From dbd16b3b6d2e6b030dd52e90eb3a38dc1a73c180 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Thu, 3 Jun 2010 16:54:31 +0200 Subject: fix for using .lnk files when running app from UNC Since "" is an invalid target for a .lnk file, we can return false for doStat() in case of resolving the .lnk to "". Notice that .lnk files only allow absolute paths for the target. "" is returned by readLink in case the .lnk file does not exist. Reviewed-by: Joao Task-Number: QTBUG-10863 --- src/corelib/io/qfsfileengine_win.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index ec49f1a..21930e1 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1162,7 +1162,15 @@ bool QFSFileEnginePrivate::doStat() const if (filePath.isEmpty()) return could_stat; - QString fname = filePath.endsWith(QLatin1String(".lnk")) ? readLink(filePath) : filePath; + QString fname; + if(filePath.endsWith(QLatin1String(".lnk"))) { + fname = readLink(filePath); + if(fname.isEmpty()) + return could_stat; + } + else + fname = filePath; + fname = fixIfRelativeUncPath(fname); UINT oldmode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); -- cgit v0.12 From cd8a6d6836f04f66d3e7083c97f7873240afa433 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 4 Jun 2010 12:53:36 +0200 Subject: Avoid timer starvation during high posted event activity Similar to commit bc01bb10da23d0d2308cf02a16947be836bc9a21, we need to avoid starvation of the idle time source by forcing a single, normal priority pass after processing posted events. Reviewed-by: ogoffart Task-number: QT-3467 --- src/corelib/kernel/qeventdispatcher_glib.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp index fd36be4..9c1c827 100644 --- a/src/corelib/kernel/qeventdispatcher_glib.cpp +++ b/src/corelib/kernel/qeventdispatcher_glib.cpp @@ -246,6 +246,7 @@ struct GPostEventSource GSource source; QAtomicInt serialNumber; int lastSerialNumber; + QEventDispatcherGlibPrivate *d; }; static gboolean postEventSourcePrepare(GSource *s, gint *timeout) @@ -274,6 +275,7 @@ static gboolean postEventSourceDispatch(GSource *s, GSourceFunc, gpointer) GPostEventSource *source = reinterpret_cast(s); source->lastSerialNumber = source->serialNumber; QCoreApplication::sendPostedEvents(); + source->d->runTimersOnceWithNormalPriority(); return true; // i dunno, george... } @@ -313,6 +315,7 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context) postEventSource = reinterpret_cast(g_source_new(&postEventSourceFuncs, sizeof(GPostEventSource))); postEventSource->serialNumber = 1; + postEventSource->d = this; g_source_set_can_recurse(&postEventSource->source, true); g_source_attach(&postEventSource->source, mainContext); -- cgit v0.12 From 2b4d2fd1ada524f4780dd7633ca34bc72d823ff1 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Fri, 4 Jun 2010 18:37:00 +0200 Subject: Fix in Addressbook tutorial Don't add if name or address is empty. Reviewed-by: Alessandro Portale --- examples/tutorials/addressbook/part3/addressbook.cpp | 1 + examples/tutorials/addressbook/part4/addressbook.cpp | 1 + examples/tutorials/addressbook/part5/addressbook.cpp | 1 + examples/tutorials/addressbook/part6/addressbook.cpp | 1 + examples/tutorials/addressbook/part7/addressbook.cpp | 1 + 5 files changed, 5 insertions(+) diff --git a/examples/tutorials/addressbook/part3/addressbook.cpp b/examples/tutorials/addressbook/part3/addressbook.cpp index adb87ef..28a570a 100644 --- a/examples/tutorials/addressbook/part3/addressbook.cpp +++ b/examples/tutorials/addressbook/part3/addressbook.cpp @@ -125,6 +125,7 @@ void AddressBook::submitContact() if (name == "" || address == "") { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); + return; } if (!contacts.contains(name)) { diff --git a/examples/tutorials/addressbook/part4/addressbook.cpp b/examples/tutorials/addressbook/part4/addressbook.cpp index 1b7a6c4..55d551f 100644 --- a/examples/tutorials/addressbook/part4/addressbook.cpp +++ b/examples/tutorials/addressbook/part4/addressbook.cpp @@ -134,6 +134,7 @@ void AddressBook::submitContact() if (name == "" || address == "") { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); + return; } //! [submitContact() function part1] if (currentMode == AddingMode) { diff --git a/examples/tutorials/addressbook/part5/addressbook.cpp b/examples/tutorials/addressbook/part5/addressbook.cpp index 80c18c3..1b3f451 100644 --- a/examples/tutorials/addressbook/part5/addressbook.cpp +++ b/examples/tutorials/addressbook/part5/addressbook.cpp @@ -141,6 +141,7 @@ void AddressBook::submitContact() if (name == "" || address == "") { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); + return; } if (currentMode == AddingMode) { diff --git a/examples/tutorials/addressbook/part6/addressbook.cpp b/examples/tutorials/addressbook/part6/addressbook.cpp index fc41190..724971c 100644 --- a/examples/tutorials/addressbook/part6/addressbook.cpp +++ b/examples/tutorials/addressbook/part6/addressbook.cpp @@ -147,6 +147,7 @@ void AddressBook::submitContact() if (name == "" || address == "") { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); + return; } if (currentMode == AddingMode) { diff --git a/examples/tutorials/addressbook/part7/addressbook.cpp b/examples/tutorials/addressbook/part7/addressbook.cpp index 3ab8702..bf00298 100644 --- a/examples/tutorials/addressbook/part7/addressbook.cpp +++ b/examples/tutorials/addressbook/part7/addressbook.cpp @@ -149,6 +149,7 @@ void AddressBook::submitContact() if (name == "" || address == "") { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); + return; } if (currentMode == AddingMode) { -- cgit v0.12 From 09c6a81109d3978c1583c556202c01c1e774f11f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 4 Jun 2010 20:47:46 +0200 Subject: Make qbswap() use glibc's fast bswap_*() functions if available. Reviewed-by: Thiago Macieira --- src/corelib/global/qendian.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h index 107854c..353e8b9 100644 --- a/src/corelib/global/qendian.h +++ b/src/corelib/global/qendian.h @@ -42,6 +42,16 @@ #ifndef QENDIAN_H #define QENDIAN_H +#ifdef Q_OS_LINUX +QT_BEGIN_INCLUDE_NAMESPACE +# include +QT_END_INCLUDE_NAMESPACE +#endif + +#ifdef __GLIBC__ +#include +#endif + #include QT_BEGIN_HEADER @@ -264,6 +274,21 @@ template <> inline qint16 qFromBigEndian(const uchar *src) * and it is therefore a bit more convenient and in most cases more efficient. */ template T qbswap(T source); + +#ifdef __GLIBC__ +template <> inline quint64 qbswap(quint64 source) +{ + return bswap_64(source); +} +template <> inline quint32 qbswap(quint32 source) +{ + return bswap_32(source); +} +template <> inline quint16 qbswap(quint16 source) +{ + return bswap_16(source); +} +#else template <> inline quint64 qbswap(quint64 source) { return 0 @@ -292,6 +317,7 @@ template <> inline quint16 qbswap(quint16 source) | ((source & 0x00ff) << 8) | ((source & 0xff00) >> 8) ); } +#endif // __GLIBC__ // signed specializations template <> inline qint64 qbswap(qint64 source) -- cgit v0.12 From 51fa7df978d71a366c95c732d6a8c2576690d63a Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 5 Jun 2010 00:06:15 +0200 Subject: Add convenience constructor to QTextOption::Tab Merge-request: 1734 Reviewed-by: Simon Hausmann --- src/gui/text/qtextoption.cpp | 10 ++++++++-- src/gui/text/qtextoption.h | 2 ++ tests/auto/qtextformat/tst_qtextformat.cpp | 5 +---- tests/auto/qtextlayout/tst_qtextlayout.cpp | 9 ++------- tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp | 9 ++------- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp index c1e254c..a2b8022 100644 --- a/src/gui/text/qtextoption.cpp +++ b/src/gui/text/qtextoption.cpp @@ -145,7 +145,7 @@ QTextOption &QTextOption::operator=(const QTextOption &o) \sa tabArray(), setTabStop(), setTabs() */ -void QTextOption::setTabArray(QList tabStops) +void QTextOption::setTabArray(QList tabStops) // Qt5: const ref { if (!d) d = new QTextOptionPrivate; @@ -165,7 +165,7 @@ void QTextOption::setTabArray(QList tabStops) \sa tabStops() */ -void QTextOption::setTabs(QList tabStops) +void QTextOption::setTabs(QList tabStops) // Qt5: const ref { if (!d) d = new QTextOptionPrivate; @@ -391,6 +391,12 @@ QList QTextOption::tabs() const */ /*! + \fn Tab::Tab(qreal pos, TabType tabType, QChar delim = QChar()) + Creates a tab with the given position, tab type, and (for DelimiterTab) delimiter + \since 4.6 +*/ + +/*! \fn bool Tab::operator==(const Tab &other) const Returns true if tab \a other is equal to this tab; diff --git a/src/gui/text/qtextoption.h b/src/gui/text/qtextoption.h index 1381ed1..5af7834 100644 --- a/src/gui/text/qtextoption.h +++ b/src/gui/text/qtextoption.h @@ -68,6 +68,8 @@ public: struct Q_GUI_EXPORT Tab { inline Tab() : position(80), type(QTextOption::LeftTab) { } + inline Tab(qreal pos, TabType tabType, QChar delim = QChar()) + : position(pos), type(tabType), delimiter(delim) {} inline bool operator==(const Tab &other) const { return type == other.type diff --git a/tests/auto/qtextformat/tst_qtextformat.cpp b/tests/auto/qtextformat/tst_qtextformat.cpp index ee1f4b5..9b71481 100644 --- a/tests/auto/qtextformat/tst_qtextformat.cpp +++ b/tests/auto/qtextformat/tst_qtextformat.cpp @@ -308,10 +308,7 @@ void tst_QTextFormat::getSetTabs() format.setTabPositions(tabs); Comparator c2(tabs, format.tabPositions()); - QTextOption::Tab tab2; - tab2.position = 3456; - tab2.type = QTextOption::RightTab; - tab2.delimiter = QChar('x'); + QTextOption::Tab tab2(3456, QTextOption::RightTab, QChar('x')); tabs.append(tab2); format.setTabPositions(tabs); Comparator c3(tabs, format.tabPositions()); diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index 1a5f493..a631f3d 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -980,9 +980,7 @@ void tst_QTextLayout::testCenteredTab() // test if centering the tab works. We expect the center of 'Bar.' to be at the tab point. QTextOption option = layout.textOption(); QList tabs; - QTextOption::Tab tab; - tab.type = QTextOption::CenterTab; - tab.position = 150; + QTextOption::Tab tab(150, QTextOption::CenterTab); tabs.append(tab); option.setTabs(tabs); layout.setTextOption(option); @@ -1002,10 +1000,7 @@ void tst_QTextLayout::testDelimiterTab() // try the different delimiter characters to see if the alignment works there. QTextOption option = layout.textOption(); QList tabs; - QTextOption::Tab tab; - tab.type = QTextOption::DelimiterTab; - tab.delimiter = QChar('.'); - tab.position = 100; + QTextOption::Tab tab(100, QTextOption::DelimiterTab, QChar('.')); tabs.append(tab); option.setTabs(tabs); layout.setTextOption(option); diff --git a/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp b/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp index 64c42bb..a463d86 100644 --- a/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp +++ b/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp @@ -198,14 +198,9 @@ void tst_QTextOdfWriter::testWriteStyle2() { QTextBlockFormat bf; // = cursor.blockFormat(); QList tabs; - QTextOption::Tab tab1; - tab1.position = 40; - tab1.type = QTextOption::RightTab; + QTextOption::Tab tab1(40, QTextOption::RightTab); tabs << tab1; - QTextOption::Tab tab2; - tab2.position = 80; - tab2.type = QTextOption::DelimiterTab; - tab2.delimiter = 'o'; + QTextOption::Tab tab2(80, QTextOption::DelimiterTab, 'o'); tabs << tab2; bf.setTabPositions(tabs); -- cgit v0.12 From fad226e8a6354d89fad3dbee5ab6dd07e80534bc Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Mon, 7 Jun 2010 09:30:41 +1000 Subject: make corewlan more namespace friendly --- src/plugins/bearer/corewlan/qcorewlanengine.mm | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index a9cb65b..6ba9504 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -70,9 +70,10 @@ #include #include -@interface QNSListener : NSObject + +@interface QT_MANGLE_NAMESPACE(QNSListener) : NSObject { - NSNotificationCenter *center; + NSNotificationCenter *notificationCenter; CWInterface *currentInterface; QCoreWlanEngine *engine; NSLock *locker; @@ -86,16 +87,16 @@ @end -@implementation QNSListener +@implementation QT_MANGLE_NAMESPACE(QNSListener) @synthesize engine; - (id) init { [locker lock]; QMacCocoaAutoReleasePool pool; - center = [NSNotificationCenter defaultCenter]; + notificationCenter = [NSNotificationCenter defaultCenter]; currentInterface = [CWInterface interfaceWithName:nil]; - [center addObserver:self selector:@selector(notificationHandler:) name:kCWPowerDidChangeNotification object:nil]; + [notificationCenter addObserver:self selector:@selector(notificationHandler:) name:kCWPowerDidChangeNotification object:nil]; [locker unlock]; return self; } @@ -116,7 +117,7 @@ -(void)remove { [locker lock]; - [center removeObserver:self]; + [notificationCenter removeObserver:self]; [locker unlock]; } @@ -126,7 +127,7 @@ } @end -QNSListener *listener = 0; +QT_MANGLE_NAMESPACE(QNSListener) *listener = 0; QT_BEGIN_NAMESPACE @@ -296,6 +297,9 @@ void QScanThread::getUserConfigurations() for(uint row=0; row < [wifiInterfaces count]; row++ ) { CWInterface *wifiInterface = [CWInterface interfaceWithName: [wifiInterfaces objectAtIndex:row]]; + if ( ![wifiInterface power] ) + continue; + NSString *nsInterfaceName = [wifiInterface name]; // add user configured system networks SCDynamicStoreRef dynRef = SCDynamicStoreCreate(kCFAllocatorSystemDefault, (CFStringRef)@"Qt corewlan", nil, nil); @@ -430,7 +434,7 @@ void QCoreWlanEngine::initialize() QMacCocoaAutoReleasePool pool; if([[CWInterface supportedInterfaces] count] > 0 && !listener) { - listener = [[QNSListener alloc] init]; + listener = [[QT_MANGLE_NAMESPACE(QNSListener) alloc] init]; listener.engine = this; hasWifi = true; } else { @@ -785,6 +789,11 @@ void QCoreWlanEngine::networksChanged() changed = true; } + if (ptr->bearer != cpPriv->bearer) { + ptr->bearer = cpPriv->bearer; + changed = true; + } + if (ptr->state != cpPriv->state) { ptr->state = cpPriv->state; changed = true; -- cgit v0.12 From 5eec7f6611075df526f30796378315c9cd469cd8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 29 May 2010 20:51:57 +0200 Subject: Update the linux-icc mkspec --- mkspecs/linux-icc/qmake.conf | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf index 3353180..5e46498 100644 --- a/mkspecs/linux-icc/qmake.conf +++ b/mkspecs/linux-icc/qmake.conf @@ -21,12 +21,12 @@ QMAKE_LEX = flex QMAKE_LEXFLAGS = QMAKE_YACC = yacc QMAKE_YACCFLAGS = -d -QMAKE_CFLAGS = -wd654,1572 +QMAKE_CFLAGS = QMAKE_CFLAGS_DEPS = -M -QMAKE_CFLAGS_WARN_ON = +QMAKE_CFLAGS_WARN_ON = -w1 -Wcheck -wd654,1572,411,873,1125 QMAKE_CFLAGS_WARN_OFF = -w -QMAKE_CFLAGS_RELEASE = -O2 -QMAKE_CFLAGS_DEBUG = -g +QMAKE_CFLAGS_RELEASE = -O2 -falign-functions=16 -ansi-alias -fstrict-aliasing +QMAKE_CFLAGS_DEBUG = -O0 -g QMAKE_CFLAGS_SHLIB = -fPIC QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB QMAKE_CFLAGS_YACC = @@ -60,9 +60,10 @@ QMAKE_LFLAGS_RELEASE = QMAKE_LFLAGS_DEBUG = QMAKE_LFLAGS_SHLIB = -shared QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB -QMAKE_LFLAGS_SONAME = -Qoption,ld,-soname, +QMAKE_LFLAGS_SONAME = -Wl,-soname, QMAKE_LFLAGS_THREAD = -QMAKE_LFLAGS_RPATH = -Qoption,ld,-rpath, +QMAKE_LFLAGS_NOUNDEF = -Wl,-z,defs +QMAKE_LFLAGS_RPATH = -Wl,-rpath, QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = -ldl @@ -99,8 +100,8 @@ QMAKE_CXXFLAGS_USE_PRECOMPILE = -pch-use ${QMAKE_PCH_OUTPUT} -include ${QMAKE_PC QMAKE_CXXFLAGS_PRECOMPILE = -c -pch-create ${QMAKE_PCH_OUTPUT} -include ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_TEMP_OBJECT} ${QMAKE_PCH_TEMP_SOURCE} # -Bsymbolic-functions (ld) support -QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Qoption,ld,-Bsymbolic-functions -QMAKE_LFLAGS_DYNAMIC_LIST = -Qoption,ld,--dynamic-list, +QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions +QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, # Symbol visibility control QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden -- cgit v0.12 From 8a4d4c1f0d3761cbf46cf0fee076647ec4a6ac5a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 30 May 2010 10:46:42 +0200 Subject: Update the mkspec for linux-icc: don't use jump tables in shlibs ICC generates jump table code that isn't PIC (i.e., it does absolute indirect jumps), so this increases the number of relocations in shared libraries by a huge amount. In QtCore it increased by 250% (from 3500 to 12000). --- mkspecs/linux-icc/qmake.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf index 5e46498..3b26f7d 100644 --- a/mkspecs/linux-icc/qmake.conf +++ b/mkspecs/linux-icc/qmake.conf @@ -27,7 +27,7 @@ QMAKE_CFLAGS_WARN_ON = -w1 -Wcheck -wd654,1572,411,873,1125 QMAKE_CFLAGS_WARN_OFF = -w QMAKE_CFLAGS_RELEASE = -O2 -falign-functions=16 -ansi-alias -fstrict-aliasing QMAKE_CFLAGS_DEBUG = -O0 -g -QMAKE_CFLAGS_SHLIB = -fPIC +QMAKE_CFLAGS_SHLIB = -fPIC -fno-jump-tables QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB QMAKE_CFLAGS_YACC = QMAKE_CFLAGS_THREAD = -D_REENTRANT @@ -58,7 +58,7 @@ QMAKE_LINK_SHLIB = icpc QMAKE_LFLAGS = QMAKE_LFLAGS_RELEASE = QMAKE_LFLAGS_DEBUG = -QMAKE_LFLAGS_SHLIB = -shared +QMAKE_LFLAGS_SHLIB = -shared -shared-intel QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB QMAKE_LFLAGS_SONAME = -Wl,-soname, QMAKE_LFLAGS_THREAD = @@ -77,7 +77,7 @@ QMAKE_LIBS_THREAD = -lpthread QMAKE_MOC = $$[QT_INSTALL_BINS]/moc QMAKE_UIC = $$[QT_INSTALL_BINS]/uic -QMAKE_AR = ar cqs +QMAKE_AR = xiar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -- cgit v0.12 From 91fa2c1beb79124db4a70a37e2224c1de9b9ded4 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Mon, 7 Jun 2010 12:33:27 +0200 Subject: Disabled item view items use incorrect background color This was a problem when using alternate row colors. We use a separate palette for base/alternate when using disabled colors. However, we should only use this if the entire view is disabled. To keep compatibility with style sheets we have to preserve the disabled state per item, but we now use the widget pointer to decide which palette role to use. Task-number: QTBUG-11263 Reviewed-by: ogoffart --- src/gui/styles/qcommonstyle.cpp | 4 ++-- src/gui/styles/qgtkstyle.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 4978565..039a6da 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -762,7 +762,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q #ifndef QT_NO_ITEMVIEWS case PE_PanelItemViewRow: if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast(opt)) { - QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled + QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled)) ? QPalette::Normal : QPalette::Disabled; if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active)) cg = QPalette::Inactive; @@ -775,7 +775,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q break; case PE_PanelItemViewItem: if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast(opt)) { - QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled + QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled)) ? QPalette::Normal : QPalette::Disabled; if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active)) cg = QPalette::Inactive; diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index b59a033..c989bd3 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -855,9 +855,10 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, key = QLS("a"); GTK_WIDGET_SET_FLAGS(gtkTreeView, GTK_HAS_FOCUS); } + bool isEnabled = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled)); gtkPainter.paintFlatBox(gtkTreeView, detail, option->rect, option->state & State_Selected ? GTK_STATE_SELECTED : - option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, + isEnabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_OUT, gtkTreeView->style, key); if (isActive ) GTK_WIDGET_UNSET_FLAGS(gtkTreeView, GTK_HAS_FOCUS); -- cgit v0.12 From e82d6264571604357b28ccb8d1b079c7eaf6ba71 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 7 Jun 2010 13:42:13 +0200 Subject: remove somewhat misleading warning about x11 pixmap leak the only situation where it would be actually true are broken drivers (or a broken x server as a whole). qt is not the right place to worry about that problem. Reviewed-by: jbache --- src/gui/image/qpixmap_x11.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 6bebefc..e8dc5ae 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -1250,10 +1250,8 @@ void QX11PixmapData::release() pengine = 0; if (!X11) { -#ifndef QT_NO_DEBUG - qWarning("~QX11PixmapData(): QPixmap objects must be destroyed before the QApplication" - " object, otherwise the native pixmap object will be leaked."); -#endif + // At this point, the X server will already have freed our resources, + // so there is nothing to do. return; } -- cgit v0.12 From 3cf159b75f8a5e66edd8f6b4defbee2f4435b6ef Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 7 Jun 2010 13:42:34 +0200 Subject: add docu about pixmaps being invalidated on qapp destruction Reviewed-by: jbache --- src/gui/image/qpixmap.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 20e4b50..fd2c139 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1766,6 +1766,9 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode) function returns the actual matrix used for transforming the pixmap. + \note When using the native X11 graphics system, the pixmap + becomes invalid when the QApplication instance is destroyed. + \sa QBitmap, QImage, QImageReader, QImageWriter */ -- cgit v0.12 From 5f9fdaa5c82fa4529ad4352da6855a19be83c079 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Mon, 7 Jun 2010 15:18:50 +0200 Subject: XQuery test suite (and others): remove p4 dependency --- tests/auto/xmlpatternsxqts/tst_suitetest.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/auto/xmlpatternsxqts/tst_suitetest.cpp b/tests/auto/xmlpatternsxqts/tst_suitetest.cpp index ec63858..6e10e3f 100644 --- a/tests/auto/xmlpatternsxqts/tst_suitetest.cpp +++ b/tests/auto/xmlpatternsxqts/tst_suitetest.cpp @@ -141,8 +141,6 @@ void tst_SuiteTest::checkTestSuiteResult() const /* Passed to ResultThreader so it knows what kind of file it is handling. */ ResultThreader::Type type = ResultThreader::Baseline; - QProcess::execute(QLatin1String("p4 edit ") + m_existingBaseline); - for(QFileInfoList::const_iterator it(list.constBegin()); it != end; ++it) { QFileInfo i(*it); @@ -167,8 +165,6 @@ void tst_SuiteTest::checkTestSuiteResult() const const int exitCode = eventLoop.exec(); - QProcess::execute(QLatin1String("p4 revert -a ") + m_existingBaseline); - QCOMPARE(exitCode, 0); } -- cgit v0.12 From 154bf4c4f58b3b4d012cd2ff57cd4709a2226464 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 7 Jun 2010 16:45:51 +0200 Subject: Fix incorrect \since tag Changed the since added in 51fa7df978d71a366c95c732d6a8c2576690d63a from 4.6 to 4.7 Pointed out by Thorbjoern :) Reviewed-by: Trust me --- src/gui/text/qtextoption.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp index a2b8022..527b603 100644 --- a/src/gui/text/qtextoption.cpp +++ b/src/gui/text/qtextoption.cpp @@ -393,7 +393,7 @@ QList QTextOption::tabs() const /*! \fn Tab::Tab(qreal pos, TabType tabType, QChar delim = QChar()) Creates a tab with the given position, tab type, and (for DelimiterTab) delimiter - \since 4.6 + \since 4.7 */ /*! -- cgit v0.12