From e62ab752373086b58f351b14acdf98a8afffb515 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 13 Dec 2012 13:16:42 +0100 Subject: [PATCH 01/23] Fix QGtkPainter::reset() to reset the clip rect Due to preparation for GTK3 support, QGtkStyle::drawXxx() no longer creates a local instance of QGtkPainter upon every call, but QGtkStylePrivate::gtkPainter() will (in the future) dynamically choose between QGtk[2|3]Painter. The same painter instance is now re-used between the calls, but wasn't properly reseted between. Task-number: QTBUG-28557 Change-Id: I29be318dbb54d97ed23dfb88d406a3a833db4369 Reviewed-by: Jens Bache-Wiig (cherry picked from commit 0b0b74a563d1513e7857000526d5c0fa462ff6af) Reviewed-by: Sergio Ahumada --- src/widgets/styles/qgtkpainter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widgets/styles/qgtkpainter.cpp b/src/widgets/styles/qgtkpainter.cpp index a5c408f20db..206dbf7e0f9 100644 --- a/src/widgets/styles/qgtkpainter.cpp +++ b/src/widgets/styles/qgtkpainter.cpp @@ -63,6 +63,7 @@ void QGtkPainter::reset(QPainter *painter) m_hflipped = false; m_vflipped = false; m_usePixmapCache = true; + m_cliprect = QRect(); } QString QGtkPainter::uniqueName(const QString &key, GtkStateType state, GtkShadowType shadow, From 22929c5dfc98901a86a231a84dde90b19b94f8e5 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 30 Oct 2012 14:01:12 +0100 Subject: [PATCH 02/23] Mac: fix bugs for font selection in QFontDialog Use localized family name and style name when selecting font with non-English locale Task-number: QTBUG-27415 Change-Id: Ie81507ed011fc096e0f5edad146e97c392e86494 Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit 3c09f6bc9aee0c97427fe8da6efdc73b4ac473aa) --- src/gui/text/qfontdatabase.cpp | 2 +- .../platforms/cocoa/qcocoafontdialoghelper.mm | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index b59966012c5..a560b415704 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -595,7 +595,7 @@ QtFontFamily *QFontDatabasePrivate::family(const QString &f, bool create) if (res < 0) pos++; - // qDebug("adding family %s at %d total=%d", f.latin1(), pos, count); + // qDebug() << "adding family " << f.toLatin1() << " at " << pos << " total=" << count; if (!(count % 8)) { QtFontFamily **newFamilies = (QtFontFamily **) realloc(families, diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index 5ccd019a9be..ff3ba63931f 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -92,20 +92,16 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont) QFont newFont; if (cocoaFont) { int pSize = qRound([cocoaFont pointSize]); - QString family(QCFString::toQString([cocoaFont familyName])); - QString typeface(QCFString::toQString([cocoaFont fontName])); + CTFontDescriptorRef font = CTFontCopyFontDescriptor((CTFontRef)cocoaFont); + // QCoreTextFontDatabase::populateFontDatabase() is using localized names + QString family = QCFString::toQString((CFStringRef) CTFontDescriptorCopyLocalizedAttribute(font, kCTFontFamilyNameAttribute, NULL)); + QString style = QCFString::toQString((CFStringRef) CTFontDescriptorCopyLocalizedAttribute(font, kCTFontStyleNameAttribute, NULL)); - int hyphenPos = typeface.indexOf(QLatin1Char('-')); - if (hyphenPos != -1) { - typeface.remove(0, hyphenPos + 1); - } else { - typeface = QLatin1String("Normal"); - } - - newFont = QFontDatabase().font(family, typeface, pSize); + newFont = QFontDatabase().font(family, style, pSize); newFont.setUnderline(resolveFont.underline()); newFont.setStrikeOut(resolveFont.strikeOut()); + CFRelease(font); } return newFont; } From 133bbf6ea9b9e6dff82361bf2101a35d42f0fbe0 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 11 Jul 2012 14:39:54 +0200 Subject: [PATCH 03/23] Fix styleName support in QPA font database Font styleName support was disconnected since Qt switched to QPA fontdatabase. Now add the code from Qt 4.8 back to enable this in QPA. Change-Id: Iab2cbfd5468f87542183348c2123ca4b2c270692 Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit fa7661d8b25fa338649a301010e1b5a2b63da731) --- src/gui/text/qfontdatabase.cpp | 25 +++++-------------- src/gui/text/qfontdatabase_qpa.cpp | 5 ++-- src/gui/text/qplatformfontdatabase.cpp | 10 +++++--- src/gui/text/qplatformfontdatabase.h | 3 ++- .../basic/qbasicfontdatabase.cpp | 2 +- .../fontconfig/qfontconfigdatabase.cpp | 14 +++++++---- .../mac/qcoretextfontdatabase.mm | 3 ++- .../windows/qwindowsfontdatabase.cpp | 8 +++--- .../windows/qwindowsfontdatabase_ft.cpp | 8 +++--- 9 files changed, 37 insertions(+), 41 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index a560b415704..d06bf217cb3 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -274,27 +274,15 @@ struct QtFontFoundry QtFontStyle *QtFontFoundry::style(const QtFontStyle::Key &key, const QString &styleName, bool create) { int pos = 0; - if (count) { - // if styleName for searching first if possible - if (!styleName.isEmpty()) { - for (; pos < count; pos++) { - if (styles[pos]->styleName == styleName) - return styles[pos]; - } - } - int low = 0; - int high = count; - pos = count / 2; - while (high > low) { + for (; pos < count; pos++) { + bool hasStyleName = !styleName.isEmpty(); // search styleName first if available + if (hasStyleName && !styles[pos]->styleName.isEmpty()) { + if (styles[pos]->styleName == styleName) + return styles[pos]; + } else { if (styles[pos]->key == key) return styles[pos]; - if (styles[pos]->key < key) - low = pos + 1; - else - high = pos; - pos = (high + low) / 2; } - pos = low; } if (!create) return 0; @@ -309,7 +297,6 @@ QtFontStyle *QtFontFoundry::style(const QtFontStyle::Key &key, const QString &st QtFontStyle *style = new QtFontStyle(key); style->styleName = styleName; - memmove(styles + pos + 1, styles + pos, (count-pos)*sizeof(QtFontStyle *)); styles[pos] = style; count++; return styles[pos]; diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index 22aacf1dcd4..2ecab9ebf98 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -52,7 +52,8 @@ QT_BEGIN_NAMESPACE -Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &foundryname, int weight, +Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &stylename, + const QString &foundryname, int weight, QFont::Style style, int stretch, bool antialiased, bool scalable, int pixelSize, bool fixedPitch, const QSupportedWritingSystems &writingSystems, void *handle) @@ -75,7 +76,7 @@ Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &fou } QtFontFoundry *foundry = f->foundry(foundryname, true); - QtFontStyle *fontStyle = foundry->style(styleKey, QString(), true); + QtFontStyle *fontStyle = foundry->style(styleKey, stylename, true); fontStyle->smoothScalable = scalable; fontStyle->antialiased = antialiased; QtFontSize *size = fontStyle->pixelSize(pixelSize ? pixelSize : SMOOTH_SCALABLE, true); diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp index 6fd145d921e..972e0b1a09e 100644 --- a/src/gui/text/qplatformfontdatabase.cpp +++ b/src/gui/text/qplatformfontdatabase.cpp @@ -47,7 +47,8 @@ QT_BEGIN_NAMESPACE -extern void qt_registerFont(const QString &familyname, const QString &foundryname, int weight, +extern void qt_registerFont(const QString &familyname, const QString &stylename, + const QString &foundryname, int weight, QFont::Style style, int stretch, bool antialiased, bool scalable, int pixelSize, bool fixedPitch, const QSupportedWritingSystems &writingSystems, void *hanlde); @@ -89,7 +90,7 @@ void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void * } } QFont::Stretch stretch = QFont::Unstretched; - registerFont(fontName,QString(),fontWeight,fontStyle,stretch,true,false,pixelSize,false,writingSystems,handle); + registerFont(fontName,QString(),QString(),fontWeight,fontStyle,stretch,true,false,pixelSize,false,writingSystems,handle); } } else { qDebug() << "header verification of QPF2 font failed. maybe it is corrupt?"; @@ -117,7 +118,8 @@ void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void * \sa registerQPF2Font() */ -void QPlatformFontDatabase::registerFont(const QString &familyname, const QString &foundryname, QFont::Weight weight, +void QPlatformFontDatabase::registerFont(const QString &familyname, const QString &stylename, + const QString &foundryname, QFont::Weight weight, QFont::Style style, QFont::Stretch stretch, bool antialiased, bool scalable, int pixelSize, bool fixedPitch, const QSupportedWritingSystems &writingSystems, void *usrPtr) @@ -125,7 +127,7 @@ void QPlatformFontDatabase::registerFont(const QString &familyname, const QStrin if (scalable) pixelSize = 0; - qt_registerFont(familyname, foundryname, weight, style, + qt_registerFont(familyname, stylename, foundryname, weight, style, stretch, antialiased, scalable, pixelSize, fixedPitch, writingSystems, usrPtr); } diff --git a/src/gui/text/qplatformfontdatabase.h b/src/gui/text/qplatformfontdatabase.h index 8c2e4cf5f72..5ff25429825 100644 --- a/src/gui/text/qplatformfontdatabase.h +++ b/src/gui/text/qplatformfontdatabase.h @@ -116,7 +116,8 @@ public: //callback static void registerQPF2Font(const QByteArray &dataArray, void *handle); - static void registerFont(const QString &familyname, const QString &foundryname, QFont::Weight weight, + static void registerFont(const QString &familyname, const QString &stylename, + const QString &foundryname, QFont::Weight weight, QFont::Style style, QFont::Stretch stretch, bool antialiased, bool scalable, int pixelSize, bool fixedPitch, const QSupportedWritingSystems &writingSystems, void *handle); diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp index dd6f04f74d8..996ea852490 100644 --- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp @@ -452,7 +452,7 @@ QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByt QFont::Stretch stretch = QFont::Unstretched; - registerFont(family,QString(),weight,style,stretch,true,true,0,fixedPitch,writingSystems,fontFile); + registerFont(family,QString::fromLatin1(face->style_name),QString(),weight,style,stretch,true,true,0,fixedPitch,writingSystems,fontFile); families.append(family); diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index cf6ff11acd7..d23588d22da 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -318,6 +318,7 @@ void QFontconfigDatabase::populateFontDatabase() FcChar8 *file_value; int indexValue; FcChar8 *foundry_value; + FcChar8 *style_value; FcBool scalable; FcBool antialias; @@ -325,7 +326,7 @@ void QFontconfigDatabase::populateFontDatabase() FcObjectSet *os = FcObjectSetCreate(); FcPattern *pattern = FcPatternCreate(); const char *properties [] = { - FC_FAMILY, FC_WEIGHT, FC_SLANT, + FC_FAMILY, FC_STYLE, FC_WEIGHT, FC_SLANT, FC_SPACING, FC_FILE, FC_INDEX, FC_LANG, FC_CHARSET, FC_FOUNDRY, FC_SCALABLE, FC_PIXEL_SIZE, FC_WEIGHT, FC_WIDTH, @@ -371,6 +372,8 @@ void QFontconfigDatabase::populateFontDatabase() scalable = FcTrue; if (FcPatternGetString(fonts->fonts[i], FC_FOUNDRY, 0, &foundry_value) != FcResultMatch) foundry_value = 0; + if (FcPatternGetString(fonts->fonts[i], FC_STYLE, 0, &style_value) != FcResultMatch) + style_value = 0; if(FcPatternGetBool(fonts->fonts[i],FC_ANTIALIAS,0,&antialias) != FcResultMatch) antialias = true; @@ -438,7 +441,8 @@ void QFontconfigDatabase::populateFontDatabase() bool fixedPitch = spacing_value >= FC_MONO; QFont::Stretch stretch = QFont::Unstretched; - QPlatformFontDatabase::registerFont(familyName,QLatin1String((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,fixedPitch,writingSystems,fontFile); + QString styleName = style_value ? QString::fromUtf8((const char *) style_value) : QString(); + QPlatformFontDatabase::registerFont(familyName,styleName,QLatin1String((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,fixedPitch,writingSystems,fontFile); // qDebug() << familyName << (const char *)foundry_value << weight << style << &writingSystems << scalable << true << pixel_size; } @@ -462,9 +466,9 @@ void QFontconfigDatabase::populateFontDatabase() while (f->qtname) { QString familyQtName = QString::fromLatin1(f->qtname); - registerFont(familyQtName,QString(),QFont::Normal,QFont::StyleNormal,QFont::Unstretched,true,true,0,f->fixed,ws,0); - registerFont(familyQtName,QString(),QFont::Normal,QFont::StyleItalic,QFont::Unstretched,true,true,0,f->fixed,ws,0); - registerFont(familyQtName,QString(),QFont::Normal,QFont::StyleOblique,QFont::Unstretched,true,true,0,f->fixed,ws,0); + registerFont(familyQtName,QString(),QString(),QFont::Normal,QFont::StyleNormal,QFont::Unstretched,true,true,0,f->fixed,ws,0); + registerFont(familyQtName,QString(),QString(),QFont::Normal,QFont::StyleItalic,QFont::Unstretched,true,true,0,f->fixed,ws,0); + registerFont(familyQtName,QString(),QString(),QFont::Normal,QFont::StyleOblique,QFont::Unstretched,true,true,0,f->fixed,ws,0); ++f; } diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 99a316bef32..4ea38cb74ef 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -227,6 +227,7 @@ void QCoreTextFontDatabase::populateFontDatabase() for (int i = 0; i < numFonts; ++i) { CTFontDescriptorRef font = (CTFontDescriptorRef) CFArrayGetValueAtIndex(fonts, i); QCFString familyName = (CFStringRef) CTFontDescriptorCopyLocalizedAttribute(font, kCTFontFamilyNameAttribute, NULL); + QCFString styleName = (CFStringRef)CTFontDescriptorCopyLocalizedAttribute(font, kCTFontStyleNameAttribute, NULL); QCFType styles = (CFDictionaryRef) CTFontDescriptorCopyAttribute(font, kCTFontTraitsAttribute); QFont::Weight weight = QFont::Normal; QFont::Style style = QFont::StyleNormal; @@ -285,7 +286,7 @@ void QCoreTextFontDatabase::populateFontDatabase() } CFRetain(font); - QPlatformFontDatabase::registerFont(familyName, foundryName, weight, style, stretch, + QPlatformFontDatabase::registerFont(familyName, styleName, foundryName, weight, style, stretch, true /* antialiased */, true /* scalable */, pixelSize, fixedPitch, writingSystems, (void *) font); CFStringRef psName = (CFStringRef) CTFontDescriptorCopyAttribute(font, kCTFontNameAttribute); diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp index 262b610745c..1a899c848e2 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp @@ -1033,17 +1033,17 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName, writingSystems.setSupported(ws); } - QPlatformFontDatabase::registerFont(familyName, foundryName, weight, + QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, weight, style, stretch, antialias, scalable, size, fixed, writingSystems, 0); // add fonts windows can generate for us: if (weight <= QFont::DemiBold) - QPlatformFontDatabase::registerFont(familyName, foundryName, QFont::Bold, + QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, QFont::Bold, style, stretch, antialias, scalable, size, fixed, writingSystems, 0); if (style != QFont::StyleItalic) - QPlatformFontDatabase::registerFont(familyName, foundryName, weight, + QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, weight, QFont::StyleItalic, stretch, antialias, scalable, size, fixed, writingSystems, 0); if (weight <= QFont::DemiBold && style != QFont::StyleItalic) - QPlatformFontDatabase::registerFont(familyName, foundryName, QFont::Bold, + QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, QFont::Bold, QFont::StyleItalic, stretch, antialias, scalable, size, fixed, writingSystems, 0); if (!englishName.isEmpty()) diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp index 4c3d412b8eb..7d091664738 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp @@ -279,20 +279,20 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName, if (!QDir::isAbsolutePath(value)) value.prepend(QString::fromLocal8Bit(qgetenv("windir") + "\\Fonts\\")); - QPlatformFontDatabase::registerFont(faceName, foundryName, weight, style, stretch, + QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, weight, style, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(value, index)); // add fonts windows can generate for us: if (weight <= QFont::DemiBold) - QPlatformFontDatabase::registerFont(faceName, foundryName, QFont::Bold, style, stretch, + QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, QFont::Bold, style, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(value, index)); if (style != QFont::StyleItalic) - QPlatformFontDatabase::registerFont(faceName, foundryName, weight, QFont::StyleItalic, stretch, + QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, weight, QFont::StyleItalic, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(value, index)); if (weight <= QFont::DemiBold && style != QFont::StyleItalic) - QPlatformFontDatabase::registerFont(faceName, foundryName, QFont::Bold, QFont::StyleItalic, stretch, + QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, QFont::Bold, QFont::StyleItalic, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(value, index)); if (!englishName.isEmpty()) From f1b88369ef5e424838e87a63c98c17e8eee13fae Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 13 Dec 2012 08:30:29 +0100 Subject: [PATCH 04/23] Mark QGlyphRun and QStaticText tests as insignificant on Linux These tests have been failing on certain setups for a while, but some new critical changes causes the failure to trigger on the CI system as well. We mark them as insignificant until they can be fixed. Change-Id: I467e7030c55d6f23515275b4062c17068d2b688c Reviewed-by: Andy Shaw (cherry picked from commit 04f25ac46ca0956dfd1209b14a1eee9e2e1274c2) Reviewed-by: Eskil Abrahamsen Blomfeldt --- tests/auto/gui/text/qglyphrun/qglyphrun.pro | 2 ++ tests/auto/gui/text/qstatictext/qstatictext.pro | 1 + 2 files changed, 3 insertions(+) diff --git a/tests/auto/gui/text/qglyphrun/qglyphrun.pro b/tests/auto/gui/text/qglyphrun/qglyphrun.pro index 67eb1d1b2b1..45680febf3a 100644 --- a/tests/auto/gui/text/qglyphrun/qglyphrun.pro +++ b/tests/auto/gui/text/qglyphrun/qglyphrun.pro @@ -3,6 +3,8 @@ CONFIG += parallel_test TARGET = tst_qglyphrun QT = core gui testlib +linux: CONFIG += insignificant_test + SOURCES += \ tst_qglyphrun.cpp diff --git a/tests/auto/gui/text/qstatictext/qstatictext.pro b/tests/auto/gui/text/qstatictext/qstatictext.pro index 38ab1209854..772b68cfffc 100644 --- a/tests/auto/gui/text/qstatictext/qstatictext.pro +++ b/tests/auto/gui/text/qstatictext/qstatictext.pro @@ -1,5 +1,6 @@ CONFIG += testcase CONFIG += parallel_test +linux: CONFIG += insignificant_test TARGET = tst_qstatictext QT += testlib QT += core core-private gui gui-private From c629bf001978b5713464da81fce2f0bd7dcf2435 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 13 Dec 2012 10:07:48 +0100 Subject: [PATCH 05/23] Mark QAbstractTextDocumentLayout test as insignificant This test fails on some setups and a pending critical change causes the existing bug to trigger in CI. To avoid blocking other changes because of this bug, it's been marked as insignificant until such a time when it can be fixed. Change-Id: Ide41f7b1c76209f9c05f95f996b2364d5dea5e67 Reviewed-by: Liang Qi Reviewed-by: Andy Shaw (cherry picked from commit 02032fb229e4a26b2848db60e90820e2daeb3363) Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro b/tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro index 801e9dc7be9..bb6457853ea 100644 --- a/tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro +++ b/tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro @@ -7,6 +7,6 @@ CONFIG += parallel_test TARGET = tst_qabstracttextdocumentlayout QT += testlib SOURCES += tst_qabstracttextdocumentlayout.cpp - +linux: CONFIG += insignificant_test DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 From d454cb08daa0aa0b5b4798e9e1c9e6617a572f31 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 13 Dec 2012 12:31:02 +0100 Subject: [PATCH 06/23] add .rpath only for dynamic unix builds rpath is meaningless for static libraries. and windows has no concept of rpaths to start with. Change-Id: Ia02bbdfbf7112e7082175c3051c0839ac0900f57 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module.prf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index ad8d9aab558..be0ca0b1986 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -40,6 +40,10 @@ MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri !build_pass { # Create a module .pri file + unix:!static: \ + module_rpath = "QT.$${MODULE}.rpath = $$[QT_INSTALL_LIBS/raw]" + else: \ + module_rpath = !isEmpty(QT_FOR_PRIVATE) { contains(QT_FOR_PRIVATE, .*-private$):error("QT_FOR_PRIVATE may not contain *-private.") module_privdep = "QT.$${MODULE}.private_depends = $$QT_FOR_PRIVATE" @@ -74,7 +78,7 @@ MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri "QT.$${MODULE}.sources = $$val_escape(_PRO_FILE_PWD_)" \ "QT.$${MODULE}.libs = \$\$QT_MODULE_LIB_BASE" \ "QT.$${MODULE}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \ - "QT.$${MODULE}.rpath = $$[QT_INSTALL_LIBS/raw]" \ + $$module_rpath \ "QT.$${MODULE}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \ "QT.$${MODULE}.imports = \$\$QT_MODULE_IMPORT_BASE" \ "QT.$${MODULE}.qml = \$\$QT_MODULE_QML_BASE" \ From 719ca7c53ae5d78d2928ee763efbd9160d581531 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 7 Dec 2012 13:28:43 +0100 Subject: [PATCH 07/23] Remove win32/thread.prf and thread_off.prf The variables these files refer to are not set anywhere anymore. The Unix thread.prf file is still needed, as it is still effective and is activated by qt.prf. Task-number: QTBUG-25106 Change-Id: Ia514192d28785205df3710d78ee597285d4136b0 Reviewed-by: Joerg Bornemann --- mkspecs/features/win32/thread.prf | 22 ---------------------- mkspecs/features/win32/thread_off.prf | 2 -- 2 files changed, 24 deletions(-) delete mode 100644 mkspecs/features/win32/thread.prf delete mode 100644 mkspecs/features/win32/thread_off.prf diff --git a/mkspecs/features/win32/thread.prf b/mkspecs/features/win32/thread.prf deleted file mode 100644 index fc832a0990e..00000000000 --- a/mkspecs/features/win32/thread.prf +++ /dev/null @@ -1,22 +0,0 @@ -CONFIG -= thread_off - -# #### These need to go -debug { - contains(DEFINES, QT_DLL) { - QMAKE_CFLAGS += $$QMAKE_CFLAGS_MT_DLLDBG - QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_MT_DLLDBG - } else { - QMAKE_CFLAGS += $$QMAKE_CFLAGS_MT_DBG - QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_MT_DBG - } -} else { - contains(DEFINES, QT_DLL) { - QMAKE_CFLAGS += $$QMAKE_CFLAGS_MT_DLL - QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_MT_DLL - } else { - QMAKE_CFLAGS += $$QMAKE_CFLAGS_MT - QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_MT - } -} - -QMAKE_LIBS += $$QMAKE_LIBS_RTMT diff --git a/mkspecs/features/win32/thread_off.prf b/mkspecs/features/win32/thread_off.prf deleted file mode 100644 index 436a2c81664..00000000000 --- a/mkspecs/features/win32/thread_off.prf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG -= thread -QMAKE_LIBS += $$QMAKE_LIBS_RT From d0bce448cf02c25eded28a82cb4d6acb4fb61c1b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 7 Dec 2012 20:19:03 +0100 Subject: [PATCH 08/23] stop defining QT..sources it's the very antithesis of modularization to do it. Task-number: QTBUG-27722 Change-Id: I2540e1a70e67b55420246d0c209314c05c65a85f Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module.prf | 1 - mkspecs/features/qt_module_fwdpri.prf | 1 - 2 files changed, 2 deletions(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index be0ca0b1986..22cec4d987b 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -75,7 +75,6 @@ MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri "QT.$${MODULE}.bins = \$\$QT_MODULE_BIN_BASE" \ "QT.$${MODULE}.includes = $$MODULE_INCLUDES" \ "QT.$${MODULE}.private_includes = $$MODULE_PRIVATE_INCLUDES" \ - "QT.$${MODULE}.sources = $$val_escape(_PRO_FILE_PWD_)" \ "QT.$${MODULE}.libs = \$\$QT_MODULE_LIB_BASE" \ "QT.$${MODULE}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \ $$module_rpath \ diff --git a/mkspecs/features/qt_module_fwdpri.prf b/mkspecs/features/qt_module_fwdpri.prf index 0b203b5a903..e62eecc3440 100644 --- a/mkspecs/features/qt_module_fwdpri.prf +++ b/mkspecs/features/qt_module_fwdpri.prf @@ -48,7 +48,6 @@ # Create a forwarding module .pri file MODULE_FWD_PRI_CONT = \ - "QT_MODULE_BASE = $$MODULE_BASE_DIR" \ "QT_MODULE_BIN_BASE = $$MODULE_BASE_OUTDIR/bin" \ "QT_MODULE_INCLUDE_BASE = $$MODULE_BASE_OUTDIR/include" \ "QT_MODULE_IMPORT_BASE = $$MODULE_BASE_OUTDIR/imports" \ From 5648bbbcbca0e6bbd71dbd9c49ab9de260e1c3c6 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 12 Dec 2012 14:15:38 +0100 Subject: [PATCH 09/23] Doc: remove example docs that were moved to qttools Remove docs and images for Multiple Inheritance and Text Finder examples that were moved to qttools/uitools. Change-Id: I29e8f76b2512e329c354a6d3676c9b2e09e35726 Reviewed-by: Friedemann Kleint Reviewed-by: David Schulz (cherry picked from commit a0a4c06736a71fedb69f01c1c4c423173a2a665e) Reviewed-by: Sergio Ahumada --- doc/src/examples/multipleinheritance.qdoc | 94 ----------- .../code/doc_src_examples_textfinder.pro | 6 - examples/tools/doc/textfinder.qdoc | 159 ------------------ .../textfinder-example-userinterface.png | Bin 7900 -> 0 bytes 4 files changed, 259 deletions(-) delete mode 100644 doc/src/examples/multipleinheritance.qdoc delete mode 100644 doc/src/snippets/code/doc_src_examples_textfinder.pro delete mode 100644 examples/tools/doc/textfinder.qdoc delete mode 100644 examples/widgets/doc/images/textfinder-example-userinterface.png diff --git a/doc/src/examples/multipleinheritance.qdoc b/doc/src/examples/multipleinheritance.qdoc deleted file mode 100644 index 541dc3c719f..00000000000 --- a/doc/src/examples/multipleinheritance.qdoc +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example uitools/multipleinheritance - \title Multiple Inheritance Example - - The Multiple Inheritance Example shows how to use a form created with - Qt Designer in an application by subclassing both QWidget and the user - interface class, which is \c{Ui::CalculatorForm}. - - \image multipleinheritance-example.png - - To subclass the \c calculatorform.ui file and ensure that \c qmake - processes it with the \c uic, we have to include \c calculatorform.ui - in the \c .pro file, as shown below: - - \snippet examples/uitools/multipleinheritance/multipleinheritance.pro 0 - - When the project is compiled, the \c uic will generate a corresponding - \c ui_calculatorform.h. - - \section1 CalculatorForm Definition - - In the \c CalculatorForm definition, we include the \c ui_calculatorform.h - that was generated earlier. - - \snippet examples/uitools/multipleinheritance/calculatorform.h 0 - - As mentioned earlier, the class is a subclass of both QWidget and - \c{Ui::CalculatorForm}. - - \snippet examples/uitools/multipleinheritance/calculatorform.h 1 - - Two slots are defined according to the \l{Automatic Connections} - {automatic connection} naming convention required by \c uic. This is - to ensure that \l{QMetaObject}'s auto-connection facilities connect - all the signals and slots involved automatically. - - \section1 CalculatorForm Implementation - - In the constructor, we call \c setupUi() to load the user interface file. - Note that we do not need the \c{ui} prefix as \c CalculatorForm is a - subclass of the user interface class. - - \snippet examples/uitools/multipleinheritance/calculatorform.cpp 0 - - We include two slots, \c{on_inputSpinBox1_valueChanged()} and - \c{on_inputSpinBox2_valueChanged()}. These slots respond to the - \l{QSpinBox::valueChanged()}{valueChanged()} signal that both spin boxes - emit. Whenever there is a change in one spin box's value, we take that - value and add it to whatever value the other spin box has. - - \snippet examples/uitools/multipleinheritance/calculatorform.cpp 1 - \codeline - \snippet examples/uitools/multipleinheritance/calculatorform.cpp 2 - - \section1 \c main() Function - - The \c main() function instantiates QApplication and \c CalculatorForm. - The \c calculator object is displayed by invoking the \l{QWidget::show()} - {show()} function. - - \snippet examples/uitools/multipleinheritance/main.cpp 0 - - There are various approaches to include forms into applications. The - Multiple Inheritance approach is just one of them. See - \l{Using a Designer UI File in Your Application} for more information on - the other approaches available. -*/ diff --git a/doc/src/snippets/code/doc_src_examples_textfinder.pro b/doc/src/snippets/code/doc_src_examples_textfinder.pro deleted file mode 100644 index 4446e8eb7ba..00000000000 --- a/doc/src/snippets/code/doc_src_examples_textfinder.pro +++ /dev/null @@ -1,6 +0,0 @@ -#! [0] -QT += uitools -HEADERS = textfinder.h -RESOURCES = textfinder.qrc -SOURCES = textfinder.cpp main.cpp -#! [0] diff --git a/examples/tools/doc/textfinder.qdoc b/examples/tools/doc/textfinder.qdoc deleted file mode 100644 index f958cf8623d..00000000000 --- a/examples/tools/doc/textfinder.qdoc +++ /dev/null @@ -1,159 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example uitools/textfinder - \title Text Finder Example - - \brief The Text Finder example demonstrates how to dynamically process forms - using the QtUiTools module. Dynamic form processing enables a form to - be processed at run-time only by changing the UI file for the project. - The program allows the user to look up a particular word within the - contents of a text file. This text file is included in the project's - resource and is loaded into the display at startup. - - \table - \row \li \inlineimage textfinder-example-find.png - \li \inlineimage textfinder-example-find2.png - \endtable - - \section1 Setting Up The Resource File - - The resources required for Text Finder are: - \list - \li \e{textfinder.ui} - the user interface file created in QtDesigner - \li \e{input.txt} - a text file containing some text to be displayed - in the QTextEdit - \endlist - - \e{textfinder.ui} contains all the necessary QWidget objects for the - Text Finder. A QLineEdit is used for the user input, a QTextEdit is - used to display the contents of \e{input.txt}, a QLabel is used to - display the text "Keyword", and a QPushButton is used for the "Find" - button. The screenshot below shows the preview obtained in QtDesigner. - - \image textfinder-example-userinterface.png - - A \e{textfinder.qrc} file is used to store both the \e{textfinder.ui} - and \e{input.txt} in the application's executable. The file contains - the following code: - - \quotefile examples/uitools/textfinder/textfinder.qrc - - For more information on resource files, see \l{The Qt Resource System}. - - To generate a form at run-time, the example is linked against the - QtUiTools module library. This is done in the \c{textfinder.pro} file - that contains the following lines: - - \snippet doc/src/snippets/code/doc_src_examples_textfinder.pro 0 - - \section1 TextFinder Class Definition - - The \c TextFinder class is a subclass of QWidget and it hosts the - \l{QWidget}s we need to access in the user interface. The QLabel in the - user interface is not declared here as we do not need to access it. - - \snippet examples/uitools/textfinder/textfinder.h 0 - - The slot \c{on_findButton_clicked()} is a slot named according to the - \l{Using a Designer UI File in Your Application#Automatic Connections} - {Automatic Connection} naming convention required - by \c uic. - - \section1 TextFinder Class Implementation - - The \c TextFinder class's constructor calls the \c loadUiFile() function - and then uses \c qFindChild() to access the user interface's - \l{QWidget}s. - - \snippet examples/uitools/textfinder/textfinder.cpp 0 - - We then use QMetaObject's system to enable signal and slot connections. - - \snippet examples/uitools/textfinder/textfinder.cpp 2 - - The loadTextFile() function is called to load \c{input.txt} into - QTextEdit to displays its contents. - - \snippet examples/uitools/textfinder/textfinder.cpp 3a - - The \c{TextFinder}'s layout is set with \l{QWidget::}{setLayout()}. - - \snippet examples/uitools/textfinder/textfinder.cpp 3b - - Finally, the window title is set to \e {Text Finder} and \c isFirstTime is - set to true. - - \c isFirstTime is used as a flag to indicate whether the search operation - has been performed more than once. This is further explained with the - \c{on_findButton_clicked()} function. - - The \c{loadUiFile()} function is used to load the user interface file - previously created in QtDesigner. The QUiLoader class is instantiated - and its \c load() function is used to load the form into \c{formWidget} - that acts as a place holder for the user interface. The function then - returns \c{formWidget} to its caller. - - \snippet examples/uitools/textfinder/textfinder.cpp 4 - - As mentioned earlier, the loadTextFile() function loads \e{input.txt} - into QTextEdit to display its contents. Data is read using QTextStream - into a QString object, \c line with the QTextStream::readAll() function. - The contents of \c line are then appended to \c{ui_textEdit}. - - \snippet examples/uitools/textfinder/textfinder.cpp 5 - - The \c{on_findButton_clicked()} function is a slot that is connected to - \c{ui_findButton}'s \c clicked() signal. The \c searchString is extracted - from the \c ui_lineEdit and the \c document is extracted from \c textEdit. - In event there is an empty \c searchString, a QMessageBox is used, - requesting the user to enter a word. Otherwise, we traverse through the - words in \c ui_textEdit, and highlight all ocurrences of the - \c searchString . Two QTextCursor objects are used: One to traverse through - the words in \c line and another to keep track of the edit blocks. - - \snippet examples/uitools/textfinder/textfinder.cpp 7 - - The \c isFirstTime flag is set to false the moment \c findButton is - clicked. This is necessary to undo the previous text highlight before - highlighting the user's next search string. Also, the \c found flag - is used to indicate if the \c searchString was found within the contents - of \c ui_textEdit. If it was not found, a QMessageBox is used - to inform the user. - - \snippet examples/uitools/textfinder/textfinder.cpp 9 - - \section1 \c main() Function - - \snippet examples/uitools/textfinder/main.cpp 0 - - The \c main() function initialises the \e{textfinder.qrc} resource file - and instantiates as well as displays \c TextFinder. - - \sa {Calculator Builder Example}, {World Time Clock Builder Example} - */ diff --git a/examples/widgets/doc/images/textfinder-example-userinterface.png b/examples/widgets/doc/images/textfinder-example-userinterface.png deleted file mode 100644 index 2bebe2e9dd836164fc31a252c8bcc8705ae6505c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7900 zcmY+J1x#F9ptWakXK*brxD**2F3zCEU5XEdLb2j94DJ-CKyiw@6bi-K;_mKJ97?ew z1CM)O-kT&2|5=R?kX*aRH5l7vcg`Db!)ixH+JZPgrhyI^H~C-9hP`>h8D`UO=#za6BDqqCUoskC|n+&BS0i~J%LU&e$ zs!tyx7YRoeoPf1m(sb5*EhNJx^#c7WDsQL5J-?Zkb67H83*Z#3CPAS%a>0R&@8HM>?h3iggY7>BkrJJs%Ms2qd8tEVFX()y=$xi(Eum+8{-4H80}4 zs8kc)&AQ&v`dB#%BBM`~5n%lQ=s(5iALpygG9HH#b~D3CqdZFH8^y@7GC7BU?>7aI zE^z1Dq4A%;oN0xYeB|`#AsF-k9Sr*ruZzCM^@z0IoXYjrth-+vN88l}YdhwC$YLNj zE{bxlD9)T*ew`~XE80wKKqB^m>eyQAfX}ILl26FZ^E8T1cQTFYj`xuoHhj6)E+4FV z-J%ptno2I}&x^m?d^%h4J2b!dknl1$)2sqU;V>wFl%@J37_{Hhqs?wA8O6vn$UoiF<=>sShbDYGjW ztXt(hcXdDJRg&xP$<%XgG6K%%L;}t}%XlE4^CK%WF80KvIo)ZD`%>JO)%j-qGa(;* zS(}M$L7$0G2(mJnxR25i*o0w;XXzKT4TA7s_6)u;VDYtB_Ff{?9z~R3*2<7~0SXF5%Za} z89=;kgVvdc!T3gynZLIuo|E2YN*re&ARSu(KK!s@LjwHNB*pNUS{=Zcsud(NDL5 z(fQ*-KnwAQy%+cKMZ_X|Ls!%0d!~lMuSF{0cfQ<>K1ynTOJ%$M2_5m`-J()oW;O3T zkzKpjTQkuc8hN#M#lU^Wn#MZ;4BqZ$@@yjKi(m$;zlvvOaWg(s5pVVZ0cAl2VMmIv zysr$lNgDQ94yIgl_K-#G(4af|r;79B@v>LSB%aYFg9TlI)cfvBcBamEbXck)VV`ZZ z)7fguGx~8R(wp{JZtfaUG3b~6JZ>+oT)#HUdpH`ul-xR-*9op?6-5WhqGALU<2p#+ zFxo=z4Rc({0hOaucH0me-8Jy?&hCB1igCCD|5AV6jn3>;BsabBf}roQX@ch6U#3@R zGIw<5KJH13QW?VoD1@6&QW@2(azCOWSlij0*{i4Li(!aj7BU;^sOPNZ*m+*ti>|q_vUN2x*xC|KSJC z#>0yiEy=f}Re_TdT|$+wCF_=Wf4acisplR}OGh`Eba9YhPqX^+t|Yi6OaGwz5l+7X zYcmly9B!v+9g-1(9qC>l7)1kQJrfwaTcz2Vqsd=HPZzSC|Kq2E%JX|@ROrB&F_@sq zNXw=HD_~kW&lG`N?FPHkn_MKY5q4Z~@EaiBFoW}fG|>hlQG%G^r;oNf?|0B4Sl!LA zob}fMyJ;&#D$`pQm)Ogn2_(l}q zA~o?R*rILZt?@&uc!%iIFH}={sZM8F*Zuu)E~`a@Ok-FcO#9@`7sP3a?#ErLeIa!L z*0px4&3^yX^cqNFbe!p&aB0CC2Y8D}hFM~~-K+M%MdI4s;tNhD--M}GrrNRPisY&J zWt@qx~9z zZ_jhAZu6SamN^{`V>OZE(Og{+*Hw`U3V;Cv@eDDV<;c#-cwYVm=Hc-YwqhOs(NemY zW03xv1EzW)rT6c~(u6zDygQ2#I9Haq`~791rK*tqJz1oM**`mnDlIN3gozv;4iWr1 z;=`EU)XVA46Q8EWJ*KL=J|od&#z!cX$1r|2hw6&+aPwJQse*&dkg) zMnZ~?4h0e6VpQ#qDf0O+Y4ijW`jZBCM9WYl{qb&hEhoqQjJ;L>)Yo=u_d&6x9)F6W zB-3X4zM+s)#^e(u%1ADVxnUB0#K>7M$7}>7y=sN^U~_ln3}?7|xV!6kn11>c<7lq& zLCpU4WS#P=bg{Oo{idY_eyP+heO(UN=ss;0VTNnQD8;MRLt&J402gPYHsl6urSvoq zlKJPcjcJtWJW4>b+HMxH;=4V^H04$r9_(3%k9KTsCr_T?`aV#!+T8__LHH$y^%P6Z$4<}CB*)KuHSpWC1OEr* z{@muXCTKzr{jn7HcK>sc{Y=kA9@Od+iU3|Bw|Bb`pELtbO$g#6;eh2;LSw4fco2u7 z`zy7G?@+8WSw9uYXkAAwB7G2FluiX0i&zGV3T6kMq4$;p7RoBIj@8kAH#cI*5KIW- z^FZbpIV-Rn?El_|roR1p)LU}#K}KI*CTZhb*%bheL}O3f8JI^QGLfeRLcewCE+_Bo zj4MTRJ$kJ*gC5Fs9S9_)@RSKHd~PeNYggO$uT~Irw~`TN0OhKzp!%ppFuq+AohRit zzEqj0p?)~#XYDYkrB#X~Gc`d%jnQ7hUk_oP)H)*ad>SDLl<4=S{L2}QR_{JiFDsF1 z>j|rEm(?nY7nl3q&R>(5Qi_zk>Z>i)zL@J#yG={4OF53y`R{0m{{dYwbJNo;IpNXd zlW!!F;KG?GGaL417KfNk%dn0C-NV6O6*?M?MUh$2 zN4sW45lzxy)FvnmDp636aj1eOF;(K9TY;YT6oYg)*mnLa1+Ri4m;3#&`Bg@ zcp}LQVoV}YQxX7jb0j3#!b+Jz&MHfa7L*Bj{Q1w(bp99y*z;}7F%H0B6tu~Nd9fGD@@C%W9ZN~FnK@sNfu(PX z+{H?x%iUp$2SelsOV}(8MQ`^4y*dB4YQLp73#-i`Y{aby+0jNWz+}-@G|4KR#Pxug zE!}l8Id^IJdy`x-%3_;iOW03Lh zRfjg$kuFj#ZNXIUT6p3NR}jQZ0Z@ykkB&~(gQG^{beBq&fNf?6kSCqWAJbeq*ykC( zn=qI~aYWaC$k+1g@yjrdo#bOJjgkgg+K0mYwq-(XQxsr1zj|3NpuK4|iuGMT9P`6X+ZYmGa;MxS=w&rP_l8##Oa+Ao8H=L0cE`R$c zwN@H2ep!StWU8&Uc^&S=hLO7{ys6e!kfN`-n&x?(PW~#QE|ukD`gHQqI;8V&blstV znGJia(JLOtZBvV3vm5R75tY8D`s}t%)P9q1>=b$K0ZP>gAbzzs3&Z~2!lb5X#inRv zD8vl-hZ5h*FHjO=+sNF^QKh_Rp5Unm_OkwK$L%u#t!)0Cu>G?R^-$0 zNW9s2!3zjIb$Tsb-gT~F#vmH>nob?8WMN-hZWP^{8-NyN^x}PAR=W1+(Ynu7_zDeT zu-16CuGLlaj7H24t$I0krS4_s!?C6aouoofzCn()7Hxhx3%M#5@no=$EVR_|vyDXD z(^M8qm*~S%@9S6S+Qt=?S%YIJjt{?0O)iH^n-YK?V{y_vz75ySEJY;*UhceKZxy93 z8+}bvcb7#~a z(PhlLnk#N&w(|J`*9=yP#`D;>y$OE>El}&&iESv;hKCJsGI~TBYHMLF)?bJw5aI-# z7{E65^^c=#o;RJg%rrC>J)SY&>7XzRQrZQdd<)XcLDT$A{SbkxNboSr6~6wIyfG`L zQ#z(AXU)Dmt!1vy# z<3GX{b_l3irUN>ORHF#q$h{QfBvLh}t4H>y#G(Uyt%9=MEk>uTQ%3IEiT)2G6T{6sl|61hs zX^`6w=`J0&9+YA;2p;d*_2HZ?j8Wb~Ex?O@-@Peuf<0HbpK;*CAS;L^tE@oGtgq86 zmQ8XtR~qP$#;{YC4Rd%!z-CEYS2V#;)YH@o4Z0f z>5T7{hId6OW3=*%`hpi*04)6R^I#yYp1K8>zAsZ@5*e3K{ah^60gpk{=`q&%b+X6Tfq_qDM~xSUsorVkeh0lzuh+c2+|8;FbXjgQ24b-2WPf9@eO4}HmL=BQ z8t8O5{MlUn&ZHm#K4e}YNs+|sC$qQsQ8OU#MAxq3UYUnin3yRnIgY}U_48lo>yTH< z-l|`jSEuOA*T!0FE3#W(FnGRGQ8B2y8z;)auITf97iP%(BL=M(#Q-DFL#YVm%1ECV z1r%Hq29+b+FLvZOEB@G*KB3j(`IB6*fO2`DEDD26h`2kH;uEJi%Q6}9*+h@_0{^ik zd>(2Ip6&ZJvD77NDx6p`N>)#VMGe&xjPi@^FC}ij)63S~GpjJwfeq9V5Q$^;M&Srv z5u3_%pyXPHT30co`SVxEQSt8D+#vqm9u$8x??hOf*H9tH^Ui-Pc`g@<@)F~L*%`@+ zYPTSC*bX5#QlPrSDJ#^e`x?p3E#DKZS@|U1^*ICL*2CN%BlPQ6J-d4@zWz=;AM}`` zz-W$8nHke7;`Yfz6`xA*IrU*=e8+7k?|L2C%hi)uj3N7ieJ7X@x@-M7X2?Q5fP)e@ z$WOm5-vNmIfo?kXCLPD`!1gqy-p}m(Nb^t2!~$*2ox0W9w42sR(txDXMXq4kPskZ0 zRQfpm$^5(}`rRLa(|0*Hi5qD%1sqf_{N<6NW#qaHgh{Jcc-pXufnQC-B+fEClwR_> zT!#S9r{T5Lz9!FAD*)nD$YrQmc+wT6=;I7WEXK>DbnNB~(0Gh)XO*BV9W@mP4$&<1 zmybt?6MeFeRaUdU@A(u=M>``+zYY>M#cVdyo7~^V5U(8FtngKJVrhvbSe)Cjuo(Ng z!)`Bws|FM**6`xp(UX9j)ZU7tD7}xz*yjFgn1r8?pyW~*v_Sf$xox7JJ#|K>0##hJ z^^8%xECJpmJ0o7JHCL5=JRcllF9mnn@6dLud{mxK>z;Ai$z%p*r<(#~(3w*LskUA8 zNYvcF_vEYc1)W=qGwcM%pe4NqutN1-epW0P)AUyfeHmMbEv`P(GZoVtgVzv-HJulc zX9%dukfz=;K)ESZNGqG`;*O}lJ!2m9Nx=()M4*ANRb(i2em!!o#53A4Ugz;gJYWhW z7*ecZYj!m|Ueb8cke}NFgzlvcyDaxJCJ|t_7_D$ULDkb`bfpivh z;=V~l)NE-e_cbtvfnvaNSiK-{n6+{rlM)uVA#R_IR5lEhl}aSX9wCDTraHGD9sB9*{5?8^# zqYf_^^_ICHe1aekKa=mx?oAJ1OnN&qc)!4wba>8U~F}~%CWY%U5j}w z6hP!=+Dyq9_S3Yw#=P9=Rb*PnJefD!meTT@$eQEPQ^yPhNM>z@}lFgyIeLh$s* zG3xELIf0aVYl_3+8}IBLg(CerZ{EL?#-X6}rmMGo8-HgPGJOkl{S{{#i_cIfBcTv8 zYe>^&V1Fj29YQP31r10@o%Av|*hul6cU}Yj$y={4S@0q{M8v(UgC@oA2kC8y`p&Y!Sdhn| zIFK9)xDJ+&rg`T2^C)~d{v_@6%=dfilPGd}$w;?&Ig&C`q#V+ujM$DVD6So&8LX9V z=qz%a5dJ1diu0l12CB{LQ7tP|zjQ5(XCbbIZ*gX>#1`aqB6${O+1g>X>>PU|Qlu4P zvs;YQHNOU5z|knLZtU_oNghV=zoFwoE7BhrM$l$&(Pns92agOf$X(*8s^9^oym#$Z zCR*3N8n9N_T+RO@)i#aa?)kf(sdQP`)V$oou>E{8aiC~jI6&I72t2v|S!3wfvpHvs z%YNCXOmHMLqS4zTGoD%gs`)xSmPt7K-KrPh^;;^Q2*rNXbjhKTJDK%j5GSn$L(~pq z*jz;ShNzd5y&;E(g!KoxjVs<6epko5_d(#lwUGXLn?@na%w}OU_J1UmKGDX*JA-qI z$sW^nnKTl}F!JAcx3pBCD+SQ)hraN*ijzFj*0S~|FAZQ{#%J&AC}>%`Y-zz~*bnEK zTN0psFU(bMFk`#A1Ok`mrBVq^98t`DUR=_8P|doxc)|N#@P~+N>$m!f6}%A|s&nlG zxPZf}U;OBSGfz6CX>4v=*}E|)`Aaq{!}FgjiEw^solsE=8>V>!uCERLX&?nFGBTe{ zQ!YGE7X{WR*6aOkf840qBMW=5gICev4Mu^H!yp8nO4P7S*K}0$ARz4Ni@Ctme6V(&BS`Z~|`wd!FZjuZfE zF^uAhrBn0-huxvX#}{Mu>#fVbr$S1M+02&OzK2w-39ai#F|3oqboG*xIZs~vhwAdVKeL{d ziJKWd_2+}%x;kA~TZ`3%ccoT%9LU!Lm2%PFE)4mX(O-VjewK|5jv|eZ<~!^j-S%$` z8xLL{DlXsUA#SLQg^^EsR#WeDMW9%NgM-`h5j8IJk6(Q&nFon`xIAIHbUKQA$PvgI*$8i?=79A06{96G>lR(z-0(Pg|c5)7$7mgVJqjJO|4MhE9Ko-IcjnWrJ(s)Frmp(Rs?MUAIOi!ApguF2-pxr8vq620S#t?$gXB4 zxE#7;mYlKbXi)wQ{4e*vwC)({|Fw9Aq5A*ko^7kjA~B7$QDLbVR4A_0&usriva{$! z0G?t0wR{%yKturF{ulkf=>c}zF#$ADeBiV4-*8VZz#@Y@K;sz;H~@Mc8N;xi&HhVW z20W+mGww;r2d(}K%a1morHBg1Rlt81|EC}Q_XAe7qKVn?@>7-Re*s1)fd5+>KR-3V z{=tgi|2U*b1WXZkjBUU&yD}K<(dMe-IUx`RtuMs*e?2!qQG?Jub05isEEQItDk^K* z4js(;mX?cW-G@bZoLrpYKJ64gQH@$#$hSuqd`Px=i!yYd$z+ni|JS#~{&ov8LHeU1 z?`wFSKI`!ktpO?u8qgX!%aH#8=`H5i From 4dc45567a0b910a7678097dfc749337d85efb341 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 12 Dec 2012 11:20:30 +0100 Subject: [PATCH 10/23] QtBase: Removed moved linguist examples. Linguist examples are now in qttools. Change-Id: I8abfff50d81cda143a080711bf9583e7be777009 Reviewed-by: Leena Miettinen (cherry picked from commit d64c4662f01ffc94c68e7c9f7abdb6309e67e489) Reviewed-by: Sergio Ahumada --- doc/src/examples/arrowpad.qdoc | 223 ------------------ doc/src/examples/hellotr.qdoc | 174 -------------- .../code/doc_src_examples_arrowpad.cpp | 43 ---- .../code/doc_src_examples_arrowpad.qdoc | 54 ----- .../code/doc_src_examples_hellotr.qdoc | 71 ------ .../code/doc_src_examples_trollprint.cpp | 77 ------ examples/examples.pro | 2 - examples/ja_JP/linguist/hellotr/hellotr.pro | 11 - examples/ja_JP/linguist/hellotr/main.cpp | 70 ------ examples/linguist/README | 6 - examples/linguist/arrowpad/arrowpad.cpp | 64 ----- examples/linguist/arrowpad/arrowpad.h | 68 ------ examples/linguist/arrowpad/arrowpad.pro | 18 -- examples/linguist/arrowpad/main.cpp | 63 ----- examples/linguist/arrowpad/mainwindow.cpp | 61 ----- examples/linguist/arrowpad/mainwindow.h | 68 ------ examples/linguist/hellotr/hellotr.pro | 13 - examples/linguist/hellotr/main.cpp | 70 ------ examples/linguist/linguist.pro | 6 - examples/linguist/trollprint/main.cpp | 60 ----- examples/linguist/trollprint/mainwindow.cpp | 95 -------- examples/linguist/trollprint/mainwindow.h | 74 ------ examples/linguist/trollprint/printpanel.cpp | 85 ------- examples/linguist/trollprint/printpanel.h | 69 ------ examples/linguist/trollprint/trollprint.pro | 14 -- examples/linguist/trollprint/trollprint_pt.ts | 65 ----- 26 files changed, 1624 deletions(-) delete mode 100644 doc/src/examples/arrowpad.qdoc delete mode 100644 doc/src/examples/hellotr.qdoc delete mode 100644 doc/src/snippets/code/doc_src_examples_arrowpad.cpp delete mode 100644 doc/src/snippets/code/doc_src_examples_arrowpad.qdoc delete mode 100644 doc/src/snippets/code/doc_src_examples_hellotr.qdoc delete mode 100644 doc/src/snippets/code/doc_src_examples_trollprint.cpp delete mode 100644 examples/ja_JP/linguist/hellotr/hellotr.pro delete mode 100644 examples/ja_JP/linguist/hellotr/main.cpp delete mode 100644 examples/linguist/README delete mode 100644 examples/linguist/arrowpad/arrowpad.cpp delete mode 100644 examples/linguist/arrowpad/arrowpad.h delete mode 100644 examples/linguist/arrowpad/arrowpad.pro delete mode 100644 examples/linguist/arrowpad/main.cpp delete mode 100644 examples/linguist/arrowpad/mainwindow.cpp delete mode 100644 examples/linguist/arrowpad/mainwindow.h delete mode 100644 examples/linguist/hellotr/hellotr.pro delete mode 100644 examples/linguist/hellotr/main.cpp delete mode 100644 examples/linguist/linguist.pro delete mode 100644 examples/linguist/trollprint/main.cpp delete mode 100644 examples/linguist/trollprint/mainwindow.cpp delete mode 100644 examples/linguist/trollprint/mainwindow.h delete mode 100644 examples/linguist/trollprint/printpanel.cpp delete mode 100644 examples/linguist/trollprint/printpanel.h delete mode 100644 examples/linguist/trollprint/trollprint.pro delete mode 100644 examples/linguist/trollprint/trollprint_pt.ts diff --git a/doc/src/examples/arrowpad.qdoc b/doc/src/examples/arrowpad.qdoc deleted file mode 100644 index 39c0558117f..00000000000 --- a/doc/src/examples/arrowpad.qdoc +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example linguist/arrowpad - \title Arrow Pad Example - - This example is a slightly more involved and introduces a key \e - {Qt Linguist} concept: "contexts". It also shows how to use two - or more languages. - - \image linguist-arrowpad_en.png - - We will use two translations, French and Dutch, although there is no - effective limit on the number of possible translations that can be used - with an application. The relevant lines of \c arrowpad.pro are - - \snippet examples/linguist/arrowpad/arrowpad.pro 0 - \codeline - \snippet examples/linguist/arrowpad/arrowpad.pro 1 - - Run \c lupdate; it should produce two identical message files - \c arrowpad_fr.ts and \c arrowpad_nl.ts. These files will contain all the source - texts marked for translation with \c tr() calls and their contexts. - - See the \l{Qt Linguist manual} for more information about - translating Qt application. - - \section1 Line by Line Walkthrough - - In \c arrowpad.h we define the \c ArrowPad subclass which is a - subclass of QWidget. In the screenshot above, the central - widget with the four buttons is an \c ArrowPad. - - \snippet examples/linguist/arrowpad/arrowpad.h 0 - \snippet examples/linguist/arrowpad/arrowpad.h 1 - \snippet examples/linguist/arrowpad/arrowpad.h 2 - - When \c lupdate is run it not only extracts the source texts but it - also groups them into contexts. A context is the name of the class in - which the source text appears. Thus, in this example, "ArrowPad" is a - context: it is the context of the texts in the \c ArrowPad class. - The \c Q_OBJECT macro defines \c tr(x) in \c ArrowPad like this: - - \snippet doc/src/snippets/code/doc_src_examples_arrowpad.cpp 0 - - Knowing which class each source text appears in enables \e {Qt - Linguist} to group texts that are logically related together, e.g. - all the text in a dialog will have the context of the dialog's class - name and will be shown together. This provides useful information for - the translator since the context in which text appears may influence how - it should be translated. For some translations keyboard - accelerators may need to be changed and having all the source texts in a - particular context (class) grouped together makes it easier for the - translator to perform any accelerator changes without introducing - conflicts. - - In \c arrowpad.cpp we implement the \c ArrowPad class. - - \snippet examples/linguist/arrowpad/arrowpad.cpp 0 - \snippet examples/linguist/arrowpad/arrowpad.cpp 1 - \snippet examples/linguist/arrowpad/arrowpad.cpp 2 - \snippet examples/linguist/arrowpad/arrowpad.cpp 3 - - We call \c ArrowPad::tr() for each button's label since the labels are - user-visible text. - - \image linguist-arrowpad_en.png - - \snippet examples/linguist/arrowpad/mainwindow.h 0 - \snippet examples/linguist/arrowpad/mainwindow.h 1 - - In the screenshot above, the whole window is a \c MainWindow. - This is defined in the \c mainwindow.h header file. Here too, we - use \c Q_OBJECT, so that \c MainWindow will become a context in - \e {Qt Linguist}. - - \snippet examples/linguist/arrowpad/mainwindow.cpp 0 - - In the implementation of \c MainWindow, \c mainwindow.cpp, we create - an instance of our \c ArrowPad class. - - \snippet examples/linguist/arrowpad/mainwindow.cpp 1 - - We also call \c MainWindow::tr() twice, once for the action and - once for the shortcut. - - Note the use of \c tr() to support different keys in other - languages. "Ctrl+Q" is a good choice for Quit in English, but a - Dutch translator might want to use "Ctrl+A" (for Afsluiten) and a - German translator "Strg+E" (for Beenden). When using \c tr() for - \uicontrol Ctrl key accelerators, the two argument form should be used - with the second argument describing the function that the - accelerator performs. - - Our \c main() function is defined in \c main.cpp as usual. - - \snippet examples/linguist/arrowpad/main.cpp 2 - \snippet examples/linguist/arrowpad/main.cpp 3 - - We choose which translation to use according to the current locale. - QLocale::system() can be influenced by setting the \c LANG - environment variable, for example. Notice that the use of a naming - convention that incorporates the locale for \c .qm message files, - (and TS files), makes it easy to implement choosing the - translation file according to locale. - - If there is no QM message file for the locale chosen the original - source text will be used and no error raised. - - \section1 Translating to French and Dutch - - We'll begin by translating the example application into French. Start - \e {Qt Linguist} with \c arrowpad_fr.ts. You should get the seven source - texts ("\&Up", "\&Left", etc.) grouped in two contexts ("ArrowPad" - and "MainWindow"). - - Now, enter the following translations: - - \list - \li \c ArrowPad - \list - \li \&Up - \&Haut - \li \&Left - \&Gauche - \li \&Right - \&Droite - \li \&Down - \&Bas - \endlist - \li \c MainWindow - \list - \li E\&xit - \&Quitter - \li Ctrl+Q - Ctrl+Q - \li \&File - \&Fichier - \endlist - \endlist - - It's quickest to press \uicontrol{Alt+D} (which clicks the \uicontrol {Done \& Next} - button) after typing each translation, since this marks the - translation as done and moves on to the next source text. - - Save the file and do the same for Dutch working with \c arrowpad_nl.ts: - - \list - \li \c ArrowPad - \list - \li \&Up - \&Omhoog - \li \&Left - \&Links - \li \&Right - \&Rechts - \li \&Down - Omlaa\&g - \endlist - \li \c MainWindow - \list - \li E\&xit - \&Afsluiten - \li Ctrl+Q - Ctrl+A - \li File - \&Bestand - \endlist - \endlist - - We have to convert the \c tt1_fr.ts and \c tt1_nl.ts translation source - files into QM files. We could use \e {Qt Linguist} as we've done - before; however using the command line tool \c lrelease ensures that - \e all the QM files for the application are created without us - having to remember to load and \uicontrol File|Release each one - individually from \e {Qt Linguist}. - - Type - - \snippet doc/src/snippets/code/doc_src_examples_arrowpad.qdoc 1 - - This should create both \c arrowpad_fr.qm and \c arrowpad_nl.qm. Set the \c - LANG environment variable to \c fr. In Unix, one of the two following - commands should work - - \snippet doc/src/snippets/code/doc_src_examples_arrowpad.qdoc 2 - - In Windows, either modify \c autoexec.bat or run - - \snippet doc/src/snippets/code/doc_src_examples_arrowpad.qdoc 3 - - When you run the program, you should now see the French version: - - \image linguist-arrowpad_fr.png - - Try the same with Dutch, by setting \c LANG=nl. Now the Dutch - version should appear: - - \image linguist-arrowpad_nl.png - - \section1 Exercises - - Mark one of the translations in \e {Qt Linguist} as not done, i.e. - by unchecking the "done" checkbox; run \c lupdate, then \c lrelease, - then the example. What effect did this change have? - - Set \c LANG=fr_CA (French Canada) and run the example program again. - Explain why the result is the same as with \c LANG=fr. - - Change one of the accelerators in the Dutch translation to eliminate the - conflict between \e \&Bestand and \e \&Boven. -*/ diff --git a/doc/src/examples/hellotr.qdoc b/doc/src/examples/hellotr.qdoc deleted file mode 100644 index ca4d4282ad6..00000000000 --- a/doc/src/examples/hellotr.qdoc +++ /dev/null @@ -1,174 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example linguist/hellotr - \title Hello tr() Example - - This example is a small Hello World program with a Latin translation. The - screenshot below shows the English version. - - \image linguist-hellotr_en.png - - See the \l{Qt Linguist manual} for more information about - translating Qt application. - - \section1 Line by Line Walkthrough - - - \snippet examples/linguist/hellotr/main.cpp 0 - - This line includes the definition of the QTranslator class. - Objects of this class provide translations for user-visible text. - - \snippet examples/linguist/hellotr/main.cpp 5 - - Creates a QTranslator object without a parent. - - \snippet examples/linguist/hellotr/main.cpp 6 - - Tries to load a file called \c hellotr_la.qm (the \c .qm file extension is - implicit) that contains Latin translations for the source texts used in - the program. No error will occur if the file is not found. - - \snippet examples/linguist/hellotr/main.cpp 7 - - Adds the translations from \c hellotr_la.qm to the pool of translations used - by the program. - - \snippet examples/linguist/hellotr/main.cpp 8 - - Creates a push button that displays "Hello world!". If \c hellotr_la.qm - was found and contains a translation for "Hello world!", the - translation appears; if not, the source text appears. - - All classes that inherit QObject have a \c tr() function. Inside - a member function of a QObject class, we simply write \c tr("Hello - world!") instead of \c QPushButton::tr("Hello world!") or \c - QObject::tr("Hello world!"). - - \section1 Running the Application in English - - Since we haven't made the translation file \c hellotr_la.qm, the source text - is shown when we run the application: - - \image linguist-hellotr_en.png - - \section1 Creating a Latin Message File - - The first step is to create a project file, \c hellotr.pro, that lists - all the source files for the project. The project file can be a qmake - project file, or even an ordinary makefile. Any file that contains - - \snippet examples/linguist/hellotr/hellotr.pro 0 - \snippet examples/linguist/hellotr/hellotr.pro 1 - - will work. \c TRANSLATIONS specifies the message files we want to - maintain. In this example, we just maintain one set of translations, - namely Latin. - - Note that the file extension is \c .ts, not \c .qm. The \c .ts - translation source format is designed for use during the - application's development. Programmers or release managers run - the \c lupdate program to generate and update TS files with - the source text that is extracted from the source code. - Translators read and update the TS files using \e {Qt - Linguist} adding and editing their translations. - - The TS format is human-readable XML that can be emailed directly - and is easy to put under version control. If you edit this file - manually, be aware that the default encoding for XML is UTF-8, not - Latin1 (ISO 8859-1). One way to type in a Latin1 character such as - '\oslash' (Norwegian o with slash) is to use an XML entity: - "\ø". This will work for any Unicode 4.0 character. - - Once the translations are complete the \c lrelease program is used to - convert the TS files into the QM Qt message file format. The - QM format is a compact binary format designed to deliver very - fast lookup performance. Both \c lupdate and \c lrelease read all the - project's source and header files (as specified in the HEADERS and - SOURCES lines of the project file) and extract the strings that - appear in \c tr() function calls. - - \c lupdate is used to create and update the message files (\c hellotr_la.ts - in this case) to keep them in sync with the source code. It is safe to - run \c lupdate at any time, as \c lupdate does not remove any - information. For example, you can put it in the makefile, so the TS - files are updated whenever the source changes. - - Try running \c lupdate right now, like this: - - \snippet doc/src/snippets/code/doc_src_examples_hellotr.qdoc 0 - - (The \c -verbose option instructs \c lupdate to display messages that - explain what it is doing.) You should now have a file \c hellotr_la.ts in - the current directory, containing this: - - \snippet doc/src/snippets/code/doc_src_examples_hellotr.qdoc 1 - - You don't need to understand the file format since it is read and - updated using tools (\c lupdate, \e {Qt Linguist}, \c lrelease). - - \section1 Translating to Latin with Qt Linguist - - We will use \e {Qt Linguist} to provide the translation, although - you can use any XML or plain text editor to enter a translation into a - TS file. - - To start \e {Qt Linguist}, type - - \snippet doc/src/snippets/code/doc_src_examples_hellotr.qdoc 2 - - You should now see the text "QPushButton" in the top left pane. - Double-click it, then click on "Hello world!" and enter "Orbis, te - saluto!" in the \uicontrol Translation pane (the middle right of the - window). Don't forget the exclamation mark! - - Click the \uicontrol Done checkbox and choose \uicontrol File|Save from the - menu bar. The TS file will no longer contain - - \snippet doc/src/snippets/code/doc_src_examples_hellotr.qdoc 3 - - but instead will have - - \snippet doc/src/snippets/code/doc_src_examples_hellotr.qdoc 4 - - \section1 Running the Application in Latin - - To see the application running in Latin, we have to generate a QM - file from the TS file. Generating a QM file can be achieved - either from within \e {Qt Linguist} (for a single TS file), or - by using the command line program \c lrelease which will produce one - QM file for each of the TS files listed in the project file. - Generate \c hellotr_la.qm from \c hellotr_la.ts by choosing - \uicontrol File|Release from \e {Qt Linguist}'s menu bar and pressing - \uicontrol Save in the file save dialog that pops up. Now run the \c hellotr - program again. This time the button will be labelled "Orbis, te - saluto!". - - \image linguist-hellotr_la.png -*/ diff --git a/doc/src/snippets/code/doc_src_examples_arrowpad.cpp b/doc/src/snippets/code/doc_src_examples_arrowpad.cpp deleted file mode 100644 index 58e790d3ae0..00000000000 --- a/doc/src/snippets/code/doc_src_examples_arrowpad.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [0] -qApp->translate("ArrowPad", x) -//! [0] diff --git a/doc/src/snippets/code/doc_src_examples_arrowpad.qdoc b/doc/src/snippets/code/doc_src_examples_arrowpad.qdoc deleted file mode 100644 index 4b3ea343a34..00000000000 --- a/doc/src/snippets/code/doc_src_examples_arrowpad.qdoc +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [1] -lrelease arrowpad.pro -//! [1] - - -//! [2] -export LANG=fr -setenv LANG fr -//! [2] - - -//! [3] -set LANG=fr -//! [3] diff --git a/doc/src/snippets/code/doc_src_examples_hellotr.qdoc b/doc/src/snippets/code/doc_src_examples_hellotr.qdoc deleted file mode 100644 index 2e57cac8a52..00000000000 --- a/doc/src/snippets/code/doc_src_examples_hellotr.qdoc +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [0] -lupdate -verbose hellotr.pro -//! [0] - - -//! [1] - - - QPushButton - - Hello world! - - - - -//! [1] - - -//! [2] -linguist hellotr_la.ts -//! [2] - - -//! [3] - -//! [3] - - -//! [4] -Orbis, te saluto! -//! [4] diff --git a/doc/src/snippets/code/doc_src_examples_trollprint.cpp b/doc/src/snippets/code/doc_src_examples_trollprint.cpp deleted file mode 100644 index 493e245e834..00000000000 --- a/doc/src/snippets/code/doc_src_examples_trollprint.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [0] -twoSidedEnabledRadio = new QRadioButton(tr("Enabled", "two-sided")); -twoSidedDisabledRadio = new QRadioButton(tr("Disabled", "two-sided")); -//! [0] - - -//! [1] -colorsEnabledRadio = new QRadioButton(tr("Enabled", "colors"), colors); -colorsDisabledRadio = new QRadioButton(tr("Disabled", "colors"), colors); -//! [1] - - -//! [2] -/* - TRANSLATOR MainWindow - - In this application the whole application is a MainWindow. - Choose Help|About from the menu bar to see some text - belonging to MainWindow. - - ... -*/ -//! [2] - - -//! [3] -/* - TRANSLATOR ZClientErrorDialog - - Choose Client|Edit to reach the Client Edit dialog, then choose - Client Specification from the drop down list at the top and pick - client Bartel Leendert van der Waerden. Now check the Profile - checkbox and then click the Start Processing button. You should - now see a pop up window with the text "Error: Name too long!". - This window is a ZClientErrorDialog. -*/ -//! [3] diff --git a/examples/examples.pro b/examples/examples.pro index 06ef0adcab0..e1c3611836b 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -11,7 +11,6 @@ SUBDIRS = \ !contains(QT_CONFIG, no-widgets) { SUBDIRS += widgets \ ipc \ - linguist \ sql \ tools \ touch \ @@ -24,7 +23,6 @@ contains(QT_BUILD_PARTS, tools):!contains(QT_CONFIG, no-gui):!contains(QT_CONFIG contains(QT_CONFIG, opengl):!contains(QT_CONFIG, no-widgets):SUBDIRS += opengl contains(QT_CONFIG, dbus): SUBDIRS += dbus contains(QT_CONFIG, concurrent): SUBDIRS += qtconcurrent -contains(DEFINES, QT_NO_TRANSLATION): SUBDIRS -= linguist aggregate.files = aggregate/examples.pro aggregate.path = $$[QT_INSTALL_EXAMPLES] diff --git a/examples/ja_JP/linguist/hellotr/hellotr.pro b/examples/ja_JP/linguist/hellotr/hellotr.pro deleted file mode 100644 index e4a1ee11bb1..00000000000 --- a/examples/ja_JP/linguist/hellotr/hellotr.pro +++ /dev/null @@ -1,11 +0,0 @@ -#! [0] -SOURCES = main.cpp -#! [0] #! [1] -TRANSLATIONS = hellotr_ja.ts -#! [1] - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/linguist/hellotr -INSTALLS += target - -QT += widgets diff --git a/examples/ja_JP/linguist/hellotr/main.cpp b/examples/ja_JP/linguist/hellotr/main.cpp deleted file mode 100644 index df4546f4b53..00000000000 --- a/examples/ja_JP/linguist/hellotr/main.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -//! [0] -#include -//! [0] - -//! [1] //! [2] -int main(int argc, char *argv[]) -//! [1] //! [3] //! [4] -{ - QApplication app(argc, argv); -//! [3] - -//! [5] - QTranslator translator; -//! [5] //! [6] - translator.load("hellotr_ja"); -//! [6] //! [7] - app.installTranslator(&translator); -//! [4] //! [7] - -//! [8] - QPushButton hello(QPushButton::tr("Hello world!")); -//! [8] - hello.resize(100, 30); - - hello.show(); - return app.exec(); -} -//! [2] diff --git a/examples/linguist/README b/examples/linguist/README deleted file mode 100644 index 15817742dac..00000000000 --- a/examples/linguist/README +++ /dev/null @@ -1,6 +0,0 @@ -Internationalization is a core feature of Qt. These examples show how to -access translation and localization facilities at run-time. - - -Documentation for these examples can be found via the Examples -link in the main Qt documentation. diff --git a/examples/linguist/arrowpad/arrowpad.cpp b/examples/linguist/arrowpad/arrowpad.cpp deleted file mode 100644 index 7b332382954..00000000000 --- a/examples/linguist/arrowpad/arrowpad.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "arrowpad.h" - -ArrowPad::ArrowPad(QWidget *parent) - : QWidget(parent) -{ -//! [0] - upButton = new QPushButton(tr("&Up")); -//! [0] //! [1] - downButton = new QPushButton(tr("&Down")); -//! [1] //! [2] - leftButton = new QPushButton(tr("&Left")); -//! [2] //! [3] - rightButton = new QPushButton(tr("&Right")); -//! [3] - - QGridLayout *mainLayout = new QGridLayout; - mainLayout->addWidget(upButton, 0, 1); - mainLayout->addWidget(leftButton, 1, 0); - mainLayout->addWidget(rightButton, 1, 2); - mainLayout->addWidget(downButton, 2, 1); - setLayout(mainLayout); -} diff --git a/examples/linguist/arrowpad/arrowpad.h b/examples/linguist/arrowpad/arrowpad.h deleted file mode 100644 index 30ebf98e926..00000000000 --- a/examples/linguist/arrowpad/arrowpad.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef ARROWPAD_H -#define ARROWPAD_H - -#include - -QT_BEGIN_NAMESPACE -class QPushButton; -QT_END_NAMESPACE - -//! [0] -class ArrowPad : public QWidget -//! [0] //! [1] -{ -//! [1] //! [2] - Q_OBJECT -//! [2] - -public: - ArrowPad(QWidget *parent = 0); - -private: - QPushButton *upButton; - QPushButton *downButton; - QPushButton *leftButton; - QPushButton *rightButton; -}; - -#endif diff --git a/examples/linguist/arrowpad/arrowpad.pro b/examples/linguist/arrowpad/arrowpad.pro deleted file mode 100644 index 3b5916684b3..00000000000 --- a/examples/linguist/arrowpad/arrowpad.pro +++ /dev/null @@ -1,18 +0,0 @@ -#! [0] -HEADERS = arrowpad.h \ - mainwindow.h -SOURCES = arrowpad.cpp \ - main.cpp \ - mainwindow.cpp -#! [0] #! [1] -TRANSLATIONS = arrowpad_fr.ts \ - arrowpad_nl.ts -#! [1] - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/linguist/arrowpad -INSTALLS += target - -QT += widgets - -simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/linguist/arrowpad/main.cpp b/examples/linguist/arrowpad/main.cpp deleted file mode 100644 index c43b17556fb..00000000000 --- a/examples/linguist/arrowpad/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "mainwindow.h" - -//! [0] -int main(int argc, char *argv[]) -//! [0] //! [1] -{ - QApplication app(argc, argv); - - QString locale = QLocale::system().name(); - -//! [2] - QTranslator translator; -//! [2] //! [3] - translator.load(QString("arrowpad_") + locale); - app.installTranslator(&translator); -//! [1] //! [3] - - MainWindow mainWindow; - mainWindow.show(); - return app.exec(); -} diff --git a/examples/linguist/arrowpad/mainwindow.cpp b/examples/linguist/arrowpad/mainwindow.cpp deleted file mode 100644 index 75a489e5184..00000000000 --- a/examples/linguist/arrowpad/mainwindow.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "arrowpad.h" -#include "mainwindow.h" - -MainWindow::MainWindow() -{ -//! [0] - arrowPad = new ArrowPad; -//! [0] - setCentralWidget(arrowPad); - -//! [1] - exitAct = new QAction(tr("E&xit"), this); - exitAct->setShortcuts(QKeySequence::Quit); - connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); -//! [1] - - fileMenu = menuBar()->addMenu(tr("&File")); - fileMenu->addAction(exitAct); -} diff --git a/examples/linguist/arrowpad/mainwindow.h b/examples/linguist/arrowpad/mainwindow.h deleted file mode 100644 index 7ccac6ac592..00000000000 --- a/examples/linguist/arrowpad/mainwindow.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -QT_BEGIN_NAMESPACE -class QAction; -class QMenu; -QT_END_NAMESPACE -class ArrowPad; - -//! [0] -class MainWindow : public QMainWindow -//! [0] //! [1] -{ - Q_OBJECT -//! [1] - -public: - MainWindow(); - -private: - ArrowPad *arrowPad; - QMenu *fileMenu; - QAction *exitAct; -}; - -#endif diff --git a/examples/linguist/hellotr/hellotr.pro b/examples/linguist/hellotr/hellotr.pro deleted file mode 100644 index 38e5a5b3663..00000000000 --- a/examples/linguist/hellotr/hellotr.pro +++ /dev/null @@ -1,13 +0,0 @@ -#! [0] -SOURCES = main.cpp -#! [0] #! [1] -TRANSLATIONS = hellotr_la.ts -#! [1] - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/linguist/hellotr -INSTALLS += target - -QT += widgets - -simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/linguist/hellotr/main.cpp b/examples/linguist/hellotr/main.cpp deleted file mode 100644 index 12433f8414a..00000000000 --- a/examples/linguist/hellotr/main.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -//! [0] -#include -//! [0] - -//! [1] //! [2] -int main(int argc, char *argv[]) -//! [1] //! [3] //! [4] -{ - QApplication app(argc, argv); -//! [3] - -//! [5] - QTranslator translator; -//! [5] //! [6] - translator.load("hellotr_la"); -//! [6] //! [7] - app.installTranslator(&translator); -//! [4] //! [7] - -//! [8] - QPushButton hello(QPushButton::tr("Hello world!")); -//! [8] - hello.resize(100, 30); - - hello.show(); - return app.exec(); -} -//! [2] diff --git a/examples/linguist/linguist.pro b/examples/linguist/linguist.pro deleted file mode 100644 index 6109ef00452..00000000000 --- a/examples/linguist/linguist.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = arrowpad \ - hellotr \ - trollprint - -QT += widgets diff --git a/examples/linguist/trollprint/main.cpp b/examples/linguist/trollprint/main.cpp deleted file mode 100644 index 9438d987b2e..00000000000 --- a/examples/linguist/trollprint/main.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QString locale = QLocale::system().name(); - -//! [0] - QTranslator translator; - translator.load(QString("trollprint_") + locale); - app.installTranslator(&translator); -//! [0] - - MainWindow mainWindow; - mainWindow.show(); - return app.exec(); -} diff --git a/examples/linguist/trollprint/mainwindow.cpp b/examples/linguist/trollprint/mainwindow.cpp deleted file mode 100644 index d98aba6f3db..00000000000 --- a/examples/linguist/trollprint/mainwindow.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "mainwindow.h" -#include "printpanel.h" - -MainWindow::MainWindow() -{ - printPanel = new PrintPanel; - setCentralWidget(printPanel); - - createActions(); - createMenus(); - -//! [0] - setWindowTitle(tr("Troll Print 1.0")); -//! [0] -} - -void MainWindow::about() -{ - QMessageBox::information(this, tr("About Troll Print 1.0"), - tr("Troll Print 1.0.\n\n" - "Copyright 1999 Software, Inc.")); -} - -//! [1] -void MainWindow::createActions() -{ -//! [2] - exitAct = new QAction(tr("E&xit"), this); - exitAct->setShortcut(tr("Ctrl+Q", "Quit")); -//! [2] - connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); - - aboutAct = new QAction(tr("&About"), this); - aboutAct->setShortcut(Qt::Key_F1); - connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); - - aboutQtAct = new QAction(tr("About &Qt"), this); - connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt())); -} - -void MainWindow::createMenus() -//! [1] //! [3] -{ - QMenu *fileMenu = menuBar()->addMenu(tr("&File")); - fileMenu->addAction(exitAct); - - menuBar()->addSeparator(); - - QMenu *helpMenu = menuBar()->addMenu(tr("&Help")); - helpMenu->addAction(aboutAct); - helpMenu->addAction(aboutQtAct); -} -//! [3] diff --git a/examples/linguist/trollprint/mainwindow.h b/examples/linguist/trollprint/mainwindow.h deleted file mode 100644 index d55d6fb897b..00000000000 --- a/examples/linguist/trollprint/mainwindow.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -QT_BEGIN_NAMESPACE -class QAction; -class QMenu; -QT_END_NAMESPACE -class PrintPanel; - -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - MainWindow(); - -private slots: - void about(); - -private: - void createActions(); - void createMenus(); - - PrintPanel *printPanel; - QMenu *fileMenu; - QMenu *helpMenu; - QAction *exitAct; - QAction *aboutAct; - QAction *aboutQtAct; -}; - -#endif diff --git a/examples/linguist/trollprint/printpanel.cpp b/examples/linguist/trollprint/printpanel.cpp deleted file mode 100644 index 163fc6de113..00000000000 --- a/examples/linguist/trollprint/printpanel.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "printpanel.h" - -//! [0] -PrintPanel::PrintPanel(QWidget *parent) - : QWidget(parent) -{ -/* - QLabel *label = new QLabel(tr("TROLL PRINT")); - label->setAlignment(Qt::AlignCenter); -*/ -//! [0] - -//! [1] - twoSidedGroupBox = new QGroupBox(tr("2-sided")); - twoSidedEnabledRadio = new QRadioButton(tr("Enabled")); - twoSidedDisabledRadio = new QRadioButton(tr("Disabled")); -//! [1] //! [2] - twoSidedDisabledRadio->setChecked(true); - - colorsGroupBox = new QGroupBox(tr("Colors")); - colorsEnabledRadio = new QRadioButton(tr("Enabled")); - colorsDisabledRadio = new QRadioButton(tr("Disabled")); -//! [2] - colorsDisabledRadio->setChecked(true); - - QHBoxLayout *twoSidedLayout = new QHBoxLayout; - twoSidedLayout->addWidget(twoSidedEnabledRadio); - twoSidedLayout->addWidget(twoSidedDisabledRadio); - twoSidedGroupBox->setLayout(twoSidedLayout); - - QHBoxLayout *colorsLayout = new QHBoxLayout; - colorsLayout->addWidget(colorsEnabledRadio); - colorsLayout->addWidget(colorsDisabledRadio); - colorsGroupBox->setLayout(colorsLayout); - - QVBoxLayout *mainLayout = new QVBoxLayout; -/* - mainLayout->addWidget(label); -*/ - mainLayout->addWidget(twoSidedGroupBox); - mainLayout->addWidget(colorsGroupBox); - setLayout(mainLayout); -} diff --git a/examples/linguist/trollprint/printpanel.h b/examples/linguist/trollprint/printpanel.h deleted file mode 100644 index a773a297006..00000000000 --- a/examples/linguist/trollprint/printpanel.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef PRINTPANEL_H -#define PRINTPANEL_H - -#include - -QT_BEGIN_NAMESPACE -class QGroupBox; -class QRadioButton; -QT_END_NAMESPACE - -//! [0] -class PrintPanel : public QWidget -{ - Q_OBJECT -//! [0] - -public: - PrintPanel(QWidget *parent = 0); - -private: - QGroupBox *twoSidedGroupBox; - QGroupBox *colorsGroupBox; - QRadioButton *twoSidedEnabledRadio; - QRadioButton *twoSidedDisabledRadio; - QRadioButton *colorsEnabledRadio; - QRadioButton *colorsDisabledRadio; -}; - -#endif diff --git a/examples/linguist/trollprint/trollprint.pro b/examples/linguist/trollprint/trollprint.pro deleted file mode 100644 index f4f60c41cfd..00000000000 --- a/examples/linguist/trollprint/trollprint.pro +++ /dev/null @@ -1,14 +0,0 @@ -HEADERS = mainwindow.h \ - printpanel.h -SOURCES = main.cpp \ - mainwindow.cpp \ - printpanel.cpp -TRANSLATIONS = trollprint_pt.ts - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/linguist/trollprint -INSTALLS += target - -QT += widgets - -simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/linguist/trollprint/trollprint_pt.ts b/examples/linguist/trollprint/trollprint_pt.ts deleted file mode 100644 index e5871bd0877..00000000000 --- a/examples/linguist/trollprint/trollprint_pt.ts +++ /dev/null @@ -1,65 +0,0 @@ - - - MainWindow - - Troll Print 1.0 - Troll Imprimir 1.0 - - - E&xit - &Sair - - - &About - &Sobre - - - About &Qt - Sobre &Qt - - - &File - &Arquivo - - - &Help - A&juda - - - About Troll Print 1.0 - Sobre Troll Imprimir 1.0 - - - Troll Print 1.0. - -Copyright 1999 Software, Inc. - Troll Imprimir 1.0 - -Copyright 1999 Software, Inc. - - - Ctrl+Q - Quit - Ctrl+Q - - - - PrintPanel - - 2-sided - 2-lados - - - Enabled - Ativado - - - Disabled - Desativado - - - Colors - Cores - - - From 85338a9c638f080e54ae9047dd5a86de3509199d Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Fri, 14 Dec 2012 14:19:43 +0100 Subject: [PATCH 11/23] Doc: Moved content from qtdoc - The qdoc pages were related to qtcore and they were referring to snippets inside the qtcore module boundary. - Fixed the exampledirs for QtCore to include the examples that are referred by the \snippet instances in the moved qdoc pages work. Change-Id: Ibb6dbb131920ea8692a203f6145863e5012e4602 Reviewed-by: Jerome Pasion (cherry picked from commit 69e602941112da325b1154e0dc52714bc27a2cc8) Reviewed-by: Sergio Ahumada --- src/corelib/doc/qtcore.qdocconf | 4 +- src/corelib/doc/src/custom-types.qdoc | 165 ++++++++++++++++++++ src/corelib/doc/src/objectmodel/object.qdoc | 3 +- src/corelib/doc/src/timers.qdoc | 123 +++++++++++++++ 4 files changed, 293 insertions(+), 2 deletions(-) create mode 100644 src/corelib/doc/src/custom-types.qdoc create mode 100644 src/corelib/doc/src/timers.qdoc diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index e0c74c9ae50..7e6d06eaa60 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -35,6 +35,8 @@ sourcedirs += .. exampledirs += \ ../ \ snippets \ - ../../../examples/threads + ../../../examples/threads/ \ + ../../../examples/tools/ \ + ../../../examples/widgets/widgets/analogclock imagedirs += images diff --git a/src/corelib/doc/src/custom-types.qdoc b/src/corelib/doc/src/custom-types.qdoc new file mode 100644 index 00000000000..95987ec014c --- /dev/null +++ b/src/corelib/doc/src/custom-types.qdoc @@ -0,0 +1,165 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page custom-types.html + \title Creating Custom Qt Types + \brief How to create and register new types with Qt. + + \ingroup best-practices + + \tableofcontents + + \section1 Overview + + When creating user interfaces with Qt, particularly those with specialized controls and + features, developers sometimes need to create new data types that can be used alongside + or in place of Qt's existing set of value types. + + Standard types such as QSize, QColor and QString can all be stored in QVariant objects, + used as the types of properties in QObject-based classes, and emitted in signal-slot + communication. + + In this document, we take a custom type and describe how to integrate it into Qt's object + model so that it can be stored in the same way as standard Qt types. We then show how to + register the custom type to allow it to be used in signals and slots connections. + + \section1 Creating a Custom Type + + Before we begin, we need to ensure that the custom type we are creating meets all the + requirements imposed by QMetaType. In other words, it must provide: + + \list + \li a public default constructor, + \li a public copy constructor, and + \li a public destructor. + \endlist + + The following \c Message class definition includes these members: + + \snippet customtype/message.h custom type definition + + The class also provides a constructor for normal use and two public member functions + that are used to obtain the private data. + + \section1 Declaring the Type with QMetaType + + The \c Message class only needs a suitable implementation in order to be usable. + However, Qt's type system will not be able to understand how to store, retrieve + and serialize instances of this class without some assistance. For example, we + will be unable to store \c Message values in QVariant. + + The class in Qt responsible for custom types is QMetaType. To make the type known + to this class, we invoke the Q_DECLARE_METATYPE() macro on the class in the header + file where it is defined: + + \snippet customtype/message.h custom type meta-type declaration + + This now makes it possible for \c Message values to be stored in QVariant objects + and retrieved later. See the \l{Custom Type Example} for code that demonstrates + this. + + The Q_DECLARE_METATYPE() macro also makes it possible for these values to be used as + arguments to signals, but \e{only in direct signal-slot connections}. + To make the custom type generally usable with the signals and slots mechanism, we + need to perform some extra work. + + \section1 Creating and Destroying Custom Objects + + Although the declaration in the previous section makes the type available for use + in direct signal-slot connections, it cannot be used for queued signal-slot + connections, such as those that are made between objects in different threads. + This is because the meta-object system does not know how to handle creation and + destruction of objects of the custom type at run-time. + + To enable creation of objects at run-time, call the qRegisterMetaType() template + function to register it with the meta-object system. This also makes the type + available for queued signal-slot communication as long as you call it before you + make the first connection that uses the type. + + The \l{Queued Custom Type Example} declares a \c Block class which is registered + in the \c{main.cpp} file: + + \snippet queuedcustomtype/main.cpp main start + \dots + \snippet queuedcustomtype/main.cpp register meta-type for queued communications + \dots + \snippet queuedcustomtype/main.cpp main finish + + This type is later used in a signal-slot connection in the \c{window.cpp} file: + + \snippet queuedcustomtype/window.cpp Window constructor start + \dots + \snippet queuedcustomtype/window.cpp connecting signal with custom type + \dots + \snippet queuedcustomtype/window.cpp Window constructor finish + + If a type is used in a queued connection without being registered, a warning will be + printed at the console; for example: + + \code + QObject::connect: Cannot queue arguments of type 'Block' + (Make sure 'Block' is registered using qRegisterMetaType().) + \endcode + + \section1 Making the Type Printable + + It is often quite useful to make a custom type printable for debugging purposes, + as in the following code: + + \snippet customtype/main.cpp printing a custom type + + This is achieved by creating a streaming operator for the type, which is often + defined in the header file for that type: + + \snippet customtype/message.h custom type streaming operator + + The implementation for the \c Message type in the \l{Custom Type Example} + goes to some effort to make the printable representation as readable as + possible: + + \snippet customtype/message.cpp custom type streaming operator + + The output sent to the debug stream can, of course, be made as simple or as + complicated as you like. Note that the value returned by this function is + the QDebug object itself, though this is often obtained by calling the + maybeSpace() member function of QDebug that pads out the stream with space + characters to make it more readable. + + \section1 Further Reading + + The Q_DECLARE_METATYPE() macro and qRegisterMetaType() function documentation + contain more detailed information about their uses and limitations. + + The \l{Custom Type Example}{Custom Type}, + \l{Custom Type Sending Example}{Custom Type Sending} + and \l{Queued Custom Type Example}{Queued Custom Type} examples show how to + implement a custom type with the features outlined in this document. + + The \l{Debugging Techniques} document provides an overview of the debugging + mechanisms discussed above. +*/ diff --git a/src/corelib/doc/src/objectmodel/object.qdoc b/src/corelib/doc/src/objectmodel/object.qdoc index 47f56372de2..edf5673da0d 100644 --- a/src/corelib/doc/src/objectmodel/object.qdoc +++ b/src/corelib/doc/src/objectmodel/object.qdoc @@ -47,7 +47,7 @@ properties} \li powerful \l{The Event System}{events and event filters} \li contextual \l{i18n}{string translation for internationalization} - \li sophisticated interval driven \l timers that make it possible + \li sophisticated interval driven \l {Timers}{timers} that make it possible to elegantly integrate many tasks in an event-driven GUI \li hierarchical and queryable \l{Object Trees & Ownership}{object trees} that organize object ownership in a natural way @@ -56,6 +56,7 @@ pointers which become dangling pointers when their objects are destroyed \li a \l{metaobjects.html#qobjectcast}{dynamic cast} that works across library boundaries. + \li support for \l{Creating Custom Qt Types}{custom type} creation. \endlist Many of these Qt features are implemented with standard C++ diff --git a/src/corelib/doc/src/timers.qdoc b/src/corelib/doc/src/timers.qdoc new file mode 100644 index 00000000000..eddb6005598 --- /dev/null +++ b/src/corelib/doc/src/timers.qdoc @@ -0,0 +1,123 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page timers.html + \title Timers + \brief How to use Qt timers in your application. + + \ingroup best-practices + + QObject, the base class of all Qt objects, provides the basic + timer support in Qt. With QObject::startTimer(), you start a + timer with an interval in milliseconds as argument. The function + returns a unique integer timer ID. The timer will now fire at + regular intervals until you explicitly call QObject::killTimer() + with the timer ID. + + For this mechanism to work, the application must run in an event + loop. You start an event loop with QApplication::exec(). When a + timer fires, the application sends a QTimerEvent, and the flow of + control leaves the event loop until the timer event is processed. + This implies that a timer cannot fire while your application is + busy doing something else. In other words: the accuracy of timers + depends on the granularity of your application. + + In multithreaded applications, you can use the timer mechanism in + any thread that has an event loop. To start an event loop from a + non-GUI thread, use QThread::exec(). Qt uses the object's + \l{QObject::thread()}{thread affinity} to determine which thread + will deliver the QTimerEvent. Because of this, you must start and + stop all timers in the object's thread; it is not possible to + start timers for objects in another thread. + + The upper limit for the interval value is determined by the number + of milliseconds that can be specified in a signed integer + (in practice, this is a period of just over 24 days). The accuracy + depends on the underlying operating system. Windows 2000 has 15 + millisecond accuracy; other systems that we have tested can handle + 1 millisecond intervals. + + The main API for the timer functionality is QTimer. That class + provides regular timers that emit a signal when the timer fires, and + inherits QObject so that it fits well into the ownership structure + of most GUI programs. The normal way of using it is like this: + + \snippet timers/timers.cpp 0 + \snippet timers/timers.cpp 1 + \snippet timers/timers.cpp 2 + + The QTimer object is made into a child of this widget so that, + when this widget is deleted, the timer is deleted too. + Next, its \l{QTimer::}{timeout()} signal is connected to the slot + that will do the work, it is started with a value of 1000 + milliseconds, indicating that it will time out every second. + + QTimer also provides a static function for single-shot timers. + For example: + + \snippet timers/timers.cpp 3 + + 200 milliseconds (0.2 seconds) after this line of code is + executed, the \c updateCaption() slot will be called. + + For QTimer to work, you must have an event loop in your + application; that is, you must call QCoreApplication::exec() + somewhere. Timer events will be delivered only while the event + loop is running. + + In multithreaded applications, you can use QTimer in any thread + that has an event loop. To start an event loop from a non-GUI + thread, use QThread::exec(). Qt uses the timer's + \l{QObject::thread()}{thread affinity} to determine which thread + will emit the \l{QTimer::}{timeout()} signal. Because of this, you + must start and stop the timer in its thread; it is not possible to + start a timer from another thread. + + The \l{widgets/analogclock}{Analog Clock} example shows how to use + QTimer to redraw a widget at regular intervals. From \c{AnalogClock}'s + implementation: + + \snippet analogclock.cpp 0 + \snippet analogclock.cpp 2 + \snippet analogclock.cpp 3 + \snippet analogclock.cpp 4 + \snippet analogclock.cpp 5 + \snippet analogclock.cpp 6 + \dots + \snippet analogclock.cpp 7 + + Every second, QTimer will call the QWidget::update() slot to + refresh the clock's display. + + If you already have a QObject subclass and want an easy + optimization, you can use QBasicTimer instead of QTimer. With + QBasicTimer, you must reimplement + \l{QObject::timerEvent()}{timerEvent()} in your QObject subclass + and handle the timeout there. The \l{widgets/wiggly}{Wiggly} + example shows how to use QBasicTimer. +*/ From a71b1e94f10ab06bc6240d3bae968f8bf91b9ca7 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 Dec 2012 16:27:17 +0100 Subject: [PATCH 12/23] Fix mandlebrot and imagescaling example qdoc markup. Change-Id: I5c9802cab917203092d93fca73b166d2dfeb64bc Reviewed-by: Jerome Pasion (cherry picked from commit 127f9e109869897c144d86be3a7999a2e1b4dea7) Reviewed-by: Sergio Ahumada --- .../imagescaling/doc/src/qtconcurrent-imagescaling.qdoc | 5 ++--- examples/threads/doc/src/mandelbrot.qdoc | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/qtconcurrent/imagescaling/doc/src/qtconcurrent-imagescaling.qdoc b/examples/qtconcurrent/imagescaling/doc/src/qtconcurrent-imagescaling.qdoc index 4cf07e8edb8..c270bda1024 100644 --- a/examples/qtconcurrent/imagescaling/doc/src/qtconcurrent-imagescaling.qdoc +++ b/examples/qtconcurrent/imagescaling/doc/src/qtconcurrent-imagescaling.qdoc @@ -28,11 +28,10 @@ /*! \example qtconcurrent/imagescaling \title Image Scaling Example - \bried Demonstrates how to asynchronously scale images. + \brief Demonstrates how to asynchronously scale images. \ingroup qtconcurrentexamples + \image imagescaling_example.png The QtConcurrent Map example shows how to use the asynchronous QtConcurrent API to load and scale a collection of images. - - \image imagescaling_example.png */ diff --git a/examples/threads/doc/src/mandelbrot.qdoc b/examples/threads/doc/src/mandelbrot.qdoc index 8ef8d0b01af..f2c544ad3d8 100644 --- a/examples/threads/doc/src/mandelbrot.qdoc +++ b/examples/threads/doc/src/mandelbrot.qdoc @@ -28,21 +28,21 @@ /*! \example mandelbrot \title Mandelbrot Example - \brief Demonstrates multi-thread programming using Qt \ingroup qtconcurrent-mtexamples - \brief The Mandelbrot example shows how to use a worker thread to + \brief The Mandelbrot example demonstrates multi-thread programming + using Qt. It shows how to use a worker thread to perform heavy computations without blocking the main thread's event loop. + \image mandelbrot-example.png Screenshot of the Mandelbrot example + The heavy computation here is the Mandelbrot set, probably the world's most famous fractal. These days, while sophisticated programs such as \l{XaoS} that provide real-time zooming in the Mandelbrot set, the standard Mandelbrot algorithm is just slow enough for our purposes. - \image mandelbrot-example.png Screenshot of the Mandelbrot example - In real life, the approach described here is applicable to a large set of problems, including synchronous network I/O and database access, where the user interface must remain responsive From 1ff94b05e977378776ba9f73e82d5c20b4f6bc3e Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 17 Dec 2012 12:43:26 +0100 Subject: [PATCH 13/23] OpenGL examples: Add error message about ANGLE on Windows These OpenGL examples require a Desktop OpenGL and will not build with OpenGL ES 2.0. This means those examples do not build on Windows with the default configuration using ANGLE. ANGLE is wrapping OpenGL ES 2.0 to DirectX and does not support the full Desktop OpenGL feature set. Since this is confusing for Windows users that do not know about ANGLE this patch adds an explicit error message describing the solution. (configuring Qt with -opengl desktop) Task-number: QTBUG-28590 Change-Id: I782e6830b9e282ddcc8a2ee0a47faf3579d36aab Reviewed-by: hjk Reviewed-by: Oswald Buddenhagen (cherry picked from commit 63693430c7cb8e8ede611eb9e99f305370d11ff9) Reviewed-by: Sergio Ahumada --- examples/opengl/framebufferobject2/framebufferobject2.pro | 6 ++++++ examples/opengl/grabber/grabber.pro | 6 ++++++ examples/opengl/hellogl/hellogl.pro | 6 ++++++ examples/opengl/overpainting/overpainting.pro | 6 ++++++ examples/opengl/pbuffers/pbuffers.pro | 6 ++++++ examples/opengl/pbuffers2/pbuffers2.pro | 6 ++++++ examples/opengl/samplebuffers/samplebuffers.pro | 6 ++++++ 7 files changed, 42 insertions(+) diff --git a/examples/opengl/framebufferobject2/framebufferobject2.pro b/examples/opengl/framebufferobject2/framebufferobject2.pro index d26751ab0e1..3a0dbb4446b 100644 --- a/examples/opengl/framebufferobject2/framebufferobject2.pro +++ b/examples/opengl/framebufferobject2/framebufferobject2.pro @@ -10,3 +10,9 @@ INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} diff --git a/examples/opengl/grabber/grabber.pro b/examples/opengl/grabber/grabber.pro index a60dbbe2dc6..c4c54c7c325 100644 --- a/examples/opengl/grabber/grabber.pro +++ b/examples/opengl/grabber/grabber.pro @@ -11,3 +11,9 @@ INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} diff --git a/examples/opengl/hellogl/hellogl.pro b/examples/opengl/hellogl/hellogl.pro index acaca356350..42913835a21 100644 --- a/examples/opengl/hellogl/hellogl.pro +++ b/examples/opengl/hellogl/hellogl.pro @@ -16,3 +16,9 @@ INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} diff --git a/examples/opengl/overpainting/overpainting.pro b/examples/opengl/overpainting/overpainting.pro index 08fe9b3dae7..141c8cb7ce5 100644 --- a/examples/opengl/overpainting/overpainting.pro +++ b/examples/opengl/overpainting/overpainting.pro @@ -15,3 +15,9 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/overpainting INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} diff --git a/examples/opengl/pbuffers/pbuffers.pro b/examples/opengl/pbuffers/pbuffers.pro index 1a9882c45d8..57bb3aa32ab 100644 --- a/examples/opengl/pbuffers/pbuffers.pro +++ b/examples/opengl/pbuffers/pbuffers.pro @@ -11,3 +11,9 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} diff --git a/examples/opengl/pbuffers2/pbuffers2.pro b/examples/opengl/pbuffers2/pbuffers2.pro index 31fd22cced3..c53309d1fa5 100644 --- a/examples/opengl/pbuffers2/pbuffers2.pro +++ b/examples/opengl/pbuffers2/pbuffers2.pro @@ -9,3 +9,9 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers2 INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} diff --git a/examples/opengl/samplebuffers/samplebuffers.pro b/examples/opengl/samplebuffers/samplebuffers.pro index 5793ea3e68f..d16993adfe4 100644 --- a/examples/opengl/samplebuffers/samplebuffers.pro +++ b/examples/opengl/samplebuffers/samplebuffers.pro @@ -9,3 +9,9 @@ INSTALLS += target simulator: warning(This example might not fully work on Simulator platform) + +contains(QT_CONFIG, opengles.) { + contains(QT_CONFIG, angle): \ + warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c") + error("This example requires Qt to be configured with -opengl desktop") +} From fbcc5217e51d6ccdbd8866deea21f32e68e18f50 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 17 Dec 2012 15:20:39 +0100 Subject: [PATCH 14/23] Doc: Correcting qhp link to Qt GUI C++ API. Task-number: QTBUG-28579 Change-Id: I224d55adc1be77138237da4efcac01641964c06b Reviewed-by: Geir Vattekar (cherry picked from commit 771e29178d792274bd122e68c71a97eced2aafe4) Reviewed-by: Sergio Ahumada --- src/gui/doc/qtgui.qdocconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf index cf324ad8aca..933d990c77d 100644 --- a/src/gui/doc/qtgui.qdocconf +++ b/src/gui/doc/qtgui.qdocconf @@ -21,7 +21,7 @@ qhp.QtGui.customFilters.Qt.filterAttributes = qtgui 5.0.0 qhp.QtGui.subprojects = classes qhp.QtGui.subprojects.classes.title = C++ Classes -qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ Classes +qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ API qhp.QtGui.subprojects.classes.selectors = class fake:headerfile qhp.QtGui.subprojects.classes.sortPages = true From bb454255a3a25290a88891ea00f6570b0ee13b96 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 17 Dec 2012 15:38:58 +0100 Subject: [PATCH 15/23] Doc: Correcting qhp link to Qt SQL's C++ Classes. Task-number: QTBUG-28579 Change-Id: I0faae04ab125236554cb39659169780e2ab64629 Reviewed-by: Geir Vattekar (cherry picked from commit 7d685afe5d9f2055dc24d5a978355893c8183758) Reviewed-by: Sergio Ahumada --- src/sql/doc/qtsql.qdocconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/doc/qtsql.qdocconf b/src/sql/doc/qtsql.qdocconf index 4de56207f65..61573d542c8 100644 --- a/src/sql/doc/qtsql.qdocconf +++ b/src/sql/doc/qtsql.qdocconf @@ -21,7 +21,7 @@ qhp.QtSql.customFilters.Qt.filterAttributes = qtsql 5.0.0 qhp.QtSql.subprojects = classes qhp.QtSql.subprojects.classes.title = C++ Classes -qhp.QtSql.subprojects.classes.indexTitle = Qt SQL C++ Classes +qhp.QtSql.subprojects.classes.indexTitle = Qt SQL Module C++ Classes qhp.QtSql.subprojects.classes.selectors = class fake:headerfile qhp.QtSql.subprojects.classes.sortPages = true tagfile = ../../../doc/qtsql/qtsql.tags From 3a75e2f227810d75adc22d426fcab1355611adee Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 17 Dec 2012 22:46:45 +0100 Subject: [PATCH 16/23] Initalize the printinfo on Mac if it requests and it needs initalizing When the print panel was closed then it would clean up the printinfo and if it was requested for the same QPrinter then it would not be recreated in time. Therefore we check if it is initalized and if not we re-initalize it. Task-number: QTBUG-28657 Change-Id: I7dc9011b80e03cfa3eae8fee2fcf6cc8021a8566 Reviewed-by: Lars Knoll (cherry picked from commit dde9569d389b4382e8869ac48f942adb3c51ade7) Reviewed-by: Sergio Ahumada --- src/plugins/platforms/cocoa/qcocoanativeinterface.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm index f0b1bd330a7..271c9d28941 100644 --- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm +++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm @@ -107,8 +107,10 @@ QPlatformPrinterSupport *QCocoaNativeInterface::createPlatformPrinterSupport() void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine) { #ifndef QT_NO_WIDGETS - QMacPrintEngine *macPrintEngine = static_cast(printEngine); - return macPrintEngine->d_func()->printInfo; + QMacPrintEnginePrivate *macPrintEnginePriv = static_cast(printEngine)->d_func(); + if (macPrintEnginePriv->state == QPrinter::Idle && !macPrintEnginePriv->isPrintSessionInitialized()) + macPrintEnginePriv->initialize(); + return macPrintEnginePriv->printInfo; #else qFatal("Printing is not supported when Qt is configured with -no-widgets"); return 0; From c8b1c9dceaee73df30b6c154df5eed6d119242fe Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 14 Dec 2012 10:42:08 +0100 Subject: [PATCH 17/23] tst_QDBusXmlParser: make XML attribute order deterministic Avoid QHash randomization so that the order of the XML attributes is stable This was causing intermittent failures. Change-Id: I4cc0dba4b0c2ec36601f3b06fb17ff80005cc9fb Reviewed-by: Sean Harmer (cherry picked from commit aa434bc90861f1599209edd6bc614802c50704dc) Reviewed-by: Sergio Ahumada --- tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp index 35cf9897534..6d58fdf6d05 100644 --- a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp +++ b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp @@ -58,6 +58,7 @@ private: QString clean_xml(const QString&); private slots: + void initTestCase(); void parsing_data(); void parsing(); void parsingWithDoctype_data(); @@ -71,6 +72,12 @@ private slots: void properties(); }; +void tst_QDBusXmlParser::initTestCase() +{ + // Avoid QHash randomization so that the order of the XML attributes is stable + qputenv("QT_HASH_SEED", "123"); +} + void tst_QDBusXmlParser::parsing_data() { QTest::addColumn("xmlData"); From e14dd5a65d1ba9cd37c8ca9924886e0b36de9911 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 17 Dec 2012 15:25:35 -0800 Subject: [PATCH 18/23] Fix direct compilation of qtypeinfo.h and others qtypeinfo.h is included by qglobal.h, so it needs to include that before the #ifdef. Otherwise, we get a circular dependency problem with qflags.h: ./QtCore/../../src/corelib/global/qflags.h:60:27: error: "Q_PRIMITIVE_TYPE" has not been declared Also, take the opportunity to fix the other headers that are included from qglobal.h to avoid similar problems in the future. Change-Id: I99a56f42775c24bdcc796995b06509c1ca0cb849 Reviewed-by: Olivier Goffart (cherry picked from commit 797f3c0a01e9adf0af3bc7c0bd3f7f63849d99b9) Reviewed-by: Sergio Ahumada --- src/corelib/global/qflags.h | 3 ++- src/corelib/global/qsysinfo.h | 4 ++-- src/corelib/global/qtypeinfo.h | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h index 3edbef3bd63..cbd7185a92b 100644 --- a/src/corelib/global/qflags.h +++ b/src/corelib/global/qflags.h @@ -39,10 +39,11 @@ ** ****************************************************************************/ +#include + #ifndef QFLAGS_H #define QFLAGS_H -#include #include #include diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index 275b8996622..867acd4d606 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -39,11 +39,11 @@ ** ****************************************************************************/ +#include + #ifndef QSYSINFO_H #define QSYSINFO_H -#include - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index a4b12feae30..68df50a2af4 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -39,11 +39,11 @@ ** ****************************************************************************/ +#include + #ifndef QTYPEINFO_H #define QTYPEINFO_H -#include - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE From 3bf50a7db9a1add66fb66b7a1f9c1d3b038c5e7f Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 18 Dec 2012 14:05:45 +0100 Subject: [PATCH 19/23] Fix font sizes when X11 has a forced dpi setting On X11, the X resource system can override the physical DPI of the screen for resolving font sizes etc. Correctly load the setting and adjust the logicalDpi() accordingly. Change-Id: Id60d03d1d214fb99e9de17a65976abd170bb7cca Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/xcb/qxcbscreen.cpp | 44 ++++++++++++++++++++++++ src/plugins/platforms/xcb/qxcbscreen.h | 2 ++ 2 files changed, 46 insertions(+) diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index 4f0c3ba6bb7..fc80662c462 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -66,6 +66,7 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, xcb_screen_t *scr, , m_orientation(Qt::PrimaryOrientation) , m_number(number) , m_refreshRate(60) + , m_forcedDpi(-1) { if (connection->hasXRandr()) xcb_randr_select_input(xcb_connection(), screen()->root, true); @@ -82,6 +83,9 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, xcb_screen_t *scr, if (m_availableGeometry.isEmpty()) m_availableGeometry = QRect(QPoint(), m_virtualSize); + readXResources(); + + #ifdef Q_XCB_DEBUG qDebug(); qDebug("Screen output %s of xcb screen %d:", m_outputName.toUtf8().constData(), m_number); @@ -243,6 +247,9 @@ QImage::Format QXcbScreen::format() const QDpi QXcbScreen::logicalDpi() const { + if (m_forcedDpi > 0) + return QDpi(m_forcedDpi, m_forcedDpi); + return QDpi(Q_MM_PER_INCH * m_virtualSize.width() / m_virtualSizeMillimeters.width(), Q_MM_PER_INCH * m_virtualSize.height() / m_virtualSizeMillimeters.height()); } @@ -474,4 +481,41 @@ QPixmap QXcbScreen::grabWindow(WId window, int x, int y, int width, int height) return result; } +void QXcbScreen::readXResources() +{ + int offset = 0; + QByteArray resources; + while(1) { + xcb_get_property_reply_t *reply = + xcb_get_property_reply(xcb_connection(), + xcb_get_property_unchecked(xcb_connection(), false, screen()->root, + XCB_ATOM_RESOURCE_MANAGER, + XCB_ATOM_STRING, offset/4, 8192), NULL); + bool more = false; + if (reply && reply->format == 8 && reply->type == XCB_ATOM_STRING) { + resources += QByteArray((const char *)xcb_get_property_value(reply), xcb_get_property_value_length(reply)); + offset += xcb_get_property_value_length(reply); + more = reply->bytes_after != 0; + } + + if (reply) + free(reply); + + if (!more) + break; + } + + QList split = resources.split('\n'); + for (int i = 0; i < split.size(); ++i) { + const QByteArray &r = split.at(i); + if (r.startsWith("Xft.dpi:\t")) { + bool ok; + int dpi = r.mid(sizeof("Xft.dpi:")).toInt(&ok); + if (ok) + m_forcedDpi = dpi; + break; + } + } +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h index d9eee464dc4..96d30cde8bc 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h @@ -96,6 +96,7 @@ public: void updateGeometry(xcb_timestamp_t timestamp); void updateRefreshRate(); + void readXResources(); private: xcb_screen_t *m_screen; xcb_randr_crtc_t m_crtc; @@ -114,6 +115,7 @@ private: QMap m_visuals; QXcbCursor *m_cursor; int m_refreshRate; + int m_forcedDpi; }; QT_END_NAMESPACE From fd925d630f6d96b89352359960d7dc8f35d90152 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Dec 2012 16:26:23 +0100 Subject: [PATCH 20/23] added changelog for linguist Change-Id: Id4920837017de1496fa1a72581a3453e32dc93a2 Reviewed-by: Lars Knoll --- dist/changes-5.0.0 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0 index a969fc84d5e..564df7f7015 100644 --- a/dist/changes-5.0.0 +++ b/dist/changes-5.0.0 @@ -891,6 +891,11 @@ Qt for Windows CE - Linguist + * The integration with Mac OS' document handling was improved + * lupdate can now treat other .ts files as sources + * lupdate's CODECFORTR is deprecated and will be removed soon. All source code + written with Qt is expected to use UTF-8 encoding. + - rcc From ce66a61a7113fe5ac3588dd2a732026f604bd0a3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Dec 2012 16:28:09 +0100 Subject: [PATCH 21/23] mention that qt3support is gone Change-Id: I08f01eef9d93876471d365ce09f5e1706e74312d Reviewed-by: Lars Knoll --- dist/changes-5.0.0 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0 index 564df7f7015..3574c401bba 100644 --- a/dist/changes-5.0.0 +++ b/dist/changes-5.0.0 @@ -11,6 +11,8 @@ information about a particular change. * Source incompatible changes * **************************************************************************** +- The Qt 3 support module and all related code was removed. + - QAtomicInt's and QAtomicPointer's non-atomic convenience methods (i.e., operator=, operator int / operator T*, operator!, operator==, operator!= and operator->) have been removed as they did implicit @@ -908,9 +910,6 @@ Qt for Windows CE - uic -- uic3 - - - qmake * QMAKE_MOC_OPTIONS variable is now available for passing additional parameters From dd69e430ca3d8be0465b43d8fd332aed5a2d0634 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Dec 2012 16:09:59 +0100 Subject: [PATCH 22/23] finish changelog for qmake, configure & co. Change-Id: I69e88421b2959215f05f024aedc60dc2c52133fe Reviewed-by: Lars Knoll --- dist/changes-5.0.0 | 139 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 108 insertions(+), 31 deletions(-) diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0 index 3574c401bba..212e08f11f8 100644 --- a/dist/changes-5.0.0 +++ b/dist/changes-5.0.0 @@ -284,23 +284,6 @@ information about a particular change. - QIconEngineV2 was merged into QIconEngine You might need to adjust your code if it used a QIconEngine. -- qmake - * Projects which explicitly set an empty TARGET are considered broken now. - * The makespec and .qmake.cache do not see build pass specific variables any more. - * load()/include() with a target namespace and infile()/$$fromfile() now start with - an entirely pristine context. - * Configure's -sysroot and -hostprefix are now handled slightly differently. - The QT_INSTALL_... properties are now automatically prefixed with the sysroot; - the raw values are available as QT_INSTALL_.../raw and the sysroot as QT_SYSROOT. - The new QT_HOST_... properties can be used to refer to the Qt host tools. - * Several functions and built-in variables were modified to return normalized paths. - * The -(no-)exception flags in configure have been removed. Qt modules are now compiled - without exceptions by default, as they do not use them and can neither handle them - properly. Qt Core still has exceptions enabled to correctly throw bad_alloc exceptions - in our tool classes. - Whether code should be compiled with exception support enabled or disabled can be - controlled by a CONFIG += exceptions/exceptions_off setting in the .pro file. - - QTextCodecPlugin has been removed since it is no longer used. All text codecs are now built into QtCore. @@ -880,9 +863,66 @@ Qt for Windows CE - Build System - * Remove qttest_p4.prf file. From now on we should explicitly enable the - things from it which we want. Autotest .pro files should stop using - 'load(qttest_p4)' and start using 'CONFIG+=testcase' instead. + * Qt has been split into numerous repositories. Configure covers mostly only qtbase's options. + * Qt will now install CMake configuration files for all its libraries. + +- configure + + * The Mac OS X -dwarf2 configure argument has been removed. DWARF2 is always + used on Mac OS X now. + * The following options have been added: (-no)-force-asserts, (-no)-strip, (-no)-gui & + (-no)-widgets, -device & -device-option, -archdatadir, -libexecdir & -qmldir, + and numerous changes relating to specific Qt features and dependencies. + * Configure will no longer call "qmake -recursive" by default, as the subsequent + build invokes qmake as needed. Use -fully-process to restore the old behavior. + +- qmake + + * default_pre.prf is now evaluated per subproject & build pass, symmetrically + to default_post.prf. + * .qmake.conf files (.qmake.cache equivalent in source tree) are read now. + * Project-specific mkspecs/ and features/ directories are supported now. + QMAKEPATH and QMAKEFEATURES can be set in .qmake.{config,cache} to specifiy their + location, and qmake will find them in the project's top-level directory automatically. + * Mixing host and target subprojects is now supported. "default-host" makespec + was added; option(host_build) enables its use. + * QMAKE_MOC_OPTIONS variable is now available for passing additional parameters + to the moc. + * The CROSS_COMPILE variable and property can be used to parametrize the device + and mingw makespecs. + * QMAKE_RPATHLINKDIR (complementary to QMAKE_RPATHDIR) is now understood. + * The "aux" TEMPLATE was added. Does not work with vcproj and xcode output files. + * The properties QT_INSTALL_ARCHDATA, QT_INSTALL_LIBEXECS, QT_INSTALL_QML, + QMAKE_SPEC & QMAKE_XSPEC were added. QT_INSTALL_DEMOS is obsolete. + * The following functions have been added: $$sort_depends, $$resolve_depends, + $$enumerate_vars, $$reverse, $$val_escape, $$format_number, $$shadowed, + $$clean_path, $$system_path, $$shell_path, $$absolute_path, $$relative_path, + $$system_quote, $$shell_quote, cache, write_file, touch, mkpath & log. + defined can now query variables; $$cat and $$system support more splitting modes. + qtCompileTest (available from configure.prf) was added. + * Removed qttest_p4.prf. Use CONFIG+=testcase and other flags instead. + * QMAKE_SUBSTITUTES can now copy files verbatim. + * MSVC desktop builds now use -Zc:wchar_t. + * The following variables were added: QMAKESPEC, _QMAKE_CONF_ & _QMAKE_SUPER_CACHE_. + * QDBUSXML2CPP_{INTERFACES,ADAPTORS}_{HEADER,SOURCE}_FLAGS are now understood, + and DBUS_{INTERFACES,ADAPTORS} support file groups with individual flags now. + * QT_PRIVATE and PKGCONFIG_PRIVATE (analogous to LIBS_PRIVATE resp. PKGCONFIG) are now understood. + * INSTALLS entries now support copying with subdirectory (e.g., entry.base = $$dirname(PWD)). + * Defining QTPLUGIN in dynamically linked projects does not hurt any more. + * CONFIG+=import_plugins will now cause plugin imports for QTPLUGIN being auto-generated. + * Debug info generation can now be enabled also for release builds (CONFIG+=force_debug_info). + * The following CONFIG flags have been deprecated in favor of QT module entries: + qtestlib, qdbus, help, designer, uitools, qaxserver & qaxcontainer (the leading 'q' + was stripped from the affected modules). + * The IN_PWD alias for PWD was deprecated. + * QMAKE_{DIST,}CLEAN support normalized path separators now. + * CONFIG+=depend_includepath is on by default now. DEPENDPATH is unnecessary in most projects. + * Makespecs should be adjusted in the following ways: + * The QMAKE_INCDIR_QT, QMAKE_LIBDIR_QT, QMAKE_MOC, QMAKE_UIC, QMAKE_IDC, TEMPLATE & QT + variables should not be defined any more. Furthermore, QMAKE_LIBS_X11SM is obsolete. + * The qt, warn_on, release, & link_prl CONFIG flags should not be set any more. + * The QMAKE_PLATFORM & QMAKE_COMPILER variables should be defined now. + Several other variables should be defined by including files from mkspecs/common/. - Assistant @@ -910,17 +950,6 @@ Qt for Windows CE - uic -- qmake - -* QMAKE_MOC_OPTIONS variable is now available for passing additional parameters - to the moc. - - -- configure - - * The Mac OS X -dwarf2 configure argument has been removed. DWARF2 is always - used on Mac OS X now. - - qtconfig @@ -969,6 +998,10 @@ Qt for Windows CE in the URL by themselves. Now, it will return "%25", like QUrl::toEncoded(). +- QLibraryInfo + + * location() always returns paths with normalized separators now. + - QVariant * Definition of QVariant::UserType changed. Currently it is the same as @@ -995,3 +1028,47 @@ Qt for Windows CE * The static function QMessageBox::question has changed the default argument for buttons. Before the default was to have an Ok button. That is changed to having a yes and a no button. + +- qmake & configure + + * The project file parser has been rewritten from scratch. Invalid syntax will be + rejected more aggressively, and interpretation may have changed in some corner cases. + * Projects which explicitly set an empty TARGET are considered broken now. + * The makespec and .qmake.cache do not see build pass specific variables any more. + * load()/include() with a target namespace and infile()/$$fromfile() now start with + an entirely pristine context. + * Configure's -sysroot and -hostprefix are now handled slightly differently. + The QT_INSTALL_... properties are now automatically prefixed with the sysroot; + the raw values are available as QT_INSTALL_.../raw and the sysroot as QT_SYSROOT. + The new QT_HOST_... properties can be used to refer to the Qt host tools. + -no-gcc-sysroot can be used for non-standard sysroot configurations. + * The QMAKE_MKSPECS property became unavailable at the command line. Query QT_HOST_DATA instead. + * The TEMPLATE_PREFIX variable is gone. Use contains(TEMPLATE, vc.*) instead. + * The "default" makespec symlink/directory is gone. Use qmake -query QMAKE_XSPEC instead. + * DEPENDPATH does not end up in VPATH any more. Some SOURCES may not be found any more. + * Several functions and built-in variables were modified to return normalized paths. + * The -(no-)exception flags in configure have been removed. Qt modules are now compiled + without exceptions by default, as they do not use them and can neither handle them + properly. Qt Core still has exceptions enabled to correctly throw bad_alloc exceptions + in our tool classes. + Whether code should be compiled with exception support enabled or disabled can be + controlled by a CONFIG += exceptions/exceptions_off setting in the .pro file. + * The -no/-stl configure options are gone. Qt always uses the STL now. + * The -prefix-install configure option is gone. Use -prefix, etc. instead. + * The -make option of the Windows configure was renamed to -make-tool. + -make now complements -no-make, like in the Unix version. + * The object_with_source CONFIG flag was removed. Use object_parallel_to_source instead. + * Support for universal binaries on Mac OS has been removed. + * The processor architecture handling changed significantly. This affects the -arch & -*-endian + configure options, the QT_ARCH qmake variable, and more. + * No "make_default" make targets will be generated any more. Use "make_first" instead. + * The "qmake" make targets are non-recursive now. Use "qmake_all" to recurse. + * load() with paths relative to the current project is not supported any more. + Use include() instead. + * Persistent qmake properties are not versioned any more. Also, the vendor changed to + "QtProject", so old settings are lost. + * Support for the Borland toolchain was removed. Numerous obsolete makespecs were culled. + * setcepaths.bat is gone. QMake-generated Makefiles are self-contained now. + * moc_dir, rcc_dir and some other tool variables are not defined in Qt's .pc files any more; + the generic host_bins is defined instead. + From d1c10615e31acc487eae0c966e8c3a8e5927af84 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Dec 2012 16:55:20 +0100 Subject: [PATCH 23/23] slash the -fast configure option it's completely broken, and i have no time to fix it properly now. configure runs no qmake -r by default any more, so it's fast enough. Change-Id: Ib2b4c68f1fc2fe95accecbe93dd5a87c9b015692 Reviewed-by: David Faure (KDE) Reviewed-by: Lars Knoll --- configure | 59 ------------------- dist/changes-5.0.0 | 1 + tools/configure/configureapp.cpp | 98 +------------------------------- tools/configure/configureapp.h | 1 - 4 files changed, 3 insertions(+), 156 deletions(-) diff --git a/configure b/configure index 2fbe7a10069..faf8a6d380d 100755 --- a/configure +++ b/configure @@ -861,7 +861,6 @@ PLATFORM=$QMAKESPEC QT_CROSS_COMPILE=no OPT_CONFIRM_LICENSE=no OPT_SHADOW=maybe -OPT_FAST=auto OPT_VERBOSE=no OPT_HELP= CFG_SILENT=no @@ -2015,13 +2014,6 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; - fast) - if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then - OPT_FAST="$VAL" - else - UNKNOWN_OPT=yes - fi - ;; rpath) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_RPATH="$VAL" @@ -2305,14 +2297,6 @@ if [ ! -d "${outpath}/lib/fonts" ]; then fi fi -if [ "$OPT_FAST" = "auto" ]; then - if [ '!' -z "$AWK" ] && [ "$CFG_DEV" = "yes" ]; then - OPT_FAST=yes - else - OPT_FAST=no - fi -fi - # find a make command if [ -z "$MAKE" ]; then MAKE= @@ -3099,12 +3083,6 @@ Configure options: -fully-process ..... Generate Makefiles for the entire Qt tree. -dont-process ...... Do not generate any Makefiles. - * -no-fast ........... Configure Qt normally by generating Makefiles for all - project files. - -fast .............. Configure Qt quickly by generating Makefiles only for - library and subdirectory targets. All other Makefiles - are created as wrappers, which will in turn run qmake. - -no-largefile ...... Disables large file support. + -largefile ......... Enables Qt to access files larger than 4 GB. @@ -6375,43 +6353,6 @@ if [ "$CFG_PROCESS" != "no" ]; then else "$outpath/bin/qmake" "$relpath" fi - - if [ "$OPT_FAST" = "yes" ]; then - PART_ROOTS= - for part in $CFG_BUILD_PARTS; do - case "$part" in - examples|tests) PART_ROOTS="$PART_ROOTS $part" ;; - esac - done - if [ "x$PART_ROOTS" != "x" ]; then - echo - echo "Creating stub makefiles. Please wait..." - QMAKE="$outpath/bin/qmake" - [ "$CFG_DEBUG_RELEASE" = "no" ] && first_tgt="first_target: first" || first_tgt= - (cd "$relpath" && find $PART_ROOTS -name '*.pro') | grep -v /testdata/ | while read p; do - d=${p%/*} - test -f "$outpath/$d/Makefile" && continue - echo " for $relpath/$p" - - mkdir -p "$outpath/$d" || exit - cat > "$outpath/$d/Makefile" <", "Add part to the list of parts to be built at make time"); for (int i=0; idirectory == "tools/configure") - continue; // don't overwrite our own Makefile - - QString dirPath = it->directory + '/'; - QString projectName = it->proFile; - QString makefileName = buildPath + "/" + dirPath + it->target; - - // For shadowbuilds, we need to create the path first - QDir buildPathDir(buildPath); - if (sourcePath != buildPath && !buildPathDir.exists(dirPath)) - buildPathDir.mkpath(dirPath); - - QStringList args; - - args << QDir::toNativeSeparators(buildPath + "/bin/qmake.exe"); - args << sourcePath + "/" + dirPath + projectName; - - cout << "For " << qPrintable(QDir::toNativeSeparators(dirPath + projectName)) << endl; - args << "-o"; - args << it->target; - - QDir::setCurrent(dirPath); - - QFile file(makefileName); - if (!file.open(QFile::WriteOnly | QFile::Text)) { - printf("failed on dirPath=%s, makefile=%s\n", - qPrintable(QDir::toNativeSeparators(dirPath)), - qPrintable(QDir::toNativeSeparators(makefileName))); - continue; - } - QTextStream txt(&file); - txt << "all:\n"; - txt << "\t" << args.join(' ') << "\n"; - txt << "\t$(MAKE) -$(MAKEFLAGS) -f " << it->target << "\n"; - txt << "first: all\n"; - txt << "qmake: FORCE\n"; - txt << "\t" << args.join(' ') << "\n"; - txt << "FORCE:\n"; - } - } } QDir::setCurrent(pwd); } else { diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index dc79e3ff585..3f4987f6899 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -85,7 +85,6 @@ public: void generateSystemVars(); #endif void showSummary(); - void findProjects( const QString& dirName ); QString firstLicensePath(); #if !defined(EVAL)