summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r--src/widgets/kernel/qapplication.cpp86
1 files changed, 14 insertions, 72 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 86b3282124..df467505d9 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -101,23 +101,13 @@
#include "qdatetime.h"
-#ifdef Q_OS_WINCE
-extern bool qt_wince_is_smartphone(); //qguifunctions_wince.cpp
-extern bool qt_wince_is_mobile(); //qguifunctions_wince.cpp
-extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp
-#endif
-
#include <qpa/qplatformwindow.h>
//#define ALIEN_DEBUG
static void initResources()
{
-#if defined(Q_OS_WINCE)
- Q_INIT_RESOURCE(qstyle_wince);
-#else
Q_INIT_RESOURCE(qstyle);
-#endif
Q_INIT_RESOURCE(qmessagebox);
}
@@ -171,12 +161,7 @@ static QByteArray nativeStyleClassName()
return name;
}
-#ifdef Q_OS_WINCE
-int QApplicationPrivate::autoMaximizeThreshold = -1;
-bool QApplicationPrivate::autoSipEnabled = false;
-#else
bool QApplicationPrivate::autoSipEnabled = true;
-#endif
QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, int flags)
: QApplicationPrivateBase(argc, argv, flags)
@@ -352,8 +337,10 @@ void QApplicationPrivate::createEventDispatcher()
\sa QCoreApplication, QAbstractEventDispatcher, QEventLoop, QSettings
*/
+// ### fixme: Qt 6: Remove ColorSpec and accessors.
/*!
\enum QApplication::ColorSpec
+ \obsolete
\value NormalColor the default color allocation policy
\value CustomColor the same as NormalColor for X11; allocates colors
@@ -410,8 +397,6 @@ QString QApplicationPrivate::styleSheet; // default application styles
#endif
QPointer<QWidget> QApplicationPrivate::leaveAfterRelease = 0;
-int QApplicationPrivate::app_cspec = QApplication::NormalColor;
-
QPalette *QApplicationPrivate::sys_pal = 0; // default system palette
QPalette *QApplicationPrivate::set_pal = 0; // default palette set by programmer
@@ -657,17 +642,6 @@ void QApplicationPrivate::initialize()
if (qEnvironmentVariableIntValue("QT_USE_NATIVE_WINDOWS") > 0)
QCoreApplication::setAttribute(Qt::AA_NativeWindows);
-#ifdef Q_OS_WINCE
-#ifdef QT_AUTO_MAXIMIZE_THRESHOLD
- autoMaximizeThreshold = QT_AUTO_MAXIMIZE_THRESHOLD;
-#else
- if (qt_wince_is_mobile())
- autoMaximizeThreshold = 50;
- else
- autoMaximizeThreshold = -1;
-#endif //QT_AUTO_MAXIMIZE_THRESHOLD
-#endif //Q_OS_WINCE
-
#ifndef QT_NO_WHEELEVENT
QApplicationPrivate::wheel_scroll_lines = 3;
#endif
@@ -894,6 +868,7 @@ QApplication::~QApplication()
#endif
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
// #fixme: Remove.
static HDC displayDC = 0; // display device context
@@ -906,6 +881,7 @@ Q_WIDGETS_EXPORT HDC qt_win_display_dc() // get display D
return displayDC;
}
#endif
+#endif
void qt_cleanup()
{
@@ -913,12 +889,14 @@ void qt_cleanup()
QColormap::cleanup();
QApplicationPrivate::active_window = 0; //### this should not be necessary
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
if (displayDC) {
ReleaseDC(0, displayDC);
displayDC = 0;
}
#endif
+#endif
}
/*!
@@ -1023,30 +1001,6 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis
*/
/*!
- \property QApplication::autoMaximizeThreshold
- \since 4.4
- \brief defines a threshold for auto maximizing widgets
-
- \b{The auto maximize threshold is only available as part of Qt for
- Windows CE.}
-
- This property defines a threshold for the size of a window as a percentage
- of the screen size. If the minimum size hint of a window exceeds the
- threshold, calling show() will cause the window to be maximized
- automatically.
-
- Setting the threshold to 100 or greater means that the widget will always
- be maximized. Alternatively, setting the threshold to 50 means that the
- widget will be maximized only if the vertical minimum size hint is at least
- 50% of the vertical screen size.
-
- Setting the threshold to -1 disables the feature.
-
- On Windows CE the default is -1 (i.e., it is disabled).
- On Windows Mobile the default is 40.
-*/
-
-/*!
\property QApplication::autoSipEnabled
\since 4.5
\brief toggles automatic SIP (software input panel) visibility
@@ -1061,19 +1015,6 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis
The default is platform dependent.
*/
-
-#ifdef Q_OS_WINCE
-void QApplication::setAutoMaximizeThreshold(const int threshold)
-{
- QApplicationPrivate::autoMaximizeThreshold = threshold;
-}
-
-int QApplication::autoMaximizeThreshold() const
-{
- return QApplicationPrivate::autoMaximizeThreshold;
-}
-#endif
-
void QApplication::setAutoSipEnabled(const bool enabled)
{
QApplicationPrivate::autoSipEnabled = enabled;
@@ -1314,17 +1255,21 @@ QStyle* QApplication::setStyle(const QString& style)
/*!
Returns the color specification.
+ \obsolete
\sa QApplication::setColorSpec()
*/
int QApplication::colorSpec()
{
- return QApplicationPrivate::app_cspec;
+ return QApplication::NormalColor;
}
/*!
Sets the color specification for the application to \a spec.
+ \obsolete
+
+ This call has no effect.
The color specification controls how the application allocates colors when
run on a display with a limited amount of colors, e.g. 8 bit / 256 color
@@ -1380,10 +1325,7 @@ int QApplication::colorSpec()
void QApplication::setColorSpec(int spec)
{
- if (Q_UNLIKELY(qApp))
- qWarning("QApplication::setColorSpec: This function must be "
- "called before the QApplication object is created");
- QApplicationPrivate::app_cspec = spec;
+ Q_UNUSED(spec)
}
/*!
@@ -3637,7 +3579,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
// We may get here if the widget is subscribed to a gesture,
// but has not accepted TouchBegin. Propagate touch events
// only if TouchBegin has been accepted.
- if (widget && widget->testAttribute(Qt::WA_WState_AcceptedTouchBeginEvent))
+ if (widget->testAttribute(Qt::WA_WState_AcceptedTouchBeginEvent))
res = d->notify_helper(widget, e);
break;
}
@@ -3777,7 +3719,7 @@ bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e)
if (receiver->isWidgetType()) {
QWidget *widget = static_cast<QWidget *>(receiver);
-#if !defined(Q_OS_WINCE) || (defined(GWES_ICONCURS) && !defined(QT_NO_CURSOR))
+#if !defined(QT_NO_CURSOR)
// toggle HasMouse widget state on enter and leave
if ((e->type() == QEvent::Enter || e->type() == QEvent::DragEnter) &&
(!QApplication::activePopupWidget() || QApplication::activePopupWidget() == widget->window()))