Doc: Compile textdocument-tables snippets

Minor code cleanup in passing.

Task-number: QTBUG-81486
Change-Id: I23f8b3a22f627050582c69c81e5e0b85b5e45768
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
bb10
Paul Wicking 2020-08-29 14:10:22 +02:00
parent e81383eb09
commit b16b7d8879
5 changed files with 18 additions and 12 deletions

View File

@ -23,5 +23,6 @@ contains(QT_BUILD_PARTS, tests) {
textdocument-lists \
textdocument-printing \
textdocument-resources \
textdocument-selections
textdocument-selections \
textdocument-tables
}

View File

@ -47,11 +47,10 @@
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);

View File

@ -131,9 +131,9 @@ MainWindow::MainWindow()
}
//! [8]
connect(saveAction, &QAction:triggered, this, &MainWindow::saveFile);
connect(quitAction, &QAction:triggered, this, &MainWindow::close);
connect(showTableAction, &QAction:triggered, this, &MainWindow::showTable);
connect(saveAction, &QAction::triggered, this, &MainWindow::saveFile);
connect(quitAction, &QAction::triggered, this, &MainWindow::close);
connect(showTableAction, &QAction::triggered, this, &MainWindow::showTable);
setCentralWidget(editor);
setWindowTitle(tr("Text Document Tables"));

View File

@ -47,7 +47,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef WINDOW_H
#define WINDOW_H
@ -69,7 +68,7 @@ public slots:
private:
bool writeXml(const QString &fileName);
QTextEdit *editor;
QTextEdit *editor = nullptr;
};
#endif

View File

@ -1,3 +1,10 @@
SOURCES = main.cpp \
mainwindow.cpp
HEADERS = mainwindow.h
TEMPLATE = lib
TARGET = textdocument-tables_snippets
QT += core gui widgets
HEADERS = \
mainwindow.h
SOURCES = \
main.cpp \
mainwindow.cpp