summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-01-03 14:20:01 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-01-04 11:12:05 +0100
commitca2f44680cb97e7a7c46ee0ab26654822fe65e2d (patch)
treeb9d85ad8ec1b18a6aa56b7657812cf3791bdf72e /src/widgets
parent28a21d98ef8d880a6dd86ee19dd803424bb5eae1 (diff)
parent83188c6499ccdc87c0a2c468bb497e287f5db369 (diff)
Merge branch 'stable' into dev
Conflicts: examples/widgets/painting/shared/shared.pri src/corelib/tools/qharfbuzz_p.h src/corelib/tools/qunicodetools.cpp src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp Change-Id: Ibc9860abf570e5ce8b052fb88feb73ec35e64bd3
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/accessible/qaccessiblewidget.cpp2
-rw-r--r--src/widgets/dialogs/qdialog.cpp2
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp4
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp30
-rw-r--r--src/widgets/dialogs/qwizard.cpp2
-rw-r--r--src/widgets/doc/images/dialog-examples.pngbin0 -> 7049 bytes
-rw-r--r--src/widgets/doc/images/graphicsview-examples.pngbin0 -> 223121 bytes
-rw-r--r--src/widgets/doc/images/itemviews-examples.pngbin0 -> 32534 bytes
-rw-r--r--src/widgets/doc/images/mainwindow-examples.pngbin0 -> 10271 bytes
-rw-r--r--src/widgets/doc/qtwidgets.qdocconf12
-rw-r--r--src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp30
-rw-r--r--src/widgets/doc/src/model-view-programming.qdoc3
-rw-r--r--src/widgets/doc/src/qtwidgets-examples.qdoc70
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/styles.qdoc4
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc32
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp31
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp106
-rw-r--r--src/widgets/graphicsview/qgraphicsview_p.h1
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp2
-rw-r--r--src/widgets/itemviews/qlistview.cpp4
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp4
-rw-r--r--src/widgets/itemviews/qtableview.cpp4
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp4
-rw-r--r--src/widgets/itemviews/qtreeview.cpp16
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp4
-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
-rw-r--r--src/widgets/styles/qcommonstyle.cpp8
-rw-r--r--src/widgets/styles/qfusionstyle.cpp2
-rw-r--r--src/widgets/styles/qgtkpainter.cpp1
-rw-r--r--src/widgets/styles/qgtkstyle.cpp4
-rw-r--r--src/widgets/styles/qmacstyle.qdoc2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm139
-rw-r--r--src/widgets/styles/qmacstyle_mac_p_p.h26
-rw-r--r--src/widgets/styles/qstylehelper.cpp2
-rw-r--r--src/widgets/styles/qstyleoption.cpp1
-rw-r--r--src/widgets/widgets.pro10
-rw-r--r--src/widgets/widgets/qabstractscrollarea.cpp31
-rw-r--r--src/widgets/widgets/qcheckbox.cpp4
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp12
-rw-r--r--src/widgets/widgets/qdial.cpp4
-rw-r--r--src/widgets/widgets/qfontcombobox.cpp2
-rw-r--r--src/widgets/widgets/qgroupbox.cpp4
-rw-r--r--src/widgets/widgets/qlabel.cpp4
-rw-r--r--src/widgets/widgets/qlcdnumber.cpp4
-rw-r--r--src/widgets/widgets/qlineedit.cpp4
-rw-r--r--src/widgets/widgets/qmenu.cpp2
-rw-r--r--src/widgets/widgets/qmenu_wince.rc4
-rw-r--r--src/widgets/widgets/qprogressbar.cpp4
-rw-r--r--src/widgets/widgets/qpushbutton.cpp4
-rw-r--r--src/widgets/widgets/qradiobutton.cpp4
-rw-r--r--src/widgets/widgets/qscrollbar.cpp20
-rw-r--r--src/widgets/widgets/qslider.cpp4
-rw-r--r--src/widgets/widgets/qspinbox.cpp4
-rw-r--r--src/widgets/widgets/qsplitter.cpp35
-rw-r--r--src/widgets/widgets/qtabwidget.cpp4
-rw-r--r--src/widgets/widgets/qtextedit.cpp15
-rw-r--r--src/widgets/widgets/qtextedit.h1
-rw-r--r--src/widgets/widgets/qtextedit_p.h1
-rw-r--r--src/widgets/widgets/qtoolbar.cpp30
64 files changed, 482 insertions, 350 deletions
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp
index c8a22175fc..2177b2b262 100644
--- a/src/widgets/accessible/qaccessiblewidget.cpp
+++ b/src/widgets/accessible/qaccessiblewidget.cpp
@@ -162,7 +162,6 @@ public:
QAccessible::Role role;
QString name;
QStringList primarySignals;
- const QAccessibleInterface *asking;
};
/*!
@@ -201,7 +200,6 @@ QAccessibleWidget::QAccessibleWidget(QWidget *w, QAccessible::Role role, const Q
d = new QAccessibleWidgetPrivate();
d->role = role;
d->name = name;
- d->asking = 0;
}
/*! \reimp */
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 7b47f4e135..290f0a7f65 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -67,8 +67,10 @@ static inline int themeDialogType(const QDialog *dialog)
if (qobject_cast<const QFileDialog *>(dialog))
return QPlatformTheme::FileDialog;
#endif
+#ifndef QT_NO_COLORDIALOG
if (qobject_cast<const QColorDialog *>(dialog))
return QPlatformTheme::ColorDialog;
+#endif
#ifndef QT_NO_FONTDIALOG
if (qobject_cast<const QFontDialog *>(dialog))
return QPlatformTheme::FontDialog;
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index fc8b62d75e..88652271af 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -363,7 +363,7 @@ QFileDialog::QFileDialog(const QFileDialogArgs &args)
QFileDialog::~QFileDialog()
{
#ifndef QT_NO_SETTINGS
- QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ QSettings settings(QSettings::UserScope, QLatin1String("QtProject"));
settings.beginGroup(QLatin1String("Qt"));
settings.setValue(QLatin1String("filedialog"), saveState());
#endif
@@ -2229,7 +2229,7 @@ void QFileDialogPrivate::init(const QString &directory, const QString &nameFilte
q->setFileMode(QFileDialog::AnyFile);
#ifndef QT_NO_SETTINGS
- QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ QSettings settings(QSettings::UserScope, QLatin1String("QtProject"));
settings.beginGroup(QLatin1String("Qt"));
if (!directory.isEmpty())
setLastVisitedDirectory(workingDirectory(directory));
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 1bab8b7785..e93850c1b7 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -240,7 +240,7 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text)
label->setTextInteractionFlags(Qt::TextInteractionFlags(q->style()->styleHint(QStyle::SH_MessageBox_TextInteractionFlags, 0, q)));
label->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
label->setOpenExternalLinks(true);
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
label->setContentsMargins(16, 0, 0, 0);
#else
label->setContentsMargins(2, 0, 0, 0);
@@ -258,7 +258,7 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text)
q, SLOT(_q_buttonClicked(QAbstractButton*)));
QGridLayout *grid = new QGridLayout;
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
grid->addWidget(iconLabel, 0, 0, 2, 1, Qt::AlignTop);
grid->addWidget(label, 0, 1, 1, 1);
// -- leave space for information label --
@@ -285,7 +285,7 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text)
}
q->setModal(true);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
QFont f = q->font();
f.setBold(true);
label->setFont(f);
@@ -316,7 +316,7 @@ void QMessageBoxPrivate::updateSize()
if (screenSize.width() <= 1024)
hardLimit = screenSize.width();
#endif
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
int softLimit = qMin(screenSize.width()/2, 420);
#else
// note: ideally on windows, hard and soft limits but it breaks compat
@@ -1328,7 +1328,7 @@ void QMessageBox::changeEvent(QEvent *ev)
}
case QEvent::FontChange:
case QEvent::ApplicationFontChange:
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
{
QFont f = font();
f.setBold(true);
@@ -1348,12 +1348,12 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
{
Q_D(QMessageBox);
if (e->key() == Qt::Key_Escape
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
|| (e->modifiers() == Qt::ControlModifier && e->key() == Qt::Key_Period)
#endif
) {
if (d->detectedEscapeButton) {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
d->detectedEscapeButton->animateClick();
#else
d->detectedEscapeButton->click();
@@ -1687,7 +1687,7 @@ QMessageBox::StandardButton QMessageBox::critical(QWidget *parent, const QString
*/
void QMessageBox::about(QWidget *parent, const QString &title, const QString &text)
{
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
static QPointer<QMessageBox> oldMsgBox;
if (oldMsgBox && oldMsgBox->text() == text) {
@@ -1699,7 +1699,7 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
#endif
QMessageBox *msgBox = new QMessageBox(title, text, Information, 0, 0, 0, parent
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
, Qt::WindowTitleHint | Qt::WindowSystemMenuHint
#endif
);
@@ -1709,7 +1709,7 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
msgBox->setIconPixmap(icon.pixmap(size));
// should perhaps be a style hint
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
oldMsgBox = msgBox;
#if 0
// ### doesn't work until close button is enabled in title bar
@@ -1740,7 +1740,7 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
*/
void QMessageBox::aboutQt(QWidget *parent, const QString &title)
{
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
static QPointer<QMessageBox> oldMsgBox;
if (oldMsgBox) {
@@ -1802,7 +1802,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
#endif
// should perhaps be a style hint
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
oldMsgBox = msgBox;
#if 0
// ### doesn't work until close button is enabled in title bar
@@ -2467,7 +2467,7 @@ void QMessageBox::setInformativeText(const QString &text)
layout()->removeWidget(d->informativeLabel);
delete d->informativeLabel;
d->informativeLabel = 0;
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
d->label->setContentsMargins(2, 0, 0, 0);
#endif
d->updateSize();
@@ -2481,7 +2481,7 @@ void QMessageBox::setInformativeText(const QString &text)
label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
label->setOpenExternalLinks(true);
label->setWordWrap(true);
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
d->label->setContentsMargins(2, 0, 0, 0);
label->setContentsMargins(2, 0, 0, 6);
label->setIndent(9);
@@ -2511,7 +2511,7 @@ void QMessageBox::setInformativeText(const QString &text)
void QMessageBox::setWindowTitle(const QString &title)
{
// Message boxes on the mac do not have a title
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
QDialog::setWindowTitle(title);
#else
Q_UNUSED(title);
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index 44518ec7d5..241e9f678a 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -916,7 +916,7 @@ QWizardLayoutInfo QWizardPrivate::layoutInfoForCurrentPage()
info.buttonSpacing = 12;
info.wizStyle = wizStyle;
- if ((info.wizStyle == QWizard::AeroStyle)
+ if (info.wizStyle == QWizard::AeroStyle
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
&& (QVistaHelper::vistaState() == QVistaHelper::Classic || vistaDisabled())
#endif
diff --git a/src/widgets/doc/images/dialog-examples.png b/src/widgets/doc/images/dialog-examples.png
new file mode 100644
index 0000000000..26537b5de3
--- /dev/null
+++ b/src/widgets/doc/images/dialog-examples.png
Binary files differ
diff --git a/src/widgets/doc/images/graphicsview-examples.png b/src/widgets/doc/images/graphicsview-examples.png
new file mode 100644
index 0000000000..8889424023
--- /dev/null
+++ b/src/widgets/doc/images/graphicsview-examples.png
Binary files differ
diff --git a/src/widgets/doc/images/itemviews-examples.png b/src/widgets/doc/images/itemviews-examples.png
new file mode 100644
index 0000000000..a151ea857f
--- /dev/null
+++ b/src/widgets/doc/images/itemviews-examples.png
Binary files differ
diff --git a/src/widgets/doc/images/mainwindow-examples.png b/src/widgets/doc/images/mainwindow-examples.png
new file mode 100644
index 0000000000..3e946a68bf
--- /dev/null
+++ b/src/widgets/doc/images/mainwindow-examples.png
Binary files differ
diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf
index 0e4ea0351b..062adc7f7c 100644
--- a/src/widgets/doc/qtwidgets.qdocconf
+++ b/src/widgets/doc/qtwidgets.qdocconf
@@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtWidgets
description = Qt Widgets Reference Documentation
url = http://qt-project.org/doc/qtwidgets
-version = 5.0.0
+version = 5.0.1
examplesinstallpath = widgets
qhp.projects = QtWidgets
qhp.QtWidgets.file = qtwidgets.qhp
-qhp.QtWidgets.namespace = org.qt-project.qtwidgets.500
+qhp.QtWidgets.namespace = org.qt-project.qtwidgets.501
qhp.QtWidgets.virtualFolder = qtwidgets
qhp.QtWidgets.indexTitle = Qt Widgets
qhp.QtWidgets.indexRoot =
-qhp.QtWidgets.filterAttributes = qtwidgets 5.0.0 qtrefdoc
-qhp.QtWidgets.customFilters.Qt.name = QtWidgets 5.0.0
-qhp.QtWidgets.customFilters.Qt.filterAttributes = qtwidgets 5.0.0
+qhp.QtWidgets.filterAttributes = qtwidgets 5.0.1 qtrefdoc
+qhp.QtWidgets.customFilters.Qt.name = QtWidgets 5.0.1
+qhp.QtWidgets.customFilters.Qt.filterAttributes = qtwidgets 5.0.1
qhp.QtWidgets.subprojects = classes
qhp.QtWidgets.subprojects.classes.title = C++ Classes
@@ -27,7 +27,7 @@ qhp.QtWidgets.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtwidgets/qtwidgets.tags
-depends += qtcore qtgui qtdoc qtsql
+depends += qtcore qtgui qtdoc qtsql qtdesigner
headerdirs += ..
diff --git a/src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp b/src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp
index aa562078a6..b4b1eb5a00 100644
--- a/src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp
+++ b/src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp
@@ -39,23 +39,25 @@
****************************************************************************/
//! [0]
-int main(int argc, char **argv)
+QCoreApplication* createApplication(int &argc, char *argv[])
{
-#ifdef Q_WS_X11
- bool useGUI = getenv("DISPLAY") != 0;
-#else
- bool useGUI = true;
-#endif
- QApplication app(argc, argv, useGUI);
-
- if (useGUI) {
- // start GUI version
- ...
+ for (int i = 1; i < argc; ++i)
+ if (!qstrcmp(argv[i], "-no-gui"))
+ return new QCoreApplication(argc, argv);
+ return new QApplication(argc, argv);
+}
+
+int main(int argc, char* argv[])
+{
+ QScopedPointer<QCoreApplication> app(createApplication(argc, argv));
+
+ if (qobject_cast<QApplication *>(app.data())) {
+ // start GUI version...
} else {
- // start non-GUI version
- ...
+ // start non-GUI version...
}
- return app.exec();
+
+ return app->exec();
}
//! [0]
diff --git a/src/widgets/doc/src/model-view-programming.qdoc b/src/widgets/doc/src/model-view-programming.qdoc
index 804c91cea4..c665a8dba6 100644
--- a/src/widgets/doc/src/model-view-programming.qdoc
+++ b/src/widgets/doc/src/model-view-programming.qdoc
@@ -1943,9 +1943,6 @@
other components and applications can understand.
\endlist
- For more information, see the \l
- {"Item View Classes" Chapter of C++ GUI Programming with Qt 4}.
-
\section2 Item data handling
Models can provide varying levels of access to the data they provide: They can be
diff --git a/src/widgets/doc/src/qtwidgets-examples.qdoc b/src/widgets/doc/src/qtwidgets-examples.qdoc
index b321942a70..6d00a0b067 100644
--- a/src/widgets/doc/src/qtwidgets-examples.qdoc
+++ b/src/widgets/doc/src/qtwidgets-examples.qdoc
@@ -95,3 +95,73 @@
*/
+/*!
+ \group examples-dialogs
+ \ingroup all-examples
+ \title Dialog Examples
+ \brief Using Qt's standard dialogs and building and using custom dialogs.
+
+ \image dialog-examples.png
+
+ Qt includes standard dialogs for many common operations, such as file
+ selection, printing, and color selection.
+
+ Custom dialogs can also be created for specialized modal or modeless
+ interactions with users.
+*/
+
+/*!
+ \ingroup all-examples
+ \title Itemview Examples
+ \brief Using the model/view framework.
+ \group examples-itemviews
+
+ \image itemviews-examples.png
+
+ Qt provides a lot of capabalities to display pre- and user-defined item models
+ in different ways.
+ The separation of functionality introduced by the model/view architecture gives
+ developers greater flexibility to customize the presentation of items.
+
+*/
+
+/*!
+ \ingroup all-examples
+ \title Graphicsview Examples
+ \brief Using the Graphics View framework.
+ \page examples-graphicsview.html
+
+ \image graphicsview-examples.png
+
+ Qt provides powerful graphics engine that supports easy visualization of items, with
+ support for rotation and zooming.
+ Additionally it provides an event propagation architecture for interaction.
+
+ These examples demonstrate the fundamental aspects of canvas programming with Qt.
+
+ \annotatedlist{examples-graphicsview}
+
+ These examples show the use of graphics widgets and layouts.
+
+ \annotatedlist{examples-graphicsview-layout}
+
+ Some examples demonstrate the use of graphics effects with canvas items.
+
+ \annotatedlist{examples-graphicsview-graphicseffects}
+*/
+
+/*!
+ \group examples-mainwindow
+ \ingroup all-examples
+ \title Main Window Examples
+ \brief Building applications around a main window.
+
+ \image mainwindow-examples.png
+
+ All the standard features of application main windows are provided by Qt.
+
+ Main windows can have pull down menus, tool bars, and dock windows. These
+ separate forms of user input are unified in an integrated action system that
+ also supports keyboard shortcuts and accelerator keys in menu items.
+
+*/
diff --git a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
index 0154b2c9f6..51812ec9fe 100644
--- a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
@@ -1632,7 +1632,7 @@
toolbars with equal orientation (vertical or horizontal) placed
next to each other.
- \l{QToolbar}{QToolbar}s in Qt consist of three elements:
+ \l{QToolBar}{Toolbars} in Qt consist of three elements:
\c CE_ToolBar, \c PE_IndicatorToolBarHandle, and
\c PE_IndicatorToolBarSeparator. It is QMainWindowLayout that
calculates the bounding rectangles (i.e., position and size of the
@@ -1647,7 +1647,7 @@
The dotted lines indicate that the QToolBar keeps an instance of
QToolBarLayout and that QToolBarSeparators are kept by
QToolBarLayout. When the toolbar is floating (i.e., has its own
- window) the \c PE_FrameMenu element is drawn, else QToolbar draws
+ window) the \c PE_FrameMenu element is drawn, else QToolBar draws
\c CE_ToolBar.
Here is an image of a toolbar in the Java style:
diff --git a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
index b160a22e48..2d9d5bba33 100644
--- a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
@@ -138,8 +138,8 @@
/*!
\page stylesheet-syntax.html
- \contentspage {Qt Style Sheet}{Contents}
- \previouspage Qt Style Sheet
+ \contentspage {Qt Style Sheets}{Contents}
+ \previouspage Qt Style Sheets
\nextpage Qt Designer Integration
\title The Style Sheet Syntax
@@ -543,7 +543,7 @@
/*!
\page stylesheet-designer.html
- \contentspage {Qt Style Sheet}{Contents}
+ \contentspage {Qt Style Sheets}{Contents}
\previouspage The Style Sheet Syntax
\nextpage Customizing Qt Widgets Using Style Sheets
\title Qt Designer Integration
@@ -569,7 +569,7 @@
/*!
\page stylesheet-customizing.html
- \contentspage {Qt Style Sheet}{Contents}
+ \contentspage {Qt Style Sheets}{Contents}
\previouspage Qt Designer Integration
\nextpage Qt Style Sheets Reference
\title Customizing Qt Widgets Using Style Sheets
@@ -673,7 +673,7 @@
/*!
\page stylesheet-reference.html
- \contentspage {Qt Style Sheet}{Contents}
+ \contentspage {Qt Style Sheets}{Contents}
\previouspage Customizing Qt Widgets Using Style Sheets
\nextpage Qt Style Sheets Examples
\title Qt Style Sheets Reference
@@ -1754,7 +1754,7 @@
\li \b{\c bottom} \target bottom-prop
\li \l{#Length}{Length}
\li If \l{#position-prop}{position} is \c relative (the
- default), moves a \l{subcontrol} by a certain offset up;
+ default), moves a subcontrol by a certain offset up;
specifying \tt{bottom: \e{y}} is then equivalent to
specifying \tt{\l{Qt Style Sheets Reference#top-prop}{top}: -\e{y}}.
@@ -1906,7 +1906,7 @@
\row
\li \b{\c height} \target height-prop
\li \l{#Length}{Length}
- \li The height of a \l{subcontrol} (or in some case, a widget).
+ \li The height of a subcontrol (or in some case, a widget).
If this property is not specified, it defaults to a value
that depends on the subcontrol/widget and on the current style.
@@ -1944,7 +1944,7 @@
\li \b{\c image}* \target image-prop
\li \l{#Url}{Url}+
\li The image that is drawn in the contents rectangle of a
- \l{subcontrol}.
+ subcontrol.
The image property accepts a list of \l{#Url}{Url}s or
an \c{svg}. The actual image that is drawn is determined
@@ -1959,7 +1959,7 @@
image within the rectangle can be specified using
\l{image-position-prop}{image-position}.
- This property is for \l{subcontrol}s only--we don't support it for
+ This property is for subcontrols only--we don't support it for
other elements.
\warning The QIcon SVG plugin is needed to render SVG images.
@@ -1978,7 +1978,7 @@
\li \b{\c left} \target left-prop
\li \l{#Length}{Length}
\li If \l{#position-prop}{position} is \c relative (the
- default), moves a \l{subcontrol} by a certain offset to
+ default), moves a subcontrol by a certain offset to
the right.
If \l{#position-prop}{position} is \c absolute, the \c
@@ -2232,7 +2232,7 @@
\li \b{\c right} \target right-prop
\li \l{#Length}{Length}
\li If \l{#position-prop}{position} is \c relative (the
- default), moves a \l{subcontrol} by a certain offset to
+ default), moves a subcontrol by a certain offset to
the left; specifying \tt{right: \e{x}} is then equivalent
to specifying \tt{\l{Qt Style Sheets Reference#left-prop}{left}: -\e{x}}.
@@ -2323,7 +2323,7 @@
\row
\li \b{\c subcontrol-origin*} \target subcontrol-origin-prop
\li \l{#Origin}{Origin}
- \li The origin rectangle of the \l subcontrol within the
+ \li The origin rectangle of the subcontrol within the
parent element.
If this property is not specified, the default is \c
@@ -2339,7 +2339,7 @@
\row
\li \b{\c subcontrol-position*} \target subcontrol-position-prop
\li \l{#Alignment}{Alignment}
- \li The alignment of the \l subcontrol within the origin
+ \li The alignment of the subcontrol within the origin
rectangle specified by \l{Qt Style Sheets Reference#subcontrol-origin-prop}
{subcontrol-origin}.
@@ -2380,7 +2380,7 @@
\li \b{\c top} \target top-prop
\li \l{#Length}{Length}
\li If \l{#position-prop}{position} is \c relative (the
- default), moves a \l{subcontrol} by a certain offset
+ default), moves a subcontrol by a certain offset
down.
If \l{#position-prop}{position} is \c absolute, the \c top
@@ -2400,7 +2400,7 @@
\row
\li \b{\c width} \target width-prop
\li \l{#Length}{Length}
- \li The width of a \l{subcontrol} (or a widget in some cases).
+ \li The width of a subcontrol (or a widget in some cases).
If this property is not specified, it defaults to a value
that depends on the subcontrol/widget and on the current style.
@@ -3358,7 +3358,7 @@
/*!
\page stylesheet-examples.html
- \contentspage {Qt Style Sheet}{Contents}
+ \contentspage {Qt Style Sheets}{Contents}
\previouspage Qt Style Sheets Reference
\title Qt Style Sheets Examples
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index 48430e60db..f76e89f1a0 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -1436,6 +1436,7 @@ QGraphicsItem::~QGraphicsItem()
#endif
clearFocus();
+ setFocusProxy(0);
// Update focus scope item ptr.
QGraphicsItem *p = d_ptr->parent;
@@ -1771,24 +1772,6 @@ void QGraphicsItem::setFlag(GraphicsItemFlag flag, bool enabled)
}
/*!
- \internal
-
- Sets the flag \a flag on \a item and all its children, to \a enabled.
-*/
-static void _q_qgraphicsItemSetFlag(QGraphicsItem *item, QGraphicsItem::GraphicsItemFlag flag,
- bool enabled)
-{
- if (item->flags() & flag) {
- // If this item already has the correct flag set, we don't have to
- // propagate it.
- return;
- }
- item->setFlag(flag, enabled);
- foreach (QGraphicsItem *child, item->childItems())
- _q_qgraphicsItemSetFlag(child, flag, enabled);
-}
-
-/*!
Sets the item flags to \a flags. All flags in \a flags are enabled; all
flags not in \a flags are disabled.
@@ -3348,6 +3331,12 @@ void QGraphicsItem::clearFocus()
*/
void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent, bool hiddenByParentPanel)
{
+ QGraphicsItem *subFocusItem = q_ptr;
+ if (flags & QGraphicsItem::ItemIsFocusScope) {
+ while (subFocusItem->d_ptr->focusScopeItem)
+ subFocusItem = subFocusItem->d_ptr->focusScopeItem;
+ }
+
if (giveFocusToParent) {
// Pass focus to the closest parent focus scope
if (!inDestructor) {
@@ -3356,10 +3345,10 @@ void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent, bool hiddenB
if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
if (p->d_ptr->focusScopeItem == q_ptr) {
p->d_ptr->focusScopeItem = 0;
- if (!q_ptr->hasFocus()) //if it has focus, focusScopeItemChange is called elsewhere
+ if (!subFocusItem->hasFocus()) //if it has focus, focusScopeItemChange is called elsewhere
focusScopeItemChange(false);
}
- if (q_ptr->hasFocus())
+ if (subFocusItem->hasFocus())
p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ false,
/* focusFromHide = */ false);
return;
@@ -3369,7 +3358,7 @@ void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent, bool hiddenB
}
}
- if (q_ptr->hasFocus()) {
+ if (subFocusItem->hasFocus()) {
// Invisible items with focus must explicitly clear subfocus.
if (!hiddenByParentPanel)
clearSubFocus(q_ptr);
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index 2012f980db..a1ee562807 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -616,6 +616,10 @@ void QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent *event)
{
Q_Q(QGraphicsView);
+#ifndef QT_NO_RUBBERBAND
+ updateRubberBand(event);
+#endif
+
storeMouseEvent(event);
lastMouseEvent.setAccepted(false);
@@ -701,6 +705,58 @@ QRegion QGraphicsViewPrivate::rubberBandRegion(const QWidget *widget, const QRec
tmp &= mask.region;
return tmp;
}
+
+void QGraphicsViewPrivate::updateRubberBand(QMouseEvent *event)
+{
+ Q_Q(QGraphicsView);
+ if (dragMode == QGraphicsView::RubberBandDrag && sceneInteractionAllowed) {
+ storeMouseEvent(event);
+ if (rubberBanding) {
+ // Check for enough drag distance
+ if ((mousePressViewPoint - event->pos()).manhattanLength()
+ < QApplication::startDragDistance()) {
+ return;
+ }
+
+ // Update old rubberband
+ if (viewportUpdateMode != QGraphicsView::NoViewportUpdate && !rubberBandRect.isEmpty()) {
+ if (viewportUpdateMode != QGraphicsView::FullViewportUpdate)
+ q->viewport()->update(rubberBandRegion(q->viewport(), rubberBandRect));
+ else
+ updateAll();
+ }
+
+ // Stop rubber banding if the user has let go of all buttons (even
+ // if we didn't get the release events).
+ if (!event->buttons()) {
+ rubberBanding = false;
+ rubberBandRect = QRect();
+ return;
+ }
+
+ // Update rubberband position
+ const QPoint mp = q->mapFromScene(mousePressScenePoint);
+ const QPoint ep = event->pos();
+ rubberBandRect = QRect(qMin(mp.x(), ep.x()), qMin(mp.y(), ep.y()),
+ qAbs(mp.x() - ep.x()) + 1, qAbs(mp.y() - ep.y()) + 1);
+
+ // Update new rubberband
+ if (viewportUpdateMode != QGraphicsView::NoViewportUpdate){
+ if (viewportUpdateMode != QGraphicsView::FullViewportUpdate)
+ q->viewport()->update(rubberBandRegion(q->viewport(), rubberBandRect));
+ else
+ updateAll();
+ }
+ // Set the new selection area
+ QPainterPath selectionArea;
+ selectionArea.addPolygon(mapToScene(rubberBandRect));
+ selectionArea.closeSubpath();
+ if (scene)
+ scene->setSelectionArea(selectionArea, rubberBandSelectionMode,
+ q->viewportTransform());
+ }
+ }
+}
#endif
/*!
@@ -3211,56 +3267,6 @@ void QGraphicsView::mouseMoveEvent(QMouseEvent *event)
{
Q_D(QGraphicsView);
-#ifndef QT_NO_RUBBERBAND
- if (d->dragMode == QGraphicsView::RubberBandDrag && d->sceneInteractionAllowed) {
- d->storeMouseEvent(event);
- if (d->rubberBanding) {
- // Check for enough drag distance
- if ((d->mousePressViewPoint - event->pos()).manhattanLength()
- < QApplication::startDragDistance()) {
- return;
- }
-
- // Update old rubberband
- if (d->viewportUpdateMode != QGraphicsView::NoViewportUpdate && !d->rubberBandRect.isEmpty()) {
- if (d->viewportUpdateMode != FullViewportUpdate)
- viewport()->update(d->rubberBandRegion(viewport(), d->rubberBandRect));
- else
- d->updateAll();
- }
-
- // Stop rubber banding if the user has let go of all buttons (even
- // if we didn't get the release events).
- if (!event->buttons()) {
- d->rubberBanding = false;
- d->rubberBandRect = QRect();
- return;
- }
-
- // Update rubberband position
- const QPoint &mp = mapFromScene(d->mousePressScenePoint);
- QPoint ep = event->pos();
- d->rubberBandRect = QRect(qMin(mp.x(), ep.x()), qMin(mp.y(), ep.y()),
- qAbs(mp.x() - ep.x()) + 1, qAbs(mp.y() - ep.y()) + 1);
-
- // Update new rubberband
- if (d->viewportUpdateMode != QGraphicsView::NoViewportUpdate){
- if (d->viewportUpdateMode != FullViewportUpdate)
- viewport()->update(d->rubberBandRegion(viewport(), d->rubberBandRect));
- else
- d->updateAll();
- }
- // Set the new selection area
- QPainterPath selectionArea;
- selectionArea.addPolygon(mapToScene(d->rubberBandRect));
- selectionArea.closeSubpath();
- if (d->scene)
- d->scene->setSelectionArea(selectionArea, d->rubberBandSelectionMode,
- viewportTransform());
- return;
- }
- } else
-#endif // QT_NO_RUBBERBAND
if (d->dragMode == QGraphicsView::ScrollHandDrag) {
if (d->handScrolling) {
QScrollBar *hBar = horizontalScrollBar();
diff --git a/src/widgets/graphicsview/qgraphicsview_p.h b/src/widgets/graphicsview/qgraphicsview_p.h
index 6b15fb61f2..bb6b44af19 100644
--- a/src/widgets/graphicsview/qgraphicsview_p.h
+++ b/src/widgets/graphicsview/qgraphicsview_p.h
@@ -138,6 +138,7 @@ public:
#ifndef QT_NO_RUBBERBAND
QRect rubberBandRect;
QRegion rubberBandRegion(const QWidget *widget, const QRect &rect) const;
+ void updateRubberBand(QMouseEvent *event);
bool rubberBanding;
Qt::ItemSelectionMode rubberBandSelectionMode;
#endif
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index ab98bf6438..cb466dfb4b 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -65,7 +65,7 @@
#include <qaccessible.h>
#include <qaccessible2.h>
#endif
-#ifndef QT_NO_GESTURE
+#ifndef QT_NO_GESTURES
# include <qscroller.h>
#endif
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index e43eda8621..13627b42ac 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -108,10 +108,10 @@ QT_BEGIN_NAMESPACE
be rendered as large or small icons depending on their iconSize().
\table 100%
- \row \li \inlineimage windowsxp-listview.png Screenshot of a Windows XP style list view
+ \row \li \inlineimage windowsvista-listview.png Screenshot of a Windows Vista style list view
\li \inlineimage macintosh-listview.png Screenshot of a Macintosh style table view
\li \inlineimage fusion-listview.png Screenshot of a Fusion style table view
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} list view.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} list view.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} list view.
\li A \l{Fusion Style Widget Gallery}{Fusion style} list view.
\endtable
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index 766c8e5cc7..183c3538c9 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -1189,10 +1189,10 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
new current item and the item that was previously current.
\table 100%
- \row \li \inlineimage windowsxp-listview.png Screenshot of a Windows XP style list widget
+ \row \li \inlineimage windowsvista-listview.png Screenshot of a Windows Vista style list widget
\li \inlineimage macintosh-listview.png Screenshot of a Macintosh style table widget
\li \inlineimage fusion-listview.png Screenshot of a Fusion style table widget
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} list widget.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} list widget.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} list widget.
\li A \l{Fusion Style Widget Gallery}{Fusion style} list widget.
\endtable
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index e010c6977e..e84325c730 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -1011,10 +1011,10 @@ void QTableViewPrivate::drawCell(QPainter *painter, const QStyleOptionViewItem &
its appearance in other styles.
\table 100%
- \row \li \inlineimage windowsxp-tableview.png Screenshot of a Windows XP style table view
+ \row \li \inlineimage windowsvista-tableview.png Screenshot of a Windows Vista style table view
\li \inlineimage macintosh-tableview.png Screenshot of a Macintosh style table view
\li \inlineimage fusion-tableview.png Screenshot of a Fusion style table view
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} table view.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} table view.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} table view.
\li A \l{Fusion Style Widget Gallery}{Fusion style} table view.
\endtable
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index 900af0872a..9793639d74 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -1539,10 +1539,10 @@ QTableWidgetItem &QTableWidgetItem::operator=(const QTableWidgetItem &other)
clear() function.
\table 100%
- \row \li \inlineimage windowsxp-tableview.png Screenshot of a Windows XP style table widget
+ \row \li \inlineimage windowsvista-tableview.png Screenshot of a Windows Vista style table widget
\li \inlineimage macintosh-tableview.png Screenshot of a Macintosh style table widget
\li \inlineimage fusion-tableview.png Screenshot of a Fusion style table widget
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} table widget.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} table widget.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} table widget.
\li A \l{Fusion Style Widget Gallery}{Fusion style} table widget.
\endtable
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index fe34d3de6a..194fb71880 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -146,10 +146,10 @@ QT_BEGIN_NAMESPACE
\endomit
\table 100%
- \row \li \inlineimage windowsxp-treeview.png Screenshot of a Windows XP style tree view
+ \row \li \inlineimage windowsvista-treeview.png Screenshot of a Windows Vista style tree view
\li \inlineimage macintosh-treeview.png Screenshot of a Macintosh style tree view
\li \inlineimage fusion-treeview.png Screenshot of a Fusion style tree view
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} tree view.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} tree view.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} tree view.
\li A \l{Fusion Style Widget Gallery}{Fusion style} tree view.
\endtable
@@ -876,7 +876,7 @@ bool QTreeView::isSortingEnabled() const
\brief whether animations are enabled
If this property is true the treeview will animate expandsion
- and collasping of branches. If this property is false, the treeview
+ and collapsing of branches. If this property is false, the treeview
will expand or collapse branches immediately without showing
the animation.
@@ -3743,7 +3743,7 @@ void QTreeView::currentChanged(const QModelIndex &current, const QModelIndex &pr
}
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive() && current.isValid()) {
- int entry = (visualIndex(current) + (header()?1:0))*current.model()->columnCount()+current.column() + 1;
+ int entry = (visualIndex(current) + (header()?1:0))*current.model()->columnCount()+current.column();
QAccessibleEvent event(this, QAccessible::Focus);
event.setChild(entry);
QAccessible::updateAccessibility(&event);
@@ -3763,16 +3763,16 @@ void QTreeView::selectionChanged(const QItemSelection &selected,
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
- int entry = (visualIndex(sel) + (header()?1:0))*sel.model()->columnCount()+sel.column() + 1;
- Q_ASSERT(entry > 0);
+ int entry = (visualIndex(sel) + (header()?1:0))*sel.model()->columnCount()+sel.column();
+ Q_ASSERT(entry >= 0);
QAccessibleEvent event(this, QAccessible::Selection);
event.setChild(entry);
QAccessible::updateAccessibility(&event);
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
- int entry = (visualIndex(desel) + (header()?1:0))*desel.model()->columnCount()+desel.column() + 1;
- Q_ASSERT(entry > 0);
+ int entry = (visualIndex(desel) + (header()?1:0))*desel.model()->columnCount()+desel.column();
+ Q_ASSERT(entry >= 0);
QAccessibleEvent event(this, QAccessible::SelectionRemove);
event.setChild(entry);
QAccessible::updateAccessibility(&event);
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index a2eb28e213..c4b71fd05f 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -2379,10 +2379,10 @@ void QTreeWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
whether sorting is enabled.
\table 100%
- \row \li \inlineimage windowsxp-treeview.png Screenshot of a Windows XP style tree widget
+ \row \li \inlineimage windowsvista-treeview.png Screenshot of a Windows Vista style tree widget
\li \inlineimage macintosh-treeview.png Screenshot of a Macintosh style tree widget
\li \inlineimage fusion-treeview.png Screenshot of a Fusion style tree widget
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} tree widget.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} tree widget.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} tree widget.
\li A \l{Fusion Style Widget Gallery}{Fusion style} tree widget.
\endtable
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
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index f25f035382..7519d7f910 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -108,7 +108,7 @@ QT_BEGIN_NAMESPACE
subElementRect() are documented here.
\endomit
- \sa QStyle, QWindowsStyle
+ \sa QStyle, QProxyStyle
*/
/*!
@@ -1156,8 +1156,10 @@ void QCommonStylePrivate::startAnimation(QStyleAnimation *animation) const
void QCommonStylePrivate::stopAnimation(const QObject *target) const
{
QStyleAnimation *animation = animations.take(target);
- if (animation && animation->state() != QAbstractAnimation::Stopped)
+ if (animation) {
animation->stop();
+ delete animation;
+ }
}
/*! \internal */
@@ -4634,7 +4636,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
ret = int(QStyleHelper::dpiScaled(13.));
break;
case PM_MessageBoxIconSize:
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
if (QApplication::desktopSettingsAware()) {
ret = 64; // No DPI scaling, it's handled elsewhere.
} else
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 623cdb55b9..6450ab049b 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -2631,7 +2631,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
buttonOption.QStyleOption::operator=(*comboBox);
buttonOption.rect = rect;
buttonOption.state = (comboBox->state & (State_Enabled | State_MouseOver | State_HasFocus))
- | State_KeyboardFocusChange; // Allways show hig
+ | State_KeyboardFocusChange; // Always show hig
if (sunken) {
buttonOption.state |= State_Sunken;
diff --git a/src/widgets/styles/qgtkpainter.cpp b/src/widgets/styles/qgtkpainter.cpp
index a5c408f20d..206dbf7e0f 100644
--- a/src/widgets/styles/qgtkpainter.cpp
+++ b/src/widgets/styles/qgtkpainter.cpp
@@ -63,6 +63,7 @@ void QGtkPainter::reset(QPainter *painter)
m_hflipped = false;
m_vflipped = false;
m_usePixmapCache = true;
+ m_cliprect = QRect();
}
QString QGtkPainter::uniqueName(const QString &key, GtkStateType state, GtkShadowType shadow,
diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp
index 75d2306da7..3ee242334d 100644
--- a/src/widgets/styles/qgtkstyle.cpp
+++ b/src/widgets/styles/qgtkstyle.cpp
@@ -2204,8 +2204,10 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
GtkRange *range = (GtkRange*)(horizontal ? gtkHScrollBar : gtkVScrollBar);
- GtkAdjustment *adjustment = d->gtk_range_get_adjustment(range);
+ GtkAdjustment *adjustment = 0;
+ if (d->gtk_adjustment_configure)
+ adjustment = d->gtk_range_get_adjustment(range);
if (adjustment) {
d->gtk_adjustment_configure(adjustment, fakePos, 0, maximum, 0, 0, 0);
} else {
diff --git a/src/widgets/styles/qmacstyle.qdoc b/src/widgets/styles/qmacstyle.qdoc
index caa6bfa79e..29f41752ae 100644
--- a/src/widgets/styles/qmacstyle.qdoc
+++ b/src/widgets/styles/qmacstyle.qdoc
@@ -190,7 +190,7 @@
or Qt::WA_MacNormalSize instead.
*/
-/*! \fn QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget)
+/*! \fn QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget, const QStyleOption *opt = 0)
\obsolete
Call QWidget::testAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize,
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 89ea4d553a..bde33cdb97 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1764,8 +1764,8 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
QMacStyle::QMacStyle()
: QCommonStyle(*new QMacStylePrivate)
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
Q_D(QMacStyle);
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
d->receiver = [[NotificationReceiver alloc] initWithPrivate:d];
NotificationReceiver *receiver = static_cast<NotificationReceiver *>(d->receiver);
@@ -1778,6 +1778,7 @@ QMacStyle::QMacStyle()
d->nsscroller = [[NSScroller alloc] init];
}
#endif
+ d->indicatorBranchButtonCell = nil;
}
QMacStyle::~QMacStyle()
@@ -2181,11 +2182,11 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
switch (d->aquaSizeConstrain(opt, widget)) {
case QAquaSizeUnknown:
case QAquaSizeLarge:
- ret = 9;
+ ret = QSysInfo::macVersion() >= QSysInfo::MV_10_8 ? 16 : 9;
break;
case QAquaSizeMini:
case QAquaSizeSmall:
- ret = 7;
+ ret = QSysInfo::macVersion() >= QSysInfo::MV_10_8 ? 14 : 7;
break;
}
break;
@@ -2706,6 +2707,10 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
ret = false;
break;
case SH_ScrollBar_Transient:
+ if (!qobject_cast<const QScrollBar*>(w)) {
+ ret = false;
+ break;
+ }
ret = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7)
@@ -3076,21 +3081,30 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
case PE_IndicatorBranch: {
if (!(opt->state & State_Children))
break;
- HIThemeButtonDrawInfo bi;
- bi.version = qt_mac_hitheme_version;
- bi.state = tds;
- if (tds == kThemeStateInactive && opt->palette.currentColorGroup() == QPalette::Active)
- bi.state = kThemeStateActive;
- if (opt->state & State_Sunken)
- bi.state |= kThemeStatePressed;
- bi.kind = kThemeDisclosureButton;
- if (opt->state & State_Open)
- bi.value = kThemeDisclosureDown;
- else
- bi.value = opt->direction == Qt::LeftToRight ? kThemeDisclosureRight : kThemeDisclosureLeft;
- bi.adornment = kThemeAdornmentNone;
- HIRect hirect = qt_hirectForQRect(opt->rect.adjusted(DisclosureOffset,0,-DisclosureOffset,0));
- HIThemeDrawButton(&hirect, &bi, cg, kHIThemeOrientationNormal, 0);
+ if (!d->indicatorBranchButtonCell)
+ const_cast<QMacStylePrivate *>(d)->indicatorBranchButtonCell = (void *)[[NSButtonCell alloc] init];
+ NSButtonCell *triangleCell = (NSButtonCell *)d->indicatorBranchButtonCell;
+ [triangleCell setButtonType:NSOnOffButton];
+ [triangleCell setState:(opt->state & State_Open) ? NSOnState : NSOffState];
+ [triangleCell setBezelStyle:NSDisclosureBezelStyle];
+ [triangleCell setBackgroundStyle:((opt->state & State_Selected) && w->hasFocus()) ? NSBackgroundStyleDark : NSBackgroundStyleLight];
+
+ CGContextSaveGState(cg);
+ [NSGraphicsContext saveGraphicsState];
+
+ [NSGraphicsContext setCurrentContext:[NSGraphicsContext
+ graphicsContextWithGraphicsPort:(CGContextRef)cg flipped:NO]];
+
+ QRect qtRect = opt->rect.adjusted(DisclosureOffset, 0, -DisclosureOffset, 0);
+ CGRect rect = CGRectMake(qtRect.x() + 1, qtRect.y(), qtRect.width(), qtRect.height());
+ CGContextTranslateCTM(cg, rect.origin.x, rect.origin.y + rect.size.height);
+ CGContextScaleCTM(cg, 1, -1);
+ CGContextTranslateCTM(cg, -rect.origin.x, -rect.origin.y);
+
+ [triangleCell drawBezelWithFrame:rect inView:[triangleCell controlView]];
+
+ [NSGraphicsContext restoreGraphicsState];
+ CGContextRestoreGState(cg);
break; }
case PE_Frame: {
@@ -4906,9 +4920,14 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
- if (cc == CC_ScrollBar && proxy()->styleHint(SH_ScrollBar_Transient)) {
+ if (cc == CC_ScrollBar && proxy()->styleHint(SH_ScrollBar_Transient, 0, widget)) {
bool wasActive = false;
CGFloat opacity = 1.0;
+ CGFloat expandScale = 1.0;
+ CGFloat expandOffset = -1.0;
+ bool shouldExpand = false;
+ const CGFloat maxExpandScale = tdi.kind == kThemeSmallScrollBar ? 11.0 / 7.0 : 13.0 / 9.0;
+
if (QObject *styleObject = opt->styleObject) {
int oldPos = styleObject->property("_q_stylepos").toInt();
int oldMin = styleObject->property("_q_stylemin").toInt();
@@ -4936,23 +4955,24 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
styleObject->setProperty("_q_stylestate", static_cast<int>(slider->state));
styleObject->setProperty("_q_stylecontrols", static_cast<uint>(slider->activeSubControls));
+ QScrollbarAnimation *anim = qobject_cast<QScrollbarAnimation *>(d->animation(styleObject));
if (transient) {
- QFadeOutAnimation *anim = qobject_cast<QFadeOutAnimation *>(d->animation(styleObject));
if (!anim) {
- anim = new QFadeOutAnimation(styleObject);
+ anim = new QScrollbarAnimation(styleObject);
+ anim->setFadingOut();
d->startAnimation(anim);
- } else {
+ } else if (anim->isFadingOut()) {
// the scrollbar was already fading out while the
// state changed -> restart the fade out animation
anim->setCurrentTime(0);
}
- } else {
+ } else if (anim && anim->isFadingOut()) {
d->stopAnimation(styleObject);
}
}
- QFadeOutAnimation *anim = qobject_cast<QFadeOutAnimation *>(d->animation(styleObject));
- if (anim) {
+ QScrollbarAnimation *anim = qobject_cast<QScrollbarAnimation *>(d->animation(styleObject));
+ if (anim && anim->isFadingOut()) {
// once a scrollbar was active (hovered/pressed), it retains
// the active look even if it's no longer active while fading out
if (oldActiveControls)
@@ -4961,6 +4981,24 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
wasActive = anim->wasActive();
opacity = anim->currentValue();
}
+
+ shouldExpand = (opt->activeSubControls || wasActive) && QSysInfo::macVersion() >= QSysInfo::MV_10_8;
+ if (shouldExpand) {
+ if (!anim && !oldActiveControls) {
+ // Start expand animation only once and when entering
+ anim = new QScrollbarAnimation(styleObject);
+ anim->setExpanding();
+ d->startAnimation(anim);
+ }
+ if (anim && !anim->isFadingOut()) {
+ expandScale = 1.0 + (maxExpandScale - 1.0) * anim->currentValue();
+ expandOffset = 5.5 * anim->currentValue() - 1;
+ } else {
+ // Keep expanded state after the animation ends, and when fading out
+ expandScale = maxExpandScale;
+ expandOffset = 4.5;
+ }
+ }
}
const bool isHorizontal = slider->orientation == Qt::Horizontal;
@@ -4982,38 +5020,30 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
[scroller setControlSize:(tdi.kind == kThemeSmallScrollBar ? NSMiniControlSize
: NSRegularControlSize)];
- if (isHorizontal)
- [scroller setBounds:NSMakeRect(0, -1,
- slider->rect.width(), slider->rect.height())];
- else
- [scroller setBounds:NSMakeRect(-1, 0,
- slider->rect.width(), slider->rect.height())];
+ [scroller setBounds:NSMakeRect(0, 0, slider->rect.width(), slider->rect.height())];
[scroller setScrollerStyle:NSScrollerStyleOverlay];
- // first we draw only the track, by using a disabled scroller
- if (opt->activeSubControls || wasActive) {
- CGContextBeginTransparencyLayerWithRect(cg, qt_hirectForQRect(slider->rect),
- NULL);
- CGContextSetAlpha(cg, opacity);
-
- [scroller setFrame:NSMakeRect(0, 0, slider->rect.width(), slider->rect.height())];
- [scroller setEnabled:NO];
- [scroller displayRectIgnoringOpacity:[scroller bounds]
- inContext:[NSGraphicsContext currentContext]];
+ CGContextBeginTransparencyLayer(cg, NULL);
+ CGContextSetAlpha(cg, opacity);
- CGContextEndTransparencyLayer(cg);
+ // Draw the track when hovering
+ if (opt->activeSubControls || wasActive) {
+ CGRect rect = [scroller bounds];
+ if (shouldExpand) {
+ if (isHorizontal)
+ rect.origin.y += 4.5 - expandOffset;
+ else
+ rect.origin.x += 4.5 - expandOffset;
+ }
+ [scroller drawKnobSlotInRect:rect highlight:YES];
}
- CGContextBeginTransparencyLayerWithRect(cg, qt_hirectForQRect(slider->rect), NULL);
- CGContextSetAlpha(cg, opacity);
-
const qreal length = slider->maximum - slider->minimum + slider->pageStep;
const qreal proportion = slider->pageStep / length;
qreal value = (slider->sliderValue - slider->minimum) / length;
if (isHorizontal && slider->direction == Qt::RightToLeft)
value = 1.0 - value - proportion;
- [scroller setEnabled:(slider->state & State_Enabled) ? YES : NO];
[scroller setKnobProportion:1.0];
const int minKnobWidth = 26;
@@ -5023,18 +5053,27 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
const qreal width = qMax<qreal>(minKnobWidth, plannedWidth);
const qreal totalWidth = slider->rect.width() + plannedWidth - width;
[scroller setFrame:NSMakeRect(0, 0, width, slider->rect.height())];
- CGContextTranslateCTM(cg, value * totalWidth, 0);
+ if (shouldExpand) {
+ CGContextScaleCTM(cg, 1, expandScale);
+ CGContextTranslateCTM(cg, value * totalWidth, -expandOffset);
+ } else {
+ CGContextTranslateCTM(cg, value * totalWidth, 1);
+ }
} else {
const qreal plannedHeight = proportion * slider->rect.height();
const qreal height = qMax<qreal>(minKnobWidth, plannedHeight);
const qreal totalHeight = slider->rect.height() + plannedHeight - height;
[scroller setFrame:NSMakeRect(0, 0, slider->rect.width(), height)];
- CGContextTranslateCTM(cg, 0, value * totalHeight);
+ if (shouldExpand) {
+ CGContextScaleCTM(cg, expandScale, 1);
+ CGContextTranslateCTM(cg, -expandOffset, value * totalHeight);
+ } else {
+ CGContextTranslateCTM(cg, 1, value * totalHeight);
+ }
}
if (length > 0.0) {
[scroller layout];
- [scroller displayRectIgnoringOpacity:[scroller bounds]
- inContext:[NSGraphicsContext currentContext]];
+ [scroller drawKnob];
}
CGContextEndTransparencyLayer(cg);
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h
index c2e5a024a4..dae87bfec6 100644
--- a/src/widgets/styles/qmacstyle_mac_p_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p_p.h
@@ -209,34 +209,50 @@ public:
void* receiver;
void *nsscroller;
#endif
+ void *indicatorBranchButtonCell;
};
-class QFadeOutAnimation : public QNumberStyleAnimation
+class QScrollbarAnimation : public QNumberStyleAnimation
{
Q_OBJECT
public:
- QFadeOutAnimation(QObject *target) : QNumberStyleAnimation(target), _active(false)
+ QScrollbarAnimation(QObject *target) : QNumberStyleAnimation(target), _active(false)
+ { }
+
+ bool wasActive() const { return _active; }
+ void setActive(bool active) { _active = active; }
+
+ bool isFadingOut() const { return _isFadingOut; }
+
+ void setFadingOut()
{
+ _isFadingOut = true;
setDuration(QMacStylePrivate::ScrollBarFadeOutDelay + QMacStylePrivate::ScrollBarFadeOutDuration);
setDelay(QMacStylePrivate::ScrollBarFadeOutDelay);
setStartValue(1.0);
setEndValue(0.0);
}
- bool wasActive() const { return _active; }
- void setActive(bool active) { _active = active; }
+ void setExpanding()
+ {
+ _isFadingOut = false;
+ setDuration(QMacStylePrivate::ScrollBarFadeOutDuration);
+ setStartValue(0.0);
+ setEndValue(1.0);
+ }
private slots:
void updateCurrentTime(int time)
{
QNumberStyleAnimation::updateCurrentTime(time);
- if (qFuzzyIsNull(currentValue()))
+ if (_isFadingOut && qFuzzyIsNull(currentValue()))
target()->setProperty("visible", false);
}
private:
bool _active;
+ bool _isFadingOut;
};
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index c6e9a8d013..1630130de2 100644
--- a/src/widgets/styles/qstylehelper.cpp
+++ b/src/widgets/styles/qstylehelper.cpp
@@ -78,7 +78,7 @@ QString uniqueName(const QString &key, const QStyleOption *option, const QSize &
qreal dpiScaled(qreal value)
{
#ifdef Q_OS_MAC
- // On mac the DPI is allways 72 so we should not scale it
+ // On mac the DPI is always 72 so we should not scale it
return value;
#else
static const qreal scale = qreal(qt_defaultDpiX()) / 96.0;
diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp
index 0ec42e446d..1c2df682cc 100644
--- a/src/widgets/styles/qstyleoption.cpp
+++ b/src/widgets/styles/qstyleoption.cpp
@@ -578,6 +578,7 @@ QStyleOptionFrame::QStyleOptionFrame(int version)
\value None Indicates a normal frame.
\value Flat Indicates a flat frame.
+ \value Rounded Indicates a rounded frame.
*/
/*!
diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro
index f8f00af69b..6b9aa92fd9 100644
--- a/src/widgets/widgets.pro
+++ b/src/widgets/widgets.pro
@@ -2,6 +2,7 @@ TARGET = QtWidgets
QT = core-private gui-private
MODULE_CONFIG = uic
+CONFIG += $$MODULE_CONFIG
DEFINES += QT_NO_USING_NAMESPACE
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000
irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
@@ -41,15 +42,6 @@ testcocoon {
load(testcocoon)
}
-INCLUDEPATH += ../3rdparty/harfbuzz/src
-
win32:!contains(QT_CONFIG, directwrite) {
DEFINES += QT_NO_DIRECTWRITE
}
-
-load(uic)
-
-uic_dir.name = uic_location
-uic_dir.variable = QMAKE_UIC
-
-QMAKE_PKGCONFIG_VARIABLES += uic_dir
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp
index 3c21d767be..c277f7bd45 100644
--- a/src/widgets/widgets/qabstractscrollarea.cpp
+++ b/src/widgets/widgets/qabstractscrollarea.cpp
@@ -328,11 +328,14 @@ void QAbstractScrollAreaPrivate::setSingleFingerPanEnabled(bool on)
void QAbstractScrollAreaPrivate::layoutChildren()
{
Q_Q(QAbstractScrollArea);
- bool needh = (hbarpolicy == Qt::ScrollBarAlwaysOn
- || (hbarpolicy == Qt::ScrollBarAsNeeded && hbar->minimum() < hbar->maximum() && !hbar->sizeHint().isEmpty()));
+ bool transient = q->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, vbar ? vbar : hbar);
+ bool needh = (hbarpolicy == Qt::ScrollBarAlwaysOn && !transient)
+ || ((hbarpolicy == Qt::ScrollBarAsNeeded || transient)
+ && hbar->minimum() < hbar->maximum() && !hbar->sizeHint().isEmpty());
- bool needv = (vbarpolicy == Qt::ScrollBarAlwaysOn
- || (vbarpolicy == Qt::ScrollBarAsNeeded && vbar->minimum() < vbar->maximum() && !vbar->sizeHint().isEmpty()));
+ bool needv = (vbarpolicy == Qt::ScrollBarAlwaysOn && !transient)
+ || ((vbarpolicy == Qt::ScrollBarAsNeeded || transient)
+ && vbar->minimum() < vbar->maximum() && !vbar->sizeHint().isEmpty());
QStyleOption opt(0);
opt.init(q);
@@ -489,12 +492,20 @@ void QAbstractScrollAreaPrivate::layoutChildren()
if (hasMacReverseSizeGrip)
horizontalScrollBarRect.adjust(vsbExt, 0, 0, 0);
#endif
+#ifdef Q_OS_MAC
+ if (!hasCornerWidget && QSysInfo::macVersion() >= QSysInfo::MV_10_8 && transient)
+ horizontalScrollBarRect.adjust(0, 0, cornerOffset.x(), 0);
+#endif
scrollBarContainers[Qt::Horizontal]->setGeometry(QStyle::visualRect(opt.direction, opt.rect, horizontalScrollBarRect));
scrollBarContainers[Qt::Horizontal]->raise();
}
if (needv) {
- const QRect verticalScrollBarRect (QPoint(cornerPoint.x(), controlsRect.top() + hHeaderBottom), QPoint(controlsRect.right(), cornerPoint.y() - 1));
+ QRect verticalScrollBarRect (QPoint(cornerPoint.x(), controlsRect.top() + hHeaderBottom), QPoint(controlsRect.right(), cornerPoint.y() - 1));
+#ifdef Q_OS_MAC
+ if (!hasCornerWidget && QSysInfo::macVersion() >= QSysInfo::MV_10_8 && transient)
+ verticalScrollBarRect.adjust(0, 0, 0, cornerOffset.y());
+#endif
scrollBarContainers[Qt::Vertical]->setGeometry(QStyle::visualRect(opt.direction, opt.rect, verticalScrollBarRect));
scrollBarContainers[Qt::Vertical]->raise();
}
@@ -654,7 +665,6 @@ void QAbstractScrollArea::setVerticalScrollBarPolicy(Qt::ScrollBarPolicy policy)
d->layoutChildren();
if (oldPolicy != d->vbarpolicy)
d->scrollBarPolicyChanged(Qt::Vertical, d->vbarpolicy);
- d->setScrollBarTransient(d->vbar, policy == Qt::ScrollBarAsNeeded);
}
@@ -716,7 +726,6 @@ void QAbstractScrollArea::setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy polic
d->layoutChildren();
if (oldPolicy != d->hbarpolicy)
d->scrollBarPolicyChanged(Qt::Horizontal, d->hbarpolicy);
- d->setScrollBarTransient(d->hbar, policy == Qt::ScrollBarAsNeeded);
}
/*!
@@ -935,7 +944,7 @@ bool QAbstractScrollArea::eventFilter(QObject *o, QEvent *e)
Q_D(QAbstractScrollArea);
if ((o == d->hbar || o == d->vbar) && (e->type() == QEvent::HoverEnter || e->type() == QEvent::HoverLeave)) {
Qt::ScrollBarPolicy policy = o == d->hbar ? d->vbarpolicy : d->hbarpolicy;
- if (policy == Qt::ScrollBarAsNeeded) {
+ if (policy == Qt::ScrollBarAsNeeded || style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, d->vbar ? d->vbar : d->hbar)) {
QScrollBar *sibling = o == d->hbar ? d->vbar : d->hbar;
d->setScrollBarTransient(sibling, e->type() == QEvent::HoverLeave);
}
@@ -1445,9 +1454,11 @@ bool QAbstractScrollAreaPrivate::canStartScrollingAt( const QPoint &startPos )
void QAbstractScrollAreaPrivate::flashScrollBars()
{
- if (hbarpolicy == Qt::ScrollBarAsNeeded)
+ Q_Q(QAbstractScrollArea);
+ bool transient = q->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, vbar ? vbar : hbar);
+ if (hbarpolicy == Qt::ScrollBarAsNeeded || transient)
hbar->d_func()->flash();
- if (vbarpolicy == Qt::ScrollBarAsNeeded)
+ if (vbarpolicy == Qt::ScrollBarAsNeeded || transient)
vbar->d_func()->flash();
}
diff --git a/src/widgets/widgets/qcheckbox.cpp b/src/widgets/widgets/qcheckbox.cpp
index 1567e30d83..0e2e802006 100644
--- a/src/widgets/widgets/qcheckbox.cpp
+++ b/src/widgets/widgets/qcheckbox.cpp
@@ -124,8 +124,8 @@ public:
\li \inlineimage macintosh-checkbox.png Screenshot of a Macintosh style checkbox
\li A checkbox shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
\row
- \li \inlineimage windows-checkbox.png Screenshot of a Windows XP style checkbox
- \li A checkbox shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \li \inlineimage windowsvista-checkbox.png Screenshot of a Windows Vista style checkbox
+ \li A checkbox shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row
\li \inlineimage fusion-checkbox.png Screenshot of a Fusion style checkbox
\li A checkbox shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index 394e2b537f..a962762bb1 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -105,8 +105,8 @@ QT_BEGIN_NAMESPACE
calendar widget can be retrieved with calendarWidget().
\table 100%
- \row \li \inlineimage windowsxp-datetimeedit.png Screenshot of a Windows XP style date time editing widget
- \li A date time editing widget shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-datetimeedit.png Screenshot of a Windows Vista style date time editing widget
+ \li A date time editing widget shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage macintosh-datetimeedit.png Screenshot of a Macintosh style date time editing widget
\li A date time editing widget shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
\row \li \inlineimage fusion-datetimeedit.png Screenshot of a Fusion style date time editing widget
@@ -1536,8 +1536,8 @@ void QDateTimeEdit::mousePressEvent(QMouseEvent *event)
\endlist
\table 100%
- \row \li \inlineimage windowsxp-timeedit.png Screenshot of a Windows XP style time editing widget
- \li A time editing widget shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-timeedit.png Screenshot of a Windows Vista style time editing widget
+ \li A time editing widget shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage macintosh-timeedit.png Screenshot of a Macintosh style time editing widget
\li A time editing widget shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
\row \li \inlineimage fusion-timeedit.png Screenshot of a Fusion style time editing widget
@@ -1613,8 +1613,8 @@ QTimeEdit::~QTimeEdit()
\endlist
\table 100%
- \row \li \inlineimage windowsxp-dateedit.png Screenshot of a Windows XP style date editing widget
- \li A date editing widget shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-dateedit.png Screenshot of a Windows Vista style date editing widget
+ \li A date editing widget shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage macintosh-dateedit.png Screenshot of a Macintosh style date editing widget
\li A date editing widget shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
\row \li \inlineimage fusion-dateedit.png Screenshot of a Fusion style date editing widget
diff --git a/src/widgets/widgets/qdial.cpp b/src/widgets/widgets/qdial.cpp
index 1f06fed0f6..4bdd5538b9 100644
--- a/src/widgets/widgets/qdial.cpp
+++ b/src/widgets/widgets/qdial.cpp
@@ -231,11 +231,11 @@ int QDialPrivate::valueFromPoint(const QPoint &p) const
\table
\row \li \inlineimage fusion-dial.png Screenshot of a dial in the Fusion widget style
- \li \inlineimage windowsxp-dial.png Screenshot of a dial in the Windows XP widget style
+ \li \inlineimage windowsvista-dial.png Screenshot of a dial in the Windows Vista widget style
\li \inlineimage macintosh-dial.png Screenshot of a dial in the Macintosh widget style
\row \li {3,1} Dials shown in various widget styles (from left to right):
\l{Fusion Style Widget Gallery}{Fusion},
- \l{Windows XP Style Widget Gallery}{Windows XP},
+ \l{Windows Vista Style Widget Gallery}{Windows Vista},
\l{Macintosh Style Widget Gallery}{Macintosh}.
\endtable
diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp
index ab878cc98f..f602a47051 100644
--- a/src/widgets/widgets/qfontcombobox.cpp
+++ b/src/widgets/widgets/qfontcombobox.cpp
@@ -314,7 +314,7 @@ void QFontComboBoxPrivate::_q_currentChanged(const QString &text)
filter out certain types of fonts as e.g. non scalable fonts or
monospaced fonts.
- \image windowsxp-fontcombobox.png Screenshot of QFontComboBox on Windows XP
+ \image windowsvista-fontcombobox.png Screenshot of QFontComboBox on Windows Vista
\sa QComboBox, QFont, QFontInfo, QFontMetrics, QFontDatabase, {Character Map Example}
*/
diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp
index e52b8f1a94..e303fe5d6f 100644
--- a/src/widgets/widgets/qgroupbox.cpp
+++ b/src/widgets/widgets/qgroupbox.cpp
@@ -171,10 +171,10 @@ void QGroupBoxPrivate::click()
\snippet widgets/groupbox/window.cpp 2
\table 100%
- \row \li \inlineimage windowsxp-groupbox.png Screenshot of a Windows XP style group box
+ \row \li \inlineimage windowsvista-groupbox.png Screenshot of a Windows Vista style group box
\li \inlineimage macintosh-groupbox.png Screenshot of a Macintosh style group box
\li \inlineimage fusion-groupbox.png Screenshot of a Fusion style group box
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} group box.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} group box.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} group box.
\li A \l{Fusion Style Widget Gallery}{Fusion style} group box.
\endtable
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 9465acfdad..63596a64af 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -141,8 +141,8 @@ QT_BEGIN_NAMESPACE
\li \inlineimage fusion-label.png Screenshot of a Fusion style label
\li A label shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
\row
- \li \inlineimage windowsxp-label.png Screenshot of a Windows XP style label
- \li A label shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \li \inlineimage windowsvista-label.png Screenshot of a Windows Vista style label
+ \li A label shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\endtable
\sa QLineEdit, QTextEdit, QPixmap, QMovie,
diff --git a/src/widgets/widgets/qlcdnumber.cpp b/src/widgets/widgets/qlcdnumber.cpp
index 69d838bb00..c7a835b629 100644
--- a/src/widgets/widgets/qlcdnumber.cpp
+++ b/src/widgets/widgets/qlcdnumber.cpp
@@ -108,11 +108,11 @@ public:
\table
\row \li
\inlineimage windows-lcdnumber.png Screenshot of a Windows style LCD number widget
- \inlineimage windowsxp-lcdnumber.png Screenshot of a Windows XP style LCD number widget
+ \inlineimage windowsvista-lcdnumber.png Screenshot of a Windows Vista style LCD number widget
\inlineimage macintosh-lcdnumber.png Screenshot of a Macintosh style LCD number widget
\inlineimage fusion-lcdnumber.png Screenshot of a Fusion style LCD number widget
\row \li LCD number widgets shown in various widget styles (from left to right):
- \l{Windows Style Widget Gallery}{Windows}, \l{Windows XP Style Widget Gallery}{Windows XP},
+ \l{Windows Style Widget Gallery}{Windows}, \l{Windows Vista Style Widget Gallery}{Windows Vista},
\l{Macintosh Style Widget Gallery}{Macintosh}, \l{Fusion Style Widget Gallery}{Fusion}.
\endtable
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index 23dee90406..c250c286bc 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -206,8 +206,8 @@ void QLineEdit::initStyleOption(QStyleOptionFrame *option) const
\table 100%
\row \li \inlineimage macintosh-lineedit.png Screenshot of a Macintosh style line edit
\li A line edit shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage windows-lineedit.png Screenshot of a Windows XP style line edit
- \li A line edit shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-lineedit.png Screenshot of a Windows Vista style line edit
+ \li A line edit shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage fusion-lineedit.png Screenshot of a Fusion style line edit
\li A line edit shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
\endtable
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 4d431868ac..17f9ca7911 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -1856,7 +1856,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
QPoint mouse = QCursor::pos();
d->mousePopupPos = mouse;
- const bool snapToMouse = (QRect(p.x() - 3, p.y() - 3, 6, 6).contains(mouse));
+ const bool snapToMouse = !d->causedPopup.widget && (QRect(p.x() - 3, p.y() - 3, 6, 6).contains(mouse));
const QSize menuSize(sizeHint());
if (adjustToDesktop) {
diff --git a/src/widgets/widgets/qmenu_wince.rc b/src/widgets/widgets/qmenu_wince.rc
index 50624eef57..631cd9d47a 100644
--- a/src/widgets/widgets/qmenu_wince.rc
+++ b/src/widgets/widgets/qmenu_wince.rc
@@ -3,9 +3,9 @@
#include <commctrl.h>
#include "winuser.h"
-#if defined (_DEBUG) && defined(QT_DLL)
+#if defined (_DEBUG) && defined(QT_SHARED)
#include "Qt5Widgetsd_resource.rc"
-#elif defined(QT_DLL)
+#elif defined(QT_SHARED)
#include "Qt5Widgets_resource.rc"
#endif
diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp
index 3292116dac..7cf564c8e7 100644
--- a/src/widgets/widgets/qprogressbar.cpp
+++ b/src/widgets/widgets/qprogressbar.cpp
@@ -198,8 +198,8 @@ bool QProgressBarPrivate::repaintRequired() const
\table
\row \li \inlineimage macintosh-progressbar.png Screenshot of a Macintosh style progress bar
\li A progress bar shown in the Macintosh widget style.
- \row \li \inlineimage windowsxp-progressbar.png Screenshot of a Windows XP style progress bar
- \li A progress bar shown in the Windows XP widget style.
+ \row \li \inlineimage windowsvista-progressbar.png Screenshot of a Windows Vista style progress bar
+ \li A progress bar shown in the Windows Vista widget style.
\row \li \inlineimage fusion-progressbar.png Screenshot of a Fusion style progress bar
\li A progress bar shown in the Fusion widget style.
\endtable
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index 0f9243a6c8..dd7c5f9d4f 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -168,8 +168,8 @@ QT_BEGIN_NAMESPACE
changed from round to square. Use the setMinimumSize()
function to prevent this behavior.
- \row \li \inlineimage windowsxp-pushbutton.png Screenshot of a Windows XP style push button
- \li A push button shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-pushbutton.png Screenshot of a Windows Vista style push button
+ \li A push button shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage fusion-pushbutton.png Screenshot of a Fusion style push button
\li A push button shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
\endtable
diff --git a/src/widgets/widgets/qradiobutton.cpp b/src/widgets/widgets/qradiobutton.cpp
index 68681a9dea..bb081ec905 100644
--- a/src/widgets/widgets/qradiobutton.cpp
+++ b/src/widgets/widgets/qradiobutton.cpp
@@ -118,8 +118,8 @@ void QRadioButtonPrivate::init()
\table 100%
\row \li \inlineimage fusion-radiobutton.png Screenshot of a Fusion radio button
\li A radio button shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \row \li \inlineimage windows-radiobutton.png Screenshot of a Windows XP radio button
- \li A radio button shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-radiobutton.png Screenshot of a Windows Vista radio button
+ \li A radio button shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage macintosh-radiobutton.png Screenshot of a Macintosh radio button
\li A radio button shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
\endtable
diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp
index 32cf9f4467..6ace736391 100644
--- a/src/widgets/widgets/qscrollbar.cpp
+++ b/src/widgets/widgets/qscrollbar.cpp
@@ -192,8 +192,8 @@ QT_BEGIN_NAMESPACE
\table 100%
\row \li \inlineimage macintosh-horizontalscrollbar.png Screenshot of a Macintosh style scroll bar
\li A scroll bar shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage windowsxp-horizontalscrollbar.png Screenshot of a Windows XP style scroll bar
- \li A scroll bar shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-horizontalscrollbar.png Screenshot of a Windows Vista style scroll bar
+ \li A scroll bar shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage fusion-horizontalscrollbar.png Screenshot of a Fusion style scroll bar
\li A scroll bar shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
\endtable
@@ -234,10 +234,10 @@ void QScrollBarPrivate::setTransient(bool value)
Q_Q(QScrollBar);
if (transient != value) {
transient = value;
- if (transient) {
- if (q->isVisible() && q->style()->styleHint(QStyle::SH_ScrollBar_Transient))
+ if (q->isVisible()) {
+ if (q->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, q))
q->update();
- } else if (!q->isVisible()) {
+ } else if (!transient) {
q->show();
}
}
@@ -246,7 +246,7 @@ void QScrollBarPrivate::setTransient(bool value)
void QScrollBarPrivate::flash()
{
Q_Q(QScrollBar);
- if (!flashed && q->style()->styleHint(QStyle::SH_ScrollBar_Transient)) {
+ if (!flashed && q->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, q)) {
flashed = true;
q->show();
}
@@ -325,7 +325,7 @@ void QScrollBar::initStyleOption(QStyleOptionSlider *option) const
option->upsideDown = d->invertedAppearance;
if (d->orientation == Qt::Horizontal)
option->state |= QStyle::State_Horizontal;
- if (d->flashed || !d->transient)
+ if ((d->flashed || !d->transient) && style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, this))
option->state |= QStyle::State_On;
}
@@ -384,7 +384,7 @@ void QScrollBarPrivate::init()
invertedControls = true;
pressedControl = hoverControl = QStyle::SC_None;
pointerOutsidePressedControl = false;
- transient = q->style()->styleHint(QStyle::SH_ScrollBar_Transient);
+ transient = q->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, q);
flashed = false;
q->setFocusPolicy(Qt::NoFocus);
QSizePolicy sp(QSizePolicy::Minimum, QSizePolicy::Fixed, QSizePolicy::Slider);
@@ -484,7 +484,7 @@ bool QScrollBar::event(QEvent *event)
d_func()->updateHoverControl(he->pos());
break;
case QEvent::StyleChange:
- d_func()->setTransient(style()->styleHint(QStyle::SH_ScrollBar_Transient));
+ d_func()->setTransient(style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, this));
break;
default:
break;
@@ -531,7 +531,7 @@ void QScrollBar::paintEvent(QPaintEvent *)
opt.activeSubControls = (QStyle::SubControl)d->hoverControl;
}
style()->drawComplexControl(QStyle::CC_ScrollBar, &opt, &p, this);
- if (d->flashed && style()->styleHint(QStyle::SH_ScrollBar_Transient)) {
+ if (d->flashed && style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, this)) {
d->flashed = false;
update();
}
diff --git a/src/widgets/widgets/qslider.cpp b/src/widgets/widgets/qslider.cpp
index f96a44c29f..eb16faae2f 100644
--- a/src/widgets/widgets/qslider.cpp
+++ b/src/widgets/widgets/qslider.cpp
@@ -257,8 +257,8 @@ QStyle::SubControl QSliderPrivate::newHoverControl(const QPoint &pos)
\table 100%
\row \li \inlineimage macintosh-slider.png Screenshot of a Macintosh slider
\li A slider shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage windows-slider.png Screenshot of a Windows XP slider
- \li A slider shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-slider.png Screenshot of a Windows Vista slider
+ \li A slider shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage fusion-slider.png Screenshot of a Fusion slider
\li A slider shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
\endtable
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp
index 4754f5c1a6..13fbf3a781 100644
--- a/src/widgets/widgets/qspinbox.cpp
+++ b/src/widgets/widgets/qspinbox.cpp
@@ -153,8 +153,8 @@ public:
setSpecialValueText() for how to do this with QSpinBox.
\table 100%
- \row \li \inlineimage windowsxp-spinbox.png Screenshot of a Windows XP spin box
- \li A spin box shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-spinbox.png Screenshot of a Windows Vista spin box
+ \li A spin box shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage fusion-spinbox.png Screenshot of a Fusion spin box
\li A spin box shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
\row \li \inlineimage macintosh-spinbox.png Screenshot of a Macintosh spin box
diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp
index 70c493cedd..9b605e4368 100644
--- a/src/widgets/widgets/qsplitter.cpp
+++ b/src/widgets/widgets/qsplitter.cpp
@@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QSplitterHandle
- \brief The QSplitterHandle class provides handle functionality of the splitter.
+ \brief The QSplitterHandle class provides handle functionality for the splitter.
\ingroup organizers
\inmodule QtWidgets
@@ -80,7 +80,7 @@ QT_BEGIN_NAMESPACE
QSplitterHandle. It is provided for developers who want splitter handles
that provide extra features, such as popup menus.
- The typical way one would create splitter handles is to subclass QSplitter then
+ The typical way one would create splitter handles is to subclass QSplitter and then
reimplement QSplitter::createHandle() to instantiate the custom splitter
handle. For example, a minimum QSplitter subclass might look like this:
@@ -113,7 +113,7 @@ QT_BEGIN_NAMESPACE
/*!
Creates a QSplitter handle with the given \a orientation and
- QSplitter \a parent.
+ \a parent.
*/
QSplitterHandle::QSplitterHandle(Qt::Orientation orientation, QSplitter *parent)
: QWidget(*new QSplitterHandlePrivate, parent, 0)
@@ -888,7 +888,7 @@ QSplitterLayoutStruct *QSplitterPrivate::insertWidget(int index, QWidget *w)
A splitter lets the user control the size of child widgets by dragging the
- boundary between the children. Any number of widgets may be controlled by a
+ boundary between them. Any number of widgets may be controlled by a
single splitter. The typical use of a QSplitter is to create several
widgets and add them using insertWidget() or addWidget().
@@ -921,7 +921,7 @@ QSplitterLayoutStruct *QSplitterPrivate::insertWidget(int index, QWidget *w)
Alternatively, you can save and restore the sizes of the widgets from a
QByteArray using saveState() and restoreState() respectively.
- When you hide() a child its space will be distributed among the
+ When you hide() a child, its space will be distributed among the
other children. It will be reinstated when you show() it again.
\note Adding a QLayout to a QSplitter is not supported (either through
@@ -987,7 +987,7 @@ void QSplitter::refresh()
\property QSplitter::orientation
\brief the orientation of the splitter
- By default the orientation is horizontal (i.e., the widgets are
+ By default, the orientation is horizontal (i.e., the widgets are
laid out side by side). The possible orientations are
Qt::Horizontal and Qt::Vertical.
@@ -1046,7 +1046,7 @@ bool QSplitter::childrenCollapsible() const
}
/*!
- Sets whether the child widget at index \a index is collapsible to \a collapse.
+ Sets whether the child widget at \a index is collapsible to \a collapse.
By default, children are collapsible, meaning that the user can
resize them down to size 0, even if they have a non-zero
@@ -1070,7 +1070,7 @@ void QSplitter::setCollapsible(int index, bool collapse)
}
/*!
- Returns true if the widget at \a index is collapsible, otherwise returns false
+ Returns true if the widget at \a index is collapsible, otherwise returns false.
*/
bool QSplitter::isCollapsible(int index) const
{
@@ -1372,7 +1372,7 @@ void QSplitter::moveSplitter(int pos, int index)
/*!
- Returns the valid range of the splitter with index \a index in
+ Returns the valid range of the splitter at \a index in
*\a{min} and *\a{max} if \a min and \a max are not 0.
*/
@@ -1384,8 +1384,7 @@ void QSplitter::getRange(int index, int *min, int *max) const
/*!
- Returns the closest legal position to \a pos of the widget with index
- \a index.
+ Returns the closest legal position to \a pos of the widget at \a index.
For right-to-left languages such as Arabic and Hebrew, the layout
of horizontal splitters is reversed. Positions are then measured
@@ -1484,7 +1483,7 @@ QSize QSplitter::minimumSizeHint() const
If the splitter's orientation is horizontal, the list contains the
widgets width in pixels, from left to right; if the orientation is
- vertical, the list contains the widgets height in pixels,
+ vertical, the list contains the widgets' heights in pixels,
from top to bottom.
Giving the values to another splitter's setSizes() function will
@@ -1509,21 +1508,21 @@ QList<int> QSplitter::sizes() const
}
/*!
- Sets the child widgets respective sizes to the values given in the \a list.
+ Sets the child widgets' respective sizes to the values given in the \a list.
- If the splitter is horizontal, the values set the widths of each
+ If the splitter is horizontal, the values set the width of each
widget in pixels, from left to right. If the splitter is vertical, the
- heights of each widget is set, from top to bottom.
+ height of each widget is set, from top to bottom.
Extra values in the \a list are ignored. If \a list contains too few
- values, the result is undefined but the program will still be well-behaved.
+ values, the result is undefined, but the program will still be well-behaved.
The overall size of the splitter widget is not affected.
Instead, any additional/missing space is distributed amongst the
widgets according to the relative weight of the sizes.
If you specify a size of 0, the widget will be invisible. The size policies
- of the widgets are preserved. That is, a value smaller then the minimal size
+ of the widgets are preserved. That is, a value smaller than the minimal size
hint of the respective widget will be replaced by the value of the hint.
\sa sizes()
@@ -1616,7 +1615,7 @@ QByteArray QSplitter::saveState() const
Typically this is used in conjunction with QSettings to restore the size
from a past session. Here is an example:
- Restore the splitters's state:
+ Restore the splitter's state:
\snippet splitter/splitter.cpp 2
diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp
index df9ca56e88..abb781960e 100644
--- a/src/widgets/widgets/qtabwidget.cpp
+++ b/src/widgets/widgets/qtabwidget.cpp
@@ -120,10 +120,10 @@ QT_BEGIN_NAMESPACE
area, organizing the individual pages).
\table 100%
- \row \li \inlineimage windowsxp-tabwidget.png Screenshot of a Windows XP style tab widget
+ \row \li \inlineimage windowsvista-tabwidget.png Screenshot of a Windows Vista style tab widget
\li \inlineimage macintosh-tabwidget.png Screenshot of a Macintosh style tab widget
\li \inlineimage fusion-tabwidget.png Screenshot of a Fusion style tab widget
- \row \li A Windows XP style tab widget.
+ \row \li A Windows Vista style tab widget.
\li A Macintosh style tab widget.
\li A Fusion style tab widget.
\endtable
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index 9f7d66b344..70dcc5b506 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -53,6 +53,9 @@
#include <qmenu.h>
#include <qstyle.h>
#include <qtimer.h>
+#ifndef QT_NO_ACCESSIBILITY
+#include <qaccessible.h>
+#endif
#include "private/qtextdocumentlayout_p.h"
#include "qtextdocument.h"
#include "private/qtextdocument_p.h"
@@ -154,7 +157,7 @@ void QTextEditPrivate::init(const QString &html)
QObject::connect(control, SIGNAL(redoAvailable(bool)), q, SIGNAL(redoAvailable(bool)));
QObject::connect(control, SIGNAL(copyAvailable(bool)), q, SIGNAL(copyAvailable(bool)));
QObject::connect(control, SIGNAL(selectionChanged()), q, SIGNAL(selectionChanged()));
- QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SIGNAL(cursorPositionChanged()));
+ QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SLOT(_q_cursorPositionChanged()));
QObject::connect(control, SIGNAL(textChanged()), q, SLOT(updateMicroFocus()));
@@ -206,6 +209,16 @@ void QTextEditPrivate::_q_repaintContents(const QRectF &contentsRect)
viewport->update(r);
}
+void QTextEditPrivate::_q_cursorPositionChanged()
+{
+ Q_Q(QTextEdit);
+ emit q->cursorPositionChanged();
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessibleTextCursorEvent event(q, q->textCursor().position());
+ QAccessible::updateAccessibility(&event);
+#endif
+}
+
void QTextEditPrivate::pageUpDown(QTextCursor::MoveOperation op, QTextCursor::MoveMode moveMode)
{
QTextCursor cursor = control->textCursor();
diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h
index 178aa7b907..5df44da4cf 100644
--- a/src/widgets/widgets/qtextedit.h
+++ b/src/widgets/widgets/qtextedit.h
@@ -304,6 +304,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_currentCharFormatChanged(const QTextCharFormat &))
Q_PRIVATE_SLOT(d_func(), void _q_adjustScrollbars())
Q_PRIVATE_SLOT(d_func(), void _q_ensureVisible(const QRectF &))
+ Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged())
friend class QTextEditControl;
friend class QTextDocument;
friend class QWidgetTextControl;
diff --git a/src/widgets/widgets/qtextedit_p.h b/src/widgets/widgets/qtextedit_p.h
index d2dd81c13b..7038f16205 100644
--- a/src/widgets/widgets/qtextedit_p.h
+++ b/src/widgets/widgets/qtextedit_p.h
@@ -99,6 +99,7 @@ public:
{ control->processEvent(e, QPointF(horizontalOffset(), verticalOffset()), viewport); }
void _q_currentCharFormatChanged(const QTextCharFormat &format);
+ void _q_cursorPositionChanged();
void updateDefaultTextOption();
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp
index 2681b0ab4e..80d42e4c95 100644
--- a/src/widgets/widgets/qtoolbar.cpp
+++ b/src/widgets/widgets/qtoolbar.cpp
@@ -273,7 +273,7 @@ bool QToolBarPrivate::mousePressEvent(QMouseEvent *event)
q->initStyleOption(&opt);
if (q->style()->subElementRect(QStyle::SE_ToolBarHandle, &opt, q).contains(event->pos()) == false) {
#ifdef Q_WS_MAC
- // When using the unified toolbar on Mac OS X the user can can click and
+ // When using the unified toolbar on Mac OS X, the user can click and
// drag between toolbar contents to move the window. Make this work by
// implementing the standard mouse-dragging code and then call
// window->move() in mouseMoveEvent below.
@@ -421,13 +421,13 @@ void QToolBarPrivate::plug(const QRect &r)
or insertAction(). Groups of buttons can be separated using
addSeparator() or insertSeparator(). If a toolbar button is not
appropriate, a widget can be inserted instead using addWidget() or
- insertWidget(); examples of suitable widgets are QSpinBox,
- QDoubleSpinBox, and QComboBox. When a toolbar button is pressed it
+ insertWidget(). Examples of suitable widgets are QSpinBox,
+ QDoubleSpinBox, and QComboBox. When a toolbar button is pressed, it
emits the actionTriggered() signal.
- A toolbar can be fixed in place in a particular area (e.g. at the
- top of the window), or it can be movable (isMovable()) between
- toolbar areas; see allowedAreas() and isAreaAllowed().
+ A toolbar can be fixed in place in a particular area (e.g., at the
+ top of the window), or it can be movable between toolbar areas;
+ see setMovable(), isMovable(), allowedAreas() and isAreaAllowed().
When a toolbar is resized in such a way that it is too small to
show all the items it contains, an extension button will appear as
@@ -454,7 +454,7 @@ void QToolBarPrivate::plug(const QRect &r)
\fn void QToolBar::addAction(QAction *action)
\overload
- Appends the action \a action to the toolbar's list of actions.
+ Appends the \a action to the toolbar's list of actions.
\sa QMenu::addAction(), QWidget::addAction()
*/
@@ -464,7 +464,7 @@ void QToolBarPrivate::plug(const QRect &r)
This signal is emitted when an action in this toolbar is triggered.
This happens when the action's tool button is pressed, or when the
- action is triggered in some other way outside the tool bar. The parameter
+ action is triggered in some other way outside the toolbar. The parameter
holds the triggered \a action.
*/
@@ -481,7 +481,7 @@ void QToolBarPrivate::plug(const QRect &r)
/*!
\fn void QToolBar::iconSizeChanged(const QSize &iconSize)
- This signal is emitted when the icon size is changed. The \a
+ This signal is emitted when the icon size is changed. The \a
iconSize parameter holds the toolbar's new icon size.
\sa iconSize, QMainWindow::iconSize
@@ -501,7 +501,7 @@ void QToolBarPrivate::plug(const QRect &r)
\fn void QToolBar::orientationChanged(Qt::Orientation orientation)
This signal is emitted when the orientation of the toolbar changes.
- The new orientation is specified by the \a orientation given.
+ The \a orientation parameter holds the toolbar's new orientation.
\sa orientation
*/
@@ -583,7 +583,7 @@ QToolBar::~QToolBar()
/*! \property QToolBar::movable
\brief whether the user can move the toolbar within the toolbar area,
- or between toolbar areas
+ or between toolbar areas.
By default, this property is true.
@@ -681,8 +681,8 @@ Qt::ToolBarAreas QToolBar::allowedAreas() const
This function should not be used when the toolbar is managed
by QMainWindow. You can use QMainWindow::addToolBar() or
- QMainWindow::insertToolBar() if you wish to move a toolbar (that
- is already added to a main window) to another Qt::ToolBarArea.
+ QMainWindow::insertToolBar() if you wish to move a toolbar that
+ is already added to a main window to another Qt::ToolBarArea.
*/
void QToolBar::setOrientation(Qt::Orientation orientation)
@@ -833,7 +833,7 @@ QAction *QToolBar::addAction(const QString &text,
/*!
\overload
- Creates a new action with the icon \a icon and text \a text. This
+ Creates a new action with the given \a icon and \a text. This
action is added to the end of the toolbar. The action's
\l{QAction::triggered()}{triggered()} signal is connected to \a
member in \a receiver.
@@ -880,7 +880,7 @@ QAction *QToolBar::insertSeparator(QAction *before)
The toolbar takes ownership of \a widget.
- If you add a QToolButton with this method, the tools bar's
+ If you add a QToolButton with this method, the toolbar's
Qt::ToolButtonStyle will not be respected.
\note You should use QAction::setVisible() to change the