diff options
Diffstat (limited to 'src/widgets/dialogs')
34 files changed, 472 insertions, 570 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index b133c49b5e..5f3161f39f 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -84,7 +84,7 @@ public: virtual void setCurrent(int row, int col); virtual void setSelected(int row, int col); - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; virtual void setCellBrush(int row, int col, const QBrush &); QBrush cellBrush(int row, int col); @@ -137,12 +137,12 @@ protected: virtual void paintCell(QPainter *, int row, int col, const QRect&); virtual void paintCellContents(QPainter *, int row, int col, const QRect&); - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void keyPressEvent(QKeyEvent*); - void focusInEvent(QFocusEvent*); - void focusOutEvent(QFocusEvent*); - void paintEvent(QPaintEvent *); + void mousePressEvent(QMouseEvent*) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent*) Q_DECL_OVERRIDE; + void keyPressEvent(QKeyEvent*) Q_DECL_OVERRIDE; + void focusInEvent(QFocusEvent*) Q_DECL_OVERRIDE; + void focusOutEvent(QFocusEvent*) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; private: Q_DISABLE_COPY(QWellArray) @@ -514,15 +514,15 @@ public: { setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); } protected: - void paintCellContents(QPainter *, int row, int col, const QRect&); - void mousePressEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); + void paintCellContents(QPainter *, int row, int col, const QRect&) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; #ifndef QT_NO_DRAGANDDROP - void dragEnterEvent(QDragEnterEvent *e); - void dragLeaveEvent(QDragLeaveEvent *e); - void dragMoveEvent(QDragMoveEvent *e); - void dropEvent(QDropEvent *e); + void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE; + void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE; #endif private: @@ -636,11 +636,11 @@ signals: void newCol(int h, int s); protected: - QSize sizeHint() const; - void paintEvent(QPaintEvent*); - void mouseMoveEvent(QMouseEvent *); - void mousePressEvent(QMouseEvent *); - void resizeEvent(QResizeEvent *); + QSize sizeHint() const Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE; private: int hue; @@ -673,9 +673,9 @@ signals: void newHsv(int h, int s, int v); protected: - void paintEvent(QPaintEvent*); - void mouseMoveEvent(QMouseEvent *); - void mousePressEvent(QMouseEvent *); + void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; private: enum { foff = 3, coff = 4 }; //frame and contents offset @@ -995,14 +995,14 @@ signals: void colorDropped(QRgb); protected: - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); + void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; #ifndef QT_NO_DRAGANDDROP - void dragEnterEvent(QDragEnterEvent *e); - void dragLeaveEvent(QDragLeaveEvent *e); - void dropEvent(QDropEvent *e); + void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE; + void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE; #endif private: @@ -1119,10 +1119,7 @@ QColorShower::QColorShower(QColorDialog *parent) #if !defined(QT_SMALL_COLORDIALOG) gl->addWidget(lab, 0, 0, -1, 1); #else - if (nonTouchUI) - gl->addWidget(lab, 0, 0, 1, -1); - else - gl->addWidget(lab, 0, 0, -1, 1); + gl->addWidget(lab, 0, 0, 1, -1); #endif connect(lab, SIGNAL(colorDropped(QRgb)), this, SIGNAL(newCol(QRgb))); connect(lab, SIGNAL(colorDropped(QRgb)), this, SLOT(setRgb(QRgb))); @@ -1138,13 +1135,8 @@ QColorShower::QColorShower(QColorDialog *parent) gl->addWidget(lblHue, 0, 1); gl->addWidget(hEd, 0, 2); #else - if (nonTouchUI) { - gl->addWidget(lblHue, 1, 0); - gl->addWidget(hEd, 2, 0); - } else { - lblHue->hide(); - hEd->hide(); - } + gl->addWidget(lblHue, 1, 0); + gl->addWidget(hEd, 2, 0); #endif sEd = new QColSpinBox(this); @@ -1157,13 +1149,8 @@ QColorShower::QColorShower(QColorDialog *parent) gl->addWidget(lblSat, 1, 1); gl->addWidget(sEd, 1, 2); #else - if (nonTouchUI) { - gl->addWidget(lblSat, 1, 1); - gl->addWidget(sEd, 2, 1); - } else { - lblSat->hide(); - sEd->hide(); - } + gl->addWidget(lblSat, 1, 1); + gl->addWidget(sEd, 2, 1); #endif vEd = new QColSpinBox(this); @@ -1176,13 +1163,8 @@ QColorShower::QColorShower(QColorDialog *parent) gl->addWidget(lblVal, 2, 1); gl->addWidget(vEd, 2, 2); #else - if (nonTouchUI) { - gl->addWidget(lblVal, 1, 2); - gl->addWidget(vEd, 2, 2); - } else { - lblVal->hide(); - vEd->hide(); - } + gl->addWidget(lblVal, 1, 2); + gl->addWidget(vEd, 2, 2); #endif rEd = new QColSpinBox(this); @@ -1195,13 +1177,8 @@ QColorShower::QColorShower(QColorDialog *parent) gl->addWidget(lblRed, 0, 3); gl->addWidget(rEd, 0, 4); #else - if (nonTouchUI) { - gl->addWidget(lblRed, 3, 0); - gl->addWidget(rEd, 4, 0); - } else { - lblRed->hide(); - rEd->hide(); - } + gl->addWidget(lblRed, 3, 0); + gl->addWidget(rEd, 4, 0); #endif gEd = new QColSpinBox(this); @@ -1214,13 +1191,8 @@ QColorShower::QColorShower(QColorDialog *parent) gl->addWidget(lblGreen, 1, 3); gl->addWidget(gEd, 1, 4); #else - if (nonTouchUI) { - gl->addWidget(lblGreen, 3, 1); - gl->addWidget(gEd, 4, 1); - } else { - lblGreen->hide(); - gEd->hide(); - } + gl->addWidget(lblGreen, 3, 1); + gl->addWidget(gEd, 4, 1); #endif bEd = new QColSpinBox(this); @@ -1233,13 +1205,8 @@ QColorShower::QColorShower(QColorDialog *parent) gl->addWidget(lblBlue, 2, 3); gl->addWidget(bEd, 2, 4); #else - if (nonTouchUI) { - gl->addWidget(lblBlue, 3, 2); - gl->addWidget(bEd, 4, 2); - } else { - lblBlue->hide(); - bEd->hide(); - } + gl->addWidget(lblBlue, 3, 2); + gl->addWidget(bEd, 4, 2); #endif alphaEd = new QColSpinBox(this); @@ -1252,13 +1219,8 @@ QColorShower::QColorShower(QColorDialog *parent) gl->addWidget(alphaLab, 3, 1, 1, 3); gl->addWidget(alphaEd, 3, 4); #else - if (nonTouchUI) { - gl->addWidget(alphaLab, 1, 3, 3, 1); - gl->addWidget(alphaEd, 4, 3); - } else { - alphaLab->hide(); - alphaEd->hide(); - } + gl->addWidget(alphaLab, 1, 3, 3, 1); + gl->addWidget(alphaEd, 4, 3); #endif alphaEd->hide(); alphaLab->hide(); @@ -1598,11 +1560,16 @@ void QColorDialogPrivate::_q_pickScreenColor() buttons->setDisabled(true); screenColorPickerButton->setDisabled(true); - q->setCurrentColor(grabScreenColor(QCursor::pos())); - lblScreenColorInfo->setText(QColorDialog::tr("Cursor at %1, %2, color: %3\nPress ESC to cancel") - .arg(QCursor::pos().x()) - .arg(QCursor::pos().y()) - .arg(q->currentColor().name())); + const QPoint globalPos = QCursor::pos(); + q->setCurrentColor(grabScreenColor(globalPos)); + updateColorLabelText(globalPos); +} + +void QColorDialogPrivate::updateColorLabelText(const QPoint &globalPos) +{ + lblScreenColorInfo->setText(QColorDialog::tr("Cursor at %1, %2\nPress ESC to cancel") + .arg(globalPos.x()) + .arg(globalPos.y())); } void QColorDialogPrivate::releaseColorPicking() @@ -1638,7 +1605,7 @@ void QColorDialogPrivate::init(const QColor &initial) if (!nativeDialogInUse) initWidgets(); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC delegate = 0; #endif #ifdef Q_OS_WIN32 @@ -1674,9 +1641,7 @@ void QColorDialogPrivate::initWidgets() if (!smallDisplay) { leftLay = new QVBoxLayout; topLay->addLayout(leftLay); - } - if (!smallDisplay) { standard = new QColorWell(q, standardColorRows, colorColumns, QColorDialogOptions::standardColors()); lblBasicColors = new QLabel(q); #ifndef QT_NO_SHORTCUT @@ -1688,7 +1653,7 @@ void QColorDialogPrivate::initWidgets() #if !defined(Q_OS_WINCE) && !defined(QT_SMALL_COLORDIALOG) // The screen color picker button - screenColorPickerButton = new QPushButton(QColorDialog::tr("Pick Screen Color")); + screenColorPickerButton = new QPushButton(); leftLay->addWidget(screenColorPickerButton); lblScreenColorInfo = new QLabel(QLatin1String("\n")); leftLay->addWidget(lblScreenColorInfo); @@ -1743,12 +1708,7 @@ void QColorDialogPrivate::initWidgets() cp->setFrameStyle(QFrame::Panel + QFrame::Sunken); #if defined(QT_SMALL_COLORDIALOG) - if (!nonTouchUI) { - pickLay->addWidget(cp); - cLay->addSpacing(lumSpace); - } else { - cp->hide(); - } + cp->hide(); #else cLay->addSpacing(lumSpace); cLay->addWidget(cp); @@ -1757,15 +1717,7 @@ void QColorDialogPrivate::initWidgets() lp = new QColorLuminancePicker(q); #if defined(QT_SMALL_COLORDIALOG) - QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size(); - const int minDimension = qMin(screenSize.height(), screenSize.width()); - //set picker to be finger-usable - int pickerWidth = !nonTouchUI ? minDimension/9 : minDimension/12; - lp->setFixedWidth(pickerWidth); - if (!nonTouchUI) - pickLay->addWidget(lp); - else - lp->hide(); + lp->hide(); #else lp->setFixedWidth(20); pickLay->addSpacing(10); @@ -1784,12 +1736,11 @@ void QColorDialogPrivate::initWidgets() QObject::connect(cs, SIGNAL(currentColorChanged(QColor)), q, SIGNAL(currentColorChanged(QColor))); #if defined(QT_SMALL_COLORDIALOG) - if (!nonTouchUI) - pWidth -= cp->size().width(); topLay->addWidget(cs); #else rightLay->addWidget(cs); - leftLay->addSpacing(cs->gl->margin()); + if (leftLay) + leftLay->addSpacing(cs->gl->margin()); #endif buttons = new QDialogButtonBox(q); @@ -1835,6 +1786,7 @@ void QColorDialogPrivate::retranslateStrings() lblBasicColors->setText(QColorDialog::tr("&Basic colors")); lblCustomColors->setText(QColorDialog::tr("&Custom colors")); addCusBt->setText(QColorDialog::tr("&Add to Custom Colors")); + screenColorPickerButton->setText(QColorDialog::tr("&Pick Screen Color")); } cs->retranslateStrings(); @@ -2057,7 +2009,7 @@ QColorDialog::ColorDialogOptions QColorDialog::options() const \sa color, colorSelected() */ -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC // can only have one Cocoa color panel active bool QColorDialogPrivate::sharedColorPanelAvailable = true; #endif @@ -2088,7 +2040,7 @@ void QColorDialog::setVisible(bool visible) if (visible) d->selectedQColor = QColor(); -#if defined(Q_WS_MAC) +#if defined(Q_DEAD_CODE_FROM_QT4_MAC) if (visible) { if (d->delegate || (QColorDialogPrivate::sharedColorPanelAvailable && !(testAttribute(Qt::WA_DontShowOnScreen) || (d->opts & DontUseNativeDialog)))){ @@ -2137,16 +2089,6 @@ void QColorDialog::open(QObject *receiver, const char *member) } /*! - \fn QColorDialog::open() - - \since 4.5 - Shows the dialog as a \l{QDialog#Modal Dialogs}{window modal dialog}, - returning immediately. - - \sa QDialog::open() -*/ - -/*! \since 4.5 Pops up a modal color dialog with the given window \a title (or "Select Color" if none is @@ -2199,7 +2141,7 @@ QRgb QColorDialog::getRgba(QRgb initial, bool *ok, QWidget *parent) QColorDialog::~QColorDialog() { -#if defined(Q_WS_MAC) +#if defined(Q_DEAD_CODE_FROM_QT4_MAC) Q_D(QColorDialog); if (d->delegate) { d->releaseCocoaColorPanelDelegate(); @@ -2244,8 +2186,8 @@ void QColorDialogPrivate::updateColorPicking(const QPoint &globalPos) // QTBUG-39792, do not change standard, custom color selectors while moving as // otherwise it is not possible to pre-select a custom cell for assignment. setCurrentColor(color, ShowColor); - lblScreenColorInfo->setText(QColorDialog::tr("Cursor at %1, %2, color: %3\nPress ESC to cancel") - .arg(globalPos.x()).arg(globalPos.y()).arg(color.name())); + updateColorLabelText(globalPos); + } bool QColorDialogPrivate::handleColorPickingMouseMove(QMouseEvent *e) diff --git a/src/widgets/dialogs/qcolordialog.h b/src/widgets/dialogs/qcolordialog.h index b06da2ab13..16339f56c4 100644 --- a/src/widgets/dialogs/qcolordialog.h +++ b/src/widgets/dialogs/qcolordialog.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -47,7 +47,6 @@ class Q_WIDGETS_EXPORT QColorDialog : public QDialog { Q_OBJECT Q_DECLARE_PRIVATE(QColorDialog) - Q_ENUMS(ColorDialogOption) Q_PROPERTY(QColor currentColor READ currentColor WRITE setCurrentColor NOTIFY currentColorChanged) Q_PROPERTY(ColorDialogOptions options READ options WRITE setOptions) @@ -58,6 +57,7 @@ public: NoButtons = 0x00000002, DontUseNativeDialog = 0x00000004 }; + Q_ENUM(ColorDialogOption) Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption) @@ -75,14 +75,10 @@ public: void setOptions(ColorDialogOptions options); ColorDialogOptions options() const; -#ifdef Q_NO_USING_KEYWORD - void open() { QDialog::open(); } -#else using QDialog::open; -#endif void open(QObject *receiver, const char *member); - void setVisible(bool visible); + void setVisible(bool visible) Q_DECL_OVERRIDE; static QColor getColor(const QColor &initial = Qt::white, QWidget *parent = 0, @@ -103,8 +99,8 @@ Q_SIGNALS: void colorSelected(const QColor &color); protected: - void changeEvent(QEvent *event); - void done(int result); + void changeEvent(QEvent *event) Q_DECL_OVERRIDE; + void done(int result) Q_DECL_OVERRIDE; private: Q_DISABLE_COPY(QColorDialog) diff --git a/src/widgets/dialogs/qcolordialog_p.h b/src/widgets/dialogs/qcolordialog_p.h index 9182b510f1..1a881eae70 100644 --- a/src/widgets/dialogs/qcolordialog_p.h +++ b/src/widgets/dialogs/qcolordialog_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -111,13 +111,14 @@ public: void _q_newStandard(int, int); void _q_pickScreenColor(); void _q_updateColorPicking(); + void updateColorLabelText(const QPoint &); void updateColorPicking(const QPoint &pos); void releaseColorPicking(); bool handleColorPickingMouseMove(QMouseEvent *e); bool handleColorPickingMouseButtonRelease(QMouseEvent *e); bool handleColorPickingKeyPress(QKeyEvent *e); - bool canBeNativeDialog() const; + bool canBeNativeDialog() const Q_DECL_OVERRIDE; QWellArray *custom; QWellArray *standard; @@ -149,7 +150,7 @@ public: QWindow dummyTransparentWindow; #endif -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC void openCocoaColorPanel(const QColor &initial, QWidget *parent, const QString &title, QColorDialog::ColorDialogOptions options); void closeCocoaColorPanel(); @@ -167,8 +168,8 @@ public: void mac_nativeDialogModalHelp(); #endif private: - virtual void initHelper(QPlatformDialogHelper *h); - virtual void helperPrepareShow(QPlatformDialogHelper *h); + virtual void initHelper(QPlatformDialogHelper *h) Q_DECL_OVERRIDE; + virtual void helperPrepareShow(QPlatformDialogHelper *h) Q_DECL_OVERRIDE; }; #endif // QT_NO_COLORDIALOG diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 6de3ff8c15..65def6d4b8 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -127,7 +127,7 @@ bool QDialogPrivate::setNativeDialogVisible(bool visible) Q_Q(QDialog); helperPrepareShow(helper); nativeDialogInUse = helper->show(q->windowFlags(), q->windowModality(), parentWindow()); - } else { + } else if (nativeDialogInUse) { helper->hide(); } } diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h index 338f05f94d..cd53378f9a 100644 --- a/src/widgets/dialogs/qdialog.h +++ b/src/widgets/dialogs/qdialog.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h index 9cf3f102da..556bd4ff30 100644 --- a/src/widgets/dialogs/qdialog_p.h +++ b/src/widgets/dialogs/qdialog_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ diff --git a/src/widgets/dialogs/qerrormessage.cpp b/src/widgets/dialogs/qerrormessage.cpp index 6bab921d21..4c3a5497d4 100644 --- a/src/widgets/dialogs/qerrormessage.cpp +++ b/src/widgets/dialogs/qerrormessage.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -84,8 +84,8 @@ public: QErrorMessageTextView(QWidget *parent) : QTextEdit(parent) { setReadOnly(true); } - virtual QSize minimumSizeHint() const; - virtual QSize sizeHint() const; + virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE; + virtual QSize sizeHint() const Q_DECL_OVERRIDE; }; QSize QErrorMessageTextView::minimumSizeHint() const diff --git a/src/widgets/dialogs/qerrormessage.h b/src/widgets/dialogs/qerrormessage.h index 0925923d96..55d0b389b1 100644 --- a/src/widgets/dialogs/qerrormessage.h +++ b/src/widgets/dialogs/qerrormessage.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -58,8 +58,8 @@ public Q_SLOTS: void showMessage(const QString &message, const QString &type); protected: - void done(int); - void changeEvent(QEvent *e); + void done(int) Q_DECL_OVERRIDE; + void changeEvent(QEvent *e) Q_DECL_OVERRIDE; private: Q_DISABLE_COPY(QErrorMessage) diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 9d5d8d2e24..455111225e 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -327,16 +327,12 @@ Q_GLOBAL_STATIC(QUrl, lastVisitedDir) This signal is emitted when the user selects a \a filter. */ -//#if defined(Q_WS_WIN) || defined(Q_WS_MAC) -//bool Q_WIDGETS_EXPORT qt_use_native_dialogs = true; // for the benefit of testing tools, until we have a proper API -//#endif - QT_BEGIN_INCLUDE_NAMESPACE -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN #include <qwindowsstyle_p.h> #endif #include <qshortcut.h> -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC #include <qmacstyle_mac_p.h> #endif QT_END_INCLUDE_NAMESPACE @@ -590,10 +586,6 @@ void QFileDialogPrivate::helperPrepareShow(QPlatformDialogHelper *) options->setHistory(q->history()); if (usingWidgets()) options->setSidebarUrls(qFileDialogUi->sidebar->urls()); - const QDir directory = q->directory(); - options->setInitialDirectory(directory.exists() ? - QUrl::fromLocalFile(directory.absolutePath()) : - QUrl()); if (options->initiallySelectedNameFilter().isEmpty()) options->setInitiallySelectedNameFilter(q->selectedNameFilter()); if (options->initiallySelectedFiles().isEmpty()) @@ -933,7 +925,6 @@ void QFileDialog::setDirectory(const QString &directory) { Q_D(QFileDialog); QString newDirectory = directory; - QFileInfo info(directory); //we remove .. and . from the given path if exist if (!directory.isEmpty()) newDirectory = QDir::cleanPath(directory); @@ -1000,7 +991,7 @@ void QFileDialog::setDirectoryUrl(const QUrl &directory) d->setDirectory_sys(directory); else if (directory.isLocalFile()) setDirectory(directory.toLocalFile()); - else + else if (d->usingWidgets()) qWarning() << "Non-native QFileDialog supports only local files"; } @@ -1219,7 +1210,7 @@ QList<QUrl> QFileDialogPrivate::userSelectedFiles() const return files; } -QStringList QFileDialogPrivate::addDefaultSuffixToFiles(const QStringList filesToFix) const +QStringList QFileDialogPrivate::addDefaultSuffixToFiles(const QStringList &filesToFix) const { QStringList files; for (int i=0; i<filesToFix.size(); ++i) { @@ -1525,6 +1516,8 @@ void QFileDialog::setFilter(QDir::Filters filters) d->showHiddenAction->setChecked((filters & QDir::Hidden)); } +#ifndef QT_NO_MIMETYPE + static QString nameFilterForMime(const QString &mimeType) { QMimeDatabase db; @@ -1594,6 +1587,8 @@ void QFileDialog::selectMimeTypeFilter(const QString &filter) selectNameFilter(text); } +#endif // QT_NO_MIMETYPE + /*! \property QFileDialog::viewMode \brief the way files and directories are displayed in the dialog @@ -2852,9 +2847,12 @@ void QFileDialogPrivate::createWidgets() if (!options->sidebarUrls().isEmpty()) q->setSidebarUrls(options->sidebarUrls()); q->setDirectoryUrl(options->initialDirectory()); +#ifndef QT_NO_MIMETYPE if (!options->mimeTypeFilters().isEmpty()) q->setMimeTypeFilters(options->mimeTypeFilters()); - else if (!options->nameFilters().isEmpty()) + else +#endif + if (!options->nameFilters().isEmpty()) q->setNameFilters(options->nameFilters()); q->selectNameFilter(options->initiallySelectedNameFilter()); q->setDefaultSuffix(options->defaultSuffix()); @@ -3595,7 +3593,7 @@ void QFileDialogPrivate::_q_rowsInserted(const QModelIndex &parent) return; } -void QFileDialogPrivate::_q_fileRenamed(const QString &path, const QString oldName, const QString newName) +void QFileDialogPrivate::_q_fileRenamed(const QString &path, const QString &oldName, const QString &newName) { const QFileDialog::FileMode fileMode = q_func()->fileMode(); if (fileMode == QFileDialog::Directory || fileMode == QFileDialog::DirectoryOnly) { diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h index 70e498a2cd..95209bceb5 100644 --- a/src/widgets/dialogs/qfiledialog.h +++ b/src/widgets/dialogs/qfiledialog.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -55,7 +55,6 @@ class QAbstractProxyModel; class Q_WIDGETS_EXPORT QFileDialog : public QDialog { Q_OBJECT - Q_ENUMS(ViewMode FileMode AcceptMode Option) Q_FLAGS(Options) Q_PROPERTY(ViewMode viewMode READ viewMode WRITE setViewMode) Q_PROPERTY(FileMode fileMode READ fileMode WRITE setFileMode) @@ -70,8 +69,11 @@ class Q_WIDGETS_EXPORT QFileDialog : public QDialog public: enum ViewMode { Detail, List }; + Q_ENUM(ViewMode) enum FileMode { AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly }; + Q_ENUM(FileMode) enum AcceptMode { AcceptOpen, AcceptSave }; + Q_ENUM(AcceptMode) enum DialogLabel { LookIn, FileName, FileType, Accept, Reject }; enum Option @@ -85,6 +87,7 @@ public: HideNameFilterDetails = 0x00000040, DontUseCustomDirectoryIcons = 0x00000080 }; + Q_ENUM(Option) Q_DECLARE_FLAGS(Options, Option) QFileDialog(QWidget *parent, Qt::WindowFlags f); @@ -116,9 +119,11 @@ public: void selectNameFilter(const QString &filter); QString selectedNameFilter() const; +#ifndef QT_NO_MIMETYPE void setMimeTypeFilters(const QStringList &filters); QStringList mimeTypeFilters() const; void selectMimeTypeFilter(const QString &filter); +#endif QDir::Filters filter() const; void setFilter(QDir::Filters filters); @@ -172,15 +177,9 @@ public: void setOptions(Options options); Options options() const; -#ifdef Q_NO_USING_KEYWORD -#ifndef Q_QDOC - void open() { QDialog::open(); } -#endif -#else using QDialog::open; -#endif void open(QObject *receiver, const char *member); - void setVisible(bool visible); + void setVisible(bool visible) Q_DECL_OVERRIDE; Q_SIGNALS: void fileSelected(const QString &file); @@ -256,9 +255,9 @@ public: protected: QFileDialog(const QFileDialogArgs &args); - void done(int result); - void accept(); - void changeEvent(QEvent *e); + void done(int result) Q_DECL_OVERRIDE; + void accept() Q_DECL_OVERRIDE; + void changeEvent(QEvent *e) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QFileDialog) @@ -292,7 +291,8 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_autoCompleteFileName(const QString &text)) Q_PRIVATE_SLOT(d_func(), void _q_rowsInserted(const QModelIndex & parent)) Q_PRIVATE_SLOT(d_func(), void _q_fileRenamed(const QString &path, - const QString oldName, const QString newName)) + const QString &oldName, + const QString &newName)) friend class QPlatformDialogHelper; }; diff --git a/src/widgets/dialogs/qfiledialog.ui b/src/widgets/dialogs/qfiledialog.ui index 7f6e59c908..7bbfb0a10b 100644 --- a/src/widgets/dialogs/qfiledialog.ui +++ b/src/widgets/dialogs/qfiledialog.ui @@ -2,41 +2,33 @@ <ui version="4.0"> <comment>********************************************************************* ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:LGPL21$ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** ** $QT_END_LICENSE$ ** *********************************************************************</comment> diff --git a/src/widgets/dialogs/qfiledialog_embedded.ui b/src/widgets/dialogs/qfiledialog_embedded.ui index 4cdc620437..6263902474 100644 --- a/src/widgets/dialogs/qfiledialog_embedded.ui +++ b/src/widgets/dialogs/qfiledialog_embedded.ui @@ -2,41 +2,33 @@ <ui version="4.0"> <comment>********************************************************************* ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:LGPL21$ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** ** $QT_END_LICENSE$ ** *********************************************************************</comment> diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h index cc2f481eb9..9eb08f7a3a 100644 --- a/src/widgets/dialogs/qfiledialog_p.h +++ b/src/widgets/dialogs/qfiledialog_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -123,7 +123,7 @@ public: static QString initialSelection(const QUrl &path); QStringList typedFiles() const; QList<QUrl> userSelectedFiles() const; - QStringList addDefaultSuffixToFiles(const QStringList filesToFix) const; + QStringList addDefaultSuffixToFiles(const QStringList &filesToFix) const; QList<QUrl> addDefaultSuffixToUrls(const QList<QUrl> &urlsToFix) const; bool removeDirectory(const QString &path); void setLabelTextControl(QFileDialog::DialogLabel label, const QString &text); @@ -212,7 +212,7 @@ public: void _q_goToUrl(const QUrl &url); void _q_autoCompleteFileName(const QString &); void _q_rowsInserted(const QModelIndex & parent); - void _q_fileRenamed(const QString &path, const QString oldName, const QString newName); + void _q_fileRenamed(const QString &path, const QString &oldName, const QString &newName); // layout #ifndef QT_NO_PROXYMODEL @@ -243,7 +243,7 @@ public: // setVisible_sys returns true if it ends up showing a native // dialog. Returning false means that a non-native dialog must be // used instead. - bool canBeNativeDialog() const; + bool canBeNativeDialog() const Q_DECL_OVERRIDE; inline bool usingWidgets() const; void setDirectory_sys(const QUrl &directory); @@ -273,9 +273,9 @@ public: ~QFileDialogPrivate(); private: - virtual void initHelper(QPlatformDialogHelper *); - virtual void helperPrepareShow(QPlatformDialogHelper *); - virtual void helperDone(QDialog::DialogCode, QPlatformDialogHelper *); + virtual void initHelper(QPlatformDialogHelper *) Q_DECL_OVERRIDE; + virtual void helperPrepareShow(QPlatformDialogHelper *) Q_DECL_OVERRIDE; + virtual void helperDone(QDialog::DialogCode, QPlatformDialogHelper *) Q_DECL_OVERRIDE; Q_DISABLE_COPY(QFileDialogPrivate) }; @@ -285,7 +285,7 @@ class QFileDialogLineEdit : public QLineEdit public: QFileDialogLineEdit(QWidget *parent = 0) : QLineEdit(parent), d_ptr(0){} void setFileDialogPrivate(QFileDialogPrivate *d_pointer) {d_ptr = d_pointer; } - void keyPressEvent(QKeyEvent *e); + void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE; bool hideOnEsc; private: QFileDialogPrivate *d_ptr; @@ -296,10 +296,10 @@ class QFileDialogComboBox : public QComboBox public: QFileDialogComboBox(QWidget *parent = 0) : QComboBox(parent), urlModel(0) {} void setFileDialogPrivate(QFileDialogPrivate *d_pointer); - void showPopup(); + void showPopup() Q_DECL_OVERRIDE; void setHistory(const QStringList &paths); QStringList history() const { return m_history; } - void paintEvent(QPaintEvent *); + void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; private: QUrlModel *urlModel; @@ -312,9 +312,9 @@ class QFileDialogListView : public QListView public: QFileDialogListView(QWidget *parent = 0); void setFileDialogPrivate(QFileDialogPrivate *d_pointer); - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; protected: - void keyPressEvent(QKeyEvent *e); + void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE; private: QFileDialogPrivate *d_ptr; }; @@ -324,10 +324,10 @@ class QFileDialogTreeView : public QTreeView public: QFileDialogTreeView(QWidget *parent); void setFileDialogPrivate(QFileDialogPrivate *d_pointer); - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; protected: - void keyPressEvent(QKeyEvent *e); + void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE; private: QFileDialogPrivate *d_ptr; }; diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp index e7983c64c2..df07de7975 100644 --- a/src/widgets/dialogs/qfileinfogatherer.cpp +++ b/src/widgets/dialogs/qfileinfogatherer.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -47,15 +47,15 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_FILESYSTEMMODEL #ifdef QT_BUILD_INTERNAL -static bool fetchedRoot = false; +static QBasicAtomicInt fetchedRoot = Q_BASIC_ATOMIC_INITIALIZER(false); Q_AUTOTEST_EXPORT void qt_test_resetFetchedRoot() { - fetchedRoot = false; + fetchedRoot.store(false); } Q_AUTOTEST_EXPORT bool qt_test_isFetchedRoot() { - return fetchedRoot; + return fetchedRoot.load(); } #endif @@ -273,7 +273,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil // List drives if (path.isEmpty()) { #ifdef QT_BUILD_INTERNAL - fetchedRoot = true; + fetchedRoot.store(true); #endif QFileInfoList infoList; if (files.isEmpty()) { diff --git a/src/widgets/dialogs/qfileinfogatherer_p.h b/src/widgets/dialogs/qfileinfogatherer_p.h index 88eac5fbe8..6bd15b5388 100644 --- a/src/widgets/dialogs/qfileinfogatherer_p.h +++ b/src/widgets/dialogs/qfileinfogatherer_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index baa55cb88f..04238f242a 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ diff --git a/src/widgets/dialogs/qfilesystemmodel.h b/src/widgets/dialogs/qfilesystemmodel.h index bde699d2a0..7c98a102f3 100644 --- a/src/widgets/dialogs/qfilesystemmodel.h +++ b/src/widgets/dialogs/qfilesystemmodel.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -72,31 +72,31 @@ public: explicit QFileSystemModel(QObject *parent = 0); ~QFileSystemModel(); - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; QModelIndex index(const QString &path, int column = 0) const; - QModelIndex parent(const QModelIndex &child) const; - bool hasChildren(const QModelIndex &parent = QModelIndex()) const; - bool canFetchMore(const QModelIndex &parent) const; - void fetchMore(const QModelIndex &parent); + QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE; + bool hasChildren(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + bool canFetchMore(const QModelIndex &parent) const Q_DECL_OVERRIDE; + void fetchMore(const QModelIndex &parent) Q_DECL_OVERRIDE; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; QVariant myComputer(int role = Qt::DisplayRole) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; - void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); + void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) Q_DECL_OVERRIDE; - QStringList mimeTypes() const; - QMimeData *mimeData(const QModelIndexList &indexes) const; + QStringList mimeTypes() const Q_DECL_OVERRIDE; + QMimeData *mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE; bool dropMimeData(const QMimeData *data, Qt::DropAction action, - int row, int column, const QModelIndex &parent); - Qt::DropActions supportedDropActions() const; + int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE; + Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE; // QFileSystemModel specific API QModelIndex setRootPath(const QString &path); @@ -137,8 +137,8 @@ public: protected: QFileSystemModel(QFileSystemModelPrivate &, QObject *parent = 0); - void timerEvent(QTimerEvent *event); - bool event(QEvent *event); + void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; + bool event(QEvent *event) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QFileSystemModel) diff --git a/src/widgets/dialogs/qfilesystemmodel_p.h b/src/widgets/dialogs/qfilesystemmodel_p.h index 867cdd9f0b..dd4b25d59c 100644 --- a/src/widgets/dialogs/qfilesystemmodel_p.h +++ b/src/widgets/dialogs/qfilesystemmodel_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -148,7 +148,7 @@ public: } // children shouldn't normally be accessed directly, use node() - inline int visibleLocation(QString childName) { + inline int visibleLocation(const QString &childName) { return visibleChildren.indexOf(childName); } void updateIcon(QFileIconProvider *iconProvider, const QString &path) { diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp index d12b109d9f..d47dd3562f 100644 --- a/src/widgets/dialogs/qfontdialog.cpp +++ b/src/widgets/dialogs/qfontdialog.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -57,10 +57,6 @@ #include <private/qdialog_p.h> #include <private/qfont_p.h> -#include <QtGui/private/qguiapplication_p.h> -#include <qpa/qplatformintegration.h> -#include <qpa/qplatformfontdatabase.h> - QT_BEGIN_NAMESPACE class QFontListView : public QListView @@ -84,7 +80,7 @@ public: int row = QListView::currentIndex().row(); return row < 0 ? QString() : model()->stringList().at(row); } - void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { + void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) Q_DECL_OVERRIDE { QListView::currentChanged(current, previous); if (current.isValid()) emit highlighted(current.row()); @@ -482,11 +478,11 @@ void QFontDialogPrivate::updateFamilies() const QFontDialog::FontDialogOptions spacingMask = (QFontDialog::ProportionalFonts | QFontDialog::MonospacedFonts); const QFontDialog::FontDialogOptions options = q->options(); - QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); + QFontDatabase fdb; QStringList familyNames; foreach (const QString &family, fdb.families(writingSystem)) { - if (pfdb->isPrivateFontFamily(family)) + if (fdb.isPrivateFamily(family)) continue; if ((options & scalableMask) && (options & scalableMask) != scalableMask) { diff --git a/src/widgets/dialogs/qfontdialog.h b/src/widgets/dialogs/qfontdialog.h index 455b5d3f3e..8ca9bf14dd 100644 --- a/src/widgets/dialogs/qfontdialog.h +++ b/src/widgets/dialogs/qfontdialog.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -49,7 +49,6 @@ class Q_WIDGETS_EXPORT QFontDialog : public QDialog { Q_OBJECT Q_DECLARE_PRIVATE(QFontDialog) - Q_ENUMS(FontDialogOption) Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged) Q_PROPERTY(FontDialogOptions options READ options WRITE setOptions) @@ -62,6 +61,7 @@ public: MonospacedFonts = 0x00000010, ProportionalFonts = 0x00000020 }; + Q_ENUM(FontDialogOption) Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption) @@ -79,16 +79,10 @@ public: void setOptions(FontDialogOptions options); FontDialogOptions options() const; -#ifdef Q_NO_USING_KEYWORD -#ifndef Q_QDOC - void open() { QDialog::open(); } -#endif -#else using QDialog::open; -#endif void open(QObject *receiver, const char *member); - void setVisible(bool visible); + void setVisible(bool visible) Q_DECL_OVERRIDE; static QFont getFont(bool *ok, QWidget *parent = 0); static QFont getFont(bool *ok, const QFont &initial, QWidget *parent = 0, const QString &title = QString(), @@ -99,9 +93,9 @@ Q_SIGNALS: void fontSelected(const QFont &font); protected: - void changeEvent(QEvent *event); - void done(int result); - bool eventFilter(QObject *object, QEvent *event); + void changeEvent(QEvent *event) Q_DECL_OVERRIDE; + void done(int result) Q_DECL_OVERRIDE; + bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE; private: Q_DISABLE_COPY(QFontDialog) diff --git a/src/widgets/dialogs/qfontdialog_p.h b/src/widgets/dialogs/qfontdialog_p.h index 3af6f9f29a..e456faaa61 100644 --- a/src/widgets/dialogs/qfontdialog_p.h +++ b/src/widgets/dialogs/qfontdialog_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -135,12 +135,12 @@ public: QPointer<QObject> receiverToDisconnectOnClose; QByteArray memberToDisconnectOnClose; - bool canBeNativeDialog() const; + bool canBeNativeDialog() const Q_DECL_OVERRIDE; void _q_runNativeAppModalPanel(); private: - virtual void initHelper(QPlatformDialogHelper *); - virtual void helperPrepareShow(QPlatformDialogHelper *); + virtual void initHelper(QPlatformDialogHelper *) Q_DECL_OVERRIDE; + virtual void helperPrepareShow(QPlatformDialogHelper *) Q_DECL_OVERRIDE; }; #endif // QT_NO_FONTDIALOG diff --git a/src/widgets/dialogs/qfscompleter_p.h b/src/widgets/dialogs/qfscompleter_p.h index a5871e34f7..5173d699e0 100644 --- a/src/widgets/dialogs/qfscompleter_p.h +++ b/src/widgets/dialogs/qfscompleter_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -62,8 +62,8 @@ public: setCaseSensitivity(Qt::CaseInsensitive); #endif } - QString pathFromIndex(const QModelIndex &index) const; - QStringList splitPath(const QString& path) const; + QString pathFromIndex(const QModelIndex &index) const Q_DECL_OVERRIDE; + QStringList splitPath(const QString& path) const Q_DECL_OVERRIDE; QAbstractProxyModel *proxyModel; QFileSystemModel *sourceModel; diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp index b52cebadfa..9c78f5e9ac 100644 --- a/src/widgets/dialogs/qinputdialog.cpp +++ b/src/widgets/dialogs/qinputdialog.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -111,7 +111,7 @@ private slots: void notifyTextChanged() { emit textChanged(hasAcceptableInput()); } private: - void keyPressEvent(QKeyEvent *event) { + void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE { if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) && !hasAcceptableInput()) { #ifndef QT_NO_PROPERTIES setProperty("value", property("value")); @@ -122,7 +122,7 @@ private: notifyTextChanged(); } - void mousePressEvent(QMouseEvent *event) { + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE { QSpinBox::mousePressEvent(event); notifyTextChanged(); } @@ -146,7 +146,7 @@ private slots: void notifyTextChanged() { emit textChanged(hasAcceptableInput()); } private: - void keyPressEvent(QKeyEvent *event) { + void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE { if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) && !hasAcceptableInput()) { #ifndef QT_NO_PROPERTIES setProperty("value", property("value")); @@ -157,7 +157,7 @@ private: notifyTextChanged(); } - void mousePressEvent(QMouseEvent *event) { + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE { QDoubleSpinBox::mousePressEvent(event); notifyTextChanged(); } diff --git a/src/widgets/dialogs/qinputdialog.h b/src/widgets/dialogs/qinputdialog.h index 4511e367d4..84130d5f90 100644 --- a/src/widgets/dialogs/qinputdialog.h +++ b/src/widgets/dialogs/qinputdialog.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -143,19 +143,13 @@ public: void setCancelButtonText(const QString &text); QString cancelButtonText() const; -#ifdef Q_NO_USING_KEYWORD -#ifndef Q_QDOC - void open() { QDialog::open(); } -#endif -#else using QDialog::open; -#endif void open(QObject *receiver, const char *member); - QSize minimumSizeHint() const; - QSize sizeHint() const; + QSize minimumSizeHint() const Q_DECL_OVERRIDE; + QSize sizeHint() const Q_DECL_OVERRIDE; - void setVisible(bool visible); + void setVisible(bool visible) Q_DECL_OVERRIDE; static QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode echo = QLineEdit::Normal, @@ -195,7 +189,7 @@ Q_SIGNALS: void doubleValueSelected(double value); public: - void done(int result); + void done(int result) Q_DECL_OVERRIDE; private: Q_DISABLE_COPY(QInputDialog) diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 391c1d4fb9..66152387e4 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -89,7 +89,7 @@ public: { public: TextEdit(QWidget *parent=0) : QTextEdit(parent) { } - void contextMenuEvent(QContextMenuEvent * e) + void contextMenuEvent(QContextMenuEvent * e) Q_DECL_OVERRIDE { #ifndef QT_NO_CONTEXTMENU QMenu *menu = createStandardContextMenu(); @@ -167,7 +167,7 @@ public: void setLabel(DetailButtonLabel lbl) { setText(label(lbl)); } - QSize sizeHint() const + QSize sizeHint() const Q_DECL_OVERRIDE { ensurePolished(); QStyleOptionButton opt; @@ -256,9 +256,9 @@ public: QByteArray signalToDisconnectOnClose; QSharedPointer<QMessageDialogOptions> options; private: - void initHelper(QPlatformDialogHelper *); - void helperPrepareShow(QPlatformDialogHelper *); - void helperDone(QDialog::DialogCode, QPlatformDialogHelper *); + void initHelper(QPlatformDialogHelper *) Q_DECL_OVERRIDE; + void helperPrepareShow(QPlatformDialogHelper *) Q_DECL_OVERRIDE; + void helperDone(QDialog::DialogCode, QPlatformDialogHelper *) Q_DECL_OVERRIDE; }; void QMessageBoxPrivate::init(const QString &title, const QString &text) @@ -1901,11 +1901,12 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title) "and conditions of the GNU LGPL version 2.1.</p>" "<p>Please see <a href=\"http://%2/\">%2</a> " "for an overview of Qt licensing.</p>" - "<p>Copyright (C) %1 Digia Plc and/or its subsidiary(-ies) and other " + "<p>Copyright (C) %1 The Qt Company Ltd and other " "contributors.</p>" - "<p>Qt and the Qt logo are trademarks of Digia Plc and/or its subsidiary(-ies).</p>" - "<p>Qt is a Digia product developed as an open source project. See <a href=\"http://%3/\">%3</a> " - "for more information.</p>" + "<p>Qt and the Qt logo are trademarks of The Qt Company Ltd and/or its" + "subsidiary(-ies).</p>" + "<p>Qt is The Qt Company Ltd product developed as an open source" + "project. See <a href=\"http://%3/\">%3</a> for more information.</p>" ).arg(QStringLiteral("2015"), QStringLiteral("qt.io/licensing"), QStringLiteral("qt.io")); diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h index 1b47e9c575..464bf734dc 100644 --- a/src/widgets/dialogs/qmessagebox.h +++ b/src/widgets/dialogs/qmessagebox.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -49,7 +49,6 @@ class QCheckBox; class Q_WIDGETS_EXPORT QMessageBox : public QDialog { Q_OBJECT - Q_ENUMS(Icon) Q_FLAGS(StandardButtons) Q_PROPERTY(QString text READ text WRITE setText) Q_PROPERTY(Icon icon READ icon WRITE setIcon) @@ -71,6 +70,7 @@ public: Critical = 3, Question = 4 }; + Q_ENUM(Icon) enum ButtonRole { // keep this in sync with QDialogButtonBox::ButtonRole and QPlatformDialogHelper::ButtonRole @@ -140,13 +140,7 @@ public: void setVisible(bool visible); #endif -#ifdef Q_NO_USING_KEYWORD -#ifndef Q_QDOC - void open() { QDialog::open(); } -#endif -#else using QDialog::open; -#endif void open(QObject *receiver, const char *member); QList<QAbstractButton *> buttons() const; @@ -293,12 +287,12 @@ public Q_SLOTS: #endif protected: - bool event(QEvent *e); - void resizeEvent(QResizeEvent *event); - void showEvent(QShowEvent *event); - void closeEvent(QCloseEvent *event); - void keyPressEvent(QKeyEvent *event); - void changeEvent(QEvent *event); + bool event(QEvent *e) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; + void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; + void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; + void changeEvent(QEvent *event) Q_DECL_OVERRIDE; private: Q_PRIVATE_SLOT(d_func(), void _q_buttonClicked(QAbstractButton *)) diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp index 371949e768..4e8e245813 100644 --- a/src/widgets/dialogs/qprogressdialog.cpp +++ b/src/widgets/dialogs/qprogressdialog.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -65,6 +65,7 @@ public: QProgressDialogPrivate() : label(0), cancel(0), bar(0), shown_once(false), cancellation_flag(false), + setValue_called(false), showTime(defaultShowTime), #ifndef QT_NO_SHORTCUT escapeShortcut(0), @@ -87,6 +88,7 @@ public: QTimer *forceTimer; bool shown_once; bool cancellation_flag; + bool setValue_called; QElapsedTimer starttime; #ifndef QT_NO_CURSOR QCursor parentCursor; @@ -123,6 +125,8 @@ void QProgressDialogPrivate::init(const QString &labelText, const QString &cance } else { q->setCancelButtonText(cancelText); } + starttime.start(); + forceTimer->start(showTime); } void QProgressDialogPrivate::layout() @@ -598,6 +602,7 @@ void QProgressDialog::reset() d->bar->reset(); d->cancellation_flag = false; d->shown_once = false; + d->setValue_called = false; d->forceTimer->stop(); /* @@ -636,7 +641,7 @@ int QProgressDialog::value() const \brief the current amount of progress made. For the progress dialog to work as expected, you should initially set - this property to 0 and finally set it to + this property to QProgressDialog::minimum() and finally set it to QProgressDialog::maximum(); you can call setValue() any number of times in-between. @@ -651,8 +656,7 @@ int QProgressDialog::value() const void QProgressDialog::setValue(int progress) { Q_D(QProgressDialog); - if (progress == d->bar->value() - || (d->bar->value() == -1 && progress == d->bar->maximum())) + if (d->setValue_called && progress == d->bar->value()) return; d->bar->setValue(progress); @@ -661,11 +665,13 @@ void QProgressDialog::setValue(int progress) if (isModal()) QApplication::processEvents(); } else { - if (progress == 0) { + if ((!d->setValue_called && progress == 0 /* for compat with Qt < 5.4 */) || progress == minimum()) { d->starttime.start(); d->forceTimer->start(d->showTime); + d->setValue_called = true; return; } else { + d->setValue_called = true; bool need_show; int elapsed = d->starttime.elapsed(); if (elapsed >= d->showTime) { @@ -691,7 +697,7 @@ void QProgressDialog::setValue(int progress) d->shown_once = true; } } -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC QApplication::flush(); #endif } @@ -759,7 +765,7 @@ void QProgressDialog::setMinimumDuration(int ms) { Q_D(QProgressDialog); d->showTime = ms; - if (d->bar->value() == 0) { + if (d->bar->value() == d->bar->minimum()) { d->forceTimer->stop(); d->forceTimer->start(ms); } diff --git a/src/widgets/dialogs/qprogressdialog.h b/src/widgets/dialogs/qprogressdialog.h index 7547f06682..51c45f5d30 100644 --- a/src/widgets/dialogs/qprogressdialog.h +++ b/src/widgets/dialogs/qprogressdialog.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -77,7 +77,7 @@ public: int value() const; - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; QString labelText() const; int minimumDuration() const; @@ -87,13 +87,7 @@ public: void setAutoClose(bool close); bool autoClose() const; -#ifdef Q_NO_USING_KEYWORD -#ifndef Q_QDOC - void open() { QDialog::open(); } -#endif -#else using QDialog::open; -#endif void open(QObject *receiver, const char *member); public Q_SLOTS: @@ -111,10 +105,10 @@ Q_SIGNALS: void canceled(); protected: - void resizeEvent(QResizeEvent *event); - void closeEvent(QCloseEvent *event); - void changeEvent(QEvent *event); - void showEvent(QShowEvent *event); + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; + void changeEvent(QEvent *event) Q_DECL_OVERRIDE; + void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; protected Q_SLOTS: void forceShow(); diff --git a/src/widgets/dialogs/qsidebar.cpp b/src/widgets/dialogs/qsidebar.cpp index f5157931cb..6fbcce801d 100644 --- a/src/widgets/dialogs/qsidebar.cpp +++ b/src/widgets/dialogs/qsidebar.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -247,10 +247,11 @@ void QUrlModel::addUrls(const QList<QUrl> &list, int row, bool move) for (int j = 0; move && j < rowCount(); ++j) { QString local = index(j, 0).data(UrlRole).toUrl().toLocalFile(); #if defined(Q_OS_WIN) - if (index(j, 0).data(UrlRole).toUrl().toLocalFile().toLower() == cleanUrl.toLower()) { + const Qt::CaseSensitivity cs = Qt::CaseInsensitive; #else - if (index(j, 0).data(UrlRole).toUrl().toLocalFile() == cleanUrl) { + const Qt::CaseSensitivity cs = Qt::CaseSensitive; #endif + if (!cleanUrl.compare(local, cs)) { removeRow(j); if (j <= row) row--; diff --git a/src/widgets/dialogs/qsidebar_p.h b/src/widgets/dialogs/qsidebar_p.h index 402863da85..cf49ba410c 100644 --- a/src/widgets/dialogs/qsidebar_p.h +++ b/src/widgets/dialogs/qsidebar_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -61,7 +61,7 @@ class QSideBarDelegate : public QStyledItemDelegate public: QSideBarDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) {} void initStyleOption(QStyleOptionViewItem *option, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; }; class Q_AUTOTEST_EXPORT QUrlModel : public QStandardItemModel @@ -76,14 +76,14 @@ public: QUrlModel(QObject *parent = 0); - QStringList mimeTypes() const; - QMimeData *mimeData(const QModelIndexList &indexes) const; + QStringList mimeTypes() const Q_DECL_OVERRIDE; + QMimeData *mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE; #ifndef QT_NO_DRAGANDDROP bool canDrop(QDragEnterEvent *event); - bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); + bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE; #endif - Qt::ItemFlags flags(const QModelIndex &index) const; - bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole); + Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; + bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) Q_DECL_OVERRIDE; void setUrls(const QList<QUrl> &list); void addUrls(const QList<QUrl> &urls, int row = -1, bool move = true); @@ -116,7 +116,7 @@ public: void setModelAndUrls(QFileSystemModel *model, const QList<QUrl> &newUrls); ~QSidebar(); - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; void setUrls(const QList<QUrl> &list) { urlModel->setUrls(list); } void addUrls(const QList<QUrl> &list, int row) { urlModel->addUrls(list, row); } @@ -125,10 +125,10 @@ public: void selectUrl(const QUrl &url); protected: - bool event(QEvent * e); - void focusInEvent(QFocusEvent *event); + bool event(QEvent * e) Q_DECL_OVERRIDE; + void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE; #ifndef QT_NO_DRAGANDDROP - void dragEnterEvent(QDragEnterEvent *event); + void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; #endif private Q_SLOTS: diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index a378daa3d3..bf3e44b6a6 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -290,7 +290,7 @@ public: Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat); protected: - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; #if !defined(QT_NO_STYLE_WINDOWSVISTA) private: bool vistaDisabled() const; @@ -446,7 +446,7 @@ public: m_layout->addWidget(m_sideWidget); } - QSize minimumSizeHint() const { + QSize minimumSizeHint() const Q_DECL_OVERRIDE { if (!pixmap() && !pixmap()->isNull()) return pixmap()->size(); return QFrame::minimumSizeHint(); diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h index 25b0d5e3ee..517edde377 100644 --- a/src/widgets/dialogs/qwizard.h +++ b/src/widgets/dialogs/qwizard.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -48,7 +48,6 @@ class QWizardPrivate; class Q_WIDGETS_EXPORT QWizard : public QDialog { Q_OBJECT - Q_ENUMS(WizardStyle WizardOption) Q_FLAGS(WizardOptions) Q_PROPERTY(WizardStyle wizardStyle READ wizardStyle WRITE setWizardStyle) Q_PROPERTY(WizardOptions options READ options WRITE setOptions) @@ -90,6 +89,7 @@ public: AeroStyle, NStyles }; + Q_ENUM(WizardStyle) enum WizardOption { IndependentPages = 0x00000001, @@ -110,6 +110,7 @@ public: HaveCustomButton3 = 0x00008000, NoCancelButtonOnLastPage = 0x00010000 }; + Q_ENUM(WizardOption) Q_DECLARE_FLAGS(WizardOptions, WizardOption) @@ -161,8 +162,8 @@ public: void setDefaultProperty(const char *className, const char *property, const char *changedSignal); - void setVisible(bool visible); - QSize sizeHint() const; + void setVisible(bool visible) Q_DECL_OVERRIDE; + QSize sizeHint() const Q_DECL_OVERRIDE; Q_SIGNALS: void currentIdChanged(int id); @@ -177,13 +178,13 @@ public Q_SLOTS: void restart(); protected: - bool event(QEvent *event); - void resizeEvent(QResizeEvent *event); - void paintEvent(QPaintEvent *event); + bool event(QEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; #ifdef Q_OS_WIN bool nativeEvent(const QByteArray &eventType, void * message, long * result); #endif - void done(int result); + void done(int result) Q_DECL_OVERRIDE; virtual void initializePage(int id); virtual void cleanupPage(int id); diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp index 69761473fc..701fea1c03 100644 --- a/src/widgets/dialogs/qwizard_win.cpp +++ b/src/widgets/dialogs/qwizard_win.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ diff --git a/src/widgets/dialogs/qwizard_win_p.h b/src/widgets/dialogs/qwizard_win_p.h index 0d39f03ee3..8c36472bee 100644 --- a/src/widgets/dialogs/qwizard_win_p.h +++ b/src/widgets/dialogs/qwizard_win_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ |