From fce8978426b9dbad8ea60412ba34d855a9c90a24 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 15 Sep 2017 01:17:15 -0700 Subject: Fix exclusion condition for assistant examples The actual reason why they were disabled for WinRT is because that platform lacks process support (see 40e060d). Therefore, this fixes the build for VxWorks as well. Change-Id: Id411c467f4c3bbed45f7bd3bd8d4881c72f3b466 Reviewed-by: Tuomas Heimonen Reviewed-by: Lars Knoll --- examples/examples.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/examples.pro b/examples/examples.pro index 69365d18d..8fb90f846 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs qtHaveModule(widgets): SUBDIRS += help designer linguist uitools assistant -winrt: SUBDIRS -= assistant designer +!qtConfig(process): SUBDIRS -= assistant +winrt: SUBDIRS -= designer -- cgit v1.2.3 From ad18484063a41328d0e72c75cda151128977e0d8 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 14 Sep 2017 10:34:09 +0200 Subject: Improve SimpleTextViewer example documentation Change-Id: I6da730993b6e9a0fd3b75705547260aef638048d Reviewed-by: Leena Miettinen --- examples/assistant/doc/src/simpletextviewer.qdoc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'examples') diff --git a/examples/assistant/doc/src/simpletextviewer.qdoc b/examples/assistant/doc/src/simpletextviewer.qdoc index 7afef1a78..4954fbfc5 100644 --- a/examples/assistant/doc/src/simpletextviewer.qdoc +++ b/examples/assistant/doc/src/simpletextviewer.qdoc @@ -34,15 +34,14 @@ \image simpletextviewer-example.png - This is done in two stages. Firstly, documentation is created and \QA - is customized; secondly, the functionality to launch and control - \QA is added to the application. + This example shows how to use \QA as a customized help viewer in + a custom application. This is done in two stages. Firstly, + documentation is created and \QA is customized; secondly, the + functionality to launch and control \QA is added to the application. The Simple Text Viewer application lets the user select and view - existing files. - - The application provides its own custom documentation that is - available from the \gui Help menu in the main window's menu bar + existing files. The application provides its own custom documentation + that is available from the \gui Help menu in the main window's menu bar or by clicking the \gui Help button in the application's find file dialog. @@ -353,8 +352,8 @@ The implementation for \c showDocumentation() is now straightforward. Firstly, we ensure that \QA is running, then we send the request to display the \a page via the \c stdin channel of the process. It is very - important here that the command is terminated by the '\\0' character - followed by an end of line token to flush the channel. + important here that the command is terminated by an end of line token + to flush the channel. \snippet simpletextviewer/assistant.cpp 1 -- cgit v1.2.3 From b7c16e4f454804929be6ed6ec7053b66822d8463 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 12 Sep 2017 16:07:42 +0200 Subject: Assistant Examples: Unify #include style Change-Id: I72c419123e27e06ae30fa2042fb8bb6ddbab9da4 Reviewed-by: Jarek Kobus --- examples/assistant/remotecontrol/main.cpp | 5 +++-- examples/assistant/remotecontrol/remotecontrol.cpp | 15 ++++++------- examples/assistant/remotecontrol/remotecontrol.h | 5 +++-- examples/assistant/simpletextviewer/assistant.cpp | 15 ++++++------- examples/assistant/simpletextviewer/assistant.h | 4 ++-- .../assistant/simpletextviewer/findfiledialog.cpp | 26 +++++++++++----------- .../assistant/simpletextviewer/findfiledialog.h | 4 ++-- examples/assistant/simpletextviewer/main.cpp | 6 ++--- examples/assistant/simpletextviewer/mainwindow.cpp | 20 ++++++++--------- examples/assistant/simpletextviewer/mainwindow.h | 9 ++++++-- examples/assistant/simpletextviewer/textedit.cpp | 8 +++---- examples/assistant/simpletextviewer/textedit.h | 6 ++--- 12 files changed, 64 insertions(+), 59 deletions(-) (limited to 'examples') diff --git a/examples/assistant/remotecontrol/main.cpp b/examples/assistant/remotecontrol/main.cpp index 3652e6251..3ab883268 100644 --- a/examples/assistant/remotecontrol/main.cpp +++ b/examples/assistant/remotecontrol/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,9 +48,10 @@ ** ****************************************************************************/ -#include #include "remotecontrol.h" +#include + int main(int argc, char *argv[]) { Q_INIT_RESOURCE(remotecontrol); diff --git a/examples/assistant/remotecontrol/remotecontrol.cpp b/examples/assistant/remotecontrol/remotecontrol.cpp index 3ee8bb27d..916a08efd 100644 --- a/examples/assistant/remotecontrol/remotecontrol.cpp +++ b/examples/assistant/remotecontrol/remotecontrol.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,15 +48,14 @@ ** ****************************************************************************/ -#include -#include -#include -#include - -#include - #include "remotecontrol.h" +#include +#include +#include +#include +#include + RemoteControl::RemoteControl(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags) { diff --git a/examples/assistant/remotecontrol/remotecontrol.h b/examples/assistant/remotecontrol/remotecontrol.h index 16a9f9441..5054f59f8 100644 --- a/examples/assistant/remotecontrol/remotecontrol.h +++ b/examples/assistant/remotecontrol/remotecontrol.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -51,9 +51,10 @@ #ifndef REMOTECONTROL_H #define REMOTECONTROL_H -#include #include "ui_remotecontrol.h" +#include + QT_BEGIN_NAMESPACE class QProcess; QT_END_NAMESPACE; diff --git a/examples/assistant/simpletextviewer/assistant.cpp b/examples/assistant/simpletextviewer/assistant.cpp index a9b2776b6..b7bbe6a06 100644 --- a/examples/assistant/simpletextviewer/assistant.cpp +++ b/examples/assistant/simpletextviewer/assistant.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,15 +48,14 @@ ** ****************************************************************************/ -#include -#include -#include -#include - -#include - #include "assistant.h" +#include +#include +#include +#include +#include + Assistant::Assistant() : proc(0) { diff --git a/examples/assistant/simpletextviewer/assistant.h b/examples/assistant/simpletextviewer/assistant.h index fce67f0da..dada5a1ee 100644 --- a/examples/assistant/simpletextviewer/assistant.h +++ b/examples/assistant/simpletextviewer/assistant.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -51,7 +51,7 @@ #ifndef ASSISTANT_H #define ASSISTANT_H -#include +#include QT_BEGIN_NAMESPACE class QProcess; diff --git a/examples/assistant/simpletextviewer/findfiledialog.cpp b/examples/assistant/simpletextviewer/findfiledialog.cpp index b34b8aeae..cf64e9a6a 100644 --- a/examples/assistant/simpletextviewer/findfiledialog.cpp +++ b/examples/assistant/simpletextviewer/findfiledialog.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,21 +48,21 @@ ** ****************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "findfiledialog.h" #include "assistant.h" +#include "findfiledialog.h" #include "textedit.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + //! [0] FindFileDialog::FindFileDialog(TextEdit *editor, Assistant *assistant) : QDialog(editor) diff --git a/examples/assistant/simpletextviewer/findfiledialog.h b/examples/assistant/simpletextviewer/findfiledialog.h index 2d5b1378a..bc0e22409 100644 --- a/examples/assistant/simpletextviewer/findfiledialog.h +++ b/examples/assistant/simpletextviewer/findfiledialog.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -51,7 +51,7 @@ #ifndef FINDFILEDIALOG_H #define FINDFILEDIALOG_H -#include +#include QT_BEGIN_NAMESPACE class QComboBox; diff --git a/examples/assistant/simpletextviewer/main.cpp b/examples/assistant/simpletextviewer/main.cpp index 30c886f5a..55c1039f8 100644 --- a/examples/assistant/simpletextviewer/main.cpp +++ b/examples/assistant/simpletextviewer/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,10 +48,10 @@ ** ****************************************************************************/ -#include - #include "mainwindow.h" +#include + int main(int argc, char *argv[]) { QApplication app(argc, argv); diff --git a/examples/assistant/simpletextviewer/mainwindow.cpp b/examples/assistant/simpletextviewer/mainwindow.cpp index 0660a0426..5b0564ca1 100644 --- a/examples/assistant/simpletextviewer/mainwindow.cpp +++ b/examples/assistant/simpletextviewer/mainwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,18 +48,18 @@ ** ****************************************************************************/ -#include -#include -#include -#include -#include -#include - -#include "mainwindow.h" -#include "findfiledialog.h" #include "assistant.h" +#include "findfiledialog.h" +#include "mainwindow.h" #include "textedit.h" +#include +#include +#include +#include +#include +#include + // ![0] MainWindow::MainWindow() { diff --git a/examples/assistant/simpletextviewer/mainwindow.h b/examples/assistant/simpletextviewer/mainwindow.h index 7026b5eca..e8e917ea3 100644 --- a/examples/assistant/simpletextviewer/mainwindow.h +++ b/examples/assistant/simpletextviewer/mainwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -51,7 +51,12 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include +#include + +QT_BEGIN_NAMESPACE +class QAction; +class QMenu; +QT_END_NAMESPACE class Assistant; class TextEdit; diff --git a/examples/assistant/simpletextviewer/textedit.cpp b/examples/assistant/simpletextviewer/textedit.cpp index 81cb3251a..18cd767eb 100644 --- a/examples/assistant/simpletextviewer/textedit.cpp +++ b/examples/assistant/simpletextviewer/textedit.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,11 +48,11 @@ ** ****************************************************************************/ -#include -#include - #include "textedit.h" +#include +#include + TextEdit::TextEdit(QWidget *parent) : QTextEdit(parent) { diff --git a/examples/assistant/simpletextviewer/textedit.h b/examples/assistant/simpletextviewer/textedit.h index 70bcf75af..d44fbb5f5 100644 --- a/examples/assistant/simpletextviewer/textedit.h +++ b/examples/assistant/simpletextviewer/textedit.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -51,8 +51,8 @@ #ifndef TEXTEDIT_H #define TEXTEDIT_H -#include -#include +#include +#include class TextEdit : public QTextEdit { -- cgit v1.2.3 From c1bd55b42e3c6ac7ccebce0452b0c1f048f2d5b8 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 12 Sep 2017 16:09:38 +0200 Subject: Assistant Examples: Remove stray ; Change-Id: I4374610fa78d2c42fc8ca88d80cd1f50a431d046 Reviewed-by: Jarek Kobus --- examples/assistant/remotecontrol/remotecontrol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/assistant/remotecontrol/remotecontrol.h b/examples/assistant/remotecontrol/remotecontrol.h index 5054f59f8..b1a54e29b 100644 --- a/examples/assistant/remotecontrol/remotecontrol.h +++ b/examples/assistant/remotecontrol/remotecontrol.h @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE class QProcess; -QT_END_NAMESPACE; +QT_END_NAMESPACE class RemoteControl : public QMainWindow { -- cgit v1.2.3 From a20b68a6735a9191fe18860b29689371d06a5586 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 12 Sep 2017 16:11:54 +0200 Subject: Assistant Examples: Use nullptr Change-Id: Icfede0f02c6651aa39e2a0a9d5b586a5bb7037e9 Reviewed-by: Jarek Kobus --- examples/assistant/remotecontrol/remotecontrol.h | 2 +- examples/assistant/simpletextviewer/assistant.cpp | 2 +- examples/assistant/simpletextviewer/findfiledialog.h | 2 +- examples/assistant/simpletextviewer/textedit.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/assistant/remotecontrol/remotecontrol.h b/examples/assistant/remotecontrol/remotecontrol.h index b1a54e29b..40e370f71 100644 --- a/examples/assistant/remotecontrol/remotecontrol.h +++ b/examples/assistant/remotecontrol/remotecontrol.h @@ -64,7 +64,7 @@ class RemoteControl : public QMainWindow Q_OBJECT public: - RemoteControl(QWidget *parent = 0, Qt::WindowFlags flags = 0); + RemoteControl(QWidget *parent = nullptr, Qt::WindowFlags flags = 0); ~RemoteControl(); private: diff --git a/examples/assistant/simpletextviewer/assistant.cpp b/examples/assistant/simpletextviewer/assistant.cpp index b7bbe6a06..9e668bb7f 100644 --- a/examples/assistant/simpletextviewer/assistant.cpp +++ b/examples/assistant/simpletextviewer/assistant.cpp @@ -108,7 +108,7 @@ bool Assistant::startAssistant() proc->start(app, args); if (!proc->waitForStarted()) { - QMessageBox::critical(0, QObject::tr("Simple Text Viewer"), + QMessageBox::critical(nullptr, QObject::tr("Simple Text Viewer"), QObject::tr("Unable to launch Qt Assistant (%1)").arg(app)); return false; } diff --git a/examples/assistant/simpletextviewer/findfiledialog.h b/examples/assistant/simpletextviewer/findfiledialog.h index bc0e22409..6ca57b061 100644 --- a/examples/assistant/simpletextviewer/findfiledialog.h +++ b/examples/assistant/simpletextviewer/findfiledialog.h @@ -76,7 +76,7 @@ public: private slots: void browse(); void help(); - void openFile(QTreeWidgetItem *item = 0); + void openFile(QTreeWidgetItem *item = nullptr); void update(); private: diff --git a/examples/assistant/simpletextviewer/textedit.h b/examples/assistant/simpletextviewer/textedit.h index d44fbb5f5..b1cb243fb 100644 --- a/examples/assistant/simpletextviewer/textedit.h +++ b/examples/assistant/simpletextviewer/textedit.h @@ -59,7 +59,7 @@ class TextEdit : public QTextEdit Q_OBJECT public: - TextEdit(QWidget *parent = 0); + TextEdit(QWidget *parent = nullptr); void setContents(const QString &fileName); private: -- cgit v1.2.3 From bca0d910b3b1f8454b60a5d6420a2ac836ecdedb Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 12 Sep 2017 16:14:09 +0200 Subject: RemoteControl example: Remove superfluous connect quitOnLastWindowClosed is the default. Change-Id: Ic2afbef731895f2fce17050655d11facd51736ab Reviewed-by: Jarek Kobus --- examples/assistant/remotecontrol/main.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'examples') diff --git a/examples/assistant/remotecontrol/main.cpp b/examples/assistant/remotecontrol/main.cpp index 3ab883268..f6c63d3f1 100644 --- a/examples/assistant/remotecontrol/main.cpp +++ b/examples/assistant/remotecontrol/main.cpp @@ -59,6 +59,5 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); RemoteControl w; w.show(); - a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); return a.exec(); } -- cgit v1.2.3 From 736c32abc91b8a2273f3c408d379d7ddd5f36610 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 12 Sep 2017 16:15:09 +0200 Subject: RemoteControl example: Remove Q_INIT_RESOURCE For exectuables, resources are initialized by default. Change-Id: I3d1aea0afd9cc01996d4b0a496ac9a01787fce4a Reviewed-by: Jarek Kobus --- examples/assistant/remotecontrol/main.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'examples') diff --git a/examples/assistant/remotecontrol/main.cpp b/examples/assistant/remotecontrol/main.cpp index f6c63d3f1..ee5201b79 100644 --- a/examples/assistant/remotecontrol/main.cpp +++ b/examples/assistant/remotecontrol/main.cpp @@ -54,8 +54,6 @@ int main(int argc, char *argv[]) { - Q_INIT_RESOURCE(remotecontrol); - QApplication a(argc, argv); RemoteControl w; w.show(); -- cgit v1.2.3