summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qapplication.cpp103
-rw-r--r--src/widgets/kernel/qapplication_p.h10
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp79
-rw-r--r--src/widgets/kernel/qboxlayout.cpp12
-rw-r--r--src/widgets/kernel/qformlayout.cpp34
-rw-r--r--src/widgets/kernel/qgesture.h2
-rw-r--r--src/widgets/kernel/qgesturemanager.cpp6
-rw-r--r--src/widgets/kernel/qgesturemanager_p.h4
-rw-r--r--src/widgets/kernel/qicon.cpp12
-rw-r--r--src/widgets/kernel/qicon.h4
-rw-r--r--src/widgets/kernel/qiconengineplugin.cpp2
-rw-r--r--src/widgets/kernel/qlayout.cpp4
-rw-r--r--src/widgets/kernel/qlayoutitem.cpp30
-rw-r--r--src/widgets/kernel/qstackedlayout.cpp32
-rw-r--r--src/widgets/kernel/qstackedlayout.h2
-rw-r--r--src/widgets/kernel/qwidget.cpp133
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp14
-rw-r--r--src/widgets/kernel/qwidgetaction.cpp10
18 files changed, 297 insertions, 196 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index c350223278..90b64db579 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -131,8 +131,11 @@ QApplicationPrivate *QApplicationPrivate::self = 0;
static void initSystemPalette()
{
if (!QApplicationPrivate::sys_pal)
- if (const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette())
+ if (const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette()) {
QApplicationPrivate::setSystemPalette(*themePalette);
+ QApplicationPrivate::initializeWidgetPaletteHash();
+ }
+
if (!QApplicationPrivate::sys_pal && QApplicationPrivate::app_style)
QApplicationPrivate::setSystemPalette(QApplicationPrivate::app_style->standardPalette());
}
@@ -185,7 +188,7 @@ QApplicationPrivate::~QApplicationPrivate()
for QWidget-based applications. It handles widget specific initialization,
finalization, and provides session management.
- For any GUI application using Qt, there is precisely \bold one QApplication
+ For any GUI application using Qt, there is precisely \b one QApplication
object, no matter whether the application has 0, 1, 2 or more windows at
any given time. For non-QWidget based Qt applications, use QGuiApplication instead,
as it does not depend on the \l QtWidgets library.
@@ -195,41 +198,41 @@ QApplicationPrivate::~QApplicationPrivate()
QApplication's main areas of responsibility are:
\list
- \o It initializes the application with the user's desktop settings
+ \li It initializes the application with the user's desktop settings
such as palette(), font() and doubleClickInterval(). It keeps
track of these properties in case the user changes the desktop
globally, for example through some kind of control panel.
- \o It performs event handling, meaning that it receives events
+ \li It performs event handling, meaning that it receives events
from the underlying window system and dispatches them to the
relevant widgets. By using sendEvent() and postEvent() you can
send your own events to widgets.
- \o It parses common command line arguments and sets its internal
+ \li It parses common command line arguments and sets its internal
state accordingly. See the \l{QApplication::QApplication()}
{constructor documentation} below for more details.
- \o It defines the application's look and feel, which is
+ \li It defines the application's look and feel, which is
encapsulated in a QStyle object. This can be changed at runtime
with setStyle().
- \o It specifies how the application is to allocate colors. See
+ \li It specifies how the application is to allocate colors. See
setColorSpec() for details.
- \o It provides localization of strings that are visible to the
+ \li It provides localization of strings that are visible to the
user via translate().
- \o It provides some magical objects like the desktop() and the
+ \li It provides some magical objects like the desktop() and the
clipboard().
- \o It knows about the application's windows. You can ask which
+ \li It knows about the application's windows. You can ask which
widget is at a certain position using widgetAt(), get a list of
topLevelWidgets() and closeAllWindows(), etc.
- \o It manages the application's mouse cursor handling, see
+ \li It manages the application's mouse cursor handling, see
setOverrideCursor()
- \o It provides support for sophisticated \l{Session Management}
+ \li It provides support for sophisticated \l{Session Management}
{session management}. This makes it possible for applications
to terminate gracefully when the user logs out, to cancel a
shutdown process if termination isn't possible and even to
@@ -246,11 +249,11 @@ QApplicationPrivate::~QApplicationPrivate()
\table
\header
- \o{2,1} Groups of functions
+ \li{2,1} Groups of functions
\row
- \o System settings
- \o desktopSettingsAware(),
+ \li System settings
+ \li desktopSettingsAware(),
setDesktopSettingsAware(),
cursorFlashTime(),
setCursorFlashTime(),
@@ -266,8 +269,8 @@ QApplicationPrivate::~QApplicationPrivate()
fontMetrics().
\row
- \o Event handling
- \o exec(),
+ \li Event handling
+ \li exec(),
processEvents(),
exit(),
quit().
@@ -279,24 +282,24 @@ QApplicationPrivate::~QApplicationPrivate()
notify().
\row
- \o GUI Styles
- \o style(),
+ \li GUI Styles
+ \li style(),
setStyle().
\row
- \o Color usage
- \o colorSpec(),
+ \li Color usage
+ \li colorSpec(),
setColorSpec().
\row
- \o Text handling
- \o installTranslator(),
+ \li Text handling
+ \li installTranslator(),
removeTranslator()
translate().
\row
- \o Widgets
- \o allWidgets(),
+ \li Widgets
+ \li allWidgets(),
topLevelWidgets(),
desktop(),
activePopupWidget(),
@@ -307,21 +310,21 @@ QApplicationPrivate::~QApplicationPrivate()
widgetAt().
\row
- \o Advanced cursor handling
- \o overrideCursor(),
+ \li Advanced cursor handling
+ \li overrideCursor(),
setOverrideCursor(),
restoreOverrideCursor().
\row
- \o Session management
- \o isSessionRestored(),
+ \li Session management
+ \li isSessionRestored(),
sessionId(),
commitData(),
saveState().
\row
- \o Miscellaneous
- \o closeAllWindows(),
+ \li Miscellaneous
+ \li closeAllWindows(),
startingUp(),
closingDown(),
type().
@@ -428,11 +431,6 @@ PaletteHash *qt_app_palettes_hash()
return app_palettes();
}
-FontHash::FontHash()
-{
- QHash<QByteArray, QFont>::operator=(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFonts());
-}
-
Q_GLOBAL_STATIC(FontHash, app_fonts)
FontHash *qt_app_fonts_hash()
{
@@ -534,25 +532,25 @@ void QApplicationPrivate::process_cmdline()
All Qt programs automatically support the following command line options:
\list
- \o -style= \e style, sets the application GUI style. Possible values
+ \li -style= \e style, sets the application GUI style. Possible values
are \c motif, \c windows, and \c platinum. If you compiled Qt with
additional styles or have additional styles as plugins these will
be available to the \c -style command line option.
- \o -style \e style, is the same as listed above.
- \o -stylesheet= \e stylesheet, sets the application \l styleSheet. The
+ \li -style \e style, is the same as listed above.
+ \li -stylesheet= \e stylesheet, sets the application \l styleSheet. The
value must be a path to a file that contains the Style Sheet.
\note Relative URLs in the Style Sheet file are relative to the
Style Sheet file's path.
- \o -stylesheet \e stylesheet, is the same as listed above.
- \o -session= \e session, restores the application from an earlier
+ \li -stylesheet \e stylesheet, is the same as listed above.
+ \li -session= \e session, restores the application from an earlier
\l{Session Management}{session}.
- \o -session \e session, is the same as listed above.
- \o -widgetcount, prints debug message at the end about number of
+ \li -session \e session, is the same as listed above.
+ \li -widgetcount, prints debug message at the end about number of
widgets left undestroyed and maximum number of widgets existed at
the same time
- \o -reverse, sets the application's layout direction to
+ \li -reverse, sets the application's layout direction to
Qt::RightToLeft
- \o -qmljsdebugger=, activates the QML/JS debugger with a specified port.
+ \li -qmljsdebugger=, activates the QML/JS debugger with a specified port.
The value must be of format port:1234[,block], where block is optional
and will make the application wait until a debugger connects to it.
\endlist
@@ -968,7 +966,7 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis
\since 4.4
\brief defines a threshold for auto maximizing widgets
- \bold{The auto maximize threshold is only available as part of Qt for
+ \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
@@ -997,7 +995,7 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis
the WA_InputMethodEnabled attribute set, and is typically used to launch
a virtual keyboard on devices which have very few or no keys.
- \bold{ The property only has an effect on platforms which use software input
+ \b{ The property only has an effect on platforms which use software input
panels, such as Windows CE.}
The default is platform dependent.
@@ -1275,21 +1273,21 @@ int QApplication::colorSpec()
The options are:
\list
- \o QApplication::NormalColor. This is the default color allocation
+ \li QApplication::NormalColor. This is the default color allocation
strategy. Use this option if your application uses buttons, menus,
texts and pixmaps with few colors. With this option, the
application uses system global colors. This works fine for most
applications under X11, but on the Windows platform, it may cause
dithering of non-standard colors.
- \o QApplication::CustomColor. Use this option if your application
+ \li QApplication::CustomColor. Use this option if your application
needs a small number of custom colors. On X11, this option is the
same as NormalColor. On Windows, Qt creates a Windows palette, and
allocates colors to it on demand.
- \o QApplication::ManyColor. Use this option if your application is
+ \li QApplication::ManyColor. Use this option if your application is
very color hungry, e.g., it requires thousands of colors. \br
Under X11 the effect is:
\list
- \o For 256-color displays which have at best a 256 color true
+ \li For 256-color displays which have at best a 256 color true
color visual, the default visual is used, and colors are
allocated from a color cube. The color cube is the 6x6x6
(216 color) "Web palette" (the red, green, and blue
@@ -1298,7 +1296,7 @@ int QApplication::colorSpec()
can be changed by the \e -ncols option. The user can force
the application to use the true color visual with the
\l{QApplication::QApplication()}{-visual} option.
- \o For 256-color displays which have a true color visual with
+ \li For 256-color displays which have a true color visual with
more than 256 colors, use that visual. Silicon Graphics X
servers this feature, for example. They provide an 8 bit
visual by default but can deliver true color when asked.
@@ -3124,7 +3122,6 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::ChildRemoved:
case QEvent::UpdateRequest:
case QEvent::UpdateLater:
- case QEvent::AccessibilityPrepare:
case QEvent::LocaleChange:
case QEvent::Style:
case QEvent::IconDrag:
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index 7a880986bf..2d639172e2 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -157,10 +157,7 @@ QMacTabletHash *qt_mac_tablet_hash();
# endif
#endif
-struct FontHash : public QHash<QByteArray, QFont>
-{
- FontHash();
-};
+typedef QHash<QByteArray, QFont> FontHash;
FontHash *qt_app_fonts_hash();
typedef QHash<QByteArray, QPalette> PaletteHash;
@@ -292,6 +289,7 @@ public:
static void setSystemPalette(const QPalette &pal);
static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash);
static void initializeWidgetPaletteHash();
+ static void initializeWidgetFontHash();
static void setSystemFont(const QFont &font);
#if defined(Q_WS_X11)
@@ -313,7 +311,7 @@ public:
QPointer<QWSManager> last_manager;
QWSServerCleaner qwsServerCleaner;
# ifndef QT_NO_DIRECTPAINTER
- QMap<WId, QDirectPainter *> *directPainters;
+ QHash<WId, QDirectPainter *> *directPainters;
# endif
QRect maxWindowRect(const QScreen *screen) const { return maxWindowRects[screen]; }
void setMaxWindowRect(const QScreen *screen, int screenNo, const QRect &rect);
@@ -393,7 +391,7 @@ public:
private:
#ifdef Q_WS_QWS
- QMap<const QScreen*, QRect> maxWindowRects;
+ QHash<const QScreen*, QRect> maxWindowRects;
#endif
static QApplicationPrivate *self;
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index 54c5c39396..97fc794252 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -289,8 +289,85 @@ void QApplicationPrivate::cleanupMultitouch_sys()
{
}
+static void setPossiblePalette(const QPalette *palette, const char *className)
+{
+ if (palette == 0)
+ return;
+ QApplicationPrivate::setPalette_helper(*palette, className, false);
+}
+
+
void QApplicationPrivate::initializeWidgetPaletteHash()
{
+ QPlatformTheme *platformTheme = QGuiApplicationPrivate::platformTheme();
+ if (!platformTheme)
+ return;
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::ToolButtonPalette), "QToolButton");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::ButtonPalette), "QAbstractButton");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::HeaderPalette), "QHeaderView");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::HeaderPalette), "Q3Header");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::ItemViewPalette), "QAbstractItemView");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::MessageBoxLabelPelette), "QMessageBoxLabel");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::TabBarPalette), "QTabBar");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::LabelPalette), "QLabel");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::GroupBoxPalette), "QGroupBox");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::MenuPalette), "QMenu");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::MenuBarPalette), "QMenuBar");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::TextEditPalette), "QTextEdit");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::TextEditPalette), "QTextControl");
+ setPossiblePalette(platformTheme->palette(QPlatformTheme::TextLineEditPalette), "QLineEdit");
+}
+
+void QApplicationPrivate::initializeWidgetFontHash()
+{
+ const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme();
+ if (!theme)
+ return;
+ FontHash *fontHash = qt_app_fonts_hash();
+ if (const QFont *font = theme->font(QPlatformTheme::MenuFont))
+ fontHash->insert(QByteArrayLiteral("QMenu"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::MenuBarFont))
+ fontHash->insert(QByteArrayLiteral("QMenuBar"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::MenuItemFont))
+ fontHash->insert(QByteArrayLiteral("QMenuItem"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::MessageBoxFont))
+ fontHash->insert(QByteArrayLiteral("QMessageBox"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::LabelFont))
+ fontHash->insert(QByteArrayLiteral("QLabel"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::TipLabelFont))
+ fontHash->insert(QByteArrayLiteral("QTipLabel"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::TitleBarFont))
+ fontHash->insert(QByteArrayLiteral("QTitleBar"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::StatusBarFont))
+ fontHash->insert(QByteArrayLiteral("QStatusBar"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::MdiSubWindowTitleFont)) {
+ fontHash->insert(QByteArrayLiteral("QWorkspaceTitleBar"), *font);
+ fontHash->insert(QByteArrayLiteral("QMdiSubWindowTitleBar"), *font);
+ }
+ if (const QFont *font = theme->font(QPlatformTheme::DockWidgetTitleFont))
+ fontHash->insert(QByteArrayLiteral("QDockWidgetTitle"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::PushButtonFont))
+ fontHash->insert(QByteArrayLiteral("QPushButton"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::ToolButtonFont))
+ fontHash->insert(QByteArrayLiteral("QToolButton"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::ItemViewFont))
+ fontHash->insert(QByteArrayLiteral("QAbstractItemView"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::ListViewFont))
+ fontHash->insert(QByteArrayLiteral("QListViewFont"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::HeaderViewFont)) {
+ fontHash->insert(QByteArrayLiteral("QHeaderViewFont"), *font);
+ fontHash->insert(QByteArrayLiteral("Q3Header"), *font);
+ }
+ if (const QFont *font = theme->font(QPlatformTheme::ListBoxFont))
+ fontHash->insert(QByteArrayLiteral("QListBox"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::ComboMenuItemFont))
+ fontHash->insert(QByteArrayLiteral("QComboMenuItemFont"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::ComboLineEditFont))
+ fontHash->insert(QByteArrayLiteral("QComboLineEditFont"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::SmallFont))
+ fontHash->insert(QByteArrayLiteral("QSmallFont"), *font);
+ if (const QFont *font = theme->font(QPlatformTheme::MiniFont))
+ fontHash->insert(QByteArrayLiteral("QMiniFont"), *font);
}
#ifndef QT_NO_WHEELEVENT
@@ -391,6 +468,7 @@ QPlatformNativeInterface *QApplication::platformNativeInterface()
void qt_init(QApplicationPrivate *priv, int type)
{
+ Q_UNUSED(priv);
Q_UNUSED(type);
qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
@@ -398,6 +476,7 @@ void qt_init(QApplicationPrivate *priv, int type)
if (const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette))
QToolTip::setPalette(*toolTipPalette);
+ QApplicationPrivate::initializeWidgetFontHash();
qApp->setObjectName(appName);
}
diff --git a/src/widgets/kernel/qboxlayout.cpp b/src/widgets/kernel/qboxlayout.cpp
index 4b7153715d..7ea77d211c 100644
--- a/src/widgets/kernel/qboxlayout.cpp
+++ b/src/widgets/kernel/qboxlayout.cpp
@@ -487,17 +487,17 @@ void QBoxLayoutPrivate::calcHfw(int w)
one of four functions:
\list
- \o addWidget() to add a widget to the QBoxLayout and set the
+ \li addWidget() to add a widget to the QBoxLayout and set the
widget's stretch factor. (The stretch factor is along the row of
boxes.)
- \o addSpacing() to create an empty box; this is one of the
+ \li addSpacing() to create an empty box; this is one of the
functions you use to create nice and spacious dialogs. See below
for ways to set margins.
- \o addStretch() to create an empty, stretchable box.
+ \li addStretch() to create an empty, stretchable box.
- \o addLayout() to add a box containing another QLayout to the row
+ \li addLayout() to add a box containing another QLayout to the row
and set that layout's stretch factor.
\endlist
@@ -508,10 +508,10 @@ void QBoxLayoutPrivate::calcHfw(int w)
QBoxLayout also includes two margin widths:
\list
- \o setContentsMargins() sets the width of the outer border on
+ \li setContentsMargins() sets the width of the outer border on
each side of the widget. This is the width of the reserved space
along each of the QBoxLayout's four sides.
- \o setSpacing() sets the width between neighboring boxes. (You
+ \li setSpacing() sets the width between neighboring boxes. (You
can use addSpacing() to get more space at a particular spot.)
\endlist
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index dd61528124..440f3f1dc2 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -1019,20 +1019,20 @@ QStyle* QFormLayoutPrivate::getStyle() const
provides the following advantages:
\list
- \o \bold{Adherence to the different platform's look and feel guidelines.}
+ \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
labels should be right-aligned, whereas Windows and GNOME
applications normally use left-alignment.
- \o \bold{Support for wrapping long rows.}
+ \li \b{Support for wrapping long rows.}
For devices with small displays, QFormLayout can be set to
\l{WrapLongRows}{wrap long rows}, or even to
\l{WrapAllRows}{wrap all rows}.
- \o \bold{Convenient API for creating label--field pairs.}
+ \li \b{Convenient API for creating label--field pairs.}
The addRow() overload that takes a QString and a QWidget *
creates a QLabel behind the scenes and automatically set up
@@ -1049,30 +1049,30 @@ QStyle* QFormLayoutPrivate::getStyle() const
\table
\header
- \o QCommonStyle derived styles (except QPlastiqueStyle)
- \o QMacStyle
- \o QPlastiqueStyle
- \o Qt Extended styles
+ \li QCommonStyle derived styles (except QPlastiqueStyle)
+ \li QMacStyle
+ \li QPlastiqueStyle
+ \li Qt Extended styles
\row
- \o \inlineimage qformlayout-win.png
- \o \inlineimage qformlayout-mac.png
- \o \inlineimage qformlayout-kde.png
- \o \inlineimage qformlayout-qpe.png
+ \li \inlineimage qformlayout-win.png
+ \li \inlineimage qformlayout-mac.png
+ \li \inlineimage qformlayout-kde.png
+ \li \inlineimage qformlayout-qpe.png
\row
- \o Traditional style used for Windows, GNOME, and earlier
+ \li Traditional style used for Windows, GNOME, and earlier
versions of KDE. Labels are left aligned, and expanding
fields grow to fill the available space. (This normally
corresponds to what we would get using a two-column
QGridLayout.)
- \o Style based on the
+ \li Style based on the
\l{Mac OS X Aqua} guidelines. Labels are right-aligned,
the fields don't grow beyond their size hint, and the
form is horizontally centered.
- \o Recommended style for
+ \li Recommended style for
\l{KDE applications}. Similar to MacStyle, except that the form
is left-aligned and all fields grow to fill the available
space.
- \o Default style for Qt Extended styles. Labels are right-aligned,
+ \li Default style for Qt Extended styles. Labels are right-aligned,
expanding fields grow to fill the available space, and row
wrapping is enabled for long lines.
\endtable
@@ -1966,7 +1966,7 @@ void QFormLayoutPrivate::arrangeWidgets(const QVector<QLayoutStruct>& layouts, Q
If the cell is already occupied, the \a widget is not inserted and an error message is
sent to the console.
- \bold{Note:} For most applications, addRow() or insertRow() should be used instead of setWidget().
+ \b{Note:} For most applications, addRow() or insertRow() should be used instead of setWidget().
\sa setLayout()
*/
@@ -1986,7 +1986,7 @@ void QFormLayout::setWidget(int row, ItemRole role, QWidget *widget)
If the cell is already occupied, the \a layout is not inserted and an error message is
sent to the console.
- \bold{Note:} For most applications, addRow() or insertRow() should be used instead of setLayout().
+ \b{Note:} For most applications, addRow() or insertRow() should be used instead of setLayout().
\sa setWidget()
*/
diff --git a/src/widgets/kernel/qgesture.h b/src/widgets/kernel/qgesture.h
index 8c412680b8..5e121def41 100644
--- a/src/widgets/kernel/qgesture.h
+++ b/src/widgets/kernel/qgesture.h
@@ -270,7 +270,7 @@ class QGestureEventPrivate;
class Q_WIDGETS_EXPORT QGestureEvent : public QEvent
{
public:
- QGestureEvent(const QList<QGesture *> &gestures);
+ explicit QGestureEvent(const QList<QGesture *> &gestures);
~QGestureEvent();
QList<QGesture *> gestures() const;
diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp
index 2e9edb1481..296d8d31e7 100644
--- a/src/widgets/kernel/qgesturemanager.cpp
+++ b/src/widgets/kernel/qgesturemanager.cpp
@@ -541,8 +541,8 @@ bool QGestureManager::filterEvent(QObject *receiver, QEvent *event)
}
void QGestureManager::getGestureTargets(const QSet<QGesture*> &gestures,
- QMap<QWidget *, QList<QGesture *> > *conflicts,
- QMap<QWidget *, QList<QGesture *> > *normal)
+ QHash<QWidget *, QList<QGesture *> > *conflicts,
+ QHash<QWidget *, QList<QGesture *> > *normal)
{
typedef QHash<Qt::GestureType, QHash<QWidget *, QGesture *> > GestureByTypes;
GestureByTypes gestureByTypes;
@@ -588,7 +588,7 @@ void QGestureManager::deliverEvents(const QSet<QGesture *> &gestures,
if (gestures.isEmpty())
return;
- typedef QMap<QWidget *, QList<QGesture *> > GesturesPerWidget;
+ typedef QHash<QWidget *, QList<QGesture *> > GesturesPerWidget;
GesturesPerWidget conflictedGestures;
GesturesPerWidget normalStartedGestures;
diff --git a/src/widgets/kernel/qgesturemanager_p.h b/src/widgets/kernel/qgesturemanager_p.h
index 68945a7b66..9f59550bb1 100644
--- a/src/widgets/kernel/qgesturemanager_p.h
+++ b/src/widgets/kernel/qgesturemanager_p.h
@@ -138,8 +138,8 @@ private:
void deliverEvents(const QSet<QGesture *> &gestures,
QSet<QGesture *> *undeliveredGestures);
void getGestureTargets(const QSet<QGesture*> &gestures,
- QMap<QWidget *, QList<QGesture *> > *conflicts,
- QMap<QWidget *, QList<QGesture *> > *normal);
+ QHash<QWidget *, QList<QGesture *> > *conflicts,
+ QHash<QWidget *, QList<QGesture *> > *normal);
void cancelGesturesForChildren(QGesture *originatingGesture);
};
diff --git a/src/widgets/kernel/qicon.cpp b/src/widgets/kernel/qicon.cpp
index eebd57f97e..369e26c21e 100644
--- a/src/widgets/kernel/qicon.cpp
+++ b/src/widgets/kernel/qicon.cpp
@@ -616,7 +616,8 @@ QIcon::operator QVariant() const
return QVariant(QVariant::Icon, this);
}
-/*! \obsolete
+/*! \fn int QIcon::serialNumber() const
+ \obsolete
Returns a number that identifies the contents of this
QIcon object. Distinct QIcon objects can have
@@ -633,11 +634,6 @@ QIcon::operator QVariant() const
\sa QPixmap::serialNumber()
*/
-int QIcon::serialNumber() const
-{
- return d ? d->serialNum : 0;
-}
-
/*!
Returns a number that identifies the contents of this QIcon
object. Distinct QIcon objects can have the same key if
@@ -945,8 +941,8 @@ QString QIcon::themeName()
specification can be obtained here:
\list
- \o \l{http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html}
- \o \l{http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html}
+ \li \l{http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html}
+ \li \l{http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html}
\endlist
To fetch an icon from the current icon theme:
diff --git a/src/widgets/kernel/qicon.h b/src/widgets/kernel/qicon.h
index 7bef500946..c6e07ba3e2 100644
--- a/src/widgets/kernel/qicon.h
+++ b/src/widgets/kernel/qicon.h
@@ -94,7 +94,9 @@ public:
bool isDetached() const;
void detach();
- int serialNumber() const;
+#if QT_DEPRECATED_SINCE(5, 0)
+ QT_DEPRECATED inline int serialNumber() const { return cacheKey() >> 32; }
+#endif
qint64 cacheKey() const;
void addPixmap(const QPixmap &pixmap, Mode mode = Normal, State state = Off);
diff --git a/src/widgets/kernel/qiconengineplugin.cpp b/src/widgets/kernel/qiconengineplugin.cpp
index ced4f5dd3e..26c9e7890a 100644
--- a/src/widgets/kernel/qiconengineplugin.cpp
+++ b/src/widgets/kernel/qiconengineplugin.cpp
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
\ingroup plugins
\inmodule QtWidgets
- \bold {Use QIconEnginePluginV2 instead.}
+ \b {Use QIconEnginePluginV2 instead.}
The icon engine plugin is a simple plugin interface that makes it easy to
create custom icon engines that can be loaded dynamically into applications
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp
index d5d739e431..541350c35c 100644
--- a/src/widgets/kernel/qlayout.cpp
+++ b/src/widgets/kernel/qlayout.cpp
@@ -215,7 +215,7 @@ QSpacerItem *QLayoutPrivate::createSpacerItem(const QLayout *layout, int w, int
to a layout, use the addWidget() function; to add a child layout, use the
addLayout() function provided by the relevant QLayout subclass.
- \bold{Note:} The ownership of \a item is transferred to the layout, and it's
+ \b{Note:} The ownership of \a item is transferred to the layout, and it's
the layout's responsibility to delete it.
\sa addWidget(), QBoxLayout::addLayout(), QGridLayout::addLayout()
@@ -1270,7 +1270,7 @@ QRect QLayout::alignmentRect(const QRect &r) const
is the caller's responsibility to give the widget a reasonable
geometry or to put the widget back into a layout.
- \bold{Note:} The ownership of \a widget remains the same as
+ \b{Note:} The ownership of \a widget remains the same as
when it was added.
\sa removeItem(), QWidget::setGeometry(), addWidget()
diff --git a/src/widgets/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp
index 664334d725..814b807b82 100644
--- a/src/widgets/kernel/qlayoutitem.cpp
+++ b/src/widgets/kernel/qlayoutitem.cpp
@@ -127,15 +127,15 @@ QSizePolicy::operator QVariant() const
manipulating empty space in layouts:
\table
- \header \o Class
- \o Functions
- \row \o QHBoxLayout
- \o \l{QBoxLayout::addSpacing()}{addSpacing()},
+ \header \li Class
+ \li Functions
+ \row \li QHBoxLayout
+ \li \l{QBoxLayout::addSpacing()}{addSpacing()},
\l{QBoxLayout::addStretch()}{addStretch()},
\l{QBoxLayout::insertSpacing()}{insertSpacing()},
\l{QBoxLayout::insertStretch()}{insertStretch()}
- \row \o QGridLayout
- \o \l{QGridLayout::setRowMinimumHeight()}{setRowMinimumHeight()},
+ \row \li QGridLayout
+ \li \l{QGridLayout::setRowMinimumHeight()}{setRowMinimumHeight()},
\l{QGridLayout::setRowStretch()}{setRowStretch()},
\l{QGridLayout::setColumnMinimumWidth()}{setColumnMinimumWidth()},
\l{QGridLayout::setColumnStretch()}{setColumnStretch()}
@@ -156,16 +156,16 @@ QSizePolicy::operator QVariant() const
manipulating widgets in layouts:
\table
- \header \o Class
- \o Functions
- \row \o QBoxLayout
- \o \l{QBoxLayout::addWidget()}{addWidget()},
+ \header \li Class
+ \li Functions
+ \row \li QBoxLayout
+ \li \l{QBoxLayout::addWidget()}{addWidget()},
\l{QBoxLayout::insertWidget()}{insertWidget()},
\l{QBoxLayout::setStretchFactor()}{setStretchFactor()}
- \row \o QGridLayout
- \o \l{QGridLayout::addWidget()}{addWidget()}
- \row \o QStackedLayout
- \o \l{QStackedLayout::addWidget()}{addWidget()},
+ \row \li QGridLayout
+ \li \l{QGridLayout::addWidget()}{addWidget()}
+ \row \li QStackedLayout
+ \li \l{QStackedLayout::addWidget()}{addWidget()},
\l{QStackedLayout::insertWidget()}{insertWidget()},
\l{QStackedLayout::currentWidget()}{currentWidget()},
\l{QStackedLayout::setCurrentWidget()}{setCurrentWidget()},
@@ -191,7 +191,7 @@ QSizePolicy::operator QVariant() const
/*!
Sets the alignment of this item to \a alignment.
- \bold{Note:} Item alignment is only supported by QLayoutItem subclasses
+ \b{Note:} Item alignment is only supported by QLayoutItem subclasses
where it would have a visual effect. Except for QSpacerItem, which provides
blank space for layouts, all public Qt classes that inherit QLayoutItem
support item alignment.
diff --git a/src/widgets/kernel/qstackedlayout.cpp b/src/widgets/kernel/qstackedlayout.cpp
index 9b40063e65..0d2e7716e5 100644
--- a/src/widgets/kernel/qstackedlayout.cpp
+++ b/src/widgets/kernel/qstackedlayout.cpp
@@ -477,6 +477,38 @@ void QStackedLayout::setGeometry(const QRect &rect)
}
/*!
+ \reimp
+*/
+bool QStackedLayout::hasHeightForWidth() const
+{
+ const int n = count();
+
+ for (int i = 0; i < n; ++i) {
+ if (QLayoutItem *item = itemAt(i)) {
+ if (item->hasHeightForWidth())
+ return true;
+ }
+ }
+ return false;
+}
+
+/*!
+ \reimp
+*/
+int QStackedLayout::heightForWidth(int width) const
+{
+ const int n = count();
+
+ int hfw = 0;
+ for (int i = 0; i < n; ++i) {
+ if (QLayoutItem *item = itemAt(i)) {
+ hfw = qMax(hfw, item->heightForWidth(width));
+ }
+ }
+ return hfw;
+}
+
+/*!
\enum QStackedLayout::StackingMode
\since 4.4
diff --git a/src/widgets/kernel/qstackedlayout.h b/src/widgets/kernel/qstackedlayout.h
index e54efa886e..fa77341c52 100644
--- a/src/widgets/kernel/qstackedlayout.h
+++ b/src/widgets/kernel/qstackedlayout.h
@@ -94,6 +94,8 @@ public:
QLayoutItem *itemAt(int) const;
QLayoutItem *takeAt(int);
void setGeometry(const QRect &rect);
+ bool hasHeightForWidth() const;
+ int heightForWidth(int width) const;
Q_SIGNALS:
void widgetRemoved(int index);
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 44995f0959..bf864503a4 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -484,11 +484,11 @@ void QWidget::setAutoFillBackground(bool enabled)
Every widget's constructor accepts one or two standard arguments:
\list 1
- \i \c{QWidget *parent = 0} is the parent of the new widget. If it is 0
+ \li \c{QWidget *parent = 0} is the parent of the new widget. If it is 0
(the default), the new widget will be a window. If not, it will be
a child of \e parent, and be constrained by \e parent's geometry
(unless you specify Qt::Window as window flag).
- \i \c{Qt::WindowFlags f = 0} (where available) sets the window flags;
+ \li \c{Qt::WindowFlags f = 0} (where available) sets the window flags;
the default is suitable for almost all widgets, but to get, for
example, a window without a window system frame, you must use
special flags.
@@ -593,16 +593,16 @@ void QWidget::setAutoFillBackground(bool enabled)
starting with the most common ones:
\list
- \i paintEvent() is called whenever the widget needs to be repainted.
+ \li paintEvent() is called whenever the widget needs to be repainted.
Every widget displaying custom content must implement it. Painting
using a QPainter can only take place in a paintEvent() or a
function called by a paintEvent().
- \i resizeEvent() is called when the widget has been resized.
- \i mousePressEvent() is called when a mouse button is pressed while
+ \li resizeEvent() is called when the widget has been resized.
+ \li mousePressEvent() is called when a mouse button is pressed while
the mouse cursor is inside the widget, or when the widget has
grabbed the mouse using grabMouse(). Pressing the mouse without
releasing it is effectively the same as calling grabMouse().
- \i mouseReleaseEvent() is called when a mouse button is released. A
+ \li mouseReleaseEvent() is called when a mouse button is released. A
widget receives mouse release events when it has received the
corresponding mouse press event. This means that if the user
presses the mouse inside \e your widget, then drags the mouse
@@ -610,7 +610,7 @@ void QWidget::setAutoFillBackground(bool enabled)
receives the release event. There is one exception: if a popup menu
appears while the mouse button is held down, this popup immediately
steals the mouse events.
- \i mouseDoubleClickEvent() is called when the user double-clicks in
+ \li mouseDoubleClickEvent() is called when the user double-clicks in
the widget. If the user double-clicks, the widget receives a mouse
press event, a mouse release event and finally this event instead
of a second mouse press event. (Some mouse move events may also be
@@ -625,46 +625,46 @@ void QWidget::setAutoFillBackground(bool enabled)
handlers:
\list
- \i keyPressEvent() is called whenever a key is pressed, and again when
+ \li keyPressEvent() is called whenever a key is pressed, and again when
a key has been held down long enough for it to auto-repeat. The
\key Tab and \key Shift+Tab keys are only passed to the widget if
they are not used by the focus-change mechanisms. To force those
keys to be processed by your widget, you must reimplement
QWidget::event().
- \i focusInEvent() is called when the widget gains keyboard focus
+ \li focusInEvent() is called when the widget gains keyboard focus
(assuming you have called setFocusPolicy()). Well-behaved widgets
indicate that they own the keyboard focus in a clear but discreet
way.
- \i focusOutEvent() is called when the widget loses keyboard focus.
+ \li focusOutEvent() is called when the widget loses keyboard focus.
\endlist
You may be required to also reimplement some of the less common event
handlers:
\list
- \i mouseMoveEvent() is called whenever the mouse moves while a mouse
+ \li mouseMoveEvent() is called whenever the mouse moves while a mouse
button is held down. This can be useful during drag and drop
operations. If you call \l{setMouseTracking()}{setMouseTracking}(true),
you get mouse move events even when no buttons are held down.
(See also the \l{Drag and Drop} guide.)
- \i keyReleaseEvent() is called whenever a key is released and while it
+ \li keyReleaseEvent() is called whenever a key is released and while it
is held down (if the key is auto-repeating). In that case, the
widget will receive a pair of key release and key press event for
every repeat. The \key Tab and \key Shift+Tab keys are only passed
to the widget if they are not used by the focus-change mechanisms.
To force those keys to be processed by your widget, you must
reimplement QWidget::event().
- \i wheelEvent() is called whenever the user turns the mouse wheel
+ \li wheelEvent() is called whenever the user turns the mouse wheel
while the widget has the focus.
- \i enterEvent() is called when the mouse enters the widget's screen
+ \li enterEvent() is called when the mouse enters the widget's screen
space. (This excludes screen space owned by any of the widget's
children.)
- \i leaveEvent() is called when the mouse leaves the widget's screen
+ \li leaveEvent() is called when the mouse leaves the widget's screen
space. If the mouse enters a child widget it will not cause a
leaveEvent().
- \i moveEvent() is called when the widget has been moved relative to
+ \li moveEvent() is called when the widget has been moved relative to
its parent.
- \i closeEvent() is called when the user closes the widget (or when
+ \li closeEvent() is called when the user closes the widget (or when
close() is called).
\endlist
@@ -682,27 +682,27 @@ void QWidget::setAutoFillBackground(bool enabled)
\section1 Groups of Functions and Properties
\table
- \header \i Context \i Functions and Properties
+ \header \li Context \li Functions and Properties
- \row \i Window functions \i
+ \row \li Window functions \li
show(),
hide(),
raise(),
lower(),
close().
- \row \i Top-level windows \i
+ \row \li Top-level windows \li
\l windowModified, \l windowTitle, \l windowIcon, \l windowIconText,
\l isActiveWindow, activateWindow(), \l minimized, showMinimized(),
\l maximized, showMaximized(), \l fullScreen, showFullScreen(),
showNormal().
- \row \i Window contents \i
+ \row \li Window contents \li
update(),
repaint(),
scroll().
- \row \i Geometry \i
+ \row \li Geometry \li
\l pos, x(), y(), \l rect, \l size, width(), height(), move(), resize(),
\l sizePolicy, sizeHint(), minimumSizeHint(),
updateGeometry(), layout(),
@@ -713,7 +713,7 @@ void QWidget::setAutoFillBackground(bool enabled)
\l maximumSize, \l minimumSize, \l sizeIncrement,
\l baseSize, setFixedSize()
- \row \i Mode \i
+ \row \li Mode \li
\l visible, isVisibleTo(),
\l enabled, isEnabledTo(),
\l modal,
@@ -722,7 +722,7 @@ void QWidget::setAutoFillBackground(bool enabled)
\l updatesEnabled,
visibleRegion().
- \row \i Look and feel \i
+ \row \li Look and feel \li
style(),
setStyle(),
\l styleSheet,
@@ -732,17 +732,17 @@ void QWidget::setAutoFillBackground(bool enabled)
backgroundRole(), setBackgroundRole(),
fontInfo(), fontMetrics().
- \row \i Keyboard focus functions \i
+ \row \li Keyboard focus functions \li
\l focus, \l focusPolicy,
setFocus(), clearFocus(), setTabOrder(), setFocusProxy(),
focusNextChild(), focusPreviousChild().
- \row \i Mouse and keyboard grabbing \i
+ \row \li Mouse and keyboard grabbing \li
grabMouse(), releaseMouse(),
grabKeyboard(), releaseKeyboard(),
mouseGrabber(), keyboardGrabber().
- \row \i Event handlers \i
+ \row \li Event handlers \li
event(),
mousePressEvent(),
mouseReleaseEvent(),
@@ -769,11 +769,11 @@ void QWidget::setAutoFillBackground(bool enabled)
customEvent().
changeEvent(),
- \row \i System functions \i
+ \row \li System functions \li
parentWidget(), window(), setParent(), winId(),
find(), metric().
- \row \i Interactive help \i
+ \row \li Interactive help \li
setToolTip(), setWhatsThis()
\endtable
@@ -815,15 +815,15 @@ void QWidget::setAutoFillBackground(bool enabled)
achieve different effects:
\list
- \i The left widget has no additional properties or widget attributes
+ \li The left widget has no additional properties or widget attributes
set. This default state suits most custom widgets using
transparency, are irregularly-shaped, or do not paint over their
entire area with an opaque brush.
- \i The center widget has the \l autoFillBackground property set. This
+ \li The center widget has the \l autoFillBackground property set. This
property is used with custom widgets that rely on the widget to
supply a default background, and do not paint over their entire
area with an opaque brush.
- \i The right widget has the Qt::WA_OpaquePaintEvent widget attribute
+ \li The right widget has the Qt::WA_OpaquePaintEvent widget attribute
set. This indicates that the widget will paint over its entire area
with opaque colors. The widget's area will initially be
\e{uninitialized}, represented in the diagram with a red diagonal
@@ -874,9 +874,9 @@ void QWidget::setAutoFillBackground(bool enabled)
Platform notes:
\list
- \o X11: This feature relies on the use of an X server that supports ARGB visuals
+ \li X11: This feature relies on the use of an X server that supports ARGB visuals
and a compositing window manager.
- \o Windows: The widget needs to have the Qt::FramelessWindowHint window flag set
+ \li Windows: The widget needs to have the Qt::FramelessWindowHint window flag set
for the translucency to work.
\endlist
@@ -891,14 +891,14 @@ void QWidget::setAutoFillBackground(bool enabled)
one of the following options:
\list 1
- \i Use the \c{QT_USE_NATIVE_WINDOWS=1} in your environment.
- \i Set the Qt::AA_NativeWindows attribute on your application. All
+ \li Use the \c{QT_USE_NATIVE_WINDOWS=1} in your environment.
+ \li Set the Qt::AA_NativeWindows attribute on your application. All
widgets will be native widgets.
- \i Set the Qt::WA_NativeWindow attribute on widgets: The widget itself
+ \li Set the Qt::WA_NativeWindow attribute on widgets: The widget itself
and all of its ancestors will become native (unless
Qt::WA_DontCreateNativeAncestors is set).
- \i Call QWidget::winId to enforce a native window (this implies 3).
- \i Set the Qt::WA_PaintOnScreen attribute to enforce a native window
+ \li Call QWidget::winId to enforce a native window (this implies 3).
+ \li Set the Qt::WA_PaintOnScreen attribute to enforce a native window
(this implies 3).
\endlist
@@ -957,17 +957,17 @@ QRegion qt_dirtyRegion(QWidget *widget)
/*
Widget state flags:
\list
- \i Qt::WA_WState_Created The widget has a valid winId().
- \i Qt::WA_WState_Visible The widget is currently visible.
- \i Qt::WA_WState_Hidden The widget is hidden, i.e. it won't
+ \li Qt::WA_WState_Created The widget has a valid winId().
+ \li Qt::WA_WState_Visible The widget is currently visible.
+ \li Qt::WA_WState_Hidden The widget is hidden, i.e. it won't
become visible unless you call show() on it. Qt::WA_WState_Hidden
implies !Qt::WA_WState_Visible.
- \i Qt::WA_WState_CompressKeys Compress keyboard events.
- \i Qt::WA_WState_BlockUpdates Repaints and updates are disabled.
- \i Qt::WA_WState_InPaintEvent Currently processing a paint event.
- \i Qt::WA_WState_Reparented The widget has been reparented.
- \i Qt::WA_WState_ConfigPending A configuration (resize/move) event is pending.
- \i Qt::WA_WState_DND (Deprecated) The widget supports drag and drop, see setAcceptDrops().
+ \li Qt::WA_WState_CompressKeys Compress keyboard events.
+ \li Qt::WA_WState_BlockUpdates Repaints and updates are disabled.
+ \li Qt::WA_WState_InPaintEvent Currently processing a paint event.
+ \li Qt::WA_WState_Reparented The widget has been reparented.
+ \li Qt::WA_WState_ConfigPending A configuration (resize/move) event is pending.
+ \li Qt::WA_WState_DND (Deprecated) The widget supports drag and drop, see setAcceptDrops().
\endlist
*/
@@ -5689,16 +5689,16 @@ QString QWidget::windowIconText() const
On Mac OS X:
\list
- \o The file name of the specified path, obtained using QFileInfo::fileName().
+ \li The file name of the specified path, obtained using QFileInfo::fileName().
\endlist
On Windows and X11:
\list
- \o The file name of the specified path, obtained using QFileInfo::fileName().
- \o An optional \c{*} character, if the \l windowModified property is set.
- \o The \c{0x2014} unicode character, padded either side by spaces.
- \o The application name, obtained from the application's
+ \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
@@ -7164,9 +7164,9 @@ void QWidgetPrivate::hide_helper()
Widgets are hidden if:
\list
- \o they were created as independent windows,
- \o they were created as children of visible widgets,
- \o hide() or setVisible(false) was called.
+ \li they were created as independent windows,
+ \li they were created as children of visible widgets,
+ \li hide() or setVisible(false) was called.
\endlist
*/
@@ -8390,7 +8390,6 @@ void QWidget::mouseReleaseEvent(QMouseEvent *event)
void QWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
- mousePressEvent(event); // try mouse press event
}
#ifndef QT_NO_WHEELEVENT
@@ -8587,9 +8586,9 @@ void QWidget::leaveEvent(QEvent *)
happen for one of the following reasons:
\list
- \o repaint() or update() was invoked,
- \o the widget was obscured and has now been uncovered, or
- \o many other reasons.
+ \li repaint() or update() was invoked,
+ \li the widget was obscured and has now been uncovered, or
+ \li many other reasons.
\endlist
Many widgets can simply repaint their entire surface when asked to, but
@@ -8612,13 +8611,13 @@ void QWidget::leaveEvent(QEvent *)
Since Qt 4.0, QWidget automatically double-buffers its painting, so there
is no need to write double-buffering code in paintEvent() to avoid flicker.
- \bold{Note for the X11 platform}: It is possible to toggle global double
+ \b{Note for the X11 platform}: It is possible to toggle global double
buffering by calling \c qt_x11_set_global_double_buffer(). For example,
\snippet doc/src/snippets/code/src_gui_kernel_qwidget.cpp 14
\note Generally, you should refrain from calling update() or repaint()
- \bold{inside} a paintEvent(). For example, calling update() or repaint() on
+ \b{inside} a paintEvent(). For example, calling update() or repaint() on
children inside a paintevent() results in undefined behavior; the child may
or may not get a paint event.
@@ -8960,8 +8959,8 @@ void QWidget::hideEvent(QHideEvent *)
x11Event(), winEvent() and macEvent() of Qt 4.
\table
- \header \i Platform \i Event Type Identifier \i Message Type \i Result Type
- \row \i Windows \i "windows_generic_MSG" \i MSG * \i LRESULT
+ \header \li Platform \li Event Type Identifier \li Message Type \li Result Type
+ \row \li Windows \li "windows_generic_MSG" \li MSG * \li LRESULT
\endtable
*/
@@ -8991,7 +8990,7 @@ bool QWidget::nativeEvent(const QByteArray &eventType, void *message, long *resu
If you need to change some settings when a widget is polished,
reimplement event() and handle the QEvent::Polish event type.
- \bold{Note:} The function is declared const so that it can be called from
+ \b{Note:} The function is declared const so that it can be called from
other const functions (e.g., sizeHint()).
\sa event()
@@ -11081,7 +11080,7 @@ void QWidget::ungrabGesture(Qt::GestureType gesture)
\note Only visible widgets can grab mouse input. If isVisible()
returns false for a widget, that widget cannot call grabMouse().
- \note \bold{(Mac OS X developers)} For \e Cocoa, calling
+ \note \b{(Mac OS X developers)} For \e Cocoa, calling
grabMouse() on a widget only works when the mouse is inside the
frame of that widget. For \e Carbon, it works outside the widget's
frame as well, like for Windows and X11.
@@ -11101,7 +11100,7 @@ void QWidget::ungrabGesture(Qt::GestureType gesture)
\warning Grabbing the mouse might lock the terminal.
- \note \bold{(Mac OS X developers)} See the note in QWidget::grabMouse().
+ \note \b{(Mac OS X developers)} See the note in QWidget::grabMouse().
\sa releaseMouse(), grabKeyboard(), releaseKeyboard(), setCursor()
*/
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index a37de8547a..3d23b04ddf 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -905,16 +905,12 @@ void QWidgetPrivate::setModal_sys()
}
#ifndef QT_NO_CURSOR
-static void applyCursor(QWidget *w, const QCursor &c)
+static inline void applyCursor(QWidget *w, QCursor c)
{
- QCursor cc = c;
- QList<QWeakPointer<QPlatformCursor> > cursors = QPlatformCursorPrivate::getInstances();
- int cursorCount = cursors.count();
- for (int i = 0; i < cursorCount; ++i) {
- const QWeakPointer<QPlatformCursor> &cursor(cursors.at(i));
- if (cursor)
- cursor.data()->changeCursor(&cc, w->window()->windowHandle());
- }
+ if (QWindow *window = w->windowHandle())
+ if (const QScreen *screen = window->screen())
+ if (QPlatformCursor *cursor = screen->handle()->cursor())
+ cursor->changeCursor(&c, window);
}
void qt_qpa_set_cursor(QWidget *w, bool force)
diff --git a/src/widgets/kernel/qwidgetaction.cpp b/src/widgets/kernel/qwidgetaction.cpp
index 14369513da..c3fc6c7cfb 100644
--- a/src/widgets/kernel/qwidgetaction.cpp
+++ b/src/widgets/kernel/qwidgetaction.cpp
@@ -87,17 +87,17 @@ QT_BEGIN_NAMESPACE
Note that it is up to the widget to activate the action, for example by
reimplementing mouse event handlers and calling QAction::trigger().
- \bold {Mac OS X}: If you add a widget to a menu in the application's menu
+ \b {Mac OS X}: If you add a widget to a menu in the application's menu
bar on Mac OS X, the widget will be added and it will function but with some
limitations:
\list 1
- \o The widget is reparented away from the QMenu to the native menu
+ \li The widget is reparented away from the QMenu to the native menu
view. If you show the menu in some other place (e.g. as a popup menu),
the widget will not be there.
- \o Focus/Keyboard handling of the widget is not possible.
- \o Due to Apple's design, mouse tracking on the widget currently does
+ \li Focus/Keyboard handling of the widget is not possible.
+ \li Due to Apple's design, mouse tracking on the widget currently does
not work.
- \o Connecting the triggered() signal to a slot that opens a modal
+ \li Connecting the triggered() signal to a slot that opens a modal
dialog will cause a crash in Mac OS X 10.4 (known bug acknowledged
by Apple), a workaround is to use a QueuedConnection instead of a
DirectConnection.