Doc - polishing more of part 2

This commit is contained in:
Kavindra Devi Palaraja
2009-05-29 18:32:36 +02:00
parent 3cc335618e
commit cd21181fe0
2 changed files with 71 additions and 3 deletions

View File

@@ -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.
*/

View File

@@ -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>