From ffbb3c1a2aee4134dce80cd144a26bf32865b698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 6 May 2009 09:43:32 +0200 Subject: Fixed some inconsistencies for image drawing on non-integer coords. Don't use aliased coordinate delta for image drawing. Related to change fde7475bcf9c10522a8170e6eb8fb9a8fadc21cd. Task-number: 251561 Reviewed-by: Trond --- src/gui/painting/qblendfunctions.cpp | 12 ++---------- src/gui/painting/qpaintengine_raster.cpp | 6 +++++- tests/arthur/data/qps/borderimage.qps | 20 ++++++++++++++++++++ tests/arthur/data/qps/borderimage_qps.png | Bin 88788 -> 90704 bytes 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp index dd7b016..93f11e1 100644 --- a/src/gui/painting/qblendfunctions.cpp +++ b/src/gui/painting/qblendfunctions.cpp @@ -44,8 +44,6 @@ QT_BEGIN_NAMESPACE -static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; - struct SourceOnlyAlpha { inline uchar alpha(uchar src) const { return src; } @@ -140,14 +138,11 @@ struct Blend_ARGB32_on_RGB16_SourceAndConstAlpha { template void qt_scale_image_16bit(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, - const QRectF &target, + const QRectF &targetRect, const QRectF &srcRect, const QRect &clip, T blender) { - const QRectF targetRect = target.translated(aliasedCoordinateDelta, - aliasedCoordinateDelta); - qreal sx = targetRect.width() / (qreal) srcRect.width(); qreal sy = targetRect.height() / (qreal) srcRect.height(); @@ -618,14 +613,11 @@ struct Blend_ARGB32_on_ARGB32_SourceAndConstAlpha { template void qt_scale_image_32bit(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, - const QRectF &target, + const QRectF &targetRect, const QRectF &srcRect, const QRect &clip, T blender) { - const QRectF targetRect = target.translated(aliasedCoordinateDelta, - aliasedCoordinateDelta); - qreal sx = targetRect.width() / (qreal) srcRect.width(); qreal sy = targetRect.height() / (qreal) srcRect.height(); diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 788b722..cbfd5e3 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2573,7 +2573,11 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe QRasterPaintEngineState *s = state(); const bool aa = s->flags.antialiased || s->flags.bilinear; if (!aa && sr.size() == QSize(1, 1)) { - fillRect(r, QColor::fromRgba(img.pixel(sr.x(), sr.y()))); + // as fillRect will apply the aliased coordinate delta we need to + // subtract it here as we don't use it for image drawing + const QRectF targetRect = r.translated(-aliasedCoordinateDelta, + -aliasedCoordinateDelta); + fillRect(targetRect, QColor::fromRgba(img.pixel(sr.x(), sr.y()))); return; } diff --git a/tests/arthur/data/qps/borderimage.qps b/tests/arthur/data/qps/borderimage.qps index 747a74d..14073fe 100644 --- a/tests/arthur/data/qps/borderimage.qps +++ b/tests/arthur/data/qps/borderimage.qps @@ -106,6 +106,23 @@ repeat_block draw_column resetMatrix setRenderHint Antialiasing off +translate 200.1 520.1 + +begin_block one_pixel_border +drawImage borderimage 0 0 16 16 0 0 16 16 +drawImage borderimage 16 0 64 16 16 0 1 1 +drawImage borderimage 80 0 16 16 48 0 16 16 + +drawImage borderimage 0 16 16 64 16 0 1 1 +drawImage borderimage 80 16 16 64 16 0 1 1 + +drawImage borderimage 0 80 16 16 0 48 16 16 +drawImage borderimage 16 80 64 16 16 0 1 1 +drawImage borderimage 80 80 16 16 48 48 16 16 +end_block one_pixel_border + +resetMatrix + setPen red drawRect 0 0 70 680 @@ -127,3 +144,6 @@ drawText 174 114 "smoothpixmaptransform off" drawRect 164 128 224 134 drawText 174 252 "smoothpixmaptransform on" + +drawRect 200 520 97 128 +drawText 210 638 "1x1 edges" diff --git a/tests/arthur/data/qps/borderimage_qps.png b/tests/arthur/data/qps/borderimage_qps.png index 89a8eba..a4ec6cb 100644 Binary files a/tests/arthur/data/qps/borderimage_qps.png and b/tests/arthur/data/qps/borderimage_qps.png differ -- cgit v0.12 From bd29efb125142c936a57a9e6ad35c3f9f76b8e17 Mon Sep 17 00:00:00 2001 From: mae Date: Wed, 6 May 2009 10:13:43 +0200 Subject: Fixed scrolling performance issue related to hidden blocks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to a wrong lookup (confusing line and block number) the scroll optimization was broken, causing the entire view to be updated. Reviewed-by: Thorbjørn Lindeijer --- src/gui/widgets/qplaintextedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index 2e9201d..e563fa1 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -624,7 +624,7 @@ void QPlainTextEditPrivate::setTopBlock(int blockNumber, int lineNumber, int dx) if (viewport->updatesEnabled() && viewport->isVisible()) { int dy = 0; - if (doc->findBlockByLineNumber(control->topBlock).isValid()) { + if (doc->findBlockByNumber(control->topBlock).isValid()) { dy = (int)(-q->blockBoundingGeometry(block).y()) + verticalOffset() - verticalOffset(blockNumber, lineNumber); } -- cgit v0.12 From a78dba4353318efdf7b11116518650fd539a9fd9 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Wed, 6 May 2009 11:23:56 +0200 Subject: Doc: Updated QImageReader::supportedImageFormat() to include SVG Task-number: 252415 --- src/gui/image/qimagereader.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 5de39d9..7f36be9 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -1337,6 +1337,7 @@ QByteArray QImageReader::imageFormat(QIODevice *device) \row \o TIFF \o Tagged Image File Format \row \o XBM \o X11 Bitmap \row \o XPM \o X11 Pixmap + \row \o SVG \o Scalable Vector Graphics \endtable Reading and writing SVG files is supported through Qt's -- cgit v0.12 From 384869482e2481685dd409208f583a1acc77bcc8 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 29 Apr 2009 10:01:24 +0200 Subject: Mac OS X QWidget::setMinimumSize locks. There was code for updating the size constrains inside setConstraints_sys. This is now added. Factored out the code that does this into a function, and since we never applied size constraines on a window upon creation, I also added an extra call from that code part Task-number: 219695 Reviewed-by: Trenton Schulz --- src/gui/kernel/qwidget_mac.mm | 86 ++++++++++++++++++++++--------------------- src/gui/kernel/qwidget_p.h | 3 +- 2 files changed, 46 insertions(+), 43 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 5abaaf8..3f89ff3 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2162,6 +2162,7 @@ void QWidgetPrivate::finishCreateWindow_sys_Carbon(OSWindowRef windowRef) setWindowModified_sys(q->isWindowModified()); updateFrameStrut(); qt_mac_update_sizer(q); + applyMaxAndMinSizeOnWindow(); } #else // QT_MAC_USE_COCOA void QWidgetPrivate::finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ voidWindowRef) @@ -2247,6 +2248,7 @@ void QWidgetPrivate::finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ voidWin syncCocoaMask(); macUpdateIsOpaque(); qt_mac_update_sizer(q); + applyMaxAndMinSizeOnWindow(); } #endif // QT_MAC_USE_COCOA @@ -4001,7 +4003,7 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &oldRect) } } -void QWidgetPrivate::applyMaxAndMinSizeConstraints(int &w, int &h) +void QWidgetPrivate::adjustWithinMaxAndMinSize(int &w, int &h) { if (QWExtra *extra = extraData()) { w = qMin(w, extra->maxw); @@ -4028,6 +4030,26 @@ void QWidgetPrivate::applyMaxAndMinSizeConstraints(int &w, int &h) } } +void QWidgetPrivate::applyMaxAndMinSizeOnWindow() +{ + Q_Q(QWidget); + const float max_f(20000); +#ifndef QT_MAC_USE_COCOA +#define SF(x) ((x > max_f) ? max_f : x) + HISize max = CGSizeMake(SF(extra->maxw), SF(extra->maxh)); + HISize min = CGSizeMake(SF(extra->minw), SF(extra->minh)); +#undef SF + SetWindowResizeLimits(qt_mac_window_for(q), &min, &max); +#else +#define SF(x) ((x > max_f) ? max_f : x) + NSSize max = NSMakeSize(SF(extra->maxw), SF(extra->maxh)); + NSSize min = NSMakeSize(SF(extra->minw), SF(extra->minh)); +#undef SF + [qt_mac_window_for(q) setMinSize:min]; + [qt_mac_window_for(q) setMaxSize:max]; +#endif +} + void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) { Q_Q(QWidget); @@ -4039,17 +4061,18 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) QMacCocoaAutoReleasePool pool; bool realWindow = isRealWindow(); - if (realWindow && !q->testAttribute(Qt::WA_DontShowOnScreen) + if (realWindow && !q->testAttribute(Qt::WA_DontShowOnScreen)){ + adjustWithinMaxAndMinSize(w, h); #ifndef QT_MAC_USE_COCOA - && !(w == 0 && h == 0) -#endif - ){ - applyMaxAndMinSizeConstraints(w, h); - topData()->isSetGeometry = 1; - topData()->isMove = isMove; -#ifndef QT_MAC_USE_COCOA - Rect r; SetRect(&r, x, y, x + w, y + h); - SetWindowBounds(qt_mac_window_for(q), kWindowContentRgn, &r); + if (w != 0 && h != 0) { + topData()->isSetGeometry = 1; + topData()->isMove = isMove; + Rect r; SetRect(&r, x, y, x + w, y + h); + SetWindowBounds(qt_mac_window_for(q), kWindowContentRgn, &r); + topData()->isSetGeometry = 0; + } else { + setGeometry_sys_helper(x, y, w, h, isMove); + } #else NSWindow *window = qt_mac_window_for(q); const QRect &fStrut = frameStrut(); @@ -4077,7 +4100,6 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) [window setFrameOrigin:cocoaFrameRect.origin]; } #endif - topData()->isSetGeometry = 0; } else { setGeometry_sys_helper(x, y, w, h, isMove); } @@ -4102,40 +4124,19 @@ void QWidgetPrivate::setGeometry_sys_helper(int x, int y, int w, int h, bool isM data.crect = QRect(x, y, w, h); if (realWindow) { - if (QWExtra *extra = extraData()) { - applyMaxAndMinSizeConstraints(w, h); - qt_mac_update_sizer(q); + adjustWithinMaxAndMinSize(w, h); + qt_mac_update_sizer(q); - if (q->windowFlags() & Qt::WindowMaximizeButtonHint) { #ifndef QT_MAC_USE_COCOA - OSWindowRef window = qt_mac_window_for(q); - if(extra->maxw && extra->maxh && extra->maxw == extra->minw - && extra->maxh == extra->minh) { - ChangeWindowAttributes(window, kWindowNoAttributes, kWindowFullZoomAttribute); - } else { - ChangeWindowAttributes(window, kWindowFullZoomAttribute, kWindowNoAttributes); - } -#endif + if (q->windowFlags() & Qt::WindowMaximizeButtonHint) { + OSWindowRef window = qt_mac_window_for(q); + if (extra->maxw && extra->maxh && extra->maxw == extra->minw + && extra->maxh == extra->minh) { + ChangeWindowAttributes(window, kWindowNoAttributes, kWindowFullZoomAttribute); + } else { + ChangeWindowAttributes(window, kWindowFullZoomAttribute, kWindowNoAttributes); } - - // Update max and min constraints: - const float max_f(20000); -#ifndef QT_MAC_USE_COCOA -#define SF(x) ((x > max_f) ? max_f : x) - HISize max = CGSizeMake(SF(extra->maxw), SF(extra->maxh)); - HISize min = CGSizeMake(SF(extra->minw), SF(extra->minh)); -#undef SF - SetWindowResizeLimits(qt_mac_window_for(q), &min, &max); -#else -#define SF(x) ((x > max_f) ? max_f : x) - NSSize max = NSMakeSize(SF(extra->maxw), SF(extra->maxh)); - NSSize min = NSMakeSize(SF(extra->minw), SF(extra->minh)); -#undef SF - [qt_mac_window_for(q) setMinSize:min]; - [qt_mac_window_for(q) setMaxSize:max]; -#endif } -#ifndef QT_MAC_USE_COCOA HIRect bounds = CGRectMake(0, 0, w, h); HIViewSetFrame(qt_mac_nativeview_for(q), &bounds); #else @@ -4181,6 +4182,7 @@ void QWidgetPrivate::setGeometry_sys_helper(int x, int y, int w, int h, bool isM void QWidgetPrivate::setConstraints_sys() { updateMaximizeButton_sys(); + applyMaxAndMinSizeOnWindow(); } void QWidgetPrivate::updateMaximizeButton_sys() diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index db78682..2461820 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -257,7 +257,8 @@ public: void macUpdateIsOpaque(); void setEnabled_helper_sys(bool enable); bool isRealWindow() const; - void applyMaxAndMinSizeConstraints(int &w, int &h); + void adjustWithinMaxAndMinSize(int &w, int &h); + void applyMaxAndMinSizeOnWindow(); #endif void raise_sys(); -- cgit v0.12 From 6ba793ea76e72332786ee90022ee169fca311446 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 6 May 2009 11:11:32 +0200 Subject: QComboBox: Click-drag-release does not work for combo boxes using Cocoa The problem is that the mouse event was redirected to the active pop-up, while it should have been redirected to the widget under the mouse under the active popup. This patch does the correct redirection Task-number: 252259 Reviewed-by: Trenton Schulz --- src/gui/kernel/qt_cocoa_helpers_mac.mm | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index f000292..9165836 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -826,13 +826,28 @@ bool qt_mac_handleMouseEvent(void * /* NSView * */view, void * /* NSEvent * */ev QWidget *qwidget = [theView qt_qwidget]; QWidget *widgetToGetMouse = qwidget; QWidget *popup = qAppInstance()->activePopupWidget(); - if (popup && popup != qwidget->window()) - widgetToGetMouse = popup; NSView *tmpView = theView; - if (widgetToGetMouse != qwidget) { - tmpView = qt_mac_nativeview_for(widgetToGetMouse); + + if (popup && popup != qwidget->window()) { + widgetToGetMouse = popup; + tmpView = qt_mac_nativeview_for(popup); windowPoint = [[tmpView window] convertScreenToBase:globalPoint]; + + QPoint qWindowPoint(windowPoint.x, windowPoint.y); + if (widgetToGetMouse->rect().contains(qWindowPoint)) { + // Keeping the mouse pressed on a combobox button will make + // the popup pop in front of the mouse. But all mouse events + // will be sendt to the button. Since we want mouse events + // to be sendt to widgets inside the popup, we search for the + // widget in front of the mouse: + tmpView = [tmpView hitTest:windowPoint]; + if (!tmpView) + return false; + widgetToGetMouse = + [static_cast(tmpView) qt_qwidget]; + } } + NSPoint localPoint = [tmpView convertPoint:windowPoint fromView:nil]; QPoint qlocalPoint(localPoint.x, localPoint.y); -- cgit v0.12 From 54313dfcb36286916f5daa7df5d605f2d94b70ea Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Wed, 6 May 2009 11:35:37 +0200 Subject: Doc: Said that QTextCursor is an implicitly shared class in QTextCursor::operator= Task-number: 247955 --- src/gui/text/qtextcursor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index c327b9f..48963bb 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -1074,7 +1074,10 @@ QTextCursor::QTextCursor(const QTextCursor &cursor) } /*! - Makes a copy of \a cursor and assigns it to this QTextCursor. + Makes a copy of \a cursor and assigns it to this QTextCursor. Note + that QTextCursor is an \l{Implicitly Shared Classes}{implicitly + shared} class. + */ QTextCursor &QTextCursor::operator=(const QTextCursor &cursor) { -- cgit v0.12 From 6586200d3043ba7915bc60695e2a1436a5cadfa3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 6 May 2009 12:11:59 +0200 Subject: Moved the QT_BEGIN_NAMESPACE macro to the right place in qsslcipher.cpp Task-number: 252298 Reviewed-by: Peter Hartmann --- src/network/ssl/qsslcipher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/ssl/qsslcipher.cpp b/src/network/ssl/qsslcipher.cpp index 505c662..7fec2df 100644 --- a/src/network/ssl/qsslcipher.cpp +++ b/src/network/ssl/qsslcipher.cpp @@ -64,9 +64,9 @@ #ifndef QT_NO_DEBUG_STREAM #include +#endif QT_BEGIN_NAMESPACE -#endif /*! Constructs an empty QSslCipher object. -- cgit v0.12 From b38874c55ec7d046c3ff3ba08599d52e004c0146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Wed, 6 May 2009 12:58:33 +0200 Subject: Optimize QCocoaView::registerDragTypes and mode switching in QtCreator. We were registering the types each time drag and drop was enabled, which caused slowdowns when for example switching between the Edit and Debug modes in QtCreator. Instead, register the types on first enable and also when the custom types change. Add check to draggingEntered() that disables the drag if WA_DropSiteRegistered is false. Reviewed-by: nrc --- src/gui/kernel/qcocoaview_mac.mm | 18 +++++++++++++----- src/gui/kernel/qcocoaview_mac_p.h | 3 ++- src/gui/kernel/qwidget_mac.mm | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index ff36ca1..4ceae3f 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -198,6 +198,7 @@ extern "C" { } composing = false; sendKeyEvents = true; + currentCustomTypes = 0; [self setHidden:YES]; return self; } @@ -212,10 +213,16 @@ extern "C" { object:self]; } --(void)registerDragTypes:(bool)accept +-(void)registerDragTypes { QMacCocoaAutoReleasePool pool; - if (accept) { + // Calling registerForDraggedTypes is slow, so only do it once for each widget + // or when the custom types change. + const QStringList& customTypes = qEnabledDraggedTypes(); + if (currentCustomTypes == 0 || *currentCustomTypes != customTypes) { + if (currentCustomTypes == 0) + currentCustomTypes = new QStringList(); + *currentCustomTypes = customTypes; const NSString* mimeTypeGeneric = @"com.trolltech.qt.MimeTypeName"; NSMutableArray *supportedTypes = [NSMutableArray arrayWithObjects:NSColorPboardType, NSFilenamesPboardType, NSStringPboardType, @@ -227,13 +234,10 @@ extern "C" { NSFilesPromisePboardType, NSInkTextPboardType, NSMultipleTextSelectionPboardType, mimeTypeGeneric, nil]; // Add custom types supported by the application. - const QStringList& customTypes = qEnabledDraggedTypes(); for (int i = 0; i < customTypes.size(); i++) { [supportedTypes addObject:reinterpret_cast(QCFString::toCFStringRef(customTypes[i]))]; } [self registerForDraggedTypes:supportedTypes]; - } else { - [self unregisterDraggedTypes]; } } @@ -282,6 +286,8 @@ extern "C" { - (NSDragOperation)draggingEntered:(id )sender { + if (qwidget->testAttribute(Qt::WA_DropSiteRegistered) == false) + return NSDragOperationNone; [self addDropData:sender]; QMimeData *mimeData = dropData; if (QDragManager::self()->source()) @@ -414,6 +420,8 @@ extern "C" { - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; + delete currentCustomTypes; + [self unregisterDraggedTypes]; [super dealloc]; } diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h index 9de94d5..983c762 100644 --- a/src/gui/kernel/qcocoaview_mac_p.h +++ b/src/gui/kernel/qcocoaview_mac_p.h @@ -83,6 +83,7 @@ Q_GUI_EXPORT bool composing; int composingLength; bool sendKeyEvents; + QStringList *currentCustomTypes; } - (id)initWithQWidget:(QWidget *)widget widgetPrivate:(QWidgetPrivate *)widgetprivate; - (void) finishInitWithQWidget:(QWidget *)widget widgetPrivate:(QWidgetPrivate *)widgetprivate; @@ -91,7 +92,7 @@ Q_GUI_EXPORT - (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender; - (void)draggingExited:(id < NSDraggingInfo >)sender; - (BOOL)performDragOperation:(id )sender; -- (void)registerDragTypes:(bool)accept; +- (void)registerDragTypes; - (void)removeDropData; - (void)addDropData:(id )sender; - (void)setSupportedActions:(NSDragOperation)actions; diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 3f89ff3..b315eaf 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4497,8 +4497,8 @@ void QWidgetPrivate::registerDropSite(bool on) SetControlDragTrackingEnabled(qt_mac_nativeview_for(q), on); #else NSView *view = qt_mac_nativeview_for(q); - if ([view isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) { - [static_cast(view) registerDragTypes:on]; + if (on && [view isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) { + [static_cast(view) registerDragTypes]; } #endif } -- cgit v0.12 From acd5ac35f26b075c48bc04a2db8064fe8bd4be90 Mon Sep 17 00:00:00 2001 From: kh Date: Wed, 6 May 2009 13:11:08 +0200 Subject: Fixes broken last tab page handling in case the search was hidden. --- tools/assistant/tools/assistant/centralwidget.cpp | 46 ++++++++++++++++------- tools/assistant/tools/assistant/centralwidget.h | 2 +- tools/assistant/tools/assistant/mainwindow.cpp | 8 +++- tools/assistant/tools/assistant/mainwindow.h | 1 + 4 files changed, 42 insertions(+), 15 deletions(-) diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 4390a10..ec54d0c 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -262,8 +262,9 @@ CentralWidget::~CentralWidget() QString zoomCount; QString currentPages; QLatin1Char separator('|'); - int i = m_searchWidget->isAttached() ? 1 : 0; + bool searchAttached = m_searchWidget->isAttached(); + int i = searchAttached ? 1 : 0; for (; i < tabWidget->count(); ++i) { HelpViewer *viewer = qobject_cast(tabWidget->widget(i)); if (viewer && viewer->source().isValid()) { @@ -274,6 +275,7 @@ CentralWidget::~CentralWidget() engine.setCustomValue(QLatin1String("LastTabPage"), lastTabPage); engine.setCustomValue(QLatin1String("LastShownPages"), currentPages); + engine.setCustomValue(QLatin1String("SearchWasAttached"), searchAttached); #if !defined(QT_NO_WEBKIT) engine.setCustomValue(QLatin1String("LastPagesZoomWebView"), zoomCount); #else @@ -418,7 +420,18 @@ void CentralWidget::setLastShownPages() setSourceInNewTab((*it), (*zIt).toFloat()); const QLatin1String lastTab("LastTabPage"); - tabWidget->setCurrentIndex(helpEngine->customValue(lastTab, 1).toInt()); + int tab = helpEngine->customValue(lastTab, 1).toInt(); + + const QLatin1String searchKey("SearchWasAttached"); + const bool searchIsAttached = m_searchWidget->isAttached(); + const bool searchWasAttached = helpEngine->customValue(searchKey).toBool(); + + if (searchWasAttached && !searchIsAttached) + tabWidget->setCurrentIndex(--tab); + else if (!searchWasAttached && searchIsAttached) + tabWidget->setCurrentIndex(++tab); + else + tabWidget->setCurrentIndex(tab); } bool CentralWidget::hasSelection() const @@ -978,22 +991,29 @@ void CentralWidget::updateBrowserFont() void CentralWidget::createSearchWidget(QHelpSearchEngine *searchEngine) { - if (!m_searchWidget) { - m_searchWidget = new SearchWidget(searchEngine, this); - connect(m_searchWidget, SIGNAL(requestShowLink(QUrl)), this, - SLOT(setSourceFromSearch(QUrl))); - connect(m_searchWidget, SIGNAL(requestShowLinkInNewTab(QUrl)), this, - SLOT(setSourceFromSearchInNewTab(QUrl))); - } - tabWidget->insertTab(0, m_searchWidget, tr("Search")); - m_searchWidget->setAttached(true); + if (m_searchWidget) + return; + + m_searchWidget = new SearchWidget(searchEngine, this); + connect(m_searchWidget, SIGNAL(requestShowLink(QUrl)), this, + SLOT(setSourceFromSearch(QUrl))); + connect(m_searchWidget, SIGNAL(requestShowLinkInNewTab(QUrl)), this, + SLOT(setSourceFromSearchInNewTab(QUrl))); } -void CentralWidget::activateSearchWidget() +void CentralWidget::activateSearchWidget(bool updateLastTabPage) { - if (!m_searchWidget->isAttached()) + if (!m_searchWidget) createSearchWidget(helpEngine->searchEngine()); + if (!m_searchWidget->isAttached()) { + tabWidget->insertTab(0, m_searchWidget, tr("Search")); + m_searchWidget->setAttached(true); + + if (updateLastTabPage) + lastTabPage++; + } + tabWidget->setCurrentWidget(m_searchWidget); m_searchWidget->setFocus(); } diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h index 2c28091..e3ce200 100644 --- a/tools/assistant/tools/assistant/centralwidget.h +++ b/tools/assistant/tools/assistant/centralwidget.h @@ -118,7 +118,7 @@ public: void activateTab(bool onlyHelpViewer = false); void createSearchWidget(QHelpSearchEngine *searchEngine); - void activateSearchWidget(); + void activateSearchWidget(bool updateLastTabPage = false); void removeSearchWidget(); int availableHelpViewer() const; diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 426a828..52cbf45 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -126,6 +126,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) connect(searchEngine, SIGNAL(indexingFinished()), this, SLOT(indexingFinished())); m_centralWidget->createSearchWidget(searchEngine); + m_centralWidget->activateSearchWidget(); QString defWindowTitle = tr("Qt Assistant"); setWindowTitle(defWindowTitle); @@ -461,7 +462,7 @@ void MainWindow::setupActions() QKeySequence(tr("ALT+I"))); m_viewMenu->addAction(tr("Bookmarks"), this, SLOT(showBookmarks()), QKeySequence(tr("ALT+O"))); - m_viewMenu->addAction(tr("Search"), this, SLOT(showSearch()), + m_viewMenu->addAction(tr("Search"), this, SLOT(showSearchWidget()), QKeySequence(tr("ALT+S"))); menu = menuBar()->addMenu(tr("&Go")); @@ -880,6 +881,11 @@ void MainWindow::showSearch() m_centralWidget->activateSearchWidget(); } +void MainWindow::showSearchWidget() +{ + m_centralWidget->activateSearchWidget(true); +} + void MainWindow::hideSearch() { m_centralWidget->removeSearchWidget(); diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h index 7d08a74..d7f5c69 100644 --- a/tools/assistant/tools/assistant/mainwindow.h +++ b/tools/assistant/tools/assistant/mainwindow.h @@ -92,6 +92,7 @@ public slots: void showIndex(); void showBookmarks(); void showSearch(); + void showSearchWidget(); void syncContents(); void activateCurrentCentralWidgetTab(); -- cgit v0.12 From 4258eb4c448f2e68fe5cd428f90e1af0c9268a00 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Wed, 6 May 2009 13:10:30 +0200 Subject: fixed a typo in QPrintDialog documentation --- src/gui/dialogs/qabstractprintdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/dialogs/qabstractprintdialog.cpp b/src/gui/dialogs/qabstractprintdialog.cpp index 0dc16c9..5ed8852 100644 --- a/src/gui/dialogs/qabstractprintdialog.cpp +++ b/src/gui/dialogs/qabstractprintdialog.cpp @@ -400,7 +400,7 @@ void QAbstractPrintDialogPrivate::setPrinter(QPrinter *newPrinter) QAbstractPrintDialog::setEnabledOptions() and QAbstractPrintDialog::addEnabledOption() have no effect. - In Qt 4.4, it was possible to use the satic functions to show a sheet on + In Qt 4.4, it was possible to use the static functions to show a sheet on Mac OS X. This is no longer supported in Qt 4.5. If you want this functionality, use QPrintDialog::open(). -- cgit v0.12 From 3dcbd944d90f6e2db9ab74078ccc4f6caf38a2bd Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Wed, 6 May 2009 13:30:42 +0200 Subject: Doc: Added links to Text Object Example in QTextDocument and QTextObject Task-number: 244858 --- src/gui/text/qtextdocument.cpp | 2 +- src/gui/text/qtextobject.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index e84b324..873f846 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -287,7 +287,7 @@ QTextCodec *Qt::codecForHtml(const QByteArray &ba) that inform connected editor widgets about the state of the undo/redo system. - \sa QTextCursor QTextEdit \link richtext.html Rich Text Processing\endlink + \sa QTextCursor, QTextEdit, \link richtext.html Rich Text Processing\endlink , {Text Object Example} */ /*! diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp index 3f4c8e5..71b68e0 100644 --- a/src/gui/text/qtextobject.cpp +++ b/src/gui/text/qtextobject.cpp @@ -76,7 +76,7 @@ QT_BEGIN_NAMESPACE objects, you will also need to reimplement QTextDocument::createObject() which acts as a factory method for creating text objects. - \sa QTextDocument + \sa QTextDocument, {Text Object Example} */ /*! -- cgit v0.12 From 8ca999b4e3bbb4c547a4e45095eb8fd14c6a62f1 Mon Sep 17 00:00:00 2001 From: kh Date: Wed, 6 May 2009 13:34:12 +0200 Subject: Put the Dochwidget tabs on top as this was often requested. --- tools/assistant/tools/assistant/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 52cbf45..b0c2c6b 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -235,6 +235,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) else checkInitState(); } + setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); } MainWindow::~MainWindow() -- cgit v0.12 From 30559395ca73361ec4347fe04fb0eb34a373859a Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 6 May 2009 14:39:39 +0200 Subject: Fixing task 252319 This is still not a perfect solution since it breaks 245347 again Task-number: 252319 Reviewed-by: Maurice --- src/gui/widgets/qmainwindow.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 2abc9e8..502c1e9 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -480,9 +480,6 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar) oldMenuBar->hide(); oldMenuBar->deleteLater(); } -#ifdef Q_OS_WINCE - if (menuBar && menuBar->size().height() > 0) -#endif d->layout->setMenuBar(menuBar); } -- cgit v0.12 From da1416cef6b1d24156739ded101df895ee4e80d9 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Wed, 6 May 2009 14:51:13 +0200 Subject: Added comment to QTextStream - clarification of the documentation Explained why you cannot use QTextStream::atEnd with stdin. Task-number:251171 --- src/corelib/io/qtextstream.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index ed9d0aa..2010008 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -67,7 +67,8 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 1 Note that you cannot use QTextStream::atEnd(), which returns true when you - have reached the end of the data stream, with stdin. + have reached the end of the data stream, with stdin because as long as the + application is running, stdin has no end. Besides using QTextStream's constructors, you can also set the device or string QTextStream operates on by calling setDevice() or -- cgit v0.12 From 4395513385ed639e54b1ebf5c0f1a919f9a9622b Mon Sep 17 00:00:00 2001 From: jasplin Date: Wed, 6 May 2009 14:52:03 +0200 Subject: Fixed bug in QTabBar::setTabButton() for a scrolled tab bar. This fix ensures that the current tab is visible after calling setTabButton() on a scrolled tab bar. Reviewed-by: bnilsen Task-number: 252472 --- src/gui/widgets/qtabbar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index b562b1f..69221ba 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1085,7 +1085,7 @@ void QTabBar::setTabData(int index, const QVariant & data) } /*! - Returns the datad of the tab at position \a index, or a null + Returns the data of the tab at position \a index, or a null variant if \a index is out of range. */ QVariant QTabBar::tabData(int index) const @@ -2222,6 +2222,7 @@ void QTabBar::setTabButton(int index, ButtonPosition position, QWidget *widget) d->tabList[index].rightWidget = widget; } d->layoutTabs(); + d->refresh(); update(); } -- cgit v0.12 From 3cec5ff3f0aa8d3eca0dfb325e83a8a3a18cb305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 6 May 2009 14:08:55 +0200 Subject: Prevented X server crash when calling XFillPolygon with >200000 points. Don't know why the X server crashes, but it's reproducible both by us and customers so we should fall back to the raster paint engine to avoid the crash. Task-number: 244362 Reviewed-by: Trond --- src/gui/painting/qpaintengine_x11.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 4b2fbca..9cc9683 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -1543,6 +1543,8 @@ void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int p QX11PaintEnginePrivate::GCMode gcMode, QPaintEngine::PolygonDrawMode mode) { + Q_Q(QX11PaintEngine); + int clippedCount = 0; qt_float_point *clippedPoints = 0; @@ -1617,7 +1619,29 @@ void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int p } else #endif if (fill.style() != Qt::NoBrush) { - if (clippedCount > 0) { + if (clippedCount > 200000) { + QPolygon poly; + for (int i = 0; i < clippedCount; ++i) + poly << QPoint(qFloor(clippedPoints[i].x), qFloor(clippedPoints[i].y)); + + const QRect bounds = poly.boundingRect(); + const QRect aligned = bounds + & QRect(QPoint(), QSize(pdev->width(), pdev->height())); + + QImage img(aligned.size(), QImage::Format_ARGB32_Premultiplied); + img.fill(0); + + QPainter painter(&img); + painter.translate(-aligned.x(), -aligned.y()); + painter.setPen(Qt::NoPen); + painter.setBrush(fill); + if (gcMode == BrushGC) + painter.setBrushOrigin(q->painter()->brushOrigin()); + painter.drawPolygon(poly); + painter.end(); + + q->drawImage(aligned, img, img.rect(), Qt::AutoColor); + } else if (clippedCount > 0) { QVarLengthArray xpoints(clippedCount); for (int i = 0; i < clippedCount; ++i) { xpoints[i].x = qFloor(clippedPoints[i].x); -- cgit v0.12 From 2043637a4e17252062fcb483e2e63ce0cb0920dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 6 May 2009 11:58:56 +0200 Subject: Re-enabled antialiasing for large font sizes in OpenGL paint engine. In 4.4 alphaMapForGlyph() would return valid images for any font size, but this was changed in 4.5, forcing us to use the path fallback instead. This lead to non-antialiased fonts when not using a multisample-enabled GL format. This patch re-introduces the alphaMapForGlyph() fallback in QFontEngine from 4.4 which uses the raster paint engine to draw the glyph. Task-number: 247083 Reviewed-by: Trond --- src/gui/text/qfontengine.cpp | 39 ++++++++++++++++++++++++++++++++++++++ src/gui/text/qfontengine_ft.cpp | 8 +++++--- src/gui/text/qfontengine_p.h | 2 +- src/opengl/qpaintengine_opengl.cpp | 5 ++--- 4 files changed, 47 insertions(+), 7 deletions(-) diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 47fe5c2..d7a9c23 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -624,6 +624,45 @@ QImage QFontEngine::alphaRGBMapForGlyph(glyph_t glyph, int /* margin */, const Q return rgbMask; } +QImage QFontEngine::alphaMapForGlyph(glyph_t glyph) +{ + glyph_metrics_t gm = boundingBox(glyph); + int glyph_x = qFloor(gm.x.toReal()); + int glyph_y = qFloor(gm.y.toReal()); + int glyph_width = qCeil((gm.x + gm.width).toReal()) - glyph_x; + int glyph_height = qCeil((gm.y + gm.height).toReal()) - glyph_y; + + if (glyph_width <= 0 || glyph_height <= 0) + return QImage(); + QFixedPoint pt; + pt.x = 0; + pt.y = -glyph_y; // the baseline + QPainterPath path; + QImage im(glyph_width + qAbs(glyph_x) + 4, glyph_height, QImage::Format_ARGB32_Premultiplied); + im.fill(Qt::transparent); + QPainter p(&im); + p.setRenderHint(QPainter::Antialiasing); + addGlyphsToPath(&glyph, &pt, 1, &path, 0); + p.setPen(Qt::NoPen); + p.setBrush(Qt::black); + p.drawPath(path); + p.end(); + + QImage indexed(im.width(), im.height(), QImage::Format_Indexed8); + QVector colors(256); + for (int i=0; i<256; ++i) + colors[i] = qRgba(0, 0, 0, i); + indexed.setColorTable(colors); + + for (int y=0; ywidth + 3) & ~3 : ((glyph->width + 31)/32) * 4; diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 176c728..dc18991 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -178,7 +178,7 @@ public: * Create a qimage with the alpha values for the glyph. * Returns an image indexed_8 with index values ranging from 0=fully transparant to 255=opaque */ - virtual QImage alphaMapForGlyph(glyph_t) = 0; + virtual QImage alphaMapForGlyph(glyph_t); virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t); virtual QImage alphaRGBMapForGlyph(glyph_t, int margin, const QTransform &t); diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index ec6e33b..5a212f5 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -5068,9 +5068,8 @@ void QOpenGLPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte // fall back to drawing a polygon if the scale factor is large, or // we use a gradient pen - if (ti.fontEngine->fontDef.pixelSize >= 64 - || (d->matrix.det() > 1) || (d->pen_brush_style >= Qt::LinearGradientPattern - && d->pen_brush_style <= Qt::ConicalGradientPattern)) { + if ((d->matrix.det() > 1) || (d->pen_brush_style >= Qt::LinearGradientPattern + && d->pen_brush_style <= Qt::ConicalGradientPattern)) { QPaintEngine::drawTextItem(p, textItem); return; } -- cgit v0.12 From 2e3a5ea4434d19fbdb90996e71961f0791ea6487 Mon Sep 17 00:00:00 2001 From: Bjoern Erik Nilsen Date: Wed, 6 May 2009 13:40:25 +0200 Subject: QGraphicsItem::setOpacity(0.0) does not trigger an update. The problem was that we discarded update requests for fully transparent items, which is correct, but we even did that when the update was issued from QGraphicsItem::setOpacity. We don't have to, and shouldn't, consider the opacity in that case. Whenever we reach the fullUpdateHelper call in setOpacity it means we have to do an update regardless of the current opacity (oldOpacity was not 0.0 if the currentOpacity is 0.0). Auto-test included. Task-number: 252913 Reviewed-by: Andreas --- src/gui/graphicsview/qgraphicsitem.cpp | 16 ++--- src/gui/graphicsview/qgraphicsitem_p.h | 7 +- src/gui/graphicsview/qgraphicsview.cpp | 6 +- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 89 +++++++++++++++++++++++++- 4 files changed, 102 insertions(+), 16 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 3e8d38f..11ec24b 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1921,7 +1921,7 @@ void QGraphicsItem::setOpacity(qreal opacity) itemChange(ItemOpacityHasChanged, newOpacity); // Update. - d_ptr->fullUpdateHelper(); + d_ptr->fullUpdateHelper(/*childrenOnly=*/false, /*maybeDirtyClipPath=*/false, /*ignoreOpacity=*/true); } /*! @@ -3621,9 +3621,8 @@ void QGraphicsItem::setBoundingRegionGranularity(qreal granularity) \internal Returns true if we can discard an update request; otherwise false. */ -bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreClipping, - bool ignoreVisibleBit, - bool ignoreDirtyBit) const +bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreClipping, bool ignoreVisibleBit, + bool ignoreDirtyBit, bool ignoreOpacity) const { // No scene, or if the scene is updating everything, means we have nothing // to do. The only exception is if the scene tracks the growing scene rect. @@ -3632,7 +3631,7 @@ bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreClipping, || !scene || (scene->d_func()->updateAll && scene->d_func()->hasSceneRect) || (!ignoreClipping && (childrenClippedToShape() && isClippedAway())) - || (childrenCombineOpacity() && isFullyTransparent()); + || (!ignoreOpacity && childrenCombineOpacity() && isFullyTransparent()); } /*! @@ -3662,11 +3661,10 @@ void QGraphicsItemPrivate::updateHelper(const QRectF &rect, bool force, bool may Propagates updates to \a item and all its children. */ -void QGraphicsItemPrivate::fullUpdateHelper(bool childrenOnly, bool maybeDirtyClipPath) +void QGraphicsItemPrivate::fullUpdateHelper(bool childrenOnly, bool maybeDirtyClipPath, bool ignoreOpacity) { - if (discardUpdateRequest(/*ignoreClipping=*/maybeDirtyClipPath, - /*ignoreVisibleBit=*/false, - /*ignoreDirtyBit=*/true)) { + if (discardUpdateRequest(/*ignoreClipping=*/maybeDirtyClipPath, /*ignoreVisibleBit=*/false, + /*ignoreDirtyBit=*/true, ignoreOpacity)) { return; } diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index a5871a7..9ce1bbf 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -165,11 +165,10 @@ public: void setPosHelper(const QPointF &pos); void setVisibleHelper(bool newVisible, bool explicitly, bool update = true); void setEnabledHelper(bool newEnabled, bool explicitly, bool update = true); - bool discardUpdateRequest(bool ignoreClipping = false, - bool ignoreVisibleBit = false, - bool ignoreDirtyBit = false) const; + bool discardUpdateRequest(bool ignoreClipping = false, bool ignoreVisibleBit = false, + bool ignoreDirtyBit = false, bool ignoreOpacity = false) const; void updateHelper(const QRectF &rect = QRectF(), bool force = false, bool maybeDirtyClipPath = false); - void fullUpdateHelper(bool childrenOnly = false, bool maybeDirtyClipPath = false); + void fullUpdateHelper(bool childrenOnly = false, bool maybeDirtyClipPath = false, bool ignoreOpacity = false); void updateEffectiveOpacity(); void resolveEffectiveOpacity(qreal effectiveParentOpacity); void resolveDepth(int parentDepth); diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index b5a1bdf..05e4907 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1071,8 +1071,12 @@ QList QGraphicsViewPrivate::findItems(const QRegion &exposedReg QList itemList(scene->items()); int i = 0; while (i < itemList.size()) { + const QGraphicsItem *item = itemList.at(i); // But we only want to include items that are visible - if (!itemList.at(i)->isVisible()) + // The following check is basically the same as item->d_ptr->isInvisible(), except + // that we don't check whether the item clips children to shape or propagates its + // opacity (we loop through all items, so those checks are wrong in this context). + if (!item->isVisible() || item->d_ptr->isClippedAway() || item->d_ptr->isFullyTransparent()) itemList.removeAt(i); else ++i; diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 77b7948..6d150cb 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -78,8 +78,7 @@ Q_DECLARE_METATYPE(QRectF) class EventTester : public QGraphicsItem { public: - EventTester() - : repaints(0) + EventTester(QGraphicsItem *parent = 0) : QGraphicsItem(parent), repaints(0) { br = QRectF(-10, -10, 20, 20); } void setGeometry(const QRectF &rect) @@ -207,6 +206,7 @@ private slots: void itemTransform_unrelated(); void opacity_data(); void opacity(); + void opacity2(); void itemStacksBehindParent(); void nestedClipping(); void nestedClippingTransforms(); @@ -5570,6 +5570,91 @@ void tst_QGraphicsItem::opacity() QCOMPARE(c3->effectiveOpacity(), c3_effectiveOpacity); } +void tst_QGraphicsItem::opacity2() +{ + EventTester *parent = new EventTester; + EventTester *child = new EventTester(parent); + EventTester *grandChild = new EventTester(child); + + QGraphicsScene scene; + scene.addItem(parent); + + class MyGraphicsView : public QGraphicsView + { public: + int repaints; + MyGraphicsView(QGraphicsScene *scene) : QGraphicsView(scene), repaints(0) {} + void paintEvent(QPaintEvent *e) { ++repaints; QGraphicsView::paintEvent(e); } + }; + + MyGraphicsView view(&scene); + view.show(); +#ifdef Q_WS_X11 + qt_x11_wait_for_window_manager(&view); +#endif + QTest::qWait(250); + +#define RESET_REPAINT_COUNTERS \ + parent->repaints = 0; \ + child->repaints = 0; \ + grandChild->repaints = 0; \ + view.repaints = 0; + + RESET_REPAINT_COUNTERS + + child->setOpacity(0.0); + QTest::qWait(100); + QCOMPARE(view.repaints, 1); + QCOMPARE(parent->repaints, 1); + QCOMPARE(child->repaints, 0); + QCOMPARE(grandChild->repaints, 0); + + RESET_REPAINT_COUNTERS + + child->setOpacity(1.0); + QTest::qWait(100); + QCOMPARE(view.repaints, 1); + QCOMPARE(parent->repaints, 1); + QCOMPARE(child->repaints, 1); + QCOMPARE(grandChild->repaints, 1); + + RESET_REPAINT_COUNTERS + + parent->setOpacity(0.0); + QTest::qWait(100); + QCOMPARE(view.repaints, 1); + QCOMPARE(parent->repaints, 0); + QCOMPARE(child->repaints, 0); + QCOMPARE(grandChild->repaints, 0); + + RESET_REPAINT_COUNTERS + + parent->setOpacity(1.0); + QTest::qWait(100); + QCOMPARE(view.repaints, 1); + QCOMPARE(parent->repaints, 1); + QCOMPARE(child->repaints, 1); + QCOMPARE(grandChild->repaints, 1); + + grandChild->setFlag(QGraphicsItem::ItemIgnoresParentOpacity); + RESET_REPAINT_COUNTERS + + child->setOpacity(0.0); + QTest::qWait(100); + QCOMPARE(view.repaints, 1); + QCOMPARE(parent->repaints, 1); + QCOMPARE(child->repaints, 0); + QCOMPARE(grandChild->repaints, 1); + + RESET_REPAINT_COUNTERS + + child->setOpacity(0.0); // Already 0.0; no change. + QTest::qWait(100); + QCOMPARE(view.repaints, 0); + QCOMPARE(parent->repaints, 0); + QCOMPARE(child->repaints, 0); + QCOMPARE(grandChild->repaints, 0); +} + void tst_QGraphicsItem::itemStacksBehindParent() { QGraphicsRectItem *parent1 = new QGraphicsRectItem(QRectF(0, 0, 100, 50)); -- cgit v0.12 From b35bde7308016bbf32f28940a27bb37c74343375 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 6 May 2009 15:39:33 +0200 Subject: Adds in documentation for RESOURCES Reviewed-by: Kavindra Palaraja --- doc/src/qmake-manual.qdoc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/src/qmake-manual.qdoc b/doc/src/qmake-manual.qdoc index 39581a2..172bc60 100644 --- a/doc/src/qmake-manual.qdoc +++ b/doc/src/qmake-manual.qdoc @@ -932,6 +932,7 @@ \o \l{qmake Variable Reference#QT}{QT} \o \l{qmake Variable Reference#RCC_DIR}{RCC_DIR} \o \l{qmake Variable Reference#REQUIRES}{REQUIRES} + \o \l{qmake Variable Reference#RESOURCES}{RESOURCES} \o \l{qmake Variable Reference#SOURCES}{SOURCES} \o \l{qmake Variable Reference#SUBDIRS}{SUBDIRS} \o \l{qmake Variable Reference#TARGET}{TARGET} @@ -2420,6 +2421,12 @@ This is mainly used in Qt's build system for building the examples. + \section1 RESOURCES + + This variable contains the name of the resource collection file (qrc) + for the application. Further information about the resource collection + file can be found at \l{The Qt Resource System}. + \section1 RES_FILE This variable contains the name of the resource file for the application. -- cgit v0.12 From 1560af4bca4a7ea2dd6b73ddef60cd012c4897b0 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Wed, 6 May 2009 14:48:03 +0200 Subject: Doc: Updated docs for collision between QGraphicsItems Task-number: 252287 --- src/gui/graphicsview/qgraphicsitem.cpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 3e8d38f..2ec1c44 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -3235,10 +3235,16 @@ bool QGraphicsItem::contains(const QPointF &point) const } /*! - Returns true if this item collides with \a other; otherwise returns false. - The ways items collide is determined by \a mode. The default value for \a - mode is Qt::IntersectsItemShape; \a other collides with this item if it - either intersects, contains, or is contained by this item's shape. + + Returns true if this item collides with \a other; otherwise + returns false. + + The \a mode is applied to \a other, and the resulting shape or + bounding rectangle is then compared to this item's shape. The + default value for \a mode is Qt::IntersectsItemShape; \a other + collides with this item if it either intersects, contains, or is + contained by this item's shape (see Qt::ItemSelectionMode for + details). The default implementation is based on shape intersection, and it calls shape() on both items. Because the complexity of arbitrary shape-shape @@ -3293,6 +3299,11 @@ bool QGraphicsItem::collidesWithItem(const QGraphicsItem *other, Qt::ItemSelecti Qt::IntersectsItemShape; \a path collides with this item if it either intersects, contains, or is contained by this item's shape. + Note that this function checks whether the item's shape or + bounding rectangle (depending on \a mode) is contained within \a + path, and not whether \a path is contained within the items shape + or bounding rectangle. + \sa collidesWithItem(), contains(), shape() */ bool QGraphicsItem::collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode) const @@ -3333,11 +3344,12 @@ bool QGraphicsItem::collidesWithPath(const QPainterPath &path, Qt::ItemSelection /*! Returns a list of all items that collide with this item. - The way collisions are detected is determined by \a mode. The default - value for \a mode is Qt::IntersectsItemShape; All items whose shape - intersects or is contained by this item's shape are returned. + The way collisions are detected is determined by applying \a mode + to items that are compared to this item, i.e., each item's shape + or bounding rectangle is checked against this item's shape. The + default value for \a mode is Qt::IntersectsItemShape. - \sa QGraphicsScene::collidingItems(), collidesWithItem() + \sa collidesWithItem() */ QList QGraphicsItem::collidingItems(Qt::ItemSelectionMode mode) const { -- cgit v0.12 From ec8fef8f17ac69bacc3d250a0d5932c336276bc5 Mon Sep 17 00:00:00 2001 From: Benjamin C Meyer Date: Tue, 5 May 2009 20:00:12 -0400 Subject: QNetworkDiskCache: check if opening file succeeds In QNetworkDiskCache::prepare() When QTemporaryFile::open fails, delete the cache item and return 0 rather then returning a closed device. And a spelling mistake in a qWarning() Reviewed-by: Peter Hartmann --- src/network/access/qnetworkdiskcache.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index 93360c8..892929e 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -191,7 +191,11 @@ QIODevice *QNetworkDiskCache::prepare(const QNetworkCacheMetaData &metaData) } else { QString templateName = d->tmpCacheFileName(); cacheItem->file = new QTemporaryFile(templateName, &cacheItem->data); - cacheItem->file->open(); + if (!cacheItem->file->open()) { + qWarning() << "QNetworkDiskCache::prepare() unable to open temporary file"; + delete cacheItem; + return 0; + } cacheItem->writeHeader(cacheItem->file); device = cacheItem->file; } @@ -229,7 +233,7 @@ void QNetworkDiskCachePrivate::storeItem(QCacheItem *cacheItem) if (QFile::exists(fileName)) { if (!QFile::remove(fileName)) { - qWarning() << "QNetworkDiskCache: could't remove the cache file " << fileName; + qWarning() << "QNetworkDiskCache: couldn't remove the cache file " << fileName; return; } } -- cgit v0.12 From 92f2815bf45a67ec8c6b94ca26fb8598a07a6de2 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Wed, 6 May 2009 16:48:55 +0200 Subject: Doc: Added info on NOTIFY to the Q_PROPERTY docs. Task-number: 248336 --- doc/src/properties.qdoc | 7 ++++++- doc/src/snippets/code/doc_src_properties.qdoc | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/src/properties.qdoc b/doc/src/properties.qdoc index 0775b12..d934f13 100644 --- a/doc/src/properties.qdoc +++ b/doc/src/properties.qdoc @@ -89,7 +89,12 @@ and QWidget::setCursor(), and it also has a \c RESET function, QWidget::unsetCursor(), since no call to QWidget::setCursor() can mean \e {reset to the context specific cursor}. The \c RESET - function musrt return void and take no parameters. + function must return void and take no parameters. + + \o A \c NOTIFY signal is optional. If defined, the signal will be + emitted whenever the value of the property changes. The signal must + take one parameter, which must be of the same type as the property; the + parameter will take the new value of the property. \o The \c DESIGNABLE attribute indicates whether the property should be visible in the property editor of GUI design tool (e.g., diff --git a/doc/src/snippets/code/doc_src_properties.qdoc b/doc/src/snippets/code/doc_src_properties.qdoc index ba7f79b..377cc9c 100644 --- a/doc/src/snippets/code/doc_src_properties.qdoc +++ b/doc/src/snippets/code/doc_src_properties.qdoc @@ -3,6 +3,7 @@ Q_PROPERTY(type name READ getFunction [WRITE setFunction] [RESET resetFunction] + [NOTIFY notifySignal] [DESIGNABLE bool] [SCRIPTABLE bool] [STORED bool] -- cgit v0.12 From 67c2b69d45eb43078b7e4193ced6cd513602483c Mon Sep 17 00:00:00 2001 From: Bjoern Erik Nilsen Date: Wed, 6 May 2009 16:32:01 +0200 Subject: Crash in QWidget::render when passing an untransformed QPixmap painter. The crash only occurred on Windows and X11 when running with -graphicssystem raster. The reason is that the actual paint device in QRasterPaintEngine::begin() is changed to pixmap->data->buffer(), which means QPaintEngine::paintDevice() returns something else than what it was told to paint on (see cb0c899b56b84154f69ddc545991bc6ded96ab01) The root of the problem, however, was that we used a weird condition (painter->worldMatrixEnabled(), added in 345072b9 for Qt 4.4) to find the target device. We did that because the shared painter was completely different in 4.4. We refactored it in 4.5.0, and we can only trust QPaintEngine::paintDevice to be the target device. Auto-test included. Task-number: 252837 Reviewed-by: Trond --- src/gui/kernel/qwidget.cpp | 2 +- tests/auto/qwidget/tst_qwidget.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index fb9c8cb..b96d8b3 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -4805,7 +4805,7 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset, Q_ASSERT(engine); QPaintEnginePrivate *enginePriv = engine->d_func(); Q_ASSERT(enginePriv); - QPaintDevice *target = painter->worldMatrixEnabled() ? engine->paintDevice() : painter->device(); + QPaintDevice *target = engine->paintDevice(); Q_ASSERT(target); // Render via a pixmap when dealing with non-opaque painters or printers. diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index dee48a3..5896df9 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -287,6 +287,7 @@ private slots: void render_systemClip2(); void render_systemClip3_data(); void render_systemClip3(); + void render_task252837(); void setContentsMargins(); @@ -7097,6 +7098,16 @@ void tst_QWidget::render_systemClip3() } } +void tst_QWidget::render_task252837() +{ + QWidget widget; + widget.resize(200, 200); + + QPixmap pixmap(widget.size()); + QPainter painter(&pixmap); + // Please do not crash. + widget.render(&painter); +} void tst_QWidget::setContentsMargins() { QLabel label("why does it always rain on me?"); -- cgit v0.12 From 9f7e8dcd408f8a082d6b8355c78c692d71becbb8 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 4 May 2009 14:29:39 +0200 Subject: Fix crash in QWebView when application has a style sheet Task: 252796 Rev-By: Tor Arne --- src/gui/styles/qstylesheetstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 058660e..714b8c5 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -4926,7 +4926,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op case CT_LineEdit: #ifndef QT_NO_SPINBOX // ### hopelessly broken QAbstractSpinBox (part 2) - if (QAbstractSpinBox *spinBox = qobject_cast(w->parentWidget())) { + if (QAbstractSpinBox *spinBox = qobject_cast(w ? w->parentWidget() : 0)) { QRenderRule rule = renderRule(spinBox, opt); if (rule.hasBox() || !rule.hasNativeBorder()) return csz; -- cgit v0.12 From a86c2b58d80b0688b98d0eaf243508a096f699b1 Mon Sep 17 00:00:00 2001 From: Nils Christian Roscher-Nielsen Date: Wed, 6 May 2009 17:42:51 +0200 Subject: Fixed typo in README file Reviewed-by: David Boddie --- examples/phonon/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/phonon/README b/examples/phonon/README index d0f4462..51213cb 100644 --- a/examples/phonon/README +++ b/examples/phonon/README @@ -1,4 +1,4 @@ -Qt usese the Phonon cross-platform multimedia framework to play common +Qt uses the Phonon cross-platform multimedia framework to play common multimedia formats. Applications can be written to take advantage of the native multimedia -- cgit v0.12 From 42e10c0dda9acfb3a5344bd20172898e7ed2846d Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 6 May 2009 10:50:02 -0700 Subject: Make Scale public Needed for fallback warnings Reviewed-by: TrustMe --- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 6d8f617..18e0d55 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -211,6 +211,8 @@ static QCache imageCache(4*1024*1024); // 4 MB class QDirectFBPaintEnginePrivate : public QRasterPaintEnginePrivate { public: + enum Scale { NoScale, Scaled, NegativeScale }; + QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p); ~QDirectFBPaintEnginePrivate(); @@ -266,7 +268,7 @@ private: bool simplePen; bool matrixRotShear; - enum Scale { NoScale, Scaled, NegativeScale } scale; + Scale scale; SurfaceCache *surfaceCache; QTransform transform; -- cgit v0.12 From df83ea844e2254723cbd9fabf91586cbad0756a3 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 6 May 2009 11:35:28 -0700 Subject: Pass the scale parameter as an int. We're just printout out the integer value anyway. Reviewed-by: TrustMe --- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 18e0d55..91a60e7 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -80,7 +80,7 @@ template inline const T *ptr(const T &t) { return &t; } template <> inline const bool* ptr(const bool &) { return 0; } template static void rasterFallbackWarn(const char *msg, const char *func, const device *dev, - QDirectFBPaintEnginePrivate::Scale scale, bool matrixRotShear, bool simplePen, + int scale, bool matrixRotShear, bool simplePen, bool dfbHandledClip, bool forceRasterPrimitives, const char *nameOne, const T1 &one, const char *nameTwo, const T2 &two, -- cgit v0.12 From 311978919f63c2c23dd09b4743ff12cf2a8a47bb Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 6 May 2009 14:23:03 -0700 Subject: Improved debug output for directfb:debug Include info on the primary surface pixelformat. Reviewed-by: TrustMe --- src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 25e24fd..f571d1b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -818,7 +818,7 @@ static const QByteArray flagDescriptions(uint mask, const FlagDescription *flags -static void printDirectFBInfo(IDirectFB *fb) +static void printDirectFBInfo(IDirectFB *fb, IDirectFBSurface *primarySurface) { DFBResult result; DFBGraphicsDeviceDescription dev; @@ -829,10 +829,14 @@ static void printDirectFBInfo(IDirectFB *fb) return; } - qDebug("Device: %s (%s), Driver: %s v%i.%i (%s)\n" + DFBSurfacePixelFormat pixelFormat; + primarySurface->GetPixelFormat(primarySurface, &pixelFormat); + + qDebug("Device: %s (%s), Driver: %s v%i.%i (%s) Pixelformat: %d (%d)\n" "acceleration: 0x%x%s\nblit: 0x%x%s\ndraw: 0x%0x%s\nvideo: %iKB\n", dev.name, dev.vendor, dev.driver.name, dev.driver.major, - dev.driver.minor, dev.driver.vendor, dev.acceleration_mask, + dev.driver.minor, dev.driver.vendor, DFB_PIXELFORMAT_INDEX(pixelFormat), + QDirectFBScreen::getImageFormat(primarySurface), dev.acceleration_mask, ::flagDescriptions(dev.acceleration_mask, accelerationDescriptions).constData(), dev.blitting_flags, ::flagDescriptions(dev.blitting_flags, blitDescriptions).constData(), dev.drawing_flags, ::flagDescriptions(dev.drawing_flags, drawDescriptions).constData(), @@ -883,9 +887,6 @@ bool QDirectFBScreen::connect(const QString &displaySpec) return false; } - if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive)) - printDirectFBInfo(d_ptr->dfb); - if (displayArgs.contains(QLatin1String("videoonly"), Qt::CaseInsensitive)) d_ptr->directFBFlags |= VideoOnly; @@ -952,6 +953,9 @@ bool QDirectFBScreen::connect(const QString &displaySpec) return false; } + if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive)) + printDirectFBInfo(d_ptr->dfb, d_ptr->dfbSurface); + // Work out what format we're going to use for surfaces with an alpha channel d_ptr->alphaPixmapFormat = QDirectFBScreen::getImageFormat(d_ptr->dfbSurface); setPixelFormat(d_ptr->alphaPixmapFormat); -- cgit v0.12 From a83d4edbb27ca5394e97de6387f9bdc1fc0d98ae Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 6 May 2009 16:43:52 -0700 Subject: Use proper ways to create "window" surface Reviewed-by: TrustMe --- src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index f1e3c84..8c64293 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -178,15 +178,7 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask) "Unable to get DirectFB handle!"); } - DFBSurfaceDescription description; - description.flags = DFBSurfaceDescriptionFlags(DSDESC_WIDTH | - DSDESC_HEIGHT | - DSDESC_PIXELFORMAT); - description.width = rect.width(); - description.height = rect.height(); - QDirectFBScreen::initSurfaceDescriptionPixelFormat(&description, - screen->pixelFormat()); - dfbSurface = screen->createDFBSurface(description, false); + dfbSurface = screen->createDFBSurface(rect.size(), screen->pixelFormat(), QDirectFBScreen::DontTrackSurface); forceRaster = (dfbSurface && QDirectFBScreen::getImageFormat(dfbSurface) == QImage::Format_RGB32); } else { Q_ASSERT(dfbSurface); -- cgit v0.12 From 0d8434ecfec5a088bc0c755964dae1dfcb35305e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Thu, 7 May 2009 09:41:35 +0200 Subject: Fix configure error on Mac with "-arch x86" STRING="${STRING/x86/i386}" actually replaces whole words only, so we don't need to fixup x86_64 afterwards. Reviewed-by: nrc --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index 20bf457..bd77174 100755 --- a/configure +++ b/configure @@ -2717,7 +2717,6 @@ if [ "$PLATFORM_MAC" = "yes" ]; then # Build commmand line arguments we can pass to the compiler during configure tests # by prefixing each arch with "-arch". CFG_MAC_ARCHS_GCC_FORMAT="${CFG_MAC_ARCHS/x86/i386}" - CFG_MAC_ARCHS_GCC_FORMAT="${CFG_MAC_ARCHS/i386_64/x86_64}" for ARCH in $CFG_MAC_ARCHS_GCC_FORMAT; do MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch $ARCH" done -- cgit v0.12 From 83566cfac942c8ca7620cf95ae47655d6ff475c3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 5 May 2009 20:48:46 +0200 Subject: Make QDBusPendingCallWatcher emit a signal if it is created on an already-finished call. This fixes a bit of a "surprise" when calling a local method (which returns and finishes immediately) or when by accident calling a function that returns QDBusReply instead of QDBusPendingCall/Reply. Reviewed-by: Trust Me --- src/dbus/qdbuspendingcall.cpp | 10 ++- .../auto/qdbuspendingcall/tst_qdbuspendingcall.cpp | 73 ++++++++++++++++++++++ 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp index 9753bbe..955f4a0 100644 --- a/src/dbus/qdbuspendingcall.cpp +++ b/src/dbus/qdbuspendingcall.cpp @@ -432,9 +432,14 @@ inline void QDBusPendingCallWatcherPrivate::_q_finished() QDBusPendingCallWatcher::QDBusPendingCallWatcher(const QDBusPendingCall &call, QObject *parent) : QObject(*new QDBusPendingCallWatcherPrivate, parent), QDBusPendingCall(call) { - if (d) { - if (!d->watcherHelper) + if (d) { // QDBusPendingCall::d + if (!d->watcherHelper) { d->watcherHelper = new QDBusPendingCallWatcherHelper; + if (isFinished()) { + // cause a signal emission anyways + QMetaObject::invokeMethod(d->watcherHelper, "finished", Qt::QueuedConnection); + } + } d->watcherHelper->add(this); } } @@ -464,6 +469,7 @@ void QDBusPendingCallWatcher::waitForFinished() d->waitForFinished(); // our signals were queued, so deliver them + QCoreApplication::sendPostedEvents(d->watcherHelper, QEvent::MetaCall); QCoreApplication::sendPostedEvents(this, QEvent::MetaCall); } } diff --git a/tests/auto/qdbuspendingcall/tst_qdbuspendingcall.cpp b/tests/auto/qdbuspendingcall/tst_qdbuspendingcall.cpp index 58707f1..947e8d6 100644 --- a/tests/auto/qdbuspendingcall/tst_qdbuspendingcall.cpp +++ b/tests/auto/qdbuspendingcall/tst_qdbuspendingcall.cpp @@ -90,6 +90,8 @@ private Q_SLOTS: void watcher(); void watcher_error(); void watcher_waitForFinished(); + void watcher_waitForFinished_alreadyFinished(); + void watcher_waitForFinished_alreadyFinished_eventLoop(); void watcher_waitForFinished_error(); void callInsideWaitForFinished(); @@ -375,6 +377,77 @@ void tst_QDBusPendingCall::watcher_waitForFinished() QVERIFY(args2.at(0).toStringList().contains(conn.baseService())); } +void tst_QDBusPendingCall::watcher_waitForFinished_alreadyFinished() +{ + QDBusPendingCall ac = sendMessage(); + QVERIFY(!ac.isFinished()); + QVERIFY(!ac.isError()); + QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage); + + ac.waitForFinished(); + QVERIFY(ac.isFinished()); + QVERIFY(!ac.isError()); + + callCount = 0; + watchArgument = 0; + + // create a watcher on an already-finished reply + QDBusPendingCallWatcher watch(ac); + connect(&watch, SIGNAL(finished(QDBusPendingCallWatcher*)), + SLOT(finished(QDBusPendingCallWatcher*))); + + watch.waitForFinished(); + + QVERIFY(ac.isFinished()); + QVERIFY(!ac.isError()); + + QCOMPARE(callCount, 1); + QCOMPARE(slotCalled, (int)FinishCalled); + QCOMPARE(watchArgument, &watch); + QVERIFY(!watch.isError()); + + const QVariantList args2 = ac.reply().arguments(); + QVERIFY(!args2.isEmpty()); + QVERIFY(args2.at(0).toStringList().contains(conn.baseService())); +} + +void tst_QDBusPendingCall::watcher_waitForFinished_alreadyFinished_eventLoop() +{ + QDBusPendingCall ac = sendMessage(); + QVERIFY(!ac.isFinished()); + QVERIFY(!ac.isError()); + QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage); + + ac.waitForFinished(); + QVERIFY(ac.isFinished()); + QVERIFY(!ac.isError()); + + callCount = 0; + watchArgument = 0; + + // create a watcher on an already-finished reply + QDBusPendingCallWatcher watch(ac); + connect(&watch, SIGNAL(finished(QDBusPendingCallWatcher*)), + SLOT(finished(QDBusPendingCallWatcher*))); + connect(&watch, SIGNAL(finished(QDBusPendingCallWatcher*)), + &QTestEventLoop::instance(), SLOT(exitLoop())); + + QTestEventLoop::instance().enterLoop(1); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(ac.isFinished()); + QVERIFY(!ac.isError()); + + QCOMPARE(callCount, 1); + QCOMPARE(slotCalled, (int)FinishCalled); + QCOMPARE(watchArgument, &watch); + QVERIFY(!watch.isError()); + + const QVariantList args2 = ac.reply().arguments(); + QVERIFY(!args2.isEmpty()); + QVERIFY(args2.at(0).toStringList().contains(conn.baseService())); +} + void tst_QDBusPendingCall::watcher_waitForFinished_error() { QDBusPendingCall ac = sendError(); -- cgit v0.12 From 2fddd3c9b7e45b58b56fec9b89c78af0a8f75731 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 6 May 2009 13:47:24 +0200 Subject: Clarify documentation in QNetworkProxy about SOCKS5 supporting domain name resolution Task-number: 252761 --- src/network/kernel/qnetworkproxy.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index f4ece97..5a00840 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -86,10 +86,11 @@ The SOCKS5 support in Qt 4 is based on \l{RFC 1928} and \l{RFC 1929}. The supported authentication methods are no authentication and username/password authentication. Both IPv4 and IPv6 are - supported, but domain name resolution via the SOCKS server is not - supported; i.e. all domain names are resolved locally. There are - several things to remember when using SOCKS5 with QUdpSocket and - QTcpServer: + supported. Domain names are resolved through the SOCKS5 server if + the QNetworkProxy::HostNameLookupCapability is enabled, otherwise + they are resolved locally and the IP address is sent to the + server. There are several things to remember when using SOCKS5 + with QUdpSocket and QTcpServer: With QUdpSocket, a call to \l {QUdpSocket::bind()}{bind()} may fail with a timeout error. If a port number other than 0 is passed to -- cgit v0.12 From 03b29811a3a6eb34421c476d829075505aa42ada Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 6 May 2009 14:30:21 +0200 Subject: Make QNetworkProxy calculate the capabilities for a new proxy type If you write: QNetworkProxy proxy; proxy.setType(QNetworkProxy::HttpProxy); Then now QNetworkProxy will set the capabilities to the default value for the new proxy type. Previously, it wouldn't do that: default values were set only for the type passed in the constructor. Reviewed-by: Peter Hartmann --- src/network/kernel/qnetworkproxy.cpp | 13 +++++++--- tests/auto/qnetworkproxy/tst_qnetworkproxy.cpp | 33 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index 5a00840..62bdfc7 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -366,7 +366,8 @@ static QNetworkProxy::Capabilities defaultCapabilitiesForType(QNetworkProxy::Pro int(QNetworkProxy::HostNameLookupCapability)), }; - Q_ASSERT(int(type) >= 0 && int(type) <= int(QNetworkProxy::FtpCachingProxy)); + if (int(type) < 0 && int(type) > int(QNetworkProxy::FtpCachingProxy)) + type = QNetworkProxy::DefaultProxy; return QNetworkProxy::Capabilities(defaults[int(type)]); } @@ -379,6 +380,7 @@ public: QNetworkProxy::Capabilities capabilities; quint16 port; QNetworkProxy::ProxyType type; + bool capabilitiesSet; inline QNetworkProxyPrivate(QNetworkProxy::ProxyType t = QNetworkProxy::DefaultProxy, const QString &h = QString(), quint16 p = 0, @@ -388,7 +390,8 @@ public: password(pw), capabilities(defaultCapabilitiesForType(t)), port(p), - type(t) + type(t), + capabilitiesSet(false) { } inline bool operator==(const QNetworkProxyPrivate &other) const @@ -491,13 +494,16 @@ QNetworkProxy &QNetworkProxy::operator=(const QNetworkProxy &other) Sets the proxy type for this instance to be \a type. Note that changing the type of a proxy does not change - the set of capabilities this QNetworkProxy object holds. + the set of capabilities this QNetworkProxy object holds if any + capabilities have been set with setCapabilities(). \sa type(), setCapabilities() */ void QNetworkProxy::setType(QNetworkProxy::ProxyType type) { d->type = type; + if (!d->capabilitiesSet) + d->capabilities = defaultCapabilitiesForType(type); } /*! @@ -520,6 +526,7 @@ QNetworkProxy::ProxyType QNetworkProxy::type() const void QNetworkProxy::setCapabilities(Capabilities capabilities) { d->capabilities = capabilities; + d->capabilitiesSet = true; } /*! diff --git a/tests/auto/qnetworkproxy/tst_qnetworkproxy.cpp b/tests/auto/qnetworkproxy/tst_qnetworkproxy.cpp index 31a5391..0760ce8 100644 --- a/tests/auto/qnetworkproxy/tst_qnetworkproxy.cpp +++ b/tests/auto/qnetworkproxy/tst_qnetworkproxy.cpp @@ -59,6 +59,7 @@ public: private slots: void getSetCheck(); + void capabilitiesPerType(); }; tst_QNetworkProxy::tst_QNetworkProxy() @@ -79,6 +80,38 @@ void tst_QNetworkProxy::getSetCheck() QCOMPARE(quint16(0), obj1.port()); obj1.setPort(quint16(0xffff)); QCOMPARE(quint16(0xffff), obj1.port()); + + obj1.setType(QNetworkProxy::DefaultProxy); + QCOMPARE(obj1.type(), QNetworkProxy::DefaultProxy); + obj1.setType(QNetworkProxy::HttpProxy); + QCOMPARE(obj1.type(), QNetworkProxy::HttpProxy); + obj1.setType(QNetworkProxy::Socks5Proxy); + QCOMPARE(obj1.type(), QNetworkProxy::Socks5Proxy); +} + +void tst_QNetworkProxy::capabilitiesPerType() +{ + QNetworkProxy proxy(QNetworkProxy::Socks5Proxy); + QVERIFY(proxy.capabilities() & QNetworkProxy::TunnelingCapability); + QVERIFY(proxy.capabilities() & QNetworkProxy::HostNameLookupCapability); + QVERIFY(proxy.capabilities() & QNetworkProxy::UdpTunnelingCapability); + + proxy.setType(QNetworkProxy::NoProxy); + // verify that the capabilities changed + QVERIFY(!(proxy.capabilities() & QNetworkProxy::HostNameLookupCapability)); + QVERIFY(proxy.capabilities() & QNetworkProxy::UdpTunnelingCapability); + + proxy.setType(QNetworkProxy::HttpProxy); + QVERIFY(proxy.capabilities() & QNetworkProxy::HostNameLookupCapability); + QVERIFY(!(proxy.capabilities() & QNetworkProxy::UdpTunnelingCapability)); + + // now set the capabilities on stone: + proxy.setCapabilities(QNetworkProxy::TunnelingCapability | QNetworkProxy::UdpTunnelingCapability); + QCOMPARE(proxy.capabilities(), QNetworkProxy::TunnelingCapability | QNetworkProxy::UdpTunnelingCapability); + + // changing the type shouldn't change the capabilities any more + proxy.setType(QNetworkProxy::Socks5Proxy); + QCOMPARE(proxy.capabilities(), QNetworkProxy::TunnelingCapability | QNetworkProxy::UdpTunnelingCapability); } QTEST_MAIN(tst_QNetworkProxy) -- cgit v0.12 From 846f47d0fa98942e6df22cd7b6dbf594aaf116f5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 6 May 2009 14:31:49 +0200 Subject: Fix OpenSSL dynamic loading on OpenBSD. OpenBSD's OpenSSL libraries are linked in a bizarre way: libssl.so doesn't link to libcrypto.so, even though it depends on it. I don't claim to understand why, but they do it. So make sure we export its symbols for libssl to see and we load libcrypto first. Task-number: 252042 Patch by: Marc Espie Reviewed-by: Peter Hartmann --- src/network/ssl/qsslsocket_openssl_symbols.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index e09e764..42c09f5 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -364,11 +364,14 @@ static QPair loadOpenSsl() // DT_RPATH tags on our library header as well as other system-specific search // paths. See the man page for dlopen(3) on your system for more information. +#ifdef Q_OS_OPENBSD + libcrypto->setLoadHints(QLibrary::ExportExternalSymbolsHint); +#endif #ifdef SHLIB_VERSION_NUMBER // first attempt: the canonical name is libssl.so. libssl->setFileNameAndVersion(QLatin1String("ssl"), QLatin1String(SHLIB_VERSION_NUMBER)); libcrypto->setFileNameAndVersion(QLatin1String("crypto"), QLatin1String(SHLIB_VERSION_NUMBER)); - if (libssl->load() && libcrypto->load()) { + if (libcrypto->load() && libssl->load()) { // libssl.so. and libcrypto.so. found return pair; } else { @@ -380,7 +383,7 @@ static QPair loadOpenSsl() // second attempt: find the development files libssl.so and libcrypto.so libssl->setFileNameAndVersion(QLatin1String("ssl"), -1); libcrypto->setFileNameAndVersion(QLatin1String("crypto"), -1); - if (libssl->load() && libcrypto->load()) { + if (libcrypto->load() && libssl->load()) { // libssl.so.0 and libcrypto.so.0 found return pair; } else { @@ -395,7 +398,7 @@ static QPair loadOpenSsl() crypto.replace(QLatin1String("ssl"), QLatin1String("crypto")); libssl->setFileNameAndVersion(ssl, -1); libcrypto->setFileNameAndVersion(crypto, -1); - if (libssl->load() && libcrypto->load()) { + if (libcrypto->load() && libssl->load()) { // libssl.so.0 and libcrypto.so.0 found return pair; } else { -- cgit v0.12 From b7803b824905b115c8e4cfc38e353c707fbaad17 Mon Sep 17 00:00:00 2001 From: kh Date: Thu, 7 May 2009 11:25:17 +0200 Subject: Cleanup, no functional change. --- .../tools/assistant/preferencesdialog.cpp | 127 +++++++++++++-------- 1 file changed, 79 insertions(+), 48 deletions(-) diff --git a/tools/assistant/tools/assistant/preferencesdialog.cpp b/tools/assistant/tools/assistant/preferencesdialog.cpp index 094bd9c..233f44a 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.cpp +++ b/tools/assistant/tools/assistant/preferencesdialog.cpp @@ -59,36 +59,38 @@ QT_BEGIN_NAMESPACE PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, QWidget *parent) : QDialog(parent) + , m_helpEngine(helpEngine) , m_appFontChanged(false) , m_browserFontChanged(false) { - m_helpEngine = helpEngine; m_ui.setupUi(this); - connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), - SIGNAL(clicked()), this, SLOT(applyChanges())); - connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), - SIGNAL(clicked()), this, SLOT(reject())); + connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), + this, SLOT(applyChanges())); + connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), + this, SLOT(reject())); - m_hideFiltersTab = !m_helpEngine->customValue(QLatin1String("EnableFilterFunctionality"), - true).toBool(); - m_hideDocsTab = !m_helpEngine->customValue(QLatin1String("EnableDocumentationManager"), - true).toBool(); + QLatin1String key("EnableFilterFunctionality"); + m_hideFiltersTab = !m_helpEngine->customValue(key, true).toBool(); + + key = QLatin1String("EnableDocumentationManager"); + m_hideDocsTab = !m_helpEngine->customValue(key, true).toBool(); if (!m_hideFiltersTab) { m_ui.attributeWidget->header()->hide(); m_ui.attributeWidget->setRootIsDecorated(false); + connect(m_ui.attributeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(updateFilterMap())); connect(m_ui.filterWidget, - SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), - this, SLOT(updateAttributes(QListWidgetItem*))); + SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, + SLOT(updateAttributes(QListWidgetItem*))); - connect(m_ui.filterAddButton, SIGNAL(clicked()), - this, SLOT(addFilter())); - connect(m_ui.filterRemoveButton, SIGNAL(clicked()), - this, SLOT(removeFilter())); + connect(m_ui.filterAddButton, SIGNAL(clicked()), this, + SLOT(addFilter())); + connect(m_ui.filterRemoveButton, SIGNAL(clicked()), this, + SLOT(removeFilter())); updateFilterPage(); } else { @@ -106,22 +108,34 @@ PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, QWidget *paren } else { m_ui.tabWidget->removeTab(m_ui.tabWidget->indexOf(m_ui.docsTab)); } + updateFontSettingsPage(); updateOptionsPage(); } PreferencesDialog::~PreferencesDialog() { + QLatin1String key(""); if (m_appFontChanged) { - m_helpEngine->setCustomValue(QLatin1String("appFont"), m_appFontPanel->selectedFont()); - m_helpEngine->setCustomValue(QLatin1String("useAppFont"), m_appFontPanel->isChecked()); - m_helpEngine->setCustomValue(QLatin1String("appWritingSystem"), m_appFontPanel->writingSystem()); + key = QLatin1String("appFont"); + m_helpEngine->setCustomValue(key, m_appFontPanel->selectedFont()); + + key = QLatin1String("useAppFont"); + m_helpEngine->setCustomValue(key, m_appFontPanel->isChecked()); + + key = QLatin1String("appWritingSystem"); + m_helpEngine->setCustomValue(key, m_appFontPanel->writingSystem()); } if (m_browserFontChanged) { - m_helpEngine->setCustomValue(QLatin1String("browserFont"), m_browserFontPanel->selectedFont()); - m_helpEngine->setCustomValue(QLatin1String("useBrowserFont"), m_browserFontPanel->isChecked()); - m_helpEngine->setCustomValue(QLatin1String("browserWritingSystem"), m_browserFontPanel->writingSystem()); + key = QLatin1String("browserFont"); + m_helpEngine->setCustomValue(key, m_browserFontPanel->selectedFont()); + + key = QLatin1String("useBrowserFont"); + m_helpEngine->setCustomValue(key, m_browserFontPanel->isChecked()); + + key = QLatin1String("browserWritingSystem"); + m_helpEngine->setCustomValue(key, m_browserFontPanel->writingSystem()); } if (m_appFontChanged || m_browserFontChanged) { @@ -129,8 +143,10 @@ PreferencesDialog::~PreferencesDialog() emit updateBrowserFont(); } - if (!m_ui.homePageLineEdit->text().isEmpty()) - m_helpEngine->setCustomValue(QLatin1String("homepage"), m_ui.homePageLineEdit->text()); + if (!m_ui.homePageLineEdit->text().isEmpty()) { + key = QLatin1String("homepage"); + m_helpEngine->setCustomValue(key, m_ui.homePageLineEdit->text()); + } } void PreferencesDialog::showDialog() @@ -173,7 +189,7 @@ void PreferencesDialog::updateAttributes(QListWidgetItem *item) if (item) checkedList = m_filterMap.value(item->text()); QTreeWidgetItem *itm; - for (int i=0; itopLevelItemCount(); ++i) { + for (int i = 0; i < m_ui.attributeWidget->topLevelItemCount(); ++i) { itm = m_ui.attributeWidget->topLevelItem(i); if (checkedList.contains(itm->text(0))) itm->setCheckState(0, Qt::Checked); @@ -192,7 +208,7 @@ void PreferencesDialog::updateFilterMap() QStringList newAtts; QTreeWidgetItem *itm = 0; - for (int i=0; itopLevelItemCount(); ++i) { + for (int i = 0; i < m_ui.attributeWidget->topLevelItemCount(); ++i) { itm = m_ui.attributeWidget->topLevelItem(i); if (itm->checkState(0) == Qt::Checked) newAtts.append(itm->text(0)); @@ -219,8 +235,8 @@ void PreferencesDialog::addFilter() void PreferencesDialog::removeFilter() { - QListWidgetItem *item = m_ui.filterWidget - ->takeItem(m_ui.filterWidget->currentRow()); + QListWidgetItem *item = + m_ui.filterWidget ->takeItem(m_ui.filterWidget->currentRow()); if (!item) return; @@ -362,35 +378,50 @@ void PreferencesDialog::updateFontSettingsPage() m_ui.stackedWidget_2->setCurrentIndex(0); const QString customSettings(tr("Use custom settings")); - QFont font = qVariantValue(m_helpEngine->customValue(QLatin1String("appFont"))); - QFontDatabase::WritingSystem writingSystem = static_cast - (m_helpEngine->customValue(QLatin1String("appWritingSystem")).toInt()); - m_appFontPanel->setTitle(customSettings); + + QLatin1String key = QLatin1String("appFont"); + QFont font = qVariantValue(m_helpEngine->customValue(key)); m_appFontPanel->setSelectedFont(font); - m_appFontPanel->setWritingSystem(writingSystem); - m_appFontPanel->setChecked(m_helpEngine->customValue(QLatin1String("useAppFont")).toBool()); - QFont font2 = qVariantValue(m_helpEngine->customValue(QLatin1String("browserFont"))); - writingSystem = static_cast - (m_helpEngine->customValue(QLatin1String("browserWritingSystem")).toInt()); + key = QLatin1String("appWritingSystem"); + QFontDatabase::WritingSystem system = static_cast + (m_helpEngine->customValue(key).toInt()); + m_appFontPanel->setWritingSystem(system); + + key = QLatin1String("useAppFont"); + m_appFontPanel->setChecked(m_helpEngine->customValue(key).toBool()); m_browserFontPanel->setTitle(customSettings); - m_browserFontPanel->setSelectedFont(font2); - m_browserFontPanel->setWritingSystem(writingSystem); - m_browserFontPanel->setChecked(m_helpEngine->customValue(QLatin1String("useBrowserFont")).toBool()); - connect(m_appFontPanel, SIGNAL(toggled(bool)), this, SLOT(appFontSettingToggled(bool))); - connect(m_browserFontPanel, SIGNAL(toggled(bool)), this, SLOT(browserFontSettingToggled(bool))); + key = QLatin1String("browserFont"); + font = qVariantValue(m_helpEngine->customValue(key)); + m_browserFontPanel->setSelectedFont(font); + + key = QLatin1String("browserWritingSystem"); + system = static_cast + (m_helpEngine->customValue(key).toInt()); + m_browserFontPanel->setWritingSystem(system); + + key = QLatin1String("useBrowserFont"); + m_browserFontPanel->setChecked(m_helpEngine->customValue(key).toBool()); + + connect(m_appFontPanel, SIGNAL(toggled(bool)), this, + SLOT(appFontSettingToggled(bool))); + connect(m_browserFontPanel, SIGNAL(toggled(bool)), this, + SLOT(browserFontSettingToggled(bool))); QList allCombos = qFindChildren(m_appFontPanel); - foreach (QComboBox* box, allCombos) - connect(box, SIGNAL(currentIndexChanged(int)), this, SLOT(appFontSettingChanged(int))); + foreach (QComboBox* box, allCombos) { + connect(box, SIGNAL(currentIndexChanged(int)), this, + SLOT(appFontSettingChanged(int))); + } - allCombos.clear(); allCombos = qFindChildren(m_browserFontPanel); - foreach (QComboBox* box, allCombos) - connect(box, SIGNAL(currentIndexChanged(int)), this, SLOT(browserFontSettingChanged(int))); + foreach (QComboBox* box, allCombos) { + connect(box, SIGNAL(currentIndexChanged(int)), this, + SLOT(browserFontSettingChanged(int))); + } } void PreferencesDialog::appFontSettingToggled(bool on) @@ -436,8 +467,8 @@ void PreferencesDialog::updateOptionsPage() void PreferencesDialog::restoreDefaultHomepage() { - QString homepage = m_helpEngine->customValue( - QLatin1String("defaultHomepage"), QLatin1String("help")).toString(); + QString homepage = m_helpEngine->customValue(QLatin1String("defaultHomepage"), + QLatin1String("help")).toString(); m_ui.homePageLineEdit->setText(homepage); } -- cgit v0.12 From acd6ac49150a126a08afd864210d0627487c6d3d Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 7 May 2009 11:41:23 +0200 Subject: Fix strange context menu related bug on Windows Mobile Fixes 245347 again and does not trigger 252319 Task-number: 245347 Reviewed-by: Maurice --- src/gui/kernel/qlayout.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qlayout.cpp b/src/gui/kernel/qlayout.cpp index 1d5a70d..4463aab 100644 --- a/src/gui/kernel/qlayout.cpp +++ b/src/gui/kernel/qlayout.cpp @@ -1028,8 +1028,13 @@ void QLayout::freeze(int w, int h) void QLayout::setMenuBar(QWidget *widget) { Q_D(QLayout); - if (widget) - addChildWidget(widget); + +#ifdef Q_OS_WINCE_WM + if (widget && widget->size().height() > 0) +#else + if (widget) +#endif + addChildWidget(widget); d->menubar = widget; } -- cgit v0.12 From 4f00772e4e02433d6231f2c6c64cf7d97dccf4f9 Mon Sep 17 00:00:00 2001 From: kh Date: Thu, 7 May 2009 11:53:30 +0200 Subject: Implement new cmd option to remove the full text search index. --- tools/assistant/tools/assistant/cmdlineparser.cpp | 9 ++++++ tools/assistant/tools/assistant/cmdlineparser.h | 2 ++ tools/assistant/tools/assistant/main.cpp | 35 +++++++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/tools/assistant/tools/assistant/cmdlineparser.cpp b/tools/assistant/tools/assistant/cmdlineparser.cpp index 0dae785..67eaa44 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.cpp +++ b/tools/assistant/tools/assistant/cmdlineparser.cpp @@ -56,6 +56,7 @@ CmdLineParser::CmdLineParser() m_bookmarks(Untouched), m_search(Untouched), m_register(None), + m_removeSearchIndex(false), m_copy(false), m_quiet(false) { @@ -83,6 +84,7 @@ CmdLineParser::CmdLineParser() " (.qch) from the give collection\n" " file.\n" "-setCurrentFilter filter Set the filter as the active filter.\n" + "-remove-search-index Removes the full text search index.\n" "-quiet Does not display any error or\n" " status message.\n" "-help Displays this help.\n" @@ -217,6 +219,8 @@ CmdLineParser::Result CmdLineParser::parse(const QStringList &arguments) error = QObject::tr("Missing filter argument!"); break; } + } else if (arg == QLatin1String("-remove-search-index")) { + m_removeSearchIndex = true; } else if (arg == QLatin1String("-quiet")) { continue; } else if (arg == QLatin1String("-help")) { @@ -307,6 +311,11 @@ QString CmdLineParser::currentFilter() const return m_currentFilter; } +bool CmdLineParser::removeSearchIndex() const +{ + return m_removeSearchIndex; +} + CmdLineParser::RegisterState CmdLineParser::registerRequest() const { return m_register; diff --git a/tools/assistant/tools/assistant/cmdlineparser.h b/tools/assistant/tools/assistant/cmdlineparser.h index 332d464..263138b 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.h +++ b/tools/assistant/tools/assistant/cmdlineparser.h @@ -67,6 +67,7 @@ public: ShowState bookmarks() const; ShowState search() const; QString currentFilter() const; + bool removeSearchIndex() const; RegisterState registerRequest() const; QString helpFile() const; @@ -90,6 +91,7 @@ private: ShowState m_search; RegisterState m_register; QString m_currentFilter; + bool m_removeSearchIndex; bool m_copy; bool m_quiet; }; diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index 794be02..75955ec 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -52,6 +52,8 @@ #include +#include + #include #include "mainwindow.h" @@ -166,6 +168,17 @@ referencedHelpFilesExistAll(QHelpEngineCore& user, QStringList& nameSpaces) return (counter != nameSpaces.count()) ? false : true; } +QString indexFilesFolder(const QString &collectionFile) +{ + QString indexFilesFolder = QLatin1String(".fulltextsearch"); + if (!collectionFile.isEmpty()) { + QFileInfo fi(collectionFile); + indexFilesFolder = QLatin1Char('.') + + fi.fileName().left(fi.fileName().lastIndexOf(QLatin1String(".qhc"))); + } + return indexFilesFolder; +} + int main(int argc, char *argv[]) { QApplication a(argc, argv); @@ -212,6 +225,28 @@ int main(int argc, char *argv[]) return 0; } + if (cmd.removeSearchIndex()) { + QString file = cmdCollectionFile; + if (file.isEmpty()) + file = MainWindow::defaultHelpCollectionFileName(); + QString path = QFileInfo(file).path(); + path += QLatin1String("/") + indexFilesFolder(file); + + QLocalSocket localSocket; + localSocket.connectToServer(QString(QLatin1String("QtAssistant%1")) + .arg(QLatin1String(QT_VERSION_STR))); + + QDir dir(path); // check if there is no other instance ruinning + if (!localSocket.waitForConnected() && dir.exists()) { + QStringList lst = dir.entryList(QDir::Files | QDir::Hidden); + foreach (const QString &item, lst) + dir.remove(item); + return 0; + } else { + return -1; + } + } + { QSqlDatabase db; QStringList sqlDrivers(db.drivers()); -- cgit v0.12 From 52415f1bae93f2aa10ea00bbbd88e835d3a91c6e Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Thu, 7 May 2009 12:15:49 +0200 Subject: Ensure that small and mini spin boxes are drawn correctly. When we fixed the stuff for normal spin boxes, we neglected to tweak the small and mini variants. We now adjust pixels for them as well. Task-number: 252301 Reviewed-by: Jens Bache-Wiig --- src/gui/styles/qmacstyle_mac.mm | 96 ++++++++++++++++++++++++----------------- 1 file changed, 57 insertions(+), 39 deletions(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index c973b41..7a870fe 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -549,7 +549,6 @@ extern QPaintDevice *qt_mac_safe_pdev; //qapplication_mac.cpp QMacCGStyle globals *****************************************************************************/ const int qt_mac_hitheme_version = 0; //the HITheme version we speak -const int macSpinBoxSep = 5; // distance between spinwidget and the lineedit const int macItemFrame = 2; // menu item frame width const int macItemHMargin = 3; // menu item hor text margin const int macItemVMargin = 2; // menu item ver text margin @@ -2376,7 +2375,14 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW break; case PM_SpinBoxFrameWidth: GetThemeMetric(kThemeMetricEditTextFrameOutset, &ret); - ret += 2; + switch (d->aquaSizeConstrain(opt, widget)) { + default: + ret += 2; + break; + case QAquaSizeMini: + ret += 1; + break; + } break; case PM_ButtonShiftHorizontal: case PM_ButtonShiftVertical: @@ -5017,11 +5023,10 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex bdi.kind = kThemeIncDecButton; break; case QAquaSizeMini: + bdi.kind = kThemeIncDecButtonMini; + break; case QAquaSizeSmall: - if (aquaSize == QAquaSizeMini) - bdi.kind = kThemeIncDecButtonMini; - else - bdi.kind = kThemeIncDecButtonSmall; + bdi.kind = kThemeIncDecButtonSmall; break; } if (!(sb->stepEnabled & (QAbstractSpinBox::StepUpEnabled @@ -5041,8 +5046,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex bdi.value = kThemeButtonOff; bdi.adornment = kThemeAdornmentNone; - QRect updown = subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, - widget); + QRect updown = subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget); + updown |= subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget); HIRect newRect = qt_hirectForQRect(updown); QRect off_rct; @@ -5053,15 +5058,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex int(outRect.size.width - newRect.size.width), int(outRect.size.height - newRect.size.height)); - // HIThemeGetButtonBackgroundBounds offsets non-focused normal sized - // buttons by one in de y direction, account for that here. - if (bdi.adornment == kThemeAdornmentNone && bdi.kind == kThemeIncDecButton) - off_rct.adjust(0, 1, 0, 0); - - // Adjust the rect for small buttos also. - if (bdi.adornment == kThemeAdornmentFocus && bdi.kind == kThemeIncDecButtonSmall) - off_rct.adjust(0, 0, 0, -1); - newRect = qt_hirectForQRect(updown, off_rct); HIThemeDrawButton(&newRect, &bdi, cg, kHIThemeOrientationNormal, 0); } @@ -5726,39 +5722,61 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op break; case CC_SpinBox: if (const QStyleOptionSpinBox *spin = qstyleoption_cast(opt)) { - const int spinner_w = 14, - fw = pixelMetric(PM_SpinBoxFrameWidth, spin, widget); + QAquaWidgetSize aquaSize = d->aquaSizeConstrain(spin, widget); + int spinner_w; + int spinBoxSep; + int fw = pixelMetric(PM_SpinBoxFrameWidth, spin, widget); + switch (aquaSize) { + default: + case QAquaSizeUnknown: + case QAquaSizeLarge: + spinner_w = 14; + spinBoxSep = 2; + break; + case QAquaSizeSmall: + spinner_w = 12; + spinBoxSep = 2; + break; + case QAquaSizeMini: + spinner_w = 10; + spinBoxSep = 1; + break; + } + switch (sc) { case SC_SpinBoxUp: case SC_SpinBoxDown: { if (spin->buttonSymbols == QAbstractSpinBox::NoButtons) break; - const int frameWidth = pixelMetric(PM_SpinBoxFrameWidth, spin, widget); - const int spinner_w = 18; - const int y = frameWidth; - const int x = spin->rect.width() - spinner_w + frameWidth; + + const int y = fw; + const int x = spin->rect.width() - spinner_w; ret.setRect(x + spin->rect.x(), y + spin->rect.y(), spinner_w, spin->rect.height() - y * 2); HIThemeButtonDrawInfo bdi; bdi.version = qt_mac_hitheme_version; bdi.kind = kThemeIncDecButton; - QAquaWidgetSize aquaSize = d->aquaSizeConstrain(opt, widget); + int hackTranslateX; switch (aquaSize) { - case QAquaSizeUnknown: - case QAquaSizeLarge: - bdi.kind = kThemeIncDecButton; - break; - case QAquaSizeMini: - case QAquaSizeSmall: - if (aquaSize == QAquaSizeMini) - bdi.kind = kThemeIncDecButtonMini; - else - bdi.kind = kThemeIncDecButtonSmall; - break; + default: + case QAquaSizeUnknown: + case QAquaSizeLarge: + bdi.kind = kThemeIncDecButton; + hackTranslateX = 0; + break; + case QAquaSizeSmall: + bdi.kind = kThemeIncDecButtonSmall; + hackTranslateX = -2; + break; + case QAquaSizeMini: + bdi.kind = kThemeIncDecButtonMini; + hackTranslateX = -1; + break; } bdi.state = kThemeStateActive; bdi.value = kThemeButtonOff; bdi.adornment = kThemeAdornmentNone; HIRect hirect = qt_hirectForQRect(ret); + HIRect outRect; HIThemeGetButtonBackgroundBounds(&hirect, &bdi, &outRect); ret = qt_qrectForHIRect(outRect); @@ -5773,13 +5791,13 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op Q_ASSERT(0); break; } - ret.translate(-1, -2); // hack: position the buttons correctly (weird that we need this) + ret.translate(hackTranslateX, 0); // hack: position the buttons correctly (weird that we need this) ret = visualRect(spin->direction, spin->rect, ret); break; } case SC_SpinBoxEditField: ret.setRect(fw, fw, - spin->rect.width() - spinner_w - fw * 2 - macSpinBoxSep + 1, + spin->rect.width() - spinner_w - fw * 2 - spinBoxSep, spin->rect.height() - fw * 2); ret = visualRect(spin->direction, spin->rect, ret); break; @@ -5811,8 +5829,8 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, switch (ct) { case QStyle::CT_SpinBox: - sz.setWidth(sz.width() + macSpinBoxSep); - sz.setHeight(sz.height() - 3); // hack to work around horrible sizeHint() code in QAbstractSpinBox + // hack to work around horrible sizeHint() code in QAbstractSpinBox + sz.setHeight(sz.height() - 3); break; case QStyle::CT_TabBarTab: if (const QStyleOptionTabV3 *tab = qstyleoption_cast(opt)) { -- cgit v0.12 From b67a06392ce4e6ad844db857210e502044e94c18 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 7 May 2009 13:07:25 +0200 Subject: qdoc: Moved platform-specific qdoc comments to common .cpp file. When building docs for the mac, qdoc comments for functions defined in the .h file were not found in any of the .cpp files in the mac package because they were in the x11 or windows .cpp file. So I moved them to a .cpp file that is in all the packages. Task-number: 252496 252492 --- src/gui/kernel/qapplication.cpp | 131 ++++++++++++++++++ src/gui/kernel/qapplication_qws.cpp | 69 ---------- src/gui/kernel/qapplication_win.cpp | 8 -- src/gui/kernel/qapplication_x11.cpp | 42 ------ src/gui/painting/qpaintdevice_qws.cpp | 3 - src/gui/painting/qpaintdevice_win.cpp | 5 - src/gui/painting/qpaintdevice_x11.cpp | 216 ----------------------------- src/gui/painting/qpainter.cpp | 248 ++++++++++++++++++++++++++++++++++ 8 files changed, 379 insertions(+), 343 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index d0b1790..f3bd57b 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -4998,6 +4998,137 @@ bool QApplicationPrivate::shouldSetFocus(QWidget *w, Qt::FocusPolicy policy) return true; } +/*! \fn QDecoration &QApplication::qwsDecoration() + Return the QWSDecoration used for decorating windows. + + \warning This method is non-portable. It is only available in + Qt for Embedded Linux. + + \sa QDecoration +*/ + +/*! + \fn void QApplication::qwsSetDecoration(QDecoration *decoration) + + Sets the QDecoration derived class to use for decorating the + windows used by Qt for Embedded Linux to the \a decoration + specified. + + This method is non-portable. It is only available in Qt for Embedded Linux. + + \sa QDecoration +*/ + +/*! \fn QDecoration* QApplication::qwsSetDecoration(const QString &decoration) + \overload + + Requests a QDecoration object for \a decoration from the QDecorationFactory. + + The string must be one of the QDecorationFactory::keys(). Keys are + case insensitive. + + A later call to the QApplication constructor will override the + requested style when a "-style" option is passed in as a commandline + parameter. + + Returns 0 if an unknown \a decoration is passed, otherwise the QStyle object + returned is set as the application's GUI style. +*/ + +/*! + \fn bool QApplication::qwsEventFilter(QWSEvent *event) + + This virtual function is only implemented under Qt for Embedded Linux. + + If you create an application that inherits QApplication and + reimplement this function, you get direct access to all QWS (Q + Window System) events that the are received from the QWS master + process. The events are passed in the \a event parameter. + + Return true if you want to stop the event from being processed. + Return false for normal event dispatching. The default + implementation returns false. +*/ + +/*! \fn void QApplication::qwsSetCustomColors(QRgb *colorTable, int start, int numColors) + Set Qt for Embedded Linux custom color table. + + Qt for Embedded Linux on 8-bpp displays allocates a standard 216 color cube. + The remaining 40 colors may be used by setting a custom color + table in the QWS master process before any clients connect. + + \a colorTable is an array of up to 40 custom colors. \a start is + the starting index (0-39) and \a numColors is the number of colors + to be set (1-40). + + This method is non-portable. It is available \e only in + Qt for Embedded Linux. + + \note The custom colors will not be used by the default screen + driver. To make use of the new colors, implement a custom screen + driver, or use QDirectPainter. +*/ + +/*! \fn int QApplication::qwsProcessEvent(QWSEvent* event) + \internal +*/ + +/*! \fn int QApplication::x11ClientMessage(QWidget* w, XEvent* event, bool passive_only) + \internal +*/ + +/*! \fn int QApplication::x11ProcessEvent(XEvent* event) + This function does the core processing of individual X + \a{event}s, normally by dispatching Qt events to the right + destination. + + It returns 1 if the event was consumed by special handling, 0 if + the \a event was consumed by normal handling, and -1 if the \a + event was for an unrecognized widget. + + \sa x11EventFilter() +*/ + +/*! + \fn bool QApplication::x11EventFilter(XEvent *event) + + \warning This virtual function is only implemented under X11. + + If you create an application that inherits QApplication and + reimplement this function, you get direct access to all X events + that the are received from the X server. The events are passed in + the \a event parameter. + + Return true if you want to stop the event from being processed. + Return false for normal event dispatching. The default + implementation returns false. + + It is only the directly addressed messages that are filtered. + You must install an event filter directly on the event + dispatcher, which is returned by + QAbstractEventDispatcher::instance(), to handle system wide + messages. + + \sa x11ProcessEvent() +*/ + +/*! \fn void QApplication::winFocus(QWidget *widget, bool gotFocus) + \internal + \since 4.1 + + If \a gotFocus is true, \a widget will become the active window. + Otherwise the active window is reset to 0. +*/ + +/*! \fn void QApplication::winMouseButtonUp() + \internal + */ + +/*! \fn void QApplication::syncX() + Synchronizes with the X server in the X11 implementation. + This normally takes some time. Does nothing on other platforms. +*/ + QT_END_NAMESPACE #include "moc_qapplication.cpp" diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp index 2deda8e..018440f 100644 --- a/src/gui/kernel/qapplication_qws.cpp +++ b/src/gui/kernel/qapplication_qws.cpp @@ -2675,9 +2675,6 @@ void QApplication::alert(QWidget *, int) { } -/*! - \internal -*/ int QApplication::qwsProcessEvent(QWSEvent* event) { Q_D(QApplication); @@ -3056,43 +3053,11 @@ int QApplication::qwsProcessEvent(QWSEvent* event) return 0; } -/*! - \fn bool QApplication::qwsEventFilter(QWSEvent *event) - - This virtual function is only implemented under Qt for Embedded Linux. - - If you create an application that inherits QApplication and - reimplement this function, you get direct access to all QWS (Q - Window System) events that the are received from the QWS master - process. The events are passed in the \a event parameter. - - Return true if you want to stop the event from being processed. - Return false for normal event dispatching. The default - implementation returns false. -*/ bool QApplication::qwsEventFilter(QWSEvent *) { return false; } -/*! - Set Qt for Embedded Linux custom color table. - - Qt for Embedded Linux on 8-bpp displays allocates a standard 216 color cube. - The remaining 40 colors may be used by setting a custom color - table in the QWS master process before any clients connect. - - \a colorTable is an array of up to 40 custom colors. \a start is - the starting index (0-39) and \a numColors is the number of colors - to be set (1-40). - - This method is non-portable. It is available \e only in - Qt for Embedded Linux. - - \note The custom colors will not be used by the default screen - driver. To make use of the new colors, implement a custom screen - driver, or use QDirectPainter. -*/ void QApplication::qwsSetCustomColors(QRgb *colorTable, int start, int numColors) { if (start < 0 || start > 39) { @@ -3111,30 +3076,11 @@ void QApplication::qwsSetCustomColors(QRgb *colorTable, int start, int numColors } #ifndef QT_NO_QWS_MANAGER -/*! - Return the QWSDecoration used for decorating windows. - - \warning This method is non-portable. It is only available in - Qt for Embedded Linux. - - \sa QDecoration -*/ QDecoration &QApplication::qwsDecoration() { return *qws_decoration; } -/*! - \fn void QApplication::qwsSetDecoration(QDecoration *decoration) - - Sets the QDecoration derived class to use for decorating the - windows used by Qt for Embedded Linux to the \a decoration - specified. - - This method is non-portable. It is only available in Qt for Embedded Linux. - - \sa QDecoration -*/ void QApplication::qwsSetDecoration(QDecoration *dec) { if (dec) { @@ -3153,21 +3099,6 @@ void QApplication::qwsSetDecoration(QDecoration *dec) } } -/*! - \overload - - Requests a QDecoration object for \a decoration from the QDecorationFactory. - - The string must be one of the QDecorationFactory::keys(). Keys are - case insensitive. - - A later call to the QApplication constructor will override the - requested style when a "-style" option is passed in as a commandline - parameter. - - Returns 0 if an unknown \a decoration is passed, otherwise the QStyle object - returned is set as the application's GUI style. -*/ QDecoration* QApplication::qwsSetDecoration(const QString &decoration) { QDecoration *decore = QDecorationFactory::create(decoration); diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index bc32c14..065e7ff 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -1371,13 +1371,6 @@ QString QApplicationPrivate::appName() const extern uint qGlobalPostedEventsCount(); -/*! - \internal - \since 4.1 - - If \a gotFocus is true, \a widget will become the active window. - Otherwise the active window is reset to 0. -*/ void QApplication::winFocus(QWidget *widget, bool gotFocus) { if (d_func()->inPopupMode()) // some delayed focus event to ignore @@ -2921,7 +2914,6 @@ void qt_win_eatMouseMove() // In DnD, the mouse release event never appears, so the // mouse button state machine must be manually reset -/*! \internal */ void QApplication::winMouseButtonUp() { qt_button_down = 0; diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 15149a5..a3c9406 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -2976,11 +2976,6 @@ QWidget *QApplication::topLevelAt(const QPoint &p) #endif } -/*! - Synchronizes with the X server in the X11 implementation. This - normally takes some time. Does nothing on other platforms. -*/ - void QApplication::syncX() { if (X11->display) @@ -3086,9 +3081,6 @@ static QETWidget *qPRFindWidget(Window oldwin) return wPRmapper ? (QETWidget*)wPRmapper->value((int)oldwin, 0) : 0; } -/*! - \internal -*/ int QApplication::x11ClientMessage(QWidget* w, XEvent* event, bool passive_only) { if (w && !w->internalWinId()) @@ -3151,17 +3143,6 @@ int QApplication::x11ClientMessage(QWidget* w, XEvent* event, bool passive_only) return 0; } -/*! - This function does the core processing of individual X - \a{event}s, normally by dispatching Qt events to the right - destination. - - It returns 1 if the event was consumed by special handling, 0 if - the \a event was consumed by normal handling, and -1 if the \a - event was for an unrecognized widget. - - \sa x11EventFilter() -*/ int QApplication::x11ProcessEvent(XEvent* event) { Q_D(QApplication); @@ -3843,29 +3824,6 @@ int QApplication::x11ProcessEvent(XEvent* event) return 0; } -/*! - \fn bool QApplication::x11EventFilter(XEvent *event) - - \warning This virtual function is only implemented under X11. - - If you create an application that inherits QApplication and - reimplement this function, you get direct access to all X events - that the are received from the X server. The events are passed in - the \a event parameter. - - Return true if you want to stop the event from being processed. - Return false for normal event dispatching. The default - implementation returns false. - - It is only the directly addressed messages that are filtered. - You must install an event filter directly on the event - dispatcher, which is returned by - QAbstractEventDispatcher::instance(), to handle system wide - messages. - - \sa x11ProcessEvent() -*/ - bool QApplication::x11EventFilter(XEvent *) { return false; diff --git a/src/gui/painting/qpaintdevice_qws.cpp b/src/gui/painting/qpaintdevice_qws.cpp index 6a68d28..c67be86 100644 --- a/src/gui/painting/qpaintdevice_qws.cpp +++ b/src/gui/painting/qpaintdevice_qws.cpp @@ -81,9 +81,6 @@ int QPaintDevice::metric(PaintDeviceMetric m) const } } -/*! - \internal -*/ QWSDisplay *QPaintDevice::qwsDisplay() { return qt_fbdpy; diff --git a/src/gui/painting/qpaintdevice_win.cpp b/src/gui/painting/qpaintdevice_win.cpp index 6cae744..7cd3392 100644 --- a/src/gui/painting/qpaintdevice_win.cpp +++ b/src/gui/painting/qpaintdevice_win.cpp @@ -71,16 +71,11 @@ int QPaintDevice::metric(PaintDeviceMetric) const return 0; } - -/*! \internal -*/ HDC QPaintDevice::getDC() const { return 0; } -/*! \internal -*/ void QPaintDevice::releaseDC(HDC) const { } diff --git a/src/gui/painting/qpaintdevice_x11.cpp b/src/gui/painting/qpaintdevice_x11.cpp index 4ea9f57..95cb115 100644 --- a/src/gui/painting/qpaintdevice_x11.cpp +++ b/src/gui/painting/qpaintdevice_x11.cpp @@ -106,33 +106,11 @@ int QPaintDevice::metric(PaintDeviceMetric) const #ifdef QT3_SUPPORT -/*! - Use QX11Info::display() instead. - - \oldcode - Display *display = widget->x11Display(); - \newcode - Display *display = QX11Info::display(); - \endcode - - \sa QWidget::x11Info(), QX11Info::display() -*/ Display *QPaintDevice::x11Display() const { return X11->display; } -/*! - Use QX11Info::screen() instead. - - \oldcode - int screen = widget->x11Screen(); - \newcode - int screen = widget->x11Info().screen(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11Screen() const { const QX11Info *info = qt_x11Info(this); @@ -141,17 +119,6 @@ int QPaintDevice::x11Screen() const return QX11Info::appScreen(); } -/*! - Use QX11Info::visual() instead. - - \oldcode - void *visual = widget->x11Visual(); - \newcode - void *visual = widget->x11Info().visual(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ void *QPaintDevice::x11Visual() const { const QX11Info *info = qt_x11Info(this); @@ -160,17 +127,6 @@ void *QPaintDevice::x11Visual() const return QX11Info::appVisual(); } -/*! - Use QX11Info::depth() instead. - - \oldcode - int depth = widget->x11Depth(); - \newcode - int depth = widget->x11Info().depth(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11Depth() const { const QX11Info *info = qt_x11Info(this); @@ -179,17 +135,6 @@ int QPaintDevice::x11Depth() const return QX11Info::appDepth(); } -/*! - Use QX11Info::cells() instead. - - \oldcode - int cells = widget->x11Cells(); - \newcode - int cells = widget->x11Info().cells(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11Cells() const { const QX11Info *info = qt_x11Info(this); @@ -198,17 +143,6 @@ int QPaintDevice::x11Cells() const return QX11Info::appCells(); } -/*! - Use QX11Info::colormap() instead. - - \oldcode - unsigned long screen = widget->x11Colormap(); - \newcode - unsigned long screen = widget->x11Info().colormap(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ Qt::HANDLE QPaintDevice::x11Colormap() const { const QX11Info *info = qt_x11Info(this); @@ -217,17 +151,6 @@ Qt::HANDLE QPaintDevice::x11Colormap() const return QX11Info::appColormap(); } -/*! - Use QX11Info::defaultColormap() instead. - - \oldcode - bool isDefault = widget->x11DefaultColormap(); - \newcode - bool isDefault = widget->x11Info().defaultColormap(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ bool QPaintDevice::x11DefaultColormap() const { const QX11Info *info = qt_x11Info(this); @@ -236,17 +159,6 @@ bool QPaintDevice::x11DefaultColormap() const return QX11Info::appDefaultColormap(); } -/*! - Use QX11Info::defaultVisual() instead. - - \oldcode - bool isDefault = widget->x11DefaultVisual(); - \newcode - bool isDefault = widget->x11Info().defaultVisual(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ bool QPaintDevice::x11DefaultVisual() const { const QX11Info *info = qt_x11Info(this); @@ -255,176 +167,48 @@ bool QPaintDevice::x11DefaultVisual() const return QX11Info::appDefaultVisual(); } -/*! - Use QX11Info::visual() instead. - - \oldcode - void *visual = QPaintDevice::x11AppVisual(screen); - \newcode - void *visual = qApp->x11Info(screen).visual(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ void *QPaintDevice::x11AppVisual(int screen) { return QX11Info::appVisual(screen); } -/*! - Use QX11Info::colormap() instead. - - \oldcode - unsigned long colormap = QPaintDevice::x11AppColormap(screen); - \newcode - unsigned long colormap = qApp->x11Info(screen).colormap(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ Qt::HANDLE QPaintDevice::x11AppColormap(int screen) { return QX11Info::appColormap(screen); } -/*! - Use QX11Info::display() instead. - - \oldcode - Display *display = QPaintDevice::x11AppDisplay(); - \newcode - Display *display = qApp->x11Info().display(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ Display *QPaintDevice::x11AppDisplay() { return QX11Info::display(); } -/*! - Use QX11Info::screen() instead. - - \oldcode - int screen = QPaintDevice::x11AppScreen(); - \newcode - int screen = qApp->x11Info().screen(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11AppScreen() { return QX11Info::appScreen(); } -/*! - Use QX11Info::depth() instead. - - \oldcode - int depth = QPaintDevice::x11AppDepth(screen); - \newcode - int depth = qApp->x11Info(screen).depth(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11AppDepth(int screen) { return QX11Info::appDepth(screen); } -/*! - Use QX11Info::cells() instead. - - \oldcode - int cells = QPaintDevice::x11AppCells(screen); - \newcode - int cells = qApp->x11Info(screen).cells(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11AppCells(int screen) { return QX11Info::appCells(screen); } -/*! - Use QX11Info::appRootWindow() instead. - - \oldcode - unsigned long window = QPaintDevice::x11AppRootWindow(screen); - \newcode - unsigned long window = qApp->x11Info(screen).appRootWindow(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ Qt::HANDLE QPaintDevice::x11AppRootWindow(int screen) { return QX11Info::appRootWindow(screen); } -/*! - Use QX11Info::defaultColormap() instead. - - \oldcode - bool isDefault = QPaintDevice::x11AppDefaultColormap(screen); - \newcode - bool isDefault = qApp->x11Info(screen).defaultColormap(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ bool QPaintDevice::x11AppDefaultColormap(int screen) { return QX11Info::appDefaultColormap(screen); } -/*! - Use QX11Info::defaultVisual() instead. - - \oldcode - bool isDefault = QPaintDevice::x11AppDefaultVisual(screen); - \newcode - bool isDefault = qApp->x11Info(screen).defaultVisual(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ bool QPaintDevice::x11AppDefaultVisual(int screen) { return QX11Info::appDefaultVisual(screen); } -/*! - Use QX11Info::setAppDpiX() instead. -*/ void QPaintDevice::x11SetAppDpiX(int dpi, int screen) { QX11Info::setAppDpiX(dpi, screen); } -/*! - Use QX11Info::setAppDpiY() instead. -*/ void QPaintDevice::x11SetAppDpiY(int dpi, int screen) { QX11Info::setAppDpiY(dpi, screen); } - -/*! - Use QX11Info::appDpiX() instead. - - \oldcode - bool isDefault = QPaintDevice::x11AppDpiX(screen); - \newcode - bool isDefault = qApp->x11Info(screen).appDpiX(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11AppDpiX(int screen) { return QX11Info::appDpiX(screen); } -/*! - Use QX11Info::appDpiY() instead. - - \oldcode - bool isDefault = QPaintDevice::x11AppDpiY(screen); - \newcode - bool isDefault = qApp->x11Info(screen).appDpiY(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11AppDpiY(int screen) { return QX11Info::appDpiY(screen); diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index afc4211..baa9ce3 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -8571,4 +8571,252 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat p->draw_helper(path, operation); } +/*! \fn Display *QPaintDevice::x11Display() const + Use QX11Info::display() instead. + + \oldcode + Display *display = widget->x11Display(); + \newcode + Display *display = QX11Info::display(); + \endcode + + \sa QWidget::x11Info(), QX11Info::display() +*/ + +/*! \fn int QPaintDevice::x11Screen() const + Use QX11Info::screen() instead. + + \oldcode + int screen = widget->x11Screen(); + \newcode + int screen = widget->x11Info().screen(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn void *QPaintDevice::x11Visual() const + Use QX11Info::visual() instead. + + \oldcode + void *visual = widget->x11Visual(); + \newcode + void *visual = widget->x11Info().visual(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn int QPaintDevice::x11Depth() const + Use QX11Info::depth() instead. + + \oldcode + int depth = widget->x11Depth(); + \newcode + int depth = widget->x11Info().depth(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn int QPaintDevice::x11Cells() const + Use QX11Info::cells() instead. + + \oldcode + int cells = widget->x11Cells(); + \newcode + int cells = widget->x11Info().cells(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn Qt::HANDLE QPaintDevice::x11Colormap() const + Use QX11Info::colormap() instead. + + \oldcode + unsigned long screen = widget->x11Colormap(); + \newcode + unsigned long screen = widget->x11Info().colormap(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn bool QPaintDevice::x11DefaultColormap() const + Use QX11Info::defaultColormap() instead. + + \oldcode + bool isDefault = widget->x11DefaultColormap(); + \newcode + bool isDefault = widget->x11Info().defaultColormap(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn bool QPaintDevice::x11DefaultVisual() const + Use QX11Info::defaultVisual() instead. + + \oldcode + bool isDefault = widget->x11DefaultVisual(); + \newcode + bool isDefault = widget->x11Info().defaultVisual(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn void *QPaintDevice::x11AppVisual(int screen) + Use QX11Info::visual() instead. + + \oldcode + void *visual = QPaintDevice::x11AppVisual(screen); + \newcode + void *visual = qApp->x11Info(screen).visual(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn Qt::HANDLE QPaintDevice::x11AppColormap(int screen) + Use QX11Info::colormap() instead. + + \oldcode + unsigned long colormap = QPaintDevice::x11AppColormap(screen); + \newcode + unsigned long colormap = qApp->x11Info(screen).colormap(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn Display *QPaintDevice::x11AppDisplay() + Use QX11Info::display() instead. + + \oldcode + Display *display = QPaintDevice::x11AppDisplay(); + \newcode + Display *display = qApp->x11Info().display(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn int QPaintDevice::x11AppScreen() + Use QX11Info::screen() instead. + + \oldcode + int screen = QPaintDevice::x11AppScreen(); + \newcode + int screen = qApp->x11Info().screen(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn int QPaintDevice::x11AppDepth(int screen) + Use QX11Info::depth() instead. + + \oldcode + int depth = QPaintDevice::x11AppDepth(screen); + \newcode + int depth = qApp->x11Info(screen).depth(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn int QPaintDevice::x11AppCells(int screen) + Use QX11Info::cells() instead. + + \oldcode + int cells = QPaintDevice::x11AppCells(screen); + \newcode + int cells = qApp->x11Info(screen).cells(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn Qt::HANDLE QPaintDevice::x11AppRootWindow(int screen) + Use QX11Info::appRootWindow() instead. + + \oldcode + unsigned long window = QPaintDevice::x11AppRootWindow(screen); + \newcode + unsigned long window = qApp->x11Info(screen).appRootWindow(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn bool QPaintDevice::x11AppDefaultColormap(int screen) + Use QX11Info::defaultColormap() instead. + + \oldcode + bool isDefault = QPaintDevice::x11AppDefaultColormap(screen); + \newcode + bool isDefault = qApp->x11Info(screen).defaultColormap(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn bool QPaintDevice::x11AppDefaultVisual(int screen) + Use QX11Info::defaultVisual() instead. + + \oldcode + bool isDefault = QPaintDevice::x11AppDefaultVisual(screen); + \newcode + bool isDefault = qApp->x11Info(screen).defaultVisual(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn void QPaintDevice::x11SetAppDpiX(int dpi, int screen) + Use QX11Info::setAppDpiX() instead. +*/ + +/*! \fn void QPaintDevice::x11SetAppDpiY(int dpi, int screen) + Use QX11Info::setAppDpiY() instead. +*/ + +/*! \fn int QPaintDevice::x11AppDpiX(int screen) + Use QX11Info::appDpiX() instead. + + \oldcode + bool isDefault = QPaintDevice::x11AppDpiX(screen); + \newcode + bool isDefault = qApp->x11Info(screen).appDpiX(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn int QPaintDevice::x11AppDpiY(int screen) + Use QX11Info::appDpiY() instead. + + \oldcode + bool isDefault = QPaintDevice::x11AppDpiY(screen); + \newcode + bool isDefault = qApp->x11Info(screen).appDpiY(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn HDC QPaintDevice::getDC() const + \internal +*/ + +/*! \fn void QPaintDevice::releaseDC(HDC) const + \internal +*/ + +/*! \fn QWSDisplay *QPaintDevice::qwsDisplay() + \internal +*/ + QT_END_NAMESPACE -- cgit v0.12 From 2841ac47dbd646539cc863a030be4a0ac6a077f4 Mon Sep 17 00:00:00 2001 From: Bjoern Erik Nilsen Date: Thu, 7 May 2009 13:08:45 +0200 Subject: Win: QLineEdit not updating correctly when embedded in Graphics View Updates triggered by the line edit itself, i.e. cursor blinking, are not processed after the top-level is resized. This is yet another problem caused by the event dispatcher on Windows (Qt posted events are not sent during top-level resize, task 146849). We added a work-around for that particular case by posting an event via Windows, but the widget is not visible on the screen (hidden from Windows' POV) so it'll never be posted. And of course then we'll never receive it and the backing store is not synced. This work-around is therefore useless for widgets that are not visible on the screen. However, not receiving update requests while resizing the top-level (in this case QGraphicsView), is not a problem for embedded widgets because all items and hence the proxied widgets are repainted by graphics view anyways. Task-number: 252400 Reviewed-by: Olivier --- src/gui/painting/qbackingstore.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index 8fb7a12..0a3a8dd 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -492,7 +492,8 @@ static inline void sendUpdateRequest(QWidget *widget, bool updateImmediately) return; #if defined(Q_WS_WIN) && !defined(Q_OS_WINCE) - if (QApplicationPrivate::inSizeMove && widget->internalWinId() && !updateImmediately) { + if (QApplicationPrivate::inSizeMove && widget->internalWinId() && !updateImmediately + && !widget->testAttribute(Qt::WA_DontShowOnScreen)) { // Tell Windows to send us a paint event if we're in WM_SIZE/WM_MOVE; posted events // are blocked until the mouse button is released. See task 146849. const QRegion rgn(qt_dirtyRegion(widget)); -- cgit v0.12 From 27aae6a5bb4858897547f2f436bc1cdf2e8bfbd4 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 7 May 2009 13:15:27 +0200 Subject: fix parsing cookies in multiple lines original patch by Benjamin Meyer. Handle multiple cookies split by new lines in a cleaner way. Parsing the combined string was error prone. Splitting them and sending each line through our header parser is more robust, and has more obvious code paths. Tested by logging into wordpress.com, facebook.com etc. Reviewed-by: Thiago Task-number: 251959 --- src/network/access/qnetworkcookie.cpp | 33 ++++++++++++++++----------------- src/network/access/qnetworkcookie_p.h | 1 + 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index 82c9344..67df526 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -913,6 +913,17 @@ static QDateTime parseDateString(const QByteArray &dateString) */ QList QNetworkCookie::parseCookies(const QByteArray &cookieString) { + // cookieString can be a number of set-cookie header strings joined together + // by \n, parse each line separately. + QList cookies; + QList list = cookieString.split('\n'); + for (int a = 0; a < list.size(); a++) + cookies += QNetworkCookiePrivate::parseSetCookieHeaderLine(list.at(a)); + return cookies; +} + +QList QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByteArray &cookieString) +{ // According to http://wp.netscape.com/newsref/std/cookie_spec.html,< // the Set-Cookie response header is of the format: // @@ -930,12 +941,6 @@ QList QNetworkCookie::parseCookies(const QByteArray &cookieStrin while (position < length) { QNetworkCookie cookie; - // When there are multiple SetCookie headers they are join with a new line - // \n will always be the start of a new cookie - int endOfSetCookie = cookieString.indexOf('\n', position); - if (endOfSetCookie == -1) - endOfSetCookie = length; - // The first part is always the "NAME=VALUE" part QPair field = nextField(cookieString, position); if (field.first.isEmpty() || field.second.isNull()) @@ -946,7 +951,7 @@ QList QNetworkCookie::parseCookies(const QByteArray &cookieStrin position = nextNonWhitespace(cookieString, position); bool endOfCookie = false; - while (!endOfCookie && position < endOfSetCookie) + while (!endOfCookie && position < length) { switch (cookieString.at(position++)) { case ',': // end of the cookie @@ -969,9 +974,7 @@ QList QNetworkCookie::parseCookies(const QByteArray &cookieStrin position = end; QDateTime dt = parseDateString(dateString.toLower()); if (!dt.isValid()) { - cookie = QNetworkCookie(); - endOfCookie = true; - continue; + return result; } cookie.setExpirationDate(dt); } else if (field.first == "domain") { @@ -988,8 +991,7 @@ QList QNetworkCookie::parseCookies(const QByteArray &cookieStrin bool ok = false; int secs = field.second.toInt(&ok); if (!ok) - // invalid cookie string - return QList(); + return result; cookie.setExpirationDate(now.addSecs(secs)); } else if (field.first == "path") { QString path = QUrl::fromPercentEncoding(field.second); @@ -1003,9 +1005,7 @@ QList QNetworkCookie::parseCookies(const QByteArray &cookieStrin } else if (field.first == "version") { if (field.second != "1") { // oops, we don't know how to handle this cookie - cookie = QNetworkCookie(); - endOfCookie = true; - continue; + return result; } } else { // got an unknown field in the cookie @@ -1013,9 +1013,8 @@ QList QNetworkCookie::parseCookies(const QByteArray &cookieStrin } position = nextNonWhitespace(cookieString, position); - if (position > endOfSetCookie) - endOfCookie = true; } + } if (!cookie.name().isEmpty()) result += cookie; diff --git a/src/network/access/qnetworkcookie_p.h b/src/network/access/qnetworkcookie_p.h index 83ef14a..0c41322 100644 --- a/src/network/access/qnetworkcookie_p.h +++ b/src/network/access/qnetworkcookie_p.h @@ -61,6 +61,7 @@ class QNetworkCookiePrivate: public QSharedData { public: inline QNetworkCookiePrivate() : secure(false), httpOnly(false) { } + static QList parseSetCookieHeaderLine(const QByteArray &cookieString); QDateTime expirationDate; QString domain; -- cgit v0.12 From 20d88b4d390e2e11079f62ab9f472c30f7c5b11d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 7 May 2009 13:12:39 +0200 Subject: Fixed some inconsistencies for image drawing on non-integer coords. The fix for 1x1 source rect image drawing in change ffbb3c1a2aee4134dce80cd144a26bf32865b698 was incorrect for transforms with type >= TxScale. The aliased coordinate delta needs to be applied in device coordinates, not in logical coordinates. Also specialize the non-antialiased TxScale case by simply calling fillRect_normalized directly, avoiding having to scan convert the rectangle manually. Task-number: 251561 Reviewed-by: Trond --- src/gui/painting/qpaintengine_raster.cpp | 19 ++++++++++++++++--- tests/arthur/data/qps/borderimage.qps | 19 +++++++++++++++++-- tests/arthur/data/qps/borderimage_qps.png | Bin 90704 -> 91838 bytes 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index cbfd5e3..847904b 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2575,9 +2575,10 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe if (!aa && sr.size() == QSize(1, 1)) { // as fillRect will apply the aliased coordinate delta we need to // subtract it here as we don't use it for image drawing - const QRectF targetRect = r.translated(-aliasedCoordinateDelta, - -aliasedCoordinateDelta); - fillRect(targetRect, QColor::fromRgba(img.pixel(sr.x(), sr.y()))); + QTransform old = s->matrix; + s->matrix = s->matrix * QTransform::fromTranslate(-aliasedCoordinateDelta, -aliasedCoordinateDelta); + fillRect(r, QColor::fromRgba(img.pixel(sr.x(), sr.y()))); + s->matrix = old; return; } @@ -2611,6 +2612,18 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe return; d->image_filler_xform.setupMatrix(copy, s->flags.bilinear); + if (!aa && s->matrix.type() == QTransform::TxScale) { + QRectF rr = s->matrix.mapRect(r); + + const int x1 = qRound(rr.x()); + const int y1 = qRound(rr.y()); + const int x2 = qRound(rr.right()); + const int y2 = qRound(rr.bottom()); + + fillRect_normalized(QRect(x1, y1, x2-x1, y2-y1), &d->image_filler_xform, d); + return; + } + #ifdef QT_FAST_SPANS ensureState(); if (s->flags.tx_noshear || s->matrix.type() == QTransform::TxScale) { diff --git a/tests/arthur/data/qps/borderimage.qps b/tests/arthur/data/qps/borderimage.qps index 14073fe..8d2e54b 100644 --- a/tests/arthur/data/qps/borderimage.qps +++ b/tests/arthur/data/qps/borderimage.qps @@ -123,6 +123,21 @@ end_block one_pixel_border resetMatrix +translate 205.1 626.1 +scale 0.4 0.4 + +repeat_block one_pixel_border + +resetMatrix + +translate 255.1 624.1 +scale 0.4 0.4 +rotate 10 + +repeat_block one_pixel_border + +resetMatrix + setPen red drawRect 0 0 70 680 @@ -145,5 +160,5 @@ drawText 174 114 "smoothpixmaptransform off" drawRect 164 128 224 134 drawText 174 252 "smoothpixmaptransform on" -drawRect 200 520 97 128 -drawText 210 638 "1x1 edges" +drawRect 200 520 97 188 +drawText 210 698 "1x1 edges" diff --git a/tests/arthur/data/qps/borderimage_qps.png b/tests/arthur/data/qps/borderimage_qps.png index a4ec6cb..ed51d5f 100644 Binary files a/tests/arthur/data/qps/borderimage_qps.png and b/tests/arthur/data/qps/borderimage_qps.png differ -- cgit v0.12 From f2fc8979cbeb732fe4799ec43d6d376aba0a87c9 Mon Sep 17 00:00:00 2001 From: kh Date: Thu, 7 May 2009 14:19:04 +0200 Subject: Make the error dialogs less annoying. Show only one instead of many. --- .../tools/assistant/preferencesdialog.cpp | 48 +++++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/tools/assistant/tools/assistant/preferencesdialog.cpp b/tools/assistant/tools/assistant/preferencesdialog.cpp index 233f44a..74f7ba8 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.cpp +++ b/tools/assistant/tools/assistant/preferencesdialog.cpp @@ -44,6 +44,7 @@ #include "installdialog.h" #include "fontpanel.h" #include "centralwidget.h" +#include "aboutdialog.h" #include @@ -52,6 +53,8 @@ #include #include #include +#include +#include #include @@ -254,25 +257,48 @@ void PreferencesDialog::addDocumentationLocal() if (fileNames.isEmpty()) return; + QStringList invalidFiles; + QStringList alreadyRegistered; foreach (const QString &fileName, fileNames) { - const QString ns = QHelpEngineCore::namespaceName(fileName); - if (ns.isEmpty()) { - QMessageBox::warning(this, tr("Add Documentation"), - tr("The specified file is not a valid Qt Help File!")); + const QString nameSpace = QHelpEngineCore::namespaceName(fileName); + if (nameSpace.isEmpty()) { + invalidFiles.append(fileName); continue; } - if (m_ui.registeredDocsListWidget->findItems(ns, Qt::MatchFixedString).count()) { - QMessageBox::warning(this, tr("Add Documentation"), - tr("The namespace %1 is already registered!").arg(ns)); - continue; + if (m_ui.registeredDocsListWidget->findItems(nameSpace, + Qt::MatchFixedString).count()) { + alreadyRegistered.append(nameSpace); + continue; } m_helpEngine->registerDocumentation(fileName); - m_ui.registeredDocsListWidget->addItem(ns); - m_regDocs.append(ns); - m_unregDocs.removeAll(ns); + m_ui.registeredDocsListWidget->addItem(nameSpace); + m_regDocs.append(nameSpace); + m_unregDocs.removeAll(nameSpace); + } + + if (!invalidFiles.isEmpty() || !alreadyRegistered.isEmpty()) { + QString message; + if (!alreadyRegistered.isEmpty()) { + foreach (const QString &ns, alreadyRegistered) { + message += tr("The namespace %1 is already registered!") + .arg(QString("%1").arg(ns)) + QLatin1String("
"); + } + if (!invalidFiles.isEmpty()) + message.append(QLatin1String("
")); + } + + if (!invalidFiles.isEmpty()) { + message += tr("The specified file is not a valid Qt Help File!"); + message.append(QLatin1String("
    ")); + foreach (const QString &file, invalidFiles) + message += QLatin1String("
  • ") + file + QLatin1String("
  • "); + message.append(QLatin1String("
