diff options
Diffstat (limited to 'src/widgets/kernel/qapplication_p.h')
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 62 |
1 files changed, 14 insertions, 48 deletions
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 6bb1f35d1b..21b1605dfc 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_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 QAPPLICATION_P_H #define QAPPLICATION_P_H @@ -86,7 +50,7 @@ class QPointingDevice; class QGestureManager; #endif -extern Q_GUI_EXPORT bool qt_is_gui_used; +extern Q_GUI_EXPORT bool qt_is_tty_app; #ifndef QT_NO_CLIPBOARD extern QClipboard *qt_clipboard; #endif @@ -94,13 +58,11 @@ extern QClipboard *qt_clipboard; typedef QHash<QByteArray, QFont> FontHash; Q_WIDGETS_EXPORT FontHash *qt_app_fonts_hash(); -#define QApplicationPrivateBase QGuiApplicationPrivate - -class Q_WIDGETS_EXPORT QApplicationPrivate : public QApplicationPrivateBase +class Q_WIDGETS_EXPORT QApplicationPrivate : public QGuiApplicationPrivate { Q_DECLARE_PUBLIC(QApplication) public: - QApplicationPrivate(int &argc, char **argv, int flags); + QApplicationPrivate(int &argc, char **argv); ~QApplicationPrivate(); virtual void notifyLayoutDirectionChange() override; @@ -122,7 +84,8 @@ public: #endif //modality - bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = nullptr) const override; + Qt::WindowModality defaultModality() const override; + bool windowNeverBlocked(QWindow *window) const override; static bool isBlockedByModal(QWidget *widget); static bool modalState(); static bool tryModalHelper(QWidget *widget, QWidget **rettop = nullptr); @@ -141,6 +104,8 @@ public: void initialize(); void process_cmdline(); + static void setActiveWindow(QWidget* act); + static bool inPopupMode(); bool popupActive() override { return inPopupMode(); } bool closeAllPopups() override; @@ -165,7 +130,7 @@ public: static QStyle *app_style; protected: - void notifyThemeChanged() override; + void handleThemeChanged() override; QPalette basePalette() const override; void handlePaletteChanged(const char *className = nullptr) override; @@ -180,9 +145,7 @@ public: static QWidget *main_widget; static QWidget *focus_widget; static QWidget *hidden_focus_widget; - static QWidget *active_window; #if QT_CONFIG(wheelevent) - static int wheel_scroll_lines; static QPointer<QWidget> wheel_widget; #endif @@ -248,7 +211,9 @@ public: QWidget *findClosestTouchPointTarget(const QPointingDevice *device, const QEventPoint &touchPoint); void appendTouchPoint(const QEventPoint &touchPoint); void removeTouchPoint(int touchPointId); - void activateImplicitTouchGrab(QWidget *widget, QTouchEvent *touchBeginEvent); + enum ImplicitTouchGrabMode { GrabAcceptedPoints, GrabAllPoints }; + void activateImplicitTouchGrab(QWidget *widget, QTouchEvent *touchBeginEvent, + ImplicitTouchGrabMode grabMode = GrabAcceptedPoints); static bool translateRawTouchEvent(QWidget *widget, const QTouchEvent *touchEvent); static void translateTouchCancel(const QPointingDevice *device, ulong timestamp); @@ -261,6 +226,7 @@ private: static void giveFocusAccordingToFocusPolicy(QWidget *w, QEvent *event, QPoint localPos); static bool shouldSetFocus(QWidget *w, Qt::FocusPolicy policy); + static QWidget *active_window; static bool isAlien(QWidget *); }; |