From 8d6b5483e34d27f1ee45af9d9fadb87525c9f915 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 4 Mar 2010 09:23:53 +0100 Subject: Make QLabel::text a reloadable property In this way we can correctly load / reload a label in case it contains a rich text with a reference to the image taken from resources. Since QLabel::setText() ignores the call in case we try to set the same text, we force the reload by setting the empty string in between. For performance reasons we do it only in cases when the text value contains :/ (only in this case it might have a reference to the resources). Reviewed-by: Friedemann Kleint Task-number: QTBUG-8347 --- tools/designer/src/lib/shared/formwindowbase.cpp | 12 +++++++++++- tools/designer/src/lib/shared/qdesigner_propertysheet.cpp | 2 ++ tools/designer/src/lib/shared/qdesigner_propertysheet_p.h | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/designer/src/lib/shared/formwindowbase.cpp b/tools/designer/src/lib/shared/formwindowbase.cpp index 2c5efbf..b57e9d7 100644 --- a/tools/designer/src/lib/shared/formwindowbase.cpp +++ b/tools/designer/src/lib/shared/formwindowbase.cpp @@ -181,7 +181,17 @@ void FormWindowBase::reloadProperties() QMapIterator itIndex(itSheet.value()); while (itIndex.hasNext()) { const int index = itIndex.next().key(); - sheet->setProperty(index, sheet->property(index)); + const QVariant newValue = sheet->property(index); + if (qobject_cast(sheet->object()) && sheet->propertyName(index) == QLatin1String("text")) { + const PropertySheetStringValue newString = qVariantValue(newValue); + // optimize a bit, reset only if the text value might contain a reference to qt resources + // (however reloading of icons other than taken from resources might not work here) + if (newString.value().contains(QLatin1String(":/"))) { + const QVariant resetValue = qVariantFromValue(PropertySheetStringValue()); + sheet->setProperty(index, resetValue); + } + } + sheet->setProperty(index, newValue); } if (QTabWidget *tabWidget = qobject_cast(sheet->object())) { const int count = tabWidget->count(); diff --git a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp index 13bb1d7..77ab2a6 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp +++ b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp @@ -271,6 +271,7 @@ bool QDesignerPropertySheetPrivate::isReloadableProperty(int index) const { return isResourceProperty(index) || propertyType(index) == QDesignerPropertySheet::PropertyStyleSheet + || propertyType(index) == QDesignerPropertySheet::PropertyText || q->property(index).type() == QVariant::Url; } @@ -549,6 +550,7 @@ QDesignerPropertySheet::PropertyType QDesignerPropertySheet::propertyTypeFromNam propertyTypeHash.insert(QLatin1String("windowModality"), PropertyWindowModality); propertyTypeHash.insert(QLatin1String("windowModified"), PropertyWindowModified); propertyTypeHash.insert(QLatin1String("styleSheet"), PropertyStyleSheet); + propertyTypeHash.insert(QLatin1String("text"), PropertyText); } return propertyTypeHash.value(name, PropertyNone); } diff --git a/tools/designer/src/lib/shared/qdesigner_propertysheet_p.h b/tools/designer/src/lib/shared/qdesigner_propertysheet_p.h index 9db7367..0105eac 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertysheet_p.h +++ b/tools/designer/src/lib/shared/qdesigner_propertysheet_p.h @@ -176,7 +176,8 @@ public: PropertyWindowIconText, PropertyWindowModality, PropertyWindowModified, - PropertyStyleSheet + PropertyStyleSheet, + PropertyText }; enum ObjectType { ObjectNone, ObjectLabel, ObjectLayout, ObjectLayoutWidget, ObjectQ3GroupBox }; -- cgit v0.12 From a63dc3b837fbabafcd8ccdc6c30e304f69b278da Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 4 Mar 2010 09:59:24 +0100 Subject: Avoid QString reallocation for smallcaps fonts in Itemizer::generate() Reviewed-by: Simon Hausmann --- src/gui/text/qtextengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 2291138..b826588 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -81,7 +81,7 @@ public: void generate(int start, int length, QFont::Capitalization caps) { if ((int)caps == (int)QFont::SmallCaps) - generateScriptItemsSmallCaps(m_string.utf16(), start, length); + generateScriptItemsSmallCaps(reinterpret_cast(m_string.unicode()), start, length); else if(caps == QFont::Capitalize) generateScriptItemsCapitalize(start, length); else if(caps != QFont::MixedCase) { -- cgit v0.12 From 7d7a85fa16b28fdba257bb466be5a6d2b4bf5d2f Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Thu, 4 Mar 2010 10:01:56 +0100 Subject: Enable two fast path for blend_tiled_rgb565 Blending ARGB8565 and RGB16 on top of RGB16 is common on system with 16 bits color depth. The faster blending functions can be used instead of blend_tiled_generic. Reviewed-by: Tom Cooksey --- src/gui/painting/qdrawhelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 891f4c2..8d2da69 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -5072,7 +5072,7 @@ static void blend_tiled_argb8565(int count, const QSpan *spans, void *userData) static void blend_tiled_rgb565(int count, const QSpan *spans, void *userData) { -#if defined(QT_QWS_DEPTH_16) +#if !defined(Q_WS_QWS) || defined(QT_QWS_DEPTH_16) QSpanData *data = reinterpret_cast(userData); if (data->texture.format == QImage::Format_ARGB8565_Premultiplied) -- cgit v0.12 From 52da988db3a03bce5513bc5e2efa3d69f3664f24 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 4 Mar 2010 11:47:36 +0100 Subject: qmake/MinGw: Link statically for Qt Creator to be able to detect it. Qt Creator detects Qt versions by running qmake. This fails if no MinGw setup is in the path as is usually the case when starting it from the menu. Make it possible to run qmake without setup. Strip executable. Reviewed-by: Thierry Bastian Reviewed-by: mariusSO --- qmake/Makefile.win32-g++ | 2 +- qmake/Makefile.win32-g++-sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index d4d6e0e..27ae27b 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -27,7 +27,7 @@ CFLAGS = -c -o$@ -O \ -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ -DQT_BOOTSTRAPPED CXXFLAGS = $(CFLAGS) -LFLAGS = +LFLAGS = -static-libgcc -s LIBS = -lole32 -luuid LINKQMAKE = g++ $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS) ADDCLEAN = diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh index 5061089..f7b486f 100644 --- a/qmake/Makefile.win32-g++-sh +++ b/qmake/Makefile.win32-g++-sh @@ -27,7 +27,7 @@ CFLAGS = -c -o$@ -O \ -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ -DQT_BOOTSTRAPPED CXXFLAGS = $(CFLAGS) -LFLAGS = +LFLAGS = -static-libgcc -s LIBS = -lole32 -luuid LINKQMAKE = g++ $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS) ADDCLEAN = -- cgit v0.12 From 4574b342ebb8800ba50ca23f154c20b3e8a239af Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 4 Mar 2010 11:55:01 +0100 Subject: Fix compile Missing header added --- tools/designer/src/lib/shared/formwindowbase.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/designer/src/lib/shared/formwindowbase.cpp b/tools/designer/src/lib/shared/formwindowbase.cpp index b57e9d7..5292f5f 100644 --- a/tools/designer/src/lib/shared/formwindowbase.cpp +++ b/tools/designer/src/lib/shared/formwindowbase.cpp @@ -72,6 +72,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE -- cgit v0.12 From 8c8e9ffb60c244462f615f510bc71d4010cf8faf Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 4 Mar 2010 11:47:45 +0100 Subject: Remove the OBJECTS_DIR variable assignment from some projets in Qt. This prevent debug and release object file to be mixed up when linking these application in a debug_and_release configured Qt. Reviewed-by: Marius Storm-Olsen --- demos/qtdemo/qtdemo.pro | 2 -- examples/threads/waitconditions/waitconditions.pro | 2 -- src/tools/moc/util/generate_keywords.pro | 1 - .../auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro | 5 ----- tools/qev/qev.pro | 2 -- 5 files changed, 12 deletions(-) diff --git a/demos/qtdemo/qtdemo.pro b/demos/qtdemo/qtdemo.pro index 011ea0c..2a776ac 100644 --- a/demos/qtdemo/qtdemo.pro +++ b/demos/qtdemo/qtdemo.pro @@ -3,8 +3,6 @@ TARGET = qtdemo DEMO_DESTDIR = $$QT_BUILD_TREE isEmpty(DEMO_DESTDIR):DEMO_DESTDIR=../.. DESTDIR = $$DEMO_DESTDIR/bin -OBJECTS_DIR = .obj -MOC_DIR = .moc INSTALLS += target sources diff --git a/examples/threads/waitconditions/waitconditions.pro b/examples/threads/waitconditions/waitconditions.pro index b07b413..c2be6cd 100644 --- a/examples/threads/waitconditions/waitconditions.pro +++ b/examples/threads/waitconditions/waitconditions.pro @@ -10,8 +10,6 @@ INCLUDEPATH += . # Input SOURCES += waitconditions.cpp CONFIG += qt warn_on create_prl link_prl console -OBJECTS_DIR=obj/debug-shared -MOC_DIR=moc/debug-shared # install target.path = $$[QT_INSTALL_EXAMPLES]/threads/waitconditions diff --git a/src/tools/moc/util/generate_keywords.pro b/src/tools/moc/util/generate_keywords.pro index 8dff744..eb04409 100644 --- a/src/tools/moc/util/generate_keywords.pro +++ b/src/tools/moc/util/generate_keywords.pro @@ -10,4 +10,3 @@ INCLUDEPATH += . # Input SOURCES += generate_keywords.cpp CONFIG += qt create_prl link_prl -OBJECTS_DIR=.obj/debug-shared diff --git a/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro b/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro index 93a03db..e8b1ce9 100644 --- a/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro +++ b/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro @@ -13,8 +13,3 @@ wince*|symbian*:TARGET = ../desktopsettingsaware SOURCES += main.cpp CONFIG += qt warn_on create_prl link_prl CONFIG -= app_bundle - -!symbian*: { -OBJECTS_DIR=.obj/debug-shared -MOC_DIR=.moc/debug-shared -} diff --git a/tools/qev/qev.pro b/tools/qev/qev.pro index 28383c6..962b9fa 100644 --- a/tools/qev/qev.pro +++ b/tools/qev/qev.pro @@ -9,5 +9,3 @@ INCLUDEPATH += . # Input SOURCES += qev.cpp CONFIG += qt warn_on create_prl link_prl -OBJECTS_DIR=.obj/debug-shared -MOC_DIR=.moc/debug-shared -- cgit v0.12 From edb37d5ab12c061b6085d0a84fcf075faf2dba54 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 2 Mar 2010 14:12:32 +0100 Subject: Added a documentation for the new enum value in gesture api. Task-number: QTBUG-7400 Reviewed-by: David Boddie --- src/corelib/global/qnamespace.qdoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index db910ce..c5b5998 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2978,6 +2978,11 @@ the Qt::GestureStarted state and ending with a gesture in the Qt::GestureFinished or Qt::GestureCanceled states. + \value IgnoredGesturesPropagateToParent Since Qt 4.7, this flag allows you + to fine-tune gesture event propagation. By setting the flag when + \l{QGraphicsObject::grabGesture}{grabbing} a gesture all ignored partial + gestures will propagate to their parent items. + \sa QWidget::grabGesture(), QGraphicsObject::grabGesture() */ -- cgit v0.12 From 1a666089d84cb85ec8e2bda3fe0fff6f2ec2ec4a Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 2 Mar 2010 15:00:55 +0100 Subject: Allow building documentation without all of Qt added a new make target 'sub-qdoc3' which builds qdoc3 and it's dependencies only, so that when running "make docs" we don't build all of sub-tools (including declarative module), but qdoc3 only Reviewed-by: David Boddie Reviewed-by: Joao --- doc/doc.pri | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/doc.pri b/doc/doc.pri index aea5b08..3d04049 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -43,11 +43,11 @@ win32-g++:isEmpty(QMAKE_SH) { # Build rules: adp_docs.commands = ($$QDOC $$ADP_DOCS_QDOCCONF_FILE) -adp_docs.depends += sub-tools # qdoc3 +adp_docs.depends += sub-qdoc3 # qdoc3 qch_docs.commands = $$QT_DOCUMENTATION -qch_docs.depends += sub-tools +qch_docs.depends += sub-qdoc3 -docs.depends = adp_docs qch_docs +docs.depends = sub-qdoc3 adp_docs qch_docs docs_zh_CN.depends = docs docs_zh_CN.commands = $$QT_ZH_CN_DOCUMENTATION @@ -64,5 +64,8 @@ qchdocs.CONFIG += no_check_exist docimages.files = $$QT_BUILD_TREE/doc/src/images docimages.path = $$[QT_INSTALL_DOCS]/src -QMAKE_EXTRA_TARGETS += qdoc adp_docs qch_docs docs docs_zh_CN +sub-qdoc3.depends = sub-corelib sub-xml +sub-qdoc3.commands += (cd tools/qdoc3 && $(MAKE)) + +QMAKE_EXTRA_TARGETS += sub-qdoc3 adp_docs qch_docs docs docs_zh_CN INSTALLS += htmldocs qchdocs docimages -- cgit v0.12 From a0cb1ae902dce0c00dc2de8b92229d66945054c8 Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Thu, 4 Mar 2010 14:26:24 +0100 Subject: Setting ImhHiddenText for NoEcho line edits is not 100% correct, but still way better than fully visible text. Reviewed-by: axis --- src/gui/widgets/qlineedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 94ee4b3..817547c 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -539,7 +539,7 @@ void QLineEdit::setEchoMode(EchoMode mode) if (mode == (EchoMode)d->control->echoMode()) return; Qt::InputMethodHints imHints = inputMethodHints(); - if (mode == Password) { + if (mode == Password || mode == NoEcho) { imHints |= Qt::ImhHiddenText; } else { imHints &= ~Qt::ImhHiddenText; -- cgit v0.12