From b67a98afc8cf3d83050e50ea3ece8531c782eb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Thu, 20 Dec 2012 18:09:42 +0100 Subject: Printer support needs user32.lib and gdi32.lib on Windows Task-number: QTBUG-28765 Change-Id: Ia43076e07adee38dfe20f8d25eb223bb6ea6ef51 Reviewed-by: Oswald Buddenhagen --- src/printsupport/kernel/kernel.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/printsupport/kernel/kernel.pri b/src/printsupport/kernel/kernel.pri index 5f14c28616..8bdccd0f5b 100644 --- a/src/printsupport/kernel/kernel.pri +++ b/src/printsupport/kernel/kernel.pri @@ -24,7 +24,7 @@ win32 { $$PWD/qprintengine_win_p.h SOURCES += \ $$PWD/qprintengine_win.cpp - LIBS += -lwinspool -lcomdlg32 + LIBS += -lwinspool -lcomdlg32 -lgdi32 -luser32 } unix:!mac:contains(QT_CONFIG, cups): { -- cgit v1.2.3 From d446a4f26d55ada699f7d3e45a937589c7d1275c Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Thu, 24 Jan 2013 14:43:48 +0100 Subject: Doc: deleted short paragraph referring to non-existing snippet Reference to section 1, which does not exist. Task-number: QTBUG-29101 Change-Id: Ifd5ac58080033ea1d3f0a587f48f9510f24e75b1 Reviewed-by: Jerome Pasion --- src/widgets/widgets/qmacnativewidget_mac.mm | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/widgets/widgets/qmacnativewidget_mac.mm b/src/widgets/widgets/qmacnativewidget_mac.mm index 9bdd2da5c9..884a7ca007 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 -- cgit v1.2.3 From 829ada2129a01b02d7acedefddc5c99582c789f4 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Wed, 23 Jan 2013 14:16:43 +0100 Subject: Doc: added snippet file macmainwindow.mm Corrected path for snippet command Now refers to doc\snippets Removed trailing space Moved macmaindow.mm to src/widgets/doc/snippets Task-number: QTBUG-29101 Change-Id: If60c31909b2f5efad10ac8b735164a80522dcf62 Reviewed-by: Jerome Pasion --- src/widgets/doc/snippets/macmainwindow.mm | 347 ++++++++++++++++++++++ src/widgets/widgets/qmaccocoaviewcontainer_mac.mm | 2 +- 2 files changed, 348 insertions(+), 1 deletion(-) create mode 100755 src/widgets/doc/snippets/macmainwindow.mm (limited to 'src') 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 +#include + + +#ifdef Q_WS_MAC + +#include + +#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(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("





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.
"); + + 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/widgets/qmaccocoaviewcontainer_mac.mm b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm index 6c6953ee5e..ea14cf4c8e 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 */ -- cgit v1.2.3 From 1fbfbf6b6e50a6c2e3ce4eae72709ea53f56c4ab Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Wed, 23 Jan 2013 12:00:08 +0100 Subject: Doc: corrected path used for snippets. Added "../../../" to snippet command in gestures.qdoc Task-number: QTBUG-29101 Change-Id: Ie1d58355f43bcd939f6a178c64ab008b288af747 Reviewed-by: Jerome Pasion --- src/widgets/doc/src/gestures.qdoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/widgets/doc/src/gestures.qdoc b/src/widgets/doc/src/gestures.qdoc index 466274eb48..4d26f965f5 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. -- cgit v1.2.3 From dca90252a785236df9f435b2b5e4cc297345ae7f Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Mon, 14 Jan 2013 14:10:40 +0000 Subject: Prevent GL/gl.h from including system glext.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows us to then use the up-to-date qopenglext.h header on Linux too. Some distro's are not yet shipping OpenGL 4.x compatible headers. This fixes compilation of Qt on CentOS 5.8 and RHEL Change-Id: Ia8022e0aaf215dac7ea2a23dc82c3ac117d9fd53 Reviewed-by: Samuel Rødal --- src/gui/opengl/qopengl.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h index 5928b0be2f..ae02356f81 100644 --- a/src/gui/opengl/qopengl.h +++ b/src/gui/opengl/qopengl.h @@ -95,6 +95,7 @@ typedef GLfloat GLdouble; # if defined(Q_OS_WIN) # include # endif +# define GL_GLEXT_LEGACY // Prevents GL/gl.h form #including system glext.h # include # include # endif // Q_OS_MAC -- cgit v1.2.3 From ff9aa64c99bf04f7e45ee80c6c9fb4e0e69e9511 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Mon, 14 Jan 2013 15:33:24 +0000 Subject: Remove out-dated duplicate logic from qgl.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We now use the updated logic for #including the correct GL headers already implemented in QtGui. This is needed to fix compilation of QtOpenGL on CentOS 5.8 and RHEL. Change-Id: Ifdedd13885566016073538f33aa6daf5902c3497 Reviewed-by: Andy Shaw Reviewed-by: Samuel Rødal --- src/opengl/qgl.h | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'src') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 1d21b42cd5..e2d8bbba16 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -44,6 +44,7 @@ #ifndef QT_NO_OPENGL +#include #include #include #include @@ -54,33 +55,6 @@ QT_BEGIN_HEADER -#if defined(Q_OS_WIN) -# include -#endif - -#if defined(Q_OS_MAC) -# if !defined(Q_OS_IOS) -# include -# else -# if defined(QT_OPENGL_ES_2) -# include -# endif -# endif -#elif defined(QT_OPENGL_ES_2) -# include -# else -# include -# endif - -#if defined(QT_OPENGL_ES_2) -# ifndef GL_DOUBLE -# define GL_DOUBLE GL_FLOAT -# endif -# ifndef GLdouble -typedef GLfloat GLdouble; -# endif -#endif - QT_BEGIN_NAMESPACE -- cgit v1.2.3 From dac925a4d1bc325e2f4fefa25b0b9aa524285332 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Mon, 28 Jan 2013 10:23:08 +0800 Subject: Doc: Fix very minor typo Change-Id: I6af8e81296ef0dc3fcdfd67fae6899bc7c93b206 Reviewed-by: Jerome Pasion --- src/gui/kernel/qevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 33e3b7e1b7..d36204e5ad 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -1752,7 +1752,7 @@ QInputMethodEvent::QInputMethodEvent() } /*! - Construcs an event of type QEvent::InputMethod. The + Constructs an event of type QEvent::InputMethod. The preedit text is set to \a preeditText, the attributes to \a attributes. -- cgit v1.2.3 From 223ba7e66a5220e072f54861881ca85222ddd31b Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Fri, 25 Jan 2013 12:59:25 +0100 Subject: Doc: correct name of file with snippet Snippet not showing because qdoc read wrong snippet file. Due to 2 files having the same name. One was renamed: rsslisting.cpp --> listing.cpp Task-number: QTBUG-29101 Change-Id: I62b7eee6f2860613ee90538d8dea006b89000317 Reviewed-by: Venugopal Shivashankar Reviewed-by: Jerome Pasion --- src/xml/doc/snippets/rsslisting/listing.cpp | 251 +++++++++++++++++++++++++ src/xml/doc/snippets/rsslisting/rsslisting.cpp | 251 ------------------------- src/xml/sax/qxml.cpp | 2 +- 3 files changed, 252 insertions(+), 252 deletions(-) create mode 100644 src/xml/doc/snippets/rsslisting/listing.cpp delete mode 100644 src/xml/doc/snippets/rsslisting/rsslisting.cpp (limited to 'src') diff --git a/src/xml/doc/snippets/rsslisting/listing.cpp b/src/xml/doc/snippets/rsslisting/listing.cpp new file mode 100644 index 0000000000..15a46d4b41 --- /dev/null +++ b/src/xml/doc/snippets/rsslisting/listing.cpp @@ -0,0 +1,251 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* +rsslisting.cpp + +Provides a widget for displaying news items from RDF news sources. +RDF is an XML-based format for storing items of information (see +http://www.w3.org/RDF/ for details). + +The widget itself provides a simple user interface for specifying +the URL of a news source, and controlling the downloading of news. + +The widget downloads and parses the XML asynchronously, feeding the +data to an XML reader in pieces. This allows the user to interrupt +its operation, and also allows very large data sources to be read. +*/ + + +#include +#include +#include +#include + +#include "rsslisting.h" + + +/* + Constructs an RSSListing widget with a simple user interface, and sets + up the XML reader to use a custom handler class. + + The user interface consists of a line edit, two push buttons, and a + list view widget. The line edit is used for entering the URLs of news + sources; the push buttons start and abort the process of reading the + news. +*/ + +RSSListing::RSSListing(QWidget *parent) + : QWidget(parent) +{ + lineEdit = new QLineEdit(this); + + fetchButton = new QPushButton(tr("Fetch"), this); + abortButton = new QPushButton(tr("Abort"), this); + abortButton->setEnabled(false); + + treeWidget = new QTreeWidget(this); + QStringList headerLabels; + headerLabels << tr("Title") << tr("Link"); + treeWidget->setHeaderLabels(headerLabels); + + handler = 0; + + connect(&http, SIGNAL(readyRead(QHttpResponseHeader)), + this, SLOT(readData(QHttpResponseHeader))); + + connect(&http, SIGNAL(requestFinished(int,bool)), + this, SLOT(finished(int,bool))); + + connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(fetch())); + connect(fetchButton, SIGNAL(clicked()), this, SLOT(fetch())); + connect(abortButton, SIGNAL(clicked()), &http, SLOT(abort())); + + QVBoxLayout *layout = new QVBoxLayout(this); + + QHBoxLayout *hboxLayout = new QHBoxLayout; + + hboxLayout->addWidget(lineEdit); + hboxLayout->addWidget(fetchButton); + hboxLayout->addWidget(abortButton); + + layout->addLayout(hboxLayout); + layout->addWidget(treeWidget); + + setWindowTitle(tr("RSS listing example")); +} + +/* + Starts fetching data from a news source specified in the line + edit widget. + + The line edit is made read only to prevent the user from modifying its + contents during the fetch; this is only for cosmetic purposes. + The fetch button is disabled, and the abort button is enabled to allow + the user to interrupt processing. The list view is cleared, and we + define the last list view item to be 0, meaning that there are no + existing items in the list. + + We reset the flag used to determine whether parsing should begin again + or continue. A new handler is created, if required, and made available + to the reader. + + The HTTP handler is supplied with the raw contents of the line edit and + a fetch is initiated. We keep the ID value returned by the HTTP handler + for future reference. +*/ + +void RSSListing::fetch() +{ + lineEdit->setReadOnly(true); + fetchButton->setEnabled(false); + abortButton->setEnabled(true); + treeWidget->clear(); + + lastItemCreated = 0; + + newInformation = true; + + if (handler != 0) + delete handler; + handler = new Handler; + +//! [0] + xmlReader.setContentHandler(handler); + xmlReader.setErrorHandler(handler); +//! [0] + + connect(handler, SIGNAL(newItem(QString&,QString&)), + this, SLOT(addItem(QString&,QString&))); + + QUrl url(lineEdit->text()); + + http.setHost(url.host()); + connectionId = http.get(url.path()); +} + +/* + Reads data received from the RDF source. + + We read all the available data, and pass it to the XML + input source. The first time we receive new information, + the reader is set up for a new incremental parse; + we continue parsing using a different function on + subsequent calls involving the same data source. + + If parsing fails for any reason, we abort the fetch. +*/ + +//! [1] +void RSSListing::readData(const QHttpResponseHeader &resp) +{ + bool ok; + + if (resp.statusCode() != 200) + http.abort(); + else { + xmlInput.setData(http.readAll()); + + if (newInformation) { + ok = xmlReader.parse(&xmlInput, true); + newInformation = false; + } + else + ok = xmlReader.parseContinue(); + + if (!ok) + http.abort(); + } +} +//! [1] + +/* + Finishes processing an HTTP request. + + The default behavior is to keep the text edit read only. + + If an error has occurred, the user interface is made available + to the user for further input, allowing a new fetch to be + started. + + If the HTTP get request has finished, we perform a final + parsing operation on the data returned to ensure that it was + well-formed. Whether this is successful or not, we make the + user interface available to the user for further input. +*/ + +void RSSListing::finished(int id, bool error) +{ + if (error) { + qWarning("Received error during HTTP fetch."); + lineEdit->setReadOnly(false); + abortButton->setEnabled(false); + fetchButton->setEnabled(true); + } + else if (id == connectionId) { + + bool ok = xmlReader.parseContinue(); + if (!ok) + qWarning("Parse error at the end of input."); + + lineEdit->setReadOnly(false); + abortButton->setEnabled(false); + fetchButton->setEnabled(true); + } +} + +/* + Adds an item to the list view as it is reported by the handler. + + We keep a record of the last item created to ensure that the + items are created in sequence. +*/ + +void RSSListing::addItem(QString &title, QString &link) +{ + QTreeWidgetItem *item; + + item = new QTreeWidgetItem(treeWidget, lastItemCreated); + item->setText(0, title); + item->setText(1, link); + + lastItemCreated = item; +} + diff --git a/src/xml/doc/snippets/rsslisting/rsslisting.cpp b/src/xml/doc/snippets/rsslisting/rsslisting.cpp deleted file mode 100644 index 15a46d4b41..0000000000 --- a/src/xml/doc/snippets/rsslisting/rsslisting.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* -rsslisting.cpp - -Provides a widget for displaying news items from RDF news sources. -RDF is an XML-based format for storing items of information (see -http://www.w3.org/RDF/ for details). - -The widget itself provides a simple user interface for specifying -the URL of a news source, and controlling the downloading of news. - -The widget downloads and parses the XML asynchronously, feeding the -data to an XML reader in pieces. This allows the user to interrupt -its operation, and also allows very large data sources to be read. -*/ - - -#include -#include -#include -#include - -#include "rsslisting.h" - - -/* - Constructs an RSSListing widget with a simple user interface, and sets - up the XML reader to use a custom handler class. - - The user interface consists of a line edit, two push buttons, and a - list view widget. The line edit is used for entering the URLs of news - sources; the push buttons start and abort the process of reading the - news. -*/ - -RSSListing::RSSListing(QWidget *parent) - : QWidget(parent) -{ - lineEdit = new QLineEdit(this); - - fetchButton = new QPushButton(tr("Fetch"), this); - abortButton = new QPushButton(tr("Abort"), this); - abortButton->setEnabled(false); - - treeWidget = new QTreeWidget(this); - QStringList headerLabels; - headerLabels << tr("Title") << tr("Link"); - treeWidget->setHeaderLabels(headerLabels); - - handler = 0; - - connect(&http, SIGNAL(readyRead(QHttpResponseHeader)), - this, SLOT(readData(QHttpResponseHeader))); - - connect(&http, SIGNAL(requestFinished(int,bool)), - this, SLOT(finished(int,bool))); - - connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(fetch())); - connect(fetchButton, SIGNAL(clicked()), this, SLOT(fetch())); - connect(abortButton, SIGNAL(clicked()), &http, SLOT(abort())); - - QVBoxLayout *layout = new QVBoxLayout(this); - - QHBoxLayout *hboxLayout = new QHBoxLayout; - - hboxLayout->addWidget(lineEdit); - hboxLayout->addWidget(fetchButton); - hboxLayout->addWidget(abortButton); - - layout->addLayout(hboxLayout); - layout->addWidget(treeWidget); - - setWindowTitle(tr("RSS listing example")); -} - -/* - Starts fetching data from a news source specified in the line - edit widget. - - The line edit is made read only to prevent the user from modifying its - contents during the fetch; this is only for cosmetic purposes. - The fetch button is disabled, and the abort button is enabled to allow - the user to interrupt processing. The list view is cleared, and we - define the last list view item to be 0, meaning that there are no - existing items in the list. - - We reset the flag used to determine whether parsing should begin again - or continue. A new handler is created, if required, and made available - to the reader. - - The HTTP handler is supplied with the raw contents of the line edit and - a fetch is initiated. We keep the ID value returned by the HTTP handler - for future reference. -*/ - -void RSSListing::fetch() -{ - lineEdit->setReadOnly(true); - fetchButton->setEnabled(false); - abortButton->setEnabled(true); - treeWidget->clear(); - - lastItemCreated = 0; - - newInformation = true; - - if (handler != 0) - delete handler; - handler = new Handler; - -//! [0] - xmlReader.setContentHandler(handler); - xmlReader.setErrorHandler(handler); -//! [0] - - connect(handler, SIGNAL(newItem(QString&,QString&)), - this, SLOT(addItem(QString&,QString&))); - - QUrl url(lineEdit->text()); - - http.setHost(url.host()); - connectionId = http.get(url.path()); -} - -/* - Reads data received from the RDF source. - - We read all the available data, and pass it to the XML - input source. The first time we receive new information, - the reader is set up for a new incremental parse; - we continue parsing using a different function on - subsequent calls involving the same data source. - - If parsing fails for any reason, we abort the fetch. -*/ - -//! [1] -void RSSListing::readData(const QHttpResponseHeader &resp) -{ - bool ok; - - if (resp.statusCode() != 200) - http.abort(); - else { - xmlInput.setData(http.readAll()); - - if (newInformation) { - ok = xmlReader.parse(&xmlInput, true); - newInformation = false; - } - else - ok = xmlReader.parseContinue(); - - if (!ok) - http.abort(); - } -} -//! [1] - -/* - Finishes processing an HTTP request. - - The default behavior is to keep the text edit read only. - - If an error has occurred, the user interface is made available - to the user for further input, allowing a new fetch to be - started. - - If the HTTP get request has finished, we perform a final - parsing operation on the data returned to ensure that it was - well-formed. Whether this is successful or not, we make the - user interface available to the user for further input. -*/ - -void RSSListing::finished(int id, bool error) -{ - if (error) { - qWarning("Received error during HTTP fetch."); - lineEdit->setReadOnly(false); - abortButton->setEnabled(false); - fetchButton->setEnabled(true); - } - else if (id == connectionId) { - - bool ok = xmlReader.parseContinue(); - if (!ok) - qWarning("Parse error at the end of input."); - - lineEdit->setReadOnly(false); - abortButton->setEnabled(false); - fetchButton->setEnabled(true); - } -} - -/* - Adds an item to the list view as it is reported by the handler. - - We keep a record of the last item created to ensure that the - items are created in sequence. -*/ - -void RSSListing::addItem(QString &title, QString &link) -{ - QTreeWidgetItem *item; - - item = new QTreeWidgetItem(treeWidget, lastItemCreated); - item->setText(0, title); - item->setText(1, link); - - lastItemCreated = item; -} - diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index ee40f9d753..3ed792418e 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -2365,7 +2365,7 @@ events are reported. it we can use the same handler for both of the following reader functions: - \snippet rsslisting/rsslisting.cpp 0 + \snippet rsslisting/listing.cpp 0 Since the reader will inform the handler of parsing errors, it is necessary to reimplement QXmlErrorHandler::fatalError() if, for -- cgit v1.2.3 From 22550ed78d454353c4f0f5e6b5f7dee4a6943ade Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sun, 27 Jan 2013 13:43:23 +0800 Subject: Doc: Fix broken \keyword link Fix 19 counts of "Can't link to 'default-constructed value'" warnings. There was only one link to "default-constructed values", so the cleanest solution was to change the keyword. Also included a related typo fix. Change-Id: I84b47743ecb72a1b2731ef65080fa1e630d478a4 Reviewed-by: Laszlo Papp Reviewed-by: Jerome Pasion --- src/corelib/doc/src/containers.qdoc | 2 +- src/corelib/kernel/qvariant.cpp | 2 +- src/corelib/tools/qpair.qdoc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/doc/src/containers.qdoc b/src/corelib/doc/src/containers.qdoc index 9f63eb0a7e..30d86eac63 100644 --- a/src/corelib/doc/src/containers.qdoc +++ b/src/corelib/doc/src/containers.qdoc @@ -221,7 +221,7 @@ \codeline \snippet streaming/main.cpp 2 - \keyword default-constructed values + \keyword default-constructed value The documentation of certain container class functions refer to \e{default-constructed values}; for example, QVector diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 60ab5506a4..d70d8d9a68 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -2958,7 +2958,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p) Returns the stored value converted to the template type \c{T}. Call canConvert() to find out whether a type can be converted. - If the value cannot be converted, \l{default-constructed value} + If the value cannot be converted, a \l{default-constructed value} will be returned. If the type \c{T} is supported by QVariant, this function behaves diff --git a/src/corelib/tools/qpair.qdoc b/src/corelib/tools/qpair.qdoc index a79486115d..55353dc258 100644 --- a/src/corelib/tools/qpair.qdoc +++ b/src/corelib/tools/qpair.qdoc @@ -84,7 +84,7 @@ /*! \fn QPair::QPair() Constructs an empty pair. The \c first and \c second elements are - initialized with \l{default-constructed values}. + initialized with \l{default-constructed value}s. */ /*! -- cgit v1.2.3 From e778042ed7dc5c12aeea0dfcd5401bc9d002dc53 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Mon, 28 Jan 2013 11:17:55 +0800 Subject: Doc, Qt GUI: Fix "no \inmodule command" warnings Explicitly add "\inmodule QtGui" to Qt GUI classes Change-Id: Id641c1dc98770fbd994cecc375ca46c01f083236 Reviewed-by: Friedemann Kleint Reviewed-by: Jerome Pasion --- src/gui/image/qpicture.cpp | 1 + src/gui/image/qpictureformatplugin.cpp | 1 + src/gui/kernel/qevent.cpp | 5 +++++ src/gui/kernel/qgenericplugin.cpp | 1 + src/gui/kernel/qgenericpluginfactory.cpp | 1 + src/gui/kernel/qplatformsystemtrayicon_qpa.cpp | 1 + src/gui/painting/qpaintdevice.qdoc | 1 + src/gui/painting/qpaintengine_raster.cpp | 1 + 8 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp index bfc31930dd..f6de22851d 100644 --- a/src/gui/image/qpicture.cpp +++ b/src/gui/image/qpicture.cpp @@ -1278,6 +1278,7 @@ QList QPicture::outputFormats() \ingroup painting \ingroup io + \inmodule QtGui QPictureIO contains a QIODevice object that is used for picture data I/O. The programmer can install new picture file formats in addition diff --git a/src/gui/image/qpictureformatplugin.cpp b/src/gui/image/qpictureformatplugin.cpp index bef72595ad..29d6912201 100644 --- a/src/gui/image/qpictureformatplugin.cpp +++ b/src/gui/image/qpictureformatplugin.cpp @@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE for custom picture format plugins. \ingroup plugins + \inmodule QtGui The picture format plugin is a simple plugin interface that makes it easy to create custom picture formats that can be used diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index d36204e5ad..e9527bdc48 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -58,6 +58,7 @@ QT_BEGIN_NAMESPACE /*! \class QEnterEvent \ingroup events + \inmodule QtGui \brief The QEnterEvent class contains parameters that describe an enter event. @@ -144,6 +145,7 @@ QInputEvent::~QInputEvent() /*! \class QMouseEvent \ingroup events + \inmodule QtGui \brief The QMouseEvent class contains parameters that describe a mouse event. @@ -412,6 +414,7 @@ QMouseEvent::~QMouseEvent() /*! \class QHoverEvent \ingroup events + \inmodule QtGui \brief The QHoverEvent class contains parameters that describe a mouse event. @@ -797,6 +800,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos, \brief The QKeyEvent class describes a key event. \ingroup events + \inmodule QtGui Key events are sent to the widget with keyboard input focus when keys are pressed or released. @@ -1728,6 +1732,7 @@ QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos) /*! \class QInputMethodEvent::Attribute + \inmodule QtGui \brief The QInputMethodEvent::Attribute class stores an input method attribute. */ diff --git a/src/gui/kernel/qgenericplugin.cpp b/src/gui/kernel/qgenericplugin.cpp index c3301a4e34..98709804de 100644 --- a/src/gui/kernel/qgenericplugin.cpp +++ b/src/gui/kernel/qgenericplugin.cpp @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE /*! \class QGenericPlugin \ingroup plugins + \inmodule QtGui \brief The QGenericPlugin class is an abstract base class for plugins. diff --git a/src/gui/kernel/qgenericpluginfactory.cpp b/src/gui/kernel/qgenericpluginfactory.cpp index cecaf060ce..8e3b45d1a8 100644 --- a/src/gui/kernel/qgenericpluginfactory.cpp +++ b/src/gui/kernel/qgenericpluginfactory.cpp @@ -61,6 +61,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, /*! \class QGenericPluginFactory \ingroup plugins + \inmodule QtGui \brief The QGenericPluginFactory class creates plugin drivers. diff --git a/src/gui/kernel/qplatformsystemtrayicon_qpa.cpp b/src/gui/kernel/qplatformsystemtrayicon_qpa.cpp index 0976bf320d..13de2c658a 100644 --- a/src/gui/kernel/qplatformsystemtrayicon_qpa.cpp +++ b/src/gui/kernel/qplatformsystemtrayicon_qpa.cpp @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE /*! \class QPlatformSystemTrayIcon + \inmodule QtGui \brief The QPlatformSystemTrayIcon class abstracts the system tray icon and interaction. \sa QSystemTray diff --git a/src/gui/painting/qpaintdevice.qdoc b/src/gui/painting/qpaintdevice.qdoc index 5582f777a5..7397dc7fc2 100644 --- a/src/gui/painting/qpaintdevice.qdoc +++ b/src/gui/painting/qpaintdevice.qdoc @@ -31,6 +31,7 @@ can be painted on with QPainter. \ingroup painting + \inmodule QtGui A paint device is an abstraction of a two-dimensional space that can be drawn on using a QPainter. Its default coordinate system has diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index f6a749f979..aaa0a4b87e 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -296,6 +296,7 @@ QRasterPaintEnginePrivate::QRasterPaintEnginePrivate() : \class QRasterPaintEngine \preliminary \ingroup qws + \inmodule QtGui \since 4.2 \brief The QRasterPaintEngine class enables hardware acceleration -- cgit v1.2.3 From f262815f2ef147113780312a410eccdf4b318a82 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Sat, 26 Jan 2013 13:39:56 +0100 Subject: Fix some more old references and links to Nokia Task-number: QTBUG-28156 Change-Id: I9ba0d6f1e92103219bec1e61e716b6b2f269a8ad Reviewed-by: Laszlo Papp Reviewed-by: Jerome Pasion --- src/corelib/doc/snippets/code/src_corelib_io_qurl.cpp | 8 ++++---- src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp | 10 +++++----- src/corelib/doc/snippets/qxmlstreamwriter/main.cpp | 4 ++-- src/corelib/doc/src/eventsandfilters.qdoc | 2 +- src/corelib/global/qnamespace.qdoc | 2 +- src/corelib/io/qurl.cpp | 2 +- src/gui/image/qpixmapcache.cpp | 2 +- .../snippets/code/src_network_access_qnetworkaccessmanager.cpp | 4 ++-- .../doc/snippets/code/src_network_access_qnetworkdiskcache.cpp | 4 ++-- src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp | 6 +++--- src/widgets/dialogs/qwizard.cpp | 2 +- src/widgets/doc/src/modelview.qdoc | 2 +- src/widgets/doc/src/widgets-and-layouts/layout.qdoc | 2 +- src/widgets/kernel/qlayoutitem.cpp | 2 +- src/xml/doc/snippets/code/src_xml_dom_qdom.cpp | 8 ++++---- 15 files changed, 30 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qurl.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qurl.cpp index 432b0b9167..ca178e03a0 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qurl.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qurl.cpp @@ -45,7 +45,7 @@ QUrl url("http://www.example.com/List of holidays.xml"); //! [1] -QUrl url = QUrl::fromEncoded("http://qt.nokia.com/List%20of%20holidays.xml"); +QUrl url = QUrl::fromEncoded("http://qt-project.org/List%20of%20holidays.xml"); //! [1] @@ -73,10 +73,10 @@ http://www.example.com/cgi-bin/drawgraph.cgi?type(pie)color(green) //! [5] -QUrl baseUrl("http://qt.nokia.com/support"); -QUrl relativeUrl("../products/solutions"); +QUrl baseUrl("http://qt.digia.com/Support/"); +QUrl relativeUrl("../Product/Library/"); qDebug(baseUrl.resolved(relativeUrl).toString()); -// prints "http://qt.nokia.com/products/solutions" +// prints "http://qt.digia.com/Product/Library/" //! [5] diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp index eef026af75..759c31c098 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp @@ -258,7 +258,7 @@ if (url.startsWith("ftp:")) //! [26] -QByteArray url("http://qt.nokia.com/index.html"); +QByteArray url("http://qt-project.org/doc/qt-5.0/qtdoc/index.html"); if (url.endsWith(".html")) ... //! [26] @@ -286,16 +286,16 @@ QByteArray z = x.mid(5); // z == "pineapples" //! [30] -QByteArray x("Qt by NOKIA"); +QByteArray x("Qt by DIGIA"); QByteArray y = x.toLower(); -// y == "qt by nokia" +// y == "qt by digia" //! [30] //! [31] -QByteArray x("Qt by NOKIA"); +QByteArray x("Qt by DIGIA"); QByteArray y = x.toUpper(); -// y == "QT BY NOKIA" +// y == "QT BY DIGIA" //! [31] diff --git a/src/corelib/doc/snippets/qxmlstreamwriter/main.cpp b/src/corelib/doc/snippets/qxmlstreamwriter/main.cpp index 2a436f1a4c..5af3596171 100644 --- a/src/corelib/doc/snippets/qxmlstreamwriter/main.cpp +++ b/src/corelib/doc/snippets/qxmlstreamwriter/main.cpp @@ -61,8 +61,8 @@ int main(int argc, char *argv[]) stream.writeAttribute("folded", "no"); //! [write element] stream.writeStartElement("bookmark"); - stream.writeAttribute("href", "http://qt.nokia.com/"); - stream.writeTextElement("title", "Qt Home"); + stream.writeAttribute("href", "http://qt-project.org/"); + stream.writeTextElement("title", "Qt Project"); stream.writeEndElement(); // bookmark //! [write element] stream.writeEndElement(); // folder diff --git a/src/corelib/doc/src/eventsandfilters.qdoc b/src/corelib/doc/src/eventsandfilters.qdoc index 6986309c42..22a6d240dc 100644 --- a/src/corelib/doc/src/eventsandfilters.qdoc +++ b/src/corelib/doc/src/eventsandfilters.qdoc @@ -100,7 +100,7 @@ event delivery mechanisms are flexible. The documentation for QCoreApplication::notify() concisely tells the whole story; the \e{Qt Quarterly} article - \l{http://doc.qt.nokia.com/qq/qq11-events.html}{Another Look at Events} + \l{http://doc.qt.digia.com/qq/qq11-events.html}{Another Look at Events} rehashes it less concisely. Here we will explain enough for 95% of applications. diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 0b0d089ba5..448451fc12 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2492,7 +2492,7 @@ "\l{http://bugreports.qt-project.org/browse/QTWEBSITE-13}{http://bugreports.qt.../QTWEBSITE-13/}"), whereas Qt::ElideRight is appropriate for other strings (e.g., - "\l{http://qt.nokia.com/doc/qq/qq09-mac-deployment.html}{Deploying Applications on Ma...}"). + "\l{http://doc.qt.digia.com/qq/qq09-mac-deployment.html}{Deploying Applications on Ma...}"). \sa QAbstractItemView::textElideMode, QFontMetrics::elidedText(), AlignmentFlag, QTabBar::elideMode */ diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 2a439b3a7c..38eb0ed1e3 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -3861,7 +3861,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \section1 Examples: \list - \li qt.nokia.com becomes http://qt.nokia.com + \li qt-project.org becomes http://qt-project.org \li ftp.qt-project.org becomes ftp://ftp.qt-project.org \li hostname becomes http://hostname \li /home/user/test.html becomes file:///home/user/test.html diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index c9560fd816..f996d032b8 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE memory. The \e{Qt Quarterly} article - \l{http://qt.nokia.com/doc/qq/qq12-qpixmapcache.html}{Optimizing + \l{http://doc.qt.digia.com/qq/qq12-qpixmapcache.html}{Optimizing with QPixmapCache} explains how to use QPixmapCache to speed up applications by caching the results of painting. diff --git a/src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp b/src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp index 7424f4d4b5..6569b90b14 100644 --- a/src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp +++ b/src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp @@ -43,13 +43,13 @@ QNetworkAccessManager *manager = new QNetworkAccessManager(this); connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*))); -manager->get(QNetworkRequest(QUrl("http://qt.nokia.com"))); +manager->get(QNetworkRequest(QUrl("http://qt-project.org"))); //! [0] //! [1] QNetworkRequest request; -request.setUrl(QUrl("http://qt.nokia.com")); +request.setUrl(QUrl("http://qt-project.org")); request.setRawHeader("User-Agent", "MyOwnBrowser 1.0"); QNetworkReply *reply = manager->get(request); diff --git a/src/network/doc/snippets/code/src_network_access_qnetworkdiskcache.cpp b/src/network/doc/snippets/code/src_network_access_qnetworkdiskcache.cpp index bd7a744ac1..51524b2b52 100644 --- a/src/network/doc/snippets/code/src_network_access_qnetworkdiskcache.cpp +++ b/src/network/doc/snippets/code/src_network_access_qnetworkdiskcache.cpp @@ -47,11 +47,11 @@ manager->setCache(diskCache); //! [1] // do a normal request (preferred from network, as this is the default) -QNetworkRequest request(QUrl(QString("http://qt.nokia.com"))); +QNetworkRequest request(QUrl(QString("http://qt-project.org"))); manager->get(request); // do a request preferred from cache -QNetworkRequest request2(QUrl(QString("http://qt.nokia.com"))); +QNetworkRequest request2(QUrl(QString("http://qt-project.org"))); request2.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); manager->get(request2); //! [1] diff --git a/src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp b/src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp index f329da66ef..f45b232a91 100644 --- a/src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp +++ b/src/network/doc/snippets/code/src_network_kernel_qhostinfo.cpp @@ -39,8 +39,8 @@ ****************************************************************************/ //! [0] -// To find the IP address of qt.nokia.com -QHostInfo::lookupHost("qt.nokia.com", +// To find the IP address of qt-project.org +QHostInfo::lookupHost("qt-project.org", this, SLOT(printResults(QHostInfo))); // To find the host name for 4.2.2.1 @@ -50,7 +50,7 @@ QHostInfo::lookupHost("4.2.2.1", //! [1] -QHostInfo info = QHostInfo::fromName("qt.nokia.com"); +QHostInfo info = QHostInfo::fromName("qt-project.org"); //! [1] diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index 241e9f678a..4f5898ed88 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -3573,7 +3573,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/src/modelview.qdoc b/src/widgets/doc/src/modelview.qdoc index 304af0058d..96f978f9d4 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 7b88a3a63d..911974fbce 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/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp index 7de3f47c5b..cea11243ee 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/xml/doc/snippets/code/src_xml_dom_qdom.cpp b/src/xml/doc/snippets/code/src_xml_dom_qdom.cpp index 480de0daee..76eb24e8bf 100644 --- a/src/xml/doc/snippets/code/src_xml_dom_qdom.cpp +++ b/src/xml/doc/snippets/code/src_xml_dom_qdom.cpp @@ -108,7 +108,7 @@ QDomElement element4 = document.createElement("MyElement"); //! [7] - + //! [7] @@ -116,10 +116,10 @@ QDomElement element4 = document.createElement("MyElement"); QDomElement e = //... //... QDomAttr a = e.attributeNode("href"); -cout << a.value() << endl; // prints "http://qt.nokia.com" -a.setValue("http://qt.nokia.com/doc"); // change the node's attribute +cout << a.value() << endl; // prints "http://qt-project.org" +a.setValue("http://qt-project.org/doc"); // change the node's attribute QDomAttr a2 = e.attributeNode("href"); -cout << a2.value() << endl; // prints "http://qt.nokia.com/doc" +cout << a2.value() << endl; // prints "http://qt-project.org/doc" //! [8] -- cgit v1.2.3 From 747348f4556440aa21c0c8aeb76cbd71da49d007 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Thu, 24 Jan 2013 14:59:55 +0100 Subject: Doc: Fixing snippets and input file for a Qt Core article. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -copied snippet and input files from Qt Widgets. -adapted new paths in the resource-system.qdoc file. -removed the old path entry in qdocconf. Task-number: QTBUG-29101 Change-Id: Ieeb118106756a1a39890ab219294de18f437c56c Reviewed-by: Topi Reiniö Reviewed-by: Nico Vertriest Reviewed-by: Geir Vattekar --- src/corelib/doc/qtcore.qdocconf | 3 +- .../doc/snippets/resource-system/application.pro | 14 + .../doc/snippets/resource-system/application.qrc | 10 + .../doc/snippets/resource-system/mainwindow.cpp | 392 +++++++++++++++++++++ src/corelib/doc/src/resource-system.qdoc | 6 +- 5 files changed, 420 insertions(+), 5 deletions(-) create mode 100644 src/corelib/doc/snippets/resource-system/application.pro create mode 100644 src/corelib/doc/snippets/resource-system/application.qrc create mode 100644 src/corelib/doc/snippets/resource-system/mainwindow.cpp (limited to 'src') diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index cb87530f54..dc239ccf6f 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -36,7 +36,6 @@ exampledirs += \ ../ \ snippets \ ../../../examples/threads/ \ - ../../../examples/tools/ \ - ../../../examples/widgets/ + ../../../examples/tools/ imagedirs += images diff --git a/src/corelib/doc/snippets/resource-system/application.pro b/src/corelib/doc/snippets/resource-system/application.pro new file mode 100644 index 0000000000..652cc73485 --- /dev/null +++ b/src/corelib/doc/snippets/resource-system/application.pro @@ -0,0 +1,14 @@ +QT += widgets + +HEADERS = mainwindow.h +SOURCES = main.cpp \ + mainwindow.cpp +#! [0] +RESOURCES = application.qrc +#! [0] + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/application +INSTALLS += target + +simulator: warning(This example might not fully work on Simulator platform) diff --git a/src/corelib/doc/snippets/resource-system/application.qrc b/src/corelib/doc/snippets/resource-system/application.qrc new file mode 100644 index 0000000000..0a776fab4d --- /dev/null +++ b/src/corelib/doc/snippets/resource-system/application.qrc @@ -0,0 +1,10 @@ + + + images/copy.png + images/cut.png + images/new.png + images/open.png + images/paste.png + images/save.png + + diff --git a/src/corelib/doc/snippets/resource-system/mainwindow.cpp b/src/corelib/doc/snippets/resource-system/mainwindow.cpp new file mode 100644 index 0000000000..8bdd0303de --- /dev/null +++ b/src/corelib/doc/snippets/resource-system/mainwindow.cpp @@ -0,0 +1,392 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [0] +#include + +#include "mainwindow.h" +//! [0] + +//! [1] +MainWindow::MainWindow() +//! [1] //! [2] +{ + textEdit = new QPlainTextEdit; + setCentralWidget(textEdit); + + createActions(); + createMenus(); + createToolBars(); + createStatusBar(); + + readSettings(); + + connect(textEdit->document(), SIGNAL(contentsChanged()), + this, SLOT(documentWasModified())); + + setCurrentFile(""); + setUnifiedTitleAndToolBarOnMac(true); +} +//! [2] + +//! [3] +void MainWindow::closeEvent(QCloseEvent *event) +//! [3] //! [4] +{ + if (maybeSave()) { + writeSettings(); + event->accept(); + } else { + event->ignore(); + } +} +//! [4] + +//! [5] +void MainWindow::newFile() +//! [5] //! [6] +{ + if (maybeSave()) { + textEdit->clear(); + setCurrentFile(""); + } +} +//! [6] + +//! [7] +void MainWindow::open() +//! [7] //! [8] +{ + if (maybeSave()) { + QString fileName = QFileDialog::getOpenFileName(this); + if (!fileName.isEmpty()) + loadFile(fileName); + } +} +//! [8] + +//! [9] +bool MainWindow::save() +//! [9] //! [10] +{ + if (curFile.isEmpty()) { + return saveAs(); + } else { + return saveFile(curFile); + } +} +//! [10] + +//! [11] +bool MainWindow::saveAs() +//! [11] //! [12] +{ + QString fileName = QFileDialog::getSaveFileName(this); + if (fileName.isEmpty()) + return false; + + return saveFile(fileName); +} +//! [12] + +//! [13] +void MainWindow::about() +//! [13] //! [14] +{ + QMessageBox::about(this, tr("About Application"), + tr("The Application example demonstrates how to " + "write modern GUI applications using Qt, with a menu bar, " + "toolbars, and a status bar.")); +} +//! [14] + +//! [15] +void MainWindow::documentWasModified() +//! [15] //! [16] +{ + setWindowModified(textEdit->document()->isModified()); +} +//! [16] + +//! [17] +void MainWindow::createActions() +//! [17] //! [18] +{ + newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this); + newAct->setShortcuts(QKeySequence::New); + newAct->setStatusTip(tr("Create a new file")); + connect(newAct, SIGNAL(triggered()), this, SLOT(newFile())); + +//! [19] + openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this); + openAct->setShortcuts(QKeySequence::Open); + openAct->setStatusTip(tr("Open an existing file")); + connect(openAct, SIGNAL(triggered()), this, SLOT(open())); +//! [18] //! [19] + + saveAct = new QAction(QIcon(":/images/save.png"), tr("&Save"), this); + saveAct->setShortcuts(QKeySequence::Save); + saveAct->setStatusTip(tr("Save the document to disk")); + connect(saveAct, SIGNAL(triggered()), this, SLOT(save())); + + saveAsAct = new QAction(tr("Save &As..."), this); + saveAsAct->setShortcuts(QKeySequence::SaveAs); + saveAsAct->setStatusTip(tr("Save the document under a new name")); + connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs())); + +//! [20] + exitAct = new QAction(tr("E&xit"), this); + exitAct->setShortcuts(QKeySequence::Quit); +//! [20] + exitAct->setStatusTip(tr("Exit the application")); + connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); + +//! [21] + cutAct = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this); +//! [21] + cutAct->setShortcuts(QKeySequence::Cut); + cutAct->setStatusTip(tr("Cut the current selection's contents to the " + "clipboard")); + connect(cutAct, SIGNAL(triggered()), textEdit, SLOT(cut())); + + copyAct = new QAction(QIcon(":/images/copy.png"), tr("&Copy"), this); + copyAct->setShortcuts(QKeySequence::Copy); + copyAct->setStatusTip(tr("Copy the current selection's contents to the " + "clipboard")); + connect(copyAct, SIGNAL(triggered()), textEdit, SLOT(copy())); + + pasteAct = new QAction(QIcon(":/images/paste.png"), tr("&Paste"), this); + pasteAct->setShortcuts(QKeySequence::Paste); + pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current " + "selection")); + connect(pasteAct, SIGNAL(triggered()), textEdit, SLOT(paste())); + + aboutAct = new QAction(tr("&About"), this); + aboutAct->setStatusTip(tr("Show the application's About box")); + connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); + +//! [22] + aboutQtAct = new QAction(tr("About &Qt"), this); + aboutQtAct->setStatusTip(tr("Show the Qt library's About box")); + connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt())); +//! [22] + +//! [23] + cutAct->setEnabled(false); +//! [23] //! [24] + copyAct->setEnabled(false); + connect(textEdit, SIGNAL(copyAvailable(bool)), + cutAct, SLOT(setEnabled(bool))); + connect(textEdit, SIGNAL(copyAvailable(bool)), + copyAct, SLOT(setEnabled(bool))); +} +//! [24] + +//! [25] //! [26] +void MainWindow::createMenus() +//! [25] //! [27] +{ + fileMenu = menuBar()->addMenu(tr("&File")); + fileMenu->addAction(newAct); +//! [28] + fileMenu->addAction(openAct); +//! [28] + fileMenu->addAction(saveAct); +//! [26] + fileMenu->addAction(saveAsAct); + fileMenu->addSeparator(); + fileMenu->addAction(exitAct); + + editMenu = menuBar()->addMenu(tr("&Edit")); + editMenu->addAction(cutAct); + editMenu->addAction(copyAct); + editMenu->addAction(pasteAct); + + menuBar()->addSeparator(); + + helpMenu = menuBar()->addMenu(tr("&Help")); + helpMenu->addAction(aboutAct); + helpMenu->addAction(aboutQtAct); +} +//! [27] + +//! [29] //! [30] +void MainWindow::createToolBars() +{ + fileToolBar = addToolBar(tr("File")); + fileToolBar->addAction(newAct); +//! [29] //! [31] + fileToolBar->addAction(openAct); +//! [31] + fileToolBar->addAction(saveAct); + + editToolBar = addToolBar(tr("Edit")); + editToolBar->addAction(cutAct); + editToolBar->addAction(copyAct); + editToolBar->addAction(pasteAct); +} +//! [30] + +//! [32] +void MainWindow::createStatusBar() +//! [32] //! [33] +{ + statusBar()->showMessage(tr("Ready")); +} +//! [33] + +//! [34] //! [35] +void MainWindow::readSettings() +//! [34] //! [36] +{ + QSettings settings("QtProject", "Application Example"); + QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); + QSize size = settings.value("size", QSize(400, 400)).toSize(); + resize(size); + move(pos); +} +//! [35] //! [36] + +//! [37] //! [38] +void MainWindow::writeSettings() +//! [37] //! [39] +{ + QSettings settings("QtProject", "Application Example"); + settings.setValue("pos", pos()); + settings.setValue("size", size()); +} +//! [38] //! [39] + +//! [40] +bool MainWindow::maybeSave() +//! [40] //! [41] +{ + if (textEdit->document()->isModified()) { + QMessageBox::StandardButton ret; + ret = QMessageBox::warning(this, tr("Application"), + tr("The document has been modified.\n" + "Do you want to save your changes?"), + QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel); + if (ret == QMessageBox::Save) + return save(); + else if (ret == QMessageBox::Cancel) + return false; + } + return true; +} +//! [41] + +//! [42] +void MainWindow::loadFile(const QString &fileName) +//! [42] //! [43] +{ + QFile file(fileName); + if (!file.open(QFile::ReadOnly | QFile::Text)) { + QMessageBox::warning(this, tr("Application"), + tr("Cannot read file %1:\n%2.") + .arg(fileName) + .arg(file.errorString())); + return; + } + + QTextStream in(&file); +#ifndef QT_NO_CURSOR + QApplication::setOverrideCursor(Qt::WaitCursor); +#endif + textEdit->setPlainText(in.readAll()); +#ifndef QT_NO_CURSOR + QApplication::restoreOverrideCursor(); +#endif + + setCurrentFile(fileName); + statusBar()->showMessage(tr("File loaded"), 2000); +} +//! [43] + +//! [44] +bool MainWindow::saveFile(const QString &fileName) +//! [44] //! [45] +{ + QFile file(fileName); + if (!file.open(QFile::WriteOnly | QFile::Text)) { + QMessageBox::warning(this, tr("Application"), + tr("Cannot write file %1:\n%2.") + .arg(fileName) + .arg(file.errorString())); + return false; + } + + QTextStream out(&file); +#ifndef QT_NO_CURSOR + QApplication::setOverrideCursor(Qt::WaitCursor); +#endif + out << textEdit->toPlainText(); +#ifndef QT_NO_CURSOR + QApplication::restoreOverrideCursor(); +#endif + + setCurrentFile(fileName); + statusBar()->showMessage(tr("File saved"), 2000); + return true; +} +//! [45] + +//! [46] +void MainWindow::setCurrentFile(const QString &fileName) +//! [46] //! [47] +{ + curFile = fileName; + textEdit->document()->setModified(false); + setWindowModified(false); + + QString shownName = curFile; + if (curFile.isEmpty()) + shownName = "untitled.txt"; + setWindowFilePath(shownName); +} +//! [47] + +//! [48] +QString MainWindow::strippedName(const QString &fullFileName) +//! [48] //! [49] +{ + return QFileInfo(fullFileName).fileName(); +} +//! [49] diff --git a/src/corelib/doc/src/resource-system.qdoc b/src/corelib/doc/src/resource-system.qdoc index 18a6759d53..1dec196d21 100644 --- a/src/corelib/doc/src/resource-system.qdoc +++ b/src/corelib/doc/src/resource-system.qdoc @@ -50,7 +50,7 @@ Here's an example \c .qrc file: - \quotefile mainwindows/application/application.qrc + \quotefile resource-system/application.qrc The resource files listed in the \c .qrc file are files that are part of the application's source tree. The specified paths are @@ -122,7 +122,7 @@ mentioned in the application's \c .pro file so that \c qmake knows about it. For example: - \snippet mainwindows/application/application.pro 0 + \snippet resource-system/application.pro 0 \c qmake will produce make rules to generate a file called \c qrc_application.cpp that is linked into the application. This @@ -167,7 +167,7 @@ pass a resource path instead of a file name to the QIcon, QImage, or QPixmap constructor: - \snippet mainwindows/application/mainwindow.cpp 21 + \snippet resource-system/mainwindow.cpp 21 See the \l{mainwindows/application}{Application} example for an actual application that uses Qt's resource system to store its -- cgit v1.2.3 From 9ef48277f959ff759bd9fba36c907ef5ed67f5b1 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Sun, 27 Jan 2013 14:03:16 +0100 Subject: don't prematurely reduce LIBS when adding sql link lists It's possible that different database libraries share dependencies. We need to keep their link lists intact here so that QtSql's .prl and .pc files will have them in the right order. Particularly important when building the drivers into QtSql and using static linking. Change-Id: Id371b127099f2790fe7cccd0c7059607600f447d Reviewed-by: Oswald Buddenhagen --- src/sql/drivers/mysql/qsql_mysql.pri | 2 +- src/sql/drivers/psql/qsql_psql.pri | 2 +- src/sql/drivers/sqlite/qsql_sqlite.pri | 2 +- src/sql/drivers/tds/qsql_tds.pri | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/sql/drivers/mysql/qsql_mysql.pri b/src/sql/drivers/mysql/qsql_mysql.pri index c9ec2575fa..0423eb4ed9 100644 --- a/src/sql/drivers/mysql/qsql_mysql.pri +++ b/src/sql/drivers/mysql/qsql_mysql.pri @@ -13,7 +13,7 @@ unix { else:LIBS += -lmysqlclient } } else { - LIBS *= $$QT_LFLAGS_MYSQL + LIBS += $$QT_LFLAGS_MYSQL QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL } } else { diff --git a/src/sql/drivers/psql/qsql_psql.pri b/src/sql/drivers/psql/qsql_psql.pri index 6da3540104..9b647d8200 100644 --- a/src/sql/drivers/psql/qsql_psql.pri +++ b/src/sql/drivers/psql/qsql_psql.pri @@ -2,7 +2,7 @@ HEADERS += $$PWD/qsql_psql.h SOURCES += $$PWD/qsql_psql.cpp unix|win32-g++* { - LIBS *= $$QT_LFLAGS_PSQL + LIBS += $$QT_LFLAGS_PSQL !contains(LIBS, .*pq.*):LIBS += -lpq QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL } else { diff --git a/src/sql/drivers/sqlite/qsql_sqlite.pri b/src/sql/drivers/sqlite/qsql_sqlite.pri index 7ad5936e25..a2e80d4c74 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.pri +++ b/src/sql/drivers/sqlite/qsql_sqlite.pri @@ -4,6 +4,6 @@ SOURCES += $$PWD/qsql_sqlite.cpp !system-sqlite:!contains(LIBS, .*sqlite3.*) { include($$PWD/../../../3rdparty/sqlite.pri) } else { - LIBS *= $$QT_LFLAGS_SQLITE + LIBS += $$QT_LFLAGS_SQLITE QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE } diff --git a/src/sql/drivers/tds/qsql_tds.pri b/src/sql/drivers/tds/qsql_tds.pri index 3b5a6895c9..38aab2f3e4 100644 --- a/src/sql/drivers/tds/qsql_tds.pri +++ b/src/sql/drivers/tds/qsql_tds.pri @@ -2,7 +2,7 @@ HEADERS += $$PWD/qsql_tds.h SOURCES += $$PWD/qsql_tds.cpp unix|win32-g++*: { - LIBS *= $$QT_LFLAGS_TDS + LIBS += $$QT_LFLAGS_TDS !contains(LIBS, .*sybdb.*):LIBS += -lsybdb QMAKE_CXXFLAGS *= $$QT_CFLAGS_TDS } else { -- cgit v1.2.3 From 5f71203dd0129de76220f7a3198111a0d2186667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 3 Jan 2013 09:38:10 +0100 Subject: Cocoa: export setDockMenu Change-Id: I1eb35c34427660d2662f310a3e8c4e5ba42e08eb Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoanativeinterface.h | 4 ++++ src/plugins/platforms/cocoa/qcocoanativeinterface.mm | 13 +++++++++++++ 2 files changed, 17 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.h b/src/plugins/platforms/cocoa/qcocoanativeinterface.h index 34e8fb61e2..592ede4617 100644 --- a/src/plugins/platforms/cocoa/qcocoanativeinterface.h +++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.h @@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE class QWidget; class QPlatformPrinterSupport; class QPrintEngine; +class QPlatformMenu; class QCocoaNativeInterface : public QPlatformNativeInterface { @@ -92,6 +93,9 @@ private: static void addToMimeList(void *macPasteboardMime); static void removeFromMimeList(void *macPasteboardMime); static void registerDraggedTypes(const QStringList &types); + + // Dock menu support + static void setDockMenu(QPlatformMenu *platformMenu); }; #endif // QCOCOANATIVEINTERFACE_H diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm index 08084b5200..14bb82bc7e 100644 --- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm +++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm @@ -42,6 +42,7 @@ #include "qcocoanativeinterface.h" #include "qcocoaglcontext.h" #include "qcocoawindow.h" +#include "qcocoamenu.h" #include "qcocoamenubar.h" #include "qmacmime.h" @@ -60,6 +61,8 @@ #include #endif +#include + QT_BEGIN_NAMESPACE QCocoaNativeInterface::QCocoaNativeInterface() @@ -103,6 +106,8 @@ QPlatformNativeInterface::NativeResourceForIntegrationFunction QCocoaNativeInter return NativeResourceForIntegrationFunction(QCocoaNativeInterface::removeFromMimeList); if (resource.toLower() == "registerdraggedtypes") return NativeResourceForIntegrationFunction(QCocoaNativeInterface::registerDraggedTypes); + if (resource.toLower() == "setdockmenu") + return NativeResourceForIntegrationFunction(QCocoaNativeInterface::setDockMenu); return 0; } @@ -170,4 +175,12 @@ void QCocoaNativeInterface::registerDraggedTypes(const QStringList &types) qt_mac_registerDraggedTypes(types); } +void QCocoaNativeInterface::setDockMenu(QPlatformMenu *platformMenu) +{ + QCocoaMenu *cocoaPlatformMenu = static_cast(platformMenu); + NSMenu *menu = cocoaPlatformMenu->nsMenu(); + // setDockMenu seems to be undocumented, but this is what Qt 4 did. + [NSApp setDockMenu: menu]; +} + QT_END_NAMESPACE -- cgit v1.2.3 From 03e8824211ebc75ec48d1eaf3c4962ff926575f9 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Sat, 26 Jan 2013 11:53:27 +0100 Subject: testlib: Remove old 'Partner Directory' external link This reference was removed by dc0d5bf387a0b440c74b9e822c46b09e20e00720 Change-Id: I941dbd24815caf7f2f33e757215815d9ca4e581c Reviewed-by: Venugopal Shivashankar Reviewed-by: Jerome Pasion --- src/testlib/doc/src/qt-webpages.qdoc | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/testlib/doc/src/qt-webpages.qdoc b/src/testlib/doc/src/qt-webpages.qdoc index 452af99368..e945ea7f17 100644 --- a/src/testlib/doc/src/qt-webpages.qdoc +++ b/src/testlib/doc/src/qt-webpages.qdoc @@ -36,7 +36,3 @@ \externalpage http://qt.gitorious.org/qt-labs/qtestlib-tools \title qtestlib-tools */ -/*! - \externalpage http://qt.nokia.com/services-partners/partners/partner-directory - \title Partner Directory -*/ -- cgit v1.2.3 From f4065db172f11b751af03c04a21bd0b4097d1779 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Jan 2013 16:52:34 +0100 Subject: fix overquoting of GNUPATH Task-number: QTBUG-28841 Change-Id: Ifa62a273acefc240953633bbd099384a635f29c6 Reviewed-by: Friedemann Kleint Reviewed-by: Joerg Bornemann --- src/angle/src/config.pri | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/angle/src/config.pri b/src/angle/src/config.pri index 6ba2cbdf7a..4e52358205 100644 --- a/src/angle/src/config.pri +++ b/src/angle/src/config.pri @@ -15,7 +15,8 @@ isEmpty(ANGLE_DIR) { win32 { GNUTOOLS_DIR=$$PWD/../../../../gnuwin32/bin exists($$GNUTOOLS_DIR/gperf.exe) { - GNUTOOLS = "(set $$escape_expand(\\\")PATH=$$replace(GNUTOOLS_DIR, [/\\\\], $${QMAKE_DIR_SEP});%PATH%$$escape_expand(\\\"))" + # Escape closing parens when expanding the variable, otherwise cmd confuses itself. + GNUTOOLS = "(set PATH=$$replace(GNUTOOLS_DIR, [/\\\\], $${QMAKE_DIR_SEP});%PATH:)=^)%)" } } -- cgit v1.2.3 From 7bb43454b83ab0f055248b80defe0b985e59ed64 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sun, 27 Jan 2013 12:58:38 +0800 Subject: Fix minor typos in docs, printed messages & comments Missing apostrophes Change-Id: I3ef5e9d494fb7a37f8e6075f24cd3a274e572c23 Reviewed-by: Jerome Pasion --- src/corelib/kernel/qmetaobject_moc_p.h | 2 +- src/gui/itemmodels/qstandarditemmodel.cpp | 2 +- src/gui/kernel/qopenglcontext.cpp | 4 ++-- src/network/socket/qlocalsocket_unix.cpp | 2 +- src/plugins/platforms/cocoa/qmacclipboard.mm | 2 +- src/plugins/platforms/cocoa/qnsview.mm | 2 +- src/plugins/platforms/cocoa/qprintengine_mac.mm | 2 +- src/plugins/platforms/openwfd/qopenwfdport.cpp | 2 +- src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp | 2 +- src/widgets/graphicsview/qgraphicsscene.cpp | 2 +- src/widgets/graphicsview/qgraphicswidget_p.cpp | 2 +- src/widgets/itemviews/qtreewidget.cpp | 8 ++++---- src/xml/dom/qdom.cpp | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qmetaobject_moc_p.h b/src/corelib/kernel/qmetaobject_moc_p.h index 70b9d80f2d..c791f017d4 100644 --- a/src/corelib/kernel/qmetaobject_moc_p.h +++ b/src/corelib/kernel/qmetaobject_moc_p.h @@ -71,7 +71,7 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc break; } /* - We musn't convert 'char * const *' into 'const char **' + We mustn't convert 'char * const *' into 'const char **' and we must beware of 'Bar'. */ if (t[i] == '&' || t[i] == '*' ||t[i] == '<') diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp index 3a6c0804ab..d6161671b1 100644 --- a/src/gui/itemmodels/qstandarditemmodel.cpp +++ b/src/gui/itemmodels/qstandarditemmodel.cpp @@ -1470,7 +1470,7 @@ void QStandardItem::insertRow(int row, const QList &items) } /*! - Inserts \a items at \a row. The column count wont be changed. + Inserts \a items at \a row. The column count won't be changed. \sa insertRow(), insertColumn() */ diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index bf3de0de8d..645c13a2ea 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -165,7 +165,7 @@ QOpenGLContext *QOpenGLContextPrivate::setCurrentContext(QOpenGLContext *context QGuiGLThreadContext *threadContext = qwindow_context_storage.localData(); if (!threadContext) { if (!QThread::currentThread()) { - qWarning("No QTLS available. currentContext wont work"); + qWarning("No QTLS available. currentContext won't work"); return 0; } threadContext = new QGuiGLThreadContext; @@ -667,7 +667,7 @@ QScreen *QOpenGLContext::screen() const } /*! - internal: Needs to have a pointer to qGLContext. But since this is in Qt GUI we cant + internal: Needs to have a pointer to qGLContext. But since this is in Qt GUI we can't have any type information. \internal diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp index 49eb71a20e..e846e43e73 100644 --- a/src/network/socket/qlocalsocket_unix.cpp +++ b/src/network/socket/qlocalsocket_unix.cpp @@ -248,7 +248,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode) QLatin1String("QLocalSocket::connectToServer")); return; } - // set non blocking so we can try to connect and it wont wait + // set non blocking so we can try to connect and it won't wait int flags = fcntl(d->connectingSocket, F_GETFL, 0); if (-1 == flags || -1 == (fcntl(d->connectingSocket, F_SETFL, flags | O_NONBLOCK))) { diff --git a/src/plugins/platforms/cocoa/qmacclipboard.mm b/src/plugins/platforms/cocoa/qmacclipboard.mm index 6fcf4d5746..95143fd8ea 100644 --- a/src/plugins/platforms/cocoa/qmacclipboard.mm +++ b/src/plugins/platforms/cocoa/qmacclipboard.mm @@ -135,7 +135,7 @@ OSStatus QMacPasteboard::promiseKeeper(PasteboardRef paste, PasteboardItemID id, } if (!promise.itemId && flavorAsQString == QLatin1String("com.trolltech.qt.MimeTypeName")) { - // we have promised this data, but wont be able to convert, so return null data. + // we have promised this data, but won't be able to convert, so return null data. // This helps in making the application/x-qt-mime-type-name hidden from normal use. QByteArray ba; QCFType data = CFDataCreate(0, (UInt8*)ba.constData(), ba.size()); diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index b822061feb..da3e6277c6 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -1025,7 +1025,7 @@ static QTouchDevice *touchDevice = 0; - (NSUInteger)characterIndexForPoint:(NSPoint)aPoint { - // We dont support cursor movements using mouse while composing. + // We don't support cursor movements using mouse while composing. Q_UNUSED(aPoint); return NSNotFound; } diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm index a5382c5ef6..54019372bc 100644 --- a/src/plugins/platforms/cocoa/qprintengine_mac.mm +++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm @@ -109,7 +109,7 @@ bool QMacPrintEngine::end() if (d->state == QPrinter::Aborted) return true; // I was just here a function call ago :) if (d->paintEngine->type() == QPaintEngine::CoreGraphics) { - // We dont need the paint engine to call restoreGraphicsState() + // We don't need the paint engine to call restoreGraphicsState() static_cast(d->paintEngine)->d_func()->stackCount = 0; static_cast(d->paintEngine)->d_func()->hd = 0; } diff --git a/src/plugins/platforms/openwfd/qopenwfdport.cpp b/src/plugins/platforms/openwfd/qopenwfdport.cpp index 72137b91bc..14b499f7cf 100644 --- a/src/plugins/platforms/openwfd/qopenwfdport.cpp +++ b/src/plugins/platforms/openwfd/qopenwfdport.cpp @@ -125,7 +125,7 @@ void QOpenWFDPort::attach() } if (mPipeline == WFD_INVALID_HANDLE) { - qWarning("Failed to create pipeline and cant bind it to port"); + qWarning("Failed to create pipeline and can't bind it to port"); } WFDint geomerty[] = { 0, 0, mPixelSize.width(), mPixelSize.height() }; diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp index 94008bf868..406dc636b8 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp @@ -247,7 +247,7 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName, value = fontCache.value(faceName); - //Fallback if we havent cached the font yet or the font got removed/renamed iterate again over all fonts + //Fallback if we haven't cached the font yet or the font got removed/renamed iterate again over all fonts if (value.isEmpty() || !QFile::exists(value)) { QSettings settings(QSettings::SystemScope, QStringLiteral("Qt-Project"), QStringLiteral("Qtbase")); settings.beginGroup(QStringLiteral("CEFontCache")); diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index 8ef9f58964..a9c045ea80 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -6212,7 +6212,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 be3c122198..e97ec90cd0 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/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 &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 &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/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 6b0fbd4baf..c37172a187 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -261,7 +261,7 @@ public: /** * If true, then the node will redirect insert/remove calls * to its parent by calling QDomNodePrivate::appendChild or removeChild. - * In addition the map wont increase or decrease the reference count + * In addition the map won't increase or decrease the reference count * of the nodes it contains. * * By default this value is false and the map will handle reference counting -- cgit v1.2.3 From f0c8e63e5bbd5d5265478a8740cc7f0d587bfdb9 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 28 Jan 2013 16:50:59 +0100 Subject: Fix documented signature for QtMessageHandler Task-number: QTBUG-29352 Change-Id: I46190a59cd73e53e778551a2d33c6b2801e9587e Reviewed-by: Thiago Macieira --- src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp index a3a458fbc7..62ce04a6f8 100644 --- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp @@ -535,7 +535,7 @@ CApaApplication *myApplicationFactory(); //! [49] -void myMessageHandler(QtMsgType, const QMessageLogContext &, const char *); +void myMessageHandler(QtMsgType, const QMessageLogContext &, const QString &); //! [49] //! [50] -- cgit v1.2.3 From e02ecba61f3a271c4f2559c82904c4b8d3b03e61 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 28 Jan 2013 15:48:25 +0000 Subject: Delay initialization of QQnxRootWindow until first access. QtWebProcess, for example, doesn't create any QWindow, so it doesn't need any root window. This fixes Webkit2 rendering on QNX. Change-Id: I1d4c0dd20869798ba2bcd15f9d96e5fca4beb48e Reviewed-by: Sean Harmer --- src/plugins/platforms/qnx/qqnxrootwindow.cpp | 2 +- src/plugins/platforms/qnx/qqnxrootwindow.h | 4 ++-- src/plugins/platforms/qnx/qqnxscreen.cpp | 30 ++++++++++++++++------------ src/plugins/platforms/qnx/qqnxscreen.h | 8 ++++---- 4 files changed, 24 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxrootwindow.cpp b/src/plugins/platforms/qnx/qqnxrootwindow.cpp index ee05e00394..b01d468647 100644 --- a/src/plugins/platforms/qnx/qqnxrootwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxrootwindow.cpp @@ -57,7 +57,7 @@ static const int MAGIC_ZORDER_FOR_NO_NAV = 10; -QQnxRootWindow::QQnxRootWindow(QQnxScreen *screen) +QQnxRootWindow::QQnxRootWindow(const QQnxScreen *screen) : m_screen(screen), m_window(0), m_windowGroupName() diff --git a/src/plugins/platforms/qnx/qqnxrootwindow.h b/src/plugins/platforms/qnx/qqnxrootwindow.h index f9f1dc0810..aae1563c95 100644 --- a/src/plugins/platforms/qnx/qqnxrootwindow.h +++ b/src/plugins/platforms/qnx/qqnxrootwindow.h @@ -54,7 +54,7 @@ class QQnxScreen; class QQnxRootWindow { public: - QQnxRootWindow(QQnxScreen *screen); + QQnxRootWindow(const QQnxScreen *screen); ~QQnxRootWindow(); screen_window_t nativeHandle() const { return m_window; } @@ -71,7 +71,7 @@ public: private: void createWindowGroup(); - QQnxScreen *m_screen; + const QQnxScreen *m_screen; screen_window_t m_window; QByteArray m_windowGroupName; }; diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index 8b413de4fb..1e58f047ab 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -106,7 +106,6 @@ static QSize determineScreenSize(screen_display_t display, bool primaryScreen) { QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, bool primaryScreen) : m_screenContext(screenContext), m_display(display), - m_rootWindow(), m_primaryScreen(primaryScreen), m_posted(false), m_keyboardHeight(0), @@ -145,10 +144,6 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, m_currentPhysicalSize = m_initialPhysicalSize = screenSize; else m_currentPhysicalSize = m_initialPhysicalSize = screenSize.transposed(); - - // We only create the root window if we are the primary display. - if (primaryScreen) - m_rootWindow = QSharedPointer(new QQnxRootWindow(this)); } QQnxScreen::~QQnxScreen() @@ -248,8 +243,8 @@ void QQnxScreen::setRotation(int rotation) // Check if rotation changed if (m_currentRotation != rotation) { // Update rotation of root window - if (m_rootWindow) - m_rootWindow->setRotation(rotation); + if (rootWindow()) + rootWindow()->setRotation(rotation); const QRect previousScreenGeometry = geometry(); @@ -265,16 +260,16 @@ void QQnxScreen::setRotation(int rotation) // Resize root window if we've rotated 90 or 270 from previous orientation if (isOrthogonal(m_currentRotation, rotation)) { qScreenDebug() << Q_FUNC_INFO << "resize, size =" << m_currentGeometry.size(); - if (m_rootWindow) - m_rootWindow->resize(m_currentGeometry.size()); + if (rootWindow()) + rootWindow()->resize(m_currentGeometry.size()); if (m_primaryScreen) resizeWindows(previousScreenGeometry); } else { // TODO: Find one global place to flush display updates // Force immediate display update if no geometry changes required - if (m_rootWindow) - m_rootWindow->flush(); + if (rootWindow()) + rootWindow()->flush(); } // Save new rotation @@ -491,8 +486,8 @@ void QQnxScreen::onWindowPost(QQnxWindow *window) // post app window (so navigator will show it) after first child window // has posted; this only needs to happen once as the app window's content // never changes - if (!m_posted && m_rootWindow) { - m_rootWindow->post(); + if (!m_posted && rootWindow()) { + rootWindow()->post(); m_posted = true; } } @@ -573,4 +568,13 @@ void QQnxScreen::deactivateWindowGroup(const QByteArray &id) QWindowSystemInterface::handleWindowActivated(0); } +QSharedPointer QQnxScreen::rootWindow() const +{ + // We only create the root window if we are the primary display. + if (m_primaryScreen && !m_rootWindow) + m_rootWindow = QSharedPointer(new QQnxRootWindow(this)); + + return m_rootWindow; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h index be09eca1f8..2851c13c52 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.h +++ b/src/plugins/platforms/qnx/qqnxscreen.h @@ -80,7 +80,7 @@ public: int nativeFormat() const { return (depth() == 32) ? SCREEN_FORMAT_RGBA8888 : SCREEN_FORMAT_RGB565; } screen_display_t nativeDisplay() const { return m_display; } screen_context_t nativeContext() const { return m_screenContext; } - const char *windowGroupName() const { return m_rootWindow->groupName().constData(); } + const char *windowGroupName() const { return rootWindow()->groupName().constData(); } QQnxWindow *findWindow(screen_window_t windowHandle); @@ -93,7 +93,7 @@ public: void onWindowPost(QQnxWindow *window); - QSharedPointer rootWindow() const { return m_rootWindow; } + QSharedPointer rootWindow() const; public Q_SLOTS: void setRotation(int rotation); @@ -114,8 +114,8 @@ private: screen_context_t m_screenContext; screen_display_t m_display; - QSharedPointer m_rootWindow; - bool m_primaryScreen; + mutable QSharedPointer m_rootWindow; + const bool m_primaryScreen; bool m_posted; int m_initialRotation; -- cgit v1.2.3 From d48534302c903113be25a61184b4c9dfb7060df4 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 5 Jan 2013 23:50:35 +0800 Subject: Doc: Fix description about Qt::UniqueConnection Qt::UniqueConnection is a flag, not a standalone connection type. Change-Id: Ibafb7306f3d60753a4381897488131e6484d368f Reviewed-by: Thiago Macieira --- src/corelib/global/qnamespace.qdoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index f157190591..02342599a2 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -523,11 +523,11 @@ application to deadlock. \value UniqueConnection - Same as AutoConnection, but the connection is made only if - it does not duplicate an existing connection. i.e., if the - same signal is already connected to the same slot for the - same pair of objects, then the connection will fail. This - connection type was introduced in Qt 4.6. + This is a flag that can be combined with any one of the above + connection types, using a bitwise OR. When Qt::UniqueConnection is + set, QObject::connect() will fail if the connection already exists + (i.e. if the same signal is already connected to the same slot + for the same pair of objects). This flag was introduced in Qt 4.6. With queued connections, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the -- cgit v1.2.3 From 8995453263721507a4c923b905f50f800010d9ad Mon Sep 17 00:00:00 2001 From: Poul Sysolyatin Date: Mon, 21 Jan 2013 13:48:21 +0700 Subject: Added 'jpeg' to QImageReader::supportedImageFormats() When Qt build statically result of QImageReader::supportedImageFormats() must contain 'jpeg' and 'jpg' if JPEG support enabled. Task-number: QTBUG-29222 Change-Id: I94d731c2d1e2ede148e2e5261a310a840a1d5523 Reviewed-by: Gunnar Sletta --- src/gui/image/qimagereader.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 71408ecd23..a6e15ede11 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -162,6 +162,7 @@ enum _qt_BuiltInFormatType { #endif #ifndef QT_NO_IMAGEFORMAT_JPEG _qt_JpgFormat, + _qt_JpegFormat, #endif #ifdef QT_BUILTIN_GIF_READER _qt_GifFormat, @@ -194,6 +195,7 @@ static const _qt_BuiltInFormatStruct _qt_BuiltInFormats[] = { #endif #ifndef QT_NO_IMAGEFORMAT_JPEG {_qt_JpgFormat, "jpg"}, + {_qt_JpegFormat, "jpeg"}, #endif #ifdef QT_BUILTIN_GIF_READER {_qt_GifFormat, "gif"}, @@ -422,6 +424,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, #endif #ifndef QT_NO_IMAGEFORMAT_JPEG case _qt_JpgFormat: + case _qt_JpegFormat: if (QJpegHandler::canRead(device)) handler = new QJpegHandler; break; -- cgit v1.2.3 From 9d432881804edc3f680de610e40b669f97df6f9b Mon Sep 17 00:00:00 2001 From: Poul Sysolyatin Date: Mon, 21 Jan 2013 14:00:07 +0700 Subject: Exclude BMP from supported formats if it disabled by Qt build If Qt build without BMP support, we need exclude this format from output of QImageWriter::supportedImageFormats() and QImageReader::supportedImageFormats() methods. Task-number: QTBUG-27028 Change-Id: I44e8956247066c0836b1ff7bf9a1f356fe568af1 Reviewed-by: Gunnar Sletta --- src/gui/image/qimagereader.cpp | 4 ++++ src/gui/image/qimagewriter.cpp | 2 ++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index a6e15ede11..5eaf7bb8f2 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -167,7 +167,9 @@ enum _qt_BuiltInFormatType { #ifdef QT_BUILTIN_GIF_READER _qt_GifFormat, #endif +#ifndef QT_NO_IMAGEFORMAT_BMP _qt_BmpFormat, +#endif #ifndef QT_NO_IMAGEFORMAT_PPM _qt_PpmFormat, _qt_PgmFormat, @@ -200,7 +202,9 @@ static const _qt_BuiltInFormatStruct _qt_BuiltInFormats[] = { #ifdef QT_BUILTIN_GIF_READER {_qt_GifFormat, "gif"}, #endif +#ifndef QT_NO_IMAGEFORMAT_BMP {_qt_BmpFormat, "bmp"}, +#endif #ifndef QT_NO_IMAGEFORMAT_PPM {_qt_PpmFormat, "ppm"}, {_qt_PgmFormat, "pgm"}, diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp index 8e0f3fdcf0..20e601be03 100644 --- a/src/gui/image/qimagewriter.cpp +++ b/src/gui/image/qimagewriter.cpp @@ -708,7 +708,9 @@ void supportedImageHandlerFormats(QFactoryLoader *loader, QList QImageWriter::supportedImageFormats() { QSet formats; +#ifndef QT_NO_IMAGEFORMAT_BMP formats << "bmp"; +#endif #ifndef QT_NO_IMAGEFORMAT_PPM formats << "pbm" << "pgm" << "ppm"; #endif -- cgit v1.2.3 From 2aef22b77aa15eb0863a9585af77ccab04425dbd Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 10 Dec 2012 11:19:52 +0100 Subject: Mac: make windows not restorable on 10.7 and later MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default value for NSWindow::setRestorable: is true, it means application will have some information for each window stored. After a crash happened and application relaunched, the application tries to restore those windows from the broken file. And then the "Retore Windows" will pop up. There is no workaround for application users or develoeprs. What they can do is to manually remove the the saved application state file for the applicaiton. To avoid that, better to switch it off. Task-number: QTBUG-28281 Change-Id: I8ce3cd94f5ae81d7877a346743ca4e0e188baa02 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoawindow.mm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 551e51bfa9..463c065c9a 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -710,6 +710,11 @@ NSWindow * QCocoaWindow::createNSWindow() createdWindow = window; } +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if ([createdWindow respondsToSelector:@selector(setRestorable:)]) + [createdWindow setRestorable: NO]; +#endif + NSInteger level = windowLevel(flags); [createdWindow setLevel:level]; m_windowModality = window()->modality(); -- cgit v1.2.3 From 70d38f078e2bd853508d073ea88b59b3a857a83a Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 18 Dec 2012 10:32:08 +0100 Subject: Mac: Ensure the native filedialog sets file name when saving MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The name field string was not set in native dialog when one was present. Task-number: QTBUG-28342 Change-Id: I243b491c8bc094d45f25be96b3bde8eccbb65acd Reviewed-by: Andy Shaw Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 7992461032..61646041fb 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -250,6 +250,7 @@ static QString strippedText(QString s) [mSavePanel setDirectoryURL:selectable ? [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath())] : [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.path())]]; + [mSavePanel setNameFieldStringValue:selectable ? QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.fileName()) : nil]; // Call processEvents in case the event dispatcher has been interrupted, and needs to do // cleanup of modal sessions. Do this before showing the native dialog, otherwise it will @@ -275,6 +276,7 @@ static QString strippedText(QString s) [mSavePanel setDirectoryURL:selectable ? [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath())] : [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.path())]]; + [mSavePanel setNameFieldStringValue:selectable ? QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.fileName()) : nil]; NSWindow *nsparent = static_cast(qGuiApp->platformNativeInterface()->nativeResourceForWindow("nswindow", parent)); [mSavePanel beginSheetModalForWindow:nsparent completionHandler:^(NSInteger result){ -- cgit v1.2.3 From 52a317092eb7693c83c4917282283ea53fecd220 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Wed, 23 Jan 2013 19:39:47 +0800 Subject: Doc: Fix references to Qt Test QtTestLib and QTestLib don't exist. The proper name is "QtTest" (code) or "Qt Test" (English) http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation http://lists.qt-project.org/pipermail/interest/2012-December/005221.html Files paths in qttestlib.qdocconf can't be changed easily however, as it breaks things. So, they're left as they are. Change-Id: Ifbc44ea858c453bedad8cd7723f847e67fc7a85a Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira Reviewed-by: Jerome Pasion --- src/corelib/kernel/qobject_p.h | 2 +- src/testlib/doc/qttestlib.qdocconf | 4 ++-- src/testlib/doc/src/qttest-index.qdoc | 2 +- src/testlib/qbenchmark.cpp | 2 +- src/testlib/qbenchmark.h | 2 +- src/testlib/qtestcase.cpp | 4 ++-- src/widgets/kernel/qapplication.cpp | 2 +- src/widgets/widgets/qsplashscreen.cpp | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index d8bc87d13e..e4b4ce8b42 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -69,7 +69,7 @@ class QThreadData; class QObjectConnectionListVector; namespace QtSharedPointer { struct ExternalRefCountData; } -/* for QtTestLib */ +/* for Qt Test */ struct QSignalSpyCallbackSet { typedef void (*BeginCallback)(QObject *caller, int signal_or_method_index, void **argv); diff --git a/src/testlib/doc/qttestlib.qdocconf b/src/testlib/doc/qttestlib.qdocconf index 2a2a1e4ea0..3785bd6503 100644 --- a/src/testlib/doc/qttestlib.qdocconf +++ b/src/testlib/doc/qttestlib.qdocconf @@ -15,8 +15,8 @@ qhp.QtTestLib.virtualFolder = qttest qhp.QtTestLib.indexTitle = Qt Test qhp.QtTestLib.indexRoot = -qhp.QtTestLib.filterAttributes = qttestlib 5.0.1 qtrefdoc -qhp.QtTestLib.customFilters.Qt.name = QtTestLib 5.0.1 +qhp.QtTestLib.filterAttributes = qttest 5.0.1 qtrefdoc +qhp.QtTestLib.customFilters.Qt.name = QtTest 5.0.1 qhp.QtTestLib.customFilters.Qt.filterAttributes = qttest 5.0.1 qhp.QtTestLib.subprojects = classes diff --git a/src/testlib/doc/src/qttest-index.qdoc b/src/testlib/doc/src/qttest-index.qdoc index fb0b639847..db42db1687 100644 --- a/src/testlib/doc/src/qttest-index.qdoc +++ b/src/testlib/doc/src/qttest-index.qdoc @@ -25,7 +25,7 @@ ** ****************************************************************************/ /*! - \page qttestlib-index.html + \page qttest-index.html \title Qt Test \brief Provides classes for unit testing Qt applications and libraries. diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp index 450dce46ab..796d817ae2 100644 --- a/src/testlib/qbenchmark.cpp +++ b/src/testlib/qbenchmark.cpp @@ -266,7 +266,7 @@ quint64 QTest::endBenchmarkMeasurement() Sets the benchmark result for this test function to \a result. Use this function if you want to report benchmark results without - using the QBENCHMARK macro. Use \a metric to specify how QTestLib + using the QBENCHMARK macro. Use \a metric to specify how Qt Test should interpret the results. The context for the result will be the test function name and any diff --git a/src/testlib/qbenchmark.h b/src/testlib/qbenchmark.h index 942e8f69fd..f166955249 100644 --- a/src/testlib/qbenchmark.h +++ b/src/testlib/qbenchmark.h @@ -58,7 +58,7 @@ namespace QTest // ------------- // // The QBenchmarkIterationController class is not a part of the -// QTestlib API. It exists purely as an implementation detail. +// Qt Test API. It exists purely as an implementation detail. // // class Q_TESTLIB_EXPORT QBenchmarkIterationController diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 951631ba33..987c5d88b2 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1837,7 +1837,7 @@ char *toHexRepresentation(const char *ba, int length) * running out of memory and flooding things when the byte array * is large. * - * maxLen can't be for example 200 because QTestLib is sprinkled with fixed + * maxLen can't be for example 200 because Qt Test is sprinkled with fixed * size char arrays. * */ const int maxLen = 50; @@ -2037,7 +2037,7 @@ FatalSignalHandler::~FatalSignalHandler() are executed if they exist. See \l{Creating a Test} for more details. Optionally, the command line arguments \a argc and \a argv can be provided. - For a list of recognized arguments, read \l {QTestLib Command Line Arguments}. + For a list of recognized arguments, read \l {Qt Test Command Line Arguments}. The following example will run all tests in \c MyTestObject: 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/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 }; -- cgit v1.2.3 From 393fcf69dc9efc5f990fc37e2205112ae4620562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 4 Jan 2013 11:11:49 +0100 Subject: Cocoa: prevent scale factor value of 0. Check that the NSWindow pointer is valid before calling backingScaleFactor. Change-Id: Ia23cbb4058b7d0fece008bc437f8bfec6c0ddebe Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoabackingstore.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm index fd0f4529cc..7f022da4c3 100644 --- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm +++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm @@ -67,7 +67,7 @@ QPaintDevice *QCocoaBackingStore::paintDevice() #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { QCocoaWindow *cocoaWindow = static_cast(window()->handle()); - if (cocoaWindow && cocoaWindow->m_contentView) { + if (cocoaWindow && cocoaWindow->m_contentView && [cocoaWindow->m_contentView window]) { scaleFactor = int([[cocoaWindow->m_contentView window] backingScaleFactor]); } } -- cgit v1.2.3 From 5b3ebdc26f551eec26a30c567f785343452695c2 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 7 Jan 2013 16:33:32 +0100 Subject: fix angle sub-target name Change-Id: I4dc374f96d492f75aee3724eadbd95626fa7a6d7 Reviewed-by: Friedemann Kleint Reviewed-by: Joerg Bornemann --- src/src.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/src.pro b/src/src.pro index 1ce31eed47..525c9c8855 100644 --- a/src/src.pro +++ b/src/src.pro @@ -36,7 +36,7 @@ src_testlib.target = sub-testlib src_testlib.depends = src_corelib # src_gui & src_widgets are not build-depends src_angle.subdir = $$PWD/angle -src_angle.target = src_angle +src_angle.target = sub-angle src_gui.subdir = $$PWD/gui src_gui.target = sub-gui -- cgit v1.2.3 From 2be4d6ba022e1349b1b231ae852235f557c6fc20 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Tue, 29 Jan 2013 21:51:31 +0100 Subject: fix path adjustments in installed metafiles Task-number: QTBUG-28902 Change-Id: Ia70da8f0f0b7abb4ea2a46cb4068c0827888b322 Reviewed-by: Oswald Buddenhagen --- src/winmain/winmain.pro | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro index 32eae0b9fe..b8c920b8e6 100644 --- a/src/winmain/winmain.pro +++ b/src/winmain/winmain.pro @@ -25,3 +25,9 @@ TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end load(qt_targets) wince*:QMAKE_POST_LINK = + +unix|win32-g++* { + lib_replace.match = $$[QT_INSTALL_LIBS/get] + lib_replace.replace = $$[QT_INSTALL_LIBS/raw] + QMAKE_PRL_INSTALL_REPLACE += lib_replace +} -- cgit v1.2.3 From 38f740e4de9a313fd33984bd54834c56dc2316c4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 30 Jan 2013 10:05:55 +0100 Subject: Windows tray icon: Fix reinstalling after restart of Explorer. Use a normal instead of a HWND_MESSAGE-window since the latter do not receive the "TaskbarCreated" message. Provide an invokable slot in the native interface to register a window class for that purpose. Task-number: QTBUG-29160 Change-Id: Ic25222d08d21867f7d882a9e19d8aaf50f3f47cf Reviewed-by: Joerg Bornemann --- .../platforms/windows/qwindowsintegration.cpp | 12 ++++++++ src/widgets/util/qsystemtrayicon_win.cpp | 32 ++++++++++++++-------- 2 files changed, 32 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index aac28c36dc..4473b6b8a4 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -107,6 +107,9 @@ public: Q_INVOKABLE void *createMessageWindow(const QString &classNameTemplate, const QString &windowName, void *eventProc) const; + + Q_INVOKABLE QString registerWindowClass(const QString &classNameIn, void *eventProc) const; + bool asyncExpose() const; void setAsyncExpose(bool value); }; @@ -186,6 +189,15 @@ void *QWindowsNativeInterface::createMessageWindow(const QString &classNameTempl return hwnd; } +/*! + \brief Registers a unique window class with a callback function based on \a classNameIn. +*/ + +QString QWindowsNativeInterface::registerWindowClass(const QString &classNameIn, void *eventProc) const +{ + return QWindowsContext::instance()->registerWindowClass(classNameIn, (WNDPROC)eventProc); +} + bool QWindowsNativeInterface::asyncExpose() const { return QWindowsContext::instance()->asyncExpose(); 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(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); - } + QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface(); + if (!ni) + return 0; + // Register window class in the platform plugin. + QString className; + void *wndProc = reinterpret_cast(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) -- cgit v1.2.3 From 539a024819a5f696b8afe899108b409f2b77549c Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Thu, 31 Jan 2013 07:02:27 +1000 Subject: update ofono API Task-number: QTBUG-29381 Change-Id: I952b73d86b4e8f497b4ff90d10c1f5312882bd8a Reviewed-by: Thiago Macieira --- src/plugins/bearer/connman/qofonoservice_linux.cpp | 82 ++++++++++++++++------ src/plugins/bearer/connman/qofonoservice_linux_p.h | 8 +++ 2 files changed, 70 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/plugins/bearer/connman/qofonoservice_linux.cpp b/src/plugins/bearer/connman/qofonoservice_linux.cpp index 085b57d660..f6fb55522e 100644 --- a/src/plugins/bearer/connman/qofonoservice_linux.cpp +++ b/src/plugins/bearer/connman/qofonoservice_linux.cpp @@ -56,6 +56,22 @@ #ifndef QT_NO_BEARERMANAGEMENT #ifndef QT_NO_DBUS +QDBusArgument &operator<<(QDBusArgument &argument, const ObjectPathProperties &item) +{ + argument.beginStructure(); + argument << item.path << item.properties; + argument.endStructure(); + return argument; +} + +const QDBusArgument &operator>>(const QDBusArgument &argument, ObjectPathProperties &item) +{ + argument.beginStructure(); + argument >> item.path >> item.properties; + argument.endStructure(); + return argument; +} + QT_BEGIN_NAMESPACE QOfonoManagerInterface::QOfonoManagerInterface( QObject *parent) @@ -64,6 +80,8 @@ QOfonoManagerInterface::QOfonoManagerInterface( QObject *parent) OFONO_MANAGER_INTERFACE, QDBusConnection::systemBus(), parent) { + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); } QOfonoManagerInterface::~QOfonoManagerInterface() @@ -72,8 +90,16 @@ QOfonoManagerInterface::~QOfonoManagerInterface() QList QOfonoManagerInterface::getModems() { - QVariant var = getProperty("Modems"); - return qdbus_cast >(var); + QList modemList; + QList argumentList; + QDBusReply reply = this->asyncCallWithArgumentList(QLatin1String("GetModems"), argumentList); + if (reply.isValid()) { + foreach (ObjectPathProperties modem, reply.value()) { + modemList << modem.path; + } + } + + return modemList; } QDBusObjectPath QOfonoManagerInterface::currentModem() @@ -81,7 +107,7 @@ QDBusObjectPath QOfonoManagerInterface::currentModem() QList modems = getModems(); foreach (const QDBusObjectPath &modem, modems) { QOfonoModemInterface device(modem.path()); - if(device.isPowered() && device.isOnline()) + if (device.isPowered() && device.isOnline()) return modem;; } return QDBusObjectPath(); @@ -92,7 +118,7 @@ void QOfonoManagerInterface::connectNotify(const QMetaMethod &signal) { static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoManagerInterface::propertyChanged); if (signal == propertyChangedSignal) { - if(!connection().connect(QLatin1String(OFONO_SERVICE), + if (!connection().connect(QLatin1String(OFONO_SERVICE), QLatin1String(OFONO_MANAGER_PATH), QLatin1String(OFONO_MANAGER_INTERFACE), QLatin1String("PropertyChanged"), @@ -140,7 +166,7 @@ QVariant QOfonoManagerInterface::getProperty(const QString &property) QVariantMap QOfonoManagerInterface::getProperties() { QDBusReply reply = this->call(QLatin1String("GetProperties")); - if(reply.isValid()) + if (reply.isValid()) return reply.value(); else return QVariantMap(); @@ -234,7 +260,7 @@ QStringList QOfonoModemInterface::getInterfaces() QString QOfonoModemInterface::defaultInterface() { - foreach(const QString &modem,getInterfaces()) { + foreach (const QString &modem,getInterfaces()) { return modem; } return QString(); @@ -245,7 +271,7 @@ void QOfonoModemInterface::connectNotify(const QMetaMethod &signal) { static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoModemInterface::propertyChanged); if (signal == propertyChangedSignal) { - if(!connection().connect(QLatin1String(OFONO_SERVICE), + if (!connection().connect(QLatin1String(OFONO_SERVICE), this->path(), QLatin1String(OFONO_MODEM_INTERFACE), QLatin1String("PropertyChanged"), @@ -363,15 +389,23 @@ QString QOfonoNetworkRegistrationInterface::getBaseStation() QList QOfonoNetworkRegistrationInterface::getOperators() { - QVariant var = getProperty("Operators"); - return qdbus_cast >(var); + QList operatorList; + QList argumentList; + QDBusReply reply = this->asyncCallWithArgumentList(QLatin1String("GetOperators"), + argumentList); + if (reply.isValid()) { + foreach (ObjectPathProperties netop, reply.value()) { + operatorList << netop.path; + } + } + return operatorList; } void QOfonoNetworkRegistrationInterface::connectNotify(const QMetaMethod &signal) { static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoNetworkRegistrationInterface::propertyChanged); if (signal == propertyChangedSignal) { - if(!connection().connect(QLatin1String(OFONO_SERVICE), + if (!connection().connect(QLatin1String(OFONO_SERVICE), this->path(), QLatin1String(OFONO_NETWORK_REGISTRATION_INTERFACE), QLatin1String("PropertyChanged"), @@ -473,7 +507,7 @@ void QOfonoNetworkOperatorInterface::connectNotify(const QMetaMethod &signal) Q_UNUSED(signal); // static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoNetworkOperatorInterface::propertyChanged); // if (signal == propertyChangedSignal) { -// if(!connection().connect(QLatin1String(OFONO_SERVICE), +// if (!connection().connect(QLatin1String(OFONO_SERVICE), // this->path(), // QLatin1String(OFONO_NETWORK_OPERATOR_INTERFACE), // QLatin1String("PropertyChanged"), @@ -581,7 +615,7 @@ void QOfonoSimInterface::connectNotify(const QMetaMethod &signal) Q_UNUSED(signal); // static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoSimInterface::propertyChanged); // if (signal == propertyChangedSignal) { -// if(!connection().connect(QLatin1String(OFONO_SERVICE), +// if (!connection().connect(QLatin1String(OFONO_SERVICE), // this->path(), // QLatin1String(OFONO_SIM_MANAGER_INTERFACE), // QLatin1String("PropertyChanged"), @@ -648,8 +682,16 @@ QOfonoDataConnectionManagerInterface::~QOfonoDataConnectionManagerInterface() QList QOfonoDataConnectionManagerInterface::getPrimaryContexts() { - QVariant var = getProperty("PrimaryContexts"); - return qdbus_cast >(var); + QList contextList; + QList argumentList; + QDBusReply reply = this->asyncCallWithArgumentList(QLatin1String("GetContexts"), + argumentList); + if (reply.isValid()) { + foreach (ObjectPathProperties context, reply.value()) { + contextList << context.path; + } + } + return contextList; } bool QOfonoDataConnectionManagerInterface::isAttached() @@ -675,7 +717,7 @@ void QOfonoDataConnectionManagerInterface::connectNotify(const QMetaMethod &sign Q_UNUSED(signal); // static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoDataConnectionManagerInterface::propertyChanged); // if (signal == propertyChangedSignal) { -// if(!connection().connect(QLatin1String(OFONO_SERVICE), +// if (!connection().connect(QLatin1String(OFONO_SERVICE), // this->path(), // QLatin1String(OFONO_DATA_CONNECTION_MANAGER_INTERFACE), // QLatin1String("PropertyChanged"), @@ -799,7 +841,7 @@ void QOfonoPrimaryDataContextInterface::connectNotify(const QMetaMethod &signal) Q_UNUSED(signal); // static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoPrimaryDataContextInterface::propertyChanged); // if (signal == propertyChangedSignal) { -// if(!connection().connect(QLatin1String(OFONO_SERVICE), +// if (!connection().connect(QLatin1String(OFONO_SERVICE), // this->path(), // QLatin1String(OFONO_DATA_CONTEXT_INTERFACE), // QLatin1String("PropertyChanged"), @@ -861,7 +903,7 @@ bool QOfonoPrimaryDataContextInterface::setProp(const QString &property, const Q QLatin1String("SetProperty"), args); bool ok = true; - if(reply.type() != QDBusMessage::ReplyMessage) { + if (reply.type() != QDBusMessage::ReplyMessage) { qWarning() << reply.errorMessage(); ok = false; } @@ -885,7 +927,7 @@ void QOfonoSmsInterface::connectNotify(const QMetaMethod &signal) { static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QOfonoSmsInterface::propertyChanged); if (signal == propertyChangedSignal) { - if(!connection().connect(QLatin1String(OFONO_SERVICE), + if (!connection().connect(QLatin1String(OFONO_SERVICE), this->path(), QLatin1String(OFONO_SMS_MANAGER_INTERFACE), QLatin1String("PropertyChanged"), @@ -912,7 +954,7 @@ void QOfonoSmsInterface::connectNotify(const QMetaMethod &signal) static const QMetaMethod immediateMessageSignal = QMetaMethod::fromSignal(&QOfonoSmsInterface::immediateMessage); if (signal == immediateMessageSignal) { - if(!connection().connect(QLatin1String(OFONO_SERVICE), + if (!connection().connect(QLatin1String(OFONO_SERVICE), this->path(), QLatin1String(OFONO_SMS_MANAGER_INTERFACE), QLatin1String("ImmediateMessage"), @@ -923,7 +965,7 @@ void QOfonoSmsInterface::connectNotify(const QMetaMethod &signal) static const QMetaMethod incomingMessageSignal = QMetaMethod::fromSignal(&QOfonoSmsInterface::incomingMessage); if (signal == incomingMessageSignal) { - if(!connection().connect(QLatin1String(OFONO_SERVICE), + if (!connection().connect(QLatin1String(OFONO_SERVICE), this->path(), QLatin1String(OFONO_SMS_MANAGER_INTERFACE), QLatin1String("IncomingMessage"), diff --git a/src/plugins/bearer/connman/qofonoservice_linux_p.h b/src/plugins/bearer/connman/qofonoservice_linux_p.h index 85f6602023..00be9aa675 100644 --- a/src/plugins/bearer/connman/qofonoservice_linux_p.h +++ b/src/plugins/bearer/connman/qofonoservice_linux_p.h @@ -88,6 +88,14 @@ QT_BEGIN_NAMESPACE QT_END_NAMESPACE +struct ObjectPathProperties +{ + QDBusObjectPath path; + QVariantMap properties; +}; +typedef QList PathPropertiesList; +Q_DECLARE_METATYPE(ObjectPathProperties) +Q_DECLARE_METATYPE (PathPropertiesList) QT_BEGIN_NAMESPACE -- cgit v1.2.3 From a9458a175598a0da0fdfbfed7f9470878af25b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 24 Jan 2013 09:09:28 +0100 Subject: Clean up logical dpi for QImage. Revert to the pre highdpi-patch behaviour. Before, both physical and logical DPI would be based on the dpmx/dpmy variables, which could be changed with setDotsPerMeter(). The highdpi patch introduced separate ldpmx/ldpmy variables, which were not changed by setDotsPerMeter(). This broke when loading images: setDotsPerMeter would be called but the logical dpi would not change. Remove ldpmx/ldpmy. Keep scaling the physical dpi by the devicePixelRatio, which will be set to 1 by default. Task-number: QTBUG-29187 Change-Id: I0d6f5f3b8efae5fb1adc0a50b22a5da78324a282 Reviewed-by: Gunnar Sletta --- src/gui/image/qimage.cpp | 6 ++---- src/gui/image/qimage_p.h | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index de1e555771..975ef54d6b 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -99,8 +99,6 @@ QImageData::QImageData() format(QImage::Format_ARGB32), bytes_per_line(0), ser_no(qimage_serial_number.fetchAndAddRelaxed(1)), detach_no(0), - ldpmx(qt_defaultDpiX() * 100 / qreal(2.54)), - ldpmy(qt_defaultDpiY() * 100 / qreal(2.54)), dpmx(qt_defaultDpiX() * 100 / qreal(2.54)), dpmy(qt_defaultDpiY() * 100 / qreal(2.54)), offset(0, 0), own_data(true), ro_data(false), has_alpha_clut(false), @@ -4984,11 +4982,11 @@ int QImage::metric(PaintDeviceMetric metric) const return d->depth; case PdmDpiX: - return qRound(d->ldpmx * 0.0254); + return qRound(d->dpmx * 0.0254); break; case PdmDpiY: - return qRound(d->ldpmy * 0.0254); + return qRound(d->dpmy * 0.0254); break; case PdmPhysicalDpiX: diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h index e79eb9d562..18c686e917 100644 --- a/src/gui/image/qimage_p.h +++ b/src/gui/image/qimage_p.h @@ -82,10 +82,8 @@ struct Q_GUI_EXPORT QImageData { // internal image data int ser_no; // serial number int detach_no; - qreal ldpmx; // logical dots per meter X (or 0) - qreal ldpmy; // logical dots per meter Y (or 0) - qreal dpmx; // device dots per meter X (or 0) - qreal dpmy; // device dots per meter Y (or 0) + qreal dpmx; // dots per meter X (or 0) + qreal dpmy; // dots per meter Y (or 0) QPoint offset; // offset in pixels uint own_data : 1; -- cgit v1.2.3 From 3dc47622a469ded1c99397fdedc2053b73d57189 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Fri, 25 Jan 2013 09:38:47 +0100 Subject: BlackBerry bearer plugin: check whether device is online several times This is supposed to workaround a race condition in the underlying netstatus API: Sometimes we get an event that the Wifi interface changed, but it is not up, e.g. no gateway (yet). In that case we need to check back (currently: 300 ms) whether the interface has come up or not. This commit can be reverted again once the race condition in the netstatus API has been resolved. Task-number: QTBUG-29421 Change-Id: I215ce8aae4848b6e942e77c6425adba90e9cc526 Reviewed-by: Sean Harmer Reviewed-by: Rafael Roquetto --- src/network/bearer/qnetworkconfiguration_p.h | 11 +++++++++++ src/plugins/bearer/blackberry/qbbengine.cpp | 14 ++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'src') diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h index a2ab83d395..20353726ac 100644 --- a/src/network/bearer/qnetworkconfiguration_p.h +++ b/src/network/bearer/qnetworkconfiguration_p.h @@ -59,6 +59,10 @@ #include #include +#ifdef Q_OS_BLACKBERRY +#include +#endif + QT_BEGIN_NAMESPACE typedef QExplicitlySharedDataPointer QNetworkConfigurationPrivatePointer; @@ -70,6 +74,9 @@ public: type(QNetworkConfiguration::Invalid), purpose(QNetworkConfiguration::UnknownPurpose), bearerType(QNetworkConfiguration::BearerUnknown), +#ifdef Q_OS_BLACKBERRY + oldIpStatus(NETSTATUS_IP_STATUS_ERROR_UNKNOWN), +#endif isValid(false), roamingSupported(false) {} virtual ~QNetworkConfigurationPrivate() @@ -90,6 +97,10 @@ public: QNetworkConfiguration::Purpose purpose; QNetworkConfiguration::BearerType bearerType; +#ifdef Q_OS_BLACKBERRY + netstatus_ip_status_t oldIpStatus; +#endif + bool isValid; bool roamingSupported; diff --git a/src/plugins/bearer/blackberry/qbbengine.cpp b/src/plugins/bearer/blackberry/qbbengine.cpp index d64a8fe20f..ab1ba9aa19 100644 --- a/src/plugins/bearer/blackberry/qbbengine.cpp +++ b/src/plugins/bearer/blackberry/qbbengine.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include @@ -355,6 +356,9 @@ void QBBEngine::updateConfiguration(const char *interface) changed = true; } + const netstatus_ip_status_t oldIpStatus = ptr->oldIpStatus; + ptr->oldIpStatus = ipStatus; + ptrLocker.unlock(); locker.unlock(); @@ -364,7 +368,17 @@ void QBBEngine::updateConfiguration(const char *interface) Q_EMIT configurationChanged(ptr); } else { + // maybe Wifi has changed but gateway not yet ready etc. qBearerDebug() << Q_FUNC_INFO << "configuration has not changed."; + if (oldIpStatus != ipStatus) { // if IP status changed + if (ipStatus != NETSTATUS_IP_STATUS_OK + && ipStatus != NETSTATUS_IP_STATUS_ERROR_NOT_UP + && ipStatus != NETSTATUS_IP_STATUS_ERROR_NOT_CONFIGURED) { + // work around race condition in netstatus API by just checking + // again in 300 ms + QTimer::singleShot(300, this, SLOT(doRequestUpdate())); + } + } } return; -- cgit v1.2.3 From 29a78d48d0d3c162fad11b050cb50c951d4a484c Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Wed, 30 Jan 2013 13:58:12 +0000 Subject: QNX: Don't crash if we unplug the primary display. The QPA plugin assumes in several places that we have at least one QScreen. Even if patching the plugin to support 0 screens, Qt itself crashes when dereferencing a null paint device while synching the backing store. Change-Id: I2ac504a447aff811d6c07ab857340a3433557cdc Reviewed-by: Kevin Krammer Reviewed-by: Sean Harmer --- src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp index 8b41465add..4412bb34bd 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp +++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp @@ -42,6 +42,7 @@ #include "qqnxscreeneventhandler.h" #include "qqnxintegration.h" #include "qqnxkeytranslator.h" +#include "qqnxscreen.h" #include #include @@ -487,9 +488,18 @@ void QQnxScreenEventHandler::handleDisplayEvent(screen_event_t event) m_qnxIntegration->createDisplay(nativeDisplay, false /* not primary, we assume */); } } else if (!isAttached) { - // libscreen display is deactivated, let's remove the QQnxScreen / QScreen - qScreenEventDebug() << "removing display"; - m_qnxIntegration->removeDisplay(screen); + // We never remove the primary display, the qpa plugin doesn't support that and it crashes. + // To support it, this would be needed: + // - Adjust all qnx qpa code which uses screens + // - Make QWidgetBackingStore not dereference a null paint device + // - Create platform resources ( QQnxWindow ) for all QWindow because they would be deleted + // when you delete the screen + + if (!screen->isPrimaryScreen()) { + // libscreen display is deactivated, let's remove the QQnxScreen / QScreen + qScreenEventDebug() << "removing display"; + m_qnxIntegration->removeDisplay(screen); + } } } -- cgit v1.2.3 From 4b6bd14063875167a018495373a978ca3f003229 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 23 Jan 2013 12:33:42 -0800 Subject: Let ICC 13 build Qt again if the system compiler is GCC 4.7. GCC 4.7 has new builtins in x86intrin.h that ICC 13 does not (yet) understand, causing compilation errors. /usr/lib/gcc/x86_64-redhat-linux/4.7.2/include/adxintrin.h(36): error: identifier "__builtin_ia32_addcarryx_u32" is undefined Change-Id: I1845ccc3bf3ac15aef063bc3f998c5839fa51866 Reviewed-by: Olivier Goffart --- src/corelib/tools/qsimd_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index 2d0e554de8..3f570c7a44 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -141,7 +141,8 @@ QT_BEGIN_HEADER #endif // other x86 intrinsics -#if defined(QT_COMPILER_SUPPORTS_AVX) && defined(Q_CC_GNU) +#if defined(QT_COMPILER_SUPPORTS_AVX) && defined(Q_CC_GNU) && \ + (!defined(Q_CC_INTEL) || (__GNUC__ * 100 + __GNUC_MINOR__ < 407)) #define QT_COMPILER_SUPPORTS_X86INTRIN #include #endif -- cgit v1.2.3 From c81d15a746e50db8554d6362909d84784382917c Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 28 Jan 2013 10:41:23 +0100 Subject: Correct QTextEdit detailed description. Change-Id: Ie5c4769c864d9dfdc1cb4ed5d2cbfb9951df582b Reviewed-by: Venugopal Shivashankar Reviewed-by: Andy Shaw --- src/widgets/widgets/qtextedit.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') 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 -- cgit v1.2.3 From 06a6d1da589d68d72ef70bc0b19ab9ef39593164 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 30 Jan 2013 17:20:33 +0100 Subject: substitute fixed version numbers in qdocconf files with variables Change-Id: Ie57765c10a8e90d6fc74ee5a8fd84bfc7cd8bcf2 Reviewed-by: Jerome Pasion Reviewed-by: Joerg Bornemann --- src/concurrent/doc/qtconcurrent.qdocconf | 10 +++++----- src/corelib/doc/qtcore.qdocconf | 10 +++++----- src/dbus/doc/qtdbus.qdocconf | 2 +- src/gui/doc/qtgui.qdocconf | 10 +++++----- src/network/doc/qtnetwork.qdocconf | 10 +++++----- src/opengl/doc/qtopengl.qdocconf | 2 +- src/printsupport/doc/qtprintsupport.qdocconf | 10 +++++----- src/sql/doc/qtsql.qdocconf | 10 +++++----- src/testlib/doc/qttestlib.qdocconf | 10 +++++----- src/widgets/doc/qtwidgets.qdocconf | 10 +++++----- src/xml/doc/qtxml.qdocconf | 10 +++++----- 11 files changed, 47 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/concurrent/doc/qtconcurrent.qdocconf b/src/concurrent/doc/qtconcurrent.qdocconf index 442f69372c..1f5a0ec1f3 100644 --- a/src/concurrent/doc/qtconcurrent.qdocconf +++ b/src/concurrent/doc/qtconcurrent.qdocconf @@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtConcurrent description = Qt Concurrent Reference Documentation url = http://qt-project.org/doc/qtconcurrent -version = 5.0.1 +version = $QT_VERSION examplesinstallpath = qtconcurrent qhp.projects = QtConcurrent qhp.QtConcurrent.file = qtconcurrent.qhp -qhp.QtConcurrent.namespace = org.qt-project.qtconcurrent.501 +qhp.QtConcurrent.namespace = org.qt-project.qtconcurrent.$QT_VERSION_TAG qhp.QtConcurrent.virtualFolder = qtconcurrent qhp.QtConcurrent.indexTitle = Qt Concurrent qhp.QtConcurrent.indexRoot = -qhp.QtConcurrent.filterAttributes = qtconcurrent 5.0.1 qtrefdoc -qhp.QtConcurrent.customFilters.Qt.name = QtConcurrent 5.0.1 -qhp.QtConcurrent.customFilters.Qt.filterAttributes = qtconcurrent 5.0.1 +qhp.QtConcurrent.filterAttributes = qtconcurrent $QT_VERSION qtrefdoc +qhp.QtConcurrent.customFilters.Qt.name = QtConcurrent $QT_VERSION +qhp.QtConcurrent.customFilters.Qt.filterAttributes = qtconcurrent $QT_VERSION qhp.QtConcurrent.subprojects = classes qhp.QtConcurrent.subprojects.classes.title = C++ Classes diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index cb87530f54..ac58bda07f 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtCore description = Qt Core Reference Documentation url = http://qt-project.org/doc/qtcore -version = 5.0.1 +version = $QT_VERSION examplesinstallpath = core qhp.projects = QtCore qhp.QtCore.file = qtcore.qhp -qhp.QtCore.namespace = org.qt-project.qtcore.501 +qhp.QtCore.namespace = org.qt-project.qtcore.$QT_VERSION_TAG qhp.QtCore.virtualFolder = qtcore qhp.QtCore.indexTitle = Qt Core qhp.QtCore.indexRoot = -qhp.QtCore.filterAttributes = qtcore 5.0.1 qtrefdoc -qhp.QtCore.customFilters.Qt.name = QtCore 5.0.1 -qhp.QtCore.customFilters.Qt.filterAttributes = qtcore 5.0.1 +qhp.QtCore.filterAttributes = qtcore $QT_VERSION qtrefdoc +qhp.QtCore.customFilters.Qt.name = QtCore $QT_VERSION +qhp.QtCore.customFilters.Qt.filterAttributes = qtcore $QT_VERSION qhp.QtCore.subprojects = classes qhp.QtCore.subprojects.classes.title = C++ Classes qhp.QtCore.subprojects.classes.indexTitle = Qt Core C++ Classes diff --git a/src/dbus/doc/qtdbus.qdocconf b/src/dbus/doc/qtdbus.qdocconf index 7a58dada63..f3b4c0f1d7 100644 --- a/src/dbus/doc/qtdbus.qdocconf +++ b/src/dbus/doc/qtdbus.qdocconf @@ -36,7 +36,7 @@ qhp.qtdbus.file = qtdbus.qhp # Namespace for the output file. This namespace is used to distinguish between # different documentation files in Creator/Assistant. -qhp.qtdbus.namespace = org.qt-project.qtdbus.501 +qhp.qtdbus.namespace = org.qt-project.qtdbus.$QT_VERSION_TAG # Title for the package, will be the main title for the package in # Assistant/Creator. diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf index a46aa9b3d1..3fc03aec73 100644 --- a/src/gui/doc/qtgui.qdocconf +++ b/src/gui/doc/qtgui.qdocconf @@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtGui description = Qt GUI Reference Documentation url = http://qt-project.org/doc/qtgui -version = 5.0.1 +version = $QT_VERSION examplesinstallpath = gui qhp.projects = QtGui qhp.QtGui.file = qtgui.qhp -qhp.QtGui.namespace = org.qt-project.qtgui.501 +qhp.QtGui.namespace = org.qt-project.qtgui.$QT_VERSION_TAG qhp.QtGui.virtualFolder = qtgui qhp.QtGui.indexTitle = Qt GUI qhp.QtGui.indexRoot = -qhp.QtGui.filterAttributes = qtgui 5.0.1 qtrefdoc -qhp.QtGui.customFilters.Qt.name = Qtgui 5.0.1 -qhp.QtGui.customFilters.Qt.filterAttributes = qtgui 5.0.1 +qhp.QtGui.filterAttributes = qtgui $QT_VERSION qtrefdoc +qhp.QtGui.customFilters.Qt.name = Qtgui $QT_VERSION +qhp.QtGui.customFilters.Qt.filterAttributes = qtgui $QT_VERSION qhp.QtGui.subprojects = classes qhp.QtGui.subprojects.classes.title = C++ Classes diff --git a/src/network/doc/qtnetwork.qdocconf b/src/network/doc/qtnetwork.qdocconf index 702338e224..59fb19fac9 100644 --- a/src/network/doc/qtnetwork.qdocconf +++ b/src/network/doc/qtnetwork.qdocconf @@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtNetwork description = Qt Network Reference Documentation url = http://qt-project.org/doc/qtnetwork -version = 5.0.1 +version = $QT_VERSION examplesinstallpath = network qhp.projects = QtNetwork qhp.QtNetwork.file = qtnetwork.qhp -qhp.QtNetwork.namespace = org.qt-project.qtnetwork.501 +qhp.QtNetwork.namespace = org.qt-project.qtnetwork.$QT_VERSION_TAG qhp.QtNetwork.virtualFolder = qtnetwork qhp.QtNetwork.indexTitle = Qt Network qhp.QtNetwork.indexRoot = -qhp.QtNetwork.filterAttributes = qtnetwork 5.0.1 qtrefdoc -qhp.QtNetwork.customFilters.Qt.name = QtNetwork 5.0.1 -qhp.QtNetwork.customFilters.Qt.filterAttributes = qtnetwork 5.0.1 +qhp.QtNetwork.filterAttributes = qtnetwork $QT_VERSION qtrefdoc +qhp.QtNetwork.customFilters.Qt.name = QtNetwork $QT_VERSION +qhp.QtNetwork.customFilters.Qt.filterAttributes = qtnetwork $QT_VERSION qhp.QtNetwork.subprojects = classes qhp.QtNetwork.subprojects.classes.title = C++ Classes diff --git a/src/opengl/doc/qtopengl.qdocconf b/src/opengl/doc/qtopengl.qdocconf index 131fdb8968..d0f49fd602 100644 --- a/src/opengl/doc/qtopengl.qdocconf +++ b/src/opengl/doc/qtopengl.qdocconf @@ -39,7 +39,7 @@ qhp.qtopengl.file = qtopengl.qhp # Namespace for the output file. This namespace is used to distinguish between # different documentation files in Creator/Assistant. -qhp.qtopengl.namespace = org.qt-project.qtopengl.501 +qhp.qtopengl.namespace = org.qt-project.qtopengl.$QT_VERSION_TAG # Title for the package, will be the main title for the package in # Assistant/Creator. diff --git a/src/printsupport/doc/qtprintsupport.qdocconf b/src/printsupport/doc/qtprintsupport.qdocconf index 1a4d37ae49..60b6b8fa52 100644 --- a/src/printsupport/doc/qtprintsupport.qdocconf +++ b/src/printsupport/doc/qtprintsupport.qdocconf @@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtPrintSupport description = Qt Print Support Reference Documentation url = http://qt-project.org/doc/qtprintsupport -version = 5.0.1 +version = $QT_VERSION examplesinstallpath = printsupport qhp.projects = QtPrintSupport qhp.QtPrintSupport.file = qtprintsupport.qhp -qhp.QtPrintSupport.namespace = org.qt-project.qtprintsupport.501 +qhp.QtPrintSupport.namespace = org.qt-project.qtprintsupport.$QT_VERSION_TAG qhp.QtPrintSupport.virtualFolder = qtprintsupport qhp.QtPrintSupport.indexTitle = Qt Print Support qhp.QtPrintSupport.indexRoot = -qhp.QtPrintSupport.filterAttributes = qtprintsupport 5.0.1 qtrefdoc -qhp.QtPrintSupport.customFilters.Qt.name = QtPrintSupport 5.0.1 -qhp.QtPrintSupport.customFilters.Qt.filterAttributes = qtprintsupport 5.0.1 +qhp.QtPrintSupport.filterAttributes = qtprintsupport $QT_VERSION qtrefdoc +qhp.QtPrintSupport.customFilters.Qt.name = QtPrintSupport $QT_VERSION +qhp.QtPrintSupport.customFilters.Qt.filterAttributes = qtprintsupport $QT_VERSION qhp.QtPrintSupport.subprojects = classes qhp.QtPrintSupport.subprojects.classes.title = C++ Classes diff --git a/src/sql/doc/qtsql.qdocconf b/src/sql/doc/qtsql.qdocconf index 6c5af37de8..2fedc1b561 100644 --- a/src/sql/doc/qtsql.qdocconf +++ b/src/sql/doc/qtsql.qdocconf @@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtSql description = Qt SQL Reference Documentation url = http://qt-project.org/doc/qtsql -version = 5.0.1 +version = $QT_VERSION examplesinstallpath = sql qhp.projects = QtSql qhp.QtSql.file = qtsql.qhp -qhp.QtSql.namespace = org.qt-project.qtsql.501 +qhp.QtSql.namespace = org.qt-project.qtsql.$QT_VERSION_TAG qhp.QtSql.virtualFolder = qtsql qhp.QtSql.indexTitle = Qt SQL qhp.QtSql.indexRoot = -qhp.QtSql.filterAttributes = qtsql 5.0.1 qtrefdoc -qhp.QtSql.customFilters.Qt.name = QtSql 5.0.1 -qhp.QtSql.customFilters.Qt.filterAttributes = qtsql 5.0.1 +qhp.QtSql.filterAttributes = qtsql $QT_VERSION qtrefdoc +qhp.QtSql.customFilters.Qt.name = QtSql $QT_VERSION +qhp.QtSql.customFilters.Qt.filterAttributes = qtsql $QT_VERSION qhp.QtSql.subprojects = classes qhp.QtSql.subprojects.classes.title = C++ Classes diff --git a/src/testlib/doc/qttestlib.qdocconf b/src/testlib/doc/qttestlib.qdocconf index 3785bd6503..fe39ddc692 100644 --- a/src/testlib/doc/qttestlib.qdocconf +++ b/src/testlib/doc/qttestlib.qdocconf @@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtTestLib description = Qt Test Reference Documentation url = http://qt-project.org/doc/qttestlib -version = 5.0.1 +version = $QT_VERSION examplesinstallpath = testlib qhp.projects = QtTestLib qhp.QtTestLib.file = qttestlib.qhp -qhp.QtTestLib.namespace = org.qt-project.qttest.501 +qhp.QtTestLib.namespace = org.qt-project.qttest.$QT_VERSION_TAG qhp.QtTestLib.virtualFolder = qttest qhp.QtTestLib.indexTitle = Qt Test qhp.QtTestLib.indexRoot = -qhp.QtTestLib.filterAttributes = qttest 5.0.1 qtrefdoc -qhp.QtTestLib.customFilters.Qt.name = QtTest 5.0.1 -qhp.QtTestLib.customFilters.Qt.filterAttributes = qttest 5.0.1 +qhp.QtTestLib.filterAttributes = qttest $QT_VERSION qtrefdoc +qhp.QtTestLib.customFilters.Qt.name = QtTest $QT_VERSION +qhp.QtTestLib.customFilters.Qt.filterAttributes = qttest $QT_VERSION qhp.QtTestLib.subprojects = classes qhp.QtTestLib.subprojects.classes.title = C++ Classes diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf index 062adc7f7c..4ce7c38357 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.1 +version = $QT_VERSION examplesinstallpath = widgets qhp.projects = QtWidgets qhp.QtWidgets.file = qtwidgets.qhp -qhp.QtWidgets.namespace = org.qt-project.qtwidgets.501 +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.0.1 qtrefdoc -qhp.QtWidgets.customFilters.Qt.name = QtWidgets 5.0.1 -qhp.QtWidgets.customFilters.Qt.filterAttributes = qtwidgets 5.0.1 +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/xml/doc/qtxml.qdocconf b/src/xml/doc/qtxml.qdocconf index bf77059a02..c713a61695 100644 --- a/src/xml/doc/qtxml.qdocconf +++ b/src/xml/doc/qtxml.qdocconf @@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtXml description = Qt XML Reference Documentation url = http://qt-project.org/doc/qtxml -version = 5.0.1 +version = $QT_VERSION examplesinstallpath = xml qhp.projects = QtXml qhp.QtXml.file = qtxml.qhp -qhp.QtXml.namespace = org.qt-project.qtxml.501 +qhp.QtXml.namespace = org.qt-project.qtxml.$QT_VERSION_TAG qhp.QtXml.virtualFolder = qtxml qhp.QtXml.indexTitle = Qt XML qhp.QtXml.indexRoot = -qhp.QtXml.filterAttributes = qtxml 5.0.1 qtrefdoc -qhp.QtXml.customFilters.Qt.name = QtXml 5.0.1 -qhp.QtXml.customFilters.Qt.filterAttributes = qtxml 5.0.1 +qhp.QtXml.filterAttributes = qtxml $QT_VERSION qtrefdoc +qhp.QtXml.customFilters.Qt.name = QtXml $QT_VERSION +qhp.QtXml.customFilters.Qt.filterAttributes = qtxml $QT_VERSION qhp.QtXml.subprojects = classes qhp.QtXml.subprojects.classes.title = C++ Classes -- cgit v1.2.3 From 2aa9f5d153ee9db1c904fdf98e814feb938e7bb2 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Fri, 1 Feb 2013 11:05:49 +0100 Subject: Bump Qt version to 5.0.2 Change-Id: I573601fb609cdb632fbb422920801a24be4c0448 Reviewed-by: Lars Knoll --- src/corelib/global/qglobal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 6da275712f..13bdc7553f 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -45,11 +45,11 @@ #include -#define QT_VERSION_STR "5.0.1" +#define QT_VERSION_STR "5.0.2" /* QT_VERSION is (major << 16) + (minor << 8) + patch. */ -#define QT_VERSION 0x050001 +#define QT_VERSION 0x050002 /* can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0)) */ -- cgit v1.2.3 From 3ba61d9baa569ea69e41a943981680c09c521ff7 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 31 Jan 2013 17:24:50 +0100 Subject: fix build failures on mingw caused by name clash In mingw.org, basetyps.h contains #define interface _COM_interface which clashes with function parameter names in qdbusmessage.h. Although there is no clash when building qtbase itself, the clash makes building qttools 5.0.1 fail. Presumably this could also affect other applications. Taken from 2cc9a9a51d6742708b1ea41c7338755e2a0ee9e9 which solves the same problem in another header. Change-Id: I802d5c673b544fb3a17e9273030876928faa5c46 Reviewed-by: Friedemann Kleint Reviewed-by: Thiago Macieira --- src/dbus/qdbusmessage.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/dbus/qdbusmessage.h b/src/dbus/qdbusmessage.h index 8560440881..72caf312ec 100644 --- a/src/dbus/qdbusmessage.h +++ b/src/dbus/qdbusmessage.h @@ -49,6 +49,10 @@ #ifndef QT_NO_DBUS +#if defined(Q_OS_WIN) && defined(interface) +# undef interface +#endif + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -- cgit v1.2.3 From c5c584c116798c495d78a4d89c568a77bc065010 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 1 Feb 2013 14:39:23 +0100 Subject: Optimize code sample of QObject::isSignalConnected Since isSignalConnected is meant to be used in performance critical code, and that QMetaMethod::fromSignal is relatively slow, it is better to have it a a static variable in the code sample, as a good recommendation on how to use it. Since QMetaMethod::fromSignal should not change during the life of the program, it should be safe. Also, if different threads run at the same time, both should lead to the same result. Change-Id: Ib6113d11ca93f216bc3a92aea4eaa4da6a4151ca Reviewed-by: Thiago Macieira --- src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp index 932a006436..bafd3f8eb8 100644 --- a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp @@ -480,7 +480,8 @@ QObject::disconnect(lineEdit, &QLineEdit::textChanged, //! [48] //! [49] -if (isSignalConnected(QMetaMethod::fromSignal(&MyObject::valueChanged))) { +static const QMetaMethod valueChangedSignal = QMetaMethod::fromSignal(&MyObject::valueChanged); +if (isSignalConnected(valueChangedSignal)) { QByteArray data; data = get_the_value(); // expensive operation emit valueChanged(data); -- cgit v1.2.3 From 86ca28774be1f91af26b518f0e945f00ffe6ba4a Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Sat, 2 Feb 2013 17:23:29 +0000 Subject: Add the missing "\since 5.0" reference for the QTimer method Change-Id: I9f2bb97eed7a1e2eb92865920f815055c847c84e Reviewed-by: Thiago Macieira --- src/corelib/kernel/qtimer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index d0c2dd6380..667c490d31 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -385,6 +385,7 @@ void QTimer::setInterval(int msec) /*! \property QTimer::remainingTime + \since 5.0 \brief the remaining time in milliseconds Returns the timer's remaining value in milliseconds left until the timeout. -- cgit v1.2.3 From 91e12dca757a8ef5c4691b70eb80db61a9d47e83 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 19 Jan 2013 16:17:51 +0100 Subject: QThread documentation: do not discourage the reimplementation of QThread The new QThread documentation now really discourage to reimplement QThread. But in fact, there are many cases where it is perfectly fine. And the example given is even a case where using worker object is wrong. The examle even contains a leak since the thread will never stop and will even leak. This changes put back some sentences from before commit d4ad9dbbf96884c0899e8f8116a8a056facd52d5. The sample code has been re-writen. Notice how reimpementing run takes less lines of code, less runtime overhead, no leaks, and also is more complete than the previous example. Change-Id: I6cb80826e917dd5ce442ccad2572ec692ccb25ab Reviewed-by: Andre Somers Reviewed-by: Geir Vattekar Reviewed-by: Debao Zhang Reviewed-by: Thiago Macieira --- .../snippets/code/src_corelib_thread_qthread.cpp | 79 +++++++++++++++------- src/corelib/kernel/qobject.cpp | 6 +- src/corelib/thread/qthread.cpp | 62 +++++++---------- 3 files changed, 82 insertions(+), 65 deletions(-) (limited to 'src') diff --git a/src/corelib/doc/snippets/code/src_corelib_thread_qthread.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qthread.cpp index f0bc759320..c33c8bb48a 100644 --- a/src/corelib/doc/snippets/code/src_corelib_thread_qthread.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_thread_qthread.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Olivier Goffart ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. @@ -38,41 +38,68 @@ ** ****************************************************************************/ -//! [0] -class Worker : public QObject +#include +class MyObject; + +//! [reimpl-run] +class WorkerThread : public QThread { Q_OBJECT - -public slots: - void doWork() { - ... + void run() Q_DECL_OVERRIDE { + QString result; + /* expensive or blocking operation */ + emit resultReady(result); } +signals: + void resultReady(const QString &s); }; -void MyObject::putWorkerInAThread() +void MyObject::startWorkInAThread() { - Worker *worker = new Worker; - QThread *workerThread = new QThread(this); - - connect(workerThread, &QThread::started, worker, &Worker::doWork); - connect(workerThread, &QThread::finished, worker, &Worker::deleteLater); - worker->moveToThread(workerThread); - - // Starts an event loop, and emits workerThread->started() + WorkerThread *workerThread = new WorkerThread(this); + connect(workerThread, &WorkerThread::resultReady, this, &MyObject::handleResults); + connect(workerThread, &WorkerThread::finished, workerThread, &QObject::deleteLater); workerThread->start(); } -//! [0] +//! [reimpl-run] + -//! [1] -class AdvancedThreadManager : public QThread +//! [worker] +class Worker : public QObject { -protected: - void run() - { - /* ... other code to initialize thread... */ + Q_OBJECT + QThread workerThread; - // Begin event handling - exec(); +public slots: + void doWork(const QString ¶meter) { + // ... + emit resultReady(result); } + +signals: + void resultReady(const QString &result); +}; + +class Controller : public QObject +{ + Q_OBJECT + QThread workerThread; +public: + Controller() { + Worker *worker = new Worker; + worker->moveToThread(&workerThread); + connect(workerThread, &QThread::finished, worker, &QObject::deleteLater); + connect(this, &Controller::operate, worker, &Worker::doWork); + connect(worker, &Worker::resultReady, this, &Controller::handleResults); + workerThread.start(); + } + ~Controller() { + workerThread.quit(); + workerThread.wait(); + } +public slots: + void handleResults(const QString &); +signals: + void operate(const QString &); }; -//! [1] +//! [worker] diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index d125946781..a82242939d 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1917,7 +1917,11 @@ void QObject::removeEventFilter(QObject *obj) loop. If the event loop is not running when this function is called (e.g. deleteLater() is called on an object before QCoreApplication::exec()), the object will be deleted once the - event loop is started. + event loop is started. If deleteLater() is called after the main event loop + has stopped, the object will not be deleted. + Since Qt 4.8, if deleteLater() is called on an object that lives in a + thread with no running event loop, the object will be destroyed when the + thread finishes. Note that entering and leaving a new event loop (e.g., by opening a modal dialog) will \e not perform the deferred deletion; for the object to be diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index 712681024d..bd8c6341c1 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -178,21 +178,38 @@ QThreadPrivate::~QThreadPrivate() \ingroup thread A QThread object manages one thread of control within the - program. To make code run in a separate thread, simply create a - QThread, change the thread affinity of the QObject(s) that - contain the code, and start() the new event loop. For example: + program. QThreads begin executing in run(). By default, run() starts the + event loop by calling exec() and runs a Qt event loop inside the thread. - \snippet code/src_corelib_thread_qthread.cpp 0 + You can use worker objects by moving them to the thread using + QObject::moveToThread. + + \snippet code/src_corelib_thread_qthread.cpp worker The code inside the Worker's slot would then execute in a - separate thread. In this example, the QThread triggers the - Worker's doWork() slot upon starting, and frees the Worker's - memory upon terminating. However, you are free to connect the + separate thread. However, you are free to connect the Worker's slots to any signal, from any object, in any thread. It is safe to connect signals and slots across different threads, thanks to a mechanism called \l{Qt::QueuedConnection}{queued connections}. + Another way to make code run in a separate thread, is to subclass QThread + and reimplement run(). For example: + + \snippet code/src_corelib_thread_qthread.cpp reimpl-run + + In that example, the thread will exit after the run function has returned. + There will not be any event loop running in the thread unless you call + exec(). + + It is important to remember that a QThread object usually lives + in the thread where it was created, not in the thread that it + manages. This oft-overlooked detail means that a QThread's slots + will be executed in the context of its home thread, not in the + context of the thread it is managing. For this reason, + implementing new slots in a QThread subclass is error-prone and + discouraged. + \note If you interact with an object, using any technique other than queued signal/slot connections (e.g. direct function calls), then the usual multithreading precautions need to be taken. @@ -200,7 +217,6 @@ QThreadPrivate::~QThreadPrivate() \note It is not possible to change the thread affinity of GUI objects; they must remain in the main thread. - \section1 Managing threads QThread will notifiy you via a signal when the thread is @@ -244,36 +260,6 @@ QThreadPrivate::~QThreadPrivate() \l{Mandelbrot Example}, as that is the name of the QThread subclass). Note that this is currently not available with release builds on Windows. - \section1 Subclassing QThread - - Subclassing QThread is unnecessary for most purposes, since - QThread provides fully-functional thread management capabilities. - Nonetheless, QThread can be subclassed if you wish to implement - advanced thread management. This is done by adding new member - functions to the subclass, and/or by reimplementing run(). - QThread's run() function is analogous to an application's main() - function -- it is executed when the thread is started, and the - thread will end when it returns. - - \note Prior to Qt 4.4, the only way to use QThread for parallel - processing was to subclass it and implement the processing code - inside run(). This approach is now considered \b {bad practice}; - a QThread should only manage a thread, not process data. - - If you require event handling and signal/slot connections to - work in your thread, and if you reimplement run(), you must - explicitly call exec() at the end of your reimplementation: - - \snippet code/src_corelib_thread_qthread.cpp 1 - - It is important to remember that a QThread object usually lives - in the thread where it was created, not in the thread that it - manages. This oft-overlooked detail means that a QThread's slots - will be executed in the context of its home thread, not in the - context of the thread it is managing. For this reason, - implementing new slots in a QThread subclass is error-prone and - discouraged. - \sa {Thread Support in Qt}, QThreadStorage, QMutex, QSemaphore, QWaitCondition, {Mandelbrot Example}, {Semaphores Example}, {Wait Conditions Example} */ -- cgit v1.2.3 From e01343352ed8c1ac9cde0418bf72b6dec5099246 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 30 Jan 2013 18:00:01 +0100 Subject: fix doc page urls they are versioned nowadays Change-Id: I839db633e9d7d63c9d445f8e914b529bd7ce60a2 Reviewed-by: Jerome Pasion --- src/concurrent/doc/qtconcurrent.qdocconf | 2 +- src/corelib/doc/qtcore.qdocconf | 2 +- src/gui/doc/qtgui.qdocconf | 2 +- src/network/doc/qtnetwork.qdocconf | 2 +- src/printsupport/doc/qtprintsupport.qdocconf | 2 +- src/sql/doc/qtsql.qdocconf | 2 +- src/testlib/doc/qttestlib.qdocconf | 2 +- src/widgets/doc/qtwidgets.qdocconf | 2 +- src/xml/doc/qtxml.qdocconf | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/concurrent/doc/qtconcurrent.qdocconf b/src/concurrent/doc/qtconcurrent.qdocconf index 1f5a0ec1f3..3d5e9de5e0 100644 --- a/src/concurrent/doc/qtconcurrent.qdocconf +++ b/src/concurrent/doc/qtconcurrent.qdocconf @@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtConcurrent description = Qt Concurrent Reference Documentation -url = http://qt-project.org/doc/qtconcurrent +url = http://qt-project.org/doc/qt-$QT_VER/qtconcurrent version = $QT_VERSION examplesinstallpath = qtconcurrent diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index 60cdce7a26..0e275ee8d4 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtCore description = Qt Core Reference Documentation -url = http://qt-project.org/doc/qtcore +url = http://qt-project.org/doc/qt-$QT_VER/qtcore version = $QT_VERSION examplesinstallpath = core diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf index 3fc03aec73..fcf6cdf57c 100644 --- a/src/gui/doc/qtgui.qdocconf +++ b/src/gui/doc/qtgui.qdocconf @@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtGui description = Qt GUI Reference Documentation -url = http://qt-project.org/doc/qtgui +url = http://qt-project.org/doc/qt-$QT_VER/qtgui version = $QT_VERSION examplesinstallpath = gui diff --git a/src/network/doc/qtnetwork.qdocconf b/src/network/doc/qtnetwork.qdocconf index 59fb19fac9..048b3325b6 100644 --- a/src/network/doc/qtnetwork.qdocconf +++ b/src/network/doc/qtnetwork.qdocconf @@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtNetwork description = Qt Network Reference Documentation -url = http://qt-project.org/doc/qtnetwork +url = http://qt-project.org/doc/qt-$QT_VER/qtnetwork version = $QT_VERSION examplesinstallpath = network diff --git a/src/printsupport/doc/qtprintsupport.qdocconf b/src/printsupport/doc/qtprintsupport.qdocconf index 60b6b8fa52..76206a8c1f 100644 --- a/src/printsupport/doc/qtprintsupport.qdocconf +++ b/src/printsupport/doc/qtprintsupport.qdocconf @@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtPrintSupport description = Qt Print Support Reference Documentation -url = http://qt-project.org/doc/qtprintsupport +url = http://qt-project.org/doc/qt-$QT_VER/qtprintsupport version = $QT_VERSION examplesinstallpath = printsupport diff --git a/src/sql/doc/qtsql.qdocconf b/src/sql/doc/qtsql.qdocconf index 2fedc1b561..e53bd50b55 100644 --- a/src/sql/doc/qtsql.qdocconf +++ b/src/sql/doc/qtsql.qdocconf @@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtSql description = Qt SQL Reference Documentation -url = http://qt-project.org/doc/qtsql +url = http://qt-project.org/doc/qt-$QT_VER/qtsql version = $QT_VERSION examplesinstallpath = sql diff --git a/src/testlib/doc/qttestlib.qdocconf b/src/testlib/doc/qttestlib.qdocconf index fe39ddc692..2eea4f246a 100644 --- a/src/testlib/doc/qttestlib.qdocconf +++ b/src/testlib/doc/qttestlib.qdocconf @@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtTestLib description = Qt Test Reference Documentation -url = http://qt-project.org/doc/qttestlib +url = http://qt-project.org/doc/qt-$QT_VER/qttestlib version = $QT_VERSION examplesinstallpath = testlib diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf index 4ce7c38357..e960ebfeba 100644 --- a/src/widgets/doc/qtwidgets.qdocconf +++ b/src/widgets/doc/qtwidgets.qdocconf @@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtWidgets description = Qt Widgets Reference Documentation -url = http://qt-project.org/doc/qtwidgets +url = http://qt-project.org/doc/qt-$QT_VER/qtwidgets version = $QT_VERSION examplesinstallpath = widgets diff --git a/src/xml/doc/qtxml.qdocconf b/src/xml/doc/qtxml.qdocconf index c713a61695..4e8cf34b0c 100644 --- a/src/xml/doc/qtxml.qdocconf +++ b/src/xml/doc/qtxml.qdocconf @@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtXml description = Qt XML Reference Documentation -url = http://qt-project.org/doc/qtxml +url = http://qt-project.org/doc/qt-$QT_VER/qtxml version = $QT_VERSION examplesinstallpath = xml -- cgit v1.2.3 From 328c7ee6b804043a6fe293bcd0afba7d715989f7 Mon Sep 17 00:00:00 2001 From: Jian Liang Date: Tue, 5 Feb 2013 13:01:25 +0800 Subject: Show default shortcut menu when user right click window's caption In windows platform, Qt5 will not show the system default shortcut menu when the user right click in the window's caption. This is a regression from Qt4. This patch will let DefWindowProc() to handle the message WM_CONTEXTMENU if the mouse pointer is in the non-client area of the window. Thus the default Windows shortcut menu will show up. Change-Id: I88638ad1d4f0e73b088204b83c3f7ec0fe2033f0 Reviewed-by: Joerg Bornemann Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowscontext.cpp | 18 +++++++++++++++--- src/plugins/platforms/windows/qwindowscontext.h | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 44f1a438b8..99ef3aacf3 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -874,8 +874,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, #endif #ifndef QT_NO_CONTEXTMENU case QtWindows::ContextMenu: - handleContextMenuEvent(platformWindow->window(), msg); - return true; + return handleContextMenuEvent(platformWindow->window(), msg); #endif default: break; @@ -909,7 +908,7 @@ void QWindowsContext::handleFocusEvent(QtWindows::WindowsEventType et, } #ifndef QT_NO_CONTEXTMENU -void QWindowsContext::handleContextMenuEvent(QWindow *window, const MSG &msg) +bool QWindowsContext::handleContextMenuEvent(QWindow *window, const MSG &msg) { bool mouseTriggered = false; QPoint globalPos; @@ -919,10 +918,23 @@ void QWindowsContext::handleContextMenuEvent(QWindow *window, const MSG &msg) globalPos.setX(msg.pt.x); globalPos.setY(msg.pt.y); pos = QWindowsGeometryHint::mapFromGlobal(msg.hwnd, globalPos); + + RECT clientRect; + if (GetClientRect(msg.hwnd, &clientRect)) { + if (pos.x() < (int)clientRect.left || pos.x() >= (int)clientRect.right || + pos.y() < (int)clientRect.top || pos.y() >= (int)clientRect.bottom) + { + // This is the case that user has right clicked in the window's caption, + // We should call DefWindowProc() to display a default shortcut menu + // instead of sending a Qt window system event. + return false; + } + } } QWindowSystemInterface::handleContextMenuEvent(window, mouseTriggered, pos, globalPos, QWindowsKeyMapper::queryKeyboardModifiers()); + return true; } #endif diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h index bfe56ed246..1fe71e3aff 100644 --- a/src/plugins/platforms/windows/qwindowscontext.h +++ b/src/plugins/platforms/windows/qwindowscontext.h @@ -192,7 +192,7 @@ public: private: void handleFocusEvent(QtWindows::WindowsEventType et, QWindowsWindow *w); #ifndef QT_NO_CONTEXTMENU - void handleContextMenuEvent(QWindow *window, const MSG &msg); + bool handleContextMenuEvent(QWindow *window, const MSG &msg); #endif void unregisterWindowClasses(); -- cgit v1.2.3 From ef7c9b5b525c539d12d17f61b979c1c4e0751076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 5 Feb 2013 08:31:29 +0100 Subject: Fixed missing support for single buffered OpenGL on OS X. Task-number: QTBUG-28804 Change-Id: I426a9bbc08953d777f67a23b050570e9f7d442d7 Reviewed-by: Gunnar Sletta --- src/opengl/qgl_qpa.cpp | 2 +- src/platformsupport/cglconvenience/cglconvenience.mm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp index 44df7d109c..0a24654624 100644 --- a/src/opengl/qgl_qpa.cpp +++ b/src/opengl/qgl_qpa.cpp @@ -100,7 +100,7 @@ QSurfaceFormat QGLFormat::toSurfaceFormat(const QGLFormat &format) retFormat.setRedBufferSize(format.redBufferSize()); if (format.depth()) retFormat.setDepthBufferSize(format.depthBufferSize() == -1 ? 1 : format.depthBufferSize()); - retFormat.setSwapBehavior(format.doubleBuffer() ? QSurfaceFormat::DoubleBuffer : QSurfaceFormat::DefaultSwapBehavior); + retFormat.setSwapBehavior(format.doubleBuffer() ? QSurfaceFormat::DoubleBuffer : QSurfaceFormat::SingleBuffer); if (format.sampleBuffers()) retFormat.setSamples(format.samples() == -1 ? 4 : format.samples()); if (format.stencil()) diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm index dbb453f1b5..b0ea2d2225 100644 --- a/src/platformsupport/cglconvenience/cglconvenience.mm +++ b/src/platformsupport/cglconvenience/cglconvenience.mm @@ -87,7 +87,8 @@ void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format) QVector attrs; - attrs.append(NSOpenGLPFADoubleBuffer); + if (format.swapBehavior() != QSurfaceFormat::SingleBuffer) + attrs.append(NSOpenGLPFADoubleBuffer); #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { -- cgit v1.2.3 From 0b8065b5819efd8ba3741ea5703d5b95954b16c2 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Tue, 5 Feb 2013 09:07:07 +0100 Subject: remove misleading statement from ~QSqlDatabase() The presence of the sentence "If this is the last QSqlDatabase object that uses a certain database connection, the database connection is automatically closed" is misleading, whether or not the statement is true. It is about an internal detail of QSqlDatabase's implementation. As such it is not appropriate for user documentation. The user should be focused on how to use addDatabase(), cloneDatabase() and removeDatabase() correctly. Task-number: QTBUG-29481 Change-Id: I0c39584be260e13340834c34098368fcce4a7419 Reviewed-by: Florian Paul Schmidt Reviewed-by: Sune Vuorela Reviewed-by: Mark Brand --- src/sql/kernel/qsqldatabase.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index 4f59855ac2..36422f5f62 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -794,9 +794,6 @@ void QSqlDatabasePrivate::init(const QString &type) /*! Destroys the object and frees any allocated resources. - If this is the last QSqlDatabase object that uses a certain - database connection, the database connection is automatically closed. - \sa close() */ -- cgit v1.2.3 From 7cc3a3adf2952b94616785472f3541f97c4ee012 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 5 Feb 2013 11:35:28 +0100 Subject: Added missing null pointer check in QMacStyle QMacStyle::subElementRect could crash if SE_LineEditContents was used without providing a widget pointer. Task-number: QTBUG-27033 Change-Id: I15ef07ae1310be4257a8480d392f98dbf02168d3 Reviewed-by: J-P Nurmi --- src/widgets/styles/qmacstyle_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index bb2423adae..4bdd0a9bcb 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -4565,7 +4565,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, break; case SE_LineEditContents: rect = QCommonStyle::subElementRect(sr, opt, widget); - if(widget->parentWidget() && qobject_cast(widget->parentWidget())) + if (widget && qobject_cast(widget->parentWidget())) rect.adjust(-1, -2, 0, 0); else rect.adjust(-1, -1, 0, +1); -- cgit v1.2.3 From 9d7e63e37033741175baa38dc6b9faeebf7d2aa1 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Thu, 31 Jan 2013 19:08:12 +0000 Subject: QNX: Fix one more code path that led to having no QScreens. Qt dereferences QGuiApplication::primaryScreen() inside, for example, QColormapPrivate::initialize(). libscreen always returns at least one display, even it it's not connected, so lets not ignore it if it's primary. Change-Id: I2f14a187c979ca0c7ad39149ceb0b2b7e61e9ba6 Reviewed-by: Sean Harmer --- src/plugins/platforms/qnx/qqnxintegration.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index bff4dbdc2a..d7370998d5 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -446,6 +446,11 @@ void QQnxIntegration::createDisplays() qFatal("QQnxIntegration: failed to query display count, errno=%d", errno); } + if (displayCount < 1) { + // Never happens, even if there's no display, libscreen returns 1 + qFatal("QQnxIntegration: displayCount=%d", displayCount); + } + // Get all displays errno = 0; screen_display_t *displays = (screen_display_t *)alloca(sizeof(screen_display_t) * displayCount); @@ -454,7 +459,11 @@ void QQnxIntegration::createDisplays() qFatal("QQnxIntegration: failed to query displays, errno=%d", errno); } - for (int i=0; i Date: Tue, 5 Feb 2013 12:00:49 +0100 Subject: doc: Fix QPixmapCache size default value in doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QPixmapCache size default value is always 10 Mb since change I2ac33765 Change-Id: I28c99433948b07e9c84d0afda7aa5a8f49d2cd18 Reviewed-by: Samuel Rødal --- src/gui/image/qpixmapcache.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index 4a8330d9f3..f4d2afed7a 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -75,10 +75,8 @@ QT_BEGIN_NAMESPACE behavior of the QHash and QCache classes. The cache becomes full when the total size of all pixmaps in the - cache exceeds cacheLimit(). The initial cache limit is - 2048 KB (2 MB) on embedded platforms, 10240 KB (10 MB) on desktop - platforms; you can change this by calling setCacheLimit() with the - required value. + cache exceeds cacheLimit(). The initial cache limit is 10240 KB (10 MB); + you can change this by calling setCacheLimit() with the required value. A pixmap takes roughly (\e{width} * \e{height} * \e{depth})/8 bytes of memory. @@ -90,7 +88,7 @@ QT_BEGIN_NAMESPACE \sa QCache, QPixmap */ -static int cache_limit = 10240; // 10 MB cache limit for desktop +static int cache_limit = 10240; // 10 MB cache limit /*! \class QPixmapCache::Key @@ -596,8 +594,7 @@ bool QPixmapCache::replace(const Key &key, const QPixmap &pixmap) /*! Returns the cache limit (in kilobytes). - The default cache limit is 2048 KB on embedded platforms, 10240 KB on - desktop platforms. + The default cache limit is 10240 KB. \sa setCacheLimit() */ @@ -610,8 +607,7 @@ int QPixmapCache::cacheLimit() /*! Sets the cache limit to \a n kilobytes. - The default setting is 2048 KB on embedded platforms, 10240 KB on - desktop platforms. + The default setting is 10240 KB. \sa cacheLimit() */ -- cgit v1.2.3 From 0972067264382d1669b9f53f58cbb82b0a598263 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 4 Feb 2013 16:01:32 +0100 Subject: Fix lupdate-warnings in QSpiAccessibleBridge. linuxaccessibility/bridge.cpp:169: tr() cannot be called without context Change-Id: Ib6bd4db7c4759818ccba8adff73617af7331f318 Reviewed-by: Frederik Gladhorn --- src/platformsupport/linuxaccessibility/bridge.cpp | 128 +++++++++++----------- 1 file changed, 64 insertions(+), 64 deletions(-) (limited to 'src') diff --git a/src/platformsupport/linuxaccessibility/bridge.cpp b/src/platformsupport/linuxaccessibility/bridge.cpp index d42ce8b064..a10358edba 100644 --- a/src/platformsupport/linuxaccessibility/bridge.cpp +++ b/src/platformsupport/linuxaccessibility/bridge.cpp @@ -117,70 +117,70 @@ struct RoleMapping { }; static RoleMapping map[] = { - { QAccessible::NoRole, ATSPI_ROLE_INVALID, QT_TR_NOOP("invalid role") }, - { QAccessible::TitleBar, ATSPI_ROLE_TEXT, QT_TR_NOOP("title bar") }, - { QAccessible::MenuBar, ATSPI_ROLE_MENU_BAR, QT_TR_NOOP("menu bar") }, - { QAccessible::ScrollBar, ATSPI_ROLE_SCROLL_BAR, QT_TR_NOOP("scroll bar") }, - { QAccessible::Grip, ATSPI_ROLE_UNKNOWN, QT_TR_NOOP("grip") }, - { QAccessible::Sound, ATSPI_ROLE_UNKNOWN, QT_TR_NOOP("sound") }, - { QAccessible::Cursor, ATSPI_ROLE_UNKNOWN, QT_TR_NOOP("cursor") }, - { QAccessible::Caret, ATSPI_ROLE_UNKNOWN, QT_TR_NOOP("cursor") }, - { QAccessible::AlertMessage, ATSPI_ROLE_ALERT, QT_TR_NOOP("alert message") }, - { QAccessible::Window, ATSPI_ROLE_WINDOW, QT_TR_NOOP("window") }, - { QAccessible::Client, ATSPI_ROLE_FILLER, QT_TR_NOOP("filler") }, - { QAccessible::PopupMenu, ATSPI_ROLE_POPUP_MENU, QT_TR_NOOP("popup menu") }, - { QAccessible::MenuItem, ATSPI_ROLE_MENU_ITEM, QT_TR_NOOP("menu item") }, - { QAccessible::ToolTip, ATSPI_ROLE_TOOL_TIP, QT_TR_NOOP("tool tip") }, - { QAccessible::Application, ATSPI_ROLE_APPLICATION, QT_TR_NOOP("application") }, - { QAccessible::Document, ATSPI_ROLE_DOCUMENT_FRAME, QT_TR_NOOP("document") }, - { QAccessible::Pane, ATSPI_ROLE_PANEL, QT_TR_NOOP("panel") }, - { QAccessible::Chart, ATSPI_ROLE_CHART, QT_TR_NOOP("chart") }, - { QAccessible::Dialog, ATSPI_ROLE_DIALOG, QT_TR_NOOP("dialog") }, - { QAccessible::Border, ATSPI_ROLE_FRAME, QT_TR_NOOP("frame") }, - { QAccessible::Grouping, ATSPI_ROLE_PANEL, QT_TR_NOOP("panel") }, - { QAccessible::Separator, ATSPI_ROLE_SEPARATOR, QT_TR_NOOP("separator") }, - { QAccessible::ToolBar, ATSPI_ROLE_TOOL_BAR, QT_TR_NOOP("tool bar") }, - { QAccessible::StatusBar, ATSPI_ROLE_STATUS_BAR, QT_TR_NOOP("status bar") }, - { QAccessible::Table, ATSPI_ROLE_TABLE, QT_TR_NOOP("table") }, - { QAccessible::ColumnHeader, ATSPI_ROLE_TABLE_COLUMN_HEADER, QT_TR_NOOP("column header") }, - { QAccessible::RowHeader, ATSPI_ROLE_TABLE_ROW_HEADER, QT_TR_NOOP("row header") }, - { QAccessible::Column, ATSPI_ROLE_TABLE_CELL, QT_TR_NOOP("column") }, - { QAccessible::Row, ATSPI_ROLE_TABLE_ROW, QT_TR_NOOP("row") }, - { QAccessible::Cell, ATSPI_ROLE_TABLE_CELL, QT_TR_NOOP("cell") }, - { QAccessible::Link, ATSPI_ROLE_LINK, QT_TR_NOOP("link") }, - { QAccessible::HelpBalloon, ATSPI_ROLE_DIALOG, QT_TR_NOOP("help balloon") }, - { QAccessible::Assistant, ATSPI_ROLE_DIALOG, QT_TR_NOOP("assistant") }, - { QAccessible::List, ATSPI_ROLE_LIST, QT_TR_NOOP("list") }, - { QAccessible::ListItem, ATSPI_ROLE_LIST_ITEM, QT_TR_NOOP("list item") }, - { QAccessible::Tree, ATSPI_ROLE_TREE, QT_TR_NOOP("tree") }, - { QAccessible::TreeItem, ATSPI_ROLE_TABLE_CELL, QT_TR_NOOP("tree item") }, - { QAccessible::PageTab, ATSPI_ROLE_PAGE_TAB, QT_TR_NOOP("page tab") }, - { QAccessible::PropertyPage, ATSPI_ROLE_PAGE_TAB, QT_TR_NOOP("property page") }, - { QAccessible::Indicator, ATSPI_ROLE_UNKNOWN, QT_TR_NOOP("indicator") }, - { QAccessible::Graphic, ATSPI_ROLE_IMAGE, QT_TR_NOOP("graphic") }, - { QAccessible::StaticText, ATSPI_ROLE_LABEL, QT_TR_NOOP("label") }, - { QAccessible::EditableText, ATSPI_ROLE_TEXT, QT_TR_NOOP("text") }, - { QAccessible::PushButton, ATSPI_ROLE_PUSH_BUTTON, QT_TR_NOOP("push button") }, - { QAccessible::CheckBox, ATSPI_ROLE_CHECK_BOX, QT_TR_NOOP("check box") }, - { QAccessible::RadioButton, ATSPI_ROLE_RADIO_BUTTON, QT_TR_NOOP("radio button") }, - { QAccessible::ComboBox, ATSPI_ROLE_COMBO_BOX, QT_TR_NOOP("combo box") }, - { QAccessible::ProgressBar, ATSPI_ROLE_PROGRESS_BAR, QT_TR_NOOP("progress bar") }, - { QAccessible::Dial, ATSPI_ROLE_DIAL, QT_TR_NOOP("dial") }, - { QAccessible::HotkeyField, ATSPI_ROLE_TEXT, QT_TR_NOOP("hotkey field") }, - { QAccessible::Slider, ATSPI_ROLE_SLIDER, QT_TR_NOOP("slider") }, - { QAccessible::SpinBox, ATSPI_ROLE_SPIN_BUTTON, QT_TR_NOOP("spin box") }, - { QAccessible::Canvas, ATSPI_ROLE_CANVAS, QT_TR_NOOP("canvas") }, - { QAccessible::Animation, ATSPI_ROLE_ANIMATION, QT_TR_NOOP("animation") }, - { QAccessible::Equation, ATSPI_ROLE_TEXT, QT_TR_NOOP("equation") }, - { QAccessible::ButtonDropDown, ATSPI_ROLE_PUSH_BUTTON, QT_TR_NOOP("button drop down") }, - { QAccessible::ButtonMenu, ATSPI_ROLE_PUSH_BUTTON, QT_TR_NOOP("button menu") }, - { QAccessible::ButtonDropGrid, ATSPI_ROLE_PUSH_BUTTON, QT_TR_NOOP("button drop grid") }, - { QAccessible::Whitespace, ATSPI_ROLE_FILLER, QT_TR_NOOP("whitespace") }, - { QAccessible::PageTabList, ATSPI_ROLE_PAGE_TAB_LIST, QT_TR_NOOP("page tab list") }, - { QAccessible::Clock, ATSPI_ROLE_UNKNOWN, QT_TR_NOOP("clock") }, - { QAccessible::Splitter, ATSPI_ROLE_SPLIT_PANE, QT_TR_NOOP("splitter") }, - { QAccessible::LayeredPane, ATSPI_ROLE_LAYERED_PANE, QT_TR_NOOP("layered pane") }, - { QAccessible::UserRole, ATSPI_ROLE_UNKNOWN, QT_TR_NOOP("unknown") } + { QAccessible::NoRole, ATSPI_ROLE_INVALID, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "invalid role") }, + { QAccessible::TitleBar, ATSPI_ROLE_TEXT, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "title bar") }, + { QAccessible::MenuBar, ATSPI_ROLE_MENU_BAR, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "menu bar") }, + { QAccessible::ScrollBar, ATSPI_ROLE_SCROLL_BAR, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "scroll bar") }, + { QAccessible::Grip, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "grip") }, + { QAccessible::Sound, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "sound") }, + { QAccessible::Cursor, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "cursor") }, + { QAccessible::Caret, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "cursor") }, + { QAccessible::AlertMessage, ATSPI_ROLE_ALERT, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "alert message") }, + { QAccessible::Window, ATSPI_ROLE_WINDOW, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "window") }, + { QAccessible::Client, ATSPI_ROLE_FILLER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "filler") }, + { QAccessible::PopupMenu, ATSPI_ROLE_POPUP_MENU, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "popup menu") }, + { QAccessible::MenuItem, ATSPI_ROLE_MENU_ITEM, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "menu item") }, + { QAccessible::ToolTip, ATSPI_ROLE_TOOL_TIP, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "tool tip") }, + { QAccessible::Application, ATSPI_ROLE_APPLICATION, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "application") }, + { QAccessible::Document, ATSPI_ROLE_DOCUMENT_FRAME, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "document") }, + { QAccessible::Pane, ATSPI_ROLE_PANEL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "panel") }, + { QAccessible::Chart, ATSPI_ROLE_CHART, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "chart") }, + { QAccessible::Dialog, ATSPI_ROLE_DIALOG, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "dialog") }, + { QAccessible::Border, ATSPI_ROLE_FRAME, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "frame") }, + { QAccessible::Grouping, ATSPI_ROLE_PANEL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "panel") }, + { QAccessible::Separator, ATSPI_ROLE_SEPARATOR, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "separator") }, + { QAccessible::ToolBar, ATSPI_ROLE_TOOL_BAR, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "tool bar") }, + { QAccessible::StatusBar, ATSPI_ROLE_STATUS_BAR, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "status bar") }, + { QAccessible::Table, ATSPI_ROLE_TABLE, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "table") }, + { QAccessible::ColumnHeader, ATSPI_ROLE_TABLE_COLUMN_HEADER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "column header") }, + { QAccessible::RowHeader, ATSPI_ROLE_TABLE_ROW_HEADER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "row header") }, + { QAccessible::Column, ATSPI_ROLE_TABLE_CELL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "column") }, + { QAccessible::Row, ATSPI_ROLE_TABLE_ROW, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "row") }, + { QAccessible::Cell, ATSPI_ROLE_TABLE_CELL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "cell") }, + { QAccessible::Link, ATSPI_ROLE_LINK, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "link") }, + { QAccessible::HelpBalloon, ATSPI_ROLE_DIALOG, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "help balloon") }, + { QAccessible::Assistant, ATSPI_ROLE_DIALOG, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "assistant") }, + { QAccessible::List, ATSPI_ROLE_LIST, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "list") }, + { QAccessible::ListItem, ATSPI_ROLE_LIST_ITEM, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "list item") }, + { QAccessible::Tree, ATSPI_ROLE_TREE, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "tree") }, + { QAccessible::TreeItem, ATSPI_ROLE_TABLE_CELL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "tree item") }, + { QAccessible::PageTab, ATSPI_ROLE_PAGE_TAB, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "page tab") }, + { QAccessible::PropertyPage, ATSPI_ROLE_PAGE_TAB, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "property page") }, + { QAccessible::Indicator, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "indicator") }, + { QAccessible::Graphic, ATSPI_ROLE_IMAGE, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "graphic") }, + { QAccessible::StaticText, ATSPI_ROLE_LABEL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "label") }, + { QAccessible::EditableText, ATSPI_ROLE_TEXT, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "text") }, + { QAccessible::PushButton, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "push button") }, + { QAccessible::CheckBox, ATSPI_ROLE_CHECK_BOX, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "check box") }, + { QAccessible::RadioButton, ATSPI_ROLE_RADIO_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "radio button") }, + { QAccessible::ComboBox, ATSPI_ROLE_COMBO_BOX, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "combo box") }, + { QAccessible::ProgressBar, ATSPI_ROLE_PROGRESS_BAR, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "progress bar") }, + { QAccessible::Dial, ATSPI_ROLE_DIAL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "dial") }, + { QAccessible::HotkeyField, ATSPI_ROLE_TEXT, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "hotkey field") }, + { QAccessible::Slider, ATSPI_ROLE_SLIDER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "slider") }, + { QAccessible::SpinBox, ATSPI_ROLE_SPIN_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "spin box") }, + { QAccessible::Canvas, ATSPI_ROLE_CANVAS, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "canvas") }, + { QAccessible::Animation, ATSPI_ROLE_ANIMATION, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "animation") }, + { QAccessible::Equation, ATSPI_ROLE_TEXT, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "equation") }, + { QAccessible::ButtonDropDown, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "button drop down") }, + { QAccessible::ButtonMenu, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "button menu") }, + { QAccessible::ButtonDropGrid, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "button drop grid") }, + { QAccessible::Whitespace, ATSPI_ROLE_FILLER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "whitespace") }, + { QAccessible::PageTabList, ATSPI_ROLE_PAGE_TAB_LIST, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "page tab list") }, + { QAccessible::Clock, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "clock") }, + { QAccessible::Splitter, ATSPI_ROLE_SPLIT_PANE, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "splitter") }, + { QAccessible::LayeredPane, ATSPI_ROLE_LAYERED_PANE, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "layered pane") }, + { QAccessible::UserRole, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "unknown") } }; void QSpiAccessibleBridge::initializeConstantMappings() -- cgit v1.2.3 From d81edc440b259203b5858898c3575d3a9a592851 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 4 Feb 2013 16:04:00 +0100 Subject: Fix lupdate-warnings in simplewidgets.cpp. simplewidgets.cpp:429: Discarding unconsumed meta data simplewidgets.cpp:535: Discarding unconsumed meta data Change-Id: Icd9686392781eb1faa7868dc4c92d26fa44c4f94 Reviewed-by: Frederik Gladhorn --- src/plugins/accessible/widgets/simplewidgets.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp index 48f973c30d..a9a43a7875 100644 --- a/src/plugins/accessible/widgets/simplewidgets.cpp +++ b/src/plugins/accessible/widgets/simplewidgets.cpp @@ -424,7 +424,7 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const /*! \reimp */ QVector > -QAccessibleDisplay::relations(QAccessible::Relation match /*= QAccessible::AllRelations*/) const +QAccessibleDisplay::relations(QAccessible::Relation match /* = QAccessible::AllRelations */) const { QVector > rels = QAccessibleWidget::relations(match); if (match & QAccessible::Labelled) { @@ -530,7 +530,7 @@ QAccessible::Role QAccessibleGroupBox::role() const } QVector > -QAccessibleGroupBox::relations(QAccessible::Relation match /*= QAccessible::AllRelations*/) const +QAccessibleGroupBox::relations(QAccessible::Relation match /* = QAccessible::AllRelations */) const { QVector > rels = QAccessibleWidget::relations(match); -- cgit v1.2.3 From 655ba5755696df8e2594bca9f7696ab621f5afc3 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 5 Feb 2013 13:39:33 +0100 Subject: Cocoa QPA: Fix compilation error The error appeared with latest clang as of Feb. 5, 2013. Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.2.0 Change-Id: I8df8cccc941ac03a7a997bdd5afe095b7b6f65d3 Reviewed-by: Frederik Gladhorn --- src/plugins/platforms/cocoa/qcocoawindow.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index 3b5be0af0f..324a43c8ae 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -49,7 +49,8 @@ #include "qcocoaglcontext.h" #include "qnsview.h" -class QT_PREPEND_NAMESPACE(QCocoaWindow); + +QT_FORWARD_DECLARE_CLASS(QCocoaWindow) @interface QNSWindow : NSWindow { @public QCocoaWindow *m_cocoaPlatformWindow; -- cgit v1.2.3 From 1de63171eec5ae634968cbe1e2343b1c6918226d Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Sat, 2 Feb 2013 02:35:08 +0000 Subject: QScroller was introduced in Qt 5.0, not 4.8 Task-number: QTBUG-29365 Change-Id: I11804bf51f1537dcd7f40d7ec02022d8fb76c1e8 Reviewed-by: Jerome Pasion --- src/widgets/util/qscroller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3 From 334101df92ece6becf1b342ae4b79cb3bf726a69 Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Sat, 2 Feb 2013 07:27:05 +0000 Subject: Do not use the non-existent state() method reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-29094 Change-Id: I715018a82b7f8405dee023cbe5f2481883cad3e2 Reviewed-by: Topi Reiniö Reviewed-by: Jerome Pasion --- src/corelib/xml/qxmlstream.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index 455df4ec73..4be4593e95 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -1958,7 +1958,7 @@ QStringRef QXmlStreamReader::text() const } -/*! If the state() is \l DTD, this function returns the DTD's +/*! If the tokenType() is \l DTD, this function returns the DTD's notation declarations. Otherwise an empty vector is returned. The QXmlStreamNotationDeclarations class is defined to be a QVector @@ -1973,7 +1973,7 @@ QXmlStreamNotationDeclarations QXmlStreamReader::notationDeclarations() const } -/*! If the state() is \l DTD, this function returns the DTD's +/*! If the tokenType() is \l DTD, this function returns the DTD's unparsed (external) entity declarations. Otherwise an empty vector is returned. The QXmlStreamEntityDeclarations class is defined to be a QVector @@ -1990,7 +1990,7 @@ QXmlStreamEntityDeclarations QXmlStreamReader::entityDeclarations() const /*! \since 4.4 - If the state() is \l DTD, this function returns the DTD's + If the tokenType() is \l DTD, this function returns the DTD's name. Otherwise an empty string is returned. */ @@ -2005,7 +2005,7 @@ QStringRef QXmlStreamReader::dtdName() const /*! \since 4.4 - If the state() is \l DTD, this function returns the DTD's + If the tokenType() is \l DTD, this function returns the DTD's public identifier. Otherwise an empty string is returned. */ @@ -2020,7 +2020,7 @@ QStringRef QXmlStreamReader::dtdPublicId() const /*! \since 4.4 - If the state() is \l DTD, this function returns the DTD's + If the tokenType() is \l DTD, this function returns the DTD's system identifier. Otherwise an empty string is returned. */ @@ -2032,7 +2032,7 @@ QStringRef QXmlStreamReader::dtdSystemId() const return QStringRef(); } -/*! If the state() is \l StartElement, this function returns the +/*! If the tokenType() is \l StartElement, this function returns the element's namespace declarations. Otherwise an empty vector is returned. @@ -2845,7 +2845,7 @@ bool QXmlStreamReader::isStandaloneDocument() const /*! \since 4.4 - If the state() is \l StartDocument, this function returns the + If the tokenType() is \l StartDocument, this function returns the version string as specified in the XML declaration. Otherwise an empty string is returned. */ @@ -2860,7 +2860,7 @@ QStringRef QXmlStreamReader::documentVersion() const /*! \since 4.4 - If the state() is \l StartDocument, this function returns the + If the tokenType() is \l StartDocument, this function returns the encoding string as specified in the XML declaration. Otherwise an empty string is returned. */ -- cgit v1.2.3 From 1d9863658db1c996997f0a203640da33a59156b1 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 1 Feb 2013 11:45:38 +0100 Subject: Doc: Fix filenames for nested classes generated by qdoc Generator::fullDocumentLocation() adds a parent class name twice into the generated filename for nested classes, which not correct. This change fixes the issue and makes documentation for nested classes work in Qt Creator (qch files). Task-number: QTBUG-29440 Change-Id: I489800ba09f49dda2befef73634cb2b344be0060 Reviewed-by: Jerome Pasion Reviewed-by: Martin Smith --- src/tools/qdoc/generator.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index 46d45f7008..95ba6d28bf 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -476,13 +476,7 @@ QString Generator::fullDocumentLocation(const Node *node, bool subdir) switch (node->type()) { case Node::Class: case Node::Namespace: - if (parentNode && !parentNode->name().isEmpty()) { - parentName.remove(QLatin1Char('.') + currentGenerator()->fileExtension()); - parentName += QLatin1Char('-') - + fileBase(node).toLower() + QLatin1Char('.') + currentGenerator()->fileExtension(); - } else { - parentName = fileBase(node) + QLatin1Char('.') + currentGenerator()->fileExtension(); - } + parentName = fileBase(node) + QLatin1Char('.') + currentGenerator()->fileExtension(); break; case Node::Function: { -- cgit v1.2.3 From d7cad756efc89281f0294fec4ce84df1188c8aad Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 5 Feb 2013 19:03:25 +0100 Subject: Replace nokia in example by Qt Project Change-Id: I23adfd6a1cf02c8c99996b698fb780988434b9a7 Reviewed-by: Gabriel de Dietrich --- src/corelib/doc/snippets/qstring/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp index 0fdb88cd8b..6149e9d051 100644 --- a/src/corelib/doc/snippets/qstring/main.cpp +++ b/src/corelib/doc/snippets/qstring/main.cpp @@ -856,8 +856,8 @@ void Widget::toLongLongFunction() void Widget::toLowerFunction() { //! [75] - QString str = "Qt by NOKIA"; - str = str.toLower(); // str == "qt by nokia" + QString str = "The QT PROJECT"; + str = str.toLower(); // str == "the qt project" //! [75] } -- cgit v1.2.3 From a1f4a821fc068958621c4d1aad5a366e77c46399 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 5 Feb 2013 19:27:37 +0100 Subject: Nokia -> Qt Project Change-Id: Iadd29ee918dc181d2a468f5198e66351c7cb3548 Reviewed-by: Simon Hausmann --- src/gui/doc/snippets/code/src_gui_painting_qpainter.cpp | 2 +- src/network/kernel/qurlinfo.cpp | 2 +- src/tools/qdoc/doc/qdoc-manual.qdoc | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gui/doc/snippets/code/src_gui_painting_qpainter.cpp b/src/gui/doc/snippets/code/src_gui_painting_qpainter.cpp index 79cef3b5ef..6a012879d4 100644 --- a/src/gui/doc/snippets/code/src_gui_painting_qpainter.cpp +++ b/src/gui/doc/snippets/code/src_gui_painting_qpainter.cpp @@ -213,7 +213,7 @@ painter.drawPixmap(target, image, source); //! [17] QPainter painter(this); -painter.drawText(rect, Qt::AlignCenter, tr("Qt by\nNokia")); +painter.drawText(rect, Qt::AlignCenter, tr("Qt\nProject")); //! [17] diff --git a/src/network/kernel/qurlinfo.cpp b/src/network/kernel/qurlinfo.cpp index db5105a52b..89d48639cf 100644 --- a/src/network/kernel/qurlinfo.cpp +++ b/src/network/kernel/qurlinfo.cpp @@ -217,7 +217,7 @@ QUrlInfo::QUrlInfo(const QUrl &url, int permissions, const QString &owner, /*! Sets the name of the URL to \a name. The name is the full text, - for example, "http://qt.nokia.com/doc/qurlinfo.html". + for example, "http://qt-project.org/doc/qt-5.0/qtcore/qurl.html". If you call this function for an invalid URL info, this function turns it into a valid one. diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc index f157f0a2d9..acf3b34153 100644 --- a/src/tools/qdoc/doc/qdoc-manual.qdoc +++ b/src/tools/qdoc/doc/qdoc-manual.qdoc @@ -4061,10 +4061,10 @@ the QWidget class is the base class of all user interface objects. Qt Development Frameworks - Nokia + Qt Project - - Nokia + + Qt Project @@ -7313,9 +7313,9 @@ \code dita.metadata.default.author = Qt Development Frameworks dita.metadata.default.permissions = all - dita.metadata.default.publisher = Nokia - dita.metadata.default.copyryear = 2011 - dita.metadata.default.copyrholder = Nokia + dita.metadata.default.publisher = Qt Project + dita.metadata.default.copyryear = 2013 + dita.metadata.default.copyrholder = Qt Project dita.metadata.default.audience = programmer \endcode -- cgit v1.2.3 From a694b9f8d204d6555caf4e30dbd18f536859c5bd Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Sat, 26 Jan 2013 23:09:24 +0100 Subject: fix QSqlTableModel::headerData() for empty query with inserted row QSqlQueryModel::headerData() relied on virtual indexInQuery() to detect whether the requested column at row 0 mapped to an index in the query. This failed when row 0 was a pending insert managed by QSqlTableModel, and therefore not in the query. The only thing that matters here is the column. Task-number: QTBUG-29108 Change-Id: I3e0ae85ba223e444781ec8033386d394bb44f0e8 Reviewed-by: Andy Shaw Reviewed-by: Mark Brand --- src/sql/models/qsqlquerymodel.cpp | 21 +++++++++++---------- src/sql/models/qsqlquerymodel_p.h | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/sql/models/qsqlquerymodel.cpp b/src/sql/models/qsqlquerymodel.cpp index 59103b72d3..00fc410ca5 100644 --- a/src/sql/models/qsqlquerymodel.cpp +++ b/src/sql/models/qsqlquerymodel.cpp @@ -95,6 +95,13 @@ void QSqlQueryModelPrivate::initColOffsets(int size) memset(colOffsets.data(), 0, colOffsets.size() * sizeof(int)); } +int QSqlQueryModelPrivate::columnInQuery(int modelColumn) const +{ + if (modelColumn < 0 || modelColumn >= rec.count() || !rec.isGenerated(modelColumn) || modelColumn >= colOffsets.size()) + return -1; + return modelColumn - colOffsets[modelColumn]; +} + /*! \class QSqlQueryModel \brief The QSqlQueryModel class provides a read-only data model for SQL @@ -370,11 +377,7 @@ QVariant QSqlQueryModel::headerData(int section, Qt::Orientation orientation, in val = d->headers.value(section).value(Qt::EditRole); if (val.isValid()) return val; - - // See if it's an inserted column (iiq.column() != -1) - QModelIndex dItem = indexInQuery(createIndex(0, section)); - - if (role == Qt::DisplayRole && d->rec.count() > section && dItem.column() != -1) + if (role == Qt::DisplayRole && d->rec.count() > section && d->columnInQuery(section) != -1) return d->rec.fieldName(section); } return QAbstractItemModel::headerData(section, orientation, role); @@ -668,12 +671,10 @@ bool QSqlQueryModel::removeColumns(int column, int count, const QModelIndex &par QModelIndex QSqlQueryModel::indexInQuery(const QModelIndex &item) const { Q_D(const QSqlQueryModel); - if (item.column() < 0 || item.column() >= d->rec.count() - || !d->rec.isGenerated(item.column()) - || item.column() >= d->colOffsets.size()) + int modelColumn = d->columnInQuery(item.column()); + if (modelColumn < 0) return QModelIndex(); - return createIndex(item.row(), item.column() - d->colOffsets[item.column()], - item.internalPointer()); + return createIndex(item.row(), modelColumn, item.internalPointer()); } QT_END_NAMESPACE diff --git a/src/sql/models/qsqlquerymodel_p.h b/src/sql/models/qsqlquerymodel_p.h index ecf69003f4..a79b62cda1 100644 --- a/src/sql/models/qsqlquerymodel_p.h +++ b/src/sql/models/qsqlquerymodel_p.h @@ -72,6 +72,7 @@ public: void prefetch(int); void initColOffsets(int size); + int columnInQuery(int modelColumn) const; mutable QSqlQuery query; mutable QSqlError error; -- cgit v1.2.3 From 33c212b7d25726b78c4bf630548a76feaab872f0 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Wed, 30 Jan 2013 00:39:53 +0100 Subject: QSqlTableModel::setData(): fix non-change detection Commit 10ff9de91bedf93852f13a58287afd8831644759 introduced the optimization of ignoring non-changes, but it overshot the mark. It neglected to consider that QVariant's equality operator does not compare the null flag. It also failed to consider that setData() has a useful side effect of setting the generated flag in a column of a pending INSERT. This is important when the application actually wants a NULL to be inserted into the column. Task-number: QTBUG-29217 Change-Id: I1368f7acc21eebfeb5a8d23746fc38f6f30fd395 Reviewed-by: Andy Shaw Reviewed-by: Mark Brand --- src/sql/models/qsqltablemodel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index 32dd517a7a..a2a83e6a4b 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -587,7 +587,10 @@ bool QSqlTableModel::setData(const QModelIndex &index, const QVariant &value, in if (!(flags(index) & Qt::ItemIsEditable)) return false; - if (QSqlTableModel::data(index, role) == value) + const QVariant oldValue = QSqlTableModel::data(index, role); + if (value == oldValue + && value.isNull() == oldValue.isNull() + && d->cache.value(index.row()).op() != QSqlTableModelPrivate::Insert) return true; QSqlTableModelPrivate::ModifiedRow &row = d->cache[index.row()]; -- cgit v1.2.3 From c3ae1c76f349bac2e262929d29163cd9b5d60332 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Sun, 27 Jan 2013 17:13:24 +0100 Subject: QSqlTableModel: support refreshing inserted rows with auto columns Previously, selectRow() did not work after INSERTing a new row into a table with an automatically populated column. It did not work because the model did not know the primary values for the new row. Newly inserted rows were therefore not refreshed in OnFieldChange and OnRowChange edit strategies. This change provides support for the typical simple case where a single column is populated by the database and can be retrieved with QSqlQuery::lastInsertId(). Task-Number: QTBUG-29102 Change-Id: Ibf0f0ac8661185bde57034ddf40c2178bece4778 Reviewed-by: Andy Shaw Reviewed-by: Lukas Geyer Reviewed-by: Mark Brand --- src/sql/models/qsqltablemodel.cpp | 15 +++++++++++++++ src/sql/models/qsqltablemodel_p.h | 1 + 2 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index a2a83e6a4b..2822c8bb73 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -355,6 +355,16 @@ void QSqlTableModel::setTable(const QString &tableName) if (d->rec.count() == 0) d->error = QSqlError(QLatin1String("Unable to find table ") + d->tableName, QString(), QSqlError::StatementError); + + // Remember the auto index column if there is one now. + // The record that will be obtained from the query after select lacks this feature. + d->autoColumn.clear(); + for (int c = 0; c < d->rec.count(); ++c) { + if (d->rec.field(c).isAutoValue()) { + d->autoColumn = d->rec.fieldName(c); + break; + } + } } /*! @@ -775,6 +785,11 @@ bool QSqlTableModel::submitAll() } if (success) { + if (d->strategy != OnManualSubmit && mrow.op() == QSqlTableModelPrivate::Insert) { + int c = mrow.rec().indexOf(d->autoColumn); + if (c != -1 && !mrow.rec().isGenerated(c)) + mrow.setValue(c, d->editQuery.lastInsertId()); + } mrow.setSubmitted(); if (d->strategy != OnManualSubmit) success = selectRow(row); diff --git a/src/sql/models/qsqltablemodel_p.h b/src/sql/models/qsqltablemodel_p.h index 56db09b7e0..825490ea39 100644 --- a/src/sql/models/qsqltablemodel_p.h +++ b/src/sql/models/qsqltablemodel_p.h @@ -96,6 +96,7 @@ public: QSqlIndex primaryIndex; QString tableName; QString filter; + QString autoColumn; enum Op { None, Insert, Update, Delete }; -- cgit v1.2.3 From af84313c622af880e95d461ea8b7dbca58d2dffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 5 Feb 2013 09:44:26 +0100 Subject: Fixed crash in image reader when reading certain BMP files. If the high bit in a mask is set, for instance if the mask is 0xff000000, and we shift it to the right by 24 positions, since the mask was not declared as unsigned we ended up with a mask value of 0xffffffff. We then add 1 to this value and divide by the result, causing a division by zero crash. The masks need to be declared unsigned to prevent sign bit extension when shifting right. Task-number: QTBUG-29194 Change-Id: I79260344cebfbdd3ea86416a9c734dca76517999 Reviewed-by: Gunnar Sletta --- src/gui/image/qbmphandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp index 062714c769..6abde5e420 100644 --- a/src/gui/image/qbmphandler.cpp +++ b/src/gui/image/qbmphandler.cpp @@ -143,7 +143,7 @@ static QDataStream &operator<<(QDataStream &s, const BMP_INFOHDR &bi) return s; } -static int calc_shift(int mask) +static int calc_shift(uint mask) { int result = 0; while (mask && !(mask & 1)) { @@ -207,9 +207,9 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int #endif int w = bi.biWidth, h = bi.biHeight, nbits = bi.biBitCount; int t = bi.biSize, comp = bi.biCompression; - int red_mask = 0; - int green_mask = 0; - int blue_mask = 0; + uint red_mask = 0; + uint green_mask = 0; + uint blue_mask = 0; int red_shift = 0; int green_shift = 0; int blue_shift = 0; -- cgit v1.2.3 From 20204fe58b77d7f62d3dac4e574bdef528199518 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Tue, 5 Feb 2013 16:43:07 +0100 Subject: Do not crash if the child index is out of range. Task-number: QTBUG-29077 Change-Id: I934101cdc121e9ef99de2e9eeaef154dd4cae0d8 Reviewed-by: Frederik Gladhorn --- .../platforms/windows/accessible/qwindowsmsaaaccessible.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp index 7cc2b2aeb0..c23902014c 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp +++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp @@ -577,9 +577,10 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accLocation(long *pxLeft, long QRect rect; if (varID.lVal) { - QAIPointer child = QAIPointer(accessible->child(varID.lVal - 1)); - if (child->isValid()) - rect = child->rect(); + QAIPointer child(childPointer(varID)); + if (!child) + return E_FAIL; + rect = child->rect(); } else { rect = accessible->rect(); } -- cgit v1.2.3 From 7502a7838847b27f537e4817a392f755313a37a5 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Wed, 6 Feb 2013 10:23:24 +0100 Subject: Check if the interface pointer is valid to avoid a potential crash. Change-Id: I7e6634b799e551786d6cbc85e2d526b7874ada3d Reviewed-by: Frederik Gladhorn --- src/platformsupport/linuxaccessibility/atspiadaptor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index 3d91f883f9..057d562264 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -1181,7 +1181,7 @@ void AtSpiAdaptor::notifyAboutCreation(const QAIPointer &interface) const void AtSpiAdaptor::notifyAboutDestruction(const QAIPointer &interface) const { - if (!interface->isValid()) + if (!interface || !interface->isValid()) return; QAIPointer parent(interface->parent()); -- cgit v1.2.3 From 5bf3fb34bedbbf56bc567232fdafd35a37e21814 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 4 Feb 2013 15:59:55 +0100 Subject: Fix lupdate-warning in qnetworkreplyhttpimpl.cpp. qnetworkreplyhttpimpl.cpp:666: Cannot invoke tr() like this. Change-Id: I3baf448f2118b108c32dcddc7e408b2b75542eab Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- src/network/access/qnetworkreplyhttpimpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index 480598918f..1520816e8d 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -663,7 +663,7 @@ void QNetworkReplyHttpImplPrivate::postRequest() // unsuitable proxies QMetaObject::invokeMethod(q, "_q_error", synchronous ? Qt::DirectConnection : Qt::QueuedConnection, Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ProxyNotFoundError), - Q_ARG(QString, q->tr("No suitable proxy found"))); + Q_ARG(QString, QNetworkReplyHttpImpl::tr("No suitable proxy found"))); QMetaObject::invokeMethod(q, "_q_finished", synchronous ? Qt::DirectConnection : Qt::QueuedConnection); return; } -- cgit v1.2.3 From 05ce12849b2e266210b71a432ce65883a1fdbe60 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 6 Feb 2013 09:48:46 +0100 Subject: Spell "Qt" correctly Change-Id: Idf2b5c888f159ee8ffdb81ed74e685c40951c6b4 Reviewed-by: Frederik Gladhorn --- src/corelib/doc/snippets/qstring/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp index 6149e9d051..6ee3088138 100644 --- a/src/corelib/doc/snippets/qstring/main.cpp +++ b/src/corelib/doc/snippets/qstring/main.cpp @@ -856,7 +856,7 @@ void Widget::toLongLongFunction() void Widget::toLowerFunction() { //! [75] - QString str = "The QT PROJECT"; + QString str = "The Qt PROJECT"; str = str.toLower(); // str == "the qt project" //! [75] } -- cgit v1.2.3 From ba2a0d652c3366638fb18218b632de8512fb1c9c Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Wed, 6 Feb 2013 11:06:17 +0100 Subject: Clean up whitespace Change-Id: I3413e0f55df07a35ad2e93da9bae2ca7f9b8d4c1 Reviewed-by: Oswald Buddenhagen --- src/corelib/xml/qxmlstream.g | 58 +++++++++++++++++++++--------------------- src/corelib/xml/qxmlstream_p.h | 58 +++++++++++++++++++++--------------------- 2 files changed, 58 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/corelib/xml/qxmlstream.g b/src/corelib/xml/qxmlstream.g index dc0bb353c9..cd7b4fe14e 100644 --- a/src/corelib/xml/qxmlstream.g +++ b/src/corelib/xml/qxmlstream.g @@ -207,18 +207,18 @@ public: inline QStringRef addToStringStorage(const QStringRef &s) { int pos = tagStackStringStorageSize; - int sz = s.size(); - if (pos != tagStackStringStorage.size()) - tagStackStringStorage.resize(pos); + int sz = s.size(); + if (pos != tagStackStringStorage.size()) + tagStackStringStorage.resize(pos); tagStackStringStorage.insert(pos, s.unicode(), sz); tagStackStringStorageSize += sz; return QStringRef(&tagStackStringStorage, pos, sz); } inline QStringRef addToStringStorage(const QString &s) { int pos = tagStackStringStorageSize; - int sz = s.size(); - if (pos != tagStackStringStorage.size()) - tagStackStringStorage.resize(pos); + int sz = s.size(); + if (pos != tagStackStringStorage.size()) + tagStackStringStorage.resize(pos); tagStackStringStorage.insert(pos, s.unicode(), sz); tagStackStringStorageSize += sz; return QStringRef(&tagStackStringStorage, pos, sz); @@ -525,7 +525,7 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::StartElement: name.clear(); prefix.clear(); - qualifiedName.clear(); + qualifiedName.clear(); namespaceUri.clear(); if (publicNamespaceDeclarations.size()) publicNamespaceDeclarations.clear(); @@ -536,7 +536,7 @@ bool QXmlStreamReaderPrivate::parse() Tag &tag = tagStack_pop(); namespaceUri = tag.namespaceDeclaration.namespaceUri; name = tag.name; - qualifiedName = tag.qualifiedName; + qualifiedName = tag.qualifiedName; isEmptyElement = false; return true; } @@ -545,7 +545,7 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::EndElement: name.clear(); prefix.clear(); - qualifiedName.clear(); + qualifiedName.clear(); namespaceUri.clear(); clearTextBuffer(); break; @@ -559,7 +559,7 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::Comment: case QXmlStreamReader::Characters: isCDATA = false; - isWhitespace = true; + isWhitespace = true; text.clear(); clearTextBuffer(); break; @@ -571,21 +571,21 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::ProcessingInstruction: processingInstructionTarget.clear(); processingInstructionData.clear(); - clearTextBuffer(); + clearTextBuffer(); break; case QXmlStreamReader::NoToken: case QXmlStreamReader::Invalid: break; case QXmlStreamReader::StartDocument: - lockEncoding = true; + lockEncoding = true; documentVersion.clear(); documentEncoding.clear(); #ifndef QT_NO_TEXTCODEC - if(decoder->hasFailure()) { - raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content.")); - readBuffer.clear(); - return false; - } + if (decoder->hasFailure()) { + raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content.")); + readBuffer.clear(); + return false; + } #endif // fall through default: @@ -1225,7 +1225,7 @@ cdata ::= langle_bang CDATA_START; case $rule_number: { setType(QXmlStreamReader::Characters); isCDATA = true; - isWhitespace = false; + isWhitespace = false; int pos = sym(2).pos; if (scanUntil("]]>", -1)) { text = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 3); @@ -1294,7 +1294,7 @@ scan_content_char ::= SPACE; resume($rule_number); return false; } - break; + break; ./ content_char_list ::= content_char_list char_ref; @@ -1310,11 +1310,11 @@ content_char_list ::= scan_content_char; character_content ::= content_char_list %prec SHIFT_THERE; /. case $rule_number: - if (!textBuffer.isEmpty()) { + if (!textBuffer.isEmpty()) { setType(QXmlStreamReader::Characters); text = &textBuffer; - } - break; + } + break; ./ literal ::= QUOTE QUOTE; @@ -1361,7 +1361,7 @@ literal_content_start ::= LETTER | DIGIT | RANGLE | HASH | LBRACK | RBRACK | LPA literal_content_start ::= SPACE; /. case $rule_number: - if (normalizeLiterals) + if (normalizeLiterals) textBuffer.data()[textBuffer.size()-1] = QLatin1Char(' '); break; ./ @@ -1405,7 +1405,7 @@ entity_value ::= QUOTE entity_value_content_with_dblquote QUOTE; entity_value ::= DBLQUOTE entity_value_content_with_quote DBLQUOTE; /. case $rule_number: - sym(1) = sym(2); + sym(1) = sym(2); break; ./ @@ -1609,7 +1609,7 @@ unresolved_entity ::= UNRESOLVED_ENTITY; } setType(QXmlStreamReader::EntityReference); name = &unresolvedEntity; - break; + break; ./ entity_ref ::= AMPERSAND name SEMICOLON; @@ -1646,10 +1646,10 @@ entity_ref ::= AMPERSAND name SEMICOLON; } } - injectToken(UNRESOLVED_ENTITY); - unresolvedEntity = symString(2).toString(); - textBuffer.chop(2 + sym(2).len); - clearSym(); + injectToken(UNRESOLVED_ENTITY); + unresolvedEntity = symString(2).toString(); + textBuffer.chop(2 + sym(2).len); + clearSym(); } break; ./ diff --git a/src/corelib/xml/qxmlstream_p.h b/src/corelib/xml/qxmlstream_p.h index 8276fe2721..68b7ff7af3 100644 --- a/src/corelib/xml/qxmlstream_p.h +++ b/src/corelib/xml/qxmlstream_p.h @@ -701,18 +701,18 @@ public: inline QStringRef addToStringStorage(const QStringRef &s) { int pos = tagStackStringStorageSize; - int sz = s.size(); - if (pos != tagStackStringStorage.size()) - tagStackStringStorage.resize(pos); + int sz = s.size(); + if (pos != tagStackStringStorage.size()) + tagStackStringStorage.resize(pos); tagStackStringStorage.insert(pos, s.unicode(), sz); tagStackStringStorageSize += sz; return QStringRef(&tagStackStringStorage, pos, sz); } inline QStringRef addToStringStorage(const QString &s) { int pos = tagStackStringStorageSize; - int sz = s.size(); - if (pos != tagStackStringStorage.size()) - tagStackStringStorage.resize(pos); + int sz = s.size(); + if (pos != tagStackStringStorage.size()) + tagStackStringStorage.resize(pos); tagStackStringStorage.insert(pos, s.unicode(), sz); tagStackStringStorageSize += sz; return QStringRef(&tagStackStringStorage, pos, sz); @@ -1019,7 +1019,7 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::StartElement: name.clear(); prefix.clear(); - qualifiedName.clear(); + qualifiedName.clear(); namespaceUri.clear(); if (publicNamespaceDeclarations.size()) publicNamespaceDeclarations.clear(); @@ -1030,7 +1030,7 @@ bool QXmlStreamReaderPrivate::parse() Tag &tag = tagStack_pop(); namespaceUri = tag.namespaceDeclaration.namespaceUri; name = tag.name; - qualifiedName = tag.qualifiedName; + qualifiedName = tag.qualifiedName; isEmptyElement = false; return true; } @@ -1039,7 +1039,7 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::EndElement: name.clear(); prefix.clear(); - qualifiedName.clear(); + qualifiedName.clear(); namespaceUri.clear(); clearTextBuffer(); break; @@ -1053,7 +1053,7 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::Comment: case QXmlStreamReader::Characters: isCDATA = false; - isWhitespace = true; + isWhitespace = true; text.clear(); clearTextBuffer(); break; @@ -1065,21 +1065,21 @@ bool QXmlStreamReaderPrivate::parse() case QXmlStreamReader::ProcessingInstruction: processingInstructionTarget.clear(); processingInstructionData.clear(); - clearTextBuffer(); + clearTextBuffer(); break; case QXmlStreamReader::NoToken: case QXmlStreamReader::Invalid: break; case QXmlStreamReader::StartDocument: - lockEncoding = true; + lockEncoding = true; documentVersion.clear(); documentEncoding.clear(); #ifndef QT_NO_TEXTCODEC - if(decoder->hasFailure()) { - raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content.")); - readBuffer.clear(); - return false; - } + if (decoder->hasFailure()) { + raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content.")); + readBuffer.clear(); + return false; + } #endif // fall through default: @@ -1550,7 +1550,7 @@ bool QXmlStreamReaderPrivate::parse() case 101: { setType(QXmlStreamReader::Characters); isCDATA = true; - isWhitespace = false; + isWhitespace = false; int pos = sym(2).pos; if (scanUntil("]]>", -1)) { text = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 3); @@ -1597,14 +1597,14 @@ bool QXmlStreamReaderPrivate::parse() resume(130); return false; } - break; + break; case 139: - if (!textBuffer.isEmpty()) { + if (!textBuffer.isEmpty()) { setType(QXmlStreamReader::Characters); text = &textBuffer; - } - break; + } + break; case 140: case 141: @@ -1624,7 +1624,7 @@ bool QXmlStreamReaderPrivate::parse() break; case 173: - if (normalizeLiterals) + if (normalizeLiterals) textBuffer.data()[textBuffer.size()-1] = QLatin1Char(' '); break; @@ -1651,7 +1651,7 @@ bool QXmlStreamReaderPrivate::parse() case 178: case 179: - sym(1) = sym(2); + sym(1) = sym(2); break; case 180: @@ -1789,7 +1789,7 @@ bool QXmlStreamReaderPrivate::parse() } setType(QXmlStreamReader::EntityReference); name = &unresolvedEntity; - break; + break; case 240: { sym(1).len += sym(2).len + 1; @@ -1823,10 +1823,10 @@ bool QXmlStreamReaderPrivate::parse() } } - injectToken(UNRESOLVED_ENTITY); - unresolvedEntity = symString(2).toString(); - textBuffer.chop(2 + sym(2).len); - clearSym(); + injectToken(UNRESOLVED_ENTITY); + unresolvedEntity = symString(2).toString(); + textBuffer.chop(2 + sym(2).len); + clearSym(); } break; -- cgit v1.2.3 From b3820b12fbded1f173837eee7f7559783e92b46b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 6 Feb 2013 11:38:26 +0100 Subject: Windows: Fix setting of layered windows. The setting/clearing of WS_EX_LAYERED in the backing store interfered with the setting/clearing in setWindowOpacity when combining translucent and non-opaque windows. Introduce QWindowsWindow::setWindowLayered to handle it consistently. Task-number: QTBUG-29010 Task-number: QTBUG-28531 Change-Id: Ib6e2740aae417bdf7b3db9ef7deb646be98df1d6 Reviewed-by: Joerg Bornemann --- .../platforms/windows/qwindowsbackingstore.cpp | 6 +-- src/plugins/platforms/windows/qwindowswindow.cpp | 48 ++++++++++++++++------ src/plugins/platforms/windows/qwindowswindow.h | 2 + 3 files changed, 38 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp index 792eaf0fdc..0a7ff61b7b 100644 --- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp +++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp @@ -88,11 +88,7 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion ®ion, QWindowsWindow *rw = QWindowsWindow::baseWindowOf(window); #ifndef Q_OS_WINCE - if (rw->format().hasAlpha() && (window->flags() & Qt::FramelessWindowHint)) { - const long wl = GetWindowLong(rw->handle(), GWL_EXSTYLE); - if ((wl & WS_EX_LAYERED) == 0) - SetWindowLong(rw->handle(), GWL_EXSTYLE, wl | WS_EX_LAYERED); - + if (QWindowsWindow::setWindowLayered(rw->handle(), window->flags(), rw->format().hasAlpha(), rw->opacity())) { QRect r = window->frameGeometry(); QPoint frameOffset(window->frameMargins().left(), window->frameMargins().top()); QRect dirtyRect = br.translated(offset + frameOffset); diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 42a301cbb2..5d6d4620b7 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -209,22 +209,42 @@ static bool shouldShowMaximizeButton(Qt::WindowFlags flags) return flags & Qt::WindowMaximizeButtonHint; } -static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, qreal level) +// Set the WS_EX_LAYERED flag on a HWND if required. This is required for +// translucent backgrounds, not fully opaque windows and for +// Qt::WindowTransparentForInput (in combination with WS_EX_TRANSPARENT). +bool QWindowsWindow::setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal opacity) +{ +#ifndef Q_OS_WINCE // maybe needs revisiting WS_EX_LAYERED + const LONG exStyle = GetWindowLong(hwnd, GWL_EXSTYLE); + const bool needsLayered = (flags & Qt::WindowTransparentForInput) + || (hasAlpha && (flags & Qt::FramelessWindowHint)) || opacity < 1.0; + const bool isLayered = (exStyle & WS_EX_LAYERED); + if (needsLayered != isLayered) { + if (needsLayered) { + SetWindowLong(hwnd, GWL_EXSTYLE, exStyle | WS_EX_LAYERED); + } else { + SetWindowLong(hwnd, GWL_EXSTYLE, exStyle & ~WS_EX_LAYERED); + } + } + return needsLayered; +#else // !Q_OS_WINCE + Q_UNUSED(hwnd); + Q_UNUSED(flags); + Q_UNUSED(hasAlpha); + Q_UNUSED(opacity); + return false; +#endif // Q_OS_WINCE +} + +static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal level) { #ifdef Q_OS_WINCE // maybe needs revisit WS_EX_LAYERED Q_UNUSED(hwnd); Q_UNUSED(flags); + Q_UNUSED(hasAlpha); Q_UNUSED(level); #else - const long wl = GetWindowLong(hwnd, GWL_EXSTYLE); - const bool isOpaque = level == 1.0 && !(flags & Qt::WindowTransparentForInput); - - if (isOpaque) { - if (wl & WS_EX_LAYERED) - SetWindowLong(hwnd, GWL_EXSTYLE, wl & ~WS_EX_LAYERED); - } else { - if ((wl & WS_EX_LAYERED) == 0) - SetWindowLong(hwnd, GWL_EXSTYLE, wl | WS_EX_LAYERED); + if (QWindowsWindow::setWindowLayered(hwnd, flags, hasAlpha, level)) { if (flags & Qt::FramelessWindowHint) { BLENDFUNCTION blend = {AC_SRC_OVER, 0, (BYTE)(255.0 * level), AC_SRC_ALPHA}; QWindowsContext::user32dll.updateLayeredWindow(hwnd, NULL, NULL, NULL, NULL, NULL, 0, &blend, ULW_ALPHA); @@ -271,7 +291,7 @@ struct WindowCreationData WindowCreationData() : parentHandle(0), type(Qt::Widget), style(0), exStyle(0), topLevel(false), popup(false), dialog(false), desktop(false), - tool(false), embedded(false) {} + tool(false), embedded(false), hasAlpha(false) {} void fromWindow(const QWindow *w, const Qt::WindowFlags flags, unsigned creationFlags = 0); inline WindowData create(const QWindow *w, const QRect &geometry, QString title) const; @@ -290,6 +310,7 @@ struct WindowCreationData bool desktop; bool tool; bool embedded; + bool hasAlpha; }; QDebug operator<<(QDebug debug, const WindowCreationData &d) @@ -308,6 +329,7 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag unsigned creationFlags) { isGL = w->surfaceType() == QWindow::OpenGLSurface; + hasAlpha = w->format().hasAlpha(); flags = flagsIn; // Sometimes QWindow doesn't have a QWindow parent but does have a native parent window, @@ -526,7 +548,7 @@ void WindowCreationData::initialize(HWND hwnd, bool frameChange, qreal opacityLe EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_GRAYED); } - setWindowOpacity(hwnd, flags, opacityLevel); + setWindowOpacity(hwnd, flags, hasAlpha, opacityLevel); } else { // child. SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, swpFlags); } @@ -1471,7 +1493,7 @@ void QWindowsWindow::setOpacity(qreal level) if (m_opacity != level) { m_opacity = level; if (m_data.hwnd) - setWindowOpacity(m_data.hwnd, m_data.flags, level); + setWindowOpacity(m_data.hwnd, m_data.flags, window()->format().hasAlpha(), level); } } diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index c864ba439f..c30b6e62b0 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -216,6 +216,8 @@ public: static inline void *userDataOf(HWND hwnd); static inline void setUserDataOf(HWND hwnd, void *ud); + static bool setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal opacity); + HDC getDC(); void releaseDC(); #ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_GETMINMAXINFO -- cgit v1.2.3 From 2f555cf6b772b84d0bb01c5b6ee8b27e9d7437e5 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 6 Feb 2013 14:05:22 +0100 Subject: Fix typo in QString documentation. Change-Id: Ic7ee426e17bb851d948ff5a772559d80ec7fa059 Reviewed-by: Jerome Pasion --- src/corelib/tools/qstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 21aa3b6ffb..61d5073a1f 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -4932,7 +4932,7 @@ int QString::compare_helper(const QChar *data1, int length1, QLatin1String s2, lists of strings to the user. On Mac OS X since Qt 4.3, this function compares according the - "Order for sorted lists" setting in the International prefereces panel. + "Order for sorted lists" setting in the International preferences panel. \sa compare(), QTextCodec::locale() */ -- cgit v1.2.3 From 9b52415fc90b3572426e9769dfc3db09cab9c74f Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 6 Feb 2013 12:13:38 +0100 Subject: Fix broken IANA link in QTextCodec documentation. Change-Id: I81708691ada600c444a60a8f9b007b0ce64f8b68 Reviewed-by: Jerome Pasion --- src/corelib/doc/src/external-resources.qdoc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/doc/src/external-resources.qdoc b/src/corelib/doc/src/external-resources.qdoc index c92f752476..86df385d9e 100644 --- a/src/corelib/doc/src/external-resources.qdoc +++ b/src/corelib/doc/src/external-resources.qdoc @@ -64,4 +64,9 @@ /*! \externalpage http://www.ietf.org/rfc/rfc2045.txt \title RFC 2045 -*/ \ No newline at end of file +*/ + +/*! + \externalpage http://www.iana.org/assignments/character-sets/character-sets.xml + \title IANA character-sets encoding file +*/ -- cgit v1.2.3 From bf915eeea29a482712c2d479d6cc1625315ec5f8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 4 Feb 2013 12:13:55 +0100 Subject: export QT_CONFIG only in Qt5Core.pc there is no point in duplicating the information in every module. host_bins is exported only here as well. Change-Id: I2f816e1cade9761a2c0d97c7ca1c90293095bfb1 Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira --- src/corelib/corelib.pro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index bf2fd3c84a..4462203a11 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -54,7 +54,10 @@ HOST_BINS = $$[QT_HOST_BINS/raw] host_bins.name = host_bins host_bins.variable = HOST_BINS -QMAKE_PKGCONFIG_VARIABLES += host_bins +qt_conf.name = qt_config +qt_conf.variable = QT_CONFIG + +QMAKE_PKGCONFIG_VARIABLES += host_bins qt_conf ctest_macros_file.input = $$PWD/Qt5CTestMacros.cmake ctest_macros_file.output = $$DESTDIR/cmake/Qt5Core/Qt5CTestMacros.cmake -- cgit v1.2.3 From ca19cba2ac3cf9785b9a2211c4ba7d1e14d87bf2 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 14 Dec 2012 18:25:03 +0100 Subject: Factorize code for formatting window titles into QPlatformWindow. Change-Id: I0dcccd08916fc2ea1b795681e9b98a9550ef51b6 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qplatformwindow.cpp | 24 ++++++++++++++++++++++++ src/gui/kernel/qplatformwindow.h | 2 ++ src/plugins/platforms/windows/qwindowswindow.cpp | 13 +------------ src/plugins/platforms/xcb/qxcbwindow.cpp | 12 +----------- 4 files changed, 28 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 01377d1aa0..b710701e7f 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -42,6 +42,7 @@ #include "qplatformwindow.h" #include "qplatformwindow_p.h" +#include #include #include #include @@ -424,6 +425,29 @@ bool QPlatformWindow::frameStrutEventsEnabled() const return false; } +/*! + Call this method to put together a window title composed of + \a title + \a separator + the application display name + + If the display name isn't set, and the title is empty, the raw app name is used. +*/ +QString QPlatformWindow::formatWindowTitle(const QString &title, const QString &separator) +{ + QString fullTitle = title; + if (QGuiApplicationPrivate::displayName) { + // Append display name, if set. + if (!fullTitle.isEmpty()) + fullTitle += separator; + fullTitle += *QGuiApplicationPrivate::displayName; + } else if (fullTitle.isEmpty()) { + // Don't let the window title be completely empty, use the app name as fallback. + fullTitle = QCoreApplication::applicationName(); + } + return fullTitle; +} + /*! \class QPlatformWindow \since 4.8 diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h index d435198349..fe62d7b67b 100644 --- a/src/gui/kernel/qplatformwindow.h +++ b/src/gui/kernel/qplatformwindow.h @@ -131,6 +131,8 @@ public: virtual bool frameStrutEventsEnabled() const; protected: + static QString formatWindowTitle(const QString &title, const QString &separator); + QScopedPointer d_ptr; private: Q_DISABLE_COPY(QPlatformWindow) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 5d6d4620b7..2708d7d428 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1216,18 +1216,7 @@ void QWindowsWindow::setWindowTitle(const QString &title) if (QWindowsContext::verboseWindows) qDebug() << __FUNCTION__ << this << window() < Date: Tue, 5 Feb 2013 14:15:45 +0100 Subject: Fix copy-paste errors in QtPrivate::ConnectionTypes That resulted in error such as: qobject_impl.h(82) : error C2078: too many initializers This should have been tested by tst_QObject::connectManyArguments, but the test did not work because the detection of defined QMetaType was broken for const references. That will be fixed in a latter commit. Task-number: QTBUG-29130 Change-Id: I78514c251358c0e8adf33af724d87ab114230cd3 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qobject_impl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qobject_impl.h b/src/corelib/kernel/qobject_impl.h index fbc523b8b7..7ed4d33e96 100644 --- a/src/corelib/kernel/qobject_impl.h +++ b/src/corelib/kernel/qobject_impl.h @@ -78,14 +78,14 @@ namespace QtPrivate { { static const int *types() { static const int t[4] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), 0 }; return t; } }; template struct ConnectionTypes > > >, true> - { static const int *types() { static const int t[4] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), + { static const int *types() { static const int t[5] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), 0 }; return t; } }; template struct ConnectionTypes > > > >, true> - { static const int *types() { static const int t[4] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), + { static const int *types() { static const int t[6] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), 0 }; return t; } }; template struct ConnectionTypes > > > > >, true> - { static const int *types() { static const int t[4] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), + { static const int *types() { static const int t[7] = { QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), QtPrivate::QMetaTypeIdHelper::qt_metatype_id(), 0 }; return t; } }; #else -- cgit v1.2.3 From 8200e49bbef6fe05b904908d6439e8aa2c645c45 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 6 Feb 2013 12:16:47 -0800 Subject: Allow x86intrin.h with ICC 13.1 The Intel C++ Composer XE 2013 Update 2 (a.k.a. ICC 13.1) has fixed the bug of the undefined intrinsics. Change-Id: If837a0800725d55fed7eff39b9d52c359dabb073 Reviewed-by: Olivier Goffart --- src/corelib/tools/qsimd_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index 3f570c7a44..2156c2235f 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -142,7 +142,7 @@ QT_BEGIN_HEADER // other x86 intrinsics #if defined(QT_COMPILER_SUPPORTS_AVX) && defined(Q_CC_GNU) && \ - (!defined(Q_CC_INTEL) || (__GNUC__ * 100 + __GNUC_MINOR__ < 407)) + (!defined(Q_CC_INTEL)|| __INTEL_COMPILER >= 1310 || (__GNUC__ * 100 + __GNUC_MINOR__ < 407)) #define QT_COMPILER_SUPPORTS_X86INTRIN #include #endif -- cgit v1.2.3 From 5221ae5f424f24000d877d2a4394e2d75a052cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 5 Feb 2013 11:58:07 +0100 Subject: Update documentation for QIODevice::readData(). readData() might be called with a maxSize of 0, regardless of the device being buffered or not. Task-number: QTBUG-28968 Change-Id: I666ed4d601341107722c86fe217f617ef748363d Reviewed-by: Thiago Macieira --- src/corelib/io/qiodevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 4f3518aeb8..4df9c6b911 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -1640,8 +1640,8 @@ QString QIODevice::errorString() const all the requested information was read and therefore does not retry reading if there was a problem. - This function will be called with maxSize 0 when the device is - buffered and the buffer was emptied by a call to read(). + This function might be called with a maxSize of 0, which can be used to + perform post-reading operations. \sa read(), readLine(), writeData() */ -- cgit v1.2.3 From 41dfd254c3a972fd77389713d0e370b98247a12d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 7 Feb 2013 10:39:22 +0100 Subject: qdoc: Fix translation contexts. Put all translations into the namespace QDoc and fix warnings about invalid tr()-usage by removing the free tr()-function from tr.h. Provide QCoreApplication::translate() for bootstrap builds. Change-Id: I2b6931188346f290e80e14b84adff8892d8a860f Reviewed-by: Martin Smith Reviewed-by: Oswald Buddenhagen --- src/tools/qdoc/atom.cpp | 2 +- src/tools/qdoc/codeparser.h | 2 ++ src/tools/qdoc/config.cpp | 2 ++ src/tools/qdoc/config.h | 2 ++ src/tools/qdoc/cppcodemarker.h | 2 ++ src/tools/qdoc/cppcodeparser.h | 2 ++ src/tools/qdoc/ditaxmlgenerator.h | 2 ++ src/tools/qdoc/doc.cpp | 2 ++ src/tools/qdoc/doc.h | 2 ++ src/tools/qdoc/generator.h | 2 ++ src/tools/qdoc/helpprojectwriter.h | 2 ++ src/tools/qdoc/htmlgenerator.h | 2 ++ src/tools/qdoc/jscodemarker.h | 2 ++ src/tools/qdoc/location.h | 2 ++ src/tools/qdoc/main.cpp | 10 +++++----- src/tools/qdoc/node.h | 4 ++++ src/tools/qdoc/openedlist.h | 3 +++ src/tools/qdoc/puredocparser.h | 2 ++ src/tools/qdoc/qdocdatabase.h | 2 ++ src/tools/qdoc/qmlcodemarker.h | 2 ++ src/tools/qdoc/qmlcodeparser.h | 2 ++ src/tools/qdoc/qmlparser/qqmljslexer_p.h | 3 +++ src/tools/qdoc/qmlparser/qqmljsparser.cpp | 6 ------ src/tools/qdoc/qmlparser/qqmljsparser_p.h | 2 ++ src/tools/qdoc/qmlvisitor.h | 2 ++ src/tools/qdoc/quoter.h | 2 ++ src/tools/qdoc/separator.cpp | 18 +++++++++--------- src/tools/qdoc/tokenizer.h | 2 ++ src/tools/qdoc/tr.h | 26 ++++++++++++++++++-------- 29 files changed, 85 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/tools/qdoc/atom.cpp b/src/tools/qdoc/atom.cpp index 481cfffd75..6f9da3790d 100644 --- a/src/tools/qdoc/atom.cpp +++ b/src/tools/qdoc/atom.cpp @@ -349,7 +349,7 @@ QString Atom::typeString() const int i = 0; while (atms[i].english != 0) { if (atms[i].no != i) - Location::internalError(tr("atom %1 missing").arg(i)); + Location::internalError(QCoreApplication::translate("QDoc::Atom", "atom %1 missing").arg(i)); i++; } deja = true; diff --git a/src/tools/qdoc/codeparser.h b/src/tools/qdoc/codeparser.h index cbb8544d6f..8c398aeb05 100644 --- a/src/tools/qdoc/codeparser.h +++ b/src/tools/qdoc/codeparser.h @@ -54,6 +54,8 @@ class QDocDatabase; class CodeParser { + Q_DECLARE_TR_FUNCTIONS(QDoc::CodeParser) + public: CodeParser(); virtual ~CodeParser(); diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp index 9b58df19ee..766697dfc2 100644 --- a/src/tools/qdoc/config.cpp +++ b/src/tools/qdoc/config.cpp @@ -88,6 +88,8 @@ void MetaStackEntry::close() */ class MetaStack : private QStack { + Q_DECLARE_TR_FUNCTIONS(QDoc::MetaStack) + public: MetaStack(); diff --git a/src/tools/qdoc/config.h b/src/tools/qdoc/config.h index 419329797b..2c655cdf23 100644 --- a/src/tools/qdoc/config.h +++ b/src/tools/qdoc/config.h @@ -72,6 +72,8 @@ typedef QMap QStringListPairMap; class Config { + Q_DECLARE_TR_FUNCTIONS(QDoc::Config) + public: Config(const QString& programName); ~Config(); diff --git a/src/tools/qdoc/cppcodemarker.h b/src/tools/qdoc/cppcodemarker.h index f4bdca0133..91a9c01a28 100644 --- a/src/tools/qdoc/cppcodemarker.h +++ b/src/tools/qdoc/cppcodemarker.h @@ -52,6 +52,8 @@ QT_BEGIN_NAMESPACE class CppCodeMarker : public CodeMarker { + Q_DECLARE_TR_FUNCTIONS(QDoc::CppCodeMarker) + public: CppCodeMarker(); ~CppCodeMarker(); diff --git a/src/tools/qdoc/cppcodeparser.h b/src/tools/qdoc/cppcodeparser.h index 72c5907166..24b1f4c05a 100644 --- a/src/tools/qdoc/cppcodeparser.h +++ b/src/tools/qdoc/cppcodeparser.h @@ -57,6 +57,8 @@ class Tokenizer; class CppCodeParser : public CodeParser { + Q_DECLARE_TR_FUNCTIONS(QDoc::CppCodeParser) + public: CppCodeParser(); ~CppCodeParser(); diff --git a/src/tools/qdoc/ditaxmlgenerator.h b/src/tools/qdoc/ditaxmlgenerator.h index 95e034bc43..c096829cae 100644 --- a/src/tools/qdoc/ditaxmlgenerator.h +++ b/src/tools/qdoc/ditaxmlgenerator.h @@ -56,6 +56,8 @@ typedef QMap GuidMaps; class DitaXmlGenerator : public Generator { + Q_DECLARE_TR_FUNCTIONS(QDoc::DitaXmlGenerator) + public: enum SinceType { Namespace, diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp index 3154578766..a0a2e51198 100644 --- a/src/tools/qdoc/doc.cpp +++ b/src/tools/qdoc/doc.cpp @@ -439,6 +439,8 @@ bool DocPrivate::isEnumDocSimplifiable() const class DocParser { + Q_DECLARE_TR_FUNCTIONS(QDoc::DocParser) + public: void parse(const QString &source, DocPrivate *docPrivate, diff --git a/src/tools/qdoc/doc.h b/src/tools/qdoc/doc.h index abbe231a46..ca9787595f 100644 --- a/src/tools/qdoc/doc.h +++ b/src/tools/qdoc/doc.h @@ -121,6 +121,8 @@ public: class Doc { + Q_DECLARE_TR_FUNCTIONS(QDoc::Doc) + public: // the order is important enum Sections { diff --git a/src/tools/qdoc/generator.h b/src/tools/qdoc/generator.h index 551196f2f4..e4bc85b2bc 100644 --- a/src/tools/qdoc/generator.h +++ b/src/tools/qdoc/generator.h @@ -66,6 +66,8 @@ class QDocDatabase; class Generator { + Q_DECLARE_TR_FUNCTIONS(QDoc::Generator) + public: enum Passes { Both, Prepare, Generate }; diff --git a/src/tools/qdoc/helpprojectwriter.h b/src/tools/qdoc/helpprojectwriter.h index adca31d814..0ca3043223 100644 --- a/src/tools/qdoc/helpprojectwriter.h +++ b/src/tools/qdoc/helpprojectwriter.h @@ -85,6 +85,8 @@ struct HelpProject class HelpProjectWriter { + Q_DECLARE_TR_FUNCTIONS(QDoc::HelpProjectWriter) + public: HelpProjectWriter(const Config &config, const QString &defaultFileName, diff --git a/src/tools/qdoc/htmlgenerator.h b/src/tools/qdoc/htmlgenerator.h index 132fb0927a..65d874f619 100644 --- a/src/tools/qdoc/htmlgenerator.h +++ b/src/tools/qdoc/htmlgenerator.h @@ -59,6 +59,8 @@ class HelpProjectWriter; class HtmlGenerator : public Generator { + Q_DECLARE_TR_FUNCTIONS(QDoc::HtmlGenerator) + public: enum SinceType { Namespace, diff --git a/src/tools/qdoc/jscodemarker.h b/src/tools/qdoc/jscodemarker.h index 59b1776728..123e3e2db7 100644 --- a/src/tools/qdoc/jscodemarker.h +++ b/src/tools/qdoc/jscodemarker.h @@ -52,6 +52,8 @@ QT_BEGIN_NAMESPACE class JsCodeMarker : public QmlCodeMarker { + Q_DECLARE_TR_FUNCTIONS(QDoc::JsCodeMarker) + public: JsCodeMarker(); ~JsCodeMarker(); diff --git a/src/tools/qdoc/location.h b/src/tools/qdoc/location.h index 87aa9b5893..20ddfd076e 100644 --- a/src/tools/qdoc/location.h +++ b/src/tools/qdoc/location.h @@ -57,6 +57,8 @@ class QRegExp; class Location { + Q_DECLARE_TR_FUNCTIONS(QDoc::Location) + public: Location(); Location(const QString& filePath); diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index 2625782cfb..348023b750 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -110,7 +110,7 @@ static QString documentationPath; */ static void printHelp() { - Location::information(tr("Usage: qdoc [options] file1.qdocconf ...\n" + Location::information(QCoreApplication::translate("QDoc", "Usage: qdoc [options] file1.qdocconf ...\n" "Options:\n" " -D " "Define as a macro while parsing sources\n" @@ -149,7 +149,7 @@ static void printHelp() */ static void printVersion() { - QString s = tr("qdoc version %1").arg(QT_VERSION_STR); + QString s = QCoreApplication::translate("QDoc", "qdoc version %1").arg(QT_VERSION_STR); Location::information(s); } @@ -250,7 +250,7 @@ static void processQdocconfFile(const QString &fileName) All the other classes are initialized with the config. Here we initialize the configuration with some default values. */ - Config config(tr("qdoc")); + Config config(QCoreApplication::translate("QDoc", "qdoc")); int i = 0; while (defaults[i].key) { config.setStringList(defaults[i].key, QStringList() << defaults[i].value); @@ -325,7 +325,7 @@ static void processQdocconfFile(const QString &fileName) while (fn != fileNames.constEnd()) { QTranslator *translator = new QTranslator(0); if (!translator->load(*fn)) - config.lastLocation().error(tr("Cannot load translator '%1'").arg(*fn)); + config.lastLocation().error(QCoreApplication::translate("QDoc", "Cannot load translator '%1'").arg(*fn)); QCoreApplication::instance()->installTranslator(translator); translators.append(translator); ++fn; @@ -489,7 +489,7 @@ static void processQdocconfFile(const QString &fileName) while (of != outputFormats.constEnd()) { Generator* generator = Generator::generatorForFormat(*of); if (generator == 0) - outputFormatsLocation.fatal(tr("Unknown output format '%1'").arg(*of)); + outputFormatsLocation.fatal(QCoreApplication::translate("QDoc", "Unknown output format '%1'").arg(*of)); generator->generateTree(); ++of; } diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index 56da4ca174..11c08fb659 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -69,6 +69,8 @@ typedef QList > ImportList; class Node { + Q_DECLARE_TR_FUNCTIONS(QDoc::Node) + public: enum Type { Namespace, @@ -596,6 +598,8 @@ class QmlPropertyNode; class QmlPropertyNode : public LeafNode { + Q_DECLARE_TR_FUNCTIONS(QDoc::QmlPropertyNode) + public: QmlPropertyNode(QmlClassNode *parent, const QString& name, diff --git a/src/tools/qdoc/openedlist.h b/src/tools/qdoc/openedlist.h index 7d40add8b1..cf7624b8e3 100644 --- a/src/tools/qdoc/openedlist.h +++ b/src/tools/qdoc/openedlist.h @@ -49,11 +49,14 @@ #include #include "location.h" +#include "tr.h" QT_BEGIN_NAMESPACE class OpenedList { + Q_DECLARE_TR_FUNCTIONS(QDoc::OpenedList) + public: enum Style { Bullet, Tag, Value, Numeric, UpperAlpha, LowerAlpha, UpperRoman, LowerRoman }; diff --git a/src/tools/qdoc/puredocparser.h b/src/tools/qdoc/puredocparser.h index f25f777733..0174af7a4e 100644 --- a/src/tools/qdoc/puredocparser.h +++ b/src/tools/qdoc/puredocparser.h @@ -60,6 +60,8 @@ class Tree; class PureDocParser : public CppCodeParser { + Q_DECLARE_TR_FUNCTIONS(QDoc::PureDocParser) + public: PureDocParser(); virtual ~PureDocParser(); diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h index 21f955566f..857fd301bb 100644 --- a/src/tools/qdoc/qdocdatabase.h +++ b/src/tools/qdoc/qdocdatabase.h @@ -82,6 +82,8 @@ typedef QMultiMap TargetRecMultiMap; class QDocDatabase { + Q_DECLARE_TR_FUNCTIONS(QDoc::QDocDatabase) + public: static QDocDatabase* qdocDB(); static void destroyQdocDB(); diff --git a/src/tools/qdoc/qmlcodemarker.h b/src/tools/qdoc/qmlcodemarker.h index 7e801d083e..bc2321e076 100644 --- a/src/tools/qdoc/qmlcodemarker.h +++ b/src/tools/qdoc/qmlcodemarker.h @@ -53,6 +53,8 @@ QT_BEGIN_NAMESPACE class QmlCodeMarker : public CppCodeMarker { + Q_DECLARE_TR_FUNCTIONS(QDoc::QmlCodeMarker) + public: QmlCodeMarker(); ~QmlCodeMarker(); diff --git a/src/tools/qdoc/qmlcodeparser.h b/src/tools/qdoc/qmlcodeparser.h index 5a33238584..5bdcfbfbbf 100644 --- a/src/tools/qdoc/qmlcodeparser.h +++ b/src/tools/qdoc/qmlcodeparser.h @@ -62,6 +62,8 @@ class Tree; class QmlCodeParser : public CodeParser { + Q_DECLARE_TR_FUNCTIONS(QDoc::QmlCodeParser) + public: QmlCodeParser(); virtual ~QmlCodeParser(); diff --git a/src/tools/qdoc/qmlparser/qqmljslexer_p.h b/src/tools/qdoc/qmlparser/qqmljslexer_p.h index f22325ebf9..cb6ff6bcdf 100644 --- a/src/tools/qdoc/qmlparser/qqmljslexer_p.h +++ b/src/tools/qdoc/qmlparser/qqmljslexer_p.h @@ -55,6 +55,7 @@ #include "qqmljsglobal_p.h" #include "qqmljsgrammar_p.h" +#include "tr.h" #include QT_QML_BEGIN_NAMESPACE @@ -87,6 +88,8 @@ public: class QML_PARSER_EXPORT Lexer: public QQmlJSGrammar { + Q_DECLARE_TR_FUNCTIONS(QDoc::QQmlJS::Lexer) + public: enum { T_ABSTRACT = T_RESERVED_WORD, diff --git a/src/tools/qdoc/qmlparser/qqmljsparser.cpp b/src/tools/qdoc/qmlparser/qqmljsparser.cpp index 104aa3d557..b7f571aa62 100644 --- a/src/tools/qdoc/qmlparser/qqmljsparser.cpp +++ b/src/tools/qdoc/qmlparser/qqmljsparser.cpp @@ -40,12 +40,6 @@ ****************************************************************************/ #include -#ifdef QT_BOOTSTRAPPED -#define tr(x, y) QString(QLatin1String(y)) -#else -#include -#define tr(x, y) QCoreApplication::translate(x, y) -#endif #include diff --git a/src/tools/qdoc/qmlparser/qqmljsparser_p.h b/src/tools/qdoc/qmlparser/qqmljsparser_p.h index e59ef67ffd..9fe7428bc2 100644 --- a/src/tools/qdoc/qmlparser/qqmljsparser_p.h +++ b/src/tools/qdoc/qmlparser/qqmljsparser_p.h @@ -75,6 +75,8 @@ class Engine; class QML_PARSER_EXPORT Parser: protected QQmlJSGrammar { + Q_DECLARE_TR_FUNCTIONS(QDoc::QQmlJS::Parser) + public: union Value { int ival; diff --git a/src/tools/qdoc/qmlvisitor.h b/src/tools/qdoc/qmlvisitor.h index acf34ab95c..172aca579a 100644 --- a/src/tools/qdoc/qmlvisitor.h +++ b/src/tools/qdoc/qmlvisitor.h @@ -66,6 +66,8 @@ struct QmlPropArgs class QmlDocVisitor : public QQmlJS::AST::Visitor { + Q_DECLARE_TR_FUNCTIONS(QDoc::QmlDocVisitor) + public: QmlDocVisitor(const QString &filePath, const QString &code, diff --git a/src/tools/qdoc/quoter.h b/src/tools/qdoc/quoter.h index 9f2e3f7852..223fdd96b3 100644 --- a/src/tools/qdoc/quoter.h +++ b/src/tools/qdoc/quoter.h @@ -55,6 +55,8 @@ QT_BEGIN_NAMESPACE class Quoter { + Q_DECLARE_TR_FUNCTIONS(QDoc::Quoter) + public: Quoter(); diff --git a/src/tools/qdoc/separator.cpp b/src/tools/qdoc/separator.cpp index b9320449c6..2403fb15c8 100644 --- a/src/tools/qdoc/separator.cpp +++ b/src/tools/qdoc/separator.cpp @@ -51,14 +51,14 @@ QT_BEGIN_NAMESPACE QString separator(int index, int count) { if (index == count - 1) - return tr(".", "terminator"); + return QCoreApplication::translate("QDoc", ".", "terminator"); if (count == 2) - return tr(" and ", "separator when N = 2"); + return QCoreApplication::translate("QDoc", " and ", "separator when N = 2"); if (index == 0) - return tr(", ", "first separator when N > 2"); + return QCoreApplication::translate("QDoc", ", ", "first separator when N > 2"); if (index < count - 2) - return tr(", ", "general separator when N > 2"); - return tr(", and ", "last separator when N > 2"); + return QCoreApplication::translate("QDoc", ", ", "general separator when N > 2"); + return QCoreApplication::translate("QDoc", ", and ", "last separator when N > 2"); } QString comma(int index, int count) @@ -66,12 +66,12 @@ QString comma(int index, int count) if (index == count - 1) return QString(); if (count == 2) - return tr(" and ", "separator when N = 2"); + return QCoreApplication::translate("QDoc", " and ", "separator when N = 2"); if (index == 0) - return tr(", ", "first separator when N > 2"); + return QCoreApplication::translate("QDoc", ", ", "first separator when N > 2"); if (index < count - 2) - return tr(", ", "general separator when N > 2"); - return tr(", and ", "last separator when N > 2"); + return QCoreApplication::translate("QDoc", ", ", "general separator when N > 2"); + return QCoreApplication::translate("QDoc", ", and ", "last separator when N > 2"); } QT_END_NAMESPACE diff --git a/src/tools/qdoc/tokenizer.h b/src/tools/qdoc/tokenizer.h index ae67a9b8a9..4e2c622f3c 100644 --- a/src/tools/qdoc/tokenizer.h +++ b/src/tools/qdoc/tokenizer.h @@ -96,6 +96,8 @@ enum { Tok_Eoi, Tok_Ampersand, Tok_Aster, Tok_Caret, Tok_LeftParen, class Tokenizer { + Q_DECLARE_TR_FUNCTIONS(QDoc::Tokenizer) + public: Tokenizer(const Location& loc, const QByteArray &in); Tokenizer(const Location& loc, QFile &file); diff --git a/src/tools/qdoc/tr.h b/src/tools/qdoc/tr.h index 686b9171ab..36b0c47fef 100644 --- a/src/tools/qdoc/tr.h +++ b/src/tools/qdoc/tr.h @@ -46,26 +46,36 @@ #ifndef TR_H #define TR_H -#ifndef QT_BOOTSTRAPPED -# include "qcoreapplication.h" +#include + +#if !defined(QT_BOOTSTRAPPED) && !defined(QT_NO_TRANSLATION) +# define TRANSLATE_QDOC #endif #include +#ifdef TRANSLATE_QDOC +# include +#endif QT_BEGIN_NAMESPACE -#if defined(QT_BOOTSTRAPPED) || defined(QT_NO_TRANSLATION) +#ifndef TRANSLATE_QDOC + +#define Q_DECLARE_TR_FUNCTIONS(context) + inline QString tr(const char *sourceText, const char *comment = 0) { Q_UNUSED(comment); return QString( QLatin1String(sourceText) ); } -#else -inline QString tr(const char *sourceText, const char *comment = 0) + +struct QCoreApplication { - return QCoreApplication::instance()->translate("", sourceText, comment); -} -#endif + static inline QString translate(const char * /* context */ , const char *sourceText, const char * /* disambiguation */ = 0) + { return QLatin1String(sourceText); } +}; + +#endif // !TRANSLATE_QDOC QT_END_NAMESPACE -- cgit v1.2.3 From d00224881ba73c21a0d9a877d02c564122c05981 Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Thu, 7 Feb 2013 08:26:42 +0000 Subject: Fix a typo in the qdoc manual Change-Id: I7eb6348562a18ce87e065950315dec3253a22aeb Reviewed-by: Sergio Ahumada --- src/tools/qdoc/doc/qdoc-manual.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc index acf3b34153..5486e240c4 100644 --- a/src/tools/qdoc/doc/qdoc-manual.qdoc +++ b/src/tools/qdoc/doc/qdoc-manual.qdoc @@ -2243,7 +2243,7 @@ The text up to the line break becomes the target name. Be sure to follow the target name with a line break. Curly brackets are not required around the target name, but they may be required when the - target name is used in a link cammand. See below. + target name is used in a link command. See below. \code / *! -- cgit v1.2.3 From d45b40007f3a44b5974b83f5d59ea57a1882b64d Mon Sep 17 00:00:00 2001 From: Bjoern Breitmeyer Date: Thu, 31 Jan 2013 13:17:08 +0100 Subject: Removed User32.dll usage on WINCE Change-Id: Id65dc0a9a829d66d0a2cc7bd40c5ba3190d9ecba Reviewed-by: Friedemann Kleint Reviewed-by: Janne Anttila --- src/plugins/platforms/windows/qwindowswindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 2708d7d428..2ebc3a06fa 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -238,7 +238,7 @@ bool QWindowsWindow::setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool has static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal level) { -#ifdef Q_OS_WINCE // maybe needs revisit WS_EX_LAYERED +#ifdef Q_OS_WINCE // WINCE does not support that feature and microsoft explicitly warns to use those calls Q_UNUSED(hwnd); Q_UNUSED(flags); Q_UNUSED(hasAlpha); @@ -756,8 +756,10 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) : break; } } +#ifndef Q_OS_WINCE if (QWindowsContext::instance()->systemInfo() & QWindowsContext::SI_SupportsTouch) QWindowsContext::user32dll.registerTouchWindow(m_data.hwnd, 0); +#endif // !Q_OS_WINCE setWindowState(aWindow->windowState()); const qreal opacity = qt_window_private(aWindow)->opacity; if (!qFuzzyCompare(opacity, qreal(1.0))) @@ -766,8 +768,10 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) : QWindowsWindow::~QWindowsWindow() { +#ifndef Q_OS_WINCE if (QWindowsContext::instance()->systemInfo() & QWindowsContext::SI_SupportsTouch) QWindowsContext::user32dll.unregisterTouchWindow(m_data.hwnd); +#endif // !Q_OS_WINCE destroyWindow(); destroyIcon(); } @@ -797,7 +801,7 @@ void QWindowsWindow::destroyWindow() ShowWindow(handle, SW_SHOW); } } -#endif +#endif // !Q_OS_WINCE if (m_data.hwnd != GetDesktopWindow()) DestroyWindow(m_data.hwnd); QWindowsContext::instance()->removeWindow(m_data.hwnd); -- cgit v1.2.3 From e74bf9497c9dc02465f902c03a600da83f117c69 Mon Sep 17 00:00:00 2001 From: Bjoern Breitmeyer Date: Wed, 30 Jan 2013 14:39:53 +0100 Subject: Fixed QT_NO_CURSOR build for windows/CE plugin. Change-Id: I02f13b2af2d8c285fbca46917ff77826720857be Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowscursor.cpp | 3 +++ src/plugins/platforms/windows/qwindowsscreen.cpp | 11 ++++++++++- src/plugins/platforms/windows/qwindowsscreen.h | 8 ++++++++ src/plugins/platforms/windows/qwindowswindow.cpp | 10 +++++++++- src/plugins/platforms/windows/qwindowswindow.h | 4 ++++ 5 files changed, 34 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp index 0479eb6d58..4dc9af61d8 100644 --- a/src/plugins/platforms/windows/qwindowscursor.cpp +++ b/src/plugins/platforms/windows/qwindowscursor.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#ifndef QT_NO_CURSOR #include "qwindowscursor.h" #include "qwindowscontext.h" #include "qwindowswindow.h" @@ -498,3 +499,5 @@ HCURSOR QWindowsWindowCursor::handle() const } QT_END_NAMESPACE + +#endif // !QT_NO_CURSOR diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index 9bb16793cc..f616972aa0 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -168,8 +168,10 @@ static QDebug operator<<(QDebug dbg, const QWindowsScreenData &d) // Return the cursor to be shared by all screens (virtual desktop). static inline QSharedPointer sharedCursor() { +#ifndef QT_NO_CURSOR if (const QScreen *primaryScreen = QGuiApplication::primaryScreen()) return static_cast(primaryScreen->handle())->windowsCursor(); +#endif return QSharedPointer(new QWindowsCursor); } @@ -182,7 +184,10 @@ static inline QSharedPointer sharedCursor() */ QWindowsScreen::QWindowsScreen(const QWindowsScreenData &data) : - m_data(data), m_cursor(sharedCursor()) + m_data(data) +#ifndef QT_NO_CURSOR + ,m_cursor(sharedCursor()) +#endif { } @@ -250,7 +255,11 @@ QWindow *QWindowsScreen::windowAt(const QPoint &screenPoint, unsigned flags) QWindow *QWindowsScreen::windowUnderMouse(unsigned flags) { +#ifndef QT_NO_CURSOR return QWindowsScreen::windowAt(QWindowsCursor::mousePosition(), flags); +#else + return 0; +#endif } QWindowsScreen *QWindowsScreen::screenOf(const QWindow *w) diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h index 7da1a4d207..216973125b 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.h +++ b/src/plugins/platforms/windows/qwindowsscreen.h @@ -79,7 +79,9 @@ struct QWindowsScreenData class QWindowsScreen : public QPlatformScreen { public: +#ifndef QT_NO_CURSOR typedef QSharedPointer WindowsCursorPtr; +#endif explicit QWindowsScreen(const QWindowsScreenData &data); @@ -106,14 +108,20 @@ public: inline void handleChanges(const QWindowsScreenData &newData); +#ifndef QT_NO_CURSOR QPlatformCursor *cursor() const { return m_cursor.data(); } const WindowsCursorPtr &windowsCursor() const { return m_cursor; } +#else + QPlatformCursor *cursor() const { return 0; } +#endif // !QT_NO_CURSOR const QWindowsScreenData &data() const { return m_data; } private: QWindowsScreenData m_data; +#ifndef QT_NO_CURSOR const WindowsCursorPtr m_cursor; +#endif }; class QWindowsScreenManager diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 2ebc3a06fa..3530f0af68 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -44,7 +44,9 @@ #include "qwindowscontext.h" #include "qwindowsdrag.h" #include "qwindowsscreen.h" -#include "qwindowscursor.h" +#ifdef QT_NO_CURSOR +# include "qwindowscursor.h" +#endif #ifdef QT_OPENGL_ES_2 # include "qwindowseglcontext.h" @@ -726,7 +728,9 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) : m_hdc(0), m_windowState(Qt::WindowNoState), m_opacity(1.0), +#ifndef QT_NO_CURSOR m_cursor(QWindowsScreen::screenOf(aWindow)->windowsCursor()->standardWindowCursor()), +#endif m_dropTarget(0), m_savedStyle(0), m_format(aWindow->format()), @@ -1649,11 +1653,14 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const void QWindowsWindow::applyCursor() { +#ifndef QT_NO_CURSOR SetCursor(m_cursor.handle()); +#endif } void QWindowsWindow::setCursor(const QWindowsWindowCursor &c) { +#ifndef QT_NO_CURSOR if (c.handle() != m_cursor.handle()) { const bool underMouse = QWindowsContext::instance()->windowUnderMouse() == window(); if (QWindowsContext::verboseWindows) @@ -1663,6 +1670,7 @@ void QWindowsWindow::setCursor(const QWindowsWindowCursor &c) if (underMouse) applyCursor(); } +#endif } /*! diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index c30b6e62b0..f3b480b0af 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -224,7 +224,9 @@ public: void getSizeHints(MINMAXINFO *mmi) const; #endif +#ifndef QT_NO_CURSOR QWindowsWindowCursor cursor() const { return m_cursor; } +#endif void setCursor(const QWindowsWindowCursor &c); void applyCursor(); @@ -270,7 +272,9 @@ private: HDC m_hdc; Qt::WindowState m_windowState; qreal m_opacity; +#ifndef QT_NO_CURSOR QWindowsWindowCursor m_cursor; +#endif QWindowsOleDropTarget *m_dropTarget; unsigned m_savedStyle; QRect m_savedFrameGeometry; -- cgit v1.2.3 From 681085c1986af51101f59abfced759211b79f0b4 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 31 Jan 2013 13:48:09 +0100 Subject: Accessibility: Ignore TableModelChanges on Linux for now. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This part will be improved in Qt 5.1. Currently it just spits out debug messages for unhandled events. Change-Id: I22475317ab54a8223d42536e1cee3f93a969e497 Reviewed-by: hjk Reviewed-by: Jan Arve Sæther --- .../linuxaccessibility/atspiadaptor.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index 057d562264..4cd81b2389 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -1104,22 +1104,10 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) } break; } -// case QAccessible::TableModelChanged: { -// // This is rather evil. We don't send data and hope that at-spi fetches the right child. -// // This hack fails when a row gets removed and a different one added in its place. -// QDBusVariant data; -// emit ChildrenChanged("add", 0, 0, data, spiBridge->getRootReference()); -// break; -// } - // case QAccessible::TableModelChanged: - // QAccessible2::TableModelChange change = interface->tableInterface()->modelChange(); - // // assume we should reset if everything is 0 - // if (change.firstColumn == 0 && change.firstRow == 0 && change.lastColumn == 0 && change.lastRow == 0) { - // notifyAboutDestruction(accessible); - // notifyAboutCreation(accessible); - // } - // break; - + case QAccessible::TableModelChanged: + // For now we ignore this event and hope that + // setting manages_descendants works. + break; case QAccessible::ParentChanged: break; case QAccessible::DialogStart: -- cgit v1.2.3 From 09e972884ed146e828be7a096d832829ff342225 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Thu, 7 Feb 2013 10:58:15 +0100 Subject: Doc: Made QDoc Manual use Qt 5's qdoc -removed extra qdocconf and files -"make docs" using QMAKE_DOCS -installs the documentation in QT_INSTALL_DOCS -updated title of the manual to "QDoc Manual" -modified listing of contents in Assistant Change-Id: I22f93c0903c5e672a0e7efa83bf3f592658be66d Reviewed-by: Martin Smith Reviewed-by: Jerome Pasion --- src/tools/qdoc/doc/config/compat.qdocconf | 12 - src/tools/qdoc/doc/config/config.pro | 13 - src/tools/qdoc/doc/config/images/arrow_down.png | Bin 177 -> 0 bytes src/tools/qdoc/doc/config/images/bg_l.png | Bin 100 -> 0 bytes src/tools/qdoc/doc/config/images/bg_l_blank.png | Bin 84 -> 0 bytes src/tools/qdoc/doc/config/images/bg_ll_blank.png | Bin 320 -> 0 bytes src/tools/qdoc/doc/config/images/bg_r.png | Bin 96 -> 0 bytes src/tools/qdoc/doc/config/images/bg_ul_blank.png | Bin 304 -> 0 bytes src/tools/qdoc/doc/config/images/box_bg.png | Bin 89 -> 0 bytes src/tools/qdoc/doc/config/images/breadcrumb.png | Bin 134 -> 0 bytes src/tools/qdoc/doc/config/images/bullet_dn.png | Bin 230 -> 0 bytes src/tools/qdoc/doc/config/images/bullet_gt.png | Bin 124 -> 0 bytes src/tools/qdoc/doc/config/images/bullet_sq.png | Bin 74 -> 0 bytes src/tools/qdoc/doc/config/images/bullet_up.png | Bin 210 -> 0 bytes .../qdoc/doc/config/images/feedbackground.png | Bin 263 -> 0 bytes src/tools/qdoc/doc/config/images/header_bg.png | Bin 114 -> 0 bytes src/tools/qdoc/doc/config/images/horBar.png | Bin 2807 -> 0 bytes src/tools/qdoc/doc/config/images/page.png | Bin 3102 -> 0 bytes src/tools/qdoc/doc/config/images/page_bg.png | Bin 84 -> 0 bytes src/tools/qdoc/doc/config/images/spinner.gif | Bin 2037 -> 0 bytes .../qdoc/doc/config/images/sprites-combined.png | Bin 62534 -> 0 bytes src/tools/qdoc/doc/config/macros.qdocconf | 40 -- src/tools/qdoc/doc/config/qdoc-online.qdocconf | 2 - src/tools/qdoc/doc/config/qdoc-project.qdocconf | 45 -- src/tools/qdoc/doc/config/qdoc.qdocconf | 73 ++- src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf | 98 --- src/tools/qdoc/doc/config/qt-defines.qdocconf | 16 - .../doc/config/qt-html-default-styles.qdocconf | 32 - .../qdoc/doc/config/qt-html-online-styles.qdocconf | 72 --- .../doc/config/qt-html-templates-online.qdocconf | 117 ---- .../qdoc/doc/config/qt-html-templates.qdocconf | 56 -- src/tools/qdoc/doc/config/style/offline.css | 673 --------------------- src/tools/qdoc/doc/qdoc-manual.qdoc | 74 +-- src/tools/qdoc/qdoc.pro | 17 +- 34 files changed, 109 insertions(+), 1231 deletions(-) delete mode 100644 src/tools/qdoc/doc/config/compat.qdocconf delete mode 100644 src/tools/qdoc/doc/config/config.pro delete mode 100644 src/tools/qdoc/doc/config/images/arrow_down.png delete mode 100755 src/tools/qdoc/doc/config/images/bg_l.png delete mode 100755 src/tools/qdoc/doc/config/images/bg_l_blank.png delete mode 100644 src/tools/qdoc/doc/config/images/bg_ll_blank.png delete mode 100755 src/tools/qdoc/doc/config/images/bg_r.png delete mode 100644 src/tools/qdoc/doc/config/images/bg_ul_blank.png delete mode 100755 src/tools/qdoc/doc/config/images/box_bg.png delete mode 100755 src/tools/qdoc/doc/config/images/breadcrumb.png delete mode 100644 src/tools/qdoc/doc/config/images/bullet_dn.png delete mode 100755 src/tools/qdoc/doc/config/images/bullet_gt.png delete mode 100755 src/tools/qdoc/doc/config/images/bullet_sq.png delete mode 100644 src/tools/qdoc/doc/config/images/bullet_up.png delete mode 100755 src/tools/qdoc/doc/config/images/feedbackground.png delete mode 100644 src/tools/qdoc/doc/config/images/header_bg.png delete mode 100755 src/tools/qdoc/doc/config/images/horBar.png delete mode 100644 src/tools/qdoc/doc/config/images/page.png delete mode 100755 src/tools/qdoc/doc/config/images/page_bg.png delete mode 100644 src/tools/qdoc/doc/config/images/spinner.gif delete mode 100755 src/tools/qdoc/doc/config/images/sprites-combined.png delete mode 100644 src/tools/qdoc/doc/config/macros.qdocconf delete mode 100644 src/tools/qdoc/doc/config/qdoc-online.qdocconf delete mode 100644 src/tools/qdoc/doc/config/qdoc-project.qdocconf delete mode 100644 src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf delete mode 100644 src/tools/qdoc/doc/config/qt-defines.qdocconf delete mode 100644 src/tools/qdoc/doc/config/qt-html-default-styles.qdocconf delete mode 100644 src/tools/qdoc/doc/config/qt-html-online-styles.qdocconf delete mode 100644 src/tools/qdoc/doc/config/qt-html-templates-online.qdocconf delete mode 100644 src/tools/qdoc/doc/config/qt-html-templates.qdocconf delete mode 100644 src/tools/qdoc/doc/config/style/offline.css (limited to 'src') diff --git a/src/tools/qdoc/doc/config/compat.qdocconf b/src/tools/qdoc/doc/config/compat.qdocconf deleted file mode 100644 index 3e7ea6c891..0000000000 --- a/src/tools/qdoc/doc/config/compat.qdocconf +++ /dev/null @@ -1,12 +0,0 @@ -alias.include = input - -macro.0 = "\\\\0" -macro.b = "\\\\b" -macro.n = "\\\\n" -macro.r = "\\\\r" -macro.img = "\\image" -macro.endquote = "\\endquotation" -macro.relatesto = "\\relates" - -spurious = "Missing comma in .*" \ - "Missing pattern .*" diff --git a/src/tools/qdoc/doc/config/config.pro b/src/tools/qdoc/doc/config/config.pro deleted file mode 100644 index ee7aea8a04..0000000000 --- a/src/tools/qdoc/doc/config/config.pro +++ /dev/null @@ -1,13 +0,0 @@ -SOURCES = config.pro \ - compat.qdocconf \ - qdoc-online.qdocconf \ - qt-defines.qdocconf \ - qt-html-templates.qdocconf \ - qdoc-project.qdocconf \ - qt-html-default-styles.qdocconf \ - qdoc.qdocconf \ - qt-html-online-styles.qdocconf \ - macros.qdocconf \ - qt-cpp-ignore.qdocconf \ - qt-html-templates-online.qdocconf - diff --git a/src/tools/qdoc/doc/config/images/arrow_down.png b/src/tools/qdoc/doc/config/images/arrow_down.png deleted file mode 100644 index 9d01e97f6a..0000000000 Binary files a/src/tools/qdoc/doc/config/images/arrow_down.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/bg_l.png b/src/tools/qdoc/doc/config/images/bg_l.png deleted file mode 100755 index 90b1da10b9..0000000000 Binary files a/src/tools/qdoc/doc/config/images/bg_l.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/bg_l_blank.png b/src/tools/qdoc/doc/config/images/bg_l_blank.png deleted file mode 100755 index 5a9673d81b..0000000000 Binary files a/src/tools/qdoc/doc/config/images/bg_l_blank.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/bg_ll_blank.png b/src/tools/qdoc/doc/config/images/bg_ll_blank.png deleted file mode 100644 index 95a1c45e04..0000000000 Binary files a/src/tools/qdoc/doc/config/images/bg_ll_blank.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/bg_r.png b/src/tools/qdoc/doc/config/images/bg_r.png deleted file mode 100755 index f0fb121dea..0000000000 Binary files a/src/tools/qdoc/doc/config/images/bg_r.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/bg_ul_blank.png b/src/tools/qdoc/doc/config/images/bg_ul_blank.png deleted file mode 100644 index 70512614cc..0000000000 Binary files a/src/tools/qdoc/doc/config/images/bg_ul_blank.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/box_bg.png b/src/tools/qdoc/doc/config/images/box_bg.png deleted file mode 100755 index 3322f923f8..0000000000 Binary files a/src/tools/qdoc/doc/config/images/box_bg.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/breadcrumb.png b/src/tools/qdoc/doc/config/images/breadcrumb.png deleted file mode 100755 index 0ded5514d2..0000000000 Binary files a/src/tools/qdoc/doc/config/images/breadcrumb.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/bullet_dn.png b/src/tools/qdoc/doc/config/images/bullet_dn.png deleted file mode 100644 index f7762472e2..0000000000 Binary files a/src/tools/qdoc/doc/config/images/bullet_dn.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/bullet_gt.png b/src/tools/qdoc/doc/config/images/bullet_gt.png deleted file mode 100755 index 7561b4edc4..0000000000 Binary files a/src/tools/qdoc/doc/config/images/bullet_gt.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/bullet_sq.png b/src/tools/qdoc/doc/config/images/bullet_sq.png deleted file mode 100755 index a84845e3c7..0000000000 Binary files a/src/tools/qdoc/doc/config/images/bullet_sq.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/bullet_up.png b/src/tools/qdoc/doc/config/images/bullet_up.png deleted file mode 100644 index 7de2f06954..0000000000 Binary files a/src/tools/qdoc/doc/config/images/bullet_up.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/feedbackground.png b/src/tools/qdoc/doc/config/images/feedbackground.png deleted file mode 100755 index 3a38d995d7..0000000000 Binary files a/src/tools/qdoc/doc/config/images/feedbackground.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/header_bg.png b/src/tools/qdoc/doc/config/images/header_bg.png deleted file mode 100644 index a436aa61ef..0000000000 Binary files a/src/tools/qdoc/doc/config/images/header_bg.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/horBar.png b/src/tools/qdoc/doc/config/images/horBar.png deleted file mode 100755 index 100fe91c6c..0000000000 Binary files a/src/tools/qdoc/doc/config/images/horBar.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/page.png b/src/tools/qdoc/doc/config/images/page.png deleted file mode 100644 index 1db151bd31..0000000000 Binary files a/src/tools/qdoc/doc/config/images/page.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/page_bg.png b/src/tools/qdoc/doc/config/images/page_bg.png deleted file mode 100755 index 9b3bd999df..0000000000 Binary files a/src/tools/qdoc/doc/config/images/page_bg.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/spinner.gif b/src/tools/qdoc/doc/config/images/spinner.gif deleted file mode 100644 index 1ed786f2ec..0000000000 Binary files a/src/tools/qdoc/doc/config/images/spinner.gif and /dev/null differ diff --git a/src/tools/qdoc/doc/config/images/sprites-combined.png b/src/tools/qdoc/doc/config/images/sprites-combined.png deleted file mode 100755 index 3a48b21f6b..0000000000 Binary files a/src/tools/qdoc/doc/config/images/sprites-combined.png and /dev/null differ diff --git a/src/tools/qdoc/doc/config/macros.qdocconf b/src/tools/qdoc/doc/config/macros.qdocconf deleted file mode 100644 index 2dbc9c1f91..0000000000 --- a/src/tools/qdoc/doc/config/macros.qdocconf +++ /dev/null @@ -1,40 +0,0 @@ -macro.aacute.HTML = "á" -macro.Aring.HTML = "Å" -macro.aring.HTML = "å" -macro.Auml.HTML = "Ä" -macro.author = "\\bold{Author:}" -macro.br.HTML = "
" -macro.BR.HTML = "
" -macro.copyright.HTML = "©" -macro.eacute.HTML = "é" -macro.gui = "\\bold" -macro.hr.HTML = "
" -macro.iacute.HTML = "í" -macro.key = "\\bold" -macro.menu = "\\bold" -macro.note = "\\bold{Note:}" -macro.oslash.HTML = "ø" -macro.ouml.HTML = "ö" -macro.QA = "\\e{Qt Assistant}" -macro.QD = "\\e{Qt Designer}" -macro.QL = "\\e{Qt Linguist}" -macro.QQV = "\\e{Qt QML Viewer}" -macro.param = "\\e" -macro.raisedaster.HTML = "*" -macro.rarrow.HTML = "→" -macro.reg.HTML = "®" -macro.return = "Returns" -macro.starslash = "\\c{*/}" -macro.begincomment = "\\c{/*}" -macro.endcomment = "\\c{*/}" -macro.uuml.HTML = "ü" -macro.mdash.HTML = "—" -macro.pi.HTML = "Π" -macro.beginqdoc.HTML = "/*!" -macro.endqdoc.HTML = "*/" - -macro.beginfloatleft.HTML = "
" -macro.beginfloatright.HTML = "
" -macro.endfloat.HTML = "
" -macro.clearfloat.HTML = "
" -macro.emptyspan.HTML = "" diff --git a/src/tools/qdoc/doc/config/qdoc-online.qdocconf b/src/tools/qdoc/doc/config/qdoc-online.qdocconf deleted file mode 100644 index 7fd8ed59f4..0000000000 --- a/src/tools/qdoc/doc/config/qdoc-online.qdocconf +++ /dev/null @@ -1,2 +0,0 @@ -include(qdoc-project.qdocconf) -include(qt-html-templates-online.qdocconf) diff --git a/src/tools/qdoc/doc/config/qdoc-project.qdocconf b/src/tools/qdoc/doc/config/qdoc-project.qdocconf deleted file mode 100644 index 10cdfa417b..0000000000 --- a/src/tools/qdoc/doc/config/qdoc-project.qdocconf +++ /dev/null @@ -1,45 +0,0 @@ -include(compat.qdocconf) -include(macros.qdocconf) -include(qt-cpp-ignore.qdocconf) -include(qt-defines.qdocconf) - -sourceencoding = UTF-8 -outputencoding = UTF-8 -naturallanguage = en_US - -project = QDoc -description = QDoc Manual -url = http://doc-snapshot.qt-project.org/qdoc - -sources.fileextensions = "*.cpp *.qdoc *.mm *.qml" -headers.fileextensions = "*.h *.ch *.h++ *.hh *.hpp *.hxx" -examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml *.qdoc *.qdocconf *.qdocinc" -examples.imageextensions = "*.png *.jpeg *.jpg *.gif *.mng" - -sourcedirs = .. - -exampledirs = .. \ - ../examples \ - ../../../../examples \ - config - -imagedirs = ../../../doc/src/templates/images \ - images - -tagfile = ../html/qdoc.tags - -qhp.projects = QDoc - -qhp.QDoc.file = qdoc.qhp -qhp.QDoc.namespace = com.trolltech.qdoc -qhp.QDoc.virtualFolder = qdoc -qhp.QDoc.indexTitle = QDoc Manual - Table of Contents -qhp.QDoc.indexRoot = - -qhp.QDoc.filterAttributes = qdoc qtrefdoc -qhp.QDoc.customFilters.QDoc.name = QDoc -qhp.QDoc.customFilters.QDoc.filterAttributes = qdoc -qhp.QDoc.subprojects = overviews -qhp.QDoc.subprojects.overviews.title = Overviews -qhp.QDoc.subprojects.overviews.indexTitle = All Overviews and HOWTOs -qhp.QDoc.subprojects.overviews.selectors = fake:page,group,module diff --git a/src/tools/qdoc/doc/config/qdoc.qdocconf b/src/tools/qdoc/doc/config/qdoc.qdocconf index c238abef88..6bbe934749 100644 --- a/src/tools/qdoc/doc/config/qdoc.qdocconf +++ b/src/tools/qdoc/doc/config/qdoc.qdocconf @@ -1,2 +1,71 @@ -include(qdoc-project.qdocconf) -include(qt-html-templates.qdocconf) +include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) + +project = QDoc +description = QDoc Manual +url = http://qt-project.org/doc/qt-$QT_VER +version = $QT_VERSION + +sourcedirs = .. + +exampledirs = .. \ + ../examples \ + ../../../../examples \ + config + +imagedirs = ../../../doc/src/templates/images \ + images + +tagfile = ../html/qdoc.tags + +qhp.projects = QDoc + +qhp.QDoc.file = qdoc.qhp +qhp.QDoc.namespace = qdoc.$QT_VERSION_TAG +qhp.QDoc.virtualFolder = qdoc +qhp.QDoc.indexTitle = QDoc Manual +qhp.QDoc.indexRoot = + +qhp.QDoc.filterAttributes = qdoc qtrefdoc +qhp.QDoc.customFilters.QDoc.name = QDoc +qhp.QDoc.customFilters.QDoc.filterAttributes = qdoc +qhp.QDoc.subprojects = overviews +qhp.QDoc.subprojects.overviews.title = Overviews +qhp.QDoc.subprojects.overviews.indexTitle = QDoc Manual +qhp.QDoc.subprojects.overviews.selectors = fake:page,group,module + +depends += \ + activeqt \ + qtassistant \ + qtbluetooth \ + qtconcurrent \ + qtcontacts \ + qtcore \ + qtdbus \ + qtdesigner \ + qtdoc \ + qthelp \ + qtimageformats \ + qtgui \ + qtlocation \ + qtlinguist \ + qtmultimedia \ + qtnetwork \ + qtopengl \ + qtorganizer \ + qtprintsupport \ + qtqml \ + qtquick \ + qtscript \ + qtscripttools \ + qtsensors \ + qtsql \ + qtsvg \ + qttestlib \ + qttools \ + qtuitools \ + qtversit \ + qtwidgets \ + qtwebkit \ + qtwebkitexamples \ + qtxml \ + qtxmlpatterns diff --git a/src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf b/src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf deleted file mode 100644 index 21efcf9940..0000000000 --- a/src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf +++ /dev/null @@ -1,98 +0,0 @@ -Cpp.ignoretokens = QAXFACTORY_EXPORT \ - QDESIGNER_COMPONENTS_LIBRARY \ - QDESIGNER_EXTENSION_LIBRARY \ - QDESIGNER_SDK_LIBRARY \ - QDESIGNER_SHARED_LIBRARY \ - QDESIGNER_UILIB_LIBRARY \ - QM_EXPORT_CANVAS \ - QM_EXPORT_DNS \ - QM_EXPORT_DOM \ - QM_EXPORT_FTP \ - QM_EXPORT_HTTP \ - QM_EXPORT_ICONVIEW \ - QM_EXPORT_NETWORK \ - QM_EXPORT_OPENGL \ - QM_EXPORT_OPENVG \ - QM_EXPORT_SQL \ - QM_EXPORT_TABLE \ - QM_EXPORT_WORKSPACE \ - QM_EXPORT_XML \ - QT_ASCII_CAST_WARN \ - QT_ASCII_CAST_WARN_CONSTRUCTOR \ - QT_BEGIN_HEADER \ - QT_DESIGNER_STATIC \ - QT_END_HEADER \ - QT_FASTCALL \ - QT_WIDGET_PLUGIN_EXPORT \ - Q_COMPAT_EXPORT \ - Q_CORE_EXPORT \ - Q_CORE_EXPORT_INLINE \ - Q_EXPLICIT \ - Q_EXPORT \ - Q_EXPORT_CODECS_CN \ - Q_EXPORT_CODECS_JP \ - Q_EXPORT_CODECS_KR \ - Q_EXPORT_PLUGIN \ - Q_GFX_INLINE \ - Q_AUTOTEST_EXPORT \ - Q_GUI_EXPORT \ - Q_GUI_EXPORT_INLINE \ - Q_GUI_EXPORT_STYLE_CDE \ - Q_GUI_EXPORT_STYLE_COMPACT \ - Q_GUI_EXPORT_STYLE_MAC \ - Q_GUI_EXPORT_STYLE_MOTIF \ - Q_GUI_EXPORT_STYLE_MOTIFPLUS \ - Q_GUI_EXPORT_STYLE_PLATINUM \ - Q_GUI_EXPORT_STYLE_POCKETPC \ - Q_GUI_EXPORT_STYLE_SGI \ - Q_GUI_EXPORT_STYLE_WINDOWS \ - Q_GUI_EXPORT_STYLE_WINDOWSXP \ - QHELP_EXPORT \ - Q_INLINE_TEMPLATE \ - Q_INTERNAL_WIN_NO_THROW \ - Q_LOCATION_EXPORT \ - Q_NETWORK_EXPORT \ - Q_OPENGL_EXPORT \ - Q_OPENVG_EXPORT \ - Q_OUTOFLINE_TEMPLATE \ - Q_SQL_EXPORT \ - Q_SVG_EXPORT \ - Q_SCRIPT_EXPORT \ - Q_SCRIPTTOOLS_EXPORT \ - Q_TESTLIB_EXPORT \ - Q_XML_EXPORT \ - Q_XMLSTREAM_EXPORT \ - Q_XMLPATTERNS_EXPORT \ - QDBUS_EXPORT \ - Q_DBUS_EXPORT \ - QT_BEGIN_NAMESPACE \ - QT_BEGIN_INCLUDE_NAMESPACE \ - QT_END_NAMESPACE \ - QT_END_INCLUDE_NAMESPACE \ - PHONON_EXPORT \ - Q_DECLARATIVE_EXPORT \ - Q_GADGET \ - QWEBKIT_EXPORT \ - Q_INVOKABLE -Cpp.ignoredirectives = Q_DECLARE_HANDLE \ - Q_DECLARE_INTERFACE \ - Q_DECLARE_METATYPE \ - Q_DECLARE_OPERATORS_FOR_FLAGS \ - Q_DECLARE_PRIVATE \ - Q_DECLARE_PUBLIC \ - Q_DECLARE_SHARED \ - Q_DECLARE_TR_FUNCTIONS \ - Q_DECLARE_TYPEINFO \ - Q_DISABLE_COPY \ - QT_FORWARD_DECLARE_CLASS \ - Q_DUMMY_COMPARISON_OPERATOR \ - Q_ENUMS \ - Q_FLAGS \ - Q_INTERFACES \ - __attribute__ \ - K_DECLARE_PRIVATE \ - PHONON_OBJECT \ - PHONON_HEIR \ - Q_PRIVATE_PROPERTY \ - Q_DECLARE_PRIVATE_D \ - Q_CLASSINFO diff --git a/src/tools/qdoc/doc/config/qt-defines.qdocconf b/src/tools/qdoc/doc/config/qt-defines.qdocconf deleted file mode 100644 index e11b32dc4c..0000000000 --- a/src/tools/qdoc/doc/config/qt-defines.qdocconf +++ /dev/null @@ -1,16 +0,0 @@ -defines = Q_QDOC \ - QT_.*_SUPPORT \ - QT_.*_LIB \ - QT_COMPAT \ - QT_KEYPAD_NAVIGATION \ - QT3_SUPPORT \ - Q_WS_.* \ - Q_OS_.* \ - Q_BYTE_ORDER \ - QT_DEPRECATED \ - Q_NO_USING_KEYWORD \ - __cplusplus - -versionsym = QT_VERSION_STR - -codeindent = 1 diff --git a/src/tools/qdoc/doc/config/qt-html-default-styles.qdocconf b/src/tools/qdoc/doc/config/qt-html-default-styles.qdocconf deleted file mode 100644 index b2e39d02f5..0000000000 --- a/src/tools/qdoc/doc/config/qt-html-default-styles.qdocconf +++ /dev/null @@ -1,32 +0,0 @@ -# Define the location of the templates to use. Style sheets and scripts are -# specified relative to the template directory and will be copied into -# subdirectories of the output directory. - -HTML.templatedir = . - -HTML.stylesheets = style/offline.css - -HTML.scripts = - -# Files not referenced in any qdoc file (last four needed by qtdemo) -# See also qhp.Qt.extraFiles -extraimages.HTML = qt-logo.png \ - arrow_down.png \ - breadcrumb.png \ - bullet_gt.png \ - bullet_dn.png \ - bullet_sq.png \ - bullet_up.png \ - horBar.png \ - sprites-combined.png - -# Include the style sheets and scripts used. - -HTML.headerstyles = \ - " \n" - -HTML.headerscripts = - -HTML.endheader = \ - "\n" \ - "\n" diff --git a/src/tools/qdoc/doc/config/qt-html-online-styles.qdocconf b/src/tools/qdoc/doc/config/qt-html-online-styles.qdocconf deleted file mode 100644 index 4ffd6ca65f..0000000000 --- a/src/tools/qdoc/doc/config/qt-html-online-styles.qdocconf +++ /dev/null @@ -1,72 +0,0 @@ -# Define the location of the templates to use. Style sheets and scripts are -# specified relative to the template directory and will be copied into -# subdirectories of the output directory. - -HTML.templatedir = . - -HTML.stylesheets = style/narrow.css \ - style/style.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/superfish.css - -# Adding jquery and functions - providing online tools and search features -HTML.scripts = scripts/functions.js \ - scripts/narrow.js \ - scripts/superfish.js \ - scripts/jquery.js - - -# Files not referenced in any qdoc file. -# See also qhp.Qt.extraFiles -extraimages.HTML = qt-logo.png \ - bg_l.png \ - bg_l_blank.png \ - bg_ll_blank.png \ - bg_ul_blank.png \ - header_bg.png \ - bg_r.png \ - box_bg.png \ - breadcrumb.png \ - bullet_gt.png \ - bullet_dn.png \ - bullet_sq.png \ - bullet_up.png \ - arrow_down.png \ - feedbackground.png \ - horBar.png \ - page.png \ - page_bg.png \ - sprites-combined.png \ - spinner.gif - -# Include the style sheets and scripts used. - -HTML.headerstyles = \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - "\n" \ - "\n" \ - "\n\n" - -HTML.headerscripts = \ - "\n" \ - "\n\n" - -HTML.endheader = \ - "\n" \ - "\n" diff --git a/src/tools/qdoc/doc/config/qt-html-templates-online.qdocconf b/src/tools/qdoc/doc/config/qt-html-templates-online.qdocconf deleted file mode 100644 index 038f3de5a0..0000000000 --- a/src/tools/qdoc/doc/config/qt-html-templates-online.qdocconf +++ /dev/null @@ -1,117 +0,0 @@ -include(qt-html-online-styles.qdocconf) - -HTML.postheader = \ - "
\n" \ - "
\n" \ - "
\n" \ - " Home
\n" \ - " QDoc Reference Documentation\n" \ - "
\n" \ - "
\n" \ - " \n" \ - "
\n" \ - "
\n" \ - " \n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - " \n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
    \n" \ - "
  • Home
  • \n" \ - " \n" - -HTML.postpostheader = \ - "
\n" \ - "
\n" \ - "
\n" \ - " \n" \ - "
\n" \ - "
\n" \ - "
\n" - -HTML.footer = \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - " \n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "

\n" \ - " © 2012 Digia Plc and/or its\n" \ - " subsidiaries. Documentation contributions included herein are the copyrights of\n" \ - " their respective owners.

\n" \ - "
\n" \ - "

\n" \ - " The documentation provided herein is licensed under the terms of the\n" \ - " GNU Free Documentation\n" \ - " License version 1.3 as published by the Free Software Foundation.

\n" \ - "

\n" \ - " Documentation sources may be obtained from \n" \ - " www.qt-project.org.

\n" \ - "
\n" \ - "

\n" \ - " Digia, Qt and their respective logos are trademarks of Digia Plc \n" \ - " in Finland and/or other countries worldwide. All other trademarks are property\n" \ - " of their respective owners. Privacy Policy

\n" \ - "
\n" - - -# Files not referenced in any qdoc file. -# See also extraimages.HTML -qhp.QDoc.extraFiles = qdoc-index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ul_blank.png \ - images/header_bg.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/arrow_down.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/spinner.gif \ - scripts/functions.js \ - scripts/jquery.js \ - scripts/narrow.js \ - scripts/superfish.js \ - style/narrow.css \ - style/superfish.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css diff --git a/src/tools/qdoc/doc/config/qt-html-templates.qdocconf b/src/tools/qdoc/doc/config/qt-html-templates.qdocconf deleted file mode 100644 index 22bf6e1c23..0000000000 --- a/src/tools/qdoc/doc/config/qt-html-templates.qdocconf +++ /dev/null @@ -1,56 +0,0 @@ -include(qt-html-default-styles.qdocconf) - -HTML.postheader = \ - "
\n" \ - "
\n" \ - " QDoc Reference Documentation\n" \ - "
\n" \ - "
\n" \ - "
    \n" \ - "
  • Home
  • \n" \ - " \n" - -HTML.postpostheader = \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" - -HTML.footer = \ - "
\n" \ - " \n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "

\n" \ - " © 2012 Digia Plc and/or its\n" \ - " subsidiaries. Documentation contributions included herein are the copyrights of\n" \ - " their respective owners.

\n" \ - "
\n" \ - "

\n" \ - " The documentation provided herein is licensed under the terms of the\n" \ - " GNU Free Documentation\n" \ - " License version 1.3 as published by the Free Software Foundation.

\n" \ - "

\n" \ - " Documentation sources may be obtained from \n" \ - " www.qt-project.org.

\n" \ - "
\n" \ - "

\n" \ - " Digia, Qt and their respective logos are trademarks of Digia Plc \n" \ - " in Finland and/or other countries worldwide. All other trademarks are property\n" \ - " of their respective owners. Privacy Policy

\n" \ - "
\n" \ - -# Files not referenced in any qdoc file. -# See also extraimages.HTML -qhp.QDoc.extraFiles = qdoc-index.html \ - images/arrow_down.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/horBar.png \ - images/sprites-combined.png \ - style/offline.css diff --git a/src/tools/qdoc/doc/config/style/offline.css b/src/tools/qdoc/doc/config/style/offline.css deleted file mode 100644 index 3689ee8d40..0000000000 --- a/src/tools/qdoc/doc/config/style/offline.css +++ /dev/null @@ -1,673 +0,0 @@ -@media screen -{ - -/* basic elements */ - html - { - color: #000000; - background: #FFFFFF; - } - table - { - border-collapse: collapse; - border-spacing: 0; - } - fieldset, img - { - border: 0; - max-width:100%; - } - address, caption, cite, code, dfn, em, strong, th, var, optgroup - { - font-style: inherit; - font-weight: inherit; - } - del, ins - { - text-decoration: none; - } - li - { - list-style: none; - } - ol li - { - list-style: decimal; - } - caption, th - { - text-align: left; - } - h1, h2, h3, h4, h5, h6 - { - font-size: 100%; - } - q:before, q:after - { - content: ''; - } - abbr, acronym - { - border: 0; - font-variant: normal; - } - sup, sub - { - vertical-align: baseline; - } - tt, .qmlreadonly span, .qmldefault span - { - word-spacing:0.5em; - } - legend - { - color: #000000; - } - strong - { - font-weight: bold; - } - em - { - font-style: italic; - } - - body - { - margin-left: 0.5em; - margin-right: 0.5em; - } - a - { - color: #00732F; - text-decoration: none; - } - hr - { - background-color: #E6E6E6; - border: 1px solid #E6E6E6; - height: 1px; - width: 100%; - text-align: left; - margin: 1.5em 0 1.5em 0; - } - - pre - { - border: 1px solid #DDDDDD; - -moz-border-radius: 0.7em 0.7em 0.7em 0.7em; - -webkit-border-radius: 0.7em 0.7em 0.7em 0.7em; - border-radius: 0.7em 0.7em 0.7em 0.7em; - margin: 0 1.5em 1em 1em; - padding: 1em 1em 1em 1em; - overflow-x: auto; - } - table, pre - { - -moz-border-radius: 0.7em 0.7em 0.7em 0.7em; - -webkit-border-radius: 0.7em 0.7em 0.7em 0.7em; - border-radius: 0.7em 0.7em 0.7em 0.7em; - background-color: #F6F6F6; - border: 1px solid #E6E6E6; - border-collapse: separate; - margin-bottom: 2.5em; - } - pre { - font-size: 90%; - display: block; - overflow:hidden; - } - thead - { - margin-top: 0.5em; - font-weight: bold - } - th - { - padding: 0.5em 1.5em 0.5em 1.5em; - background-color: #E1E1E1; - border-left: 1px solid #E6E6E6; - } - td - { - padding: 0.25em 1.5em 0.25em 2em; - } - - td.rightAlign - { - padding: 0.25em 0.5em 0.25em 1em; - } - table tr.odd - { - border-left: 1px solid #E6E6E6; - background-color: #F6F6F6; - color: #66666E; - } - table tr.even - { - border-left: 1px solid #E6E6E6; - background-color: #ffffff; - color: #66666E; - } - - div.float-left - { - float: left; margin-right: 2em - } - div.float-right - { - float: right; margin-left: 2em - } - - span.comment - { - color: #008B00; - font-style: italic - } - span.string, span.char - { - color: #000084; - } - span.number - { - color: #a46200; - } - span.operator - { - color: #202020; - } - span.keyword - { - color: #840000; - } - span.name - { - color: black - } - span.type - { - font-weight: bold - } - span.type a:visited - { - color: #0F5300; - } - span.preprocessor - { - color: #404040 - } -/* end basic elements */ - -/* font style elements */ - .heading - { - font-weight: bold; - font-size: 125%; - } - .subtitle - { - font-size: 110% - } - .small-subtitle - { - font-size: 100% - } - .red - { - color:red; - } -/* end font style elements */ - -/* global settings*/ - .header, .footer - { - display: block; - clear: both; - overflow: hidden; - } -/* end global settings*/ - -/* header elements */ - .header .qtref - { - color: #00732F; - font-weight: bold; - font-size: 130%; - } - - .header .content - { - margin-bottom: 0.5em - } - - .naviNextPrevious - { - display: none - } - .header .breadcrumb - { - font-size: 90%; - padding: 0.5em 0 0.5em 1em; - margin: 0; - background-color: #fafafa; - height: 1.35em; - border-bottom: 1px solid #d1d1d1; - } - - .header .breadcrumb ul - { - margin: 0; - padding: 0; - } - - .header .content - { - word-wrap: break-word; - } - - .header .breadcrumb ul li - { - float: left; - background: url(../images/breadcrumb.png) no-repeat 0 3px; - padding-left: 1.5em; - margin-left: 1.5em; - } - - .header .breadcrumb ul li.last - { - font-weight: normal; - } - - .header .breadcrumb ul li a - { - color: #00732F; - } - - .header .breadcrumb ul li.first - { - background-image: none; - padding-left: 0; - margin-left: 0; - } - - .header .content ol li { - background: none; - margin-bottom: 1.0em; - margin-left: 1.2em; - padding-left: 0 - } - - .header .content li - { - background: url(../images/bullet_sq.png) no-repeat 0 5px; - margin-bottom: 1em; - padding-left: 1.2em; - } - -/* end header elements */ - -/* content elements */ - .content h1 - { - font-weight: bold; - font-size: 150% - } - - .content h2 - { - font-weight: bold; - font-size: 135%; - width: 100%; - } - .content h3 - { - font-weight: bold; - font-size: 120%; - width: 100%; - } - .content table p - { - margin: 0 - } - .content ul - { - padding-left: 2.5em; - } - .content li - { - padding-top: 0.25em; - padding-bottom: 0.25em; - } - .content ul img { - vertical-align: middle; - } - - .content a:visited - { - color: #4c0033; - text-decoration: none; - } - - .content a:visited:hover - { - color: #4c0033; - text-decoration: underline; - } - - a:hover - { - color: #4c0033; - text-decoration: underline; - } - descr p a - { - text-decoration: underline; - } - - .descr p a:visited - { - text-decoration: underline; - } - - .alphaChar{ - width:95%; - background-color:#F6F6F6; - border:1px solid #E6E6E6; - -moz-border-radius: 7px 7px 7px 7px; - border-radius: 7px 7px 7px 7px; - -webkit-border-radius: 7px 7px 7px 7px; - font-size:12pt; - padding-left:10px; - margin-top:10px; - margin-bottom:10px; - } - .flowList{ - /*vertical-align:top;*/ - /*margin:20px auto;*/ - - column-count:3; - -webkit-column-count:3; - -moz-column-count:3; -/* - column-width:100%; - -webkit-column-width:200px; - -col-column-width:200px; -*/ - column-gap:41px; - -webkit-column-gap:41px; - -moz-column-gap:41px; - - column-rule: 1px dashed #ccc; - -webkit-column-rule: 1px dashed #ccc; - -moz-column-rule: 1px dashed #ccc; - } - - .flowList dl{ - } - .flowList dd{ - /*display:inline-block;*/ - margin-left:10px; - min-width:250px; - line-height: 1.5; - min-width:100%; - min-height:15px; - } - - .flowList dd a{ - } - - .content .flowList p{ - padding:0px; - } - - .content .alignedsummary - { - margin: 15px; - } - - - .qmltype - { - text-align: center; - font-size: 120%; - } - .qmlreadonly - { - padding-left: 5px; - float: right; - color: #254117; - } - - .qmldefault - { - padding-left: 5px; - float: right; - color: red; - } - - .qmldoc - { - } - - .generic .alphaChar{ - margin-top:5px; - } - - .generic .odd .alphaChar{ - background-color: #F6F6F6; - } - - .generic .even .alphaChar{ - background-color: #FFFFFF; - } - - .memItemRight{ - padding: 0.25em 1.5em 0.25em 0; - } - .highlightedCode - { - margin: 1.0em; - } - .annotated td { - padding: 0.25em 0.5em 0.25em 0.5em; - } - - .header .content .toc ul - { - padding-left: 0px; - } - - .content .toc h3 { - border-bottom: 0px; - margin-top: 0px; - } - - .content .toc h3 a:hover { - color: #00732F; - text-decoration: none; - } - - .content .toc .level2 - { - margin-left: 1.5em; - } - - .content .toc .level3 - { - margin-left: 3.0em; - } - - .content ul li - { - background: url(../images/bullet_sq.png) no-repeat 0 0.7em; - padding-left: 1em - } - - .content .toc li - { - background: url(../images/bullet_dn.png) no-repeat 0 5px; - padding-left: 1em - } - - .relpage - { - -moz-border-radius: 7px 7px 7px 7px; - -webkit-border-radius: 7px 7px 7px 7px; - border-radius: 7px 7px 7px 7px; - border: 1px solid #DDDDDD; - padding: 25px 25px; - clear: both; - } - .relpage ul - { - float: none; - padding: 1.5em; - } - - h3.fn, span.fn - { - -moz-border-radius:7px 7px 7px 7px; - -webkit-border-radius:7px 7px 7px 7px; - border-radius:7px 7px 7px 7px; - background-color: #F6F6F6; - border-width: 1px; - border-style: solid; - border-color: #E6E6E6; - font-weight: bold; - word-spacing:3px; - padding:3px 5px; - } - - .functionIndex { - font-size:12pt; - word-spacing:10px; - margin-bottom:10px; - background-color: #F6F6F6; - border-width: 1px; - border-style: solid; - border-color: #E6E6E6; - -moz-border-radius: 7px 7px 7px 7px; - -webkit-border-radius: 7px 7px 7px 7px; - border-radius: 7px 7px 7px 7px; - width:100%; - } - - .centerAlign - { - text-align:center; - } - - .rightAlign - { - text-align:right; - } - - .leftAlign - { - text-align:left; - } - - .topAlign{ - vertical-align:top - } - - .functionIndex a{ - display:inline-block; - } - -/* end content elements */ -/* footer elements */ - - .footer - { - color: #393735; - font-size: 0.75em; - text-align: center; - padding-top: 1.5em; - padding-bottom: 1em; - background-color: #E6E7E8; - margin: 0; - } - .footer p - { - margin: 0.25em - } - .small - { - font-size: 0.5em; - } -/* end footer elements */ - - .item { - float: left; - position: relative; - width: 100%; - overflow: hidden; - } - - - .item .primary { - margin-right: 220px; - position: relative; - } - - .item hr { - margin-left: -220px; - } - - .item .secondary { - float: right; - width: 200px; - position: relative; - } - - .item .cols { - clear: both; - display: block; - } - - .item .cols .col { - float: left; - margin-left: 1.5%; - } - - .item .cols .col.first { - margin-left: 0; - } - - .item .cols.two .col { - width: 45%; - } - - .item .box { - margin: 0 0 10px 0; - } - - .item .box h3 { - margin: 0 0 10px 0; - } - - .cols.unclear { - clear:none; - } -} - -/* end of screen media */ - -/* start of print media */ - -@media print -{ - input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft, #feedbackBox, #blurpage, .toc, .breadcrumb, .toolbar, .floatingResult - { - display: none; - background: none; - } - .content - { - background: none; - display: block; - width: 100%; margin: 0; float: none; - } -} -/* end of print media */ diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc index 5486e240c4..5254c46eb5 100644 --- a/src/tools/qdoc/doc/qdoc-manual.qdoc +++ b/src/tools/qdoc/doc/qdoc-manual.qdoc @@ -29,7 +29,7 @@ \page qdoc-index.html \nextpage Introduction to QDoc - \title Table of Contents + \title QDoc Manual \list \li \l {Introduction to QDoc} @@ -75,8 +75,8 @@ /*! \page 01-qdoc-manual.html - \contentspage Table of Contents - \previouspage Table of Contents + \contentspage QDoc Manual + \previouspage QDoc Manual \nextpage Command Index \title Introduction to QDoc @@ -229,7 +229,7 @@ /*! \page 03-qdoc-commands-markup.html - \contentspage Table of Contents + \contentspage QDoc Manual \previouspage Naming Things \nextpage Text Markup @@ -310,7 +310,7 @@ /*! \page 04-qdoc-commands-textmarkup.html - \contentspage Table of Contents + \contentspage QDoc Manual \previouspage Markup Commands \nextpage Document Structure @@ -924,7 +924,7 @@ /*! \page 05-qdoc-commands-documentstructure.html \previouspage Text Markup - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Including Code Inline \title Document Structure @@ -1146,7 +1146,7 @@ /*! \page 06-qdoc-commands-includecodeinline.html \previouspage Document Structure - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Including External Code \title Including Code Inline @@ -1392,7 +1392,7 @@ /*! \page 07-0-qdoc-commands-includingexternalcode.html \previouspage Including Code Inline - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Creating Links \title Including External Code @@ -2030,7 +2030,7 @@ /*! \page 07-1-example.html \previouspage Including External Code - \contentspage Table of Contents + \contentspage QDoc Manual \title Example File @@ -2040,7 +2040,7 @@ /*! \page 08-qdoc-commands-creatinglinks.html \previouspage Including External Code - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Including Images \title Creating Links @@ -2339,7 +2339,7 @@ /*! \page 09-qdoc-commands-includingimages.html \previouspage Creating Links - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Tables and Lists \title Including Images @@ -2535,7 +2535,7 @@ /*! \page 10-qdoc-commands-tablesandlists.html \previouspage Including Images - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Special Content \title Tables and Lists @@ -3061,7 +3061,7 @@ /*! \page 11-qdoc-commands-specialcontent.html \previouspage Tables and Lists - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Miscellaneous \title Special Content @@ -3496,7 +3496,7 @@ /*! \page 12-0-qdoc-commands-miscellaneous.html \previouspage Special Content - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Creating DITA Maps \title Miscellaneous @@ -4247,7 +4247,7 @@ /*! \page 12-1-signalandslots.html \previouspage Miscellaneous - \contentspage Table of Contents + \contentspage QDoc Manual \title signalandslots.qdocinc @@ -4257,7 +4257,7 @@ /*! \page 12-2-objectmodel.html \previouspage Miscellaneous - \contentspage Table of Contents + \contentspage QDoc Manual \title objectmodel.qdocinc @@ -4267,7 +4267,7 @@ /*! \page 12-3-layoutmanagement.html \previouspage Miscellaneous - \contentspage Table of Contents + \contentspage QDoc Manual \title layoutmanagement.qdocinc @@ -4277,7 +4277,7 @@ /*! \page 13-qdoc-commands-topics.html \previouspage Command Index - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Context Commands \title Topic Commands @@ -5887,7 +5887,7 @@ /*! \page 14-qdoc-commands-contextcommands.html \previouspage Topic Commands - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Document Navigation \title Context Commands @@ -5929,7 +5929,7 @@ /*! \page 15-qdoc-commands-navigation.html \previouspage Context Commands - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Reporting Status \title Document Navigation @@ -6125,7 +6125,7 @@ /*! \page 16-qdoc-commands-status.html \previouspage Document Navigation - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Thread Support \title Reporting Status @@ -6427,7 +6427,7 @@ /*! \page 17-qdoc-commands-thread.html \previouspage Reporting Status - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Relating Things \title Thread Support @@ -6610,7 +6610,7 @@ /*! \page 18-qdoc-commands-relating.html \previouspage Thread Support - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Grouping Things \title Relating Things @@ -6795,7 +6795,7 @@ /*! \page 19-qdoc-commands-grouping.html \previouspage Relating Things - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Naming Things \title Grouping Things @@ -6909,7 +6909,7 @@ /*! \page 20-qdoc-commands-namingthings.html \previouspage Grouping Things - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Markup Commands \title Naming Things @@ -6997,7 +6997,7 @@ /*! \page 21-0-qdoc-creating-dita-maps.html \previouspage Miscellaneous - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage The QDoc Configuration File \title Creating DITA Maps @@ -7134,7 +7134,7 @@ /*! \page 21-0-qdoc-configuration.html \previouspage Creating DITA Maps - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Generic Configuration Variables \title The QDoc Configuration File @@ -7246,7 +7246,7 @@ /*! \page 21-1-minimum-qdocconf.html \previouspage qt.qdocconf - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Generating DITA XML Output \title minimum.qdocconf @@ -7257,7 +7257,7 @@ /*! \page 21-2-qt-qdocconf.html \previouspage Supporting Derived Projects - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage minimum.qdocconf \title qt.qdocconf @@ -7268,8 +7268,8 @@ /*! \page 21-3-qt-dita-xml-output.html \previouspage minimum.qdocconf - \contentspage Table of Contents - \nextpage Table of Contents + \contentspage QDoc Manual + \nextpage QDoc Manual \title Generating DITA XML Output @@ -7327,7 +7327,7 @@ /*! \page 22-qdoc-configuration-generalvariables.html \previouspage The QDoc Configuration File - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Creating Help Project Files \title Generic Configuration Variables @@ -8235,7 +8235,7 @@ /*! \page 22-creating-help-project-files.html \previouspage Generic Configuration Variables - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage C++ Specific Configuration Variables \title Creating Help Project Files @@ -8304,7 +8304,7 @@ /*! \page 23-qdoc-configuration-cppvariables.html \previouspage Creating Help Project Files - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage HTML Specific Configuration Variables \title C++ Specific Configuration Variables @@ -8418,7 +8418,7 @@ /*! \page 24-qdoc-configuration-htmlvariables.html \previouspage C++ Specific Configuration Variables - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Supporting Derived Projects \title HTML Specific Configuration Variables @@ -8533,7 +8533,7 @@ /*! \page 25-qdoc-configuration-derivedprojects.html \previouspage HTML Specific Configuration Variables - \contentspage Table of Contents + \contentspage QDoc Manual \title Supporting Derived Projects @@ -8674,7 +8674,7 @@ /*! \page 27-qdoc-commands-alphabetical.html \previouspage Introduction to QDoc - \contentspage Table of Contents + \contentspage QDoc Manual \nextpage Topic Commands \title Command Index diff --git a/src/tools/qdoc/qdoc.pro b/src/tools/qdoc/qdoc.pro index c0f3cd70d1..9729a758f0 100644 --- a/src/tools/qdoc/qdoc.pro +++ b/src/tools/qdoc/qdoc.pro @@ -88,21 +88,6 @@ SOURCES += jscodemarker.cpp \ qtPrepareTool(QDOC, qdoc) qtPrepareTool(QHELPGENERATOR, qhelpgenerator) -equals(QMAKE_DIR_SEP, /) { - QDOC = QT_BUILD_TREE=$$QT_BUILD_TREE QT_SOURCE_TREE=$$QT_SOURCE_TREE $$QDOC -} else { - QDOC = set QT_BUILD_TREE=$$QT_BUILD_TREE&& set QT_SOURCE_TREE=$$QT_SOURCE_TREE&& $$QDOC - QDOC = $$replace(QDOC, "/", "\\") -} - -html-docs.commands = $$QDOC $$PWD/doc/config/qdoc.qdocconf -html-docs.files = $$PWD/doc/html - -qch-docs.commands = $$QHELPGENERATOR $$PWD/doc/html/qdoc.qhp -o $$PWD/doc/qch/qdoc.qch -qch-docs.files = $$PWD/doc/qch -qch-docs.path = $$[QT_INSTALL_DOCS] -qch-docs.CONFIG += no_check_exist directory - -QMAKE_EXTRA_TARGETS += html-docs qch-docs +QMAKE_DOCS = $$PWD/doc/config/qdoc.qdocconf load(qt_tool) -- cgit v1.2.3 From b06363886d17cef736610f9274c784db37d3e500 Mon Sep 17 00:00:00 2001 From: Bjoern Breitmeyer Date: Thu, 31 Jan 2013 11:47:56 +0100 Subject: Fixed QT_NO_DRAGANDDROP build for the windows plugin Change-Id: Ieb987105bdcc08118a1b83cf3b74a93fa402264a Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowsintegration.cpp | 13 +++++++++---- src/plugins/platforms/windows/qwindowsintegration.h | 4 +++- src/plugins/platforms/windows/qwindowswindow.cpp | 8 ++++++++ src/plugins/platforms/windows/windows.pro | 12 ++++++++++-- 4 files changed, 30 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 4473b6b8a4..da4519199f 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -59,8 +59,10 @@ #include "qwindowsguieventdispatcher.h" #ifndef QT_NO_CLIPBOARD # include "qwindowsclipboard.h" +# ifndef QT_NO_DRAGANDDROP +# include "qwindowsdrag.h" +# endif #endif -#include "qwindowsdrag.h" #include "qwindowsinputcontext.h" #include "qwindowskeymapper.h" # ifndef QT_NO_ACCESSIBILITY @@ -266,8 +268,10 @@ struct QWindowsIntegrationPrivate QWindowsNativeInterface m_nativeInterface; #ifndef QT_NO_CLIPBOARD QWindowsClipboard m_clipboard; -#endif +# ifndef QT_NO_DRAGANDDROP QWindowsDrag m_drag; +# endif +#endif QWindowsGuiEventDispatcher *m_eventDispatcher; #if defined(QT_OPENGL_ES_2) QEGLStaticContextPtr m_staticEGLContext; @@ -529,12 +533,13 @@ QPlatformClipboard * QWindowsIntegration::clipboard() const { return &d->m_clipboard; } -#endif // !QT_NO_CLIPBOARD - +# ifndef QT_NO_DRAGANDDROP QPlatformDrag *QWindowsIntegration::drag() const { return &d->m_drag; } +# endif // !QT_NO_DRAGANDDROP +#endif // !QT_NO_CLIPBOARD QPlatformInputContext * QWindowsIntegration::inputContext() const { diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h index 2593c3b946..24dc01f0bd 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.h +++ b/src/plugins/platforms/windows/qwindowsintegration.h @@ -75,8 +75,10 @@ public: virtual QAbstractEventDispatcher *guiThreadEventDispatcher() const; #ifndef QT_NO_CLIPBOARD virtual QPlatformClipboard *clipboard() const; -#endif +# ifndef QT_NO_DRAGANDDROP virtual QPlatformDrag *drag() const; +# endif +#endif !QT_NO_CLIPBOARD virtual QPlatformInputContext *inputContext() const; #ifndef QT_NO_ACCESSIBILITY virtual QPlatformAccessibility *accessibility() const; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 3530f0af68..2a26e092eb 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -815,21 +815,29 @@ void QWindowsWindow::destroyWindow() void QWindowsWindow::registerDropSite() { +#ifndef QT_NO_CLIPBOARD +# ifndef QT_NO_DRAGANDDROP if (m_data.hwnd && !m_dropTarget) { m_dropTarget = new QWindowsOleDropTarget(window()); RegisterDragDrop(m_data.hwnd, m_dropTarget); CoLockObjectExternal(m_dropTarget, true, true); } +# endif // !QT_NO_DRAGANDDROP +#endif // !QT_NO_CLIPBOARD } void QWindowsWindow::unregisterDropSite() { +#ifndef QT_NO_CLIPBOARD +# ifndef QT_NO_DRAGANDDROP if (m_data.hwnd && m_dropTarget) { m_dropTarget->Release(); CoLockObjectExternal(m_dropTarget, false, true); RevokeDragDrop(m_data.hwnd); m_dropTarget = 0; } +# endif // !QT_NO_DRAGANDDROP +#endif // !QT_NO_CLIPBOARD } // Returns topmost QWindowsWindow ancestor even if there are embedded windows in the chain. diff --git a/src/plugins/platforms/windows/windows.pro b/src/plugins/platforms/windows/windows.pro index 7f73465135..ff162e2d41 100644 --- a/src/plugins/platforms/windows/windows.pro +++ b/src/plugins/platforms/windows/windows.pro @@ -45,7 +45,6 @@ SOURCES += \ qwindowsguieventdispatcher.cpp \ qwindowsole.cpp \ qwindowsmime.cpp \ - qwindowsdrag.cpp \ qwindowsinternalmimedata.cpp \ qwindowscursor.cpp \ qwindowsinputcontext.cpp \ @@ -69,7 +68,6 @@ HEADERS += \ qtwindows_additional.h \ qwindowsole.h \ qwindowsmime.h \ - qwindowsdrag.h \ qwindowsinternalmimedata.h \ qwindowscursor.h \ array.h \ @@ -94,6 +92,16 @@ contains(QT_CONFIG, opengles2) { HEADERS += qwindowsclipboard.h } +# drag and drop on windows only works if a clipboard is available +!contains( DEFINES, QT_NO_DRAGANDDROP ) { + !win32:SOURCES += qwindowsdrag.cpp + !win32:HEADERS += qwindowsdrag.h + win32:!contains( DEFINES, QT_NO_CLIPBOARD ) { + HEADERS += qwindowsdrag.h + SOURCES += qwindowsdrag.cpp + } +} + # Enable access to HB_Face in harfbuzz includes included by qfontengine_p.h. DEFINES *= QT_COMPILES_IN_HARFBUZZ -- cgit v1.2.3 From d757d023fe5d2750ba03108ff2c5c117724a16a3 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 7 Feb 2013 16:19:13 +0100 Subject: Fix spelling error found by bot. Change-Id: I7e9a00e014368450b6dcb8172f7888bb744d6555 Reviewed-by: Oswald Buddenhagen --- src/tools/qdoc/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index 348023b750..50632f1da4 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -115,7 +115,7 @@ static void printHelp() " -D " "Define as a macro while parsing sources\n" " -depends " - "Specify dependant modules\n" + "Specify dependent modules\n" " -help " "Display this information and exit\n" " -highlighting " -- cgit v1.2.3 From 10d5b24cc5d00b5495cd7c3cd07f36056b02e43c Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 28 Jan 2013 15:02:49 +0100 Subject: Doc: Make QDoc/HelpProjectWriter always add member pages to .qch files This change refactors the code for inserting compatibility and obsolete member pages into a qhp file, detaching it as a new function and calling it when processing each node. This ensures that members page, compatibility and obsolete pages (html files) are added to .QCH files for all processed nodes that have children or related nodes. Also renames a variable ('node'->'nodeChildren') to prevent shadowing. Task-number: QTBUG-29314 Change-Id: Iccee70ba8768d48b24e68b08651043d0ce4a62a5 Reviewed-by: Martin Smith --- src/tools/qdoc/helpprojectwriter.cpp | 140 ++++++++++++++++++----------------- src/tools/qdoc/helpprojectwriter.h | 4 + 2 files changed, 76 insertions(+), 68 deletions(-) (limited to 'src') diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp index 09b3629ade..fdba15700f 100644 --- a/src/tools/qdoc/helpprojectwriter.cpp +++ b/src/tools/qdoc/helpprojectwriter.cpp @@ -429,17 +429,18 @@ void HelpProjectWriter::generateSections(HelpProject &project, // Ensure that we don't visit nodes more than once. QMap childMap; - foreach (const Node *node, inner->childNodes()) { - if (node->access() == Node::Private) + foreach (const Node *childNode, inner->childNodes()) { + if (childNode->access() == Node::Private) continue; - if (node->type() == Node::Document) { + + if (childNode->type() == Node::Document) { /* Don't visit QML property group nodes, but visit their children, which are all QML property nodes. */ - if (node->subType() == Node::QmlPropertyGroup) { - const InnerNode* inner = static_cast(node); + if (childNode->subType() == Node::QmlPropertyGroup) { + const InnerNode* inner = static_cast(childNode); foreach (const Node* n, inner->childNodes()) { if (n->access() == Node::Private) continue; @@ -447,17 +448,24 @@ void HelpProjectWriter::generateSections(HelpProject &project, } } else - childMap[static_cast(node)->fullTitle()] = node; + childMap[static_cast(childNode)->fullTitle()] = childNode; } else { - if (node->type() == Node::Function) { - const FunctionNode *funcNode = static_cast(node); + // Store member status of children + project.memberStatus[node].insert(childNode->status()); + + if (childNode->type() == Node::Function) { + const FunctionNode *funcNode = static_cast(childNode); if (funcNode->isOverload()) continue; } - childMap[node->fullDocumentName()] = node; + childMap[childNode->fullDocumentName()] = childNode; } } + // Insert files for all/compatibility/obsolete members + addMembers(project, writer, node, false); + if (node->relates()) + addMembers(project, writer, node->relates(), false); foreach (const Node *child, childMap) generateSections(project, writer, child); @@ -483,6 +491,57 @@ void HelpProjectWriter::writeHashFile(QFile &file) hashFile.close(); } +void HelpProjectWriter::writeSection(QXmlStreamWriter &writer, const QString &path, + const QString &value) +{ + writer.writeStartElement(QStringLiteral("section")); + writer.writeAttribute(QStringLiteral("ref"), path); + writer.writeAttribute(QStringLiteral("title"), value); + writer.writeEndElement(); // section +} + +/* + Add files for all members, compatibility members and obsolete members + Also write subsections for these depending on 'writeSections' (default=true). +*/ +void HelpProjectWriter::addMembers(HelpProject &project, QXmlStreamWriter &writer, + const Node *node, bool writeSections) +{ + QString href = gen_->fullDocumentLocation(node,true); + href = href.left(href.size()-5); + if (href.isEmpty()) + return; + + Node::SubType subType = static_cast(node)->subType(); + + bool derivedClass = false; + if (node->type() == Node::Class) + derivedClass = !(static_cast(node)->baseClasses().isEmpty()); + + // Do not generate a 'List of all members' for namespaces or header files, + // but always generate it for derived classes and QML classes + if (node->type() != Node::Namespace && subType != Node::HeaderFile && + (derivedClass || subType == Node::QmlClass || + !project.memberStatus[node].isEmpty())) { + QString membersPath = href + QStringLiteral("-members.html"); + project.files.insert(membersPath); + if (writeSections) + writeSection(writer, membersPath, tr("List of all members")); + } + if (project.memberStatus[node].contains(Node::Compat)) { + QString compatPath = href + QStringLiteral("-compat.html"); + project.files.insert(compatPath); + if (writeSections) + writeSection(writer, compatPath, tr("Compatibility members")); + } + if (project.memberStatus[node].contains(Node::Obsolete)) { + QString obsoletePath = href + QStringLiteral("-obsolete.html"); + project.files.insert(obsoletePath); + if (writeSections) + writeSection(writer, obsoletePath, tr("Obsolete members")); + } +} + void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer, const Node *node) { @@ -499,41 +558,12 @@ void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer else writer.writeAttribute("title", tr("%1 Class Reference").arg(objName)); - // Write subsections for all members, obsolete members and Qt 3 - // members. - if (!project.memberStatus[node].isEmpty()) { - QString membersPath = href.left(href.size()-5) + "-members.html"; - writer.writeStartElement("section"); - writer.writeAttribute("ref", membersPath); - writer.writeAttribute("title", tr("List of all members")); - writer.writeEndElement(); // section - project.files.insert(membersPath); - } - if (project.memberStatus[node].contains(Node::Compat)) { - QString compatPath = href.left(href.size()-5) + "-compat.html"; - writer.writeStartElement("section"); - writer.writeAttribute("ref", compatPath); - writer.writeAttribute("title", tr("Compatibility members")); - writer.writeEndElement(); // section - project.files.insert(compatPath); - } - if (project.memberStatus[node].contains(Node::Obsolete)) { - QString obsoletePath = href.left(href.size()-5) + "-obsolete.html"; - writer.writeStartElement("section"); - writer.writeAttribute("ref", obsoletePath); - writer.writeAttribute("title", tr("Obsolete members")); - writer.writeEndElement(); // section - project.files.insert(obsoletePath); - } - + addMembers(project, writer, node); writer.writeEndElement(); // section break; case Node::Namespace: - writer.writeStartElement("section"); - writer.writeAttribute("ref", href); - writer.writeAttribute("title", objName); - writer.writeEndElement(); // section + writeSection(writer, href, objName); break; case Node::Document: { @@ -548,34 +578,8 @@ void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer else writer.writeAttribute("title", docNode->fullTitle()); - if ((docNode->subType() == Node::HeaderFile) || (docNode->subType() == Node::QmlClass)) { - // Write subsections for all members, obsolete members and Qt 3 - // members. - if (!project.memberStatus[node].isEmpty() || (docNode->subType() == Node::QmlClass)) { - QString membersPath = href.left(href.size()-5) + "-members.html"; - writer.writeStartElement("section"); - writer.writeAttribute("ref", membersPath); - writer.writeAttribute("title", tr("List of all members")); - writer.writeEndElement(); // section - project.files.insert(membersPath); - } - if (project.memberStatus[node].contains(Node::Compat)) { - QString compatPath = href.left(href.size()-5) + "-compat.html"; - writer.writeStartElement("section"); - writer.writeAttribute("ref", compatPath); - writer.writeAttribute("title", tr("Compatibility members")); - writer.writeEndElement(); // section - project.files.insert(compatPath); - } - if (project.memberStatus[node].contains(Node::Obsolete)) { - QString obsoletePath = href.left(href.size()-5) + "-obsolete.html"; - writer.writeStartElement("section"); - writer.writeAttribute("ref", obsoletePath); - writer.writeAttribute("title", tr("Obsolete members")); - writer.writeEndElement(); // section - project.files.insert(obsoletePath); - } - } + if ((docNode->subType() == Node::HeaderFile) || (docNode->subType() == Node::QmlClass)) + addMembers(project, writer, node); writer.writeEndElement(); // section } diff --git a/src/tools/qdoc/helpprojectwriter.h b/src/tools/qdoc/helpprojectwriter.h index 0ca3043223..5dfa12cf73 100644 --- a/src/tools/qdoc/helpprojectwriter.h +++ b/src/tools/qdoc/helpprojectwriter.h @@ -105,6 +105,10 @@ private: void writeHashFile(QFile &file); void writeNode(HelpProject &project, QXmlStreamWriter &writer, const Node *node); void readSelectors(SubProject &subproject, const QStringList &selectors); + void addMembers(HelpProject &project, QXmlStreamWriter &writer, + const Node *node, bool writeSections = true); + void writeSection(QXmlStreamWriter &writer, const QString &path, + const QString &value); QDocDatabase* qdb_; Generator* gen_; -- cgit v1.2.3 From bc8727cbbc751cc8a10289cb5ec78065fefe9bcc Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 7 Feb 2013 15:11:55 +0100 Subject: Add translator help for accessibility strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is also one string fix: cursor was twice, the second one should have been text caret. These roles follow IAccessible/MSAA as reference. Change-Id: I39b64fd01376fec9e8d9b743c43a24611a1d9fbd Reviewed-by: Friedemann Kleint Reviewed-by: Jan Arve Sæther --- src/gui/accessible/qaccessible.h | 4 +- src/platformsupport/linuxaccessibility/bridge.cpp | 72 +++++++++++++++++++++-- 2 files changed, 70 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index b26f592e11..d316ec4f10 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -284,10 +284,10 @@ public: Canvas = 0x00000035, Animation = 0x00000036, Equation = 0x00000037, - ButtonDropDown = 0x00000038, + ButtonDropDown = 0x00000038, // The object represents a button that expands a grid. ButtonMenu = 0x00000039, ButtonDropGrid = 0x0000003A, - Whitespace = 0x0000003B, + Whitespace = 0x0000003B, // The object represents blank space between other objects. PageTabList = 0x0000003C, Clock = 0x0000003D, Splitter = 0x0000003E, diff --git a/src/platformsupport/linuxaccessibility/bridge.cpp b/src/platformsupport/linuxaccessibility/bridge.cpp index a10358edba..181feeba6a 100644 --- a/src/platformsupport/linuxaccessibility/bridge.cpp +++ b/src/platformsupport/linuxaccessibility/bridge.cpp @@ -117,69 +117,133 @@ struct RoleMapping { }; static RoleMapping map[] = { + //: Role of an accessible object - the object is in an invalid state or could not be constructed { QAccessible::NoRole, ATSPI_ROLE_INVALID, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "invalid role") }, + //: Role of an accessible object { QAccessible::TitleBar, ATSPI_ROLE_TEXT, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "title bar") }, + //: Role of an accessible object { QAccessible::MenuBar, ATSPI_ROLE_MENU_BAR, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "menu bar") }, + //: Role of an accessible object { QAccessible::ScrollBar, ATSPI_ROLE_SCROLL_BAR, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "scroll bar") }, + //: Role of an accessible object - the grip is usually used for resizing another object { QAccessible::Grip, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "grip") }, + //: Role of an accessible object { QAccessible::Sound, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "sound") }, + //: Role of an accessible object { QAccessible::Cursor, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "cursor") }, - { QAccessible::Caret, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "cursor") }, + //: Role of an accessible object + { QAccessible::Caret, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "text caret") }, + //: Role of an accessible object { QAccessible::AlertMessage, ATSPI_ROLE_ALERT, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "alert message") }, + //: Role of an accessible object { QAccessible::Window, ATSPI_ROLE_WINDOW, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "window") }, + //: Role of an accessible object { QAccessible::Client, ATSPI_ROLE_FILLER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "filler") }, + //: Role of an accessible object { QAccessible::PopupMenu, ATSPI_ROLE_POPUP_MENU, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "popup menu") }, + //: Role of an accessible object { QAccessible::MenuItem, ATSPI_ROLE_MENU_ITEM, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "menu item") }, + //: Role of an accessible object { QAccessible::ToolTip, ATSPI_ROLE_TOOL_TIP, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "tool tip") }, + //: Role of an accessible object { QAccessible::Application, ATSPI_ROLE_APPLICATION, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "application") }, + //: Role of an accessible object { QAccessible::Document, ATSPI_ROLE_DOCUMENT_FRAME, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "document") }, + //: Role of an accessible object { QAccessible::Pane, ATSPI_ROLE_PANEL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "panel") }, + //: Role of an accessible object { QAccessible::Chart, ATSPI_ROLE_CHART, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "chart") }, + //: Role of an accessible object { QAccessible::Dialog, ATSPI_ROLE_DIALOG, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "dialog") }, + //: Role of an accessible object { QAccessible::Border, ATSPI_ROLE_FRAME, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "frame") }, + //: Role of an accessible object { QAccessible::Grouping, ATSPI_ROLE_PANEL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "panel") }, + //: Role of an accessible object { QAccessible::Separator, ATSPI_ROLE_SEPARATOR, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "separator") }, + //: Role of an accessible object { QAccessible::ToolBar, ATSPI_ROLE_TOOL_BAR, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "tool bar") }, + //: Role of an accessible object { QAccessible::StatusBar, ATSPI_ROLE_STATUS_BAR, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "status bar") }, + //: Role of an accessible object { QAccessible::Table, ATSPI_ROLE_TABLE, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "table") }, + //: Role of an accessible object - part of a table { QAccessible::ColumnHeader, ATSPI_ROLE_TABLE_COLUMN_HEADER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "column header") }, + //: Role of an accessible object - part of a table { QAccessible::RowHeader, ATSPI_ROLE_TABLE_ROW_HEADER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "row header") }, + //: Role of an accessible object - part of a table { QAccessible::Column, ATSPI_ROLE_TABLE_CELL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "column") }, + //: Role of an accessible object - part of a table { QAccessible::Row, ATSPI_ROLE_TABLE_ROW, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "row") }, + //: Role of an accessible object - part of a table { QAccessible::Cell, ATSPI_ROLE_TABLE_CELL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "cell") }, + //: Role of an accessible object { QAccessible::Link, ATSPI_ROLE_LINK, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "link") }, + //: Role of an accessible object { QAccessible::HelpBalloon, ATSPI_ROLE_DIALOG, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "help balloon") }, + //: Role of an accessible object - a helper dialog { QAccessible::Assistant, ATSPI_ROLE_DIALOG, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "assistant") }, + //: Role of an accessible object { QAccessible::List, ATSPI_ROLE_LIST, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "list") }, + //: Role of an accessible object { QAccessible::ListItem, ATSPI_ROLE_LIST_ITEM, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "list item") }, + //: Role of an accessible object { QAccessible::Tree, ATSPI_ROLE_TREE, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "tree") }, + //: Role of an accessible object { QAccessible::TreeItem, ATSPI_ROLE_TABLE_CELL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "tree item") }, + //: Role of an accessible object { QAccessible::PageTab, ATSPI_ROLE_PAGE_TAB, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "page tab") }, + //: Role of an accessible object { QAccessible::PropertyPage, ATSPI_ROLE_PAGE_TAB, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "property page") }, + //: Role of an accessible object { QAccessible::Indicator, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "indicator") }, + //: Role of an accessible object { QAccessible::Graphic, ATSPI_ROLE_IMAGE, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "graphic") }, + //: Role of an accessible object { QAccessible::StaticText, ATSPI_ROLE_LABEL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "label") }, + //: Role of an accessible object { QAccessible::EditableText, ATSPI_ROLE_TEXT, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "text") }, + //: Role of an accessible object { QAccessible::PushButton, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "push button") }, + //: Role of an accessible object { QAccessible::CheckBox, ATSPI_ROLE_CHECK_BOX, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "check box") }, + //: Role of an accessible object { QAccessible::RadioButton, ATSPI_ROLE_RADIO_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "radio button") }, + //: Role of an accessible object { QAccessible::ComboBox, ATSPI_ROLE_COMBO_BOX, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "combo box") }, + //: Role of an accessible object { QAccessible::ProgressBar, ATSPI_ROLE_PROGRESS_BAR, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "progress bar") }, + //: Role of an accessible object { QAccessible::Dial, ATSPI_ROLE_DIAL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "dial") }, + //: Role of an accessible object { QAccessible::HotkeyField, ATSPI_ROLE_TEXT, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "hotkey field") }, + //: Role of an accessible object { QAccessible::Slider, ATSPI_ROLE_SLIDER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "slider") }, + //: Role of an accessible object { QAccessible::SpinBox, ATSPI_ROLE_SPIN_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "spin box") }, + //: Role of an accessible object { QAccessible::Canvas, ATSPI_ROLE_CANVAS, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "canvas") }, + //: Role of an accessible object { QAccessible::Animation, ATSPI_ROLE_ANIMATION, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "animation") }, + //: Role of an accessible object { QAccessible::Equation, ATSPI_ROLE_TEXT, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "equation") }, - { QAccessible::ButtonDropDown, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "button drop down") }, + //: Role of an accessible object + { QAccessible::ButtonDropDown, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "button with drop down") }, + //: Role of an accessible object { QAccessible::ButtonMenu, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "button menu") }, - { QAccessible::ButtonDropGrid, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "button drop grid") }, - { QAccessible::Whitespace, ATSPI_ROLE_FILLER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "whitespace") }, + //: Role of an accessible object - a button that expands a grid. + { QAccessible::ButtonDropGrid, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "button with drop down grid") }, + //: Role of an accessible object - blank space between other objects. + { QAccessible::Whitespace, ATSPI_ROLE_FILLER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "space") }, + //: Role of an accessible object { QAccessible::PageTabList, ATSPI_ROLE_PAGE_TAB_LIST, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "page tab list") }, + //: Role of an accessible object { QAccessible::Clock, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "clock") }, + //: Role of an accessible object { QAccessible::Splitter, ATSPI_ROLE_SPLIT_PANE, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "splitter") }, + //: Role of an accessible object { QAccessible::LayeredPane, ATSPI_ROLE_LAYERED_PANE, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "layered pane") }, + //: Role of an accessible object { QAccessible::UserRole, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "unknown") } }; -- cgit v1.2.3 From 391b5a465eb20758fe36528c32da51f95888a9da Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 8 Feb 2013 10:19:42 +0100 Subject: Do not force top level flag on embedded windows. Regression introduced by cd7ba89a07f794b17fc66ba29515b104c4d21f27. Task-number: QTBUG-29564 Task-number: QTBUG-28872 Change-Id: I6402a971af89321d18afb42dc25e54b1c88df129 Reviewed-by: Miikka Heikkinen Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 2a26e092eb..07dc668b3f 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -345,10 +345,12 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag if (creationFlags & ForceChild) { topLevel = false; - } else if (creationFlags & ForceTopLevel) { - topLevel = true; + } else if (embedded) { + // Embedded native windows (for example Active X server windows) are by + // definition never toplevel, even though they do not have QWindow parents. + topLevel = false; } else { - topLevel = w->isTopLevel(); + topLevel = (creationFlags & ForceTopLevel) ? true : w->isTopLevel(); } if (topLevel && flags == 1) { -- cgit v1.2.3 From 67bed5616bf4743b432566130d1f3cfb6a2dc0c1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 7 Feb 2013 15:58:31 +0100 Subject: Fix broken fading of menus. Breakage introduced by b3820b12fbded1f173837eee7f7559783e92b46b Set layered in backing store for frameless windows as was before. Task-number: QTBUG-29010 Task-number: QTBUG-28531 Change-Id: I13f8f0d58d71b6612430c7048056f672e23b8095 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowsbackingstore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp index 0a7ff61b7b..b40aefa225 100644 --- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp +++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp @@ -88,7 +88,8 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion ®ion, QWindowsWindow *rw = QWindowsWindow::baseWindowOf(window); #ifndef Q_OS_WINCE - if (QWindowsWindow::setWindowLayered(rw->handle(), window->flags(), rw->format().hasAlpha(), rw->opacity())) { + const Qt::WindowFlags flags = window->flags(); + if ((flags & Qt::FramelessWindowHint) && QWindowsWindow::setWindowLayered(rw->handle(), flags, rw->format().hasAlpha(), rw->opacity())) { QRect r = window->frameGeometry(); QPoint frameOffset(window->frameMargins().left(), window->frameMargins().top()); QRect dirtyRect = br.translated(offset + frameOffset); @@ -97,7 +98,6 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion ®ion, POINT ptDst = {r.x(), r.y()}; POINT ptSrc = {0, 0}; BLENDFUNCTION blend = {AC_SRC_OVER, 0, (BYTE)(255.0 * rw->opacity()), AC_SRC_ALPHA}; - if (QWindowsContext::user32dll.updateLayeredWindowIndirect) { RECT dirty = {dirtyRect.x(), dirtyRect.y(), dirtyRect.x() + dirtyRect.width(), dirtyRect.y() + dirtyRect.height()}; -- cgit v1.2.3 From e7a242b27b961c64613542c75c69954d1c7bd315 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Fri, 8 Feb 2013 12:32:14 +0100 Subject: QProcessEnvironment: Permit magic cmd variables The cmd shell inserts magic variables starting with a = into the environment. Task-number: QTCREATORBUG-8716 Change-Id: I2f140032aea4fb1d77633c6baf90d7b536e2812a Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qprocess_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index d249bb17fb..693778e629 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -364,7 +364,8 @@ QProcessEnvironment QProcessEnvironment::systemEnvironment() if (wchar_t *envStrings = GetEnvironmentStringsW()) { for (const wchar_t *entry = envStrings; *entry; ) { const int entryLen = int(wcslen(entry)); - if (const wchar_t *equal = wcschr(entry, L'=')) { + // + 1 to permit magic cmd variable names starting with = + if (const wchar_t *equal = wcschr(entry + 1, L'=')) { int nameLen = equal - entry; QString name = QString::fromWCharArray(entry, nameLen); QString value = QString::fromWCharArray(equal + 1, entryLen - nameLen - 1); -- cgit v1.2.3 From 2be39c68320ab058ac5428ed1a9f0bb69a6c5893 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 6 Feb 2013 16:29:58 +0100 Subject: Cocoa: Make tool window receive mouse events also when its parent is modal We need to check for the Cocoa window class because of the way currently QDockWidget works. Change-Id: If69c7327c168518614fe884defa79deb358e260d Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoawindow.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 463c065c9a..14d62c9fca 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -301,9 +301,11 @@ void QCocoaWindow::setVisible(bool visible) [m_nsWindow orderFront: nil]; } - // We want the events to properly reach the popup and dialog - if (window()->type() == Qt::Popup || window()->type() == Qt::Dialog) + // We want the events to properly reach the popup, dialog, and tool + if ((window()->type() == Qt::Popup || window()->type() == Qt::Dialog || window()->type() == Qt::Tool) + && [m_nsWindow isKindOfClass:[NSPanel class]]) { [(NSPanel *)m_nsWindow setWorksWhenModal:YES]; + } } } else { [m_contentView setHidden:NO]; -- cgit v1.2.3 From 934afb5c57fce6d28ce0d7ae8ac1450e8d833b17 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Fri, 8 Feb 2013 10:09:09 +0200 Subject: Fix loading of SSL certificate of DER files. DER certificates should not be opened as text files, so we only pass the QIODevice::Text flag when the format is QSsl::Pem. Change-Id: I4bad98023c397b967d5beeec0aaa6c414e06fd9c Reviewed-by: Richard J. Moore --- src/network/ssl/qsslcertificate.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index db20f5618b..8b5be7ae00 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -876,8 +876,11 @@ QList QSslCertificate::fromPath(const QString &path, // Check if the path is a file. if (QFileInfo(sourcePath).isFile()) { QFile file(sourcePath); - if (file.open(QIODevice::ReadOnly | QIODevice::Text)) - return QSslCertificate::fromData(file.readAll(),format); + QIODevice::OpenMode openMode = QIODevice::ReadOnly; + if (format == QSsl::Pem) + openMode |= QIODevice::Text; + if (file.open(openMode)) + return QSslCertificate::fromData(file.readAll(), format); return QList(); } } @@ -899,8 +902,11 @@ QList QSslCertificate::fromPath(const QString &path, continue; QFile file(filePath); - if (file.open(QIODevice::ReadOnly | QIODevice::Text)) - certs += QSslCertificate::fromData(file.readAll(),format); + QIODevice::OpenMode openMode = QIODevice::ReadOnly; + if (format == QSsl::Pem) + openMode |= QIODevice::Text; + if (file.open(openMode)) + certs += QSslCertificate::fromData(file.readAll(), format); } return certs; } -- cgit v1.2.3 From 4866fcf0081e0c416c0dc6f85f11eac66cde57ff Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 6 Feb 2013 13:41:04 +0100 Subject: qdoc: Missing links to qRegisterMetaType() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A serious problem in the design of qdoc is its C++ parser. It is an ad hoc recursive descent parser, which has not kept pace with Qt's use of the more esoteric aspects of C++. Part of the problem is that qdoc does not send files through the preprocessor before processing them. The bottom line is qdoc needs the C++ parser used in Qt Creator. But that is a long-term solution. In the short term, we have to introduce minor hacks like this one to keep qdoc going until the parser can be replaced. The problem in this case is that qdoc doesn't handle the QT_PREPEND_NAMESPACE macro in function declarations. The solution is to let qdoc ignore the macro and just use the macro's parameter, which is what qdoc wants anyway. Task-number: QTBUG-28953 Change-Id: I5b9efcc10fa8fb500a44854ee995c2e50e9e16b5 Reviewed-by: Topi Reiniö Reviewed-by: Jerome Pasion --- src/tools/qdoc/cppcodeparser.cpp | 88 ++++++++++++++++++++++++++-------------- src/tools/qdoc/cppcodeparser.h | 23 +++++++---- 2 files changed, 72 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index e83147776f..0af5a841eb 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE /* qmake ignore Q_OBJECT */ +static bool inMacroCommand_ = false; QStringList CppCodeParser::exampleFiles; QStringList CppCodeParser::exampleDirs; @@ -311,13 +312,14 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, const QString& command, const ArgLocPair& arg) { + ExtraFuncData extra; if (command == COMMAND_FN) { QStringList parentPath; FunctionNode *func = 0; FunctionNode *clone = 0; - if (!makeFunctionNode(arg.first, &parentPath, &clone) && - !makeFunctionNode("void " + arg.first, &parentPath, &clone)) { + if (!makeFunctionNode(arg.first, &parentPath, &clone, extra) && + !makeFunctionNode("void " + arg.first, &parentPath, &clone, extra)) { doc.startLocation().warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_FN)); } else { @@ -368,7 +370,9 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, QStringList parentPath; FunctionNode *func = 0; - if (makeFunctionNode(arg.first, &parentPath, &func, qdb_->treeRoot())) { + extra.root = qdb_->treeRoot(); + extra.isMacro = true; + if (makeFunctionNode(arg.first, &parentPath, &func, extra)) { if (!parentPath.isEmpty()) { doc.startLocation().warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_MACRO)); delete func; @@ -1152,7 +1156,6 @@ bool CppCodeParser::matchTemplateAngles(CodeChunk *dataType) if (--parenAndBraceDepth < 0) return false; } - if (dataType != 0) dataType->append(lexeme()); readToken(); @@ -1161,6 +1164,9 @@ bool CppCodeParser::matchTemplateAngles(CodeChunk *dataType) return matches; } +/* + This function is no longer used. + */ bool CppCodeParser::matchTemplateHeader() { readToken(); @@ -1204,13 +1210,27 @@ bool CppCodeParser::matchDataType(CodeChunk *dataType, QString *var) } if (virgin) { - if (match(Tok_Ident)) - dataType->append(previousLexeme()); + if (match(Tok_Ident)) { + /* + This is a hack until we replace this "parser" + with the real one used in Qt Creator. + */ + if (!inMacroCommand_ && lexeme() == "(" && + ((previousLexeme() == "QT_PREPEND_NAMESPACE") || (previousLexeme() == "NS"))) { + readToken(); + readToken(); + dataType->append(previousLexeme()); + readToken(); + } + else + dataType->append(previousLexeme()); + } else if (match(Tok_void) || match(Tok_int) || match(Tok_char) || match(Tok_double) || match(Tok_Ellipsis)) dataType->append(previousLexeme()); - else + else { return false; + } } else if (match(Tok_int) || match(Tok_char) || match(Tok_double)) { dataType->append(previousLexeme()); @@ -1242,8 +1262,9 @@ bool CppCodeParser::matchDataType(CodeChunk *dataType, QString *var) dataType->appendHotspot(); if (var != 0 && match(Tok_Ident)) *var = previousLexeme(); - if (!match(Tok_RightParen) || tok != Tok_LeftParen) + if (!match(Tok_RightParen) || tok != Tok_LeftParen) { return false; + } dataType->append(previousLexeme()); int parenDepth0 = tokenizer->parenDepth(); @@ -1298,8 +1319,9 @@ bool CppCodeParser::matchParameter(FunctionNode *func) QString name; CodeChunk defaultValue; - if (!matchDataType(&dataType, &name)) + if (!matchDataType(&dataType, &name)) { return false; + } match(Tok_Comment); if (match(Tok_Equal)) { int parenDepth0 = tokenizer->parenDepth(); @@ -1312,10 +1334,7 @@ bool CppCodeParser::matchParameter(FunctionNode *func) readToken(); } } - func->addParameter(Parameter(dataType.toString(), - "", - name, - defaultValue.toString())); // ### + func->addParameter(Parameter(dataType.toString(), "", name, defaultValue.toString())); // ### return true; } @@ -1323,16 +1342,16 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, QStringList *parentPathPtr, FunctionNode **funcPtr, const QString &templateStuff, - Node::Type type, - bool attached) + ExtraFuncData& extra) { CodeChunk returnType; QStringList parentPath; QString name; - bool compat = false; - if (match(Tok_friend)) + + if (match(Tok_friend)) { return false; + } match(Tok_explicit); if (matchCompat()) compat = true; @@ -1473,7 +1492,7 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, } readToken(); - FunctionNode *func = new FunctionNode(type, parent, name, attached); + FunctionNode *func = new FunctionNode(extra.type, parent, name, extra.isAttached); func->setAccess(access); func->setLocation(location()); func->setReturnType(returnType.toString()); @@ -1899,6 +1918,7 @@ bool CppCodeParser::matchProperty(InnerNode *parent) */ bool CppCodeParser::matchDeclList(InnerNode *parent) { + ExtraFuncData extra; QString templateStuff; int braceDepth0 = tokenizer->braceDepth(); if (tok == Tok_RightBrace) // prevents failure on empty body @@ -1921,7 +1941,12 @@ bool CppCodeParser::matchDeclList(InnerNode *parent) matchUsingDecl(); break; case Tok_template: - templateStuff = matchTemplateHeader(); + { + CodeChunk dataType; + readToken(); + matchTemplateAngles(&dataType); + templateStuff = dataType.toString(); + } continue; case Tok_enum: matchEnumDecl(parent); @@ -2017,13 +2042,14 @@ bool CppCodeParser::matchDeclList(InnerNode *parent) match(Tok_RightParen); break; default: - if (!matchFunctionDecl(parent, 0, 0, templateStuff)) { + if (!matchFunctionDecl(parent, 0, 0, templateStuff, extra)) { while (tok != Tok_Eoi && (tokenizer->braceDepth() > braceDepth0 || (!match(Tok_Semicolon) && tok != Tok_public && tok != Tok_protected && - tok != Tok_private))) + tok != Tok_private))) { readToken(); + } } } templateStuff.clear(); @@ -2037,6 +2063,7 @@ bool CppCodeParser::matchDeclList(InnerNode *parent) */ bool CppCodeParser::matchDocsAndStuff() { + ExtraFuncData extra; QSet topicCommandsAllowed = topicCommands(); QSet otherMetacommandsAllowed = otherMetaCommands(); QSet metacommandsAllowed = topicCommandsAllowed + @@ -2082,7 +2109,7 @@ bool CppCodeParser::matchDocsAndStuff() FunctionNode *clone; FunctionNode *func = 0; - if (matchFunctionDecl(0, &parentPath, &clone)) { + if (matchFunctionDecl(0, &parentPath, &clone, QString(), extra)) { foreach (const QString& usedNamespace_, activeNamespaces_) { QStringList newPath = usedNamespace_.split("::") + parentPath; func = qdb_->findFunctionNode(newPath, clone); @@ -2176,7 +2203,7 @@ bool CppCodeParser::matchDocsAndStuff() FunctionNode *clone; FunctionNode *node = 0; - if (matchFunctionDecl(0, &parentPath, &clone)) { + if (matchFunctionDecl(0, &parentPath, &clone, QString(), extra)) { /* The location of the definition is more interesting than that of the declaration. People equipped with @@ -2209,9 +2236,7 @@ bool CppCodeParser::matchDocsAndStuff() bool CppCodeParser::makeFunctionNode(const QString& signature, QStringList* parentPathPtr, FunctionNode** funcPtr, - InnerNode* root, - Node::Type type, - bool attached) + ExtraFuncData& extra) { Tokenizer* outerTokenizer = tokenizer; int outerTok = tok; @@ -2223,7 +2248,9 @@ bool CppCodeParser::makeFunctionNode(const QString& signature, tokenizer = &stringTokenizer; readToken(); - bool ok = matchFunctionDecl(root, parentPathPtr, funcPtr, QString(), type, attached); + inMacroCommand_ = extra.isMacro; + bool ok = matchFunctionDecl(extra.root, parentPathPtr, funcPtr, QString(), extra); + inMacroCommand_ = false; // potential memory leak with funcPtr tokenizer = outerTokenizer; @@ -2252,15 +2279,14 @@ FunctionNode* CppCodeParser::makeFunctionNode(const Doc& doc, { QStringList pp; FunctionNode* fn = 0; - if (!makeFunctionNode(sig,&pp,&fn,parent,type,attached) && - !makeFunctionNode("void "+sig,&pp,&fn,parent,type,attached)) { + ExtraFuncData extra(parent, type, attached); + if (!makeFunctionNode(sig, &pp, &fn, extra) && !makeFunctionNode("void " + sig, &pp, &fn, extra)) { doc.location().warning(tr("Invalid syntax in '\\%1'").arg(qdoctag)); } return fn; } -void CppCodeParser::parseQiteratorDotH(const Location &location, - const QString &filePath) +void CppCodeParser::parseQiteratorDotH(const Location &location, const QString &filePath) { QFile file(filePath); if (!file.open(QFile::ReadOnly)) diff --git a/src/tools/qdoc/cppcodeparser.h b/src/tools/qdoc/cppcodeparser.h index 24b1f4c05a..eae5d1e97d 100644 --- a/src/tools/qdoc/cppcodeparser.h +++ b/src/tools/qdoc/cppcodeparser.h @@ -59,6 +59,16 @@ class CppCodeParser : public CodeParser { Q_DECLARE_TR_FUNCTIONS(QDoc::CppCodeParser) + struct ExtraFuncData { + InnerNode* root; // Used as the parent. + Node::Type type; // The node type: Function, etc. + bool isAttached; // If true, the method is attached. + bool isMacro; // If true, we are parsing a macro signature. + ExtraFuncData() : root(0), type(Node::Function), isAttached(false), isMacro(false) { } + ExtraFuncData(InnerNode* r, Node::Type t, bool a) + : root(r), type(t), isAttached(a), isMacro(false) { } + }; + public: CppCodeParser(); ~CppCodeParser(); @@ -114,11 +124,10 @@ protected: bool matchDataType(CodeChunk *type, QString *var = 0); bool matchParameter(FunctionNode *func); bool matchFunctionDecl(InnerNode *parent, - QStringList *parentPathPtr = 0, - FunctionNode **funcPtr = 0, - const QString &templateStuff = QString(), - Node::Type type = Node::Function, - bool attached = false); + QStringList *parentPathPtr, + FunctionNode **funcPtr, + const QString &templateStuff, + ExtraFuncData& extra); bool matchBaseSpecifier(ClassNode *classe, bool isClass); bool matchBaseList(ClassNode *classe, bool isClass); bool matchClassDecl(InnerNode *parent, @@ -134,9 +143,7 @@ protected: bool makeFunctionNode(const QString &synopsis, QStringList *parentPathPtr, FunctionNode **funcPtr, - InnerNode *root = 0, - Node::Type type = Node::Function, - bool attached = false); + ExtraFuncData& params); FunctionNode* makeFunctionNode(const Doc& doc, const QString& sig, InnerNode* parent, -- cgit v1.2.3 From 6b8d0b3092180dff54bfb68ab7765de40515c31d Mon Sep 17 00:00:00 2001 From: Oleg Shparber Date: Fri, 8 Feb 2013 20:04:58 +0200 Subject: QNX: Add support for QInputMethod::keyboardRectangle() Change-Id: Ie23aa06fed5778e228abf0f35fc1136a86661771 Reviewed-by: Sean Harmer --- src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp | 12 +++++++++++- src/plugins/platforms/qnx/qqnxinputcontext_imf.h | 6 +++++- src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp | 12 +++++++++++- src/plugins/platforms/qnx/qqnxinputcontext_noimf.h | 5 ++++- src/plugins/platforms/qnx/qqnxintegration.cpp | 2 +- 5 files changed, 32 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp b/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp index 30ca8a5c48..0d8f430c73 100644 --- a/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp +++ b/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp @@ -42,6 +42,8 @@ #include "qqnxinputcontext_imf.h" #include "qqnxeventthread.h" #include "qqnxabstractvirtualkeyboard.h" +#include "qqnxintegration.h" +#include "qqnxscreen.h" #include #include @@ -645,12 +647,13 @@ static bool imfAvailable() QT_BEGIN_NAMESPACE -QQnxInputContext::QQnxInputContext(QQnxAbstractVirtualKeyboard &keyboard): +QQnxInputContext::QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVirtualKeyboard &keyboard) : QPlatformInputContext(), m_lastCaretPos(0), m_isComposing(false), m_inputPanelVisible(false), m_inputPanelLocale(QLocale::c()), + m_integration(integration), m_virtualKeyboad(keyboard) { qInputContextDebug() << Q_FUNC_INFO; @@ -857,6 +860,13 @@ bool QQnxInputContext::filterEvent( const QEvent *event ) } } +QRectF QQnxInputContext::keyboardRect() const +{ + QRect screenGeometry = m_integration->primaryDisplay()->geometry(); + return QRectF(screenGeometry.x(), screenGeometry.height() - m_virtualKeyboard.height(), + screenGeometry.width(), m_virtualKeyboard.height()); +} + void QQnxInputContext::reset() { qInputContextDebug() << Q_FUNC_INFO; diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_imf.h b/src/plugins/platforms/qnx/qqnxinputcontext_imf.h index 72c52300bb..1980a99ed9 100644 --- a/src/plugins/platforms/qnx/qqnxinputcontext_imf.h +++ b/src/plugins/platforms/qnx/qqnxinputcontext_imf.h @@ -54,21 +54,24 @@ QT_BEGIN_NAMESPACE class QQnxAbstractVirtualKeyboard; +class QQnxIntegration; class QQnxInputContext : public QPlatformInputContext { Q_OBJECT public: - explicit QQnxInputContext(QQnxAbstractVirtualKeyboard &keyboard); + explicit QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVirtualKeyboard &keyboard); ~QQnxInputContext(); bool isValid() const; bool filterEvent(const QEvent *event); + QRectF keyboardRect() const; void reset(); void update(Qt::InputMethodQueries); bool handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap); + void showInputPanel(); void hideInputPanel(); bool isInputPanelVisible() const; @@ -125,6 +128,7 @@ private: QString m_composingText; bool m_inputPanelVisible; QLocale m_inputPanelLocale; + QQnxIntegration *m_integration; QQnxAbstractVirtualKeyboard &m_virtualKeyboad; }; diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp index 23d1f75539..98beb8ce43 100644 --- a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp +++ b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp @@ -41,6 +41,8 @@ #include "qqnxinputcontext_noimf.h" #include "qqnxabstractvirtualkeyboard.h" +#include "qqnxintegration.h" +#include "qqnxscreen.h" #include #include @@ -53,10 +55,11 @@ QT_BEGIN_NAMESPACE -QQnxInputContext::QQnxInputContext(QQnxAbstractVirtualKeyboard &keyboard) : +QQnxInputContext::QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVirtualKeyboard &keyboard) : QPlatformInputContext(), m_inputPanelVisible(false), m_inputPanelLocale(QLocale::c()), + m_integration(integration), m_virtualKeyboard(keyboard) { connect(&keyboard, SIGNAL(visibilityChanged(bool)), this, SLOT(keyboardVisibilityChanged(bool))); @@ -105,6 +108,13 @@ bool QQnxInputContext::filterEvent( const QEvent *event ) } +QRectF QQnxInputContext::keyboardRect() const +{ + QRect screenGeometry = m_integration->primaryDisplay()->geometry(); + return QRectF(screenGeometry.x(), screenGeometry.height() - m_virtualKeyboard.height(), + screenGeometry.width(), m_virtualKeyboard.height()); +} + bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap) { Q_UNUSED(flags); diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h index c037b6afd0..3e9e929923 100644 --- a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h +++ b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h @@ -49,18 +49,20 @@ QT_BEGIN_NAMESPACE class QQnxAbstractVirtualKeyboard; +class QQnxIntegration; class QQnxInputContext : public QPlatformInputContext { Q_OBJECT public: - explicit QQnxInputContext(QQnxAbstractVirtualKeyboard &keyboard); + explicit QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVirtualKeyboard &keyboard); ~QQnxInputContext(); bool isValid() const; void reset(); bool filterEvent( const QEvent *event ); + QRectF keyboardRect() const; bool handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap); void showInputPanel(); @@ -79,6 +81,7 @@ private: bool m_inputPanelVisible; QLocale m_inputPanelLocale; + QQnxIntegration *m_integration; QQnxAbstractVirtualKeyboard &m_virtualKeyboard; }; diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index d7370998d5..f3cfdab9c6 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -214,7 +214,7 @@ QQnxIntegration::QQnxIntegration() #if defined(QQNX_PPS) // Set up the input context - m_inputContext = new QQnxInputContext(*m_virtualKeyboard); + m_inputContext = new QQnxInputContext(this, *m_virtualKeyboard); #endif } -- cgit v1.2.3 From 93ed02e3b1718a560fb8028c80e63b511d334410 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Mon, 4 Feb 2013 02:01:28 +0100 Subject: fix QSqlTableModel:revert() for OnFieldChange revert() should operate in OnFieldChange edit strategy just as submit() does. The reason in Qt 4 for excluding OnFieldChange was that there was no opportunity to revert. The model was refreshed, causing all changes to be lost. In Qt 5 a failed edit remains in the cache until user action, which could be to revert. Change-Id: Ide021c4f83a53834b7ed81f2abfa3aa49317704d Reviewed-by: Mark Brand --- src/sql/models/qsqltablemodel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index 2822c8bb73..2e395b0a59 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -839,7 +839,8 @@ bool QSqlTableModel::submit() user canceled editing the current row. Reverts the changes if the model's strategy is set to - OnRowChange. Does nothing for the other edit strategies. + OnRowChange or OnFieldChange. Does nothing for the OnManualSubmit + strategy. Use revertAll() to revert all pending changes for the OnManualSubmit strategy or revertRow() to revert a specific row. @@ -849,7 +850,7 @@ bool QSqlTableModel::submit() void QSqlTableModel::revert() { Q_D(QSqlTableModel); - if (d->strategy == OnRowChange) + if (d->strategy == OnRowChange || d->strategy == OnFieldChange) revertAll(); } -- cgit v1.2.3 From f03d4bdae811844bb2e04be2386be0504ad94992 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Tue, 5 Feb 2013 18:22:43 +0100 Subject: QSqlResult: note in doc about misnamed method Change-Id: I488a915622445527c529b35db639ec3b6e887d1d Reviewed-by: Israel Lins Albuquerque Reviewed-by: Mark Brand --- src/sql/kernel/qsqlresult.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp index 3a45ccbcce..1f9bcec603 100644 --- a/src/sql/kernel/qsqlresult.cpp +++ b/src/sql/kernel/qsqlresult.cpp @@ -584,6 +584,8 @@ void QSqlResult::setForwardOnly(bool forward) functionality where possible. Returns true if the query is prepared successfully; otherwise returns false. + Note: This method should have been called "safePrepare()". + \sa prepare() */ bool QSqlResult::savePrepare(const QString& query) -- cgit v1.2.3 From 6c151605bc18f811d5018417f287e816561fc4ad Mon Sep 17 00:00:00 2001 From: Israel Lins Date: Thu, 7 Feb 2013 16:15:24 -0300 Subject: QSqlResult: consolidate SQL parsing for binding Consolidated SQL parsing for binding values, removing repeated code. Change-Id: I77aadcfd2673b067f7deb52b826d7b5a2ba2ae2a Reviewed-by: Mark Brand --- src/sql/kernel/qsqlresult.cpp | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp index 1f9bcec603..b720e40d8a 100644 --- a/src/sql/kernel/qsqlresult.cpp +++ b/src/sql/kernel/qsqlresult.cpp @@ -616,34 +616,11 @@ bool QSqlResult::savePrepare(const QString& query) */ bool QSqlResult::prepare(const QString& query) { + d->sql = query; if (d->holders.isEmpty()) { - int n = query.size(); - - bool inQuote = false; - int i = 0; - - while (i < n) { - QChar ch = query.at(i); - if (ch == QLatin1Char(':') && !inQuote - && (i == 0 || query.at(i - 1) != QLatin1Char(':')) - && (i + 1 < n && qIsAlnum(query.at(i + 1)))) { - int pos = i + 2; - while (pos < n && qIsAlnum(query.at(pos))) - ++pos; - - QString holder(query.mid(i, pos - i)); - d->indexes[holder].append(d->holders.size()); - d->holders.append(QHolder(holder, i)); - i = pos; - } else { - if (ch == QLatin1Char('\'')) - inQuote = !inQuote; - ++i; - } - } - d->values.resize(d->holders.size()); + // parse the query to memorize parameter location + d->namedToPositionalBinding(); } - d->sql = query; return true; // fake prepares should always succeed } -- cgit v1.2.3 From 8fd7d46b3a698a212d958e61036dd493cb7c9ca5 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Sat, 9 Feb 2013 00:34:25 +0100 Subject: QSqlResult::savePrepare() simplify logic Change-Id: If0b54a4c17f1c71c2bb33ae4d514ad6a9cc17e4c Reviewed-by: Israel Lins Albuquerque Reviewed-by: Mark Brand --- src/sql/kernel/qsqlresult.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp index b720e40d8a..2509d5a8b3 100644 --- a/src/sql/kernel/qsqlresult.cpp +++ b/src/sql/kernel/qsqlresult.cpp @@ -597,13 +597,12 @@ bool QSqlResult::savePrepare(const QString& query) if (!driver()->hasFeature(QSqlDriver::PreparedQueries)) return prepare(query); - if (driver()->hasFeature(QSqlDriver::NamedPlaceholders)) { - // parse the query to memorize parameter location - d->namedToPositionalBinding(); + // parse the query to memorize parameter location + d->executedQuery = d->namedToPositionalBinding(); + + if (driver()->hasFeature(QSqlDriver::NamedPlaceholders)) d->executedQuery = d->positionalToNamedBinding(); - } else { - d->executedQuery = d->namedToPositionalBinding(); - } + return prepare(d->executedQuery); } -- cgit v1.2.3 From 316d8ececa3314ec16baf46ec4f1c5440cd951ef Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 8 Feb 2013 00:48:57 +0100 Subject: Don't duplicate the 'top-level' include dir in all modules. This is the /include directory which is independent of the module and which only has to be used once. As everything uses QtCore, it is enough to set it only there. The CI system is a special case, in that it tests things before installation. Handle that case too. Change-Id: Idcdf9617e199b7d490cb3553cce07f1f464b3bec Reviewed-by: Stephen Kelly --- src/corelib/Qt5CTestMacros.cmake | 12 ++++++++++++ src/corelib/Qt5CoreConfigExtras.cmake.in | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake index c5d10c9b5b..60b98a7138 100644 --- a/src/corelib/Qt5CTestMacros.cmake +++ b/src/corelib/Qt5CTestMacros.cmake @@ -94,6 +94,18 @@ function(test_module_includes) include_directories(\${Qt5${qtmodule}_INCLUDE_DIRS}) add_definitions(\${Qt5${qtmodule}_DEFINITIONS})\n" ) + + # Because the CI system tests built packages before installation, + # the include dir allowing module-includes for the new module is not + # the same as the dir for QtCore (because that is at the installation + # location). The CI system is untypical here in that it attempts to use + # packages while they are in an intermediate state, so we work around + # that in the test system. + set(packages_string + "${packages_string} + include_directories(\"\${Qt5${qtmodule}_DIR}/../../../include\")\n" + ) + set(libraries_string "${libraries_string} Qt5::${qtmodule}") endwhile() diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index 06ff6dc831..3c0c753c3c 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -44,9 +44,9 @@ set(Qt5Core_MOC_EXECUTABLE Qt5::moc) set(Qt5Core_RCC_EXECUTABLE Qt5::rcc) !!IF isEmpty(CMAKE_ARCHDATA_DIR_IS_ABSOLUTE) -list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/$${CMAKE_ARCHDATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\") +list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5_corelib_install_prefix}/$${CMAKE_ARCHDATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\") !!ELSE -list(APPEND Qt5Core_INCLUDE_DIRS \"$${CMAKE_ARCHDATA_DIR}mkspecs/$${CMAKE_MKSPEC}\") +list(APPEND Qt5Core_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_ARCHDATA_DIR}mkspecs/$${CMAKE_MKSPEC}\") !!ENDIF !!IF !isEmpty(CMAKE_ADD_FPIE_FLAGS) -- cgit v1.2.3 From 5764f1032310065ee2620d5f06e3db75fcaaa2b1 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 31 Jan 2013 12:38:09 +0100 Subject: When expanding up the tree, there is no need to expand above root. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The index set by setRootIndex is the root of the visible part of the model. Expanding more than that is not needed. Change-Id: I0015e313ef046ff63c67338c4f00c37e1aa71ca7 Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Stephen Kelly --- src/widgets/itemviews/qtreeview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 1f922dd6e3..6046ef50a5 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -1097,7 +1097,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); -- cgit v1.2.3 From 5a46251de36e568513bca70b82a1d6cc9c9cb0f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 29 Jan 2013 09:11:21 +0100 Subject: Fix devicePixelRatio getter for embedded QWindows. m_nsWindow is not set for non-toplevel QWindows, causing devicePixelRatio to always return 1. Use [m_contentView window] instead. Change-Id: I6689a70812c9484f103b5e706fe4c1b76406b750 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoawindow.mm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 14d62c9fca..45100f9906 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -837,11 +837,9 @@ QCocoaMenuBar *QCocoaWindow::menubar() const qreal QCocoaWindow::devicePixelRatio() const { - if (!m_nsWindow) - return 1.0; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { - return qreal([m_nsWindow backingScaleFactor]); + return qreal([[m_contentView window] backingScaleFactor]); } else #endif { -- cgit v1.2.3 From 42a6d405e464944bd48a5ebdd6ed9f0b7feb3b1d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 8 Feb 2013 11:21:05 +0100 Subject: exclude bootstrapped tools from lupdate message collection the translation infrastructure is disabled in the bootstrapped tools, so the translations are wasted. Change-Id: Ief5d13f09242e03aaf0d4a3d9b1645f9c7a1ab3a Reviewed-by: Friedemann Kleint --- src/tools/tools.pro | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/tools/tools.pro b/src/tools/tools.pro index fa9ed54c50..c3a9ea228e 100644 --- a/src/tools/tools.pro +++ b/src/tools/tools.pro @@ -41,3 +41,5 @@ SUBDIRS = $$TOOLS_SUBDIRS bootstrap_prepare_docs.depends += $${src_tools_qdoc.target}-make_first bootstrap_prepare_docs.target = $${src_tools_bootstrap.target}-prepare_docs QMAKE_EXTRA_TARGETS += bootstrap_prepare_docs + +TR_EXCLUDE += $$PWD/* -- cgit v1.2.3 From 7f15506548e82e85560a9b6a57bfdb372883c367 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 5 Feb 2013 19:22:11 +0100 Subject: Remove Nokia from ssl linking exception. Change-Id: I559d4dd8789a249af855f6fe9bfe013ba1d77132 Reviewed-by: Richard J. Moore Reviewed-by: Lars Knoll --- src/network/ssl/qsslconfiguration.h | 8 ++++---- src/network/ssl/qsslconfiguration_p.h | 8 ++++---- src/network/ssl/qsslsocket_openssl.cpp | 15 +++++++++++++++ src/network/ssl/qsslsocket_openssl_p.h | 14 ++++++++++++++ src/network/ssl/qsslsocket_openssl_symbols.cpp | 14 ++++++++++++++ src/network/ssl/qsslsocket_openssl_symbols_p.h | 14 ++++++++++++++ 6 files changed, 65 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/network/ssl/qsslconfiguration.h b/src/network/ssl/qsslconfiguration.h index 701dc4cfe1..ae6e225ce5 100644 --- a/src/network/ssl/qsslconfiguration.h +++ b/src/network/ssl/qsslconfiguration.h @@ -41,10 +41,10 @@ /**************************************************************************** ** -** In addition, as a special exception, Nokia gives permission to link -** the code of its release of Qt with the OpenSSL project's "OpenSSL" library -** (or modified versions of the "OpenSSL" library that use the same license -** as the original version), and distribute the linked executables. +** In addition, as a special exception, the copyright holders listed above give +** permission to link the code of its release of Qt with the OpenSSL project's +** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the +** same license as the original version), and distribute the linked executables. ** ** You must comply with the GNU General Public License version 2 in all ** respects for all of the code used other than the "OpenSSL" code. If you diff --git a/src/network/ssl/qsslconfiguration_p.h b/src/network/ssl/qsslconfiguration_p.h index 3e6e43361d..30f1ed66f9 100644 --- a/src/network/ssl/qsslconfiguration_p.h +++ b/src/network/ssl/qsslconfiguration_p.h @@ -41,10 +41,10 @@ /**************************************************************************** ** -** In addition, as a special exception, Nokia gives permission to link -** the code of its release of Qt with the OpenSSL project's "OpenSSL" library -** (or modified versions of the "OpenSSL" library that use the same license -** as the original version), and distribute the linked executables. +** In addition, as a special exception, the copyright holders listed above give +** permission to link the code of its release of Qt with the OpenSSL project's +** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the +** same license as the original version), and distribute the linked executables. ** ** You must comply with the GNU General Public License version 2 in all ** respects for all of the code used other than the "OpenSSL" code. If you diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index fd5e12fec3..f846bf2d8b 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -39,6 +39,21 @@ ** ****************************************************************************/ +/**************************************************************************** +** +** In addition, as a special exception, the copyright holders listed above give +** permission to link the code of its release of Qt with the OpenSSL project's +** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the +** same license as the original version), and distribute the linked executables. +** +** You must comply with the GNU General Public License version 2 in all +** respects for all of the code used other than the "OpenSSL" code. If you +** modify this file, you may extend this exception to your version of the file, +** but you are not obligated to do so. If you do not wish to do so, delete +** this exception statement from your version of this file. +** +****************************************************************************/ + //#define QSSLSOCKET_DEBUG #include "qsslsocket_openssl_p.h" diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h index 9acdcbd1c5..d6675197b4 100644 --- a/src/network/ssl/qsslsocket_openssl_p.h +++ b/src/network/ssl/qsslsocket_openssl_p.h @@ -39,6 +39,20 @@ ** ****************************************************************************/ +/**************************************************************************** +** +** In addition, as a special exception, the copyright holders listed above give +** permission to link the code of its release of Qt with the OpenSSL project's +** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the +** same license as the original version), and distribute the linked executables. +** +** You must comply with the GNU General Public License version 2 in all +** respects for all of the code used other than the "OpenSSL" code. If you +** modify this file, you may extend this exception to your version of the file, +** but you are not obligated to do so. If you do not wish to do so, delete +** this exception statement from your version of this file. +** +****************************************************************************/ #ifndef QSSLSOCKET_OPENSSL_P_H #define QSSLSOCKET_OPENSSL_P_H diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 5829170320..9f271f863a 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -39,6 +39,20 @@ ** ****************************************************************************/ +/**************************************************************************** +** +** In addition, as a special exception, the copyright holders listed above give +** permission to link the code of its release of Qt with the OpenSSL project's +** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the +** same license as the original version), and distribute the linked executables. +** +** You must comply with the GNU General Public License version 2 in all +** respects for all of the code used other than the "OpenSSL" code. If you +** modify this file, you may extend this exception to your version of the file, +** but you are not obligated to do so. If you do not wish to do so, delete +** this exception statement from your version of this file. +** +****************************************************************************/ #include "qsslsocket_openssl_symbols_p.h" diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h index 782725407e..ccd9d3cfb9 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols_p.h +++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h @@ -39,6 +39,20 @@ ** ****************************************************************************/ +/**************************************************************************** +** +** In addition, as a special exception, the copyright holders listed above give +** permission to link the code of its release of Qt with the OpenSSL project's +** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the +** same license as the original version), and distribute the linked executables. +** +** You must comply with the GNU General Public License version 2 in all +** respects for all of the code used other than the "OpenSSL" code. If you +** modify this file, you may extend this exception to your version of the file, +** but you are not obligated to do so. If you do not wish to do so, delete +** this exception statement from your version of this file. +** +****************************************************************************/ #ifndef QSSLSOCKET_OPENSSL_SYMBOLS_P_H #define QSSLSOCKET_OPENSSL_SYMBOLS_P_H -- cgit v1.2.3 From c927d6b9e161ee22822dbfb0654f5734c9101aa7 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 4 Feb 2013 16:12:58 +0100 Subject: Rename function to fix symbol clash in static build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename qt_gl_read_framebuffer function to qt_gl_read_frame_buffer in Qt5OpenGL. This fixes an error when linking statically against both Qt5Gui and Qt5OpenGL: Qt5Guid.lib(qopenglframebufferobject.obj) : error LNK2005: "class QImage __cdecl qt_gl_read_framebuffer(class QSize const &,bool,bool)" (?qt_gl_read_framebuffer@@YA?AVQImage@@ABVQSize@@_N1@Z) already defined in Qt5OpenGLd.lib(qgl.obj) Creating library debug\composition.lib and object debug\composition.exp The function was duplicated in 6e28e844 . Change-Id: I9e3b78e0ec5b25264575d563538587b45cd93e86 Reviewed-by: Friedemann Kleint Reviewed-by: Samuel Rødal --- src/opengl/qgl.cpp | 4 ++-- src/opengl/qglframebufferobject.cpp | 6 +++--- src/opengl/qglpixelbuffer.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 3cb738b9c8..6476e2b26c 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1637,7 +1637,7 @@ static void convertFromGLImage(QImage &img, int w, int h, bool alpha_format, boo img = img.mirrored(); } -QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha) +QImage qt_gl_read_frame_buffer(const QSize &size, bool alpha_format, bool include_alpha) { QImage img(size, (alpha_format && include_alpha) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32); @@ -4063,7 +4063,7 @@ QImage QGLWidget::grabFrameBuffer(bool withAlpha) int w = width(); int h = height(); if (format().rgba()) - res = qt_gl_read_framebuffer(QSize(w, h), format().alpha(), withAlpha); + res = qt_gl_read_frame_buffer(QSize(w, h), format().alpha(), withAlpha); return res; } diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index ee932d1ab9..9a3e2a80ac 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE -extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool); +extern QImage qt_gl_read_frame_buffer(const QSize&, bool, bool); #define QGL_FUNC_CONTEXT const QGLContext *ctx = QGLContext::currentContext(); #define QGL_FUNCP_CONTEXT const QGLContext *ctx = QGLContext::currentContext(); @@ -1081,7 +1081,7 @@ QImage QGLFramebufferObject::toImage() const if (!d->valid) return QImage(); - // qt_gl_read_framebuffer doesn't work on a multisample FBO + // qt_gl_read_frame_buffer doesn't work on a multisample FBO if (format().samples() != 0) { QGLFramebufferObject temp(size(), QGLFramebufferObjectFormat()); @@ -1094,7 +1094,7 @@ QImage QGLFramebufferObject::toImage() const bool wasBound = isBound(); if (!wasBound) const_cast(this)->bind(); - QImage image = qt_gl_read_framebuffer(d->size, format().internalTextureFormat() != GL_RGB, true); + QImage image = qt_gl_read_frame_buffer(d->size, format().internalTextureFormat() != GL_RGB, true); if (!wasBound) const_cast(this)->release(); diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp index 36b9e60937..e514e34552 100644 --- a/src/opengl/qglpixelbuffer.cpp +++ b/src/opengl/qglpixelbuffer.cpp @@ -108,7 +108,7 @@ QT_BEGIN_NAMESPACE -extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool); +extern QImage qt_gl_read_frame_buffer(const QSize&, bool, bool); QGLContext* QGLPBufferGLPaintDevice::context() const @@ -391,7 +391,7 @@ QImage QGLPixelBuffer::toImage() const const_cast(this)->makeCurrent(); if (d->fbo) d->fbo->bind(); - return qt_gl_read_framebuffer(d->req_size, d->format.alpha(), true); + return qt_gl_read_frame_buffer(d->req_size, d->format.alpha(), true); } /*! -- cgit v1.2.3 From d180560e148722071f30fbbbfcdce01b01ba8cdf Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 8 Feb 2013 17:26:47 +0100 Subject: Fix QWindow::setFramePosition() to keep the size. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I14551e0d0573c2e8d86d76eadab4df9f3c8ed5e4 Reviewed-by: Samuel Rødal --- src/gui/kernel/qwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index db19aa9366..2fcad5706f 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1186,7 +1186,7 @@ void QWindow::setFramePosition(const QPoint &point) if (d->platformWindow) { d->platformWindow->setGeometry(QRect(point, size())); } else { - d->geometry.setTopLeft(point); + d->geometry.moveTopLeft(point); } } -- cgit v1.2.3 From 00d8de8589fc799015af1aa9a84e268fba4d6a74 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Sun, 10 Feb 2013 20:45:12 +0100 Subject: move QSqlResultPrivate to private header Change-Id: Ice5464989530d521f65703daa080cb2094afef3c Reviewed-by: Oswald Buddenhagen Reviewed-by: Israel Lins Albuquerque Reviewed-by: Mark Brand --- src/sql/kernel/kernel.pri | 1 + src/sql/kernel/qsqlresult.cpp | 69 +-------------------- src/sql/kernel/qsqlresult_p.h | 138 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+), 68 deletions(-) create mode 100644 src/sql/kernel/qsqlresult_p.h (limited to 'src') diff --git a/src/sql/kernel/kernel.pri b/src/sql/kernel/kernel.pri index c6fe404737..fe7f1270f9 100644 --- a/src/sql/kernel/kernel.pri +++ b/src/sql/kernel/kernel.pri @@ -8,6 +8,7 @@ HEADERS += kernel/qsql.h \ kernel/qsqldriverplugin.h \ kernel/qsqlerror.h \ kernel/qsqlresult.h \ + kernel/qsqlresult_p.h \ kernel/qsqlcachedresult_p.h \ kernel/qsqlindex.h diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp index 2509d5a8b3..b3e7ad5b38 100644 --- a/src/sql/kernel/qsqlresult.cpp +++ b/src/sql/kernel/qsqlresult.cpp @@ -50,78 +50,11 @@ #include "qvector.h" #include "qsqldriver.h" #include "qpointer.h" +#include "qsqlresult_p.h" #include QT_BEGIN_NAMESPACE -struct QHolder { - QHolder(const QString& hldr = QString(), int index = -1): holderName(hldr), holderPos(index) {} - bool operator==(const QHolder& h) const { return h.holderPos == holderPos && h.holderName == holderName; } - bool operator!=(const QHolder& h) const { return h.holderPos != holderPos || h.holderName != holderName; } - QString holderName; - int holderPos; -}; - -class QSqlResultPrivate -{ -public: - QSqlResultPrivate(QSqlResult* d) - : q(d), idx(QSql::BeforeFirstRow), active(false), - isSel(false), forwardOnly(false), precisionPolicy(QSql::LowPrecisionDouble), bindCount(0), binds(QSqlResult::PositionalBinding) - {} - - void clearValues() - { - values.clear(); - bindCount = 0; - } - - void resetBindCount() - { - bindCount = 0; - } - - void clearIndex() - { - indexes.clear(); - holders.clear(); - types.clear(); - } - - void clear() - { - clearValues(); - clearIndex();; - } - - QString positionalToNamedBinding(); - QString namedToPositionalBinding(); - QString holderAt(int index) const; - -public: - QSqlResult* q; - QPointer sqldriver; - int idx; - QString sql; - bool active; - bool isSel; - QSqlError error; - bool forwardOnly; - QSql::NumericalPrecisionPolicy precisionPolicy; - - int bindCount; - QSqlResult::BindingSyntax binds; - - QString executedQuery; - QHash types; - QVector values; - typedef QHash > IndexMap; - IndexMap indexes; - - typedef QVector QHolderVector; - QHolderVector holders; -}; - static QString qFieldSerial(int); QString QSqlResultPrivate::holderAt(int index) const diff --git a/src/sql/kernel/qsqlresult_p.h b/src/sql/kernel/qsqlresult_p.h new file mode 100644 index 0000000000..65f9be7a05 --- /dev/null +++ b/src/sql/kernel/qsqlresult_p.h @@ -0,0 +1,138 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSql module 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$ +** +****************************************************************************/ + +#ifndef QSQLRESULT_P_H +#define QSQLRESULT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of qsql*model.h . This header file may change from version to version +// without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include "qsqlerror.h" +#include "qsqlresult.h" + +QT_BEGIN_NAMESPACE + +struct QHolder { + QHolder(const QString &hldr = QString(), int index = -1): holderName(hldr), holderPos(index) { } + bool operator==(const QHolder &h) const { return h.holderPos == holderPos && h.holderName == holderName; } + bool operator!=(const QHolder &h) const { return h.holderPos != holderPos || h.holderName != holderName; } + QString holderName; + int holderPos; +}; + +class Q_SQL_EXPORT QSqlResultPrivate +{ +public: + QSqlResultPrivate(QSqlResult *d) + : q(d), + idx(QSql::BeforeFirstRow), + active(false), + isSel(false), + forwardOnly(false), + precisionPolicy(QSql::LowPrecisionDouble), + bindCount(0), + binds(QSqlResult::PositionalBinding) + { } + + void clearValues() + { + values.clear(); + bindCount = 0; + } + + void resetBindCount() + { + bindCount = 0; + } + + void clearIndex() + { + indexes.clear(); + holders.clear(); + types.clear(); + } + + void clear() + { + clearValues(); + clearIndex();; + } + + QString positionalToNamedBinding(); + QString namedToPositionalBinding(); + QString holderAt(int index) const; + + QSqlResult *q; + QPointer sqldriver; + int idx; + QString sql; + bool active; + bool isSel; + QSqlError error; + bool forwardOnly; + QSql::NumericalPrecisionPolicy precisionPolicy; + + int bindCount; + QSqlResult::BindingSyntax binds; + + QString executedQuery; + QHash types; + QVector values; + typedef QHash > IndexMap; + IndexMap indexes; + + typedef QVector QHolderVector; + QHolderVector holders; +}; + +QT_END_NAMESPACE + +#endif // QSQLRESULT_P_H -- cgit v1.2.3 From 784b9655597d2c23a00d57181b1853e6df07fdf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 7 Jan 2013 22:38:10 +0100 Subject: Cocoa: Export QImage <-> CGImage conversion funcs. For implementing to/fromMacCGImageRef in QtMacExtras. These do not depend on internal Qt state. The main reason for exporting them is to keep the implementation in one place to ease maintenance. Refactor qt_mac_cg_context to support QImage. Add qt_mac_toQImage. Change-Id: Ia9c226ed52d087b2c6b47aa8210ed8f2645b9cf2 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoahelpers.h | 3 +- src/plugins/platforms/cocoa/qcocoahelpers.mm | 55 ++++++++++++++-------- .../platforms/cocoa/qcocoanativeinterface.h | 6 +++ .../platforms/cocoa/qcocoanativeinterface.mm | 16 +++++++ src/plugins/platforms/cocoa/qcocoatheme.mm | 4 +- 5 files changed, 61 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h index b065c72e68..831ab579f5 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.h +++ b/src/plugins/platforms/cocoa/qcocoahelpers.h @@ -158,8 +158,9 @@ public: } }; -CGContextRef qt_mac_cg_context(const QPaintDevice *pdev); +CGContextRef qt_mac_cg_context(QPaintDevice *pdev); CGImageRef qt_mac_toCGImage(const QImage &qImage, bool isMask, uchar **dataCopy); +QImage qt_mac_toQImage(CGImageRef image); QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index 0c5d26054c..91a6f5a4c7 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -719,35 +719,38 @@ QString qt_mac_removeAmpersandEscapes(QString s) \warning This function is only available on Mac OS X. \warning This function is duplicated in qmacstyle_mac.mm */ -CGContextRef qt_mac_cg_context(const QPaintDevice *pdev) +CGContextRef qt_mac_cg_context(QPaintDevice *pdev) { - if (pdev->devType() == QInternal::Pixmap) { - const QPixmap *pm = static_cast(pdev); - CGColorSpaceRef colorspace = qt_mac_colorSpaceForDeviceType(pdev); - uint flags = kCGImageAlphaPremultipliedFirst; - flags |= kCGBitmapByteOrder32Host; - CGContextRef ret = 0; + // In Qt 5, QWidget and QPixmap (and QImage) paint devices are all QImages under the hood. + QImage *image = 0; + if (pdev->devType() == QInternal::Image) { + image = static_cast(pdev); + } else if (pdev->devType() == QInternal::Pixmap) { + const QPixmap *pm = static_cast(pdev); QPlatformPixmap *data = const_cast(pm)->data_ptr().data(); if (data && data->classId() == QPlatformPixmap::RasterClass) { - QImage *image = data->buffer(); - ret = CGBitmapContextCreate(image->bits(), image->width(), image->height(), - 8, image->bytesPerLine(), colorspace, flags); + image = data->buffer(); } else { qDebug() << "qt_mac_cg_context: Unsupported pixmap class"; } - - CGContextTranslateCTM(ret, 0, pm->height()); - CGContextScaleCTM(ret, 1, -1); - return ret; } else if (pdev->devType() == QInternal::Widget) { - //CGContextRef ret = static_cast(static_cast(pdev)->macCGHandle()); - ///CGContextRetain(ret); - //return ret; + // TODO test: image = static_cast(static_cast(pdev)->backingStore()->paintDevice()); qDebug() << "qt_mac_cg_context: not implemented: Widget class"; - return 0; } - return 0; + + if (!image) + return 0; // Context type not supported. + + CGColorSpaceRef colorspace = qt_mac_colorSpaceForDeviceType(pdev); + uint flags = kCGImageAlphaPremultipliedFirst; + flags |= kCGBitmapByteOrder32Host; + CGContextRef ret = 0; + ret = CGBitmapContextCreate(image->bits(), image->width(), image->height(), + 8, image->bytesPerLine(), colorspace, flags); + CGContextTranslateCTM(ret, 0, image->height()); + CGContextScaleCTM(ret, 1, -1); + return ret; } CGImageRef qt_mac_toCGImage(const QImage &qImage, bool isMask, uchar **dataCopy) @@ -841,4 +844,18 @@ CGImageRef qt_mac_toCGImage(const QImage &qImage, bool isMask, uchar **dataCopy) return cgImage; } +QImage qt_mac_toQImage(CGImageRef image) +{ + const size_t w = CGImageGetWidth(image), + h = CGImageGetHeight(image); + QImage ret(w, h, QImage::Format_ARGB32_Premultiplied); + ret.fill(Qt::transparent); + CGRect rect = CGRectMake(0, 0, w, h); + CGContextRef ctx = qt_mac_cg_context(&ret); + qt_mac_drawCGImage(ctx, &rect, image); + CGContextRelease(ctx); + return ret; +} + + QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.h b/src/plugins/platforms/cocoa/qcocoanativeinterface.h index 592ede4617..9506f86238 100644 --- a/src/plugins/platforms/cocoa/qcocoanativeinterface.h +++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.h @@ -42,6 +42,8 @@ #ifndef QCOCOANATIVEINTERFACE_H #define QCOCOANATIVEINTERFACE_H +#include + #include QT_BEGIN_NAMESPACE @@ -96,6 +98,10 @@ private: // Dock menu support static void setDockMenu(QPlatformMenu *platformMenu); + + // QImage <-> CGImage conversion functions + static CGImageRef qImageToCGImage(const QImage &image); + static QImage cgImageToQImage(CGImageRef image); }; #endif // QCOCOANATIVEINTERFACE_H diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm index 14bb82bc7e..bd3a909137 100644 --- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm +++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm @@ -45,6 +45,7 @@ #include "qcocoamenu.h" #include "qcocoamenubar.h" #include "qmacmime.h" +#include "qcocoahelpers.h" #include #include @@ -108,6 +109,10 @@ QPlatformNativeInterface::NativeResourceForIntegrationFunction QCocoaNativeInter return NativeResourceForIntegrationFunction(QCocoaNativeInterface::registerDraggedTypes); if (resource.toLower() == "setdockmenu") return NativeResourceForIntegrationFunction(QCocoaNativeInterface::setDockMenu); + if (resource.toLower() == "qimagetocgimage") + return NativeResourceForIntegrationFunction(QCocoaNativeInterface::qImageToCGImage); + if (resource.toLower() == "cgimagetoqimage") + return NativeResourceForIntegrationFunction(QCocoaNativeInterface::cgImageToQImage); return 0; } @@ -183,4 +188,15 @@ void QCocoaNativeInterface::setDockMenu(QPlatformMenu *platformMenu) [NSApp setDockMenu: menu]; } +CGImageRef QCocoaNativeInterface::qImageToCGImage(const QImage &image) +{ + return qt_mac_toCGImage(image, false, 0); +} + +QImage QCocoaNativeInterface::cgImageToQImage(CGImageRef image) +{ + return qt_mac_toQImage(image); +} + + QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 0845ab8e94..beaa50da6d 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -53,6 +53,7 @@ #include "qcocoamenuitem.h" #include "qcocoamenu.h" #include "qcocoamenubar.h" +#include "qcocoahelpers.h" #include #include @@ -137,9 +138,6 @@ const QFont *QCocoaTheme::font(Font type) const return m_fonts.value(type, 0); } -// Defined in qpaintengine_mac.mm -extern CGContextRef qt_mac_cg_context(const QPaintDevice *pdev); - //! \internal QPixmap qt_mac_convert_iconref(const IconRef icon, int width, int height) { -- cgit v1.2.3 From c6d522532a19ab1547c14799a25b8a49405dcc2a Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Mon, 11 Feb 2013 20:46:54 +0100 Subject: qpsql: fix spelling in comment Change-Id: I3d1abd6041a4adf425ba7851146659655fc12183 Reviewed-by: Mark Brand --- src/sql/drivers/psql/qsql_psql.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index 678e83690a..1d96e9f93b 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -1208,8 +1208,7 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const if (field.value().toDateTime().isValid()) { QDate dt = field.value().toDateTime().date(); QTime tm = field.value().toDateTime().time(); - // msecs need to be right aligned otherwise psql - // interpretes them wrong + // msecs need to be right aligned otherwise psql interprets them wrong r = QLatin1Char('\'') + QString::number(dt.year()) + QLatin1Char('-') + QString::number(dt.month()) + QLatin1Char('-') + QString::number(dt.day()) + QLatin1Char(' ') -- cgit v1.2.3 From f5acd545a8bf8b187be6b3dd29f095b1fa7e94ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 12 Feb 2013 11:34:55 +0100 Subject: Mac: Remove broken platformPluginPath code. The missing "/" in front of "../Plugins" prevents this from working - platformPluginPath is never set. Deployed platform plugin loading works in spite of this via qt.conf which adds the plugin path to QCoreApplication::libraryPaths(). Change-Id: I7ae4d13c65a380ddad72bffd29b776c39ea91c8a Reviewed-by: Gabriel de Dietrich --- src/gui/kernel/qguiapplication.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 3044c1dee2..02ae51bfc2 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -851,15 +851,6 @@ void QGuiApplicationPrivate::createPlatformIntegration() // Load the platform integration QString platformPluginPath = QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH")); - // On Mac, look inside the application bundle for the platform plugin. - // TODO (msorvig): Create proper cross-platform solution for loading - // deployed platform plugins -#ifdef Q_OS_MAC - const QString bundlePluginPath = QCoreApplication::applicationDirPath() + QLatin1String("../Plugins/"); - if (platformPluginPath.isEmpty() && QDir(bundlePluginPath).exists()) { - platformPluginPath = bundlePluginPath; - } -#endif QByteArray platformName; #ifdef QT_QPA_DEFAULT_PLATFORM_NAME -- cgit v1.2.3 From 62d25e4d4f02a53da25b9f14cc9e0244d6655312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 12 Feb 2013 12:58:08 +0100 Subject: Fixed QPixmapCache associating path with wrong QPixmap. QPixmap::load() would not detach, so multiple paths could get associated with the same QPixmap, causing the wrong pixmap to be shown. Task-number: QTBUG-29639 Change-Id: I064dd6a9611b5996853bec9fb20b6224a0adcf62 Reviewed-by: aavit --- src/gui/image/qpixmap.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 852025117b..b6a21f588e 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -760,6 +760,8 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers return false; } + detach(); + QFileInfo info(fileName); QString key = QLatin1String("qt_pixmap") % info.absoluteFilePath() -- cgit v1.2.3 From c76ec20e55a194664045c61094f8aea75ff6a756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 12 Feb 2013 15:48:19 +0100 Subject: Fixed QSurfaceFormat documentation about DebugContext requiring GL3+. GL_ARB_debug_output only requires OpenGL 1.1 and above. Change-Id: Ib79d370fac36fa737817ea678f0dee25283dfa31 Reviewed-by: Giuseppe D'Angelo --- src/gui/kernel/qsurfaceformat.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp index e7c93f4e48..2c26a172a4 100644 --- a/src/gui/kernel/qsurfaceformat.cpp +++ b/src/gui/kernel/qsurfaceformat.cpp @@ -130,7 +130,6 @@ public: \value StereoBuffers Used to request stereo buffers in the surface format. \value DebugContext Used to request a debug context with extra debugging information. - This requires OpenGL version 3.0 or higher. \value DeprecatedFunctions Used to request that deprecated functions be included in the OpenGL context profile. If not specified, you should get a forward compatible context without support functionality marked as deprecated. This requires OpenGL version 3.0 or higher. -- cgit v1.2.3 From 3fb356f531159c3ce09e13ea7e9e2a9aaf1be465 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Tue, 12 Feb 2013 15:53:59 +0000 Subject: QNX: Fix qFatal() statements. "QQNXQBBWindow" doesn't make sense. Change-Id: I0e56d5be4a9bb7a0336f71ea3348621be730dee1 Reviewed-by: Sean Harmer --- src/plugins/platforms/qnx/qqnxglcontext.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp index aa748fc852..1c2ec23fa9 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.cpp +++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp @@ -150,13 +150,13 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext) // Select EGL config based on requested window format m_eglConfig = q_configFromGLFormat(ms_eglDisplay, format); if (m_eglConfig == 0) { - qFatal("QQNXQBBWindow: failed to find EGL config"); + qFatal("QQnxGLContext: failed to find EGL config"); } m_eglContext = eglCreateContext(ms_eglDisplay, m_eglConfig, EGL_NO_CONTEXT, contextAttrs()); if (m_eglContext == EGL_NO_CONTEXT) { checkEGLError("eglCreateContext"); - qFatal("QQNXQBBWindow: failed to create EGL context, err=%d", eglGetError()); + qFatal("QQnxGLContext: failed to create EGL context, err=%d", eglGetError()); } // Query/cache window format of selected EGL config @@ -184,13 +184,13 @@ void QQnxGLContext::initialize() ms_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (ms_eglDisplay == EGL_NO_DISPLAY) { checkEGLError("eglGetDisplay"); - qFatal("QQNXQBBWindow: failed to obtain EGL display"); + qFatal("QQnxGLContext: failed to obtain EGL display"); } EGLBoolean eglResult = eglInitialize(ms_eglDisplay, 0, 0); if (eglResult != EGL_TRUE) { checkEGLError("eglInitialize"); - qFatal("QQNXQBBWindow: failed to initialize EGL display, err=%d", eglGetError()); + qFatal("QQnxGLContext: failed to initialize EGL display, err=%d", eglGetError()); } } @@ -217,7 +217,7 @@ bool QQnxGLContext::makeCurrent(QPlatformSurface *surface) // Set current rendering API EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); if (eglResult != EGL_TRUE) { - qFatal("QQNXQBBWindow: failed to set EGL API, err=%d", eglGetError()); + qFatal("QQnxGLContext: failed to set EGL API, err=%d", eglGetError()); } if (m_newSurfaceRequested.testAndSetOrdered(true, false)) { -- cgit v1.2.3 From 3a2276c6f3fb4a38ae5946eab5baf32ee99f4231 Mon Sep 17 00:00:00 2001 From: Oleg Shparber Date: Tue, 12 Feb 2013 16:11:47 +0200 Subject: QNX: Fix QInputMethod::keyboardRectangleChanged() signal Change-Id: Iad3ee07ba85854d2eb0cf36710643b75993bf61c Reviewed-by: Sean Harmer --- src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp | 6 ++++++ src/plugins/platforms/qnx/qqnxinputcontext_noimf.h | 1 + 2 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp index 98beb8ce43..71b925357a 100644 --- a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp +++ b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp @@ -62,6 +62,7 @@ QQnxInputContext::QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVir m_integration(integration), m_virtualKeyboard(keyboard) { + connect(&keyboard, SIGNAL(heightChanged(int)), this, SLOT(keyboardHeightChanged())); connect(&keyboard, SIGNAL(visibilityChanged(bool)), this, SLOT(keyboardVisibilityChanged(bool))); connect(&keyboard, SIGNAL(localeChanged(QLocale)), this, SLOT(keyboardLocaleChanged(QLocale))); keyboardVisibilityChanged(keyboard.isVisible()); @@ -147,6 +148,11 @@ QLocale QQnxInputContext::locale() const return m_inputPanelLocale; } +void QQnxInputContext::keyboardHeightChanged() +{ + emitKeyboardRectChanged(); +} + void QQnxInputContext::keyboardVisibilityChanged(bool visible) { qInputContextDebug() << Q_FUNC_INFO << "visible=" << visible; diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h index 3e9e929923..1ecf7cc94e 100644 --- a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h +++ b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h @@ -73,6 +73,7 @@ public: void setFocusObject(QObject *object); private Q_SLOTS: + void keyboardHeightChanged(); void keyboardVisibilityChanged(bool visible); void keyboardLocaleChanged(const QLocale &locale); -- cgit v1.2.3 From 82eaff97d1e7227e7a566b8576ca76f9dd447c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Mon, 4 Feb 2013 15:51:35 +0100 Subject: Don't ignore QSurfaceFormat::Options in the XCB plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The XCB plugin requested a forward-compatible context regardless of whether QSurfaceFormat::DeprecatedFunctions was set, and also ignored the QSurfaceFormat::DebugContext option. Change-Id: I81c737447b554b3b6f61c2725bce7583e0e887ab Reviewed-by: Sean Harmer Reviewed-by: Giuseppe D'Angelo Reviewed-by: Samuel Rødal --- src/plugins/platforms/xcb/qglxintegration.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index 80fcbbebc6..23bec15b48 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -305,14 +305,24 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat // If asking for OpenGL 3.2 or newer we should also specify a profile if (m_format.majorVersion() > 3 || (m_format.majorVersion() == 3 && m_format.minorVersion() > 1)) { - if (m_format.profile() == QSurfaceFormat::CoreProfile) { - contextAttributes << GLX_CONTEXT_FLAGS_ARB << GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB - << GLX_CONTEXT_PROFILE_MASK_ARB << GLX_CONTEXT_CORE_PROFILE_BIT_ARB; - } else { + if (m_format.profile() == QSurfaceFormat::CoreProfile) + contextAttributes << GLX_CONTEXT_PROFILE_MASK_ARB << GLX_CONTEXT_CORE_PROFILE_BIT_ARB; + else contextAttributes << GLX_CONTEXT_PROFILE_MASK_ARB << GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; - } } + int flags = 0; + + if (m_format.testOption(QSurfaceFormat::DebugContext)) + flags |= GLX_CONTEXT_DEBUG_BIT_ARB; + + // A forward-compatible context may be requested for 3.0 and later + if (m_format.majorVersion() >= 3 && !m_format.testOption(QSurfaceFormat::DeprecatedFunctions)) + flags |= GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + + if (flags != 0) + contextAttributes << GLX_CONTEXT_FLAGS_ARB << flags; + contextAttributes << None; m_context = glXCreateContextAttribsARB(DISPLAY_FROM_XCB(screen), config, m_shareContext, true, contextAttributes.data()); -- cgit v1.2.3 From 8943a5a28e0559bce2bd412453840f951f796fbf Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 11 Feb 2013 13:20:30 +0100 Subject: Don't calculate the install prefix again in the extra cmake files. The parent file has already set a variable for it. Change-Id: I90ddda355a580f44ea7e1e44cc7df717fa0a8b7b Reviewed-by: Alexander Neundorf Reviewed-by: Stephen Kelly --- src/corelib/Qt5CoreConfigExtras.cmake.in | 14 ++++++-------- src/corelib/Qt5CoreMacros.cmake | 2 +- src/dbus/Qt5DBusConfigExtras.cmake.in | 6 ++---- src/widgets/Qt5WidgetsConfigExtras.cmake.in | 4 +--- 4 files changed, 10 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index 3c0c753c3c..4e0fcda20e 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -1,12 +1,10 @@ -get_filename_component(_qt5_corelib_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) - if (NOT TARGET Qt5::qmake) add_executable(Qt5::qmake IMPORTED) set_target_properties(Qt5::qmake PROPERTIES !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - IMPORTED_LOCATION \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\" + IMPORTED_LOCATION \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\" !!ELSE IMPORTED_LOCATION \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\" !!ENDIF @@ -18,7 +16,7 @@ if (NOT TARGET Qt5::moc) set_target_properties(Qt5::moc PROPERTIES !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - IMPORTED_LOCATION \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\" + IMPORTED_LOCATION \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\" !!ELSE IMPORTED_LOCATION \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\" !!ENDIF @@ -32,7 +30,7 @@ if (NOT TARGET Qt5::rcc) set_target_properties(Qt5::rcc PROPERTIES !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - IMPORTED_LOCATION \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\" + IMPORTED_LOCATION \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\" !!ELSE IMPORTED_LOCATION \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\" !!ENDIF @@ -44,7 +42,7 @@ set(Qt5Core_MOC_EXECUTABLE Qt5::moc) set(Qt5Core_RCC_EXECUTABLE Qt5::rcc) !!IF isEmpty(CMAKE_ARCHDATA_DIR_IS_ABSOLUTE) -list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5_corelib_install_prefix}/$${CMAKE_ARCHDATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\") +list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5Core_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5Core_install_prefix}/$${CMAKE_ARCHDATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\") !!ELSE list(APPEND Qt5Core_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_ARCHDATA_DIR}mkspecs/$${CMAKE_MKSPEC}\") !!ENDIF @@ -80,7 +78,7 @@ if (NOT TARGET Qt5::WinMain) set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) set_target_properties(Qt5::WinMain PROPERTIES !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - IMPORTED_LOCATION_DEBUG \"${_qt5_corelib_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\" + IMPORTED_LOCATION_DEBUG \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\" !!ELSE IMPORTED_LOCATION_DEBUG \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\" !!ENDIF @@ -91,7 +89,7 @@ if (NOT TARGET Qt5::WinMain) set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(Qt5::WinMain PROPERTIES !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - IMPORTED_LOCATION_RELEASE \"${_qt5_corelib_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\" + IMPORTED_LOCATION_RELEASE \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\" !!ELSE IMPORTED_LOCATION_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\" !!ENDIF diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 614b79ab88..e3115db8ee 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -234,7 +234,7 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9) foreach(_module ${_qt5_modules}) if (NOT Qt5${_module}_FOUND) - find_package(Qt5${_module} PATHS ${_qt5_corelib_install_prefix} NO_DEFAULT_PATH) + find_package(Qt5${_module} PATHS ${_qt5Core_install_prefix} NO_DEFAULT_PATH) if (NOT Qt5${_module}_FOUND) message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.") endif() diff --git a/src/dbus/Qt5DBusConfigExtras.cmake.in b/src/dbus/Qt5DBusConfigExtras.cmake.in index 03640f8ccd..8ecf7ceb5c 100644 --- a/src/dbus/Qt5DBusConfigExtras.cmake.in +++ b/src/dbus/Qt5DBusConfigExtras.cmake.in @@ -1,12 +1,10 @@ -get_filename_component(_qt5_dbus_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) - if (NOT TARGET Qt5::qdbuscpp2xml) add_executable(Qt5::qdbuscpp2xml IMPORTED) set_target_properties(Qt5::qdbuscpp2xml PROPERTIES !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - IMPORTED_LOCATION \"${_qt5_dbus_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\" + IMPORTED_LOCATION \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\" !!ELSE IMPORTED_LOCATION \"$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\" !!ENDIF @@ -18,7 +16,7 @@ if (NOT TARGET Qt5::qdbusxml2cpp) set_target_properties(Qt5::qdbusxml2cpp PROPERTIES !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - IMPORTED_LOCATION \"${_qt5_dbus_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\" + IMPORTED_LOCATION \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\" !!ELSE IMPORTED_LOCATION \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\" !!ENDIF 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 -- cgit v1.2.3