summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2020-12-01 13:37:05 +0100
committerKai Koehne <kai.koehne@qt.io>2020-12-01 14:30:35 +0000
commit3bde0400196d52238da5c170b01fac4cf718ab31 (patch)
tree22a2dc8365352fcbb71ff56c3069a5554fe6f61b /doc/src/snippets
parent629a90fa229f9c2b759c1fa44fbeccf9956a8300 (diff)
Remove snippets for widgets-tutorial
The documentation got removed in 9682ba54b Pick-to: 6.0 Change-Id: I42514b2ddcc54c7a8aad7779d34aca12378965fd Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'doc/src/snippets')
-rw-r--r--doc/src/snippets/widgets-tutorial/childwidget/childwidget.pro1
-rw-r--r--doc/src/snippets/widgets-tutorial/childwidget/main.cpp67
-rw-r--r--doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp98
-rw-r--r--doc/src/snippets/widgets-tutorial/nestedlayouts/nestedlayouts.pro1
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/copy.pngbin1633 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/create.pngbin459 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/cut.pngbin9554 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/edit_redo.pngbin7463 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/edit_undo.pngbin8424 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/exit.pngbin379 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/font.pngbin6983 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/info.pngbin557 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/main.cpp75
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/new.pngbin7422 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/notepad.cpp190
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/notepad.h112
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/notepad.pro34
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/notepad.qrc19
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/notepad.ui196
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/open.pngbin5437 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/paste.pngbin3597 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/pencil.pngbin3780 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/print.pngbin331 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/save.pngbin2699 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/notepad/save_as.pngbin8209 -> 0 bytes
-rw-r--r--doc/src/snippets/widgets-tutorial/toplevel/main.cpp63
-rw-r--r--doc/src/snippets/widgets-tutorial/toplevel/toplevel.pro1
-rw-r--r--doc/src/snippets/widgets-tutorial/windowlayout/main.cpp69
-rw-r--r--doc/src/snippets/widgets-tutorial/windowlayout/windowlayout.pro1
29 files changed, 0 insertions, 927 deletions
diff --git a/doc/src/snippets/widgets-tutorial/childwidget/childwidget.pro b/doc/src/snippets/widgets-tutorial/childwidget/childwidget.pro
deleted file mode 100644
index bba41b9c1..000000000
--- a/doc/src/snippets/widgets-tutorial/childwidget/childwidget.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = main.cpp
diff --git a/doc/src/snippets/widgets-tutorial/childwidget/main.cpp b/doc/src/snippets/widgets-tutorial/childwidget/main.cpp
deleted file mode 100644
index d60d4b2e2..000000000
--- a/doc/src/snippets/widgets-tutorial/childwidget/main.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- QWidget *window = new QWidget();
- window->resize(320, 240);
- window->setWindowTitle(tr("Child widget"));
- window->show();
-
-//! [create, position and show]
- QPushButton *button = new QPushButton(tr("Press me"), window);
- button->move(100, 100);
- button->show();
-//! [create, position and show]
- return app.exec();
-}
diff --git a/doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp b/doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp
deleted file mode 100644
index 5d321a5f8..000000000
--- a/doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- QWidget *window = new QWidget();
-//! [create, lay out widgets and show]
- QLabel *queryLabel = new QLabel(tr("Query:"));
- QLineEdit *queryEdit = new QLineEdit();
- QTableView *resultView = new QTableView();
-
- QHBoxLayout *queryLayout = new QHBoxLayout();
- queryLayout->addWidget(queryLabel);
- queryLayout->addWidget(queryEdit);
-
- QVBoxLayout *mainLayout = new QVBoxLayout();
- mainLayout->addLayout(queryLayout);
- mainLayout->addWidget(resultView);
- window->setLayout(mainLayout);
-//! [create, lay out widgets and show]
-
- QStandardItemModel model;
- model.setHorizontalHeaderLabels(QStringList() << tr("Name") << tr("Office"));
- QList<QStringList> rows = QList<QStringList>()
- << (QStringList() << "Verne Nilsen" << "123")
- << (QStringList() << "Carlos Tang" << "77")
- << (QStringList() << "Bronwyn Hawcroft" << "119")
- << (QStringList() << "Alessandro Hanssen" << "32")
- << (QStringList() << "Andrew John Bakken" << "54")
- << (QStringList() << "Vanessa Weatherley" << "85")
- << (QStringList() << "Rebecca Dickens" << "17")
- << (QStringList() << "David Bradley" << "42")
- << (QStringList() << "Knut Walters" << "25")
- << (QStringList() << "Andrea Jones" << "34");
- foreach (const QStringList &row, rows) {
- QList<QStandardItem *> items;
- foreach (const QString &text, row)
- items.append(new QStandardItem(text));
- model.appendRow(items);
- }
-
- resultView->setModel(&model);
- resultView->verticalHeader()->hide();
- resultView->horizontalHeader()->setStretchLastSection(true);
- window->setWindowTitle(tr("Nested layouts"));
- window->show();
- return app.exec();
-}
diff --git a/doc/src/snippets/widgets-tutorial/nestedlayouts/nestedlayouts.pro b/doc/src/snippets/widgets-tutorial/nestedlayouts/nestedlayouts.pro
deleted file mode 100644
index bba41b9c1..000000000
--- a/doc/src/snippets/widgets-tutorial/nestedlayouts/nestedlayouts.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = main.cpp
diff --git a/doc/src/snippets/widgets-tutorial/notepad/copy.png b/doc/src/snippets/widgets-tutorial/notepad/copy.png
deleted file mode 100644
index cb3442c04..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/copy.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/create.png b/doc/src/snippets/widgets-tutorial/notepad/create.png
deleted file mode 100644
index fdfd4b438..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/create.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/cut.png b/doc/src/snippets/widgets-tutorial/notepad/cut.png
deleted file mode 100644
index 74b15301f..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/cut.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/edit_redo.png b/doc/src/snippets/widgets-tutorial/notepad/edit_redo.png
deleted file mode 100644
index 8a7725463..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/edit_redo.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/edit_undo.png b/doc/src/snippets/widgets-tutorial/notepad/edit_undo.png
deleted file mode 100644
index 852f5e3b2..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/edit_undo.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/exit.png b/doc/src/snippets/widgets-tutorial/notepad/exit.png
deleted file mode 100644
index 677d4deef..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/exit.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/font.png b/doc/src/snippets/widgets-tutorial/notepad/font.png
deleted file mode 100644
index 925e501c0..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/font.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/info.png b/doc/src/snippets/widgets-tutorial/notepad/info.png
deleted file mode 100644
index 9731212c4..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/info.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/main.cpp b/doc/src/snippets/widgets-tutorial/notepad/main.cpp
deleted file mode 100644
index 5a76f0255..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/main.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [all]
-//! [1]
-#include "notepad.h"
-#include <QApplication>
-//! [1]
-
-//! [2]
-int main(int argc, char *argv[])
-{
-//! [2]
-//! [3]
- QApplication EditorApp(argc, argv);
-//! [3]
-//! [4]
- Notepad Editor;
-//! [4]
-//! [5]
- Editor.show();
-//! [5]
-
-//! [6]
- return EditorApp.exec();
-//! [6]
-}
-//! [all]
diff --git a/doc/src/snippets/widgets-tutorial/notepad/new.png b/doc/src/snippets/widgets-tutorial/notepad/new.png
deleted file mode 100644
index b24edc5d0..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/new.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/notepad.cpp b/doc/src/snippets/widgets-tutorial/notepad/notepad.cpp
deleted file mode 100644
index f519bb66a..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/notepad.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "notepad.h"
-#include "ui_notepad.h"
-
-//! [0]
-#include <QFile>
-#include <QFileDialog>
-#include <QTextStream>
-#include <QMessageBox>
-#include <QprintDev>
-#include <QPrintDialog>
-#include <QFont>
-#include <QFontDialog>
-//! [0]
-
-//! [1]
-Notepad::Notepad(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::Notepad)
-{
- ui->setupUi(this);
- this->setCentralWidget(ui->textEdit);
-}
-//! [1]
-
-Notepad::~Notepad()
-{
- delete ui;
-}
-
-//! [2]
-void Notepad::on_actionNew_triggered()
-{
- currentFile = "";
- ui->textEdit->setText("");
-}
-//! [2]
-
-//! [3]
-void Notepad::on_actionOpen_triggered()
-{
- QString fileName = QFileDialog::getOpenFileName(this, "Open the file");
- QFile file(fileName);
- currentFile = fileName;
- if (!file.open(QIODevice::ReadOnly | QFile::Text)) {
- QMessageBox::warning(this,"..","File not opened.");
- return;
- }
- QTextStream in(&file);
- QString text = in.readAll();
- ui->textEdit->setText(text);
- file.close();
-}
-//! [3]
-
-//! [4]
-void Notepad::on_actionSave_triggered()
-{
- QFile file(currentFile);
- if (!file.open(QIODevice::WriteOnly | QFile::Text)) {
- QMessageBox::warning(this,"..","No file opened. Use Save As");
- return;
- }
- QTextStream out(&file);
- QString text = ui->textEdit->toPlainText();
- out << text;
- file.flush();
- file.close();
-}
-//! [4]
-
-//! [5]
-void Notepad::on_actionSave_as_triggered()
-{
- QString fileName = QFileDialog::getSaveFileName(this, "Save as");
- QFile file(fileName);
- currentFile = fileName;
- if (!file.open(QFile::WriteOnly | QFile::Text)) {
- QMessageBox::warning(this,"..","File not opened.");
- return;
- }
- QTextStream out(&file);
- QString text = ui->textEdit->toPlainText();
- out << text;
- file.flush();
- file.close();
-}
-//! [5]
-
-//! [6]
-void Notepad::on_actionPrint_triggered()
-{
- QprintDev printDev;
- QPrintDialog dialog(&printDev, this);
- if (dialog.exec() == QDialog::Rejected) {
- return;
- }
- ui->textEdit->print(&printDev);
-}
-//! [6]
-
-void Notepad::on_actionExit_triggered()
-{
- QCoreApplication::quit();
-}
-
-void Notepad::on_actionCopy_triggered()
-{
- ui->textEdit->copy();
-}
-
-void Notepad::on_actionCut_triggered()
-{
- ui->textEdit->cut();
-}
-
-void Notepad::on_actionPaste_triggered()
-{
- ui->textEdit->paste();
-}
-
-void Notepad::on_actionUndo_triggered()
-{
- ui->textEdit->undo();
-}
-
-void Notepad::on_actionRedo_triggered()
-{
- ui->textEdit->redo();
-}
-
-//! [7]
-void Notepad::on_actionFont_triggered()
-{
- bool fontSelected;
- QFont font = QFontDialog::getFont(&fontSelected, this);
- if (fontSelected) {
- ui->textEdit->setFont(font);
- }
-}
-//! [7]
diff --git a/doc/src/snippets/widgets-tutorial/notepad/notepad.h b/doc/src/snippets/widgets-tutorial/notepad/notepad.h
deleted file mode 100644
index 9bcdd725a..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/notepad.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef NOTEPAD_H
-#define NOTEPAD_H
-
-//! [all]
-//! [1]
-#include <QMainWindow>
-//! [1]
-
-//! [2]
-namespace Ui {
-class Notepad;
-}
-//! [2]
-
-//! [3]
-class Notepad : public QMainWindow
-{
- Q_OBJECT
-//! [3]
-
-//! [4]
-public:
- explicit Notepad(QWidget *parent = 0);
-//! [4]
-//! [5]
- ~Notepad();
-//! [5]
-
-private slots:
- void on_actionNew_triggered();
-
- void on_actionOpen_triggered();
-
- void on_actionSave_triggered();
-
- void on_actionSave_as_triggered();
-
- void on_actionPrint_triggered();
-
- void on_actionExit_triggered();
-
- void on_actionCopy_triggered();
-
- void on_actionCut_triggered();
-
- void on_actionPaste_triggered();
-
- void on_actionUndo_triggered();
-
- void on_actionRedo_triggered();
-
- void on_actionFont_triggered();
-
-//! [6]
-private:
- Ui::Notepad *ui;
- QString CurrentFile;
-//! [6]
-};
-//! [all]
-
-#endif // NOTEPAD_H
diff --git a/doc/src/snippets/widgets-tutorial/notepad/notepad.pro b/doc/src/snippets/widgets-tutorial/notepad/notepad.pro
deleted file mode 100644
index 758c067eb..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/notepad.pro
+++ /dev/null
@@ -1,34 +0,0 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2017-07-10T14:20:07
-#
-#-------------------------------------------------
-
-QT += core gui printsupport
-
-greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
-
-TARGET = Notepad
-TEMPLATE = app
-
-# The following define makes your compiler emit warnings if you use
-# any feature of Qt which as been marked as deprecated (the exact warnings
-# depend on your compiler). Please consult the documentation of the
-# deprecated API in order to know how to port your code away from it.
-DEFINES += QT_DEPRECATED_WARNINGS
-
-# You can also make your code fail to compile if you use deprecated APIs.
-# In order to do so, uncomment the following line.
-# You can also select to disable deprecated APIs only up to a certain version of Qt.
-#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
-
-
-SOURCES += main.cpp\
- notepad.cpp
-
-HEADERS += notepad.h
-
-FORMS += notepad.ui
-
-RESOURCES += \
- notepad.qrc
diff --git a/doc/src/snippets/widgets-tutorial/notepad/notepad.qrc b/doc/src/snippets/widgets-tutorial/notepad/notepad.qrc
deleted file mode 100644
index 3e04ad7e7..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/notepad.qrc
+++ /dev/null
@@ -1,19 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>info.png</file>
- <file>new.png</file>
- <file>open.png</file>
- <file>paste.png</file>
- <file>pencil.png</file>
- <file>print.png</file>
- <file>save.png</file>
- <file>save_as.png</file>
- <file>exit.png</file>
- <file>font.png</file>
- <file>copy.png</file>
- <file>create.png</file>
- <file>cut.png</file>
- <file>edit_redo.png</file>
- <file>edit_undo.png</file>
- </qresource>
-</RCC>
diff --git a/doc/src/snippets/widgets-tutorial/notepad/notepad.ui b/doc/src/snippets/widgets-tutorial/notepad/notepad.ui
deleted file mode 100644
index 59dfce383..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/notepad.ui
+++ /dev/null
@@ -1,196 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Notepad</class>
- <widget class="QMainWindow" name="Notepad">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>524</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Notepad</string>
- </property>
- <widget class="QWidget" name="centralWidget">
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QTextEdit" name="textEdit"/>
- </item>
- </layout>
- </widget>
- <widget class="QMenuBar" name="menuBar">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>524</width>
- <height>25</height>
- </rect>
- </property>
- <widget class="QMenu" name="menuFile">
- <property name="title">
- <string>File</string>
- </property>
- <addaction name="actionNew"/>
- <addaction name="actionOpen"/>
- <addaction name="actionSave"/>
- <addaction name="actionSave_as"/>
- <addaction name="actionPrint"/>
- <addaction name="separator"/>
- <addaction name="actionExit"/>
- </widget>
- <widget class="QMenu" name="menuEdit">
- <property name="title">
- <string>Edit</string>
- </property>
- <addaction name="actionCopy"/>
- <addaction name="actionCut"/>
- <addaction name="actionPaste"/>
- <addaction name="separator"/>
- <addaction name="actionUndo"/>
- <addaction name="actionRedo"/>
- <addaction name="actionFont"/>
- </widget>
- <addaction name="menuFile"/>
- <addaction name="menuEdit"/>
- </widget>
- <widget class="QToolBar" name="mainToolBar">
- <attribute name="toolBarArea">
- <enum>TopToolBarArea</enum>
- </attribute>
- <attribute name="toolBarBreak">
- <bool>false</bool>
- </attribute>
- <addaction name="actionNew"/>
- <addaction name="actionOpen"/>
- <addaction name="actionSave"/>
- <addaction name="actionSave_as"/>
- <addaction name="actionPrint"/>
- <addaction name="separator"/>
- <addaction name="actionCopy"/>
- <addaction name="actionCut"/>
- <addaction name="actionPaste"/>
- <addaction name="actionUndo"/>
- <addaction name="actionRedo"/>
- <addaction name="actionFont"/>
- <addaction name="separator"/>
- <addaction name="actionExit"/>
- </widget>
- <widget class="QStatusBar" name="statusBar"/>
- <action name="actionNew">
- <property name="icon">
- <iconset resource="notepad.qrc">
- <normaloff>:/new.png</normaloff>:/new.png</iconset>
- </property>
- <property name="text">
- <string>New</string>
- </property>
- </action>
- <action name="actionOpen">
- <property name="icon">
- <iconset resource="notepad.qrc">
- <normaloff>:/open.png</normaloff>:/open.png</iconset>
- </property>
- <property name="text">
- <string>Open</string>
- </property>
- </action>
- <action name="actionSave">
- <property name="icon">
- <iconset resource="notepad.qrc">
- <normaloff>:/save.png</normaloff>:/save.png</iconset>
- </property>
- <property name="text">
- <string>Save</string>
- </property>
- </action>
- <action name="actionSave_as">
- <property name="icon">
- <iconset resource="notepad.qrc">
- <normaloff>:/save_as.png</normaloff>:/save_as.png</iconset>
- </property>
- <property name="text">
- <string>Save as</string>
- </property>
- </action>
- <action name="actionPrint">
- <property name="icon">
- <iconset resource="notepad.qrc">
- <normaloff>:/print.png</normaloff>:/print.png</iconset>
- </property>
- <property name="text">
- <string>Print</string>
- </property>
- </action>
- <action name="actionExit">
- <property name="icon">
- <iconset resource="notepad.qrc">
- <normaloff>:/exit.png</normaloff>:/exit.png</iconset>
- </property>
- <property name="text">
- <string>Exit</string>
- </property>
- </action>
- <action name="actionCopy">
- <property name="icon">
- <iconset resource="notepad.qrc">
- <normaloff>:/copy.png</normaloff>:/copy.png</iconset>
- </property>
- <property name="text">
- <string>Copy</string>
- </property>
- </action>
- <action name="actionCut">
- <property name="icon">
- <iconset resource="notepad.qrc">
- <normaloff>:/cut.png</normaloff>:/cut.png</iconset>
- </property>
- <property name="text">
- <string>Cut</string>
- </property>
- </action>
- <action name="actionPaste">
- <property name="icon">
- <iconset resource="notepad.qrc">
- <normaloff>:/paste.png</normaloff>:/paste.png</iconset>
- </property>
- <property name="text">
- <string>Paste</string>
- </property>
- </action>
- <action name="actionUndo">
- <property name="icon">
- <iconset resource="notepad.qrc">
- <normaloff>:/edit_undo.png</normaloff>:/edit_undo.png</iconset>
- </property>
- <property name="text">
- <string>Undo</string>
- </property>
- </action>
- <action name="actionRedo">
- <property name="icon">
- <iconset resource="notepad.qrc">
- <normaloff>:/edit_redo.png</normaloff>:/edit_redo.png</iconset>
- </property>
- <property name="text">
- <string>Redo</string>
- </property>
- </action>
- <action name="actionFont">
- <property name="icon">
- <iconset resource="notepad.qrc">
- <normaloff>:/font.png</normaloff>:/font.png</iconset>
- </property>
- <property name="text">
- <string>Font</string>
- </property>
- </action>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <resources>
- <include location="notepad.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/doc/src/snippets/widgets-tutorial/notepad/open.png b/doc/src/snippets/widgets-tutorial/notepad/open.png
deleted file mode 100644
index 7b052edf5..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/open.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/paste.png b/doc/src/snippets/widgets-tutorial/notepad/paste.png
deleted file mode 100644
index c50dbd95b..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/paste.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/pencil.png b/doc/src/snippets/widgets-tutorial/notepad/pencil.png
deleted file mode 100644
index a9c5e5482..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/pencil.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/print.png b/doc/src/snippets/widgets-tutorial/notepad/print.png
deleted file mode 100644
index 0cd3f28bd..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/print.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/save.png b/doc/src/snippets/widgets-tutorial/notepad/save.png
deleted file mode 100644
index e65a29d5f..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/save.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/notepad/save_as.png b/doc/src/snippets/widgets-tutorial/notepad/save_as.png
deleted file mode 100644
index 604057432..000000000
--- a/doc/src/snippets/widgets-tutorial/notepad/save_as.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/snippets/widgets-tutorial/toplevel/main.cpp b/doc/src/snippets/widgets-tutorial/toplevel/main.cpp
deleted file mode 100644
index edd942840..000000000
--- a/doc/src/snippets/widgets-tutorial/toplevel/main.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-//! [create, resize and show]
- QWidget *window = new QWidget();
- window->resize(320, 240);
- window->show();
-//! [create, resize and show]
- window->setWindowTitle(tr("Top-level widget"));
- return app.exec();
-}
diff --git a/doc/src/snippets/widgets-tutorial/toplevel/toplevel.pro b/doc/src/snippets/widgets-tutorial/toplevel/toplevel.pro
deleted file mode 100644
index bba41b9c1..000000000
--- a/doc/src/snippets/widgets-tutorial/toplevel/toplevel.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = main.cpp
diff --git a/doc/src/snippets/widgets-tutorial/windowlayout/main.cpp b/doc/src/snippets/widgets-tutorial/windowlayout/main.cpp
deleted file mode 100644
index 84b9df566..000000000
--- a/doc/src/snippets/widgets-tutorial/windowlayout/main.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- QWidget *window = new QWidget();
-//! [create, lay out widgets and show]
- QLabel *label = new QLabel(tr("Name:"));
- QLineEdit *lineEdit = new QLineEdit();
-
- QHBoxLayout *layout = new QHBoxLayout();
- layout->addWidget(label);
- layout->addWidget(lineEdit);
- window->setLayout(layout);
-//! [create, lay out widgets and show]
- window->setWindowTitle(tr("Window layout"));
- window->show();
- return app.exec();
-}
diff --git a/doc/src/snippets/widgets-tutorial/windowlayout/windowlayout.pro b/doc/src/snippets/widgets-tutorial/windowlayout/windowlayout.pro
deleted file mode 100644
index bba41b9c1..000000000
--- a/doc/src/snippets/widgets-tutorial/windowlayout/windowlayout.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = main.cpp