forked from qt-creator/qt-creator
Fixes: Doc - more of Part 3
RevBy: TrustMe
This commit is contained in:
committed by
con
parent
388c24ba78
commit
6c14c86fab
@@ -272,10 +272,11 @@
|
|||||||
We shall continue with the form we had from the last chapter; we have the
|
We shall continue with the form we had from the last chapter; we have the
|
||||||
labels and input fields set up, but we need to add push buttons to complete
|
labels and input fields set up, but we need to add push buttons to complete
|
||||||
the process of adding a contact. So, we begin by breaking the existing
|
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
|
layouts: select \gui{Break Layout} from the context menu. You might have to
|
||||||
set their text to "Add", "Submit", and "Cancel". We now require a vertical
|
do a \gui{Select All} with \key{Ctrl+A} first.. Then, we add three push
|
||||||
spacer to ensure that the push buttons will be laid out neatly; drag one
|
buttons. Double-click on each of them to set their text to "Add", "Submit",
|
||||||
from the \gui{Widget Box}.
|
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
|
Next, lay out these three push buttons and the spacer vertically, by
|
||||||
selecting all three of them (using the \key{Ctrl + click}) and choosing
|
selecting all three of them (using the \key{Ctrl + click}) and choosing
|
||||||
@@ -447,6 +448,21 @@
|
|||||||
|
|
||||||
\section1 Placing Widgets on the Form
|
\section1 Placing Widgets on the Form
|
||||||
|
|
||||||
|
So far, our application allows us to add new contacts. However, we also
|
||||||
|
need to traverse the existing contacts. To do so, we add two push buttons
|
||||||
|
at the bottom of our application and name them: \gui Next and
|
||||||
|
\gui Previous. Place them in a horizontal layout.
|
||||||
|
|
||||||
|
To lay the buttons out, we begin by breaking our top level layout. Simply
|
||||||
|
right-click on \c AddressBook in the \gui{Object Inspector} and then select
|
||||||
|
\gui{Lay out|Break Layout} Then we drag two push buttons onto the form and
|
||||||
|
name them accordingly. The buttons' \c objectName should be \c nextButton
|
||||||
|
and \c previousButton, respectively.
|
||||||
|
|
||||||
\section1 The AddressBook Class
|
\section1 The AddressBook Class
|
||||||
|
|
||||||
|
In order to add navigation functions to the address book application, we
|
||||||
|
need to add two more slots to our \c AddressBook class: \c next() and
|
||||||
|
\c previous().
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>600</width>
|
<width>600</width>
|
||||||
<height>400</height>
|
<height>294</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
<widget class="QWidget" name="layoutWidget">
|
<widget class="QWidget" name="layoutWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>9</x>
|
||||||
<y>20</y>
|
<y>9</y>
|
||||||
<width>413</width>
|
<width>413</width>
|
||||||
<height>225</height>
|
<height>225</height>
|
||||||
</rect>
|
</rect>
|
||||||
|
|||||||
Reference in New Issue
Block a user