")); + } + QMessageBox::warning(this, tr("Add Documentation"), message); } + updateFilterPage(); } -- cgit v0.12 From 12348ea833bf731a0a977cd201d6804c6f3af221 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 7 May 2009 14:54:05 +0200 Subject: handle the back soft key on Windows mobile SmartPhones We must tell the system that we want to intercept the back key on Windows mobile. Each toplevel widget that needs correct back key behaviour needs to have a menu bar. Why? Ask Microsoft... Task-number: 248846 Reviewed-by: thartman --- src/gui/kernel/qapplication_win.cpp | 15 +++++++++++++++ src/gui/widgets/qmenu_wince.cpp | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 065e7ff..f14ad6f 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -1725,6 +1725,21 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam // fall-through intended case WM_KEYUP: case WM_SYSKEYUP: +#if Q_OS_WINCE_WM + case WM_HOTKEY: + if(HIWORD(msg.lParam) == VK_TBACK) { + const bool hotKeyDown = !(LOWORD(msg.lParam) & MOD_KEYUP); + msg.lParam = 0x69 << 16; + msg.wParam = VK_BACK; + if (hotKeyDown) { + msg.message = WM_KEYDOWN; + qt_keymapper_private()->updateKeyMap(msg); + } else { + msg.message = WM_KEYUP; + } + } + // fall-through intended +#endif case WM_IME_CHAR: case WM_IME_KEYDOWN: case WM_CHAR: { diff --git a/src/gui/widgets/qmenu_wince.cpp b/src/gui/widgets/qmenu_wince.cpp index ea58d46..847a623 100644 --- a/src/gui/widgets/qmenu_wince.cpp +++ b/src/gui/widgets/qmenu_wince.cpp @@ -58,6 +58,9 @@ #include #include +#if Q_OS_WINCE_WM +# include +#endif #include "qguifunctions_wince.h" @@ -71,6 +74,12 @@ #define SHCMBM_GETSUBMENU (WM_USER + 401) #endif +#ifdef Q_OS_WINCE_WM +# define SHMBOF_NODEFAULT 0x00000001 +# define SHMBOF_NOTIFY 0x00000002 +# define SHCMBM_OVERRIDEKEY (WM_USER + 0x193) +#endif + extern bool qt_wince_is_smartphone();//defined in qguifunctions_wce.cpp extern bool qt_wince_is_pocket_pc(); //defined in qguifunctions_wce.cpp @@ -204,8 +213,13 @@ static HWND qt_wce_create_menubar(HWND parentHandle, HINSTANCE resourceHandle, i mbi.dwFlags = flags; mbi.nToolBarId = toolbarID; - if (ptrCreateMenuBar(&mbi)) + if (ptrCreateMenuBar(&mbi)) { + // Tell the menu bar that we want to override hot key behaviour. + LPARAM lparam = MAKELPARAM(SHMBOF_NODEFAULT | SHMBOF_NOTIFY, + SHMBOF_NODEFAULT | SHMBOF_NOTIFY); + SendMessage(mbi.hwndMB, SHCMBM_OVERRIDEKEY, VK_TBACK, lparam); return mbi.hwndMB; + } } return 0; } -- cgit v0.12 From afa7788e27ca388987993844f72a8182edbab70f Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Thu, 7 May 2009 15:43:24 +0200 Subject: Added types to the list. Added two missing types to the list. Task-number: 252274 --- doc/src/datastreamformat.qdoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/src/datastreamformat.qdoc b/doc/src/datastreamformat.qdoc index 3c651fb..67a3794 100644 --- a/doc/src/datastreamformat.qdoc +++ b/doc/src/datastreamformat.qdoc @@ -69,6 +69,10 @@ the application happens to be running on. \table + \row \o bool + \o \list + \o boolean + \endlist \row \o qint8 \o \list \o signed byte @@ -297,6 +301,12 @@ \o \list \o Milliseconds since midnight (quint32) \endlist + + \row \o QUrl + \o \list + \o Holds an URL (QString) + \endlist + \row \o QVariant \o \list \o The type of the data (quint32) -- cgit v0.12 From 6b715bc38fc2699c2fd03d18262c236061b9d22d Mon Sep 17 00:00:00 2001 From: Bjoern Erik Nilsen Date: Thu, 7 May 2009 14:58:30 +0200 Subject: Compiler warnings (Mac/Carbon) Reviewed-by: nrc --- src/gui/graphicsview/qgraphicsitem.cpp | 4 ++-- src/gui/painting/qdrawhelper.cpp | 3 +-- src/gui/painting/qwindowsurface_raster.cpp | 4 ++-- src/gui/text/qfont.cpp | 2 +- src/opengl/qglpixelbuffer_mac.mm | 3 +-- src/sql/drivers/odbc/qsql_odbc.cpp | 1 - src/xmlpatterns/expr/qapplytemplate.cpp | 3 +-- src/xmlpatterns/functions/qsequencefns.cpp | 3 +-- tools/assistant/tools/assistant/centralwidget.cpp | 2 +- 9 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 93cd7d9..30c15bc 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1225,8 +1225,8 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags) return; // Flags that alter the geometry of the item (or its children). - int geomChangeFlagsMask = (ItemClipsChildrenToShape | ItemClipsToShape | ItemIgnoresTransformations); - bool fullUpdate = (flags & geomChangeFlagsMask) != (d_ptr->flags & geomChangeFlagsMask); + const quint32 geomChangeFlagsMask = (ItemClipsChildrenToShape | ItemClipsToShape | ItemIgnoresTransformations); + bool fullUpdate = (quint32(flags) & geomChangeFlagsMask) != (d_ptr->flags & geomChangeFlagsMask); if (fullUpdate) d_ptr->fullUpdateHelper(false, true); diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index c11837a..9f2831d 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -2400,8 +2400,7 @@ static inline int color_burn_op(int dst, int src, int da, int sa) if (src == 0 || src_da + dst_sa <= sa_da) return qt_div_255(temp); - else - return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp); + return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp); } template diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index 7a74fe0..110ba2f 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -142,8 +142,7 @@ void QRasterWindowSurface::beginPaint(const QRegion &rgn) p.fillRect(*it, blank); } } -#endif -#if defined(Q_OS_WINCE) +#else Q_UNUSED(rgn); #endif } @@ -250,6 +249,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi // d->image->image.save("flush.png"); + Q_UNUSED(offset); // Get a context for the widget. #ifndef QT_MAC_USE_COCOA CGContextRef context; diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 24ff10b..f73ffb5 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -913,7 +913,7 @@ void QFont::setPointSize(int pointSize) void QFont::setPointSizeF(qreal pointSize) { if (pointSize <= 0) { - qWarning("QFont::setPointSizeF: Point size <= 0 (%d), must be greater than 0", pointSize); + qWarning("QFont::setPointSizeF: Point size <= 0 (%f), must be greater than 0", pointSize); return; } diff --git a/src/opengl/qglpixelbuffer_mac.mm b/src/opengl/qglpixelbuffer_mac.mm index 9a679b1..e95e36b 100644 --- a/src/opengl/qglpixelbuffer_mac.mm +++ b/src/opengl/qglpixelbuffer_mac.mm @@ -299,9 +299,8 @@ void QGLPixelBuffer::releaseFromDynamicTexture() GLuint QGLPixelBuffer::generateDynamicTexture() const { - Q_D(const QGLPixelBuffer); - #ifdef QT_MAC_USE_COCOA + Q_D(const QGLPixelBuffer); NSOpenGLContext *oldContext = [NSOpenGLContext currentContext]; if (d->share_ctx != oldContext) [static_cast(d->share_ctx) makeCurrentContext]; diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 9932463..ee500a0 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -563,7 +563,6 @@ QChar QODBCDriverPrivate::quoteChar() const static QChar quote = QChar::fromLatin1('"'); if (!isQuoteInitialized) { char driverResponse[4]; - SQLUSMALLINT casing; SQLSMALLINT length; int r = SQLGetInfo(hDbc, SQL_IDENTIFIER_QUOTE_CHAR, diff --git a/src/xmlpatterns/expr/qapplytemplate.cpp b/src/xmlpatterns/expr/qapplytemplate.cpp index 95f4fdf..b91c2f0 100644 --- a/src/xmlpatterns/expr/qapplytemplate.cpp +++ b/src/xmlpatterns/expr/qapplytemplate.cpp @@ -160,8 +160,7 @@ Item::Iterator::Ptr ApplyTemplate::evaluateSequence(const DynamicContext::Ptr &c focus->setFocusIterator(focusIterator); return makeSequenceMappingIterator(ConstPtr(this), focusIterator, focus); } - else - return CommonValues::emptyIterator; + return CommonValues::emptyIterator; } } diff --git a/src/xmlpatterns/functions/qsequencefns.cpp b/src/xmlpatterns/functions/qsequencefns.cpp index f6d5391..faa787e 100644 --- a/src/xmlpatterns/functions/qsequencefns.cpp +++ b/src/xmlpatterns/functions/qsequencefns.cpp @@ -246,8 +246,7 @@ Item::Iterator::Ptr SubsequenceFN::evaluateSequence(const DynamicContext::Ptr &c if(length < 1 && length != -1) return CommonValues::emptyIterator; - else - return Item::Iterator::Ptr(new SubsequenceIterator(it, startingLoc, length)); + return Item::Iterator::Ptr(new SubsequenceIterator(it, startingLoc, length)); } Item SubsequenceFN::evaluateSingleton(const DynamicContext::Ptr &context) const diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index ec54d0c..b78f346 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -810,7 +810,7 @@ bool CentralWidget::eventFilter(QObject *object, QEvent *e) } } - if (QTabBar *tabBar = qobject_cast(object)) { + if (qobject_cast(object)) { const bool dblClick = e->type() == QEvent::MouseButtonDblClick; if ((e->type() == QEvent::MouseButtonRelease) || dblClick) { QMouseEvent *mouseEvent = static_cast(e); -- cgit v0.12 From a90daef6d4c3e0f0025c7c3ca4e4628c5776a389 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 7 May 2009 08:16:14 -0700 Subject: Whitespace fix Reviewed-by: TrustMe --- src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index 8c64293..cd8796b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -332,7 +332,7 @@ inline bool isWidgetOpaque(const QWidget *w) return false; } void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion ®ion, - const QPoint &offset) + const QPoint &offset) { Q_UNUSED(widget); #ifdef QT_NO_DIRECTFB_WM -- cgit v0.12 From 90a65aa6611eb33229cdc00ffe6c22012944ba1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Thu, 7 May 2009 15:49:27 +0200 Subject: Fixed a problem that caused QPrintDialog to invalidate QPrinter. When passing a printer that is set up to print to a PDF file into QPrintDialog, the print dialog could invalidate the printer and not update the validity of it in a proper manner. Task-number: 252873 Reviewed-by: Samuel --- src/gui/painting/qprinter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp index 4f3e71c..6cecf2c 100644 --- a/src/gui/painting/qprinter.cpp +++ b/src/gui/painting/qprinter.cpp @@ -284,8 +284,8 @@ void QPrinterPrivate::addToManualSetList(QPrintEngine::PrintEnginePropertyKey ke to send PostScript or PDF output to the printer. As an alternative, the printProgram() function can be used to specify the command or utility to use instead of the system default. - - Note that setting parameters like paper size and resolution on an + + Note that setting parameters like paper size and resolution on an invalid printer is undefined. You can use QPrinter::isValid() to verify this before changing any parameters. @@ -744,7 +744,7 @@ void QPrinter::setOutputFormat(OutputFormat format) #ifndef QT_NO_PDF Q_D(QPrinter); - if (d->outputFormat == format) + if (d->validPrinter && d->outputFormat == format) return; d->outputFormat = format; @@ -773,8 +773,8 @@ void QPrinter::setOutputFormat(OutputFormat format) if (def_engine) delete oldPrintEngine; - d->validPrinter = d->outputFormat == QPrinter::PdfFormat || d->outputFormat == QPrinter::PostScriptFormat; - + d->validPrinter = (d->outputFormat == QPrinter::PdfFormat + || d->outputFormat == QPrinter::PostScriptFormat); #else Q_UNUSED(format); #endif -- cgit v0.12 From 5a4b17a279aaa8a0196bd645fd9095639ccb7849 Mon Sep 17 00:00:00 2001 From: Bill King Date: Fri, 8 May 2009 09:37:44 +1000 Subject: Fixes QIBASE driver crashes on multiple execution of a prepared query Task-number: 246808 --- src/sql/drivers/ibase/qsql_ibase.cpp | 6 +++--- tests/auto/qsqldatabase/tst_qsqldatabase.cpp | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp index 9eeb41d..6834d9a 100644 --- a/src/sql/drivers/ibase/qsql_ibase.cpp +++ b/src/sql/drivers/ibase/qsql_ibase.cpp @@ -871,7 +871,7 @@ QIBaseResult::~QIBaseResult() bool QIBaseResult::prepare(const QString& query) { - //qDebug("prepare: %s\n", qPrintable(query)); +// qDebug("prepare: %s", qPrintable(query)); if (!driver() || !driver()->isOpen() || driver()->isOpenError()) return false; d->cleanup(); @@ -1025,7 +1025,7 @@ bool QIBaseResult::exec() } if (ok) { - if (colCount()) { + if (colCount() && d->queryType != isc_info_sql_stmt_exec_procedure) { isc_dsql_free_statement(d->status, &d->stmt, DSQL_close); if (d->isError(QT_TRANSLATE_NOOP("QIBaseResult", "Unable to close statement"))) return false; @@ -1039,7 +1039,7 @@ bool QIBaseResult::exec() return false; // Not all stored procedures necessarily return values. - if (d->queryType == isc_info_sql_stmt_exec_procedure && d->sqlda->sqld == 0) + if (d->queryType == isc_info_sql_stmt_exec_procedure && d->sqlda && d->sqlda->sqld == 0) delDA(d->sqlda); if (d->sqlda) diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp index 8dede12..4fa3dc4 100644 --- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp @@ -517,6 +517,8 @@ void tst_QSqlDatabase::tables() // MySQL doesn't give back anything when calling QSqlDatabase::tables() with QSql::Views // May be fixable by doing a select on informational_schema.views instead of using the client library api QEXPECT_FAIL("", "MySQL driver thinks that views are tables", Continue); + if(!tables.contains(qTableName("qtest_view"), Qt::CaseInsensitive)) + qDebug() << "failed to find" << qTableName("qtest_view") << "in" << tables; QVERIFY(tables.contains(qTableName("qtest_view"), Qt::CaseInsensitive)); } if (tempTables) @@ -1880,17 +1882,26 @@ void tst_QSqlDatabase::ibase_procWithReturnValues() "\nRESULT INTEGER)" "\nAS" "\nbegin" - "\nRESULT = 10;" + "\nRESULT = 10 * ABC;" "\nsuspend;" "\nend")); // Interbase procedures can be executed in two ways: EXECUTE PROCEDURE or SELECT QVERIFY_SQL(q, exec(QString("execute procedure %1(123)").arg(procName))); QVERIFY_SQL(q, next()); - QCOMPARE(q.value(0).toInt(), 10); + QCOMPARE(q.value(0).toInt(), 1230); QVERIFY_SQL(q, exec(QString("select result from %1(456)").arg(procName))); QVERIFY_SQL(q, next()); - QCOMPARE(q.value(0).toInt(), 10); + QCOMPARE(q.value(0).toInt(), 4560); + QVERIFY_SQL(q, prepare(QLatin1String("execute procedure ")+procName+QLatin1String("(?)"))); + q.bindValue(0, 123); + QVERIFY_SQL(q, exec()); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 1230); + q.bindValue(0, 456); + QVERIFY_SQL(q, exec()); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 4560); q.exec(QString("drop procedure %1").arg(procName)); } @@ -2276,7 +2287,7 @@ void tst_QSqlDatabase::db2_valueCacheUpdate() void tst_QSqlDatabase::sqlStatementUseIsNull_189093() { - // NULL = NULL is unknow, the sqlStatment must use IS NULL + // NULL = NULL is unknown, the sqlStatment must use IS NULL QFETCH(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); -- cgit v0.12 From 2412b0410dcf97cf348ce703722a1b4f7ce623df Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 8 May 2009 09:02:55 +0200 Subject: qdoc: Moved platform-specific qdoc comments to common .cpp file. When building docs for the mac, qdoc comments for functions defined in the .h file were not found in any of the .cpp files in the mac package because they were in the x11 or windows .cpp file. So I moved them to a .cpp file that is in all the packages. Task-number: 252496 252492 --- src/gui/kernel/qwidget.cpp | 14 ++++++++++++++ src/gui/kernel/qwidget_x11.cpp | 13 ------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index b96d8b3..d911b48 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11432,3 +11432,17 @@ void QWidget::clearMask() setMask(QRegion()); } +/*! \fn const QX11Info &QWidget::x11Info() const + Returns information about the configuration of the X display used to display + the widget. + + \warning This function is only available on X11. +*/ + +/*! \fn Qt::HANDLE QWidget::x11PictureHandle() const + Returns the X11 Picture handle of the widget for XRender + support. Use of this function is not portable. This function will + return 0 if XRender support is not compiled into Qt, if the + XRender extension is not supported on the X11 display, or if the + handle could not be created. +*/ diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 76734d4..6202b35 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -2747,12 +2747,6 @@ void QWidgetPrivate::setWindowOpacity_sys(qreal opacity) 32, PropModeReplace, (uchar*)&value, 1); } -/*! - Returns information about the configuration of the X display used to display - the widget. - - \warning This function is only available on X11. -*/ const QX11Info &QWidget::x11Info() const { Q_D(const QWidget); @@ -2789,13 +2783,6 @@ QWindowSurface *QWidgetPrivate::createDefaultWindowSurface_sys() return new QX11WindowSurface(q_func()); } -/*! - Returns the X11 Picture handle of the widget for XRender - support. Use of this function is not portable. This function will - return 0 if XRender support is not compiled into Qt, if the - XRender extension is not supported on the X11 display, or if the - handle could not be created. -*/ Qt::HANDLE QWidget::x11PictureHandle() const { #ifndef QT_NO_XRENDER -- cgit v0.12 From 9ffcf3737901c49acb1a1bc6b65572d195d78a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Fri, 8 May 2009 09:51:15 +0200 Subject: Make the g++-42 mkspec use gcc-4.2 for linking as well. Forgot to override the linker, causing it to use gcc 4.0. Reviewed-by: Richard Moe Gustavsen --- mkspecs/macx-g++42/qmake.conf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mkspecs/macx-g++42/qmake.conf b/mkspecs/macx-g++42/qmake.conf index e6a3120..4c4f5c3 100644 --- a/mkspecs/macx-g++42/qmake.conf +++ b/mkspecs/macx-g++42/qmake.conf @@ -15,7 +15,11 @@ QMAKE_INCREMENTAL_STYLE = sublib include(../common/mac-g++.conf) -QMAKE_CC = gcc-4.2 -QMAKE_CXX = g++-4.2 +QMAKE_CC = gcc-4.2 +QMAKE_CXX = g++-4.2 +QMAKE_LINK = g++-4.2 +QMAKE_LINK_SHLIB = g++-4.2 +QMAKE_LINK_C = gcc-4.2 +QMAKE_LINK_C_SHLIB = gcc-4.2 load(qt_config) -- cgit v0.12 From 184e36cfb62a50bba74d2563ca3284e64b610d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 8 May 2009 10:20:27 +0200 Subject: Fixed a problem with QPrinter::NativeFormat printers not being valid. It's obvious that not only PDF and PS printers are valid.. Task-number: related to 252873 Reviewed-by: Samuel --- src/gui/painting/qprinter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp index 6cecf2c..5090b3a 100644 --- a/src/gui/painting/qprinter.cpp +++ b/src/gui/painting/qprinter.cpp @@ -773,8 +773,8 @@ void QPrinter::setOutputFormat(OutputFormat format) if (def_engine) delete oldPrintEngine; - d->validPrinter = (d->outputFormat == QPrinter::PdfFormat - || d->outputFormat == QPrinter::PostScriptFormat); + if (d->outputFormat == QPrinter::PdfFormat || d->outputFormat == QPrinter::PostScriptFormat) + d->validPrinter = true; #else Q_UNUSED(format); #endif -- cgit v0.12 From a26e4a2e103608151c63cc11a2d7578cf1d080a3 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 8 May 2009 10:43:42 +0200 Subject: Revert "Added comment to QTextStream - clarification of the documentation" This reverts commit da1416cef6b1d24156739ded101df895ee4e80d9. --- src/corelib/io/qtextstream.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 2010008..ed9d0aa 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -67,8 +67,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 1 Note that you cannot use QTextStream::atEnd(), which returns true when you - have reached the end of the data stream, with stdin because as long as the - application is running, stdin has no end. + have reached the end of the data stream, with stdin. Besides using QTextStream's constructors, you can also set the device or string QTextStream operates on by calling setDevice() or -- cgit v0.12 From d1889402eff75b8dabf67e80c16e3e3316d187e8 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 8 May 2009 10:44:24 +0200 Subject: Correcting typo Removing linebreaks in the document --- doc/src/datastreamformat.qdoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/src/datastreamformat.qdoc b/doc/src/datastreamformat.qdoc index 67a3794..15ac062 100644 --- a/doc/src/datastreamformat.qdoc +++ b/doc/src/datastreamformat.qdoc @@ -301,12 +301,10 @@ \o \list \o Milliseconds since midnight (quint32) \endlist - \row \o QUrl \o \list \o Holds an URL (QString) \endlist - \row \o QVariant \o \list \o The type of the data (quint32) -- cgit v0.12 From 3e7fc907e5cc1937fb98bf4581cee960fe3d4e7a Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 7 May 2009 21:42:02 +0200 Subject: Fixes QDir not reentrant qt_cmp_si_sort_flags could be read and written from different threads. Use qStableSort with functor instead of libc's quicksort. Found with helgrind on kdevelop Reviewed-by: Marius Storm-Olsen --- src/corelib/io/qdir.cpp | 47 ++++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 6d75c59..b7861ba 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -50,6 +50,7 @@ #include "qstring.h" #include "qregexp.h" #include "qvector.h" +#include "qalgorithms.h" #ifdef QT_BUILD_CORE_LIB # include "qresource.h" #endif @@ -190,32 +191,28 @@ QDirPrivate::~QDirPrivate() /* For sorting */ struct QDirSortItem { - QString filename_cache; - QString suffix_cache; + mutable QString filename_cache; + mutable QString suffix_cache; QFileInfo item; }; -static int qt_cmp_si_sort_flags; -#if defined(Q_C_CALLBACKS) -extern "C" { -#endif -#ifdef Q_OS_WINCE -static int __cdecl qt_cmp_si(const void *n1, const void *n2) -#else -static int qt_cmp_si(const void *n1, const void *n2) -#endif -{ - if (!n1 || !n2) - return 0; +class QDirSortItemComparator { + int qt_cmp_si_sort_flags; +public: + QDirSortItemComparator(int flags) : qt_cmp_si_sort_flags(flags) {} + bool operator()(const QDirSortItem &, const QDirSortItem &); +}; - QDirSortItem* f1 = (QDirSortItem*)n1; - QDirSortItem* f2 = (QDirSortItem*)n2; +bool QDirSortItemComparator::operator()(const QDirSortItem &n1, const QDirSortItem &n2) +{ + const QDirSortItem* f1 = &n1; + const QDirSortItem* f2 = &n2; if ((qt_cmp_si_sort_flags & QDir::DirsFirst) && (f1->item.isDir() != f2->item.isDir())) - return f1->item.isDir() ? -1 : 1; + return f1->item.isDir(); if ((qt_cmp_si_sort_flags & QDir::DirsLast) && (f1->item.isDir() != f2->item.isDir())) - return f1->item.isDir() ? 1 : -1; + return !f1->item.isDir(); int r = 0; int sortBy = (qt_cmp_si_sort_flags & QDir::SortByMask) @@ -264,18 +261,11 @@ static int qt_cmp_si(const void *n1, const void *n2) : f1->filename_cache.compare(f2->filename_cache); } - if (r == 0) // Enforce an order - the order the items appear in the array - r = (char*)n1 - (char*)n2; - if (qt_cmp_si_sort_flags & QDir::Reversed) - return -r; - return r; + return r > 0; + return r < 0; } -#if defined(Q_C_CALLBACKS) -} -#endif - inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QStringList &l, QStringList *names, QFileInfoList *infos) const { @@ -292,9 +282,8 @@ inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QStringList &l, path += QLatin1Char('/'); si[i].item = QFileInfo(path + l.at(i)); } - qt_cmp_si_sort_flags = sort; if ((sort & QDir::SortByMask) != QDir::Unsorted) - qsort(si, i, sizeof(si[0]), qt_cmp_si); + qStableSort(si, si+i, QDirSortItemComparator(sort)); // put them back in the list(s) for (int j = 0; j Date: Thu, 7 May 2009 22:53:24 +0200 Subject: Fix reentrancy of QVector and QString The d->capacity could be modified even if ref was more than 1 Reviewed-by: Marius Storm-Olsen --- src/corelib/tools/qstring.h | 2 +- src/corelib/tools/qvector.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 1493dce..b25881f 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -113,7 +113,7 @@ public: int capacity() const; inline void reserve(int size); - inline void squeeze() { if (d->size < d->alloc) realloc(); d->capacity = 0;} + inline void squeeze() { if (d->size < d->alloc || ref != 1) realloc(); d->capacity = 0;} inline const QChar *unicode() const; inline QChar *data(); diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 3fd52ee..1f047b8 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -315,7 +315,7 @@ void QVector::detach_helper() { realloc(d->size, d->alloc); } template void QVector::reserve(int asize) -{ if (asize > d->alloc) realloc(d->size, asize); d->capacity = 1; } +{ if (asize > d->alloc || d->ref != 1) realloc(d->size, asize); d->capacity = 1; } template void QVector::resize(int asize) { realloc(asize, (asize > d->alloc || (!d->capacity && asize < d->size && asize < (d->alloc >> 1))) ? -- cgit v0.12 From 4f1f40791ed7e6aec845752680c525efbcb9be84 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 8 May 2009 12:50:01 +0200 Subject: Fix reentrency of the QCSS engine. QTextDocument which is suposed to be reentrant may use the CSS Parser in different threads. The way the indexOfId was computed is not thread safe. Insert the pre-computed value instead Reviewed-by: Thierry --- src/gui/text/qcssparser.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index db1e781..8214e54 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -278,19 +278,15 @@ static const QCssKnownValue values[NumKnownValues - 1] = { { "xx-large", Value_XXLarge } }; +//Map id to strings as they appears in the 'values' array above +static const int indexOfId[NumKnownValues] = { 0, 40, 47, 41, 48, 53, 34, 26, 68, 69, 25, 42, 5, 62, 46, + 29, 57, 58, 27, 50, 60, 6, 10, 38, 55, 19, 13, 17, 18, 20, 21, 49, 24, 45, 65, 36, 3, 2, 39, 61, 16, + 11, 56, 14, 32, 63, 54, 64, 33, 67, 8, 28, 37, 12, 35, 59, 7, 9, 4, 66, 52, 22, 23, 30, 31, 1, 15, 0, + 51, 44, 43 }; + QString Value::toString() const { - static int indexOfId[NumKnownValues - 1]; - static bool hasCachedIndexes = false; - if (type == KnownIdentifier) { - if (!hasCachedIndexes) { - for (int i = 0; i < NumKnownValues - 1; ++i) - indexOfId[values[i].id] = i; - - hasCachedIndexes = true; - } - return QLatin1String(values[indexOfId[variant.toInt()]].name); } else { return variant.toString(); -- cgit v0.12 From fafd6f5a43d72e91bc511b9738eae6f087eb8073 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 8 May 2009 13:02:01 +0200 Subject: Added further explanation on the note about stdin and QTextsStream::atEnd() Explained why you cannot use stdin and atEnd() together. Task-number:251171 Rev-by: Andreas Aardal Hanssen --- src/corelib/io/qtextstream.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index ed9d0aa..1167671 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -67,8 +67,10 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 1 Note that you cannot use QTextStream::atEnd(), which returns true when you - have reached the end of the data stream, with stdin. - + have reached the end of the data stream, with stdin. The reason for this is + that as long as stdin doesn't give any input to the QTextStream, \c atEnd() + will return true even if the stdin is open and waiting for more characters. + Besides using QTextStream's constructors, you can also set the device or string QTextStream operates on by calling setDevice() or setString(). You can seek to a position by calling seek(), and -- cgit v0.12 From f64bcba9338928107bb4bfc1282b94aa2f696557 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Fri, 8 May 2009 13:25:58 +0200 Subject: compile? --- src/corelib/tools/qstring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index b25881f..69c4f2f 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -113,7 +113,7 @@ public: int capacity() const; inline void reserve(int size); - inline void squeeze() { if (d->size < d->alloc || ref != 1) realloc(); d->capacity = 0;} + inline void squeeze() { if (d->size < d->alloc || d->ref != 1) realloc(); d->capacity = 0;} inline const QChar *unicode() const; inline QChar *data(); -- cgit v0.12 From 42e2070925d012845db9cf85e597a17851a0dcb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 6 May 2009 16:12:57 +0200 Subject: Fix leak of file descriptors in QTemporaryFile Using setFileName in QFile::copy (introduced recently) has a nasty side-effect of leaking file descriptors in QTemporaryFile. This happens because the code assumes the file has been closed. In QTemporaryFile, we need to explicitly call native file engine close. Test case by Thiago. Bug report from Arora developers. Reviewed-by: thiago --- src/corelib/io/qtemporaryfile.cpp | 9 +++++ tests/auto/qtemporaryfile/qtemporaryfile.pro | 3 +- tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp | 45 ++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 4856353..6a9125c 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -294,6 +294,8 @@ public: QTemporaryFileEngine(const QString &file) : QFSFileEngine(file) { } ~QTemporaryFileEngine(); + void setFileName(const QString &file); + bool open(QIODevice::OpenMode flags); bool remove(); bool close(); @@ -304,6 +306,13 @@ QTemporaryFileEngine::~QTemporaryFileEngine() QFSFileEngine::close(); } +void QTemporaryFileEngine::setFileName(const QString &file) +{ + // Really close the file, so we don't leak + QFSFileEngine::close(); + QFSFileEngine::setFileName(file); +} + bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode) { Q_D(QFSFileEngine); diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro index 0c90994..bde990a 100644 --- a/tests/auto/qtemporaryfile/qtemporaryfile.pro +++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro @@ -2,5 +2,4 @@ load(qttest_p4) SOURCES += tst_qtemporaryfile.cpp QT = core - - +DEFINES += SRCDIR=\\\"$$PWD/\\\" diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp index f5155ae..2daa0f6 100644 --- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp @@ -51,6 +51,13 @@ #if defined(Q_OS_WIN) # include #endif +#if defined(Q_OS_UNIX) +# include +# include +# include +# include // open(2) +# include // close(2) +#endif //TESTED_CLASS= //TESTED_FILES= @@ -78,6 +85,7 @@ private slots: void openOnRootDrives(); void stressTest(); void rename(); + void renameFdLeak(); public: }; @@ -356,5 +364,42 @@ void tst_QTemporaryFile::rename() QVERIFY(!dir.exists("temporary-file.txt")); } +void tst_QTemporaryFile::renameFdLeak() +{ +#ifdef Q_OS_UNIX + // Test this on Unix only + + // Open a bunch of files to force the fd count to go up + static const int count = 10; + int bunch_of_files[count]; + for (int i = 0; i < count; ++i) { + bunch_of_files[i] = ::open(SRCDIR "tst_qtemporaryfile.cpp", O_RDONLY); + QVERIFY(bunch_of_files[i] != -1); + } + + int fd; + { + QTemporaryFile file; + file.setAutoRemove(false); + QVERIFY(file.open()); + + // close the bunch of files + for (int i = 0; i < count; ++i) + ::close(bunch_of_files[i]); + + // save the file descriptor for later + fd = file.handle(); + + // rename the file to something + QString newPath = QDir::tempPath() + "/tst_qtemporaryfile-renameFdLeak-" + QString::number(getpid()); + file.rename(newPath); + QFile::remove(newPath); + } + + // check if QTemporaryFile closed the file + QVERIFY(::close(fd) == -1 && errno == EBADF); +#endif +} + QTEST_MAIN(tst_QTemporaryFile) #include "tst_qtemporaryfile.moc" -- cgit v0.12 From 813835f67a1053561eba67bf958eb39c0f4eedfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 7 May 2009 20:45:35 +0200 Subject: Fix QCompleter with UnfilteredPopupCompletion Fixes regression introduced in a794ded85f74516239a08cf848e6b4f8b6dcac6a. When using UnfilteredPopupCompletion the matchCount is always zero and completion was being skipped. By adding the check for showAll we still avoid the assert but retain correct behavior. Task-number: 253125 Reviewed-by: jasplin --- src/gui/util/qcompleter.cpp | 2 +- tests/auto/qcompleter/tst_qcompleter.cpp | 46 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index a622385..faa4e7b 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -824,7 +824,7 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted) Q_Q(QCompleter); QString completion; - if (!index.isValid() || (index.row() >= proxy->engine->matchCount())) { + if (!index.isValid() || (!proxy->showAll && (index.row() >= proxy->engine->matchCount()))) { completion = prefix; } else { QModelIndex si = proxy->mapToSource(index); diff --git a/tests/auto/qcompleter/tst_qcompleter.cpp b/tests/auto/qcompleter/tst_qcompleter.cpp index 656995a..b71cdc6 100644 --- a/tests/auto/qcompleter/tst_qcompleter.cpp +++ b/tests/auto/qcompleter/tst_qcompleter.cpp @@ -143,6 +143,9 @@ private slots: void task246056_setCompletionPrefix(); void task250064_lostFocus(); + void task253125_lineEditCompletion_data(); + void task253125_lineEditCompletion(); + private: void filter(); void testRowCount(); @@ -1184,5 +1187,48 @@ void tst_QCompleter::task250064_lostFocus() QCOMPARE(textEdit->focusPolicy(), origPolicy); } +void tst_QCompleter::task253125_lineEditCompletion_data() +{ + QTest::addColumn("list"); + QTest::addColumn("completionMode"); + + QStringList list = QStringList() + << "alpha" << "beta" << "gamma" << "delta" << "epsilon" << "zeta" + << "eta" << "theta" << "iota" << "kappa" << "lambda" << "mu" + << "nu" << "xi" << "omicron" << "pi" << "rho" << "sigma" + << "tau" << "upsilon" << "phi" << "chi" << "psi" << "omega"; + + QTest::newRow("Inline") << list << (int)QCompleter::InlineCompletion; + QTest::newRow("Filtered") << list << (int)QCompleter::PopupCompletion; + QTest::newRow("Unfiltered") << list << (int)QCompleter::UnfilteredPopupCompletion; +} + +void tst_QCompleter::task253125_lineEditCompletion() +{ + QFETCH(QStringList, list); + QFETCH(int, completionMode); + + QStringListModel *model = new QStringListModel; + model->setStringList(list); + + QCompleter *completer = new QCompleter(list); + completer->setModel(model); + completer->setCompletionMode((QCompleter::CompletionMode)completionMode); + + QLineEdit edit; + edit.setCompleter(completer); + edit.show(); + edit.setFocus(); + + QTest::qWait(100); + + QTest::keyClick(&edit, 'i'); + QCOMPARE(edit.completer()->currentCompletion(), QString("iota")); + QTest::keyClick(edit.completer()->popup(), Qt::Key_Down); + QTest::keyClick(edit.completer()->popup(), Qt::Key_Enter); + + QCOMPARE(edit.text(), QString("iota")); +} + QTEST_MAIN(tst_QCompleter) #include "tst_qcompleter.moc" -- cgit v0.12 From 42b5bc2e21cbed70b64fcd1f1bcf9282444206dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 7 May 2009 20:53:22 +0200 Subject: Fixes a crash in QPrinterDialog with relative filenames It's better to set the sourceModel in the constructor for QFSCompletor, as requiring that it be set separately is error prone. Surprisingly, the printer dialog crash only appears to happen when using relative filenames. Task-number: 253135 Reviewed-by: alexis --- src/gui/dialogs/qfiledialog.cpp | 1 - src/gui/dialogs/qfiledialog_p.h | 2 +- tests/auto/qprinter/tst_qprinter.cpp | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 2f524cb..eeb2743 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -2142,7 +2142,6 @@ void QFileDialogPrivate::createWidgets() #ifndef QT_NO_COMPLETER completer = new QFSCompletor(model, q); qFileDialogUi->fileNameEdit->setCompleter(completer); - completer->sourceModel = model; QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)), q, SLOT(_q_autoCompleteFileName(QString))); #endif // QT_NO_COMPLETER diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h index dc24390..ab4199e 100644 --- a/src/gui/dialogs/qfiledialog_p.h +++ b/src/gui/dialogs/qfiledialog_p.h @@ -97,7 +97,7 @@ class Ui_QFileDialog; */ class QFSCompletor : public QCompleter { public: - QFSCompletor(QAbstractItemModel *model, QObject *parent = 0) : QCompleter(model, parent), proxyModel(0), sourceModel(0) + QFSCompletor(QFileSystemModel *model, QObject *parent = 0) : QCompleter(model, parent), proxyModel(0), sourceModel(model) { #ifdef Q_OS_WIN setCaseSensitivity(Qt::CaseInsensitive); diff --git a/tests/auto/qprinter/tst_qprinter.cpp b/tests/auto/qprinter/tst_qprinter.cpp index a598bfc..cde4ae5 100644 --- a/tests/auto/qprinter/tst_qprinter.cpp +++ b/tests/auto/qprinter/tst_qprinter.cpp @@ -103,6 +103,7 @@ private slots: void valuePreservation(); void errorReporting(); void testCustomPageSizes(); + void printDialogCompleter(); private: }; @@ -940,5 +941,22 @@ void tst_QPrinter::testCustomPageSizes() QCOMPARE(paperSize, customSize); } +void tst_QPrinter::printDialogCompleter() +{ +#if defined(QT_NO_COMPLETER) || defined(QT_NO_FILEDIALOG) + QSKIP("QT_NO_COMPLETER || QT_NO_FILEDIALOG: Auto-complete turned off in QPrinterDialog.", QTest::SkipAll); +#else + QPrintDialog dialog; + dialog.printer()->setOutputFileName("file.pdf"); + dialog.setEnabledOptions(QAbstractPrintDialog::PrintToFile); + dialog.show(); + + QTest::qWait(100); + + QTest::keyClick(0, Qt::Key_Tab); + QTest::keyClick(0, 'P'); +#endif +} + QTEST_MAIN(tst_QPrinter) #include "tst_qprinter.moc" -- cgit v0.12 From b5adcbd322d9ae34b54ccde5a4d5835a2078f7db Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Fri, 8 May 2009 13:22:34 +0200 Subject: QDataStream: Small doc error Task-number: 253179 Reviewed-by: TrustMe --- src/corelib/io/qdatastream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index 9990696..b203899 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -514,7 +514,7 @@ void QDataStream::setByteOrder(ByteOrder bo) \value Qt_4_2 Version 8 (Qt 4.2) \value Qt_4_3 Version 9 (Qt 4.3) \value Qt_4_4 Version 10 (Qt 4.4) - \value Qt_4_5 Version 10 (Qt 4.5) + \value Qt_4_5 Version 11 (Qt 4.5) \omitvalue Qt_4_6 \sa setVersion(), version() -- cgit v0.12 From 6f1946e92e01582cdfb5712ccb9ee734f9af7743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 6 May 2009 18:17:12 +0200 Subject: macx-g++42 spec linker was gcc instead of gcc-4.2 Better alternative to 9ffcf3737901c49acb1a1bc6b65572d195d78a5d Task-number: 253052 Reviewed-by: Norwegian Rock Cat Reviewed-by: MortenS --- mkspecs/common/mac-g++.conf | 8 ++++---- mkspecs/macx-g++/qmake.conf | 4 ++-- mkspecs/macx-g++42/qmake.conf | 11 +++-------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/mkspecs/common/mac-g++.conf b/mkspecs/common/mac-g++.conf index b764b26..eaae1aa 100644 --- a/mkspecs/common/mac-g++.conf +++ b/mkspecs/common/mac-g++.conf @@ -46,10 +46,10 @@ QMAKE_CXXFLAGS_DWARF2 += $$QMAKE_CFLAGS_DWARF2 QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE -QMAKE_LINK = g++ -QMAKE_LINK_SHLIB = g++ -QMAKE_LINK_C = gcc -QMAKE_LINK_C_SHLIB = gcc +QMAKE_LINK = $$QMAKE_CXX +QMAKE_LINK_SHLIB = $$QMAKE_CXX +QMAKE_LINK_C = $$QMAKE_CC +QMAKE_LINK_C_SHLIB = $$QMAKE_CC QMAKE_LFLAGS += -headerpad_max_install_names QMAKE_LFLAGS_RELEASE += QMAKE_LFLAGS_DEBUG += diff --git a/mkspecs/macx-g++/qmake.conf b/mkspecs/macx-g++/qmake.conf index 64ef801..4355073 100644 --- a/mkspecs/macx-g++/qmake.conf +++ b/mkspecs/macx-g++/qmake.conf @@ -12,9 +12,9 @@ CONFIG += qt warn_on release app_bundle incremental global_init_link_order lib QT += core gui QMAKE_INCREMENTAL_STYLE = sublib -include(../common/mac-g++.conf) - QMAKE_CC = gcc QMAKE_CXX = g++ +include(../common/mac-g++.conf) + load(qt_config) diff --git a/mkspecs/macx-g++42/qmake.conf b/mkspecs/macx-g++42/qmake.conf index 4c4f5c3..06bbdcb 100644 --- a/mkspecs/macx-g++42/qmake.conf +++ b/mkspecs/macx-g++42/qmake.conf @@ -12,14 +12,9 @@ CONFIG += qt warn_on release app_bundle incremental global_init_link_order lib QT += core gui QMAKE_INCREMENTAL_STYLE = sublib -include(../common/mac-g++.conf) - +QMAKE_CC = gcc-4.2 +QMAKE_CXX = g++-4.2 -QMAKE_CC = gcc-4.2 -QMAKE_CXX = g++-4.2 -QMAKE_LINK = g++-4.2 -QMAKE_LINK_SHLIB = g++-4.2 -QMAKE_LINK_C = gcc-4.2 -QMAKE_LINK_C_SHLIB = gcc-4.2 +include(../common/mac-g++.conf) load(qt_config) -- cgit v0.12 From 0ba839d4587a40a8af31c8233213da216002706e Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 8 May 2009 13:38:23 +0200 Subject: Fixing hellogl_es2 for Windows CE We hardcode the lib names for 4.5 Reviewed-by: Maurice --- examples/opengl/hellogl_es2/hellogl_es2.pro | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/opengl/hellogl_es2/hellogl_es2.pro b/examples/opengl/hellogl_es2/hellogl_es2.pro index 92b4224..d5ad4b8 100644 --- a/examples/opengl/hellogl_es2/hellogl_es2.pro +++ b/examples/opengl/hellogl_es2/hellogl_es2.pro @@ -25,3 +25,9 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2 sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es2.pro sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2 INSTALLS += target sources + + +wince*: { + QMAKE_LIBS += "libGLESv2.lib" + +} \ No newline at end of file -- cgit v0.12 From b21210d646f4aaa639fa480ddf1c8e5fcd9b0572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 7 May 2009 16:07:47 +0200 Subject: Prevented asynchronous access to non-thread safe libfontconfig API. We need to protect calls to FcCharSetHasChar with the font database mutex. Task-number: 241361 Reviewed-by: Simon Hausmann --- src/gui/text/qfontengine_ft.cpp | 43 ++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index de03a3c..7a236fd 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1521,6 +1521,11 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs return false; } +#if !defined(QT_NO_FONTCONFIG) + extern QMutex *qt_fontdatabase_mutex(); + QMutex *mtx = 0; +#endif + bool mirrored = flags & QTextEngine::RightToLeft; int glyph_pos = 0; if (freetype->symbol_map) { @@ -1533,6 +1538,11 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs if ( !glyphs->glyphs[glyph_pos] ) { glyph_t glyph; #if !defined(QT_NO_FONTCONFIG) + if (!mtx) { + mtx = qt_fontdatabase_mutex(); + mtx->lock(); + } + if (FcCharSetHasChar(freetype->charset, uc)) { #else if (false) { @@ -1561,20 +1571,26 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs if (mirrored) uc = QChar::mirroredChar(uc); glyphs->glyphs[glyph_pos] = uc < QFreetypeFace::cmapCacheSize ? freetype->cmapCache[uc] : 0; - if (!glyphs->glyphs[glyph_pos] + if (!glyphs->glyphs[glyph_pos]) { #if !defined(QT_NO_FONTCONFIG) - && FcCharSetHasChar(freetype->charset, uc) + if (!mtx) { + mtx = qt_fontdatabase_mutex(); + mtx->lock(); + } + + if (FcCharSetHasChar(freetype->charset, uc)) #endif - ) { - redo: - glyph_t glyph = FT_Get_Char_Index(face, uc); - if (!glyph && (uc == 0xa0 || uc == 0x9)) { - uc = 0x20; - goto redo; + { + redo: + glyph_t glyph = FT_Get_Char_Index(face, uc); + if (!glyph && (uc == 0xa0 || uc == 0x9)) { + uc = 0x20; + goto redo; + } + glyphs->glyphs[glyph_pos] = glyph; + if (uc < QFreetypeFace::cmapCacheSize) + freetype->cmapCache[uc] = glyph; } - glyphs->glyphs[glyph_pos] = glyph; - if (uc < QFreetypeFace::cmapCacheSize) - freetype->cmapCache[uc] = glyph; } ++glyph_pos; } @@ -1583,6 +1599,11 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs *nglyphs = glyph_pos; glyphs->numGlyphs = glyph_pos; +#if !defined(QT_NO_FONTCONFIG) + if (mtx) + mtx->unlock(); +#endif + if (flags & QTextEngine::GlyphIndicesOnly) return true; -- cgit v0.12 From 842ba1b3878c2973b24936b18a7ee55bdd980be6 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Mon, 11 May 2009 14:28:43 +1000 Subject: Fixes qt3support unit tests generating compile failures when Qt is not configured with qt3support. The build system knows when qt3support was turned off, so let's just skip these tests in that case. That makes more sense than individually configuring each autotest machine to skip these tests when the configuration is known to turn off qt3support, which is what's done previously. Reviewed-by: Lincoln Ramsay --- tests/auto/q3accel/q3accel.pro | 1 + tests/auto/q3action/q3action.pro | 1 + tests/auto/q3actiongroup/q3actiongroup.pro | 1 + tests/auto/q3buttongroup/clickLock/clickLock.pro | 3 ++- tests/auto/q3buttongroup/tst_q3buttongroup.pro | 1 + tests/auto/q3canvas/q3canvas.pro | 1 + tests/auto/q3checklistitem/q3checklistitem.pro | 1 + tests/auto/q3combobox/q3combobox.pro | 1 + tests/auto/q3cstring/q3cstring.pro | 1 + tests/auto/q3databrowser/q3databrowser.pro | 1 + tests/auto/q3dateedit/q3dateedit.pro | 1 + tests/auto/q3datetimeedit/q3datetimeedit.pro | 1 + tests/auto/q3deepcopy/q3deepcopy.pro | 1 + tests/auto/q3dict/q3dict.pro | 1 + tests/auto/q3dns/q3dns.pro | 1 + tests/auto/q3dockwindow/q3dockwindow.pro | 1 + tests/auto/q3filedialog/q3filedialog.pro | 1 + tests/auto/q3frame/q3frame.pro | 1 + tests/auto/q3groupbox/q3groupbox.pro | 1 + tests/auto/q3hbox/q3hbox.pro | 1 + tests/auto/q3header/q3header.pro | 1 + tests/auto/q3iconview/q3iconview.pro | 1 + tests/auto/q3listbox/q3listbox.pro | 3 ++- tests/auto/q3listview/q3listview.pro | 1 + tests/auto/q3listviewitemiterator/q3listviewitemiterator.pro | 1 + tests/auto/q3mainwindow/q3mainwindow.pro | 1 + tests/auto/q3popupmenu/q3popupmenu.pro | 1 + tests/auto/q3process/q3process.pro | 1 + tests/auto/q3process/tst/tst.pro | 3 ++- tests/auto/q3progressbar/q3progressbar.pro | 1 + tests/auto/q3progressdialog/q3progressdialog.pro | 1 + tests/auto/q3ptrlist/q3ptrlist.pro | 1 + tests/auto/q3richtext/q3richtext.pro | 1 + tests/auto/q3scrollview/q3scrollview.pro | 3 ++- tests/auto/q3semaphore/q3semaphore.pro | 1 + tests/auto/q3serversocket/q3serversocket.pro | 1 + tests/auto/q3socket/q3socket.pro | 1 + tests/auto/q3socketdevice/q3socketdevice.pro | 1 + tests/auto/q3sqlcursor/q3sqlcursor.pro | 1 + tests/auto/q3sqlselectcursor/q3sqlselectcursor.pro | 1 + tests/auto/q3stylesheet/q3stylesheet.pro | 1 + tests/auto/q3tabdialog/q3tabdialog.pro | 1 + tests/auto/q3table/q3table.pro | 1 + tests/auto/q3textbrowser/q3textbrowser.pro | 1 + tests/auto/q3textedit/q3textedit.pro | 1 + tests/auto/q3textstream/q3textstream.pro | 1 + tests/auto/q3timeedit/q3timeedit.pro | 1 + tests/auto/q3toolbar/q3toolbar.pro | 1 + tests/auto/q3uridrag/q3uridrag.pro | 3 ++- tests/auto/q3urloperator/q3urloperator.pro | 3 ++- tests/auto/q3valuelist/q3valuelist.pro | 3 ++- tests/auto/q3valuevector/q3valuevector.pro | 3 ++- tests/auto/q3widgetstack/q3widgetstack.pro | 3 ++- 53 files changed, 62 insertions(+), 9 deletions(-) diff --git a/tests/auto/q3accel/q3accel.pro b/tests/auto/q3accel/q3accel.pro index 002033f..61d4f38 100644 --- a/tests/auto/q3accel/q3accel.pro +++ b/tests/auto/q3accel/q3accel.pro @@ -3,6 +3,7 @@ HEADERS += SOURCES += tst_q3accel.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3action/q3action.pro b/tests/auto/q3action/q3action.pro index ee5d780..c85a158 100644 --- a/tests/auto/q3action/q3action.pro +++ b/tests/auto/q3action/q3action.pro @@ -1,3 +1,4 @@ load(qttest_p4) QT += qt3support +requires(contains(QT_CONFIG,qt3support)) SOURCES += tst_q3action.cpp diff --git a/tests/auto/q3actiongroup/q3actiongroup.pro b/tests/auto/q3actiongroup/q3actiongroup.pro index bfe1f68..139e48c 100644 --- a/tests/auto/q3actiongroup/q3actiongroup.pro +++ b/tests/auto/q3actiongroup/q3actiongroup.pro @@ -1,5 +1,6 @@ load(qttest_p4) QT += qt3support +requires(contains(QT_CONFIG,qt3support)) SOURCES += tst_q3actiongroup.cpp diff --git a/tests/auto/q3buttongroup/clickLock/clickLock.pro b/tests/auto/q3buttongroup/clickLock/clickLock.pro index 68f5ed2..a1aa105 100644 --- a/tests/auto/q3buttongroup/clickLock/clickLock.pro +++ b/tests/auto/q3buttongroup/clickLock/clickLock.pro @@ -3,7 +3,8 @@ TEMPLATE = app win32:TARGET = ../clickLock !win32:TARGET = clickLock -contains(QT_CONFIG, qt3support): QT += qt3support +QT += qt3support +requires(contains(QT_CONFIG,qt3support)) DEPENDPATH += . INCLUDEPATH += . CONFIG -= app_bundle diff --git a/tests/auto/q3buttongroup/tst_q3buttongroup.pro b/tests/auto/q3buttongroup/tst_q3buttongroup.pro index 8ec25d0..9f1f090 100644 --- a/tests/auto/q3buttongroup/tst_q3buttongroup.pro +++ b/tests/auto/q3buttongroup/tst_q3buttongroup.pro @@ -1,5 +1,6 @@ load(qttest_p4) QT += qt3support +requires(contains(QT_CONFIG,qt3support)) # Input SOURCES += tst_q3buttongroup.cpp diff --git a/tests/auto/q3canvas/q3canvas.pro b/tests/auto/q3canvas/q3canvas.pro index cac538d..70e9b88 100644 --- a/tests/auto/q3canvas/q3canvas.pro +++ b/tests/auto/q3canvas/q3canvas.pro @@ -3,5 +3,6 @@ SOURCES += tst_q3canvas.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3checklistitem/q3checklistitem.pro b/tests/auto/q3checklistitem/q3checklistitem.pro index 77d96e8..9ae9c55 100644 --- a/tests/auto/q3checklistitem/q3checklistitem.pro +++ b/tests/auto/q3checklistitem/q3checklistitem.pro @@ -3,5 +3,6 @@ SOURCES += tst_q3checklistitem.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3combobox/q3combobox.pro b/tests/auto/q3combobox/q3combobox.pro index 2391f6c..7dcde2b 100644 --- a/tests/auto/q3combobox/q3combobox.pro +++ b/tests/auto/q3combobox/q3combobox.pro @@ -1,3 +1,4 @@ load(qttest_p4) SOURCES += tst_q3combobox.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3cstring/q3cstring.pro b/tests/auto/q3cstring/q3cstring.pro index 78077b8..1171093 100644 --- a/tests/auto/q3cstring/q3cstring.pro +++ b/tests/auto/q3cstring/q3cstring.pro @@ -3,5 +3,6 @@ SOURCES += tst_q3cstring.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3databrowser/q3databrowser.pro b/tests/auto/q3databrowser/q3databrowser.pro index 09c16b7..d65a5ef 100644 --- a/tests/auto/q3databrowser/q3databrowser.pro +++ b/tests/auto/q3databrowser/q3databrowser.pro @@ -2,5 +2,6 @@ load(qttest_p4) SOURCES += tst_q3databrowser.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3dateedit/q3dateedit.pro b/tests/auto/q3dateedit/q3dateedit.pro index ba585ce..85e0ebf 100644 --- a/tests/auto/q3dateedit/q3dateedit.pro +++ b/tests/auto/q3dateedit/q3dateedit.pro @@ -1,6 +1,7 @@ load(qttest_p4) SOURCES += tst_q3dateedit.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3datetimeedit/q3datetimeedit.pro b/tests/auto/q3datetimeedit/q3datetimeedit.pro index f2c0097..9c980be 100644 --- a/tests/auto/q3datetimeedit/q3datetimeedit.pro +++ b/tests/auto/q3datetimeedit/q3datetimeedit.pro @@ -4,6 +4,7 @@ load(qttest_p4) QT += qt3support +requires(contains(QT_CONFIG,qt3support)) SOURCES += tst_q3datetimeedit.cpp diff --git a/tests/auto/q3deepcopy/q3deepcopy.pro b/tests/auto/q3deepcopy/q3deepcopy.pro index 04e0690..9ac1a10 100644 --- a/tests/auto/q3deepcopy/q3deepcopy.pro +++ b/tests/auto/q3deepcopy/q3deepcopy.pro @@ -3,5 +3,6 @@ SOURCES += tst_q3deepcopy.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3dict/q3dict.pro b/tests/auto/q3dict/q3dict.pro index 5ccd875..7bbea61 100644 --- a/tests/auto/q3dict/q3dict.pro +++ b/tests/auto/q3dict/q3dict.pro @@ -3,5 +3,6 @@ SOURCES += tst_q3dict.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3dns/q3dns.pro b/tests/auto/q3dns/q3dns.pro index 10c24e5..7fd2e4c 100644 --- a/tests/auto/q3dns/q3dns.pro +++ b/tests/auto/q3dns/q3dns.pro @@ -3,5 +3,6 @@ SOURCES += tst_q3dns.cpp QT += network qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3dockwindow/q3dockwindow.pro b/tests/auto/q3dockwindow/q3dockwindow.pro index 5f23c40..1352123 100644 --- a/tests/auto/q3dockwindow/q3dockwindow.pro +++ b/tests/auto/q3dockwindow/q3dockwindow.pro @@ -3,6 +3,7 @@ HEADERS += SOURCES += tst_q3dockwindow.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3filedialog/q3filedialog.pro b/tests/auto/q3filedialog/q3filedialog.pro index 2394111..f57f9c0 100644 --- a/tests/auto/q3filedialog/q3filedialog.pro +++ b/tests/auto/q3filedialog/q3filedialog.pro @@ -4,6 +4,7 @@ load(qttest_p4) QT += qt3support +requires(contains(QT_CONFIG,qt3support)) SOURCES += tst_q3filedialog.cpp diff --git a/tests/auto/q3frame/q3frame.pro b/tests/auto/q3frame/q3frame.pro index 7f0d24f..1d1f5a7 100644 --- a/tests/auto/q3frame/q3frame.pro +++ b/tests/auto/q3frame/q3frame.pro @@ -1,4 +1,5 @@ load(qttest_p4) QT += qt3support +requires(contains(QT_CONFIG,qt3support)) SOURCES += tst_q3frame.cpp diff --git a/tests/auto/q3groupbox/q3groupbox.pro b/tests/auto/q3groupbox/q3groupbox.pro index 5153a25..fd4cced 100644 --- a/tests/auto/q3groupbox/q3groupbox.pro +++ b/tests/auto/q3groupbox/q3groupbox.pro @@ -1,5 +1,6 @@ load(qttest_p4) QT += qt3support +requires(contains(QT_CONFIG,qt3support)) # Input SOURCES += tst_q3groupbox.cpp diff --git a/tests/auto/q3hbox/q3hbox.pro b/tests/auto/q3hbox/q3hbox.pro index d5b7c65..bbd7f5b 100644 --- a/tests/auto/q3hbox/q3hbox.pro +++ b/tests/auto/q3hbox/q3hbox.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_q3hbox.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3header/q3header.pro b/tests/auto/q3header/q3header.pro index 64ffb0f..d1a913a 100644 --- a/tests/auto/q3header/q3header.pro +++ b/tests/auto/q3header/q3header.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_q3header.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3iconview/q3iconview.pro b/tests/auto/q3iconview/q3iconview.pro index 37a138b..9416c08 100644 --- a/tests/auto/q3iconview/q3iconview.pro +++ b/tests/auto/q3iconview/q3iconview.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_q3iconview.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3listbox/q3listbox.pro b/tests/auto/q3listbox/q3listbox.pro index d193ace..dc2d197 100644 --- a/tests/auto/q3listbox/q3listbox.pro +++ b/tests/auto/q3listbox/q3listbox.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_qlistbox.cpp -contains(QT_CONFIG, qt3support): QT += qt3support +QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3listview/q3listview.pro b/tests/auto/q3listview/q3listview.pro index 56c62d1..5d72ea6 100644 --- a/tests/auto/q3listview/q3listview.pro +++ b/tests/auto/q3listview/q3listview.pro @@ -2,4 +2,5 @@ load(qttest_p4) SOURCES += tst_q3listview.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3listviewitemiterator/q3listviewitemiterator.pro b/tests/auto/q3listviewitemiterator/q3listviewitemiterator.pro index 143e0c0..b50d012 100644 --- a/tests/auto/q3listviewitemiterator/q3listviewitemiterator.pro +++ b/tests/auto/q3listviewitemiterator/q3listviewitemiterator.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_q3listviewitemiterator.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3mainwindow/q3mainwindow.pro b/tests/auto/q3mainwindow/q3mainwindow.pro index 7a198d1..c4cb7c4 100644 --- a/tests/auto/q3mainwindow/q3mainwindow.pro +++ b/tests/auto/q3mainwindow/q3mainwindow.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_q3mainwindow.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) CONFIG += console diff --git a/tests/auto/q3popupmenu/q3popupmenu.pro b/tests/auto/q3popupmenu/q3popupmenu.pro index c9c0dd5..216722b 100644 --- a/tests/auto/q3popupmenu/q3popupmenu.pro +++ b/tests/auto/q3popupmenu/q3popupmenu.pro @@ -4,5 +4,6 @@ load(qttest_p4) QT += qt3support +requires(contains(QT_CONFIG,qt3support)) SOURCES += tst_q3popupmenu.cpp diff --git a/tests/auto/q3process/q3process.pro b/tests/auto/q3process/q3process.pro index 8dc3541..a665c2b 100644 --- a/tests/auto/q3process/q3process.pro +++ b/tests/auto/q3process/q3process.pro @@ -5,6 +5,7 @@ SUBDIRS = cat \ tst TARGET = tst_q3process QT += qt3support +requires(contains(QT_CONFIG,qt3support)) #no install rule for subdir INSTALLS = diff --git a/tests/auto/q3process/tst/tst.pro b/tests/auto/q3process/tst/tst.pro index 090d76b..359148b 100644 --- a/tests/auto/q3process/tst/tst.pro +++ b/tests/auto/q3process/tst/tst.pro @@ -11,6 +11,7 @@ win32 { } } -contains(QT_CONFIG, qt3support): QT += qt3support +QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3progressbar/q3progressbar.pro b/tests/auto/q3progressbar/q3progressbar.pro index b3c8864..582c39e 100644 --- a/tests/auto/q3progressbar/q3progressbar.pro +++ b/tests/auto/q3progressbar/q3progressbar.pro @@ -4,6 +4,7 @@ load(qttest_p4) QT += qt3support +requires(contains(QT_CONFIG,qt3support)) SOURCES += tst_q3progressbar.cpp diff --git a/tests/auto/q3progressdialog/q3progressdialog.pro b/tests/auto/q3progressdialog/q3progressdialog.pro index 65e24ed..08528db 100644 --- a/tests/auto/q3progressdialog/q3progressdialog.pro +++ b/tests/auto/q3progressdialog/q3progressdialog.pro @@ -4,6 +4,7 @@ load(qttest_p4) QT += qt3support +requires(contains(QT_CONFIG,qt3support)) SOURCES += tst_q3progressdialog.cpp diff --git a/tests/auto/q3ptrlist/q3ptrlist.pro b/tests/auto/q3ptrlist/q3ptrlist.pro index 186a707..d7431f4 100644 --- a/tests/auto/q3ptrlist/q3ptrlist.pro +++ b/tests/auto/q3ptrlist/q3ptrlist.pro @@ -2,5 +2,6 @@ load(qttest_p4) SOURCES += tst_q3ptrlist.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3richtext/q3richtext.pro b/tests/auto/q3richtext/q3richtext.pro index 2d4fc5a..e22fa37 100644 --- a/tests/auto/q3richtext/q3richtext.pro +++ b/tests/auto/q3richtext/q3richtext.pro @@ -3,6 +3,7 @@ HEADERS += SOURCES += tst_q3richtext.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3scrollview/q3scrollview.pro b/tests/auto/q3scrollview/q3scrollview.pro index 1750e8b..d98d234 100644 --- a/tests/auto/q3scrollview/q3scrollview.pro +++ b/tests/auto/q3scrollview/q3scrollview.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_qscrollview.cpp -contains(QT_CONFIG, qt3support): QT += qt3support +QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3semaphore/q3semaphore.pro b/tests/auto/q3semaphore/q3semaphore.pro index ad8c154..935917d 100644 --- a/tests/auto/q3semaphore/q3semaphore.pro +++ b/tests/auto/q3semaphore/q3semaphore.pro @@ -1,5 +1,6 @@ load(qttest_p4) SOURCES += tst_q3semaphore.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3serversocket/q3serversocket.pro b/tests/auto/q3serversocket/q3serversocket.pro index 4fa9dce..4e5e364 100644 --- a/tests/auto/q3serversocket/q3serversocket.pro +++ b/tests/auto/q3serversocket/q3serversocket.pro @@ -3,5 +3,6 @@ SOURCES += tst_q3serversocket.cpp QT += network qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3socket/q3socket.pro b/tests/auto/q3socket/q3socket.pro index a9bf0c0..a8324e9 100644 --- a/tests/auto/q3socket/q3socket.pro +++ b/tests/auto/q3socket/q3socket.pro @@ -2,5 +2,6 @@ load(qttest_p4) SOURCES += tst_qsocket.cpp QT += network qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3socketdevice/q3socketdevice.pro b/tests/auto/q3socketdevice/q3socketdevice.pro index c6e9e93..d2cbfb2 100644 --- a/tests/auto/q3socketdevice/q3socketdevice.pro +++ b/tests/auto/q3socketdevice/q3socketdevice.pro @@ -2,5 +2,6 @@ load(qttest_p4) SOURCES += tst_q3socketdevice.cpp QT += network qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3sqlcursor/q3sqlcursor.pro b/tests/auto/q3sqlcursor/q3sqlcursor.pro index 2844540..2d316fb 100644 --- a/tests/auto/q3sqlcursor/q3sqlcursor.pro +++ b/tests/auto/q3sqlcursor/q3sqlcursor.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_q3sqlcursor.cpp QT += sql qt3support +requires(contains(QT_CONFIG,qt3support)) win32:LIBS += -lws2_32 diff --git a/tests/auto/q3sqlselectcursor/q3sqlselectcursor.pro b/tests/auto/q3sqlselectcursor/q3sqlselectcursor.pro index 21e311f..59448eb 100644 --- a/tests/auto/q3sqlselectcursor/q3sqlselectcursor.pro +++ b/tests/auto/q3sqlselectcursor/q3sqlselectcursor.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_q3sqlselectcursor.cpp QT += sql qt3support +requires(contains(QT_CONFIG,qt3support)) win32:LIBS += -lws2_32 diff --git a/tests/auto/q3stylesheet/q3stylesheet.pro b/tests/auto/q3stylesheet/q3stylesheet.pro index a5e8438..f0fcd8b 100644 --- a/tests/auto/q3stylesheet/q3stylesheet.pro +++ b/tests/auto/q3stylesheet/q3stylesheet.pro @@ -4,6 +4,7 @@ load(qttest_p4) QT += qt3support +requires(contains(QT_CONFIG,qt3support)) SOURCES += tst_q3stylesheet.cpp diff --git a/tests/auto/q3tabdialog/q3tabdialog.pro b/tests/auto/q3tabdialog/q3tabdialog.pro index 1ba72f9..815510d 100644 --- a/tests/auto/q3tabdialog/q3tabdialog.pro +++ b/tests/auto/q3tabdialog/q3tabdialog.pro @@ -4,6 +4,7 @@ load(qttest_p4) QT += qt3support +requires(contains(QT_CONFIG,qt3support)) SOURCES += tst_q3tabdialog.cpp diff --git a/tests/auto/q3table/q3table.pro b/tests/auto/q3table/q3table.pro index 6d96a4e..bdda8ba 100644 --- a/tests/auto/q3table/q3table.pro +++ b/tests/auto/q3table/q3table.pro @@ -2,5 +2,6 @@ load(qttest_p4) SOURCES += tst_q3table.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3textbrowser/q3textbrowser.pro b/tests/auto/q3textbrowser/q3textbrowser.pro index 8ddeaba..4dfd12e 100644 --- a/tests/auto/q3textbrowser/q3textbrowser.pro +++ b/tests/auto/q3textbrowser/q3textbrowser.pro @@ -3,6 +3,7 @@ HEADERS += SOURCES += tst_q3textbrowser.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3textedit/q3textedit.pro b/tests/auto/q3textedit/q3textedit.pro index a4b24a9..ff90c4a 100644 --- a/tests/auto/q3textedit/q3textedit.pro +++ b/tests/auto/q3textedit/q3textedit.pro @@ -4,5 +4,6 @@ SOURCES += tst_q3textedit.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3textstream/q3textstream.pro b/tests/auto/q3textstream/q3textstream.pro index 7c80af7..bf2584a 100644 --- a/tests/auto/q3textstream/q3textstream.pro +++ b/tests/auto/q3textstream/q3textstream.pro @@ -1,6 +1,7 @@ load(qttest_p4) SOURCES += tst_q3textstream.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) MOC_DIR=tmp diff --git a/tests/auto/q3timeedit/q3timeedit.pro b/tests/auto/q3timeedit/q3timeedit.pro index 17b4a84..0f231df 100644 --- a/tests/auto/q3timeedit/q3timeedit.pro +++ b/tests/auto/q3timeedit/q3timeedit.pro @@ -1,6 +1,7 @@ load(qttest_p4) SOURCES += tst_q3timeedit.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3toolbar/q3toolbar.pro b/tests/auto/q3toolbar/q3toolbar.pro index 8fcab99..974f14f 100644 --- a/tests/auto/q3toolbar/q3toolbar.pro +++ b/tests/auto/q3toolbar/q3toolbar.pro @@ -1,6 +1,7 @@ load(qttest_p4) SOURCES += tst_q3toolbar.cpp QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3uridrag/q3uridrag.pro b/tests/auto/q3uridrag/q3uridrag.pro index 526623e..b6e77fc 100644 --- a/tests/auto/q3uridrag/q3uridrag.pro +++ b/tests/auto/q3uridrag/q3uridrag.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_q3uridrag.cpp -contains(QT_CONFIG, qt3support): QT += qt3support +QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3urloperator/q3urloperator.pro b/tests/auto/q3urloperator/q3urloperator.pro index 3364dac..29282eb 100644 --- a/tests/auto/q3urloperator/q3urloperator.pro +++ b/tests/auto/q3urloperator/q3urloperator.pro @@ -2,7 +2,8 @@ load(qttest_p4) SOURCES += tst_q3urloperator.cpp -contains(QT_CONFIG, qt3support): QT += qt3support +QT += qt3support +requires(contains(QT_CONFIG,qt3support)) QT += network diff --git a/tests/auto/q3valuelist/q3valuelist.pro b/tests/auto/q3valuelist/q3valuelist.pro index ab82d31..d359779 100644 --- a/tests/auto/q3valuelist/q3valuelist.pro +++ b/tests/auto/q3valuelist/q3valuelist.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_q3valuelist.cpp -contains(QT_CONFIG, qt3support): QT += qt3support +QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3valuevector/q3valuevector.pro b/tests/auto/q3valuevector/q3valuevector.pro index 883fda2..55956cb 100644 --- a/tests/auto/q3valuevector/q3valuevector.pro +++ b/tests/auto/q3valuevector/q3valuevector.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_q3valuevector.cpp -contains(QT_CONFIG, qt3support): QT += qt3support +QT += qt3support +requires(contains(QT_CONFIG,qt3support)) diff --git a/tests/auto/q3widgetstack/q3widgetstack.pro b/tests/auto/q3widgetstack/q3widgetstack.pro index 9783f58..1bd6a89 100644 --- a/tests/auto/q3widgetstack/q3widgetstack.pro +++ b/tests/auto/q3widgetstack/q3widgetstack.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_q3widgetstack.cpp -contains(QT_CONFIG, qt3support): QT += qt3support +QT += qt3support +requires(contains(QT_CONFIG,qt3support)) -- cgit v0.12