Advertisement
Guest User

Untitled

a guest
Sep 18th, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.14 KB | None | 0 0
  1. import QtQuick 2.0
  2. import QtQuick.Controls 1.0
  3. import QtQuick.Layouts 1.0
  4.  
  5. ApplicationWindow {
  6.     property int margin: 11
  7.     width: mainLayout.implicitWidth + 2 * margin
  8.     height: mainLayout.implicitHeight + 2 * margin
  9.     minimumWidth: mainLayout.Layout.minimumWidth + 2 * margin
  10.     minimumHeight: mainLayout.Layout.minimumHeight + 2 * margin
  11.  
  12.     ColumnLayout {
  13.         id: mainLayout
  14.         anchors.fill: parent
  15.         anchors.margins: margin
  16.  
  17.         TextField {
  18.             id: nameField
  19.             Layout.minimumHeight: 30
  20.             Layout.fillHeight: true
  21.             Layout.fillWidth: true
  22.  
  23.             Binding { target: testData; property: "name"; value: nameField.text }
  24.             Binding { target: nameField; property: "text"; value: testData["name"] }
  25.         }
  26.  
  27.         TextField {
  28.             id: phoneField
  29.             Layout.minimumHeight: 30
  30.             Layout.fillHeight: true
  31.             Layout.fillWidth: true
  32.  
  33.             Binding { target: testData; property: "phone"; value: phoneField.text }
  34.             Binding { target: phoneField; property: "text"; value: testData["phone"] }
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement