summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2013-02-17 20:31:38 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-17 20:31:38 +0100
commite88011357e5dd3b0ae4e6bc715ef29e5f4f3ffab (patch)
treec5b05d45e49194d70ff4defae41e5d5d5cf75e80 /src/widgets
parent2df8884bc68343ad96962e7496b98d6e585c0347 (diff)
parente65cd6f3794e12e6bc5c2ee985eae8e70ff5f333 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/Qt5WidgetsConfigExtras.cmake.in4
-rw-r--r--src/widgets/dialogs/qwizard.cpp2
-rw-r--r--src/widgets/doc/qtwidgets.qdocconf12
-rwxr-xr-xsrc/widgets/doc/snippets/macmainwindow.mm347
-rw-r--r--src/widgets/doc/src/gestures.qdoc8
-rw-r--r--src/widgets/doc/src/modelview.qdoc2
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/layout.qdoc2
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicswidget_p.cpp2
-rw-r--r--src/widgets/itemviews/qtreeview.cpp2
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp8
-rw-r--r--src/widgets/kernel/qapplication.cpp2
-rw-r--r--src/widgets/kernel/qlayoutitem.cpp2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm2
-rw-r--r--src/widgets/util/qscroller.cpp2
-rw-r--r--src/widgets/util/qsystemtrayicon_win.cpp32
-rw-r--r--src/widgets/widgets/qmaccocoaviewcontainer_mac.mm2
-rw-r--r--src/widgets/widgets/qmacnativewidget_mac.mm4
-rw-r--r--src/widgets/widgets/qsplashscreen.cpp2
-rw-r--r--src/widgets/widgets/qtextedit.cpp12
20 files changed, 402 insertions, 49 deletions
diff --git a/src/widgets/Qt5WidgetsConfigExtras.cmake.in b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
index 27f9c2e5a6..d9abb45843 100644
--- a/src/widgets/Qt5WidgetsConfigExtras.cmake.in
+++ b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
@@ -1,12 +1,10 @@
-get_filename_component(_qt5_widgets_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
-
if (NOT TARGET Qt5::uic)
add_executable(Qt5::uic IMPORTED)
set_target_properties(Qt5::uic PROPERTIES
!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
- IMPORTED_LOCATION \"${_qt5_widgets_install_prefix}/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\"
+ IMPORTED_LOCATION \"${_qt5Widgets_install_prefix}/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\"
!!ELSE
IMPORTED_LOCATION \"$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\"
!!ENDIF
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index d233df6351..aab6494d98 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -3577,7 +3577,7 @@ bool QWizardPage::validatePage()
from the rest of your implementation, whenever the value of isComplete()
changes. This ensures that QWizard updates the enabled or disabled state of
its buttons. An example of the reimplementation is
- available \l{http://qt.nokia.com/doc/qq/qq22-qwizard.html#validatebeforeitstoolate}
+ available \l{http://doc.qt.digia.com/qq/qq22-qwizard.html#validatebeforeitstoolate}
{here}.
\sa completeChanged(), isFinalPage()
diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf
index 2cd6887f83..e960ebfeba 100644
--- a/src/widgets/doc/qtwidgets.qdocconf
+++ b/src/widgets/doc/qtwidgets.qdocconf
@@ -2,22 +2,22 @@ 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.1.0
+url = http://qt-project.org/doc/qt-$QT_VER/qtwidgets
+version = $QT_VERSION
examplesinstallpath = widgets
qhp.projects = QtWidgets
qhp.QtWidgets.file = qtwidgets.qhp
-qhp.QtWidgets.namespace = org.qt-project.qtwidgets.510
+qhp.QtWidgets.namespace = org.qt-project.qtwidgets.$QT_VERSION_TAG
qhp.QtWidgets.virtualFolder = qtwidgets
qhp.QtWidgets.indexTitle = Qt Widgets
qhp.QtWidgets.indexRoot =
-qhp.QtWidgets.filterAttributes = qtwidgets 5.1.0 qtrefdoc
-qhp.QtWidgets.customFilters.Qt.name = QtWidgets 5.1.0
-qhp.QtWidgets.customFilters.Qt.filterAttributes = qtwidgets 5.1.0
+qhp.QtWidgets.filterAttributes = qtwidgets $QT_VERSION qtrefdoc
+qhp.QtWidgets.customFilters.Qt.name = QtWidgets $QT_VERSION
+qhp.QtWidgets.customFilters.Qt.filterAttributes = qtwidgets $QT_VERSION
qhp.QtWidgets.subprojects = classes
qhp.QtWidgets.subprojects.classes.title = C++ Classes
diff --git a/src/widgets/doc/snippets/macmainwindow.mm b/src/widgets/doc/snippets/macmainwindow.mm
new file mode 100755
index 0000000000..af21ee726a
--- /dev/null
+++ b/src/widgets/doc/snippets/macmainwindow.mm
@@ -0,0 +1,347 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "macmainwindow.h"
+#import <Cocoa/Cocoa.h>
+#include <QtGui>
+
+
+#ifdef Q_WS_MAC
+
+#include <Carbon/Carbon.h>
+
+#ifdef QT_MAC_USE_COCOA
+
+//![0]
+SearchWidget::SearchWidget(QWidget *parent)
+ : QMacCocoaViewContainer(0, parent)
+{
+ // Many Cocoa objects create temporary autorelease objects,
+ // so create a pool to catch them.
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ // Create the NSSearchField, set it on the QCocoaViewContainer.
+ NSSearchField *search = [[NSSearchField alloc] init];
+ setCocoaView(search);
+
+ // Use a Qt menu for the search field menu.
+ QMenu *qtMenu = createMenu(this);
+ NSMenu *nsMenu = qtMenu->macMenu(0);
+ [[search cell] setSearchMenuTemplate:nsMenu];
+
+ // Release our reference, since our super class takes ownership and we
+ // don't need it anymore.
+ [search release];
+
+ // Clean up our pool as we no longer need it.
+ [pool release];
+}
+//![0]
+
+SearchWidget::~SearchWidget()
+{
+}
+
+QSize SearchWidget::sizeHint() const
+{
+ return QSize(150, 40);
+}
+
+#else
+
+// The SearchWidget class wraps a native HISearchField.
+SearchWidget::SearchWidget(QWidget *parent)
+ :QWidget(parent)
+{
+
+ // Create a native search field and pass its window id to QWidget::create.
+ searchFieldText = CFStringCreateWithCString(0, "search", 0);
+ HISearchFieldCreate(NULL/*bounds*/, kHISearchFieldAttributesSearchIcon | kHISearchFieldAttributesCancel,
+ NULL/*menu ref*/, searchFieldText, &searchField);
+ create(reinterpret_cast<WId>(searchField));
+
+ // Use a Qt menu for the search field menu.
+ QMenu *searchMenu = createMenu(this);
+ MenuRef menuRef = searchMenu->macMenu(0);
+ HISearchFieldSetSearchMenu(searchField, menuRef);
+ setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+}
+
+SearchWidget::~SearchWidget()
+{
+ CFRelease(searchField);
+ CFRelease(searchFieldText);
+}
+
+// Get the size hint from the search field.
+QSize SearchWidget::sizeHint() const
+{
+ EventRef event;
+ HIRect optimalBounds;
+ CreateEvent(0, kEventClassControl,
+ kEventControlGetOptimalBounds,
+ GetCurrentEventTime(),
+ kEventAttributeUserEvent, &event);
+
+ SendEventToEventTargetWithOptions(event,
+ HIObjectGetEventTarget(HIObjectRef(winId())),
+ kEventTargetDontPropagate);
+
+ GetEventParameter(event,
+ kEventParamControlOptimalBounds, typeHIRect,
+ 0, sizeof(HIRect), 0, &optimalBounds);
+
+ ReleaseEvent(event);
+ return QSize(optimalBounds.size.width + 100, // make it a bit wider.
+ optimalBounds.size.height);
+}
+
+#endif
+
+QMenu *createMenu(QWidget *parent)
+{
+ QMenu *searchMenu = new QMenu(parent);
+
+ QAction * indexAction = searchMenu->addAction("Index Search");
+ indexAction->setCheckable(true);
+ indexAction->setChecked(true);
+
+ QAction * fulltextAction = searchMenu->addAction("Full Text Search");
+ fulltextAction->setCheckable(true);
+
+ QActionGroup *searchActionGroup = new QActionGroup(parent);
+ searchActionGroup->addAction(indexAction);
+ searchActionGroup->addAction(fulltextAction);
+ searchActionGroup->setExclusive(true);
+
+ return searchMenu;
+}
+
+SearchWrapper::SearchWrapper(QWidget *parent)
+:QWidget(parent)
+{
+ s = new SearchWidget(this);
+ s->move(2,2);
+ setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+}
+
+QSize SearchWrapper::sizeHint() const
+{
+ return s->sizeHint() + QSize(6, 2);
+}
+
+Spacer::Spacer(QWidget *parent)
+:QWidget(parent)
+{
+ QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ setSizePolicy(sizePolicy);
+}
+
+QSize Spacer::sizeHint() const
+{
+ return QSize(1, 1);
+}
+
+MacSplitterHandle::MacSplitterHandle(Qt::Orientation orientation, QSplitter *parent)
+: QSplitterHandle(orientation, parent) { }
+
+// Paint the horizontal handle as a gradient, paint
+// the vertical handle as a line.
+void MacSplitterHandle::paintEvent(QPaintEvent *)
+{
+ QPainter painter(this);
+
+ QColor topColor(145, 145, 145);
+ QColor bottomColor(142, 142, 142);
+ QColor gradientStart(252, 252, 252);
+ QColor gradientStop(223, 223, 223);
+
+ if (orientation() == Qt::Vertical) {
+ painter.setPen(topColor);
+ painter.drawLine(0, 0, width(), 0);
+ painter.setPen(bottomColor);
+ painter.drawLine(0, height() - 1, width(), height() - 1);
+
+ QLinearGradient linearGrad(QPointF(0, 0), QPointF(0, height() -3));
+ linearGrad.setColorAt(0, gradientStart);
+ linearGrad.setColorAt(1, gradientStop);
+ painter.fillRect(QRect(QPoint(0,1), size() - QSize(0, 2)), QBrush(linearGrad));
+ } else {
+ painter.setPen(topColor);
+ painter.drawLine(0, 0, 0, height());
+ }
+}
+
+QSize MacSplitterHandle::sizeHint() const
+{
+ QSize parent = QSplitterHandle::sizeHint();
+ if (orientation() == Qt::Vertical) {
+ return parent + QSize(0, 3);
+ } else {
+ return QSize(1, parent.height());
+ }
+}
+
+QSplitterHandle *MacSplitter::createHandle()
+{
+ return new MacSplitterHandle(orientation(), this);
+}
+
+MacMainWindow::MacMainWindow()
+{
+ QSettings settings;
+ restoreGeometry(settings.value("Geometry").toByteArray());
+
+ setWindowTitle("Mac Main Window");
+
+ splitter = new MacSplitter();
+
+ // Set up the left-hand side blue side bar.
+ sidebar = new QTreeView();
+ sidebar->setFrameStyle(QFrame::NoFrame);
+ sidebar->setAttribute(Qt::WA_MacShowFocusRect, false);
+ sidebar->setAutoFillBackground(true);
+
+ // Set the palette.
+ QPalette palette = sidebar->palette();
+ QColor macSidebarColor(231, 237, 246);
+ QColor macSidebarHighlightColor(168, 183, 205);
+ palette.setColor(QPalette::Base, macSidebarColor);
+ palette.setColor(QPalette::Highlight, macSidebarHighlightColor);
+ sidebar->setPalette(palette);
+
+ sidebar->setModel(createItemModel());
+ sidebar->header()->hide();
+ sidebar->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ sidebar->setTextElideMode(Qt::ElideMiddle);
+
+ splitter->addWidget(sidebar);
+
+ horizontalSplitter = new MacSplitter();
+ horizontalSplitter->setOrientation(Qt::Vertical);
+ splitter->addWidget(horizontalSplitter);
+
+ splitter->setStretchFactor(0, 0);
+ splitter->setStretchFactor(1, 1);
+
+ // Set up the top document list view.
+ documents = new QListView();
+ documents->setFrameStyle(QFrame::NoFrame);
+ documents->setAttribute(Qt::WA_MacShowFocusRect, false);
+ documents->setModel(createDocumentModel());
+ documents->setAlternatingRowColors(true);
+ documents->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
+ horizontalSplitter->addWidget(documents);
+ horizontalSplitter->setStretchFactor(0, 0);
+
+ // Set up the text view.
+ textedit = new QTextEdit();
+ textedit->setFrameStyle(QFrame::NoFrame);
+ textedit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
+ textedit->setText("<br><br><br><br><br><br><center><b>This demo shows how to create a \
+ Qt main window application that has the same appearance as other \
+ Mac OS X applications such as Mail or iTunes. This includes \
+ customizing the item views and QSplitter and wrapping native widgets \
+ such as the search field.</b></center>");
+
+ horizontalSplitter->addWidget(textedit);
+
+ setCentralWidget(splitter);
+
+ toolBar = addToolBar(tr("Search"));
+ toolBar->addWidget(new Spacer());
+ toolBar->addWidget(new SearchWrapper());
+
+ setUnifiedTitleAndToolBarOnMac(true);
+}
+
+MacMainWindow::~MacMainWindow()
+{
+ QSettings settings;
+ settings.setValue("Geometry", saveGeometry());
+}
+
+QAbstractItemModel *MacMainWindow::createItemModel()
+{
+ QStandardItemModel *model = new QStandardItemModel();
+ QStandardItem *parentItem = model->invisibleRootItem();
+
+ QStandardItem *documentationItem = new QStandardItem("Documentation");
+ parentItem->appendRow(documentationItem);
+
+ QStandardItem *assistantItem = new QStandardItem("Qt MainWindow Manual");
+ documentationItem->appendRow(assistantItem);
+
+ QStandardItem *designerItem = new QStandardItem("Qt Designer Manual");
+ documentationItem->appendRow(designerItem);
+
+ QStandardItem *qtItem = new QStandardItem("Qt Reference Documentation");
+ qtItem->appendRow(new QStandardItem("Classes"));
+ qtItem->appendRow(new QStandardItem("Overviews"));
+ qtItem->appendRow(new QStandardItem("Tutorial & Examples"));
+ documentationItem->appendRow(qtItem);
+
+ QStandardItem *bookmarksItem = new QStandardItem("Bookmarks");
+ parentItem->appendRow(bookmarksItem);
+ bookmarksItem->appendRow(new QStandardItem("QWidget"));
+ bookmarksItem->appendRow(new QStandardItem("QObject"));
+ bookmarksItem->appendRow(new QStandardItem("QWizard"));
+
+ return model;
+}
+
+void MacMainWindow::resizeEvent(QResizeEvent *)
+{
+ if (toolBar)
+ toolBar->updateGeometry();
+}
+
+QAbstractItemModel *MacMainWindow::createDocumentModel()
+{
+ QStandardItemModel *model = new QStandardItemModel();
+ QStandardItem *parentItem = model->invisibleRootItem();
+ parentItem->appendRow(new QStandardItem("QWidget Class Reference"));
+ parentItem->appendRow(new QStandardItem("QObject Class Reference"));
+ parentItem->appendRow(new QStandardItem("QListView Class Reference"));
+
+ return model;
+}
+
+#endif // Q_WS_MAC
diff --git a/src/widgets/doc/src/gestures.qdoc b/src/widgets/doc/src/gestures.qdoc
index cc0bc76ea3..027f893db2 100644
--- a/src/widgets/doc/src/gestures.qdoc
+++ b/src/widgets/doc/src/gestures.qdoc
@@ -68,7 +68,7 @@
required gesture type. The standard types are defined by the Qt::GestureType
enum and include many commonly used gestures.
- \snippet examples/gestures/imagegestures/imagewidget.cpp enable gestures
+ \snippet ../../../examples/gestures/imagegestures/imagewidget.cpp enable gestures
In the above code, the gestures are set up in the constructor of the target object
itself.
@@ -125,18 +125,18 @@
\l{QWidget::}{event()} handler function and delegates gesture events to a
specialized gestureEvent() function:
- \snippet examples/gestures/imagegestures/imagewidget.cpp event handler
+ \snippet ../../../examples/gestures/imagegestures/imagewidget.cpp event handler
The gesture events delivered to the target object can be examined individually
and dealt with appropriately:
- \snippet examples/gestures/imagegestures/imagewidget.cpp gesture event handler
+ \snippet ../../../examples/gestures/imagegestures/imagewidget.cpp gesture event handler
Responding to a gesture is simply a matter of obtaining the QGesture object
delivered in the QGestureEvent sent to the target object and examining the
information it contains.
- \snippet examples/gestures/imagegestures/imagewidget.cpp swipe function
+ \snippet ../../../examples/gestures/imagegestures/imagewidget.cpp swipe function
Here, we examine the direction in which the user swiped the widget and modify
its contents accordingly.
diff --git a/src/widgets/doc/src/modelview.qdoc b/src/widgets/doc/src/modelview.qdoc
index fac0be3b0a..97d1c72e85 100644
--- a/src/widgets/doc/src/modelview.qdoc
+++ b/src/widgets/doc/src/modelview.qdoc
@@ -576,7 +576,7 @@
problem.
Qt Labs provides software called
- \l{http://labs.qt.nokia.com/page/Projects/Itemview/Modeltest}{ModelTest},
+ \l{http://qt-project.org/wiki/Model_Test}{ModelTest},
which checks models while your programming is running. Every time the model
is changed, ModelTest scans the model and reports errors with an assert.
This is especially important for tree models, since their hierarchical
diff --git a/src/widgets/doc/src/widgets-and-layouts/layout.qdoc b/src/widgets/doc/src/widgets-and-layouts/layout.qdoc
index 5d7ed8be1d..b658fc809c 100644
--- a/src/widgets/doc/src/widgets-and-layouts/layout.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/layout.qdoc
@@ -249,7 +249,7 @@
For further guidance when implementing these functions, see the
\e{Qt Quarterly} article
- \l{http://doc.qt.nokia.com/qq/qq04-height-for-width.html}
+ \l{http://doc.qt.digia.com/qq/qq04-height-for-width.html}
{Trading Height for Width}.
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index f35002af4c..78611a27ca 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -6280,7 +6280,7 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event)
// if the gesture was ignored by its target, we will update the
// targetItems list with a possible target items (items that
// want to receive partial gestures).
- // ### wont' work if the target was destroyed in the event
+ // ### won't work if the target was destroyed in the event
// we will just stop delivering it.
if (receiver && receiver.data() == gestureTargets.value(g, 0))
ignoredGestures.insert(g);
diff --git a/src/widgets/graphicsview/qgraphicswidget_p.cpp b/src/widgets/graphicsview/qgraphicswidget_p.cpp
index 204444f6c0..4101615fb3 100644
--- a/src/widgets/graphicsview/qgraphicswidget_p.cpp
+++ b/src/widgets/graphicsview/qgraphicswidget_p.cpp
@@ -466,7 +466,7 @@ static QSizeF closestAcceptableSize(const QSizeF &proposed,
do {
if (maxw - minw < 0.1) {
- // we still havent found anything, cut off binary search
+ // we still haven't found anything, cut off binary search
minw = maxw;
minh = maxh;
}
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index be42c8dac0..8d0a578f61 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -1100,7 +1100,7 @@ void QTreeView::scrollTo(const QModelIndex &index, ScrollHint hint)
// Expand all parents if the parent(s) of the node are not expanded.
QModelIndex parent = index.parent();
- while (parent.isValid() && state() == NoState && d->itemsExpandable) {
+ while (parent != d->root && parent.isValid() && state() == NoState && d->itemsExpandable) {
if (!isExpanded(parent))
expand(parent);
parent = d->model->parent(parent);
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index 41958517c8..8e86775a2d 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -1896,7 +1896,7 @@ void QTreeWidgetItem::addChild(QTreeWidgetItem *child)
/*!
Inserts the \a child item at \a index in the list of children.
- If the child has already been inserted somewhere else it wont be inserted again.
+ If the child has already been inserted somewhere else it won't be inserted again.
*/
void QTreeWidgetItem::insertChild(int index, QTreeWidgetItem *child)
{
@@ -1998,7 +1998,7 @@ void QTreeWidgetItem::addChildren(const QList<QTreeWidgetItem*> &children)
Inserts the given list of \a children into the list of the item children at \a index .
- Children that have already been inserted somewhere else wont be inserted.
+ Children that have already been inserted somewhere else won't be inserted.
*/
void QTreeWidgetItem::insertChildren(int index, const QList<QTreeWidgetItem*> &children)
{
@@ -2621,7 +2621,7 @@ int QTreeWidget::topLevelItemCount() const
/*!
Inserts the \a item at \a index in the top level in the view.
- If the item has already been inserted somewhere else it wont be inserted.
+ If the item has already been inserted somewhere else it won't be inserted.
\sa addTopLevelItem(), columnCount()
*/
@@ -2675,7 +2675,7 @@ int QTreeWidget::indexOfTopLevelItem(QTreeWidgetItem *item) const
Inserts the list of \a items at \a index in the top level in the view.
- Items that have already been inserted somewhere else wont be inserted.
+ Items that have already been inserted somewhere else won't be inserted.
\sa addTopLevelItems()
*/
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 95a8840a9d..4c6d8cfdc7 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -2720,7 +2720,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
if(e->spontaneous()) {
// Capture the current mouse and keyboard states. Doing so here is
- // required in order to support QTestLib synthesized events. Real mouse
+ // required in order to support Qt Test synthesized events. Real mouse
// and keyboard state updates from the platform plugin are managed by
// QGuiApplicationPrivate::process(Mouse|Wheel|Key|Touch|Tablet)Event();
switch (e->type()) {
diff --git a/src/widgets/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp
index 1323d2dceb..31276d015d 100644
--- a/src/widgets/kernel/qlayoutitem.cpp
+++ b/src/widgets/kernel/qlayoutitem.cpp
@@ -109,7 +109,7 @@ QSizePolicy::operator QVariant() const
be expressed using hasHeightForWidth(), heightForWidth(), and
minimumHeightForWidth(). For more explanation see the \e{Qt
Quarterly} article
- \l{http://qt.nokia.com/doc/qq/qq04-height-for-width.html}{Trading
+ \l{http://doc.qt.digia.com/qq/qq04-height-for-width.html}{Trading
Height for Width}.
\sa QLayout
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index a58f6e710b..ccf783adb3 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -4564,7 +4564,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
break;
case SE_LineEditContents:
rect = QCommonStyle::subElementRect(sr, opt, widget);
- if(widget->parentWidget() && qobject_cast<const QComboBox*>(widget->parentWidget()))
+ if (widget && qobject_cast<const QComboBox*>(widget->parentWidget()))
rect.adjust(-1, -2, 0, 0);
else
rect.adjust(-1, -1, 0, +1);
diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp
index baa1ab2e9a..1670d0ab57 100644
--- a/src/widgets/util/qscroller.cpp
+++ b/src/widgets/util/qscroller.cpp
@@ -234,7 +234,7 @@ private:
/*!
\class QScroller
\brief The QScroller class enables kinetic scrolling for any scrolling widget or graphics item.
- \since 4.8
+ \since 5.0
\inmodule QtWidgets
diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp
index 8d8d731795..209fb206e1 100644
--- a/src/widgets/util/qsystemtrayicon_win.cpp
+++ b/src/widgets/util/qsystemtrayicon_win.cpp
@@ -166,21 +166,29 @@ extern "C" LRESULT QT_WIN_CALLBACK qWindowsTrayconWndProc(HWND hwnd, UINT messag
}
// Invoke a service of the native Windows interface to create
-// a non-visible message window.
+// a non-visible toplevel window to receive tray messages.
+// Note: Message windows (HWND_MESSAGE) are not sufficient, they
+// will not receive the "TaskbarCreated" message.
static inline HWND createTrayIconMessageWindow()
{
- if (QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface()) {
- void *hwnd = 0;
- void *wndProc = reinterpret_cast<void *>(qWindowsTrayconWndProc);
- if (QMetaObject::invokeMethod(ni, "createMessageWindow", Qt::DirectConnection,
- Q_RETURN_ARG(void *, hwnd),
- Q_ARG(QString, QStringLiteral("QTrayIconMessageWindowClass")),
- Q_ARG(QString, QStringLiteral("QTrayIconMessageWindow")),
- Q_ARG(void *, wndProc)) && hwnd) {
- return reinterpret_cast<HWND>(hwnd);
- }
+ QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface();
+ if (!ni)
+ return 0;
+ // Register window class in the platform plugin.
+ QString className;
+ void *wndProc = reinterpret_cast<void *>(qWindowsTrayconWndProc);
+ if (!QMetaObject::invokeMethod(ni, "registerWindowClass", Qt::DirectConnection,
+ Q_RETURN_ARG(QString, className),
+ Q_ARG(QString, QStringLiteral("QTrayIconMessageWindowClass")),
+ Q_ARG(void *, wndProc))) {
+ return 0;
}
- return 0;
+ const wchar_t windowName[] = L"QTrayIconMessageWindow";
+ return CreateWindowEx(0, (wchar_t*)className.utf16(),
+ windowName, WS_OVERLAPPED,
+ CW_USEDEFAULT, CW_USEDEFAULT,
+ CW_USEDEFAULT, CW_USEDEFAULT,
+ NULL, NULL, (HINSTANCE)GetModuleHandle(0), NULL);
}
QSystemTrayIconSys::QSystemTrayIconSys(HWND hwnd, QSystemTrayIcon *object)
diff --git a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
index 0f28854f5c..1eadb62d5c 100644
--- a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
+++ b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
@@ -85,7 +85,7 @@
developer to provide the autorelease pool.
The following is a snippet of subclassing QMacCocoaViewContainer to wrap a NSSearchField.
- \snippet widgets/mainwindows/macmainwindow/macmainwindow.mm 0
+ \snippet macmainwindow.mm 0
*/
diff --git a/src/widgets/widgets/qmacnativewidget_mac.mm b/src/widgets/widgets/qmacnativewidget_mac.mm
index 27ce9317ba..240bd6d92e 100644
--- a/src/widgets/widgets/qmacnativewidget_mac.mm
+++ b/src/widgets/widgets/qmacnativewidget_mac.mm
@@ -72,10 +72,6 @@
\snippet qmacnativewidget/main.mm 0
- On Carbon, this would do the equivalent:
-
- \snippet qmacnativewidget/main.mm 1
-
Note that QMacNativeWidget requires knowledge of Carbon or Cocoa. All it
does is get the Qt hierarchy into a window not owned by Qt. It is then up
to the programmer to ensure it is placed correctly in the window and
diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp
index 1ad8fe07cd..3711b2f43e 100644
--- a/src/widgets/widgets/qsplashscreen.cpp
+++ b/src/widgets/widgets/qsplashscreen.cpp
@@ -225,7 +225,7 @@ void QSplashScreen::clearMessage()
repaint();
}
-// A copy of QTestLib's qWaitForWindowExposed() and qSleep().
+// A copy of Qt Test's qWaitForWindowExposed() and qSleep().
inline static bool waitForWindowExposed(QWindow *window, int timeout = 1000)
{
enum { TimeOutMs = 10 };
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index b8f7e7e1d4..f033b6544c 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -468,12 +468,16 @@ void QTextEditPrivate::_q_ensureVisible(const QRectF &_rect)
the currentCharFormatChanged() signal is emitted to reflect the new attributes
at the new cursor position.
+ The textChanged() signal is emitted whenever the text changes (as a result
+ of setText() or through the editor itself).
+
QTextEdit holds a QTextDocument object which can be retrieved using the
document() method. You can also set your own document object using setDocument().
- QTextDocument emits a textChanged() signal if the text changes and it also
- provides a isModified() function which will return true if the text has been
- modified since it was either loaded or since the last call to setModified
- with false as argument. In addition it provides methods for undo and redo.
+
+ QTextDocument provides an \l {QTextDocument::isModified()}{isModified()}
+ function which will return true if the text has been modified since it was
+ either loaded or since the last call to setModified with false as argument.
+ In addition it provides methods for undo and redo.
\section2 Drag and Drop