Changeset 561 for trunk/doc/src/tutorials
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/doc/src/tutorials/addressbook-fr.qdoc
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the documentation of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 44 44 45 45 \startpage {index.html}{Qt Reference Documentation} 46 \contentspage Tutorials 46 47 \nextpage {tutorials/addressbook-fr/part1}{Chapitre 1} 47 48 48 49 \title Tutoriel "Carnet d'adresses" 49 \ingroup howto50 \ingroup tutorials51 50 \brief Une introduction à la programation d'interface graphique montrant comment construire une application simple avec Qt. 52 51 … … 221 220 comme argument optionnel. Ceci est destiné à assurer qu'il ne sera pas centré 222 221 verticalement dans la cellule (1,0). Pour un aperçu rapide des layouts de Qt, 223 consultez la section \l{Layout Classes}.222 consultez la section \l{Layout Management}. 224 223 225 224 Afin d'installer l'objet layout dans un widget, il faut appeler la méthode … … 240 239 \snippet tutorials/addressbook/part1/main.cpp main function 241 240 242 On construit un nouveau widget \c AddressBook sur l e tas en utilisant le mot-clé243 \c new et en invoquantsa méthode \l{QWidget::show()}{show()} pour l'afficher.241 On construit un nouveau widget \c AddressBook sur la pile et on invoque 242 sa méthode \l{QWidget::show()}{show()} pour l'afficher. 244 243 Cependant, le widget ne sera pas visible tant que la boucle d'évènements 245 244 n'aura pas été lancée. On démarre la boucle d'évènements en appelant la … … 247 246 par cette méthode est lui même utilisé comme valeur de retour pour la méthode 248 247 \c main(). 248 On comprend maintenant pourquoi \c AddressBook a été créé sur la pile: à la fin 249 du programme, l'objet sort du scope de la fonction \c main() et tous ses widgets enfants 250 sont supprimés, assurant ainsi qu'il n'y aura pas de fuites de mémoire. 249 251 */ 250 252 -
trunk/doc/src/tutorials/addressbook.qdoc
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the documentation of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 44 44 45 45 \startpage {index.html}{Qt Reference Documentation} 46 \contentspage Tutorials 46 47 \nextpage {tutorials/addressbook/part1}{Chapter 1} 47 48 48 49 \title Address Book Tutorial 49 \ingroup howto50 \ingroup tutorials51 50 \brief An introduction to GUI programming, showing how to put together a 52 51 simple yet fully-functioning application. … … 223 222 Notice that \c addressLabel is positioned using Qt::AlignTop as an 224 223 additional argument. This is to make sure it is not vertically centered in 225 cell (1,0). For a basic overview on Qt Layouts, refer to the \l{Layout Classes}226 document.224 cell (1,0). For a basic overview on Qt Layouts, refer to the 225 \l{Layout Management} documentation. 227 226 228 227 In order to install the layout object onto the widget, we have to invoke … … 243 242 \snippet tutorials/addressbook/part1/main.cpp main function 244 243 245 We construct a new \c AddressBook widget on the heap using the \c new246 keyword and invokeits \l{QWidget::show()}{show()} function to display it.244 We construct a new \c AddressBook widget on the stack and invoke 245 its \l{QWidget::show()}{show()} function to display it. 247 246 However, the widget will not be shown until the application's event loop 248 247 is started. We start the event loop by calling the application's 249 248 \l{QApplication::}{exec()} function; the result returned by this function 250 is used as the return value from the \c main() function. 249 is used as the return value from the \c main() function. At this point, 250 it becomes apparent why we instanciated \c AddressBook on the stack: It 251 will now go out of scope. Therefore, \c AddressBook and all its child widgets 252 will be deleted, thus preventing memory leaks. 251 253 */ 252 254 … … 297 299 We also declare two private QString objects, \c oldName and \c oldAddress. 298 300 These objects are needed to hold the name and address of the contact that 299 was last displayed, before the user clicked "Add". So, when the user clicks300 "Cancel", we can revert to displaying the details of the last contact.301 was last displayed, before the user clicked \gui Add. So, when the user clicks 302 \gui Cancel, we can revert to displaying the details of the last contact. 301 303 302 304 \section1 Implementing the AddressBook Class … … 304 306 Within the constructor of \c AddressBook, we set the \c nameLine and 305 307 \c addressText to read-only, so that we can only display but not edit 306 existing co tact details.308 existing contact details. 307 309 308 310 \dots … … 319 321 {show()} function, while the \c submitButton and \c cancelButton are 320 322 hidden by invoking \l{QPushButton::hide()}{hide()}. These two push 321 buttons will only be displayed when the user clicks "Add"and this is323 buttons will only be displayed when the user clicks \gui Add and this is 322 324 handled by the \c addContact() function discussed below. 323 325 … … 363 365 \o We extract the contact's details from \c nameLine and \c addressText 364 366 and store them in QString objects. We also validate to make sure that the 365 user did not click "Submit"with empty input fields; otherwise, a367 user did not click \gui Submit with empty input fields; otherwise, a 366 368 QMessageBox is displayed to remind the user for a name and address. 367 369 … … 375 377 376 378 If the contact already exists, again, we display a QMessageBox to inform 377 the user about this, to preventthe user from adding duplicate contacts.378 Our \c contacts object is based on key-value pairs of name and address es,379 the user about this, preventing the user from adding duplicate contacts. 380 Our \c contacts object is based on key-value pairs of name and address, 379 381 hence, we want to ensure that \e key is unique. 380 382 … … 397 399 \snippet tutorials/addressbook/part2/addressbook.cpp cancel 398 400 399 The general idea to add a contact is to give the user the flexibility to400 click "Submit" or "Cancel" at any time. The flowchart below further401 explains this concept:401 The general idea behind adding a contact is to give the user the 402 flexibility to click \gui Submit or \gui Cancel at any time. The flowchart below 403 further explains this concept: 402 404 403 405 \image addressbook-tutorial-part2-add-flowchart.png … … 455 457 456 458 The image below is our expected graphical user interface. Notice that it 457 is getting closer to our expected final output.459 is getting closer to our final application. 458 460 459 461 \image addressbook-tutorial-part3-screenshot.png … … 511 513 \o If the iterator is at the end of \c contacts, we clear the 512 514 display and return. 513 \o If the iterator is the beginning of \c contacts, we move it to515 \o If the iterator is at the beginning of \c contacts, we move it to 514 516 the end. 515 517 \o We then decrement the iterator by one. … … 530 532 \title Address Book 4 - Editing and Removing Addresses 531 533 532 In this chapter, we look at ways to modify the contents of contact stored534 In this chapter, we look at ways to modify the contents of contacts stored 533 535 in the address book application. 534 536 … … 540 542 when needed. However, this requires a little improvement, in the form of 541 543 enums. In our previous chapters, we had two modes: \c{AddingMode} and 542 \c{NavigationMode} - but they were n't defined as enums. Instead, we544 \c{NavigationMode} - but they were not defined as enums. Instead, we 543 545 enabled and disabled the corresponding buttons manually, resulting in 544 546 multiple lines of repeated code. … … 574 576 \snippet tutorials/addressbook/part4/addressbook.h mode declaration 575 577 576 Lastly, we declare \c currentMode to keep track of the current mode of the 577 enum. 578 Lastly, we declare \c currentMode to keep track of the enum's current mode. 578 579 579 580 \section1 Implementing the AddressBook Class … … 645 646 \snippet tutorials/addressbook/part4/addressbook.cpp update interface() part 1 646 647 647 For \c NavigationMode, however, we include conditions within the 648 parameters of the QPushButton::setEnabled(). This is to ensure that649 the \c editButton and \c removeButton push buttons are enabled when there650 is at least one contact in the address book; \c nextButton and \c previousButton651 are onlyenabled when there is more than one contact in the address book.648 For \c NavigationMode, however, we include conditions within the parameters 649 of the QPushButton::setEnabled() function. This is to ensure that 650 \c editButton and \c removeButton are enabled when there is at least one 651 contact in the address book; \c nextButton and \c previousButton are only 652 enabled when there is more than one contact in the address book. 652 653 653 654 \snippet tutorials/addressbook/part4/addressbook.cpp update interface() part 2 … … 696 697 \snippet tutorials/addressbook/part5/finddialog.h FindDialog header 697 698 698 We define a public function, \c getFindText() for use by classes that 699 instantiate \c FindDialog, which allows them to obtain the text 700 entered by the user. A public slot, \c findClicked(), is defined to 701 handle the search string when the user clicks the \gui Find button. 699 We define a public function, \c getFindText(), to be used by classes that 700 instantiate \c FindDialog. This function allows these classes to obtain the 701 search string entered by the user. A public slot, \c findClicked(), is also 702 defined to handle the search string when the user clicks the \gui Find 703 button. 702 704 703 705 Lastly, we define the private variables, \c findButton, \c lineEdit … … 714 716 \snippet tutorials/addressbook/part5/finddialog.cpp constructor 715 717 716 We set the layout and window title, as well as connect the signals 717 to their respective slots. Notice that \c{findButton}'s718 \l{QPushButton::clicked()}{clicked()} signal is connected to to719 \ c findClicked() and \l{QDialog::accept()}{accept()}. The720 \l{QDialog::accept()}{accept()} slot provided by QDialog hides721 the dialog and sets the result code to \l{QDialog::}{Accepted}.722 We use this function to help \c{AddressBook}'s \c findContact() function723 know when the \c FindDialog object has been closed. This will be724 further explained when discussing the\c findContact() function.718 We set the layout and window title, as well as connect the signals to their 719 respective slots. Notice that \c{findButton}'s \l{QPushButton::clicked()} 720 {clicked()} signal is connected to to \c findClicked() and 721 \l{QDialog::accept()}{accept()}. The \l{QDialog::accept()}{accept()} slot 722 provided by QDialog hides the dialog and sets the result code to 723 \l{QDialog::}{Accepted}. We use this function to help \c{AddressBook}'s 724 \c findContact() function know when the \c FindDialog object has been 725 closed. We will explain this logic in further detail when discussing the 726 \c findContact() function. 725 727 726 728 \image addressbook-tutorial-part5-signals-and-slots.png … … 816 818 \image addressbook-tutorial-part6-screenshot.png 817 819 818 Although browsing and searching for contacts are useful features, our address 819 book is not really fully ready for use until we can saving existing contacts 820 and load them again at a later time. 821 Qt provides a number of classes for \l{Input/Output and Networking}{input and output}, 822 but we have chosen to use two which are simple to use in combination: QFile and 823 QDataStream. 824 825 A QFile object represents a file on disk that can be read from and written to. 826 QFile is a subclass of the more general QIODevice class which represents many 827 different kinds of devices. 828 829 A QDataStream object is used to serialize binary data so that it can be stored 830 in a QIODevice and retrieved again later. Reading from a QIODevice and writing 831 to it is as simple as opening the stream - with the respective device as a 832 parameter - and reading from or writing to it. 820 Although browsing and searching for contacts are useful features, our 821 address book is not ready for use until we can save existing contacts and 822 load them again at a later time. 823 824 Qt provides a number of classes for \l{Input/Output and Networking} 825 {input and output}, but we have chosen to use two which are simple to use 826 in combination: QFile and QDataStream. 827 828 A QFile object represents a file on disk that can be read from and written 829 to. QFile is a subclass of the more general QIODevice class which 830 represents many different kinds of devices. 831 832 A QDataStream object is used to serialize binary data so that it can be 833 stored in a QIODevice and retrieved again later. Reading from a QIODevice 834 and writing to it is as simple as opening the stream - with the respective 835 device as a parameter - and reading from or writing to it. 836 833 837 834 838 \section1 Defining the AddressBook Class … … 872 876 \image addressbook-tutorial-part6-save.png 873 877 874 If \c fileName is not empty, we create a QFile object, \c file with878 If \c fileName is not empty, we create a QFile object, \c file, with 875 879 \c fileName. QFile works with QDataStream as QFile is a QIODevice. 876 880 … … 902 906 903 907 If \c fileName is not empty, again, we use a QFile object, \c file, and 904 attempt to open it in \l{QIODevice::}{ReadOnly} mode. In a similar way905 to our implementation of \c saveToFile(), if this attempt is unsuccessful,906 wedisplay a QMessageBox to inform the user.908 attempt to open it in \l{QIODevice::}{ReadOnly} mode. Similar to our 909 implementation of \c saveToFile(), if this attempt is unsuccessful, we 910 display a QMessageBox to inform the user. 907 911 908 912 \snippet tutorials/addressbook/part6/addressbook.cpp loadFromFile() function part2 … … 910 914 Otherwise, we instantiate a QDataStream object, \c in, set its version as 911 915 above and read the serialized data into the \c contacts data structure. 912 Note that we empty \c contacts before reading data into it to simplify the913 file reading process. A more advanced method would be to read the contacts914 into temporary QMap object, and copy only the contacts that do not already915 exist in\c contacts.916 The \c contacts object is emptied before data is read into it to simplify 917 the file reading process. A more advanced method would be to read the 918 contacts into a temporary QMap object, and copy over non-duplicate contacts 919 into \c contacts. 916 920 917 921 \snippet tutorials/addressbook/part6/addressbook.cpp loadFromFile() function part3 -
trunk/doc/src/tutorials/widgets-tutorial.qdoc
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the documentation of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 42 42 /*! 43 43 \page widgets-tutorial.html 44 45 44 \title Widgets Tutorial 46 \ingroup tutorials 47 48 \brief This tutorial covers basic usage of widgets and layouts, showing how they are used to build GUI applications. 45 \brief This tutorial covers basic usage of widgets and layouts, showing how 46 they are used to build GUI applications. 47 48 \startpage {index.html}{Qt Reference Documentation} 49 \contentspage Tutorials 50 \nextpage {tutorials/widgets/toplevel}{Creating a Window} 51 49 52 50 53 \section1 Introduction … … 69 72 the widgets it contains are automatically deleted. 70 73 71 \section1 Creating a Window 74 \section1 Writing a main Function 75 76 Many of the GUI examples in Qt follow the pattern of having a \c{main.cpp} 77 file containing code to initialize the application, and a number of other 78 source and header files containing the application logic and custom GUI 79 components. 80 81 A typical \c main() function, written in \c{main.cpp}, looks like this: 82 83 \snippet doc/src/snippets/widgets-tutorial/template.cpp main.cpp body 84 85 We first construct a QApplication object which is configured using any 86 arguments passed in from the command line. After any widgets have been 87 created and shown, we call QApplication::exec() to start Qt's event loop. 88 Control passes to Qt until this function returns, at which point we return 89 the value we obtain from this function. 90 91 In each part of this tutorial, we provide an example that is written 92 entirely within a \c main() function. In more sophisticated examples, the 93 code to set up widgets and layouts is written in other parts of the 94 example. For example, the GUI for a main window may be set up in the 95 constructor of a QMainWindow subclass. 96 97 The \l{Widgets examples} are a good place to look for 98 more complex and complete examples and applications. 99 100 \section1 Building Examples and Tutorials 101 102 If you obtained a binary package of Qt or compiled it yourself, the 103 examples described in this tutorial should already be ready to run. 104 However, if you may wish to modify them and recompile them, you need to 105 perform the following steps: 106 107 \list 1 108 \o At the command line, enter the directory containing the example you 109 wish to recompile. 110 \o Type \c qmake and press \key{Return}. If this doesn't work, make sure 111 that the executable is on your path, or enter its full location. 112 \o On Linux/Unix and Mac OS X, type \c make and press \key{Return}; 113 on Windows with Visual Studio, type \c nmake and press \key{Return}. 114 \endlist 115 116 An executable file should have been created within the current directory. 117 On Windows, this file may be located within a \c debug or \c release 118 subdirectory. You can run this file to see the example code at work. 119 */ 120 121 /*! 122 \page widgets-tutorial-toplevel.html 123 \contentspage {Widgets Tutorial}{Contents} 124 \previouspage {Widgets Tutorial} 125 \nextpage {Widgets Tutorial - Child Widgets} 126 \example tutorials/widgets/toplevel 127 \title Widgets Tutorial - Creating a Window 72 128 73 129 If a widget is created without a parent, it is treated as a window, or … … 83 139 <tr class="qt-code"><td> 84 140 \endraw 85 \snippet snippets/widgets-tutorial/toplevel/main.cpp create, resize and show141 \snippet tutorials/widgets/toplevel/main.cpp main program 86 142 \raw HTML 87 143 </td><td align="right"> … … 93 149 \endraw 94 150 95 We can add a child widget to this window by passing \c window as the 96 parent to its constructor. In this case, we add a button to the window 97 and place it in a specific location: 98 99 \raw HTML 100 <table align="left" width="100%"> 101 <tr class="qt-code"><td> 102 \endraw 103 \snippet snippets/widgets-tutorial/childwidget/main.cpp create, position and show 151 To create a real GUI, we need to place widgets inside the window. To do 152 this, we pass a QWidget instance to a widget's constructor, as we will 153 demonstrate in the next part of this tutorial. 154 */ 155 156 /*! 157 \page widgets-tutorial-childwidget.html 158 \contentspage {Widgets Tutorial}{Contents} 159 \previouspage {Widgets Tutorial - Creating a Window} 160 \nextpage {Widgets Tutorial - Using Layouts} 161 \example tutorials/widgets/childwidget 162 \title Widgets Tutorial - Child Widgets 163 164 We can add a child widget to the window created in the previous example by 165 passing \c window as the parent to its constructor. In this case, we add a 166 button to the window and place it in a specific location: 167 168 \raw HTML 169 <table align="left" width="100%"> 170 <tr class="qt-code"><td> 171 \endraw 172 \snippet tutorials/widgets/childwidget/main.cpp main program 104 173 \raw HTML 105 174 </td><td align="right"> … … 113 182 The button is now a child of the window and will be deleted when the 114 183 window is destroyed. Note that hiding or closing the window does not 115 automatically destroy it. 116 117 \section1 Using Layouts 184 automatically destroy it. It will be destroyed when the example exits. 185 */ 186 187 /*! 188 \page widgets-tutorial-windowlayout.html 189 \contentspage {Widgets Tutorial}{Contents} 190 \previouspage {Widgets Tutorial - Child Widgets} 191 \nextpage {Widgets Tutorial - Nested Layouts} 192 \example tutorials/widgets/windowlayout 193 \title Widgets Tutorial - Using Layouts 118 194 119 195 Usually, child widgets are arranged inside a window using layout objects … … 126 202 <tr class="qt-code"><td> 127 203 \endraw 128 \snippet snippets/widgets-tutorial/windowlayout/main.cpp create, lay out widgets and show204 \snippet tutorials/widgets/windowlayout/main.cpp main program 129 205 \raw HTML 130 206 </td><td align="right"> … … 150 226 widgets and the layout itself are ''reparented'' to become children of 151 227 the window. 228 */ 229 230 /*! 231 \page widgets-tutorial-nestedlayouts.html 232 \contentspage {Widgets Tutorial}{Contents} 233 \previouspage {Widgets Tutorial - Using Layouts} 234 \example tutorials/widgets/nestedlayouts 235 \title Widgets Tutorial - Nested Layouts 152 236 153 237 Just as widgets can contain other widgets, layouts can be used to provide … … 156 240 showing the results of a query. 157 241 158 \raw HTML 159 <table align="left" width="100%"> 160 <tr class="qt-code"><td> 161 \endraw 162 \snippet snippets/widgets-tutorial/nestedlayouts/main.cpp create, lay out widgets and show 242 We achieve this by creating two layouts: \c{queryLayout} is a QHBoxLayout 243 that contains QLabel and QLineEdit widgets placed side-by-side; 244 \c{mainLayout} is a QVBoxLayout that contains \c{queryLayout} and a 245 QTableView arranged vertically. 246 247 \raw HTML 248 <table align="left" width="100%"> 249 <tr class="qt-code"><td> 250 \endraw 251 \snippet tutorials/widgets/nestedlayouts/main.cpp first part 252 \snippet tutorials/widgets/nestedlayouts/main.cpp last part 163 253 \raw HTML 164 254 </td><td align="right"> … … 169 259 </table> 170 260 \endraw 261 262 Note that we call the \c{mainLayout}'s \l{QBoxLayout::}{addLayout()} 263 function to insert the \c{queryLayout} above the \c{resultView} table. 264 265 We have omitted the code that sets up the model containing the data shown 266 by the QTableView widget, \c resultView. For completeness, we show this below. 171 267 172 268 As well as QHBoxLayout and QVBoxLayout, Qt also provides QGridLayout 173 269 and QFormLayout classes to help with more complex user interfaces. 174 */ 270 These can be seen if you run \l{Qt Designer}. 271 272 \section1 Setting up the Model 273 274 In the code above, we did not show where the table's data came from 275 because we wanted to concentrate on the use of layouts. Here, we see 276 that the model holds a number of items corresponding to rows, each of 277 which is set up to contain data for two columns. 278 279 \snippet tutorials/widgets/nestedlayouts/main.cpp set up the model 280 281 The use of models and views is covered in the 282 \l{Item Views Examples} and in the \l{Model/View Programming} overview. 283 */
Note:
See TracChangeset
for help on using the changeset viewer.