diff --git a/doc/addressbook-sdk.qdoc b/doc/addressbook-sdk.qdoc index 9c4062582653d722362acd408991acb1af074006..eed7f573f3248389de3fd8f6433bbc67897d18d1 100644 --- a/doc/addressbook-sdk.qdoc +++ b/doc/addressbook-sdk.qdoc @@ -160,6 +160,8 @@ Place your widgets accordingly and save the form by choosing \gui{File | Save} or using the \key{Ctrl+S} shortcut. + A common + \section1 The AddressBook Class @@ -259,7 +261,27 @@ \section1 Placing Widgets on the Form + Now that we have the labels and input fields set up, we add push buttons to - complete the process of adding a contact. + complete the process of adding a contact. So, we begin by breaking the + existing layouts. Then, we add three push buttons. Double-click on each of + them to set their text to "Add", "Submit", and "Cancel". We now require a + vertical spacer to ensure that the push buttons will be laid out neatly; + drag one from the \gui{Widget Box}. + + Next, lay out these three push buttons and the spacer vertically, by + selecting all three of them (using the \key{Ctrl + click}) and choosing + \gui{Lay out Vertically} from the context menu. Alternatively you can click + on the ... button or use the \key{Ctrl+L} shortcut. We use the spacer as we + do not want the buttons to be evenly spaced, but arranged closer to the top + of the widget. The figure below shows the difference between using the + spacer and not using it. + + ## image + + Select all the objects on the form (use \key{Ctrl+A}) and lay them out in a + grid. + + */ diff --git a/doc/examples/addressbook-sdk/part2/addressbook.ui b/doc/examples/addressbook-sdk/part2/addressbook.ui index 466e83dda528609df7bb3bb2679081d7829b42e9..c36839330148ee0c7e26e3990d1bb25bb015921c 100644 --- a/doc/examples/addressbook-sdk/part2/addressbook.ui +++ b/doc/examples/addressbook-sdk/part2/addressbook.ui @@ -6,14 +6,22 @@ <rect> <x>0</x> <y>0</y> - <width>356</width> - <height>261</height> + <width>463</width> + <height>245</height> </rect> </property> <property name="windowTitle"> <string>AddressBook</string> </property> <widget class="QWidget" name=""> + <property name="geometry"> + <rect> + <x>10</x> + <y>10</y> + <width>413</width> + <height>225</height> + </rect> + </property> <layout class="QGridLayout" name="gridLayout"> <item row="0" column="0"> <widget class="QLabel" name="nameEdit"> @@ -38,6 +46,44 @@ <item row="1" column="1"> <widget class="QTextEdit" name="textEdit"/> </item> + <item row="1" column="2"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QPushButton" name="pushButton"> + <property name="text"> + <string>Add</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pushButton_2"> + <property name="text"> + <string>Submit</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pushButton_3"> + <property name="text"> + <string>Cancel</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> </layout> </widget> </widget>