Doc: Make Qt Gui snippets compilable - textdocument-listitems
Task-number: QTBUG-81486 Change-Id: I7bbecd3cbf086243ea3a03fb7822064bde85201c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>bb10
parent
38653f1633
commit
29949cc0f7
|
|
@ -17,5 +17,6 @@ contains(QT_BUILD_PARTS, tests) {
|
|||
textdocument-frames \
|
||||
textdocument-imagedrop \
|
||||
textdocument-imageformat \
|
||||
textdocument-images
|
||||
textdocument-images \
|
||||
textdocument-listitems
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include <QtGui>
|
||||
#include <QApplication>
|
||||
#include <QTextEdit>
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -47,11 +47,14 @@
|
|||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QTextEdit>
|
||||
#include <QTextList>
|
||||
#include <QTreeWidget>
|
||||
|
||||
MainWindow::MainWindow()
|
||||
{
|
||||
QMenu *fileMenu = new QMenu(tr("&File"));
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ public slots:
|
|||
|
||||
private:
|
||||
QString currentFile;
|
||||
QTextEdit *editor;
|
||||
QTextDocument *document;
|
||||
QTextEdit *editor = nullptr;
|
||||
QTextDocument *document = nullptr;
|
||||
QList<QTextList*> listStructures;
|
||||
QList<QTreeWidgetItem*> previousItems;
|
||||
QList<QTreeWidgetItem*> parentItems;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
HEADERS = mainwindow.h
|
||||
SOURCES = main.cpp \
|
||||
mainwindow.cpp
|
||||
TEMPLATE = lib
|
||||
TARGET = textdocument-listitems
|
||||
QT += widgets core gui
|
||||
|
||||
HEADERS = \
|
||||
mainwindow.h
|
||||
SOURCES = \
|
||||
main.cpp \
|
||||
mainwindow.cpp
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue