summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qapplication.cpp13
-rw-r--r--src/widgets/kernel/qapplication.h3
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp3
-rw-r--r--src/widgets/kernel/qformlayout.cpp4
-rw-r--r--src/widgets/kernel/qwidget.cpp44
-rw-r--r--src/widgets/kernel/qwidgetsfunctions_wince.h2
6 files changed, 29 insertions, 40 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 80912ff409..9d3c5f8616 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -41,7 +41,6 @@
#include "qplatformdefs.h"
#include "qabstracteventdispatcher.h"
-#include "qaccessible.h"
#include "qapplication.h"
#include "qclipboard.h"
#include "qcursor.h"
@@ -190,6 +189,15 @@ QApplicationPrivate::~QApplicationPrivate()
any given time. For non-QWidget based Qt applications, use QGuiApplication instead,
as it does not depend on the \l QtWidgets library.
+ Some GUI applications provide a special batch mode ie. provide command line
+ arguments for executing tasks without manual intervention. In such non-GUI
+ mode, it is often sufficient to instantiate a plain QCoreApplication to
+ avoid unnecessarily initializing resources needed for a graphical user
+ interface. The following example shows how to dynamically create an
+ appropriate type of application instance:
+
+ \snippet code/src_gui_kernel_qapplication.cpp 0
+
The QApplication object is accessible through the instance() function that
returns a pointer equivalent to the global qApp pointer.
@@ -2653,9 +2661,6 @@ int QApplication::startDragDistance()
*/
int QApplication::exec()
{
-#ifndef QT_NO_ACCESSIBILITY
- QAccessible::setRootObject(qApp);
-#endif
return QGuiApplication::exec();
}
diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h
index 8a7cb24539..5800ca48b0 100644
--- a/src/widgets/kernel/qapplication.h
+++ b/src/widgets/kernel/qapplication.h
@@ -50,6 +50,9 @@
#ifdef QT_INCLUDE_COMPAT
# include <QtWidgets/qdesktopwidget.h>
#endif
+#ifdef Q_NO_USING_KEYWORD
+#include <QtGui/qpalette.h>
+#endif
#include <QtGui/qguiapplication.h>
QT_BEGIN_HEADER
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index 21bc9506d4..3568e49ccd 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -421,8 +421,11 @@ void qt_init(QApplicationPrivate *priv, int type)
QColormap::initialize();
+#ifndef QT_NO_TOOLTIP
if (const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette))
QToolTip::setPalette(*toolTipPalette);
+#endif
+
QApplicationPrivate::initializeWidgetFontHash();
}
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index f875de16df..05f03dc97a 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -1022,7 +1022,7 @@ QStyle* QFormLayoutPrivate::getStyle() const
\li \b{Adherence to the different platform's look and feel guidelines.}
For example, the
- \l{Mac OS X Aqua} and KDE guidelines specify that the
+ \l{https://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html}{Mac OS X Aqua} and KDE guidelines specify that the
labels should be right-aligned, whereas Windows and GNOME
applications normally use left-alignment.
@@ -1065,7 +1065,7 @@ QStyle* QFormLayoutPrivate::getStyle() const
corresponds to what we would get using a two-column
QGridLayout.)
\li Style based on the
- \l{Mac OS X Aqua} guidelines. Labels are right-aligned,
+ \l{https://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html}{Mac OS X Aqua} guidelines. Labels are right-aligned,
the fields don't grow beyond their size hint, and the
form is horizontally centered.
\li Recommended style for
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 55326e2ef9..ecf73ee777 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -3069,11 +3069,13 @@ void QWidgetPrivate::setEnabled_helper(bool enable)
qt_x11_enforce_cursor(q);
}
#endif
+#ifndef QT_NO_CURSOR
if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) {
// enforce the windows behavior of clearing the cursor on
// disabled widgets
qt_qpa_set_cursor(q, false);
}
+#endif
#if defined(Q_WS_MAC)
setEnabled_helper_sys(enable);
#endif
@@ -5472,18 +5474,6 @@ void QWidget::unsetLocale()
d->resolveLocale();
}
-static QString constructWindowTitleFromFilePath(const QString &filePath)
-{
- QFileInfo fi(filePath);
- QString windowTitle = fi.fileName() + QLatin1String("[*]");
-#ifndef Q_WS_MAC
- QString appName = QApplication::applicationName();
- if (!appName.isEmpty())
- windowTitle += QLatin1Char(' ') + QChar(0x2014) + QLatin1Char(' ') + appName;
-#endif
- return windowTitle;
-}
-
/*!
\property QWidget::windowTitle
\brief the window title (caption)
@@ -5500,6 +5490,11 @@ static QString constructWindowTitleFromFilePath(const QString &filePath)
windowModified property is false (the default), the placeholder
is simply removed.
+ On some desktop platforms (including Windows and Unix), the application name
+ (from QGuiApplication::applicationDisplayName) is added at the end of the
+ window title, if set. This is done by the QPA plugin, so it is shown to the
+ user, but isn't part of the \l windowTitle string.
+
\sa windowIcon, windowIconText, windowModified, windowFilePath
*/
QString QWidget::windowTitle() const
@@ -5509,7 +5504,7 @@ QString QWidget::windowTitle() const
if (!d->extra->topextra->caption.isEmpty())
return d->extra->topextra->caption;
if (!d->extra->topextra->filePath.isEmpty())
- return constructWindowTitleFromFilePath(d->extra->topextra->filePath);
+ return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]");
}
return QString();
}
@@ -5681,24 +5676,8 @@ QString QWidget::windowIconText() const
This property only makes sense for windows. It associates a file path with
a window. If you set the file path, but have not set the window title, Qt
- sets the window title to contain a string created using the following
- components.
-
- On Mac OS X:
-
- \list
- \li The file name of the specified path, obtained using QFileInfo::fileName().
- \endlist
-
- On Windows and X11:
-
- \list
- \li The file name of the specified path, obtained using QFileInfo::fileName().
- \li An optional \c{*} character, if the \l windowModified property is set.
- \li The \c{0x2014} unicode character, padded either side by spaces.
- \li The application name, obtained from the application's
- \l{QCoreApplication::}{applicationName} property.
- \endlist
+ sets the window title to the file name of the specified path, obtained using
+ QFileInfo::fileName().
If the window title is set at any point, then the window title takes precedence and
will be shown instead of the file path string.
@@ -10264,6 +10243,7 @@ void QWidget::setWindowOpacity(qreal opacity)
QTLWExtra *extra = d->topData();
extra->opacity = uint(opacity * 255);
setAttribute(Qt::WA_WState_WindowOpacitySet);
+ d->setWindowOpacity_sys(opacity);
if (!testAttribute(Qt::WA_WState_Created))
return;
@@ -10278,8 +10258,6 @@ void QWidget::setWindowOpacity(qreal opacity)
return;
}
#endif
-
- d->setWindowOpacity_sys(opacity);
}
/*!
diff --git a/src/widgets/kernel/qwidgetsfunctions_wince.h b/src/widgets/kernel/qwidgetsfunctions_wince.h
index 39d29b83ad..a113f44043 100644
--- a/src/widgets/kernel/qwidgetsfunctions_wince.h
+++ b/src/widgets/kernel/qwidgetsfunctions_wince.h
@@ -58,4 +58,4 @@ HINSTANCE qt_wince_ShellExecute(HWND hwnd, LPCWSTR operation, LPCWSTR file, LPCW
#endif
#endif // Q_OS_WINCE
-#endif // QWIDGETSFUNCTIONS_WCE_H \ No newline at end of file
+#endif // QWIDGETSFUNCTIONS_WCE_H