diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-02-04 01:00:59 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-02-04 10:44:00 +0100 |
commit | 97417e8f2896bfbe1d9e9a703ddba980983d1442 (patch) | |
tree | ecee79f9b126bc695904e74000c0775d1ef34646 /examples | |
parent | 02eb9df851093f11872c828869226903c81f1b60 (diff) | |
parent | 056230cc9c3309823a93df0e34c92affb29df9e4 (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
.qmake.conf
examples/widgets/widgets/imageviewer/imageviewer.cpp
src/corelib/text/qchar.cpp
src/corelib/time/qdatetime.cpp
Change-Id: I9762f5c4ff650799219729d6aee79ac07ce9024a
Diffstat (limited to 'examples')
21 files changed, 39 insertions, 33 deletions
diff --git a/examples/embedded/flightinfo/flightinfo.cpp b/examples/embedded/flightinfo/flightinfo.cpp index 732e07583a..a20a03de43 100644 --- a/examples/embedded/flightinfo/flightinfo.cpp +++ b/examples/embedded/flightinfo/flightinfo.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. @@ -198,7 +198,7 @@ private slots: public slots: - void request(const QString &flightCode, const QDate &date) { + void request(const QString &flightCode, QDate date) { setWindowTitle("Loading..."); diff --git a/examples/sql/books/initdb.h b/examples/sql/books/initdb.h index 773e3fb74c..e1f690a234 100644 --- a/examples/sql/books/initdb.h +++ b/examples/sql/books/initdb.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. @@ -71,7 +71,7 @@ QVariant addGenre(QSqlQuery &q, const QString &name) return q.lastInsertId(); } -QVariant addAuthor(QSqlQuery &q, const QString &name, const QDate &birthdate) +QVariant addAuthor(QSqlQuery &q, const QString &name, QDate birthdate) { q.addBindValue(name); q.addBindValue(birthdate); diff --git a/examples/vulkan/doc/src/hellovulkancubes.qdoc b/examples/vulkan/doc/src/hellovulkancubes.qdoc index 8fa3243024..f6160a5083 100644 --- a/examples/vulkan/doc/src/hellovulkancubes.qdoc +++ b/examples/vulkan/doc/src/hellovulkancubes.qdoc @@ -27,6 +27,7 @@ /*! \example hellovulkancubes + \meta installpath vulkan \title Hello Vulkan Cubes Example \ingroup examples-vulkan \brief Shows the basics of using QVulkanWindow. diff --git a/examples/vulkan/doc/src/hellovulkantexture.qdoc b/examples/vulkan/doc/src/hellovulkantexture.qdoc index 4284e4a05c..968c560236 100644 --- a/examples/vulkan/doc/src/hellovulkantexture.qdoc +++ b/examples/vulkan/doc/src/hellovulkantexture.qdoc @@ -27,6 +27,7 @@ /*! \example hellovulkantexture + \meta installpath vulkan \ingroup examples-vulkan \title Hello Vulkan Texture Vulkan Example \brief Shows the basics of rendering with textures in a QVulkanWindow. diff --git a/examples/vulkan/doc/src/hellovulkantriangle.qdoc b/examples/vulkan/doc/src/hellovulkantriangle.qdoc index 57793cf25a..f030d61578 100644 --- a/examples/vulkan/doc/src/hellovulkantriangle.qdoc +++ b/examples/vulkan/doc/src/hellovulkantriangle.qdoc @@ -27,6 +27,7 @@ /*! \example hellovulkantriangle + \meta installpath vulkan \ingroup examples-vulkan \title Hello Vulkan Triangle Example \brief Shows the basics of rendering with QVulkanWindow and the Vulkan API. diff --git a/examples/vulkan/doc/src/hellovulkanwidget.qdoc b/examples/vulkan/doc/src/hellovulkanwidget.qdoc index b5ad43ba2a..b1fb52ee85 100644 --- a/examples/vulkan/doc/src/hellovulkanwidget.qdoc +++ b/examples/vulkan/doc/src/hellovulkanwidget.qdoc @@ -27,6 +27,7 @@ /*! \example hellovulkanwidget + \meta installpath vulkan \ingroup examples-vulkan \title Hello Vulkan Widget Example \brief Shows the usage of QVulkanWindow in QWidget applications. diff --git a/examples/vulkan/doc/src/hellovulkanwindow.qdoc b/examples/vulkan/doc/src/hellovulkanwindow.qdoc index a9682b7e90..e1e95a0952 100644 --- a/examples/vulkan/doc/src/hellovulkanwindow.qdoc +++ b/examples/vulkan/doc/src/hellovulkanwindow.qdoc @@ -27,6 +27,7 @@ /*! \example hellovulkanwindow + \meta installpath vulkan \title Hello Vulkan Window Example \ingroup examples-vulkan \brief Shows the basics of using QVulkanWindow. diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.cpp b/examples/widgets/dialogs/licensewizard/licensewizard.cpp index c082afa876..2eaadd1cba 100644 --- a/examples/widgets/dialogs/licensewizard/licensewizard.cpp +++ b/examples/widgets/dialogs/licensewizard/licensewizard.cpp @@ -369,7 +369,7 @@ void ConclusionPage::setVisible(bool visible) void ConclusionPage::printButtonClicked() { -#if QT_CONFIG(printdialog) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) QPrinter printer; QPrintDialog dialog(&printer, this); if (dialog.exec()) diff --git a/examples/widgets/graphicsview/chip/view.cpp b/examples/widgets/graphicsview/chip/view.cpp index 86da5b138f..3b1718bdbd 100644 --- a/examples/widgets/graphicsview/chip/view.cpp +++ b/examples/widgets/graphicsview/chip/view.cpp @@ -264,7 +264,7 @@ void View::toggleAntialiasing() void View::print() { -#if QT_CONFIG(printdialog) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) QPrinter printer; QPrintDialog dialog(&printer, this); if (dialog.exec() == QDialog::Accepted) { diff --git a/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp b/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp index b0b4017e62..fd17876f2b 100644 --- a/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp +++ b/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -60,7 +60,7 @@ MySortFilterProxyModel::MySortFilterProxyModel(QObject *parent) //! [0] //! [1] -void MySortFilterProxyModel::setFilterMinimumDate(const QDate &date) +void MySortFilterProxyModel::setFilterMinimumDate(QDate date) { minDate = date; invalidateFilter(); @@ -68,7 +68,7 @@ void MySortFilterProxyModel::setFilterMinimumDate(const QDate &date) //! [1] //! [2] -void MySortFilterProxyModel::setFilterMaximumDate(const QDate &date) +void MySortFilterProxyModel::setFilterMaximumDate(QDate date) { maxDate = date; invalidateFilter(); @@ -122,7 +122,7 @@ bool MySortFilterProxyModel::lessThan(const QModelIndex &left, //! [5] //! [6] //! [7] -bool MySortFilterProxyModel::dateInRange(const QDate &date) const +bool MySortFilterProxyModel::dateInRange(QDate date) const { return (!minDate.isValid() || date > minDate) && (!maxDate.isValid() || date < maxDate); diff --git a/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h b/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h index e2aff3c829..5fdabbd5df 100644 --- a/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h +++ b/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -63,17 +63,17 @@ public: MySortFilterProxyModel(QObject *parent = 0); QDate filterMinimumDate() const { return minDate; } - void setFilterMinimumDate(const QDate &date); + void setFilterMinimumDate(QDate date); QDate filterMaximumDate() const { return maxDate; } - void setFilterMaximumDate(const QDate &date); + void setFilterMaximumDate(QDate date); protected: bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; private: - bool dateInRange(const QDate &date) const; + bool dateInRange(QDate date) const; QDate minDate; QDate maxDate; diff --git a/examples/widgets/itemviews/pixelator/mainwindow.cpp b/examples/widgets/itemviews/pixelator/mainwindow.cpp index f6b67e4dba..abd4a8b1ab 100644 --- a/examples/widgets/itemviews/pixelator/mainwindow.cpp +++ b/examples/widgets/itemviews/pixelator/mainwindow.cpp @@ -167,7 +167,7 @@ void MainWindow::openImage(const QString &fileName) void MainWindow::printImage() { -#if QT_CONFIG(printdialog) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) if (model->rowCount(QModelIndex())*model->columnCount(QModelIndex()) > 90000) { QMessageBox::StandardButton answer; answer = QMessageBox::question(this, tr("Large Image Size"), diff --git a/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp b/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp index a62765cdab..dba4a081df 100644 --- a/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp +++ b/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp @@ -128,7 +128,7 @@ void MainWindow::newLetter() //! [3] void MainWindow::print() { -#if QT_CONFIG(printdialog) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) QTextDocument *document = textEdit->document(); QPrinter printer; diff --git a/examples/widgets/richtext/orderform/mainwindow.cpp b/examples/widgets/richtext/orderform/mainwindow.cpp index 0b6a2cac6c..ee6758c9cb 100644 --- a/examples/widgets/richtext/orderform/mainwindow.cpp +++ b/examples/widgets/richtext/orderform/mainwindow.cpp @@ -248,7 +248,7 @@ void MainWindow::openDialog() //! [17] void MainWindow::printFile() { -#if QT_CONFIG(printdialog) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) QTextEdit *editor = static_cast<QTextEdit*>(letters->currentWidget()); //! [18] QPrinter printer; diff --git a/examples/widgets/richtext/textedit/textedit.cpp b/examples/widgets/richtext/textedit/textedit.cpp index 85fb83ab89..7708b25a24 100644 --- a/examples/widgets/richtext/textedit/textedit.cpp +++ b/examples/widgets/richtext/textedit/textedit.cpp @@ -419,18 +419,18 @@ bool TextEdit::load(const QString &f) QByteArray data = file.readAll(); QTextCodec *codec = Qt::codecForHtml(data); QString str = codec->toUnicode(data); - QUrl baseUrl = (f.front() == QLatin1Char(':') ? QUrl(f) : QUrl::fromLocalFile(f)).adjusted(QUrl::RemoveFilename); - textEdit->document()->setBaseUrl(baseUrl); if (Qt::mightBeRichText(str)) { + QUrl baseUrl = (f.front() == QLatin1Char(':') ? QUrl(f) : QUrl::fromLocalFile(f)).adjusted(QUrl::RemoveFilename); + textEdit->document()->setBaseUrl(baseUrl); textEdit->setHtml(str); } else { #if QT_CONFIG(textmarkdownreader) QMimeDatabase db; if (db.mimeTypeForFileNameAndData(f, data).name() == QLatin1String("text/markdown")) - textEdit->setMarkdown(str); + textEdit->setMarkdown(QString::fromUtf8(data)); else #endif - textEdit->setPlainText(QString::fromLocal8Bit(data)); + textEdit->setPlainText(QString::fromUtf8(data)); } setCurrentFileName(f); @@ -545,7 +545,7 @@ bool TextEdit::fileSaveAs() void TextEdit::filePrint() { -#if QT_CONFIG(printdialog) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) QPrinter printer(QPrinter::HighResolution); QPrintDialog *dlg = new QPrintDialog(&printer, this); if (textEdit->textCursor().hasSelection()) diff --git a/examples/widgets/touch/fingerpaint/scribblearea.cpp b/examples/widgets/touch/fingerpaint/scribblearea.cpp index 0b0c4476d9..e490495cd9 100644 --- a/examples/widgets/touch/fingerpaint/scribblearea.cpp +++ b/examples/widgets/touch/fingerpaint/scribblearea.cpp @@ -170,7 +170,7 @@ void ScribbleArea::resizeImage(QImage *image, const QSize &newSize) //! [21] void ScribbleArea::print() { -#if QT_CONFIG(printdialog) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) QPrinter printer(QPrinter::HighResolution); QPrintDialog printDialog(&printer, this); diff --git a/examples/widgets/tutorials/notepad/notepad.cpp b/examples/widgets/tutorials/notepad/notepad.cpp index 2ccd6501a1..5fd0d69cea 100644 --- a/examples/widgets/tutorials/notepad/notepad.cpp +++ b/examples/widgets/tutorials/notepad/notepad.cpp @@ -92,7 +92,7 @@ Notepad::Notepad(QWidget *parent) : connect(ui->actionAbout, &QAction::triggered, this, &Notepad::about); // Disable menu actions for unavailable features -#if !QT_CONFIG(printer) +#if !defined(QT_PRINTSUPPORT_LIB) || !QT_CONFIG(printer) ui->actionPrint->setEnabled(false); #endif @@ -171,7 +171,7 @@ void Notepad::saveAs() void Notepad::print() { -#if QT_CONFIG(printer) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printer) QPrinter printDev; #if QT_CONFIG(printdialog) QPrintDialog dialog(&printDev, this); diff --git a/examples/widgets/widgets/calendarwidget/window.cpp b/examples/widgets/widgets/calendarwidget/window.cpp index b8a3d03552..ae10223dd4 100644 --- a/examples/widgets/widgets/calendarwidget/window.cpp +++ b/examples/widgets/widgets/calendarwidget/window.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -126,7 +126,7 @@ void Window::selectedDateChanged() //! [2] //! [3] -void Window::minimumDateChanged(const QDate &date) +void Window::minimumDateChanged(QDate date) { calendar->setMinimumDate(date); maximumDateEdit->setDate(calendar->maximumDate()); @@ -134,7 +134,7 @@ void Window::minimumDateChanged(const QDate &date) //! [3] //! [4] -void Window::maximumDateChanged(const QDate &date) +void Window::maximumDateChanged(QDate date) { calendar->setMaximumDate(date); minimumDateEdit->setDate(calendar->minimumDate()); diff --git a/examples/widgets/widgets/calendarwidget/window.h b/examples/widgets/widgets/calendarwidget/window.h index 83ea494fc2..1b673b8ce0 100644 --- a/examples/widgets/widgets/calendarwidget/window.h +++ b/examples/widgets/widgets/calendarwidget/window.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -52,6 +52,7 @@ #define WINDOW_H #include <QWidget> +#include <QDateTime> QT_BEGIN_NAMESPACE class QCalendarWidget; @@ -79,8 +80,8 @@ private slots: void horizontalHeaderChanged(int index); void verticalHeaderChanged(int index); void selectedDateChanged(); - void minimumDateChanged(const QDate &date); - void maximumDateChanged(const QDate &date); + void minimumDateChanged(QDate date); + void maximumDateChanged(QDate date); void weekdayFormatChanged(); void weekendFormatChanged(); void reformatHeaders(); diff --git a/examples/widgets/widgets/imageviewer/imageviewer.cpp b/examples/widgets/widgets/imageviewer/imageviewer.cpp index 1efaad0082..7a0f49308b 100644 --- a/examples/widgets/widgets/imageviewer/imageviewer.cpp +++ b/examples/widgets/widgets/imageviewer/imageviewer.cpp @@ -201,7 +201,7 @@ void ImageViewer::print() //! [5] //! [6] { Q_ASSERT(!imageLabel->pixmap(Qt::ReturnByValue).isNull()); -#if QT_CONFIG(printdialog) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) //! [6] //! [7] QPrintDialog dialog(&printer, this); //! [7] //! [8] diff --git a/examples/widgets/widgets/scribble/scribblearea.cpp b/examples/widgets/widgets/scribble/scribblearea.cpp index 75371b523f..d3937f90d8 100644 --- a/examples/widgets/widgets/scribble/scribblearea.cpp +++ b/examples/widgets/widgets/scribble/scribblearea.cpp @@ -210,7 +210,7 @@ void ScribbleArea::resizeImage(QImage *image, const QSize &newSize) //! [21] void ScribbleArea::print() { -#if QT_CONFIG(printdialog) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) QPrinter printer(QPrinter::HighResolution); QPrintDialog printDialog(&printer, this); |