|
|
Строка 1: |
Строка 1: |
- | ==QApplication== | + | {|style="border: 1px solid #aaa; padding: 1em; margin: auto; width:100%;" |
| + | | <div style=" <!-- border: 1px solid #aaa; --> float:left; ">{{{logo}}}</div> |
| + | <div style=" <!-- border: 1px solid #aaa; --> font-family:sans-serif; font-size:160%; font-weight:bold; text-align:center; color:#000; padding-left:1em; padding-top:0.2em; padding-bottom:0.2em; ">Wiki посвящённая кроссплатформенному программированию</div> |
| + | <div style=" <!-- border: 1px solid #aaa; --> text-align:center; font-size:100%;"> {{{описание}}}</div> |
| + | |} |
| | | |
- | 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.
| + | <br style="clear:both;"> |
| + | На данный момент здесь затронуты такие библиотеки и языки программирования как: |
| + | <div style="float:left; width:49%;"> |
| | | |
- | In addition, the following API changes were made:
| + | {{Блок раздела |
- | <ol>
| + | |title = Библиотеки |
- | <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
| + | |colortitle = #cef3ce |
- | <source lang="cpp-qt">
| + | |colorborder = #a3bfb1 |
- | QWidgetList *list = QApplication::topLevelWidgets();
| + | |colorback = #f5fffa |
- | QWidgetListIt it(*list);
| + | }} |
- | QWidget *widget;
| + | |
- | while ((widget = it.current())) {
| + | </div> |
- | if (widget->inherits("MainWindow"))
| + | |
- | ((MainWindow *)widget)->updateRecentFileItems();
| + | <div style="float:right; width:49%"> |
- | ++it;
| + | |
- | }
| + | {{Блок раздела |
- | delete list;
| + | |title = Языки программирования |
- | </source> | + | |colortitle = #cecef3 |
- | you can rewrite it as
| + | |colorborder = #a3b0bf |
- | <source lang="cpp-qt"> | + | |colorback = #f5faff |
- | QWidgetList list = QApplication::topLevelWidgets();
| + | }} |
- | for (int i = 0; i < list.size(); ++i) {
| + | |
- | if (MainWindow *mainWin = qobject_cast<MainWindow>(list.at(i)))
| + | </div> |
- | mainWin->updateRecentFileItems();
| + | __NOTOC__ __NOEDITSECTION__ |
- | }
| + | |
- | </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>
| + | |
- | === Вариант === | + | |
- | #какой-то текст | + | |
- | :<pre>
| + | |
- | : код строка 1
| + | |
- | : код строка 2
| + | |
- | :</pre>
| + | |
- | #еще какой-то текст
| + | |
- | :<pre>
| + | |
- | : код строка 1
| + | |
- | : код строка 2
| + | |
- | :</pre>
| + | |