Материал из Wiki.crossplatform.ru
< Участник:Root(Различия между версиями)
|
|
(7 промежуточных версий не показаны.) |
Строка 1: |
Строка 1: |
- | ==QApplication== | + | На данный момент wiki.crossplatform.ru находится на стадии заполнения... |
| + | <div style="float:left; width:49%;"> |
| | | |
- | The [[Qt:Документация 4.3.2/qapplication | QApplication]] class has been split into two classes: [[Qt:Документация 4.3.2/qcoreapplication | QCoreApplication]] and [[Qt:Документация 4.3.2/qapplication | QApplication]]. The new [[Qt:Документация 4.3.2/qapplication | QApplication]] class inherits [[Qt:Документация 4.3.2/qcoreapplication | QCoreApplication]] and adds GUI-related functionality. In practice, this has no consequences for existing Qt applications.
| + | {{Блок раздела |
| + | |title = Библиотеки |
| + | |colortitle = #eeeeee |
| + | }} |
| | | |
- | In addition, the following API changes were made:
| + | </div> |
- | <ol> | + | |
- | <li>[[Qt:Документация 4.3.2/qapplication#allWidgets | QApplication::allWidgets]]() and [[Qt:Документация 4.3.2/qapplication#topLevelWidgets | QApplication::topLevelWidgets]]() used to return a pointer to a [[Qt:Документация 4.3.2/qwidget#QWidgetList-typedef | QWidgetList]]. Now they return a [[Qt:Документация 4.3.2/qwidget#QWidgetList-typedef | QWidgetList]].<br />Also, [[Qt:Документация 4.3.2/qwidget#QWidgetList-typedef | QWidgetList]] has changed from being a typedef for QPtrList<[[Qt:Документация 4.3.2/qwidget | QWidget]]> to being a typedef for [[Qt:Документация 4.3.2/qlist | QList]]<[[Qt:Документация 4.3.2/qwidget | QWidget]] *>. See the [[#qwidgetlist-section | section on QWidgetList]] below for details.<br /><br />For example, if you have code like
| + | <div style="float:right; width:49%"> |
- | <source lang="cpp-qt"> | + | |
- | QWidgetList *list = QApplication::topLevelWidgets();
| + | {{Блок раздела |
- | QWidgetListIt it(*list);
| + | |title = Языки программирования |
- | QWidget *widget;
| + | |colortitle = #eeeeee |
- | while ((widget = it.current())) {
| + | }} |
- | if (widget->inherits("MainWindow"))
| + | |
- | ((MainWindow *)widget)->updateRecentFileItems();
| + | </div> |
- | ++it;
| + | __NOTOC__ __NOEDITSECTION__ |
- | }
| + | |
- | delete list;
| + | |
- | </source>
| + | |
- | you can rewrite it as
| + | |
- | <source lang="cpp-qt">
| + | |
- | QWidgetList list = QApplication::topLevelWidgets();
| + | |
- | for (int i = 0; i < list.size(); ++i) {
| + | |
- | if (MainWindow *mainWin = qobject_cast<MainWindow>(list.at(i)))
| + | |
- | mainWin->updateRecentFileItems();
| + | |
- | }
| + | |
- | </source></li>
| + | |
- | <li>[[Qt:Документация 4.3.2/qapplication-qt3#setMainWidget | QApplication::setMainWidget]]() is no longer used. When all an application's windows are closed, the application will exit normally.</li>
| + | |
- | </ol>
| + | |
- | === Вариант ===
| + | |
- | <ul>
| + | |
- | <li>какой-то текст
| + | |
- | <pre>
| + | |
- | код строка 1
| + | |
- | код строка 2
| + | |
- | </pre>
| + | |
- | </li>
| + | |
- | <li>еще какой-то текст
| + | |
- | <pre>
| + | |
- | код строка 1
| + | |
- | код строка 2
| + | |
- | </pre>
| + | |
- | </li>
| + | |
- | </ul>
| + | |
Текущая версия на 13:30, 3 декабря 2008
На данный момент wiki.crossplatform.ru находится на стадии заполнения...
__NOTOC__ __NOEDITSECTION__