From d79d756d057f20ecc1a6e70a00fe792c2a1f95c8 Mon Sep 17 00:00:00 2001 From: Dean Dettman Date: Tue, 24 Nov 2009 14:25:41 +0100 Subject: Docs : Add details to QMdiArea::removeSubWindow() Clarifying that the behaviour is different depending on what is passed in. Reviewed-by: Morten Engvoldsen --- src/gui/widgets/qmdiarea.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qmdiarea.cpp b/src/gui/widgets/qmdiarea.cpp index b3288c3..f3dbe34 100644 --- a/src/gui/widgets/qmdiarea.cpp +++ b/src/gui/widgets/qmdiarea.cpp @@ -1947,8 +1947,10 @@ QMdiSubWindow *QMdiArea::addSubWindow(QWidget *widget, Qt::WindowFlags windowFla /*! Removes \a widget from the MDI area. The \a widget must be either a QMdiSubWindow or a widget that is the internal widget of - a subwindow. Note that the subwindow is not deleted by QMdiArea - and that its parent is set to 0. + a subwindow. Note \a widget is never actually deleted by QMdiArea. + If a QMdiSubWindow is passed in its parent is set to 0 and it is + removed, but if an internal widget is passed in the child widget + is set to 0 but the QMdiSubWindow is not removed. \sa addSubWindow() */ -- cgit v0.12 From 4817debee23a72f44eedbb8f33b6b611b5161174 Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 24 Nov 2009 14:36:08 +0100 Subject: Added some missing build instructions for abld. WebKit will not build unless the mentioned variable is set. RevBy: Aleksandar Sasha Babic --- doc/src/getting-started/installation.qdoc | 7 +++++++ doc/src/snippets/code/doc_src_installation.qdoc | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index 1a5cd99..057629d 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -599,6 +599,13 @@ If you are using pre-built binaries, follow the instructions given in the emulator. This is done by locating the Carbide.c++ submenu on the Start menu, and choosing "Configure environment for WINSCW command line". + If you are planning to use abld (the default build system that comes with the S60 SDK) + to build Qt, you will also need to set the following environment variable: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 33 + + This is not necessary for other applications, only when building Qt. + \o Configure Qt To configure Qt for the Symbian platform, do: diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc index 3563a64..50e29d0 100644 --- a/doc/src/snippets/code/doc_src_installation.qdoc +++ b/doc/src/snippets/code/doc_src_installation.qdoc @@ -216,3 +216,7 @@ bldmake bldfiles abld build winscw udeb abld build gcce urel //! [32] + +//! [33] +SYMBIANBUILD_DEPENDENCYOFF=1 +//! [33] -- cgit v0.12 From a0c8e134a284d45520dd3a229e68dbcd155299e6 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Tue, 24 Nov 2009 15:52:38 +0100 Subject: Fix softkeys for QDialogButtonBoxes created without a parent. Inthe case where a QDialogButtonBox was created without a parent, for example in the FTP example, the softkeys that are automatically created inside the button box were not being added to the right widget when the button box was given a parent (or added to a layout) later. This patch resolves that issue by handling the ParentChange event and then adding the softkeys at this point. Task-number: QTBUG-6086 Reviewed-by: axis --- src/gui/widgets/qdialogbuttonbox.cpp | 24 +++++++++ .../auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp | 60 ++++++++++++++++------ 2 files changed, 68 insertions(+), 16 deletions(-) diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp index 2ee5751..0e859f1 100644 --- a/src/gui/widgets/qdialogbuttonbox.cpp +++ b/src/gui/widgets/qdialogbuttonbox.cpp @@ -1215,6 +1215,30 @@ bool QDialogButtonBox::event(QEvent *event) }else if (event->type() == QEvent::LanguageChange) { d->retranslateStrings(); } +#ifdef QT_SOFTKEYS_ENABLED + else if (event->type() == QEvent::ParentChange) { + QWidget *dialog = 0; + QWidget *p = this; + while (p && !p->isWindow()) { + p = p->parentWidget(); + if ((dialog = qobject_cast(p))) + break; + } + + // If the parent changes, then move the softkeys + for (QHash::const_iterator it = d->softKeyActions.constBegin(); + it != d->softKeyActions.constEnd(); ++it) { + QAction *current = it.value(); + QList widgets = current->associatedWidgets(); + foreach (QWidget *w, widgets) + w->removeAction(current); + if (dialog) + dialog->addAction(current); + else + addAction(current); + } + } +#endif return QWidget::event(event); } diff --git a/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp b/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp index 936ebf7..2c49fc8 100644 --- a/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp +++ b/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp @@ -111,6 +111,9 @@ private slots: void testDefaultButton_data(); void testDefaultButton(); void testS60SoftKeys(); +#ifdef QT_SOFTKEYS_ENABLED + void testSoftKeyReparenting(); +#endif void task191642_default(); private: @@ -715,6 +718,17 @@ void tst_QDialogButtonBox::testDefaultButton_data() QTest::newRow("third accept explicit after add") << 0 << 2 << 2; } +static int softKeyCount(QWidget *widget) +{ + int softkeyCount = 0; + QList actions = widget->actions(); + foreach (QAction *action, actions) { + if (action->softKeyRole() != QAction::NoSoftKey) + softkeyCount++; + } + return softkeyCount; +} + void tst_QDialogButtonBox::testS60SoftKeys() { #ifdef Q_WS_S60 @@ -722,33 +736,47 @@ void tst_QDialogButtonBox::testS60SoftKeys() QDialogButtonBox buttonBox(&dialog); buttonBox.setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); dialog.show(); - - int softkeyCount = 0; - QList actions = dialog.actions(); - foreach (QAction *action, actions) { - if (action->softKeyRole() != QAction::NoSoftKey) - softkeyCount++; - } - QCOMPARE( softkeyCount, 2); + + QCOMPARE( softKeyCount(&dialog), 2); QDialog dialog2(0); QDialogButtonBox buttonBox2(&dialog2); buttonBox2.setStandardButtons(QDialogButtonBox::Cancel); dialog2.show(); - int softkeyCount2 = 0; - QList actions2 = dialog2.actions(); - foreach (QAction *action, actions2) { - if (action->softKeyRole() != QAction::NoSoftKey) - softkeyCount2++; - } - QCOMPARE( softkeyCount2, 1); - + QCOMPARE( softKeyCount(&dialog2), 1); + #else QSKIP("S60-specific test", SkipAll ); #endif } +#ifdef QT_SOFTKEYS_ENABLED +void tst_QDialogButtonBox::testSoftKeyReparenting() +{ + QDialog dialog; + QDialogButtonBox *buttonBox = new QDialogButtonBox; + buttonBox->addButton(QDialogButtonBox::Ok); + buttonBox->addButton(QDialogButtonBox::Cancel); + + QCOMPARE(softKeyCount(&dialog), 0); + QCOMPARE(softKeyCount(buttonBox), 2); + + // Were the softkeys re-parented correctly? + dialog.setLayout(new QVBoxLayout); + dialog.layout()->addWidget(buttonBox); + QCOMPARE(softKeyCount(&dialog), 2); + QCOMPARE(softKeyCount(buttonBox), 0); + + // Softkeys are only added to QDialog, not QWidget + QWidget *nested = new QWidget; + nested->setLayout(new QVBoxLayout); + nested->layout()->addWidget(buttonBox); + QCOMPARE(softKeyCount(nested), 0); + QCOMPARE(softKeyCount(buttonBox), 2); +} +#endif + void tst_QDialogButtonBox::testDefaultButton() { QFETCH(int, whenToSetDefault); -- cgit v0.12 From 80e9b7cdeeb1b1e85e724b4ed1903e0923005c79 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 25 Nov 2009 10:16:26 +1000 Subject: Fix links to docs in INSTALL and README The names of the doc directories on the doc site don't include the patch version number. Task-number: QTBUG-6043 Reviewed-by: Trust Me --- INSTALL | 14 +++++++------- dist/README | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/INSTALL b/INSTALL index b62f21d..7279f06 100644 --- a/INSTALL +++ b/INSTALL @@ -1,14 +1,14 @@ INSTALLING Qt Source Package Version %VERSION%. For full installation instructions for each supported platform, please -see http://qt.nokia.com/doc/%VERSION%/installation.html, the file +see http://qt.nokia.com/doc/%SHORTVERSION%/installation.html, the file doc/html/installation.html in this package, or follow one of the following links: -Embedded Linux: http://qt.nokia.com/doc/%VERSION%/qt-embedded-install.html -Mac OS X: http://qt.nokia.com/doc/%VERSION%/install-mac.html -Windows: http://qt.nokia.com/doc/%VERSION%/install-win.html -Windows CE: http://qt.nokia.com/doc/%VERSION%/install-wince.html -X11 Platforms: http://qt.nokia.com/doc/%VERSION%/install-x11.html -Symbian Platform: http://qt.nokia.com/doc/%VERSION%/install-symbian.html +Embedded Linux: http://qt.nokia.com/doc/%SHORTVERSION%/qt-embedded-install.html +Mac OS X: http://qt.nokia.com/doc/%SHORTVERSION%/install-mac.html +Windows: http://qt.nokia.com/doc/%SHORTVERSION%/install-win.html +Windows CE: http://qt.nokia.com/doc/%SHORTVERSION%/install-wince.html +X11 Platforms: http://qt.nokia.com/doc/%SHORTVERSION%/install-x11.html +Symbian Platform: http://qt.nokia.com/doc/%SHORTVERSION%/install-symbian.html diff --git a/dist/README b/dist/README index 529d2bd..e7dfb19 100644 --- a/dist/README +++ b/dist/README @@ -52,7 +52,7 @@ documentation is available at http://qt.nokia.com/doc/. SUPPORTED PLATFORMS For a complete list of supported platforms, see -http://qt.nokia.com/doc/%VERSION%/supported-platforms.html. +http://qt.nokia.com/doc/%SHORTVERSION%/supported-platforms.html. COMMERCIAL EDITIONS @@ -65,7 +65,7 @@ the QtCore, QtGui (except QGraphicsView), QtTest, QtDBus and Qt3Support modules. For a full listing of the contents of each module, please refer to -http://qt.nokia.com/doc/%VERSION%/modules.html +http://qt.nokia.com/doc/%SHORTVERSION%/modules.html HOW TO REPORT A BUG -- cgit v0.12 From c71c46430317b70e784f0952d0aac048775ad842 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 24 Nov 2009 09:34:48 +0100 Subject: Fix QFile::map in Linux 64bit On 64bit, qint64(size_t(-1)) = -1 Reviewed-by: Joao Reviewed-by: Thiago (cherry picked from commit 829d9e10ad3d26fb2fddef01c8e36352018c3fec) --- src/corelib/io/qfsfileengine_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 35737b3..8cbf6a3 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -1245,7 +1245,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla } if (offset < 0 || offset != qint64(QT_OFF_T(offset)) - || size < 0 || size > qint64(size_t(-1))) { + || size < 0 || quint64(size) > quint64(size_t(-1))) { q->setError(QFile::UnspecifiedError, qt_error_string(int(EINVAL))); return 0; } -- cgit v0.12 From 106121a74bca32a6411b9ca968ee415f8bdfbff1 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 23 Nov 2009 17:56:03 +0100 Subject: Fixes implicit grabbing in Qt/Cocoa When delivering mouse events in Qt/Cocoa set the implicit mouse grabber and deliver the event to it and do not try to propagate the event to the parent view. Reviewed-by: Prasanth (cherry picked from commit aae81f370f6afede95064bc75eb7ee6ac13b1c30) --- src/gui/kernel/qcocoaview_mac.mm | 51 ++++++++++++++-------------------- src/gui/kernel/qt_cocoa_helpers_mac.mm | 8 ++++++ 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 72eedad..bf6bf4a 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -79,6 +79,7 @@ extern bool qt_sendSpontaneousEvent(QObject *, QEvent *); // qapplication.cpp extern OSViewRef qt_mac_nativeview_for(const QWidget *w); // qwidget_mac.mm extern const QStringList& qEnabledDraggedTypes(); // qmime_mac.cpp extern QPointer qt_mouseover; //qapplication_mac.mm +extern QPointer qt_button_down; //qapplication_mac.cpp Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum) { @@ -691,6 +692,9 @@ extern "C" { - (void)mouseDown:(NSEvent *)theEvent { + if (!qt_button_down) + qt_button_down = qwidget; + qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonPress, Qt::LeftButton); // Don't call super here. This prevents us from getting the mouseUp event, // which we need to send even if the mouseDown event was not accepted. @@ -700,75 +704,62 @@ extern "C" { - (void)mouseUp:(NSEvent *)theEvent { - bool mouseOK = qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonRelease, Qt::LeftButton); + qt_button_down = 0; - if (!mouseOK) - [super mouseUp:theEvent]; + qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonRelease, Qt::LeftButton); } - (void)rightMouseDown:(NSEvent *)theEvent { - bool mouseOK = qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonPress, Qt::RightButton); + if (!qt_button_down) + qt_button_down = qwidget; - if (!mouseOK) - [super rightMouseDown:theEvent]; + qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonPress, Qt::RightButton); } - (void)rightMouseUp:(NSEvent *)theEvent { - bool mouseOK = qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonRelease, Qt::RightButton); + qt_button_down = 0; - if (!mouseOK) - [super rightMouseUp:theEvent]; + qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonRelease, Qt::RightButton); } - (void)otherMouseDown:(NSEvent *)theEvent { - Qt::MouseButton mouseButton = cocoaButton2QtButton([theEvent buttonNumber]); - bool mouseOK = qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonPress, mouseButton); + if (!qt_button_down) + qt_button_down = qwidget; - if (!mouseOK) - [super otherMouseDown:theEvent]; + Qt::MouseButton mouseButton = cocoaButton2QtButton([theEvent buttonNumber]); + qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonPress, mouseButton); } - (void)otherMouseUp:(NSEvent *)theEvent { - Qt::MouseButton mouseButton = cocoaButton2QtButton([theEvent buttonNumber]); - bool mouseOK = qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonRelease, mouseButton); - - if (!mouseOK) - [super otherMouseUp:theEvent]; + qt_button_down = 0; + Qt::MouseButton mouseButton = cocoaButton2QtButton([theEvent buttonNumber]); + qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseButtonRelease, mouseButton); } - (void)mouseDragged:(NSEvent *)theEvent { qMacDnDParams()->view = self; qMacDnDParams()->theEvent = theEvent; - bool mouseOK = qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseMove, Qt::NoButton); - - if (!mouseOK) - [super mouseDragged:theEvent]; + qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseMove, Qt::NoButton); } - (void)rightMouseDragged:(NSEvent *)theEvent { qMacDnDParams()->view = self; qMacDnDParams()->theEvent = theEvent; - bool mouseOK = qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseMove, Qt::NoButton); - - if (!mouseOK) - [super rightMouseDragged:theEvent]; + qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseMove, Qt::NoButton); } - (void)otherMouseDragged:(NSEvent *)theEvent { qMacDnDParams()->view = self; qMacDnDParams()->theEvent = theEvent; - bool mouseOK = qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseMove, Qt::NoButton); - - if (!mouseOK) - [super otherMouseDragged:theEvent]; + qt_mac_handleMouseEvent(self, theEvent, QEvent::MouseMove, Qt::NoButton); } - (void)scrollWheel:(NSEvent *)theEvent diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index c0fb8aa..2bf1465 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -899,6 +899,14 @@ bool qt_mac_handleMouseEvent(void * /* NSView * */view, void * /* NSEvent * */ev widgetToGetMouse = [static_cast(tmpView) qt_qwidget]; } + } else { + extern QPointer qt_button_down; //qapplication_mac.cpp + if (!mac_mouse_grabber && qt_button_down) { + // if there is no explicit grabber, and the mouse was grabbed + // implicitely (i.e. a mousebutton was pressed) + widgetToGetMouse = qt_button_down; + tmpView = qt_mac_nativeview_for(widgetToGetMouse); + } } NSPoint localPoint = [tmpView convertPoint:windowPoint fromView:nil]; -- cgit v0.12