summaryrefslogtreecommitdiffstats
path: root/src/designer/src/designer/qdesigner_toolwindow.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/designer/src/designer/qdesigner_toolwindow.h')
-rw-r--r--src/designer/src/designer/qdesigner_toolwindow.h58
1 files changed, 15 insertions, 43 deletions
diff --git a/src/designer/src/designer/qdesigner_toolwindow.h b/src/designer/src/designer/qdesigner_toolwindow.h
index 88ea6bb00..7fec13981 100644
--- a/src/designer/src/designer/qdesigner_toolwindow.h
+++ b/src/designer/src/designer/qdesigner_toolwindow.h
@@ -1,59 +1,33 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Designer of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** 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 General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** 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-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef QDESIGNER_TOOLWINDOW_H
#define QDESIGNER_TOOLWINDOW_H
#include "mainwindow.h"
+#include <QtCore/qcompare.h>
#include <QtCore/qpointer.h>
#include <QtGui/qfontdatabase.h>
#include <QtWidgets/qmainwindow.h>
QT_BEGIN_NAMESPACE
-struct ToolWindowFontSettings {
- bool equals(const ToolWindowFontSettings &) const;
-
+struct ToolWindowFontSettings
+{
QFont m_font;
QFontDatabase::WritingSystem m_writingSystem{QFontDatabase::Any};
bool m_useFont{false};
-};
-
-inline bool operator==(const ToolWindowFontSettings &tw1, const ToolWindowFontSettings &tw2)
-{
- return tw1.equals(tw2);
-}
-inline bool operator!=(const ToolWindowFontSettings &tw1, const ToolWindowFontSettings &tw2)
-{
- return !tw1.equals(tw2);
-}
+ friend bool comparesEqual(const ToolWindowFontSettings &lhs,
+ const ToolWindowFontSettings &rhs) noexcept
+ {
+ return lhs.m_useFont == rhs.m_useFont
+ && lhs.m_writingSystem == rhs.m_writingSystem
+ && lhs.m_font == rhs.m_font;
+ }
+ Q_DECLARE_EQUALITY_COMPARABLE(ToolWindowFontSettings)
+};
class QDesignerWorkbench;
@@ -86,7 +60,7 @@ public:
QAction *action() const;
Qt::DockWidgetArea dockWidgetAreaHint() const { return m_dockAreaHint; }
- virtual QRect geometryHint() const;
+ virtual QRect geometryHint(const QRect &availableGeometry) const = 0;
private slots:
void showMe(bool);
@@ -96,8 +70,6 @@ protected:
void hideEvent(QHideEvent *e) override;
void changeEvent(QEvent *e) override;
- QRect availableToolWindowGeometry() const;
-
private:
const Qt::DockWidgetArea m_dockAreaHint;
QDesignerWorkbench *m_workbench;