diff options
179 files changed, 1529 insertions, 732 deletions
diff --git a/bin/syncqt b/bin/syncqt index 69d50ec4ca..a955456fec 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -46,7 +46,9 @@ my $check_includes = 0; my $copy_headers = 0; my $create_uic_class_map = 0; my $create_private_headers = 1; -my $no_module_fwd = 0; +my $module_fwd = ""; +my $cache_module_fwd = 0; +my $developer_build = 0; my $no_module_version_header = 0; my @modules_to_sync ; $force_relative = 1 if ( -d "/System/Library/Frameworks" ); @@ -72,12 +74,18 @@ sub showUsage print " -windows Force platform to Windows (default: " . ($force_win ? "yes" : "no") . ")\n"; print " -showonly Show action but not perform (default: " . ($showonly ? "yes" : "no") . ")\n"; print " -outdir <PATH> Specify output directory for sync (default: $out_basedir)\n"; - print " -qtdir <PATH> Set the path to QtBase (detected: " . (defined $qtbasedir ? $qtbasedir : "-none-") . ")\n"; + print " -qtdir <PATH> Set the path to QtBase (detected: " . (defined $qtbasedir ? $qtbasedir : "-none-") . ")\n"; print " -quiet Only report problems, not activity (default: " . ($quiet ? "yes" : "no") . ")\n"; print " -separate-module <NAME>:<PROFILEDIR>:<HEADERDIR>\n"; - print " Create headers for <NAME> with original headers in <HEADERDIR> relative to <PROFILEDIR> \n"; + print " Create headers for <NAME> with original headers in\n"; + print " <HEADERDIR> relative to <PROFILEDIR> \n"; print " -private Force copy private headers (default: " . ($create_private_headers ? "yes" : "no") . ")\n"; - print " -no-module-fwd Don't create fwd includes for module pri files\n"; + print " -module-fwd <PATH> Create fwd includes for module pri files in the given\n"; + print " path (default: none)\n"; + print " -cache-module-fwd Create a .qmake.cache file to cache the location of the\n"; + print " fwd includes\n"; + print " -developer-build Point libraries and binaries to a common directory for\n"; + print " easy development\n"; print " -no-module-version-header\n"; print " Don't create module version header file\n"; print " -help This help\n"; @@ -590,6 +598,18 @@ while ( @ARGV ) { $arg eq "-relative" || $arg eq "-check-includes") { $var = substr($arg, 1); $val = "yes"; + } elsif($arg eq "-module-fwd") { + $var = "module_fwd"; + $val = shift @ARGV; + } elsif($arg eq "-cache-module-fwd") { + $var = "cache_module_fwd"; + $val = "yes"; + } elsif($arg eq "-developer-build") { + $var = "developer_build"; + $val = "yes"; + } elsif($arg eq "-no-module-version-header") { + $var = "no_module_version_header"; + $val = "yes"; } elsif($arg =~ /^-no-(.*)$/) { $var = $1; $val = "no"; @@ -619,12 +639,6 @@ while ( @ARGV ) { # skip, it's been dealt with at the top of the file shift @ARGV; next; - } elsif($arg eq "-no-module-fwd") { - $var = "no_module_fwd"; - $val = "yes"; - } elsif($arg eq "-no-module-version-header") { - $var = "no_module_version_header"; - $val = "yes"; } elsif($arg =~/^-/) { print "Unknown option: $arg\n\n" if(!$var); showUsage(); @@ -700,8 +714,12 @@ while ( @ARGV ) { } else { die "The -qtdir option requires an argument"; } - } elsif ($var eq "no_module_fwd") { - $no_module_fwd = 1; + } elsif ($var eq "module_fwd") { + $module_fwd = $val; + } elsif ($var eq "cache_module_fwd") { + $cache_module_fwd = 1; + } elsif ($var eq "developer_build") { + $developer_build = 1; } elsif ($var eq "no_module_version_header") { $no_module_version_header = 1; } elsif ($var eq "output") { @@ -1066,21 +1084,35 @@ foreach my $lib (@modules_to_sync) { } # create forwarding module pri in qtbase/mkspecs/modules - unless ($no_module_fwd) { + if ($module_fwd) { my $modulepri = $modulepris{$lib}; if (-e $modulepri) { my $modulepriname = basename($modulepri); - my $moduleprifwd = "$qtbasedir/mkspecs/modules/$modulepriname"; - open MODULE_PRI_FILE, ">$moduleprifwd"; - print MODULE_PRI_FILE "QT_MODULE_BASE = $basedir\n"; - print MODULE_PRI_FILE "QT_MODULE_BIN_BASE = $qtbasedir/bin\n"; + mkpath($module_fwd); + my $moduleprifwd = "$module_fwd/$modulepriname"; + my $mod_base = $developer_build ? $basedir : $out_basedir; + my $mod_component_base = $developer_build ? $qtbasedir : $out_basedir; + open MODULE_PRI_FILE, ">$moduleprifwd" or die("Could not open $moduleprifwd for writing"); + print MODULE_PRI_FILE "QT_MODULE_BASE = $mod_base\n"; + print MODULE_PRI_FILE "QT_MODULE_BIN_BASE = $mod_component_base/bin\n"; print MODULE_PRI_FILE "QT_MODULE_INCLUDE_BASE = $out_basedir/include\n"; - print MODULE_PRI_FILE "QT_MODULE_IMPORT_BASE = $qtbasedir/imports\n"; - print MODULE_PRI_FILE "QT_MODULE_LIB_BASE = $qtbasedir/lib\n"; - print MODULE_PRI_FILE "QT_MODULE_PLUGIN_BASE = $qtbasedir/plugins\n"; + print MODULE_PRI_FILE "QT_MODULE_IMPORT_BASE = $mod_component_base/imports\n"; + print MODULE_PRI_FILE "QT_MODULE_LIB_BASE = $mod_component_base/lib\n"; + print MODULE_PRI_FILE "QT_MODULE_PLUGIN_BASE = $mod_component_base/plugins\n"; print MODULE_PRI_FILE "include($modulepri)\n"; close MODULE_PRI_FILE; utime(time, (stat($modulepri))[9], $moduleprifwd); + if ($cache_module_fwd) { + my $cacheStatement = "QMAKE_EXTRA_MODULE_FORWARDS = \"$module_fwd\""; + my $cacheFile = "$out_basedir/.qmake.cache"; + my $existingQmakeCache = fileContents($cacheFile); + # Skip if it's already there. + if ($existingQmakeCache !~ $cacheStatement) { + open QMAKE_CACHE_FILE, ">>$cacheFile" or die("Could not open $cacheFile for writing"); + print QMAKE_CACHE_FILE "$cacheStatement\n"; + close(QMAKE_CACHE_FILE); + } + } } elsif ($modulepri) { print "WARNING: Module $lib\'s pri file '$modulepri' not found.\nSkipped creating forwarding pri for $lib.\n"; } diff --git a/examples/animation/animatedtiles/animatedtiles.pro b/examples/animation/animatedtiles/animatedtiles.pro index 77a9b55597..791bbf6a22 100644 --- a/examples/animation/animatedtiles/animatedtiles.pro +++ b/examples/animation/animatedtiles/animatedtiles.pro @@ -12,4 +12,4 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/animation/appchooser/appchooser.pro b/examples/animation/appchooser/appchooser.pro index 0fb1aa6829..3969b551e9 100644 --- a/examples/animation/appchooser/appchooser.pro +++ b/examples/animation/appchooser/appchooser.pro @@ -12,4 +12,4 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/animation/moveblocks/moveblocks.pro b/examples/animation/moveblocks/moveblocks.pro index f127148793..b82370dff6 100644 --- a/examples/animation/moveblocks/moveblocks.pro +++ b/examples/animation/moveblocks/moveblocks.pro @@ -11,4 +11,4 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/animation/states/states.pro b/examples/animation/states/states.pro index 18dc7ac29e..5c0d28163b 100644 --- a/examples/animation/states/states.pro +++ b/examples/animation/states/states.pro @@ -12,4 +12,4 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/animation/stickman/stickman.pro b/examples/animation/stickman/stickman.pro index c0e180e741..340a502c90 100644 --- a/examples/animation/stickman/stickman.pro +++ b/examples/animation/stickman/stickman.pro @@ -25,4 +25,4 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/dialogs/configdialog/configdialog.pro b/examples/dialogs/configdialog/configdialog.pro index de396bd0d5..51a7f457d7 100644 --- a/examples/dialogs/configdialog/configdialog.pro +++ b/examples/dialogs/configdialog/configdialog.pro @@ -15,7 +15,7 @@ symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/sipdialog/sipdialog.pro b/examples/dialogs/sipdialog/sipdialog.pro index 937d2141e8..cea038ede3 100644 --- a/examples/dialogs/sipdialog/sipdialog.pro +++ b/examples/dialogs/sipdialog/sipdialog.pro @@ -11,10 +11,9 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib - QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/standarddialogs/standarddialogs.pro b/examples/dialogs/standarddialogs/standarddialogs.pro index 46a692b15c..59cd79f413 100644 --- a/examples/dialogs/standarddialogs/standarddialogs.pro +++ b/examples/dialogs/standarddialogs/standarddialogs.pro @@ -12,4 +12,4 @@ symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/dialogs/tabdialog/tabdialog.pro b/examples/dialogs/tabdialog/tabdialog.pro index 1e418f7f83..4e01a68b96 100644 --- a/examples/dialogs/tabdialog/tabdialog.pro +++ b/examples/dialogs/tabdialog/tabdialog.pro @@ -11,6 +11,6 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/draganddrop/draggableicons/draggableicons.pro b/examples/draganddrop/draggableicons/draggableicons.pro index 941e817462..792de0a73c 100644 --- a/examples/draganddrop/draggableicons/draggableicons.pro +++ b/examples/draganddrop/draggableicons/draggableicons.pro @@ -14,4 +14,4 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/draganddrop/draggabletext/draggabletext.pro b/examples/draganddrop/draggabletext/draggabletext.pro index cec6651629..38c20663a2 100644 --- a/examples/draganddrop/draggabletext/draggabletext.pro +++ b/examples/draganddrop/draggabletext/draggabletext.pro @@ -16,5 +16,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/draganddrop/fridgemagnets/fridgemagnets.pro b/examples/draganddrop/fridgemagnets/fridgemagnets.pro index 7cdb9591d6..481fffd5fe 100644 --- a/examples/draganddrop/fridgemagnets/fridgemagnets.pro +++ b/examples/draganddrop/fridgemagnets/fridgemagnets.pro @@ -16,7 +16,6 @@ symbian { CONFIG += qt_example } - QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/draganddrop/puzzle/puzzle.pro b/examples/draganddrop/puzzle/puzzle.pro index 8c81c49b73..d084827a45 100644 --- a/examples/draganddrop/puzzle/puzzle.pro +++ b/examples/draganddrop/puzzle/puzzle.pro @@ -28,4 +28,4 @@ wince*: { DEPLOYMENT += addFile } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/effects/blurpicker/blurpicker.pro b/examples/effects/blurpicker/blurpicker.pro index e24e6cbada..ca651b8858 100644 --- a/examples/effects/blurpicker/blurpicker.pro +++ b/examples/effects/blurpicker/blurpicker.pro @@ -9,5 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/effects/blurpicker INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/effects/fademessage/fademessage.pro b/examples/effects/fademessage/fademessage.pro index 5f24357dee..261bee42f9 100644 --- a/examples/effects/fademessage/fademessage.pro +++ b/examples/effects/fademessage/fademessage.pro @@ -12,8 +12,8 @@ sources.files = $$SOURCES \ fademessage.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/effects/fademessage -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example QT += widgets simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/effects/lighting/lighting.pro b/examples/effects/lighting/lighting.pro index 8c7af8f660..1876a7b3af 100644 --- a/examples/effects/lighting/lighting.pro +++ b/examples/effects/lighting/lighting.pro @@ -8,6 +8,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/effects/lighting INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/gestures/imagegestures/imagegestures.pro b/examples/gestures/imagegestures/imagegestures.pro index c36ad25831..03fd2e8ff3 100644 --- a/examples/gestures/imagegestures/imagegestures.pro +++ b/examples/gestures/imagegestures/imagegestures.pro @@ -20,7 +20,7 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) maemo5: warning(This example does not work on Maemo platform) simulator: warning(This example does not work on Simulator platform) diff --git a/examples/graphicsview/anchorlayout/anchorlayout.pro b/examples/graphicsview/anchorlayout/anchorlayout.pro index 32066e3502..abe55f2ef6 100644 --- a/examples/graphicsview/anchorlayout/anchorlayout.pro +++ b/examples/graphicsview/anchorlayout/anchorlayout.pro @@ -9,7 +9,7 @@ INSTALLS += target sources TARGET = anchorlayout QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro index 900d6d138e..88fa8182ab 100644 --- a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro +++ b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro @@ -16,5 +16,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/collidingmice/collidingmice.pro b/examples/graphicsview/collidingmice/collidingmice.pro index 7a1ecc34ed..1c1c2683cf 100644 --- a/examples/graphicsview/collidingmice/collidingmice.pro +++ b/examples/graphicsview/collidingmice/collidingmice.pro @@ -18,5 +18,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/elasticnodes/elasticnodes.pro b/examples/graphicsview/elasticnodes/elasticnodes.pro index 6017b2c9d4..6b591a8c66 100644 --- a/examples/graphicsview/elasticnodes/elasticnodes.pro +++ b/examples/graphicsview/elasticnodes/elasticnodes.pro @@ -22,6 +22,6 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/flowlayout/flowlayout.pro b/examples/graphicsview/flowlayout/flowlayout.pro index 4f54ed2b05..f8d1e4871f 100644 --- a/examples/graphicsview/flowlayout/flowlayout.pro +++ b/examples/graphicsview/flowlayout/flowlayout.pro @@ -9,6 +9,6 @@ HEADERS += flowlayout.h window.h SOURCES += flowlayout.cpp main.cpp window.cpp QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/padnavigator/padnavigator.pro b/examples/graphicsview/padnavigator/padnavigator.pro index 9a1229ece2..f0287f1f86 100644 --- a/examples/graphicsview/padnavigator/padnavigator.pro +++ b/examples/graphicsview/padnavigator/padnavigator.pro @@ -30,6 +30,6 @@ symbian { TARGET.UID3 = 0xA000A644 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro b/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro index a4302eb9cc..80cc3a1a24 100644 --- a/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro +++ b/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro @@ -9,6 +9,6 @@ INSTALLS += target sources TARGET = simpleanchorlayout QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro b/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro index b545ff0743..5f1dfd38e1 100644 --- a/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro +++ b/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro @@ -13,6 +13,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/weatheranchorlayout INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/ipc/localfortuneclient/localfortuneclient.pro b/examples/ipc/localfortuneclient/localfortuneclient.pro index d1f87b684a..bace9574cf 100644 --- a/examples/ipc/localfortuneclient/localfortuneclient.pro +++ b/examples/ipc/localfortuneclient/localfortuneclient.pro @@ -12,6 +12,6 @@ INSTALLS += target sources symbian: CONFIG += qt_example maemo5: CONFIG += qt_example -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/itemviews/addressbook/addressbook.pro b/examples/itemviews/addressbook/addressbook.pro index 4f83a5ef79..5eeb601d55 100644 --- a/examples/itemviews/addressbook/addressbook.pro +++ b/examples/itemviews/addressbook/addressbook.pro @@ -21,5 +21,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/chart/chart.pro b/examples/itemviews/chart/chart.pro index 70100f89be..34d69957c9 100644 --- a/examples/itemviews/chart/chart.pro +++ b/examples/itemviews/chart/chart.pro @@ -19,5 +19,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/combowidgetmapper/combowidgetmapper.pro b/examples/itemviews/combowidgetmapper/combowidgetmapper.pro index d538fe58f0..46fce72ec9 100644 --- a/examples/itemviews/combowidgetmapper/combowidgetmapper.pro +++ b/examples/itemviews/combowidgetmapper/combowidgetmapper.pro @@ -9,5 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/combowidgetmapper INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/fetchmore/fetchmore.pro b/examples/itemviews/fetchmore/fetchmore.pro index 9f81d00670..848a12f3c6 100644 --- a/examples/itemviews/fetchmore/fetchmore.pro +++ b/examples/itemviews/fetchmore/fetchmore.pro @@ -11,5 +11,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/fetchmore INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/frozencolumn/frozencolumn.pro b/examples/itemviews/frozencolumn/frozencolumn.pro index 684f4bb21b..79eedf787a 100644 --- a/examples/itemviews/frozencolumn/frozencolumn.pro +++ b/examples/itemviews/frozencolumn/frozencolumn.pro @@ -9,5 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/itemviews/frozencolumn INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/itemviews/puzzle/puzzle.pro b/examples/itemviews/puzzle/puzzle.pro index 8e133d7b7b..2f15daf7ca 100644 --- a/examples/itemviews/puzzle/puzzle.pro +++ b/examples/itemviews/puzzle/puzzle.pro @@ -20,5 +20,5 @@ wince* { } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/mainwindows/menus/menus.pro b/examples/mainwindows/menus/menus.pro index cf117c25d2..c004ef73a8 100644 --- a/examples/mainwindows/menus/menus.pro +++ b/examples/mainwindows/menus/menus.pro @@ -13,6 +13,6 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/bearermonitor/bearermonitor.pro b/examples/network/bearermonitor/bearermonitor.pro index 20cefbf669..8b2b33affb 100644 --- a/examples/network/bearermonitor/bearermonitor.pro +++ b/examples/network/bearermonitor/bearermonitor.pro @@ -25,9 +25,9 @@ CONFIG += console symbian: { TARGET.CAPABILITY = NetworkServices ReadUserData - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro index 357063b987..b5cb3b4390 100644 --- a/examples/network/fortuneclient/fortuneclient.pro +++ b/examples/network/fortuneclient/fortuneclient.pro @@ -16,7 +16,7 @@ symbian { TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro index a385f1153a..ed865e4ca5 100644 --- a/examples/network/fortuneserver/fortuneserver.pro +++ b/examples/network/fortuneserver/fortuneserver.pro @@ -17,7 +17,7 @@ symbian { TARGET.CAPABILITY = "NetworkServices ReadUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/googlesuggest/googlesuggest.pro b/examples/network/googlesuggest/googlesuggest.pro index 6616ec0f3e..97866f6f32 100644 --- a/examples/network/googlesuggest/googlesuggest.pro +++ b/examples/network/googlesuggest/googlesuggest.pro @@ -8,8 +8,8 @@ sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/googlesuggest INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro index 05f97f6183..f6650f1d40 100644 --- a/examples/network/network-chat/network-chat.pro +++ b/examples/network/network-chat/network-chat.pro @@ -24,7 +24,7 @@ symbian { TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/qftp/qftp.pro b/examples/network/qftp/qftp.pro index b3c98bca7a..f0efe630b9 100644 --- a/examples/network/qftp/qftp.pro +++ b/examples/network/qftp/qftp.pro @@ -18,7 +18,7 @@ symbian { INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE TARGET.CAPABILITY="NetworkServices ReadUserData WriteUserData" } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/opengl/cube/cube.pro b/examples/opengl/cube/cube.pro index fd6e288013..652812b718 100644 --- a/examples/opengl/cube/cube.pro +++ b/examples/opengl/cube/cube.pro @@ -33,8 +33,8 @@ contains(QT_CONFIG, opengl) { message(OpenGL support is not available.) } -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/opengl/hellogl_es/hellogl_es.pro b/examples/opengl/hellogl_es/hellogl_es.pro index ef0c1cdc3e..5a3eec51c4 100644 --- a/examples/opengl/hellogl_es/hellogl_es.pro +++ b/examples/opengl/hellogl_es/hellogl_es.pro @@ -25,8 +25,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example does not work on Maemo platform) diff --git a/examples/opengl/hellogl_es2/hellogl_es2.pro b/examples/opengl/hellogl_es2/hellogl_es2.pro index ac7d3233b6..2eef986ed2 100644 --- a/examples/opengl/hellogl_es2/hellogl_es2.pro +++ b/examples/opengl/hellogl_es2/hellogl_es2.pro @@ -25,13 +25,13 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es2.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es2 INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +symbian: CONFIG += qt_example maemo5 { # Debian package name may not contain numbers or special characters # such as '_', lets change this in Maemo. TARGET = helloglestwo - include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + CONFIG += qt_example } symbian: warning(This example might not fully work on Symbian platform) diff --git a/examples/painting/basicdrawing/basicdrawing.pro b/examples/painting/basicdrawing/basicdrawing.pro index d0f6192fbc..0e9c699698 100644 --- a/examples/painting/basicdrawing/basicdrawing.pro +++ b/examples/painting/basicdrawing/basicdrawing.pro @@ -16,6 +16,6 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/painting/concentriccircles/concentriccircles.pro b/examples/painting/concentriccircles/concentriccircles.pro index d5d60a9f49..a889673014 100644 --- a/examples/painting/concentriccircles/concentriccircles.pro +++ b/examples/painting/concentriccircles/concentriccircles.pro @@ -15,5 +15,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/painting/imagecomposition/imagecomposition.pro b/examples/painting/imagecomposition/imagecomposition.pro index d0b666764d..e8841ea770 100644 --- a/examples/painting/imagecomposition/imagecomposition.pro +++ b/examples/painting/imagecomposition/imagecomposition.pro @@ -14,5 +14,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/painting/painterpaths/painterpaths.pro b/examples/painting/painterpaths/painterpaths.pro index c9c07f8110..6ead35fe5a 100644 --- a/examples/painting/painterpaths/painterpaths.pro +++ b/examples/painting/painterpaths/painterpaths.pro @@ -16,5 +16,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/painting/transformations/transformations.pro b/examples/painting/transformations/transformations.pro index 171dd714ea..2e76a13c5f 100644 --- a/examples/painting/transformations/transformations.pro +++ b/examples/painting/transformations/transformations.pro @@ -15,7 +15,7 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qtconcurrent/imagescaling/imagescaling.pro b/examples/qtconcurrent/imagescaling/imagescaling.pro index d214949230..cb931c7bfb 100644 --- a/examples/qtconcurrent/imagescaling/imagescaling.pro +++ b/examples/qtconcurrent/imagescaling/imagescaling.pro @@ -16,6 +16,6 @@ symbian: CONFIG += qt_example wince*: DEPLOYMENT_PLUGIN += qgif qjpeg qtiff QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qtestlib/tutorial1/tutorial1.pro b/examples/qtestlib/tutorial1/tutorial1.pro index ca4c795fdb..ee3d12a1b0 100644 --- a/examples/qtestlib/tutorial1/tutorial1.pro +++ b/examples/qtestlib/tutorial1/tutorial1.pro @@ -12,7 +12,7 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qtestlib/tutorial2/tutorial2.pro b/examples/qtestlib/tutorial2/tutorial2.pro index 8ff0f4b818..d19be2e243 100644 --- a/examples/qtestlib/tutorial2/tutorial2.pro +++ b/examples/qtestlib/tutorial2/tutorial2.pro @@ -12,7 +12,7 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qtestlib/tutorial3/tutorial3.pro b/examples/qtestlib/tutorial3/tutorial3.pro index 732c7be6bd..344b97f481 100644 --- a/examples/qtestlib/tutorial3/tutorial3.pro +++ b/examples/qtestlib/tutorial3/tutorial3.pro @@ -12,7 +12,7 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qtestlib/tutorial4/tutorial4.pro b/examples/qtestlib/tutorial4/tutorial4.pro index 9fa2f110d3..17fa04cf83 100644 --- a/examples/qtestlib/tutorial4/tutorial4.pro +++ b/examples/qtestlib/tutorial4/tutorial4.pro @@ -12,7 +12,7 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qtestlib/tutorial5/tutorial5.pro b/examples/qtestlib/tutorial5/tutorial5.pro index 15a8b85956..42afe4204c 100644 --- a/examples/qtestlib/tutorial5/tutorial5.pro +++ b/examples/qtestlib/tutorial5/tutorial5.pro @@ -12,7 +12,7 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qws/dbscreen/dbscreen.pro b/examples/qws/dbscreen/dbscreen.pro index a8f754d217..08d6c41e96 100644 --- a/examples/qws/dbscreen/dbscreen.pro +++ b/examples/qws/dbscreen/dbscreen.pro @@ -10,7 +10,7 @@ SOURCES = dbscreendriverplugin.cpp \ dbscreen.cpp QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qws/framebuffer/framebuffer.pro b/examples/qws/framebuffer/framebuffer.pro index 52da5594df..1d3235087f 100644 --- a/examples/qws/framebuffer/framebuffer.pro +++ b/examples/qws/framebuffer/framebuffer.pro @@ -11,8 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qws/framebuffer INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) simulator: warning(This example does not work on Simulator platform) diff --git a/examples/qws/mousecalibration/mousecalibration.pro b/examples/qws/mousecalibration/mousecalibration.pro index 9c767233c6..5637e735bc 100644 --- a/examples/qws/mousecalibration/mousecalibration.pro +++ b/examples/qws/mousecalibration/mousecalibration.pro @@ -11,8 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qws/mousecalibration INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qws/simpledecoration/simpledecoration.pro b/examples/qws/simpledecoration/simpledecoration.pro index 14b4d8fef9..e26ffd5ad0 100644 --- a/examples/qws/simpledecoration/simpledecoration.pro +++ b/examples/qws/simpledecoration/simpledecoration.pro @@ -12,8 +12,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qws/simpledecoration INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/qws/svgalib/svgalib.pro b/examples/qws/svgalib/svgalib.pro index 2d99774707..7d21b181dd 100644 --- a/examples/qws/svgalib/svgalib.pro +++ b/examples/qws/svgalib/svgalib.pro @@ -18,8 +18,8 @@ SOURCES = svgalibscreen.cpp \ svgalibplugin.cpp QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro index e2c4abb6af..9abd82f40a 100644 --- a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro +++ b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro @@ -18,5 +18,5 @@ wince*: { DEPLOYMENT += addFiles } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/sql/drilldown/drilldown.pro b/examples/sql/drilldown/drilldown.pro index f3050beb2f..8209dd5bd5 100644 --- a/examples/sql/drilldown/drilldown.pro +++ b/examples/sql/drilldown/drilldown.pro @@ -19,6 +19,6 @@ symbian { TARGET.UID3 = 0xA000C612 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/sql/masterdetail/masterdetail.pro b/examples/sql/masterdetail/masterdetail.pro index ef8f88d131..fcbc642bed 100644 --- a/examples/sql/masterdetail/masterdetail.pro +++ b/examples/sql/masterdetail/masterdetail.pro @@ -19,7 +19,7 @@ symbian { TARGET.UID3 = 0xA000D7CF CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro index 63acd8269e..6d2f028d66 100644 --- a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro +++ b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro @@ -11,6 +11,6 @@ INSTALLS += target sources wince*: DEPLOYMENT_PLUGIN += qsqlite -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/statemachine/eventtransitions/eventtransitions.pro b/examples/statemachine/eventtransitions/eventtransitions.pro index a958ed7819..374ef3a72f 100644 --- a/examples/statemachine/eventtransitions/eventtransitions.pro +++ b/examples/statemachine/eventtransitions/eventtransitions.pro @@ -7,7 +7,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/eventtransitions INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/statemachine/factorial/factorial.pro b/examples/statemachine/factorial/factorial.pro index 012e175e3b..6fbfd8e598 100644 --- a/examples/statemachine/factorial/factorial.pro +++ b/examples/statemachine/factorial/factorial.pro @@ -10,7 +10,7 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS factorial.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/factorial INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) diff --git a/examples/statemachine/pingpong/pingpong.pro b/examples/statemachine/pingpong/pingpong.pro index 9ee782c1de..e15f593d84 100644 --- a/examples/statemachine/pingpong/pingpong.pro +++ b/examples/statemachine/pingpong/pingpong.pro @@ -10,7 +10,7 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS pingpong.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/pingpong INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example does not work on Symbian platform) diff --git a/examples/statemachine/rogue/rogue.pro b/examples/statemachine/rogue/rogue.pro index 9e401aab82..001f3e44a3 100644 --- a/examples/statemachine/rogue/rogue.pro +++ b/examples/statemachine/rogue/rogue.pro @@ -10,6 +10,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/rogue INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/statemachine/trafficlight/trafficlight.pro b/examples/statemachine/trafficlight/trafficlight.pro index f3f9cbb321..9ea94f75f0 100644 --- a/examples/statemachine/trafficlight/trafficlight.pro +++ b/examples/statemachine/trafficlight/trafficlight.pro @@ -7,6 +7,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/trafficlight INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/statemachine/twowaybutton/twowaybutton.pro b/examples/statemachine/twowaybutton/twowaybutton.pro index 3861fb8599..3b37be7d9e 100644 --- a/examples/statemachine/twowaybutton/twowaybutton.pro +++ b/examples/statemachine/twowaybutton/twowaybutton.pro @@ -7,6 +7,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/twowaybutton INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/threads/queuedcustomtype/queuedcustomtype.pro b/examples/threads/queuedcustomtype/queuedcustomtype.pro index fc8d4d7bc6..415f4f14dd 100644 --- a/examples/threads/queuedcustomtype/queuedcustomtype.pro +++ b/examples/threads/queuedcustomtype/queuedcustomtype.pro @@ -13,6 +13,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mandelbrot.pro sources.path = $$[QT_INSTALL_EXAMPLES]/threads/mandelbrot INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/tools/contiguouscache/contiguouscache.pro b/examples/tools/contiguouscache/contiguouscache.pro index bd9e3db05f..c26f32e3d6 100644 --- a/examples/tools/contiguouscache/contiguouscache.pro +++ b/examples/tools/contiguouscache/contiguouscache.pro @@ -9,8 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tools/contiguouscache INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tools/customtype/customtype.pro b/examples/tools/customtype/customtype.pro index c63425f49d..6542cf5473 100644 --- a/examples/tools/customtype/customtype.pro +++ b/examples/tools/customtype/customtype.pro @@ -9,8 +9,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS customcompleter.pro reso sources.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tools/customtypesending/customtypesending.pro b/examples/tools/customtypesending/customtypesending.pro index 3388888dfe..4d11497f0b 100644 --- a/examples/tools/customtypesending/customtypesending.pro +++ b/examples/tools/customtypesending/customtypesending.pro @@ -11,8 +11,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS customcompleter.pro reso sources.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro index 16d96c56ec..434de1a5e3 100644 --- a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro +++ b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro @@ -18,4 +18,4 @@ symbian: CONFIG += qt_example symbian:TARGET.EPOCALLOWDLLDATA = 1 QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/tools/styleplugin/plugin/plugin.pro b/examples/tools/styleplugin/plugin/plugin.pro index 46e5ec1928..55ea4e4bba 100644 --- a/examples/tools/styleplugin/plugin/plugin.pro +++ b/examples/tools/styleplugin/plugin/plugin.pro @@ -24,4 +24,4 @@ symbian: CONFIG += qt_example symbian:TARGET.EPOCALLOWDLLDATA = 1 QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/touch/dials/dials.pro b/examples/touch/dials/dials.pro index e69f7ab00e..0836c741ab 100644 --- a/examples/touch/dials/dials.pro +++ b/examples/touch/dials/dials.pro @@ -8,8 +8,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/dials INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/touch/fingerpaint/fingerpaint.pro b/examples/touch/fingerpaint/fingerpaint.pro index b41e6a3e4c..138d0c2bed 100644 --- a/examples/touch/fingerpaint/fingerpaint.pro +++ b/examples/touch/fingerpaint/fingerpaint.pro @@ -11,8 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/fingerpaint INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/touch/knobs/knobs.pro b/examples/touch/knobs/knobs.pro index 043ae8ac13..caa3af098c 100644 --- a/examples/touch/knobs/knobs.pro +++ b/examples/touch/knobs/knobs.pro @@ -8,8 +8,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/knobs INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/touch/pinchzoom/pinchzoom.pro b/examples/touch/pinchzoom/pinchzoom.pro index 6d4dbf43d2..f4145dbdfd 100644 --- a/examples/touch/pinchzoom/pinchzoom.pro +++ b/examples/touch/pinchzoom/pinchzoom.pro @@ -16,8 +16,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/touch/pinchzoom INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part1/part1.pro b/examples/tutorials/addressbook-fr/part1/part1.pro index cb4b6ecbde..9d99ec6852 100644 --- a/examples/tutorials/addressbook-fr/part1/part1.pro +++ b/examples/tutorials/addressbook-fr/part1/part1.pro @@ -9,8 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part1 INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part2/part2.pro b/examples/tutorials/addressbook-fr/part2/part2.pro index a3393bee28..faa54f8b51 100644 --- a/examples/tutorials/addressbook-fr/part2/part2.pro +++ b/examples/tutorials/addressbook-fr/part2/part2.pro @@ -9,8 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part2 INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part3/part3.pro b/examples/tutorials/addressbook-fr/part3/part3.pro index 063feac12f..1f01b8ac29 100644 --- a/examples/tutorials/addressbook-fr/part3/part3.pro +++ b/examples/tutorials/addressbook-fr/part3/part3.pro @@ -9,8 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part3 INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part4/part4.pro b/examples/tutorials/addressbook-fr/part4/part4.pro index 90e2ce7ad5..312f183c74 100644 --- a/examples/tutorials/addressbook-fr/part4/part4.pro +++ b/examples/tutorials/addressbook-fr/part4/part4.pro @@ -9,8 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part4 INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part5/part5.pro b/examples/tutorials/addressbook-fr/part5/part5.pro index dc6099ed2c..34f9b56d7f 100644 --- a/examples/tutorials/addressbook-fr/part5/part5.pro +++ b/examples/tutorials/addressbook-fr/part5/part5.pro @@ -11,8 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part5 INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part6/part6.pro b/examples/tutorials/addressbook-fr/part6/part6.pro index a7e48be141..81ec20fffe 100644 --- a/examples/tutorials/addressbook-fr/part6/part6.pro +++ b/examples/tutorials/addressbook-fr/part6/part6.pro @@ -11,8 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part6 INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/addressbook-fr/part7/part7.pro b/examples/tutorials/addressbook-fr/part7/part7.pro index 1e773fd093..921c313654 100644 --- a/examples/tutorials/addressbook-fr/part7/part7.pro +++ b/examples/tutorials/addressbook-fr/part7/part7.pro @@ -11,8 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/addressbook/part7 INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/widgets/childwidget/childwidget.pro b/examples/tutorials/widgets/childwidget/childwidget.pro index a876ed9e2c..4efc1432c2 100644 --- a/examples/tutorials/widgets/childwidget/childwidget.pro +++ b/examples/tutorials/widgets/childwidget/childwidget.pro @@ -7,8 +7,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/childwidget INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro b/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro index f668b42f2e..a5601552d9 100644 --- a/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro +++ b/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro @@ -7,8 +7,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/nestedlayouts INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/widgets/toplevel/toplevel.pro b/examples/tutorials/widgets/toplevel/toplevel.pro index cbbf3ff4de..a86d05b46c 100644 --- a/examples/tutorials/widgets/toplevel/toplevel.pro +++ b/examples/tutorials/widgets/toplevel/toplevel.pro @@ -7,8 +7,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/toplevel INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/tutorials/widgets/windowlayout/windowlayout.pro b/examples/tutorials/widgets/windowlayout/windowlayout.pro index a088cdff97..08613201dc 100644 --- a/examples/tutorials/widgets/windowlayout/windowlayout.pro +++ b/examples/tutorials/widgets/windowlayout/windowlayout.pro @@ -7,8 +7,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/tutorials/widgets/windowlayout INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/uitools/multipleinheritance/multipleinheritance.pro b/examples/uitools/multipleinheritance/multipleinheritance.pro index a33f619035..7e64967416 100644 --- a/examples/uitools/multipleinheritance/multipleinheritance.pro +++ b/examples/uitools/multipleinheritance/multipleinheritance.pro @@ -15,5 +15,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/widgets/analogclock/analogclock.pro b/examples/widgets/analogclock/analogclock.pro index 95233f0968..c8e1dc916d 100644 --- a/examples/widgets/analogclock/analogclock.pro +++ b/examples/widgets/analogclock/analogclock.pro @@ -13,5 +13,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/widgets/applicationicon/applicationicon.pro b/examples/widgets/applicationicon/applicationicon.pro index b2ba42279c..dd4ace3993 100644 --- a/examples/widgets/applicationicon/applicationicon.pro +++ b/examples/widgets/applicationicon/applicationicon.pro @@ -11,7 +11,7 @@ OTHER_FILES += applicationicon.svg \ applicationicon.desktop symbian { - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + CONFIG += qt_example # override icon ICON = applicationicon.svg TARGET.UID3 = 0xe9f919ee @@ -20,7 +20,7 @@ symbian { } maemo5 { - include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + CONFIG += qt_example # override icon from maemo5pkgrules.pri icon.files = $${TARGET}.png diff --git a/examples/widgets/calculator/calculator.pro b/examples/widgets/calculator/calculator.pro index 0243347719..f1e110dfd2 100644 --- a/examples/widgets/calculator/calculator.pro +++ b/examples/widgets/calculator/calculator.pro @@ -15,5 +15,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/widgets/calendarwidget/calendarwidget.pro b/examples/widgets/calendarwidget/calendarwidget.pro index 5b0584d171..6e664cf353 100644 --- a/examples/widgets/calendarwidget/calendarwidget.pro +++ b/examples/widgets/calendarwidget/calendarwidget.pro @@ -13,7 +13,7 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/codeeditor/codeeditor.pro b/examples/widgets/codeeditor/codeeditor.pro index 7ad747793c..caee3f7ca1 100644 --- a/examples/widgets/codeeditor/codeeditor.pro +++ b/examples/widgets/codeeditor/codeeditor.pro @@ -8,8 +8,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/codeeditor INSTALLS += target sources QT += widgets -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/elidedlabel/elidedlabel.pro b/examples/widgets/elidedlabel/elidedlabel.pro index 9d91c54c5a..30c308cd7e 100644 --- a/examples/widgets/elidedlabel/elidedlabel.pro +++ b/examples/widgets/elidedlabel/elidedlabel.pro @@ -21,10 +21,10 @@ symbian { TARGET.UID3 = 0xE2728354 # randomly generated TARGET.EPOCSTACKSIZE = 0x14000 TARGET.EPOCHEAPSIZE = 0x020000 0x800000 - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/icons/icons.pro b/examples/widgets/icons/icons.pro index 7cdd420219..17c09f354f 100644 --- a/examples/widgets/icons/icons.pro +++ b/examples/widgets/icons/icons.pro @@ -26,7 +26,7 @@ wince*: { DEPLOYMENT += imageFiles } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/imageviewer/imageviewer.pro b/examples/widgets/imageviewer/imageviewer.pro index 94798d6969..d3eaf379d4 100644 --- a/examples/widgets/imageviewer/imageviewer.pro +++ b/examples/widgets/imageviewer/imageviewer.pro @@ -17,7 +17,7 @@ wince*: { DEPLOYMENT_PLUGIN += qjpeg qmng qgif } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/lineedits/lineedits.pro b/examples/widgets/lineedits/lineedits.pro index f24f8e55f3..484ffde462 100644 --- a/examples/widgets/lineedits/lineedits.pro +++ b/examples/widgets/lineedits/lineedits.pro @@ -13,7 +13,7 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro index adef12b4b2..5657efa3c1 100644 --- a/examples/widgets/movie/movie.pro +++ b/examples/widgets/movie/movie.pro @@ -18,7 +18,7 @@ wince*: { } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/orientation/orientation.pro b/examples/widgets/orientation/orientation.pro index cf443b5c0a..91560a3b38 100644 --- a/examples/widgets/orientation/orientation.pro +++ b/examples/widgets/orientation/orientation.pro @@ -22,8 +22,8 @@ FORMS += \ RESOURCES += \ images.qrc -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/shapedclock/shapedclock.pro b/examples/widgets/shapedclock/shapedclock.pro index 8c3cb76e5a..d7ab454ac7 100644 --- a/examples/widgets/shapedclock/shapedclock.pro +++ b/examples/widgets/shapedclock/shapedclock.pro @@ -13,7 +13,7 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example symbian: warning(This example might not fully work on Symbian platform) maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/widgets/softkeys/softkeys.pro b/examples/widgets/softkeys/softkeys.pro index f9eca7f994..e0be830b4d 100644 --- a/examples/widgets/softkeys/softkeys.pro +++ b/examples/widgets/softkeys/softkeys.pro @@ -14,5 +14,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/widgets/tetrix/tetrix.pro b/examples/widgets/tetrix/tetrix.pro index 827769ed30..d9fff26fef 100644 --- a/examples/widgets/tetrix/tetrix.pro +++ b/examples/widgets/tetrix/tetrix.pro @@ -17,5 +17,5 @@ symbian { CONFIG += qt_example } QT += widgets -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/widgets/wiggly/wiggly.pro b/examples/widgets/wiggly/wiggly.pro index ec0e0a80b0..8a1bec3100 100644 --- a/examples/widgets/wiggly/wiggly.pro +++ b/examples/widgets/wiggly/wiggly.pro @@ -16,5 +16,5 @@ symbian { TARGET.UID3 = 0xA000C607 CONFIG += qt_example } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro index b9f039de5f..21eb5c071f 100644 --- a/examples/xml/dombookmarks/dombookmarks.pro +++ b/examples/xml/dombookmarks/dombookmarks.pro @@ -14,7 +14,7 @@ INSTALLS += target sources symbian: CONFIG += qt_example symbian: { - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + CONFIG += qt_example addFiles.sources = frank.xbel jennifer.xbel addFiles.path = files DEPLOYMENT += addFiles @@ -25,5 +25,5 @@ wince*: { addFiles.path = "\\My Documents" DEPLOYMENT += addFiles } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro index 76c0259203..22d96f5b96 100644 --- a/examples/xml/saxbookmarks/saxbookmarks.pro +++ b/examples/xml/saxbookmarks/saxbookmarks.pro @@ -26,5 +26,5 @@ symbian: { addFiles.path = /data/qt/saxbookmarks DEPLOYMENT += addFiles } -maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +maemo5: CONFIG += qt_example diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf index d451d29f7c..c91d543d6c 100644 --- a/mkspecs/features/default_pre.prf +++ b/mkspecs/features/default_pre.prf @@ -12,24 +12,23 @@ exists($$_PRO_FILE_PWD_/sync.profile) { isEmpty(QTDIR) { QTDIR = $$(QTDIR) isEmpty(QTDIR):QTDIR = $$QT_BUILD_TREE - isEmpty(QTDIR):QTDIR = $$dirname(_QMAKE_CACHE_) - isEmpty(QTDIR) { - QMAKE_BASED_QTDIR = $$dirname(QMAKE_QMAKE) - QMAKE_BASED_QTDIR = $$dirname(QMAKE_BASED_QTDIR) - exists($$QMAKE_BASED_QTDIR/mkspecs/qconfig.pri): QTDIR = $$QMAKE_BASED_QTDIR - unset(QMAKE_BASED_QTDIR) - } } - isEmpty(QTDIR):QTFWD="-no-module-fwd" - else:QTFWD="-qtdir $$QTDIR" + QTFWD = + isEmpty(QTDIR) { + QTFWD += -module-fwd $$OUT_PWD/module-paths/modules -cache-module-fwd + } else { + QTFWD += -qtdir $$QTDIR -module-fwd $$QTDIR/mkspecs/modules -developer-build + } - message("Running syncqt for $$PRO_BASENAME in $$OUT_PWD") qtPrepareTool(QMAKE_SYNCQT, syncqt) - system("$$QMAKE_SYNCQT $$QTFWD -outdir $$OUT_PWD $$_PRO_FILE_PWD_") { + + MSG = $$quote($$QMAKE_SYNCQT $$QTFWD -outdir $$OUT_PWD $$_PRO_FILE_PWD_) + !silent:message($$MSG) + system($$MSG) { # success! Nothing to do } else { - error("Failed to run: $$QMAKE_SYNCQT $$QTFWD -outdir $$OUT_PWD $$_PRO_FILE_PWD_") + error("Failed to run: $$MSG") } unset(QTFWD) unset(PRO_BASENAME) diff --git a/mkspecs/features/qpa/basicunixfontdatabase.prf b/mkspecs/features/qpa/basicunixfontdatabase.prf index 261eadb5d0..65490e03a8 100644 --- a/mkspecs/features/qpa/basicunixfontdatabase.prf +++ b/mkspecs/features/qpa/basicunixfontdatabase.prf @@ -1,3 +1,5 @@ +DEFINES += QT_COMPILES_IN_HARFBUZZ + contains(QT_CONFIG, system-freetype) { LIBS += -lfreetype } diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf index 071bb6c237..3d0028c3a3 100644 --- a/mkspecs/features/qt_config.prf +++ b/mkspecs/features/qt_config.prf @@ -1,20 +1,25 @@ # This file is loaded by the mkspecs, before .qmake.cache has been loaded. # Consequently, we have to do some stunts to get values out of the cache. -exists($$_QMAKE_CACHE_):QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QMAKE_QT_CONFIG) +exists($$_QMAKE_CACHE_) { + QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QMAKE_QT_CONFIG) + QMAKE_EXTRA_MODULE_FORWARDS = $$fromfile($$_QMAKE_CACHE_, QMAKE_EXTRA_MODULE_FORWARDS) +} isEmpty(QMAKE_QT_CONFIG)|!exists($$QMAKE_QT_CONFIG) { !isEmpty(QT_BUILD_TREE):QMAKE_QT_CONFIG = $$QT_BUILD_TREE/mkspecs/qconfig.pri else:exists($$_QMAKE_CACHE_):infile($$_QMAKE_CACHE_, QT_BUILD_TREE):QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE)/mkspecs/qconfig.pri - else:exists($$[QT_INSTALL_DATA]/mkspecs/qconfig.pri):QMAKE_QT_CONFIG = $$[QT_INSTALL_DATA]/mkspecs/qconfig.pri + isEmpty(QMAKE_QT_CONFIG):exists($$[QT_INSTALL_DATA]/mkspecs/qconfig.pri):QMAKE_QT_CONFIG = $$[QT_INSTALL_DATA]/mkspecs/qconfig.pri } !exists($$QMAKE_QT_CONFIG)|!include($$QMAKE_QT_CONFIG, "", true) { debug(1, "Cannot load qconfig.pri!") } else { debug(1, "Loaded .qconfig.pri from ($$QMAKE_QT_CONFIG)") - for(dir, $$list($$unique($$list($$dirname(QMAKE_QT_CONFIG) \ - $$replace($$list($$split($$list($$(QMAKEPATH)), $$DIRLIST_SEPARATOR)), $, /mkspecs))))) { + for(dir, $$list($$unique($$list($$replace($$list($$dirname(QMAKE_QT_CONFIG) \ + $$replace($$list($$split($$list($$(QMAKEPATH)), $$DIRLIST_SEPARATOR)), $, /mkspecs)), \ + $, /modules) \ + $$QMAKE_EXTRA_MODULE_FORWARDS)))) { debug(1, "Loading modules from $${dir}") - for(mod, $$list($$files($$dir/modules/qt_*.pri))) { + for(mod, $$list($$files($$dir/qt_*.pri))) { # For installed Qt these paths will be common for all modules # For development these will vary per module, and syncqt will override the value in the # qt_<module>.pri forwarding file diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf new file mode 100644 index 0000000000..5a9ab4ba0a --- /dev/null +++ b/mkspecs/features/qt_installs.prf @@ -0,0 +1,44 @@ +#always install the library +win32 { + dlltarget.path=$$[QT_INSTALL_BINS] + INSTALLS += dlltarget +} +target.path=$$[QT_INSTALL_LIBS] +INSTALLS += target + +#headers +qt_install_headers { + INSTALL_HEADERS = $$SYNCQT.HEADER_FILES + equals(TARGET, QtCore) { + #headers created by configure + INSTALL_HEADERS *= $$QT_BUILD_TREE/src/corelib/global/qconfig.h \ + $$QT_SOURCE_TREE/src/corelib/arch/$$QT_ARCH/arch + } + + equals(TARGET, phonon) { + class_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET + } else { + flat_headers.files = $$INSTALL_HEADERS + flat_headers.path = $$[QT_INSTALL_HEADERS]/Qt + INSTALLS += flat_headers + + class_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET + } + class_headers.files = $$SYNCQT.HEADER_CLASSES + INSTALLS += class_headers + + targ_headers.files = $$INSTALL_HEADERS + targ_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET + INSTALLS += targ_headers + + private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES + private_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET/$$eval(QT.$${MODULE}.VERSION)/$$TARGET/private + INSTALLS += private_headers +} + +embedded|qpa: equals(TARGET, QtGui) { + # install fonts for embedded + INSTALLS += fonts + fonts.path = $$[QT_INSTALL_LIBS]/fonts + fonts.files = $$QT_SOURCE_TREE/lib/fonts/* +} diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index c49a41581f..aee95295e8 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -11,11 +11,18 @@ isEmpty(QMAKE_QT_MODULE)|!exists($$QMAKE_QT_MODULE) { !exists($$QMAKE_QT_MODULE):exists($$[QT_INSTALL_DATA]/mkspecs/qmodule.pri):QMAKE_QT_MODULE = $$[QT_INSTALL_DATA]/mkspecs/qmodule.pri } -!exists($$QMAKE_QT_MODULE)|!include($$QMAKE_QT_MODULE, "", true) { - error("Cannot load qmodule.pri!") +!contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\.pri) { + !exists($$QMAKE_QT_MODULE)|!include($$QMAKE_QT_MODULE, "", true) { + error("Cannot load qmodule.pri!") + } else { + QMAKE_QT_MODULE_PRI_LOADED = 1 + debug(1, "Loaded qmodule.pri from ($$QMAKE_QT_MODULE)") + } } else { - debug(1, "Loaded qmodule.pri from ($$QMAKE_QT_MODULE)") + QMAKE_QT_MODULE_PRI_LOADED = 1 # covers 'preloading' from .qmake.cache + debug(1, "Not loading qmodule.pri twice") } + mac { !isEmpty(QMAKE_RPATHDIR){ CONFIG += absolute_library_soname diff --git a/mkspecs/features/qt_module_config.prf b/mkspecs/features/qt_module_config.prf new file mode 100644 index 0000000000..8f225fe6ed --- /dev/null +++ b/mkspecs/features/qt_module_config.prf @@ -0,0 +1,234 @@ +!no_qt_module_warning:if(!contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\\\.pri)|isEmpty(QMAKE_QT_MODULE_PRI_LOADED)) { + QMAKE_ACTUAL_PRO_FILE = $$basename(_PRO_FILE_) + isEmpty(QMAKE_ACTUAL_PRO_FILE): QMAKE_ACTUAL_PRO_FILE=.pro + warning("You should probably load(qt_module) first in $$QMAKE_ACTUAL_PRO_FILE for $$TARGET, as it also load()s qt_module_config.") + message("Not doing so may lead to qt_module_config.prf overriding compiler/linker options in your .pro file.") + message("Ignore this warning with CONFIG+=no_qt_module_warning if you know what you are doing.") + unset(QMAKE_ACTUAL_PRO_FILE) +} +load(qt_module) # loads qmodule.pri if hasn't been loaded already + +isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0) +isEmpty(TARGET):error("You must set TARGET before include()'ing $${_FILE_}") + +MODULE_INCLUDES = $$eval(QT.$${MODULE}.includes) +MODULE_PRIVATE_INCLUDES = $$eval(QT.$${MODULE}.private_includes) +INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES +INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES/$$TARGET +INCLUDEPATH *= $$MODULE_INCLUDES $$MODULE_INCLUDES/.. #just for today to have some compat +!isEmpty(RCC_DIR): INCLUDEPATH += $$RCC_DIR +isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700 +TEMPLATE = lib +isEmpty(QT_MAJOR_VERSION) { + VERSION=5.0.0 +} else { + VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} +} + +#load up the headers info +CONFIG += qt_install_headers +#headers.pri is loaded from the last include path +LAST_MODULE_INCLUDE=$$MODULE_INCLUDES +for(include_path, MODULE_INCLUDES):LAST_MODULE_INCLUDE=$${include_path} +HEADERS_PRI = $$LAST_MODULE_INCLUDE/headers.pri +include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI) + +#version overriding +win32 { + #because libnetwork.pro could be qmake'd (qmade?) before libqcore.pro we + #need to override the version of libq* in all other libq*'s just to be + #sure the same version is used + VERSIONS_LIST = $$split(VERSION, ".") + QT_LIBS_OVERRIDE = $$member(VERSIONS_LIST, 0) + for(lib, $$list(qtcore qtgui qtnetwork qtxml qtopengl qtsql qt3support)) { + eval(QMAKE_$${upper($$lib)}_VERSION_OVERRIDE = $$QT_LIBS_OVERRIDE) + eval(QMAKE_$${upper($$lib)}D_VERSION_OVERRIDE = $$QT_LIBS_OVERRIDE) + } +} + +#other +DESTDIR = $$eval(QT.$${MODULE}.libs) +win32:!wince*:DLLDESTDIR = $$[QT_INSTALL_PREFIX]/bin + +CONFIG += qt warn_on depend_includepath +CONFIG += qmake_cache target_qt +CONFIG -= fix_output_dirs +win32|mac:!macx-xcode:CONFIG += debug_and_release +linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF + +contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols +unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions +contains(QT_CONFIG, largefile):CONFIG += largefile + +#mac frameworks +mac:!static:contains(QT_CONFIG, qt_framework) { + #QMAKE_FRAMEWORK_VERSION = 4.0 + CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework + CONFIG(debug, debug|release) { + !build_pass:CONFIG += build_all + } else { #release + !debug_and_release|build_pass { + CONFIG -= qt_install_headers #no need to install these as well + FRAMEWORK_HEADERS.version = Versions + FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES + FRAMEWORK_HEADERS.path = Headers + equals(TARGET, QtCore) { + #headers generated by configure + !contains(FRAMEWORK_HEADERS.files, .*/qconfig.h) { + FRAMEWORK_HEADERS.files *= $$QT_BUILD_TREE/src/corelib/global/qconfig.h + } + } + } + QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS + } +} + +mac { + CONFIG += explicitlib + macx-g++ { + QMAKE_CFLAGS += -fconstant-cfstrings + QMAKE_CXXFLAGS += -fconstant-cfstrings + } +} + +win32:!shared:CONFIG += static + +win32-borland { + mng:QMAKE_CFLAGS_WARN_ON += -w-par + mng:QMAKE_CXXFLAGS_WARN_ON += -w-par + # Keep the size of the .tds file for the Qt library smaller than + # 34 Mbytes to avoid linking problems + QMAKE_CFLAGS_DEBUG += -vi -y- + QMAKE_CXXFLAGS_DEBUG += -vi -y- +} + +win32 { + INCLUDEPATH += tmp + !static: DEFINES+=QT_MAKEDLL +} +symbian { + shared { + DEFINES+=QT_MAKEDLL + TARGET.CAPABILITY = All -Tcb + + # When building without autotests, DEF files are used by default. + # This is to maintain binary compatibility with previous releases. + # To explicitly disable DEF files usage, eg. when lots of code churn is + # going on, and functions may be added and removed before shipping, + # configure with -no-usedeffiles + # WARNING - disabling DEF files *will* break BC with previous released versions + # of Qt, and the only compatibility will be between this build of Qt and anything + # built in this exact environment. *Never* use this when building a version + # for release. + contains(CONFIG, def_files) { + DEF_FILE=../s60installs + } + } + load(armcc_warnings) + + # workaround for the fact that some of our required includes in Symbian^3 + # now depend upon files in epoc32/include/platform + INCLUDEPATH += $$OS_LAYER_SYSTEMINCLUDE +} +win32-borland:INCLUDEPATH += kernel + +aix-g++* { + QMAKE_CFLAGS += -mminimal-toc + QMAKE_CXXFLAGS += -mminimal-toc +} + +embedded { + EMBEDDED_H = $$EMBEDDED_CPP +} + +DEPENDPATH += ;$$NETWORK_H;$$KERNEL_H;$$WIDGETS_H;$$SQL_H;$$TABLE_H;$$DIALOGS_H; +DEPENDPATH += $$ICONVIEW_H;$$OPENGL_H;$$THREAD_H;$$TOOLS_H;$$CODECS_H; +DEPENDPATH += $$WORKSPACE_H;$$XML_H;$$STYLES_H;$$COMPAT_H +embedded:DEPENDPATH += ;$$EMBEDDED_H + +!static:PRL_EXPORT_DEFINES += QT_SHARED + +#install directives +load(qt_installs) + +unix:!symbian { + CONFIG += create_libtool create_pc explicitlib + QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS] + QMAKE_PRL_LIBDIR = $$[QT_INSTALL_LIBS] + QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] + QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET + QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] + QMAKE_PKGCONFIG_DESTDIR = pkgconfig + include_replace.match = $$QMAKE_INCDIR_QT + include_replace.replace = $$[QT_INSTALL_HEADERS] + lib_replace.match = $$QMAKE_LIBDIR_QT + lib_replace.replace = $$[QT_INSTALL_LIBS] + prefix_replace.match = $$QT_BUILD_TREE + prefix_replace.replace = $$[QT_INSTALL_PREFIX] + QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace + QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace + QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace prefix_replace +} + +win32-g++* { + CONFIG += create_pc + QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] + QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET + QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] + QMAKE_PKGCONFIG_DESTDIR = pkgconfig +} + +contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE +DEFINES *= QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS +contains(QT_CONFIG, gui-qt3support):DEFINES *= QT3_SUPPORT +DEFINES *= QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code +DEFINES *= QT_USE_QSTRINGBUILDER + +TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end + +qtPrepareTool(QMAKE_LUPDATE, lupdate) +qtPrepareTool(QMAKE_LRELEASE, lrelease) + +moc_dir.name = moc_location +moc_dir.variable = QMAKE_MOC + +uic_dir.name = uic_location +uic_dir.variable = QMAKE_UIC + +rcc_dir.name = rcc_location +rcc_dir.variable = QMAKE_RCC + +lupdate_dir.name = lupdate_location +lupdate_dir.variable = QMAKE_LUPDATE + +lrelease_dir.name = lrelease_location +lrelease_dir.variable = QMAKE_LRELEASE + +QMAKE_PKGCONFIG_VARIABLES += moc_dir uic_dir rcc_dir lupdate_dir lrelease_dir + +load(qt_targets) + +win32:DEFINES+=_USE_MATH_DEFINES + +symbian { + # Make partial upgrade SIS file for all dll's except webkit and s60main + !contains(TARGET.UID3, 0x200267C2):!contains(TARGET.UID3, 0xE00267C2):!contains(TARGET.UID3, 0x2001E61F):!contains(TARGET.UID3, 0xE001E61F) { + # Partial upgrade SIS file + vendorinfo = \ + "; Localised Vendor name" \ + "%{\"Nokia\"}" \ + " " \ + "; Unique Vendor name" \ + ":\"Nokia, Qt\"" \ + " " + isEmpty(QT_LIBINFIX): PARTIAL_UPGRADE_UID = 0x2001E61C + else: PARTIAL_UPGRADE_UID = 0xE001E61C + + pu_header = "; Partial upgrade package for testing $${TARGET} changes without reinstalling everything" \ + "$${LITERAL_HASH}{\"$${TARGET}\"}, ($$PARTIAL_UPGRADE_UID), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" + partial_upgrade.pkg_prerules = pu_header vendorinfo + partial_upgrade.files = $$QMAKE_LIBDIR_QT/$${TARGET}.dll + partial_upgrade.path = c:/sys/bin + DEPLOYMENT += partial_upgrade + } +} diff --git a/mkspecs/features/qt_targets.prf b/mkspecs/features/qt_targets.prf new file mode 100644 index 0000000000..af1a32bb02 --- /dev/null +++ b/mkspecs/features/qt_targets.prf @@ -0,0 +1,4 @@ +QMAKE_TARGET_COMPANY = Nokia Corporation and/or its subsidiary(-ies) +QMAKE_TARGET_PRODUCT = Qt4 +QMAKE_TARGET_DESCRIPTION = C++ application development framework. +QMAKE_TARGET_COPYRIGHT = Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 1e1e4dacf6..2388f53a9e 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtCore QPRO_PWD = $$PWD QT = @@ -10,7 +12,7 @@ DEFINES += QT_BUILD_CORE_LIB QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000 irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/corelib/qtcoreversion.h diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index 0c2cf1619e..42cab84cc0 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -116,6 +116,10 @@ SOURCES += ../3rdparty/harfbuzz/src/harfbuzz-buffer.c \ tools/qharfbuzz.cpp HEADERS += tools/qharfbuzz_p.h +corelib_tools_private_headers.files = ../3rdparty/harfbuzz/src/*.h +corelib_tools_private_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET/$$eval(QT.$${MODULE}.VERSION)/$$TARGET +INSTALLS += corelib_tools_private_headers + INCLUDEPATH += ../3rdparty/md5 \ ../3rdparty/md4 diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index 731d20a893..12efd8638b 100644 --- a/src/dbus/dbus.pro +++ b/src/dbus/dbus.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtDBus QPRO_PWD = $$PWD QT = core-private \ @@ -31,7 +33,7 @@ win32 { CONFIG(debug, debug|release):LIBS_PRIVATE += -ldbus-1d else:LIBS_PRIVATE += -ldbus-1 } -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/dub/qtdbusversion.h diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 4665c51821..f1d5bbaea5 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtGui QPRO_PWD = $$PWD QT = core-private @@ -9,7 +11,7 @@ DEFINES += QT_BUILD_GUI_LIB QT_NO_USING_NAMESPACE unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/gui/qtguiversion.h diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 7232f9c910..3b177af4ec 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3021,11 +3021,8 @@ void QRasterPaintEngine::drawStaticTextItem(QStaticTextItem *textItem) ensurePen(); ensureState(); - QRasterPaintEngineState *s = state(); - QFontEngine *fontEngine = textItem->fontEngine(); - const qreal pixelSize = fontEngine->fontDef.pixelSize; - if (pixelSize * pixelSize * qAbs(s->matrix.determinant()) < 64 * 64) { + if (!supportsTransformations(fontEngine)) { drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions, fontEngine); } else { @@ -3053,38 +3050,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte #if defined (Q_OS_WIN) || defined(Q_WS_MAC) - bool drawCached = true; - - if (s->matrix.type() >= QTransform::TxProject) - drawCached = false; - - // don't try to cache huge fonts - const qreal pixelSize = ti.fontEngine->fontDef.pixelSize; - if (pixelSize * pixelSize * qAbs(s->matrix.determinant()) >= 64 * 64) - drawCached = false; - - // ### Remove the TestFontEngine and Box engine crap, in these - // ### cases we should delegate painting to the font engine - // ### directly... - -/* - #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - conQFontEngine::Type fontEngineType = ti.fontEngine->type(); - // qDebug() << "type" << fontEngineType << s->matrix.type(); - if ((fontEngineType == QFontEngine::Win && !((QFontEngineWin *) ti.fontEngine)->ttf && s->matrix.type() > QTransform::TxTranslate) - || (s->matrix.type() <= QTransform::TxTranslate - && (fontEngineType == QFontEngine::TestFontEngine - || fontEngineType == QFontEngine::Box))) { - drawCached = false; - } -#else -*/ - if (s->matrix.type() > QTransform::TxTranslate) - drawCached = false; -// #endif - if (drawCached) { - QRasterPaintEngineState *s = state(); - + if (!supportsTransformations(ti.fontEngine)) { QVarLengthArray<QFixedPoint> positions; QVarLengthArray<glyph_t> glyphs; @@ -3356,6 +3322,37 @@ void QRasterPaintEngine::releaseDC(HDC) const #endif +bool QRasterPaintEngine::supportsTransformations(const QFontEngine *fontEngine) const +{ + const QTransform &m = state()->matrix; +#if defined(Q_WS_WIN) && !defined(Q_WS_WINCE) + QFontEngine::Type fontEngineType = fontEngine->type(); + if ((fontEngineType == QFontEngine::Win && !((QFontEngineWin *) fontEngine)->ttf && m.type() > QTransform::TxTranslate) + || (m.type() <= QTransform::TxTranslate + && (fontEngineType == QFontEngine::TestFontEngine + || fontEngineType == QFontEngine::Box))) { + return true; + } +#endif + return supportsTransformations(fontEngine->fontDef.pixelSize, m); +} + +bool QRasterPaintEngine::supportsTransformations(qreal pixelSize, const QTransform &m) const +{ +#if defined(Q_WS_MAC) + // Mac font engines don't support scaling and rotation + if (m.type() > QTransform::TxTranslate) +#else + if (m.type() >= QTransform::TxProject) +#endif + return true; + + if (pixelSize * pixelSize * qAbs(m.determinant()) >= 64 * 64) + return true; + + return false; +} + /*! \internal */ diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h index 6d0388bfa3..9bdfbff9f6 100644 --- a/src/gui/painting/qpaintengine_raster_p.h +++ b/src/gui/painting/qpaintengine_raster_p.h @@ -237,6 +237,9 @@ public: QPoint coordinateOffset() const; + bool supportsTransformations(const QFontEngine *fontEngine) const; + bool supportsTransformations(qreal pixelSize, const QTransform &m) const; + protected: QRasterPaintEngine(QRasterPaintEnginePrivate &d, QPaintDevice *); private: diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 3b52a789c3..8510416fcb 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -1093,4 +1093,14 @@ void QPaintEngineEx::drawStaticTextItem(QStaticTextItem *staticTextItem) } } +bool QPaintEngineEx::supportsTransformations(qreal pixelSize, const QTransform &m) const +{ + Q_UNUSED(pixelSize); + + if (!m.isAffine()) + return true; + + return false; +} + QT_END_NAMESPACE diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h index 9e6cbfc1ea..604a43133f 100644 --- a/src/gui/painting/qpaintengineex_p.h +++ b/src/gui/painting/qpaintengineex_p.h @@ -227,6 +227,7 @@ public: IsEmulationEngine = 0x02 // If set, this object is a QEmulationEngine. }; virtual uint flags() const {return 0;} + virtual bool supportsTransformations(qreal pixelSize, const QTransform &m) const; protected: QPaintEngineEx(QPaintEngineExPrivate &data); diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index aa684864e8..d46b30b6e2 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -149,14 +149,6 @@ static inline uint line_emulation(uint emulation) | QPaintEngine_OpaqueBackground); } -static bool qt_paintengine_supports_transformations(QPaintEngine::Type type) -{ - return type == QPaintEngine::OpenGL2 - || type == QPaintEngine::OpenVG - || type == QPaintEngine::OpenGL - || type == QPaintEngine::CoreGraphics; -} - #ifndef QT_NO_DEBUG static bool qt_painter_thread_test(int devType, const char *what, bool extraCondition = false) { @@ -5683,35 +5675,37 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun) if (!font.isValid()) return; - QVector<quint32> glyphIndexes = glyphRun.glyphIndexes(); - QVector<QPointF> glyphPositions = glyphRun.positions(); + QGlyphRunPrivate *glyphRun_d = QGlyphRunPrivate::get(glyphRun); - int count = qMin(glyphIndexes.size(), glyphPositions.size()); - QVarLengthArray<QFixedPoint, 128> fixedPointPositions(count); + const quint32 *glyphIndexes = glyphRun_d->glyphIndexData; + const QPointF *glyphPositions = glyphRun_d->glyphPositionData; - bool paintEngineSupportsTransformations = - d->extended != 0 - ? qt_paintengine_supports_transformations(d->extended->type()) - : qt_paintengine_supports_transformations(d->engine->type()); + int count = qMin(glyphRun_d->glyphIndexDataSize, glyphRun_d->glyphPositionDataSize); + QVarLengthArray<QFixedPoint, 128> fixedPointPositions(count); - // If the matrix is not affine, the paint engine will fall back to - // drawing the glyphs as paths, which in turn means we should not - // preprocess the glyph positions - if (!d->state->matrix.isAffine()) - paintEngineSupportsTransformations = true; + QRawFontPrivate *fontD = QRawFontPrivate::get(font); + bool supportsTransformations; + if (d->extended != 0) { + supportsTransformations = d->extended->supportsTransformations(fontD->fontEngine->fontDef.pixelSize, + d->state->matrix); + } else { + supportsTransformations = d->engine->type() == QPaintEngine::CoreGraphics + || d->state->matrix.isAffine(); + } for (int i=0; i<count; ++i) { - QPointF processedPosition = position + glyphPositions.at(i); - if (!paintEngineSupportsTransformations) + QPointF processedPosition = position + glyphPositions[i]; + if (!supportsTransformations) processedPosition = d->state->transform().map(processedPosition); fixedPointPositions[i] = QFixedPoint::fromPointF(processedPosition); } - d->drawGlyphs(glyphIndexes.data(), fixedPointPositions.data(), count, font, glyphRun.overline(), + d->drawGlyphs(glyphIndexes, fixedPointPositions.data(), count, font, glyphRun.overline(), glyphRun.underline(), glyphRun.strikeOut()); } -void QPainterPrivate::drawGlyphs(quint32 *glyphArray, QFixedPoint *positions, int glyphCount, +void QPainterPrivate::drawGlyphs(const quint32 *glyphArray, QFixedPoint *positions, + int glyphCount, const QRawFont &font, bool overline, bool underline, bool strikeOut) { @@ -5878,11 +5872,12 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText return; } - bool paintEngineSupportsTransformations = qt_paintengine_supports_transformations(d->extended->type()); - if (paintEngineSupportsTransformations && !staticText_d->untransformedCoordinates) { + bool supportsTransformations = d->extended->supportsTransformations(staticText_d->font.pixelSize(), + d->state->matrix); + if (supportsTransformations && !staticText_d->untransformedCoordinates) { staticText_d->untransformedCoordinates = true; staticText_d->needsRelayout = true; - } else if (!paintEngineSupportsTransformations && staticText_d->untransformedCoordinates) { + } else if (!supportsTransformations && staticText_d->untransformedCoordinates) { staticText_d->untransformedCoordinates = false; staticText_d->needsRelayout = true; } diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h index 35cdf86ee0..79d4b4bbe0 100644 --- a/src/gui/painting/qpainter_p.h +++ b/src/gui/painting/qpainter_p.h @@ -232,7 +232,7 @@ public: void drawOpaqueBackground(const QPainterPath &path, DrawOperation operation); #if !defined(QT_NO_RAWFONT) - void drawGlyphs(quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount, + void drawGlyphs(const quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount, const QRawFont &font, bool overline = false, bool underline = false, bool strikeOut = false); #endif diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 7f8a0f9c3e..8b78b52c08 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -325,6 +325,9 @@ void QFontPrivate::resolve(uint mask, const QFontPrivate *other) if (! (mask & QFont::FamilyResolved)) request.family = other->request.family; + if (! (mask & QFont::StyleNameResolved)) + request.styleName = other->request.styleName; + if (! (mask & QFont::SizeResolved)) { request.pointSize = other->request.pointSize; request.pixelSize = other->request.pixelSize; @@ -874,6 +877,38 @@ void QFont::setFamily(const QString &family) } /*! + \since 4.8 + + Returns the requested font style name, it will be used to match the + font with irregular styles (that can't be normalized in other style + properties). It depends on system font support, thus only works for + Mac OS X and X11 so far. On Windows irregular styles will be added + as separate font families so there is no need for this. + + \sa setFamily() setStyle() +*/ +QString QFont::styleName() const +{ + return d->request.styleName; +} + +/*! + \since 4.8 + + Sets the style name of the font. When set, other style properties + like \a style() and \a weight() will be ignored for font matching. + + \sa styleName() +*/ +void QFont::setStyleName(const QString &styleName) +{ + detach(); + + d->request.styleName = styleName; + resolve_mask |= QFont::StyleNameResolved; +} + +/*! Returns the point size of the font. Returns -1 if the font size was specified in pixels. @@ -2437,6 +2472,21 @@ QString QFontInfo::family() const } /*! + \since 4.8 + + Returns the style name of the matched window system font on + system that supports it. + + \sa QFont::styleName() +*/ +QString QFontInfo::styleName() const +{ + QFontEngine *engine = d->engineForScript(QUnicodeTables::Common); + Q_ASSERT(engine != 0); + return engine->fontDef.styleName; +} + +/*! Returns the point size of the matched window system font. \sa pointSizeF() QFont::pointSize() diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h index ce24747aac..1035b665a3 100644 --- a/src/gui/text/qfont.h +++ b/src/gui/text/qfont.h @@ -156,7 +156,8 @@ public: LetterSpacingResolved = 0x2000, WordSpacingResolved = 0x4000, HintingPreferenceResolved = 0x8000, - AllPropertiesResolved = 0xffff + StyleNameResolved = 0x10000, + AllPropertiesResolved = 0x1ffff }; QFont(); @@ -168,6 +169,9 @@ public: QString family() const; void setFamily(const QString &); + QString styleName() const; + void setStyleName(const QString &); + int pointSize() const; void setPointSize(int); qreal pointSizeF() const; diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h index d36518ee4b..8eeae6ffc1 100644 --- a/src/gui/text/qfont_p.h +++ b/src/gui/text/qfont_p.h @@ -80,6 +80,7 @@ struct QFontDef } QString family; + QString styleName; #ifdef Q_WS_X11 QString addStyle; diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 39abbd6f58..dd30a15030 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -51,7 +51,6 @@ #include "qabstractfileengine.h" #include "qthreadstorage.h" #include <qmath.h> -#include <private/qharfbuzz_p.h> #include "qfontengine_ft_p.h" #include <ft2build.h> @@ -758,6 +757,8 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format, } #endif + fontDef.styleName = QString::fromUtf8(face->style_name); + unlockFace(); fsType = freetype->fsType(); diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index a52fd45df2..e320be4421 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -70,7 +70,7 @@ #include <qmutex.h> -#include <harfbuzz-shaper.h> +#include "private/qharfbuzz_copy_p.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/text/qfontinfo.h b/src/gui/text/qfontinfo.h index 1238cba4da..37a724ec7c 100644 --- a/src/gui/text/qfontinfo.h +++ b/src/gui/text/qfontinfo.h @@ -61,6 +61,7 @@ public: QFontInfo &operator=(const QFontInfo &); QString family() const; + QString styleName() const; int pixelSize() const; int pointSize() const; qreal pointSizeF() const; diff --git a/src/gui/text/qglyphrun.cpp b/src/gui/text/qglyphrun.cpp index 4a51e56805..18b6357863 100644 --- a/src/gui/text/qglyphrun.cpp +++ b/src/gui/text/qglyphrun.cpp @@ -132,13 +132,27 @@ QGlyphRun &QGlyphRun::operator=(const QGlyphRun &other) */ bool QGlyphRun::operator==(const QGlyphRun &other) const { - return ((d == other.d) - || (d->glyphIndexes == other.d->glyphIndexes - && d->glyphPositions == other.d->glyphPositions - && d->overline == other.d->overline - && d->underline == other.d->underline - && d->strikeOut == other.d->strikeOut - && d->rawFont == other.d->rawFont)); + if (d == other.d) + return true; + + if ((d->glyphIndexDataSize != other.d->glyphIndexDataSize) + || (d->glyphPositionDataSize != other.d->glyphPositionDataSize)) { + return false; + } + + for (int i=0; i<qMax(d->glyphIndexDataSize, d->glyphPositionDataSize); ++i) { + if (i < d->glyphIndexDataSize && d->glyphIndexData[i] != other.d->glyphIndexData[i]) + return false; + + if (i < d->glyphPositionDataSize && d->glyphPositionData[i] != other.d->glyphPositionData[i]) + return false; + } + + + return (d->overline == other.d->overline + && d->underline == other.d->underline + && d->strikeOut == other.d->strikeOut + && d->rawFont == other.d->rawFont); } /*! @@ -151,36 +165,6 @@ bool QGlyphRun::operator!=(const QGlyphRun &other) const } /*! - \internal - - Adds together the lists of glyph indexes and positions in \a other and this QGlyphRun - object and returns the result. The font in the returned QGlyphRun will be the same as in - this QGlyphRun object. -*/ -QGlyphRun QGlyphRun::operator+(const QGlyphRun &other) const -{ - QGlyphRun ret(*this); - ret += other; - return ret; -} - -/*! - \internal - - Appends the glyph indexes and positions in \a other to this QGlyphRun object and returns - a reference to the current object. -*/ -QGlyphRun &QGlyphRun::operator+=(const QGlyphRun &other) -{ - detach(); - - d->glyphIndexes += other.d->glyphIndexes; - d->glyphPositions += other.d->glyphPositions; - - return *this; -} - -/*! Returns the font selected for this QGlyphRun object. \sa setRawFont() @@ -208,7 +192,13 @@ void QGlyphRun::setRawFont(const QRawFont &rawFont) */ QVector<quint32> QGlyphRun::glyphIndexes() const { - return d->glyphIndexes; + if (d->glyphIndexes.constData() == d->glyphIndexData) { + return d->glyphIndexes; + } else { + QVector<quint32> indexes(d->glyphIndexDataSize); + qMemCopy(indexes.data(), d->glyphIndexData, d->glyphIndexDataSize * sizeof(quint32)); + return indexes; + } } /*! @@ -218,7 +208,9 @@ QVector<quint32> QGlyphRun::glyphIndexes() const void QGlyphRun::setGlyphIndexes(const QVector<quint32> &glyphIndexes) { detach(); - d->glyphIndexes = glyphIndexes; + d->glyphIndexes = glyphIndexes; // Keep a reference to the QVector to avoid copying + d->glyphIndexData = glyphIndexes.constData(); + d->glyphIndexDataSize = glyphIndexes.size(); } /*! @@ -226,7 +218,14 @@ void QGlyphRun::setGlyphIndexes(const QVector<quint32> &glyphIndexes) */ QVector<QPointF> QGlyphRun::positions() const { - return d->glyphPositions; + if (d->glyphPositions.constData() == d->glyphPositionData) { + return d->glyphPositions; + } else { + QVector<QPointF> glyphPositions(d->glyphPositionDataSize); + qMemCopy(glyphPositions.data(), d->glyphPositionData, + d->glyphPositionDataSize * sizeof(QPointF)); + return glyphPositions; + } } /*! @@ -236,7 +235,9 @@ QVector<QPointF> QGlyphRun::positions() const void QGlyphRun::setPositions(const QVector<QPointF> &positions) { detach(); - d->glyphPositions = positions; + d->glyphPositions = positions; // Keep a reference to the vector to avoid copying + d->glyphPositionData = positions.constData(); + d->glyphPositionDataSize = positions.size(); } /*! @@ -245,12 +246,33 @@ void QGlyphRun::setPositions(const QVector<QPointF> &positions) void QGlyphRun::clear() { detach(); - d->glyphPositions = QVector<QPointF>(); - d->glyphIndexes = QVector<quint32>(); d->rawFont = QRawFont(); d->strikeOut = false; d->overline = false; d->underline = false; + + setPositions(QVector<QPointF>()); + setGlyphIndexes(QVector<quint32>()); +} + +/*! + Sets the glyph indexes and positions of this QGlyphRun to use the first \a size + elements in the arrays \a glyphIndexArray and \a glyphPositionArray. The data is + \e not copied. The caller must guarantee that the arrays are not deleted as long + as this QGlyphRun and any copies of it exists. + + \sa setGlyphIndexes(), setPositions() +*/ +void QGlyphRun::setRawData(const quint32 *glyphIndexArray, const QPointF *glyphPositionArray, + int size) +{ + detach(); + d->glyphIndexes.clear(); + d->glyphPositions.clear(); + + d->glyphIndexData = glyphIndexArray; + d->glyphPositionData = glyphPositionArray; + d->glyphIndexDataSize = d->glyphPositionDataSize = size; } /*! diff --git a/src/gui/text/qglyphrun.h b/src/gui/text/qglyphrun.h index 99a1fc8593..b4f02f0d87 100644 --- a/src/gui/text/qglyphrun.h +++ b/src/gui/text/qglyphrun.h @@ -66,6 +66,10 @@ public: QRawFont rawFont() const; void setRawFont(const QRawFont &rawFont); + void setRawData(const quint32 *glyphIndexArray, + const QPointF *glyphPositionArray, + int size); + QVector<quint32> glyphIndexes() const; void setGlyphIndexes(const QVector<quint32> &glyphIndexes); diff --git a/src/gui/text/qglyphrun_p.h b/src/gui/text/qglyphrun_p.h index 533679d96a..a7745e68ce 100644 --- a/src/gui/text/qglyphrun_p.h +++ b/src/gui/text/qglyphrun_p.h @@ -71,6 +71,10 @@ public: : overline(false) , underline(false) , strikeOut(false) + , glyphIndexData(glyphIndexes.constData()) + , glyphIndexDataSize(0) + , glyphPositionData(glyphPositions.constData()) + , glyphPositionDataSize(0) { } @@ -82,6 +86,10 @@ public: , overline(other.overline) , underline(other.underline) , strikeOut(other.strikeOut) + , glyphIndexData(other.glyphIndexData) + , glyphIndexDataSize(other.glyphIndexDataSize) + , glyphPositionData(other.glyphPositionData) + , glyphPositionDataSize(other.glyphPositionDataSize) { } @@ -92,6 +100,17 @@ public: uint overline : 1; uint underline : 1; uint strikeOut : 1; + + const quint32 *glyphIndexData; + int glyphIndexDataSize; + + const QPointF *glyphPositionData; + int glyphPositionDataSize; + + static QGlyphRunPrivate *get(const QGlyphRun &glyphRun) + { + return glyphRun.d.data(); + } }; QT_END_NAMESPACE diff --git a/src/gui/text/qharfbuzz_copy_p.h b/src/gui/text/qharfbuzz_copy_p.h new file mode 100644 index 0000000000..74b824ab35 --- /dev/null +++ b/src/gui/text/qharfbuzz_copy_p.h @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) + * Copyright (C) 2007 Red Hat, Inc. + * + * This code is a modified version of some part of HarfBuzz, + * an OpenType Layout engine library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + */ + +#ifndef QHARFBUZZ_COPY_P_H +#define QHARFBUZZ_COPY_P_H + +/* + The purpose of this header file is to allow inclusion of the private + headers for font and text classes without having to pull in the full + harfbuzz library under QTDIR/src/3rdparty/harfbuzz/src +*/ +#if defined(QT_BUILD_GUI_LIB) || defined(QT_COMPILES_IN_HARFBUZZ) +#include <private/qharfbuzz_p.h> +#else + +extern "C" { + +#ifdef __xlC__ +typedef unsigned hb_bitfield; +#else +typedef quint8 hb_bitfield; +#endif + +typedef enum { + /* no error */ + HB_Err_Ok = 0x0000, + HB_Err_Not_Covered = 0xFFFF, + + /* _hb_err() is called whenever returning the following errors, + * and in a couple places for HB_Err_Not_Covered too. */ + + /* programmer error */ + HB_Err_Invalid_Argument = 0x1A66, + + /* font error */ + HB_Err_Invalid_SubTable_Format = 0x157F, + HB_Err_Invalid_SubTable = 0x1570, + HB_Err_Read_Error = 0x6EAD, + + /* system error */ + HB_Err_Out_Of_Memory = 0xDEAD +} HB_Error; + +typedef quint32 HB_Glyph; +typedef void * HB_Font; +typedef void * HB_Face; +typedef void * HB_FontRec; +typedef quint32 hb_uint32; +typedef qint32 HB_Fixed; + +typedef struct { + HB_Fixed x; + HB_Fixed y; +} HB_FixedPoint; + +// The GlyphAttrbutes class is used inline so it needs to be complete. +typedef struct { + hb_bitfield justification :4; /* Justification class */ + hb_bitfield clusterStart :1; /* First glyph of representation of cluster */ + hb_bitfield mark :1; /* needs to be positioned around base char */ + hb_bitfield zeroWidth :1; /* ZWJ, ZWNJ etc, with no width */ + hb_bitfield dontPrint :1; + hb_bitfield combiningClass :8; +} HB_GlyphAttributes; + +// This struct is strictly not needed, but we replicate it completely in +// case the compiler tries to get clever with padding. +typedef struct { + /*HB_LineBreakType*/ hb_bitfield lineBreakType :2; + /*HB_Bool*/ hb_bitfield whiteSpace :1; /* A unicode whitespace character, except NBSP, ZWNBSP */ + /*HB_Bool*/ hb_bitfield charStop :1; /* Valid cursor position (for left/right arrow) */ + /*HB_Bool*/ hb_bitfield wordBoundary :1; + /*HB_Bool*/ hb_bitfield sentenceBoundary :1; + hb_bitfield unused :2; +} HB_CharAttributes; + +} + +#endif // ifdef QT_BUILD_GUI_LIB + +#endif // QHARFBUZZ_COPY_P_H diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp index 481180ec78..71762df09f 100644 --- a/src/gui/text/qrawfont.cpp +++ b/src/gui/text/qrawfont.cpp @@ -404,6 +404,19 @@ QString QRawFont::familyName() const } /*! + Returns the style name of this QRawFont. + + \sa QFont::styleName() +*/ +QString QRawFont::styleName() const +{ + if (!isValid()) + return QString(); + + return d->fontEngine->fontDef.styleName; +} + +/*! Returns the style of this QRawFont. \sa QFont::style() diff --git a/src/gui/text/qrawfont.h b/src/gui/text/qrawfont.h index 3857da35e0..aca33af127 100644 --- a/src/gui/text/qrawfont.h +++ b/src/gui/text/qrawfont.h @@ -84,6 +84,7 @@ public: bool operator==(const QRawFont &other) const; QString familyName() const; + QString styleName() const; QFont::Style style() const; int weight() const; diff --git a/src/gui/text/qrawfont_ft.cpp b/src/gui/text/qrawfont_ft.cpp index e8c10a5748..db60459176 100644 --- a/src/gui/text/qrawfont_ft.cpp +++ b/src/gui/text/qrawfont_ft.cpp @@ -46,7 +46,7 @@ #include "qrawfont_p.h" #include "qfontengine_ft_p.h" -#if defined(Q_WS_X11) +#if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG) # include "qfontengine_x11_p.h" #endif @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE class QFontEngineFTRawFont -#if defined(Q_WS_X11) +#if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG) : public QFontEngineX11FT #else : public QFontEngineFT @@ -63,7 +63,7 @@ class QFontEngineFTRawFont { public: QFontEngineFTRawFont(const QFontDef &fontDef) -#if defined(Q_WS_X11) +#if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG) : QFontEngineX11FT(fontDef) #else : QFontEngineFT(fontDef) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index dfe3e410f6..5127fcf969 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -856,7 +856,7 @@ void QTextEngine::shapeLine(const QScriptLine &line) } } -#if !defined(QT_ENABLE_HARFBUZZ_FOR_MAC) +#if !defined(QT_ENABLE_HARFBUZZ_FOR_MAC) && defined(Q_WS_MAC) static bool enableHarfBuzz() { static enum { Yes, No, Unknown } status = Unknown; diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index 988e41e502..25ab1e4420 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -70,7 +70,9 @@ #ifndef QT_BUILD_COMPAT_LIB #include "private/qtextdocument_p.h" #endif -#include "private/qharfbuzz_p.h" + +#include "private/qharfbuzz_copy_p.h" + #include "private/qfixed_p.h" #include <stdlib.h> diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index a88b46625a..e386b5eb1f 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2280,10 +2280,20 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const glyphIndexes.setRawFont(font); QPair<QFontEngine *, int> key(fontEngine, int(flags)); - if (!glyphsHash.contains(key)) + if (!glyphsHash.contains(key)) { glyphsHash.insert(key, glyphIndexes); - else - glyphsHash[key] += glyphIndexes; + } else { + QGlyphRun &glyphRun = glyphsHash[key]; + + QVector<quint32> indexes = glyphRun.glyphIndexes(); + QVector<QPointF> positions = glyphRun.positions(); + + indexes += glyphIndexes.glyphIndexes(); + positions += glyphIndexes.positions(); + + glyphRun.setGlyphIndexes(indexes); + glyphRun.setPositions(positions); + } } } diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri index 23c863392a..e8535e089c 100644 --- a/src/gui/text/text.pri +++ b/src/gui/text/text.pri @@ -41,7 +41,8 @@ HEADERS += \ text/qrawfont.h \ text/qrawfont_p.h \ text/qglyphrun.h \ - text/qglyphrun_p.h + text/qglyphrun_p.h \ + text/qharfbuzz_copy_p.h SOURCES += \ text/qfont.cpp \ diff --git a/src/network/network.pro b/src/network/network.pro index 4ee71b028e..cfd3f95300 100644 --- a/src/network/network.pro +++ b/src/network/network.pro @@ -1,3 +1,5 @@ +load(qt_module) + # Qt network module TARGET = QtNetwork QPRO_PWD = $$PWD @@ -18,7 +20,7 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x64000000 unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/network/qtnetworkversion.h diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 46665176cf..5316626638 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1908,7 +1908,7 @@ bool QAbstractSocket::waitForReadyRead(int msecs) if (state() != ConnectedState) return false; - } while (qt_timeout_value(msecs, stopWatch.elapsed()) > 0); + } while (msecs == -1 || qt_timeout_value(msecs, stopWatch.elapsed()) > 0); return false; } diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 7ba92e4244..2895d5a9b0 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -158,6 +158,7 @@ public: void setRenderTextActive(bool); bool isNativePaintingActive() const; + bool supportsTransformations(qreal, const QTransform &) const { return true; } private: Q_DISABLE_COPY(QGL2PaintEngineEx) }; diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index 2ff4ce0f31..578ce0f660 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtOpenGL QPRO_PWD = $$PWD QT = core-private gui-private widgets-private @@ -13,7 +15,7 @@ irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/opengl/qtopenglversion.h diff --git a/src/opengl/qpaintengine_opengl_p.h b/src/opengl/qpaintengine_opengl_p.h index 5d5f5ce652..8d0ea83a47 100644 --- a/src/opengl/qpaintengine_opengl_p.h +++ b/src/opengl/qpaintengine_opengl_p.h @@ -143,6 +143,7 @@ public: Qt::HANDLE handle() const; #endif inline Type type() const { return QPaintEngine::OpenGL; } + bool supportsTransformations(qreal, const QTransform &) const { return true; } private: void drawPolyInternal(const QPolygonF &pa, bool close = true); diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 287ffce721..9e8596f19e 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -48,7 +48,7 @@ #include <QtGui/QPlatformWindow> #include <QtGui/QPlatformWindowFormat> -#include <QtOpenGL/private/qpixmapdata_gl_p.h> +#include <QtGui/private/qpixmap_raster_p.h> #include <EGL/egl.h> @@ -78,7 +78,7 @@ QPixmapData *QEglFSIntegration::createPixmapData(QPixmapData::PixelType type) co #ifdef QEGL_EXTRA_DEBUG qWarning("QEglIntegration::createPixmapData %d\n", type); #endif - return new QGLPixmapData(type); + return new QRasterPixmapData(type); } QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWidget *widget, WId winId) const diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 1232df6d52..53f74e3ddf 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -141,6 +141,7 @@ void QWaylandWindow::damage(const QRegion ®ion) QVector<QRect> rects = region.rects(); for (int i = 0; i < rects.size(); i++) { const QRect rect = rects.at(i); + wl_buffer_damage(mBuffer->buffer(), rect.x(), rect.y(), rect.width(), rect.height()); wl_surface_damage(mSurface, rect.x(), rect.y(), rect.width(), rect.height()); } diff --git a/src/qbase.pri b/src/qbase.pri index cf02978853..528dd1e17a 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -1,226 +1 @@ -load(qt_module) - -isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0) -isEmpty(TARGET):error("You must set TARGET before include()'ing $${_FILE_}") - -MODULE_INCLUDES = $$eval(QT.$${MODULE}.includes) -MODULE_PRIVATE_INCLUDES = $$eval(QT.$${MODULE}.private_includes) -INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES -INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES/$$TARGET -INCLUDEPATH *= $$MODULE_INCLUDES $$MODULE_INCLUDES/.. #just for today to have some compat -!isEmpty(RCC_DIR): INCLUDEPATH += $$RCC_DIR -isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700 -TEMPLATE = lib -isEmpty(QT_MAJOR_VERSION) { - VERSION=5.0.0 -} else { - VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} -} - -#load up the headers info -CONFIG += qt_install_headers -#headers.pri is loaded from the last include path -LAST_MODULE_INCLUDE=$$MODULE_INCLUDES -for(include_path, MODULE_INCLUDES):LAST_MODULE_INCLUDE=$${include_path} -HEADERS_PRI = $$LAST_MODULE_INCLUDE/headers.pri -include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI) - -#version overriding -win32 { - #because libnetwork.pro could be qmake'd (qmade?) before libqcore.pro we - #need to override the version of libq* in all other libq*'s just to be - #sure the same version is used - VERSIONS_LIST = $$split(VERSION, ".") - QT_LIBS_OVERRIDE = $$member(VERSIONS_LIST, 0) - for(lib, $$list(qtcore qtgui qtnetwork qtxml qtopengl qtsql qt3support)) { - eval(QMAKE_$${upper($$lib)}_VERSION_OVERRIDE = $$QT_LIBS_OVERRIDE) - eval(QMAKE_$${upper($$lib)}D_VERSION_OVERRIDE = $$QT_LIBS_OVERRIDE) - } -} - -#other -DESTDIR = $$QMAKE_LIBDIR_QT -win32:!wince*:DLLDESTDIR = $$[QT_INSTALL_PREFIX]/bin - -CONFIG += qt warn_on depend_includepath -CONFIG += qmake_cache target_qt -CONFIG -= fix_output_dirs -win32|mac:!macx-xcode:CONFIG += debug_and_release -linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF - -contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols -unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions -contains(QT_CONFIG, largefile):CONFIG += largefile - -#mac frameworks -mac:!static:contains(QT_CONFIG, qt_framework) { - #QMAKE_FRAMEWORK_VERSION = 4.0 - CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework - CONFIG(debug, debug|release) { - !build_pass:CONFIG += build_all - } else { #release - !debug_and_release|build_pass { - CONFIG -= qt_install_headers #no need to install these as well - FRAMEWORK_HEADERS.version = Versions - FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES - FRAMEWORK_HEADERS.path = Headers - equals(TARGET, QtCore) { - #headers generated by configure - !contains(FRAMEWORK_HEADERS.files, .*/qconfig.h) { - FRAMEWORK_HEADERS.files *= $$QT_BUILD_TREE/src/corelib/global/qconfig.h - } - } - } - QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS - } -} - -mac { - CONFIG += explicitlib - macx-g++ { - QMAKE_CFLAGS += -fconstant-cfstrings - QMAKE_CXXFLAGS += -fconstant-cfstrings - } -} - -win32:!shared:CONFIG += static - -win32-borland { - mng:QMAKE_CFLAGS_WARN_ON += -w-par - mng:QMAKE_CXXFLAGS_WARN_ON += -w-par - # Keep the size of the .tds file for the Qt library smaller than - # 34 Mbytes to avoid linking problems - QMAKE_CFLAGS_DEBUG += -vi -y- - QMAKE_CXXFLAGS_DEBUG += -vi -y- -} - -win32 { - INCLUDEPATH += tmp - !static: DEFINES+=QT_MAKEDLL -} -symbian { - shared { - DEFINES+=QT_MAKEDLL - TARGET.CAPABILITY = All -Tcb - - # When building without autotests, DEF files are used by default. - # This is to maintain binary compatibility with previous releases. - # To explicitly disable DEF files usage, eg. when lots of code churn is - # going on, and functions may be added and removed before shipping, - # configure with -no-usedeffiles - # WARNING - disabling DEF files *will* break BC with previous released versions - # of Qt, and the only compatibility will be between this build of Qt and anything - # built in this exact environment. *Never* use this when building a version - # for release. - contains(CONFIG, def_files) { - DEF_FILE=../s60installs - } - } - load(armcc_warnings) - - # workaround for the fact that some of our required includes in Symbian^3 - # now depend upon files in epoc32/include/platform - INCLUDEPATH += $$OS_LAYER_SYSTEMINCLUDE -} -win32-borland:INCLUDEPATH += kernel - -aix-g++* { - QMAKE_CFLAGS += -mminimal-toc - QMAKE_CXXFLAGS += -mminimal-toc -} - -embedded { - EMBEDDED_H = $$EMBEDDED_CPP -} - -DEPENDPATH += ;$$NETWORK_H;$$KERNEL_H;$$WIDGETS_H;$$SQL_H;$$TABLE_H;$$DIALOGS_H; -DEPENDPATH += $$ICONVIEW_H;$$OPENGL_H;$$THREAD_H;$$TOOLS_H;$$CODECS_H; -DEPENDPATH += $$WORKSPACE_H;$$XML_H;$$STYLES_H;$$COMPAT_H -embedded:DEPENDPATH += ;$$EMBEDDED_H - -!static:PRL_EXPORT_DEFINES += QT_SHARED - -#install directives -include(qt_install.pri) - -unix:!symbian { - CONFIG += create_libtool create_pc explicitlib - QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS] - QMAKE_PRL_LIBDIR = $$[QT_INSTALL_LIBS] - QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] - QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET - QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] - QMAKE_PKGCONFIG_DESTDIR = pkgconfig - include_replace.match = $$QMAKE_INCDIR_QT - include_replace.replace = $$[QT_INSTALL_HEADERS] - lib_replace.match = $$QMAKE_LIBDIR_QT - lib_replace.replace = $$[QT_INSTALL_LIBS] - prefix_replace.match = $$QT_BUILD_TREE - prefix_replace.replace = $$[QT_INSTALL_PREFIX] - QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace - QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace - QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace prefix_replace -} - -win32-g++* { - CONFIG += create_pc - QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] - QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET - QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] - QMAKE_PKGCONFIG_DESTDIR = pkgconfig -} - -contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE -DEFINES *= QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS -contains(QT_CONFIG, gui-qt3support):DEFINES *= QT3_SUPPORT -DEFINES *= QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code -DEFINES *= QT_USE_QSTRINGBUILDER - -TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end - -qtPrepareTool(QMAKE_LUPDATE, lupdate) -qtPrepareTool(QMAKE_LRELEASE, lrelease) - -moc_dir.name = moc_location -moc_dir.variable = QMAKE_MOC - -uic_dir.name = uic_location -uic_dir.variable = QMAKE_UIC - -rcc_dir.name = rcc_location -rcc_dir.variable = QMAKE_RCC - -lupdate_dir.name = lupdate_location -lupdate_dir.variable = QMAKE_LUPDATE - -lrelease_dir.name = lrelease_location -lrelease_dir.variable = QMAKE_LRELEASE - -QMAKE_PKGCONFIG_VARIABLES += moc_dir uic_dir rcc_dir lupdate_dir lrelease_dir - -include(qt_targets.pri) - -win32:DEFINES+=_USE_MATH_DEFINES - -symbian { - # Make partial upgrade SIS file for all dll's except webkit and s60main - !contains(TARGET.UID3, 0x200267C2):!contains(TARGET.UID3, 0xE00267C2):!contains(TARGET.UID3, 0x2001E61F):!contains(TARGET.UID3, 0xE001E61F) { - # Partial upgrade SIS file - vendorinfo = \ - "; Localised Vendor name" \ - "%{\"Nokia\"}" \ - " " \ - "; Unique Vendor name" \ - ":\"Nokia, Qt\"" \ - " " - isEmpty(QT_LIBINFIX): PARTIAL_UPGRADE_UID = 0x2001E61C - else: PARTIAL_UPGRADE_UID = 0xE001E61C - - pu_header = "; Partial upgrade package for testing $${TARGET} changes without reinstalling everything" \ - "$${LITERAL_HASH}{\"$${TARGET}\"}, ($$PARTIAL_UPGRADE_UID), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" - partial_upgrade.pkg_prerules = pu_header vendorinfo - partial_upgrade.files = $$QMAKE_LIBDIR_QT/$${TARGET}.dll - partial_upgrade.path = c:/sys/bin - DEPLOYMENT += partial_upgrade - } -} +load(qt_module_config) diff --git a/src/qt_install.pri b/src/qt_install.pri index f5ad51f591..8a9a7ab5ba 100644 --- a/src/qt_install.pri +++ b/src/qt_install.pri @@ -1,44 +1 @@ -#always install the library -win32 { - dlltarget.path=$$[QT_INSTALL_BINS] - INSTALLS += dlltarget -} -target.path=$$[QT_INSTALL_LIBS] -INSTALLS += target - -#headers -qt_install_headers { - INSTALL_HEADERS = $$SYNCQT.HEADER_FILES - equals(TARGET, QtCore) { - #headers generated by configure - INSTALL_HEADERS *= $$QT_BUILD_TREE/src/corelib/global/qconfig.h \ - $$QT_SOURCE_TREE/src/corelib/arch/$$QT_ARCH/arch - } - - equals(TARGET, phonon) { - class_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET - } else { - flat_headers.files = $$INSTALL_HEADERS - flat_headers.path = $$[QT_INSTALL_HEADERS]/Qt - INSTALLS += flat_headers - - class_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET - } - class_headers.files = $$SYNCQT.HEADER_CLASSES - INSTALLS += class_headers - - targ_headers.files = $$INSTALL_HEADERS - targ_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET - INSTALLS += targ_headers - - private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES - private_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET/$$eval(QT.$${MODULE}.VERSION)/$$TARGET/private - INSTALLS += private_headers -} - -embedded|qpa: equals(TARGET, QtGui) { - # install fonts for embedded - INSTALLS += fonts - fonts.path = $$[QT_INSTALL_LIBS]/fonts - fonts.files = $$QT_SOURCE_TREE/lib/fonts/* -} +load(qt_installs) diff --git a/src/qt_targets.pri b/src/qt_targets.pri index af1a32bb02..900b50bde4 100644 --- a/src/qt_targets.pri +++ b/src/qt_targets.pri @@ -1,4 +1 @@ -QMAKE_TARGET_COMPANY = Nokia Corporation and/or its subsidiary(-ies) -QMAKE_TARGET_PRODUCT = Qt4 -QMAKE_TARGET_DESCRIPTION = C++ application development framework. -QMAKE_TARGET_COPYRIGHT = Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +load(qt_targets) diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro index 4c598e2857..8cdd00e56f 100644 --- a/src/s60main/s60main.pro +++ b/src/s60main/s60main.pro @@ -35,4 +35,4 @@ symbian { error("$$_FILE_ is intended only for Symbian!") } -include(../qbase.pri) +load(qt_module_config) diff --git a/src/sql/sql.pro b/src/sql/sql.pro index c7cbbc4985..445946e07c 100644 --- a/src/sql/sql.pro +++ b/src/sql/sql.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtSql QPRO_PWD = $$PWD QT = core-private @@ -11,7 +13,7 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x62000000 unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/sql/qtsqlversion.h diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro index 18312d4829..435036e0c8 100644 --- a/src/testlib/testlib.pro +++ b/src/testlib/testlib.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtTest QPRO_PWD = $$PWD QT = core gui widgets @@ -84,7 +86,7 @@ qpa:mac: { } } -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/testlib/qttestlibversion.h diff --git a/src/tools/moc/moc.pro b/src/tools/moc/moc.pro index 0b8ddbe31e..8e2e76d4b9 100644 --- a/src/tools/moc/moc.pro +++ b/src/tools/moc/moc.pro @@ -15,4 +15,4 @@ include(../bootstrap/bootstrap.pri) target.path=$$[QT_INSTALL_BINS] INSTALLS += target -include(../../qt_targets.pri) +load(qt_targets) diff --git a/src/tools/rcc/rcc.pro b/src/tools/rcc/rcc.pro index edc85a1d15..6c78642406 100644 --- a/src/tools/rcc/rcc.pro +++ b/src/tools/rcc/rcc.pro @@ -13,4 +13,4 @@ include(../bootstrap/bootstrap.pri) target.path=$$[QT_INSTALL_BINS] INSTALLS += target -include(../../qt_targets.pri) +load(qt_targets) diff --git a/src/tools/uic/uic.pro b/src/tools/uic/uic.pro index 591925ca90..0b0ae782d4 100644 --- a/src/tools/uic/uic.pro +++ b/src/tools/uic/uic.pro @@ -20,4 +20,4 @@ include(../bootstrap/bootstrap.pri) target.path=$$[QT_INSTALL_BINS] INSTALLS += target -include(../../qt_targets.pri) +load(qt_targets) diff --git a/src/uitools/uitools.pro b/src/uitools/uitools.pro index 0af26d9375..3f9f166dbd 100644 --- a/src/uitools/uitools.pro +++ b/src/uitools/uitools.pro @@ -3,7 +3,8 @@ TEMPLATE = lib TARGET = $$qtLibraryTarget(QtUiTools) QT = core xml -CONFIG += qt staticlib # Not adding module here, since the module pri's are only used for building +CONFIG += qt staticlib module +MODULE = uitools MODULE_PRI = ../modules/qt_uitools.pri \ ../modules/qt_uilib.pri @@ -22,7 +23,7 @@ isEmpty(QT_MAJOR_VERSION) { } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } -include(../qt_targets.pri) +load(qt_targets) QMAKE_TARGET_PRODUCT = UiLoader QMAKE_TARGET_DESCRIPTION = QUiLoader @@ -34,7 +35,17 @@ SOURCES += quiloader.cpp include($$QT_BUILD_TREE/include/QtUiTools/headers.pri, "", true) quitools_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES quitools_headers.path = $$[QT_INSTALL_HEADERS]/QtUiTools -INSTALLS += quitools_headers +quitools_private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES +quitools_private_headers.path = $$[QT_INSTALL_HEADERS]/QtUiTools/$$QT.uitools.VERSION/QtUiTools/private +INSTALLS += quitools_headers quitools_private_headers + +# Uilib is from designer. +include($$QT_BUILD_TREE/include/QtDesigner/headers.pri, "", true) +quilib_headers.files = $$replace($$list($$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES), ^, ../../tools/uilib/) +quilib_headers.path = $$[QT_INSTALL_HEADERS]/QtDesigner +quilib_private_headers.files = $$replace($$list($$SYNCQT.PRIVATE_HEADER_FILES), ^, ../../tools/uilib/) +quilib_private_headers.path = $$[QT_INSTALL_HEADERS]/QtDesigner/$$QT.uilib.VERSION/QtDesigner/private +INSTALLS += quilib_headers quilib_private_headers target.path=$$[QT_INSTALL_LIBS] INSTALLS += target diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index d3df5c9a2c..9d6e348b0d 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -66,6 +66,9 @@ #if defined(Q_OS_WINCE) extern bool qt_priv_ptr_valid; #endif +#if defined(Q_OS_UNIX) +#include <pwd.h> +#endif #endif QT_BEGIN_NAMESPACE @@ -858,23 +861,78 @@ void QFileDialog::selectFile(const QString &filename) d->lineEdit()->setText(file); } +#ifdef Q_OS_UNIX +Q_AUTOTEST_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded = 0) +{ + if (expanded != 0) + *expanded = false; + if (!path.startsWith(QLatin1Char('~'))) + return path; + QString ret = path; + QStringList tokens = ret.split(QDir::separator()); + if (tokens.first() == QLatin1String("~")) { + ret.replace(0, 1, QDir::homePath()); + } else { + QString userName = tokens.first(); + userName.remove(0, 1); +#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) + passwd pw; + passwd *tmpPw; + char buf[200]; + const int bufSize = sizeof(buf); + int err = getpwnam_r(userName.toLocal8Bit().constData(), &pw, buf, bufSize, &tmpPw); + if (err || !tmpPw) + return ret; + const QString homePath = QString::fromLocal8Bit(pw.pw_dir); +#else + passwd *pw = getpwnam(userName.toLocal8Bit().constData()); + if (!pw) + return ret; + const QString homePath = QString::fromLocal8Bit(pw->pw_dir); +#endif + ret.replace(0, tokens.first().length(), homePath); + } + if (expanded != 0) + *expanded = true; + return ret; +} +#endif + /** Returns the text in the line edit which can be one or more file names */ QStringList QFileDialogPrivate::typedFiles() const { + Q_Q(const QFileDialog); QStringList files; QString editText = lineEdit()->text(); - if (!editText.contains(QLatin1Char('"'))) + if (!editText.contains(QLatin1Char('"'))) { +#ifdef Q_OS_UNIX + const QString prefix = q->directory().absolutePath() + QDir::separator(); + if (QFile::exists(prefix + editText)) + files << editText; + else + files << qt_tildeExpansion(editText); +#else files << editText; - else { +#endif + } else { // " is used to separate files like so: "file1" "file2" "file3" ... // ### need escape character for filenames with quotes (") QStringList tokens = editText.split(QLatin1Char('\"')); for (int i=0; i<tokens.size(); ++i) { if ((i % 2) == 0) continue; // Every even token is a separator +#ifdef Q_OS_UNIX + const QString token = tokens.at(i); + const QString prefix = q->directory().absolutePath() + QDir::separator(); + if (QFile::exists(prefix + token)) + files << token; + else + files << qt_tildeExpansion(token); +#else files << toInternal(tokens.at(i)); +#endif } } return addDefaultSuffixToFiles(files); @@ -3338,6 +3396,17 @@ QStringList QFSCompleter::splitPath(const QString &path) const pathCopy = pathCopy.mid(2); else doubleSlash.clear(); +#elif defined(Q_OS_UNIX) + bool expanded; + pathCopy = qt_tildeExpansion(pathCopy, &expanded); + if (expanded) { + QFileSystemModel *dirModel; + if (proxyModel) + dirModel = qobject_cast<QFileSystemModel *>(proxyModel->sourceModel()); + else + dirModel = sourceModel; + dirModel->fetchMore(dirModel->index(pathCopy)); + } #endif QRegExp re(QLatin1Char('[') + QRegExp::escape(sep) + QLatin1Char(']')); @@ -3354,14 +3423,14 @@ QStringList QFSCompleter::splitPath(const QString &path) const parts.append(QString()); #else QStringList parts = pathCopy.split(re); - if (path[0] == sep[0]) // read the "/" at the beginning as the split removed it + if (pathCopy[0] == sep[0]) // read the "/" at the beginning as the split removed it parts[0] = sep[0]; #endif #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) bool startsFromRoot = !parts.isEmpty() && parts[0].endsWith(QLatin1Char(':')); #else - bool startsFromRoot = path[0] == sep[0]; + bool startsFromRoot = pathCopy[0] == sep[0]; #endif if (parts.count() == 1 || (parts.count() > 1 && !startsFromRoot)) { const QFileSystemModel *dirModel; diff --git a/src/widgets/platforms/mac/qfontdatabase_mac.cpp b/src/widgets/platforms/mac/qfontdatabase_mac.cpp index 6fdaf06c8b..724dbf6c4a 100644 --- a/src/widgets/platforms/mac/qfontdatabase_mac.cpp +++ b/src/widgets/platforms/mac/qfontdatabase_mac.cpp @@ -249,6 +249,63 @@ static inline float weightToFloat(unsigned int weight) return (weight - 50) / 100.0; } +static QFontEngine *loadFromDatabase(const QFontDef &req, const QFontPrivate *d) +{ +#if defined(QT_MAC_USE_COCOA) + QCFString fontName = NULL; +#else + ATSFontFamilyRef familyRef = 0; + ATSFontRef fontRef = 0; +#endif + + QStringList family_list = familyList(req); + + const char *stylehint = styleHint(req); + if (stylehint) + family_list << QLatin1String(stylehint); + + // add QFont::defaultFamily() to the list, for compatibility with previous versions + family_list << QApplication::font().defaultFamily(); + + QMutexLocker locker(fontDatabaseMutex()); + QFontDatabasePrivate *db = privateDb(); + if (!db->count) + initializeDb(); + for (int i = 0; i < family_list.size(); ++i) { + for (int k = 0; k < db->count; ++k) { + if (db->families[k]->name.compare(family_list.at(i), Qt::CaseInsensitive) == 0) { + QByteArray family_name = db->families[k]->name.toUtf8(); +#if defined(QT_MAC_USE_COCOA) + QCFType<CTFontRef> ctFont = CTFontCreateWithName(QCFString(db->families[k]->name), 12, NULL); + if (ctFont) { + fontName = CTFontCopyFullName(ctFont); + goto found; + } +#else + familyRef = ATSFontFamilyFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault); + if (familyRef) { + fontRef = ATSFontFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault); + goto found; + } +#endif + } + } + } +found: +#ifdef QT_MAC_USE_COCOA + if (fontName) + return new QCoreTextFontEngineMulti(fontName, req, d->kerning); +#else + if (familyRef) { + QCFString actualName; + if (ATSFontFamilyGetName(familyRef, kATSOptionFlagsDefault, &actualName) == noErr) + req.family = actualName; + return new QFontEngineMacMulti(familyRef, req, fontDef, d->kerning); + } +#endif + return NULL; +} + void QFontDatabase::load(const QFontPrivate *d, int script) { // sanity checks @@ -289,69 +346,38 @@ void QFontDatabase::load(const QFontPrivate *d, int script) return; // the font info and fontdef should already be filled } - //find the font - QStringList family_list = familyList(req); - - const char *stylehint = styleHint(req); - if (stylehint) - family_list << QLatin1String(stylehint); - - // add QFont::defaultFamily() to the list, for compatibility with - // previous versions - family_list << QApplication::font().defaultFamily(); - + QFontEngine *engine = NULL; #if defined(QT_MAC_USE_COCOA) - QCFString fontName = NULL, familyName = NULL; -#else - ATSFontFamilyRef familyRef = 0; - ATSFontRef fontRef = 0; -#endif - - QMutexLocker locker(fontDatabaseMutex()); - QFontDatabasePrivate *db = privateDb(); - if (!db->count) - initializeDb(); - for(int i = 0; i < family_list.size(); ++i) { - for (int k = 0; k < db->count; ++k) { - if (db->families[k]->name.compare(family_list.at(i), Qt::CaseInsensitive) == 0) { - QByteArray family_name = db->families[k]->name.toUtf8(); -#if defined(QT_MAC_USE_COCOA) - QCFType<CTFontRef> ctFont = CTFontCreateWithName(QCFString(db->families[k]->name), 12, NULL); - if (ctFont) { - fontName = CTFontCopyFullName(ctFont); - familyName = CTFontCopyFamilyName(ctFont); - goto FamilyFound; - } -#else - familyRef = ATSFontFamilyFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault); - if (familyRef) { - fontRef = ATSFontFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault); - goto FamilyFound; - } -#endif + // Shortcut to get the font directly without going through the font database + if (!req.family.isEmpty() && !req.styleName.isEmpty()) { + QCFString expectedFamily = QCFString(req.family); + QCFString expectedStyle = QCFString(req.styleName); + + QCFType<CFMutableDictionaryRef> attributes = CFDictionaryCreateMutable(NULL, 0, + &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + CFDictionaryAddValue(attributes, kCTFontFamilyNameAttribute, expectedFamily); + CFDictionaryAddValue(attributes, kCTFontStyleNameAttribute, expectedStyle); + + QCFType<CTFontDescriptorRef> descriptor = CTFontDescriptorCreateWithAttributes(attributes); + CGAffineTransform transform = qt_transform_from_fontdef(req); + QCFType<CTFontRef> ctFont = CTFontCreateWithFontDescriptor(descriptor, req.pixelSize, &transform); + if (ctFont) { + QCFString familyName = CTFontCopyFamilyName(ctFont); + // Only accept the font if the family name is exactly the same as we specified + if (CFEqual(expectedFamily, familyName)) { + engine = new QCoreTextFontEngineMulti(ctFont, req, d->kerning); } } } -FamilyFound: - //fill in the engine's font definition - QFontDef fontDef = d->request; //copy.. - if(fontDef.pointSize < 0) - fontDef.pointSize = qt_mac_pointsize(fontDef, d->dpi); - else - fontDef.pixelSize = qt_mac_pixelsize(fontDef, d->dpi); - -#ifdef QT_MAC_USE_COCOA - fontDef.family = familyName; - QFontEngine *engine = new QCoreTextFontEngineMulti(fontName, fontDef, d->kerning); -#else - QCFString actualName; - if (ATSFontFamilyGetName(familyRef, kATSOptionFlagsDefault, &actualName) == noErr) - fontDef.family = actualName; - QFontEngine *engine = new QFontEngineMacMulti(familyRef, fontRef, fontDef, d->kerning); #endif - d->engineData->engine = engine; - engine->ref.ref(); //a ref for the engineData->engine - QFontCache::instance()->insertEngine(key, engine); + if (!engine) + engine = loadFromDatabase(req, d); + + if (engine) { + d->engineData->engine = engine; + engine->ref.ref(); + QFontCache::instance()->insertEngine(key, engine); + } } static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) diff --git a/src/widgets/platforms/mac/qfontengine_coretext.mm b/src/widgets/platforms/mac/qfontengine_coretext.mm index 737edc3a8c..a68a1551d9 100644 --- a/src/widgets/platforms/mac/qfontengine_coretext.mm +++ b/src/widgets/platforms/mac/qfontengine_coretext.mm @@ -116,17 +116,11 @@ QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const QCFString &name, const init(kerning); } -QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(CGFontRef cgFontRef, const QFontDef &fontDef, bool kerning) +QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(CTFontRef ctFontRef, const QFontDef &fontDef, bool kerning) : QFontEngineMulti(0) { this->fontDef = fontDef; - - transform = CGAffineTransformIdentity; - if (fontDef.stretch != 100) { - transform = CGAffineTransformMakeScale(float(fontDef.stretch) / float(100), 1); - } - - ctfont = CTFontCreateWithGraphicsFont(cgFontRef, fontDef.pixelSize, &transform, NULL); + ctfont = (CTFontRef) CFRetain(ctFontRef); init(kerning); } @@ -149,6 +143,9 @@ void QCoreTextFontEngineMulti::init(bool kerning) } QCoreTextFontEngine *fe = new QCoreTextFontEngine(ctfont, fontDef); + fontDef.family = fe->fontDef.family; + fontDef.styleName = fe->fontDef.styleName; + transform = fe->transform; fe->ref.ref(); engines.append(fe); } @@ -405,7 +402,7 @@ void QCoreTextFontEngineMulti::loadEngine(int) extern int qt_antialiasing_threshold; // from qapplication.cpp -static inline CGAffineTransform transformFromFontDef(const QFontDef &fontDef) +CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef) { CGAffineTransform transform = CGAffineTransformIdentity; if (fontDef.stretch != 100) @@ -416,7 +413,7 @@ static inline CGAffineTransform transformFromFontDef(const QFontDef &fontDef) QCoreTextFontEngine::QCoreTextFontEngine(CTFontRef font, const QFontDef &def) { fontDef = def; - transform = transformFromFontDef(fontDef); + transform = qt_transform_from_fontdef(fontDef); ctfont = font; CFRetain(ctfont); cgFont = CTFontCopyGraphicsFont(font, NULL); @@ -426,7 +423,7 @@ QCoreTextFontEngine::QCoreTextFontEngine(CTFontRef font, const QFontDef &def) QCoreTextFontEngine::QCoreTextFontEngine(CGFontRef font, const QFontDef &def) { fontDef = def; - transform = transformFromFontDef(fontDef); + transform = qt_transform_from_fontdef(fontDef); cgFont = font; // Keep reference count balanced CFRetain(cgFont); @@ -464,6 +461,9 @@ void QCoreTextFontEngine::init() QCFString family = CTFontCopyFamilyName(ctfont); fontDef.family = family; + QCFString styleName = (CFStringRef) CTFontCopyAttribute(ctfont, kCTFontStyleNameAttribute); + fontDef.styleName = styleName; + synthesisFlags = 0; CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(ctfont); if (traits & kCTFontItalicTrait) @@ -745,9 +745,8 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition 8, im.bytesPerLine(), colorspace, cgflags); CGContextSetFontSize(ctx, fontDef.pixelSize); - CGContextSetShouldAntialias(ctx, aa || - (fontDef.pointSize > qt_antialiasing_threshold - && !(fontDef.styleStrategy & QFont::NoAntialias))); + CGContextSetShouldAntialias(ctx, (aa || fontDef.pointSize > qt_antialiasing_threshold) + && !(fontDef.styleStrategy & QFont::NoAntialias)); CGContextSetShouldSmoothFonts(ctx, aa); CGAffineTransform oldTextMatrix = CGContextGetTextMatrix(ctx); CGAffineTransform cgMatrix = CGAffineTransformMake(1, 0, 0, 1, 0, 0); diff --git a/src/widgets/platforms/mac/qfontengine_coretext_p.h b/src/widgets/platforms/mac/qfontengine_coretext_p.h index 98d3b50c66..3ca8a0ad60 100644 --- a/src/widgets/platforms/mac/qfontengine_coretext_p.h +++ b/src/widgets/platforms/mac/qfontengine_coretext_p.h @@ -113,7 +113,7 @@ class QCoreTextFontEngineMulti : public QFontEngineMulti { public: QCoreTextFontEngineMulti(const QCFString &name, const QFontDef &fontDef, bool kerning); - QCoreTextFontEngineMulti(CGFontRef cgFontRef, const QFontDef &fontDef, bool kerning); + QCoreTextFontEngineMulti(CTFontRef ctFontRef, const QFontDef &fontDef, bool kerning); ~QCoreTextFontEngineMulti(); virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, @@ -141,6 +141,8 @@ private: friend class QFontDialogPrivate; }; +CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef); + #endif// !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) #endif // QFONTENGINE_CORETEXT_P_H diff --git a/src/widgets/platforms/mac/qpaintengine_mac_p.h b/src/widgets/platforms/mac/qpaintengine_mac_p.h index c87501ee1a..2434011e52 100644 --- a/src/widgets/platforms/mac/qpaintengine_mac_p.h +++ b/src/widgets/platforms/mac/qpaintengine_mac_p.h @@ -121,6 +121,8 @@ public: void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) { QPaintEngine::drawPolygon(points, pointCount, mode); } + bool supportsTransformations(qreal, const QTransform &) const { return true; }; + protected: friend class QMacPrintEngine; friend class QMacPrintEnginePrivate; diff --git a/src/widgets/platforms/x11/qfontdatabase_x11.cpp b/src/widgets/platforms/x11/qfontdatabase_x11.cpp index a5fdcb5216..754334c0c4 100644 --- a/src/widgets/platforms/x11/qfontdatabase_x11.cpp +++ b/src/widgets/platforms/x11/qfontdatabase_x11.cpp @@ -1452,6 +1452,35 @@ static const char *styleHint(const QFontDef &request) void qt_addPatternProps(FcPattern *pattern, int screen, int script, const QFontDef &request) { + double size_value = qMax(qreal(1.), request.pixelSize); + FcPatternDel(pattern, FC_PIXEL_SIZE); + FcPatternAddDouble(pattern, FC_PIXEL_SIZE, size_value); + + if (X11->display && QX11Info::appDepth(screen) <= 8) { + FcPatternDel(pattern, FC_ANTIALIAS); + // can't do antialiasing on 8bpp + FcPatternAddBool(pattern, FC_ANTIALIAS, false); + } else if (request.styleStrategy & (QFont::PreferAntialias|QFont::NoAntialias)) { + FcPatternDel(pattern, FC_ANTIALIAS); + FcPatternAddBool(pattern, FC_ANTIALIAS, + !(request.styleStrategy & QFont::NoAntialias)); + } + + if (script != QUnicodeTables::Common && *specialLanguages[script] != '\0') { + Q_ASSERT(script < QUnicodeTables::ScriptCount); + FcLangSet *ls = FcLangSetCreate(); + FcLangSetAdd(ls, (const FcChar8*)specialLanguages[script]); + FcPatternDel(pattern, FC_LANG); + FcPatternAddLangSet(pattern, FC_LANG, ls); + FcLangSetDestroy(ls); + } + + if (!request.styleName.isEmpty()) { + QByteArray cs = request.styleName.toUtf8(); + FcPatternAddString(pattern, FC_STYLE, (const FcChar8 *) cs.constData()); + return; + } + int weight_value = FC_WEIGHT_BLACK; if (request.weight == 0) weight_value = FC_WEIGHT_MEDIUM; @@ -1474,34 +1503,11 @@ void qt_addPatternProps(FcPattern *pattern, int screen, int script, const QFontD FcPatternDel(pattern, FC_SLANT); FcPatternAddInteger(pattern, FC_SLANT, slant_value); - double size_value = qMax(qreal(1.), request.pixelSize); - FcPatternDel(pattern, FC_PIXEL_SIZE); - FcPatternAddDouble(pattern, FC_PIXEL_SIZE, size_value); - int stretch = request.stretch; if (!stretch) stretch = 100; FcPatternDel(pattern, FC_WIDTH); FcPatternAddInteger(pattern, FC_WIDTH, stretch); - - if (X11->display && QX11Info::appDepth(screen) <= 8) { - FcPatternDel(pattern, FC_ANTIALIAS); - // can't do antialiasing on 8bpp - FcPatternAddBool(pattern, FC_ANTIALIAS, false); - } else if (request.styleStrategy & (QFont::PreferAntialias|QFont::NoAntialias)) { - FcPatternDel(pattern, FC_ANTIALIAS); - FcPatternAddBool(pattern, FC_ANTIALIAS, - !(request.styleStrategy & QFont::NoAntialias)); - } - - if (script != QUnicodeTables::Common && *specialLanguages[script] != '\0') { - Q_ASSERT(script < QUnicodeTables::ScriptCount); - FcLangSet *ls = FcLangSetCreate(); - FcLangSetAdd(ls, (const FcChar8*)specialLanguages[script]); - FcPatternDel(pattern, FC_LANG); - FcPatternAddLangSet(pattern, FC_LANG, ls); - FcLangSetDestroy(ls); - } } static bool preferScalable(const QFontDef &request) @@ -2049,7 +2055,8 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) return; FcPatternDel(pattern, FC_FILE); - FcPatternAddString(pattern, FC_FILE, (const FcChar8 *)fnt->fileName.toUtf8().constData()); + QByteArray cs = fnt->fileName.toUtf8(); + FcPatternAddString(pattern, FC_FILE, (const FcChar8 *) cs.constData()); FcChar8 *fam = 0, *familylang = 0; int i, n = 0; @@ -2135,7 +2142,8 @@ QString QFontDatabase::resolveFontFamilyAlias(const QString &family) if (!pattern) return family; - FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) family.toUtf8().data()); + QByteArray cs = family.toUtf8(); + FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) cs.constData()); FcConfigSubstitute(0, pattern, FcMatchPattern); FcDefaultSubstitute(pattern); diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro index 8c2710ccd9..b353e8e382 100644 --- a/src/winmain/winmain.pro +++ b/src/winmain/winmain.pro @@ -16,6 +16,6 @@ win32 { } !win32:error("$$_FILE_ is intended only for Windows!") -include(../qbase.pri) +load(qt_module_config) wince*:QMAKE_POST_LINK = diff --git a/src/xml/xml.pro b/src/xml/xml.pro index 986e478b69..f1d2baca50 100644 --- a/src/xml/xml.pro +++ b/src/xml/xml.pro @@ -1,3 +1,5 @@ +load(qt_module) + TARGET = QtXml QPRO_PWD = $$PWD QT = core-private @@ -10,7 +12,7 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x61000000 unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore -include(../qbase.pri) +load(qt_module_config) HEADERS += $$QT_SOURCE_TREE/src/xml/qtxmlversion.h diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp index 8060bc7056..d005ffd215 100644 --- a/tests/arthur/common/paintcommands.cpp +++ b/tests/arthur/common/paintcommands.cpp @@ -48,6 +48,7 @@ #include <qtextstream.h> #include <qtextlayout.h> #include <qdebug.h> +#include <QStaticText> #ifndef QT_NO_OPENGL #include <qglpixelbuffer.h> @@ -433,6 +434,10 @@ void PaintCommands::staticInit() "^drawText\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$", "drawText <x> <y> <text>", "drawText 10 10 \"my text\""); + DECL_PAINTCOMMAND("drawStaticText", command_drawStaticText, + "^drawStaticText\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$", + "drawStaticText <x> <y> <text>", + "drawStaticText 10 10 \"my text\""); DECL_PAINTCOMMAND("drawTiledPixmap", command_drawTiledPixmap, "^drawTiledPixmap\\s+([\\w.:\\/]*)" "\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w*)\\s*(-?\\w*)" @@ -1256,6 +1261,21 @@ void PaintCommands::command_drawText(QRegExp re) m_painter->drawText(x, y, txt); } +void PaintCommands::command_drawStaticText(QRegExp re) +{ + if (!m_shouldDrawText) + return; + QStringList caps = re.capturedTexts(); + int x = convertToInt(caps.at(1)); + int y = convertToInt(caps.at(2)); + QString txt = caps.at(3); + + if (m_verboseMode) + printf(" -(lance) drawStaticText(%d, %d, %s)\n", x, y, qPrintable(txt)); + + m_painter->drawStaticText(x, y, QStaticText(txt)); +} + /***************************************************************************************************/ void PaintCommands::command_noop(QRegExp) { diff --git a/tests/arthur/common/paintcommands.h b/tests/arthur/common/paintcommands.h index cc64aefb90..925a867f2f 100644 --- a/tests/arthur/common/paintcommands.h +++ b/tests/arthur/common/paintcommands.h @@ -201,6 +201,7 @@ private: void command_drawRoundedRect(QRegExp re); void command_drawRoundRect(QRegExp re); void command_drawText(QRegExp re); + void command_drawStaticText(QRegExp re); void command_drawTiledPixmap(QRegExp re); void command_path_addEllipse(QRegExp re); void command_path_addPolygon(QRegExp re); diff --git a/tests/auto/lancelot/scripts/statictext.qps b/tests/auto/lancelot/scripts/statictext.qps new file mode 100644 index 0000000000..b62b623462 --- /dev/null +++ b/tests/auto/lancelot/scripts/statictext.qps @@ -0,0 +1,122 @@ +drawStaticText -5 5 "Text that is drawn outside the bounds..." + +translate 20 20 +begin_block text_drawing +save + setFont "sansserif" 10 normal + drawStaticText 0 20 "sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 40 "sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 60 "sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 80 "sansserif 10pt, bold italic" + + + translate 0 100 + setPen #7fff0000 + + setFont "sansserif" 10 normal + drawStaticText 0 20 "alpha sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 40 "alpha sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 60 "alpha sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 80 "alpha sansserif 10pt, bold italic" + + + translate 0 100 + setPen black + save + scale 0.9 0.9 + + setFont "sansserif" 10 normal + drawStaticText 0 20 "scaled sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 40 "scaled sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 60 "scaled sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 80 "scaled sansserif 10pt, bold italic" + restore + + translate 0 100 + setPen black + save + translate 200 90 + rotate 185 + + setFont "sansserif" 10 normal + drawStaticText 0 20 "scaled sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 40 "scaled sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 60 "scaled sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 80 "scaled sansserif 10pt, bold italic" + restore + + translate 0 100 + gradient_appendStop 0 red + gradient_appendStop 0.5 #00ff00 + gradient_appendStop 1 blue + gradient_setLinear 0 0 200 0 + setPen brush + + setFont "sansserif" 10 normal + drawStaticText 0 0 "gradient sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 20 "gradient sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 40 "gradient sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 60 "gradient sansserif 10pt, bold italic" +restore +end_block + +translate 250 0 +drawStaticText 25 520 "clipped to rectangle" +save + setPen #3f000000 + setBrush nobrush + drawRect 20 0 100 500 + setClipRect 20 0 100 500 + setPen black + repeat_block text_drawing +restore + +translate 150 0 +drawStaticText 25 520 "clipped to path" +save + path_moveTo clip 20 0 + path_cubicTo clip 0 200 40 400 20 400 + path_lineTo clip 30 500 + path_lineTo clip 30 0 + path_lineTo clip 40 0 + path_lineTo clip 40 500 + path_lineTo clip 120 500 + path_lineTo clip 120 0 + path_lineTo clip 20 0 + setPen #3f000000 + setBrush nobrush + drawPath clip + setClipPath clip + setPen black + repeat_block text_drawing +restore diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp index 6c70d063a7..3bb682c7e9 100644 --- a/tests/auto/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp @@ -78,6 +78,10 @@ # define STRINGIFY(x) #x # define TOSTRING(x) STRINGIFY(x) # define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/" +#elif defined(Q_OS_UNIX) +#ifdef QT_BUILD_INTERNAL +extern Q_GUI_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded = 0); +#endif #endif class QNonNativeFileDialog : public QFileDialog @@ -144,6 +148,10 @@ private slots: void clearLineEdit(); void enableChooseButton(); void hooks(); +#ifdef Q_OS_UNIX + void tildeExpansion_data(); + void tildeExpansion(); +#endif private: QByteArray userSettings; @@ -1323,5 +1331,36 @@ void tst_QFiledialog::hooks() QCOMPARE(QFileDialog::getSaveFileName(), QString("saveName")); } +#ifdef Q_OS_UNIX +void tst_QFiledialog::tildeExpansion_data() +{ + QTest::addColumn<QString>("tildePath"); + QTest::addColumn<QString>("expandedPath"); + + QTest::newRow("empty path") << QString() << QString(); + QTest::newRow("~") << QString::fromLatin1("~") << QDir::homePath(); + QTest::newRow("~/some/sub/dir/") << QString::fromLatin1("~/some/sub/dir") << QDir::homePath() + + QString::fromLatin1("/some/sub/dir"); + QString userHome = QString(qgetenv("USER")); + userHome.prepend('~'); + QTest::newRow("current user (~<user> syntax)") << userHome << QDir::homePath(); + QString invalid = QString::fromLatin1("~thisIsNotAValidUserName"); + QTest::newRow("invalid user name") << invalid << invalid; +} + + +void tst_QFiledialog::tildeExpansion() +{ +#ifndef QT_BUILD_INTERNAL + QSKIP("Test case relies on developer build (AUTOTEST_EXPORT)", SkipAll); +#else + QFETCH(QString, tildePath); + QFETCH(QString, expandedPath); + + QCOMPARE(qt_tildeExpansion(tildePath), expandedPath); +#endif +} +#endif + QTEST_MAIN(tst_QFiledialog) #include "tst_qfiledialog.moc" diff --git a/tests/auto/qfont/tst_qfont.cpp b/tests/auto/qfont/tst_qfont.cpp index cfafa78684..711ffc0b53 100644 --- a/tests/auto/qfont/tst_qfont.cpp +++ b/tests/auto/qfont/tst_qfont.cpp @@ -77,6 +77,7 @@ private slots: void insertAndRemoveSubstitutions(); void serializeSpacing(); void lastResortFont(); + void styleName(); }; // Testing get/set functions @@ -612,5 +613,17 @@ void tst_QFont::lastResortFont() QVERIFY(!font.lastResortFont().isEmpty()); } +void tst_QFont::styleName() +{ +#if !defined(Q_WS_MAC) + QSKIP("Only tested on Mac", SkipAll); +#else + QFont font("Helvetica Neue"); + font.setStyleName("UltraLight"); + + QCOMPARE(QFontInfo(font).styleName(), QString("UltraLight")); +#endif +} + QTEST_MAIN(tst_QFont) #include "tst_qfont.moc" diff --git a/tests/auto/qglyphrun/tst_qglyphrun.cpp b/tests/auto/qglyphrun/tst_qglyphrun.cpp index 3ea84e3a4d..a18a2ac8dd 100644 --- a/tests/auto/qglyphrun/tst_qglyphrun.cpp +++ b/tests/auto/qglyphrun/tst_qglyphrun.cpp @@ -72,6 +72,8 @@ private slots: void drawUnderlinedText(); void drawRightToLeft(); void detach(); + void setRawData(); + void setRawDataAndGetAsVector(); private: int m_testFontId; @@ -284,6 +286,83 @@ void tst_QGlyphRun::drawExistingGlyphs() QCOMPARE(textLayoutDraw, drawGlyphs); } +void tst_QGlyphRun::setRawData() +{ + QGlyphRun glyphRun; + glyphRun.setRawFont(QRawFont::fromFont(m_testFont)); + glyphRun.setGlyphIndexes(QVector<quint32>() << 2 << 2 << 2); + glyphRun.setPositions(QVector<QPointF>() << QPointF(2, 3) << QPointF(20, 3) << QPointF(10, 20)); + + QPixmap baseline(100, 50); + baseline.fill(Qt::white); + { + QPainter p(&baseline); + p.drawGlyphRun(QPointF(3, 2), glyphRun); + } + + QGlyphRun baselineCopied = glyphRun; + + quint32 glyphIndexArray[3] = { 2, 2, 2 }; + QPointF glyphPositionArray[3] = { QPointF(2, 3), QPointF(20, 3), QPointF(10, 20) }; + + glyphRun.setRawData(glyphIndexArray, glyphPositionArray, 3); + + QPixmap rawDataGlyphs(100, 50); + rawDataGlyphs.fill(Qt::white); + { + QPainter p(&rawDataGlyphs); + p.drawGlyphRun(QPointF(3, 2), glyphRun); + } + + quint32 otherGlyphIndexArray[1] = { 2 }; + QPointF otherGlyphPositionArray[1] = { QPointF(2, 3) }; + + glyphRun.setRawData(otherGlyphIndexArray, otherGlyphPositionArray, 1); + + QPixmap baselineCopiedPixmap(100, 50); + baselineCopiedPixmap.fill(Qt::white); + { + QPainter p(&baselineCopiedPixmap); + p.drawGlyphRun(QPointF(3, 2), baselineCopied); + } + +#if defined(DEBUG_SAVE_IMAGE) + baseline.save("setRawData_baseline.png"); + rawDataGlyphs.save("setRawData_rawDataGlyphs.png"); + baselineCopiedPixmap.save("setRawData_baselineCopiedPixmap.png"); +#endif + + QCOMPARE(rawDataGlyphs, baseline); + QCOMPARE(baselineCopiedPixmap, baseline); +} + +void tst_QGlyphRun::setRawDataAndGetAsVector() +{ + QVector<quint32> glyphIndexArray; + glyphIndexArray << 3 << 2 << 1 << 4; + + QVector<QPointF> glyphPositionArray; + glyphPositionArray << QPointF(1, 2) << QPointF(3, 4) << QPointF(5, 6) << QPointF(7, 8); + + QGlyphRun glyphRun; + glyphRun.setRawData(glyphIndexArray.constData(), glyphPositionArray.constData(), 4); + + QVector<quint32> glyphIndexes = glyphRun.glyphIndexes(); + QVector<QPointF> glyphPositions = glyphRun.positions(); + + QCOMPARE(glyphIndexes.size(), 4); + QCOMPARE(glyphPositions.size(), 4); + + QCOMPARE(glyphIndexes, glyphIndexArray); + QCOMPARE(glyphPositions, glyphPositionArray); + + QGlyphRun otherGlyphRun; + otherGlyphRun.setGlyphIndexes(glyphIndexArray); + otherGlyphRun.setPositions(glyphPositionArray); + + QCOMPARE(glyphRun, otherGlyphRun); +} + void tst_QGlyphRun::drawNonExistentGlyphs() { QVector<quint32> glyphIndexes; diff --git a/tests/auto/qlocalsocket/qlocalsocket.pro b/tests/auto/qlocalsocket/qlocalsocket.pro index 3911a64936..931c1e0602 100644 --- a/tests/auto/qlocalsocket/qlocalsocket.pro +++ b/tests/auto/qlocalsocket/qlocalsocket.pro @@ -1,4 +1,4 @@ TEMPLATE = subdirs -SUBDIRS = lackey test +SUBDIRS = test # lackey should be moved to the QtScript module !wince*:!symbian: SUBDIRS += example symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 67b6e5c5b4..3b31e84556 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -5970,7 +5970,7 @@ public slots: void onReadAndReschedule() { const qint64 bytesReceived = m_reply->bytesAvailable(); - if (bytesReceived) { + if (bytesReceived && m_reply->readBufferSize()) { QByteArray data = m_reply->read(bytesReceived); // reschedule read const int millisecDelay = static_cast<int>(bytesReceived * 1000 / m_reply->readBufferSize()); @@ -6193,16 +6193,62 @@ void tst_QNetworkReply::synchronousRequestSslFailure() } #endif -void tst_QNetworkReply::httpAbort() +class HttpAbortHelper : public QObject { - // FIXME: Implement a test that aborts a big HTTP reply - // a) after the first readyRead() - // b) immediatly after the get() - // c) after the finished() - // The goal is no crash and no irrelevant signals after the abort + Q_OBJECT +public: + HttpAbortHelper(QNetworkReply *parent) + : QObject(parent) + { + mReply = parent; + connect(parent, SIGNAL(readyRead()), this, SLOT(readyRead())); + } + + ~HttpAbortHelper() + { + } + +public slots: + void readyRead() + { + mReply->abort(); + QMetaObject::invokeMethod(&QTestEventLoop::instance(), "exitLoop", Qt::QueuedConnection); + } + +private: + QNetworkReply *mReply; +}; +void tst_QNetworkReply::httpAbort() +{ // FIXME Also implement one where we do a big upload and then abort(). // It must not crash either. + + // Abort after the first readyRead() + QNetworkRequest request("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile"); + QNetworkReplyPtr reply; + reply = manager.get(request); + HttpAbortHelper replyHolder(reply); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + QCOMPARE(reply->error(), QNetworkReply::OperationCanceledError); + QVERIFY(reply->isFinished()); + + // Abort immediatly after the get() + QNetworkReplyPtr reply2 = manager.get(request); + connect(reply2, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + reply2->abort(); + QCOMPARE(reply2->error(), QNetworkReply::OperationCanceledError); + QVERIFY(reply2->isFinished()); + + // Abort after the finished() + QNetworkRequest request3("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"); + QNetworkReplyPtr reply3 = manager.get(request3); + connect(reply3, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(reply3->isFinished()); + reply3->abort(); + QCOMPARE(reply3->error(), QNetworkReply::NoError); } void tst_QNetworkReply::dontInsertPartialContentIntoTheCache() diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 6a4f1ed75e..999cad55ba 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -156,6 +156,7 @@ private slots: void setSslConfiguration_data(); void setSslConfiguration(); void waitForEncrypted(); + void waitForEncryptedMinusOne(); void waitForConnectedEncryptedReadyRead(); void startClientEncryption(); void startServerEncryption(); @@ -1098,6 +1099,20 @@ void tst_QSslSocket::waitForEncrypted() QVERIFY(socket->waitForEncrypted(10000)); } +void tst_QSslSocket::waitForEncryptedMinusOne() +{ + if (!QSslSocket::supportsSsl()) + return; + + QSslSocketPtr socket = newSocket(); + this->socket = socket; + + connect(socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(ignoreErrorSlot())); + socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443); + + QVERIFY(socket->waitForEncrypted(-1)); +} + void tst_QSslSocket::waitForConnectedEncryptedReadyRead() { if (!QSslSocket::supportsSsl()) diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp index 424d913157..547fdaf04b 100644 --- a/tests/auto/qstatictext/tst_qstatictext.cpp +++ b/tests/auto/qstatictext/tst_qstatictext.cpp @@ -361,7 +361,7 @@ bool tst_QStaticText::supportsTransformations() const QPaintEngine::Type type = engine->type(); if (type == QPaintEngine::OpenGL -#if !defined(Q_WS_WIN) && !defined(Q_WS_X11) +#if !defined(Q_WS_WIN) && !defined(Q_WS_X11) && !defined(Q_WS_MAC) || type == QPaintEngine::Raster #endif ) @@ -601,7 +601,7 @@ void tst_QStaticText::setPenPlainText() QStaticText staticText("XXXXX"); staticText.setTextFormat(Qt::PlainText); - p.drawStaticText(0, fm.ascent(), staticText); + p.drawStaticText(0, 0, staticText); } QImage img = image.toImage(); diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index 69e8ff1dbf..a2f8bac517 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -166,7 +166,9 @@ private slots: void readLineString(); void readChunks(); void waitForBytesWritten(); + void waitForBytesWrittenMinusOne(); void waitForReadyRead(); + void waitForReadyReadMinusOne(); void flush(); void synchronousApi(); void dontCloseOnTimeout(); @@ -1417,10 +1419,10 @@ void tst_QTcpSocket::readChunks() void tst_QTcpSocket::waitForBytesWritten() { QTcpSocket *socket = newSocket(); - socket->connectToHost(QtNetworkSettings::serverName(), 22); + socket->connectToHost(QtNetworkSettings::serverName(), 80); QVERIFY(socket->waitForConnected(10000)); - socket->write(QByteArray(10000, '@')); + socket->write("GET / HTTP/1.0\r\n\r\n"); qint64 toWrite = socket->bytesToWrite(); QVERIFY(socket->waitForBytesWritten(5000)); QVERIFY(toWrite > socket->bytesToWrite()); @@ -1429,11 +1431,37 @@ void tst_QTcpSocket::waitForBytesWritten() } //---------------------------------------------------------------------------------- +void tst_QTcpSocket::waitForBytesWrittenMinusOne() +{ + QTcpSocket *socket = newSocket(); + socket->connectToHost(QtNetworkSettings::serverName(), 80); + QVERIFY(socket->waitForConnected(10000)); + + socket->write("GET / HTTP/1.0\r\n\r\n"); + qint64 toWrite = socket->bytesToWrite(); + QVERIFY(socket->waitForBytesWritten(-1)); + QVERIFY(toWrite > socket->bytesToWrite()); + + delete socket; +} + +//---------------------------------------------------------------------------------- void tst_QTcpSocket::waitForReadyRead() { QTcpSocket *socket = newSocket(); - socket->connectToHost(QtNetworkSettings::serverName(), 22); - socket->waitForReadyRead(0); + socket->connectToHost(QtNetworkSettings::serverName(), 80); + socket->write("GET / HTTP/1.0\r\n\r\n"); + QVERIFY(socket->waitForReadyRead(5000)); + delete socket; +} + +//---------------------------------------------------------------------------------- +void tst_QTcpSocket::waitForReadyReadMinusOne() +{ + QTcpSocket *socket = newSocket(); + socket->connectToHost(QtNetworkSettings::serverName(), 80); + socket->write("GET / HTTP/1.0\r\n\r\n"); + QVERIFY(socket->waitForReadyRead(-1)); delete socket; } diff --git a/tests/auto/qtipc/qtipc.pro b/tests/auto/qtipc/qtipc.pro index 60037d28d2..e7d2a55cd8 100644 --- a/tests/auto/qtipc/qtipc.pro +++ b/tests/auto/qtipc/qtipc.pro @@ -1,6 +1,5 @@ TEMPLATE=subdirs SUBDIRS=\ - lackey \ qsharedmemory \ qsystemsemaphore \ - +# lackey \ should be moved to QtScript |