summaryrefslogtreecommitdiffstats
path: root/src/widgets/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/util')
-rw-r--r--src/widgets/util/qcompleter.h10
-rw-r--r--src/widgets/util/qcompleter_p.h26
-rw-r--r--src/widgets/util/qflickgesture.cpp2
-rw-r--r--src/widgets/util/qscroller.cpp11
-rw-r--r--src/widgets/util/qsystemtrayicon.h6
-rw-r--r--src/widgets/util/qsystemtrayicon_p.h8
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp12
-rw-r--r--src/widgets/util/qundogroup.h2
-rw-r--r--src/widgets/util/qundostack.h6
-rw-r--r--src/widgets/util/qundoview.cpp10
-rw-r--r--src/widgets/util/qundoview.h6
11 files changed, 50 insertions, 49 deletions
diff --git a/src/widgets/util/qcompleter.h b/src/widgets/util/qcompleter.h
index 1a2c2440f5..de79302e15 100644
--- a/src/widgets/util/qcompleter.h
+++ b/src/widgets/util/qcompleter.h
@@ -82,10 +82,10 @@ public:
CaseInsensitivelySortedModel
};
- QCompleter(QObject *parent = Q_NULLPTR);
- QCompleter(QAbstractItemModel *model, QObject *parent = Q_NULLPTR);
+ QCompleter(QObject *parent = nullptr);
+ QCompleter(QAbstractItemModel *model, QObject *parent = nullptr);
#ifndef QT_NO_STRINGLISTMODEL
- QCompleter(const QStringList& completions, QObject *parent = Q_NULLPTR);
+ QCompleter(const QStringList& completions, QObject *parent = nullptr);
#endif
~QCompleter();
@@ -142,8 +142,8 @@ public:
virtual QStringList splitPath(const QString &path) const;
protected:
- bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE;
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *o, QEvent *e) override;
+ bool event(QEvent *) override;
Q_SIGNALS:
void activated(const QString &text);
diff --git a/src/widgets/util/qcompleter_p.h b/src/widgets/util/qcompleter_p.h
index e76dcdc8bc..765363744b 100644
--- a/src/widgets/util/qcompleter_p.h
+++ b/src/widgets/util/qcompleter_p.h
@@ -177,7 +177,7 @@ class QSortedModelEngine : public QCompletionEngine
{
public:
QSortedModelEngine(QCompleterPrivate *c) : QCompletionEngine(c) { }
- QMatchData filter(const QString&, const QModelIndex&, int) Q_DECL_OVERRIDE;
+ QMatchData filter(const QString&, const QModelIndex&, int) override;
QIndexMapper indexHint(QString, const QModelIndex&, Qt::SortOrder);
Qt::SortOrder sortOrder(const QModelIndex&) const;
};
@@ -187,8 +187,8 @@ class QUnsortedModelEngine : public QCompletionEngine
public:
QUnsortedModelEngine(QCompleterPrivate *c) : QCompletionEngine(c) { }
- void filterOnDemand(int) Q_DECL_OVERRIDE;
- QMatchData filter(const QString&, const QModelIndex&, int) Q_DECL_OVERRIDE;
+ void filterOnDemand(int) override;
+ QMatchData filter(const QString&, const QModelIndex&, int) override;
private:
int buildIndices(const QString& str, const QModelIndex& parent, int n,
const QIndexMapper& iv, QMatchData* m);
@@ -199,7 +199,7 @@ class QCompleterItemDelegate : public QItemDelegate
public:
QCompleterItemDelegate(QAbstractItemView *view)
: QItemDelegate(view), view(view) { }
- void paint(QPainter *p, const QStyleOptionViewItem& opt, const QModelIndex& idx) const Q_DECL_OVERRIDE {
+ void paint(QPainter *p, const QStyleOptionViewItem& opt, const QModelIndex& idx) const override {
QStyleOptionViewItem optCopy = opt;
optCopy.showDecorationSelected = true;
if (view->currentIndex() == idx)
@@ -228,16 +228,16 @@ public:
bool setCurrentRow(int row);
QModelIndex currentIndex(bool) const;
- QModelIndex index(int row, int column, const QModelIndex & = QModelIndex()) const Q_DECL_OVERRIDE;
- int rowCount(const QModelIndex &index = QModelIndex()) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &index = QModelIndex()) const Q_DECL_OVERRIDE;
- bool hasChildren(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex parent(const QModelIndex & = QModelIndex()) const Q_DECL_OVERRIDE { return QModelIndex(); }
- QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ QModelIndex index(int row, int column, const QModelIndex & = QModelIndex()) const override;
+ int rowCount(const QModelIndex &index = QModelIndex()) const override;
+ int columnCount(const QModelIndex &index = QModelIndex()) const override;
+ bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex & = QModelIndex()) const override { return QModelIndex(); }
+ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
- void setSourceModel(QAbstractItemModel *sourceModel) Q_DECL_OVERRIDE;
- QModelIndex mapToSource(const QModelIndex& proxyIndex) const Q_DECL_OVERRIDE;
- QModelIndex mapFromSource(const QModelIndex& sourceIndex) const Q_DECL_OVERRIDE;
+ void setSourceModel(QAbstractItemModel *sourceModel) override;
+ QModelIndex mapToSource(const QModelIndex& proxyIndex) const override;
+ QModelIndex mapFromSource(const QModelIndex& sourceIndex) const override;
QCompleterPrivate *c;
QScopedPointer<QCompletionEngine> engine;
diff --git a/src/widgets/util/qflickgesture.cpp b/src/widgets/util/qflickgesture.cpp
index 549b130c9d..b59fe0d504 100644
--- a/src/widgets/util/qflickgesture.cpp
+++ b/src/widgets/util/qflickgesture.cpp
@@ -256,7 +256,7 @@ public:
}
protected:
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE
+ void timerEvent(QTimerEvent *e) override
{
if (e->timerId() == pressDelayTimer) {
if (pressDelayEvent && mouseTarget) {
diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp
index d8ac686fb9..8a1bcdae05 100644
--- a/src/widgets/util/qscroller.cpp
+++ b/src/widgets/util/qscroller.cpp
@@ -58,6 +58,7 @@
#include <QGraphicsView>
#endif
#include <QDesktopWidget>
+#include <private/qdesktopwidget_p.h>
#include <QVector2D>
#include <QtCore/qmath.h>
#include <QtGui/qevent.h>
@@ -198,7 +199,7 @@ public:
: QAbstractAnimation(_d), d(_d), ignoreUpdate(false), skip(0)
{ }
- int duration() const Q_DECL_OVERRIDE
+ int duration() const override
{
return -1;
}
@@ -214,7 +215,7 @@ public:
}
protected:
- void updateCurrentTime(int /*currentTime*/) Q_DECL_OVERRIDE
+ void updateCurrentTime(int /*currentTime*/) override
{
if (!ignoreUpdate) {
if (++skip >= d->frameRateSkip()) {
@@ -1016,7 +1017,7 @@ bool QScroller::handleInput(Input input, const QPointF &position, qint64 timesta
#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
// the Mac version is implemented in qscroller_mac.mm
-QPointF QScrollerPrivate::realDpi(int screen) const
+QPointF QScrollerPrivate::realDpi(int screenNumber) const
{
# if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && !defined(QT_NO_XRANDR)
if (X11 && X11->use_xrandr && X11->ptrXRRSizes && X11->ptrXRRRootToScreen) {
@@ -1040,8 +1041,8 @@ QPointF QScrollerPrivate::realDpi(int screen) const
}
# endif
- QWidget *w = QApplication::desktop()->screen(screen);
- return QPointF(w->physicalDpiX(), w->physicalDpiY());
+ const QScreen *screen = QDesktopWidgetPrivate::screen(screenNumber);
+ return QPointF(screen->physicalDotsPerInchX(), screen->physicalDotsPerInchY());
}
#endif
diff --git a/src/widgets/util/qsystemtrayicon.h b/src/widgets/util/qsystemtrayicon.h
index 81f396ed83..e4652b742c 100644
--- a/src/widgets/util/qsystemtrayicon.h
+++ b/src/widgets/util/qsystemtrayicon.h
@@ -66,8 +66,8 @@ class Q_WIDGETS_EXPORT QSystemTrayIcon : public QObject
Q_PROPERTY(bool visible READ isVisible WRITE setVisible DESIGNABLE false)
public:
- QSystemTrayIcon(QObject *parent = Q_NULLPTR);
- QSystemTrayIcon(const QIcon &icon, QObject *parent = Q_NULLPTR);
+ QSystemTrayIcon(QObject *parent = nullptr);
+ QSystemTrayIcon(const QIcon &icon, QObject *parent = nullptr);
~QSystemTrayIcon();
enum ActivationReason {
@@ -110,7 +110,7 @@ Q_SIGNALS:
void messageClicked();
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
private:
Q_DISABLE_COPY(QSystemTrayIcon)
diff --git a/src/widgets/util/qsystemtrayicon_p.h b/src/widgets/util/qsystemtrayicon_p.h
index 318edbd1e3..5bdf020a47 100644
--- a/src/widgets/util/qsystemtrayicon_p.h
+++ b/src/widgets/util/qsystemtrayicon_p.h
@@ -127,10 +127,10 @@ private:
void balloon(const QPoint&, int, bool);
protected:
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
+ void mousePressEvent(QMouseEvent *e) override;
+ void timerEvent(QTimerEvent *e) override;
private:
QSystemTrayIcon *trayIcon;
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index cd593d8d98..df93e15f80 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -87,12 +87,12 @@ public:
QRect globalGeometry() const;
protected:
- virtual void mousePressEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
- virtual void mouseDoubleClickEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
- virtual bool event(QEvent *) Q_DECL_OVERRIDE;
- virtual void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
- virtual void moveEvent(QMoveEvent *) Q_DECL_OVERRIDE;
+ virtual void mousePressEvent(QMouseEvent *ev) override;
+ virtual void mouseDoubleClickEvent(QMouseEvent *ev) override;
+ virtual bool event(QEvent *) override;
+ virtual void paintEvent(QPaintEvent *) override;
+ virtual void resizeEvent(QResizeEvent *) override;
+ virtual void moveEvent(QMoveEvent *) override;
private slots:
void systemTrayWindowChanged(QScreen *screen);
diff --git a/src/widgets/util/qundogroup.h b/src/widgets/util/qundogroup.h
index dba79ea706..1845f7e057 100644
--- a/src/widgets/util/qundogroup.h
+++ b/src/widgets/util/qundogroup.h
@@ -58,7 +58,7 @@ class Q_WIDGETS_EXPORT QUndoGroup : public QObject
Q_DECLARE_PRIVATE(QUndoGroup)
public:
- explicit QUndoGroup(QObject *parent = Q_NULLPTR);
+ explicit QUndoGroup(QObject *parent = nullptr);
~QUndoGroup();
void addStack(QUndoStack *stack);
diff --git a/src/widgets/util/qundostack.h b/src/widgets/util/qundostack.h
index 7ab90b507a..4be24eadab 100644
--- a/src/widgets/util/qundostack.h
+++ b/src/widgets/util/qundostack.h
@@ -57,8 +57,8 @@ class Q_WIDGETS_EXPORT QUndoCommand
QUndoCommandPrivate *d;
public:
- explicit QUndoCommand(QUndoCommand *parent = Q_NULLPTR);
- explicit QUndoCommand(const QString &text, QUndoCommand *parent = Q_NULLPTR);
+ explicit QUndoCommand(QUndoCommand *parent = nullptr);
+ explicit QUndoCommand(const QString &text, QUndoCommand *parent = nullptr);
virtual ~QUndoCommand();
virtual void undo();
@@ -92,7 +92,7 @@ class Q_WIDGETS_EXPORT QUndoStack : public QObject
Q_PROPERTY(int undoLimit READ undoLimit WRITE setUndoLimit)
public:
- explicit QUndoStack(QObject *parent = Q_NULLPTR);
+ explicit QUndoStack(QObject *parent = nullptr);
~QUndoStack();
void clear();
diff --git a/src/widgets/util/qundoview.cpp b/src/widgets/util/qundoview.cpp
index b56aa42aed..31f6c0dff2 100644
--- a/src/widgets/util/qundoview.cpp
+++ b/src/widgets/util/qundoview.cpp
@@ -59,11 +59,11 @@ public:
QUndoStack *stack() const;
virtual QModelIndex index(int row, int column,
- const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- virtual QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
- virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- virtual int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ const QModelIndex &parent = QModelIndex()) const override;
+ virtual QModelIndex parent(const QModelIndex &child) const override;
+ virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QModelIndex selectedIndex() const;
QItemSelectionModel *selectionModel() const;
diff --git a/src/widgets/util/qundoview.h b/src/widgets/util/qundoview.h
index 0bfcdd0c18..403f05d2e4 100644
--- a/src/widgets/util/qundoview.h
+++ b/src/widgets/util/qundoview.h
@@ -62,10 +62,10 @@ class Q_WIDGETS_EXPORT QUndoView : public QListView
Q_PROPERTY(QIcon cleanIcon READ cleanIcon WRITE setCleanIcon)
public:
- explicit QUndoView(QWidget *parent = Q_NULLPTR);
- explicit QUndoView(QUndoStack *stack, QWidget *parent = Q_NULLPTR);
+ explicit QUndoView(QWidget *parent = nullptr);
+ explicit QUndoView(QUndoStack *stack, QWidget *parent = nullptr);
#if QT_CONFIG(undogroup)
- explicit QUndoView(QUndoGroup *group, QWidget *parent = Q_NULLPTR);
+ explicit QUndoView(QUndoGroup *group, QWidget *parent = nullptr);
#endif
~QUndoView();