forked from qt-creator/qt-creator
Fixes: - Doc more on the tutorial.
This commit is contained in:
+16
-22
@@ -180,12 +180,12 @@
|
||||
address book is needed.
|
||||
|
||||
|
||||
\section1 Defining the AddressBook Class
|
||||
\section1 The AddressBook Class
|
||||
|
||||
The \l{examples/addressbook-sdk/part1/addressbook.h}{\c addressbook.h} file
|
||||
is used to define the \c AddressBook class.
|
||||
|
||||
We start by looking at what is already provided for us by Qt Creator. The
|
||||
Let's take a look at what is already provided for us by Qt Creator. The
|
||||
\c AddressBook class has been defined as a QWidget subclass with a
|
||||
constructor and destructor.The Q_OBJECT macro is used to indicate that this
|
||||
class uses internationalization and Qt's signals and slots features.
|
||||
@@ -195,31 +195,25 @@
|
||||
|
||||
\snippet examples/addressbook-sdk/part1/addressbook.h class definition
|
||||
|
||||
Qt Creator's project wizard provides us with the \c Ui object as a way to
|
||||
access the widgets on our form.
|
||||
Qt Creator's \gui{Project Wizard} provides us with the \c Ui object as a
|
||||
way to access the widgets on our form.
|
||||
|
||||
The \l{examples/addressbook-sdk/part1/addressbook.cpp}{\c addressbook.cpp}
|
||||
file is used to implement the \c AddressBook class. The constructor sets up
|
||||
the \c ui file; the destructor deletes it.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\snippet examples/addressbook-sdk/part1/addressbook.cpp class implementation
|
||||
|
||||
|
||||
\section1 The \c{main()} Function
|
||||
|
||||
The \l{examples/addressbook-sdk/part1/main.cpp}{\c main.cpp} file contains
|
||||
the \c{main()} function It is generated by the \gui{Project Wizard}.
|
||||
Within this function, a QApplication object, \c a, is instantiated.
|
||||
QApplication is responsible for various application-wide resources, such as
|
||||
the default font and cursor, and for running an event loop. Hence, there is
|
||||
always one QApplication objet in every GUI application using Qt.
|
||||
|
||||
\snippet examples/addressbook-sdk/part1/main.cpp main function
|
||||
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//! [class implementation]
|
||||
#include "addressbook.h"
|
||||
#include "ui_addressbook.h"
|
||||
|
||||
@@ -11,3 +12,4 @@ AddressBook::~AddressBook()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
//! [class implementation]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//! [class definition]
|
||||
#ifndef ADDRESSBOOK_H
|
||||
#define ADDRESSBOOK_H
|
||||
|
||||
@@ -21,3 +22,4 @@ private:
|
||||
};
|
||||
|
||||
#endif // ADDRESSBOOK_H
|
||||
//! [class definition]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//! [main function]
|
||||
#include <QtGui/QApplication>
|
||||
#include "addressbook.h"
|
||||
|
||||
@@ -8,3 +9,4 @@ int main(int argc, char *argv[])
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
||||
//! [main function]
|
||||
|
||||
Reference in New Issue
Block a user