From 6f0f9f69288925ef423c542ef5eb7302a5431867 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Tue, 22 Nov 2011 14:45:35 +0100 Subject: Remove QMetaObject guards and deprecate QPointer. QWeakPointer is superior and preferred. Remove QMetaObject::addGuard(), QMetaObject::changeGuard(), QMetaObject::removeGuard(), and QObjectPrivate::clearGuards(). Implement QPointer using QWeakPointer instead. This changes the behavior of QPointer in 2 ways: - During destruction of a QWidget. Previously, the destructor of QWidget would reset all QPointers so that they would return zero when destroying children. Update tst_QPointer to account for this change. - When constructing a QSharedPointer to take ownership of an object after a QPointer is already tracking the object. Previously, the shared pointer construction would not be affected by the QPointer, but now that QPointer is implemented using QWeakPoiner, constructing the QSharedPointer will cause an abort(). Fix tst_QSharedPointer by removing the use of QPointer in the objectCast() test. These behavior changes are documented in the QPointer class documentation and in the changes file. Change-Id: I92d0276219c076ece7bcb60f6e1b9120ce4f5747 Reviewed-by: Lars Knoll Reviewed-by: Olivier Goffart --- src/widgets/kernel/qwidget.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/widgets/kernel/qwidget.cpp') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 7ec37bb929..d20e979cfb 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1469,10 +1469,6 @@ QWidget::~QWidget() delete d->needsFlush; d->needsFlush = 0; - // set all QPointers for this object to zero - if (d->hasGuards) - QObjectPrivate::clearGuards(this); - if (d->declarativeData) { QAbstractDeclarativeData::destroyed(d->declarativeData, this); d->declarativeData = 0; // don't activate again in ~QObject -- cgit v1.2.3 From eada3449b9914a3c1cee005245b90631c617a787 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 15 Dec 2011 10:18:37 +0100 Subject: Remove widget attribute orientation values from Qt:: enum. These were only actually implemented on Symbian, thus, they aren't too useful, apart from confusing developers when they don't work. Removed per the discussion on: http://lists.qt-project.org/pipermail/development/2011-December/000860.html Change-Id: Id097cb392a3d964364adbe51a72a22927b9c382c Reviewed-by: Lars Knoll --- src/widgets/kernel/qwidget.cpp | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'src/widgets/kernel/qwidget.cpp') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index d20e979cfb..68d1b432e7 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -10313,45 +10313,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) d->registerTouchWindow(); #endif break; - case Qt::WA_LockPortraitOrientation: - case Qt::WA_LockLandscapeOrientation: - case Qt::WA_AutoOrientation: { - const Qt::WidgetAttribute orientations[3] = { - Qt::WA_LockPortraitOrientation, - Qt::WA_LockLandscapeOrientation, - Qt::WA_AutoOrientation - }; - - if (on) { - // We can only have one of these set at a time - for (int i = 0; i < 3; ++i) { - if (orientations[i] != attribute) - setAttribute_internal(orientations[i], false, data, d); - } - } - -#ifdef Q_WS_S60 - CAknAppUiBase* appUi = static_cast(CEikonEnv::Static()->EikAppUi()); - const CAknAppUiBase::TAppUiOrientation s60orientations[] = { - CAknAppUiBase::EAppUiOrientationPortrait, - CAknAppUiBase::EAppUiOrientationLandscape, - CAknAppUiBase::EAppUiOrientationAutomatic - }; - CAknAppUiBase::TAppUiOrientation s60orientation = CAknAppUiBase::EAppUiOrientationUnspecified; - for (int i = 0; i < 3; ++i) { - if (testAttribute(orientations[i])) { - s60orientation = s60orientations[i]; - break; - } - } - QT_TRAP_THROWING(appUi->SetOrientationL(s60orientation)); - S60->orientationSet = true; - QSymbianControl *window = static_cast(internalWinId()); - if (window) - window->ensureFixNativeOrientation(); -#endif - break; - } default: break; } -- cgit v1.2.3 From 1fdfc2abfe1fa26b86028934d4853432e25b4655 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 5 Jan 2012 14:03:39 +1000 Subject: Update copyright year in license headers. Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern --- src/widgets/kernel/qwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/kernel/qwidget.cpp') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 68d1b432e7..d7a7efda6d 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -- cgit v1.2.3 From f03099cee37ba955e2eda6ae2056a8f8f1109e5c Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 5 Jan 2012 18:51:52 +0100 Subject: Remove docs for functions that no longer exist. Change-Id: Id79d3eeab85b156348054c727ea1897ac3e5842b Reviewed-by: Casper van Donderen --- src/widgets/kernel/qwidget.cpp | 382 ----------------------------------------- 1 file changed, 382 deletions(-) (limited to 'src/widgets/kernel/qwidget.cpp') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index d7a7efda6d..a682a24f4c 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -10803,274 +10803,6 @@ void QWidget::stackUnder(QWidget* w) */ -/*! - \fn bool QWidget::isVisibleToTLW() const - - Use isVisible() instead. -*/ - -/*! - \fn void QWidget::iconify() - - Use showMinimized() instead. -*/ - -/*! - \fn void QWidget::constPolish() const - - Use ensurePolished() instead. -*/ - -/*! - \fn void QWidget::reparent(QWidget *parent, Qt::WindowFlags f, const QPoint &p, bool showIt) - - Use setParent() to change the parent or the widget's widget flags; - use move() to move the widget, and use show() to show the widget. -*/ - -/*! - \fn void QWidget::reparent(QWidget *parent, const QPoint &p, bool showIt) - - Use setParent() to change the parent; use move() to move the - widget, and use show() to show the widget. -*/ - -/*! - \fn void QWidget::recreate(QWidget *parent, Qt::WindowFlags f, const QPoint & p, bool showIt) - - Use setParent() to change the parent or the widget's widget flags; - use move() to move the widget, and use show() to show the widget. -*/ - -/*! - \fn bool QWidget::hasMouse() const - - Use testAttribute(Qt::WA_UnderMouse) instead. -*/ - -/*! - \fn bool QWidget::ownCursor() const - - Use testAttribute(Qt::WA_SetCursor) instead. -*/ - -/*! - \fn bool QWidget::ownFont() const - - Use testAttribute(Qt::WA_SetFont) instead. -*/ - -/*! - \fn void QWidget::unsetFont() - - Use setFont(QFont()) instead. -*/ - -/*! - \fn bool QWidget::ownPalette() const - - Use testAttribute(Qt::WA_SetPalette) instead. -*/ - -/*! - \fn void QWidget::unsetPalette() - - Use setPalette(QPalette()) instead. -*/ - -/*! - \fn void QWidget::setEraseColor(const QColor &color) - - Use the palette instead. - - \oldcode - widget->setEraseColor(color); - \newcode - QPalette palette; - palette.setColor(widget->backgroundRole(), color); - widget->setPalette(palette); - \endcode -*/ - -/*! - \fn void QWidget::setErasePixmap(const QPixmap &pixmap) - - Use the palette instead. - - \oldcode - widget->setErasePixmap(pixmap); - \newcode - QPalette palette; - palette.setBrush(widget->backgroundRole(), QBrush(pixmap)); - widget->setPalette(palette); - \endcode -*/ - -/*! - \fn void QWidget::setPaletteForegroundColor(const QColor &color) - - Use the palette directly. - - \oldcode - widget->setPaletteForegroundColor(color); - \newcode - QPalette palette; - palette.setColor(widget->foregroundRole(), color); - widget->setPalette(palette); - \endcode -*/ - -/*! - \fn void QWidget::setPaletteBackgroundColor(const QColor &color) - - Use the palette directly. - - \oldcode - widget->setPaletteBackgroundColor(color); - \newcode - QPalette palette; - palette.setColor(widget->backgroundRole(), color); - widget->setPalette(palette); - \endcode -*/ - -/*! - \fn void QWidget::setPaletteBackgroundPixmap(const QPixmap &pixmap) - - Use the palette directly. - - \oldcode - widget->setPaletteBackgroundPixmap(pixmap); - \newcode - QPalette palette; - palette.setBrush(widget->backgroundRole(), QBrush(pixmap)); - widget->setPalette(palette); - \endcode -*/ - -/*! - \fn void QWidget::setBackgroundPixmap(const QPixmap &pixmap) - - Use the palette instead. - - \oldcode - widget->setBackgroundPixmap(pixmap); - \newcode - QPalette palette; - palette.setBrush(widget->backgroundRole(), QBrush(pixmap)); - widget->setPalette(palette); - \endcode -*/ - -/*! - \fn void QWidget::setBackgroundColor(const QColor &color) - - Use the palette instead. - - \oldcode - widget->setBackgroundColor(color); - \newcode - QPalette palette; - palette.setColor(widget->backgroundRole(), color); - widget->setPalette(palette); - \endcode -*/ - - -/*! - \fn QWidget *QWidget::parentWidget(bool sameWindow) const - - Use the no-argument overload instead. -*/ - -/*! - \fn void QWidget::setKeyCompression(bool b) - - Use setAttribute(Qt::WA_KeyCompression, b) instead. -*/ - -/*! - \fn void QWidget::setFont(const QFont &f, bool b) - - Use the single-argument overload instead. -*/ - -/*! - \fn void QWidget::setPalette(const QPalette &p, bool b) - - Use the single-argument overload instead. -*/ - -/*! - \fn void QWidget::setBackgroundOrigin(BackgroundOrigin background) - - \obsolete -*/ - -/*! - \fn BackgroundOrigin QWidget::backgroundOrigin() const - - \obsolete - - Always returns \c WindowOrigin. -*/ - -/*! - \fn QPoint QWidget::backgroundOffset() const - - \obsolete - - Always returns QPoint(). -*/ - -/*! - \fn void QWidget::repaint(bool b) - - The boolean parameter \a b is ignored. Use the no-argument overload instead. -*/ - -/*! - \fn void QWidget::repaint(int x, int y, int w, int h, bool b) - - The boolean parameter \a b is ignored. Use the four-argument overload instead. -*/ - -/*! - \fn void QWidget::repaint(const QRect &r, bool b) - - The boolean parameter \a b is ignored. Use the single rect-argument overload instead. -*/ - -/*! - \fn void QWidget::repaint(const QRegion &rgn, bool b) - - The boolean parameter \a b is ignored. Use the single region-argument overload instead. -*/ - -/*! - \fn void QWidget::erase() - - Drawing may only take place in a QPaintEvent. Overload - paintEvent() to do your erasing and call update() to schedule a - replaint whenever necessary. See also QPainter. -*/ - -/*! - \fn void QWidget::erase(int x, int y, int w, int h) - - Drawing may only take place in a QPaintEvent. Overload - paintEvent() to do your erasing and call update() to schedule a - replaint whenever necessary. See also QPainter. -*/ - -/*! - \fn void QWidget::erase(const QRect &rect) - - Drawing may only take place in a QPaintEvent. Overload - paintEvent() to do your erasing and call update() to schedule a - replaint whenever necessary. See also QPainter. -*/ - /*! \fn void QWidget::drawText(const QPoint &p, const QString &s) @@ -11087,42 +10819,6 @@ void QWidget::stackUnder(QWidget* w) replaint whenever necessary. See also QPainter. */ -/*! - \fn QWidget *QWidget::childAt(const QPoint &p, bool includeThis) const - - Use the single point argument overload instead. -*/ - -/*! - \fn void QWidget::setCaption(const QString &c) - - Use setWindowTitle() instead. -*/ - -/*! - \fn void QWidget::setIcon(const QPixmap &i) - - Use setWindowIcon() instead. -*/ - -/*! - \fn void QWidget::setIconText(const QString &it) - - Use setWindowIconText() instead. -*/ - -/*! - \fn QString QWidget::caption() const - - Use windowTitle() instead. -*/ - -/*! - \fn QString QWidget::iconText() const - - Use windowIconText() instead. -*/ - /*! \fn bool QWidget::isTopLevel() const \obsolete @@ -11140,84 +10836,6 @@ void QWidget::stackUnder(QWidget* w) \internal */ -/*! - \fn void QWidget::setInputMethodEnabled(bool enabled) - - Use setAttribute(Qt::WA_InputMethodEnabled, \a enabled) instead. -*/ - -/*! - \fn bool QWidget::isInputMethodEnabled() const - - Use testAttribute(Qt::WA_InputMethodEnabled) instead. -*/ - -/*! - \fn void QWidget::setActiveWindow() - - Use activateWindow() instead. -*/ - -/*! - \fn bool QWidget::isShown() const - - Use !isHidden() instead (notice the exclamation mark), or use isVisible() to check whether the widget is visible. -*/ - -/*! - \fn bool QWidget::isDialog() const - - Use windowType() == Qt::Dialog instead. -*/ - -/*! - \fn bool QWidget::isPopup() const - - Use windowType() == Qt::Popup instead. -*/ - -/*! - \fn bool QWidget::isDesktop() const - - Use windowType() == Qt::Desktop instead. -*/ - -/*! - \fn void QWidget::polish() - - Use ensurePolished() instead. -*/ - -/*! - \fn QWidget *QWidget::childAt(int x, int y, bool includeThis) const - - Use the childAt() overload that doesn't have an \a includeThis parameter. - - \oldcode - return widget->childAt(x, y, true); - \newcode - QWidget *child = widget->childAt(x, y, true); - if (child) - return child; - if (widget->rect().contains(x, y)) - return widget; - \endcode -*/ - -/*! - \fn void QWidget::setSizePolicy(QSizePolicy::Policy hor, QSizePolicy::Policy ver, bool hfw) - \compat - - Use the \l sizePolicy property and heightForWidth() function instead. -*/ - -/*! - \fn bool QWidget::isUpdatesEnabled() const - \compat - - Use the \l updatesEnabled property instead. -*/ - /*! \macro QWIDGETSIZE_MAX \relates QWidget -- cgit v1.2.3 From 7e46af4a41eaf0188921da504438c3515b062bdd Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 5 Jan 2012 21:59:04 +0100 Subject: Remove qdoc for code that no longer exists. Change-Id: I82d4ba930335a03181aa20c9e4cb060ca8b35b9a Reviewed-by: Casper van Donderen --- src/widgets/kernel/qwidget.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'src/widgets/kernel/qwidget.cpp') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index a682a24f4c..ae0cbe42dc 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -10791,33 +10791,6 @@ void QWidget::stackUnder(QWidget* w) QApplication::sendEvent(this, &e); } -/*! - \enum QWidget::BackgroundOrigin - - \compat - - \value WidgetOrigin - \value ParentOrigin - \value WindowOrigin - \value AncestorOrigin - -*/ - -/*! - \fn void QWidget::drawText(const QPoint &p, const QString &s) - - Drawing may only take place in a QPaintEvent. Overload - paintEvent() to do your drawing and call update() to schedule a - replaint whenever necessary. See also QPainter. -*/ - -/*! - \fn void QWidget::drawText(int x, int y, const QString &s) - - Drawing may only take place in a QPaintEvent. Overload - paintEvent() to do your drawing and call update() to schedule a - replaint whenever necessary. See also QPainter. -*/ /*! \fn bool QWidget::isTopLevel() const -- cgit v1.2.3 From 75af95cbeb43a55f0026ee15aba028b5236e3baf Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 10 Jan 2012 15:58:31 +0100 Subject: Fix QWidget::saveGeometry(). Bring back code that was accidentally removed. Change-Id: Ie1a4d22caa206bc8bb8e678879935e79009e9622 Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qwidget.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/widgets/kernel/qwidget.cpp') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index ae0cbe42dc..a90d15c62b 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -6555,6 +6555,9 @@ QByteArray QWidget::saveGeometry() const #ifdef Q_WS_MAC << newFramePosition << newNormalPosition +#else + << frameGeometry() + << normalGeometry() #endif // Q_WS_MAC << qint32(QApplication::desktop()->screenNumber(this)) << quint8(windowState() & Qt::WindowMaximized) -- cgit v1.2.3 From ad163821356dfab943cbc848d82039c171f0346d Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 9 Jan 2012 14:18:18 +0100 Subject: Remove QAccessibleEvent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was unused and I don't quite understand its purpose any more. Change-Id: I5c946a1644fd64508cb4aad78320ae96fd935d31 Reviewed-by: Jan-Arve Sæther --- src/widgets/kernel/qwidget.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'src/widgets/kernel/qwidget.cpp') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index a90d15c62b..a66ccf8572 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -8186,26 +8186,6 @@ bool QWidget::event(QEvent *event) if (d->whatsThis.isEmpty()) event->ignore(); break; -#endif -#ifndef QT_NO_ACCESSIBILITY - case QEvent::AccessibilityDescription: - case QEvent::AccessibilityHelp: { - QAccessibleEvent *ev = static_cast(event); - switch (ev->type()) { -#ifndef QT_NO_TOOLTIP - case QEvent::AccessibilityDescription: - ev->setValue(d->toolTip); - break; -#endif -#ifndef QT_NO_WHATSTHIS - case QEvent::AccessibilityHelp: - ev->setValue(d->whatsThis); - break; -#endif - default: - return false; - } - break; } #endif case QEvent::EmbeddingControl: d->topData()->frameStrut.setCoords(0 ,0, 0, 0); -- cgit v1.2.3 From e50416066cab4be7df8382bd224d9e4ddd7a903a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 12 Jan 2012 08:53:13 +0100 Subject: Added application flags to translate between touch and mouse events. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current way we do it of having the platform or touch plugin send both mouse and touch events is not ideal. There's no good way to write an application that works sanely both on a touch-only device and on a desktop except by restricting yourself to only handling mouse events. If you try to handle touch events you don't get any events at all on desktop, and if you try to handle both, you end up getting duplicate events on touch devices. Instead, we should get rid of the code in the plugins that automatically sends mouse events translated from touch events. This change enables that by making the behaviour fully configurable in QtGui. Two new application attributes are added to explicitly say whether unhandled touch events should be sent as synthesized mouse events and vice versa, and no duplicates are automatically sent as the current situation. Synthesized mouse events are enabled by default. We also get rid of the QTouchEvent::TouchPoint::Primary flag, which was only used to signal that the windowing system automatically generated mouse events for that touch point. Now we only generate mouse events from the first touch point in the list. Change-Id: I8e20f3480407ca8c31b42de0a4d2b319e1346b65 Reviewed-by: Laszlo Agocs Reviewed-by: Jocelyn Turcotte Reviewed-by: Tor Arne Vestbø Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll Reviewed-by: Denis Dzyubenko --- src/widgets/kernel/qwidget.cpp | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'src/widgets/kernel/qwidget.cpp') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index a66ccf8572..531a217b1d 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -8227,40 +8227,7 @@ bool QWidget::event(QEvent *event) case QEvent::TouchUpdate: case QEvent::TouchEnd: { -#ifndef Q_WS_MAC - QTouchEvent *touchEvent = static_cast(event); - const QTouchEvent::TouchPoint &touchPoint = touchEvent->touchPoints().first(); - if (touchPoint.isPrimary() || touchEvent->device()->type() == QTouchDevice::TouchPad) - break; - - // fake a mouse event! - QEvent::Type eventType = QEvent::None; - switch (touchEvent->type()) { - case QEvent::TouchBegin: - eventType = QEvent::MouseButtonPress; - break; - case QEvent::TouchUpdate: - eventType = QEvent::MouseMove; - break; - case QEvent::TouchEnd: - eventType = QEvent::MouseButtonRelease; - break; - default: - Q_ASSERT(!true); - break; - } - if (eventType == QEvent::None) - break; - - QMouseEvent mouseEvent(eventType, - touchPoint.pos(), - touchPoint.scenePos(), - touchPoint.screenPos(), - Qt::LeftButton, - Qt::LeftButton, - touchEvent->modifiers()); - (void) QApplication::sendEvent(this, &mouseEvent); -#endif // Q_WS_MAC + event->ignore(); break; } #ifndef QT_NO_GESTURES -- cgit v1.2.3