diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..a3c61083700 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.tag ident diff --git a/.tag b/.tag new file mode 100644 index 00000000000..055c8729cdc --- /dev/null +++ b/.tag @@ -0,0 +1 @@ +$Id$ diff --git a/bin/syncqt b/bin/syncqt index 45ac9d0fb0b..3d25ecc817b 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -558,8 +558,11 @@ sub locateSyncProfile # check if this is an in-source build, and if so use that as the basedir too $basedir = locateSyncProfile($out_basedir); -$basedir = dirname($basedir) if ($basedir); -$quoted_basedir = "\Q$basedir"; +if ($basedir) { + $basedir = dirname($basedir) ; + $basedir =~ s=\\=/=g; + $quoted_basedir = "\Q$basedir"; +} # -------------------------------------------------------------------- # "main" function @@ -624,6 +627,7 @@ while ( @ARGV ) { die "Could not find a sync.profile for '$arg'\n" if (!$basedir); $basedir = dirname($basedir); $basedir =~ s=\\=/=g; + $quoted_basedir = "\Q$basedir"; $var = "ignore"; } @@ -743,6 +747,21 @@ mkpath "$out_basedir/include/Qt", !$quiet; foreach my $lib (@modules_to_sync) { #iteration info my $dir = $modules{$lib}; + my $module_version = ""; + + if (-e "$modulepris{$lib}") { + my $content = fileContents($modulepris{$lib}); + my @version_rows = grep(/QT\..*\.VERSION/, split('\n', $content)); + if(@version_rows) { + # We only pick the first one, since each module need a separate .pri file + $module_version = $version_rows[0]; + chomp $module_version; + $module_version =~ s/^\s*QT\..*\.VERSION\s*=\s*([^#]+).*$/$1/; + $module_version =~ s/\s+$//; + } + } + print "WARNING: Module $lib\'s pri missing QT..VERSION variable! Private headers not versioned!\n" if (!$module_version); + my $pathtoheaders = ""; $pathtoheaders = $moduleheaders{$lib} if ($moduleheaders{$lib}); @@ -762,6 +781,7 @@ foreach my $lib (@modules_to_sync) { chomp $line; if($line =~ /^ *QT *\+?= *([^\r\n]*)/) { foreach(split(/ /, $1)) { + $_ =~ s/-private$//; my $content = $mastercontent{$_}; $master_contents .= $content if ($content); } @@ -909,7 +929,11 @@ foreach my $lib (@modules_to_sync) { } } } elsif ($create_private_headers) { - @headers = ( "$out_basedir/include/$lib/private/$header" ); + if ($module_version) { + @headers = ( "$out_basedir/include/$lib/$module_version/$lib/private/$header" ); + } else { + @headers = ( "$out_basedir/include/$lib/private/$header" ); + } } foreach(@headers) { #sync them $header_copies++ if(syncHeader($_, $iheader, $copy_headers && !$shadow, $ts)); diff --git a/configure b/configure index 60e1ec12163..e6956fbda9d 100755 --- a/configure +++ b/configure @@ -804,6 +804,7 @@ CFG_MAC_XARCH=auto CFG_MAC_CARBON=no CFG_MAC_COCOA=yes COMMANDLINE_MAC_CARBON=no +CFG_MAC_HARFBUZZ=no CFG_SXE=no CFG_PREFIX_INSTALL=yes CFG_SDK= @@ -1041,7 +1042,7 @@ while [ "$#" -gt 0 ]; do VAL=no ;; #Qt style yes options - -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu) + -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -1499,6 +1500,13 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; + harfbuzz) + if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_CARBON" != "yes" ] && [ "$VAL" = "yes" ]; then + CFG_MAC_HARFBUZZ="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; framework) if [ "$PLATFORM_MAC" = "yes" ] || [ "$PLATFORM_QPA" = "yes" ]; then @@ -4257,6 +4265,11 @@ Qt/Mac only: -sdk ......... Build Qt using Apple provided SDK . This option requires gcc 4. To use a different SDK with gcc 3.3, set the SDKROOT environment variable. + -harfbuzz .......... Use HarfBuzz to do text layout instead of Core Text when possible. + It is only available to Cocoa builds. + * -no-harfbuzz ....... Disable HarfBuzz on Mac. It can still be enabled by setting + QT_ENABLE_HARFBUZZ environment variable. + EOF fi @@ -4921,7 +4934,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; -e "s,@QT_INSTALL_BINS@,\$(INSTALL_ROOT)$QMAKE_BIN_DIR,g" \ -e "s,@QT_INSTALL_DATA@,\$(INSTALL_ROOT)$QMAKE_DATA_DIR,g" \ -e "s,@QMAKE_QTOBJS@,$EXTRA_OBJS,g" -e "s,@QMAKE_QTSRCS@,$EXTRA_SRCS,g" \ - -e "s,@QMAKESPEC@,$adjqmakespec,g" "$in_mkfile" >>"$mkfile" + -e "s,@QMAKESPEC@,$adjqmakespec,g" -e "s,@QT_VERSION@,$QT_VERSION,g" "$in_mkfile" >>"$mkfile" if "$WHICH" makedepend >/dev/null 2>&1 && grep 'depend:' "$mkfile" >/dev/null 2>&1; then (cd "$outpath/qmake" && "$MAKE" -f "$mkfile" depend) >/dev/null 2>&1 @@ -7251,6 +7264,7 @@ fi [ "$CFG_NAS" = "system" ] && QT_CONFIG="$QT_CONFIG nas" [ "$CFG_OPENSSL" = "yes" ] && QT_CONFIG="$QT_CONFIG openssl" [ "$CFG_OPENSSL" = "linked" ] && QT_CONFIG="$QT_CONFIG openssl-linked" +[ "$CFG_MAC_HARFBUZZ" = "yes" ] && QT_CONFIG="$QT_CONFIG harfbuzz" if [ "$PLATFORM_X11" = "yes" ]; then [ "$CFG_SM" = "yes" ] && QT_CONFIG="$QT_CONFIG x11sm" @@ -8500,7 +8514,7 @@ CACHEFILE="$outpath/.qmake.cache" [ -f "$CACHEFILE.tmp" ] && rm -f "$CACHEFILE.tmp" cat >>"$CACHEFILE.tmp" <.depends variable QT = $$resolve_depends($$QT, "QT.") + QT_DEPENDS= +unset(using_privates) for(QTLIB, $$list($$lower($$unique(QT)))) { + # Figure out if we're wanting to use the private headers of a module + contains(QTLIB, .*-private) { + QTLIB ~= s/-private// + use_private = UsePrivate + } else { + use_private = NoPrivate + } + isEmpty(QT.$${QTLIB}.name) { message("Warning: unknown QT module: $$QTLIB") next() @@ -141,14 +153,21 @@ for(QTLIB, $$list($$lower($$unique(QT)))) { warning($$TARGET cannot have a QT of $$QTLIB) next() } - qtAddModule($$QTLIB) + qtAddModule($$QTLIB, $$use_private) QT_DEPENDS += $$eval(QT.$${QTLIB}.depends) + isEqual(use_private, UsePrivate):using_privates = true } # add include paths for all .depends, since module/application might need f.ex. template specializations etc. QT_DEPENDS -= $$QT for(QTLIB, $$list($$lower($$unique(QT_DEPENDS)))):INCLUDEPATH += $$INCLUDEPATH $$eval(QT.$${QTLIB}.includes) +!isEmpty(using_privates):!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) { + message("This project is using private headers and will therefore be tied to this specific Qt module build version.") + message("Running this project against other versions of the Qt modules may crash at any arbitrary point.") + message("This is not a bug, but a result of using Qt internals. You have been warned!") +} + qt_compat { !qt_compat_no_warning:QTDIR_build:warning(***USE of COMPAT inside of QTDIR!**) #just for us INCLUDEPATH *= $$QMAKE_INCDIR_QT/Qt diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf index 5afd82c84ac..071bb6c237e 100644 --- a/mkspecs/features/qt_config.prf +++ b/mkspecs/features/qt_config.prf @@ -12,7 +12,7 @@ isEmpty(QMAKE_QT_CONFIG)|!exists($$QMAKE_QT_CONFIG) { } else { debug(1, "Loaded .qconfig.pri from ($$QMAKE_QT_CONFIG)") for(dir, $$list($$unique($$list($$dirname(QMAKE_QT_CONFIG) \ - $$split($$list($$[QMAKE_MKSPECS]), $$DIRLIST_SEPARATOR))))) { + $$replace($$list($$split($$list($$(QMAKEPATH)), $$DIRLIST_SEPARATOR)), $, /mkspecs))))) { debug(1, "Loading modules from $${dir}") for(mod, $$list($$files($$dir/modules/qt_*.pri))) { # For installed Qt these paths will be common for all modules diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index b16c84864fe..50a85d86ce9 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -102,6 +102,16 @@ defineTest(qtAddModule) { INCLUDEPATH -= $$MODULE_INCLUDES INCLUDEPATH = $$MODULE_INCLUDES $$INCLUDEPATH + isEqual(2, UsePrivate) { # Tests function parameter 2 ($$2) being equal to 'UsePrivate' + # This adds both + # / + # and / + # since we have code using both #include and #include + # Both need to be supported with the new private includes structure + MODULE_INCLUDES_PRIVATES = $$eval(QT.$${1}.private_includes) + INCLUDEPATH -= $$MODULE_INCLUDES_PRIVATES $$MODULE_INCLUDES_PRIVATES/$$MODULE_NAME + INCLUDEPATH = $$MODULE_INCLUDES_PRIVATES $$MODULE_INCLUDES_PRIVATES/$$MODULE_NAME $$INCLUDEPATH + } unset(LINKAGE) mac { @@ -140,12 +150,16 @@ defineTest(qtAddModule) { } isEmpty(LINKAGE):LINKAGE = -l$${MODULE_NAME}$${QT_LIBINFIX} } - !isEmpty(QMAKE_LSB) { - QMAKE_LFLAGS *= --lsb-libpath=$$$$QMAKE_LIBDIR_QT - QMAKE_LFLAGS *= -L/opt/lsb/lib - QMAKE_LFLAGS *= --lsb-shared-libs=$${MODULE_NAME}$${QT_LIBINFIX} + # Only link to this module if a libs directory is set, else this is just a module + # to give access to sources or include files, and not for linking. + !isEmpty(MODULE_LIBS) { + !isEmpty(QMAKE_LSB) { + QMAKE_LFLAGS *= --lsb-libpath=$$$$QMAKE_LIBDIR_QT + QMAKE_LFLAGS *= -L/opt/lsb/lib + QMAKE_LFLAGS *= --lsb-shared-libs=$${MODULE_NAME}$${QT_LIBINFIX} + } + LIBS += $$LINKAGE } - LIBS += $$LINKAGE export(CONFIG) export(DEFINES) export(LIBS) diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index 9dbe035fc26..c522779981f 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -1,5 +1,6 @@ SOURCE_PATH = @SOURCE_PATH@ BUILD_PATH = @BUILD_PATH@ +QT_VERSION = @QT_VERSION@ QTOBJS = @QMAKE_QTOBJS@ QTSRCS = @QMAKE_QTSRCS@ QMAKESPEC = @QMAKESPEC@ @@ -76,6 +77,7 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge CPPFLAGS = -g -I. -Igenerators -Igenerators/unix -Igenerators/win32 \ -Igenerators/mac -Igenerators/symbian -Igenerators/integrity \ -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \ + -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION) -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION)/QtCore \ -I$(BUILD_PATH)/src/corelib/global -I$(BUILD_PATH)/src/corelib/xml \ -I$(SOURCE_PATH)/tools/shared \ -DQT_NO_PCRE \ diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 6fd393993e9..56ccf3d5655 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -32,8 +32,8 @@ CFLAGS_BARE = -c -Fo./ \ -W3 -nologo -O2 \ $(CFLAGS_EXTRA) \ -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian -Igenerators\integrity \ - -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \ - -I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore \ + -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION) -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION)\QtCore \ + -I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore -I$(SOURCE_PATH)\include\QtCore\$(QT_VERSION) -I$(SOURCE_PATH)\include\QtCore\$(QT_VERSION)\QtCore \ -I$(BUILD_PATH)\src\corelib\global \ -I$(BUILD_PATH)\src\corelib\xml \ -I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \ diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index d40dc29a9b8..05d7a154d68 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -16,8 +16,8 @@ CFLAGS = -c -o$@ -O \ -I. -Igenerators -Igenerators/unix \ -Igenerators/win32 -Igenerators/mac \ -Igenerators/symbian -Igenerators/integrity \ - -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \ - -I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \ + -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION) -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION)/QtCore \ + -I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore -I$(SOURCE_PATH)/include/QtCore/$(QT_VERSION) -I$(SOURCE_PATH)/include/QtCore/$(QT_VERSION)/QtCore \ -I$(BUILD_PATH)/src/corelib/global \ -I$(BUILD_PATH)/src/corelib/xml \ -I$(SOURCE_PATH)/mkspecs/win32-g++ \ diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh index 49ccfbcc77b..b691470cca8 100644 --- a/qmake/Makefile.win32-g++-sh +++ b/qmake/Makefile.win32-g++-sh @@ -16,8 +16,8 @@ CFLAGS = -c -o$@ -O \ -I. -Igenerators -Igenerators/unix \ -Igenerators/win32 -Igenerators/mac \ -Igenerators/symbian -Igenerators/integrity \ - -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \ - -I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \ + -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION) -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION)/QtCore \ + -I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore -I$(SOURCE_PATH)/include/QtCore/$(QT_VERSION) -I$(SOURCE_PATH)/include/QtCore/$(QT_VERSION)/QtCore \ -I$(BUILD_PATH)/src/corelib/global \ -I$(BUILD_PATH)/src/corelib/xml \ -I$(SOURCE_PATH)/mkspecs/win32-g++ \ diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 61e7ac55ca2..47ae384ba90 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2376,6 +2376,14 @@ MakefileGenerator::writeSubDirs(QTextStream &t) qDeleteAll(targets); } +void MakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &callPrefix, + const QString &makeArguments, const QString &callPostfix) +{ + t << callPrefix + << "$(MAKE)" << makeArguments + << callPostfix << endl; +} + void MakefileGenerator::writeSubTargets(QTextStream &t, QList targets, int flags) { @@ -2499,9 +2507,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListdepends); if(project->isEmpty("QMAKE_NOFORCE")) t << " FORCE"; - t << out_directory_cdin - << "$(MAKE)" << makefilein - << out_directory_cdout << endl; + writeSubMakeCall(t, out_directory_cdin, makefilein, out_directory_cdout); } for(int suffix = 0; suffix < targetSuffixes.size(); ++suffix) { @@ -2521,9 +2527,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListtarget << "-" << targetSuffixes.at(suffix) << "-ordered "; if(project->isEmpty("QMAKE_NOFORCE")) t << " FORCE"; - t << out_directory_cdin - << "$(MAKE)" << makefilein << " " << s - << out_directory_cdout << endl; + writeSubMakeCall(t, out_directory_cdin, makefilein, out_directory_cdout); } t << subtarget->target << "-" << targetSuffixes.at(suffix) << ": " << mkfile; if(!subtarget->depends.isEmpty()) @@ -2531,9 +2535,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListisEmpty("QMAKE_NOFORCE")) t << " FORCE"; - t << out_directory_cdin - << "$(MAKE)" << makefilein << " " << s - << out_directory_cdout << endl; + writeSubMakeCall(t, out_directory_cdin, makefilein, out_directory_cdout); } } t << endl; @@ -2671,12 +2673,10 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList findSubDirsSubTargets() const; + virtual void writeSubMakeCall(QTextStream &t, const QString &outDirectory_cdin, + const QString &makeFileIn, const QString &outDirectory_cdout); void writeSubTargets(QTextStream &t, QList subtargets, int flags); //extra compiler interface diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index c55806d002b..e0e2fe0e795 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -85,6 +85,15 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) return false; } +void NmakeMakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &callPrefix, + const QString &makeArguments, const QString &callPostfix) +{ + // Pass MAKEFLAGS as environment variable to sub-make calls. + // Unlike other make tools nmake doesn't do this automatically. + t << "\n\t@set MAKEFLAGS=$(MAKEFLAGS)"; + Win32MakefileGenerator::writeSubMakeCall(t, callPrefix, makeArguments, callPostfix); +} + QString NmakeMakefileGenerator::getPdbTarget() { return QString(project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".pdb"); diff --git a/qmake/generators/win32/msvc_nmake.h b/qmake/generators/win32/msvc_nmake.h index 8954655672b..689cc19479e 100644 --- a/qmake/generators/win32/msvc_nmake.h +++ b/qmake/generators/win32/msvc_nmake.h @@ -57,6 +57,8 @@ class NmakeMakefileGenerator : public Win32MakefileGenerator void init(); protected: + virtual void writeSubMakeCall(QTextStream &t, const QString &callPrefix, + const QString &makeArguments, const QString &callPostfix); virtual QString getPdbTarget(); virtual QString defaultInstall(const QString &t); virtual QStringList &findDependencies(const QString &file); diff --git a/qmake/qmake.pro b/qmake/qmake.pro index b602afa1981..ac52bd8dd0e 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -27,6 +27,8 @@ INCLUDEPATH += . \ generators/symbian \ $$QT_SOURCE_TREE/include \ $$QT_SOURCE_TREE/include/QtCore \ + $$QT_SOURCE_TREE/include/QtCore/$$QT_VERSION \ + $$QT_SOURCE_TREE/include/QtCore/$$QT_VERSION/QtCore \ $$QT_SOURCE_TREE/qmake VPATH += $$QT_SOURCE_TREE/tools/shared diff --git a/qtbase.pro b/qtbase.pro index d3ca3e1d9ac..7e334501aeb 100644 --- a/qtbase.pro +++ b/qtbase.pro @@ -122,6 +122,12 @@ win32 { } INSTALLS += qmake +#syncqt +syncqt.path=$$[QT_INSTALL_BINS] +syncqt.files=$$QT_BUILD_TREE/bin/syncqt +win32:syncqt.files=$$QT_BUILD_TREE/bin/syncqt.bat +INSTALLS += syncqt + #mkspecs mkspecs.path=$$[QT_INSTALL_DATA]/mkspecs mkspecs.files=$$QT_BUILD_TREE/mkspecs/qconfig.pri $$files($$QT_SOURCE_TREE/mkspecs/*) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 602cf8a6fdd..7d74de8e44b 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -201,16 +201,17 @@ void QUnifiedTimer::ensureTimerUpdate() { QUnifiedTimer *inst = QUnifiedTimer::instance(false); if (inst && inst->isPauseTimerActive) - inst->updateAnimationsTime(); + inst->updateAnimationsTime(-1); } -void QUnifiedTimer::updateAnimationsTime() +void QUnifiedTimer::updateAnimationsTime(qint64 timeStep) { //setCurrentTime can get this called again while we're the for loop. At least with pauseAnimations if(insideTick) return; - qint64 totalElapsed = time.elapsed(); + qint64 totalElapsed = timeStep >= 0 ? timeStep : time.elapsed(); + // ignore consistentTiming in case the pause timer is active int delta = (consistentTiming && !isPauseTimerActive) ? timingInterval : totalElapsed - lastTick; @@ -260,7 +261,8 @@ void QUnifiedTimer::restartAnimationTimer() } else if (!driver->isRunning() || isPauseTimerActive) { driver->start(); isPauseTimerActive = false; - } + } else if (runningLeafAnimations == 0) + driver->stop(); } void QUnifiedTimer::setTimingInterval(int interval) @@ -302,7 +304,7 @@ void QUnifiedTimer::timerEvent(QTimerEvent *event) if (event->timerId() == animationTimer.timerId()) { // update current time on all top level animations - updateAnimationsTime(); + updateAnimationsTime(-1); restartAnimationTimer(); } } @@ -389,19 +391,49 @@ int QUnifiedTimer::closestPauseAnimationTimeToFinish() return closestTimeToFinish; } + void QUnifiedTimer::installAnimationDriver(QAnimationDriver *d) { - if (driver->isRunning()) { - qWarning("QUnifiedTimer: Cannot change animation driver while animations are running"); + if (driver != &defaultDriver) { + qWarning("QUnifiedTimer: animation driver already installed..."); return; } - if (driver && driver != &defaultDriver) - delete driver; + if (driver->isRunning()) { + driver->stop(); + d->start(); + } driver = d; + } + +void QUnifiedTimer::uninstallAnimationDriver(QAnimationDriver *d) +{ + if (driver != d) { + qWarning("QUnifiedTimer: trying to uninstall a driver that is not installed..."); + return; + } + + driver = &defaultDriver; + + if (d->isRunning()) { + d->stop(); + driver->start(); + } +} + +/*! + Returns true if \a d is the currently installed animation driver + and is not the default animation driver (which can never be uninstalled). +*/ +bool QUnifiedTimer::canUninstallAnimationDriver(QAnimationDriver *d) +{ + return d == driver && driver != &defaultDriver; +} + + /*! \class QAnimationDriver @@ -424,35 +456,69 @@ QAnimationDriver::QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent) { } +QAnimationDriver::~QAnimationDriver() +{ + QUnifiedTimer *timer = QUnifiedTimer::instance(true); + if (timer->canUninstallAnimationDriver(this)) + uninstall(); +} + + /*! - Advances the animation based on the current time. This function should - be continuously called by the driver while the animation is running. + Advances the animation based to the specified \a timeStep. This function should + be continuously called by the driver subclasses while the animation is running. - \internal + If \a timeStep is positive, it will be used as the current time in the + calculations; otherwise, the current clock time will be used. */ -void QAnimationDriver::advance() + +void QAnimationDriver::advanceAnimation(qint64 timeStep) { QUnifiedTimer *instance = QUnifiedTimer::instance(); // update current time on all top level animations - instance->updateAnimationsTime(); + instance->updateAnimationsTime(timeStep); instance->restartAnimationTimer(); } + +/*! + Advances the animation. This function should be continously called + by the driver while the animation is running. + */ + +void QAnimationDriver::advance() +{ + advanceAnimation(-1); +} + + + /*! Installs this animation driver. The animation driver is thread local and will only apply for the thread its installed in. - - \internal */ + void QAnimationDriver::install() { QUnifiedTimer *timer = QUnifiedTimer::instance(true); timer->installAnimationDriver(this); } + + +/*! + Uninstalls this animation driver. + */ + +void QAnimationDriver::uninstall() +{ + QUnifiedTimer *timer = QUnifiedTimer::instance(true); + timer->uninstallAnimationDriver(this); +} + bool QAnimationDriver::isRunning() const { return d_func()->running; @@ -463,7 +529,7 @@ void QAnimationDriver::start() { Q_D(QAnimationDriver); if (!d->running) { - started(); + emit started(); d->running = true; } } @@ -473,16 +539,28 @@ void QAnimationDriver::stop() { Q_D(QAnimationDriver); if (d->running) { - stopped(); + emit stopped(); d->running = false; } } + +/*! + \fn qint64 QAnimationDriver::elapsed() const + + Returns the number of milliseconds since the animations was started. + */ + +qint64 QAnimationDriver::elapsed() const +{ + return QUnifiedTimer::instance()->time.elapsed(); +} + /*! \fn QAnimationDriver::started() - This function is called by the animation framework to notify the driver - that it should start running. + This signal is emitted by the animation framework to notify the driver + that continous animation has started. \internal */ @@ -490,8 +568,8 @@ void QAnimationDriver::stop() /*! \fn QAnimationDriver::stopped() - This function is called by the animation framework to notify the driver - that it should stop running. + This signal is emitted by the animation framework to notify the driver + that continous animation has stopped. \internal */ diff --git a/src/corelib/animation/qabstractanimation.h b/src/corelib/animation/qabstractanimation.h index 0900870ce2e..91282066a69 100644 --- a/src/corelib/animation/qabstractanimation.h +++ b/src/corelib/animation/qabstractanimation.h @@ -141,23 +141,31 @@ class Q_CORE_EXPORT QAnimationDriver : public QObject public: QAnimationDriver(QObject *parent = 0); + ~QAnimationDriver(); + + virtual void advance(); - void advance(); void install(); + void uninstall(); bool isRunning() const; + qint64 elapsed() const; + +Q_SIGNALS: + void started(); + void stopped(); + protected: - virtual void started() {}; - virtual void stopped() {}; + void advanceAnimation(qint64 timeStep = -1); + virtual void start(); + virtual void stop(); QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent = 0); private: friend class QUnifiedTimer; - void start(); - void stop(); }; diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h index ba92960f6b0..de269877211 100644 --- a/src/corelib/animation/qabstractanimation_p.h +++ b/src/corelib/animation/qabstractanimation_p.h @@ -180,15 +180,21 @@ public: static void updateAnimationTimer(); void installAnimationDriver(QAnimationDriver *driver); + void uninstallAnimationDriver(QAnimationDriver *driver); + bool canUninstallAnimationDriver(QAnimationDriver *driver); void restartAnimationTimer(); - void updateAnimationsTime(); + void updateAnimationsTime(qint64 timeStep); + + //useful for profiling/debugging + int runningAnimationCount() { return animations.count(); } protected: void timerEvent(QTimerEvent *); private: friend class QDefaultAnimationDriver; + friend class QAnimationDriver; QAnimationDriver *driver; QDefaultAnimationDriver defaultDriver; diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 4efb1b9a229..a31d1e5b7f8 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -1,7 +1,11 @@ -MODULE = core TARGET = QtCore QPRO_PWD = $$PWD QT = + +CONFIG += module +MODULE = core # not corelib, as per project file +MODULE_PRI = ../modules/qt_core.pri + DEFINES += QT_BUILD_CORE_LIB QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000 irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 9434eb29f7a..0c861990fad 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1843,6 +1843,10 @@ inline QT3_SUPPORT void qSuppressObsoleteWarnings(bool = true) {} inline QT3_SUPPORT void qObsolete(const char *, const char * = 0, const char * = 0) {} #endif +#if !defined(Q_UNIMPLEMENTED) +# define Q_UNIMPLEMENTED() qWarning("%s:%d: %s: Unimplemented code.", __FILE__, __LINE__, Q_FUNC_INFO) +#endif + #if defined(QT_NO_THREAD) template @@ -2755,7 +2759,8 @@ QT_LICENSED_MODULE(DBus) #if !(defined(Q_WS_WIN) && !defined(Q_WS_WINCE)) \ && !(defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)) \ - && !(defined(Q_WS_X11) && !defined(QT_NO_FREETYPE)) + && !(defined(Q_WS_X11) && !defined(QT_NO_FREETYPE)) \ + && !(defined(Q_WS_QPA)) # define QT_NO_RAWFONT #endif diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 82c6ebad059..1dbc40f3ed2 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -583,6 +583,7 @@ QString QFileSystemEngine::owner(const QFileSystemEntry &entry, QAbstractFileEng } } #else + Q_UNUSED(entry); Q_UNUSED(own); #endif return name; diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 3af9b46df83..f53742b8150 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -171,17 +171,27 @@ private: Q_GLOBAL_STATIC(QMutex, processManagerGlobalMutex) -static QProcessManager *processManager() { +static QProcessManager *processManagerInstance = 0; + +static QProcessManager *processManager() +{ // The constructor of QProcessManager should be called only once // so we cannot use Q_GLOBAL_STATIC directly for QProcessManager QMutex *mutex = processManagerGlobalMutex(); QMutexLocker locker(mutex); - static QProcessManager processManager; - return &processManager; + + if (!processManagerInstance) + QProcessPrivate::initializeProcessManager(); + + Q_ASSERT(processManagerInstance); + return processManagerInstance; } QProcessManager::QProcessManager() { + // can only be called from main thread + Q_ASSERT(!qApp || qApp->thread() == QThread::currentThread()); + #if defined (QPROCESS_DEBUG) qDebug() << "QProcessManager::QProcessManager()"; #endif @@ -197,6 +207,8 @@ QProcessManager::QProcessManager() action.sa_handler = qt_sa_sigchld_handler; action.sa_flags = SA_NOCLDSTOP; ::sigaction(SIGCHLD, &action, &qt_sa_old_sigchld_handler); + + processManagerInstance = this; } QProcessManager::~QProcessManager() @@ -221,6 +233,8 @@ QProcessManager::~QProcessManager() if (currentAction.sa_handler == qt_sa_sigchld_handler) { ::sigaction(SIGCHLD, &qt_sa_old_sigchld_handler, 0); } + + processManagerInstance = 0; } void QProcessManager::run() @@ -1287,7 +1301,15 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a void QProcessPrivate::initializeProcessManager() { - (void) processManager(); + if (qApp && qApp->thread() != QThread::currentThread()) { + // The process manager must be initialized in the main thread + // Note: The call below will re-enter this function, but in the right thread, + // so the else statement below will be executed. + QMetaObject::invokeMethod(qApp, "_q_initializeProcessManager", Qt::BlockingQueuedConnection); + } else { + static QProcessManager processManager; + Q_UNUSED(processManager); + } } QT_END_NAMESPACE diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index be86c58d472..e0841cbadca 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -392,6 +392,16 @@ void QCoreApplicationPrivate::createEventDispatcher() #endif } +void QCoreApplicationPrivate::_q_initializeProcessManager() +{ +#ifndef QT_NO_PROCESS +# ifdef Q_OS_UNIX + QProcessPrivate::initializeProcessManager(); +# endif +#endif +} + + QThread *QCoreApplicationPrivate::theMainThread = 0; QThread *QCoreApplicationPrivate::mainThread() { @@ -656,12 +666,6 @@ void QCoreApplication::init() } #endif -#if defined(Q_OS_UNIX) && !(defined(QT_NO_PROCESS)) - // Make sure the process manager thread object is created in the main - // thread. - QProcessPrivate::initializeProcessManager(); -#endif - #ifdef QT_EVAL extern void qt_core_eval_init(uint); qt_core_eval_init(d->application_type); @@ -2728,3 +2732,5 @@ int QCoreApplication::loopLevel() */ QT_END_NAMESPACE + +#include "moc_qcoreapplication.cpp" diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index 3957158d839..024c5096c98 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -205,6 +205,7 @@ protected: QCoreApplication(QCoreApplicationPrivate &p); private: + Q_PRIVATE_SLOT(d_func(), void _q_initializeProcessManager()) static bool sendSpontaneousEvent(QObject *receiver, QEvent *event); bool notifyInternal(QObject *receiver, QEvent *event); diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h index add2a3553e1..fdceab4724a 100644 --- a/src/corelib/kernel/qcoreapplication_p.h +++ b/src/corelib/kernel/qcoreapplication_p.h @@ -85,6 +85,8 @@ public: bool sendThroughObjectEventFilters(QObject *, QEvent *); bool notify_helper(QObject *, QEvent *); + void _q_initializeProcessManager(); + virtual QString appName() const; virtual void createEventDispatcher(); static void removePostedEvent(QEvent *); diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index 08c9ea1fb23..e73fa05a748 100644 --- a/src/dbus/dbus.pro +++ b/src/dbus/dbus.pro @@ -1,8 +1,11 @@ TARGET = QtDBus QPRO_PWD = $$PWD -QT = core \ +QT = core-private \ xml -CONFIG += link_pkgconfig + +CONFIG += link_pkgconfig module +MODULE_PRI = ../modules/qt_dbus.pri + DEFINES += QT_BUILD_DBUS_LIB \ DBUS_API_SUBJECT_TO_CHANGE QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 8f72fead8d0..072553a05cf 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -1,6 +1,10 @@ TARGET = QtGui QPRO_PWD = $$PWD -QT = core +QT = core-private + +CONFIG += module +MODULE_PRI = ../modules/qt_gui.pri + DEFINES += QT_BUILD_GUI_LIB QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000 irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 0a033972510..72a05afbd08 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -237,6 +237,7 @@ static void resolveAygLibs() # define FE_FONTSMOOTHINGCLEARTYPE 0x0002 #endif +Q_GUI_EXPORT qreal qt_fontsmoothing_gamma; Q_GUI_EXPORT bool qt_cleartype_enabled; Q_GUI_EXPORT bool qt_win_owndc_required; // CS_OWNDC is required if we use the GL graphicssystem as default @@ -653,8 +654,18 @@ static void qt_win_read_cleartype_settings() if (SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &result, 0)) qt_cleartype_enabled = (result == FE_FONTSMOOTHINGCLEARTYPE); #endif -} + int winSmooth; + if (SystemParametersInfo(0x200C /* SPI_GETFONTSMOOTHINGCONTRAST */, 0, &winSmooth, 0)) { + qt_fontsmoothing_gamma = winSmooth / qreal(1000.0); + } else { + qt_fontsmoothing_gamma = 1.0; + } + + // Safeguard ourselves against corrupt registry values... + if (qt_fontsmoothing_gamma > 5 || qt_fontsmoothing_gamma < 1) + qt_fontsmoothing_gamma = qreal(1.4); +} static void qt_set_windows_resources() { diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index b5e5d186b86..e885d1552c0 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -334,7 +334,6 @@ static int qCocoaViewCount = 0; // // Qt will then forward the update to the children. if (qwidget->isWindow()) { - qwidget->update(qwidget->rect()); qwidgetprivate->syncBackingStore(qwidget->rect()); } } diff --git a/src/gui/kernel/qdesktopwidget_qpa.cpp b/src/gui/kernel/qdesktopwidget_qpa.cpp index cff05f58368..6257a8bc06c 100644 --- a/src/gui/kernel/qdesktopwidget_qpa.cpp +++ b/src/gui/kernel/qdesktopwidget_qpa.cpp @@ -51,6 +51,8 @@ QT_USE_NAMESPACE void QDesktopWidgetPrivate::updateScreenList() { + Q_Q(QDesktopWidget); + QList screenList = QApplicationPrivate::platformIntegration()->screens(); int targetLength = screenList.length(); int currentLength = screens.length(); @@ -72,19 +74,15 @@ void QDesktopWidgetPrivate::updateScreenList() } QRegion virtualGeometry; - bool doVirtualGeometry = QApplicationPrivate::platformIntegration()->isVirtualDesktop(); // update the geometry of each screen widget for (int i = 0; i < screens.length(); i++) { QRect screenGeometry = screenList.at(i)->geometry(); screens.at(i)->setGeometry(screenGeometry); - if (doVirtualGeometry) - virtualGeometry += screenGeometry; + virtualGeometry += screenGeometry; } - virtualScreen.setGeometry(virtualGeometry.boundingRect()); - Q_Q(QDesktopWidget); - q->setGeometry(virtualScreen.geometry()); + q->setGeometry(virtualGeometry.boundingRect()); } QDesktopWidget::QDesktopWidget() @@ -118,8 +116,6 @@ int QDesktopWidget::numScreens() const QWidget *QDesktopWidget::screen(int screen) { Q_D(QDesktopWidget); - if (QApplicationPrivate::platformIntegration()->isVirtualDesktop()) - return &d->virtualScreen; if (screen < 0 || screen >= d->screens.length()) return d->screens.at(0); return d->screens.at(screen); diff --git a/src/gui/kernel/qdesktopwidget_qpa_p.h b/src/gui/kernel/qdesktopwidget_qpa_p.h index abee8a101e3..d6ed686a3fb 100644 --- a/src/gui/kernel/qdesktopwidget_qpa_p.h +++ b/src/gui/kernel/qdesktopwidget_qpa_p.h @@ -76,7 +76,6 @@ public: void updateScreenList(); QList screens; - QDesktopScreenWidget virtualScreen; }; #endif // QDESKTOPWIDGET_QPA_P_H diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp index d559c53355b..8ff12ebf9cf 100644 --- a/src/gui/kernel/qplatformintegration_qpa.cpp +++ b/src/gui/kernel/qplatformintegration_qpa.cpp @@ -214,6 +214,7 @@ QPlatformNativeInterface * QPlatformIntegration::nativeInterface() const bool QPlatformIntegration::hasCapability(Capability cap) const { + Q_UNUSED(cap); return false; } diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp index 19bf7a9f294..f3654b676d6 100644 --- a/src/gui/kernel/qplatformwindow_qpa.cpp +++ b/src/gui/kernel/qplatformwindow_qpa.cpp @@ -150,7 +150,7 @@ void QPlatformWindow::setParent(const QPlatformWindow *parent) /*! Reimplement to set the window title to \a title */ -void QPlatformWindow::setWindowTitle(const QString &title) {} +void QPlatformWindow::setWindowTitle(const QString &) {} /*! Reimplement to be able to let Qt rais windows to the top of the desktop diff --git a/src/gui/kernel/qsessionmanager_qpa.cpp b/src/gui/kernel/qsessionmanager_qpa.cpp index ef532d79812..68685b4fed0 100644 --- a/src/gui/kernel/qsessionmanager_qpa.cpp +++ b/src/gui/kernel/qsessionmanager_qpa.cpp @@ -42,6 +42,8 @@ #include #include +#include + #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 5e75e4a8844..3553b6064dd 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -7198,14 +7198,8 @@ void qt_build_pow_tables() { #endif #ifdef Q_WS_WIN - int winSmooth; - if (SystemParametersInfo(0x200C /* SPI_GETFONTSMOOTHINGCONTRAST */, 0, &winSmooth, 0)) - smoothing = winSmooth / qreal(1000.0); - - // Safeguard ourselves against corrupt registry values... - if (smoothing > 5 || smoothing < 1) - smoothing = qreal(1.4); - + extern qreal qt_fontsmoothing_gamma; // qapplication_win.cpp + smoothing = qt_fontsmoothing_gamma; #endif #ifdef Q_WS_X11 diff --git a/src/gui/painting/qpaintengine_mac.cpp b/src/gui/painting/qpaintengine_mac.cpp index 8aab7c7a4b7..c6d061dea87 100644 --- a/src/gui/painting/qpaintengine_mac.cpp +++ b/src/gui/painting/qpaintengine_mac.cpp @@ -100,7 +100,9 @@ QMacCGContext::QMacCGContext(QPainter *p) int devType = p->device()->devType(); if (pe->type() == QPaintEngine::Raster - && (devType == QInternal::Widget || devType == QInternal::Pixmap)) { + && (devType == QInternal::Widget || + devType == QInternal::Pixmap || + devType == QInternal::Image)) { extern CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintDevice); CGColorSpaceRef colorspace = qt_mac_colorSpaceForDeviceType(pe->paintDevice()); diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 9fafba5f4ff..b7686fa7feb 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -156,7 +156,8 @@ static bool qt_paintengine_supports_transformations(QPaintEngine::Type type) { return type == QPaintEngine::OpenGL2 || type == QPaintEngine::OpenVG - || type == QPaintEngine::OpenGL; + || type == QPaintEngine::OpenGL + || type == QPaintEngine::CoreGraphics; } #ifndef QT_NO_DEBUG @@ -5809,7 +5810,7 @@ void QPainter::drawGlyphs(const QPointF &position, const QGlyphs &glyphs) bool paintEngineSupportsTransformations = d->extended != 0 ? qt_paintengine_supports_transformations(d->extended->type()) - : false; + : qt_paintengine_supports_transformations(d->engine->type()); for (int i=0; i QTransform::TxTranslate) { + if (m_transform.type() > QTransform::TxTranslate && m_current_fontengine->type() == QFontEngine::Freetype) { QFontEngineFT::GlyphFormat format = QFontEngineFT::Format_None; QImage::Format imageFormat = QImage::Format_Invalid; switch (m_type) { diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h index 8dbc7468130..0c7b6f8de80 100644 --- a/src/gui/text/qfont.h +++ b/src/gui/text/qfont.h @@ -239,7 +239,7 @@ public: bool isCopyOf(const QFont &) const; #ifdef Q_COMPILER_RVALUE_REFS inline QFont &operator=(QFont &&other) - { qSwap(d, other.d); return *this; } + { qSwap(d, other.d); qSwap(resolve_mask, other.resolve_mask); return *this; } #endif #ifdef Q_WS_WIN diff --git a/src/gui/text/qfont_mac.cpp b/src/gui/text/qfont_mac.cpp index daf68c03ea8..044fd84a8b3 100644 --- a/src/gui/text/qfont_mac.cpp +++ b/src/gui/text/qfont_mac.cpp @@ -43,6 +43,7 @@ #include "qfont_p.h" #include "qfontengine_p.h" #include "qfontengine_mac_p.h" +#include "qfontengine_coretext_p.h" #include "qfontinfo.h" #include "qfontmetrics.h" #include "qpaintdevice.h" @@ -119,10 +120,10 @@ quint32 QFont::macFontID() const // ### need 64-bit version // Returns an ATSUFonFamilyRef Qt::HANDLE QFont::handle() const { -#if 0 +#ifdef QT_MAC_USE_COCOA QFontEngine *fe = d->engineForScript(QUnicodeTables::Common); - if (fe && fe->type() == QFontEngine::Mac) - return (Qt::HANDLE)static_cast(fe)->fontFamilyRef(); + if (fe && fe->type() == QFontEngine::Multi) + return (Qt::HANDLE)static_cast(fe)->macFontID(); #endif return 0; } diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm index 20b37300fa7..d4df2183ed8 100644 --- a/src/gui/text/qfontengine_coretext.mm +++ b/src/gui/text/qfontengine_coretext.mm @@ -162,8 +162,10 @@ uint QCoreTextFontEngineMulti::fontIndexForFont(CTFontRef font) const return engines.count() - 1; } -bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags, - unsigned short *logClusters, const HB_CharAttributes *) const +bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, + int *nglyphs, QTextEngine::ShaperFlags flags, + unsigned short *logClusters, const HB_CharAttributes *, + QScriptItem *si) const { QCFType cfstring = CFStringCreateWithCharactersNoCopy(0, reinterpret_cast(str), @@ -180,6 +182,8 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); typeSetter = CTTypesetterCreateWithAttributedStringAndOptions(attributedString, options); } else +#else + Q_UNUSED(flags); #endif typeSetter = CTTypesetterCreateWithAttributedString(attributedString); @@ -219,6 +223,25 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay Q_ASSERT((CTRunGetStatus(run) & kCTRunStatusRightToLeft) == rtl); CFRange stringRange = CTRunGetStringRange(run); + int prepend = 0; +#if MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_5 + UniChar beginGlyph = CFStringGetCharacterAtIndex(cfstring, stringRange.location); + QChar dir = QChar::direction(beginGlyph); + bool beginWithOverride = dir == QChar::DirLRO || dir == QChar::DirRLO || dir == QChar::DirLRE || dir == QChar::DirRLE; + if (beginWithOverride) { + logClusters[stringRange.location] = 0; + outGlyphs[0] = 0xFFFF; + outAdvances_x[0] = 0; + outAdvances_y[0] = 0; + outAttributes[0].clusterStart = true; + outAttributes[0].dontPrint = true; + outGlyphs++; + outAdvances_x++; + outAdvances_y++; + outAttributes++; + prepend = 1; + } +#endif UniChar endGlyph = CFStringGetCharacterAtIndex(cfstring, stringRange.location + stringRange.length - 1); bool endWithPDF = QChar::direction(endGlyph) == QChar::DirPDF; if (endWithPDF) @@ -233,7 +256,12 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay if (!runAttribs) runAttribs = attributeDict; CTFontRef runFont = static_cast(CFDictionaryGetValue(runAttribs, NSFontAttributeName)); - const uint fontIndex = (fontIndexForFont(runFont) << 24); + uint fontIndex = fontIndexForFont(runFont); + const QFontEngine *engine = engineAt(fontIndex); + fontIndex <<= 24; + si->ascent = qMax(engine->ascent(), si->ascent); + si->descent = qMax(engine->descent(), si->descent); + si->leading = qMax(engine->leading(), si->leading); //NSLog(@"Run Font Name = %@", CTFontCopyFamilyName(runFont)); if (endWithPDF) glyphCount--; @@ -271,9 +299,9 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay CFIndex k = 0; CFIndex i = 0; - for (i = stringRange.location; + for (i = stringRange.location + prepend; (i < stringRange.location + stringRange.length) && (k < glyphCount); ++i) { - if (tmpIndices[k * rtlSign + rtlOffset] == i || i == stringRange.location) { + if (tmpIndices[k * rtlSign + rtlOffset] == i || i == stringRange.location + prepend) { logClusters[i] = k + firstGlyphIndex; outAttributes[k].clusterStart = true; ++k; @@ -308,7 +336,7 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay : QFixed::fromReal(lastGlyphAdvance.width); if (endWithPDF) { - logClusters[stringRange.location + stringRange.length - 1] = glyphCount; + logClusters[stringRange.location + stringRange.length - 1] = glyphCount + prepend; outGlyphs[glyphCount] = 0xFFFF; outAdvances_x[glyphCount] = 0; outAdvances_y[glyphCount] = 0; @@ -837,6 +865,15 @@ QFixed QCoreTextFontEngine::emSquareSize() const return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont))); } +QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const +{ + QFontDef newFontDef = fontDef; + newFontDef.pixelSize = pixelSize; + newFontDef.pointSize = pixelSize * 72.0 / qt_defaultDpi(); + + return new QCoreTextFontEngine(cgFont, fontDef); +} + QT_END_NAMESPACE #endif// !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) diff --git a/src/gui/text/qfontengine_coretext_p.h b/src/gui/text/qfontengine_coretext_p.h index 1503c3f73fe..3775bc6002a 100644 --- a/src/gui/text/qfontengine_coretext_p.h +++ b/src/gui/text/qfontengine_coretext_p.h @@ -91,6 +91,8 @@ public: virtual qreal minLeftBearing() const; virtual QFixed emSquareSize() const; + virtual QFontEngine *cloneWithSize(qreal pixelSize) const; + private: friend class QRawFontPrivate; @@ -118,9 +120,12 @@ public: QTextEngine::ShaperFlags flags) const; bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags, - unsigned short *logClusters, const HB_CharAttributes *charAttributes) const; + unsigned short *logClusters, const HB_CharAttributes *charAttributes, + QScriptItem *si) const; virtual const char *name() const { return "CoreText"; } + inline CTFontRef macFontID() const { return ctfont; } + protected: virtual void loadEngine(int at); diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 8f2da9b7130..4dae2a37841 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -803,106 +803,6 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags, return load_flags; } -QFontEngineFT::Glyph *QFontEngineFT::loadGlyphMetrics(QGlyphSet *set, uint glyph, GlyphFormat format) const -{ - Glyph *g = set->getGlyph(glyph); - if (g && g->format == format) - return g; - - bool hsubpixel = false; - int vfactor = 1; - int load_flags = loadFlags(set, format, 0, hsubpixel, vfactor); - - // apply our matrix to this, but note that the metrics will not be affected by this. - FT_Face face = lockFace(); - FT_Matrix matrix = this->matrix; - FT_Matrix_Multiply(&set->transformationMatrix, &matrix); - FT_Set_Transform(face, &matrix, 0); - freetype->matrix = matrix; - - bool transform = matrix.xx != 0x10000 || matrix.yy != 0x10000 || matrix.xy != 0 || matrix.yx != 0; - if (transform) - load_flags |= FT_LOAD_NO_BITMAP; - - FT_Error err = FT_Load_Glyph(face, glyph, load_flags); - if (err && (load_flags & FT_LOAD_NO_BITMAP)) { - load_flags &= ~FT_LOAD_NO_BITMAP; - err = FT_Load_Glyph(face, glyph, load_flags); - } - if (err == FT_Err_Too_Few_Arguments) { - // this is an error in the bytecode interpreter, just try to run without it - load_flags |= FT_LOAD_FORCE_AUTOHINT; - err = FT_Load_Glyph(face, glyph, load_flags); - } - if (err != FT_Err_Ok) - qWarning("load glyph failed err=%x face=%p, glyph=%d", err, face, glyph); - - unlockFace(); - if (set->outline_drawing) - return 0; - - if (!g) { - g = new Glyph; - g->uploadedToServer = false; - g->data = 0; - } - - FT_GlyphSlot slot = face->glyph; - if (embolden) Q_FT_GLYPHSLOT_EMBOLDEN(slot); - int left = slot->metrics.horiBearingX; - int right = slot->metrics.horiBearingX + slot->metrics.width; - int top = slot->metrics.horiBearingY; - int bottom = slot->metrics.horiBearingY - slot->metrics.height; - if (transform && slot->format != FT_GLYPH_FORMAT_BITMAP) { // freetype doesn't apply the transformation on the metrics - int l, r, t, b; - FT_Vector vector; - vector.x = left; - vector.y = top; - FT_Vector_Transform(&vector, &matrix); - l = r = vector.x; - t = b = vector.y; - vector.x = right; - vector.y = top; - FT_Vector_Transform(&vector, &matrix); - if (l > vector.x) l = vector.x; - if (r < vector.x) r = vector.x; - if (t < vector.y) t = vector.y; - if (b > vector.y) b = vector.y; - vector.x = right; - vector.y = bottom; - FT_Vector_Transform(&vector, &matrix); - if (l > vector.x) l = vector.x; - if (r < vector.x) r = vector.x; - if (t < vector.y) t = vector.y; - if (b > vector.y) b = vector.y; - vector.x = left; - vector.y = bottom; - FT_Vector_Transform(&vector, &matrix); - if (l > vector.x) l = vector.x; - if (r < vector.x) r = vector.x; - if (t < vector.y) t = vector.y; - if (b > vector.y) b = vector.y; - left = l; - right = r; - top = t; - bottom = b; - } - left = FLOOR(left); - right = CEIL(right); - bottom = FLOOR(bottom); - top = CEIL(top); - - g->linearAdvance = face->glyph->linearHoriAdvance >> 10; - g->width = TRUNC(right-left); - g->height = TRUNC(top-bottom); - g->x = TRUNC(left); - g->y = TRUNC(top); - g->advance = TRUNC(ROUND(face->glyph->advance.x)); - g->format = Format_None; - - return g; -} - QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph, QFixed subPixelPosition, GlyphFormat format, @@ -1697,7 +1597,7 @@ void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlag FT_Face face = 0; bool design = (default_hint_style == HintNone || default_hint_style == HintLight || - (flags & HB_ShaperFlag_UseDesignMetrics)); + (flags & HB_ShaperFlag_UseDesignMetrics)) && FT_IS_SCALABLE(freetype->face); for (int i = 0; i < glyphs->numGlyphs; i++) { Glyph *g = defaultGlyphSet.getGlyph(glyphs->glyphs[i]); if (g) { @@ -2069,6 +1969,41 @@ HB_Error QFontEngineFT::getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 p return result; } +bool QFontEngineFT::initFromFontEngine(const QFontEngineFT *fe) +{ + if (!init(fe->faceId(), fe->antialias, fe->defaultFormat, fe->freetype)) + return false; + + // Increase the reference of this QFreetypeFace since one more QFontEngineFT + // will be using it + freetype->ref.ref(); + + default_load_flags = fe->default_load_flags; + default_hint_style = fe->default_hint_style; + antialias = fe->antialias; + transform = fe->transform; + embolden = fe->embolden; + subpixelType = fe->subpixelType; + lcdFilterType = fe->lcdFilterType; + canUploadGlyphsToServer = fe->canUploadGlyphsToServer; + embeddedbitmap = fe->embeddedbitmap; + + return true; +} + +QFontEngine *QFontEngineFT::cloneWithSize(qreal pixelSize) const +{ + QFontDef fontDef; + fontDef.pixelSize = pixelSize; + QFontEngineFT *fe = new QFontEngineFT(fontDef); + if (!fe->initFromFontEngine(this)) { + delete fe; + return 0; + } else { + return fe; + } +} + QT_END_NAMESPACE #endif // QT_NO_FREETYPE diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 887efed8437..41064715b1e 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -122,7 +122,7 @@ struct QFreetypeFace static void addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path, bool = false); private: - friend class QFontEngineFTRawFont; + friend class QFontEngineFT; friend class QScopedPointerDeleter; QFreetypeFace() : _lock(QMutex::Recursive) {} ~QFreetypeFace() {} @@ -311,14 +311,12 @@ private: virtual HB_Error getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints); - enum HintStyle { - HintNone, - HintLight, - HintMedium, - HintFull - }; - void setDefaultHintStyle(HintStyle style); + virtual void setDefaultHintStyle(HintStyle style); + + virtual QFontEngine *cloneWithSize(qreal pixelSize) const; + bool initFromFontEngine(const QFontEngineFT *fontEngine); + HintStyle defaultHintStyle() const { return default_hint_style; } protected: @@ -345,7 +343,6 @@ protected: private: friend class QFontEngineFTRawFont; - QFontEngineFT::Glyph *loadGlyphMetrics(QGlyphSet *set, uint glyph, GlyphFormat format) const; int loadFlags(QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const; GlyphFormat defaultFormat; diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm index 673a7c86fa4..9f094ad7d12 100644 --- a/src/gui/text/qfontengine_mac.mm +++ b/src/gui/text/qfontengine_mac.mm @@ -377,7 +377,7 @@ bool QFontEngineMacMulti::stringToCMap(const QChar *str, int len, QGlyphLayout * } bool QFontEngineMacMulti::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags, - unsigned short *logClusters, const HB_CharAttributes *charAttributes) const + unsigned short *logClusters, const HB_CharAttributes *charAttributes, QScriptItem *) const { if (*nglyphs < len) { *nglyphs = len; diff --git a/src/gui/text/qfontengine_mac_p.h b/src/gui/text/qfontengine_mac_p.h index 385fa83fe9b..292ea98d9af 100644 --- a/src/gui/text/qfontengine_mac_p.h +++ b/src/gui/text/qfontengine_mac_p.h @@ -131,7 +131,7 @@ public: virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const; bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags, - unsigned short *logClusters, const HB_CharAttributes *charAttributes) const; + unsigned short *logClusters, const HB_CharAttributes *charAttributes, QScriptItem *) const; virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const; virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const; diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 5b39fd39ad3..b74371c7a8e 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -235,6 +235,8 @@ public: virtual int glyphCount() const; + virtual QFontEngine *cloneWithSize(qreal /*pixelSize*/) const { return 0; } + HB_Font harfbuzzFont() const; HB_Face harfbuzzFace() const; @@ -248,6 +250,14 @@ public: static QByteArray convertToPostscriptFontFamilyName(const QByteArray &fontFamily); + enum HintStyle { + HintNone, + HintLight, + HintMedium, + HintFull + }; + virtual void setDefaultHintStyle(HintStyle) { } + QAtomicInt ref; QFontDef fontDef; uint cache_cost; // amount of mem used in kb by the font diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index 82d9da0be94..54d7ec29804 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -1284,6 +1284,23 @@ QImage QFontEngineWin::alphaRGBMapForGlyph(glyph_t glyph, QFixed, int margin, co return rgbMask; } +// From qfontdatabase_win.cpp +extern QFontEngine *qt_load_font_engine_win(const QFontDef &request); +QFontEngine *QFontEngineWin::cloneWithSize(qreal pixelSize) const +{ + QFontDef request = fontDef; + QString actualFontName = request.family; + if (!uniqueFamilyName.isEmpty()) + request.family = uniqueFamilyName; + request.pixelSize = pixelSize; + + QFontEngine *fontEngine = qt_load_font_engine_win(request); + if (fontEngine != NULL) + fontEngine->fontDef.family = actualFontName; + + return fontEngine; +} + // -------------------------------------- Multi font engine QFontEngineMultiWin::QFontEngineMultiWin(QFontEngine *first, const QStringList &fallbacks) diff --git a/src/gui/text/qfontengine_win_p.h b/src/gui/text/qfontengine_win_p.h index 28d80008e47..114149d61f2 100644 --- a/src/gui/text/qfontengine_win_p.h +++ b/src/gui/text/qfontengine_win_p.h @@ -106,6 +106,8 @@ public: virtual QImage alphaMapForGlyph(glyph_t, const QTransform &xform); virtual QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, int margin, const QTransform &xform); + virtual QFontEngine *cloneWithSize(qreal pixelSize) const; + #ifndef Q_CC_MINGW virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0); #endif @@ -118,6 +120,7 @@ public: #endif QString _name; + QString uniqueFamilyName; HFONT hfont; LOGFONT logfont; uint stockFont : 1; diff --git a/src/gui/text/qfontengine_x11.cpp b/src/gui/text/qfontengine_x11.cpp index 9f3f8d3d9d8..4260b85b117 100644 --- a/src/gui/text/qfontengine_x11.cpp +++ b/src/gui/text/qfontengine_x11.cpp @@ -1196,6 +1196,20 @@ bool QFontEngineX11FT::uploadGlyphToServer(QGlyphSet *set, uint glyphid, Glyph * #endif } +QFontEngine *QFontEngineX11FT::cloneWithSize(qreal pixelSize) const +{ + QFontDef fontDef; + fontDef.pixelSize = pixelSize; + QFontEngineX11FT *fe = new QFontEngineX11FT(fontDef); + if (!fe->initFromFontEngine(this)) { + delete fe; + return 0; + } else { + fe->xglyph_format = xglyph_format; + return fe; + } +} + #endif // QT_NO_FONTCONFIG QT_END_NAMESPACE diff --git a/src/gui/text/qfontengine_x11_p.h b/src/gui/text/qfontengine_x11_p.h index ad68fac1670..d7eb39daaa9 100644 --- a/src/gui/text/qfontengine_x11_p.h +++ b/src/gui/text/qfontengine_x11_p.h @@ -161,6 +161,8 @@ public: explicit QFontEngineX11FT(FcPattern *pattern, const QFontDef &fd, int screen); ~QFontEngineX11FT(); + QFontEngine *cloneWithSize(qreal pixelSize) const; + #ifndef QT_NO_XRENDER int xglyph_format; #endif diff --git a/src/gui/text/qfontenginedirectwrite.cpp b/src/gui/text/qfontenginedirectwrite.cpp index f0a36448653..aab00c0db82 100644 --- a/src/gui/text/qfontenginedirectwrite.cpp +++ b/src/gui/text/qfontenginedirectwrite.cpp @@ -630,6 +630,17 @@ QFontEngine::Type QFontEngineDirectWrite::type() const return QFontEngine::DirectWrite; } +QFontEngine *QFontEngineDirectWrite::cloneWithSize(qreal pixelSize) const +{ + QFontEngine *fontEngine = new QFontEngineDirectWrite(m_directWriteFactory, m_directWriteFontFace, + pixelSize); + + fontEngine->fontDef = fontDef; + fontEngine->fontDef.pixelSize = pixelSize; + + return fontEngine; +} + QT_END_NAMESPACE #endif // QT_NO_DIRECTWRITE diff --git a/src/gui/text/qfontenginedirectwrite_p.h b/src/gui/text/qfontenginedirectwrite_p.h index c440a6ca65b..53a4b0a53d4 100644 --- a/src/gui/text/qfontenginedirectwrite_p.h +++ b/src/gui/text/qfontenginedirectwrite_p.h @@ -101,6 +101,8 @@ public: QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, int margin, const QTransform &xform); + QFontEngine *cloneWithSize(qreal pixelSize) const; + bool canRender(const QChar *string, int len); Type type() const; diff --git a/src/gui/text/qglyphs.cpp b/src/gui/text/qglyphs.cpp index b8a418de44d..cfea6ece93f 100644 --- a/src/gui/text/qglyphs.cpp +++ b/src/gui/text/qglyphs.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE /*! \class QGlyphs - \brief the QGlyphs class provides direct access to the internal glyphs in a font + \brief The QGlyphs class provides direct access to the internal glyphs in a font. \since 4.8 \ingroup text @@ -76,8 +76,8 @@ QT_BEGIN_NAMESPACE QTextLayout::glyphs() or QTextFragment::glyphs() can be used to convert unicode encoded text into a list of QGlyphs objects, and QPainter::drawGlyphs() can be used to draw the glyphs. - \note Please note that QRawFont is considered local to the thread in which it is constructed, - which in turn means that a new QRawFont will have to be created and set on the QGlyphs if it is + \note Please note that QRawFont is considered local to the thread in which it is constructed. + This in turn means that a new QRawFont will have to be created and set on the QGlyphs if it is moved to a different thread. If the QGlyphs contains a reference to a QRawFont from a different thread than the current, it will not be possible to draw the glyphs using a QPainter, as the QRawFont is considered invalid and inaccessible in this case. diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp index 6fa25e7ea2c..82ec2793b98 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.cpp +++ b/src/gui/text/qplatformfontdatabase_qpa.cpp @@ -218,6 +218,16 @@ QFontEngine *QPlatformFontDatabase::fontEngine(const QFontDef &fontDef, QUnicode return engine; } +QFontEngine *QPlatformFontDatabase::fontEngine(const QByteArray &fontData, qreal pixelSize, + QFont::HintingPreference hintingPreference) +{ + Q_UNUSED(fontData); + Q_UNUSED(pixelSize); + Q_UNUSED(hintingPreference); + qWarning("This plugin does not support font engines created directly from font data"); + return 0; +} + /*! */ diff --git a/src/gui/text/qplatformfontdatabase_qpa.h b/src/gui/text/qplatformfontdatabase_qpa.h index e0e4f04d892..046311f471d 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.h +++ b/src/gui/text/qplatformfontdatabase_qpa.h @@ -92,6 +92,8 @@ public: virtual QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName); virtual void releaseHandle(void *handle); + virtual QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference); + virtual QString fontDir() const; //callback diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp index 4a715c27cc2..46c892c5000 100644 --- a/src/gui/text/qrawfont.cpp +++ b/src/gui/text/qrawfont.cpp @@ -301,6 +301,58 @@ qreal QRawFont::descent() const return d->fontEngine->descent().toReal(); } +/*! + Returns the xHeight of this QRawFont in pixel units. + + \sa QFontMetricsF::xHeight() +*/ +qreal QRawFont::xHeight() const +{ + if (!isValid()) + return 0.0; + + return d->fontEngine->xHeight().toReal(); +} + +/*! + Returns the leading of this QRawFont in pixel units. + + \sa QFontMetricsF::leading() +*/ +qreal QRawFont::leading() const +{ + if (!isValid()) + return 0.0; + + return d->fontEngine->leading().toReal(); +} + +/*! + Returns the average character width of this QRawFont in pixel units. + + \sa QFontMetricsF::averageCharWidth() +*/ +qreal QRawFont::averageCharWidth() const +{ + if (!isValid()) + return 0.0; + + return d->fontEngine->averageCharWidth().toReal(); +} + +/*! + Returns the width of the widest character in the font. + + \sa QFontMetricsF::maxWidth() +*/ +qreal QRawFont::maxCharWidth() const +{ + if (!isValid()) + return 0.0; + + return d->fontEngine->maxCharWidth(); +} + /*! Returns the pixel size set for this QRawFont. The pixel size affects how glyphs are rasterized, the size of glyphs returned by pathForGlyph(), and is used to convert @@ -308,10 +360,10 @@ qreal QRawFont::descent() const \sa setPixelSize() */ -int QRawFont::pixelSize() const +qreal QRawFont::pixelSize() const { if (!isValid()) - return -1; + return 0.0; return d->fontEngine->fontDef.pixelSize; } @@ -577,10 +629,21 @@ QRawFont QRawFont::fromFont(const QFont &font, QFontDatabase::WritingSystem writ /*! Sets the pixel size with which this font should be rendered to \a pixelSize. */ -void QRawFont::setPixelSize(int pixelSize) +void QRawFont::setPixelSize(qreal pixelSize) { + if (d->fontEngine == 0) + return; + detach(); - d->platformSetPixelSize(pixelSize); + QFontEngine *oldFontEngine = d->fontEngine; + + d->fontEngine = d->fontEngine->cloneWithSize(pixelSize); + if (d->fontEngine != 0) + d->fontEngine->ref.ref(); + + oldFontEngine->ref.deref(); + if (oldFontEngine->cache_count == 0 && oldFontEngine->ref == 0) + delete oldFontEngine; } /*! diff --git a/src/gui/text/qrawfont.h b/src/gui/text/qrawfont.h index 96dc838ede0..900c07a7dd1 100644 --- a/src/gui/text/qrawfont.h +++ b/src/gui/text/qrawfont.h @@ -96,13 +96,17 @@ public: const QTransform &transform = QTransform()) const; QPainterPath pathForGlyph(quint32 glyphIndex) const; - void setPixelSize(int pixelSize); - int pixelSize() const; + void setPixelSize(qreal pixelSize); + qreal pixelSize() const; QFont::HintingPreference hintingPreference() const; qreal ascent() const; qreal descent() const; + qreal leading() const; + qreal xHeight() const; + qreal averageCharWidth() const; + qreal maxCharWidth() const; qreal unitsPerEm() const; diff --git a/src/gui/text/qrawfont_ft.cpp b/src/gui/text/qrawfont_ft.cpp index eefbd921180..23d47ebfb67 100644 --- a/src/gui/text/qrawfont_ft.cpp +++ b/src/gui/text/qrawfont_ft.cpp @@ -90,32 +90,6 @@ public: return init(faceId, true, Format_None, fontData); } - - bool initFromFontEngine(QFontEngine *oldFontEngine) - { - QFontEngineFT *fe = static_cast(oldFontEngine); - - // Increase the reference of this QFreetypeFace since one more QFontEngineFT - // will be using it - fe->freetype->ref.ref(); - if (!init(fe->faceId(), fe->antialias, fe->defaultFormat, fe->freetype)) - return false; - - default_load_flags = fe->default_load_flags; - default_hint_style = fe->default_hint_style; - antialias = fe->antialias; - transform = fe->transform; - embolden = fe->embolden; - subpixelType = fe->subpixelType; - lcdFilterType = fe->lcdFilterType; - canUploadGlyphsToServer = fe->canUploadGlyphsToServer; - embeddedbitmap = fe->embeddedbitmap; - -#if defined(Q_WS_X11) - xglyph_format = static_cast(fe)->xglyph_format; -#endif - return true; - } }; @@ -159,31 +133,6 @@ void QRawFontPrivate::platformLoadFromData(const QByteArray &fontData, int pixel fontEngine->ref.ref(); } -void QRawFontPrivate::platformSetPixelSize(int pixelSize) -{ - if (fontEngine == NULL) - return; - - QFontEngine *oldFontEngine = fontEngine; - - QFontDef fontDef; - fontDef.pixelSize = pixelSize; - QFontEngineFTRawFont *fe = new QFontEngineFTRawFont(fontDef); - if (!fe->initFromFontEngine(oldFontEngine)) { - delete fe; - return; - } - - fontEngine = fe; - fontEngine->fontDef = oldFontEngine->fontDef; - fontEngine->fontDef.pixelSize = pixelSize; - fontEngine->ref.ref(); - Q_ASSERT(fontEngine != oldFontEngine); - oldFontEngine->ref.deref(); - if (oldFontEngine->cache_count == 0 && oldFontEngine->ref == 0) - delete oldFontEngine; -} - QT_END_NAMESPACE #endif // QT_NO_RAWFONT diff --git a/src/gui/text/qrawfont_mac.cpp b/src/gui/text/qrawfont_mac.cpp index 56005c61f58..1ed4185a5d1 100644 --- a/src/gui/text/qrawfont_mac.cpp +++ b/src/gui/text/qrawfont_mac.cpp @@ -78,28 +78,6 @@ void QRawFontPrivate::platformLoadFromData(const QByteArray &fontData, } } -void QRawFontPrivate::platformSetPixelSize(int pixelSize) -{ - if (fontEngine == NULL) - return; - - QFontEngine *oldFontEngine = fontEngine; - - QFontDef fontDef = oldFontEngine->fontDef; - fontDef.pixelSize = pixelSize; - fontDef.pointSize = pixelSize * 72.0 / qt_defaultDpi(); - - QCoreTextFontEngine *ctFontEngine = static_cast(oldFontEngine); - Q_ASSERT(ctFontEngine->cgFont); - - fontEngine = new QCoreTextFontEngine(ctFontEngine->cgFont, fontDef); - fontEngine->ref.ref(); - Q_ASSERT(fontEngine != oldFontEngine); - oldFontEngine->ref.deref(); - if (oldFontEngine->cache_count == 0 && oldFontEngine->ref == 0) - delete oldFontEngine; -} - QT_END_NAMESPACE #endif // QT_NO_RAWFONT diff --git a/src/gui/text/qrawfont_p.h b/src/gui/text/qrawfont_p.h index f9a9ab55cdd..6c84be2d970 100644 --- a/src/gui/text/qrawfont_p.h +++ b/src/gui/text/qrawfont_p.h @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE namespace { class CustomFontFileLoader; } -class Q_AUTOTEST_EXPORT QRawFontPrivate +class Q_GUI_EXPORT QRawFontPrivate { public: QRawFontPrivate() @@ -83,7 +83,6 @@ public: , fontHandle(NULL) , ptrAddFontMemResourceEx(other.ptrAddFontMemResourceEx) , ptrRemoveFontMemResourceEx(other.ptrRemoveFontMemResourceEx) - , uniqueFamilyName(other.uniqueFamilyName) #endif { fontEngine = other.fontEngine; @@ -102,7 +101,6 @@ public: void platformLoadFromData(const QByteArray &fontData, int pixelSize, QFont::HintingPreference hintingPreference); - void platformSetPixelSize(int pixelSize); static QRawFontPrivate *get(const QRawFont &font) { return font.d.data(); } @@ -120,8 +118,6 @@ public: PtrAddFontMemResourceEx ptrAddFontMemResourceEx; PtrRemoveFontMemResourceEx ptrRemoveFontMemResourceEx; - QString uniqueFamilyName; - #endif // Q_WS_WIN }; diff --git a/src/gui/text/qrawfont_qpa.cpp b/src/gui/text/qrawfont_qpa.cpp new file mode 100644 index 00000000000..103619c37d0 --- /dev/null +++ b/src/gui/text/qrawfont_qpa.cpp @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#if !defined(QT_NO_RAWFONT) + +#include "qrawfont_p.h" +#include +#include + +QT_BEGIN_NAMESPACE + +void QRawFontPrivate::platformCleanUp() +{ +} + +void QRawFontPrivate::platformLoadFromData(const QByteArray &fontData, int pixelSize, + QFont::HintingPreference hintingPreference) +{ + Q_ASSERT(fontEngine == 0); + + QPlatformFontDatabase *pfdb = QApplicationPrivate::platformIntegration()->fontDatabase(); + fontEngine = pfdb->fontEngine(fontData, pixelSize, hintingPreference); + if (fontEngine != 0) + fontEngine->ref.ref(); +} + +QT_END_NAMESPACE + +#endif // QT_NO_RAWFONT diff --git a/src/gui/text/qrawfont_win.cpp b/src/gui/text/qrawfont_win.cpp index fb5c6f46b64..d8acf57431a 100644 --- a/src/gui/text/qrawfont_win.cpp +++ b/src/gui/text/qrawfont_win.cpp @@ -559,7 +559,7 @@ void QRawFontPrivate::platformLoadFromData(const QByteArray &_fontData, GUID guid; CoCreateGuid(&guid); - uniqueFamilyName = QString::fromLatin1("f") + QString uniqueFamilyName = QString::fromLatin1("f") + QString::number(guid.Data1, 36) + QLatin1Char('-') + QString::number(guid.Data2, 36) + QLatin1Char('-') + QString::number(guid.Data3, 36) + QLatin1Char('-') @@ -613,6 +613,7 @@ void QRawFontPrivate::platformLoadFromData(const QByteArray &_fontData, Q_ASSERT(fontEngine->cache_count == 0 && fontEngine->ref == 0); // Override the generated font name + static_cast(fontEngine)->uniqueFamilyName = uniqueFamilyName; fontEngine->fontDef.family = actualFontName; fontEngine->ref.ref(); } @@ -701,50 +702,6 @@ void QRawFontPrivate::platformLoadFromData(const QByteArray &_fontData, } } -void QRawFontPrivate::platformSetPixelSize(int pixelSize) -{ - if (fontEngine == NULL) - return; - - QFontEngine *oldFontEngine = fontEngine; - -#if !defined(QT_NO_DIRECTWRITE) - if (fontEngine->type() == QFontEngine::Win) -#endif - - { - QFontDef request = fontEngine->fontDef; - QString actualFontName = request.family; - if (!uniqueFamilyName.isEmpty()) - request.family = uniqueFamilyName; - request.pixelSize = pixelSize; - - fontEngine = qt_load_font_engine_win(request); - if (fontEngine != NULL) { - fontEngine->fontDef.family = actualFontName; - fontEngine->ref.ref(); - } - } - -#if !defined(QT_NO_DIRECTWRITE) - else { - QFontEngineDirectWrite *dWriteFE = static_cast(fontEngine); - fontEngine = new QFontEngineDirectWrite(dWriteFE->m_directWriteFactory, - dWriteFE->m_directWriteFontFace, - pixelSize); - - fontEngine->fontDef = dWriteFE->fontDef; - fontEngine->fontDef.pixelSize = pixelSize; - fontEngine->ref.ref(); - } -#endif - - Q_ASSERT(fontEngine != oldFontEngine); - oldFontEngine->ref.deref(); - if (oldFontEngine->cache_count == 0 && oldFontEngine->ref == 0) - delete oldFontEngine; -} - QT_END_NAMESPACE #endif // QT_NO_RAWFONT diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index 1cfb4b61f9b..5bee497a3e4 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -714,17 +714,13 @@ QStaticTextItem::~QStaticTextItem() { if (m_userData != 0 && !m_userData->ref.deref()) delete m_userData; - if (!m_fontEngine->ref.deref()) - delete m_fontEngine; + m_fontEngine->ref.deref(); } void QStaticTextItem::setFontEngine(QFontEngine *fe) { - if (m_fontEngine != 0) { - if (!m_fontEngine->ref.deref()) - delete m_fontEngine; - } - + if (m_fontEngine != 0) + m_fontEngine->ref.deref(); m_fontEngine = fe; if (m_fontEngine != 0) m_fontEngine->ref.ref(); diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index 6ddfdb00e1c..4f6857a201b 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -362,20 +362,23 @@ bool QTextCursorPrivate::movePosition(QTextCursor::MoveOperation op, QTextCursor currentCharFormat = -1; bool adjustX = true; QTextBlock blockIt = block(); + bool visualMovement = priv->defaultCursorMoveStyle == QTextCursor::Visual; if (!blockIt.isValid()) return false; - if (op >= QTextCursor::Left && op <= QTextCursor::WordRight - && blockIt.textDirection() == Qt::RightToLeft) { - if (op == QTextCursor::Left) - op = QTextCursor::NextCharacter; - else if (op == QTextCursor::Right) - op = QTextCursor::PreviousCharacter; - else if (op == QTextCursor::WordLeft) + if (blockIt.textDirection() == Qt::RightToLeft) { + if (op == QTextCursor::WordLeft) op = QTextCursor::NextWord; else if (op == QTextCursor::WordRight) op = QTextCursor::PreviousWord; + + if (!visualMovement) { + if (op == QTextCursor::Left) + op = QTextCursor::NextCharacter; + else if (op == QTextCursor::Right) + op = QTextCursor::PreviousCharacter; + } } const QTextLayout *layout = blockLayout(blockIt); @@ -418,9 +421,12 @@ bool QTextCursorPrivate::movePosition(QTextCursor::MoveOperation op, QTextCursor break; } case QTextCursor::PreviousCharacter: - case QTextCursor::Left: newPosition = priv->previousCursorPosition(position, QTextLayout::SkipCharacters); break; + case QTextCursor::Left: + newPosition = visualMovement ? priv->leftCursorPosition(position) + : priv->previousCursorPosition(position, QTextLayout::SkipCharacters); + break; case QTextCursor::StartOfWord: { if (relativePos == 0) break; @@ -529,9 +535,12 @@ bool QTextCursorPrivate::movePosition(QTextCursor::MoveOperation op, QTextCursor break; } case QTextCursor::NextCharacter: - case QTextCursor::Right: newPosition = priv->nextCursorPosition(position, QTextLayout::SkipCharacters); break; + case QTextCursor::Right: + newPosition = visualMovement ? priv->rightCursorPosition(position) + : priv->nextCursorPosition(position, QTextLayout::SkipCharacters); + break; case QTextCursor::NextWord: case QTextCursor::WordRight: newPosition = priv->nextCursorPosition(position, QTextLayout::SkipWords); @@ -2558,4 +2567,19 @@ QTextDocument *QTextCursor::document() const return 0; // document went away } +/*! + \enum QTextCursor::MoveStyle + + This enum describes the movement style available to QTextCursor. The options + are: + + \value Logical Within a left-to-right text block, increase cursor position + when pressing left arrow key, decrease cursor position when pressing the + right arrow key. If the text block is right-to-left, the opposite behavior + applies. + \value Visual Pressing the left arrow key will always cause the cursor to move + left, regardless of the text's writing direction. The same behavior applies to + right arrow key. +*/ + QT_END_NAMESPACE diff --git a/src/gui/text/qtextcursor.h b/src/gui/text/qtextcursor.h index 4eaeb41ee9f..9e4c0b82df4 100644 --- a/src/gui/text/qtextcursor.h +++ b/src/gui/text/qtextcursor.h @@ -86,6 +86,10 @@ public: MoveAnchor, KeepAnchor }; + enum MoveStyle { + Logical, + Visual + }; void setPosition(int pos, MoveMode mode = MoveAnchor); int position() const; diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 6dbd755d938..9169955617e 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -585,6 +585,29 @@ void QTextDocument::setDefaultTextOption(const QTextOption &option) d->lout->documentChanged(0, 0, d->length()); } +/*! + \since 4.8 + + The default cursor movement style is used by all QTextCursor objects + created from the document. The default is QTextCursor::Logical. +*/ +QTextCursor::MoveStyle QTextDocument::defaultCursorMoveStyle() const +{ + Q_D(const QTextDocument); + return d->defaultCursorMoveStyle; +} + +/*! + \since 4.8 + + Set the default cursor movement style. +*/ +void QTextDocument::setDefaultCursorMoveStyle(QTextCursor::MoveStyle style) +{ + Q_D(QTextDocument); + d->defaultCursorMoveStyle = style; +} + /*! \fn void QTextDocument::markContentsDirty(int position, int length) @@ -2076,6 +2099,10 @@ QString QTextHtmlExporter::toHtml(const QByteArray &encoding, ExportMode mode) html += QLatin1String(" font-size:"); html += QString::number(defaultCharFormat.fontPointSize()); html += QLatin1String("pt;"); + } else if (defaultCharFormat.hasProperty(QTextFormat::FontPixelSize)) { + html += QLatin1String(" font-size:"); + html += QString::number(defaultCharFormat.intProperty(QTextFormat::FontPixelSize)); + html += QLatin1String("px;"); } html += QLatin1String(" font-weight:"); @@ -2156,6 +2183,10 @@ bool QTextHtmlExporter::emitCharFormatStyle(const QTextCharFormat &format) html += QLatin1Char(';'); attributesEmitted = true; } + } else if (format.hasProperty(QTextFormat::FontPixelSize)) { + html += QLatin1String(" font-size:"); + html += QString::number(format.intProperty(QTextFormat::FontPixelSize)); + html += QLatin1String("px;"); } if (format.hasProperty(QTextFormat::FontWeight) diff --git a/src/gui/text/qtextdocument.h b/src/gui/text/qtextdocument.h index f87ccc91e8b..e515b36cc07 100644 --- a/src/gui/text/qtextdocument.h +++ b/src/gui/text/qtextdocument.h @@ -46,6 +46,7 @@ #include #include #include +#include QT_BEGIN_HEADER @@ -60,7 +61,6 @@ class QPainter; class QPrinter; class QAbstractTextDocumentLayout; class QPoint; -class QTextCursor; class QTextObject; class QTextFormat; class QTextFrame; @@ -269,6 +269,9 @@ public: QTextOption defaultTextOption() const; void setDefaultTextOption(const QTextOption &option); + QTextCursor::MoveStyle defaultCursorMoveStyle() const; + void setDefaultCursorMoveStyle(QTextCursor::MoveStyle style); + Q_SIGNALS: void contentsChange(int from, int charsRemoves, int charsAdded); void contentsChanged(); diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index a997720c125..779b1fff350 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -209,6 +209,7 @@ QTextDocumentPrivate::QTextDocumentPrivate() defaultTextOption.setTabStop(80); // same as in qtextengine.cpp defaultTextOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); + defaultCursorMoveStyle = QTextCursor::Logical; indentWidth = 40; documentMargin = 4; @@ -1382,6 +1383,20 @@ int QTextDocumentPrivate::previousCursorPosition(int position, QTextLayout::Curs return it.layout()->previousCursorPosition(position-start, mode) + start; } +int QTextDocumentPrivate::leftCursorPosition(int position) const +{ + QTextBlock it = blocksFind(position); + int start = it.position(); + return it.layout()->leftCursorPosition(position-start) + start; +} + +int QTextDocumentPrivate::rightCursorPosition(int position) const +{ + QTextBlock it = blocksFind(position); + int start = it.position(); + return it.layout()->rightCursorPosition(position-start) + start; +} + void QTextDocumentPrivate::changeObjectFormat(QTextObject *obj, int format) { beginEditBlock(); diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h index b464f2ee404..6563920c954 100644 --- a/src/gui/text/qtextdocument_p.h +++ b/src/gui/text/qtextdocument_p.h @@ -64,6 +64,7 @@ #include "private/qtextformat_p.h" #include "QtGui/qtextdocument.h" #include "QtGui/qtextobject.h" +#include "QtGui/qtextcursor.h" #include "QtCore/qmap.h" #include "QtCore/qvariant.h" #include "QtCore/qurl.h" @@ -244,6 +245,8 @@ public: int nextCursorPosition(int position, QTextLayout::CursorMode mode) const; int previousCursorPosition(int position, QTextLayout::CursorMode mode) const; + int leftCursorPosition(int position) const; + int rightCursorPosition(int position) const; void changeObjectFormat(QTextObject *group, int format); @@ -339,6 +342,7 @@ private: public: QTextOption defaultTextOption; + QTextCursor::MoveStyle defaultCursorMoveStyle; #ifndef QT_NO_CSSPARSER QCss::StyleSheet parsedDefaultStyleSheet; #endif diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index ce157be2544..130f0126391 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -2996,10 +2996,19 @@ void QTextDocumentLayout::resizeInlineObject(QTextInlineObject item, int posInDo QSizeF inlineSize = (pos == QTextFrameFormat::InFlow ? intrinsic : QSizeF(0, 0)); item.setWidth(inlineSize.width()); - if (f.verticalAlignment() == QTextCharFormat::AlignMiddle) { + + QFontMetrics m(f.font()); + switch (f.verticalAlignment()) + { + case QTextCharFormat::AlignMiddle: item.setDescent(inlineSize.height() / 2); item.setAscent(inlineSize.height() / 2 - 1); - } else { + break; + case QTextCharFormat::AlignBaseline: + item.setDescent(m.descent()); + item.setAscent(inlineSize.height() - m.descent() - 1); + break; + default: item.setDescent(0); item.setAscent(inlineSize.height() - 1); } diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 08d0eca7aca..ff27bc673f0 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -856,6 +856,21 @@ void QTextEngine::shapeLine(const QScriptLine &line) } } +#if !defined(QT_ENABLE_HARFBUZZ_FOR_MAC) +static bool enableHarfBuzz() +{ + static enum { Yes, No, Unknown } status = Unknown; + + if (status == Unknown) { + QByteArray v = qgetenv("QT_ENABLE_HARFBUZZ"); + bool value = !v.isEmpty() && v != "0" && v != "false"; + if (value) status = Yes; + else status = No; + } + return status == Yes; +} +#endif + void QTextEngine::shapeText(int item) const { Q_ASSERT(item < layoutData->items.size()); @@ -865,7 +880,24 @@ void QTextEngine::shapeText(int item) const return; #if defined(Q_WS_MAC) - shapeTextMac(item); +#if !defined(QT_ENABLE_HARFBUZZ_FOR_MAC) + if (enableHarfBuzz()) { +#endif + QFontEngine *actualFontEngine = fontEngine(si, &si.ascent, &si.descent, &si.leading); + if (actualFontEngine->type() == QFontEngine::Multi) + actualFontEngine = static_cast(actualFontEngine)->engine(0); + + HB_Face face = actualFontEngine->harfbuzzFace(); + HB_Script script = (HB_Script) si.analysis.script; + if (face->supported_scripts[script]) + shapeTextWithHarfbuzz(item); + else + shapeTextMac(item); +#if !defined(QT_ENABLE_HARFBUZZ_FOR_MAC) + } else { + shapeTextMac(item); + } +#endif #elif defined(Q_WS_WINCE) shapeTextWithCE(item); #else @@ -1242,6 +1274,10 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const actualFontEngine = static_cast(font)->engine(engineIdx); } + si.ascent = qMax(actualFontEngine->ascent(), si.ascent); + si.descent = qMax(actualFontEngine->descent(), si.descent); + si.leading = qMax(actualFontEngine->leading(), si.leading); + shaper_item.font = actualFontEngine->harfbuzzFont(); shaper_item.face = actualFontEngine->harfbuzzFace(); @@ -1304,6 +1340,7 @@ static void init(QTextEngine *e) e->ignoreBidi = false; e->cacheGlyphs = false; e->forceJustification = false; + e->visualMovement = false; e->layoutData = 0; @@ -1565,6 +1602,8 @@ bool QTextEngine::isRightToLeft() const default: break; } + if (!layoutData) + itemize(); // this places the cursor in the right position depending on the keyboard layout if (layoutData->string.isEmpty()) return QApplication::keyboardInputDirection() == Qt::RightToLeft; @@ -2737,6 +2776,182 @@ QFixed QTextEngine::leadingSpaceWidth(const QScriptLine &line) return width(line.from + pos, line.length - pos); } +QFixed QTextEngine::alignLine(const QScriptLine &line) +{ + QFixed x = 0; + justify(line); + // if width is QFIXED_MAX that means we used setNumColumns() and that implicitly makes this line left aligned. + if (!line.justified && line.width != QFIXED_MAX) { + int align = option.alignment(); + if (align & Qt::AlignLeft) + x -= leadingSpaceWidth(line); + if (align & Qt::AlignJustify && isRightToLeft()) + align = Qt::AlignRight; + if (align & Qt::AlignRight) + x = line.width - (line.textAdvance + leadingSpaceWidth(line)); + else if (align & Qt::AlignHCenter) + x = (line.width - (line.textAdvance + leadingSpaceWidth(line)))/2; + } + return x; +} + +QFixed QTextEngine::offsetInLigature(const QScriptItem *si, int pos, int max, int glyph_pos) +{ + unsigned short *logClusters = this->logClusters(si); + const QGlyphLayout &glyphs = shapedGlyphs(si); + + int offsetInCluster = 0; + for (int i = pos - 1; i >= 0; i--) { + if (logClusters[i] == glyph_pos) + offsetInCluster++; + else + break; + } + + // in the case that the offset is inside a (multi-character) glyph, + // interpolate the position. + if (offsetInCluster > 0) { + int clusterLength = 0; + for (int i = pos - offsetInCluster; i < max; i++) { + if (logClusters[i] == glyph_pos) + clusterLength++; + else + break; + } + if (clusterLength) + return glyphs.advances_x[glyph_pos] * offsetInCluster / clusterLength; + } + + return 0; +} + +int QTextEngine::previousLogicalPosition(int oldPos) const +{ + const HB_CharAttributes *attrs = attributes(); + if (!attrs || oldPos < 0) + return oldPos; + + if (oldPos <= 0) + return 0; + oldPos--; + while (oldPos && !attrs[oldPos].charStop) + oldPos--; + return oldPos; +} + +int QTextEngine::nextLogicalPosition(int oldPos) const +{ + const HB_CharAttributes *attrs = attributes(); + int len = block.isValid() ? block.length() - 1 + : layoutData->string.length(); + Q_ASSERT(len <= layoutData->string.length()); + if (!attrs || oldPos < 0 || oldPos >= len) + return oldPos; + + oldPos++; + while (oldPos < len && !attrs[oldPos].charStop) + oldPos++; + return oldPos; +} + +int QTextEngine::lineNumberForTextPosition(int pos) +{ + if (!layoutData) + itemize(); + if (pos == layoutData->string.length() && lines.size()) + return lines.size() - 1; + for (int i = 0; i < lines.size(); ++i) { + const QScriptLine& line = lines[i]; + if (line.from + line.length > pos) + return i; + } + return -1; +} + +void QTextEngine::insertionPointsForLine(int lineNum, QVector &insertionPoints) +{ + QTextLineItemIterator iterator(this, lineNum); + bool rtl = isRightToLeft(); + bool lastLine = lineNum >= lines.size() - 1; + + while (!iterator.atEnd()) { + iterator.next(); + const QScriptItem *si = &layoutData->items[iterator.item]; + if (si->analysis.bidiLevel % 2) { + int i = iterator.itemEnd - 1, min = iterator.itemStart; + if (lastLine && (rtl ? iterator.atBeginning() : iterator.atEnd())) + i++; + for (; i >= min; i--) + insertionPoints.push_back(i); + } else { + int i = iterator.itemStart, max = iterator.itemEnd; + if (lastLine && (rtl ? iterator.atBeginning() : iterator.atEnd())) + max++; + for (; i < max; i++) + insertionPoints.push_back(i); + } + } +} + +int QTextEngine::endOfLine(int lineNum) +{ + QVector insertionPoints; + insertionPointsForLine(lineNum, insertionPoints); + + if (insertionPoints.size() > 0) + return insertionPoints.last(); + return 0; +} + +int QTextEngine::beginningOfLine(int lineNum) +{ + QVector insertionPoints; + insertionPointsForLine(lineNum, insertionPoints); + + if (insertionPoints.size() > 0) + return insertionPoints.first(); + return 0; +} + +int QTextEngine::positionAfterVisualMovement(int pos, QTextCursor::MoveOperation op) +{ + if (!layoutData) + itemize(); + + bool moveRight = (op == QTextCursor::Right); + bool alignRight = isRightToLeft(); + if (!layoutData->hasBidi) + return moveRight ^ alignRight ? nextLogicalPosition(pos) : previousLogicalPosition(pos); + + int lineNum = lineNumberForTextPosition(pos); + Q_ASSERT(lineNum >= 0); + + QVector insertionPoints; + insertionPointsForLine(lineNum, insertionPoints); + int i, max = insertionPoints.size(); + for (i = 0; i < max; i++) + if (pos == insertionPoints[i]) { + if (moveRight) { + if (i + 1 < max) + return insertionPoints[i + 1]; + } else { + if (i > 0) + return insertionPoints[i - 1]; + } + + if (moveRight ^ alignRight) { + if (lineNum + 1 < lines.size()) + return alignRight ? endOfLine(lineNum + 1) : beginningOfLine(lineNum + 1); + } + else { + if (lineNum > 0) + return alignRight ? beginningOfLine(lineNum - 1) : endOfLine(lineNum - 1); + } + } + + return pos; +} + QStackTextEngine::QStackTextEngine(const QString &string, const QFont &f) : QTextEngine(string, f), _layoutData(string, _memory, MemSize) @@ -2841,5 +3056,127 @@ glyph_metrics_t glyph_metrics_t::transformed(const QTransform &matrix) const return m; } +QTextLineItemIterator::QTextLineItemIterator(QTextEngine *_eng, int _lineNum, const QPointF &pos, + const QTextLayout::FormatRange *_selection) + : eng(_eng), + line(eng->lines[_lineNum]), + si(0), + lineNum(_lineNum), + lineEnd(line.from + line.length), + firstItem(eng->findItem(line.from)), + lastItem(eng->findItem(lineEnd - 1)), + nItems((firstItem >= 0 && lastItem >= firstItem)? (lastItem-firstItem+1) : 0), + logicalItem(-1), + item(-1), + visualOrder(nItems), + levels(nItems), + selection(_selection) +{ + pos_x = x = QFixed::fromReal(pos.x()); + + x += line.x; + + x += eng->alignLine(line); + + for (int i = 0; i < nItems; ++i) + levels[i] = eng->layoutData->items[i+firstItem].analysis.bidiLevel; + QTextEngine::bidiReorder(nItems, levels.data(), visualOrder.data()); + + eng->shapeLine(line); +} + +QScriptItem &QTextLineItemIterator::next() +{ + x += itemWidth; + + ++logicalItem; + item = visualOrder[logicalItem] + firstItem; + itemLength = eng->length(item); + si = &eng->layoutData->items[item]; + if (!si->num_glyphs) + eng->shape(item); + + if (si->analysis.flags >= QScriptAnalysis::TabOrObject) { + itemWidth = si->width; + return *si; + } + + unsigned short *logClusters = eng->logClusters(si); + QGlyphLayout glyphs = eng->shapedGlyphs(si); + + itemStart = qMax(line.from, si->position); + glyphsStart = logClusters[itemStart - si->position]; + if (lineEnd < si->position + itemLength) { + itemEnd = lineEnd; + glyphsEnd = logClusters[itemEnd-si->position]; + } else { + itemEnd = si->position + itemLength; + glyphsEnd = si->num_glyphs; + } + // show soft-hyphen at line-break + if (si->position + itemLength >= lineEnd + && eng->layoutData->string.at(lineEnd - 1) == 0x00ad) + glyphs.attributes[glyphsEnd - 1].dontPrint = false; + + itemWidth = 0; + for (int g = glyphsStart; g < glyphsEnd; ++g) + itemWidth += glyphs.effectiveAdvance(g); + + return *si; +} + +bool QTextLineItemIterator::getSelectionBounds(QFixed *selectionX, QFixed *selectionWidth) const +{ + *selectionX = *selectionWidth = 0; + + if (!selection) + return false; + + if (si->analysis.flags >= QScriptAnalysis::TabOrObject) { + if (si->position >= selection->start + selection->length + || si->position + itemLength <= selection->start) + return false; + + *selectionX = x; + *selectionWidth = itemWidth; + } else { + unsigned short *logClusters = eng->logClusters(si); + QGlyphLayout glyphs = eng->shapedGlyphs(si); + + int from = qMax(itemStart, selection->start) - si->position; + int to = qMin(itemEnd, selection->start + selection->length) - si->position; + if (from >= to) + return false; + + int start_glyph = logClusters[from]; + int end_glyph = (to == eng->length(item)) ? si->num_glyphs : logClusters[to]; + QFixed soff; + QFixed swidth; + if (si->analysis.bidiLevel %2) { + for (int g = glyphsEnd - 1; g >= end_glyph; --g) + soff += glyphs.effectiveAdvance(g); + for (int g = end_glyph - 1; g >= start_glyph; --g) + swidth += glyphs.effectiveAdvance(g); + } else { + for (int g = glyphsStart; g < start_glyph; ++g) + soff += glyphs.effectiveAdvance(g); + for (int g = start_glyph; g < end_glyph; ++g) + swidth += glyphs.effectiveAdvance(g); + } + + // If the starting character is in the middle of a ligature, + // selection should only contain the right part of that ligature + // glyph, so we need to get the width of the left part here and + // add it to *selectionX + QFixed leftOffsetInLigature = eng->offsetInLigature(si, from, to, start_glyph); + *selectionX = x + soff + leftOffsetInLigature; + *selectionWidth = swidth - leftOffsetInLigature; + // If the ending character is also part of a ligature, swidth does + // not contain that part yet, we also need to find out the width of + // that left part + *selectionWidth += eng->offsetInLigature(si, to, eng->length(item), end_glyph); + } + return true; +} QT_END_NAMESPACE diff --git a/src/gui/text/qtextengine_mac.cpp b/src/gui/text/qtextengine_mac.cpp index 97e8c5b0f8a..2c6e579b454 100644 --- a/src/gui/text/qtextengine_mac.cpp +++ b/src/gui/text/qtextengine_mac.cpp @@ -605,11 +605,11 @@ void QTextEngine::shapeTextMac(int item) const unsigned short *log_clusters = logClusters(&si); bool stringToCMapFailed = false; - if (!fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, attributes())) { + if (!fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, attributes(), &si)) { ensureSpace(num_glyphs); g = availableGlyphs(&si); stringToCMapFailed = !fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, - attributes()); + attributes(), &si); } if (!stringToCMapFailed) { diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index 366c5c32071..c476485c1dd 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -64,6 +64,7 @@ #include "QtGui/qpaintengine.h" #include "QtGui/qtextobject.h" #include "QtGui/qtextoption.h" +#include "QtGui/qtextcursor.h" #include "QtCore/qset.h" #include "QtCore/qdebug.h" #ifndef QT_BUILD_COMPAT_LIB @@ -471,6 +472,7 @@ public: void shape(int item) const; void justify(const QScriptLine &si); + QFixed alignLine(const QScriptLine &line); QFixed width(int charFrom, int numChars) const; glyph_metrics_t boundingBox(int from, int len) const; @@ -586,12 +588,18 @@ public: uint cacheGlyphs : 1; uint stackEngine : 1; uint forceJustification : 1; + uint visualMovement : 1; int *underlinePositions; mutable LayoutData *layoutData; inline bool hasFormats() const { return (block.docHandle() || specialData); } + inline bool visualCursorMovement() const + { + return (visualMovement || + (block.docHandle() ? block.docHandle()->defaultCursorMoveStyle == QTextCursor::Visual : false)); + } struct SpecialData { int preeditPosition; @@ -611,6 +619,13 @@ public: void shapeLine(const QScriptLine &line); QFixed leadingSpaceWidth(const QScriptLine &line); + QFixed offsetInLigature(const QScriptItem *si, int pos, int max, int glyph_pos); + int previousLogicalPosition(int oldPos) const; + int nextLogicalPosition(int oldPos) const; + int lineNumberForTextPosition(int pos); + int positionAfterVisualMovement(int oldPos, QTextCursor::MoveOperation op); + void insertionPointsForLine(int lineNum, QVector &insertionPoints); + private: void setBoundary(int strPos) const; void addRequiredBoundaries() const; @@ -625,6 +640,8 @@ private: void splitItem(int item, int pos) const; void resolveAdditionalFormats() const; + int endOfLine(int lineNum); + int beginningOfLine(int lineNum); }; class QStackTextEngine : public QTextEngine { @@ -635,6 +652,49 @@ public: void *_memory[MemSize]; }; +struct QTextLineItemIterator +{ + QTextLineItemIterator(QTextEngine *eng, int lineNum, const QPointF &pos = QPointF(), + const QTextLayout::FormatRange *_selection = 0); + + inline bool atEnd() const { return logicalItem >= nItems - 1; } + inline bool atBeginning() const { return logicalItem <= 0; } + QScriptItem &next(); + + bool getSelectionBounds(QFixed *selectionX, QFixed *selectionWidth) const; + inline bool isOutsideSelection() const { + QFixed tmp1, tmp2; + return !getSelectionBounds(&tmp1, &tmp2); + } + + QTextEngine *eng; + + QFixed x; + QFixed pos_x; + const QScriptLine &line; + QScriptItem *si; + + int lineNum; + int lineEnd; + int firstItem; + int lastItem; + int nItems; + int logicalItem; + int item; + int itemLength; + + int glyphsStart; + int glyphsEnd; + int itemStart; + int itemEnd; + + QFixed itemWidth; + + QVarLengthArray visualOrder; + QVarLengthArray levels; + + const QTextLayout::FormatRange *selection; +}; Q_DECLARE_OPERATORS_FOR_FLAGS(QTextEngine::ShaperFlags) diff --git a/src/gui/text/qtextformat.h b/src/gui/text/qtextformat.h index ff28eaa1b29..4f4752a26ad 100644 --- a/src/gui/text/qtextformat.h +++ b/src/gui/text/qtextformat.h @@ -378,7 +378,8 @@ public: AlignSubScript, AlignMiddle, AlignTop, - AlignBottom + AlignBottom, + AlignBaseline }; enum UnderlineStyle { // keep in sync with Qt::PenStyle! NoUnderline, diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 93f71d3dbb6..cb5ba0e6725 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -72,23 +72,6 @@ QT_BEGIN_NAMESPACE #define SuppressText 0x5012 #define SuppressBackground 0x513 -static QFixed alignLine(QTextEngine *eng, const QScriptLine &line) -{ - QFixed x = 0; - eng->justify(line); - // if width is QFIXED_MAX that means we used setNumColumns() and that implicitly makes this line left aligned. - if (!line.justified && line.width != QFIXED_MAX) { - int align = eng->option.alignment(); - if (align & Qt::AlignJustify && eng->isRightToLeft()) - align = Qt::AlignRight; - if (align & Qt::AlignRight) - x = line.width - (line.textAdvance + eng->leadingSpaceWidth(line)); - else if (align & Qt::AlignHCenter) - x = (line.width - line.textAdvance)/2; - } - return x; -} - /*! \class QTextLayout::FormatRange \reentrant @@ -595,6 +578,30 @@ bool QTextLayout::cacheEnabled() const return d->cacheGlyphs; } +/*! + Set the visual cursor movement style. If the QTextLayout is backed by + a document, you can ignore this and use the option in QTextDocument, + this option is for widgets like QLineEdit or custom widgets without + a QTextDocument. Default value is QTextCursor::Logical. + + \sa setCursorMoveStyle() +*/ +void QTextLayout::setCursorMoveStyle(QTextCursor::MoveStyle style) +{ + d->visualMovement = style == QTextCursor::Visual ? true : false; +} + +/*! + The cursor movement style of this QTextLayout. The default is + QTextCursor::Logical. + + \sa setCursorMoveStyle() +*/ +QTextCursor::MoveStyle QTextLayout::cursorMoveStyle() const +{ + return d->visualMovement ? QTextCursor::Visual : QTextCursor::Logical; +} + /*! Begins the layout process. @@ -718,6 +725,34 @@ int QTextLayout::previousCursorPosition(int oldPos, CursorMode mode) const } /*! + Returns the cursor position to the right of \a oldPos, next to it. + It's dependent on the visual position of characters, after bi-directional + reordering. + + \sa leftCursorPosition(), nextCursorPosition() +*/ +int QTextLayout::rightCursorPosition(int oldPos) const +{ + int newPos = d->positionAfterVisualMovement(oldPos, QTextCursor::Right); +// qDebug("%d -> %d", oldPos, newPos); + return newPos; +} + +/*! + Returns the cursor position to the left of \a oldPos, next to it. + It's dependent on the visual position of characters, after bi-directional + reordering. + + \sa rightCursorPosition(), previousCursorPosition() +*/ +int QTextLayout::leftCursorPosition(int oldPos) const +{ + int newPos = d->positionAfterVisualMovement(oldPos, QTextCursor::Left); +// qDebug("%d -> %d", oldPos, newPos); + return newPos; +} + +/*!/ Returns true if position \a pos is a valid cursor position. In a Unicode context some positions in the text are not valid @@ -815,16 +850,8 @@ QTextLine QTextLayout::lineAt(int i) const */ QTextLine QTextLayout::lineForTextPosition(int pos) const { - for (int i = 0; i < d->lines.size(); ++i) { - const QScriptLine& line = d->lines[i]; - if (line.from + (int)line.length > pos) - return QTextLine(i, d); - } - if (!d->layoutData) - d->itemize(); - if (pos == d->layoutData->string.length() && d->lines.size()) - return QTextLine(d->lines.size()-1, d); - return QTextLine(); + int lineNum = d->lineNumberForTextPosition(pos); + return lineNum >= 0 ? lineAt(lineNum) : QTextLine(); } /*! @@ -919,201 +946,6 @@ void QTextLayout::setFlags(int flags) } } -struct QTextLineItemIterator -{ - QTextLineItemIterator(QTextEngine *eng, int lineNum, const QPointF &pos = QPointF(), - const QTextLayout::FormatRange *_selection = 0); - - inline bool atEnd() const { return logicalItem >= nItems - 1; } - QScriptItem &next(); - - bool getSelectionBounds(QFixed *selectionX, QFixed *selectionWidth) const; - inline bool isOutsideSelection() const { - QFixed tmp1, tmp2; - return !getSelectionBounds(&tmp1, &tmp2); - } - - QTextEngine *eng; - - QFixed x; - QFixed pos_x; - const QScriptLine &line; - QScriptItem *si; - - int lineEnd; - int firstItem; - int lastItem; - int nItems; - int logicalItem; - int item; - int itemLength; - - int glyphsStart; - int glyphsEnd; - int itemStart; - int itemEnd; - - QFixed itemWidth; - - QVarLengthArray visualOrder; - QVarLengthArray levels; - - const QTextLayout::FormatRange *selection; -}; - -QTextLineItemIterator::QTextLineItemIterator(QTextEngine *_eng, int lineNum, const QPointF &pos, - const QTextLayout::FormatRange *_selection) - : eng(_eng), - line(eng->lines[lineNum]), - si(0), - lineEnd(line.from + line.length), - firstItem(eng->findItem(line.from)), - lastItem(eng->findItem(lineEnd - 1)), - nItems((firstItem >= 0 && lastItem >= firstItem)? (lastItem-firstItem+1) : 0), - logicalItem(-1), - item(-1), - visualOrder(nItems), - levels(nItems), - selection(_selection) -{ - pos_x = x = QFixed::fromReal(pos.x()); - - x += line.x; - - x += alignLine(eng, line); - - for (int i = 0; i < nItems; ++i) - levels[i] = eng->layoutData->items[i+firstItem].analysis.bidiLevel; - QTextEngine::bidiReorder(nItems, levels.data(), visualOrder.data()); - - eng->shapeLine(line); -} - -QScriptItem &QTextLineItemIterator::next() -{ - x += itemWidth; - - ++logicalItem; - item = visualOrder[logicalItem] + firstItem; - itemLength = eng->length(item); - si = &eng->layoutData->items[item]; - if (!si->num_glyphs) - eng->shape(item); - - if (si->analysis.flags >= QScriptAnalysis::TabOrObject) { - itemWidth = si->width; - return *si; - } - - unsigned short *logClusters = eng->logClusters(si); - QGlyphLayout glyphs = eng->shapedGlyphs(si); - - itemStart = qMax(line.from, si->position); - glyphsStart = logClusters[itemStart - si->position]; - if (lineEnd < si->position + itemLength) { - itemEnd = lineEnd; - glyphsEnd = logClusters[itemEnd-si->position]; - } else { - itemEnd = si->position + itemLength; - glyphsEnd = si->num_glyphs; - } - // show soft-hyphen at line-break - if (si->position + itemLength >= lineEnd - && eng->layoutData->string.at(lineEnd - 1) == 0x00ad) - glyphs.attributes[glyphsEnd - 1].dontPrint = false; - - itemWidth = 0; - for (int g = glyphsStart; g < glyphsEnd; ++g) - itemWidth += glyphs.effectiveAdvance(g); - - return *si; -} - -static QFixed offsetInLigature(const unsigned short *logClusters, - const QGlyphLayout &glyphs, - int pos, int max, int glyph_pos) -{ - int offsetInCluster = 0; - for (int i = pos - 1; i >= 0; i--) { - if (logClusters[i] == glyph_pos) - offsetInCluster++; - else - break; - } - - // in the case that the offset is inside a (multi-character) glyph, - // interpolate the position. - if (offsetInCluster > 0) { - int clusterLength = 0; - for (int i = pos - offsetInCluster; i < max; i++) { - if (logClusters[i] == glyph_pos) - clusterLength++; - else - break; - } - if (clusterLength) - return glyphs.advances_x[glyph_pos] * offsetInCluster / clusterLength; - } - - return 0; -} - -bool QTextLineItemIterator::getSelectionBounds(QFixed *selectionX, QFixed *selectionWidth) const -{ - *selectionX = *selectionWidth = 0; - - if (!selection) - return false; - - if (si->analysis.flags >= QScriptAnalysis::TabOrObject) { - if (si->position >= selection->start + selection->length - || si->position + itemLength <= selection->start) - return false; - - *selectionX = x; - *selectionWidth = itemWidth; - } else { - unsigned short *logClusters = eng->logClusters(si); - QGlyphLayout glyphs = eng->shapedGlyphs(si); - - int from = qMax(itemStart, selection->start) - si->position; - int to = qMin(itemEnd, selection->start + selection->length) - si->position; - if (from >= to) - return false; - - int start_glyph = logClusters[from]; - int end_glyph = (to == eng->length(item)) ? si->num_glyphs : logClusters[to]; - QFixed soff; - QFixed swidth; - if (si->analysis.bidiLevel %2) { - for (int g = glyphsEnd - 1; g >= end_glyph; --g) - soff += glyphs.effectiveAdvance(g); - for (int g = end_glyph - 1; g >= start_glyph; --g) - swidth += glyphs.effectiveAdvance(g); - } else { - for (int g = glyphsStart; g < start_glyph; ++g) - soff += glyphs.effectiveAdvance(g); - for (int g = start_glyph; g < end_glyph; ++g) - swidth += glyphs.effectiveAdvance(g); - } - - // If the starting character is in the middle of a ligature, - // selection should only contain the right part of that ligature - // glyph, so we need to get the width of the left part here and - // add it to *selectionX - QFixed leftOffsetInLigature = offsetInLigature(logClusters, glyphs, from, - to, start_glyph); - *selectionX = x + soff + leftOffsetInLigature; - *selectionWidth = swidth - leftOffsetInLigature; - // If the ending character is also part of a ligature, swidth does - // not contain that part yet, we also need to find out the width of - // that left part - *selectionWidth += offsetInLigature(logClusters, glyphs, to, - eng->length(item), end_glyph); - } - return true; -} - static void addSelectedRegionsToPath(QTextEngine *eng, int lineNumber, const QPointF &pos, QTextLayout::FormatRange *selection, QPainterPath *region, QRectF boundingRect) { @@ -1228,6 +1060,7 @@ void QTextLayout::draw(QPainter *p, const QPointF &pos, const QVectorleadingSpaceWidth(sl).toReal(), 0); bool isLastLineInBlock = (line == d->lines.size()-1); int sl_length = sl.length + (isLastLineInBlock? 1 : 0); // the infamous newline @@ -1382,18 +1215,9 @@ void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition QFixed pos_y = QFixed::fromReal(position.y()); cursorPosition = qBound(0, cursorPosition, d->layoutData->string.length()); - int line = 0; - if (cursorPosition == d->layoutData->string.length()) { - line = d->lines.size() - 1; - } else { - // ### binary search - for (line = 0; line < d->lines.size(); line++) { - const QScriptLine &sl = d->lines[line]; - if (sl.from <= cursorPosition && sl.from + (int)sl.length > cursorPosition) - break; - } - } - + int line = d->lineNumberForTextPosition(cursorPosition); + if (line < 0) + line = 0; if (line >= d->lines.size()) return; @@ -1402,7 +1226,15 @@ void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition qreal x = position.x() + l.cursorToX(cursorPosition); - int itm = d->findItem(cursorPosition - 1); + int itm; + + if (d->visualCursorMovement()) { + if (cursorPosition == sl.from + sl.length) + cursorPosition--; + itm = d->findItem(cursorPosition); + } else + itm = d->findItem(cursorPosition - 1); + QFixed base = sl.base(); QFixed descent = sl.descent; bool rightToLeft = d->isRightToLeft(); @@ -1512,7 +1344,7 @@ QRectF QTextLine::rect() const QRectF QTextLine::naturalTextRect() const { const QScriptLine& sl = eng->lines[i]; - QFixed x = sl.x + alignLine(eng, sl); + QFixed x = sl.x + eng->alignLine(sl); QFixed width = sl.textWidth; if (sl.justified) @@ -2317,6 +2149,9 @@ QList QTextLine::glyphs(int from, int length) const QGlyphLayout subLayout = glyphLayout.mid(start, end - start); glyphLayoutHash.insertMulti(multiFontEngine->engine(which), GlyphInfo(subLayout, pos, flags)); + for (int i = 0; i < subLayout.numGlyphs; i++) + pos += QPointF(subLayout.advances_x[i].toReal(), + subLayout.advances_y[i].toReal()); start = end; which = e; @@ -2632,9 +2467,10 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const eng->itemize(); const QScriptLine &line = eng->lines[i]; + bool lastLine = i >= eng->lines.size() - 1; QFixed x = line.x; - x += alignLine(eng, line); + x += eng->alignLine(line); if (!i && !eng->layoutData->items.size()) { *cursorPos = 0; @@ -2720,21 +2556,29 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const logClusters = eng->logClusters(si); glyphs = eng->shapedGlyphs(si); if (si->analysis.flags >= QScriptAnalysis::TabOrObject) { - if(pos == l) + if (pos == (reverse ? 0 : l)) x += si->width; } else { + bool rtl = eng->isRightToLeft(); + bool visual = eng->visualCursorMovement(); if (reverse) { int end = qMin(lineEnd, si->position + l) - si->position; int glyph_end = end == l ? si->num_glyphs : logClusters[end]; - for (int i = glyph_end - 1; i >= glyph_pos; i--) + int glyph_start = glyph_pos; + if (visual && !rtl && !(lastLine && itm == (visualOrder[nItems - 1] + firstItem))) + glyph_start++; + for (int i = glyph_end - 1; i >= glyph_start; i--) x += glyphs.effectiveAdvance(i); } else { int start = qMax(line.from - si->position, 0); int glyph_start = logClusters[start]; - for (int i = glyph_start; i < glyph_pos; i++) + int glyph_end = glyph_pos; + if (!visual || !rtl || (lastLine && itm == visualOrder[0] + firstItem)) + glyph_end--; + for (int i = glyph_start; i <= glyph_end; i++) x += glyphs.effectiveAdvance(i); } - x += offsetInLigature(logClusters, glyphs, pos, line.length, glyph_pos); + x += eng->offsetInLigature(si, pos, line.length, glyph_pos); } *cursorPos = pos + si->position; @@ -2753,6 +2597,8 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const { QFixed x = QFixed::fromReal(_x); const QScriptLine &line = eng->lines[i]; + bool lastLine = i >= eng->lines.size() - 1; + int lineNum = i; if (!eng->layoutData) eng->itemize(); @@ -2770,7 +2616,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const return 0; x -= line.x; - x -= alignLine(eng, line); + x -= eng->alignLine(line); // qDebug("xToCursor: x=%f, cpos=%d", x.toReal(), cpos); QVarLengthArray visualOrder(nItems); @@ -2779,6 +2625,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const levels[i] = eng->layoutData->items[i+firstItem].analysis.bidiLevel; QTextEngine::bidiReorder(nItems, levels.data(), visualOrder.data()); + bool visual = eng->visualCursorMovement(); if (x <= 0) { // left of first item int item = visualOrder[0]+firstItem; @@ -2795,8 +2642,13 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const || (line.justified && x < line.width)) { // has to be in one of the runs QFixed pos; + bool rtl = eng->isRightToLeft(); eng->shapeLine(line); + QVector insertionPoints; + if (visual && rtl) + eng->insertionPointsForLine(lineNum, insertionPoints); + int nchars = 0; for (int i = 0; i < nItems; ++i) { int item = visualOrder[i]+firstItem; QScriptItem &si = eng->layoutData->items[item]; @@ -2826,6 +2678,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const if (pos + item_width < x) { pos += item_width; + nchars += end; continue; } // qDebug(" inside run"); @@ -2870,27 +2723,60 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const } else { QFixed dist = INT_MAX/256; if (si.analysis.bidiLevel % 2) { - pos += item_width; - while (gs <= ge) { - if (glyphs.attributes[gs].clusterStart && qAbs(x-pos) < dist) { - glyph_pos = gs; - dist = qAbs(x-pos); + if (!visual || rtl || (lastLine && i == nItems - 1)) { + pos += item_width; + while (gs <= ge) { + if (glyphs.attributes[gs].clusterStart && qAbs(x-pos) < dist) { + glyph_pos = gs; + dist = qAbs(x-pos); + } + pos -= glyphs.effectiveAdvance(gs); + ++gs; + } + } else { + while (ge >= gs) { + if (glyphs.attributes[ge].clusterStart && qAbs(x-pos) < dist) { + glyph_pos = ge; + dist = qAbs(x-pos); + } + pos += glyphs.effectiveAdvance(ge); + --ge; } - pos -= glyphs.effectiveAdvance(gs); - ++gs; } } else { - while (gs <= ge) { - if (glyphs.attributes[gs].clusterStart && qAbs(x-pos) < dist) { - glyph_pos = gs; - dist = qAbs(x-pos); + if (!visual || !rtl || (lastLine && i == 0)) { + while (gs <= ge) { + if (glyphs.attributes[gs].clusterStart && qAbs(x-pos) < dist) { + glyph_pos = gs; + dist = qAbs(x-pos); + } + pos += glyphs.effectiveAdvance(gs); + ++gs; } - pos += glyphs.effectiveAdvance(gs); - ++gs; + } else { + QFixed oldPos = pos; + while (gs <= ge) { + pos += glyphs.effectiveAdvance(gs); + if (glyphs.attributes[gs].clusterStart && qAbs(x-pos) < dist) { + glyph_pos = gs; + dist = qAbs(x-pos); + } + ++gs; + } + pos = oldPos; } } - if (qAbs(x-pos) < dist) + if (qAbs(x-pos) < dist) { + if (visual) { + if (!rtl && i < nItems - 1) { + nchars += end; + continue; + } + if (rtl && nchars > 0) + return insertionPoints[lastLine ? nchars : nchars - 1]; + } return si.position + end; + } } Q_ASSERT(glyph_pos != -1); int j; diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h index 9dd8ebd28fa..6aa81f9e7c0 100644 --- a/src/gui/text/qtextlayout.h +++ b/src/gui/text/qtextlayout.h @@ -50,6 +50,7 @@ #include #include #include +#include QT_BEGIN_HEADER @@ -136,6 +137,9 @@ public: void setCacheEnabled(bool enable); bool cacheEnabled() const; + void setCursorMoveStyle(QTextCursor::MoveStyle style); + QTextCursor::MoveStyle cursorMoveStyle() const; + void beginLayout(); void endLayout(); void clearLayout(); @@ -153,6 +157,8 @@ public: bool isValidCursorPosition(int pos) const; int nextCursorPosition(int oldPos, CursorMode mode = SkipCharacters) const; int previousCursorPosition(int oldPos, CursorMode mode = SkipCharacters) const; + int leftCursorPosition(int oldPos) const; + int rightCursorPosition(int oldPos) const; void draw(QPainter *p, const QPointF &pos, const QVector &selections = QVector(), const QRectF &clip = QRectF()) const; diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri index df9398ce597..e5d57d069d5 100644 --- a/src/gui/text/text.pri +++ b/src/gui/text/text.pri @@ -114,6 +114,9 @@ unix:x11 { OBJECTIVE_SOURCES += \ text/qfontengine_coretext.mm \ text/qfontengine_mac.mm + contains(QT_CONFIG, harfbuzz) { + DEFINES += QT_ENABLE_HARFBUZZ_FOR_MAC + } } embedded { @@ -136,7 +139,8 @@ qpa { SOURCES += \ text/qfont_qpa.cpp \ text/qfontengine_qpa.cpp \ - text/qplatformfontdatabase_qpa.cpp + text/qplatformfontdatabase_qpa.cpp \ + text/qrawfont_qpa.cpp HEADERS += \ text/qplatformfontdatabase_qpa.h diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index 289faa9b027..eb4e142328e 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -1585,6 +1585,7 @@ void QLineControl::processKeyEvent(QKeyEvent* event) } bool unknown = false; + bool visual = cursorMoveStyle() == QTextCursor::Visual; if (false) { } @@ -1649,11 +1650,11 @@ void QLineControl::processKeyEvent(QKeyEvent* event) #endif moveCursor(selectionEnd(), false); } else { - cursorForward(0, layoutDirection() == Qt::LeftToRight ? 1 : -1); + cursorForward(0, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1)); } } else if (event == QKeySequence::SelectNextChar) { - cursorForward(1, layoutDirection() == Qt::LeftToRight ? 1 : -1); + cursorForward(1, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1)); } else if (event == QKeySequence::MoveToPreviousChar) { #if !defined(Q_WS_WIN) || defined(QT_NO_COMPLETER) @@ -1664,11 +1665,11 @@ void QLineControl::processKeyEvent(QKeyEvent* event) #endif moveCursor(selectionStart(), false); } else { - cursorForward(0, layoutDirection() == Qt::LeftToRight ? -1 : 1); + cursorForward(0, visual ? -1 : (layoutDirection() == Qt::LeftToRight ? -1 : 1)); } } else if (event == QKeySequence::SelectPreviousChar) { - cursorForward(1, layoutDirection() == Qt::LeftToRight ? -1 : 1); + cursorForward(1, visual ? -1 : (layoutDirection() == Qt::LeftToRight ? -1 : 1)); } else if (event == QKeySequence::MoveToNextWord) { if (echoMode() == QLineEdit::Normal) diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h index 3c505c86965..0042f17261b 100644 --- a/src/gui/widgets/qlinecontrol_p.h +++ b/src/gui/widgets/qlinecontrol_p.h @@ -160,6 +160,8 @@ public: int cursorWidth() const { return m_cursorWidth; } void setCursorWidth(int value) { m_cursorWidth = value; } + QTextCursor::MoveStyle cursorMoveStyle() const { return m_textLayout.cursorMoveStyle(); } + void setCursorMoveStyle(QTextCursor::MoveStyle style) { m_textLayout.setCursorMoveStyle(style); } void moveCursor(int pos, bool mark = false); void cursorForward(bool mark, int steps) @@ -167,10 +169,12 @@ public: int c = m_cursor; if (steps > 0) { while (steps--) - c = m_textLayout.nextCursorPosition(c); + c = cursorMoveStyle() == QTextCursor::Visual ? m_textLayout.rightCursorPosition(c) + : m_textLayout.nextCursorPosition(c); } else if (steps < 0) { while (steps++) - c = m_textLayout.previousCursorPosition(c); + c = cursorMoveStyle() == QTextCursor::Visual ? m_textLayout.leftCursorPosition(c) + : m_textLayout.previousCursorPosition(c); } moveCursor(c, mark); } diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 07bd2733f22..43c3f52d2bc 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -1111,6 +1111,34 @@ void QLineEdit::setDragEnabled(bool b) } +/*! + \property QLineEdit::cursorMoveStyle + \brief the movement style of cursor in this line edit + \since 4.8 + + When this property is set to QTextCursor::Visual, the line edit will use visual + movement style. Pressing the left arrow key will always cause the cursor to move + left, regardless of the text's writing direction. The same behavior applies to + right arrow key. + + When the property is QTextCursor::Logical (the default), within a LTR text block, + increase cursor position when pressing left arrow key, decrease cursor position + when pressing the right arrow key. If the text block is right to left, the opposite + behavior applies. +*/ + +QTextCursor::MoveStyle QLineEdit::cursorMoveStyle() const +{ + Q_D(const QLineEdit); + return d->control->cursorMoveStyle(); +} + +void QLineEdit::setCursorMoveStyle(QTextCursor::MoveStyle style) +{ + Q_D(QLineEdit); + d->control->setCursorMoveStyle(style); +} + /*! \property QLineEdit::acceptableInput \brief whether the input satisfies the inputMask and the diff --git a/src/gui/widgets/qlineedit.h b/src/gui/widgets/qlineedit.h index 636cee7bb03..73a736c690c 100644 --- a/src/gui/widgets/qlineedit.h +++ b/src/gui/widgets/qlineedit.h @@ -43,6 +43,7 @@ #define QLINEEDIT_H #include +#include #include #include @@ -158,6 +159,9 @@ public: void setDragEnabled(bool b); bool dragEnabled() const; + void setCursorMoveStyle(QTextCursor::MoveStyle style); + QTextCursor::MoveStyle cursorMoveStyle() const; + QString inputMask() const; void setInputMask(const QString &inputMask); bool hasAcceptableInput() const; diff --git a/src/modules/qt_core.pri b/src/modules/qt_core.pri index 9636fb25000..bf013432a5c 100644 --- a/src/modules/qt_core.pri +++ b/src/modules/qt_core.pri @@ -1,12 +1,12 @@ -QT_CORE_VERSION = $$QT_VERSION -QT_CORE_MAJOR_VERSION = $$QT_MAJOR_VERSION -QT_CORE_MINOR_VERSION = $$QT_MINOR_VERSION -QT_CORE_PATCH_VERSION = $$QT_PATCH_VERSION +QT.core.VERSION = 4.8.0 +QT.core.MAJOR_VERSION = 4 +QT.core.MINOR_VERSION = 8 +QT.core.PATCH_VERSION = 0 QT.core.name = QtCore QT.core.bins = $$QT_MODULE_BIN_BASE QT.core.includes = $$QT_MODULE_INCLUDE_BASE/QtCore -QT.core.private_includes = $$QT_MODULE_INCLUDE_BASE/QtCore/private +QT.core.private_includes = $$QT_MODULE_INCLUDE_BASE/QtCore/$$QT.core.VERSION QT.core.sources = $$QT_MODULE_BASE/src/corelib QT.core.libs = $$QT_MODULE_LIB_BASE QT.core.plugins = $$QT_MODULE_PLUGIN_BASE diff --git a/src/modules/qt_dbus.pri b/src/modules/qt_dbus.pri index 13c9914f0db..9aefab9b82a 100644 --- a/src/modules/qt_dbus.pri +++ b/src/modules/qt_dbus.pri @@ -1,12 +1,12 @@ -QT_DBUS_VERSION = $$QT_VERSION -QT_DBUS_MAJOR_VERSION = $$QT_MAJOR_VERSION -QT_DBUS_MINOR_VERSION = $$QT_MINOR_VERSION -QT_DBUS_PATCH_VERSION = $$QT_PATCH_VERSION +QT.dbus.VERSION = 4.8.0 +QT.dbus.MAJOR_VERSION = 4 +QT.dbus.MINOR_VERSION = 8 +QT.dbus.PATCH_VERSION = 0 QT.dbus.name = QtDBus QT.dbus.bins = $$QT_MODULE_BIN_BASE QT.dbus.includes = $$QT_MODULE_INCLUDE_BASE/QtDBus -QT.dbus.private_includes = $$QT_MODULE_INCLUDE_BASE/QtDBus/private +QT.dbus.private_includes = $$QT_MODULE_INCLUDE_BASE/QtDBus/$$QT.dbus.VERSION QT.dbus.sources = $$QT_MODULE_BASE/src/dbus QT.dbus.libs = $$QT_MODULE_LIB_BASE QT.dbus.plugins = $$QT_MODULE_PLUGIN_BASE diff --git a/src/modules/qt_gui.pri b/src/modules/qt_gui.pri index 444f5c48047..1ef3697db6c 100644 --- a/src/modules/qt_gui.pri +++ b/src/modules/qt_gui.pri @@ -1,11 +1,11 @@ -QT_GUI_VERSION = $$QT_VERSION -QT_GUI_MAJOR_VERSION = $$QT_MAJOR_VERSION -QT_GUI_MINOR_VERSION = $$QT_MINOR_VERSION -QT_GUI_PATCH_VERSION = $$QT_PATCH_VERSION +QT.gui.VERSION = 4.8.0 +QT.gui.MAJOR_VERSION = 4 +QT.gui.MINOR_VERSION = 8 +QT.gui.PATCH_VERSION = 0 QT.gui.name = QtGui QT.gui.includes = $$QT_MODULE_INCLUDE_BASE/QtGui -QT.gui.private_includes = $$QT_MODULE_INCLUDE_BASE/QtGui/private +QT.gui.private_includes = $$QT_MODULE_INCLUDE_BASE/QtGui/$$QT.gui.VERSION QT.gui.sources = $$QT_MODULE_BASE/src/gui QT.gui.libs = $$QT_MODULE_LIB_BASE QT.gui.plugins = $$QT_MODULE_PLUGIN_BASE diff --git a/src/modules/qt_network.pri b/src/modules/qt_network.pri index f54afd21a0d..44326c2b2db 100644 --- a/src/modules/qt_network.pri +++ b/src/modules/qt_network.pri @@ -1,12 +1,12 @@ -QT_CORE_VERSION = $$QT_VERSION -QT_NETWORK_MAJOR_VERSION = $$QT_MAJOR_VERSION -QT_NETWORK_MINOR_VERSION = $$QT_MINOR_VERSION -QT_NETWORK_PATCH_VERSION = $$QT_PATCH_VERSION +QT.network.VERSION = 4.8.0 +QT.network.MAJOR_VERSION = 4 +QT.network.MINOR_VERSION = 8 +QT.network.PATCH_VERSION = 0 QT.network.name = QtNetwork QT.network.bins = $$QT_MODULE_BIN_BASE QT.network.includes = $$QT_MODULE_INCLUDE_BASE/QtNetwork -QT.network.private_includes = $$QT_MODULE_INCLUDE_BASE/QtNetwork/private +QT.network.private_includes = $$QT_MODULE_INCLUDE_BASE/QtNetwork/$$QT.network.VERSION QT.network.sources = $$QT_MODULE_BASE/src/network QT.network.libs = $$QT_MODULE_LIB_BASE QT.network.plugins = $$QT_MODULE_PLUGIN_BASE diff --git a/src/modules/qt_opengl.pri b/src/modules/qt_opengl.pri index 4d9a7029eff..b767a3ce124 100644 --- a/src/modules/qt_opengl.pri +++ b/src/modules/qt_opengl.pri @@ -1,12 +1,12 @@ -QT_OPENGL_VERSION = $$QT_VERSION -QT_OPENGL_MAJOR_VERSION = $$QT_MAJOR_VERSION -QT_OPENGL_MINOR_VERSION = $$QT_MINOR_VERSION -QT_OPENGL_PATCH_VERSION = $$QT_PATCH_VERSION +QT.opengl.VERSION = 4.8.0 +QT.opengl.MAJOR_VERSION = 4 +QT.opengl.MINOR_VERSION = 8 +QT.opengl.PATCH_VERSION = 0 QT.opengl.name = QtOpenGL QT.opengl.bins = $$QT_MODULE_BIN_BASE QT.opengl.includes = $$QT_MODULE_INCLUDE_BASE/QtOpenGL -QT.opengl.private_includes = $$QT_MODULE_INCLUDE_BASE/QtOpenGL/private +QT.opengl.private_includes = $$QT_MODULE_INCLUDE_BASE/QtOpenGL/$$QT.opengl.VERSION QT.opengl.sources = $$QT_MODULE_BASE/src/opengl QT.opengl.libs = $$QT_MODULE_LIB_BASE QT.opengl.plugins = $$QT_MODULE_PLUGIN_BASE diff --git a/src/modules/qt_openvg.pri b/src/modules/qt_openvg.pri index 1261fd99c27..2ff477c013e 100644 --- a/src/modules/qt_openvg.pri +++ b/src/modules/qt_openvg.pri @@ -1,12 +1,12 @@ -QT_OPENVG_VERSION = $$QT_VERSION -QT_OPENVG_MAJOR_VERSION = $$QT_MAJOR_VERSION -QT_OPENVG_MINOR_VERSION = $$QT_MINOR_VERSION -QT_OPENVG_PATCH_VERSION = $$QT_PATCH_VERSION +QT.openvg.VERSION = 4.8.0 +QT.openvg.MAJOR_VERSION = 4 +QT.openvg.MINOR_VERSION = 8 +QT.openvg.PATCH_VERSION = 0 QT.openvg.name = QtOpenVG QT.openvg.bins = $$QT_MODULE_BIN_BASE QT.openvg.includes = $$QT_MODULE_INCLUDE_BASE/QtOpenVG -QT.openvg.private_includes = $$QT_MODULE_INCLUDE_BASE/QtOpenVG/private +QT.openvg.private_includes = $$QT_MODULE_INCLUDE_BASE/QtOpenVG/$$QT.openvg.VERSION QT.openvg.sources = $$QT_MODULE_BASE/src/openvg QT.openvg.libs = $$QT_MODULE_LIB_BASE QT.openvg.plugins = $$QT_MODULE_PLUGIN_BASE diff --git a/src/modules/qt_sql.pri b/src/modules/qt_sql.pri index e7ca42a5134..14d2422989f 100644 --- a/src/modules/qt_sql.pri +++ b/src/modules/qt_sql.pri @@ -1,12 +1,12 @@ -QT_SQL_VERSION = $$QT_VERSION -QT_SQL_MAJOR_VERSION = $$QT_MAJOR_VERSION -QT_SQL_MINOR_VERSION = $$QT_MINOR_VERSION -QT_SQL_PATCH_VERSION = $$QT_PATCH_VERSION +QT.sql.VERSION = 4.8.0 +QT.sql.MAJOR_VERSION = 4 +QT.sql.MINOR_VERSION = 8 +QT.sql.PATCH_VERSION = 0 QT.sql.name = QtSql QT.sql.bins = $$QT_MODULE_BIN_BASE QT.sql.includes = $$QT_MODULE_INCLUDE_BASE/QtSql -QT.sql.private_includes = $$QT_MODULE_INCLUDE_BASE/QtSql/private +QT.sql.private_includes = $$QT_MODULE_INCLUDE_BASE/QtSql/$$QT.sql.VERSION QT.sql.sources = $$QT_MODULE_BASE/src/sql QT.sql.libs = $$QT_MODULE_LIB_BASE QT.sql.plugins = $$QT_MODULE_PLUGIN_BASE diff --git a/src/modules/qt_testlib.pri b/src/modules/qt_testlib.pri index 6ef7939164a..9fd9b2e446f 100644 --- a/src/modules/qt_testlib.pri +++ b/src/modules/qt_testlib.pri @@ -1,12 +1,12 @@ -QT_TEST_VERSION = $$QT_VERSION -QT_TEST_MAJOR_VERSION = $$QT_MAJOR_VERSION -QT_TEST_MINOR_VERSION = $$QT_MINOR_VERSION -QT_TEST_PATCH_VERSION = $$QT_PATCH_VERSION +QT.testlib.VERSION = 4.8.0 +QT.testlib.MAJOR_VERSION = 4 +QT.testlib.MINOR_VERSION = 8 +QT.testlib.PATCH_VERSION = 0 QT.testlib.name = QtTest QT.testlib.bins = $$QT_MODULE_BIN_BASE QT.testlib.includes = $$QT_MODULE_INCLUDE_BASE/QtTest -QT.testlib.private_includes = $$QT_MODULE_INCLUDE_BASE/QtTest/private +QT.testlib.private_includes = $$QT_MODULE_INCLUDE_BASE/QtTest/$$QT.testlib.VERSION QT.testlib.sources = $$QT_MODULE_BASE/src/testlib QT.testlib.libs = $$QT_MODULE_LIB_BASE QT.testlib.plugins = $$QT_MODULE_PLUGIN_BASE diff --git a/src/modules/qt_uilib.pri b/src/modules/qt_uilib.pri index 7e1dc7ccd23..5973216921e 100644 --- a/src/modules/qt_uilib.pri +++ b/src/modules/qt_uilib.pri @@ -1,14 +1,13 @@ -QT_UILIB_VERSION = $$QT_VERSION -QT_UILIB_MAJOR_VERSION = $$QT_MAJOR_VERSION -QT_UILIB_MINOR_VERSION = $$QT_MINOR_VERSION -QT_UILIB_PATCH_VERSION = $$QT_PATCH_VERSION +QT.uilib.VERSION = 4.8.0 +QT.uilib.MAJOR_VERSION = 4 +QT.uilib.MINOR_VERSION = 8 +QT.uilib.PATCH_VERSION = 0 -QT.uilib.name = +QT.uilib.name = QtUiLib QT.uilib.bins = $$QT_MODULE_BIN_BASE QT.uilib.includes = $$QT_MODULE_INCLUDE_BASE/QtDesigner -QT.uilib.private_includes = $$QT_MODULE_INCLUDE_BASE/QtDesigner/private +QT.uilib.private_includes = $$QT_MODULE_INCLUDE_BASE/QtDesigner/$$QT.uilib.VERSION QT.uilib.sources = $$QT_MODULE_BASE/tools/uilib -QT.uilib.libs = $$QT_MODULE_LIB_BASE QT.uilib.plugins = $$QT_MODULE_PLUGIN_BASE QT.uilib.imports = $$QT_MODULE_IMPORT_BASE QT.uilib.depends = xml diff --git a/src/modules/qt_uitools.pri b/src/modules/qt_uitools.pri index d2210076841..d30c8b845b2 100644 --- a/src/modules/qt_uitools.pri +++ b/src/modules/qt_uitools.pri @@ -1,12 +1,12 @@ -QT_UITOOLS_VERSION = $$QT_VERSION -QT_UITOOLS_MAJOR_VERSION = $$QT_MAJOR_VERSION -QT_UITOOLS_MINOR_VERSION = $$QT_MINOR_VERSION -QT_UITOOLS_PATCH_VERSION = $$QT_PATCH_VERSION +QT.uitools.VERSION = 4.8.0 +QT.uitools.MAJOR_VERSION = 4 +QT.uitools.MINOR_VERSION = 8 +QT.uitools.PATCH_VERSION = 0 QT.uitools.name = QtUiTools QT.uitools.bins = $$QT_MODULE_BIN_BASE QT.uitools.includes = $$QT_MODULE_INCLUDE_BASE/QtUiTools -QT.uitools.private_includes = $$QT_MODULE_INCLUDE_BASE/QtUiTools/private +QT.uitools.private_includes = $$QT_MODULE_INCLUDE_BASE/QtUiTools/$$QT.uitools.VERSION QT.uitools.sources = $$QT_MODULE_BASE/src/uitools QT.uitools.libs = $$QT_MODULE_LIB_BASE QT.uitools.plugins = $$QT_MODULE_PLUGIN_BASE diff --git a/src/modules/qt_xml.pri b/src/modules/qt_xml.pri index 0ede3d2ddf0..e7db6365eb8 100644 --- a/src/modules/qt_xml.pri +++ b/src/modules/qt_xml.pri @@ -1,12 +1,12 @@ -QT_XML_VERSION = $$QT_VERSION -QT_XML_MAJOR_VERSION = $$QT_MAJOR_VERSION -QT_XML_MINOR_VERSION = $$QT_MINOR_VERSION -QT_XML_PATCH_VERSION = $$QT_PATCH_VERSION +QT.xml.VERSION = 4.8.0 +QT.xml.MAJOR_VERSION = 4 +QT.xml.MINOR_VERSION = 8 +QT.xml.PATCH_VERSION = 0 QT.xml.name = QtXml QT.xml.bins = $$QT_MODULE_BIN_BASE QT.xml.includes = $$QT_MODULE_INCLUDE_BASE/QtXml -QT.xml.private_includes = $$QT_MODULE_INCLUDE_BASE/QtXml/private +QT.xml.private_includes = $$QT_MODULE_INCLUDE_BASE/QtXml/$$QT.xml.VERSION QT.xml.sources = $$QT_MODULE_BASE/src/xml QT.xml.libs = $$QT_MODULE_LIB_BASE QT.xml.plugins = $$QT_MODULE_PLUGIN_BASE diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index c108ad34cf5..e9b6703dd91 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -60,7 +60,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, #endif QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate() - : QObject(), mutex(QMutex::Recursive), forcedPolling(0), firstUpdate(true) + : QObject(), pollTimer(0), mutex(QMutex::Recursive), forcedPolling(0), firstUpdate(true) { qRegisterMetaType("QNetworkConfiguration"); qRegisterMetaType("QNetworkConfigurationPrivatePointer"); @@ -442,9 +442,19 @@ void QNetworkConfigurationManagerPrivate::startPolling() { QMutexLocker locker(&mutex); + if(!pollTimer) { + pollTimer = new QTimer(this); + pollTimer->setInterval(10000); + pollTimer->setSingleShot(true); + connect(pollTimer, SIGNAL(timeout()), this, SLOT(pollEngines())); + } + + if(pollTimer->isActive()) + return; + foreach (QBearerEngine *engine, sessionEngines) { if (engine->requiresPolling() && (forcedPolling || engine->configurationsInUse())) { - QTimer::singleShot(10000, this, SLOT(pollEngines())); + pollTimer->start(); break; } } diff --git a/src/network/bearer/qnetworkconfigmanager_p.h b/src/network/bearer/qnetworkconfigmanager_p.h index 81f38c5183d..abc4b9b4fa0 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.h +++ b/src/network/bearer/qnetworkconfigmanager_p.h @@ -64,6 +64,7 @@ QT_BEGIN_NAMESPACE class QBearerEngine; +class QTimer; class Q_NETWORK_EXPORT QNetworkConfigurationManagerPrivate : public QObject { @@ -107,6 +108,7 @@ private Q_SLOTS: private: void startPolling(); + QTimer *pollTimer; private: mutable QMutex mutex; diff --git a/src/network/network.pro b/src/network/network.pro index 948922b8c1d..fc5d08d936e 100644 --- a/src/network/network.pro +++ b/src/network/network.pro @@ -1,7 +1,10 @@ # Qt network module - TARGET = QtNetwork QPRO_PWD = $$PWD + +CONFIG += module +MODULE_PRI = ../modules/qt_network.pri + DEFINES += QT_BUILD_NETWORK_LIB QT_NO_USING_NAMESPACE #DEFINES += QLOCALSERVER_DEBUG QLOCALSOCKET_DEBUG #DEFINES += QNETWORKDISKCACHE_DEBUG @@ -10,7 +13,7 @@ DEFINES += QT_BUILD_NETWORK_LIB QT_NO_USING_NAMESPACE #DEFINES += QABSTRACTSOCKET_DEBUG QNATIVESOCKETENGINE_DEBUG #DEFINES += QTCPSOCKETENGINE_DEBUG QTCPSOCKET_DEBUG QTCPSERVER_DEBUG QSSLSOCKET_DEBUG #DEFINES += QUDPSOCKET_DEBUG QUDPSERVER_DEBUG -QT = core +QT = core-private win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x64000000 unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 7af71ccc8b6..cfb141398cd 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1877,7 +1877,7 @@ bool QAbstractSocket::waitForReadyRead(int msecs) } Q_ASSERT(d->socketEngine); - forever { + do { bool readyToRead = false; bool readyToWrite = false; if (!d->socketEngine->waitForReadOrWrite(&readyToRead, &readyToWrite, true, !d->writeBuffer.isEmpty(), @@ -1904,7 +1904,7 @@ bool QAbstractSocket::waitForReadyRead(int msecs) if (state() != ConnectedState) return false; - } + } while (qt_timeout_value(msecs, stopWatch.elapsed()) > 0); return false; } diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 18c684ff1b3..673f614c0d1 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1548,6 +1548,14 @@ namespace { } +#if defined(Q_WS_WIN) +static bool fontSmoothingApproximately(qreal target) +{ + extern Q_GUI_EXPORT qreal qt_fontsmoothing_gamma; // qapplication_win.cpp + return (qAbs(qt_fontsmoothing_gamma - target) < 0.2); +} +#endif + // #define QT_OPENGL_DRAWCACHEDGLYPHS_INDEX_ARRAY_VBO void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyphType, @@ -1786,7 +1794,6 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp shaderManager->setMaskType(QGLEngineShaderManager::PixelMask); prepareForDraw(false); // Text always causes src pixels to be transparent } - //### TODO: Gamma correction QGLTextureGlyphCache::FilterMode filterMode = (s->matrix.type() > QTransform::TxTranslate)?QGLTextureGlyphCache::Linear:QGLTextureGlyphCache::Nearest; if (lastMaskTextureUsed != cache->texture() || cache->filterMode() != filterMode) { @@ -1809,12 +1816,31 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp } } + bool srgbFrameBufferEnabled = false; + if (ctx->d_ptr->extension_flags & QGLExtensions::SRGBFrameBuffer) { +#if defined(Q_WS_MAC) + if (glyphType == QFontEngineGlyphCache::Raster_RGBMask) +#elif defined(Q_WS_WIN) + if (glyphType != QFontEngineGlyphCache::Raster_RGBMask || fontSmoothingApproximately(2.1)) +#else + if (false) +#endif + { + glEnable(FRAMEBUFFER_SRGB_EXT); + srgbFrameBufferEnabled = true; + } + } + #if defined(QT_OPENGL_DRAWCACHEDGLYPHS_INDEX_ARRAY_VBO) glDrawElements(GL_TRIANGLE_STRIP, 6 * numGlyphs, GL_UNSIGNED_SHORT, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); #else glDrawElements(GL_TRIANGLE_STRIP, 6 * numGlyphs, GL_UNSIGNED_SHORT, elementIndices.data()); #endif + + if (srgbFrameBufferEnabled) + glDisable(FRAMEBUFFER_SRGB_EXT); + } void QGL2PaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, @@ -1986,7 +2012,8 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) #if !defined(QT_OPENGL_ES_2) #if defined(Q_WS_WIN) - if (qt_cleartype_enabled) + if (qt_cleartype_enabled + && (fontSmoothingApproximately(1.0) || fontSmoothingApproximately(2.1))) #endif #if defined(Q_WS_MAC) if (qt_applefontsmoothing_enabled) diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index 94024f3d74f..a5faa36b4a4 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -1564,6 +1564,19 @@ QVertexSet QTriangulator::triangulate() template QVertexSet QTriangulator::polyline() { + for (int i = 0; i < m_vertices.size(); ++i) { + Q_ASSERT(qAbs(m_vertices.at(i).x) < (1 << 21)); + Q_ASSERT(qAbs(m_vertices.at(i).y) < (1 << 21)); + } + + if (!(m_hint & (QVectorPath::OddEvenFill | QVectorPath::WindingFill))) + m_hint |= QVectorPath::OddEvenFill; + + if (m_hint & QVectorPath::NonConvexShapeMask) { + ComplexToSimple c2s(this); + c2s.decompose(); + } + QVertexSet result; result.indices = m_indices; result.vertices.resize(2 * m_vertices.size()); @@ -3084,7 +3097,7 @@ QPolylineSet qPolyline(const QVectorPath &path, } else { QTriangulator triangulator; triangulator.initialize(path, matrix, lod); - QVertexSet vertexSet = triangulator.triangulate(); + QVertexSet vertexSet = triangulator.polyline(); polyLineSet.vertices = vertexSet.vertices; polyLineSet.indices.setDataUshort(vertexSet.indices); } @@ -3104,7 +3117,7 @@ QPolylineSet qPolyline(const QPainterPath &path, } else { QTriangulator triangulator; triangulator.initialize(path, matrix, lod); - QVertexSet vertexSet = triangulator.triangulate(); + QVertexSet vertexSet = triangulator.polyline(); polyLineSet.vertices = vertexSet.vertices; polyLineSet.indices.setDataUshort(vertexSet.indices); } diff --git a/src/opengl/gl2paintengineex/qtriangulator_p.h b/src/opengl/gl2paintengineex/qtriangulator_p.h index a205b923e9f..081738addfd 100644 --- a/src/opengl/gl2paintengineex/qtriangulator_p.h +++ b/src/opengl/gl2paintengineex/qtriangulator_p.h @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE -class QVertexIndexVector +class Q_OPENGL_EXPORT QVertexIndexVector { public: enum Type { @@ -111,7 +111,7 @@ private: QVector indices16; }; -struct QTriangleSet +struct Q_OPENGL_EXPORT QTriangleSet { inline QTriangleSet() { } inline QTriangleSet(const QTriangleSet &other) : vertices(other.vertices), indices(other.indices) { } @@ -122,14 +122,14 @@ struct QTriangleSet QVertexIndexVector indices; // [i[0], j[0], k[0], i[1], j[1], k[1], i[2], ...] }; -struct QPolylineSet +struct Q_OPENGL_EXPORT QPolylineSet { inline QPolylineSet() { } inline QPolylineSet(const QPolylineSet &other) : vertices(other.vertices), indices(other.indices) { } QPolylineSet &operator = (const QPolylineSet &other) {vertices = other.vertices; indices = other.indices; return *this;} QVector vertices; // [x[0], y[0], x[1], y[1], x[2], ...] - QVertexIndexVector indices; + QVertexIndexVector indices; // End of polyline is marked with -1. }; // The vertex coordinates of the returned triangle set will be rounded to a grid with a mesh size @@ -139,9 +139,9 @@ struct QPolylineSet // 'lod' is the level of detail. Default is 1. Curves are split into more lines when 'lod' is higher. QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint = QVectorPath::PolygonHint | QVectorPath::OddEvenFill, const QTransform &matrix = QTransform()); QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); -QTriangleSet qTriangulate(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); +QTriangleSet Q_OPENGL_EXPORT qTriangulate(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); -QPolylineSet qPolyline(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); +QPolylineSet Q_OPENGL_EXPORT qPolyline(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); QT_END_NAMESPACE diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index e7c1c446de9..849bd9ebc7d 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -1,6 +1,10 @@ TARGET = QtOpenGL QPRO_PWD = $$PWD -QT = core gui +QT = core-private gui-private + +CONFIG += module +MODULE_PRI = ../modules/qt_opengl.pri + DEFINES += QT_BUILD_OPENGL_LIB DEFINES += QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x63000000 diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 057fb55e2c1..4cb976f3c2e 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -43,6 +43,7 @@ #include "qplatformdefs.h" #include "qgl.h" #include +#include #if defined(Q_WS_X11) #include "private/qt_x11_p.h" @@ -1663,6 +1664,7 @@ const QGLContext *qt_gl_transfer_context(const QGLContext *ctx) QGLContextPrivate::QGLContextPrivate(QGLContext *context) : internal_context(false) , q_ptr(context) + , functions(0) { group = new QGLContextGroup(context); texture_destroyer = new QGLTextureDestroyer; @@ -1671,6 +1673,8 @@ QGLContextPrivate::QGLContextPrivate(QGLContext *context) QGLContextPrivate::~QGLContextPrivate() { + delete functions; + if (!group->m_refs.deref()) { Q_ASSERT(group->context() == q_ptr); delete group; @@ -2710,6 +2714,19 @@ int QGLContextPrivate::maxTextureSize() #endif } +/*! + Returns a QGLFunctions object that is initialized for this context. + */ +QGLFunctions *QGLContext::functions() const +{ + QGLContextPrivate *d = const_cast(d_func()); + if (!d->functions) { + d->functions = new QGLFunctions(this); + d->functions->initializeGLFunctions(this); + } + return d->functions; +} + /*! Generates and binds a 2D GL texture to the current context, based on \a image. The generated texture id is returned and can be used in @@ -3792,6 +3809,20 @@ QGLWidget::QGLWidget(QWidget *parent, const QGLWidget* shareWidget, Qt::WindowFl d->init(new QGLContext(QGLFormat::defaultFormat(), this), shareWidget); } +/*! + \internal + */ +QGLWidget::QGLWidget(QGLWidgetPrivate &dd, const QGLFormat &format, QWidget *parent, const QGLWidget *shareWidget, Qt::WindowFlags f) + : QWidget(dd, parent, f | Qt::MSWindowsOwnDC) +{ + Q_D(QGLWidget); + setAttribute(Qt::WA_PaintOnScreen); + setAttribute(Qt::WA_NoSystemBackground); + setAutoFillBackground(true); // for compatibility + d->init(new QGLContext(format, this), shareWidget); + +} + /*! Constructs an OpenGL widget with parent \a parent. @@ -5490,6 +5521,13 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions() if (extensions.match("GL_EXT_bgra")) glExtensions |= BGRATextureFormat; + { + GLboolean srgbCapableFramebuffers; + glGetBooleanv(FRAMEBUFFER_SRGB_CAPABLE_EXT, &srgbCapableFramebuffers); + if (srgbCapableFramebuffers) + glExtensions |= SRGBFrameBuffer; + } + return glExtensions; } diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index c57995d8d03..dfd1ae18248 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -307,6 +307,8 @@ Q_OPENGL_EXPORT bool operator!=(const QGLFormat&, const QGLFormat&); Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QGLFormat &); #endif +class QGLFunctions; + class Q_OPENGL_EXPORT QGLContext { Q_DECLARE_PRIVATE(QGLContext) @@ -332,6 +334,8 @@ public: virtual void swapBuffers() const; + QGLFunctions *functions() const; + enum BindOption { NoBindOption = 0x0000, InvertedYBindOption = 0x0001, @@ -466,6 +470,7 @@ private: friend class QX11GLPixmapData; friend class QX11GLSharedContexts; friend class QGLContextResourceBase; + friend class QSGDistanceFieldGlyphCache; private: Q_DISABLE_COPY(QGLContext) }; @@ -589,6 +594,11 @@ protected: virtual void glDraw(); int fontDisplayListBase(const QFont & fnt, int listBase = 2000); // ### Qt 5: remove + QGLWidget(QGLWidgetPrivate &dd, + const QGLFormat &format = QGLFormat(), + QWidget *parent = 0, + const QGLWidget* shareWidget = 0, + Qt::WindowFlags f = 0); private: Q_DISABLE_COPY(QGLWidget) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 50d13c9540b..46683c742ea 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -159,7 +159,7 @@ public: QGLFormat::OpenGLContextProfile profile; }; -class QGLWidgetPrivate : public QWidgetPrivate +class Q_OPENGL_EXPORT QGLWidgetPrivate : public QWidgetPrivate { Q_DECLARE_PUBLIC(QGLWidget) public: @@ -288,7 +288,8 @@ public: PVRTCTextureCompression = 0x00020000, FragmentShader = 0x00040000, ElementIndexUint = 0x00080000, - Depth24 = 0x00100000 + Depth24 = 0x00100000, + SRGBFrameBuffer = 0x00200000 }; Q_DECLARE_FLAGS(Extensions, Extension) @@ -441,6 +442,8 @@ public: QHash m_resources; QGLTextureDestroyer *texture_destroyer; + QGLFunctions *functions; + bool vertexAttributeArraysEnabledState[QT_GL_VERTEX_ARRAY_TRACKED_COUNT]; static inline QGLContextGroup *contextGroup(const QGLContext *ctx) { return ctx->d_ptr->group; } @@ -499,7 +502,7 @@ private: QGLContext *m_ctx; }; -class QGLTextureDestroyer : public QObject +class Q_OPENGL_EXPORT QGLTextureDestroyer : public QObject { Q_OBJECT public: diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h index 529c7a1b4e3..ac80ce8b968 100644 --- a/src/opengl/qglextensions_p.h +++ b/src/opengl/qglextensions_p.h @@ -477,6 +477,14 @@ struct QGLExtensionFuncs // OpenGL constants +#ifndef FRAMEBUFFER_SRGB_CAPABLE_EXT +#define FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif + +#ifndef FRAMEBUFFER_SRGB_EXT +#define FRAMEBUFFER_SRGB_EXT 0x8DB9 +#endif + #ifndef GL_ARRAY_BUFFER #define GL_ARRAY_BUFFER 0x8892 #endif diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp index be8219a07fc..80270815435 100644 --- a/src/opengl/qglfunctions.cpp +++ b/src/opengl/qglfunctions.cpp @@ -1348,7 +1348,7 @@ void QGLFunctions::initializeGLFunctions(const QGLContext *context) #ifndef QT_OPENGL_ES_2 -static void qglfResolveActiveTexture(GLenum texture) +static void QGLF_APIENTRY qglfResolveActiveTexture(GLenum texture) { typedef void (QGLF_APIENTRYP type_glActiveTexture)(GLenum texture); @@ -1368,7 +1368,7 @@ static void qglfResolveActiveTexture(GLenum texture) funcs->activeTexture = qglfResolveActiveTexture; } -static void qglfResolveAttachShader(GLuint program, GLuint shader) +static void QGLF_APIENTRY qglfResolveAttachShader(GLuint program, GLuint shader) { typedef void (QGLF_APIENTRYP type_glAttachShader)(GLuint program, GLuint shader); @@ -1388,7 +1388,7 @@ static void qglfResolveAttachShader(GLuint program, GLuint shader) funcs->attachShader = qglfResolveAttachShader; } -static void qglfResolveBindAttribLocation(GLuint program, GLuint index, const char* name) +static void QGLF_APIENTRY qglfResolveBindAttribLocation(GLuint program, GLuint index, const char* name) { typedef void (QGLF_APIENTRYP type_glBindAttribLocation)(GLuint program, GLuint index, const char* name); @@ -1408,7 +1408,7 @@ static void qglfResolveBindAttribLocation(GLuint program, GLuint index, const ch funcs->bindAttribLocation = qglfResolveBindAttribLocation; } -static void qglfResolveBindBuffer(GLenum target, GLuint buffer) +static void QGLF_APIENTRY qglfResolveBindBuffer(GLenum target, GLuint buffer) { typedef void (QGLF_APIENTRYP type_glBindBuffer)(GLenum target, GLuint buffer); @@ -1438,7 +1438,7 @@ static void qglfResolveBindBuffer(GLenum target, GLuint buffer) funcs->bindBuffer = qglfResolveBindBuffer; } -static void qglfResolveBindFramebuffer(GLenum target, GLuint framebuffer) +static void QGLF_APIENTRY qglfResolveBindFramebuffer(GLenum target, GLuint framebuffer) { typedef void (QGLF_APIENTRYP type_glBindFramebuffer)(GLenum target, GLuint framebuffer); @@ -1468,7 +1468,7 @@ static void qglfResolveBindFramebuffer(GLenum target, GLuint framebuffer) funcs->bindFramebuffer = qglfResolveBindFramebuffer; } -static void qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer) +static void QGLF_APIENTRY qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer) { typedef void (QGLF_APIENTRYP type_glBindRenderbuffer)(GLenum target, GLuint renderbuffer); @@ -1498,7 +1498,7 @@ static void qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer) funcs->bindRenderbuffer = qglfResolveBindRenderbuffer; } -static void qglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) +static void QGLF_APIENTRY qglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { typedef void (QGLF_APIENTRYP type_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); @@ -1528,7 +1528,7 @@ static void qglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, G funcs->blendColor = qglfResolveBlendColor; } -static void qglfResolveBlendEquation(GLenum mode) +static void QGLF_APIENTRY qglfResolveBlendEquation(GLenum mode) { typedef void (QGLF_APIENTRYP type_glBlendEquation)(GLenum mode); @@ -1558,7 +1558,7 @@ static void qglfResolveBlendEquation(GLenum mode) funcs->blendEquation = qglfResolveBlendEquation; } -static void qglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) +static void QGLF_APIENTRY qglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) { typedef void (QGLF_APIENTRYP type_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha); @@ -1588,7 +1588,7 @@ static void qglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) funcs->blendEquationSeparate = qglfResolveBlendEquationSeparate; } -static void qglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) +static void QGLF_APIENTRY qglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) { typedef void (QGLF_APIENTRYP type_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); @@ -1618,7 +1618,7 @@ static void qglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum sr funcs->blendFuncSeparate = qglfResolveBlendFuncSeparate; } -static void qglfResolveBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage) +static void QGLF_APIENTRY qglfResolveBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage) { typedef void (QGLF_APIENTRYP type_glBufferData)(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage); @@ -1648,7 +1648,7 @@ static void qglfResolveBufferData(GLenum target, qgl_GLsizeiptr size, const void funcs->bufferData = qglfResolveBufferData; } -static void qglfResolveBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data) +static void QGLF_APIENTRY qglfResolveBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data) { typedef void (QGLF_APIENTRYP type_glBufferSubData)(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data); @@ -1678,7 +1678,7 @@ static void qglfResolveBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLs funcs->bufferSubData = qglfResolveBufferSubData; } -static GLenum qglfResolveCheckFramebufferStatus(GLenum target) +static GLenum QGLF_APIENTRY qglfResolveCheckFramebufferStatus(GLenum target) { typedef GLenum (QGLF_APIENTRYP type_glCheckFramebufferStatus)(GLenum target); @@ -1708,7 +1708,7 @@ static GLenum qglfResolveCheckFramebufferStatus(GLenum target) return GLenum(0); } -static void qglfResolveCompileShader(GLuint shader) +static void QGLF_APIENTRY qglfResolveCompileShader(GLuint shader) { typedef void (QGLF_APIENTRYP type_glCompileShader)(GLuint shader); @@ -1728,7 +1728,7 @@ static void qglfResolveCompileShader(GLuint shader) funcs->compileShader = qglfResolveCompileShader; } -static void qglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) +static void QGLF_APIENTRY qglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) { typedef void (QGLF_APIENTRYP type_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); @@ -1758,7 +1758,7 @@ static void qglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum i funcs->compressedTexImage2D = qglfResolveCompressedTexImage2D; } -static void qglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) +static void QGLF_APIENTRY qglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) { typedef void (QGLF_APIENTRYP type_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); @@ -1788,7 +1788,7 @@ static void qglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint funcs->compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D; } -static GLuint qglfResolveCreateProgram() +static GLuint QGLF_APIENTRY qglfResolveCreateProgram() { typedef GLuint (QGLF_APIENTRYP type_glCreateProgram)(); @@ -1808,7 +1808,7 @@ static GLuint qglfResolveCreateProgram() return GLuint(0); } -static GLuint qglfResolveCreateShader(GLenum type) +static GLuint QGLF_APIENTRY qglfResolveCreateShader(GLenum type) { typedef GLuint (QGLF_APIENTRYP type_glCreateShader)(GLenum type); @@ -1828,7 +1828,7 @@ static GLuint qglfResolveCreateShader(GLenum type) return GLuint(0); } -static void qglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers) +static void QGLF_APIENTRY qglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers) { typedef void (QGLF_APIENTRYP type_glDeleteBuffers)(GLsizei n, const GLuint* buffers); @@ -1858,7 +1858,7 @@ static void qglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers) funcs->deleteBuffers = qglfResolveDeleteBuffers; } -static void qglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers) +static void QGLF_APIENTRY qglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers) { typedef void (QGLF_APIENTRYP type_glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers); @@ -1888,7 +1888,7 @@ static void qglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers) funcs->deleteFramebuffers = qglfResolveDeleteFramebuffers; } -static void qglfResolveDeleteProgram(GLuint program) +static void QGLF_APIENTRY qglfResolveDeleteProgram(GLuint program) { typedef void (QGLF_APIENTRYP type_glDeleteProgram)(GLuint program); @@ -1908,7 +1908,7 @@ static void qglfResolveDeleteProgram(GLuint program) funcs->deleteProgram = qglfResolveDeleteProgram; } -static void qglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) +static void QGLF_APIENTRY qglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) { typedef void (QGLF_APIENTRYP type_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers); @@ -1938,7 +1938,7 @@ static void qglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffer funcs->deleteRenderbuffers = qglfResolveDeleteRenderbuffers; } -static void qglfResolveDeleteShader(GLuint shader) +static void QGLF_APIENTRY qglfResolveDeleteShader(GLuint shader) { typedef void (QGLF_APIENTRYP type_glDeleteShader)(GLuint shader); @@ -1958,7 +1958,7 @@ static void qglfResolveDeleteShader(GLuint shader) funcs->deleteShader = qglfResolveDeleteShader; } -static void qglfResolveDetachShader(GLuint program, GLuint shader) +static void QGLF_APIENTRY qglfResolveDetachShader(GLuint program, GLuint shader) { typedef void (QGLF_APIENTRYP type_glDetachShader)(GLuint program, GLuint shader); @@ -1978,7 +1978,7 @@ static void qglfResolveDetachShader(GLuint program, GLuint shader) funcs->detachShader = qglfResolveDetachShader; } -static void qglfResolveDisableVertexAttribArray(GLuint index) +static void QGLF_APIENTRY qglfResolveDisableVertexAttribArray(GLuint index) { typedef void (QGLF_APIENTRYP type_glDisableVertexAttribArray)(GLuint index); @@ -1998,7 +1998,7 @@ static void qglfResolveDisableVertexAttribArray(GLuint index) funcs->disableVertexAttribArray = qglfResolveDisableVertexAttribArray; } -static void qglfResolveEnableVertexAttribArray(GLuint index) +static void QGLF_APIENTRY qglfResolveEnableVertexAttribArray(GLuint index) { typedef void (QGLF_APIENTRYP type_glEnableVertexAttribArray)(GLuint index); @@ -2018,7 +2018,7 @@ static void qglfResolveEnableVertexAttribArray(GLuint index) funcs->enableVertexAttribArray = qglfResolveEnableVertexAttribArray; } -static void qglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) +static void QGLF_APIENTRY qglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) { typedef void (QGLF_APIENTRYP type_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); @@ -2048,7 +2048,7 @@ static void qglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, funcs->framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer; } -static void qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) +static void QGLF_APIENTRY qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { typedef void (QGLF_APIENTRYP type_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); @@ -2078,7 +2078,7 @@ static void qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GL funcs->framebufferTexture2D = qglfResolveFramebufferTexture2D; } -static void qglfResolveGenBuffers(GLsizei n, GLuint* buffers) +static void QGLF_APIENTRY qglfResolveGenBuffers(GLsizei n, GLuint* buffers) { typedef void (QGLF_APIENTRYP type_glGenBuffers)(GLsizei n, GLuint* buffers); @@ -2108,7 +2108,7 @@ static void qglfResolveGenBuffers(GLsizei n, GLuint* buffers) funcs->genBuffers = qglfResolveGenBuffers; } -static void qglfResolveGenerateMipmap(GLenum target) +static void QGLF_APIENTRY qglfResolveGenerateMipmap(GLenum target) { typedef void (QGLF_APIENTRYP type_glGenerateMipmap)(GLenum target); @@ -2138,7 +2138,7 @@ static void qglfResolveGenerateMipmap(GLenum target) funcs->generateMipmap = qglfResolveGenerateMipmap; } -static void qglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers) +static void QGLF_APIENTRY qglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers) { typedef void (QGLF_APIENTRYP type_glGenFramebuffers)(GLsizei n, GLuint* framebuffers); @@ -2168,7 +2168,7 @@ static void qglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers) funcs->genFramebuffers = qglfResolveGenFramebuffers; } -static void qglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers) +static void QGLF_APIENTRY qglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers) { typedef void (QGLF_APIENTRYP type_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers); @@ -2198,7 +2198,7 @@ static void qglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers) funcs->genRenderbuffers = qglfResolveGenRenderbuffers; } -static void qglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) +static void QGLF_APIENTRY qglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) { typedef void (QGLF_APIENTRYP type_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name); @@ -2218,7 +2218,7 @@ static void qglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei buf funcs->getActiveAttrib = qglfResolveGetActiveAttrib; } -static void qglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) +static void QGLF_APIENTRY qglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) { typedef void (QGLF_APIENTRYP type_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name); @@ -2238,7 +2238,7 @@ static void qglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bu funcs->getActiveUniform = qglfResolveGetActiveUniform; } -static void qglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) +static void QGLF_APIENTRY qglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) { typedef void (QGLF_APIENTRYP type_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); @@ -2258,7 +2258,7 @@ static void qglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsi funcs->getAttachedShaders = qglfResolveGetAttachedShaders; } -static int qglfResolveGetAttribLocation(GLuint program, const char* name) +static int QGLF_APIENTRY qglfResolveGetAttribLocation(GLuint program, const char* name) { typedef int (QGLF_APIENTRYP type_glGetAttribLocation)(GLuint program, const char* name); @@ -2278,7 +2278,7 @@ static int qglfResolveGetAttribLocation(GLuint program, const char* name) return int(0); } -static void qglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* params) +static void QGLF_APIENTRY qglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* params) { typedef void (QGLF_APIENTRYP type_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params); @@ -2308,7 +2308,7 @@ static void qglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* funcs->getBufferParameteriv = qglfResolveGetBufferParameteriv; } -static void qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params) +static void QGLF_APIENTRY qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params) { typedef void (QGLF_APIENTRYP type_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params); @@ -2338,7 +2338,7 @@ static void qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum funcs->getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv; } -static void qglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params) +static void QGLF_APIENTRY qglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params) { typedef void (QGLF_APIENTRYP type_glGetProgramiv)(GLuint program, GLenum pname, GLint* params); @@ -2358,7 +2358,7 @@ static void qglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params) funcs->getProgramiv = qglfResolveGetProgramiv; } -static void qglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) +static void QGLF_APIENTRY qglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) { typedef void (QGLF_APIENTRYP type_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog); @@ -2378,7 +2378,7 @@ static void qglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsize funcs->getProgramInfoLog = qglfResolveGetProgramInfoLog; } -static void qglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) +static void QGLF_APIENTRY qglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) { typedef void (QGLF_APIENTRYP type_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params); @@ -2408,7 +2408,7 @@ static void qglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, G funcs->getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv; } -static void qglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params) +static void QGLF_APIENTRY qglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params) { typedef void (QGLF_APIENTRYP type_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params); @@ -2428,7 +2428,7 @@ static void qglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params) funcs->getShaderiv = qglfResolveGetShaderiv; } -static void qglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) +static void QGLF_APIENTRY qglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) { typedef void (QGLF_APIENTRYP type_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog); @@ -2448,14 +2448,14 @@ static void qglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* funcs->getShaderInfoLog = qglfResolveGetShaderInfoLog; } -static void qglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) +static void QGLF_APIENTRY qglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) { Q_UNUSED(shadertype); Q_UNUSED(precisiontype); range[0] = range[1] = precision[0] = 0; } -static void qglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) +static void QGLF_APIENTRY qglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) { typedef void (QGLF_APIENTRYP type_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); @@ -2485,7 +2485,7 @@ static void qglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precis funcs->getShaderPrecisionFormat(shadertype, precisiontype, range, precision); } -static void qglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source) +static void QGLF_APIENTRY qglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source) { typedef void (QGLF_APIENTRYP type_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, char* source); @@ -2505,7 +2505,7 @@ static void qglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* funcs->getShaderSource = qglfResolveGetShaderSource; } -static void qglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* params) +static void QGLF_APIENTRY qglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* params) { typedef void (QGLF_APIENTRYP type_glGetUniformfv)(GLuint program, GLint location, GLfloat* params); @@ -2525,7 +2525,7 @@ static void qglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* par funcs->getUniformfv = qglfResolveGetUniformfv; } -static void qglfResolveGetUniformiv(GLuint program, GLint location, GLint* params) +static void QGLF_APIENTRY qglfResolveGetUniformiv(GLuint program, GLint location, GLint* params) { typedef void (QGLF_APIENTRYP type_glGetUniformiv)(GLuint program, GLint location, GLint* params); @@ -2545,7 +2545,7 @@ static void qglfResolveGetUniformiv(GLuint program, GLint location, GLint* param funcs->getUniformiv = qglfResolveGetUniformiv; } -static int qglfResolveGetUniformLocation(GLuint program, const char* name) +static int QGLF_APIENTRY qglfResolveGetUniformLocation(GLuint program, const char* name) { typedef int (QGLF_APIENTRYP type_glGetUniformLocation)(GLuint program, const char* name); @@ -2565,7 +2565,7 @@ static int qglfResolveGetUniformLocation(GLuint program, const char* name) return int(0); } -static void qglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params) +static void QGLF_APIENTRY qglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params) { typedef void (QGLF_APIENTRYP type_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params); @@ -2585,7 +2585,7 @@ static void qglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* pa funcs->getVertexAttribfv = qglfResolveGetVertexAttribfv; } -static void qglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* params) +static void QGLF_APIENTRY qglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* params) { typedef void (QGLF_APIENTRYP type_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params); @@ -2605,7 +2605,7 @@ static void qglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* para funcs->getVertexAttribiv = qglfResolveGetVertexAttribiv; } -static void qglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer) +static void QGLF_APIENTRY qglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer) { typedef void (QGLF_APIENTRYP type_glGetVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer); @@ -2625,7 +2625,7 @@ static void qglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void* funcs->getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv; } -static GLboolean qglfResolveIsBuffer(GLuint buffer) +static GLboolean QGLF_APIENTRY qglfResolveIsBuffer(GLuint buffer) { typedef GLboolean (QGLF_APIENTRYP type_glIsBuffer)(GLuint buffer); @@ -2655,7 +2655,7 @@ static GLboolean qglfResolveIsBuffer(GLuint buffer) return GLboolean(0); } -static GLboolean qglfResolveIsFramebuffer(GLuint framebuffer) +static GLboolean QGLF_APIENTRY qglfResolveIsFramebuffer(GLuint framebuffer) { typedef GLboolean (QGLF_APIENTRYP type_glIsFramebuffer)(GLuint framebuffer); @@ -2685,12 +2685,12 @@ static GLboolean qglfResolveIsFramebuffer(GLuint framebuffer) return GLboolean(0); } -static GLboolean qglfSpecialIsProgram(GLuint program) +static GLboolean QGLF_APIENTRY qglfSpecialIsProgram(GLuint program) { return program != 0; } -static GLboolean qglfResolveIsProgram(GLuint program) +static GLboolean QGLF_APIENTRY qglfResolveIsProgram(GLuint program) { typedef GLboolean (QGLF_APIENTRYP type_glIsProgram)(GLuint program); @@ -2710,7 +2710,7 @@ static GLboolean qglfResolveIsProgram(GLuint program) return funcs->isProgram(program); } -static GLboolean qglfResolveIsRenderbuffer(GLuint renderbuffer) +static GLboolean QGLF_APIENTRY qglfResolveIsRenderbuffer(GLuint renderbuffer) { typedef GLboolean (QGLF_APIENTRYP type_glIsRenderbuffer)(GLuint renderbuffer); @@ -2740,12 +2740,12 @@ static GLboolean qglfResolveIsRenderbuffer(GLuint renderbuffer) return GLboolean(0); } -static GLboolean qglfSpecialIsShader(GLuint shader) +static GLboolean QGLF_APIENTRY qglfSpecialIsShader(GLuint shader) { return shader != 0; } -static GLboolean qglfResolveIsShader(GLuint shader) +static GLboolean QGLF_APIENTRY qglfResolveIsShader(GLuint shader) { typedef GLboolean (QGLF_APIENTRYP type_glIsShader)(GLuint shader); @@ -2765,7 +2765,7 @@ static GLboolean qglfResolveIsShader(GLuint shader) return funcs->isShader(shader); } -static void qglfResolveLinkProgram(GLuint program) +static void QGLF_APIENTRY qglfResolveLinkProgram(GLuint program) { typedef void (QGLF_APIENTRYP type_glLinkProgram)(GLuint program); @@ -2785,11 +2785,11 @@ static void qglfResolveLinkProgram(GLuint program) funcs->linkProgram = qglfResolveLinkProgram; } -static void qglfSpecialReleaseShaderCompiler() +static void QGLF_APIENTRY qglfSpecialReleaseShaderCompiler() { } -static void qglfResolveReleaseShaderCompiler() +static void QGLF_APIENTRY qglfResolveReleaseShaderCompiler() { typedef void (QGLF_APIENTRYP type_glReleaseShaderCompiler)(); @@ -2809,7 +2809,7 @@ static void qglfResolveReleaseShaderCompiler() funcs->releaseShaderCompiler(); } -static void qglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) +static void QGLF_APIENTRY qglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) { typedef void (QGLF_APIENTRYP type_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); @@ -2839,7 +2839,7 @@ static void qglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, funcs->renderbufferStorage = qglfResolveRenderbufferStorage; } -static void qglfResolveSampleCoverage(GLclampf value, GLboolean invert) +static void QGLF_APIENTRY qglfResolveSampleCoverage(GLclampf value, GLboolean invert) { typedef void (QGLF_APIENTRYP type_glSampleCoverage)(GLclampf value, GLboolean invert); @@ -2869,7 +2869,7 @@ static void qglfResolveSampleCoverage(GLclampf value, GLboolean invert) funcs->sampleCoverage = qglfResolveSampleCoverage; } -static void qglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length) +static void QGLF_APIENTRY qglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length) { typedef void (QGLF_APIENTRYP type_glShaderBinary)(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length); @@ -2889,7 +2889,7 @@ static void qglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binar funcs->shaderBinary = qglfResolveShaderBinary; } -static void qglfResolveShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length) +static void QGLF_APIENTRY qglfResolveShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length) { typedef void (QGLF_APIENTRYP type_glShaderSource)(GLuint shader, GLsizei count, const char** string, const GLint* length); @@ -2909,7 +2909,7 @@ static void qglfResolveShaderSource(GLuint shader, GLsizei count, const char** s funcs->shaderSource = qglfResolveShaderSource; } -static void qglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) +static void QGLF_APIENTRY qglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) { typedef void (QGLF_APIENTRYP type_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); @@ -2939,7 +2939,7 @@ static void qglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, funcs->stencilFuncSeparate = qglfResolveStencilFuncSeparate; } -static void qglfResolveStencilMaskSeparate(GLenum face, GLuint mask) +static void QGLF_APIENTRY qglfResolveStencilMaskSeparate(GLenum face, GLuint mask) { typedef void (QGLF_APIENTRYP type_glStencilMaskSeparate)(GLenum face, GLuint mask); @@ -2969,7 +2969,7 @@ static void qglfResolveStencilMaskSeparate(GLenum face, GLuint mask) funcs->stencilMaskSeparate = qglfResolveStencilMaskSeparate; } -static void qglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) +static void QGLF_APIENTRY qglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) { typedef void (QGLF_APIENTRYP type_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); @@ -2999,7 +2999,7 @@ static void qglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, funcs->stencilOpSeparate = qglfResolveStencilOpSeparate; } -static void qglfResolveUniform1f(GLint location, GLfloat x) +static void QGLF_APIENTRY qglfResolveUniform1f(GLint location, GLfloat x) { typedef void (QGLF_APIENTRYP type_glUniform1f)(GLint location, GLfloat x); @@ -3019,7 +3019,7 @@ static void qglfResolveUniform1f(GLint location, GLfloat x) funcs->uniform1f = qglfResolveUniform1f; } -static void qglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* v) +static void QGLF_APIENTRY qglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* v) { typedef void (QGLF_APIENTRYP type_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v); @@ -3039,7 +3039,7 @@ static void qglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* funcs->uniform1fv = qglfResolveUniform1fv; } -static void qglfResolveUniform1i(GLint location, GLint x) +static void QGLF_APIENTRY qglfResolveUniform1i(GLint location, GLint x) { typedef void (QGLF_APIENTRYP type_glUniform1i)(GLint location, GLint x); @@ -3059,7 +3059,7 @@ static void qglfResolveUniform1i(GLint location, GLint x) funcs->uniform1i = qglfResolveUniform1i; } -static void qglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v) +static void QGLF_APIENTRY qglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v) { typedef void (QGLF_APIENTRYP type_glUniform1iv)(GLint location, GLsizei count, const GLint* v); @@ -3079,7 +3079,7 @@ static void qglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v) funcs->uniform1iv = qglfResolveUniform1iv; } -static void qglfResolveUniform2f(GLint location, GLfloat x, GLfloat y) +static void QGLF_APIENTRY qglfResolveUniform2f(GLint location, GLfloat x, GLfloat y) { typedef void (QGLF_APIENTRYP type_glUniform2f)(GLint location, GLfloat x, GLfloat y); @@ -3099,7 +3099,7 @@ static void qglfResolveUniform2f(GLint location, GLfloat x, GLfloat y) funcs->uniform2f = qglfResolveUniform2f; } -static void qglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* v) +static void QGLF_APIENTRY qglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* v) { typedef void (QGLF_APIENTRYP type_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v); @@ -3119,7 +3119,7 @@ static void qglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* funcs->uniform2fv = qglfResolveUniform2fv; } -static void qglfResolveUniform2i(GLint location, GLint x, GLint y) +static void QGLF_APIENTRY qglfResolveUniform2i(GLint location, GLint x, GLint y) { typedef void (QGLF_APIENTRYP type_glUniform2i)(GLint location, GLint x, GLint y); @@ -3139,7 +3139,7 @@ static void qglfResolveUniform2i(GLint location, GLint x, GLint y) funcs->uniform2i = qglfResolveUniform2i; } -static void qglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v) +static void QGLF_APIENTRY qglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v) { typedef void (QGLF_APIENTRYP type_glUniform2iv)(GLint location, GLsizei count, const GLint* v); @@ -3159,7 +3159,7 @@ static void qglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v) funcs->uniform2iv = qglfResolveUniform2iv; } -static void qglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) +static void QGLF_APIENTRY qglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) { typedef void (QGLF_APIENTRYP type_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z); @@ -3179,7 +3179,7 @@ static void qglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z funcs->uniform3f = qglfResolveUniform3f; } -static void qglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* v) +static void QGLF_APIENTRY qglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* v) { typedef void (QGLF_APIENTRYP type_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v); @@ -3199,7 +3199,7 @@ static void qglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* funcs->uniform3fv = qglfResolveUniform3fv; } -static void qglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z) +static void QGLF_APIENTRY qglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z) { typedef void (QGLF_APIENTRYP type_glUniform3i)(GLint location, GLint x, GLint y, GLint z); @@ -3219,7 +3219,7 @@ static void qglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z) funcs->uniform3i = qglfResolveUniform3i; } -static void qglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v) +static void QGLF_APIENTRY qglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v) { typedef void (QGLF_APIENTRYP type_glUniform3iv)(GLint location, GLsizei count, const GLint* v); @@ -3239,7 +3239,7 @@ static void qglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v) funcs->uniform3iv = qglfResolveUniform3iv; } -static void qglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +static void QGLF_APIENTRY qglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { typedef void (QGLF_APIENTRYP type_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); @@ -3259,7 +3259,7 @@ static void qglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z funcs->uniform4f = qglfResolveUniform4f; } -static void qglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* v) +static void QGLF_APIENTRY qglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* v) { typedef void (QGLF_APIENTRYP type_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v); @@ -3279,7 +3279,7 @@ static void qglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* funcs->uniform4fv = qglfResolveUniform4fv; } -static void qglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) +static void QGLF_APIENTRY qglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) { typedef void (QGLF_APIENTRYP type_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w); @@ -3299,7 +3299,7 @@ static void qglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLin funcs->uniform4i = qglfResolveUniform4i; } -static void qglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v) +static void QGLF_APIENTRY qglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v) { typedef void (QGLF_APIENTRYP type_glUniform4iv)(GLint location, GLsizei count, const GLint* v); @@ -3319,7 +3319,7 @@ static void qglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v) funcs->uniform4iv = qglfResolveUniform4iv; } -static void qglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) +static void QGLF_APIENTRY qglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) { typedef void (QGLF_APIENTRYP type_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); @@ -3339,7 +3339,7 @@ static void qglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean funcs->uniformMatrix2fv = qglfResolveUniformMatrix2fv; } -static void qglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) +static void QGLF_APIENTRY qglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) { typedef void (QGLF_APIENTRYP type_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); @@ -3359,7 +3359,7 @@ static void qglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean funcs->uniformMatrix3fv = qglfResolveUniformMatrix3fv; } -static void qglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) +static void QGLF_APIENTRY qglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) { typedef void (QGLF_APIENTRYP type_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); @@ -3379,7 +3379,7 @@ static void qglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean funcs->uniformMatrix4fv = qglfResolveUniformMatrix4fv; } -static void qglfResolveUseProgram(GLuint program) +static void QGLF_APIENTRY qglfResolveUseProgram(GLuint program) { typedef void (QGLF_APIENTRYP type_glUseProgram)(GLuint program); @@ -3399,7 +3399,7 @@ static void qglfResolveUseProgram(GLuint program) funcs->useProgram = qglfResolveUseProgram; } -static void qglfResolveValidateProgram(GLuint program) +static void QGLF_APIENTRY qglfResolveValidateProgram(GLuint program) { typedef void (QGLF_APIENTRYP type_glValidateProgram)(GLuint program); @@ -3419,7 +3419,7 @@ static void qglfResolveValidateProgram(GLuint program) funcs->validateProgram = qglfResolveValidateProgram; } -static void qglfResolveVertexAttrib1f(GLuint indx, GLfloat x) +static void QGLF_APIENTRY qglfResolveVertexAttrib1f(GLuint indx, GLfloat x) { typedef void (QGLF_APIENTRYP type_glVertexAttrib1f)(GLuint indx, GLfloat x); @@ -3439,7 +3439,7 @@ static void qglfResolveVertexAttrib1f(GLuint indx, GLfloat x) funcs->vertexAttrib1f = qglfResolveVertexAttrib1f; } -static void qglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values) +static void QGLF_APIENTRY qglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values) { typedef void (QGLF_APIENTRYP type_glVertexAttrib1fv)(GLuint indx, const GLfloat* values); @@ -3459,7 +3459,7 @@ static void qglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values) funcs->vertexAttrib1fv = qglfResolveVertexAttrib1fv; } -static void qglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) +static void QGLF_APIENTRY qglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) { typedef void (QGLF_APIENTRYP type_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y); @@ -3479,7 +3479,7 @@ static void qglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) funcs->vertexAttrib2f = qglfResolveVertexAttrib2f; } -static void qglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values) +static void QGLF_APIENTRY qglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values) { typedef void (QGLF_APIENTRYP type_glVertexAttrib2fv)(GLuint indx, const GLfloat* values); @@ -3499,7 +3499,7 @@ static void qglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values) funcs->vertexAttrib2fv = qglfResolveVertexAttrib2fv; } -static void qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) +static void QGLF_APIENTRY qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) { typedef void (QGLF_APIENTRYP type_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z); @@ -3519,7 +3519,7 @@ static void qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat funcs->vertexAttrib3f = qglfResolveVertexAttrib3f; } -static void qglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values) +static void QGLF_APIENTRY qglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values) { typedef void (QGLF_APIENTRYP type_glVertexAttrib3fv)(GLuint indx, const GLfloat* values); @@ -3539,7 +3539,7 @@ static void qglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values) funcs->vertexAttrib3fv = qglfResolveVertexAttrib3fv; } -static void qglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +static void QGLF_APIENTRY qglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { typedef void (QGLF_APIENTRYP type_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); @@ -3559,7 +3559,7 @@ static void qglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat funcs->vertexAttrib4f = qglfResolveVertexAttrib4f; } -static void qglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values) +static void QGLF_APIENTRY qglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values) { typedef void (QGLF_APIENTRYP type_glVertexAttrib4fv)(GLuint indx, const GLfloat* values); @@ -3579,7 +3579,7 @@ static void qglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values) funcs->vertexAttrib4fv = qglfResolveVertexAttrib4fv; } -static void qglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr) +static void QGLF_APIENTRY qglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr) { typedef void (QGLF_APIENTRYP type_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr); diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h index 44d9bad9fa9..759af4f939f 100644 --- a/src/opengl/qglfunctions.h +++ b/src/opengl/qglfunctions.h @@ -59,6 +59,10 @@ QT_MODULE(OpenGL) typedef ptrdiff_t qgl_GLintptr; typedef ptrdiff_t qgl_GLsizeiptr; +#ifdef Q_WS_WIN +# define QGLF_APIENTRY APIENTRY +#endif + #ifndef Q_WS_MAC # ifndef QGLF_APIENTRYP # ifdef QGLF_APIENTRY @@ -1945,6 +1949,9 @@ inline void QGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum #ifndef GL_RGBA4 #define GL_RGBA4 0x8056 #endif +#ifndef GL_BGRA +#define GL_BGRA 0x80E1 +#endif #ifndef GL_SAMPLE_ALPHA_TO_COVERAGE #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E #endif diff --git a/src/opengl/qglpaintdevice_p.h b/src/opengl/qglpaintdevice_p.h index f4176fb2e7d..241e3091c64 100644 --- a/src/opengl/qglpaintdevice_p.h +++ b/src/opengl/qglpaintdevice_p.h @@ -90,7 +90,7 @@ protected: // Wraps a QGLWidget class QGLWidget; -class QGLWidgetGLPaintDevice : public QGLPaintDevice +class Q_OPENGL_EXPORT QGLWidgetGLPaintDevice : public QGLPaintDevice { public: QGLWidgetGLPaintDevice(); diff --git a/src/openvg/openvg.pro b/src/openvg/openvg.pro index e185949bef9..dbe1620f809 100644 --- a/src/openvg/openvg.pro +++ b/src/openvg/openvg.pro @@ -1,6 +1,9 @@ TARGET = QtOpenVG -QT += core \ - gui +QT += core-private \ + gui-private + +CONFIG += module +MODULE_PRI = ../modules/qt_openvg.pri DEFINES+=QT_BUILD_OPENVG_LIB diff --git a/src/plugins/accessible/widgets/widgets.pro b/src/plugins/accessible/widgets/widgets.pro index 092f3ca32ce..8329bce963d 100644 --- a/src/plugins/accessible/widgets/widgets.pro +++ b/src/plugins/accessible/widgets/widgets.pro @@ -2,6 +2,7 @@ TARGET = qtaccessiblewidgets include(../../qpluginbase.pri) include (../qaccessiblebase.pri) +QT += core-private gui-private DESTDIR = $$QT.gui.plugins/accessible QTDIR_build:REQUIRES += "contains(QT_CONFIG, accessibility)" diff --git a/src/plugins/bearer/connman/connman.pro b/src/plugins/bearer/connman/connman.pro index 3ac54c37699..f57a0c930bd 100644 --- a/src/plugins/bearer/connman/connman.pro +++ b/src/plugins/bearer/connman/connman.pro @@ -1,7 +1,7 @@ TARGET = qconnmanbearer include(../../qpluginbase.pri) -QT = core network dbus +QT = core network-private dbus HEADERS += qconnmanservice_linux_p.h \ qofonoservice_linux_p.h \ diff --git a/src/plugins/bearer/corewlan/corewlan.pro b/src/plugins/bearer/corewlan/corewlan.pro index ae5371a715b..adc1625c3d0 100644 --- a/src/plugins/bearer/corewlan/corewlan.pro +++ b/src/plugins/bearer/corewlan/corewlan.pro @@ -1,7 +1,7 @@ TARGET = qcorewlanbearer include(../../qpluginbase.pri) -QT = core network +QT = core-private network-private LIBS += -framework Foundation -framework SystemConfiguration contains(QT_CONFIG, corewlan) { diff --git a/src/plugins/bearer/generic/generic.pro b/src/plugins/bearer/generic/generic.pro index 94ab36ce59a..94fefaf6c29 100644 --- a/src/plugins/bearer/generic/generic.pro +++ b/src/plugins/bearer/generic/generic.pro @@ -1,7 +1,7 @@ TARGET = qgenericbearer include(../../qpluginbase.pri) -QT = core network +QT = core-private network-private HEADERS += qgenericengine.h \ ../qnetworksession_impl.h \ diff --git a/src/plugins/bearer/nativewifi/nativewifi.pro b/src/plugins/bearer/nativewifi/nativewifi.pro index 6df346cd46d..ba02f37d23f 100644 --- a/src/plugins/bearer/nativewifi/nativewifi.pro +++ b/src/plugins/bearer/nativewifi/nativewifi.pro @@ -1,7 +1,7 @@ TARGET = qnativewifibearer include(../../qpluginbase.pri) -QT = core network +QT = core-private network-private HEADERS += qnativewifiengine.h \ platformdefs.h \ diff --git a/src/plugins/bearer/networkmanager/networkmanager.pro b/src/plugins/bearer/networkmanager/networkmanager.pro index b3e088344df..a9de1561fdc 100644 --- a/src/plugins/bearer/networkmanager/networkmanager.pro +++ b/src/plugins/bearer/networkmanager/networkmanager.pro @@ -1,7 +1,7 @@ TARGET = qnmbearer include(../../qpluginbase.pri) -QT = core network dbus +QT = core network-private dbus HEADERS += qnmdbushelper.h \ qnetworkmanagerservice.h \ diff --git a/src/plugins/graphicssystems/opengl/opengl.pro b/src/plugins/graphicssystems/opengl/opengl.pro index fb3cb5331ad..30c88271b69 100644 --- a/src/plugins/graphicssystems/opengl/opengl.pro +++ b/src/plugins/graphicssystems/opengl/opengl.pro @@ -1,7 +1,7 @@ TARGET = qglgraphicssystem include(../../qpluginbase.pri) -QT += opengl +QT += core-private gui-private opengl-private DESTDIR = $$QT.gui.plugins/graphicssystems diff --git a/src/plugins/graphicssystems/trace/trace.pro b/src/plugins/graphicssystems/trace/trace.pro index 0958a86973d..b31beb35f82 100644 --- a/src/plugins/graphicssystems/trace/trace.pro +++ b/src/plugins/graphicssystems/trace/trace.pro @@ -1,7 +1,7 @@ TARGET = qtracegraphicssystem include(../../qpluginbase.pri) -QT += network +QT += core-private gui-private network DESTDIR = $$QT.gui.plugins/graphicssystems symbian:TARGET.UID3 = 0x2002130E diff --git a/src/plugins/imageformats/jpeg/jpeg.pro b/src/plugins/imageformats/jpeg/jpeg.pro index 3a0e8754c06..1e6c24d061c 100644 --- a/src/plugins/imageformats/jpeg/jpeg.pro +++ b/src/plugins/imageformats/jpeg/jpeg.pro @@ -1,6 +1,8 @@ TARGET = qjpeg include(../../qpluginbase.pri) +QT += core-private + QTDIR_build:REQUIRES = "!contains(QT_CONFIG, no-jpeg)" include(../../../gui/image/qjpeghandler.pri) diff --git a/src/plugins/platforms/minimal/minimal.pro b/src/plugins/platforms/minimal/minimal.pro index c8329387bf7..d1088e32338 100644 --- a/src/plugins/platforms/minimal/minimal.pro +++ b/src/plugins/platforms/minimal/minimal.pro @@ -1,6 +1,7 @@ TARGET = qminimal include(../../qpluginbase.pri) +QT = core-private gui-private DESTDIR = $$QT.gui.plugins/platforms SOURCES = main.cpp \ diff --git a/src/plugins/platforms/uikit/quikiteventloop.mm b/src/plugins/platforms/uikit/quikiteventloop.mm index 8d2603c60df..2b9728cea5a 100644 --- a/src/plugins/platforms/uikit/quikiteventloop.mm +++ b/src/plugins/platforms/uikit/quikiteventloop.mm @@ -69,13 +69,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { Q_UNUSED(launchOptions) + Q_UNUSED(application) foreach (QWidget *widget, qApp->topLevelWidgets()) { - QRect geom = widget->geometry(); - CGRect bar = application.statusBarFrame; - if (geom.y() <= bar.size.height) { - geom.setY(bar.size.height); - widget->setGeometry(geom); - } QUIKitWindow *platformWindow = static_cast(widget->platformWindow()); platformWindow->ensureNativeWindow(); } diff --git a/src/plugins/platforms/uikit/quikitintegration.mm b/src/plugins/platforms/uikit/quikitintegration.mm index d4b4192b608..3a432d11a46 100644 --- a/src/plugins/platforms/uikit/quikitintegration.mm +++ b/src/plugins/platforms/uikit/quikitintegration.mm @@ -66,7 +66,7 @@ QUIKitIntegration::~QUIKitIntegration() QPixmapData *QUIKitIntegration::createPixmapData(QPixmapData::PixelType type) const { - return new QRasterPixmapData(type); + return new QRasterPixmapData(type); } QPlatformWindow *QUIKitIntegration::createPlatformWindow(QWidget *widget, WId winId) const diff --git a/src/plugins/platforms/uikit/quikitscreen.mm b/src/plugins/platforms/uikit/quikitscreen.mm index 21494c9385f..78389f21fde 100644 --- a/src/plugins/platforms/uikit/quikitscreen.mm +++ b/src/plugins/platforms/uikit/quikitscreen.mm @@ -54,7 +54,7 @@ QUIKitScreen::QUIKitScreen(int screenIndex) NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; UIScreen *screen = [[UIScreen screens] objectAtIndex:screenIndex]; CGRect bounds = [screen bounds]; - m_geometry = QRect(0, 0, bounds.size.width, bounds.size.height); + m_geometry = QRect(bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height); m_format = QImage::Format_ARGB32; @@ -62,7 +62,7 @@ QUIKitScreen::QUIKitScreen(int screenIndex) const qreal inch = 25.4; qreal dpi = 160.; - int dragDistance = 14; + int dragDistance = 12; if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { dpi = 132.; dragDistance = 10; diff --git a/src/plugins/platforms/uikit/quikitwindow.h b/src/plugins/platforms/uikit/quikitwindow.h index 9e73754fc8c..5c6496a2ce0 100644 --- a/src/plugins/platforms/uikit/quikitwindow.h +++ b/src/plugins/platforms/uikit/quikitwindow.h @@ -47,6 +47,8 @@ #import #import #import +#import +#import #import @interface EAGLView : UIView @@ -59,6 +61,7 @@ GLuint mFramebuffer, mColorRenderbuffer, mDepthRenderbuffer; + id delegate; // ------- Text Input ---------- UITextAutocapitalizationType autocapitalizationType; UITextAutocorrectionType autocorrectionType; @@ -77,6 +80,8 @@ - (void)setWindow:(QPlatformWindow *)window; - (void)sendMouseEventForTouches:(NSSet *)touches withEvent:(UIEvent *)event fakeButtons:(Qt::MouseButtons)buttons; +@property (readonly,getter=fbo) GLint fbo; +@property (nonatomic, assign) id delegate; // ------- Text Input ---------- @@ -90,6 +95,10 @@ @end +@protocol EAGLViewDelegate +- (void)eaglView:(EAGLView *)view usesFramebuffer:(GLuint)buffer; +@end + class EAGLPlatformContext; QT_BEGIN_NAMESPACE @@ -103,7 +112,7 @@ public: ~QUIKitWindow(); UIWindow *nativeWindow() const { return mWindow; } - UIView *nativeView() const { return mView; } + EAGLView *nativeView() const { return mView; } void setGeometry(const QRect &rect); UIWindow *ensureNativeWindow(); diff --git a/src/plugins/platforms/uikit/quikitwindow.mm b/src/plugins/platforms/uikit/quikitwindow.mm index 52d184636e5..1f57baad690 100644 --- a/src/plugins/platforms/uikit/quikitwindow.mm +++ b/src/plugins/platforms/uikit/quikitwindow.mm @@ -79,7 +79,11 @@ public: mFormat.setStereo(false); mFormat.setDirectRendering(false); +#if defined(QT_OPENGL_ES_2) + EAGLContext *aContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; +#else EAGLContext *aContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; +#endif [mView setContext:aContext]; } @@ -116,6 +120,8 @@ private: @implementation EAGLView +@synthesize delegate; + + (Class)layerClass { return [CAEAGLLayer class]; @@ -156,8 +162,8 @@ private: { if (mContext) { [EAGLContext setCurrentContext:mContext]; - glBindRenderbufferOES(GL_RENDERBUFFER_OES, mColorRenderbuffer); - [mContext presentRenderbuffer:GL_RENDERBUFFER_OES]; + glBindRenderbuffer(GL_RENDERBUFFER, mColorRenderbuffer); + [mContext presentRenderbuffer:GL_RENDERBUFFER]; } } @@ -167,15 +173,15 @@ private: { [EAGLContext setCurrentContext:mContext]; if (mFramebuffer) { - glDeleteFramebuffersOES(1, &mFramebuffer); + glDeleteFramebuffers(1, &mFramebuffer); mFramebuffer = 0; } if (mColorRenderbuffer) { - glDeleteRenderbuffersOES(1, &mColorRenderbuffer); + glDeleteRenderbuffers(1, &mColorRenderbuffer); mColorRenderbuffer = 0; } if (mDepthRenderbuffer) { - glDeleteRenderbuffersOES(1, &mDepthRenderbuffer); + glDeleteRenderbuffers(1, &mDepthRenderbuffer); mDepthRenderbuffer = 0; } } @@ -186,24 +192,27 @@ private: if (mContext && !mFramebuffer) { [EAGLContext setCurrentContext:mContext]; - glGenFramebuffersOES(1, &mFramebuffer); - glBindFramebufferOES(GL_FRAMEBUFFER_OES, mFramebuffer); + glGenFramebuffers(1, &mFramebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer); - glGenRenderbuffersOES(1, &mColorRenderbuffer); - glBindRenderbufferOES(GL_RENDERBUFFER_OES, mColorRenderbuffer); - [mContext renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer *)self.layer]; - glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &mFramebufferWidth); - glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &mFramebufferHeight); - glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, mColorRenderbuffer); + glGenRenderbuffers(1, &mColorRenderbuffer); + glBindRenderbuffer(GL_RENDERBUFFER, mColorRenderbuffer); + [mContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer *)self.layer]; + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &mFramebufferWidth); + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &mFramebufferHeight); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, mColorRenderbuffer); - glGenRenderbuffersOES(1, &mDepthRenderbuffer); - glBindRenderbufferOES(GL_RENDERBUFFER_OES, mDepthRenderbuffer); - glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH24_STENCIL8_OES, mFramebufferWidth, mFramebufferHeight); - glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, mDepthRenderbuffer); - glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_STENCIL_ATTACHMENT_OES, GL_RENDERBUFFER_OES, mDepthRenderbuffer); + glGenRenderbuffers(1, &mDepthRenderbuffer); + glBindRenderbuffer(GL_RENDERBUFFER, mDepthRenderbuffer); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, mFramebufferWidth, mFramebufferHeight); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, mDepthRenderbuffer); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, mDepthRenderbuffer); - if (glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) - NSLog(@"Failed to make complete framebuffer object %x", glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES)); + if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) + NSLog(@"Failed to make complete framebuffer object %x", glCheckFramebufferStatus(GL_FRAMEBUFFER)); + if (delegate && [delegate respondsToSelector:@selector(eaglView:usesFramebuffer:)]) { + [delegate eaglView:self usesFramebuffer:mFramebuffer]; + } } } @@ -214,11 +223,16 @@ private: [EAGLContext setCurrentContext:mContext]; if (!mFramebuffer) [self createFramebuffer]; - glBindFramebufferOES(GL_FRAMEBUFFER_OES, mFramebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer); glViewport(0, 0, mFramebufferWidth, mFramebufferHeight); } } +- (GLint)fbo +{ + return mFramebuffer; +} + - (void)setWindow:(QPlatformWindow *)window { mWindow = window; @@ -322,6 +336,7 @@ QUIKitWindow::QUIKitWindow(QWidget *tlw) : CGRect screenBounds = [mScreen->uiScreen() bounds]; QRect geom(screenBounds.origin.x, screenBounds.origin.y, screenBounds.size.width, screenBounds.size.height); setGeometry(geom); + mView = [[EAGLView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)]; // TODO ensure the native window if the application is already running } @@ -334,7 +349,7 @@ QUIKitWindow::~QUIKitWindow() void QUIKitWindow::setGeometry(const QRect &rect) { - if (mWindow) { + if (mWindow && rect != geometry()) { mWindow.frame = CGRectMake(rect.x(), rect.y(), rect.width(), rect.height()); mView.frame = CGRectMake(0, 0, rect.width(), rect.height()); [mView deleteFramebuffer]; @@ -347,14 +362,16 @@ UIWindow *QUIKitWindow::ensureNativeWindow() { if (!mWindow) { // window - QRect geom = geometry(); - CGRect frame = CGRectMake(geom.x(), geom.y(), geom.width(), geom.height()); - mWindow = [[UIWindow alloc] initWithFrame:frame]; + CGRect frame = [mScreen->uiScreen() applicationFrame]; + QRect geom = QRect(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); + widget()->setGeometry(geom); + mWindow = [[UIWindow alloc] init]; mWindow.screen = mScreen->uiScreen(); - mWindow.frame = frame; // for some reason setting the screen resets frame.origin + mWindow.frame = frame; // for some reason setting the screen resets frame.origin, so we need to set the frame afterwards // view - mView = [[EAGLView alloc] initWithFrame:CGRectMake(0, 0, geom.width(), geom.height())]; + [mView deleteFramebuffer]; + mView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height); // fill [mView setMultipleTouchEnabled:YES]; [mView setWindow:this]; [mWindow addSubview:mView]; diff --git a/src/plugins/platforms/uikit/quikitwindowsurface.mm b/src/plugins/platforms/uikit/quikitwindowsurface.mm index bb7dcd794b7..8caa15fbbe9 100644 --- a/src/plugins/platforms/uikit/quikitwindowsurface.mm +++ b/src/plugins/platforms/uikit/quikitwindowsurface.mm @@ -47,27 +47,64 @@ #include +class EAGLPaintDevice; + +@interface PaintDeviceHelper : NSObject { + EAGLPaintDevice *device; +} + +@property (nonatomic, assign) EAGLPaintDevice *device; + +- (void)eaglView:(EAGLView *)view usesFramebuffer:(GLuint)buffer; + +@end + class EAGLPaintDevice : public QGLPaintDevice { public: EAGLPaintDevice(QPlatformWindow *window) :QGLPaintDevice(), mWindow(window) { +#if defined(QT_OPENGL_ES_2) + helper = [[PaintDeviceHelper alloc] init]; + helper.device = this; + EAGLView *view = static_cast(window)->nativeView(); + view.delegate = helper; + m_thisFBO = view.fbo; +#endif } + ~EAGLPaintDevice() + { +#if defined(QT_OPENGL_ES_2) + [helper release]; +#endif + } + + void setFramebuffer(GLuint buffer) { m_thisFBO = buffer; } int devType() const { return QInternal::OpenGL; } QSize size() const { return mWindow->geometry().size(); } QGLContext* context() const { return QGLContext::fromPlatformGLContext(mWindow->glContext()); } QPaintEngine *paintEngine() const { return qt_qgl_paint_engine(); } - void beginPaint(){ - QGLPaintDevice::beginPaint(); - } private: QPlatformWindow *mWindow; + PaintDeviceHelper *helper; }; +@implementation PaintDeviceHelper +@synthesize device; + +- (void)eaglView:(EAGLView *)view usesFramebuffer:(GLuint)buffer +{ + Q_UNUSED(view) + if (device) + device->setFramebuffer(buffer); +} + +@end + QT_BEGIN_NAMESPACE QUIKitWindowSurface::QUIKitWindowSurface(QWidget *window) diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.cpp b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.cpp index 39e7be5ac61..ddd17636c1d 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.cpp +++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.cpp @@ -49,7 +49,6 @@ QWaylandEglIntegration::QWaylandEglIntegration(struct wl_display *waylandDisplay) : mWaylandDisplay(waylandDisplay) - , mNativeEglDisplay(wl_egl_display_create(mWaylandDisplay)) { qDebug() << "Using Wayland-EGL"; } @@ -63,7 +62,7 @@ QWaylandEglIntegration::~QWaylandEglIntegration() void QWaylandEglIntegration::initialize() { EGLint major,minor; - mEglDisplay = eglGetDisplay((EGLNativeDisplayType)mNativeEglDisplay); + mEglDisplay = eglGetDisplay(mWaylandDisplay); if (mEglDisplay == NULL) { qWarning("EGL not available"); } else { @@ -84,11 +83,6 @@ EGLDisplay QWaylandEglIntegration::eglDisplay() const return mEglDisplay; } -wl_egl_display * QWaylandEglIntegration::nativeDisplay() const -{ - return mNativeEglDisplay; -} - QWaylandGLIntegration *QWaylandGLIntegration::createGLIntegration(QWaylandDisplay *waylandDisplay) { return new QWaylandEglIntegration(waylandDisplay->wl_display()); diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.h b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.h index bf4c3fe45cb..3a26f97b320 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.h +++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.h @@ -65,9 +65,6 @@ private: struct wl_display *mWaylandDisplay; EGLDisplay mEglDisplay; - struct wl_egl_display *mNativeEglDisplay; - - }; #endif // QWAYLANDEGLINTEGRATION_H diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp index d7cf0a55e1c..cf52f39d15f 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp +++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp @@ -103,7 +103,7 @@ void QWaylandEglWindow::newSurfaceCreated() if (!size.isValid()) size = QSize(0,0); - mWaylandEglWindow = wl_egl_window_create(mEglIntegration->nativeDisplay(),mSurface,size.width(),size.height(),visual); + mWaylandEglWindow = wl_egl_window_create(mSurface,size.width(),size.height(),visual); if (mGLContext) { EGLNativeWindowType window(reinterpret_cast(mWaylandEglWindow)); EGLSurface surface = eglCreateWindowSurface(mEglIntegration->eglDisplay(),mGLContext->eglConfig(),window,NULL); diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.h b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.h index 549d039bf8b..856321dec82 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.h +++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.h @@ -63,7 +63,6 @@ private: QWaylandEglIntegration *mEglIntegration; QWaylandGLContext *mGLContext; struct wl_egl_window *mWaylandEglWindow; - EGLConfig mConfig; const QWaylandWindow *mParentWindow; }; diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/wayland_egl.pri b/src/plugins/platforms/wayland/gl_integration/wayland_egl/wayland_egl.pri index bc978645c4a..cd0701150fe 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/wayland_egl.pri +++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/wayland_egl.pri @@ -1,12 +1,11 @@ +include (../../../eglconvenience/eglconvenience.pri) + LIBS += -lwayland-egl -lEGL INCLUDEPATH += $$PWD SOURCES += $$PWD/qwaylandeglintegration.cpp \ $$PWD/qwaylandglcontext.cpp \ - $$PWD/qwaylandeglwindow.cpp \ - $$PWD/../../../eglconvenience/qeglconvenience.cpp + $$PWD/qwaylandeglwindow.cpp HEADERS += $$PWD/qwaylandeglintegration.h \ $$PWD/qwaylandglcontext.h \ - $$PWD/qwaylandeglwindow.h \ - $$PWD/../../../eglconvenience/qeglconvenience.h \ - gl_integration/wayland_egl/qwaylandeglinclude.h + $$PWD/qwaylandeglwindow.h diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp index 95b4112cdcd..7537b52d598 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp @@ -111,9 +111,9 @@ const struct wl_xcomposite_listener QWaylandXCompositeEGLIntegration::xcomposite void QWaylandXCompositeEGLIntegration::wlDisplayHandleGlobal(wl_display *display, uint32_t id, const char *interface, uint32_t version, void *data) { Q_UNUSED(version); - if (strcmp(interface, "xcomposite") == 0) { + if (strcmp(interface, "wl_xcomposite") == 0) { QWaylandXCompositeEGLIntegration *integration = static_cast(data); - integration->mWaylandComposite = wl_xcomposite_create(display,id); + integration->mWaylandComposite = wl_xcomposite_create(display,id,1); wl_xcomposite_add_listener(integration->mWaylandComposite,&xcomposite_listener,integration); } diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.cpp index 43c0135c6e7..5cb6ef336bc 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.cpp +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.cpp @@ -106,9 +106,9 @@ const struct wl_xcomposite_listener QWaylandXCompositeGLXIntegration::xcomposite void QWaylandXCompositeGLXIntegration::wlDisplayHandleGlobal(wl_display *display, uint32_t id, const char *interface, uint32_t version, void *data) { Q_UNUSED(version); - if (strcmp(interface, "xcomposite") == 0) { + if (strcmp(interface, "wl_xcomposite") == 0) { QWaylandXCompositeGLXIntegration *integration = static_cast(data); - integration->mWaylandComposite = wl_xcomposite_create(display,id); + integration->mWaylandComposite = wl_xcomposite_create(display,id,1); wl_xcomposite_add_listener(integration->mWaylandComposite,&xcomposite_listener,integration); } diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_share/wayland-xcomposite-client-protocol.h b/src/plugins/platforms/wayland/gl_integration/xcomposite_share/wayland-xcomposite-client-protocol.h index 72376e1dcb1..85da7a95212 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_share/wayland-xcomposite-client-protocol.h +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_share/wayland-xcomposite-client-protocol.h @@ -39,7 +39,6 @@ ** ****************************************************************************/ - #ifndef XCOMPOSITE_CLIENT_PROTOCOL_H #define XCOMPOSITE_CLIENT_PROTOCOL_H @@ -55,84 +54,63 @@ struct wl_client; struct wl_xcomposite; -struct wl_proxy; - -extern void -wl_proxy_marshal(struct wl_proxy *p, uint32_t opcode, ...); -extern struct wl_proxy * -wl_proxy_create(struct wl_proxy *factory, - const struct wl_interface *interface); -extern struct wl_proxy * -wl_proxy_create_for_id(struct wl_display *display, - const struct wl_interface *interface, uint32_t id); -extern void -wl_proxy_destroy(struct wl_proxy *proxy); - -extern int -wl_proxy_add_listener(struct wl_proxy *proxy, - void (**implementation)(void), void *data); - -extern void -wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data); - -extern void * -wl_proxy_get_user_data(struct wl_proxy *proxy); - extern const struct wl_interface wl_xcomposite_interface; struct wl_xcomposite_listener { void (*root)(void *data, - struct wl_xcomposite *xcomposite, + struct wl_xcomposite *wl_xcomposite, const char *display_name, uint32_t root_window); }; static inline int -wl_xcomposite_add_listener(struct wl_xcomposite *xcomposite, - const struct wl_xcomposite_listener *listener, void *data) +wl_xcomposite_add_listener(struct wl_xcomposite *wl_xcomposite, + const struct wl_xcomposite_listener *listener, void *data) { - return wl_proxy_add_listener((struct wl_proxy *) xcomposite, + return wl_proxy_add_listener((struct wl_proxy *) wl_xcomposite, (void (**)(void)) listener, data); } #define WL_XCOMPOSITE_CREATE_BUFFER 0 static inline struct wl_xcomposite * -wl_xcomposite_create(struct wl_display *display, uint32_t id) +wl_xcomposite_create(struct wl_display *display, uint32_t id, uint32_t version) { + wl_display_bind(display, id, "wl_xcomposite", version); + return (struct wl_xcomposite *) wl_proxy_create_for_id(display, &wl_xcomposite_interface, id); } static inline void -wl_xcomposite_set_user_data(struct wl_xcomposite *xcomposite, void *user_data) +wl_xcomposite_set_user_data(struct wl_xcomposite *wl_xcomposite, void *user_data) { - wl_proxy_set_user_data((struct wl_proxy *) xcomposite, user_data); + wl_proxy_set_user_data((struct wl_proxy *) wl_xcomposite, user_data); } static inline void * -wl_xcomposite_get_user_data(struct wl_xcomposite *xcomposite) +wl_xcomposite_get_user_data(struct wl_xcomposite *wl_xcomposite) { - return wl_proxy_get_user_data((struct wl_proxy *) xcomposite); + return wl_proxy_get_user_data((struct wl_proxy *) wl_xcomposite); } static inline void -wl_xcomposite_destroy(struct wl_xcomposite *xcomposite) +wl_xcomposite_destroy(struct wl_xcomposite *wl_xcomposite) { - wl_proxy_destroy((struct wl_proxy *) xcomposite); + wl_proxy_destroy((struct wl_proxy *) wl_xcomposite); } static inline struct wl_buffer * -wl_xcomposite_create_buffer(struct wl_xcomposite *xcomposite, uint32_t x_window, int width, int height, struct wl_visual *visual) +wl_xcomposite_create_buffer(struct wl_xcomposite *wl_xcomposite, uint32_t x_window, int width, int height, struct wl_visual *visual) { struct wl_proxy *id; - id = wl_proxy_create((struct wl_proxy *) xcomposite, + id = wl_proxy_create((struct wl_proxy *) wl_xcomposite, &wl_buffer_interface); if (!id) return NULL; - wl_proxy_marshal((struct wl_proxy *) xcomposite, + wl_proxy_marshal((struct wl_proxy *) wl_xcomposite, WL_XCOMPOSITE_CREATE_BUFFER, id, x_window, width, height, visual); return (struct wl_buffer *) id; diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_share/wayland-xcomposite-protocol.c b/src/plugins/platforms/wayland/gl_integration/xcomposite_share/wayland-xcomposite-protocol.c index 5c966fda46f..a1b63254cbc 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_share/wayland-xcomposite-protocol.c +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_share/wayland-xcomposite-protocol.c @@ -43,17 +43,17 @@ #include #include "wayland-util.h" -static const struct wl_message xcomposite_requests[] = { +static const struct wl_message wl_xcomposite_requests[] = { { "create_buffer", "nuiio" }, }; -static const struct wl_message xcomposite_events[] = { +static const struct wl_message wl_xcomposite_events[] = { { "root", "su" }, }; WL_EXPORT const struct wl_interface wl_xcomposite_interface = { - "xcomposite", 1, - ARRAY_LENGTH(xcomposite_requests), xcomposite_requests, - ARRAY_LENGTH(xcomposite_events), xcomposite_events, + "wl_xcomposite", 1, + ARRAY_LENGTH(wl_xcomposite_requests), wl_xcomposite_requests, + ARRAY_LENGTH(wl_xcomposite_events), wl_xcomposite_events, }; diff --git a/src/plugins/platforms/wayland/qwaylandbuffer.h b/src/plugins/platforms/wayland/qwaylandbuffer.h index 8779d5fda0d..faeb3e85b13 100644 --- a/src/plugins/platforms/wayland/qwaylandbuffer.h +++ b/src/plugins/platforms/wayland/qwaylandbuffer.h @@ -44,6 +44,7 @@ #include +#include #include class QWaylandBuffer { diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index 1c56561904d..876b46ae9a7 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -126,6 +126,7 @@ QWaylandDisplay::QWaylandDisplay(void) #ifdef QT_WAYLAND_GL_SUPPORT mEglIntegration = QWaylandGLIntegration::createGLIntegration(this); #endif + blockingReadEvents(); qRegisterMetaType("uint32_t"); @@ -216,9 +217,6 @@ void QWaylandDisplay::outputHandleGeometry(void *data, int32_t x, int32_t y, int32_t width, int32_t height) { - //call back function called from another thread; - //but its safe to call createScreen from another thread since - //QWaylandScreen does a moveToThread QWaylandDisplay *waylandDisplay = static_cast(data); QRect outputRect = QRect(x, y, width, height); waylandDisplay->createNewScreen(output,outputRect); @@ -252,17 +250,17 @@ void QWaylandDisplay::displayHandleGlobal(uint32_t id, { Q_UNUSED(version); - if (interface == "output") { - struct wl_output *output = wl_output_create(mDisplay, id); + if (interface == "wl_output") { + struct wl_output *output = wl_output_create(mDisplay, id, 1); wl_output_add_listener(output, &outputListener, this); - } else if (interface == "compositor") { - mCompositor = wl_compositor_create(mDisplay, id); - } else if (interface == "shm") { - mShm = wl_shm_create(mDisplay, id); - } else if (interface == "shell"){ - mShell = wl_shell_create(mDisplay, id); + } else if (interface == "wl_compositor") { + mCompositor = wl_compositor_create(mDisplay, id, 1); + } else if (interface == "wl_shm") { + mShm = wl_shm_create(mDisplay, id, 1); + } else if (interface == "wl_shell"){ + mShell = wl_shell_create(mDisplay, id, 1); wl_shell_add_listener(mShell, &shellListener, this); - } else if (interface == "input_device") { + } else if (interface == "wl_input_device") { QWaylandInputDevice *inputDevice = new QWaylandInputDevice(mDisplay, id); mInputDevices.append(inputDevice); diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index 6c2f341f642..f9e7c958611 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -61,7 +61,7 @@ QWaylandInputDevice::QWaylandInputDevice(struct wl_display *display, uint32_t id) : mDisplay(display) - , mInputDevice(wl_input_device_create(display, id)) + , mInputDevice(wl_input_device_create(display, id, 1)) , mPointerFocus(NULL) , mKeyboardFocus(NULL) , mButtons(0) @@ -101,6 +101,12 @@ void QWaylandInputDevice::inputHandleMotion(void *data, QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data; QWaylandWindow *window = inputDevice->mPointerFocus; + if (window == NULL) { + /* We destroyed the pointer focus surface, but the server + * didn't get the message yet. */ + return; + } + inputDevice->mSurfacePos = QPoint(surface_x, surface_y); inputDevice->mGlobalPos = QPoint(x, y); inputDevice->mTime = time; @@ -120,6 +126,12 @@ void QWaylandInputDevice::inputHandleButton(void *data, QWaylandWindow *window = inputDevice->mPointerFocus; Qt::MouseButton qt_button; + if (window == NULL) { + /* We destroyed the pointer focus surface, but the server + * didn't get the message yet. */ + return; + } + switch (button) { case 272: qt_button = Qt::LeftButton; @@ -229,6 +241,12 @@ void QWaylandInputDevice::inputHandleKey(void *data, QEvent::Type type; char s[2]; + if (window == NULL) { + /* We destroyed the keyboard focus surface, but the server + * didn't get the message yet. */ + return; + } + code = key + inputDevice->mXkb->min_key_code; level = 0; @@ -250,9 +268,6 @@ void QWaylandInputDevice::inputHandleKey(void *data, sym = translateKey(sym, s, sizeof s); - qWarning("keycode %d, sym %d, string %d, modifiers 0x%x", - code, sym, s[0], (int) inputDevice->mModifiers); - if (window) { QWindowSystemInterface::handleKeyEvent(window->widget(), time, type, sym, diff --git a/src/plugins/platforms/wayland/qwaylandintegration.cpp b/src/plugins/platforms/wayland/qwaylandintegration.cpp index 3f3ee5e5714..b6401f6d06f 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.cpp +++ b/src/plugins/platforms/wayland/qwaylandintegration.cpp @@ -44,6 +44,7 @@ #include "qwaylanddisplay.h" #include "qwaylandshmsurface.h" #include "qwaylandshmwindow.h" +#include "qwaylandnativeinterface.h" #include "qgenericunixfontdatabase.h" @@ -62,9 +63,15 @@ QWaylandIntegration::QWaylandIntegration(bool useOpenGL) : mFontDb(new QGenericUnixFontDatabase()) , mDisplay(new QWaylandDisplay()) , mUseOpenGL(useOpenGL) + , mNativeInterface(new QWaylandNativeInterface) { } +QPlatformNativeInterface * QWaylandIntegration::nativeInterface() const +{ + return mNativeInterface; +} + QList QWaylandIntegration::screens() const { diff --git a/src/plugins/platforms/wayland/qwaylandintegration.h b/src/plugins/platforms/wayland/qwaylandintegration.h index fc9b8d6a6e0..71f6d9c7b3b 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.h +++ b/src/plugins/platforms/wayland/qwaylandintegration.h @@ -63,12 +63,15 @@ public: QPlatformFontDatabase *fontDatabase() const; + QPlatformNativeInterface *nativeInterface() const; + private: bool hasOpenGL() const; QPlatformFontDatabase *mFontDb; QWaylandDisplay *mDisplay; bool mUseOpenGL; + QPlatformNativeInterface *mNativeInterface; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp b/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp new file mode 100644 index 00000000000..c3bfba03cc2 --- /dev/null +++ b/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qwaylandnativeinterface.h" + +#include "qwaylanddisplay.h" +#include "qwaylandwindow.h" +#include + +void *QWaylandNativeInterface::nativeResourceForWidget(const QByteArray &resourceString, QWidget *widget) +{ + QByteArray lowerCaseResource = resourceString.toLower(); + + if (lowerCaseResource == "display") + return qPlatformScreenForWidget(widget)->display()->wl_display(); + if (lowerCaseResource == "surface") { + return ((QWaylandWindow *) widget->platformWindow())->wl_surface(); + } + + return NULL; +} + + +QWaylandScreen * QWaylandNativeInterface::qPlatformScreenForWidget(QWidget *widget) +{ + QWaylandScreen *screen; + + if (widget) { + screen = static_cast(QPlatformScreen::platformScreenForWidget(widget)); + } else { + screen = static_cast(QApplicationPrivate::platformIntegration()->screens()[0]); + } + return screen; +} diff --git a/src/plugins/platforms/wayland/qwaylandnativeinterface.h b/src/plugins/platforms/wayland/qwaylandnativeinterface.h new file mode 100644 index 00000000000..ac4cdb9a228 --- /dev/null +++ b/src/plugins/platforms/wayland/qwaylandnativeinterface.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDNATIVEINTERFACE_H +#define QWAYLANDNATIVEINTERFACE_H + +#include "qwaylandscreen.h" + +#include + +class QWaylandNativeInterface : public QPlatformNativeInterface +{ +public: + void *nativeResourceForWidget(const QByteArray &resourceString, + QWidget *widget); + +private: + static QWaylandScreen *qPlatformScreenForWidget(QWidget *widget); +}; + + +#endif // QWAYLANDNATIVEINTERFACE_H diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 6f522911d78..53f2f483e95 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -146,6 +146,7 @@ void QWaylandWindow::newSurfaceCreated() void QWaylandWindow::frameCallback(struct wl_surface *surface, void *data, uint32_t time) { Q_UNUSED(time); + Q_UNUSED(surface); QWaylandWindow *self = static_cast(data); self->mWaitingForFrameSync = false; } diff --git a/src/plugins/platforms/wayland/qwaylandwindow.h b/src/plugins/platforms/wayland/qwaylandwindow.h index 1e605088ad1..47d49a70d9e 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.h +++ b/src/plugins/platforms/wayland/qwaylandwindow.h @@ -74,6 +74,9 @@ public: void damage(const QRegion ®ion); void waitForFrameSync(); + + struct wl_surface *wl_surface() const { return mSurface; } + protected: struct wl_surface *mSurface; virtual void newSurfaceCreated(); diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland/wayland.pro index 6ca5a53e06c..3139232afe2 100644 --- a/src/plugins/platforms/wayland/wayland.pro +++ b/src/plugins/platforms/wayland/wayland.pro @@ -8,6 +8,7 @@ DEFINES += $$QMAKE_DEFINES_WAYLAND SOURCES = main.cpp \ qwaylandintegration.cpp \ + qwaylandnativeinterface.cpp \ qwaylandshmsurface.cpp \ qwaylandinputdevice.cpp \ qwaylandcursor.cpp \ @@ -17,6 +18,7 @@ SOURCES = main.cpp \ qwaylandshmwindow.cpp HEADERS = qwaylandintegration.h \ + qwaylandnativeinterface.h \ qwaylandcursor.h \ qwaylanddisplay.h \ qwaylandwindow.h \ diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index 190221c5f41..1417157bdff 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -110,7 +110,6 @@ void QGLXContext::swapBuffers() { Q_XCB_NOOP(m_screen->connection()); glXSwapBuffers(DISPLAY_FROM_XCB(m_screen), m_drawable); - doneCurrent(); Q_XCB_NOOP(m_screen->connection()); } diff --git a/src/plugins/sqldrivers/qsqldriverbase.pri b/src/plugins/sqldrivers/qsqldriverbase.pri index 64f55fda785..7399c659da1 100644 --- a/src/plugins/sqldrivers/qsqldriverbase.pri +++ b/src/plugins/sqldrivers/qsqldriverbase.pri @@ -1,5 +1,5 @@ include(../qpluginbase.pri) -QT = core sql +QT = core sql-private DESTDIR = $$QT.sql.plugins/sqldrivers target.path += $$[QT_INSTALL_PLUGINS]/sqldrivers diff --git a/src/qbase.pri b/src/qbase.pri index 4ff17630c5e..6336aa9f5c1 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -4,6 +4,9 @@ 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 diff --git a/src/qt_install.pri b/src/qt_install.pri index 268bb864f6a..17b41af1ce5 100644 --- a/src/qt_install.pri +++ b/src/qt_install.pri @@ -31,11 +31,9 @@ qt_install_headers { targ_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET INSTALLS += targ_headers - contains(QT_CONFIG,private_tests) { - private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES - private_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET/private - INSTALLS += private_headers - } + private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES + private_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET/$$eval(QT.$${MODULE}.VERSION)/private + INSTALLS += private_headers } embedded|qpa: equals(TARGET, QtGui) { diff --git a/src/sql/sql.pro b/src/sql/sql.pro index 81aa3c06c9b..f1bdd6bda1a 100644 --- a/src/sql/sql.pro +++ b/src/sql/sql.pro @@ -1,6 +1,10 @@ TARGET = QtSql QPRO_PWD = $$PWD -QT = core +QT = core-private + +CONFIG += module +MODULE_PRI = ../modules/qt_sql.pri + DEFINES += QT_BUILD_SQL_LIB DEFINES += QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x62000000 diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro index c25d23db129..311c79379b2 100644 --- a/src/testlib/testlib.pro +++ b/src/testlib/testlib.pro @@ -1,6 +1,10 @@ TARGET = QtTest QPRO_PWD = $$PWD QT = core + +CONFIG += module +MODULE_PRI = ../modules/qt_testlib.pri + INCLUDEPATH += . unix:!embedded:QMAKE_PKGCONFIG_DESCRIPTION = Qt \ Unit \ diff --git a/src/tools/bootstrap/bootstrap.pri b/src/tools/bootstrap/bootstrap.pri index f48c8c12fff..50c1af1775e 100644 --- a/src/tools/bootstrap/bootstrap.pri +++ b/src/tools/bootstrap/bootstrap.pri @@ -29,7 +29,11 @@ win32:DEFINES += QT_NODLL INCLUDEPATH += $$QT_BUILD_TREE/include \ $$QT_BUILD_TREE/include/QtCore \ + $$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION \ + $$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION/QtCore \ $$QT_BUILD_TREE/include/QtXml \ + $$QT_BUILD_TREE/include/QtXml/$$QT.xml.VERSION \ + $$QT_BUILD_TREE/include/QtXml/$$QT.xml.VERSION/QtXml \ $$QT_SOURCE_TREE/src/xml DEPENDPATH += $$INCLUDEPATH \ $$QT_SOURCE_TREE/src/corelib/global \ diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index 50ae2cff161..6ff948c8e8e 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -32,7 +32,11 @@ win32:DEFINES += QT_NODLL INCLUDEPATH += $$QT_BUILD_TREE/include \ $$QT_BUILD_TREE/include/QtCore \ - $$QT_BUILD_TREE/include/QtXml + $$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION \ + $$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION/QtCore \ + $$QT_BUILD_TREE/include/QtXml \ + $$QT_BUILD_TREE/include/QtXml/$$QT.xml.VERSION \ + $$QT_BUILD_TREE/include/QtXml/$$QT.xml.VERSION/QtXml \ DEPENDPATH += $$INCLUDEPATH \ ../../corelib/global \ diff --git a/src/tools/uic/cpp/cppwriteincludes.cpp b/src/tools/uic/cpp/cppwriteincludes.cpp index d09c712b7bf..b2f4f6d3113 100644 --- a/src/tools/uic/cpp/cppwriteincludes.cpp +++ b/src/tools/uic/cpp/cppwriteincludes.cpp @@ -124,22 +124,6 @@ void WriteIncludes::acceptUI(DomUI *node) add(QLatin1String("QButtonGroup")); // ### only if it is really necessary add(QLatin1String("QHeaderView")); - if (m_uic->hasExternalPixmap() && m_uic->pixmapFunction() == QLatin1String("qPixmapFromMimeSource")) { -#ifdef QT_NO_QT3_SUPPORT - qWarning("%s: Warning: The form file has external pixmaps or qPixmapFromMimeSource() set as a pixmap function. " - "This requires Qt 3 support, which is disabled. The resulting code will not compile.", - qPrintable(m_uic->option().messagePrefix())); -#endif - add(QLatin1String("Q3MimeSourceFactory")); - } - - if (m_uic->databaseInfo()->connections().size()) { - add(QLatin1String("QSqlDatabase")); - add(QLatin1String("Q3SqlCursor")); - add(QLatin1String("QSqlRecord")); - add(QLatin1String("Q3SqlForm")); - } - TreeWalker::acceptUI(node); writeHeaders(m_globalIncludes, true); @@ -241,10 +225,6 @@ void WriteIncludes::add(const QString &className, bool determineHeader, const QS return; } - if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3ListView")) || - m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3Table"))) { - add(QLatin1String("Q3Header")); - } if (determineHeader) insertIncludeForClass(className, header, global); } diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index 37d012c1098..85c1b1d2851 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.cpp +++ b/src/tools/uic/cpp/cppwriteinitialization.cpp @@ -636,7 +636,7 @@ void WriteInitialization::acceptWidget(DomWidget *node) const QString savedParentWidget = parentWidget; - if (m_uic->isContainer(parentClass) || m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3ToolBar"))) + if (m_uic->isContainer(parentClass)) parentWidget.clear(); if (m_widgetChain.size() != 1) @@ -644,9 +644,7 @@ void WriteInitialization::acceptWidget(DomWidget *node) parentWidget = savedParentWidget; - if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3ComboBox"))) { - initializeComboBox3(node); - } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QComboBox"))) { + if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QComboBox"))) { initializeComboBox(node); } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QListWidget"))) { initializeListWidget(node); @@ -654,18 +652,6 @@ void WriteInitialization::acceptWidget(DomWidget *node) initializeTreeWidget(node); } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QTableWidget"))) { initializeTableWidget(node); - } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3ListBox"))) { - initializeQ3ListBox(node); - } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3ListView"))) { - initializeQ3ListView(node); - } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3IconView"))) { - initializeQ3IconView(node); - } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3Table"))) { - initializeQ3Table(node); - } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3DataTable"))) { - initializeQ3SqlDataTable(node); - } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3DataBrowser"))) { - initializeQ3SqlDataBrowser(node); } if (m_uic->isButton(className)) @@ -706,12 +692,9 @@ void WriteInitialization::acceptWidget(DomWidget *node) id = pid->elementNumber(); } - if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QMainWindow")) - || m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3MainWindow"))) { - + if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QMainWindow"))) { if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QMenuBar"))) { - if (!m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3MainWindow"))) - m_output << m_indent << parentWidget << "->setMenuBar(" << varName <<");\n"; + m_output << m_indent << parentWidget << "->setMenuBar(" << varName <<");\n"; } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QToolBar"))) { m_output << m_indent << parentWidget << "->addToolBar(" << toolBarAreaStringFromDOMAttributes(attributes) << varName << ");\n"; @@ -733,8 +716,7 @@ void WriteInitialization::acceptWidget(DomWidget *node) m_output << m_indent << parentWidget << "->addDockWidget(" << area << varName << ");\n"; } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QStatusBar"))) { m_output << m_indent << parentWidget << "->setStatusBar(" << varName << ");\n"; - } else if (!m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3DockWindow")) - && !m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3ToolBar"))) { + } else { m_output << m_indent << parentWidget << "->setCentralWidget(" << varName << ");\n"; } } @@ -747,8 +729,6 @@ void WriteInitialization::acceptWidget(DomWidget *node) m_output << m_indent << parentWidget << "->addWidget(" << varName << ");\n"; } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QToolBar"))) { m_output << m_indent << parentWidget << "->addWidget(" << varName << ");\n"; - } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3WidgetStack"))) { - m_output << m_indent << parentWidget << "->addWidget(" << varName << ", " << id << ");\n"; } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QDockWidget"))) { m_output << m_indent << parentWidget << "->setWidget(" << varName << ");\n"; } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QScrollArea"))) { @@ -809,15 +789,6 @@ void WriteInitialization::acceptWidget(DomWidget *node) << parentWidget << "->indexOf(" << varName << "), " << autoTrCall(pwhatsThis->elementString()) << ");\n"; } #endif // QT_NO_WHATSTHIS - } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3Wizard"))) { - const DomProperty *ptitle = attributes.value(QLatin1String("title")); - DomString *ptitleString = ptitle ? ptitle->elementString() : 0; - - m_output << m_indent << parentWidget << "->addPage(" << varName << ", " << noTrCall(ptitleString, pageDefaultString) << ");\n"; - - autoTrOutput(ptitleString, pageDefaultString) << m_indent << parentWidget << "->setTitle(" - << varName << ", " << autoTrCall(ptitleString, pageDefaultString) << ");\n"; - } // @@ -937,28 +908,6 @@ void WriteInitialization::acceptLayout(DomLayout *node) bool isGroupBox = false; - if (m_widgetChain.top()) { - const QString parentWidget = m_widgetChain.top()->attributeClass(); - - if (!m_layoutChain.top() && (m_uic->customWidgetsInfo()->extends(parentWidget, QLatin1String("Q3GroupBox")) - || m_uic->customWidgetsInfo()->extends(parentWidget, QLatin1String("Q3ButtonGroup")))) { - const QString parent = m_driver->findOrInsertWidget(m_widgetChain.top()); - - isGroupBox = true; - // special case for group box - - m_output << m_indent << parent << "->setColumnLayout(0, Qt::Vertical);\n"; - QString objectName = parent; - objectName += QLatin1String("->layout()"); - int marginType = Use43UiFile; - if (oldLayoutProperties) - marginType = m_layoutMarginType; - - m_LayoutDefaultHandler.writeProperties(m_indent, - objectName, properties, marginType, false, m_output); - } - } - m_output << m_indent << varName << " = new " << className << '('; if (!m_layoutChain.top() && !isGroupBox) @@ -966,24 +915,12 @@ void WriteInitialization::acceptLayout(DomLayout *node) m_output << ");\n"; - if (isGroupBox) { - const QString tempName = m_driver->unique(QLatin1String("boxlayout")); - m_output << m_indent << "QBoxLayout *" << tempName << " = qobject_cast(" << - m_driver->findOrInsertWidget(m_widgetChain.top()) << "->layout());\n"; - m_output << m_indent << "if (" << tempName << ")\n"; - m_output << m_dindent << tempName << "->addLayout(" << varName << ");\n"; - } - - if (isGroupBox) { - m_output << m_indent << varName << "->setAlignment(Qt::AlignTop);\n"; - } else { - // Suppress margin on a read child layout - const bool suppressMarginDefault = m_layoutChain.top(); - int marginType = Use43UiFile; - if (oldLayoutProperties) - marginType = m_layoutMarginType; - m_LayoutDefaultHandler.writeProperties(m_indent, varName, properties, marginType, suppressMarginDefault, m_output); - } + // Suppress margin on a read child layout + const bool suppressMarginDefault = m_layoutChain.top(); + int marginType = Use43UiFile; + if (oldLayoutProperties) + marginType = m_layoutMarginType; + m_LayoutDefaultHandler.writeProperties(m_indent, varName, properties, marginType, suppressMarginDefault, m_output); m_layoutMarginType = SubLayoutMargin; @@ -1175,13 +1112,8 @@ void WriteInitialization::acceptActionRef(DomActionRef *node) return; } else if (m_driver->actionGroupByName(actionName)) { return; - } else if (DomWidget *w = m_driver->widgetByName(actionName)) { + } else if (const DomWidget *w = m_driver->widgetByName(actionName)) { isMenu = m_uic->isMenu(w->attributeClass()); - bool inQ3ToolBar = m_uic->customWidgetsInfo()->extends(m_widgetChain.top()->attributeClass(), QLatin1String("Q3ToolBar")); - if (!isMenu && inQ3ToolBar) { - m_actionOut << m_indent << actionName << "->setParent(" << varName << ");\n"; - return; - } } else if (!(m_driver->actionByName(actionName) || isSeparator)) { fprintf(stderr, "%s: Warning: action `%s' not declared\n", qPrintable(m_option.messagePrefix()), @@ -1217,8 +1149,6 @@ void WriteInitialization::writeProperties(const QString &varName, } } - DomWidget *buttonGroupWidget = findWidget(QLatin1String("Q3ButtonGroup")); - QString indent; if (!m_widgetChain.top()) { indent = m_option.indent; @@ -1244,11 +1174,6 @@ void WriteInitialization::writeProperties(const QString &varName, const DomRect *r = p->elementRect(); m_output << m_indent << varName << "->resize(" << r->elementWidth() << ", " << r->elementHeight() << ");\n"; continue; - } else if (propertyName == QLatin1String("buttonGroupId")) { // Q3ButtonGroup support - if (buttonGroupWidget) - m_output << m_indent << m_driver->findOrInsertWidget(buttonGroupWidget) << "->insert(" - << varName << ", " << p->elementNumber() << ");\n"; - continue; } else if (propertyName == QLatin1String("currentRow") // QListWidget::currentRow && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QListWidget"))) { m_delayedOut << m_indent << varName << "->setCurrentRow(" @@ -1568,16 +1493,7 @@ void WriteInitialization::writeProperties(const QString &varName, } } if (leftMargin != -1 || topMargin != -1 || rightMargin != -1 || bottomMargin != -1) { - QString objectName = varName; - if (m_widgetChain.top()) { - const QString parentWidget = m_widgetChain.top()->attributeClass(); - - if (!m_layoutChain.top() && (m_uic->customWidgetsInfo()->extends(parentWidget, QLatin1String("Q3GroupBox")) - || m_uic->customWidgetsInfo()->extends(parentWidget, QLatin1String("Q3ButtonGroup")))) { - objectName = m_driver->findOrInsertWidget(m_widgetChain.top()) + QLatin1String("->layout()"); - } - } - m_output << m_indent << objectName << QLatin1String("->setContentsMargins(") + m_output << m_indent << varName << QLatin1String("->setContentsMargins(") << leftMargin << QLatin1String(", ") << topMargin << QLatin1String(", ") << rightMargin << QLatin1String(", ") @@ -1934,199 +1850,6 @@ void WriteInitialization::acceptTabStops(DomTabStops *tabStops) } } -void WriteInitialization::initializeQ3ListBox(DomWidget *w) -{ - const QString varName = m_driver->findOrInsertWidget(w); - const QString className = w->attributeClass(); - - const QList items = w->elementItem(); - - if (items.isEmpty()) - return; - - m_refreshOut << m_indent << varName << "->clear();\n"; - - for (int i=0; ielementProperty()); - const DomProperty *text = properties.value(QLatin1String("text")); - const DomProperty *pixmap = properties.value(QLatin1String("pixmap")); - if (!(text || pixmap)) - continue; - - m_refreshOut << m_indent << varName << "->insertItem("; - if (pixmap) { - m_refreshOut << pixCall(pixmap); - - if (text) - m_refreshOut << ", "; - } - if (text) - m_refreshOut << trCall(text->elementString()); - m_refreshOut << ");\n"; - } -} - -void WriteInitialization::initializeQ3IconView(DomWidget *w) -{ - const QString varName = m_driver->findOrInsertWidget(w); - const QString className = w->attributeClass(); - - const QList items = w->elementItem(); - - if (items.isEmpty()) - return; - - m_refreshOut << m_indent << varName << "->clear();\n"; - - for (int i=0; ielementProperty()); - const DomProperty *text = properties.value(QLatin1String("text")); - const DomProperty *pixmap = properties.value(QLatin1String("pixmap")); - if (!(text || pixmap)) - continue; - - const QString itemName = m_driver->unique(QLatin1String("__item")); - m_refreshOut << "\n"; - m_refreshOut << m_indent << "Q3IconViewItem *" << itemName << " = new Q3IconViewItem(" << varName << ");\n"; - - if (pixmap) { - m_refreshOut << m_indent << itemName << "->setPixmap(" << pixCall(pixmap) << ");\n"; - } - - if (text) { - m_refreshOut << m_indent << itemName << "->setText(" << trCall(text->elementString()) << ");\n"; - } - } -} - -void WriteInitialization::initializeQ3ListView(DomWidget *w) -{ - const QString varName = m_driver->findOrInsertWidget(w); - const QString className = w->attributeClass(); - - // columns - const QList columns = w->elementColumn(); - for (int i=0; ielementProperty()); - const DomProperty *text = properties.value(QLatin1String("text")); - const DomProperty *pixmap = properties.value(QLatin1String("pixmap")); - const DomProperty *clickable = properties.value(QLatin1String("clickable")); - const DomProperty *resizable = properties.value(QLatin1String("resizable")); - - const QString txt = trCall(text->elementString()); - m_output << m_indent << varName << "->addColumn(" << txt << ");\n"; - m_refreshOut << m_indent << varName << "->header()->setLabel(" << i << ", " << txt << ");\n"; - - if (pixmap) { - m_output << m_indent << varName << "->header()->setLabel(" - << varName << "->header()->count() - 1, " << pixCall(pixmap) << ", " << txt << ");\n"; - } - - if (clickable != 0) { - m_output << m_indent << varName << "->header()->setClickEnabled(" << clickable->elementBool() << ", " << varName << "->header()->count() - 1);\n"; - } - - if (resizable != 0) { - m_output << m_indent << varName << "->header()->setResizeEnabled(" << resizable->elementBool() << ", " << varName << "->header()->count() - 1);\n"; - } - } - - if (w->elementItem().size()) { - m_refreshOut << m_indent << varName << "->clear();\n"; - - initializeQ3ListViewItems(className, varName, w->elementItem()); - } -} - -void WriteInitialization::initializeQ3ListViewItems(const QString &className, const QString &varName, const QList &items) -{ - if (items.isEmpty()) - return; - - // items - for (int i=0; iunique(QLatin1String("__item")); - m_refreshOut << "\n"; - m_refreshOut << m_indent << "Q3ListViewItem *" << itemName << " = new Q3ListViewItem(" << varName << ");\n"; - - int textCount = 0, pixCount = 0; - const DomPropertyList properties = item->elementProperty(); - for (int i=0; iattributeName() == QLatin1String("text")) - m_refreshOut << m_indent << itemName << "->setText(" << textCount++ << ", " - << trCall(p->elementString()) << ");\n"; - - if (p->attributeName() == QLatin1String("pixmap")) - m_refreshOut << m_indent << itemName << "->setPixmap(" << pixCount++ << ", " - << pixCall(p) << ");\n"; - } - - if (item->elementItem().size()) { - m_refreshOut << m_indent << itemName << "->setOpen(true);\n"; - initializeQ3ListViewItems(className, itemName, item->elementItem()); - } - } -} - - -void WriteInitialization::initializeQ3Table(DomWidget *w) -{ - const QString varName = m_driver->findOrInsertWidget(w); - const QString className = w->attributeClass(); - - // columns - const QList columns = w->elementColumn(); - - for (int i=0; ielementProperty()); - const DomProperty *text = properties.value(QLatin1String("text")); - const DomProperty *pixmap = properties.value(QLatin1String("pixmap")); - - m_refreshOut << m_indent << varName << "->horizontalHeader()->setLabel(" << i << ", "; - if (pixmap) { - m_refreshOut << pixCall(pixmap) << ", "; - } - m_refreshOut << trCall(text->elementString()) << ");\n"; - } - - // rows - const QList rows = w->elementRow(); - for (int i=0; ielementProperty()); - const DomProperty *text = properties.value(QLatin1String("text")); - const DomProperty *pixmap = properties.value(QLatin1String("pixmap")); - - m_refreshOut << m_indent << varName << "->verticalHeader()->setLabel(" << i << ", "; - if (pixmap) { - m_refreshOut << pixCall(pixmap) << ", "; - } - m_refreshOut << trCall(text->elementString()) << ");\n"; - } - - - //initializeQ3TableItems(className, varName, w->elementItem()); -} - -void WriteInitialization::initializeQ3TableItems(const QString &className, const QString &varName, const QList &items) -{ - Q_UNUSED(className); - Q_UNUSED(varName); - Q_UNUSED(items); -} - QString WriteInitialization::iconCall(const DomProperty *icon) { if (icon->kind() == DomProperty::IconSet) @@ -2194,26 +1917,6 @@ QString WriteInitialization::pixCall(const QString &t, const QString &text) cons return type; } -void WriteInitialization::initializeComboBox3(DomWidget *w) -{ - const QList items = w->elementItem(); - if (items.empty()) - return; - // Basic legacy Qt3 support, write out translatable text items, ignore pixmaps - const QString varName = m_driver->findOrInsertWidget(w); - const QString textProperty = QLatin1String("text"); - - m_refreshOut << m_indent << varName << "->clear();\n"; - m_refreshOut << m_indent << varName << "->insertStringList(QStringList()" << '\n'; - const int itemCount = items.size(); - for (int i = 0; i< itemCount; ++i) { - const DomItem *item = items.at(i); - if (const DomProperty *text = propertyMap(item->elementProperty()).value(textProperty)) - m_refreshOut << m_indent << " << " << autoTrCall(text->elementString()) << "\n"; - } - m_refreshOut << m_indent << ", 0);\n"; -} - void WriteInitialization::initializeComboBox(DomWidget *w) { const QString varName = m_driver->findOrInsertWidget(w); @@ -2617,86 +2320,6 @@ QString WriteInitialization::trCall(const QString &str, const QString &commentHi return result; } -void WriteInitialization::initializeQ3SqlDataTable(DomWidget *w) -{ - const DomPropertyMap properties = propertyMap(w->elementProperty()); - - const DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode"), 0); - if (frameworkCode && toBool(frameworkCode->elementBool()) == false) - return; - - QString connection; - QString table; - QString field; - - const DomProperty *db = properties.value(QLatin1String("database"), 0); - if (db && db->elementStringList()) { - const QStringList info = db->elementStringList()->elementString(); - connection = info.size() > 0 ? info.at(0) : QString(); - table = info.size() > 1 ? info.at(1) : QString(); - field = info.size() > 2 ? info.at(2) : QString(); - } - - if (table.isEmpty() || connection.isEmpty()) { - fprintf(stderr, "%s: Warning: Invalid database connection\n", qPrintable(m_option.messagePrefix())); - return; - } - - const QString varName = m_driver->findOrInsertWidget(w); - - m_output << m_indent << "if (!" << varName << "->sqlCursor()) {\n"; - - m_output << m_dindent << varName << "->setSqlCursor("; - - if (connection == QLatin1String("(default)")) { - m_output << "new Q3SqlCursor(" << fixString(table, m_dindent) << "), false, true);\n"; - } else { - m_output << "new Q3SqlCursor(" << fixString(table, m_dindent) << ", true, " << connection << "Connection" << "), false, true);\n"; - } - m_output << m_dindent << varName << "->refresh(Q3DataTable::RefreshAll);\n"; - m_output << m_indent << "}\n"; -} - -void WriteInitialization::initializeQ3SqlDataBrowser(DomWidget *w) -{ - const DomPropertyMap properties = propertyMap(w->elementProperty()); - - const DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode"), 0); - if (frameworkCode && toBool(frameworkCode->elementBool()) == false) - return; - - QString connection; - QString table; - QString field; - - const DomProperty *db = properties.value(QLatin1String("database"), 0); - if (db && db->elementStringList()) { - const QStringList info = db->elementStringList()->elementString(); - connection = info.size() > 0 ? info.at(0) : QString(); - table = info.size() > 1 ? info.at(1) : QString(); - field = info.size() > 2 ? info.at(2) : QString(); - } - - if (table.isEmpty() || connection.isEmpty()) { - fprintf(stderr, "%s: Warning: Invalid database connection\n", qPrintable(m_option.messagePrefix())); - return; - } - - const QString varName = m_driver->findOrInsertWidget(w); - - m_output << m_indent << "if (!" << varName << "->sqlCursor()) {\n"; - - m_output << m_dindent << varName << "->setSqlCursor("; - - if (connection == QLatin1String("(default)")) { - m_output << "new Q3SqlCursor(" << fixString(table, m_dindent) << "), true);\n"; - } else { - m_output << "new Q3SqlCursor(" << fixString(table, m_dindent) << ", true, " << connection << "Connection" << "), false, true);\n"; - } - m_output << m_dindent << varName << "->refresh();\n"; - m_output << m_indent << "}\n"; -} - void WriteInitialization::initializeMenu(DomWidget *w, const QString &/*parentWidget*/) { const QString menuName = m_driver->findOrInsertWidget(w); diff --git a/src/tools/uic/cpp/cppwriteinitialization.h b/src/tools/uic/cpp/cppwriteinitialization.h index 302fbe4bc5d..09983cff146 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.h +++ b/src/tools/uic/cpp/cppwriteinitialization.h @@ -241,7 +241,6 @@ private: void initializeMenu(DomWidget *w, const QString &parentWidget); void initializeComboBox(DomWidget *w); - void initializeComboBox3(DomWidget *w); void initializeListWidget(DomWidget *w); void initializeTreeWidget(DomWidget *w); QList initializeTreeWidgetItems(const QList &domItems); @@ -250,22 +249,6 @@ private: QString disableSorting(DomWidget *w, const QString &varName); void enableSorting(DomWidget *w, const QString &varName, const QString &tempName); -// -// special initialization for the Q3 support classes -// - void initializeQ3ListBox(DomWidget *w); - void initializeQ3IconView(DomWidget *w); - void initializeQ3ListView(DomWidget *w); - void initializeQ3ListViewItems(const QString &className, const QString &varName, const QList &items); - void initializeQ3Table(DomWidget *w); - void initializeQ3TableItems(const QString &className, const QString &varName, const QList &items); - -// -// Sql -// - void initializeQ3SqlDataTable(DomWidget *w); - void initializeQ3SqlDataBrowser(DomWidget *w); - QString findDeclaration(const QString &name); DomWidget *findWidget(const QLatin1String &widgetClass); DomImage *findImage(const QString &name) const; diff --git a/src/tools/uic/uic.cpp b/src/tools/uic/uic.cpp index f045e58d2e9..b616f77b948 100644 --- a/src/tools/uic/uic.cpp +++ b/src/tools/uic/uic.cpp @@ -333,14 +333,12 @@ void Uic::writeHeaderProtectionEnd() bool Uic::isMainWindow(const QString &className) const { - return customWidgetsInfo()->extends(className, QLatin1String("Q3MainWindow")) - || customWidgetsInfo()->extends(className, QLatin1String("QMainWindow")); + return customWidgetsInfo()->extends(className, QLatin1String("QMainWindow")); } bool Uic::isToolBar(const QString &className) const { - return customWidgetsInfo()->extends(className, QLatin1String("Q3ToolBar")) - || customWidgetsInfo()->extends(className, QLatin1String("QToolBar")); + return customWidgetsInfo()->extends(className, QLatin1String("QToolBar")); } bool Uic::isButton(const QString &className) const diff --git a/src/uitools/quiloader.cpp b/src/uitools/quiloader.cpp index 13ee48aa45f..7f39b557ea6 100644 --- a/src/uitools/quiloader.cpp +++ b/src/uitools/quiloader.cpp @@ -505,7 +505,7 @@ bool FormBuilderPrivate::addItem(DomWidget *ui_widget, QWidget *widget, QWidget // Check special cases. First: Custom container const QString className = QLatin1String(parentWidget->metaObject()->className()); - if (!QFormBuilderExtra::instance(this)->customWidgetAddPageMethod(className).isEmpty()) + if (!d->customWidgetAddPageMethod(className).isEmpty()) return true; const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); diff --git a/src/uitools/uitools.pro b/src/uitools/uitools.pro index 32c4501375d..0af26d93756 100644 --- a/src/uitools/uitools.pro +++ b/src/uitools/uitools.pro @@ -1,9 +1,12 @@ -MODULE = uitools QPRO_PWD = $$PWD TEMPLATE = lib TARGET = $$qtLibraryTarget(QtUiTools) QT = core xml -CONFIG += qt staticlib + +CONFIG += qt staticlib # Not adding module here, since the module pri's are only used for building +MODULE_PRI = ../modules/qt_uitools.pri \ + ../modules/qt_uilib.pri + DESTDIR = $$QMAKE_LIBDIR_QT symbian { diff --git a/src/xml/xml.pro b/src/xml/xml.pro index 019153ce856..68bb20b0098 100644 --- a/src/xml/xml.pro +++ b/src/xml/xml.pro @@ -1,6 +1,10 @@ TARGET = QtXml QPRO_PWD = $$PWD -QT = core +QT = core-private + +CONFIG += module +MODULE_PRI = ../modules/qt_xml.pri + DEFINES += QT_BUILD_XML_LIB QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x61000000 diff --git a/tests/auto/headersclean/headersclean.pro b/tests/auto/headersclean/headersclean.pro index d9b6ae3e2ab..0f976ffb959 100644 --- a/tests/auto/headersclean/headersclean.pro +++ b/tests/auto/headersclean/headersclean.pro @@ -1,7 +1,9 @@ load(qttest_p4) SOURCES += tst_headersclean.cpp -QT = core network xml sql uitools +QT = core network xml sql +CONFIG += uitools contains(QT_CONFIG,dbus): QT += dbus contains(QT_CONFIG,opengl): QT += opengl -contains(QT_CONFIG,openvg): QT += openvg \ No newline at end of file +contains(QT_CONFIG,openvg): QT += openvg + diff --git a/tests/auto/qcomplextext/tst_qcomplextext.cpp b/tests/auto/qcomplextext/tst_qcomplextext.cpp index 3d8e29057d8..58b31b4aa44 100644 --- a/tests/auto/qcomplextext/tst_qcomplextext.cpp +++ b/tests/auto/qcomplextext/tst_qcomplextext.cpp @@ -71,6 +71,10 @@ private slots: void bidiReorderString(); void bidiCursor_qtbug2795(); void bidiCursor_PDF(); + void bidiCursorMovement_data(); + void bidiCursorMovement(); + void bidiCursorLogicalMovement_data(); + void bidiCursorLogicalMovement(); }; tst_QComplexText::tst_QComplexText() @@ -185,6 +189,90 @@ void tst_QComplexText::bidiCursor_qtbug2795() QVERIFY(x1 == x2); } +void tst_QComplexText::bidiCursorMovement_data() +{ + QTest::addColumn("logical"); + QTest::addColumn("basicDir"); + + const LV *data = logical_visual; + while ( data->name ) { + //next we fill it with data + QTest::newRow( data->name ) + << QString::fromUtf8( data->logical ) + << (int) data->basicDir; + data++; + } +} + +void tst_QComplexText::bidiCursorMovement() +{ + QFETCH(QString, logical); + QFETCH(int, basicDir); + + QTextLayout layout(logical); + + QTextOption option = layout.textOption(); + option.setTextDirection(basicDir == QChar::DirL ? Qt::LeftToRight : Qt::RightToLeft); + layout.setTextOption(option); + layout.setCursorMoveStyle(QTextCursor::Visual); + bool moved; + int oldPos, newPos = 0; + qreal x, newX; + + layout.beginLayout(); + QTextLine line = layout.createLine(); + layout.endLayout(); + + newX = line.cursorToX(0); + do { + oldPos = newPos; + x = newX; + newX = line.cursorToX(oldPos); + if (basicDir == QChar::DirL) { + QVERIFY(newX >= x); + newPos = layout.rightCursorPosition(oldPos); + } else + { + QVERIFY(newX <= x); + newPos = layout.leftCursorPosition(oldPos); + } + moved = (oldPos != newPos); + } while (moved); +} + +void tst_QComplexText::bidiCursorLogicalMovement_data() +{ + bidiCursorMovement_data(); +} + +void tst_QComplexText::bidiCursorLogicalMovement() +{ + QFETCH(QString, logical); + QFETCH(int, basicDir); + + QTextLayout layout(logical); + + QTextOption option = layout.textOption(); + option.setTextDirection(basicDir == QChar::DirL ? Qt::LeftToRight : Qt::RightToLeft); + layout.setTextOption(option); + bool moved; + int oldPos, newPos = 0; + + do { + oldPos = newPos; + newPos = layout.nextCursorPosition(oldPos); + QVERIFY(newPos >= oldPos); + moved = (oldPos != newPos); + } while (moved); + + do { + oldPos = newPos; + newPos = layout.previousCursorPosition(oldPos); + QVERIFY(newPos <= oldPos); + moved = (oldPos != newPos); + } while (moved); +} + void tst_QComplexText::bidiCursor_PDF() { QString str = QString::fromUtf8("\342\200\252hello\342\200\254"); diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index 9176174cd88..f45481ca8ac 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -282,6 +282,12 @@ private slots: void validateAndSet(); #endif + void bidiVisualMovement_data(); + void bidiVisualMovement(); + + void bidiLogicalMovement_data(); + void bidiLogicalMovement(); + protected slots: #ifdef QT3_SUPPORT void lostFocus(); @@ -3760,5 +3766,135 @@ void tst_QLineEdit::QTBUG13520_textNotVisible() } +void tst_QLineEdit::bidiVisualMovement_data() +{ + QTest::addColumn("logical"); + QTest::addColumn("basicDir"); + QTest::addColumn("positionList"); + + QTest::newRow("Latin text") + << QString::fromUtf8("abc") + << (int) QChar::DirL + << (IntList() << 0 << 1 << 2 << 3); + QTest::newRow("Hebrew text, one item") + << QString::fromUtf8("\327\220\327\221\327\222") + << (int) QChar::DirR + << (QList() << 0 << 1 << 2 << 3); + QTest::newRow("Hebrew text after Latin text") + << QString::fromUtf8("abc\327\220\327\221\327\222") + << (int) QChar::DirL + << (QList() << 0 << 1 << 2 << 6 << 5 << 4 << 3); + QTest::newRow("Latin text after Hebrew text") + << QString::fromUtf8("\327\220\327\221\327\222abc") + << (int) QChar::DirR + << (QList() << 0 << 1 << 2 << 6 << 5 << 4 << 3); + QTest::newRow("LTR, 3 items") + << QString::fromUtf8("abc\327\220\327\221\327\222abc") + << (int) QChar::DirL + << (QList() << 0 << 1 << 2 << 5 << 4 << 3 << 6 << 7 << 8 << 9); + QTest::newRow("RTL, 3 items") + << QString::fromUtf8("\327\220\327\221\327\222abc\327\220\327\221\327\222") + << (int) QChar::DirR + << (QList() << 0 << 1 << 2 << 5 << 4 << 3 << 6 << 7 << 8 << 9); + QTest::newRow("LTR, 4 items") + << QString::fromUtf8("abc\327\220\327\221\327\222abc\327\220\327\221\327\222") + << (int) QChar::DirL + << (QList() << 0 << 1 << 2 << 5 << 4 << 3 << 6 << 7 << 8 << 12 << 11 << 10 << 9); + QTest::newRow("RTL, 4 items") + << QString::fromUtf8("\327\220\327\221\327\222abc\327\220\327\221\327\222abc") + << (int) QChar::DirR + << (QList() << 0 << 1 << 2 << 5 << 4 << 3 << 6 << 7 << 8 << 12 << 11 << 10 << 9); +} + +void tst_QLineEdit::bidiVisualMovement() +{ + QFETCH(QString, logical); + QFETCH(int, basicDir); + QFETCH(IntList, positionList); + + QLineEdit le; + le.setText(logical); + + le.setCursorMoveStyle(QTextCursor::Visual); + le.setCursorPosition(0); + + bool moved; + int i = 0, oldPos, newPos = 0; + + do { + oldPos = newPos; + QVERIFY(oldPos == positionList[i]); + if (basicDir == QChar::DirL) { + QTest::keyClick(&le, Qt::Key_Right); + } else + QTest::keyClick(&le, Qt::Key_Left); + newPos = le.cursorPosition(); + moved = (oldPos != newPos); + i++; + } while (moved); + + QVERIFY(i == positionList.size()); + + do { + i--; + oldPos = newPos; + QVERIFY(oldPos == positionList[i]); + if (basicDir == QChar::DirL) { + QTest::keyClick(&le, Qt::Key_Left); + } else + { + QTest::keyClick(&le, Qt::Key_Right); + } + newPos = le.cursorPosition(); + moved = (oldPos != newPos); + } while (moved && i >= 0); +} + +void tst_QLineEdit::bidiLogicalMovement_data() +{ + bidiVisualMovement_data(); +} + +void tst_QLineEdit::bidiLogicalMovement() +{ + QFETCH(QString, logical); + QFETCH(int, basicDir); + + QLineEdit le; + le.setText(logical); + + le.setCursorMoveStyle(QTextCursor::Logical); + le.setCursorPosition(0); + + bool moved; + int i = 0, oldPos, newPos = 0; + + do { + oldPos = newPos; + QVERIFY(oldPos == i); + if (basicDir == QChar::DirL) { + QTest::keyClick(&le, Qt::Key_Right); + } else + QTest::keyClick(&le, Qt::Key_Left); + newPos = le.cursorPosition(); + moved = (oldPos != newPos); + i++; + } while (moved); + + do { + i--; + oldPos = newPos; + QVERIFY(oldPos == i); + if (basicDir == QChar::DirL) { + QTest::keyClick(&le, Qt::Key_Left); + } else + { + QTest::keyClick(&le, Qt::Key_Right); + } + newPos = le.cursorPosition(); + moved = (oldPos != newPos); + } while (moved && i >= 0); +} + QTEST_MAIN(tst_QLineEdit) #include "tst_qlineedit.moc" diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 4d032e8f3c7..4ba51de7e56 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -1337,7 +1337,7 @@ void tst_QPixmap::toSymbianCFbsBitmap() void tst_QPixmap::onlyNullPixmapsOutsideGuiThread() { -#if !defined(Q_WS_WIN) +#if !defined(Q_WS_WIN) && !defined(Q_WS_MAC) class Thread : public QThread { public: @@ -1370,7 +1370,7 @@ void tst_QPixmap::onlyNullPixmapsOutsideGuiThread() thread.wait(); #endif -#endif // !defined(Q_WS_WIN) +#endif // !defined(Q_WS_WIN) && !defined(Q_WS_MAC) } void tst_QPixmap::refUnref() diff --git a/tests/auto/qrawfont/tst_qrawfont.cpp b/tests/auto/qrawfont/tst_qrawfont.cpp index 3aa4006b68b..4b42c74bb72 100644 --- a/tests/auto/qrawfont/tst_qrawfont.cpp +++ b/tests/auto/qrawfont/tst_qrawfont.cpp @@ -104,7 +104,7 @@ void tst_QRawFont::invalidRawFont() { QRawFont font; QVERIFY(!font.isValid()); - QCOMPARE(font.pixelSize(), -1); + QCOMPARE(font.pixelSize(), 0.0); QVERIFY(font.familyName().isEmpty()); QCOMPARE(font.style(), QFont::StyleNormal); QCOMPARE(font.weight(), -1); @@ -165,7 +165,7 @@ void tst_QRawFont::correctFontData_data() QTest::addColumn("weight"); QTest::addColumn("hintingPreference"); QTest::addColumn("unitsPerEm"); - QTest::addColumn("pixelSize"); + QTest::addColumn("pixelSize"); int hintingPreferences[] = { int(QFont::PreferDefaultHinting), @@ -189,7 +189,7 @@ void tst_QRawFont::correctFontData_data() << QFont::Normal << QFont::HintingPreference(*hintingPreference) << 1000.0 - << 10; + << 10.0; fileName = QLatin1String(SRCDIR "testfont_bold_italic.ttf"); title = fileName @@ -203,7 +203,7 @@ void tst_QRawFont::correctFontData_data() << QFont::Bold << QFont::HintingPreference(*hintingPreference) << 1000.0 - << 10; + << 10.0; ++hintingPreference; } @@ -217,7 +217,7 @@ void tst_QRawFont::correctFontData() QFETCH(QFont::Weight, weight); QFETCH(QFont::HintingPreference, hintingPreference); QFETCH(qreal, unitsPerEm); - QFETCH(int, pixelSize); + QFETCH(qreal, pixelSize); QRawFont font(fileName, 10, hintingPreference); QVERIFY(font.isValid()); @@ -284,7 +284,7 @@ void tst_QRawFont::textLayout() QString familyName = QString::fromLatin1("QtBidiTestFont"); QFont font(familyName); - font.setPixelSize(18); + font.setPixelSize(18.0); QCOMPARE(QFontInfo(font).family(), familyName); QTextLayout layout(QLatin1String("Foobar")); @@ -301,7 +301,7 @@ void tst_QRawFont::textLayout() QRawFont rawFont = glyphs.font(); QVERIFY(rawFont.isValid()); QCOMPARE(rawFont.familyName(), familyName); - QCOMPARE(rawFont.pixelSize(), 18); + QCOMPARE(rawFont.pixelSize(), 18.0); QVector expectedGlyphIndices; expectedGlyphIndices << 44 << 83 << 83 << 70 << 69 << 86; @@ -597,12 +597,12 @@ void tst_QRawFont::fromFont() QFont font(familyName); font.setHintingPreference(hintingPreference); - font.setPixelSize(26); + font.setPixelSize(26.0); QRawFont rawFont = QRawFont::fromFont(font, writingSystem); QVERIFY(rawFont.isValid()); QCOMPARE(rawFont.familyName(), familyName); - QCOMPARE(rawFont.pixelSize(), 26); + QCOMPARE(rawFont.pixelSize(), 26.0); QVERIFY(fontDatabase.removeApplicationFont(id)); } @@ -623,7 +623,7 @@ void tst_QRawFont::copyConstructor() { QString rawFontFamilyName; - int rawFontPixelSize; + qreal rawFontPixelSize; qreal rawFontAscent; qreal rawFontDescent; int rawFontTableSize; @@ -691,7 +691,7 @@ void tst_QRawFont::detach() { QString rawFontFamilyName; - int rawFontPixelSize; + qreal rawFontPixelSize; qreal rawFontAscent; qreal rawFontDescent; int rawFontTableSize; @@ -773,15 +773,15 @@ void tst_QRawFont::unsupportedWritingSystem() QFont font("QtBidiTestFont"); font.setHintingPreference(hintingPreference); - font.setPixelSize(12); + font.setPixelSize(12.0); QRawFont rawFont = QRawFont::fromFont(font, QFontDatabase::Any); QCOMPARE(rawFont.familyName(), QString::fromLatin1("QtBidiTestFont")); - QCOMPARE(rawFont.pixelSize(), 12); + QCOMPARE(rawFont.pixelSize(), 12.0); rawFont = QRawFont::fromFont(font, QFontDatabase::Hebrew); QCOMPARE(rawFont.familyName(), QString::fromLatin1("QtBidiTestFont")); - QCOMPARE(rawFont.pixelSize(), 12); + QCOMPARE(rawFont.pixelSize(), 12.0); QString arabicText = QFontDatabase::writingSystemSample(QFontDatabase::Arabic); @@ -798,11 +798,11 @@ void tst_QRawFont::unsupportedWritingSystem() QGlyphs glyphs = glyphss.at(0); QRawFont layoutFont = glyphs.font(); QVERIFY(layoutFont.familyName() != QString::fromLatin1("QtBidiTestFont")); - QCOMPARE(layoutFont.pixelSize(), 12); + QCOMPARE(layoutFont.pixelSize(), 12.0); rawFont = QRawFont::fromFont(font, QFontDatabase::Arabic); QCOMPARE(rawFont.familyName(), layoutFont.familyName()); - QCOMPARE(rawFont.pixelSize(), 12); + QCOMPARE(rawFont.pixelSize(), 12.0); fontDatabase.removeApplicationFont(id); } diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp index 6675c99d231..7aa6578e862 100644 --- a/tests/auto/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp @@ -180,6 +180,8 @@ private slots: void escape_data(); void escape(); + void copiedFontSize(); + private: void backgroundImage_checkExpectedHtml(const QTextDocument &doc); @@ -2734,5 +2736,29 @@ void tst_QTextDocument::escape() QCOMPARE(Qt::escape(original), expected); } +void tst_QTextDocument::copiedFontSize() +{ + QTextDocument documentInput; + QTextDocument documentOutput; + + QFont fontInput; + fontInput.setPixelSize(24); + + QTextCursor cursorInput(&documentInput); + QTextCharFormat formatInput = cursorInput.charFormat(); + formatInput.setFont(fontInput); + cursorInput.insertText("Should be the same font", formatInput); + cursorInput.select(QTextCursor::Document); + + QTextDocumentFragment fragmentInput(cursorInput); + QString html = fragmentInput.toHtml(); + + QTextCursor cursorOutput(&documentOutput); + QTextDocumentFragment fragmentOutput = QTextDocumentFragment::fromHtml(html); + cursorOutput.insertFragment(fragmentOutput); + + QCOMPARE(cursorOutput.charFormat().font().pixelSize(), 24); +} + QTEST_MAIN(tst_QTextDocument) #include "tst_qtextdocument.moc" diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index 9ca17b9f5f5..5a645937d7a 100644 --- a/tests/auto/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/qtextedit/tst_qtextedit.cpp @@ -42,7 +42,6 @@ #include - #include #include #include @@ -69,6 +68,7 @@ typedef QList pairListType; Q_DECLARE_METATYPE(pairListType); Q_DECLARE_METATYPE(keyPairType); Q_DECLARE_METATYPE(QList); +Q_DECLARE_METATYPE(QList); #ifdef Q_WS_MAC #include @@ -205,6 +205,11 @@ private slots: #ifndef QT_NO_CONTEXTMENU void taskQTBUG_7902_contextMenuCrash(); #endif + void bidiVisualMovement_data(); + void bidiVisualMovement(); + + void bidiLogicalMovement_data(); + void bidiLogicalMovement(); private: void createSelection(); @@ -2235,5 +2240,147 @@ void tst_QTextEdit::taskQTBUG_7902_contextMenuCrash() } #endif +void tst_QTextEdit::bidiVisualMovement_data() +{ + QTest::addColumn("logical"); + QTest::addColumn("basicDir"); + QTest::addColumn >("positionList"); + + QTest::newRow("Latin text") + << QString::fromUtf8("abc") + << (int) QChar::DirL + << (QList() << 0 << 1 << 2 << 3); + QTest::newRow("Hebrew text, one item") + << QString::fromUtf8("\327\220\327\221\327\222") + << (int) QChar::DirR + << (QList() << 0 << 1 << 2 << 3); + QTest::newRow("Hebrew text after Latin text") + << QString::fromUtf8("abc\327\220\327\221\327\222") + << (int) QChar::DirL + << (QList() << 0 << 1 << 2 << 6 << 5 << 4 << 3); + QTest::newRow("Latin text after Hebrew text") + << QString::fromUtf8("\327\220\327\221\327\222abc") + << (int) QChar::DirR + << (QList() << 0 << 1 << 2 << 6 << 5 << 4 << 3); + QTest::newRow("LTR, 3 items") + << QString::fromUtf8("abc\327\220\327\221\327\222abc") + << (int) QChar::DirL + << (QList() << 0 << 1 << 2 << 5 << 4 << 3 << 6 << 7 << 8 << 9); + QTest::newRow("RTL, 3 items") + << QString::fromUtf8("\327\220\327\221\327\222abc\327\220\327\221\327\222") + << (int) QChar::DirR + << (QList() << 0 << 1 << 2 << 5 << 4 << 3 << 6 << 7 << 8 << 9); + QTest::newRow("LTR, 4 items") + << QString::fromUtf8("abc\327\220\327\221\327\222abc\327\220\327\221\327\222") + << (int) QChar::DirL + << (QList() << 0 << 1 << 2 << 5 << 4 << 3 << 6 << 7 << 8 << 12 << 11 << 10 << 9); + QTest::newRow("RTL, 4 items") + << QString::fromUtf8("\327\220\327\221\327\222abc\327\220\327\221\327\222abc") + << (int) QChar::DirR + << (QList() << 0 << 1 << 2 << 5 << 4 << 3 << 6 << 7 << 8 << 12 << 11 << 10 << 9); +} + +void tst_QTextEdit::bidiVisualMovement() +{ + QFETCH(QString, logical); + QFETCH(int, basicDir); + QFETCH(QList, positionList); + + ed->setText(logical); + + QTextOption option = ed->document()->defaultTextOption(); + option.setTextDirection(basicDir == QChar::DirL ? Qt::LeftToRight : Qt::RightToLeft); + ed->document()->setDefaultTextOption(option); + + ed->document()->setDefaultCursorMoveStyle(QTextCursor::Visual); + ed->moveCursor(QTextCursor::Start); + ed->show(); + + bool moved; + int i = 0, oldPos, newPos = 0; + + do { + oldPos = newPos; + QVERIFY(oldPos == positionList[i]); + if (basicDir == QChar::DirL) { + ed->moveCursor(QTextCursor::Right); + } else + { + ed->moveCursor(QTextCursor::Left); + } + newPos = ed->textCursor().position(); + moved = (oldPos != newPos); + i++; + } while (moved); + + QVERIFY(i == positionList.size()); + + do { + i--; + oldPos = newPos; + QVERIFY(oldPos == positionList[i]); + if (basicDir == QChar::DirL) { + ed->moveCursor(QTextCursor::Left); + } else + { + ed->moveCursor(QTextCursor::Right); + } + newPos = ed->textCursor().position(); + moved = (oldPos != newPos); + } while (moved && i >= 0); +} + +void tst_QTextEdit::bidiLogicalMovement_data() +{ + bidiVisualMovement_data(); +} + +void tst_QTextEdit::bidiLogicalMovement() +{ + QFETCH(QString, logical); + QFETCH(int, basicDir); + + ed->setText(logical); + + QTextOption option = ed->document()->defaultTextOption(); + option.setTextDirection(basicDir == QChar::DirL ? Qt::LeftToRight : Qt::RightToLeft); + ed->document()->setDefaultTextOption(option); + + ed->document()->setDefaultCursorMoveStyle(QTextCursor::Logical); + ed->moveCursor(QTextCursor::Start); + ed->show(); + + bool moved; + int i = 0, oldPos, newPos = 0; + + do { + oldPos = newPos; + QVERIFY(oldPos == i); + if (basicDir == QChar::DirL) { + ed->moveCursor(QTextCursor::Right); + } else + { + ed->moveCursor(QTextCursor::Left); + } + newPos = ed->textCursor().position(); + moved = (oldPos != newPos); + i++; + } while (moved); + + do { + i--; + oldPos = newPos; + QVERIFY(oldPos == i); + if (basicDir == QChar::DirL) { + ed->moveCursor(QTextCursor::Left); + } else + { + ed->moveCursor(QTextCursor::Right); + } + newPos = ed->textCursor().position(); + moved = (oldPos != newPos); + } while (moved && i >= 0); +} + QTEST_MAIN(tst_QTextEdit) #include "tst_qtextedit.moc" diff --git a/tests/auto/uic/baseline/config_fromuic3.ui b/tests/auto/uic/baseline/config_fromuic3.ui deleted file mode 100644 index f8debfebe3b..00000000000 --- a/tests/auto/uic/baseline/config_fromuic3.ui +++ /dev/null @@ -1,1647 +0,0 @@ - - - - ********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* - - Config - - - - 0 - 0 - 481 - 645 - - - - Configure - - - logo.png - - - true - - - - 11 - - - 6 - - - - - Depth - - - - - 11 - 19 - 229 - 19 - - - - 1 bit monochrome - - - - - - 11 - 44 - 229 - 19 - - - - 4 bit grayscale - - - - - - 11 - 69 - 229 - 19 - - - - 8 bit - - - - - - 11 - 94 - 229 - 19 - - - - 12 (16) bit - - - - - - 11 - 119 - 229 - 19 - - - - 16 bit - - - - - - 11 - 144 - 229 - 19 - - - - 32 bit - - - - - - - - 0 - - - 6 - - - - - - 20 - 20 - - - - QSizePolicy::Expanding - - - Qt::Horizontal - - - - - - - &OK - - - true - - - true - - - - - - - &Cancel - - - true - - - - - - - - - Emulate touch screen (no mouse move). - - - - - - - Gamma - - - - 11 - - - 6 - - - - - Blue - - - false - - - - - - - - - - 0 - 0 - 0 - - - 0 - 0 - 255 - - - 127 - 127 - 255 - - - 63 - 63 - 255 - - - 0 - 0 - 127 - - - 0 - 0 - 170 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 0 - 0 - 0 - - - 0 - 0 - 255 - - - 127 - 127 - 255 - - - 38 - 38 - 255 - - - 0 - 0 - 127 - - - 0 - 0 - 170 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 128 - 128 - 128 - - - 0 - 0 - 255 - - - 127 - 127 - 255 - - - 38 - 38 - 255 - - - 0 - 0 - 127 - - - 0 - 0 - 170 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 128 - 128 - 128 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - - 400 - - - 100 - - - Qt::Horizontal - - - - - - - 1.0 - - - false - - - - - - - - 20 - 20 - - - - QSizePolicy::Expanding - - - Qt::Vertical - - - - - - - Green - - - false - - - - - - - - - - 0 - 0 - 0 - - - 0 - 255 - 0 - - - 127 - 255 - 127 - - - 63 - 255 - 63 - - - 0 - 127 - 0 - - - 0 - 170 - 0 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 0 - 0 - 0 - - - 0 - 255 - 0 - - - 127 - 255 - 127 - - - 38 - 255 - 38 - - - 0 - 127 - 0 - - - 0 - 170 - 0 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 128 - 128 - 128 - - - 0 - 255 - 0 - - - 127 - 255 - 127 - - - 38 - 255 - 38 - - - 0 - 127 - 0 - - - 0 - 170 - 0 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 128 - 128 - 128 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - - 400 - - - 100 - - - Qt::Horizontal - - - - - - - 1.0 - - - false - - - - - - - All - - - false - - - - - - - 1.0 - - - false - - - - - - - - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 255 - 255 - 255 - - - 255 - 255 - 255 - - - 127 - 127 - 127 - - - 170 - 170 - 170 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 255 - 255 - 255 - - - 255 - 255 - 255 - - - 127 - 127 - 127 - - - 170 - 170 - 170 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 128 - 128 - 128 - - - 255 - 255 - 255 - - - 255 - 255 - 255 - - - 255 - 255 - 255 - - - 127 - 127 - 127 - - - 170 - 170 - 170 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 128 - 128 - 128 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - - 400 - - - 100 - - - Qt::Horizontal - - - - - - - Red - - - false - - - - - - - 1.0 - - - false - - - - - - - - - - 0 - 0 - 0 - - - 255 - 0 - 0 - - - 255 - 127 - 127 - - - 255 - 63 - 63 - - - 127 - 0 - 0 - - - 170 - 0 - 0 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 0 - 0 - 0 - - - 255 - 0 - 0 - - - 255 - 127 - 127 - - - 255 - 38 - 38 - - - 127 - 0 - 0 - - - 170 - 0 - 0 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 128 - 128 - 128 - - - 255 - 0 - 0 - - - 255 - 127 - 127 - - - 255 - 38 - 38 - - - 127 - 0 - 0 - - - 170 - 0 - 0 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 128 - 128 - 128 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - - 400 - - - 100 - - - Qt::Horizontal - - - - - - - - 20 - 20 - - - - QSizePolicy::Expanding - - - Qt::Vertical - - - - - - - - 20 - 20 - - - - QSizePolicy::Expanding - - - Qt::Vertical - - - - - - - Set all to 1.0 - - - - - - - - - - - 20 - 20 - - - - QSizePolicy::Expanding - - - Qt::Vertical - - - - - - - - - - - 5 - 5 - 0 - 0 - - - - Size - - - - 11 - - - 6 - - - - - 240x320 "PDA" - - - - - - - 320x240 "TV" - - - - - - - 640x480 "VGA" - - - - - - - 0 - - - 6 - - - - - Custom - - - - - - - 1280 - - - 1 - - - 16 - - - 400 - - - - - - - 1024 - - - 1 - - - 16 - - - 300 - - - - - - - - - 0 - - - 6 - - - - - - 0 - 0 - 0 - 0 - - - - Skin - - - - - - - - 5 - 0 - 0 - 0 - - - - - pda.skin - - - - - ipaq.skin - - - - - qpe.skin - - - - - cassiopeia.skin - - - - - other.skin - - - - - - - - - - - - - <p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>. - - - false - - - - - - - Test - - - 1 - - - - - - - - - GammaView - QWidget -
gammaview.h
- - 64 - 64 - - 0 - - 3 - 3 - - image0 -
-
- - - 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 - - - - - buttonOk - clicked() - Config - accept() - - - buttonCancel - clicked() - Config - reject() - - -
diff --git a/tests/auto/uic/baseline/config_fromuic3.ui.h b/tests/auto/uic/baseline/config_fromuic3.ui.h deleted file mode 100644 index 1078b891d27..00000000000 --- a/tests/auto/uic/baseline/config_fromuic3.ui.h +++ /dev/null @@ -1,716 +0,0 @@ -/* -********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* -*/ - -/******************************************************************************** -** Form generated from reading UI file 'config_fromuic3.ui' -** -** Created: Thu Dec 17 12:48:42 2009 -** by: Qt User Interface Compiler version 4.6.4 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef CONFIG_FROMUIC3_H -#define CONFIG_FROMUIC3_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "gammaview.h" - -QT_BEGIN_NAMESPACE - -class Ui_Config -{ -public: - QGridLayout *gridLayout; - Q3ButtonGroup *ButtonGroup2; - QRadioButton *depth_1; - QRadioButton *depth_4gray; - QRadioButton *depth_8; - QRadioButton *depth_12; - QRadioButton *depth_16; - QRadioButton *depth_32; - QHBoxLayout *hboxLayout; - QSpacerItem *Horizontal_Spacing2; - QPushButton *buttonOk; - QPushButton *buttonCancel; - QCheckBox *touchScreen; - Q3GroupBox *GroupBox1; - QGridLayout *gridLayout1; - QLabel *TextLabel3; - QSlider *bslider; - QLabel *blabel; - QSpacerItem *Spacer3; - QLabel *TextLabel2; - QSlider *gslider; - QLabel *glabel; - QLabel *TextLabel7; - QLabel *TextLabel8; - QSlider *gammaslider; - QLabel *TextLabel1_2; - QLabel *rlabel; - QSlider *rslider; - QSpacerItem *Spacer2; - QSpacerItem *Spacer4; - QPushButton *PushButton3; - GammaView *MyCustomWidget1; - QSpacerItem *Spacer5; - Q3ButtonGroup *ButtonGroup1; - QVBoxLayout *vboxLayout; - QRadioButton *size_240_320; - QRadioButton *size_320_240; - QRadioButton *size_640_480; - QHBoxLayout *hboxLayout1; - QRadioButton *size_custom; - QSpinBox *size_width; - QSpinBox *size_height; - QHBoxLayout *hboxLayout2; - QRadioButton *size_skin; - QComboBox *skin; - QLabel *TextLabel1; - QRadioButton *test_for_useless_buttongroupId; - - void setupUi(QDialog *Config) - { - if (Config->objectName().isEmpty()) - Config->setObjectName(QString::fromUtf8("Config")); - Config->resize(481, 645); - Config->setWindowIcon(QPixmap(QString::fromUtf8("logo.png"))); - Config->setSizeGripEnabled(true); - gridLayout = new QGridLayout(Config); - gridLayout->setSpacing(6); - gridLayout->setContentsMargins(11, 11, 11, 11); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - ButtonGroup2 = new Q3ButtonGroup(Config); - ButtonGroup2->setObjectName(QString::fromUtf8("ButtonGroup2")); - depth_1 = new QRadioButton(ButtonGroup2); - depth_1->setObjectName(QString::fromUtf8("depth_1")); - depth_1->setGeometry(QRect(11, 19, 229, 19)); - depth_4gray = new QRadioButton(ButtonGroup2); - depth_4gray->setObjectName(QString::fromUtf8("depth_4gray")); - depth_4gray->setGeometry(QRect(11, 44, 229, 19)); - depth_8 = new QRadioButton(ButtonGroup2); - depth_8->setObjectName(QString::fromUtf8("depth_8")); - depth_8->setGeometry(QRect(11, 69, 229, 19)); - depth_12 = new QRadioButton(ButtonGroup2); - depth_12->setObjectName(QString::fromUtf8("depth_12")); - depth_12->setGeometry(QRect(11, 94, 229, 19)); - depth_16 = new QRadioButton(ButtonGroup2); - depth_16->setObjectName(QString::fromUtf8("depth_16")); - depth_16->setGeometry(QRect(11, 119, 229, 19)); - depth_32 = new QRadioButton(ButtonGroup2); - depth_32->setObjectName(QString::fromUtf8("depth_32")); - depth_32->setGeometry(QRect(11, 144, 229, 19)); - - gridLayout->addWidget(ButtonGroup2, 0, 1, 1, 1); - - hboxLayout = new QHBoxLayout(); - hboxLayout->setSpacing(6); - hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - Horizontal_Spacing2 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout->addItem(Horizontal_Spacing2); - - buttonOk = new QPushButton(Config); - buttonOk->setObjectName(QString::fromUtf8("buttonOk")); - buttonOk->setAutoDefault(true); - buttonOk->setDefault(true); - - hboxLayout->addWidget(buttonOk); - - buttonCancel = new QPushButton(Config); - buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); - buttonCancel->setAutoDefault(true); - - hboxLayout->addWidget(buttonCancel); - - - gridLayout->addLayout(hboxLayout, 4, 0, 1, 2); - - touchScreen = new QCheckBox(Config); - touchScreen->setObjectName(QString::fromUtf8("touchScreen")); - - gridLayout->addWidget(touchScreen, 2, 0, 1, 2); - - GroupBox1 = new Q3GroupBox(Config); - GroupBox1->setObjectName(QString::fromUtf8("GroupBox1")); - GroupBox1->setColumnLayout(0, Qt::Vertical); - GroupBox1->layout()->setSpacing(6); - GroupBox1->layout()->setContentsMargins(11, 11, 11, 11); - gridLayout1 = new QGridLayout(); - QBoxLayout *boxlayout = qobject_cast(GroupBox1->layout()); - if (boxlayout) - boxlayout->addLayout(gridLayout1); - gridLayout1->setAlignment(Qt::AlignTop); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); - TextLabel3 = new QLabel(GroupBox1); - TextLabel3->setObjectName(QString::fromUtf8("TextLabel3")); - TextLabel3->setWordWrap(false); - - gridLayout1->addWidget(TextLabel3, 6, 0, 1, 1); - - bslider = new QSlider(GroupBox1); - bslider->setObjectName(QString::fromUtf8("bslider")); - QPalette palette; - palette.setColor(QPalette::Active, static_cast(0), QColor(0, 0, 0)); - palette.setColor(QPalette::Active, static_cast(1), QColor(0, 0, 255)); - palette.setColor(QPalette::Active, static_cast(2), QColor(127, 127, 255)); - palette.setColor(QPalette::Active, static_cast(3), QColor(63, 63, 255)); - palette.setColor(QPalette::Active, static_cast(4), QColor(0, 0, 127)); - palette.setColor(QPalette::Active, static_cast(5), QColor(0, 0, 170)); - palette.setColor(QPalette::Active, static_cast(6), QColor(0, 0, 0)); - palette.setColor(QPalette::Active, static_cast(7), QColor(255, 255, 255)); - palette.setColor(QPalette::Active, static_cast(8), QColor(0, 0, 0)); - palette.setColor(QPalette::Active, static_cast(9), QColor(255, 255, 255)); - palette.setColor(QPalette::Active, static_cast(10), QColor(220, 220, 220)); - palette.setColor(QPalette::Active, static_cast(11), QColor(0, 0, 0)); - palette.setColor(QPalette::Active, static_cast(12), QColor(10, 95, 137)); - palette.setColor(QPalette::Active, static_cast(13), QColor(255, 255, 255)); - palette.setColor(QPalette::Active, static_cast(14), QColor(0, 0, 0)); - palette.setColor(QPalette::Active, static_cast(15), QColor(0, 0, 0)); - palette.setColor(QPalette::Inactive, static_cast(0), QColor(0, 0, 0)); - palette.setColor(QPalette::Inactive, static_cast(1), QColor(0, 0, 255)); - palette.setColor(QPalette::Inactive, static_cast(2), QColor(127, 127, 255)); - palette.setColor(QPalette::Inactive, static_cast(3), QColor(38, 38, 255)); - palette.setColor(QPalette::Inactive, static_cast(4), QColor(0, 0, 127)); - palette.setColor(QPalette::Inactive, static_cast(5), QColor(0, 0, 170)); - palette.setColor(QPalette::Inactive, static_cast(6), QColor(0, 0, 0)); - palette.setColor(QPalette::Inactive, static_cast(7), QColor(255, 255, 255)); - palette.setColor(QPalette::Inactive, static_cast(8), QColor(0, 0, 0)); - palette.setColor(QPalette::Inactive, static_cast(9), QColor(255, 255, 255)); - palette.setColor(QPalette::Inactive, static_cast(10), QColor(220, 220, 220)); - palette.setColor(QPalette::Inactive, static_cast(11), QColor(0, 0, 0)); - palette.setColor(QPalette::Inactive, static_cast(12), QColor(10, 95, 137)); - palette.setColor(QPalette::Inactive, static_cast(13), QColor(255, 255, 255)); - palette.setColor(QPalette::Inactive, static_cast(14), QColor(0, 0, 0)); - palette.setColor(QPalette::Inactive, static_cast(15), QColor(0, 0, 0)); - palette.setColor(QPalette::Disabled, static_cast(0), QColor(128, 128, 128)); - palette.setColor(QPalette::Disabled, static_cast(1), QColor(0, 0, 255)); - palette.setColor(QPalette::Disabled, static_cast(2), QColor(127, 127, 255)); - palette.setColor(QPalette::Disabled, static_cast(3), QColor(38, 38, 255)); - palette.setColor(QPalette::Disabled, static_cast(4), QColor(0, 0, 127)); - palette.setColor(QPalette::Disabled, static_cast(5), QColor(0, 0, 170)); - palette.setColor(QPalette::Disabled, static_cast(6), QColor(0, 0, 0)); - palette.setColor(QPalette::Disabled, static_cast(7), QColor(255, 255, 255)); - palette.setColor(QPalette::Disabled, static_cast(8), QColor(128, 128, 128)); - palette.setColor(QPalette::Disabled, static_cast(9), QColor(255, 255, 255)); - palette.setColor(QPalette::Disabled, static_cast(10), QColor(220, 220, 220)); - palette.setColor(QPalette::Disabled, static_cast(11), QColor(0, 0, 0)); - palette.setColor(QPalette::Disabled, static_cast(12), QColor(10, 95, 137)); - palette.setColor(QPalette::Disabled, static_cast(13), QColor(255, 255, 255)); - palette.setColor(QPalette::Disabled, static_cast(14), QColor(0, 0, 0)); - palette.setColor(QPalette::Disabled, static_cast(15), QColor(0, 0, 0)); - bslider->setPalette(palette); - bslider->setMaximum(400); - bslider->setValue(100); - bslider->setOrientation(Qt::Horizontal); - - gridLayout1->addWidget(bslider, 6, 1, 1, 1); - - blabel = new QLabel(GroupBox1); - blabel->setObjectName(QString::fromUtf8("blabel")); - blabel->setWordWrap(false); - - gridLayout1->addWidget(blabel, 6, 2, 1, 1); - - Spacer3 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout1->addItem(Spacer3, 5, 1, 1, 1); - - TextLabel2 = new QLabel(GroupBox1); - TextLabel2->setObjectName(QString::fromUtf8("TextLabel2")); - TextLabel2->setWordWrap(false); - - gridLayout1->addWidget(TextLabel2, 4, 0, 1, 1); - - gslider = new QSlider(GroupBox1); - gslider->setObjectName(QString::fromUtf8("gslider")); - QPalette palette1; - palette1.setColor(QPalette::Active, static_cast(0), QColor(0, 0, 0)); - palette1.setColor(QPalette::Active, static_cast(1), QColor(0, 255, 0)); - palette1.setColor(QPalette::Active, static_cast(2), QColor(127, 255, 127)); - palette1.setColor(QPalette::Active, static_cast(3), QColor(63, 255, 63)); - palette1.setColor(QPalette::Active, static_cast(4), QColor(0, 127, 0)); - palette1.setColor(QPalette::Active, static_cast(5), QColor(0, 170, 0)); - palette1.setColor(QPalette::Active, static_cast(6), QColor(0, 0, 0)); - palette1.setColor(QPalette::Active, static_cast(7), QColor(255, 255, 255)); - palette1.setColor(QPalette::Active, static_cast(8), QColor(0, 0, 0)); - palette1.setColor(QPalette::Active, static_cast(9), QColor(255, 255, 255)); - palette1.setColor(QPalette::Active, static_cast(10), QColor(220, 220, 220)); - palette1.setColor(QPalette::Active, static_cast(11), QColor(0, 0, 0)); - palette1.setColor(QPalette::Active, static_cast(12), QColor(10, 95, 137)); - palette1.setColor(QPalette::Active, static_cast(13), QColor(255, 255, 255)); - palette1.setColor(QPalette::Active, static_cast(14), QColor(0, 0, 0)); - palette1.setColor(QPalette::Active, static_cast(15), QColor(0, 0, 0)); - palette1.setColor(QPalette::Inactive, static_cast(0), QColor(0, 0, 0)); - palette1.setColor(QPalette::Inactive, static_cast(1), QColor(0, 255, 0)); - palette1.setColor(QPalette::Inactive, static_cast(2), QColor(127, 255, 127)); - palette1.setColor(QPalette::Inactive, static_cast(3), QColor(38, 255, 38)); - palette1.setColor(QPalette::Inactive, static_cast(4), QColor(0, 127, 0)); - palette1.setColor(QPalette::Inactive, static_cast(5), QColor(0, 170, 0)); - palette1.setColor(QPalette::Inactive, static_cast(6), QColor(0, 0, 0)); - palette1.setColor(QPalette::Inactive, static_cast(7), QColor(255, 255, 255)); - palette1.setColor(QPalette::Inactive, static_cast(8), QColor(0, 0, 0)); - palette1.setColor(QPalette::Inactive, static_cast(9), QColor(255, 255, 255)); - palette1.setColor(QPalette::Inactive, static_cast(10), QColor(220, 220, 220)); - palette1.setColor(QPalette::Inactive, static_cast(11), QColor(0, 0, 0)); - palette1.setColor(QPalette::Inactive, static_cast(12), QColor(10, 95, 137)); - palette1.setColor(QPalette::Inactive, static_cast(13), QColor(255, 255, 255)); - palette1.setColor(QPalette::Inactive, static_cast(14), QColor(0, 0, 0)); - palette1.setColor(QPalette::Inactive, static_cast(15), QColor(0, 0, 0)); - palette1.setColor(QPalette::Disabled, static_cast(0), QColor(128, 128, 128)); - palette1.setColor(QPalette::Disabled, static_cast(1), QColor(0, 255, 0)); - palette1.setColor(QPalette::Disabled, static_cast(2), QColor(127, 255, 127)); - palette1.setColor(QPalette::Disabled, static_cast(3), QColor(38, 255, 38)); - palette1.setColor(QPalette::Disabled, static_cast(4), QColor(0, 127, 0)); - palette1.setColor(QPalette::Disabled, static_cast(5), QColor(0, 170, 0)); - palette1.setColor(QPalette::Disabled, static_cast(6), QColor(0, 0, 0)); - palette1.setColor(QPalette::Disabled, static_cast(7), QColor(255, 255, 255)); - palette1.setColor(QPalette::Disabled, static_cast(8), QColor(128, 128, 128)); - palette1.setColor(QPalette::Disabled, static_cast(9), QColor(255, 255, 255)); - palette1.setColor(QPalette::Disabled, static_cast(10), QColor(220, 220, 220)); - palette1.setColor(QPalette::Disabled, static_cast(11), QColor(0, 0, 0)); - palette1.setColor(QPalette::Disabled, static_cast(12), QColor(10, 95, 137)); - palette1.setColor(QPalette::Disabled, static_cast(13), QColor(255, 255, 255)); - palette1.setColor(QPalette::Disabled, static_cast(14), QColor(0, 0, 0)); - palette1.setColor(QPalette::Disabled, static_cast(15), QColor(0, 0, 0)); - gslider->setPalette(palette1); - gslider->setMaximum(400); - gslider->setValue(100); - gslider->setOrientation(Qt::Horizontal); - - gridLayout1->addWidget(gslider, 4, 1, 1, 1); - - glabel = new QLabel(GroupBox1); - glabel->setObjectName(QString::fromUtf8("glabel")); - glabel->setWordWrap(false); - - gridLayout1->addWidget(glabel, 4, 2, 1, 1); - - TextLabel7 = new QLabel(GroupBox1); - TextLabel7->setObjectName(QString::fromUtf8("TextLabel7")); - TextLabel7->setWordWrap(false); - - gridLayout1->addWidget(TextLabel7, 0, 0, 1, 1); - - TextLabel8 = new QLabel(GroupBox1); - TextLabel8->setObjectName(QString::fromUtf8("TextLabel8")); - TextLabel8->setWordWrap(false); - - gridLayout1->addWidget(TextLabel8, 0, 2, 1, 1); - - gammaslider = new QSlider(GroupBox1); - gammaslider->setObjectName(QString::fromUtf8("gammaslider")); - QPalette palette2; - palette2.setColor(QPalette::Active, static_cast(0), QColor(0, 0, 0)); - palette2.setColor(QPalette::Active, static_cast(1), QColor(255, 255, 255)); - palette2.setColor(QPalette::Active, static_cast(2), QColor(255, 255, 255)); - palette2.setColor(QPalette::Active, static_cast(3), QColor(255, 255, 255)); - palette2.setColor(QPalette::Active, static_cast(4), QColor(127, 127, 127)); - palette2.setColor(QPalette::Active, static_cast(5), QColor(170, 170, 170)); - palette2.setColor(QPalette::Active, static_cast(6), QColor(0, 0, 0)); - palette2.setColor(QPalette::Active, static_cast(7), QColor(255, 255, 255)); - palette2.setColor(QPalette::Active, static_cast(8), QColor(0, 0, 0)); - palette2.setColor(QPalette::Active, static_cast(9), QColor(255, 255, 255)); - palette2.setColor(QPalette::Active, static_cast(10), QColor(220, 220, 220)); - palette2.setColor(QPalette::Active, static_cast(11), QColor(0, 0, 0)); - palette2.setColor(QPalette::Active, static_cast(12), QColor(10, 95, 137)); - palette2.setColor(QPalette::Active, static_cast(13), QColor(255, 255, 255)); - palette2.setColor(QPalette::Active, static_cast(14), QColor(0, 0, 0)); - palette2.setColor(QPalette::Active, static_cast(15), QColor(0, 0, 0)); - palette2.setColor(QPalette::Inactive, static_cast(0), QColor(0, 0, 0)); - palette2.setColor(QPalette::Inactive, static_cast(1), QColor(255, 255, 255)); - palette2.setColor(QPalette::Inactive, static_cast(2), QColor(255, 255, 255)); - palette2.setColor(QPalette::Inactive, static_cast(3), QColor(255, 255, 255)); - palette2.setColor(QPalette::Inactive, static_cast(4), QColor(127, 127, 127)); - palette2.setColor(QPalette::Inactive, static_cast(5), QColor(170, 170, 170)); - palette2.setColor(QPalette::Inactive, static_cast(6), QColor(0, 0, 0)); - palette2.setColor(QPalette::Inactive, static_cast(7), QColor(255, 255, 255)); - palette2.setColor(QPalette::Inactive, static_cast(8), QColor(0, 0, 0)); - palette2.setColor(QPalette::Inactive, static_cast(9), QColor(255, 255, 255)); - palette2.setColor(QPalette::Inactive, static_cast(10), QColor(220, 220, 220)); - palette2.setColor(QPalette::Inactive, static_cast(11), QColor(0, 0, 0)); - palette2.setColor(QPalette::Inactive, static_cast(12), QColor(10, 95, 137)); - palette2.setColor(QPalette::Inactive, static_cast(13), QColor(255, 255, 255)); - palette2.setColor(QPalette::Inactive, static_cast(14), QColor(0, 0, 0)); - palette2.setColor(QPalette::Inactive, static_cast(15), QColor(0, 0, 0)); - palette2.setColor(QPalette::Disabled, static_cast(0), QColor(128, 128, 128)); - palette2.setColor(QPalette::Disabled, static_cast(1), QColor(255, 255, 255)); - palette2.setColor(QPalette::Disabled, static_cast(2), QColor(255, 255, 255)); - palette2.setColor(QPalette::Disabled, static_cast(3), QColor(255, 255, 255)); - palette2.setColor(QPalette::Disabled, static_cast(4), QColor(127, 127, 127)); - palette2.setColor(QPalette::Disabled, static_cast(5), QColor(170, 170, 170)); - palette2.setColor(QPalette::Disabled, static_cast(6), QColor(0, 0, 0)); - palette2.setColor(QPalette::Disabled, static_cast(7), QColor(255, 255, 255)); - palette2.setColor(QPalette::Disabled, static_cast(8), QColor(128, 128, 128)); - palette2.setColor(QPalette::Disabled, static_cast(9), QColor(255, 255, 255)); - palette2.setColor(QPalette::Disabled, static_cast(10), QColor(220, 220, 220)); - palette2.setColor(QPalette::Disabled, static_cast(11), QColor(0, 0, 0)); - palette2.setColor(QPalette::Disabled, static_cast(12), QColor(10, 95, 137)); - palette2.setColor(QPalette::Disabled, static_cast(13), QColor(255, 255, 255)); - palette2.setColor(QPalette::Disabled, static_cast(14), QColor(0, 0, 0)); - palette2.setColor(QPalette::Disabled, static_cast(15), QColor(0, 0, 0)); - gammaslider->setPalette(palette2); - gammaslider->setMaximum(400); - gammaslider->setValue(100); - gammaslider->setOrientation(Qt::Horizontal); - - gridLayout1->addWidget(gammaslider, 0, 1, 1, 1); - - TextLabel1_2 = new QLabel(GroupBox1); - TextLabel1_2->setObjectName(QString::fromUtf8("TextLabel1_2")); - TextLabel1_2->setWordWrap(false); - - gridLayout1->addWidget(TextLabel1_2, 2, 0, 1, 1); - - rlabel = new QLabel(GroupBox1); - rlabel->setObjectName(QString::fromUtf8("rlabel")); - rlabel->setWordWrap(false); - - gridLayout1->addWidget(rlabel, 2, 2, 1, 1); - - rslider = new QSlider(GroupBox1); - rslider->setObjectName(QString::fromUtf8("rslider")); - QPalette palette3; - palette3.setColor(QPalette::Active, static_cast(0), QColor(0, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(1), QColor(255, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(2), QColor(255, 127, 127)); - palette3.setColor(QPalette::Active, static_cast(3), QColor(255, 63, 63)); - palette3.setColor(QPalette::Active, static_cast(4), QColor(127, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(5), QColor(170, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(6), QColor(0, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(7), QColor(255, 255, 255)); - palette3.setColor(QPalette::Active, static_cast(8), QColor(0, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(9), QColor(255, 255, 255)); - palette3.setColor(QPalette::Active, static_cast(10), QColor(220, 220, 220)); - palette3.setColor(QPalette::Active, static_cast(11), QColor(0, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(12), QColor(10, 95, 137)); - palette3.setColor(QPalette::Active, static_cast(13), QColor(255, 255, 255)); - palette3.setColor(QPalette::Active, static_cast(14), QColor(0, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(15), QColor(0, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(0), QColor(0, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(1), QColor(255, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(2), QColor(255, 127, 127)); - palette3.setColor(QPalette::Inactive, static_cast(3), QColor(255, 38, 38)); - palette3.setColor(QPalette::Inactive, static_cast(4), QColor(127, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(5), QColor(170, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(6), QColor(0, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(7), QColor(255, 255, 255)); - palette3.setColor(QPalette::Inactive, static_cast(8), QColor(0, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(9), QColor(255, 255, 255)); - palette3.setColor(QPalette::Inactive, static_cast(10), QColor(220, 220, 220)); - palette3.setColor(QPalette::Inactive, static_cast(11), QColor(0, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(12), QColor(10, 95, 137)); - palette3.setColor(QPalette::Inactive, static_cast(13), QColor(255, 255, 255)); - palette3.setColor(QPalette::Inactive, static_cast(14), QColor(0, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(15), QColor(0, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(0), QColor(128, 128, 128)); - palette3.setColor(QPalette::Disabled, static_cast(1), QColor(255, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(2), QColor(255, 127, 127)); - palette3.setColor(QPalette::Disabled, static_cast(3), QColor(255, 38, 38)); - palette3.setColor(QPalette::Disabled, static_cast(4), QColor(127, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(5), QColor(170, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(6), QColor(0, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(7), QColor(255, 255, 255)); - palette3.setColor(QPalette::Disabled, static_cast(8), QColor(128, 128, 128)); - palette3.setColor(QPalette::Disabled, static_cast(9), QColor(255, 255, 255)); - palette3.setColor(QPalette::Disabled, static_cast(10), QColor(220, 220, 220)); - palette3.setColor(QPalette::Disabled, static_cast(11), QColor(0, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(12), QColor(10, 95, 137)); - palette3.setColor(QPalette::Disabled, static_cast(13), QColor(255, 255, 255)); - palette3.setColor(QPalette::Disabled, static_cast(14), QColor(0, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(15), QColor(0, 0, 0)); - rslider->setPalette(palette3); - rslider->setMaximum(400); - rslider->setValue(100); - rslider->setOrientation(Qt::Horizontal); - - gridLayout1->addWidget(rslider, 2, 1, 1, 1); - - Spacer2 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout1->addItem(Spacer2, 3, 1, 1, 1); - - Spacer4 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout1->addItem(Spacer4, 1, 1, 1, 1); - - PushButton3 = new QPushButton(GroupBox1); - PushButton3->setObjectName(QString::fromUtf8("PushButton3")); - - gridLayout1->addWidget(PushButton3, 8, 0, 1, 3); - - MyCustomWidget1 = new GammaView(GroupBox1); - MyCustomWidget1->setObjectName(QString::fromUtf8("MyCustomWidget1")); - - gridLayout1->addWidget(MyCustomWidget1, 0, 3, 9, 1); - - Spacer5 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout1->addItem(Spacer5, 7, 1, 1, 1); - - - gridLayout->addWidget(GroupBox1, 3, 0, 1, 2); - - ButtonGroup1 = new Q3ButtonGroup(Config); - ButtonGroup1->setObjectName(QString::fromUtf8("ButtonGroup1")); - QSizePolicy sizePolicy(static_cast(5), static_cast(5)); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(ButtonGroup1->sizePolicy().hasHeightForWidth()); - ButtonGroup1->setSizePolicy(sizePolicy); - ButtonGroup1->setColumnLayout(0, Qt::Vertical); - ButtonGroup1->layout()->setSpacing(6); - ButtonGroup1->layout()->setContentsMargins(11, 11, 11, 11); - vboxLayout = new QVBoxLayout(); - QBoxLayout *boxlayout1 = qobject_cast(ButtonGroup1->layout()); - if (boxlayout1) - boxlayout1->addLayout(vboxLayout); - vboxLayout->setAlignment(Qt::AlignTop); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - size_240_320 = new QRadioButton(ButtonGroup1); - size_240_320->setObjectName(QString::fromUtf8("size_240_320")); - - vboxLayout->addWidget(size_240_320); - - size_320_240 = new QRadioButton(ButtonGroup1); - size_320_240->setObjectName(QString::fromUtf8("size_320_240")); - - vboxLayout->addWidget(size_320_240); - - size_640_480 = new QRadioButton(ButtonGroup1); - size_640_480->setObjectName(QString::fromUtf8("size_640_480")); - - vboxLayout->addWidget(size_640_480); - - hboxLayout1 = new QHBoxLayout(); - hboxLayout1->setSpacing(6); - hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); - size_custom = new QRadioButton(ButtonGroup1); - size_custom->setObjectName(QString::fromUtf8("size_custom")); - - hboxLayout1->addWidget(size_custom); - - size_width = new QSpinBox(ButtonGroup1); - size_width->setObjectName(QString::fromUtf8("size_width")); - size_width->setMaximum(1280); - size_width->setMinimum(1); - size_width->setSingleStep(16); - size_width->setValue(400); - - hboxLayout1->addWidget(size_width); - - size_height = new QSpinBox(ButtonGroup1); - size_height->setObjectName(QString::fromUtf8("size_height")); - size_height->setMaximum(1024); - size_height->setMinimum(1); - size_height->setSingleStep(16); - size_height->setValue(300); - - hboxLayout1->addWidget(size_height); - - - vboxLayout->addLayout(hboxLayout1); - - hboxLayout2 = new QHBoxLayout(); - hboxLayout2->setSpacing(6); - hboxLayout2->setContentsMargins(0, 0, 0, 0); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); - size_skin = new QRadioButton(ButtonGroup1); - size_skin->setObjectName(QString::fromUtf8("size_skin")); - QSizePolicy sizePolicy1(static_cast(0), static_cast(0)); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(size_skin->sizePolicy().hasHeightForWidth()); - size_skin->setSizePolicy(sizePolicy1); - - hboxLayout2->addWidget(size_skin); - - skin = new QComboBox(ButtonGroup1); - skin->setObjectName(QString::fromUtf8("skin")); - QSizePolicy sizePolicy2(static_cast(5), static_cast(0)); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(skin->sizePolicy().hasHeightForWidth()); - skin->setSizePolicy(sizePolicy2); - - hboxLayout2->addWidget(skin); - - - vboxLayout->addLayout(hboxLayout2); - - - gridLayout->addWidget(ButtonGroup1, 0, 0, 1, 1); - - TextLabel1 = new QLabel(Config); - TextLabel1->setObjectName(QString::fromUtf8("TextLabel1")); - TextLabel1->setWordWrap(false); - - gridLayout->addWidget(TextLabel1, 1, 0, 1, 2); - - test_for_useless_buttongroupId = new QRadioButton(Config); - test_for_useless_buttongroupId->setObjectName(QString::fromUtf8("test_for_useless_buttongroupId")); - - gridLayout->addWidget(test_for_useless_buttongroupId, 0, 0, 1, 1); - - - retranslateUi(Config); - QObject::connect(buttonOk, SIGNAL(clicked()), Config, SLOT(accept())); - QObject::connect(buttonCancel, SIGNAL(clicked()), Config, SLOT(reject())); - - QMetaObject::connectSlotsByName(Config); - } // setupUi - - void retranslateUi(QDialog *Config) - { - Config->setWindowTitle(QApplication::translate("Config", "Configure", 0, QApplication::UnicodeUTF8)); - ButtonGroup2->setTitle(QApplication::translate("Config", "Depth", 0, QApplication::UnicodeUTF8)); - depth_1->setText(QApplication::translate("Config", "1 bit monochrome", 0, QApplication::UnicodeUTF8)); - depth_4gray->setText(QApplication::translate("Config", "4 bit grayscale", 0, QApplication::UnicodeUTF8)); - depth_8->setText(QApplication::translate("Config", "8 bit", 0, QApplication::UnicodeUTF8)); - depth_12->setText(QApplication::translate("Config", "12 (16) bit", 0, QApplication::UnicodeUTF8)); - depth_16->setText(QApplication::translate("Config", "16 bit", 0, QApplication::UnicodeUTF8)); - depth_32->setText(QApplication::translate("Config", "32 bit", 0, QApplication::UnicodeUTF8)); - buttonOk->setText(QApplication::translate("Config", "&OK", 0, QApplication::UnicodeUTF8)); - buttonCancel->setText(QApplication::translate("Config", "&Cancel", 0, QApplication::UnicodeUTF8)); - touchScreen->setText(QApplication::translate("Config", "Emulate touch screen (no mouse move).", 0, QApplication::UnicodeUTF8)); - GroupBox1->setTitle(QApplication::translate("Config", "Gamma", 0, QApplication::UnicodeUTF8)); - TextLabel3->setText(QApplication::translate("Config", "Blue", 0, QApplication::UnicodeUTF8)); - blabel->setText(QApplication::translate("Config", "1.0", 0, QApplication::UnicodeUTF8)); - TextLabel2->setText(QApplication::translate("Config", "Green", 0, QApplication::UnicodeUTF8)); - glabel->setText(QApplication::translate("Config", "1.0", 0, QApplication::UnicodeUTF8)); - TextLabel7->setText(QApplication::translate("Config", "All", 0, QApplication::UnicodeUTF8)); - TextLabel8->setText(QApplication::translate("Config", "1.0", 0, QApplication::UnicodeUTF8)); - TextLabel1_2->setText(QApplication::translate("Config", "Red", 0, QApplication::UnicodeUTF8)); - rlabel->setText(QApplication::translate("Config", "1.0", 0, QApplication::UnicodeUTF8)); - PushButton3->setText(QApplication::translate("Config", "Set all to 1.0", 0, QApplication::UnicodeUTF8)); - ButtonGroup1->setTitle(QApplication::translate("Config", "Size", 0, QApplication::UnicodeUTF8)); - size_240_320->setText(QApplication::translate("Config", "240x320 \"PDA\"", 0, QApplication::UnicodeUTF8)); - size_320_240->setText(QApplication::translate("Config", "320x240 \"TV\"", 0, QApplication::UnicodeUTF8)); - size_640_480->setText(QApplication::translate("Config", "640x480 \"VGA\"", 0, QApplication::UnicodeUTF8)); - size_custom->setText(QApplication::translate("Config", "Custom", 0, QApplication::UnicodeUTF8)); - size_skin->setText(QApplication::translate("Config", "Skin", 0, QApplication::UnicodeUTF8)); - skin->clear(); - skin->insertItems(0, QStringList() - << QApplication::translate("Config", "pda.skin", 0, QApplication::UnicodeUTF8) - << QApplication::translate("Config", "ipaq.skin", 0, QApplication::UnicodeUTF8) - << QApplication::translate("Config", "qpe.skin", 0, QApplication::UnicodeUTF8) - << QApplication::translate("Config", "cassiopeia.skin", 0, QApplication::UnicodeUTF8) - << QApplication::translate("Config", "other.skin", 0, QApplication::UnicodeUTF8) - ); - TextLabel1->setText(QApplication::translate("Config", "

Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth above. You may freely modify the Gamma below.", 0, QApplication::UnicodeUTF8)); - test_for_useless_buttongroupId->setText(QApplication::translate("Config", "Test", 0, QApplication::UnicodeUTF8)); - } // retranslateUi - - -protected: - enum IconID - { - image0_ID, - unknown_ID - }; - static QPixmap qt_get_icon(IconID id) - { - /* XPM */ - static const char* const image0_data[] = { -"22 22 2 1", -". c None", -"# c #a4c610", -"........######........", -".....###########......", -"....##############....", -"...################...", -"..######......######..", -"..#####........#####..", -".#####.......#..#####.", -".####.......###..####.", -"####.......#####..####", -"####......#####...####", -"####....#######...####", -"####....######....####", -"####...########...####", -".####.##########..####", -".####..####.#########.", -".#####..##...########.", -"..#####.......#######.", -"..######......######..", -"...###################", -"....##################", -"......###########.###.", -"........######.....#.."}; - - - switch (id) { - case image0_ID: return QPixmap((const char**)image0_data); - default: return QPixmap(); - } // switch - } // icon - -}; - -namespace Ui { - class Config: public Ui_Config {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // CONFIG_FROMUIC3_H diff --git a/tests/auto/uic/baseline/mainwindowbase.ui b/tests/auto/uic/baseline/mainwindowbase.ui deleted file mode 100644 index 3bdfecc62cc..00000000000 --- a/tests/auto/uic/baseline/mainwindowbase.ui +++ /dev/null @@ -1,1214 +0,0 @@ - - - ********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* - - MainWindowBase - - - - 0 - 0 - 724 - 615 - - - - Qt Configuration - - - - - 0 - 28 - 724 - 587 - - - - - 8 - - - 4 - - - - - - 200 - 0 - - - - true - - - - - - - - Appearance - - - - 4 - - - 4 - - - - - GUI Style - - - - 8 - - - 4 - - - - - Select GUI &Style: - - - gstylecombo - - - - - - - - - - - - - - 5 - 4 - 0 - 0 - - - - Build Palette - - - - 8 - - - 4 - - - - - &3-D Effects: - - - buttonMainColor - - - - - - - - - - - 1 - 1 - 0 - 0 - - - - - 50 - 0 - - - - 1 - - - 0 - - - Window Back&ground: - - - Qt::AlignVCenter - - - 0 - - - buttonMainColor2 - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 70 - 20 - - - - - - - - &Tune Palette... - - - - - - - - - - - 5 - 7 - 0 - 0 - - - - Preview - - - - 8 - - - 4 - - - - - Select &Palette: - - - paletteCombo - - - - - - - - Active Palette - - - - - Inactive Palette - - - - - Disabled Palette - - - - - - - - - 7 - 7 - 0 - 0 - - - - - 410 - 260 - - - - - - - - - - - - Fonts - - - - 8 - - - 4 - - - - - Default Font - - - - 8 - - - 4 - - - - - true - - - false - - - - - - - true - - - false - - - - - - - true - - - true - - - false - - - - - - - &Style: - - - stylecombo - - - - - - - &Point Size: - - - psizecombo - - - - - - - F&amily: - - - familycombo - - - - - - - Sample Text - - - Qt::AlignHCenter - - - - - - - - - - Font Substitution - - - - 8 - - - 4 - - - - - 0 - - - 4 - - - - - S&elect or Enter a Family: - - - familysubcombo - - - - - - - true - - - true - - - false - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - Qt::Horizontal - - - - - - - Current Substitutions: - - - - - - - - - - 0 - - - 4 - - - - - Up - - - - - - - Down - - - - - - - Remove - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - Qt::Horizontal - - - - - - - 0 - - - 4 - - - - - Select s&ubstitute Family: - - - choosesubcombo - - - - - - - true - - - false - - - - - - - Add - - - - - - - - - - - - - Interface - - - - 7 - - - 4 - - - - - Feel Settings - - - - 8 - - - 4 - - - - - ms - - - 10000 - - - 10 - - - - - - - &Double Click Interval: - - - dcispin - - - - - - - No blinking - - - ms - - - 10000 - - - 9 - - - - - - - &Cursor Flash Time: - - - cfispin - - - - - - - lines - - - 20 - - - 1 - - - - - - - Wheel &Scroll Lines: - - - wslspin - - - - - - - Resolve symlinks in URLs - - - - - - - - - - GUI Effects - - - - 8 - - - 4 - - - - - &Enable - - - Alt+E - - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - - 0 - - - 4 - - - - - &Menu Effect: - - - menueffect - - - - - - - C&omboBox Effect: - - - comboeffect - - - - - - - &ToolTip Effect: - - - tooltipeffect - - - - - - - Tool&Box Effect: - - - toolboxeffect - - - - - - - 0 - - - true - - - - Disable - - - - - Animate - - - - - Fade - - - - - - - - - Disable - - - - - Animate - - - - - - - - - Disable - - - - - Animate - - - - - Fade - - - - - - - - - Disable - - - - - Animate - - - - - - - - - - - - - - Global Strut - - - - 8 - - - 4 - - - - - Minimum &Width: - - - strutwidth - - - - - - - Minimum Hei&ght: - - - strutheight - - - - - - - pixels - - - 1000 - - - - - - - pixels - - - 1000 - - - - - - - - - - Enhanced support for languages written right-to-left - - - - - - - XIM Input Style: - - - - - - - 0 - - - - On The Spot - - - - - Over The Spot - - - - - Off The Spot - - - - - Root - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - - Printer - - - - 8 - - - 4 - - - - - Enable Font embedding - - - true - - - - - - - - 5 - 7 - 0 - 0 - - - - Font Paths - - - - 8 - - - 4 - - - - - 0 - - - 4 - - - - - Up - - - - - - - Remove - - - - - - - Down - - - - - - - - - - - - 0 - - - 4 - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 20 - 20 - - - - - - - - Add - - - - - - - Browse... - - - - - - - Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. - - - - - - - - - - - - - - - - - - - - - 0 - 0 - 724 - 27 - - - - - - 0 - 0 - 800 - 480 - - - - &File - - - - - - - - - - - - 0 - 0 - 800 - 480 - - - - &Help - - - - - - - - - - - - - - &Save - - - Save - - - Ctrl+S - - - - - E&xit - - - Exit - - - - - - - - &About - - - About - - - - - - - - About &Qt - - - About Qt - - - - - - - Q3ListBox - -

q3listbox.h
- 0 - - - - ColorButton - -
colorbutton.h
- 0 - -
- - Q3Frame - -
Qt3Support/Q3Frame
- 1 - -
- - PreviewFrame - -
previewframe.h
- 0 - -
- - Q3MainWindow - -
q3mainwindow.h
- 1 - -
- - - helpview - TabWidget3 - familycombo - stylecombo - psizecombo - samplelineedit - familysubcombo - PushButton2 - PushButton3 - PushButton4 - choosesubcombo - PushButton1 - dcispin - cfispin - wslspin - effectcheckbox - menueffect - comboeffect - tooltipeffect - strutwidth - strutheight - sublistbox - - - - diff --git a/tests/auto/uic/baseline/mainwindowbase.ui.h b/tests/auto/uic/baseline/mainwindowbase.ui.h deleted file mode 100644 index abf8ff81d19..00000000000 --- a/tests/auto/uic/baseline/mainwindowbase.ui.h +++ /dev/null @@ -1,968 +0,0 @@ -/* -********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* -*/ - -/******************************************************************************** -** Form generated from reading UI file 'mainwindowbase.ui' -** -** Created: Fri Sep 4 10:17:14 2009 -** by: Qt User Interface Compiler version 4.6.0 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef MAINWINDOWBASE_H -#define MAINWINDOWBASE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "colorbutton.h" -#include "previewframe.h" - -QT_BEGIN_NAMESPACE - -class Ui_MainWindowBase -{ -public: - QAction *fileSaveAction; - QAction *fileExitAction; - QAction *helpAboutAction; - QAction *helpAboutQtAction; - QWidget *widget; - QHBoxLayout *hboxLayout; - QTextEdit *helpview; - QTabWidget *TabWidget3; - QWidget *tab1; - QVBoxLayout *vboxLayout; - QGroupBox *GroupBox40; - QHBoxLayout *hboxLayout1; - QLabel *gstylebuddy; - QComboBox *gstylecombo; - QGroupBox *groupAutoPalette; - QHBoxLayout *hboxLayout2; - QLabel *labelMainColor; - ColorButton *buttonMainColor; - QLabel *labelMainColor2; - ColorButton *buttonMainColor2; - QSpacerItem *spacerItem; - QPushButton *btnAdvanced; - QGroupBox *GroupBox126; - QGridLayout *gridLayout; - QLabel *TextLabel1; - QComboBox *paletteCombo; - PreviewFrame *previewFrame; - QWidget *tab2; - QVBoxLayout *vboxLayout1; - QGroupBox *GroupBox1; - QGridLayout *gridLayout1; - QComboBox *stylecombo; - QComboBox *familycombo; - QComboBox *psizecombo; - QLabel *stylebuddy; - QLabel *psizebuddy; - QLabel *familybuddy; - QLineEdit *samplelineedit; - QGroupBox *GroupBox2; - QVBoxLayout *vboxLayout2; - QHBoxLayout *hboxLayout3; - QLabel *famsubbuddy; - QComboBox *familysubcombo; - QFrame *Line1; - QLabel *TextLabel5; - Q3ListBox *sublistbox; - QHBoxLayout *hboxLayout4; - QPushButton *PushButton2; - QPushButton *PushButton3; - QPushButton *PushButton4; - QFrame *Line2; - QHBoxLayout *hboxLayout5; - QLabel *choosebuddy; - QComboBox *choosesubcombo; - QPushButton *PushButton1; - QWidget *tab; - QVBoxLayout *vboxLayout3; - QGroupBox *GroupBox4; - QGridLayout *gridLayout2; - QSpinBox *dcispin; - QLabel *dcibuddy; - QSpinBox *cfispin; - QLabel *cfibuddy; - QSpinBox *wslspin; - QLabel *wslbuddy; - QCheckBox *resolvelinks; - QGroupBox *GroupBox3; - QVBoxLayout *vboxLayout4; - QCheckBox *effectcheckbox; - Q3Frame *effectbase; - QGridLayout *gridLayout3; - QLabel *meffectbuddy; - QLabel *ceffectbuddy; - QLabel *teffectbuddy; - QLabel *beffectbuddy; - QComboBox *menueffect; - QComboBox *comboeffect; - QComboBox *tooltipeffect; - QComboBox *toolboxeffect; - QGroupBox *GroupBox5; - QGridLayout *gridLayout4; - QLabel *swbuddy; - QLabel *shbuddy; - QSpinBox *strutwidth; - QSpinBox *strutheight; - QCheckBox *rtlExtensions; - QLabel *inputStyleLabel; - QComboBox *inputStyle; - QSpacerItem *spacerItem1; - QWidget *tab3; - QVBoxLayout *vboxLayout5; - QCheckBox *fontembeddingcheckbox; - QGroupBox *GroupBox10; - QVBoxLayout *vboxLayout6; - QGridLayout *gridLayout5; - QPushButton *PushButton11; - QPushButton *PushButton13; - QPushButton *PushButton12; - Q3ListBox *fontpathlistbox; - QGridLayout *gridLayout6; - QSpacerItem *spacerItem2; - QPushButton *PushButton15; - QPushButton *PushButton14; - QLabel *TextLabel15_2; - QLineEdit *fontpathlineedit; - QMenuBar *menubar; - QAction *action; - QAction *action1; - QAction *action2; - QMenu *PopupMenu; - QAction *action3; - QAction *action4; - QAction *action5; - QMenu *PopupMenu_2; - - void setupUi(Q3MainWindow *MainWindowBase) - { - if (MainWindowBase->objectName().isEmpty()) - MainWindowBase->setObjectName(QString::fromUtf8("MainWindowBase")); - MainWindowBase->resize(724, 615); - fileSaveAction = new QAction(MainWindowBase); - fileSaveAction->setObjectName(QString::fromUtf8("fileSaveAction")); - fileExitAction = new QAction(MainWindowBase); - fileExitAction->setObjectName(QString::fromUtf8("fileExitAction")); - helpAboutAction = new QAction(MainWindowBase); - helpAboutAction->setObjectName(QString::fromUtf8("helpAboutAction")); - helpAboutQtAction = new QAction(MainWindowBase); - helpAboutQtAction->setObjectName(QString::fromUtf8("helpAboutQtAction")); - widget = new QWidget(MainWindowBase); - widget->setObjectName(QString::fromUtf8("widget")); - widget->setGeometry(QRect(0, 28, 724, 587)); - hboxLayout = new QHBoxLayout(widget); - hboxLayout->setSpacing(4); - hboxLayout->setContentsMargins(8, 8, 8, 8); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - helpview = new QTextEdit(widget); - helpview->setObjectName(QString::fromUtf8("helpview")); - helpview->setMinimumSize(QSize(200, 0)); - helpview->setReadOnly(true); - - hboxLayout->addWidget(helpview); - - TabWidget3 = new QTabWidget(widget); - TabWidget3->setObjectName(QString::fromUtf8("TabWidget3")); - tab1 = new QWidget(); - tab1->setObjectName(QString::fromUtf8("tab1")); - vboxLayout = new QVBoxLayout(tab1); - vboxLayout->setSpacing(4); - vboxLayout->setContentsMargins(4, 4, 4, 4); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - GroupBox40 = new QGroupBox(tab1); - GroupBox40->setObjectName(QString::fromUtf8("GroupBox40")); - hboxLayout1 = new QHBoxLayout(GroupBox40); - hboxLayout1->setSpacing(4); - hboxLayout1->setContentsMargins(8, 8, 8, 8); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); - gstylebuddy = new QLabel(GroupBox40); - gstylebuddy->setObjectName(QString::fromUtf8("gstylebuddy")); - - hboxLayout1->addWidget(gstylebuddy); - - gstylecombo = new QComboBox(GroupBox40); - gstylecombo->setObjectName(QString::fromUtf8("gstylecombo")); - - hboxLayout1->addWidget(gstylecombo); - - - vboxLayout->addWidget(GroupBox40); - - groupAutoPalette = new QGroupBox(tab1); - groupAutoPalette->setObjectName(QString::fromUtf8("groupAutoPalette")); - QSizePolicy sizePolicy(static_cast(5), static_cast(4)); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(groupAutoPalette->sizePolicy().hasHeightForWidth()); - groupAutoPalette->setSizePolicy(sizePolicy); - hboxLayout2 = new QHBoxLayout(groupAutoPalette); - hboxLayout2->setSpacing(4); - hboxLayout2->setContentsMargins(8, 8, 8, 8); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); - labelMainColor = new QLabel(groupAutoPalette); - labelMainColor->setObjectName(QString::fromUtf8("labelMainColor")); - - hboxLayout2->addWidget(labelMainColor); - - buttonMainColor = new ColorButton(groupAutoPalette); - buttonMainColor->setObjectName(QString::fromUtf8("buttonMainColor")); - - hboxLayout2->addWidget(buttonMainColor); - - labelMainColor2 = new QLabel(groupAutoPalette); - labelMainColor2->setObjectName(QString::fromUtf8("labelMainColor2")); - QSizePolicy sizePolicy1(static_cast(1), static_cast(1)); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(labelMainColor2->sizePolicy().hasHeightForWidth()); - labelMainColor2->setSizePolicy(sizePolicy1); - labelMainColor2->setMinimumSize(QSize(50, 0)); - labelMainColor2->setLineWidth(1); - labelMainColor2->setMidLineWidth(0); - labelMainColor2->setAlignment(Qt::AlignVCenter); - labelMainColor2->setMargin(0); - - hboxLayout2->addWidget(labelMainColor2); - - buttonMainColor2 = new ColorButton(groupAutoPalette); - buttonMainColor2->setObjectName(QString::fromUtf8("buttonMainColor2")); - - hboxLayout2->addWidget(buttonMainColor2); - - spacerItem = new QSpacerItem(70, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout2->addItem(spacerItem); - - btnAdvanced = new QPushButton(groupAutoPalette); - btnAdvanced->setObjectName(QString::fromUtf8("btnAdvanced")); - - hboxLayout2->addWidget(btnAdvanced); - - - vboxLayout->addWidget(groupAutoPalette); - - GroupBox126 = new QGroupBox(tab1); - GroupBox126->setObjectName(QString::fromUtf8("GroupBox126")); - QSizePolicy sizePolicy2(static_cast(5), static_cast(7)); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(GroupBox126->sizePolicy().hasHeightForWidth()); - GroupBox126->setSizePolicy(sizePolicy2); - gridLayout = new QGridLayout(GroupBox126); - gridLayout->setSpacing(4); - gridLayout->setContentsMargins(8, 8, 8, 8); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - TextLabel1 = new QLabel(GroupBox126); - TextLabel1->setObjectName(QString::fromUtf8("TextLabel1")); - - gridLayout->addWidget(TextLabel1, 0, 0, 1, 1); - - paletteCombo = new QComboBox(GroupBox126); - paletteCombo->setObjectName(QString::fromUtf8("paletteCombo")); - - gridLayout->addWidget(paletteCombo, 0, 1, 1, 1); - - previewFrame = new PreviewFrame(GroupBox126); - previewFrame->setObjectName(QString::fromUtf8("previewFrame")); - QSizePolicy sizePolicy3(static_cast(7), static_cast(7)); - sizePolicy3.setHorizontalStretch(0); - sizePolicy3.setVerticalStretch(0); - sizePolicy3.setHeightForWidth(previewFrame->sizePolicy().hasHeightForWidth()); - previewFrame->setSizePolicy(sizePolicy3); - previewFrame->setMinimumSize(QSize(410, 260)); - - gridLayout->addWidget(previewFrame, 1, 0, 1, 2); - - - vboxLayout->addWidget(GroupBox126); - - TabWidget3->addTab(tab1, QString()); - tab2 = new QWidget(); - tab2->setObjectName(QString::fromUtf8("tab2")); - vboxLayout1 = new QVBoxLayout(tab2); - vboxLayout1->setSpacing(4); - vboxLayout1->setContentsMargins(8, 8, 8, 8); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); - GroupBox1 = new QGroupBox(tab2); - GroupBox1->setObjectName(QString::fromUtf8("GroupBox1")); - gridLayout1 = new QGridLayout(GroupBox1); - gridLayout1->setSpacing(4); - gridLayout1->setContentsMargins(8, 8, 8, 8); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); - stylecombo = new QComboBox(GroupBox1); - stylecombo->setObjectName(QString::fromUtf8("stylecombo")); - stylecombo->setAutoCompletion(true); - stylecombo->setDuplicatesEnabled(false); - - gridLayout1->addWidget(stylecombo, 1, 1, 1, 1); - - familycombo = new QComboBox(GroupBox1); - familycombo->setObjectName(QString::fromUtf8("familycombo")); - familycombo->setAutoCompletion(true); - familycombo->setDuplicatesEnabled(false); - - gridLayout1->addWidget(familycombo, 0, 1, 1, 1); - - psizecombo = new QComboBox(GroupBox1); - psizecombo->setObjectName(QString::fromUtf8("psizecombo")); - psizecombo->setEditable(true); - psizecombo->setAutoCompletion(true); - psizecombo->setDuplicatesEnabled(false); - - gridLayout1->addWidget(psizecombo, 2, 1, 1, 1); - - stylebuddy = new QLabel(GroupBox1); - stylebuddy->setObjectName(QString::fromUtf8("stylebuddy")); - - gridLayout1->addWidget(stylebuddy, 1, 0, 1, 1); - - psizebuddy = new QLabel(GroupBox1); - psizebuddy->setObjectName(QString::fromUtf8("psizebuddy")); - - gridLayout1->addWidget(psizebuddy, 2, 0, 1, 1); - - familybuddy = new QLabel(GroupBox1); - familybuddy->setObjectName(QString::fromUtf8("familybuddy")); - - gridLayout1->addWidget(familybuddy, 0, 0, 1, 1); - - samplelineedit = new QLineEdit(GroupBox1); - samplelineedit->setObjectName(QString::fromUtf8("samplelineedit")); - samplelineedit->setAlignment(Qt::AlignHCenter); - - gridLayout1->addWidget(samplelineedit, 3, 0, 1, 2); - - - vboxLayout1->addWidget(GroupBox1); - - GroupBox2 = new QGroupBox(tab2); - GroupBox2->setObjectName(QString::fromUtf8("GroupBox2")); - vboxLayout2 = new QVBoxLayout(GroupBox2); - vboxLayout2->setSpacing(4); - vboxLayout2->setContentsMargins(8, 8, 8, 8); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); - hboxLayout3 = new QHBoxLayout(); - hboxLayout3->setSpacing(4); -#ifndef Q_OS_MAC - hboxLayout3->setContentsMargins(0, 0, 0, 0); -#endif - hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); - famsubbuddy = new QLabel(GroupBox2); - famsubbuddy->setObjectName(QString::fromUtf8("famsubbuddy")); - - hboxLayout3->addWidget(famsubbuddy); - - familysubcombo = new QComboBox(GroupBox2); - familysubcombo->setObjectName(QString::fromUtf8("familysubcombo")); - familysubcombo->setEditable(true); - familysubcombo->setAutoCompletion(true); - familysubcombo->setDuplicatesEnabled(false); - - hboxLayout3->addWidget(familysubcombo); - - - vboxLayout2->addLayout(hboxLayout3); - - Line1 = new QFrame(GroupBox2); - Line1->setObjectName(QString::fromUtf8("Line1")); - Line1->setFrameShape(QFrame::HLine); - Line1->setFrameShadow(QFrame::Sunken); - Line1->setFrameShape(QFrame::HLine); - - vboxLayout2->addWidget(Line1); - - TextLabel5 = new QLabel(GroupBox2); - TextLabel5->setObjectName(QString::fromUtf8("TextLabel5")); - - vboxLayout2->addWidget(TextLabel5); - - sublistbox = new Q3ListBox(GroupBox2); - sublistbox->setObjectName(QString::fromUtf8("sublistbox")); - - vboxLayout2->addWidget(sublistbox); - - hboxLayout4 = new QHBoxLayout(); - hboxLayout4->setSpacing(4); - hboxLayout4->setContentsMargins(0, 0, 0, 0); - hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4")); - PushButton2 = new QPushButton(GroupBox2); - PushButton2->setObjectName(QString::fromUtf8("PushButton2")); - - hboxLayout4->addWidget(PushButton2); - - PushButton3 = new QPushButton(GroupBox2); - PushButton3->setObjectName(QString::fromUtf8("PushButton3")); - - hboxLayout4->addWidget(PushButton3); - - PushButton4 = new QPushButton(GroupBox2); - PushButton4->setObjectName(QString::fromUtf8("PushButton4")); - - hboxLayout4->addWidget(PushButton4); - - - vboxLayout2->addLayout(hboxLayout4); - - Line2 = new QFrame(GroupBox2); - Line2->setObjectName(QString::fromUtf8("Line2")); - Line2->setFrameShape(QFrame::HLine); - Line2->setFrameShadow(QFrame::Sunken); - Line2->setFrameShape(QFrame::HLine); - - vboxLayout2->addWidget(Line2); - - hboxLayout5 = new QHBoxLayout(); - hboxLayout5->setSpacing(4); - hboxLayout5->setContentsMargins(0, 0, 0, 0); - hboxLayout5->setObjectName(QString::fromUtf8("hboxLayout5")); - choosebuddy = new QLabel(GroupBox2); - choosebuddy->setObjectName(QString::fromUtf8("choosebuddy")); - - hboxLayout5->addWidget(choosebuddy); - - choosesubcombo = new QComboBox(GroupBox2); - choosesubcombo->setObjectName(QString::fromUtf8("choosesubcombo")); - choosesubcombo->setAutoCompletion(true); - choosesubcombo->setDuplicatesEnabled(false); - - hboxLayout5->addWidget(choosesubcombo); - - PushButton1 = new QPushButton(GroupBox2); - PushButton1->setObjectName(QString::fromUtf8("PushButton1")); - - hboxLayout5->addWidget(PushButton1); - - - vboxLayout2->addLayout(hboxLayout5); - - - vboxLayout1->addWidget(GroupBox2); - - TabWidget3->addTab(tab2, QString()); - tab = new QWidget(); - tab->setObjectName(QString::fromUtf8("tab")); - vboxLayout3 = new QVBoxLayout(tab); - vboxLayout3->setSpacing(4); - vboxLayout3->setContentsMargins(7, 7, 7, 7); - vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3")); - GroupBox4 = new QGroupBox(tab); - GroupBox4->setObjectName(QString::fromUtf8("GroupBox4")); - gridLayout2 = new QGridLayout(GroupBox4); - gridLayout2->setSpacing(4); - gridLayout2->setContentsMargins(8, 8, 8, 8); - gridLayout2->setObjectName(QString::fromUtf8("gridLayout2")); - dcispin = new QSpinBox(GroupBox4); - dcispin->setObjectName(QString::fromUtf8("dcispin")); - dcispin->setMaximum(10000); - dcispin->setMinimum(10); - - gridLayout2->addWidget(dcispin, 0, 1, 1, 1); - - dcibuddy = new QLabel(GroupBox4); - dcibuddy->setObjectName(QString::fromUtf8("dcibuddy")); - - gridLayout2->addWidget(dcibuddy, 0, 0, 1, 1); - - cfispin = new QSpinBox(GroupBox4); - cfispin->setObjectName(QString::fromUtf8("cfispin")); - cfispin->setMaximum(10000); - cfispin->setMinimum(9); - - gridLayout2->addWidget(cfispin, 1, 1, 1, 1); - - cfibuddy = new QLabel(GroupBox4); - cfibuddy->setObjectName(QString::fromUtf8("cfibuddy")); - - gridLayout2->addWidget(cfibuddy, 1, 0, 1, 1); - - wslspin = new QSpinBox(GroupBox4); - wslspin->setObjectName(QString::fromUtf8("wslspin")); - wslspin->setMaximum(20); - wslspin->setMinimum(1); - - gridLayout2->addWidget(wslspin, 2, 1, 1, 1); - - wslbuddy = new QLabel(GroupBox4); - wslbuddy->setObjectName(QString::fromUtf8("wslbuddy")); - - gridLayout2->addWidget(wslbuddy, 2, 0, 1, 1); - - resolvelinks = new QCheckBox(GroupBox4); - resolvelinks->setObjectName(QString::fromUtf8("resolvelinks")); - - gridLayout2->addWidget(resolvelinks, 3, 0, 1, 2); - - - vboxLayout3->addWidget(GroupBox4); - - GroupBox3 = new QGroupBox(tab); - GroupBox3->setObjectName(QString::fromUtf8("GroupBox3")); - vboxLayout4 = new QVBoxLayout(GroupBox3); - vboxLayout4->setSpacing(4); - vboxLayout4->setContentsMargins(8, 8, 8, 8); - vboxLayout4->setObjectName(QString::fromUtf8("vboxLayout4")); - effectcheckbox = new QCheckBox(GroupBox3); - effectcheckbox->setObjectName(QString::fromUtf8("effectcheckbox")); - - vboxLayout4->addWidget(effectcheckbox); - - effectbase = new Q3Frame(GroupBox3); - effectbase->setObjectName(QString::fromUtf8("effectbase")); - effectbase->setFrameShape(QFrame::NoFrame); - effectbase->setFrameShadow(QFrame::Plain); - gridLayout3 = new QGridLayout(effectbase); - gridLayout3->setSpacing(4); - gridLayout3->setContentsMargins(0, 0, 0, 0); - gridLayout3->setObjectName(QString::fromUtf8("gridLayout3")); - meffectbuddy = new QLabel(effectbase); - meffectbuddy->setObjectName(QString::fromUtf8("meffectbuddy")); - - gridLayout3->addWidget(meffectbuddy, 0, 0, 1, 1); - - ceffectbuddy = new QLabel(effectbase); - ceffectbuddy->setObjectName(QString::fromUtf8("ceffectbuddy")); - - gridLayout3->addWidget(ceffectbuddy, 1, 0, 1, 1); - - teffectbuddy = new QLabel(effectbase); - teffectbuddy->setObjectName(QString::fromUtf8("teffectbuddy")); - - gridLayout3->addWidget(teffectbuddy, 2, 0, 1, 1); - - beffectbuddy = new QLabel(effectbase); - beffectbuddy->setObjectName(QString::fromUtf8("beffectbuddy")); - - gridLayout3->addWidget(beffectbuddy, 3, 0, 1, 1); - - menueffect = new QComboBox(effectbase); - menueffect->setObjectName(QString::fromUtf8("menueffect")); - menueffect->setAutoCompletion(true); - - gridLayout3->addWidget(menueffect, 0, 1, 1, 1); - - comboeffect = new QComboBox(effectbase); - comboeffect->setObjectName(QString::fromUtf8("comboeffect")); - - gridLayout3->addWidget(comboeffect, 1, 1, 1, 1); - - tooltipeffect = new QComboBox(effectbase); - tooltipeffect->setObjectName(QString::fromUtf8("tooltipeffect")); - - gridLayout3->addWidget(tooltipeffect, 2, 1, 1, 1); - - toolboxeffect = new QComboBox(effectbase); - toolboxeffect->setObjectName(QString::fromUtf8("toolboxeffect")); - - gridLayout3->addWidget(toolboxeffect, 3, 1, 1, 1); - - - vboxLayout4->addWidget(effectbase); - - - vboxLayout3->addWidget(GroupBox3); - - GroupBox5 = new QGroupBox(tab); - GroupBox5->setObjectName(QString::fromUtf8("GroupBox5")); - gridLayout4 = new QGridLayout(GroupBox5); - gridLayout4->setSpacing(4); - gridLayout4->setContentsMargins(8, 8, 8, 8); - gridLayout4->setObjectName(QString::fromUtf8("gridLayout4")); - swbuddy = new QLabel(GroupBox5); - swbuddy->setObjectName(QString::fromUtf8("swbuddy")); - - gridLayout4->addWidget(swbuddy, 0, 0, 1, 1); - - shbuddy = new QLabel(GroupBox5); - shbuddy->setObjectName(QString::fromUtf8("shbuddy")); - - gridLayout4->addWidget(shbuddy, 1, 0, 1, 1); - - strutwidth = new QSpinBox(GroupBox5); - strutwidth->setObjectName(QString::fromUtf8("strutwidth")); - strutwidth->setMaximum(1000); - - gridLayout4->addWidget(strutwidth, 0, 1, 1, 1); - - strutheight = new QSpinBox(GroupBox5); - strutheight->setObjectName(QString::fromUtf8("strutheight")); - strutheight->setMaximum(1000); - - gridLayout4->addWidget(strutheight, 1, 1, 1, 1); - - - vboxLayout3->addWidget(GroupBox5); - - rtlExtensions = new QCheckBox(tab); - rtlExtensions->setObjectName(QString::fromUtf8("rtlExtensions")); - - vboxLayout3->addWidget(rtlExtensions); - - inputStyleLabel = new QLabel(tab); - inputStyleLabel->setObjectName(QString::fromUtf8("inputStyleLabel")); - - vboxLayout3->addWidget(inputStyleLabel); - - inputStyle = new QComboBox(tab); - inputStyle->setObjectName(QString::fromUtf8("inputStyle")); - - vboxLayout3->addWidget(inputStyle); - - spacerItem1 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - vboxLayout3->addItem(spacerItem1); - - TabWidget3->addTab(tab, QString()); - tab3 = new QWidget(); - tab3->setObjectName(QString::fromUtf8("tab3")); - vboxLayout5 = new QVBoxLayout(tab3); - vboxLayout5->setSpacing(4); - vboxLayout5->setContentsMargins(8, 8, 8, 8); - vboxLayout5->setObjectName(QString::fromUtf8("vboxLayout5")); - fontembeddingcheckbox = new QCheckBox(tab3); - fontembeddingcheckbox->setObjectName(QString::fromUtf8("fontembeddingcheckbox")); - fontembeddingcheckbox->setChecked(true); - - vboxLayout5->addWidget(fontembeddingcheckbox); - - GroupBox10 = new QGroupBox(tab3); - GroupBox10->setObjectName(QString::fromUtf8("GroupBox10")); - sizePolicy2.setHeightForWidth(GroupBox10->sizePolicy().hasHeightForWidth()); - GroupBox10->setSizePolicy(sizePolicy2); - vboxLayout6 = new QVBoxLayout(GroupBox10); - vboxLayout6->setSpacing(4); - vboxLayout6->setContentsMargins(8, 8, 8, 8); - vboxLayout6->setObjectName(QString::fromUtf8("vboxLayout6")); - gridLayout5 = new QGridLayout(); - gridLayout5->setSpacing(4); -#ifndef Q_OS_MAC - gridLayout5->setContentsMargins(0, 0, 0, 0); -#endif - gridLayout5->setObjectName(QString::fromUtf8("gridLayout5")); - PushButton11 = new QPushButton(GroupBox10); - PushButton11->setObjectName(QString::fromUtf8("PushButton11")); - - gridLayout5->addWidget(PushButton11, 1, 0, 1, 1); - - PushButton13 = new QPushButton(GroupBox10); - PushButton13->setObjectName(QString::fromUtf8("PushButton13")); - - gridLayout5->addWidget(PushButton13, 1, 2, 1, 1); - - PushButton12 = new QPushButton(GroupBox10); - PushButton12->setObjectName(QString::fromUtf8("PushButton12")); - - gridLayout5->addWidget(PushButton12, 1, 1, 1, 1); - - fontpathlistbox = new Q3ListBox(GroupBox10); - fontpathlistbox->setObjectName(QString::fromUtf8("fontpathlistbox")); - - gridLayout5->addWidget(fontpathlistbox, 0, 0, 1, 3); - - - vboxLayout6->addLayout(gridLayout5); - - gridLayout6 = new QGridLayout(); - gridLayout6->setSpacing(4); - gridLayout6->setContentsMargins(0, 0, 0, 0); - gridLayout6->setObjectName(QString::fromUtf8("gridLayout6")); - spacerItem2 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout6->addItem(spacerItem2, 2, 0, 1, 1); - - PushButton15 = new QPushButton(GroupBox10); - PushButton15->setObjectName(QString::fromUtf8("PushButton15")); - - gridLayout6->addWidget(PushButton15, 2, 2, 1, 1); - - PushButton14 = new QPushButton(GroupBox10); - PushButton14->setObjectName(QString::fromUtf8("PushButton14")); - - gridLayout6->addWidget(PushButton14, 2, 1, 1, 1); - - TextLabel15_2 = new QLabel(GroupBox10); - TextLabel15_2->setObjectName(QString::fromUtf8("TextLabel15_2")); - - gridLayout6->addWidget(TextLabel15_2, 0, 0, 1, 3); - - fontpathlineedit = new QLineEdit(GroupBox10); - fontpathlineedit->setObjectName(QString::fromUtf8("fontpathlineedit")); - - gridLayout6->addWidget(fontpathlineedit, 1, 0, 1, 3); - - - vboxLayout6->addLayout(gridLayout6); - - - vboxLayout5->addWidget(GroupBox10); - - TabWidget3->addTab(tab3, QString()); - - hboxLayout->addWidget(TabWidget3); - - MainWindowBase->setCentralWidget(widget); - menubar = new QMenuBar(MainWindowBase); - menubar->setObjectName(QString::fromUtf8("menubar")); - menubar->setGeometry(QRect(0, 0, 724, 27)); - action = new QAction(menubar); - action->setObjectName(QString::fromUtf8("action")); - action1 = new QAction(menubar); - action1->setObjectName(QString::fromUtf8("action1")); - action2 = new QAction(menubar); - action2->setObjectName(QString::fromUtf8("action2")); - PopupMenu = new QMenu(menubar); - PopupMenu->setObjectName(QString::fromUtf8("PopupMenu")); - PopupMenu->setGeometry(QRect(0, 0, 800, 480)); - action3 = new QAction(PopupMenu); - action3->setObjectName(QString::fromUtf8("action3")); - action4 = new QAction(PopupMenu); - action4->setObjectName(QString::fromUtf8("action4")); - action5 = new QAction(PopupMenu); - action5->setObjectName(QString::fromUtf8("action5")); - PopupMenu_2 = new QMenu(menubar); - PopupMenu_2->setObjectName(QString::fromUtf8("PopupMenu_2")); - PopupMenu_2->setGeometry(QRect(0, 0, 800, 480)); -#ifndef QT_NO_SHORTCUT - gstylebuddy->setBuddy(gstylecombo); - labelMainColor->setBuddy(buttonMainColor); - labelMainColor2->setBuddy(buttonMainColor2); - TextLabel1->setBuddy(paletteCombo); - stylebuddy->setBuddy(stylecombo); - psizebuddy->setBuddy(psizecombo); - familybuddy->setBuddy(familycombo); - famsubbuddy->setBuddy(familysubcombo); - choosebuddy->setBuddy(choosesubcombo); - dcibuddy->setBuddy(dcispin); - cfibuddy->setBuddy(cfispin); - wslbuddy->setBuddy(wslspin); - meffectbuddy->setBuddy(menueffect); - ceffectbuddy->setBuddy(comboeffect); - teffectbuddy->setBuddy(tooltipeffect); - beffectbuddy->setBuddy(toolboxeffect); - swbuddy->setBuddy(strutwidth); - shbuddy->setBuddy(strutheight); -#endif // QT_NO_SHORTCUT - QWidget::setTabOrder(helpview, TabWidget3); - QWidget::setTabOrder(TabWidget3, familycombo); - QWidget::setTabOrder(familycombo, stylecombo); - QWidget::setTabOrder(stylecombo, psizecombo); - QWidget::setTabOrder(psizecombo, samplelineedit); - QWidget::setTabOrder(samplelineedit, familysubcombo); - QWidget::setTabOrder(familysubcombo, PushButton2); - QWidget::setTabOrder(PushButton2, PushButton3); - QWidget::setTabOrder(PushButton3, PushButton4); - QWidget::setTabOrder(PushButton4, choosesubcombo); - QWidget::setTabOrder(choosesubcombo, PushButton1); - QWidget::setTabOrder(PushButton1, dcispin); - QWidget::setTabOrder(dcispin, cfispin); - QWidget::setTabOrder(cfispin, wslspin); - QWidget::setTabOrder(wslspin, effectcheckbox); - QWidget::setTabOrder(effectcheckbox, menueffect); - QWidget::setTabOrder(menueffect, comboeffect); - QWidget::setTabOrder(comboeffect, tooltipeffect); - QWidget::setTabOrder(tooltipeffect, strutwidth); - QWidget::setTabOrder(strutwidth, strutheight); - QWidget::setTabOrder(strutheight, sublistbox); - - menubar->addAction(PopupMenu->menuAction()); - menubar->addSeparator(); - menubar->addAction(PopupMenu_2->menuAction()); - PopupMenu->addAction(fileSaveAction); - PopupMenu->addSeparator(); - PopupMenu->addAction(fileExitAction); - PopupMenu_2->addAction(helpAboutAction); - PopupMenu_2->addAction(helpAboutQtAction); - - retranslateUi(MainWindowBase); - - menueffect->setCurrentIndex(0); - inputStyle->setCurrentIndex(0); - - - QMetaObject::connectSlotsByName(MainWindowBase); - } // setupUi - - void retranslateUi(Q3MainWindow *MainWindowBase) - { - MainWindowBase->setWindowTitle(QApplication::translate("MainWindowBase", "Qt Configuration", 0, QApplication::UnicodeUTF8)); - fileSaveAction->setText(QApplication::translate("MainWindowBase", "&Save", 0, QApplication::UnicodeUTF8)); - fileSaveAction->setIconText(QApplication::translate("MainWindowBase", "Save", 0, QApplication::UnicodeUTF8)); - fileSaveAction->setShortcut(QApplication::translate("MainWindowBase", "Ctrl+S", 0, QApplication::UnicodeUTF8)); - fileExitAction->setText(QApplication::translate("MainWindowBase", "E&xit", 0, QApplication::UnicodeUTF8)); - fileExitAction->setIconText(QApplication::translate("MainWindowBase", "Exit", 0, QApplication::UnicodeUTF8)); - fileExitAction->setShortcut(QString()); - helpAboutAction->setText(QApplication::translate("MainWindowBase", "&About", 0, QApplication::UnicodeUTF8)); - helpAboutAction->setIconText(QApplication::translate("MainWindowBase", "About", 0, QApplication::UnicodeUTF8)); - helpAboutAction->setShortcut(QString()); - helpAboutQtAction->setText(QApplication::translate("MainWindowBase", "About &Qt", 0, QApplication::UnicodeUTF8)); - helpAboutQtAction->setIconText(QApplication::translate("MainWindowBase", "About Qt", 0, QApplication::UnicodeUTF8)); - GroupBox40->setTitle(QApplication::translate("MainWindowBase", "GUI Style", 0, QApplication::UnicodeUTF8)); - gstylebuddy->setText(QApplication::translate("MainWindowBase", "Select GUI &Style:", 0, QApplication::UnicodeUTF8)); - groupAutoPalette->setTitle(QApplication::translate("MainWindowBase", "Build Palette", 0, QApplication::UnicodeUTF8)); - labelMainColor->setText(QApplication::translate("MainWindowBase", "&3-D Effects:", 0, QApplication::UnicodeUTF8)); - labelMainColor2->setText(QApplication::translate("MainWindowBase", "Window Back&ground:", 0, QApplication::UnicodeUTF8)); - btnAdvanced->setText(QApplication::translate("MainWindowBase", "&Tune Palette...", 0, QApplication::UnicodeUTF8)); - GroupBox126->setTitle(QApplication::translate("MainWindowBase", "Preview", 0, QApplication::UnicodeUTF8)); - TextLabel1->setText(QApplication::translate("MainWindowBase", "Select &Palette:", 0, QApplication::UnicodeUTF8)); - paletteCombo->clear(); - paletteCombo->insertItems(0, QStringList() - << QApplication::translate("MainWindowBase", "Active Palette", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Inactive Palette", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Disabled Palette", 0, QApplication::UnicodeUTF8) - ); - TabWidget3->setTabText(TabWidget3->indexOf(tab1), QApplication::translate("MainWindowBase", "Appearance", 0, QApplication::UnicodeUTF8)); - GroupBox1->setTitle(QApplication::translate("MainWindowBase", "Default Font", 0, QApplication::UnicodeUTF8)); - stylebuddy->setText(QApplication::translate("MainWindowBase", "&Style:", 0, QApplication::UnicodeUTF8)); - psizebuddy->setText(QApplication::translate("MainWindowBase", "&Point Size:", 0, QApplication::UnicodeUTF8)); - familybuddy->setText(QApplication::translate("MainWindowBase", "F&amily:", 0, QApplication::UnicodeUTF8)); - samplelineedit->setText(QApplication::translate("MainWindowBase", "Sample Text", 0, QApplication::UnicodeUTF8)); - GroupBox2->setTitle(QApplication::translate("MainWindowBase", "Font Substitution", 0, QApplication::UnicodeUTF8)); - famsubbuddy->setText(QApplication::translate("MainWindowBase", "S&elect or Enter a Family:", 0, QApplication::UnicodeUTF8)); - TextLabel5->setText(QApplication::translate("MainWindowBase", "Current Substitutions:", 0, QApplication::UnicodeUTF8)); - PushButton2->setText(QApplication::translate("MainWindowBase", "Up", 0, QApplication::UnicodeUTF8)); - PushButton3->setText(QApplication::translate("MainWindowBase", "Down", 0, QApplication::UnicodeUTF8)); - PushButton4->setText(QApplication::translate("MainWindowBase", "Remove", 0, QApplication::UnicodeUTF8)); - choosebuddy->setText(QApplication::translate("MainWindowBase", "Select s&ubstitute Family:", 0, QApplication::UnicodeUTF8)); - PushButton1->setText(QApplication::translate("MainWindowBase", "Add", 0, QApplication::UnicodeUTF8)); - TabWidget3->setTabText(TabWidget3->indexOf(tab2), QApplication::translate("MainWindowBase", "Fonts", 0, QApplication::UnicodeUTF8)); - GroupBox4->setTitle(QApplication::translate("MainWindowBase", "Feel Settings", 0, QApplication::UnicodeUTF8)); - dcispin->setSuffix(QApplication::translate("MainWindowBase", " ms", 0, QApplication::UnicodeUTF8)); - dcibuddy->setText(QApplication::translate("MainWindowBase", "&Double Click Interval:", 0, QApplication::UnicodeUTF8)); - cfispin->setSpecialValueText(QApplication::translate("MainWindowBase", "No blinking", 0, QApplication::UnicodeUTF8)); - cfispin->setSuffix(QApplication::translate("MainWindowBase", " ms", 0, QApplication::UnicodeUTF8)); - cfibuddy->setText(QApplication::translate("MainWindowBase", "&Cursor Flash Time:", 0, QApplication::UnicodeUTF8)); - wslspin->setSuffix(QApplication::translate("MainWindowBase", " lines", 0, QApplication::UnicodeUTF8)); - wslbuddy->setText(QApplication::translate("MainWindowBase", "Wheel &Scroll Lines:", 0, QApplication::UnicodeUTF8)); - resolvelinks->setText(QApplication::translate("MainWindowBase", "Resolve symlinks in URLs", 0, QApplication::UnicodeUTF8)); - GroupBox3->setTitle(QApplication::translate("MainWindowBase", "GUI Effects", 0, QApplication::UnicodeUTF8)); - effectcheckbox->setText(QApplication::translate("MainWindowBase", "&Enable", 0, QApplication::UnicodeUTF8)); - effectcheckbox->setShortcut(QApplication::translate("MainWindowBase", "Alt+E", 0, QApplication::UnicodeUTF8)); - meffectbuddy->setText(QApplication::translate("MainWindowBase", "&Menu Effect:", 0, QApplication::UnicodeUTF8)); - ceffectbuddy->setText(QApplication::translate("MainWindowBase", "C&omboBox Effect:", 0, QApplication::UnicodeUTF8)); - teffectbuddy->setText(QApplication::translate("MainWindowBase", "&ToolTip Effect:", 0, QApplication::UnicodeUTF8)); - beffectbuddy->setText(QApplication::translate("MainWindowBase", "Tool&Box Effect:", 0, QApplication::UnicodeUTF8)); - menueffect->clear(); - menueffect->insertItems(0, QStringList() - << QApplication::translate("MainWindowBase", "Disable", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Animate", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Fade", 0, QApplication::UnicodeUTF8) - ); - comboeffect->clear(); - comboeffect->insertItems(0, QStringList() - << QApplication::translate("MainWindowBase", "Disable", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Animate", 0, QApplication::UnicodeUTF8) - ); - tooltipeffect->clear(); - tooltipeffect->insertItems(0, QStringList() - << QApplication::translate("MainWindowBase", "Disable", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Animate", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Fade", 0, QApplication::UnicodeUTF8) - ); - toolboxeffect->clear(); - toolboxeffect->insertItems(0, QStringList() - << QApplication::translate("MainWindowBase", "Disable", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Animate", 0, QApplication::UnicodeUTF8) - ); - GroupBox5->setTitle(QApplication::translate("MainWindowBase", "Global Strut", 0, QApplication::UnicodeUTF8)); - swbuddy->setText(QApplication::translate("MainWindowBase", "Minimum &Width:", 0, QApplication::UnicodeUTF8)); - shbuddy->setText(QApplication::translate("MainWindowBase", "Minimum Hei&ght:", 0, QApplication::UnicodeUTF8)); - strutwidth->setSuffix(QApplication::translate("MainWindowBase", " pixels", 0, QApplication::UnicodeUTF8)); - strutheight->setSuffix(QApplication::translate("MainWindowBase", " pixels", 0, QApplication::UnicodeUTF8)); - rtlExtensions->setText(QApplication::translate("MainWindowBase", "Enhanced support for languages written right-to-left", 0, QApplication::UnicodeUTF8)); - inputStyleLabel->setText(QApplication::translate("MainWindowBase", "XIM Input Style:", 0, QApplication::UnicodeUTF8)); - inputStyle->clear(); - inputStyle->insertItems(0, QStringList() - << QApplication::translate("MainWindowBase", "On The Spot", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Over The Spot", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Off The Spot", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Root", 0, QApplication::UnicodeUTF8) - ); - TabWidget3->setTabText(TabWidget3->indexOf(tab), QApplication::translate("MainWindowBase", "Interface", 0, QApplication::UnicodeUTF8)); - fontembeddingcheckbox->setText(QApplication::translate("MainWindowBase", "Enable Font embedding", 0, QApplication::UnicodeUTF8)); - GroupBox10->setTitle(QApplication::translate("MainWindowBase", "Font Paths", 0, QApplication::UnicodeUTF8)); - PushButton11->setText(QApplication::translate("MainWindowBase", "Up", 0, QApplication::UnicodeUTF8)); - PushButton13->setText(QApplication::translate("MainWindowBase", "Remove", 0, QApplication::UnicodeUTF8)); - PushButton12->setText(QApplication::translate("MainWindowBase", "Down", 0, QApplication::UnicodeUTF8)); - PushButton15->setText(QApplication::translate("MainWindowBase", "Add", 0, QApplication::UnicodeUTF8)); - PushButton14->setText(QApplication::translate("MainWindowBase", "Browse...", 0, QApplication::UnicodeUTF8)); - TextLabel15_2->setText(QApplication::translate("MainWindowBase", "Press the Browse button or enter a directory and press Enter to add them to the list.", 0, QApplication::UnicodeUTF8)); - TabWidget3->setTabText(TabWidget3->indexOf(tab3), QApplication::translate("MainWindowBase", "Printer", 0, QApplication::UnicodeUTF8)); - PopupMenu->setTitle(QApplication::translate("MainWindowBase", "&File", 0, QApplication::UnicodeUTF8)); - PopupMenu_2->setTitle(QApplication::translate("MainWindowBase", "&Help", 0, QApplication::UnicodeUTF8)); - } // retranslateUi - -}; - -namespace Ui { - class MainWindowBase: public Ui_MainWindowBase {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // MAINWINDOWBASE_H diff --git a/tests/auto/uic/baseline/mydialog.ui.h b/tests/auto/uic/baseline/mydialog.ui.h index 6114cc3807f..474684988ea 100644 --- a/tests/auto/uic/baseline/mydialog.ui.h +++ b/tests/auto/uic/baseline/mydialog.ui.h @@ -10,7 +10,6 @@ #ifndef MYDIALOG_H #define MYDIALOG_H -#include #include #include #include diff --git a/tests/auto/uic/baseline/paletteeditoradvancedbase.ui b/tests/auto/uic/baseline/paletteeditoradvancedbase.ui deleted file mode 100644 index a7055281d25..00000000000 --- a/tests/auto/uic/baseline/paletteeditoradvancedbase.ui +++ /dev/null @@ -1,617 +0,0 @@ - - - ********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* - - PaletteEditorAdvancedBase - - - PaletteEditorAdvancedBase - - - true - - - - 0 - 0 - 295 - 346 - - - - Tune Palette - - - true - - - <b>Edit Palette</b><p>Change the palette of the current widget or form.</p><p>Use a generated palette or select colors for each color group and each color role.</p><p>The palette can be tested with different widget layouts in the preview section.</p> - - - - unnamed - - - 11 - - - 6 - - - - - unnamed - - - 0 - - - 6 - - - - - TextLabel1 - - - Select &Palette: - - - paletteCombo - - - - - - - paletteCombo - - - - Active Palette - - - - - Inactive Palette - - - - - Disabled Palette - - - - - - - - - - ButtonGroup1 - - - - 5 - 4 - 0 - 0 - - - - Auto - - - - unnamed - - - 11 - - - 6 - - - - - checkBuildInactive - - - Build inactive palette from active - - - true - - - - - - - checkBuildDisabled - - - Build disabled palette from active - - - true - - - - - - - - - - groupCentral - - - Central color &roles - - - - unnamed - - - 11 - - - 6 - - - - - comboCentral - - - Choose central color role - - - <b>Select a color role.</b><p>Available central roles are: <ul> <li>Window - general background color.</li> <li>WindowText - general foreground color. </li> <li>Base - used as background color for e.g. text entry widgets, usually white or another light color. </li> <li>Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. </li> <li>Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. </li> <li>ButtonText - a foreground color used with the Button color. </li> <li>Highlight - a color to indicate a selected or highlighted item. </li> <li>HighlightedText - a text color that contrasts to Highlight. </li> <li>BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. </li> </ul> </p> - - - - Window - - - - - WindowText - - - - - Button - - - - - Base - - - - - Text - - - - - BrightText - - - - - ButtonText - - - - - Highlight - - - - - HighlightedText - - - - - - - - unnamed - - - 0 - - - 6 - - - - - - 20 - 20 - - - - Expanding - - - Horizontal - - - - - - - labelCentral - - - - 1 - 1 - 0 - 0 - - - - - 0 - 0 - - - - &Select Color: - - - buttonCentral - - - - - - - buttonCentral - - - - 0 - 0 - 0 - 0 - - - - Qt::TabFocus - - - Choose a color - - - Choose a color for the selected central color role. - - - - - - - - - - - - groupEffect - - - 3-D shadow &effects - - - - unnamed - - - 11 - - - 6 - - - - - unnamed - - - 0 - - - 6 - - - - - checkBuildEffect - - - Build &from button color - - - true - - - Generate shadings - - - Check to let 3D-effect colors be calculated from button-color. - - - - - - - comboEffect - - - Choose 3D-effect color role - - - <b>Select a color role.</b><p>Available effect roles are: <ul> <li>Light - lighter than Button color. </li> <li>Midlight - between Button and Light. </li> <li>Mid - between Button and Dark. </li> <li>Dark - darker than Button. </li> <li>Shadow - a very dark color. </li> </ul> - - - - Light - - - - - Midlight - - - - - Mid - - - - - Dark - - - - - Shadow - - - - - - - - - - unnamed - - - 0 - - - 6 - - - - - - 20 - 20 - - - - Expanding - - - Horizontal - - - - - - - labelEffect - - - - 1 - 1 - 0 - 0 - - - - - 0 - 0 - - - - Select Co&lor: - - - buttonEffect - - - - - - - buttonEffect - - - - 0 - 0 - 0 - 0 - - - - Qt::TabFocus - - - Choose a color - - - Choose a color for the selected effect color role. - - - - - - - - - - - - unnamed - - - 0 - - - 6 - - - - - - 20 - 20 - - - - Expanding - - - Horizontal - - - - - - - buttonOk - - - OK - - - true - - - true - - - Close dialog and apply all changes. - - - - - - - buttonCancel - - - Cancel - - - true - - - Close dialog and discard all changes. - - - - - - - - - - - ColorButton - -
colorbutton.h
- - 40 - 25 - - 0 - - 5 - 5 - - image0 - - color - pixmap - -
-
- - buttonOk - buttonCancel - paletteCombo - checkBuildInactive - checkBuildDisabled - comboCentral - buttonCentral - checkBuildEffect - comboEffect - buttonEffect - - - - 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 - - -
diff --git a/tests/auto/uic/baseline/paletteeditoradvancedbase.ui.h b/tests/auto/uic/baseline/paletteeditoradvancedbase.ui.h deleted file mode 100644 index e6841cca497..00000000000 --- a/tests/auto/uic/baseline/paletteeditoradvancedbase.ui.h +++ /dev/null @@ -1,485 +0,0 @@ -/* -********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* -*/ - -/******************************************************************************** -** Form generated from reading UI file 'paletteeditoradvancedbase.ui' -** -** Created: Fri Sep 4 10:17:14 2009 -** by: Qt User Interface Compiler version 4.6.0 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef PALETTEEDITORADVANCEDBASE_H -#define PALETTEEDITORADVANCEDBASE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "colorbutton.h" - -QT_BEGIN_NAMESPACE - -class Ui_PaletteEditorAdvancedBase -{ -public: - QVBoxLayout *vboxLayout; - QHBoxLayout *hboxLayout; - QLabel *TextLabel1; - QComboBox *paletteCombo; - Q3ButtonGroup *ButtonGroup1; - QVBoxLayout *vboxLayout1; - QCheckBox *checkBuildInactive; - QCheckBox *checkBuildDisabled; - Q3GroupBox *groupCentral; - QVBoxLayout *vboxLayout2; - QComboBox *comboCentral; - QHBoxLayout *hboxLayout1; - QSpacerItem *Horizontal_Spacing1; - QLabel *labelCentral; - ColorButton *buttonCentral; - Q3GroupBox *groupEffect; - QVBoxLayout *vboxLayout3; - QHBoxLayout *hboxLayout2; - QCheckBox *checkBuildEffect; - QComboBox *comboEffect; - QHBoxLayout *hboxLayout3; - QSpacerItem *Horizontal_Spacing3; - QLabel *labelEffect; - ColorButton *buttonEffect; - QHBoxLayout *hboxLayout4; - QSpacerItem *Horizontal_Spacing2; - QPushButton *buttonOk; - QPushButton *buttonCancel; - - void setupUi(QDialog *PaletteEditorAdvancedBase) - { - if (PaletteEditorAdvancedBase->objectName().isEmpty()) - PaletteEditorAdvancedBase->setObjectName(QString::fromUtf8("PaletteEditorAdvancedBase")); - PaletteEditorAdvancedBase->setEnabled(true); - PaletteEditorAdvancedBase->resize(295, 346); - PaletteEditorAdvancedBase->setSizeGripEnabled(true); - vboxLayout = new QVBoxLayout(PaletteEditorAdvancedBase); -#ifndef Q_OS_MAC - vboxLayout->setSpacing(6); -#endif - vboxLayout->setContentsMargins(11, 11, 11, 11); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - vboxLayout->setObjectName(QString::fromUtf8("unnamed")); - hboxLayout = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout->setSpacing(6); -#endif -#ifndef Q_OS_MAC - hboxLayout->setContentsMargins(0, 0, 0, 0); -#endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - hboxLayout->setObjectName(QString::fromUtf8("unnamed")); - TextLabel1 = new QLabel(PaletteEditorAdvancedBase); - TextLabel1->setObjectName(QString::fromUtf8("TextLabel1")); - - hboxLayout->addWidget(TextLabel1); - - paletteCombo = new QComboBox(PaletteEditorAdvancedBase); - paletteCombo->setObjectName(QString::fromUtf8("paletteCombo")); - - hboxLayout->addWidget(paletteCombo); - - - vboxLayout->addLayout(hboxLayout); - - ButtonGroup1 = new Q3ButtonGroup(PaletteEditorAdvancedBase); - ButtonGroup1->setObjectName(QString::fromUtf8("ButtonGroup1")); - QSizePolicy sizePolicy(static_cast(5), static_cast(4)); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(ButtonGroup1->sizePolicy().hasHeightForWidth()); - ButtonGroup1->setSizePolicy(sizePolicy); - ButtonGroup1->setColumnLayout(0, Qt::Vertical); -#ifndef Q_OS_MAC - ButtonGroup1->layout()->setSpacing(6); -#endif - ButtonGroup1->layout()->setContentsMargins(11, 11, 11, 11); - vboxLayout1 = new QVBoxLayout(); - QBoxLayout *boxlayout = qobject_cast(ButtonGroup1->layout()); - if (boxlayout) - boxlayout->addLayout(vboxLayout1); - vboxLayout1->setAlignment(Qt::AlignTop); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); - vboxLayout1->setObjectName(QString::fromUtf8("unnamed")); - checkBuildInactive = new QCheckBox(ButtonGroup1); - checkBuildInactive->setObjectName(QString::fromUtf8("checkBuildInactive")); - checkBuildInactive->setChecked(true); - - vboxLayout1->addWidget(checkBuildInactive); - - checkBuildDisabled = new QCheckBox(ButtonGroup1); - checkBuildDisabled->setObjectName(QString::fromUtf8("checkBuildDisabled")); - checkBuildDisabled->setChecked(true); - - vboxLayout1->addWidget(checkBuildDisabled); - - - vboxLayout->addWidget(ButtonGroup1); - - groupCentral = new Q3GroupBox(PaletteEditorAdvancedBase); - groupCentral->setObjectName(QString::fromUtf8("groupCentral")); - groupCentral->setColumnLayout(0, Qt::Vertical); -#ifndef Q_OS_MAC - groupCentral->layout()->setSpacing(6); -#endif - groupCentral->layout()->setContentsMargins(11, 11, 11, 11); - vboxLayout2 = new QVBoxLayout(); - QBoxLayout *boxlayout1 = qobject_cast(groupCentral->layout()); - if (boxlayout1) - boxlayout1->addLayout(vboxLayout2); - vboxLayout2->setAlignment(Qt::AlignTop); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); - vboxLayout2->setObjectName(QString::fromUtf8("unnamed")); - comboCentral = new QComboBox(groupCentral); - comboCentral->setObjectName(QString::fromUtf8("comboCentral")); - - vboxLayout2->addWidget(comboCentral); - - hboxLayout1 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout1->setSpacing(6); -#endif - hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); - hboxLayout1->setObjectName(QString::fromUtf8("unnamed")); - Horizontal_Spacing1 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout1->addItem(Horizontal_Spacing1); - - labelCentral = new QLabel(groupCentral); - labelCentral->setObjectName(QString::fromUtf8("labelCentral")); - QSizePolicy sizePolicy1(static_cast(1), static_cast(1)); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(labelCentral->sizePolicy().hasHeightForWidth()); - labelCentral->setSizePolicy(sizePolicy1); - labelCentral->setMinimumSize(QSize(0, 0)); - - hboxLayout1->addWidget(labelCentral); - - buttonCentral = new ColorButton(groupCentral); - buttonCentral->setObjectName(QString::fromUtf8("buttonCentral")); - QSizePolicy sizePolicy2(static_cast(0), static_cast(0)); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(buttonCentral->sizePolicy().hasHeightForWidth()); - buttonCentral->setSizePolicy(sizePolicy2); - buttonCentral->setFocusPolicy(Qt::TabFocus); - - hboxLayout1->addWidget(buttonCentral); - - - vboxLayout2->addLayout(hboxLayout1); - - - vboxLayout->addWidget(groupCentral); - - groupEffect = new Q3GroupBox(PaletteEditorAdvancedBase); - groupEffect->setObjectName(QString::fromUtf8("groupEffect")); - groupEffect->setColumnLayout(0, Qt::Vertical); -#ifndef Q_OS_MAC - groupEffect->layout()->setSpacing(6); -#endif - groupEffect->layout()->setContentsMargins(11, 11, 11, 11); - vboxLayout3 = new QVBoxLayout(); - QBoxLayout *boxlayout2 = qobject_cast(groupEffect->layout()); - if (boxlayout2) - boxlayout2->addLayout(vboxLayout3); - vboxLayout3->setAlignment(Qt::AlignTop); - vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3")); - vboxLayout3->setObjectName(QString::fromUtf8("unnamed")); - hboxLayout2 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout2->setSpacing(6); -#endif -#ifndef Q_OS_MAC - hboxLayout2->setContentsMargins(0, 0, 0, 0); -#endif - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); - hboxLayout2->setObjectName(QString::fromUtf8("unnamed")); - checkBuildEffect = new QCheckBox(groupEffect); - checkBuildEffect->setObjectName(QString::fromUtf8("checkBuildEffect")); - checkBuildEffect->setChecked(true); - - hboxLayout2->addWidget(checkBuildEffect); - - comboEffect = new QComboBox(groupEffect); - comboEffect->setObjectName(QString::fromUtf8("comboEffect")); - - hboxLayout2->addWidget(comboEffect); - - - vboxLayout3->addLayout(hboxLayout2); - - hboxLayout3 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout3->setSpacing(6); -#endif - hboxLayout3->setContentsMargins(0, 0, 0, 0); - hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); - hboxLayout3->setObjectName(QString::fromUtf8("unnamed")); - Horizontal_Spacing3 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout3->addItem(Horizontal_Spacing3); - - labelEffect = new QLabel(groupEffect); - labelEffect->setObjectName(QString::fromUtf8("labelEffect")); - sizePolicy1.setHeightForWidth(labelEffect->sizePolicy().hasHeightForWidth()); - labelEffect->setSizePolicy(sizePolicy1); - labelEffect->setMinimumSize(QSize(0, 0)); - - hboxLayout3->addWidget(labelEffect); - - buttonEffect = new ColorButton(groupEffect); - buttonEffect->setObjectName(QString::fromUtf8("buttonEffect")); - sizePolicy2.setHeightForWidth(buttonEffect->sizePolicy().hasHeightForWidth()); - buttonEffect->setSizePolicy(sizePolicy2); - buttonEffect->setFocusPolicy(Qt::TabFocus); - - hboxLayout3->addWidget(buttonEffect); - - - vboxLayout3->addLayout(hboxLayout3); - - - vboxLayout->addWidget(groupEffect); - - hboxLayout4 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout4->setSpacing(6); -#endif - hboxLayout4->setContentsMargins(0, 0, 0, 0); - hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4")); - hboxLayout4->setObjectName(QString::fromUtf8("unnamed")); - Horizontal_Spacing2 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout4->addItem(Horizontal_Spacing2); - - buttonOk = new QPushButton(PaletteEditorAdvancedBase); - buttonOk->setObjectName(QString::fromUtf8("buttonOk")); - buttonOk->setAutoDefault(true); - buttonOk->setDefault(true); - - hboxLayout4->addWidget(buttonOk); - - buttonCancel = new QPushButton(PaletteEditorAdvancedBase); - buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); - buttonCancel->setAutoDefault(true); - - hboxLayout4->addWidget(buttonCancel); - - - vboxLayout->addLayout(hboxLayout4); - -#ifndef QT_NO_SHORTCUT - TextLabel1->setBuddy(paletteCombo); - labelCentral->setBuddy(buttonCentral); - labelEffect->setBuddy(buttonEffect); -#endif // QT_NO_SHORTCUT - QWidget::setTabOrder(buttonOk, buttonCancel); - QWidget::setTabOrder(buttonCancel, paletteCombo); - QWidget::setTabOrder(paletteCombo, checkBuildInactive); - QWidget::setTabOrder(checkBuildInactive, checkBuildDisabled); - QWidget::setTabOrder(checkBuildDisabled, comboCentral); - QWidget::setTabOrder(comboCentral, buttonCentral); - QWidget::setTabOrder(buttonCentral, checkBuildEffect); - QWidget::setTabOrder(checkBuildEffect, comboEffect); - QWidget::setTabOrder(comboEffect, buttonEffect); - - retranslateUi(PaletteEditorAdvancedBase); - - QMetaObject::connectSlotsByName(PaletteEditorAdvancedBase); - } // setupUi - - void retranslateUi(QDialog *PaletteEditorAdvancedBase) - { - PaletteEditorAdvancedBase->setWindowTitle(QApplication::translate("PaletteEditorAdvancedBase", "Tune Palette", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_WHATSTHIS - PaletteEditorAdvancedBase->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Edit Palette

Change the palette of the current widget or form.

Use a generated palette or select colors for each color group and each color role.

The palette can be tested with different widget layouts in the preview section.

", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - TextLabel1->setText(QApplication::translate("PaletteEditorAdvancedBase", "Select &Palette:", 0, QApplication::UnicodeUTF8)); - paletteCombo->clear(); - paletteCombo->insertItems(0, QStringList() - << QApplication::translate("PaletteEditorAdvancedBase", "Active Palette", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Inactive Palette", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Disabled Palette", 0, QApplication::UnicodeUTF8) - ); - ButtonGroup1->setTitle(QApplication::translate("PaletteEditorAdvancedBase", "Auto", 0, QApplication::UnicodeUTF8)); - checkBuildInactive->setText(QApplication::translate("PaletteEditorAdvancedBase", "Build inactive palette from active", 0, QApplication::UnicodeUTF8)); - checkBuildDisabled->setText(QApplication::translate("PaletteEditorAdvancedBase", "Build disabled palette from active", 0, QApplication::UnicodeUTF8)); - groupCentral->setTitle(QApplication::translate("PaletteEditorAdvancedBase", "Central color &roles", 0, QApplication::UnicodeUTF8)); - comboCentral->clear(); - comboCentral->insertItems(0, QStringList() - << QApplication::translate("PaletteEditorAdvancedBase", "Window", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "WindowText", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Button", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Base", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Text", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "BrightText", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "ButtonText", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Highlight", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "HighlightedText", 0, QApplication::UnicodeUTF8) - ); -#ifndef QT_NO_TOOLTIP - comboCentral->setProperty("toolTip", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Choose central color role", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - comboCentral->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Select a color role.

Available central roles are:

  • Window - general background color.
  • WindowText - general foreground color.
  • Base - used as background color for e.g. text entry widgets, usually white or another light color.
  • Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base.
  • Button - general button background color, where buttons need a background different from Window, as in the Macintosh style.
  • ButtonText - a foreground color used with the Button color.
  • Highlight - a color to indicate a selected or highlighted item.
  • HighlightedText - a text color that contrasts to Highlight.
  • BrightText - a text color that is very different from WindowText and contrasts well with e.g. black.

", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - labelCentral->setText(QApplication::translate("PaletteEditorAdvancedBase", "&Select Color:", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_TOOLTIP - buttonCentral->setProperty("toolTip", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Choose a color", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - buttonCentral->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Choose a color for the selected central color role.", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - groupEffect->setTitle(QApplication::translate("PaletteEditorAdvancedBase", "3-D shadow &effects", 0, QApplication::UnicodeUTF8)); - checkBuildEffect->setText(QApplication::translate("PaletteEditorAdvancedBase", "Build &from button color", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_TOOLTIP - checkBuildEffect->setProperty("toolTip", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Generate shadings", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - checkBuildEffect->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Check to let 3D-effect colors be calculated from button-color.", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - comboEffect->clear(); - comboEffect->insertItems(0, QStringList() - << QApplication::translate("PaletteEditorAdvancedBase", "Light", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Midlight", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Mid", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Dark", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Shadow", 0, QApplication::UnicodeUTF8) - ); -#ifndef QT_NO_TOOLTIP - comboEffect->setProperty("toolTip", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Choose 3D-effect color role", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - comboEffect->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Select a color role.

Available effect roles are:

  • Light - lighter than Button color.
  • Midlight - between Button and Light.
  • Mid - between Button and Dark.
  • Dark - darker than Button.
  • Shadow - a very dark color.
", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - labelEffect->setText(QApplication::translate("PaletteEditorAdvancedBase", "Select Co&lor:", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_TOOLTIP - buttonEffect->setProperty("toolTip", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Choose a color", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - buttonEffect->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Choose a color for the selected effect color role.", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - buttonOk->setText(QApplication::translate("PaletteEditorAdvancedBase", "OK", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_WHATSTHIS - buttonOk->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Close dialog and apply all changes.", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - buttonCancel->setText(QApplication::translate("PaletteEditorAdvancedBase", "Cancel", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_WHATSTHIS - buttonCancel->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Close dialog and discard all changes.", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - } // retranslateUi - - -protected: - enum IconID - { - image0_ID, - unknown_ID - }; - static QPixmap qt_get_icon(IconID id) - { - /* XPM */ - static const char* const image0_data[] = { -"22 22 2 1", -". c None", -"# c #a4c610", -"........######........", -".....###########......", -"....##############....", -"...################...", -"..######......######..", -"..#####........#####..", -".#####.......#..#####.", -".####.......###..####.", -"####.......#####..####", -"####......#####...####", -"####....#######...####", -"####....######....####", -"####...########...####", -".####.##########..####", -".####..####.#########.", -".#####..##...########.", -"..#####.......#######.", -"..######......######..", -"...###################", -"....##################", -"......###########.###.", -"........######.....#.."}; - - - switch (id) { - case image0_ID: return QPixmap((const char**)image0_data); - default: return QPixmap(); - } // switch - } // icon - -}; - -namespace Ui { - class PaletteEditorAdvancedBase: public Ui_PaletteEditorAdvancedBase {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // PALETTEEDITORADVANCEDBASE_H diff --git a/tests/auto/uic/baseline/previewwidgetbase.ui b/tests/auto/uic/baseline/previewwidgetbase.ui deleted file mode 100644 index 5f36d49dbe5..00000000000 --- a/tests/auto/uic/baseline/previewwidgetbase.ui +++ /dev/null @@ -1,340 +0,0 @@ - - - ********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* - - PreviewWidgetBase - - - PreviewWidgetBase - - - - 0 - 0 - 378 - 236 - - - - - 1 - 1 - 0 - 0 - - - - Preview Window - - - - unnamed - - - 11 - - - 6 - - - - - unnamed - - - 0 - - - 6 - - - - - unnamed - - - 0 - - - 6 - - - - - ButtonGroup1 - - - ButtonGroup - - - - unnamed - - - 11 - - - 6 - - - - - RadioButton1 - - - RadioButton1 - - - true - - - - - - - RadioButton2 - - - RadioButton2 - - - - - - - RadioButton3 - - - RadioButton3 - - - - - - - - - - ButtonGroup2 - - - ButtonGroup2 - - - - unnamed - - - 11 - - - 6 - - - - - CheckBox1 - - - CheckBox1 - - - true - - - - - - - CheckBox2 - - - CheckBox2 - - - - - - - - - - ProgressBar1 - - - 50 - - - - - - - - - unnamed - - - 0 - - - 6 - - - - - LineEdit1 - - - LineEdit - - - - - - - ComboBox1 - - - - ComboBox - - - - - - - - unnamed - - - 0 - - - 6 - - - - - SpinBox1 - - - - - - - PushButton1 - - - PushButton - - - - - - - - - ScrollBar1 - - - Qt::Horizontal - - - - - - - Slider1 - - - Qt::Horizontal - - - - - - - textView - - - - 32767 - 50 - - - - true - - - <p> -<a href="http://qt.nokia.com">http://qt.nokia.com</a> -</p> -<p> -<a href="http://www.kde.org">http://www.kde.org</a> -</p> - - - - - - - - - - - - 20 - 20 - - - - Expanding - - - Vertical - - - - - - qPixmapFromMimeSource - diff --git a/tests/auto/uic/baseline/previewwidgetbase.ui.h b/tests/auto/uic/baseline/previewwidgetbase.ui.h deleted file mode 100644 index ab118e02a0f..00000000000 --- a/tests/auto/uic/baseline/previewwidgetbase.ui.h +++ /dev/null @@ -1,316 +0,0 @@ -/* -********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* -*/ - -/******************************************************************************** -** Form generated from reading UI file 'previewwidgetbase.ui' -** -** Created: Fri Sep 4 10:17:14 2009 -** by: Qt User Interface Compiler version 4.6.0 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef PREVIEWWIDGETBASE_H -#define PREVIEWWIDGETBASE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_PreviewWidgetBase -{ -public: - QVBoxLayout *vboxLayout; - QHBoxLayout *hboxLayout; - QVBoxLayout *vboxLayout1; - Q3ButtonGroup *ButtonGroup1; - QVBoxLayout *vboxLayout2; - QRadioButton *RadioButton1; - QRadioButton *RadioButton2; - QRadioButton *RadioButton3; - Q3ButtonGroup *ButtonGroup2; - QVBoxLayout *vboxLayout3; - QCheckBox *CheckBox1; - QCheckBox *CheckBox2; - QProgressBar *ProgressBar1; - QVBoxLayout *vboxLayout4; - QLineEdit *LineEdit1; - QComboBox *ComboBox1; - QHBoxLayout *hboxLayout1; - QSpinBox *SpinBox1; - QPushButton *PushButton1; - QScrollBar *ScrollBar1; - QSlider *Slider1; - QTextEdit *textView; - QSpacerItem *Spacer2; - - void setupUi(QWidget *PreviewWidgetBase) - { - if (PreviewWidgetBase->objectName().isEmpty()) - PreviewWidgetBase->setObjectName(QString::fromUtf8("PreviewWidgetBase")); - PreviewWidgetBase->resize(378, 236); - QSizePolicy sizePolicy(static_cast(1), static_cast(1)); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(PreviewWidgetBase->sizePolicy().hasHeightForWidth()); - PreviewWidgetBase->setSizePolicy(sizePolicy); - vboxLayout = new QVBoxLayout(PreviewWidgetBase); -#ifndef Q_OS_MAC - vboxLayout->setSpacing(6); -#endif - vboxLayout->setContentsMargins(11, 11, 11, 11); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - vboxLayout->setObjectName(QString::fromUtf8("unnamed")); - hboxLayout = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout->setSpacing(6); -#endif -#ifndef Q_OS_MAC - hboxLayout->setContentsMargins(0, 0, 0, 0); -#endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - hboxLayout->setObjectName(QString::fromUtf8("unnamed")); - vboxLayout1 = new QVBoxLayout(); -#ifndef Q_OS_MAC - vboxLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - vboxLayout1->setContentsMargins(0, 0, 0, 0); -#endif - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); - vboxLayout1->setObjectName(QString::fromUtf8("unnamed")); - ButtonGroup1 = new Q3ButtonGroup(PreviewWidgetBase); - ButtonGroup1->setObjectName(QString::fromUtf8("ButtonGroup1")); - ButtonGroup1->setColumnLayout(0, Qt::Vertical); -#ifndef Q_OS_MAC - ButtonGroup1->layout()->setSpacing(6); -#endif - ButtonGroup1->layout()->setContentsMargins(11, 11, 11, 11); - vboxLayout2 = new QVBoxLayout(); - QBoxLayout *boxlayout = qobject_cast(ButtonGroup1->layout()); - if (boxlayout) - boxlayout->addLayout(vboxLayout2); - vboxLayout2->setAlignment(Qt::AlignTop); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); - vboxLayout2->setObjectName(QString::fromUtf8("unnamed")); - RadioButton1 = new QRadioButton(ButtonGroup1); - RadioButton1->setObjectName(QString::fromUtf8("RadioButton1")); - RadioButton1->setChecked(true); - - vboxLayout2->addWidget(RadioButton1); - - RadioButton2 = new QRadioButton(ButtonGroup1); - RadioButton2->setObjectName(QString::fromUtf8("RadioButton2")); - - vboxLayout2->addWidget(RadioButton2); - - RadioButton3 = new QRadioButton(ButtonGroup1); - RadioButton3->setObjectName(QString::fromUtf8("RadioButton3")); - - vboxLayout2->addWidget(RadioButton3); - - - vboxLayout1->addWidget(ButtonGroup1); - - ButtonGroup2 = new Q3ButtonGroup(PreviewWidgetBase); - ButtonGroup2->setObjectName(QString::fromUtf8("ButtonGroup2")); - ButtonGroup2->setColumnLayout(0, Qt::Vertical); -#ifndef Q_OS_MAC - ButtonGroup2->layout()->setSpacing(6); -#endif - ButtonGroup2->layout()->setContentsMargins(11, 11, 11, 11); - vboxLayout3 = new QVBoxLayout(); - QBoxLayout *boxlayout1 = qobject_cast(ButtonGroup2->layout()); - if (boxlayout1) - boxlayout1->addLayout(vboxLayout3); - vboxLayout3->setAlignment(Qt::AlignTop); - vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3")); - vboxLayout3->setObjectName(QString::fromUtf8("unnamed")); - CheckBox1 = new QCheckBox(ButtonGroup2); - CheckBox1->setObjectName(QString::fromUtf8("CheckBox1")); - CheckBox1->setChecked(true); - - vboxLayout3->addWidget(CheckBox1); - - CheckBox2 = new QCheckBox(ButtonGroup2); - CheckBox2->setObjectName(QString::fromUtf8("CheckBox2")); - - vboxLayout3->addWidget(CheckBox2); - - - vboxLayout1->addWidget(ButtonGroup2); - - ProgressBar1 = new QProgressBar(PreviewWidgetBase); - ProgressBar1->setObjectName(QString::fromUtf8("ProgressBar1")); - ProgressBar1->setValue(50); - - vboxLayout1->addWidget(ProgressBar1); - - - hboxLayout->addLayout(vboxLayout1); - - vboxLayout4 = new QVBoxLayout(); -#ifndef Q_OS_MAC - vboxLayout4->setSpacing(6); -#endif - vboxLayout4->setContentsMargins(0, 0, 0, 0); - vboxLayout4->setObjectName(QString::fromUtf8("vboxLayout4")); - vboxLayout4->setObjectName(QString::fromUtf8("unnamed")); - LineEdit1 = new QLineEdit(PreviewWidgetBase); - LineEdit1->setObjectName(QString::fromUtf8("LineEdit1")); - - vboxLayout4->addWidget(LineEdit1); - - ComboBox1 = new QComboBox(PreviewWidgetBase); - ComboBox1->setObjectName(QString::fromUtf8("ComboBox1")); - - vboxLayout4->addWidget(ComboBox1); - - hboxLayout1 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout1->setSpacing(6); -#endif - hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); - hboxLayout1->setObjectName(QString::fromUtf8("unnamed")); - SpinBox1 = new QSpinBox(PreviewWidgetBase); - SpinBox1->setObjectName(QString::fromUtf8("SpinBox1")); - - hboxLayout1->addWidget(SpinBox1); - - PushButton1 = new QPushButton(PreviewWidgetBase); - PushButton1->setObjectName(QString::fromUtf8("PushButton1")); - - hboxLayout1->addWidget(PushButton1); - - - vboxLayout4->addLayout(hboxLayout1); - - ScrollBar1 = new QScrollBar(PreviewWidgetBase); - ScrollBar1->setObjectName(QString::fromUtf8("ScrollBar1")); - ScrollBar1->setOrientation(Qt::Horizontal); - - vboxLayout4->addWidget(ScrollBar1); - - Slider1 = new QSlider(PreviewWidgetBase); - Slider1->setObjectName(QString::fromUtf8("Slider1")); - Slider1->setOrientation(Qt::Horizontal); - - vboxLayout4->addWidget(Slider1); - - textView = new QTextEdit(PreviewWidgetBase); - textView->setObjectName(QString::fromUtf8("textView")); - textView->setMaximumSize(QSize(32767, 50)); - textView->setReadOnly(true); - - vboxLayout4->addWidget(textView); - - - hboxLayout->addLayout(vboxLayout4); - - - vboxLayout->addLayout(hboxLayout); - - Spacer2 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); - - vboxLayout->addItem(Spacer2); - - - retranslateUi(PreviewWidgetBase); - - QMetaObject::connectSlotsByName(PreviewWidgetBase); - } // setupUi - - void retranslateUi(QWidget *PreviewWidgetBase) - { - PreviewWidgetBase->setWindowTitle(QApplication::translate("PreviewWidgetBase", "Preview Window", 0, QApplication::UnicodeUTF8)); - ButtonGroup1->setTitle(QApplication::translate("PreviewWidgetBase", "ButtonGroup", 0, QApplication::UnicodeUTF8)); - RadioButton1->setText(QApplication::translate("PreviewWidgetBase", "RadioButton1", 0, QApplication::UnicodeUTF8)); - RadioButton2->setText(QApplication::translate("PreviewWidgetBase", "RadioButton2", 0, QApplication::UnicodeUTF8)); - RadioButton3->setText(QApplication::translate("PreviewWidgetBase", "RadioButton3", 0, QApplication::UnicodeUTF8)); - ButtonGroup2->setTitle(QApplication::translate("PreviewWidgetBase", "ButtonGroup2", 0, QApplication::UnicodeUTF8)); - CheckBox1->setText(QApplication::translate("PreviewWidgetBase", "CheckBox1", 0, QApplication::UnicodeUTF8)); - CheckBox2->setText(QApplication::translate("PreviewWidgetBase", "CheckBox2", 0, QApplication::UnicodeUTF8)); - LineEdit1->setText(QApplication::translate("PreviewWidgetBase", "LineEdit", 0, QApplication::UnicodeUTF8)); - ComboBox1->clear(); - ComboBox1->insertItems(0, QStringList() - << QApplication::translate("PreviewWidgetBase", "ComboBox", 0, QApplication::UnicodeUTF8) - ); - PushButton1->setText(QApplication::translate("PreviewWidgetBase", "PushButton", 0, QApplication::UnicodeUTF8)); - textView->setText(QApplication::translate("PreviewWidgetBase", "

\n" -"http://qt.nokia.com\n" -"

\n" -"

\n" -"http://www.kde.org\n" -"

", 0, QApplication::UnicodeUTF8)); - } // retranslateUi - -}; - -namespace Ui { - class PreviewWidgetBase: public Ui_PreviewWidgetBase {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // PREVIEWWIDGETBASE_H diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro index 124564667c5..81458fc1bda 100644 --- a/tools/configure/configure.pro +++ b/tools/configure/configure.pro @@ -28,6 +28,8 @@ INCLUDEPATH += \ $$QT_SOURCE_TREE/src/corelib/global \ $$QT_BUILD_TREE/include \ $$QT_BUILD_TREE/include/QtCore \ + $$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION \ + $$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION/QtCore \ $$QT_SOURCE_TREE/tools/shared HEADERS = configureapp.h environment.h tools.h\ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 9c2ce2cfb40..3f9d97c1ac6 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2913,7 +2913,7 @@ void Configure::generateCachefile() for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var) { cacheStream << (*var) << endl; } - cacheStream << "CONFIG += " << qmakeConfig.join(" ") << " incremental msvc_mp create_prl link_prl depend_includepath QTDIR_build" << endl; + cacheStream << "CONFIG += " << qmakeConfig.join(" ") << " incremental msvc_mp create_prl link_prl depend_includepath no_private_qt_headers_warning QTDIR_build" << endl; cacheStream.flush(); cacheFile.close(); @@ -3648,7 +3648,8 @@ void Configure::buildQmake() stream << "#AutoGenerated by configure.exe" << endl << "BUILD_PATH = " << QDir::convertSeparators(buildPath) << endl << "SOURCE_PATH = " << QDir::convertSeparators(sourcePath) << endl; - stream << "QMAKESPEC = " << dictionary["QMAKESPEC"] << endl; + stream << "QMAKESPEC = " << dictionary["QMAKESPEC"] << endl + << "QT_VERSION = " << QT_VERSION_STR << endl; if (dictionary["EDITION"] == "OpenSource" || dictionary["QT_EDITION"].contains("OPENSOURCE")) diff --git a/tools/uilib/abstractformbuilder.cpp b/tools/uilib/abstractformbuilder.cpp index ecb43db89f8..e850df8f37b 100644 --- a/tools/uilib/abstractformbuilder.cpp +++ b/tools/uilib/abstractformbuilder.cpp @@ -165,9 +165,7 @@ public: /*! Constructs a new form builder.*/ -QAbstractFormBuilder::QAbstractFormBuilder() : - m_defaultMargin(INT_MIN), - m_defaultSpacing(INT_MIN) +QAbstractFormBuilder::QAbstractFormBuilder() : d(new QFormBuilderExtra) { setResourceBuilder(new QResourceBuilder()); setTextBuilder(new QTextBuilder()); @@ -177,10 +175,8 @@ QAbstractFormBuilder::QAbstractFormBuilder() : Destroys the form builder.*/ QAbstractFormBuilder::~QAbstractFormBuilder() { - QFormBuilderExtra::removeInstance(this); } - /*! \fn QWidget *QAbstractFormBuilder::load(QIODevice *device, QWidget *parent) @@ -229,11 +225,10 @@ QWidget *QAbstractFormBuilder::create(DomUI *ui, QWidget *parentWidget) { typedef QFormBuilderExtra::ButtonGroupHash ButtonGroupHash; - QFormBuilderExtra *formBuilderPrivate = QFormBuilderExtra::instance(this); - formBuilderPrivate->clear(); + d->clear(); if (const DomLayoutDefault *def = ui->elementLayoutDefault()) { - m_defaultMargin = def->hasAttributeMargin() ? def->attributeMargin() : INT_MIN; - m_defaultSpacing = def->hasAttributeSpacing() ? def->attributeSpacing() : INT_MIN; + d->m_defaultMargin = def->hasAttributeMargin() ? def->attributeMargin() : INT_MIN; + d->m_defaultSpacing = def->hasAttributeSpacing() ? def->attributeSpacing() : INT_MIN; } DomWidget *ui_widget = ui->elementWidget(); @@ -243,11 +238,11 @@ QWidget *QAbstractFormBuilder::create(DomUI *ui, QWidget *parentWidget) initialize(ui); if (const DomButtonGroups *domButtonGroups = ui->elementButtonGroups()) - formBuilderPrivate->registerButtonGroups(domButtonGroups); + d->registerButtonGroups(domButtonGroups); if (QWidget *widget = create(ui_widget, parentWidget)) { // Reparent button groups that were actually created to main container for them to be found in the signal/slot part - const ButtonGroupHash &buttonGroups = formBuilderPrivate->buttonGroups(); + const ButtonGroupHash &buttonGroups = d->buttonGroups(); if (!buttonGroups.empty()) { const ButtonGroupHash::const_iterator cend = buttonGroups.constEnd(); for (ButtonGroupHash::const_iterator it = buttonGroups.constBegin(); it != cend; ++it) @@ -257,12 +252,12 @@ QWidget *QAbstractFormBuilder::create(DomUI *ui, QWidget *parentWidget) createConnections(ui->elementConnections(), widget); createResources(ui->elementResources()); // maybe this should go first, before create()... applyTabStops(widget, ui->elementTabStops()); - formBuilderPrivate->applyInternalProperties(); + d->applyInternalProperties(); reset(); - formBuilderPrivate->clear(); + d->clear(); return widget; } - formBuilderPrivate->clear(); + d->clear(); return 0; } @@ -283,10 +278,9 @@ void QAbstractFormBuilder::initialize(const DomUI *ui) if (domCustomWidgets) { const DomCustomWidgetList customWidgets = domCustomWidgets->elementCustomWidget(); if (!customWidgets.empty()) { - QFormBuilderExtra *formBuilderPrivate = QFormBuilderExtra::instance(this); const DomCustomWidgetList::const_iterator cend = customWidgets.constEnd(); for (DomCustomWidgetList::const_iterator it = customWidgets.constBegin(); it != cend; ++it) - formBuilderPrivate->storeCustomWidgetData((*it)->elementClass(), *it); + d->storeCustomWidgetData((*it)->elementClass(), *it); } } } @@ -337,9 +331,9 @@ QWidget *QAbstractFormBuilder::create(DomWidget *ui_widget, QWidget *parentWidge sep->setSeparator(true); w->addAction(sep); addMenuAction(sep); - } else if (QAction *a = m_actions.value(name)) { + } else if (QAction *a = d->m_actions.value(name)) { w->addAction(a); - } else if (QActionGroup *g = m_actionGroups.value(name)) { + } else if (QActionGroup *g = d->m_actionGroups.value(name)) { w->addActions(g->actions()); } else if (QMenu *menu = w->findChild(name)) { w->addAction(menu->menuAction()); @@ -351,9 +345,8 @@ QWidget *QAbstractFormBuilder::create(DomWidget *ui_widget, QWidget *parentWidge loadExtraInfo(ui_widget, w, parentWidget); #ifndef QT_FORMBUILDER_NO_SCRIPT QString scriptErrorMessage; - QFormBuilderExtra *extra = QFormBuilderExtra::instance(this); - extra->formScriptRunner().run(ui_widget, - extra->customWidgetScript(ui_widget->attributeClass()), + d->formScriptRunner().run(ui_widget, + d->customWidgetScript(ui_widget->attributeClass()), w, children, &scriptErrorMessage); #endif addItem(ui_widget, w, parentWidget); @@ -388,7 +381,7 @@ QAction *QAbstractFormBuilder::create(DomAction *ui_action, QObject *parent) if (!a) return 0; - m_actions.insert(ui_action->attributeName(), a); + d->m_actions.insert(ui_action->attributeName(), a); applyProperties(a, ui_action->elementProperty()); return a; } @@ -401,7 +394,7 @@ QActionGroup *QAbstractFormBuilder::create(DomActionGroup *ui_action_group, QObj QActionGroup *a = createActionGroup(parent, ui_action_group->attributeName()); if (!a) return 0; - m_actionGroups.insert(ui_action_group->attributeName(), a); + d->m_actionGroups.insert(ui_action_group->attributeName(), a); applyProperties(a, ui_action_group->elementProperty()); foreach (DomAction *ui_action, ui_action_group->elementAction()) { @@ -446,7 +439,7 @@ bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidge return true; // Check special cases. First: Custom container const QString className = QLatin1String(parentWidget->metaObject()->className()); - const QString addPageMethod = QFormBuilderExtra::instance(this)->customWidgetAddPageMethod(className); + const QString addPageMethod = d->customWidgetAddPageMethod(className); if (!addPageMethod.isEmpty()) { // If this fails ( non-existent or non-slot), use ContainerExtension in Designer, else it can't be helped return QMetaObject::invokeMethod(parentWidget, addPageMethod.toUtf8().constData(), Qt::DirectConnection, Q_ARG(QWidget*, widget)); @@ -968,14 +961,12 @@ void QAbstractFormBuilder::applyProperties(QObject *o, const QList if (properties.empty()) return; - QFormBuilderExtra *fb = QFormBuilderExtra::instance(this); - const DomPropertyList::const_iterator cend = properties.constEnd(); for (DomPropertyList::const_iterator it = properties.constBegin(); it != cend; ++it) { const QVariant v = toVariant(o->metaObject(), *it); if (!v.isNull()) { const QString attributeName = (*it)->attributeName(); - if (!fb->applyPropertyInternally(o, attributeName, v)) + if (!d->applyPropertyInternally(o, attributeName, v)) o->setProperty(attributeName.toUtf8(), v); } } @@ -990,7 +981,7 @@ void QAbstractFormBuilder::applyProperties(QObject *o, const QList bool QAbstractFormBuilder::applyPropertyInternally(QObject *o, const QString &propertyName, const QVariant &value) { - return QFormBuilderExtra::instance(this)->applyPropertyInternally(o,propertyName, value); + return d->applyPropertyInternally(o,propertyName, value); } /*! @@ -1274,7 +1265,7 @@ void QAbstractFormBuilder::save(QIODevice *dev, QWidget *widget) ui->write(writer); writer.writeEndDocument(); - m_laidout.clear(); + d->m_laidout.clear(); delete ui; } @@ -1374,7 +1365,7 @@ DomWidget *QAbstractFormBuilder::createDom(QWidget *widget, DomWidget *ui_parent foreach (QObject *obj, children) { if (QWidget *childWidget = qobject_cast(obj)) { - if (m_laidout.contains(childWidget) || recursive == false) + if (d->m_laidout.contains(childWidget) || recursive == false) continue; if (QMenu *menu = qobject_cast(childWidget)) { @@ -1580,7 +1571,7 @@ DomLayoutItem *QAbstractFormBuilder::createDom(QLayoutItem *item, DomLayout *ui_ if (item->widget()) { ui_item->setElementWidget(createDom(item->widget(), ui_parentWidget)); - m_laidout.insert(item->widget(), true); + d->m_laidout.insert(item->widget(), true); } else if (item->layout()) { ui_item->setElementLayout(createDom(item->layout(), ui_layout, ui_parentWidget)); } else if (item->spacerItem()) { @@ -2369,7 +2360,7 @@ void QAbstractFormBuilder::saveItemViewExtraInfo(const QAbstractItemView *itemVi void QAbstractFormBuilder::setResourceBuilder(QResourceBuilder *builder) { - QFormBuilderExtra::instance(this)->setResourceBuilder(builder); + d->setResourceBuilder(builder); } /*! @@ -2379,7 +2370,7 @@ void QAbstractFormBuilder::setResourceBuilder(QResourceBuilder *builder) QResourceBuilder *QAbstractFormBuilder::resourceBuilder() const { - return QFormBuilderExtra::instance(this)->resourceBuilder(); + return d->resourceBuilder(); } /*! @@ -2389,7 +2380,7 @@ QResourceBuilder *QAbstractFormBuilder::resourceBuilder() const void QAbstractFormBuilder::setTextBuilder(QTextBuilder *builder) { - QFormBuilderExtra::instance(this)->setTextBuilder(builder); + d->setTextBuilder(builder); } /*! @@ -2399,7 +2390,7 @@ void QAbstractFormBuilder::setTextBuilder(QTextBuilder *builder) QTextBuilder *QAbstractFormBuilder::textBuilder() const { - return QFormBuilderExtra::instance(this)->textBuilder(); + return d->textBuilder(); } /*! @@ -2663,8 +2654,7 @@ void QAbstractFormBuilder::loadButtonExtraInfo(const DomWidget *ui_widget, QAbst if (groupName.isEmpty()) return; // Find entry - QFormBuilderExtra *extra = QFormBuilderExtra::instance(this); - ButtonGroupHash &buttonGroups = extra->buttonGroups(); + ButtonGroupHash &buttonGroups = d->buttonGroups(); ButtonGroupHash::iterator it = buttonGroups.find(groupName); if (it == buttonGroups.end()) { #ifdef QFORMINTERNAL_NAMESPACE // Suppress the warning when copying in Designer @@ -2796,75 +2786,13 @@ void QAbstractFormBuilder::loadExtraInfo(DomWidget *ui_widget, QWidget *widget, } } -/*! - \internal -*/ -QIcon QAbstractFormBuilder::nameToIcon(const QString &filePath, const QString &qrcPath) -{ - Q_UNUSED(filePath) - Q_UNUSED(qrcPath) - qWarning() << "QAbstractFormBuilder::nameToIcon() is obsoleted"; - return QIcon(); -} - -/*! - \internal -*/ -QString QAbstractFormBuilder::iconToFilePath(const QIcon &pm) const -{ - Q_UNUSED(pm) - qWarning() << "QAbstractFormBuilder::iconToFilePath() is obsoleted"; - return QString(); -} - -/*! - \internal -*/ -QString QAbstractFormBuilder::iconToQrcPath(const QIcon &pm) const -{ - Q_UNUSED(pm) - qWarning() << "QAbstractFormBuilder::iconToQrcPath() is obsoleted"; - return QString(); -} - -/*! - \internal -*/ -QPixmap QAbstractFormBuilder::nameToPixmap(const QString &filePath, const QString &qrcPath) -{ - Q_UNUSED(filePath) - Q_UNUSED(qrcPath) - qWarning() << "QAbstractFormBuilder::nameToPixmap() is obsoleted"; - return QPixmap(); -} - -/*! - \internal -*/ -QString QAbstractFormBuilder::pixmapToFilePath(const QPixmap &pm) const -{ - Q_UNUSED(pm) - qWarning() << "QAbstractFormBuilder::pixmapToFilePath() is obsoleted"; - return QString(); -} - -/*! - \internal -*/ -QString QAbstractFormBuilder::pixmapToQrcPath(const QPixmap &pm) const -{ - Q_UNUSED(pm) - qWarning() << "QAbstractFormBuilder::pixmapToQrcPath() is obsoleted"; - return QString(); -} - /*! Returns the current working directory of the form builder. \sa setWorkingDirectory() */ QDir QAbstractFormBuilder::workingDirectory() const { - return m_workingDirectory; + return d->m_workingDirectory; } /*! @@ -2874,7 +2802,7 @@ QDir QAbstractFormBuilder::workingDirectory() const \sa workingDirectory()*/ void QAbstractFormBuilder::setWorkingDirectory(const QDir &directory) { - m_workingDirectory = directory; + d->m_workingDirectory = directory; } /*! @@ -2948,11 +2876,11 @@ void QAbstractFormBuilder::addMenuAction(QAction *action) */ void QAbstractFormBuilder::reset() { - m_laidout.clear(); - m_actions.clear(); - m_actionGroups.clear(); - m_defaultMargin = INT_MIN; - m_defaultSpacing = INT_MIN; + d->m_laidout.clear(); + d->m_actions.clear(); + d->m_actionGroups.clear(); + d->m_defaultMargin = INT_MIN; + d->m_defaultSpacing = INT_MIN; } /*! @@ -3165,7 +3093,7 @@ QPixmap QAbstractFormBuilder::domPropertyToPixmap(const DomProperty* p) #ifndef QT_FORMBUILDER_NO_SCRIPT QFormScriptRunner *QAbstractFormBuilder::formScriptRunner() const { - return &(QFormBuilderExtra::instance(this)->formScriptRunner()); + return &(d->formScriptRunner()); } #endif diff --git a/tools/uilib/abstractformbuilder.h b/tools/uilib/abstractformbuilder.h index 2f99b36515d..4c225709328 100644 --- a/tools/uilib/abstractformbuilder.h +++ b/tools/uilib/abstractformbuilder.h @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -105,6 +106,7 @@ class DomResourcePixmap; class QResourceBuilder; class QTextBuilder; +class QFormBuilderExtra; #ifndef QT_FORMBUILDER_NO_SCRIPT class QFormScriptRunner; @@ -186,13 +188,6 @@ protected: virtual void layoutInfo(DomLayout *layout, QObject *parent, int *margin, int *spacing); - virtual QIcon nameToIcon(const QString &filePath, const QString &qrcPath); - virtual QString iconToFilePath(const QIcon &pm) const; - virtual QString iconToQrcPath(const QIcon &pm) const; - virtual QPixmap nameToPixmap(const QString &filePath, const QString &qrcPath); - virtual QString pixmapToFilePath(const QPixmap &pm) const; - virtual QString pixmapToQrcPath(const QPixmap &pm) const; - void loadListWidgetExtraInfo(DomWidget *ui_widget, QListWidget *listWidget, QWidget *parentWidget); void loadTreeWidgetExtraInfo(DomWidget *ui_widget, QTreeWidget *treeWidget, QWidget *parentWidget); void loadTableWidgetExtraInfo(DomWidget *ui_widget, QTableWidget *tableWidget, QWidget *parentWidget); @@ -259,13 +254,6 @@ protected: QPixmap domPropertyToPixmap(const DomResourcePixmap* p); QPixmap domPropertyToPixmap(const DomProperty* p); - QHash m_laidout; - QHash m_actions; - QHash m_actionGroups; - int m_defaultMargin; - int m_defaultSpacing; - QDir m_workingDirectory; - private: // // utils @@ -277,6 +265,9 @@ private: friend QDESIGNER_UILIB_EXPORT DomProperty *variantToDomProperty(QAbstractFormBuilder *abstractFormBuilder, const QMetaObject *meta, const QString &propertyName, const QVariant &value); friend QDESIGNER_UILIB_EXPORT QVariant domPropertyToVariant(QAbstractFormBuilder *abstractFormBuilder,const QMetaObject *meta, const DomProperty *property); + +protected: + QScopedPointer d; }; #ifdef QFORMINTERNAL_NAMESPACE diff --git a/tools/uilib/formbuilder.cpp b/tools/uilib/formbuilder.cpp index b997cc9bc07..592b1f15f7d 100644 --- a/tools/uilib/formbuilder.cpp +++ b/tools/uilib/formbuilder.cpp @@ -104,7 +104,7 @@ namespace QFormInternal { Constructs a new form builder. */ -QFormBuilder::QFormBuilder() : QAbstractFormBuilder() +QFormBuilder::QFormBuilder() { } @@ -120,12 +120,11 @@ QFormBuilder::~QFormBuilder() */ QWidget *QFormBuilder::create(DomWidget *ui_widget, QWidget *parentWidget) { - QFormBuilderExtra *fb = QFormBuilderExtra::instance(this); - if (!fb->parentWidgetIsSet()) - fb->setParentWidget(parentWidget); + if (!d->parentWidgetIsSet()) + d->setParentWidget(parentWidget); // Is this a QLayoutWidget with a margin of 0: Not a known page-based // container and no method for adding pages registered. - fb->setProcessingLayoutWidget(false); + d->setProcessingLayoutWidget(false); if (ui_widget->attributeClass() == QFormBuilderStrings::instance().qWidgetClass && !ui_widget->hasAttributeNative() && parentWidget #ifndef QT_NO_MAINWINDOW @@ -151,8 +150,8 @@ QWidget *QFormBuilder::create(DomWidget *ui_widget, QWidget *parentWidget) #endif ) { const QString parentClassName = QLatin1String(parentWidget->metaObject()->className()); - if (!fb->isCustomWidgetContainer(parentClassName)) - fb->setProcessingLayoutWidget(true); + if (!d->isCustomWidgetContainer(parentClassName)) + d->setProcessingLayoutWidget(true); } return QAbstractFormBuilder::create(ui_widget, parentWidget); } @@ -212,14 +211,13 @@ QWidget *QFormBuilder::createWidget(const QString &widgetName, QWidget *parentWi break; // try with a registered custom widget - QDesignerCustomWidgetInterface *factory = m_customWidgets.value(widgetName); + QDesignerCustomWidgetInterface *factory = d->m_customWidgets.value(widgetName); if (factory != 0) w = factory->createWidget(parentWidget); } while(false); - QFormBuilderExtra *fb = QFormBuilderExtra::instance(this); if (w == 0) { // Attempt to instantiate base class of promoted/custom widgets - const QString baseClassName = fb->customWidgetBaseClass(widgetName); + const QString baseClassName = d->customWidgetBaseClass(widgetName); if (!baseClassName.isEmpty()) { qWarning() << QCoreApplication::translate("QFormBuilder", "QFormBuilder was unable to create a custom widget of the class '%1'; defaulting to base class '%2'.").arg(widgetName, baseClassName); return createWidget(baseClassName, parentWidget, name); @@ -374,10 +372,9 @@ QWidget *QFormBuilder::create(DomUI *ui, QWidget *parentWidget) */ QLayout *QFormBuilder::create(DomLayout *ui_layout, QLayout *layout, QWidget *parentWidget) { - QFormBuilderExtra *fb = QFormBuilderExtra::instance(this); // Is this a temporary layout widget used to represent QLayout hierarchies in Designer? // Set its margins to 0. - bool layoutWidget = fb->processingLayoutWidget(); + bool layoutWidget = d->processingLayoutWidget(); QLayout *l = QAbstractFormBuilder::create(ui_layout, layout, parentWidget); if (layoutWidget) { const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); @@ -398,7 +395,7 @@ QLayout *QFormBuilder::create(DomLayout *ui_layout, QLayout *layout, QWidget *pa bottom = prop->elementNumber(); l->setContentsMargins(left, top, right, bottom); - fb->setProcessingLayoutWidget(false); + d->setProcessingLayoutWidget(false); } return l; } @@ -434,7 +431,7 @@ QActionGroup *QFormBuilder::create(DomActionGroup *ui_action_group, QObject *par */ QStringList QFormBuilder::pluginPaths() const { - return m_pluginPaths; + return d->m_pluginPaths; } /*! @@ -445,7 +442,7 @@ QStringList QFormBuilder::pluginPaths() const */ void QFormBuilder::clearPluginPaths() { - m_pluginPaths.clear(); + d->m_pluginPaths.clear(); updateCustomWidgets(); } @@ -458,7 +455,7 @@ void QFormBuilder::clearPluginPaths() */ void QFormBuilder::addPluginPath(const QString &pluginPath) { - m_pluginPaths.append(pluginPath); + d->m_pluginPaths.append(pluginPath); updateCustomWidgets(); } @@ -469,7 +466,7 @@ void QFormBuilder::addPluginPath(const QString &pluginPath) */ void QFormBuilder::setPluginPath(const QStringList &pluginPaths) { - m_pluginPaths = pluginPaths; + d->m_pluginPaths = pluginPaths; updateCustomWidgets(); } @@ -492,9 +489,9 @@ static void insertPlugins(QObject *o, QMapm_customWidgets.clear(); - foreach (const QString &path, m_pluginPaths) { + foreach (const QString &path, d->m_pluginPaths) { const QDir dir(path); const QStringList candidates = dir.entryList(QDir::Files); @@ -508,14 +505,14 @@ void QFormBuilder::updateCustomWidgets() QPluginLoader loader(loaderPath); if (loader.load()) - insertPlugins(loader.instance(), &m_customWidgets); + insertPlugins(loader.instance(), &d->m_customWidgets); } } // Check statically linked plugins const QObjectList staticPlugins = QPluginLoader::staticInstances(); if (!staticPlugins.empty()) foreach (QObject *o, staticPlugins) - insertPlugins(o, &m_customWidgets); + insertPlugins(o, &d->m_customWidgets); } /*! @@ -525,7 +522,7 @@ void QFormBuilder::updateCustomWidgets() */ QList QFormBuilder::customWidgets() const { - return m_customWidgets.values(); + return d->m_customWidgets.values(); } /*! @@ -539,7 +536,6 @@ void QFormBuilder::applyProperties(QObject *o, const QList &proper if (properties.empty()) return; - QFormBuilderExtra *fb = QFormBuilderExtra::instance(this); const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); const DomPropertyList::const_iterator cend = properties.constEnd(); @@ -550,10 +546,10 @@ void QFormBuilder::applyProperties(QObject *o, const QList &proper const QString attributeName = (*it)->attributeName(); const bool isWidget = o->isWidgetType(); - if (isWidget && o->parent() == fb->parentWidget() && attributeName == strings.geometryProperty) { + if (isWidget && o->parent() == d->parentWidget() && attributeName == strings.geometryProperty) { // apply only the size part of a geometry for the root widget static_cast(o)->resize(qvariant_cast(v).size()); - } else if (fb->applyPropertyInternally(o, attributeName, v)) { + } else if (d->applyPropertyInternally(o, attributeName, v)) { } else if (isWidget && !qstrcmp("QFrame", o->metaObject()->className ()) && attributeName == strings.orientationProperty) { // ### special-casing for Line (QFrame) -- try to fix me o->setProperty("frameShape", v); // v is of QFrame::Shape enum diff --git a/tools/uilib/formbuilder.h b/tools/uilib/formbuilder.h index 1d3dc5a3959..6c0820c214b 100644 --- a/tools/uilib/formbuilder.h +++ b/tools/uilib/formbuilder.h @@ -45,9 +45,6 @@ #include "uilib_global.h" #include "abstractformbuilder.h" -#include -#include - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -100,8 +97,6 @@ protected: static QWidget *widgetByName(QWidget *topLevel, const QString &name); private: - QStringList m_pluginPaths; - QMap m_customWidgets; }; #ifdef QFORMINTERNAL_NAMESPACE diff --git a/tools/uilib/formbuilderextra.cpp b/tools/uilib/formbuilderextra.cpp index ecc62886b90..12e43f1e386 100644 --- a/tools/uilib/formbuilderextra.cpp +++ b/tools/uilib/formbuilderextra.cpp @@ -55,6 +55,8 @@ #include #include +#include + QT_BEGIN_NAMESPACE #ifdef QFORMINTERNAL_NAMESPACE @@ -83,6 +85,8 @@ QFormBuilderExtra::CustomWidgetData::CustomWidgetData(const DomCustomWidget *dcw } QFormBuilderExtra::QFormBuilderExtra() : + m_defaultMargin(INT_MIN), + m_defaultSpacing(INT_MIN), m_layoutWidget(false), m_resourceBuilder(0), m_textBuilder(0) @@ -217,33 +221,6 @@ bool QFormBuilderExtra::isCustomWidgetContainer(const QString &className) const return false; } -namespace { - typedef QHash FormBuilderPrivateHash; -} - -Q_GLOBAL_STATIC(FormBuilderPrivateHash, g_FormBuilderPrivateHash) - -QFormBuilderExtra *QFormBuilderExtra::instance(const QAbstractFormBuilder *afb) -{ - FormBuilderPrivateHash &fbHash = *g_FormBuilderPrivateHash(); - - FormBuilderPrivateHash::iterator it = fbHash.find(afb); - if (it == fbHash.end()) - it = fbHash.insert(afb, new QFormBuilderExtra); - return it.value(); -} - -void QFormBuilderExtra::removeInstance(const QAbstractFormBuilder *afb) -{ - FormBuilderPrivateHash &fbHash = *g_FormBuilderPrivateHash(); - - FormBuilderPrivateHash::iterator it = fbHash.find(afb); - if (it != fbHash.end()) { - delete it.value(); - fbHash.erase(it); - } -} - void QFormBuilderExtra::setProcessingLayoutWidget(bool processing) { m_layoutWidget = processing; diff --git a/tools/uilib/formbuilderextra_p.h b/tools/uilib/formbuilderextra_p.h index cac882b8d80..a5e2029391e 100644 --- a/tools/uilib/formbuilderextra_p.h +++ b/tools/uilib/formbuilderextra_p.h @@ -61,19 +61,23 @@ #include #include -#include +#include +#include +#include QT_BEGIN_NAMESPACE +class QDesignerCustomWidgetInterface; class QObject; class QVariant; class QWidget; class QObject; class QLabel; class QButtonGroup; - class QBoxLayout; class QGridLayout; +class QAction; +class QActionGroup; #ifdef QFORMINTERNAL_NAMESPACE namespace QFormInternal @@ -90,9 +94,10 @@ class QTextBuilder; class QDESIGNER_UILIB_EXPORT QFormBuilderExtra { +public: QFormBuilderExtra(); ~QFormBuilderExtra(); -public: + struct CustomWidgetData { CustomWidgetData(); explicit CustomWidgetData(const DomCustomWidget *dc); @@ -130,9 +135,6 @@ public: void setTextBuilder(QTextBuilder *builder); QTextBuilder *textBuilder() const; - static QFormBuilderExtra *instance(const QAbstractFormBuilder *afb); - static void removeInstance(const QAbstractFormBuilder *afb); - void storeCustomWidgetData(const QString &className, const DomCustomWidget *d); QString customWidgetAddPageMethod(const QString &className) const; QString customWidgetBaseClass(const QString &className) const; @@ -169,6 +171,16 @@ public: static bool setGridLayoutColumnMinimumWidth(const QString &, QGridLayout *); static void clearGridLayoutColumnMinimumWidth(QGridLayout *); + QStringList m_pluginPaths; + QMap m_customWidgets; + + QHash m_laidout; + QHash m_actions; + QHash m_actionGroups; + int m_defaultMargin; + int m_defaultSpacing; + QDir m_workingDirectory; + private: void clearResourceBuilder(); void clearTextBuilder();