diff options
Diffstat (limited to 'src/widgets/widgets/qmdiarea_p.h')
-rw-r--r-- | src/widgets/widgets/qmdiarea_p.h | 74 |
1 files changed, 21 insertions, 53 deletions
diff --git a/src/widgets/widgets/qmdiarea_p.h b/src/widgets/widgets/qmdiarea_p.h index fd00118ec6..e57b9772ca 100644 --- a/src/widgets/widgets/qmdiarea_p.h +++ b/src/widgets/widgets/qmdiarea_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWidgets module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QMDIAREA_P_H #define QMDIAREA_P_H @@ -58,13 +22,15 @@ QT_REQUIRE_CONFIG(mdiarea); #include <QList> -#include <QVector> +#include <QList> #include <QRect> #include <QPoint> #include <QtWidgets/qapplication.h> #include <private/qmdisubwindow_p.h> #include <private/qabstractscrollarea_p.h> +#include <QtCore/qpointer.h> + QT_BEGIN_NAMESPACE namespace QMdi { @@ -115,20 +81,22 @@ class Placer public: // Places the rectangle defined by 'size' relative to 'rects' and 'domain'. // Returns the position of the resulting rectangle. - virtual QPoint place( - const QSize &size, const QVector<QRect> &rects, const QRect &domain) const = 0; + virtual QPoint place(const QSize &size, const QList<QRect> &rects, + const QRect &domain) const = 0; virtual ~Placer() {} }; class MinOverlapPlacer : public Placer { - QPoint place(const QSize &size, const QVector<QRect> &rects, const QRect &domain) const override; - static int accumulatedOverlap(const QRect &source, const QVector<QRect> &rects); - static QRect findMinOverlapRect(const QVector<QRect> &source, const QVector<QRect> &rects); - static QVector<QRect> getCandidatePlacements(const QSize &size, const QVector<QRect> &rects, const QRect &domain); - static QPoint findBestPlacement(const QRect &domain, const QVector<QRect> &rects, QVector<QRect> &source); - static QVector<QRect> findNonInsiders(const QRect &domain, QVector<QRect> &source); - static QVector<QRect> findMaxOverlappers(const QRect &domain, const QVector<QRect> &source); + QPoint place(const QSize &size, const QList<QRect> &rects, const QRect &domain) const override; + static int accumulatedOverlap(const QRect &source, const QList<QRect> &rects); + static QRect findMinOverlapRect(const QList<QRect> &source, const QList<QRect> &rects); + static QList<QRect> getCandidatePlacements(const QSize &size, const QList<QRect> &rects, + const QRect &domain); + static QPoint findBestPlacement(const QRect &domain, const QList<QRect> &rects, + QList<QRect> &source); + static QList<QRect> findNonInsiders(const QRect &domain, QList<QRect> &source); + static QList<QRect> findMaxOverlappers(const QRect &domain, const QList<QRect> &source); }; } // namespace QMdi @@ -149,9 +117,9 @@ public: #endif QMdiAreaTabBar *tabBar; QList<QMdi::Rearranger *> pendingRearrangements; - QVector< QPointer<QMdiSubWindow> > pendingPlacements; - QVector< QPointer<QMdiSubWindow> > childWindows; - QVector<int> indicesToActivatedChildren; + QList<QPointer<QMdiSubWindow>> pendingPlacements; + QList<QPointer<QMdiSubWindow>> childWindows; + QList<int> indicesToActivatedChildren; QPointer<QMdiSubWindow> active; QPointer<QMdiSubWindow> aboutToBecomeActive; QBrush background; @@ -183,7 +151,7 @@ public: int tabToPreviousTimerId; // Slots. - void _q_deactivateAllWindows(QMdiSubWindow *aboutToActivate = 0); + void _q_deactivateAllWindows(QMdiSubWindow *aboutToActivate = nullptr); void _q_processWindowStateChanged(Qt::WindowStates oldState, Qt::WindowStates newState); void _q_currentTabChanged(int index); void _q_closeTab(int index); @@ -198,7 +166,7 @@ public: void activateCurrentWindow(); void activateHighlightedWindow(); void emitWindowActivated(QMdiSubWindow *child); - void resetActiveWindow(QMdiSubWindow *child = 0); + void resetActiveWindow(QMdiSubWindow *child = nullptr); void updateActiveWindow(int removedIndex, bool activeRemoved); void updateScrollBars(); void internalRaise(QMdiSubWindow *child) const; |