summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-06-01 04:06:39 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-06-01 04:06:39 (GMT)
commit111c9143dc34be69c503a90bf9d6f6e5f5f67041 (patch)
treed196c26b30a06efa46d650c7094dc73c873aea98
parent596d9378943755bc63b486919b5616132efa7ab3 (diff)
parentb9f484ae5d415d95df897e18059c054527111374 (diff)
downloadQt-111c9143dc34be69c503a90bf9d6f6e5f5f67041.zip
Qt-111c9143dc34be69c503a90bf9d6f6e5f5f67041.tar.gz
Qt-111c9143dc34be69c503a90bf9d6f6e5f5f67041.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--bin/snapshot359
-rwxr-xr-xbin/syncqt2
-rw-r--r--config.tests/unix/iodbc/iodbc.cpp7
-rw-r--r--config.tests/unix/iodbc/iodbc.pro4
-rwxr-xr-xconfigure56
-rw-r--r--demos/qtdemo/xml/examples.xml15
-rw-r--r--demos/spreadsheet/spreadsheetdelegate.cpp6
-rw-r--r--dist/changes-4.5.24
-rw-r--r--doc/src/animation.qdoc4
-rw-r--r--doc/src/designer-manual.qdoc134
-rw-r--r--doc/src/emb-fonts.qdoc2
-rw-r--r--doc/src/emb-makeqpf.qdoc9
-rw-r--r--doc/src/examples.qdoc6
-rw-r--r--doc/src/examples/stickman.qdoc115
-rw-r--r--doc/src/images/designer-choosing-form.pngbin38078 -> 39080 bytes
-rw-r--r--doc/src/images/inputdialogs.pngbin4244 -> 30369 bytes
-rw-r--r--doc/src/images/rgbController-arrangement.pngbin0 -> 10813 bytes
-rw-r--r--doc/src/images/rgbController-configure-connection1.pngbin0 -> 23241 bytes
-rw-r--r--doc/src/images/rgbController-configure-connection2.pngbin0 -> 28655 bytes
-rw-r--r--doc/src/images/rgbController-final-layout.pngbin0 -> 11275 bytes
-rw-r--r--doc/src/images/rgbController-form-gridLayout.pngbin0 -> 11235 bytes
-rw-r--r--doc/src/images/rgbController-property-editing.pngbin0 -> 9158 bytes
-rw-r--r--doc/src/images/rgbController-screenshot.pngbin0 -> 8995 bytes
-rw-r--r--doc/src/images/rgbController-selectForLayout.pngbin0 -> 20981 bytes
-rw-r--r--doc/src/images/rgbController-signalsAndSlots.pngbin0 -> 10050 bytes
-rw-r--r--doc/src/images/stickman-example.pngbin0 -> 18867 bytes
-rw-r--r--doc/src/images/stickman-example1.pngbin0 -> 64543 bytes
-rw-r--r--doc/src/images/stickman-example2.pngbin0 -> 37412 bytes
-rw-r--r--doc/src/images/stickman-example3.pngbin0 -> 23591 bytes
-rw-r--r--doc/src/index.qdoc7
-rw-r--r--doc/src/installation.qdoc2
-rw-r--r--doc/src/phonon-api.qdoc32
-rw-r--r--doc/src/qnamespace.qdoc4
-rw-r--r--doc/src/qset.qdoc9
-rw-r--r--doc/src/signalsandslots.qdoc14
-rw-r--r--doc/src/snippets/animation/sequential/icons.qrc6
-rw-r--r--doc/src/snippets/animation/sequential/icons/left.pngbin0 -> 413 bytes
-rw-r--r--doc/src/snippets/animation/sequential/icons/right.pngbin0 -> 414 bytes
-rw-r--r--doc/src/snippets/animation/sequential/main.cpp50
-rw-r--r--doc/src/snippets/animation/sequential/sequential.pro4
-rw-r--r--doc/src/snippets/animation/sequential/tracer.cpp25
-rw-r--r--doc/src/snippets/animation/sequential/tracer.h23
-rw-r--r--doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp2
-rw-r--r--doc/src/snippets/picture/picture.cpp2
-rw-r--r--doc/src/tools-list.qdoc6
-rw-r--r--doc/src/topics.qdoc2
-rw-r--r--examples/animation/README38
-rw-r--r--examples/animation/animatedtiles/animatedtiles.pro10
-rw-r--r--examples/animation/animatedtiles/main.cpp13
-rw-r--r--examples/animation/animation.pro2
-rw-r--r--examples/animation/appchooser/appchooser.pro5
-rw-r--r--examples/animation/appchooser/main.cpp3
-rw-r--r--examples/animation/easing/animation.h6
-rw-r--r--examples/animation/easing/easing.pro24
-rw-r--r--examples/animation/easing/easing.qrc (renamed from examples/animation/easing/resources.qrc)0
-rw-r--r--examples/animation/easing/main.cpp1
-rw-r--r--examples/animation/example/example.pro12
-rw-r--r--examples/animation/example/main.cpp53
-rw-r--r--examples/animation/example/mainwindow.cpp252
-rw-r--r--examples/animation/example/mainwindow.h75
-rw-r--r--examples/animation/moveblocks/main.cpp12
-rw-r--r--examples/animation/moveblocks/moveblocks.pro5
-rw-r--r--examples/animation/padnavigator-ng/backside.ui208
-rw-r--r--examples/animation/padnavigator-ng/images/artsfftscope.pngbin1294 -> 0 bytes
-rw-r--r--examples/animation/padnavigator-ng/images/blue_angle_swirl.jpgbin11826 -> 0 bytes
-rw-r--r--examples/animation/padnavigator-ng/images/kontact_contacts.pngbin4382 -> 0 bytes
-rw-r--r--examples/animation/padnavigator-ng/images/kontact_journal.pngbin3261 -> 0 bytes
-rw-r--r--examples/animation/padnavigator-ng/images/kontact_mail.pngbin3202 -> 0 bytes
-rw-r--r--examples/animation/padnavigator-ng/images/kontact_notes.pngbin3893 -> 0 bytes
-rw-r--r--examples/animation/padnavigator-ng/images/kopeteavailable.pngbin2380 -> 0 bytes
-rw-r--r--examples/animation/padnavigator-ng/images/metacontact_online.pngbin2545 -> 0 bytes
-rw-r--r--examples/animation/padnavigator-ng/images/minitools.pngbin2087 -> 0 bytes
-rw-r--r--examples/animation/padnavigator-ng/main.cpp54
-rw-r--r--examples/animation/padnavigator-ng/padnavigator.pro24
-rw-r--r--examples/animation/padnavigator-ng/padnavigator.qrc14
-rw-r--r--examples/animation/padnavigator-ng/panel.cpp246
-rw-r--r--examples/animation/padnavigator-ng/panel.h89
-rw-r--r--examples/animation/padnavigator-ng/roundrectitem.cpp136
-rw-r--r--examples/animation/padnavigator-ng/roundrectitem.h77
-rw-r--r--examples/animation/padnavigator-ng/splashitem.cpp85
-rw-r--r--examples/animation/padnavigator-ng/splashitem.h61
-rw-r--r--examples/animation/research/memberfunctions/main.cpp89
-rw-r--r--examples/animation/research/memberfunctions/memberfunctions.pro16
-rw-r--r--examples/animation/research/memberfunctions/qvalueanimation.cpp101
-rw-r--r--examples/animation/research/memberfunctions/qvalueanimation.h119
-rw-r--r--examples/animation/research/memberfunctions/qvalueanimation_p.h77
-rw-r--r--examples/animation/research/photobrowser/main.cpp82
-rw-r--r--examples/animation/research/photobrowser/menu.cpp155
-rw-r--r--examples/animation/research/photobrowser/menu.h80
-rw-r--r--examples/animation/research/photobrowser/photobrowser.pro17
-rw-r--r--examples/animation/research/photobrowser/river.cpp591
-rw-r--r--examples/animation/research/photobrowser/river.h111
-rw-r--r--examples/animation/research/photobrowser/riveritem.cpp125
-rw-r--r--examples/animation/research/photobrowser/riveritem.h66
-rw-r--r--examples/animation/research/piemenu/main.cpp56
-rw-r--r--examples/animation/research/piemenu/piemenu.pro8
-rw-r--r--examples/animation/research/piemenu/qgraphicspiemenu.cpp250
-rw-r--r--examples/animation/research/piemenu/qgraphicspiemenu.h104
-rw-r--r--examples/animation/research/piemenu/qgraphicspiemenu_p.h78
-rw-r--r--examples/animation/research/piemenu/qgraphicspiemenusection_p.h88
-rw-r--r--examples/animation/research/piemenu/scene.cpp73
-rw-r--r--examples/animation/research/piemenu/scene.h60
-rw-r--r--examples/animation/research/propertytransform/main.cpp88
-rw-r--r--examples/animation/research/propertytransform/propertytransform.pro14
-rw-r--r--examples/animation/research/propertytransform/qpropertytransform.h119
-rw-r--r--examples/animation/research/sound/main.cpp104
-rw-r--r--examples/animation/research/sound/media/sax.mp3bin417844 -> 0 bytes
-rw-r--r--examples/animation/research/sound/sound.pro14
-rw-r--r--examples/animation/states/main.cpp8
-rw-r--r--examples/animation/stickman/animation.h2
-rw-r--r--examples/animation/stickman/editor/animationdialog.h2
-rw-r--r--examples/animation/stickman/lifecycle.cpp57
-rw-r--r--examples/animation/stickman/lifecycle.h4
-rw-r--r--examples/animation/stickman/node.cpp4
-rw-r--r--examples/animation/stickman/stickman.cpp6
-rw-r--r--examples/animation/stickman/stickman.h2
-rw-r--r--examples/animation/stickman/stickman.pro27
-rw-r--r--examples/animation/sub-attaq/animationmanager.cpp6
-rw-r--r--examples/animation/sub-attaq/animationmanager.h2
-rw-r--r--examples/animation/sub-attaq/boat.cpp10
-rw-r--r--examples/animation/sub-attaq/boat.h11
-rw-r--r--examples/animation/sub-attaq/boat_p.h19
-rw-r--r--examples/animation/sub-attaq/bomb.cpp8
-rw-r--r--examples/animation/sub-attaq/bomb.h12
-rw-r--r--examples/animation/sub-attaq/custompropertyanimation.cpp7
-rw-r--r--examples/animation/sub-attaq/custompropertyanimation.h8
-rw-r--r--examples/animation/sub-attaq/graphicsscene.cpp11
-rw-r--r--examples/animation/sub-attaq/graphicsscene.h11
-rw-r--r--examples/animation/sub-attaq/mainwindow.cpp9
-rw-r--r--examples/animation/sub-attaq/mainwindow.h3
-rw-r--r--examples/animation/sub-attaq/qanimationstate.cpp52
-rw-r--r--examples/animation/sub-attaq/qanimationstate.h6
-rw-r--r--examples/animation/sub-attaq/states.cpp7
-rw-r--r--examples/animation/sub-attaq/states.h11
-rw-r--r--examples/animation/sub-attaq/sub-attaq.pro15
-rw-r--r--examples/animation/sub-attaq/subattaq.qrc1
-rw-r--r--examples/animation/sub-attaq/submarine.cpp8
-rw-r--r--examples/animation/sub-attaq/submarine.h7
-rw-r--r--examples/animation/sub-attaq/submarine_p.h17
-rw-r--r--examples/animation/sub-attaq/torpedo.cpp6
-rw-r--r--examples/animation/sub-attaq/torpedo.h12
-rw-r--r--examples/examples.pro2
-rw-r--r--examples/itemviews/puzzle/puzzle.pro5
-rw-r--r--examples/network/googlesuggest/googlesuggest.pro4
-rw-r--r--examples/opengl/framebufferobject/glwidget.cpp28
-rw-r--r--examples/opengl/framebufferobject/glwidget.h3
-rw-r--r--examples/qtconcurrent/imagescaling/imagescaling.pro2
-rw-r--r--examples/qtconcurrent/qtconcurrent.pro5
-rw-r--r--examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro3
-rw-r--r--examples/statemachine/citizenquartz/citizenquartz.pro20
-rw-r--r--examples/statemachine/citizenquartz/citizenquartz.qrc6
-rw-r--r--examples/statemachine/citizenquartz/clock.cpp390
-rw-r--r--examples/statemachine/citizenquartz/clock.h62
-rw-r--r--examples/statemachine/citizenquartz/clockbutton.cpp39
-rw-r--r--examples/statemachine/citizenquartz/clockbutton.h25
-rw-r--r--examples/statemachine/citizenquartz/clockdisplay.cpp139
-rw-r--r--examples/statemachine/citizenquartz/clockdisplay.h89
-rw-r--r--examples/statemachine/citizenquartz/images/alarm.pngbin434 -> 0 bytes
-rw-r--r--examples/statemachine/citizenquartz/main.cpp23
-rw-r--r--examples/statemachine/citizenquartz/propertyaddstate.cpp46
-rw-r--r--examples/statemachine/citizenquartz/propertyaddstate.h33
-rw-r--r--examples/statemachine/citizenquartz/sound/alarm.wavbin3238264 -> 0 bytes
-rw-r--r--examples/statemachine/citizenquartz/timeperiod.h84
-rw-r--r--examples/statemachine/eventtransitions/eventtransitions.pro12
-rw-r--r--examples/statemachine/factorial/factorial.pro11
-rw-r--r--examples/statemachine/pingpong/pingpong.pro13
-rw-r--r--examples/statemachine/tankgame/gameitem.cpp41
-rw-r--r--examples/statemachine/tankgame/gameitem.h43
-rw-r--r--examples/statemachine/tankgame/gameovertransition.cpp45
-rw-r--r--examples/statemachine/tankgame/gameovertransition.h41
-rw-r--r--examples/statemachine/tankgame/main.cpp41
-rw-r--r--examples/statemachine/tankgame/mainwindow.cpp83
-rw-r--r--examples/statemachine/tankgame/mainwindow.h48
-rw-r--r--examples/statemachine/tankgame/plugin.h45
-rw-r--r--examples/statemachine/tankgame/rocketitem.cpp43
-rw-r--r--examples/statemachine/tankgame/rocketitem.h44
-rw-r--r--examples/statemachine/tankgame/tankgame.pro30
-rw-r--r--examples/statemachine/tankgame/tankitem.cpp73
-rw-r--r--examples/statemachine/tankgame/tankitem.h47
-rw-r--r--examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.cpp41
-rw-r--r--examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.h43
-rw-r--r--examples/statemachine/tankgameplugins/seek_ai/seek_ai.cpp57
-rw-r--r--examples/statemachine/tankgameplugins/seek_ai/seek_ai.h61
-rw-r--r--examples/statemachine/tankgameplugins/spin_ai/spin_ai.cpp51
-rw-r--r--examples/statemachine/tankgameplugins/spin_ai/spin_ai.h45
-rw-r--r--examples/statemachine/tankgameplugins/spin_ai_with_error/spin_ai_with_error.cpp49
-rw-r--r--examples/statemachine/tankgameplugins/spin_ai_with_error/spin_ai_with_error.h45
-rw-r--r--examples/statemachine/trafficlight/trafficlight.pro7
-rw-r--r--examples/statemachine/twowaybutton/twowaybutton.pro12
-rw-r--r--examples/webkit/fancybrowser/mainwindow.h2
-rw-r--r--examples/widgets/movie/movie.pro8
-rw-r--r--mkspecs/common/wince.conf7
-rw-r--r--mkspecs/features/qt.prf3
-rw-r--r--projects.pro1
-rw-r--r--qmake/generators/win32/winmakefile.cpp2
-rw-r--r--src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp2
-rw-r--r--src/3rdparty/clucene/src/CLucene/util/Misc.cpp9
-rw-r--r--src/3rdparty/easing/easing.cpp1
-rw-r--r--src/3rdparty/phonon/phonon/effectwidget.cpp3
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog39
-rw-r--r--src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp6
-rw-r--r--src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp6
-rw-r--r--src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp1
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp8
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog14
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp8
-rw-r--r--src/activeqt/container/qaxbase.cpp76
-rw-r--r--src/activeqt/container/qaxdump.cpp38
-rw-r--r--src/activeqt/container/qaxscript.cpp4
-rw-r--r--src/activeqt/control/qaxserver.cpp183
-rw-r--r--src/activeqt/control/qaxserverbase.cpp10
-rw-r--r--src/activeqt/control/qaxservermain.cpp2
-rw-r--r--src/activeqt/shared/qaxtypes.cpp2
-rw-r--r--src/corelib/animation/qabstractanimation.cpp49
-rw-r--r--src/corelib/animation/qabstractanimation.h4
-rw-r--r--src/corelib/animation/qabstractanimation_p.h33
-rw-r--r--src/corelib/animation/qanimationgroup.cpp26
-rw-r--r--src/corelib/animation/qanimationgroup.h6
-rw-r--r--src/corelib/animation/qparallelanimationgroup.cpp5
-rw-r--r--src/corelib/animation/qparallelanimationgroup.h6
-rw-r--r--src/corelib/animation/qpauseanimation.cpp5
-rw-r--r--src/corelib/animation/qpauseanimation.h6
-rw-r--r--src/corelib/animation/qpropertyanimation.cpp42
-rw-r--r--src/corelib/animation/qpropertyanimation.h9
-rw-r--r--src/corelib/animation/qpropertyanimation_p.h7
-rw-r--r--src/corelib/animation/qsequentialanimationgroup.cpp5
-rw-r--r--src/corelib/animation/qsequentialanimationgroup.h6
-rw-r--r--src/corelib/animation/qvariantanimation.cpp80
-rw-r--r--src/corelib/animation/qvariantanimation.h11
-rw-r--r--src/corelib/animation/qvariantanimation_p.h30
-rw-r--r--src/corelib/arch/qatomic_bootstrap.h14
-rw-r--r--src/corelib/concurrent/qfuturewatcher_p.h4
-rw-r--r--src/corelib/global/qfeatures.txt8
-rw-r--r--src/corelib/global/qglobal.cpp53
-rw-r--r--src/corelib/global/qglobal.h16
-rw-r--r--src/corelib/global/qlibraryinfo.cpp16
-rw-r--r--src/corelib/global/qnamespace.h3
-rw-r--r--src/corelib/io/qdatastream.cpp92
-rw-r--r--src/corelib/io/qdebug.h28
-rw-r--r--src/corelib/io/qdir.cpp10
-rw-r--r--src/corelib/io/qfile.cpp29
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp2
-rw-r--r--src/corelib/io/qfsfileengine.cpp122
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp15
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp103
-rw-r--r--src/corelib/io/qiodevice.cpp2
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice.cpp4
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice_p.h2
-rw-r--r--src/corelib/io/qprocess.cpp2
-rw-r--r--src/corelib/io/qprocess_unix.cpp48
-rw-r--r--src/corelib/io/qprocess_win.cpp20
-rw-r--r--src/corelib/io/qresource.cpp8
-rw-r--r--src/corelib/io/qsettings.cpp13
-rw-r--r--src/corelib/io/qsettings_win.cpp2
-rw-r--r--src/corelib/io/qtemporaryfile.cpp98
-rw-r--r--src/corelib/io/qtextstream.cpp4
-rw-r--r--src/corelib/io/qurl.cpp8
-rw-r--r--src/corelib/io/qurl.h2
-rw-r--r--src/corelib/kernel/kernel.pri8
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp12
-rw-r--r--src/corelib/kernel/qabstractitemmodel_p.h2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp37
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix_p.h4
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp7
-rw-r--r--src/corelib/kernel/qobject.cpp45
-rw-r--r--src/corelib/kernel/qsharedmemory_unix.cpp3
-rw-r--r--src/corelib/kernel/qsystemsemaphore_p.h4
-rw-r--r--src/corelib/kernel/qtimer.cpp2
-rw-r--r--src/corelib/kernel/qtranslator.cpp4
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp2
-rw-r--r--src/corelib/statemachine/qabstractstate.cpp5
-rw-r--r--src/corelib/statemachine/qabstractstate_p.h4
-rw-r--r--src/corelib/statemachine/qabstracttransition.cpp7
-rw-r--r--src/corelib/statemachine/qabstracttransition_p.h1
-rw-r--r--src/corelib/statemachine/qeventtransition.cpp29
-rw-r--r--src/corelib/statemachine/qeventtransition_p.h3
-rw-r--r--src/corelib/statemachine/qhistorystate.cpp5
-rw-r--r--src/corelib/statemachine/qhistorystate_p.h1
-rw-r--r--src/corelib/statemachine/qsignaltransition.cpp29
-rw-r--r--src/corelib/statemachine/qsignaltransition_p.h3
-rw-r--r--src/corelib/statemachine/qstate.cpp14
-rw-r--r--src/corelib/statemachine/qstate_p.h6
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp65
-rw-r--r--src/corelib/statemachine/qstatemachine_p.h5
-rw-r--r--src/corelib/thread/qmutexpool.cpp20
-rw-r--r--src/corelib/thread/qmutexpool_p.h7
-rw-r--r--src/corelib/tools/qbytearray.cpp2
-rw-r--r--src/corelib/tools/qcontiguouscache.cpp4
-rw-r--r--src/corelib/tools/qcontiguouscache.h8
-rw-r--r--src/corelib/tools/qcryptographichash.cpp2
-rw-r--r--src/corelib/tools/qdatetime.cpp8
-rw-r--r--src/corelib/tools/qeasingcurve.cpp108
-rw-r--r--src/corelib/tools/qline.cpp4
-rw-r--r--src/corelib/tools/qlistdata.cpp6
-rw-r--r--src/corelib/tools/qlocale.cpp12
-rw-r--r--src/corelib/tools/qmap.cpp6
-rw-r--r--src/corelib/tools/qpoint.cpp2
-rw-r--r--src/corelib/tools/qstring.cpp95
-rw-r--r--src/corelib/tools/qstring.h15
-rw-r--r--src/corelib/tools/qstringbuilder.cpp135
-rw-r--r--src/corelib/tools/qstringbuilder.h207
-rw-r--r--src/corelib/tools/qstringlist.cpp2
-rw-r--r--src/corelib/tools/qtimeline.h2
-rw-r--r--src/corelib/tools/tools.pri2
-rw-r--r--src/corelib/xml/qxmlstream.cpp2
-rw-r--r--src/dbus/qdbuserror.cpp2
-rw-r--r--src/dbus/qdbusintegrator.cpp6
-rw-r--r--src/dbus/qdbusmetaobject.cpp2
-rw-r--r--src/dbus/qdbusutil.cpp16
-rw-r--r--src/declarative/canvas/qsimplecanvas.h16
-rw-r--r--src/declarative/canvas/qsimplecanvas_opengl.cpp6
-rw-r--r--src/declarative/canvas/qsimplecanvas_opengl1.cpp8
-rw-r--r--src/declarative/canvas/qsimplecanvasdebugplugin.cpp7
-rw-r--r--src/declarative/canvas/qsimplecanvasitem.cpp6
-rw-r--r--src/declarative/canvas/qsimplecanvasitem.h6
-rw-r--r--src/declarative/debugger/qmldebugclient.cpp2
-rw-r--r--src/declarative/fx/qfxblendedimage.cpp8
-rw-r--r--src/declarative/fx/qfxblendedimage.h4
-rw-r--r--src/declarative/fx/qfxhighlightfilter.cpp4
-rw-r--r--src/declarative/fx/qfximage.cpp39
-rw-r--r--src/declarative/fx/qfximage_p.h2
-rw-r--r--src/declarative/fx/qfxpainteditem.cpp16
-rw-r--r--src/declarative/fx/qfxpainteditem_p.h2
-rw-r--r--src/declarative/fx/qfxparticles.cpp8
-rw-r--r--src/declarative/fx/qfxpixmap.cpp220
-rw-r--r--src/declarative/fx/qfxpixmap.h8
-rw-r--r--src/declarative/fx/qfxrect.cpp80
-rw-r--r--src/declarative/fx/qfxrect.h18
-rw-r--r--src/declarative/fx/qfxrect_p.h2
-rw-r--r--src/declarative/fx/qfxscalegrid.h1
-rw-r--r--src/declarative/fx/qfxtext.cpp56
-rw-r--r--src/declarative/fx/qfxtext_p.h8
-rw-r--r--src/declarative/fx/qfxtextedit.cpp36
-rw-r--r--src/declarative/fx/qfxtextedit.h5
-rw-r--r--src/declarative/fx/qfxtextedit_p.h7
-rw-r--r--src/declarative/fx/qfxwebview.cpp2
-rw-r--r--src/declarative/qml/qmldom.cpp24
-rw-r--r--src/declarative/qml/qmldom.h3
-rw-r--r--src/declarative/qml/qmlparser_p.h1
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp5
-rw-r--r--src/declarative/test/qfxtestobjects.cpp24
-rw-r--r--src/declarative/test/qfxtestobjects.h28
-rw-r--r--src/declarative/util/qperformancelog.h2
-rw-r--r--src/gui/accessible/qaccessiblewidget.cpp19
-rw-r--r--src/gui/animation/qguivariantanimation.cpp5
-rw-r--r--src/gui/dialogs/qfiledialog.cpp21
-rw-r--r--src/gui/dialogs/qfiledialog_win.cpp18
-rw-r--r--src/gui/dialogs/qfilesystemmodel.cpp2
-rw-r--r--src/gui/dialogs/qfontdialog.cpp8
-rw-r--r--src/gui/dialogs/qfontdialog_mac.mm40
-rw-r--r--src/gui/dialogs/qinputdialog.cpp3
-rw-r--r--src/gui/dialogs/qmessagebox.cpp15
-rw-r--r--src/gui/dialogs/qmessagebox.h2
-rw-r--r--src/gui/dialogs/qprintdialog_unix.cpp8
-rw-r--r--src/gui/dialogs/qprintpreviewdialog.cpp6
-rw-r--r--src/gui/embedded/qkbdtty_qws.cpp6
-rw-r--r--src/gui/embedded/qmouse_qws.cpp4
-rw-r--r--src/gui/embedded/qscreen_qws.cpp5
-rw-r--r--src/gui/embedded/qscreenmulti_qws.cpp4
-rw-r--r--src/gui/embedded/qscreentransformed_qws.cpp6
-rw-r--r--src/gui/embedded/qscreenvfb_qws.cpp4
-rw-r--r--src/gui/embedded/qtransportauth_qws.cpp4
-rw-r--r--src/gui/embedded/qunixsocket.cpp32
-rw-r--r--src/gui/embedded/qunixsocketserver.cpp8
-rw-r--r--src/gui/embedded/qwindowsystem_qws.cpp4
-rw-r--r--src/gui/embedded/qwscommand_qws.cpp8
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp831
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h39
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h79
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp33
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp13
-rw-r--r--src/gui/graphicsview/qgraphicsview.h2
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp52
-rw-r--r--src/gui/graphicsview/qgraphicswidget.h11
-rw-r--r--src/gui/graphicsview/qgridlayoutengine.cpp6
-rw-r--r--src/gui/image/qimage.cpp10
-rw-r--r--src/gui/image/qpixmap.cpp95
-rw-r--r--src/gui/image/qpixmap_qws.cpp14
-rw-r--r--src/gui/image/qpixmap_raster.cpp33
-rw-r--r--src/gui/image/qpixmap_win.cpp45
-rw-r--r--src/gui/image/qpixmap_x11.cpp28
-rw-r--r--src/gui/image/qpixmapcache.cpp38
-rw-r--r--src/gui/image/qpixmapcache_p.h2
-rw-r--r--src/gui/image/qpixmapdatafactory_p.h2
-rw-r--r--src/gui/image/qpixmapfilter.cpp1
-rw-r--r--src/gui/image/qxpmhandler.cpp6
-rw-r--r--src/gui/itemviews/qfileiconprovider.cpp3
-rw-r--r--src/gui/itemviews/qheaderview.cpp4
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp3
-rw-r--r--src/gui/itemviews/qitemselectionmodel.cpp2
-rw-r--r--src/gui/itemviews/qlistview.cpp14
-rw-r--r--src/gui/itemviews/qsortfilterproxymodel.cpp3
-rw-r--r--src/gui/itemviews/qstyleditemdelegate.cpp3
-rw-r--r--src/gui/itemviews/qtableview.cpp2
-rw-r--r--src/gui/itemviews/qtreeview.cpp10
-rw-r--r--src/gui/kernel/qapplication_qws.cpp6
-rw-r--r--src/gui/kernel/qapplication_win.cpp77
-rw-r--r--src/gui/kernel/qcocoaapplicationdelegate_mac.mm2
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm28
-rw-r--r--src/gui/kernel/qcocoaview_mac_p.h1
-rw-r--r--src/gui/kernel/qcursor.cpp4
-rw-r--r--src/gui/kernel/qdnd_p.h2
-rw-r--r--src/gui/kernel/qevent.cpp6
-rw-r--r--src/gui/kernel/qkeysequence.cpp4
-rw-r--r--src/gui/kernel/qlayoutengine.cpp2
-rw-r--r--src/gui/kernel/qmime_mac.cpp4
-rw-r--r--src/gui/kernel/qmime_win.cpp10
-rw-r--r--src/gui/kernel/qshortcutmap.cpp4
-rw-r--r--src/gui/kernel/qsound_qws.cpp2
-rw-r--r--src/gui/kernel/qwidget.cpp13
-rw-r--r--src/gui/kernel/qwidget_x11.cpp31
-rw-r--r--src/gui/kernel/qwindowdefs_win.h2
-rw-r--r--src/gui/painting/qbezier.cpp8
-rw-r--r--src/gui/painting/qblendfunctions.cpp59
-rw-r--r--src/gui/painting/qcolor.cpp14
-rw-r--r--src/gui/painting/qcolormap_x11.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_p.h13
-rw-r--r--src/gui/painting/qgraphicssystemfactory_p.h2
-rw-r--r--src/gui/painting/qgraphicssystemplugin_p.h2
-rw-r--r--src/gui/painting/qmatrix.cpp2
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp233
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h1
-rw-r--r--src/gui/painting/qpaintengineex.cpp4
-rw-r--r--src/gui/painting/qpainterpath.cpp10
-rw-r--r--src/gui/painting/qpdf.cpp26
-rw-r--r--src/gui/painting/qpen.cpp2
-rw-r--r--src/gui/painting/qprintengine_pdf.cpp4
-rw-r--r--src/gui/painting/qprintengine_ps.cpp24
-rw-r--r--src/gui/painting/qprinterinfo_unix.cpp4
-rw-r--r--src/gui/painting/qregion.cpp6
-rw-r--r--src/gui/painting/qtessellator.cpp12
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp8
-rw-r--r--src/gui/painting/qtransform.cpp2
-rw-r--r--src/gui/painting/qtransform.h14
-rw-r--r--src/gui/painting/qwindowsurface_x11.cpp2
-rw-r--r--src/gui/statemachine/qbasickeyeventtransition.cpp42
-rw-r--r--src/gui/statemachine/qbasickeyeventtransition_p.h41
-rw-r--r--src/gui/statemachine/qbasicmouseeventtransition.cpp41
-rw-r--r--src/gui/statemachine/qbasicmouseeventtransition_p.h41
-rw-r--r--src/gui/statemachine/qguistatemachine.cpp36
-rw-r--r--src/gui/statemachine/qkeyeventtransition.cpp41
-rw-r--r--src/gui/statemachine/qkeyeventtransition.h41
-rw-r--r--src/gui/statemachine/qmouseeventtransition.cpp41
-rw-r--r--src/gui/statemachine/qmouseeventtransition.h42
-rw-r--r--src/gui/styles/gtksymbols.cpp33
-rw-r--r--src/gui/styles/qcleanlooksstyle.cpp6
-rw-r--r--src/gui/styles/qcommonstyle.cpp6
-rw-r--r--src/gui/styles/qgtkstyle.cpp79
-rw-r--r--src/gui/styles/qplastiquestyle.cpp9
-rw-r--r--src/gui/styles/qstyle.cpp2
-rw-r--r--src/gui/styles/qstyleoption.cpp8
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp19
-rw-r--r--src/gui/text/qcssparser.cpp4
-rw-r--r--src/gui/text/qfont.cpp14
-rw-r--r--src/gui/text/qfont_x11.cpp11
-rw-r--r--src/gui/text/qfontdatabase.cpp4
-rw-r--r--src/gui/text/qfontdatabase_qws.cpp4
-rw-r--r--src/gui/text/qfontdatabase_x11.cpp28
-rw-r--r--src/gui/text/qfontengine.cpp8
-rw-r--r--src/gui/text/qfontengine_ft.cpp2
-rw-r--r--src/gui/text/qfontengine_mac.mm4
-rw-r--r--src/gui/text/qfontengine_p.h6
-rw-r--r--src/gui/text/qfontengine_qpf.cpp8
-rw-r--r--src/gui/text/qfontengine_win.cpp6
-rw-r--r--src/gui/text/qfontengine_x11.cpp5
-rw-r--r--src/gui/text/qfontmetrics.cpp12
-rw-r--r--src/gui/text/qfontsubset.cpp30
-rw-r--r--src/gui/text/qtextcontrol.cpp2
-rw-r--r--src/gui/text/qtextcontrol_p.h2
-rw-r--r--src/gui/text/qtextcursor.cpp57
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp2
-rw-r--r--src/gui/text/qtextengine.cpp42
-rw-r--r--src/gui/text/qtexthtmlparser.cpp2
-rw-r--r--src/gui/text/qtextimagehandler_p.h4
-rw-r--r--src/gui/util/qcompleter.cpp2
-rw-r--r--src/gui/util/qdesktopservices_mac.cpp2
-rw-r--r--src/gui/util/qdesktopservices_x11.cpp4
-rw-r--r--src/gui/util/qsystemtrayicon_win.cpp2
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp6
-rw-r--r--src/gui/widgets/qabstractspinbox.cpp4
-rw-r--r--src/gui/widgets/qcalendarwidget.cpp14
-rw-r--r--src/gui/widgets/qcombobox_p.h2
-rw-r--r--src/gui/widgets/qframe.cpp4
-rw-r--r--src/gui/widgets/qframe_p.h1
-rw-r--r--src/gui/widgets/qlabel.cpp2
-rw-r--r--src/gui/widgets/qlineedit.cpp2
-rw-r--r--src/gui/widgets/qprogressbar.cpp8
-rw-r--r--src/gui/widgets/qpushbutton.cpp3
-rw-r--r--src/gui/widgets/qspinbox.cpp10
-rw-r--r--src/gui/widgets/qtabbar.cpp11
-rw-r--r--src/network/access/qhttp.cpp4
-rw-r--r--src/network/access/qhttpnetworkrequest.cpp4
-rw-r--r--src/network/access/qnetworkaccessfilebackend.cpp2
-rw-r--r--src/network/access/qnetworkcookie.cpp2
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp3
-rw-r--r--src/network/kernel/qauthenticator.cpp4
-rw-r--r--src/network/kernel/qhostaddress.cpp2
-rw-r--r--src/network/kernel/qhostinfo_win.cpp15
-rw-r--r--src/network/kernel/qnetworkinterface.cpp2
-rw-r--r--src/network/kernel/qnetworkproxy.cpp4
-rw-r--r--src/network/kernel/qurlinfo.cpp4
-rw-r--r--src/network/socket/qabstractsocket.cpp34
-rw-r--r--src/network/socket/qhttpsocketengine.cpp4
-rw-r--r--src/network/socket/qlocalsocket.cpp4
-rw-r--r--src/network/socket/qnativesocketengine_p.h37
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp61
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp35
-rw-r--r--src/network/socket/qsocks5socketengine.cpp14
-rw-r--r--src/network/ssl/qsslcertificate.cpp18
-rw-r--r--src/network/ssl/qsslcipher.cpp2
-rw-r--r--src/network/ssl/qsslkey.cpp2
-rw-r--r--src/network/ssl/qsslsocket.cpp16
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp27
-rw-r--r--src/opengl/gl2paintengineex/glgc_shader_source.h289
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp10
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h14
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp467
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager_p.h385
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadersource_p.h383
-rw-r--r--src/opengl/gl2paintengineex/qglgradientcache.cpp31
-rw-r--r--src/opengl/gl2paintengineex/qglgradientcache_p.h8
-rw-r--r--src/opengl/gl2paintengineex/qglpexshadermanager.cpp450
-rw-r--r--src/opengl/gl2paintengineex/qglpexshadermanager_p.h156
-rw-r--r--src/opengl/gl2paintengineex/qglshader.cpp605
-rw-r--r--src/opengl/gl2paintengineex/qglshader_p.h262
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp699
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h113
-rw-r--r--src/opengl/opengl.pro42
-rw-r--r--src/opengl/qegl.cpp81
-rw-r--r--src/opengl/qegl_x11egl.cpp5
-rw-r--r--src/opengl/qgl.cpp391
-rw-r--r--src/opengl/qgl.h2
-rw-r--r--src/opengl/qgl_egl.cpp8
-rw-r--r--src/opengl/qgl_p.h73
-rw-r--r--src/opengl/qgl_win.cpp16
-rw-r--r--src/opengl/qgl_wince.cpp3
-rw-r--r--src/opengl/qgl_x11.cpp152
-rw-r--r--src/opengl/qgl_x11egl.cpp162
-rw-r--r--src/opengl/qglextensions.cpp123
-rw-r--r--src/opengl/qglextensions_p.h328
-rw-r--r--src/opengl/qglframebufferobject.cpp565
-rw-r--r--src/opengl/qglframebufferobject.h49
-rw-r--r--src/opengl/qglpixelbuffer.cpp37
-rw-r--r--src/opengl/qglpixmapfilter.cpp39
-rw-r--r--src/opengl/qpaintengine_opengl.cpp228
-rw-r--r--src/opengl/qpixmapdata_gl.cpp308
-rw-r--r--src/opengl/qpixmapdata_gl_p.h37
-rw-r--r--src/opengl/qwindowsurface_gl.cpp269
-rw-r--r--src/opengl/qwindowsurface_gl_p.h1
-rw-r--r--src/opengl/util/generator.cpp2
-rw-r--r--src/plugins/accessible/widgets/rangecontrols.cpp2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp2
-rw-r--r--src/plugins/gfxdrivers/hybrid/hybridscreen.cpp4
-rw-r--r--src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp4
-rw-r--r--src/plugins/sqldrivers/odbc/odbc.pro8
-rw-r--r--src/qt3support/dialogs/q3filedialog.cpp8
-rw-r--r--src/qt3support/dialogs/q3filedialog_mac.cpp2
-rw-r--r--src/qt3support/dialogs/q3filedialog_win.cpp2
-rw-r--r--src/qt3support/itemviews/q3iconview.cpp6
-rw-r--r--src/qt3support/network/q3dns.cpp16
-rw-r--r--src/qt3support/network/q3ftp.cpp22
-rw-r--r--src/qt3support/network/q3http.cpp8
-rw-r--r--src/qt3support/network/q3url.cpp61
-rw-r--r--src/qt3support/network/q3urloperator.cpp2
-rw-r--r--src/qt3support/other/q3dragobject.cpp11
-rw-r--r--src/qt3support/other/q3process.cpp2
-rw-r--r--src/qt3support/other/q3process_unix.cpp2
-rw-r--r--src/qt3support/other/q3process_win.cpp10
-rw-r--r--src/qt3support/painting/q3paintengine_svg.cpp48
-rw-r--r--src/qt3support/text/q3richtext.cpp28
-rw-r--r--src/qt3support/text/q3textedit.cpp4
-rw-r--r--src/qt3support/widgets/q3mainwindow.cpp18
-rw-r--r--src/script/qscriptcontext.cpp2
-rw-r--r--src/script/qscriptcontext_p.cpp6
-rw-r--r--src/script/qscriptecmaerror.cpp6
-rw-r--r--src/script/qscriptecmafunction.cpp2
-rw-r--r--src/script/qscriptecmaglobal.cpp2
-rw-r--r--src/script/qscriptecmaobject.cpp2
-rw-r--r--src/script/qscriptparser.cpp4
-rw-r--r--src/script/qscriptprettypretty.cpp108
-rw-r--r--src/script/qscriptsyntaxchecker.cpp4
-rw-r--r--src/script/qscriptvalueimpl.cpp10
-rw-r--r--src/script/qscriptxmlgenerator.cpp10
-rw-r--r--src/scripttools/debugging/qscriptcompletiontask.cpp10
-rw-r--r--src/scripttools/debugging/qscriptdebuggerbackend.cpp2
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsole.cpp4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp2
-rw-r--r--src/scripttools/debugging/qscriptenginedebugger.cpp13
-rw-r--r--src/sql/drivers/db2/qsql_db2.cpp2
-rw-r--r--src/sql/drivers/ibase/qsql_ibase.cpp6
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.cpp14
-rw-r--r--src/sql/drivers/oci/qsql_oci.cpp28
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp21
-rw-r--r--src/sql/drivers/psql/qsql_psql.cpp22
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp4
-rw-r--r--src/sql/drivers/sqlite2/qsql_sqlite2.cpp6
-rw-r--r--src/sql/drivers/tds/qsql_tds.cpp6
-rw-r--r--src/sql/kernel/qsqldriver.cpp18
-rw-r--r--src/sql/kernel/qsqlerror.cpp2
-rw-r--r--src/sql/kernel/qsqlfield.cpp4
-rw-r--r--src/sql/kernel/qsqlrecord.cpp2
-rw-r--r--src/sql/models/qsqlrelationaltablemodel.cpp2
-rw-r--r--src/svg/qsvggenerator.cpp79
-rw-r--r--src/testlib/qbenchmark_p.h2
-rw-r--r--src/testlib/qbenchmarkvalgrind.cpp10
-rw-r--r--src/testlib/qplaintestlogger.cpp4
-rw-r--r--src/testlib/qsignaldumper.cpp10
-rw-r--r--src/tools/idc/main.cpp6
-rw-r--r--src/tools/moc/generator.cpp4
-rw-r--r--src/tools/moc/moc.cpp6
-rw-r--r--src/tools/moc/preprocessor.cpp2
-rw-r--r--src/tools/uic/cpp/cppwriteicondata.cpp4
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp6
-rw-r--r--src/tools/uic3/embed.cpp2
-rw-r--r--src/tools/uic3/form.cpp84
-rw-r--r--src/tools/uic3/main.cpp2
-rw-r--r--src/tools/uic3/parser.cpp12
-rw-r--r--src/tools/uic3/qt3to4.cpp2
-rw-r--r--src/tools/uic3/subclassing.cpp36
-rw-r--r--src/tools/uic3/ui3reader.cpp24
-rw-r--r--src/winmain/qtmain_win.cpp4
-rw-r--r--src/xml/dom/qdom.cpp7
-rw-r--r--src/xml/sax/qxml.cpp12
-rw-r--r--src/xmlpatterns/acceltree/qacceltree.cpp14
-rw-r--r--src/xmlpatterns/api/qsourcelocation.cpp2
-rw-r--r--src/xmlpatterns/data/qabstractfloat.cpp2
-rw-r--r--src/xmlpatterns/data/qcommonvalues.cpp2
-rw-r--r--src/xmlpatterns/expr/qexpression_p.h2
-rw-r--r--tests/auto/_networkselftest/_networkselftest.pro6
-rw-r--r--tests/auto/_networkselftest/tst_networkselftest.cpp592
-rw-r--r--tests/auto/auto.pro4
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp8
-rw-r--r--tests/auto/qdate/tst_qdate.cpp26
-rw-r--r--tests/auto/qeasingcurve/tst_qeasingcurve.cpp204
-rw-r--r--tests/auto/qfile/copy-fallback.qrc (renamed from examples/animation/research/sound/sound.qrc)2
-rw-r--r--tests/auto/qfile/test/test.pro2
-rw-r--r--tests/auto/qfile/tst_qfile.cpp37
-rw-r--r--tests/auto/qfiledialog/tst_qfiledialog.cpp33
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp162
-rw-r--r--tests/auto/qimage/tst_qimage.cpp28
-rw-r--r--tests/auto/qitemdelegate/tst_qitemdelegate.cpp78
-rw-r--r--tests/auto/qmake/tst_qmake.cpp16
-rw-r--r--tests/auto/qobject/tst_qobject.cpp81
-rw-r--r--tests/auto/qpixmapcache/tst_qpixmapcache.cpp8
-rw-r--r--tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp77
-rw-r--r--tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp10
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp634
-rw-r--r--tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp38
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp30
-rw-r--r--tests/benchmarks/qgraphicsitem/qgraphicsitem.pro6
-rw-r--r--tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp170
-rw-r--r--tests/benchmarks/qgraphicsview/images/wine-big.jpegbin0 -> 12249 bytes
-rw-r--r--tests/benchmarks/qgraphicsview/qgraphicsview.qrc1
-rw-r--r--tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp102
-rw-r--r--tests/benchmarks/qstring/main.cpp123
-rw-r--r--tests/benchmarks/qstring/qstring.pro4
-rw-r--r--tests/benchmarks/qstringbuilder/main.cpp304
-rw-r--r--tests/benchmarks/qstringbuilder/qstringbuilder.pro16
-rw-r--r--tools/assistant/tools/assistant/centralwidget.cpp166
-rw-r--r--tools/assistant/tools/assistant/centralwidget.h10
-rw-r--r--tools/assistant/tools/assistant/main.cpp2
-rw-r--r--tools/assistant/translations/qt_help.pro3
-rw-r--r--tools/assistant/translations/translations.pro3
-rw-r--r--tools/configure/configureapp.cpp1
-rw-r--r--tools/designer/src/components/formeditor/formwindow.cpp5
-rw-r--r--tools/designer/src/components/formeditor/qdesigner_resource.cpp155
-rw-r--r--tools/designer/src/lib/shared/newformwidget.cpp5
-rw-r--r--tools/designer/src/lib/shared/qdesigner_formbuilder.cpp14
-rw-r--r--tools/designer/src/lib/shared/qdesigner_formbuilder_p.h17
-rw-r--r--tools/designer/src/lib/shared/qdesigner_toolbar.cpp16
-rw-r--r--tools/designer/src/lib/shared/qsimpleresource.cpp133
-rw-r--r--tools/designer/src/lib/shared/qsimpleresource_p.h17
-rw-r--r--tools/linguist/lconvert/main.cpp24
-rw-r--r--tools/linguist/linguist/mainwindow.cpp2
-rw-r--r--tools/linguist/linguist/phrase.cpp12
-rw-r--r--tools/linguist/lupdate/java.cpp13
-rw-r--r--tools/linguist/lupdate/merge.cpp6
-rw-r--r--tools/linguist/shared/profileevaluator.cpp4
-rw-r--r--tools/linguist/shared/proparserutils.h2
-rw-r--r--tools/linguist/shared/translator.cpp20
-rw-r--r--tools/linguist/shared/translator.h3
-rw-r--r--tools/pixeltool/qpixeltool.cpp4
-rw-r--r--tools/porting/src/logger.cpp6
-rw-r--r--tools/qdoc3/codeparser.cpp13
-rw-r--r--tools/qdoc3/config.cpp2
-rw-r--r--tools/qdoc3/cppcodeparser.cpp22
-rw-r--r--tools/qdoc3/doc.cpp1984
-rw-r--r--tools/qdoc3/doc.h177
-rw-r--r--tools/qdoc3/htmlgenerator.cpp18
-rw-r--r--tools/qdoc3/main.cpp54
-rw-r--r--tools/qdoc3/test/classic.css12
-rw-r--r--tools/shared/qttoolbardialog/qttoolbardialog.cpp6
-rw-r--r--translations/assistant_da.ts1166
-rw-r--r--translations/linguist_ja.qmbin30494 -> 36145 bytes
-rw-r--r--translations/linguist_ja.ts466
-rw-r--r--translations/qt_da.ts7745
-rw-r--r--translations/qt_de.ts162
-rw-r--r--translations/qt_help_da.ts387
-rw-r--r--translations/qt_ru.qmbin60815 -> 107081 bytes
-rw-r--r--translations/qt_ru.ts3034
-rw-r--r--translations/translations.pri2
-rw-r--r--util/normalize/main.cpp22
709 files changed, 23926 insertions, 16663 deletions
diff --git a/bin/snapshot b/bin/snapshot
deleted file mode 100644
index b9a64e1..0000000
--- a/bin/snapshot
+++ /dev/null
@@ -1,359 +0,0 @@
-#!/usr/bin/perl -w
-######################################################################
-#
-#
-######################################################################
-
-# use packages -------------------------------------------------------
-use File::Basename;
-use File::Path;
-use Cwd;
-use Config;
-use strict;
-
-my $targetPath = "";
-my $qtdir = $ENV{"QTDIR"};
-
-my @class_renames = (
- "QAbstractAnimation",
- "QAnimationGroup",
- "QParallelAnimationGroup",
- "QSequentialAnimationGroup",
- "QEasingCurve",
- "QVariantAnimation",
- "QPropertyAnimation",
- "QItemAnimation",
- "QPauseAnimation",
- "QAbstractState",
- "QAbstractStateGroup",
- "QAbstractTransition",
- "QActionState",
- "QEventTransition",
- "QFinalState",
- "QHistoryState",
- "QParallelStateGroup",
- "QSignalEvent",
- "QSignalTransition",
- "QState",
- "QStateAction",
- "QStateInvokeMethodAction",
- "QStateFinishedEvent",
- "QStateFinishedTransition",
- "QStateMachine",
- "QTransition",
- "QMouseEventTransition",
- "QBasicMouseEventTransition",
- "QKeyEventTransition",
- "QBasicKeyEventTransition",
- "QGraphicsWidget",
- "QBoundEvent");
-
-my @files = (
- "3rdparty/easing/easing.cpp",
- "corelib/tools/qeasingcurve.h",
- "corelib/tools/qeasingcurve.cpp",
- "corelib/animation/animation.pri",
- "corelib/animation/qabstractanimation.cpp",
- "corelib/animation/qabstractanimation.h",
- "corelib/animation/qabstractanimation_p.h",
- "corelib/animation/qvariantanimation.cpp",
- "corelib/animation/qvariantanimation.h",
- "corelib/animation/qanimationgroup.cpp",
- "corelib/animation/qvariantanimation_p.h",
- "corelib/animation/qanimationgroup.h",
- "corelib/animation/qanimationgroup_p.h",
- "corelib/animation/qparallelanimationgroup.cpp",
- "corelib/animation/qparallelanimationgroup.h",
- "corelib/animation/qparallelanimationgroup_p.h",
- "corelib/animation/qpauseanimation.cpp",
- "corelib/animation/qpauseanimation.h",
- "corelib/animation/qpropertyanimation.cpp",
- "corelib/animation/qpropertyanimation.h",
- "corelib/animation/qpropertyanimation_p.h",
- "corelib/animation/qsequentialanimationgroup.cpp",
- "corelib/animation/qsequentialanimationgroup.h",
- "corelib/animation/qsequentialanimationgroup_p.h",
- "gui/animation/qguivariantanimation.cpp",
- "gui/animation/animation.pri",
-
- "corelib/statemachine/statemachine.pri",
- "corelib/statemachine/qabstractstate.cpp",
- "corelib/statemachine/qabstractstate.h",
- "corelib/statemachine/qabstractstate_p.h",
- "corelib/statemachine/qabstracttransition.cpp",
- "corelib/statemachine/qabstracttransition.h",
- "corelib/statemachine/qabstracttransition_p.h",
- "corelib/statemachine/qactionstate.h",
- "corelib/statemachine/qactionstate_p.h",
- "corelib/statemachine/qactionstate.cpp",
- "corelib/statemachine/qboundevent_p.h",
- "corelib/statemachine/qeventtransition.cpp",
- "corelib/statemachine/qeventtransition.h",
- "corelib/statemachine/qeventtransition_p.h",
- "corelib/statemachine/qfinalstate.cpp",
- "corelib/statemachine/qfinalstate.h",
- "corelib/statemachine/qhistorystate.cpp",
- "corelib/statemachine/qhistorystate.h",
- "corelib/statemachine/qhistorystate_p.h",
- "corelib/statemachine/qsignalevent.h",
- "corelib/statemachine/qsignaleventgenerator_p.h",
- "corelib/statemachine/qsignaltransition.cpp",
- "corelib/statemachine/qsignaltransition.h",
- "corelib/statemachine/qsignaltransition_p.h",
- "corelib/statemachine/qstate.cpp",
- "corelib/statemachine/qstate.h",
- "corelib/statemachine/qstateaction.cpp",
- "corelib/statemachine/qstateaction.h",
- "corelib/statemachine/qstateaction_p.h",
- "corelib/statemachine/qstatefinishedevent.h",
- "corelib/statemachine/qstatefinishedtransition.cpp",
- "corelib/statemachine/qstatefinishedtransition.h",
- "corelib/statemachine/qstatemachine.cpp",
- "corelib/statemachine/qstatemachine.h",
- "corelib/statemachine/qstatemachine_p.h",
- "corelib/statemachine/qstate_p.h",
- "corelib/statemachine/qactiontransition.cpp",
- "corelib/statemachine/qactiontransition.h",
- "corelib/statemachine/qactiontransition_p.h",
- "gui/statemachine/qkeyeventtransition.h",
- "gui/statemachine/qkeyeventtransition.cpp",
- "gui/statemachine/qbasickeyeventtransition.cpp",
- "gui/statemachine/qbasickeyeventtransition_p.h",
- "gui/statemachine/qbasicmouseeventtransition.cpp",
- "gui/statemachine/qbasicmouseeventtransition_p.h",
- "gui/statemachine/qguistatemachine.cpp",
- "gui/statemachine/qkeyeventtransition.cpp",
- "gui/statemachine/qkeyeventtransition.h",
- "gui/statemachine/qmouseeventtransition.cpp",
- "gui/statemachine/qmouseeventtransition.h",
- "gui/statemachine/statemachine.pri", # needs special handling
- );
-
-
-while ( @ARGV ) {
- my $arg = shift @ARGV;
- if ("$arg" eq "-to") {
- $targetPath = shift @ARGV;
- }
-}
-
-if ($targetPath eq "") {
- die("missing -to option");
-}
-
-my $projectXML = "$targetPath\\files.xml";
-open(OXML, "> " . $projectXML) || die "Could not open $projectXML for writing (no write permission?)";
-
-print "COPYING SOURCES...\n";
-foreach my $files(@files) {
- copyFile("$qtdir/src/$files","$targetPath/src", 1);
-}
-copyFile("$qtdir/doc/src/animation.qdoc","$targetPath/doc", 0);
-copyFile("$qtdir/doc/src/statemachine.qdoc","$targetPath/doc", 0);
-copyFile("$qtdir/src/3rdparty/easing/legal.qdoc","$targetPath/doc", 0);
-
-copyFile("$qtdir/doc/src/snippets/code/src_corelib_tools_qeasingcurve.cpp","$targetPath/doc/src/snippets/code", 0);
-
-
-my %animation_examples = (
- easing => [ "easing.pro",
- "main.cpp",
- "window.cpp",
- "window.h",
- "animation.h",
- "form.ui",
- "images/qt-logo.png",
- "resources.qrc"],
- moveblocks => [ "moveblocks.pro",
- "main.cpp" ],
- animatedtiles => [ "animatedtiles.pro",
- "animatedtiles.qrc",
- "main.cpp",
- "images/*"],
- "sub-attaq" => ["sub-attaq.pro",
- "animationmanager.cpp",
- "animationmanager.h",
- "boat.cpp",
- "boat_p.h",
- "boat.h",
- "bomb.cpp",
- "bomb.h",
- "custompropertyanimation.h",
- "custompropertyanimation.cpp",
- "graphicsscene.cpp",
- "graphicsscene.h",
- "main.cpp",
- "mainwindow.cpp",
- "mainwindow.h",
- "pics/scalable/*",
- "pics/big/*.png",
- "pics/big/explosion/boat/*",
- "pics/big/explosion/submarine/*",
- "pics/small/*",
- "pics/welcome/*",
- "pixmapitem.cpp",
- "pixmapitem.h",
- "subattaq.qrc",
- "submarine.cpp",
- "submarine.h",
- "submarine_p.h",
- "states.cpp",
- "states.h",
- "qanimationstate.cpp",
- "qanimationstate.h",
- "torpedo.cpp",
- "torpedo.h",
- "data.xml"],
- "stickman" => ["stickman.pro",
- "main.cpp",
- "animation.cpp",
- "animation.h",
- "graphicsview.cpp",
- "graphicsview.h",
- "lifecycle.cpp",
- "lifecycle.h",
- "node.cpp",
- "node.h",
- "stickman.cpp",
- "stickman.h",
- "editor/*",
- "animations/chilling",
- "animations/dancing",
- "animations/dead",
- "animations/jumping"]
- );
-
-my $exDir;
-print "COPYING EXAMPLES...\n";
-for $exDir ( keys %animation_examples ) {
- print " $exDir...\n";
- my $i = 0;
- for $i ( 0 .. $#{ $animation_examples{$exDir} } ) {
- my $ex_file = $animation_examples{$exDir}[$i];
-
- my $copyTargetPath;
- my $glob = 0;
- if (index($ex_file,"/") > 0) {
- my($basefile, $fullPath) = fileparse("$targetPath/examples/$exDir/$ex_file");
- if (index($basefile, "*") >= 0) {
- $glob = 1;
- }
- mkpath "$fullPath", 0777 unless(-e "$fullPath");
- $copyTargetPath = "$fullPath";
- } else {
- $copyTargetPath = "$targetPath/examples/$exDir";
- }
- my $lastCh = substr($copyTargetPath, length($copyTargetPath) - 1, 1);
- if ($lastCh eq "/" || $lastCh eq "\\") {
- chop($copyTargetPath);
- }
-
- if ($glob eq 1) {
- my @globFiles = < $qtdir/examples/animation/$exDir/$ex_file >;
- foreach my $globFile(@globFiles) {
- copyFile("$globFile", "$copyTargetPath", 0);
- }
- } else {
- copyFile("$qtdir/examples/animation/$exDir/$ex_file", "$copyTargetPath", 0);
- }
- }
-}
-
-close OXML;
-print("Finished!");
-
-
-######################################################################
-# Syntax: copyFile(gitfile, destinationPath)
-# Params: gitfile, string, filename to create duplicate for
-# destinationPath, string, destination name of duplicate
-# autoRename, int, 0: Don't rename
-# 1: The file should be renamed to have the "qt" prefix
-#
-#
-# Purpose: Copies to the solutions area.
-# Returns: --
-# Warning: Dies if script cannot get write access.
-######################################################################
-sub copyFile
-{
- my ($gitfile, $destinationPath, $autoRename) = @_;
- # Bi-directional synchronization
- open( I, "< " . $gitfile ) || die "Could not open $gitfile for reading";
- local $/;
- binmode I;
- my $filecontents = <I>;
- my ($baseFileName, $path, $ext) = fileparse($gitfile, qr/\.[^.]*/);
- if ($ext eq ".h" or $ext eq ".cpp" or $ext eq ".qdoc") {
- # both public and private classes
- foreach my $qtClass(@class_renames) {
- my $solutionClass = $qtClass;
- $solutionClass =~s/^Q/Qt/g;
- $filecontents =~s/$qtClass/$solutionClass/g;
- my $qtFilename = lc($qtClass);
- my $solutionFilename = lc($solutionClass);
- $filecontents =~s/(#\s*include\s+["])$qtFilename/${1}$solutionFilename/g;
- }
-
- $filecontents =~s/Q_CORE_EXPORT/Q_ANIMATION_EXPORT/g;
- $filecontents =~s/Q_GUI_EXPORT/Q_ANIMATION_EXPORT/g;
- $filecontents =~s/class Q_GUI_EXPORT/class/g;
- $filecontents =~s/class Q_AUTOTEST_EXPORT/class/g;
-
- # moc stuff
- $filecontents =~s/(#\s*include\s+["])moc_q/${1}moc_qt/g;
-
- $filecontents =~s/\\since 4\.[0-9]//g;
- $filecontents =~s/\\ingroup [a-z]+//g;
-
- if (substr($filecontents, 0, 10) eq "/*********") {
- my $endOfComment = index($filecontents, "*/");
- $filecontents = substr($filecontents, $endOfComment + 2);
- }
- }
- if ($ext eq ".pri" ) {
- $filecontents =~s/\$\$PWD\/q/\$\$PWD\/qt/g;
- $filecontents =~s/animation\/q/\$\$PWD\/qt/g;
-
- # oooh such a hack this is
- if ($baseFileName eq "statemachine") {
- if (index($gitfile, "corelib/statemachine") >= 0) {
- $baseFileName = "corelib_statemachine";
- }
- if (index($gitfile, "gui/statemachine") >= 0) {
- $baseFileName = "gui_statemachine";
- }
- }
- if ($baseFileName eq "animation") {
- if (index($gitfile, "corelib/animation") >= 0) {
- $baseFileName = "corelib_animation";
- }
- if (index($gitfile, "gui/animation") >= 0) {
- $baseFileName = "gui_animation";
- }
- }
-
- }
-
- if ($ext eq ".pro") {
- $filecontents = "$filecontents\ninclude(../../src/qtanimationframework.pri)\n";
- }
- close I;
-
- mkpath $destinationPath, 0777 unless(-e "$destinationPath");
-
- if ($autoRename eq 1 and ($ext eq ".h" or $ext eq ".cpp" or $ext eq ".qdoc")) {
- $baseFileName =~s/^q/qt/g;
- }
- my $targetFile = "$destinationPath/$baseFileName$ext";
- open(O, "> " . $targetFile) || die "Could not open $targetFile for writing (no write permission?)";
- local $/;
- binmode O;
- print O $filecontents;
- close O;
-
- my $xmlEntry = substr($targetFile, length($targetPath) + 1);
- print "$xmlEntry\n";
- print OXML "<add>$xmlEntry</add>\n";
-}
-
diff --git a/bin/syncqt b/bin/syncqt
index 8f797e8..cd99288 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -23,7 +23,6 @@ my $basedir = $ENV{"QTDIR"};
$basedir =~ s=\\=/=g;
my %modules = ( # path to module name map
"QtGui" => "$basedir/src/gui",
- "QtAnimation" => "$basedir/src/animation",
"QtOpenGL" => "$basedir/src/opengl",
"QtCore" => "$basedir/src/corelib",
"QtXml" => "$basedir/src/xml",
@@ -682,7 +681,6 @@ foreach (@modules_to_sync) {
foreach(split(/ /, "$1")) {
$master_contents .= "#include <QtCore/QtCore>\n" if("$_" eq "core");
$master_contents .= "#include <QtGui/QtGui>\n" if("$_" eq "gui");
- $master_contents .= "#include <QtAnimation/QtAnimation>\n" if("$_" eq "experimental-animation");
$master_contents .= "#include <QtNetwork/QtNetwork>\n" if("$_" eq "network");
$master_contents .= "#include <QtSvg/QtSvg>\n" if("$_" eq "svg");
$master_contents .= "#include <QtDeclarative/QtDeclarative>\n" if("$_" eq "declarative");
diff --git a/config.tests/unix/iodbc/iodbc.cpp b/config.tests/unix/iodbc/iodbc.cpp
new file mode 100644
index 0000000..6b64e12
--- /dev/null
+++ b/config.tests/unix/iodbc/iodbc.cpp
@@ -0,0 +1,7 @@
+#include <sql.h>
+#include <sqlext.h>
+
+int main(int, char **)
+{
+ return 0;
+}
diff --git a/config.tests/unix/iodbc/iodbc.pro b/config.tests/unix/iodbc/iodbc.pro
new file mode 100644
index 0000000..465a9a7
--- /dev/null
+++ b/config.tests/unix/iodbc/iodbc.pro
@@ -0,0 +1,4 @@
+SOURCES = iodbc.cpp
+CONFIG -= qt dylib
+mac:CONFIG -= app_bundle
+LIBS += -liodbc
diff --git a/configure b/configure
index 448176f..d909c2a 100755
--- a/configure
+++ b/configure
@@ -202,7 +202,7 @@ earlyArgParse()
VAL=$1
fi
;;
- h|help|--help|-help)
+ -h|help|--help|-help)
if [ "$VAL" = "yes" ]; then
OPT_HELP="$VAL"
COMMERCIAL_USER="no" #doesn't matter we will display the help
@@ -717,6 +717,7 @@ QT_LFLAGS_MYSQL=
QT_LFLAGS_MYSQL_R=
QT_CFLAGS_SQLITE=
QT_LFLAGS_SQLITE=
+QT_LFLAGS_ODBC="-lodbc"
# flags for libdbus-1
QT_CFLAGS_DBUS=
@@ -2716,23 +2717,24 @@ fi
if [ "$PLATFORM_MAC" = "yes" ]; then
# check -arch arguments for validity.
ALLOWED="x86 ppc x86_64 ppc64 i386"
- for i in $CFG_MAC_ARCHS
+ # Save the list so we can re-write it using only valid values
+ CFG_MAC_ARCHS_IN="$CFG_MAC_ARCHS"
+ CFG_MAC_ARCHS=
+ for i in $CFG_MAC_ARCHS_IN
do
if echo "$ALLOWED" | grep -w -v "$i" > /dev/null 2>&1; then
echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64";
exit 2;
fi
- done
-
-# replace "i386" with "x86" to support configuring with -arch i386 as an alias for x86.
- CFG_MAC_ARCHS="${CFG_MAC_ARCHS/i386/x86}"
-
-# Build commmand line arguments we can pass to the compiler during configure tests
-# by prefixing each arch with "-arch".
- CFG_MAC_ARCHS_GCC_FORMAT="${CFG_MAC_ARCHS/x86/i386}"
- CFG_MAC_ARCHS_GCC_FORMAT="${CFG_MAC_ARCHS/i386_64/x86_64}"
- for ARCH in $CFG_MAC_ARCHS_GCC_FORMAT; do
- MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch $ARCH"
+ if [ "$i" = "i386" -o "$i" = "x86" ]; then
+ # These are synonymous values
+ # CFG_MAC_ARCHS requires x86 while GCC requires i386
+ CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86"
+ MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch i386"
+ else
+ CFG_MAC_ARCHS="$CFG_MAC_ARCHS $i"
+ MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch $i"
+ fi
done
fi
@@ -4145,14 +4147,14 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)"
EXTRA_OBJS="qsettings_mac.o qcore_mac.o"
EXTRA_SRCS="\"$relpath/src/corelib/io/qsettings_mac.cpp\" \"$relpath/src/corelib/kernel/qcore_mac.cpp\""
- if echo "$CFG_MAC_ARCHS" | grep x86 > /dev/null 2>&1; then
+ if echo "$CFG_MAC_ARCHS" | grep x86 > /dev/null 2>&1; then # matches both x86 and x86_64
X86_CFLAGS="-arch i386"
X86_LFLAGS="-arch i386"
EXTRA_CFLAGS="$X86_CFLAGS $EXTRA_CFLAGS"
EXTRA_CXXFLAGS="$X86_CFLAGS $EXTRA_CXXFLAGS"
EXTRA_LFLAGS="$EXTRA_LFLAGS $X86_LFLAGS"
fi
- if echo "$CFG_MAC_ARCHS" | grep ppc > /dev/null 2>&1; then
+ if echo "$CFG_MAC_ARCHS" | grep ppc > /dev/null 2>&1; then # matches both ppc and ppc64
PPC_CFLAGS="-arch ppc"
PPC_LFLAGS="-arch ppc"
EXTRA_CFLAGS="$PPC_CFLAGS $EXTRA_CFLAGS"
@@ -4445,14 +4447,21 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
CFG_SQL_odbc=plugin
fi
else
- if [ "$CFG_SQL_odbc" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
- echo "ODBC support cannot be enabled due to functionality tests!"
- echo " Turn on verbose messaging (-v) to $0 to see the final report."
- echo " If you believe this message is in error you may use the continue"
- echo " switch (-continue) to $0 to continue."
- exit 101
+ if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iodbc "iODBC" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_ARCHS_COMMANDLINE; then
+ QT_LFLAGS_ODBC="-liodbc"
+ if [ "$CFG_SQL_odbc" = "auto" ]; then
+ CFG_SQL_odbc=plugin
+ fi
else
- CFG_SQL_odbc=no
+ if [ "$CFG_SQL_odbc" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
+ echo "ODBC support cannot be enabled due to functionality tests!"
+ echo " Turn on verbose messaging (-v) to $0 to see the final report."
+ echo " If you believe this message is in error you may use the continue"
+ echo " switch (-continue) to $0 to continue."
+ exit 101
+ else
+ CFG_SQL_odbc=no
+ fi
fi
fi
fi
@@ -6704,6 +6713,9 @@ fi
if [ -n "$QT_LFLAGS_SQLITE" ]; then
echo "QT_LFLAGS_SQLITE = $QT_LFLAGS_SQLITE" >> "$CACHEFILE.tmp"
fi
+if [ -n "$QT_LFLAGS_ODBC" ]; then
+ echo "QT_LFLAGS_ODBC = $QT_LFLAGS_ODBC" >> "$CACHEFILE.tmp"
+fi
if [ "$QT_EDITION" != "QT_EDITION_OPENSOURCE" ]; then
echo "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" >> "$CACHEFILE.tmp"
diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml
index 96a3e80..2560848 100644
--- a/demos/qtdemo/xml/examples.xml
+++ b/demos/qtdemo/xml/examples.xml
@@ -19,6 +19,15 @@
<example filename="mediaplayer" name="Media Player" />
<example filename="boxes" name="Boxes" />
</demos>
+ <category dirname="animation" name="Animation Framework">
+ <example filename="animatedtiles" name="Animated Tiles" />
+ <example filename="appchooser" name="Appchooser" />
+ <example filename="easing" name="Easing Curves" />
+ <example filename="moveblocks" name="Moving Blocks" />
+ <example filename="states" name="UI States" />
+ <example filename="stickman" name="Stickman" />
+ <example filename="sub-attaq" name="Sub-attaq" />
+ </category>
<category dirname="qtconcurrent" name="Concurrent Programming">
<example filename="map" name="Map" executable="false" />
<example filename="progressdialog" name="Progress Dialog" />
@@ -167,6 +176,12 @@
<example filename="masterdetail" name="Music Archive" />
<example filename="sqlwidgetmapper" name="SQL Widget Mapper" />
</category>
+ <category dirname="statemachine" name="State Machine">
+ <example filename="eventtransitions" name="Event Transitions" />
+ <example filename="tankgame" name="Tank Game" />
+ <example filename="trafficlight" name="Traffic Light" />
+ <example filename="twowaybutton" name="Two-way Button" />
+ </category>
<category dirname="threads" name="Threading">
<example filename="mandelbrot" name="Mandelbrot" />
</category>
diff --git a/demos/spreadsheet/spreadsheetdelegate.cpp b/demos/spreadsheet/spreadsheetdelegate.cpp
index 465c92f..2916757 100644
--- a/demos/spreadsheet/spreadsheetdelegate.cpp
+++ b/demos/spreadsheet/spreadsheetdelegate.cpp
@@ -51,7 +51,7 @@ QWidget *SpreadSheetDelegate::createEditor(QWidget *parent,
{
if (index.column() == 1) {
QDateTimeEdit *editor = new QDateTimeEdit(parent);
- editor->setDisplayFormat("dd/M/yyy");
+ editor->setDisplayFormat("dd/M/yyyy");
editor->setCalendarPopup(true);
return editor;
}
@@ -93,7 +93,7 @@ void SpreadSheetDelegate::setEditorData(QWidget *editor,
if (dateEditor) {
dateEditor->setDate(QDate::fromString(
index.model()->data(index, Qt::EditRole).toString(),
- "d/M/yy"));
+ "d/M/yyyy"));
}
}
}
@@ -107,7 +107,7 @@ void SpreadSheetDelegate::setModelData(QWidget *editor,
} else {
QDateTimeEdit *dateEditor = qobject_cast<QDateTimeEdit *>(editor);
if (dateEditor) {
- model->setData(index, dateEditor->date().toString("dd/M/yyy"));
+ model->setData(index, dateEditor->date().toString("dd/M/yyyy"));
}
}
}
diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2
index b3e808f..1e00208 100644
--- a/dist/changes-4.5.2
+++ b/dist/changes-4.5.2
@@ -42,8 +42,8 @@ Third party components
Memory (r41527, r43764, r43828, r43830)
JavaScript (r39882, r40086, r40131, r40133)
Rendering (r41285, r41296, r41659, r42887)
- Network (r41664, r42516)
- Plugins (r41346, r43550)
+ Network (r41664, r42516, r42747)
+ Plugins (r41346, r43550, r43915, r43917, r43923)
Clipboard (r41360)
****************************************************************************
diff --git a/doc/src/animation.qdoc b/doc/src/animation.qdoc
index 7a4e778..5675185 100644
--- a/doc/src/animation.qdoc
+++ b/doc/src/animation.qdoc
@@ -271,10 +271,10 @@
\code
QPushButton *bonnie = new QPushButton("Bonnie");
- bonnie.show();
+ bonnie->show();
QPushButton *clyde = new QPushButton("Clyde");
- clyde.show();
+ clyde->show();
QPropertyAnimation *anim1 = new QPropertyAnimation(bonnie, "geometry");
// Set up anim1
diff --git a/doc/src/designer-manual.qdoc b/doc/src/designer-manual.qdoc
index 2706182..ee240b5 100644
--- a/doc/src/designer-manual.qdoc
+++ b/doc/src/designer-manual.qdoc
@@ -58,7 +58,8 @@
and custom plugins allow you to use your own components with \QD.
If you are new to \QD, you can take a look at the
- \l{Getting To Know Qt Designer} document.
+ \l{Getting To Know Qt Designer} document. For a quick tutorial on how to
+ use \QD, refer to \l{A Quick Start to Qt Designer}.
Qt Designer 4.5 boasts a long list of improvements. For a detailed list of
what is new, refer \l{What's New in Qt Designer 4.5}.
@@ -235,6 +236,7 @@
\page designer-to-know.html
\contentspage {Qt Designer Manual}{Contents}
+
\title Getting to Know Qt Designer
\tableofcontents
@@ -298,12 +300,12 @@
\row
\i \inlineimage designer-widget-box.png
\i \bold{Qt Designer's Widget Box}
-
+
The widget box provides a selection of standard Qt widgets, layouts,
and other objects that can be used to create user interfaces on forms.
Each of the categories in the widget box contain widgets with similar
uses or related features.
-
+
\note Since Qt 4.4, new widgets have been included, e.g.,
QPlainTextEdit, QCommandLinkButton, QScrollArea, QMdiArea, and
QWebView.
@@ -357,7 +359,7 @@
using a grid. The coordinates on the screenshot show the position of each
widget within the grid.
- \image addressbook-tutorial-part3-labeled-layout.png
+ \image addressbook-tutorial-part3-labeled-layout.png
\note Inside the grid, the QPushButton objects are actually nested. The
buttons on the right are first placed in a QVBoxLayout; the buttons at the
@@ -366,7 +368,7 @@
To visualize, imagine the layout as a box that shrinks as much as possible,
attempting to \e squeeze your widgets in a neat arrangement, and, at the
- same time, maximize the use of available space.
+ same time, maximize the use of available space.
Qt's layouts help when you:
@@ -408,6 +410,7 @@
\page designer-quick-start.html
\contentspage {Qt Designer Manual}{Contents}
+
\title A Quick Start to Qt Designer
Using \QD involves \bold four basic steps:
@@ -419,16 +422,14 @@
\o Preview the form
\endlist
- \omit
\image rgbController-screenshot.png
- \endomit
- Suppose you would like to design a small widget (see screenshot above)
- that contains the controls needed to manipulate Red, Green and Blue (RGB)
- values -- a type of widget that can be seen everywhere in image
- manipulation programs.
+ Suppose you would like to design a small widget (see screenshot above) that
+ contains the controls needed to manipulate Red, Green and Blue (RGB) values
+ -- a type of widget that can be seen everywhere in image manipulation
+ programs.
- \table
+ \table
\row
\i \inlineimage designer-choosing-form.png
\i \bold{Choosing a Form}
@@ -436,39 +437,32 @@
You start by choosing \gui Widget from the \gui{New Form} dialog.
\endtable
- Then you drag three labels, three spin boxes and three vertical sliders
- on to your form. You can roughly arrange them according to how you would
- like them to be laid out.
- \omit
\table
- \row \o \inlineimage rgbController-widgetBox.png
- \o \inlineimage rgbController-arrangement.png
+ \row
+ \i \inlineimage rgbController-arrangement.png
+ \i \bold{Placing Widgets on a Form}
+
+ Drag three labels, three spin boxes and three vertical sliders on to your
+ form. To change the label's default text, simply double-click on it. You
+ can arrange them according to how you would like them to be laid out.
\endtable
- \endomit
To ensure that they are laid out exactly like this in your program, you
need to place these widgets into a layout. We will do this in groups of
- three. Select the "RED" label. Then, hold down \key Shift while you select
+ three. Select the "RED" label. Then, hold down \key Ctrl while you select
its corresponding spin box and slider. In the \gui{Form} menu, select
\gui{Lay Out in a Grid}.
- \omit
\table
\row
\i \inlineimage rgbController-form-gridLayout.png
\i \inlineimage rgbController-selectForLayout.png
\endtable
- \endomit
Repeat the step for the other two labels along with their corresponding
- spin boxes and sliders as well. Your form will now look similar to the
- screenshot below.
-
- \omit
- \image rgbController-almostLaidOut.png
- \endomit
+ spin boxes and sliders as well.
The next step is to combine all three layouts into one \bold{main layout}.
It is important that your form has a main layout; otherwise, the widgets
@@ -476,24 +470,26 @@
layout, \gui{Right click} anywhere on your form, outside of the three
separate layouts, and select \gui{Lay Out Horizontally}. Alternatively, you
could also select \gui{Lay Out in a Grid} -- you will still see the same
- arrangement.
+ arrangement (shown below).
+
+ \image rgbController-final-layout.png
\note Main layouts cannot be seen on the form. To check if you have a main
layout installed, try resizing your form; your widgets should resize
accordingly.
When you click on the slider and drag it to a certain value, you want the
- spin box to display the slider's position. To do this, you need to connect
- the slider's \l{QAbstractSlider::}{valueChanged()} signal to the spin box's
- \l{QSpinBox::}{setValue()} slot. You also need to make the reverse
- connections, e.g., connect the spin box's \l{QSpinBox::}{valueChanged()}
- signal to the slider's \l{QAbstractSlider::value()}{setValue()} slot.
+ spin box to display the slider's position. To accomplish this behavior, you
+ need to connect the slider's \l{QAbstractSlider::}{valueChanged()} signal
+ to the spin box's \l{QSpinBox::}{setValue()} slot. You also need to make
+ the reverse connections, e.g., connect the spin box's \l{QSpinBox::}
+ {valueChanged()} signal to the slider's \l{QAbstractSlider::value()}
+ {setValue()} slot.
To do this, you have to switch to \gui{Edit Signals/Slots} mode, either by
pressing \key{F4} or something \gui{Edit Signals/Slots} from the \gui{Edit}
menu.
- \omit
\table
\row
\i \inlineimage rgbController-signalsAndSlots.png
@@ -503,17 +499,19 @@
\gui{Configure Connection} dialog, shown below, will pop up. Select the
correct signal and slot and click \gui OK.
\endtable
- \endomit
- \omit
- \image rgbController-configureConnection.png
- \endomit
+ \image rgbController-configure-connection1.png
Repeat the step (in reverse order), clicking on the spin box and dragging
the cursor towards the slider, to connect the spin box's
\l{QSpinBox::}{valueChanged()} signal to the slider's
\l{QAbstractSlider::value()}{setValue()} slot.
+ You can use the screenshot below as a guide to selecting the correct signal
+ and slot.
+
+ \image rgbController-configure-connection2.png
+
Now that you have successfully connected the objects for the "RED"
component of the RGB Controller, do the same for the "GREEN" and "BLUE"
components as well.
@@ -521,7 +519,6 @@
Since RGB values range between 0 and 255, we need to limit the spin box
and slider to that particular range.
- \omit
\table
\row
\i \inlineimage rgbController-property-editing.png
@@ -532,21 +529,14 @@
\l{QSpinBox::}{maximum} property. Then, click on the first vertical
slider, you will see \l{QAbstractSlider}'s properties. Enter "255" for
the \l{QAbstractSlider::}{maximum} property as well. Repeat this
- process for the remaining spin boxes and sliders.
+ process for the remaining spin boxes and sliders.
\endtable
- \endomit
-
- Now, we preview your form to see how it would look in your application. To
- preview your form, press \key{Ctrl + R} or select \gui Preview from the
- \gui Form menu.
-
- \omit
- \image rgbController-preview.png
- \endomit
- Try dragging the slider - the spin box will mirror its value too (and vice
- versa). Also, you can resize it to see how the layouts used to manage the
- child widgets respond to different window sizes.
+ Now, we preview your form to see how it would look in your application -
+ press \key{Ctrl + R} or select \gui Preview from the \gui Form menu. Try
+ dragging the slider - the spin box will mirror its value too (and vice
+ versa). Also, you can resize it to see how the layouts that are used to
+ manage the child widgets, respond to different window sizes.
*/
@@ -788,11 +778,11 @@
have a \c text property that can also be edited by double-clicking
on the widget or by pressing \gui F2. \QD interprets the backslash
(\\) character specially, enabling newline (\\n) characters to be
- inserted into the text; the \\\\ character sequence is used to
+ inserted into the text; the \\\\ character sequence is used to
insert a single backslash into the text. A context menu can also be
opened while editing, providing another way to insert special
characters and newlines into the text.
- \endlist
+ \endlist
\section2 Dynamic Properties
@@ -804,12 +794,12 @@
\image designer-property-editor-toolbar.png
- To add a dynamic property, clcik on the \gui Add button
+ To add a dynamic property, clcik on the \gui Add button
\inlineimage designer-property-editor-add-dynamic.png
- . To remove it, click on the \gui Remove button
+ . To remove it, click on the \gui Remove button
\inlineimage designer-property-editor-remove-dynamic.png
instead. You can also sort the properties alphabetically and change the
- color groups by clickinig on the \gui Configure button
+ color groups by clickinig on the \gui Configure button
\inlineimage designer-property-editor-configure.png
.
@@ -911,7 +901,7 @@
\section2 Horizontal and Vertical Layouts
-
+
The simplest way to arrange objects on a form is to place them in a
horizontal or vertical layout. Horizontal layouts ensure that the widgets
within are aligned horizontally; vertical layouts ensure that they are
@@ -1138,7 +1128,7 @@
spacers just provide spacing hints to layouts, so they cannot be connected
to other objects.
-
+
\target HighlightedObjects
\table
\row
@@ -1177,7 +1167,7 @@
\image designer-connection-dialog.png
- To complete the connection, select a signal from the source object and a
+ To complete the connection, select a signal from the source object and a
slot from the destination object, then click \key OK. Click \key Cancel if
you wish to abandon the connection.
@@ -1720,22 +1710,22 @@
\i \bold{Resource Files}
Within the resource browser, you can open existing resource files or
- create new ones. Click the \gui{Edit Resources} button
+ create new ones. Click the \gui{Edit Resources} button
\inlineimage designer-edit-resources-button.png
to edit your resources. To reload resources, click on the \gui Reload
- button
+ button
\inlineimage designer-reload-resources-button.png
.
\endtable
Once a resource file is loaded, you can create or remove entries in it
- using the given \gui{Add Files}
- \inlineimage designer-add-resource-entry-button.png
- and \gui{Remove Files}
+ using the given \gui{Add Files}
+ \inlineimage designer-add-resource-entry-button.png
+ and \gui{Remove Files}
\inlineimage designer-remove-resource-entry-button.png
buttons, and specify resources (e.g., images) using the \gui{Add Files}
- button
+ button
\inlineimage designer-add-files-button.png
. Note that these resources must reside within the current resource file's
directory or one of its subdirectories.
@@ -1747,15 +1737,15 @@
\i \inlineimage designer-edit-resource.png
\i \bold{Editing Resource Files}
- Press the
+ Press the
\inlineimage designer-add-resource-entry-button.png
button to add a new resource entry to the file. Then use the
- \gui{Add Files} button
+ \gui{Add Files} button
\inlineimage designer-add-files-button.png
to specify the resource.
You can remove resources by selecting the corresponding entry in the
- resource editor, and pressing the
+ resource editor, and pressing the
\inlineimage designer-remove-resource-entry-button.png
button.
\endtable
@@ -2657,7 +2647,7 @@ pixmap property in the property editor.
QDesignerTaskMenuExtension is useful for custom widgets. It provides an
extension that allows you to add custom menu entries to \QD's task
menu.
-
+
The \l{designer/taskmenuextension}{Task Menu Extension} example
illustrates how to use this class.
@@ -2758,7 +2748,7 @@ pixmap property in the property editor.
function, making it able to create your extension, such as a
\l{designer/containerextension}{MultiPageWidget} container extension.
- You can either create a new QExtensionFactory and reimplement the
+ You can either create a new QExtensionFactory and reimplement the
QExtensionFactory::createExtension() function:
\snippet doc/src/snippets/code/doc_src_designer-manual.qdoc 8
diff --git a/doc/src/emb-fonts.qdoc b/doc/src/emb-fonts.qdoc
index 3ed23c3..86e169d 100644
--- a/doc/src/emb-fonts.qdoc
+++ b/doc/src/emb-fonts.qdoc
@@ -131,7 +131,7 @@
The Qt Prerendered Font (QPF2) is an architecture-independent,
light-weight and non-scalable font format specific to \l{Qt for Embedded Linux}.
- Nokia provides the cross-platform \c makeqpf tool, included in the
+ Nokia provides the cross-platform \l makeqpf tool, included in the
\c tools directory of both \l {Qt} and \l{Qt for Embedded Linux}, which allows
generation of QPF2 files from system fonts.
diff --git a/doc/src/emb-makeqpf.qdoc b/doc/src/emb-makeqpf.qdoc
index ca33eda..8f5d10b 100644
--- a/doc/src/emb-makeqpf.qdoc
+++ b/doc/src/emb-makeqpf.qdoc
@@ -44,7 +44,10 @@
\title makeqpf
\ingroup qt-embedded-linux
- \c makeqpf is not part of Qt 4. However, Qt 4 can still read QPF
- files generated by Qt 2 or 3. To generate QPF files, use makeqpf from Qt 2
- or 3.
+ \c makeqpf is a tool to generate pre-rendered fonts in QPF2 format for use on Embedded Linux.
+
+ Qt 4 can read files in QPF2 format in addition to QPF files generated by older versions of
+ \c makeqpf from Qt 2 or 3.
+
+ \sa {Qt for Embedded Linux Fonts}
*/
diff --git a/doc/src/examples.qdoc b/doc/src/examples.qdoc
index 6603390..c55d29f 100644
--- a/doc/src/examples.qdoc
+++ b/doc/src/examples.qdoc
@@ -86,6 +86,12 @@
\o \l{activeqt/webbrowser}{Web Browser}\raisedaster
\o \l{activeqt/wrapper}{Wrapper}\raisedaster
\endlist
+
+ \section1 Animation
+
+ \list
+ \o \l{animation/stickman}{Stick man}\raisedaster
+ \endlist
\section1 Concurrent Programming
diff --git a/doc/src/examples/stickman.qdoc b/doc/src/examples/stickman.qdoc
new file mode 100644
index 0000000..49f4953
--- /dev/null
+++ b/doc/src/examples/stickman.qdoc
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example animation/stickman
+ \title Stickman Example
+
+ The Stickman example shows how to animate transitions in a state machine to implement key frame
+ animations.
+
+ \image stickman-example.png
+
+ In this example, we will write a small application which animates the joints in a skeleton and
+ projects a stickman figure on top. The stickman can be either "alive" or "dead", and when in the
+ "alive" state, he can be performing different actions defined by key frame animations.
+
+ Animations are implemented as composite states. Each child state of the animation state
+ represents a frame in the animation by setting the position of each joint in the stickman's
+ skeleton to the positions defined for the particular frame. The frames are then bound together
+ with animated transitions that trigger on the source state's polished() signal. Thus, the
+ machine will enter the state representing the next frame in the animation immediately after it
+ has finished animating into the previous frame.
+
+ \image stickman-example1.png
+
+ The states for an animation is constructed by reading a custom animation file format and
+ creating states that assign values to the the "position" properties of each of the nodes in the
+ skeleton graph.
+
+ \snippet examples/animation/stickman/lifecycle.cpp 1
+
+ The states are then bound together with signal transitions that listen to the polished() signal.
+
+ \snippet examples/animation/stickman/lifecycle.cpp 2
+
+ The last frame state is given a transition to the first one, so that the animation will loop
+ until it is interrupted when a transition out from the animation state is taken. To get smooth
+ animations between the different key frames, we set a default animation on the state machine.
+ This is a parallel animation group which contains animations for all the "position" properties
+ and will be selected by default when taking any transition that leads into a state that assigns
+ values to these properties.
+
+ \snippet examples/animation/stickman/lifecycle.cpp 3
+
+ Several such animation states are constructed, and are placed together as children of a top
+ level "alive" state which represents the stickman life cycle. Transitions go from the parent
+ state to the child state to ensure that each of the child states inherit them.
+
+ \image stickman-example2.png
+
+ This saves us the effort of connect every state to every state with identical transitions. The
+ state machine makes sure that transitions between the key frame animations are also smooth by
+ applying the default animation when interrupting one and starting another.
+
+ Finally, there is a transition out from the "alive" state and into the "dead" state. This is
+ a custom transition type called LightningSrikesTransition which samples every second and
+ triggers at random (one out of fifty times on average.)
+
+ \snippet examples/animation/stickman/lifecycle.cpp 4
+
+ When it triggers, the machine will first enter a "lightningBlink" state which uses a timer to
+ pause for a brief period of time while the background color of the scene is white. This gives us
+ a flash effect when the lightning strikes.
+
+ \snippet examples/animation/stickman/lifecycle.cpp 5
+
+ We start and stop a QTimer object when entering and exiting the state. Then we transition into
+ the "dead" state when the timer times out.
+
+ \snippet examples/animation/stickman/lifecycle.cpp 0
+
+ When the machine is in the "dead" state, it will be unresponsive. This is because the "dead"
+ state has no transitions leading out.
+
+ \image stickman-example3.png
+
+*/
diff --git a/doc/src/images/designer-choosing-form.png b/doc/src/images/designer-choosing-form.png
index fa6e470..bee4b29 100644
--- a/doc/src/images/designer-choosing-form.png
+++ b/doc/src/images/designer-choosing-form.png
Binary files differ
diff --git a/doc/src/images/inputdialogs.png b/doc/src/images/inputdialogs.png
index 135c2f6..8bda185 100644
--- a/doc/src/images/inputdialogs.png
+++ b/doc/src/images/inputdialogs.png
Binary files differ
diff --git a/doc/src/images/rgbController-arrangement.png b/doc/src/images/rgbController-arrangement.png
new file mode 100644
index 0000000..d9e8bab
--- /dev/null
+++ b/doc/src/images/rgbController-arrangement.png
Binary files differ
diff --git a/doc/src/images/rgbController-configure-connection1.png b/doc/src/images/rgbController-configure-connection1.png
new file mode 100644
index 0000000..4e5dcf2
--- /dev/null
+++ b/doc/src/images/rgbController-configure-connection1.png
Binary files differ
diff --git a/doc/src/images/rgbController-configure-connection2.png b/doc/src/images/rgbController-configure-connection2.png
new file mode 100644
index 0000000..f3fcc62
--- /dev/null
+++ b/doc/src/images/rgbController-configure-connection2.png
Binary files differ
diff --git a/doc/src/images/rgbController-final-layout.png b/doc/src/images/rgbController-final-layout.png
new file mode 100644
index 0000000..d32a93e
--- /dev/null
+++ b/doc/src/images/rgbController-final-layout.png
Binary files differ
diff --git a/doc/src/images/rgbController-form-gridLayout.png b/doc/src/images/rgbController-form-gridLayout.png
new file mode 100644
index 0000000..c8f3dcf
--- /dev/null
+++ b/doc/src/images/rgbController-form-gridLayout.png
Binary files differ
diff --git a/doc/src/images/rgbController-property-editing.png b/doc/src/images/rgbController-property-editing.png
new file mode 100644
index 0000000..64fc500
--- /dev/null
+++ b/doc/src/images/rgbController-property-editing.png
Binary files differ
diff --git a/doc/src/images/rgbController-screenshot.png b/doc/src/images/rgbController-screenshot.png
new file mode 100644
index 0000000..6019233
--- /dev/null
+++ b/doc/src/images/rgbController-screenshot.png
Binary files differ
diff --git a/doc/src/images/rgbController-selectForLayout.png b/doc/src/images/rgbController-selectForLayout.png
new file mode 100644
index 0000000..7a8e184
--- /dev/null
+++ b/doc/src/images/rgbController-selectForLayout.png
Binary files differ
diff --git a/doc/src/images/rgbController-signalsAndSlots.png b/doc/src/images/rgbController-signalsAndSlots.png
new file mode 100644
index 0000000..2ba3aba
--- /dev/null
+++ b/doc/src/images/rgbController-signalsAndSlots.png
Binary files differ
diff --git a/doc/src/images/stickman-example.png b/doc/src/images/stickman-example.png
new file mode 100644
index 0000000..a40f37b
--- /dev/null
+++ b/doc/src/images/stickman-example.png
Binary files differ
diff --git a/doc/src/images/stickman-example1.png b/doc/src/images/stickman-example1.png
new file mode 100644
index 0000000..1596a68
--- /dev/null
+++ b/doc/src/images/stickman-example1.png
Binary files differ
diff --git a/doc/src/images/stickman-example2.png b/doc/src/images/stickman-example2.png
new file mode 100644
index 0000000..980276a
--- /dev/null
+++ b/doc/src/images/stickman-example2.png
Binary files differ
diff --git a/doc/src/images/stickman-example3.png b/doc/src/images/stickman-example3.png
new file mode 100644
index 0000000..3635ff7
--- /dev/null
+++ b/doc/src/images/stickman-example3.png
Binary files differ
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index f0debdb..2d64dfe 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -153,6 +153,7 @@
<li><a href="overviews.html">All Overviews and HOWTOs</a></li>
<li><a href="gallery.html">Qt Widget Gallery</a></li>
<li><a href="http://doc.trolltech.com/extras/qt43-class-chart.pdf">Class Chart</a></li>
+ <li><a href="qtglobal.html">Qt Global Declarations</a></li>
</ul>
</td>
<td valign="top">
@@ -208,10 +209,10 @@
<td valign="top">
<ul>
<li><a href="http://www.qtsoftware.com/products/add-on-products">Qt Solutions</a></li>
- <li><a href="http://www.qtsoftware.com/products/qt/3rdparty/">Partner Add-ons</a></li>
+ <li><a href="http://www.qtsoftware.com/products/appdev">Partner Add-ons</a></li>
<li><a href="http://qt-apps.org">Third-Party Qt Components (qt-apps.org)</a></li>
- <li><a href="http://www.qtsoftware.com/support/">Support</a></li>
- <li><a href="http://www.qtsoftware.com/support/training/">Training</a></li>
+ <li><a href="http://www.qtsoftware.com/support-services/support-services/">Support</a></li>
+ <li><a href="http://www.qtsoftware.com/support-services/training/">Training</a></li>
</ul>
</td>
<td valign="top">
diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc
index 925a195..6a689f9 100644
--- a/doc/src/installation.qdoc
+++ b/doc/src/installation.qdoc
@@ -738,8 +738,6 @@ in the \l{Qt for Windows CE Requirements} document.
\header \o Minimal \o Normal \o Minimal \o Normal \o Minimal \o Normal \o Minimal \o Normal
\row \o linux-x86-g++ \o GCC 4.2.4 \o 1.7M \o 2.7M \o 3.3M \o 9.9M \o 653K \o 1.1M \o N/A \o 17M
\row \o linux-arm-g++ \o GCC 4.1.1 \o 1.9M \o 3.2M \o 4.1M \o 11M \o 507K \o 1.0M \o N/A \o 17M
- \row \o linux-arm-g++ (thumb)
- \o GCC 4.1.1 \o 1.7M \o 2.8M \o 4.0M \o 9.8M \o 409K \o 796K \o N/A \o 17M
\row \o linux-mips-g++ (MIPS32)
\o GCC 4.2.4 \o 2.0M \o 3.2M \o 4.5M \o 12M \o 505K \o 1003K \o N/A \o 21M
\endtable
diff --git a/doc/src/phonon-api.qdoc b/doc/src/phonon-api.qdoc
index dd37fe2..5deb64e 100644
--- a/doc/src/phonon-api.qdoc
+++ b/doc/src/phonon-api.qdoc
@@ -1032,6 +1032,7 @@
\value Stream The MediaSource object describes a data stream.
This is the type used for \l{QIODevice}s. Note
that a stream opened with a QUrl, will still be of the Url type.
+ \value Empty The media source doesn't have a source.
\sa MediaSource::type()
*/
@@ -2026,6 +2027,15 @@
*/
/*!
+ \fn void Phonon::MediaObject::clear()
+
+ Stops and removes all playing and enqueued media sources.
+
+ \sa setCurrentSource()
+*/
+
+
+/*!
\fn void Phonon::MediaObject::stateChanged(Phonon::State newstate, Phonon::State oldstate)
This signal is emitted when the state of the MediaObject has changed.
@@ -3027,6 +3037,12 @@
*/
/*!
+ \typedef Phonon::AudioOutputInterface
+ \inmodule Phonon
+ \internal
+*/
+
+/*!
\class Phonon::AudioOutputInterface40
\inmodule Phonon
\since 4.4
@@ -3251,7 +3267,19 @@
/*!
\fn bool Phonon::Path::operator!=(const Path &p) const;
- Returns true if this Path is not equal to \a p; otherwise returns false;
+ Returns true if this Path is not equal to \a p; otherwise returns false.
+*/
+
+/*!
+ \fn MediaNode *Phonon::Path::source() const;
+
+ Returns the source MediaNode used by the path.
+*/
+
+/*!
+ \fn MediaNode *Phonon::Path::sink() const;
+
+ Returns the sink MediaNode used by the path.
*/
/*!
@@ -4878,7 +4906,7 @@
*/
/*!
- \typedef typedef void (*CleanUpFunction)()
+ \typedef Phonon::CleanUpFunction
\inmodule Phonon
\internal
*/
diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc
index 65f9b5d..b66ebee 100644
--- a/doc/src/qnamespace.qdoc
+++ b/doc/src/qnamespace.qdoc
@@ -528,6 +528,10 @@
Qt::DirectConnection; otherwise the
signal is queued, as with
Qt::QueuedConnection.
+ \value UniqueConnection Same as AutoConnection, but there will be a check that the signal is
+ not already connected to the same slot before connecting, otherwise,
+ the connection will fail.
+ \since 4.6
With queued connections, the parameters must be of types that are known to
Qt's meta-object system, because Qt needs to copy the arguments to store them
diff --git a/doc/src/qset.qdoc b/doc/src/qset.qdoc
index 2d12661..a168800 100644
--- a/doc/src/qset.qdoc
+++ b/doc/src/qset.qdoc
@@ -695,11 +695,12 @@
*/
/*!
- \typedef QSet::iterator::iterator_category
- \typedef QSet::const_iterator::iterator_category
+ \typedef QSet::iterator::iterator_category
+ \typedef QSet::const_iterator::iterator_category
- \internal
-*/
+ Synonyms for \e {std::bidirectional_iterator_tag} indicating
+ these iterators are bidirectional iterators.
+ */
/*!
\typedef QSet::iterator::difference_type
diff --git a/doc/src/signalsandslots.qdoc b/doc/src/signalsandslots.qdoc
index 5432bd4..29c8215 100644
--- a/doc/src/signalsandslots.qdoc
+++ b/doc/src/signalsandslots.qdoc
@@ -178,9 +178,13 @@
looping in the case of cyclic connections (e.g., if
\c{b.valueChanged()} were connected to \c{a.setValue()}).
- A signal is emitted for every connection you make; if you
- duplicate a connection, two signals will be emitted. You can
- always break a connection using QObject::disconnect().
+ By default, for every connection you make, a signal is emitted;
+ two signals are emitted for duplicate connections. You can break
+ all of these connections with a single disconnect() call.
+ If you pass the Qt::UniqueConnection \a type, the connection will only
+ be made if it is not a duplicate. If there is already a duplicate
+ (exact same signal to the exact same slot on the same objects),
+ the connection will fail and connect will return false
This example illustrates that objects can work together without needing to
know any information about each other. To enable this, the objects only
@@ -218,8 +222,8 @@
will continue immediately, and the slots will be executed later.
If several slots are connected to one signal, the slots will be
- executed one after the other, in an arbitrary order, when the signal
- is emitted.
+ executed one after the other, in the order they have been connected,
+ when the signal is emitted.
Signals are automatically generated by the \l moc and must not be
implemented in the \c .cpp file. They can never have return types
diff --git a/doc/src/snippets/animation/sequential/icons.qrc b/doc/src/snippets/animation/sequential/icons.qrc
new file mode 100644
index 0000000..d55f797
--- /dev/null
+++ b/doc/src/snippets/animation/sequential/icons.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+ <file>icons/left.png</file>
+ <file>icons/right.png</file>
+ </qresource>
+</RCC>
diff --git a/doc/src/snippets/animation/sequential/icons/left.png b/doc/src/snippets/animation/sequential/icons/left.png
new file mode 100644
index 0000000..5dd8da0
--- /dev/null
+++ b/doc/src/snippets/animation/sequential/icons/left.png
Binary files differ
diff --git a/doc/src/snippets/animation/sequential/icons/right.png b/doc/src/snippets/animation/sequential/icons/right.png
new file mode 100644
index 0000000..ac61326
--- /dev/null
+++ b/doc/src/snippets/animation/sequential/icons/right.png
Binary files differ
diff --git a/doc/src/snippets/animation/sequential/main.cpp b/doc/src/snippets/animation/sequential/main.cpp
new file mode 100644
index 0000000..aff8f29
--- /dev/null
+++ b/doc/src/snippets/animation/sequential/main.cpp
@@ -0,0 +1,50 @@
+#include <QApplication>
+#include <QLabel>
+#include <QPropertyAnimation>
+#include <QSequentialAnimationGroup>
+#include "tracer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QWidget window;
+ window.resize(720, 96);
+ window.show();
+
+ QLabel *label1 = new QLabel(&window);
+ label1->setPixmap(QPixmap(":/icons/left.png"));
+ label1->move(16, 16);
+ label1->show();
+
+ QLabel *label2 = new QLabel(&window);
+ label2->setPixmap(QPixmap(":/icons/right.png"));
+ label2->move(320, 16);
+ label2->show();
+
+ QPropertyAnimation *anim1 = new QPropertyAnimation(label1, "pos");
+ anim1->setDuration(2500);
+ anim1->setStartValue(QPoint(16, 16));
+ anim1->setEndValue(QPoint(320, 16));
+
+ QPropertyAnimation *anim2 = new QPropertyAnimation(label2, "pos");
+ anim2->setDuration(2500);
+ anim2->setStartValue(QPoint(320, 16));
+ anim2->setEndValue(QPoint(640, 16));
+
+ QSequentialAnimationGroup group;
+ group.addAnimation(anim1);
+ group.addAnimation(anim2);
+
+ Tracer tracer(&window);
+
+ QObject::connect(anim1, SIGNAL(valueChanged(QVariant)),
+ &tracer, SLOT(recordValue(QVariant)));
+ QObject::connect(anim2, SIGNAL(valueChanged(QVariant)),
+ &tracer, SLOT(recordValue(QVariant)));
+ QObject::connect(anim1, SIGNAL(finished()), &tracer, SLOT(checkValue()));
+ QObject::connect(anim2, SIGNAL(finished()), &tracer, SLOT(checkValue()));
+
+ group.start();
+ return app.exec();
+}
diff --git a/doc/src/snippets/animation/sequential/sequential.pro b/doc/src/snippets/animation/sequential/sequential.pro
new file mode 100644
index 0000000..fcf017f
--- /dev/null
+++ b/doc/src/snippets/animation/sequential/sequential.pro
@@ -0,0 +1,4 @@
+HEADERS = tracer.h
+RESOURCES = icons.qrc
+SOURCES = main.cpp \
+ tracer.cpp
diff --git a/doc/src/snippets/animation/sequential/tracer.cpp b/doc/src/snippets/animation/sequential/tracer.cpp
new file mode 100644
index 0000000..49bd51e
--- /dev/null
+++ b/doc/src/snippets/animation/sequential/tracer.cpp
@@ -0,0 +1,25 @@
+#include <QAbstractAnimation>
+#include <QDebug>
+#include <QPoint>
+#include "tracer.h"
+
+Tracer::Tracer(QObject *parent)
+ : QObject(parent)
+{
+}
+
+void Tracer::checkValue()
+{
+ QAbstractAnimation *animation = static_cast<QAbstractAnimation *>(sender());
+ if (time != animation->duration()) {
+ qDebug() << "Animation's last recorded time" << time;
+ qDebug() << "Expected" << animation->duration();
+ }
+}
+
+void Tracer::recordValue(const QVariant &value)
+{
+ QAbstractAnimation *animation = static_cast<QAbstractAnimation *>(sender());
+ this->value = value;
+ time = animation->currentTime();
+}
diff --git a/doc/src/snippets/animation/sequential/tracer.h b/doc/src/snippets/animation/sequential/tracer.h
new file mode 100644
index 0000000..1adb018
--- /dev/null
+++ b/doc/src/snippets/animation/sequential/tracer.h
@@ -0,0 +1,23 @@
+#ifndef TRACER_H
+#define TRACER_H
+
+#include <QObject>
+#include <QVariant>
+
+class Tracer : public QObject
+{
+ Q_OBJECT
+
+public:
+ Tracer(QObject *parent = 0);
+
+public slots:
+ void checkValue();
+ void recordValue(const QVariant &value);
+
+private:
+ QVariant value;
+ int time;
+};
+
+#endif
diff --git a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
index a57de9d..d9e38ed 100644
--- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
+++ b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
@@ -6,7 +6,7 @@ public:
{
qreal penWidth = 1;
return QRectF(-10 - penWidth / 2, -10 - penWidth / 2,
- 20 + penWidth / 2, 20 + penWidth / 2);
+ 20 + penWidth, 20 + penWidth);
}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
diff --git a/doc/src/snippets/picture/picture.cpp b/doc/src/snippets/picture/picture.cpp
index 07cedbf..be171c6 100644
--- a/doc/src/snippets/picture/picture.cpp
+++ b/doc/src/snippets/picture/picture.cpp
@@ -66,7 +66,7 @@ int main()
QPicture picture;
picture.load("drawing.pic"); // load picture
QPainter painter;
- painter.begin(&myWidget); // paint in myWidget
+ painter.begin(&myImage); // paint in myImage
painter.drawPicture(0, 0, picture); // draw the picture at (0,0)
painter.end(); // painting done
//! [1]
diff --git a/doc/src/tools-list.qdoc b/doc/src/tools-list.qdoc
index 7af9936..caef268 100644
--- a/doc/src/tools-list.qdoc
+++ b/doc/src/tools-list.qdoc
@@ -58,12 +58,10 @@
\o Translate applications to reach international markets.
\row \o \l{qmake Manual}{qmake}
\o Create makefiles from simple platform-independent project files (\c .pro files).
- \omit
- \row \o \l{emb-qvfb.html}{qvfb}
+ \row \o \l{The Virtual Framebuffer}{qvfb}
\o Run and test embedded applications on the desktop.
- \row \o \l{emb-makeqpf.html}{makeqpf}
+ \row \o \l{makeqpf}
\o Create pre-rendered fonts for embedded devices.
- \endomit
\row \o \l{moc}{Meta-Object Compiler (moc)}
\o Generate meta-object information for QObject subclasses.
\row \o \l{User Interface Compiler (uic)}
diff --git a/doc/src/topics.qdoc b/doc/src/topics.qdoc
index 33bf21a..4cc6617 100644
--- a/doc/src/topics.qdoc
+++ b/doc/src/topics.qdoc
@@ -293,11 +293,9 @@ including ARM, Intel x86, MIPS and SH-4.
\o \l {Qt for Windows CE Requirements}
\o \l {Installing Qt on Windows CE}
\o \l {Windows CE - Introduction to using Qt}{Introduction to using Qt}
- \o \l {Qt Examples#Qt for Embedded Linux}{Examples}
\endlist
\o
\list
- \o \l {Qt for Embedded Linux Classes}{Classes}
\o \l {Windows CE - Using shadow builds}{Using shadow builds}
\o \l {Windows CE - Working with Custom SDKs}{Working with Custom SDKs}
\endlist
diff --git a/examples/animation/README b/examples/animation/README
new file mode 100644
index 0000000..6a892f8
--- /dev/null
+++ b/examples/animation/README
@@ -0,0 +1,38 @@
+The animation framework aims to provide an easy way for creating animated and
+smooth GUI's. By animating Qt properties, the framework provides great freedom
+for animating widgets and other QObjects. The framework can also be used with
+the Graphics View framework.
+
+The example launcher provided with Qt can be used to explore each of the
+examples in this directory.
+
+Documentation for these examples can be found via the Tutorial and Examples
+link in the main Qt documentation.
+
+
+Finding the Qt Examples and Demos launcher
+==========================================
+
+On Windows:
+
+The launcher can be accessed via the Windows Start menu. Select the menu
+entry entitled "Qt Examples and Demos" entry in the submenu containing
+the Qt tools.
+
+On Mac OS X:
+
+For the binary distribution, the qtdemo executable is installed in the
+/Developer/Applications/Qt directory. For the source distribution, it is
+installed alongside the other Qt tools on the path specified when Qt is
+configured.
+
+On Unix/Linux:
+
+The qtdemo executable is installed alongside the other Qt tools on the path
+specified when Qt is configured.
+
+On all platforms:
+
+The source code for the launcher can be found in the demos/qtdemo directory
+in the Qt package. This example is built at the same time as the Qt libraries,
+tools, examples, and demonstrations.
diff --git a/examples/animation/animatedtiles/animatedtiles.pro b/examples/animation/animatedtiles/animatedtiles.pro
index 9e9062c..1840b17 100644
--- a/examples/animation/animatedtiles/animatedtiles.pro
+++ b/examples/animation/animatedtiles/animatedtiles.pro
@@ -1,2 +1,8 @@
-SOURCES += main.cpp
-RESOURCES += animatedtiles.qrc
+SOURCES = main.cpp
+RESOURCES = animatedtiles.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/animation/animatedtiles
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS animatedtiles.pro images
+sources.path = $$[QT_INSTALL_EXAMPLES]/animation/animatedtiles
+INSTALLS += target sources
diff --git a/examples/animation/animatedtiles/main.cpp b/examples/animation/animatedtiles/main.cpp
index a97eaf3..4b1d99d 100644
--- a/examples/animation/animatedtiles/main.cpp
+++ b/examples/animation/animatedtiles/main.cpp
@@ -40,18 +40,7 @@
****************************************************************************/
#include <QtGui>
-#ifdef QT_EXPERIMENTAL_SOLUTION
-# include "qgraphicswidget.h"
-# include "qstate.h"
-# include "qstatemachine.h"
-# include "qabstracttransition.h"
-# include "qgraphicswidget.h"
-# include "qparallelanimationgroup.h"
-# include "qpropertyanimation.h"
-# include "qsignaltransition.h"
-#else
#include <QtCore/qstate.h>
-#endif
class Pixmap : public QObject, public QGraphicsPixmapItem
{
@@ -143,6 +132,8 @@ protected:
int main(int argc, char **argv)
{
+ Q_INIT_RESOURCE(animatedtiles);
+
QApplication app(argc, argv);
QPixmap kineticPix(":/images/kinetic.png");
diff --git a/examples/animation/animation.pro b/examples/animation/animation.pro
index 0a57d3d..9a2874b 100644
--- a/examples/animation/animation.pro
+++ b/examples/animation/animation.pro
@@ -4,9 +4,7 @@ SUBDIRS += \
animatedtiles \
appchooser \
easing \
- example \
moveblocks \
- padnavigator-ng \
states \
stickman \
sub-attaq
diff --git a/examples/animation/appchooser/appchooser.pro b/examples/animation/appchooser/appchooser.pro
index 8cda19a..847b60a 100644
--- a/examples/animation/appchooser/appchooser.pro
+++ b/examples/animation/appchooser/appchooser.pro
@@ -1,6 +1,5 @@
-# Input
-SOURCES += main.cpp
-RESOURCES += appchooser.qrc
+SOURCES = main.cpp
+RESOURCES = appchooser.qrc
# install
target.path = $$[QT_INSTALL_EXAMPLES]/animation/appchooser
diff --git a/examples/animation/appchooser/main.cpp b/examples/animation/appchooser/main.cpp
index 1c63aba..44457f7 100644
--- a/examples/animation/appchooser/main.cpp
+++ b/examples/animation/appchooser/main.cpp
@@ -41,9 +41,6 @@
#include <QtCore>
#include <QtGui>
-#ifdef QT_EXPERIMENTAL_SOLUTION
-#include "qtgraphicswidget.h"
-#endif
class Pixmap : public QGraphicsWidget
diff --git a/examples/animation/easing/animation.h b/examples/animation/easing/animation.h
index c9472e1..d4d699d 100644
--- a/examples/animation/easing/animation.h
+++ b/examples/animation/easing/animation.h
@@ -44,11 +44,7 @@
#include <QtGui>
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qpropertyanimation.h"
-#else
-# include <QtCore/qpropertyanimation.h>
-#endif
+#include <QtCore/qpropertyanimation.h>
class Animation : public QPropertyAnimation {
public:
diff --git a/examples/animation/easing/easing.pro b/examples/animation/easing/easing.pro
index fa5b22d..8e8a35f 100644
--- a/examples/animation/easing/easing.pro
+++ b/examples/animation/easing/easing.pro
@@ -1,16 +1,14 @@
-######################################################################
-# Automatically generated by qmake (2.01a) to 2. okt 23:22:11 2008
-######################################################################
+HEADERS = window.h \
+ animation.h
+SOURCES = main.cpp \
+ window.cpp
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
+FORMS = form.ui
-# Input
-HEADERS += window.h animation.h
-SOURCES += main.cpp window.cpp
+RESOURCES = easing.qrc
-FORMS += form.ui
-
-RESOURCES = resources.qrc
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/animation/easing
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS easing.pro images
+sources.path = $$[QT_INSTALL_EXAMPLES]/animation/easing
+INSTALLS += target sources
diff --git a/examples/animation/easing/resources.qrc b/examples/animation/easing/easing.qrc
index 7e112d3..7e112d3 100644
--- a/examples/animation/easing/resources.qrc
+++ b/examples/animation/easing/easing.qrc
diff --git a/examples/animation/easing/main.cpp b/examples/animation/easing/main.cpp
index 487fa86..bd10df2 100644
--- a/examples/animation/easing/main.cpp
+++ b/examples/animation/easing/main.cpp
@@ -44,6 +44,7 @@
int main(int argc, char **argv)
{
+ Q_INIT_RESOURCE(easing);
QApplication app(argc, argv);
Window w;
w.resize(400, 400);
diff --git a/examples/animation/example/example.pro b/examples/animation/example/example.pro
deleted file mode 100644
index bc79b82..0000000
--- a/examples/animation/example/example.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-######################################################################
-# Automatically generated by qmake (2.01a) Thu Sep 25 14:03:47 2008
-######################################################################
-
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-HEADERS += mainwindow.h
-SOURCES += main.cpp mainwindow.cpp
diff --git a/examples/animation/example/main.cpp b/examples/animation/example/main.cpp
deleted file mode 100644
index 1180b4f..0000000
--- a/examples/animation/example/main.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-#include "mainwindow.h"
-
-int main(int argc, char *argv[])
-{
- //Q_INIT_RESOURCE(example);
- QApplication app(argc, argv);
- MainWindow w;
- w.show();
- return app.exec();
-}
-
diff --git a/examples/animation/example/mainwindow.cpp b/examples/animation/example/mainwindow.cpp
deleted file mode 100644
index 4aff384..0000000
--- a/examples/animation/example/mainwindow.cpp
+++ /dev/null
@@ -1,252 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "mainwindow.h"
-
-MainWindow::MainWindow() : QMainWindow(0)
-{
- // Text edit and button
- listWidget = new QListWidget;
- new QListWidgetItem("Rachel", listWidget);
- new QListWidgetItem("Andreas", listWidget);
- new QListWidgetItem("David", listWidget);
- new QListWidgetItem("Olivier", listWidget);
- new QListWidgetItem("Andy", listWidget);
- new QListWidgetItem("Martial", listWidget);
- new QListWidgetItem("Kazou", listWidget);
- new QListWidgetItem("Fred", listWidget);
- new QListWidgetItem("Ingrid", listWidget);
- QGraphicsProxyWidget *listProxy = new QGraphicsProxyWidget;
- listProxy->setWidget(listWidget);
-
- labelWidget = new QLabel;
- QGraphicsProxyWidget *labelProxy = new QGraphicsProxyWidget;
- labelProxy->setWidget(labelWidget);
- labelWidget->setAttribute(Qt::WA_NoSystemBackground);
-
- label2Widget = new QLabel;
- label2Widget->setAlignment(Qt::AlignCenter);
- QGraphicsProxyWidget *label2Proxy = new QGraphicsProxyWidget;
- label2Proxy->setWidget(label2Widget);
- label2Widget->setAttribute(Qt::WA_NoSystemBackground);
-
- editWidget = new QLineEdit;
- QGraphicsProxyWidget *editProxy = new QGraphicsProxyWidget;
- editProxy->setWidget(editWidget);
- editWidget->setAttribute(Qt::WA_NoSystemBackground);
-
- // Parent widget
- QGraphicsWidget *widget = new QGraphicsWidget;
- // Parent widget
- QGraphicsWidget *widget2 = new QGraphicsWidget;
-
- QGraphicsLinearLayout *vLayout = new QGraphicsLinearLayout(Qt::Vertical, widget);
- vLayout->addItem(listProxy);
- vLayout->addItem(widget2);
- widget->setLayout(vLayout);
-
- QPushButton *button = new QPushButton;
- QGraphicsProxyWidget *buttonProxy = new QGraphicsProxyWidget;
- buttonProxy->setWidget(button);
-
- QPushButton *button2 = new QPushButton;
- QGraphicsProxyWidget *buttonProxy2 = new QGraphicsProxyWidget;
- buttonProxy2->setWidget(button2);
-
- QPushButton *button3 = new QPushButton;
- QGraphicsProxyWidget *buttonProxy3 = new QGraphicsProxyWidget;
- buttonProxy3->setWidget(button3);
-
- QPushButton *button4 = new QPushButton;
- QGraphicsProxyWidget *buttonProxy4 = new QGraphicsProxyWidget;
- buttonProxy4->setWidget(button4);
-
- QGraphicsLinearLayout *hLayout = new QGraphicsLinearLayout(Qt::Horizontal, widget2);
- hLayout->addItem(buttonProxy);
- hLayout->addItem(buttonProxy2);
- hLayout->addItem(buttonProxy3);
- widget2->setLayout(hLayout);
-
- scene = new QGraphicsScene(0, 0, 700, 600);
- scene->setBackgroundBrush(scene->palette().window());
- scene->addItem(widget);
- scene->addItem(editProxy);
- scene->addItem(label2Proxy);
- scene->addItem(labelProxy);
- scene->addItem(buttonProxy4);
-
- machine = new QStateMachine();
-
- group = new QState(machine->rootState());
- state1 = new QState(group);
- state2 = new QState(group);
- state3 = new QState(group);
- group->setInitialState(state1);
-
- machine->setInitialState(group);
-
- // State 1
- state1->assignProperty(button, "text", "Edit");
- state1->assignProperty(button2, "text", "Add");
- state1->assignProperty(button3, "text", "Remove");
- state1->assignProperty(button4, "text", "Accept");
- state1->addTransition(button2, SIGNAL(clicked()), state3);
- state1->assignProperty(listProxy, "geometry", QRectF(0, 0, 700, 560));
- state1->assignProperty(widget, "geometry", QRectF(0, 0, 700, 600));
- state1->assignProperty(editProxy, "opacity", double(0));
- state1->assignProperty(labelProxy, "opacity", double(0));
- state1->assignProperty(label2Proxy, "opacity", double(0));
- state1->assignProperty(buttonProxy4, "opacity", double(0));
- state1->assignProperty(labelWidget, "text", "Name : ");
- state1->assignProperty(label2Widget, "text", "Edit a contact");
- state1->assignProperty(label2Proxy, "geometry", QRectF(375, -50, 300, 30));
- state1->assignProperty(labelProxy, "geometry", QRectF(350, 300, 100, 30));
- state1->assignProperty(editProxy, "geometry", QRectF(750, 300, 250, 30));
- state1->assignProperty(buttonProxy4, "geometry", QRectF(500, 350, 80, 25));
-
- // State 2
- state2->assignProperty(button, "text", "Close Editing");
- state2->assignProperty(listProxy, "geometry", QRectF(0, 0, 350, 560));
- state2->addTransition(button2, SIGNAL(clicked()), state3);
- state2->addTransition(button4, SIGNAL(clicked()), state1);
-
- state2->assignProperty(editProxy, "opacity", double(1));
- state2->assignProperty(labelProxy, "opacity", double(1));
- state2->assignProperty(label2Proxy, "opacity", double(1));
- state2->assignProperty(buttonProxy4, "opacity", double(1));
-
- state2->assignProperty(label2Proxy, "geometry", QRectF(375, 250, 300, 30));
- state2->assignProperty(editProxy, "geometry", QRectF(440, 300, 260, 30));
-
- // State 3
- state3->assignProperty(button4, "text", "Create New");
- state3->assignProperty(listProxy, "geometry", QRectF(0, 0, 350, 560));
- state3->addTransition(button4, SIGNAL(clicked()), state1);
- state3->addTransition(button, SIGNAL(clicked()), state1);
- state3->assignProperty(editProxy, "opacity", double(1));
- state3->assignProperty(labelProxy, "opacity", double(1));
- state3->assignProperty(label2Proxy, "opacity", double(1));
- state3->assignProperty(buttonProxy4, "opacity", double(1));
-
- state3->assignProperty(label2Proxy, "geometry", QRectF(375, 250, 300, 30));
- state3->assignProperty(editProxy, "geometry", QRectF(440, 300, 260, 30));
-
- {
- QAnimationGroup *animationGroup = new QParallelAnimationGroup;
- QVariantAnimation *anim = new QPropertyAnimation(labelProxy, "opacity");
- animationGroup->addAnimation(anim);
- anim = new QPropertyAnimation(label2Proxy, "geometry");
- animationGroup->addAnimation(anim);
- anim = new QPropertyAnimation(editProxy, "geometry");
- animationGroup->addAnimation(anim);
- anim = new QPropertyAnimation(listProxy, "geometry");
- animationGroup->addAnimation(anim);
-
- QAbstractTransition *trans = state1->addTransition(button, SIGNAL(clicked()), state2);
- trans->addAnimation(animationGroup);
- }
-
- {
- QVariantAnimation *anim;
- QAnimationGroup *animationGroup = new QParallelAnimationGroup;
- anim = new QPropertyAnimation(label2Proxy, "geometry");
- animationGroup->addAnimation(anim);
- anim = new QPropertyAnimation(editProxy, "geometry");
- animationGroup->addAnimation(anim);
- anim = new QPropertyAnimation(listProxy, "geometry");
- animationGroup->addAnimation(anim);
- QAbstractTransition *trans = state2->addTransition(button, SIGNAL(clicked()), state1);
- trans->addAnimation(animationGroup);
- }
-
- currentState = state1;
-
- view = new QGraphicsView(scene);
-
- setCentralWidget(view);
-
- QObject::connect(state3, SIGNAL(entered()), this, SLOT(onEnterState3()));
- QObject::connect(state2, SIGNAL(entered()), this, SLOT(onEnterState2()));
- QObject::connect(state1, SIGNAL(entered()), this, SLOT(onEnterState1()));
-
- connect(listWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(onItemClicked(QListWidgetItem*)));
- connect(button3, SIGNAL(clicked()), this, SLOT(onRemoveClicked()));
-
- machine->start();
-}
-
-void MainWindow::onEnterState2()
-{
- currentState = state2;
- if (listWidget->currentItem())
- editWidget->setText(listWidget->currentItem()->text());
-}
-
-void MainWindow::onEnterState1()
-{
- if (currentState == state2 && listWidget->currentItem())
- listWidget->currentItem()->setText(editWidget->text());
- if (currentState == state3 && !editWidget->text().isNull()) {
- new QListWidgetItem(editWidget->text(), listWidget);
- editWidget->clear();
- }
- currentState = state1;
-}
-
-void MainWindow::onEnterState3()
-{
- currentState = state3;
-}
-
-void MainWindow::onItemClicked(QListWidgetItem*)
-{
- if (currentState == state2)
- {
- editWidget->setText(listWidget->currentItem()->text());
- editWidget->clear();
- }
-}
-
-void MainWindow::onRemoveClicked()
-{
- QListWidgetItem *listItem = listWidget->takeItem(listWidget->currentRow());
- delete listItem;
-}
diff --git a/examples/animation/example/mainwindow.h b/examples/animation/example/mainwindow.h
deleted file mode 100644
index 163eb89..0000000
--- a/examples/animation/example/mainwindow.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __MAINWINDOW__H__
-#define __MAINWINDOW__H__
-
-#include <QtGui>
-
-class MainWindow : public QMainWindow
-{
-Q_OBJECT
-public:
- MainWindow();
-
-private slots :
- void onEnterState3();
- void onEnterState2();
- void onEnterState1();
- void onItemClicked(QListWidgetItem*);
- void onRemoveClicked();
-private:
- QListWidget *listWidget;
- QLabel *labelWidget;
- QLabel *label2Widget;
- QLineEdit *editWidget;
- QGraphicsScene *scene;
- QGraphicsView *view;
- QState *state1;
- QState *state2;
- QState *state3;
- QState *currentState;
- QState *group;
- QStateMachine *machine;
-};
-
-#endif //__MAINWINDOW__H__
-
diff --git a/examples/animation/moveblocks/main.cpp b/examples/animation/moveblocks/main.cpp
index 0ce07fc..d315112 100644
--- a/examples/animation/moveblocks/main.cpp
+++ b/examples/animation/moveblocks/main.cpp
@@ -41,16 +41,6 @@
#include <QtCore>
#include <QtGui>
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-#include "qstatemachine.h"
-#include "qstate.h"
-#include "qabstracttransition.h"
-#include "qpropertyanimation.h"
-#include "qsequentialanimationgroup.h"
-#include "qparallelanimationgroup.h"
-#include "qgraphicswidget.h"
-#endif
-#include <time.h>
class StateSwitchEvent: public QEvent
{
@@ -297,7 +287,7 @@ int main(int argc, char **argv)
window.resize(300, 300);
window.show();
- qsrand(time(0));
+ qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
return app.exec();
}
diff --git a/examples/animation/moveblocks/moveblocks.pro b/examples/animation/moveblocks/moveblocks.pro
index 7a82ca5..b8e88b2 100644
--- a/examples/animation/moveblocks/moveblocks.pro
+++ b/examples/animation/moveblocks/moveblocks.pro
@@ -1,8 +1,7 @@
-# Input
-SOURCES += main.cpp
+SOURCES = main.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/animation/moveblocks
-sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS states.pro
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS moveblocks.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/animation/moveblocks
INSTALLS += target sources
diff --git a/examples/animation/padnavigator-ng/backside.ui b/examples/animation/padnavigator-ng/backside.ui
deleted file mode 100644
index afa488c..0000000
--- a/examples/animation/padnavigator-ng/backside.ui
+++ /dev/null
@@ -1,208 +0,0 @@
-<ui version="4.0" >
- <class>BackSide</class>
- <widget class="QWidget" name="BackSide" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>378</width>
- <height>385</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>BackSide</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_2" >
- <item>
- <widget class="QGroupBox" name="groupBox" >
- <property name="title" >
- <string>Settings</string>
- </property>
- <property name="flat" >
- <bool>true</bool>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout" >
- <item row="0" column="0" >
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>Title:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="hostName" >
- <property name="text" >
- <string>Pad Navigator Example</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0" >
- <widget class="QLabel" name="label_2" >
- <property name="text" >
- <string>Modified:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="label_3" >
- <property name="text" >
- <string>Extent</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <layout class="QHBoxLayout" name="horizontalLayout" >
- <item>
- <widget class="QSlider" name="horizontalSlider" >
- <property name="value" >
- <number>42</number>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="spinBox" >
- <property name="value" >
- <number>42</number>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="1" >
- <widget class="QDateTimeEdit" name="dateTimeEdit" />
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="groupBox_2" >
- <property name="title" >
- <string>Other input</string>
- </property>
- <property name="flat" >
- <bool>true</bool>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout_2" >
- <item>
- <widget class="QTreeWidget" name="treeWidget" >
- <column>
- <property name="text" >
- <string>Widgets On Graphics View</string>
- </property>
- </column>
- <item>
- <property name="text" >
- <string>QGraphicsProxyWidget</string>
- </property>
- <item>
- <property name="text" >
- <string>QGraphicsWidget</string>
- </property>
- <item>
- <property name="text" >
- <string>QObject</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>QGraphicsItem</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>QGraphicsLayoutItem</string>
- </property>
- </item>
- </item>
- </item>
- <item>
- <property name="text" >
- <string>QGraphicsGridLayout</string>
- </property>
- <item>
- <property name="text" >
- <string>QGraphicsLayout</string>
- </property>
- <item>
- <property name="text" >
- <string>QGraphicsLayoutItem</string>
- </property>
- </item>
- </item>
- </item>
- <item>
- <property name="text" >
- <string>QGraphicsLinearLayout</string>
- </property>
- <item>
- <property name="text" >
- <string>QGraphicsLayout</string>
- </property>
- <item>
- <property name="text" >
- <string>QGraphicsLayoutItem</string>
- </property>
- </item>
- </item>
- </item>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <tabstops>
- <tabstop>groupBox</tabstop>
- <tabstop>hostName</tabstop>
- <tabstop>dateTimeEdit</tabstop>
- <tabstop>horizontalSlider</tabstop>
- <tabstop>spinBox</tabstop>
- <tabstop>groupBox_2</tabstop>
- <tabstop>treeWidget</tabstop>
- </tabstops>
- <resources/>
- <connections>
- <connection>
- <sender>horizontalSlider</sender>
- <signal>valueChanged(int)</signal>
- <receiver>spinBox</receiver>
- <slot>setValue(int)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>184</x>
- <y>125</y>
- </hint>
- <hint type="destinationlabel" >
- <x>275</x>
- <y>127</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>spinBox</sender>
- <signal>valueChanged(int)</signal>
- <receiver>horizontalSlider</receiver>
- <slot>setValue(int)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>272</x>
- <y>114</y>
- </hint>
- <hint type="destinationlabel" >
- <x>190</x>
- <y>126</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/examples/animation/padnavigator-ng/images/artsfftscope.png b/examples/animation/padnavigator-ng/images/artsfftscope.png
deleted file mode 100644
index b4b8775..0000000
--- a/examples/animation/padnavigator-ng/images/artsfftscope.png
+++ /dev/null
Binary files differ
diff --git a/examples/animation/padnavigator-ng/images/blue_angle_swirl.jpg b/examples/animation/padnavigator-ng/images/blue_angle_swirl.jpg
deleted file mode 100644
index 5bf0deb..0000000
--- a/examples/animation/padnavigator-ng/images/blue_angle_swirl.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/animation/padnavigator-ng/images/kontact_contacts.png b/examples/animation/padnavigator-ng/images/kontact_contacts.png
deleted file mode 100644
index 6fb4cc8..0000000
--- a/examples/animation/padnavigator-ng/images/kontact_contacts.png
+++ /dev/null
Binary files differ
diff --git a/examples/animation/padnavigator-ng/images/kontact_journal.png b/examples/animation/padnavigator-ng/images/kontact_journal.png
deleted file mode 100644
index b1fedb6..0000000
--- a/examples/animation/padnavigator-ng/images/kontact_journal.png
+++ /dev/null
Binary files differ
diff --git a/examples/animation/padnavigator-ng/images/kontact_mail.png b/examples/animation/padnavigator-ng/images/kontact_mail.png
deleted file mode 100644
index 672f8fa..0000000
--- a/examples/animation/padnavigator-ng/images/kontact_mail.png
+++ /dev/null
Binary files differ
diff --git a/examples/animation/padnavigator-ng/images/kontact_notes.png b/examples/animation/padnavigator-ng/images/kontact_notes.png
deleted file mode 100644
index 229bf73..0000000
--- a/examples/animation/padnavigator-ng/images/kontact_notes.png
+++ /dev/null
Binary files differ
diff --git a/examples/animation/padnavigator-ng/images/kopeteavailable.png b/examples/animation/padnavigator-ng/images/kopeteavailable.png
deleted file mode 100644
index 2eaf41a..0000000
--- a/examples/animation/padnavigator-ng/images/kopeteavailable.png
+++ /dev/null
Binary files differ
diff --git a/examples/animation/padnavigator-ng/images/metacontact_online.png b/examples/animation/padnavigator-ng/images/metacontact_online.png
deleted file mode 100644
index 6a398dd..0000000
--- a/examples/animation/padnavigator-ng/images/metacontact_online.png
+++ /dev/null
Binary files differ
diff --git a/examples/animation/padnavigator-ng/images/minitools.png b/examples/animation/padnavigator-ng/images/minitools.png
deleted file mode 100644
index 0248c9d..0000000
--- a/examples/animation/padnavigator-ng/images/minitools.png
+++ /dev/null
Binary files differ
diff --git a/examples/animation/padnavigator-ng/main.cpp b/examples/animation/padnavigator-ng/main.cpp
deleted file mode 100644
index f8b167f..0000000
--- a/examples/animation/padnavigator-ng/main.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-#include "panel.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- Q_INIT_RESOURCE(padnavigator);
-
- Panel panel(3, 3);
- panel.show();
-
- return app.exec();
-}
diff --git a/examples/animation/padnavigator-ng/padnavigator.pro b/examples/animation/padnavigator-ng/padnavigator.pro
deleted file mode 100644
index 0d094c6..0000000
--- a/examples/animation/padnavigator-ng/padnavigator.pro
+++ /dev/null
@@ -1,24 +0,0 @@
-HEADERS += \
- panel.h \
- roundrectitem.h \
- splashitem.h
-
-SOURCES += \
- panel.cpp \
- roundrectitem.cpp \
- splashitem.cpp \
- main.cpp
-
-RESOURCES += \
- padnavigator.qrc
-
-FORMS += \
- backside.ui
-
-contains(QT_CONFIG, opengl):QT += opengl
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/padnavigator
-sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS padnavigator.pro images
-sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/padnavigator
-INSTALLS += target sources
diff --git a/examples/animation/padnavigator-ng/padnavigator.qrc b/examples/animation/padnavigator-ng/padnavigator.qrc
deleted file mode 100644
index 30ee8e1..0000000
--- a/examples/animation/padnavigator-ng/padnavigator.qrc
+++ /dev/null
@@ -1,14 +0,0 @@
-<RCC>
- <qresource>
- <file>images/blue_angle_swirl.jpg</file>
- <file>images/artsfftscope.png</file>
- <file>images/kontact_contacts.png</file>
- <file>images/kontact_journal.png</file>
- <file>images/kontact_mail.png</file>
- <file>images/kontact_notes.png</file>
- <file>images/kopeteavailable.png</file>
- <file>images/metacontact_online.png</file>
- <file>images/minitools.png</file>
- <file>images/blue_angle_swirl.jpg</file>
- </qresource>
-</RCC>
diff --git a/examples/animation/padnavigator-ng/panel.cpp b/examples/animation/padnavigator-ng/panel.cpp
deleted file mode 100644
index e61be0e..0000000
--- a/examples/animation/padnavigator-ng/panel.cpp
+++ /dev/null
@@ -1,246 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "panel.h"
-#include "roundrectitem.h"
-#include "splashitem.h"
-#include "ui_backside.h"
-
-#ifndef QT_NO_OPENGL
-#include <QtOpenGL/QtOpenGL>
-#else
-#endif
-#include <QtGui/QtGui>
-
-Panel::Panel(int width, int height)
- : selectedIndex(0),
- grid(width*height),
- width(width),
- height(height),
- flipped(false),
- flippingGroup(0),
- rotationXanim(0),
- rotationYanim(0)
-{
- setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- setCacheMode(CacheBackground);
- setViewportUpdateMode(FullViewportUpdate);
- setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
- setBackgroundBrush(QPixmap(":/images/blue_angle_swirl.jpg"));
-#ifndef QT_NO_OPENGL
- setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
-#endif
-
- QRectF bounds((-width / 2.0) * 150, (-height / 2.0) * 150, width * 150, height * 150);
-
- setScene(new QGraphicsScene(bounds, this));
-
- baseItem = new RoundRectItem(bounds, QColor(226, 255, 92, 64));
- scene()->addItem(baseItem);
-
- QWidget *embed = new QWidget;
- ui = new Ui_BackSide;
- ui->setupUi(embed);
- ui->hostName->setFocus();
-
- backItem = new RoundRectItem(bounds, embed->palette().window(), embed);
- backItem->setYRotation(180);
- backItem->setParentItem(baseItem);
-
- selectionItem = new RoundRectItem(QRectF(-60, -60, 120, 120), Qt::gray);
- selectionItem->setParentItem(baseItem);
- selectionItem->setZValue(-1);
- selectionItem->setPos(posForLocation(0));
-
- int currentIndex = 0;
- for (int y = 0; y < height; ++y) {
- for (int x = 0; x < width; ++x) {
- RoundRectItem *item = new RoundRectItem(QRectF(-54, -54, 108, 108),
- QColor(214, 240, 110, 128));
- item->setPos(posForLocation(currentIndex));
-
- item->setParentItem(baseItem);
- item->setFlag(QGraphicsItem::ItemIsFocusable);
- grid[currentIndex++] = item;
-
- switch (qrand() % 9) {
- case 0: item->setPixmap(QPixmap(":/images/kontact_contacts.png")); break;
- case 1: item->setPixmap(QPixmap(":/images/kontact_journal.png")); break;
- case 2: item->setPixmap(QPixmap(":/images/kontact_notes.png")); break;
- case 3: item->setPixmap(QPixmap(":/images/kopeteavailable.png")); break;
- case 4: item->setPixmap(QPixmap(":/images/metacontact_online.png")); break;
- case 5: item->setPixmap(QPixmap(":/images/minitools.png")); break;
- case 6: item->setPixmap(QPixmap(":/images/kontact_journal.png")); break;
- case 7: item->setPixmap(QPixmap(":/images/kontact_contacts.png")); break;
- case 8: item->setPixmap(QPixmap(":/images/kopeteavailable.png")); break;
- default:
- break;
- }
-
- connect(item, SIGNAL(activated()), this, SLOT(flip()));
- }
- }
-
- grid.first()->setFocus();
-
- connect(backItem, SIGNAL(activated()),
- this, SLOT(flip()));
-
- splash = new SplashItem;
- splash->setZValue(5);
- splash->setPos(-splash->rect().width() / 2, scene()->sceneRect().top());
- scene()->addItem(splash);
-
- splash->grabKeyboard();
-
- //initialize the position
- baseItem->setYRotation(selectionItem->x()/6.);
- baseItem->setXRotation(selectionItem->y()/6.);
-
- setWindowTitle(tr("Pad Navigator Example"));
-}
-
-Panel::~Panel()
-{
-}
-
-void Panel::keyPressEvent(QKeyEvent *event)
-{
- if (splash->isVisible() || event->key() == Qt::Key_Return || flipped) {
- QGraphicsView::keyPressEvent(event);
- return;
- }
-
- selectedIndex = (selectedIndex + grid.count() + (event->key() == Qt::Key_Right) - (event->key() == Qt::Key_Left)
- + width * ((event->key() == Qt::Key_Down) - (event->key() == Qt::Key_Up))) % grid.count();
- grid[selectedIndex]->setFocus();
-
- const QPointF pos = posForLocation(selectedIndex);
-
- const double angleY = pos.x() / 6.,
- angleX = pos.y() / 6.;
-
- QAnimationGroup *group = new QParallelAnimationGroup();
-
- QVariantAnimation *anim = new QPropertyAnimation(baseItem, "xRotation");
- anim->setEndValue(angleX);
- anim->setDuration(150);
- anim->setEasingCurve(QEasingCurve::OutInSine);
- group->addAnimation(anim);
-
- anim = new QPropertyAnimation(baseItem, "yRotation");
- anim->setEndValue(angleY);
- anim->setDuration(150);
- anim->setEasingCurve(QEasingCurve::OutInSine);
- group->addAnimation(anim);
-
- anim = new QPropertyAnimation(selectionItem, "pos");
- anim->setEndValue(pos);
- anim->setDuration(150);
- anim->setEasingCurve(QEasingCurve::Linear);
- group->addAnimation(anim);
-
- group->start(QAbstractAnimation::DeleteWhenStopped);
-}
-
-void Panel::resizeEvent(QResizeEvent *event)
-{
- QGraphicsView::resizeEvent(event);
- fitInView(scene()->sceneRect(), Qt::KeepAspectRatio);
-}
-
-void Panel::flip()
-{
- grid[selectedIndex]->setFocus();
-
- if (flippingGroup == 0) {
- flippingGroup = new QParallelAnimationGroup(this);
-
- const qreal zoomOut = qreal(.75);
-
- //slight scaling down while flipping
- QVariantAnimation *anim = new QPropertyAnimation(baseItem, "yScale");
- anim->setKeyValueAt(qreal(.5), zoomOut);
- anim->setEndValue(1);
- anim->setEasingCurve(QEasingCurve::OutInSine);
- anim->setDuration(500);
- flippingGroup->addAnimation(anim);
-
- anim = new QPropertyAnimation(baseItem, "xScale");
- anim->setKeyValueAt(qreal(.5), zoomOut);
- anim->setEndValue(1);
- anim->setEasingCurve(QEasingCurve::OutInSine);
- anim->setDuration(500);
- flippingGroup->addAnimation(anim);
-
- rotationXanim = new QPropertyAnimation(baseItem, "xRotation");
- rotationXanim->setEndValue(0);
- rotationXanim->setDuration(500);
- flippingGroup->addAnimation(rotationXanim);
-
- rotationYanim = new QPropertyAnimation(baseItem, "yRotation");
- rotationYanim->setEndValue(180);
- rotationYanim->setDuration(500);
- flippingGroup->addAnimation(rotationYanim);
- }
-
- if (flippingGroup->currentTime() != 0 && flippingGroup->direction() == QAbstractAnimation::Forward) {
- flippingGroup->setDirection(QAbstractAnimation::Backward);
- } else {
- flippingGroup->setDirection(QAbstractAnimation::Forward);
- if (flippingGroup->currentTime() == 0) {
- //we always make sure when it is at the beginning
- rotationXanim->setStartValue(baseItem->xRotation());
- rotationYanim->setStartValue(baseItem->yRotation());
- }
- }
- flippingGroup->start();
- flipped = !flipped;
-}
-
-QPointF Panel::posForLocation(int index) const
-{
- const int x = index % width,
- y = index / width;
- return QPointF(x * 150, y * 150)
- - QPointF((width - 1) * 75, (height - 1) * 75);
-}
diff --git a/examples/animation/padnavigator-ng/panel.h b/examples/animation/padnavigator-ng/panel.h
deleted file mode 100644
index 35d0db5..0000000
--- a/examples/animation/padnavigator-ng/panel.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui/qgraphicsview.h>
-#ifdef QT_EXPERIMENTAL_SOLUTION
-#include "qtgraphicswidget.h"
-#else
-#include <QtGui/qgraphicswidget.h>
-#endif
-
-QT_BEGIN_NAMESPACE
-class Ui_BackSide;
-QT_END_NAMESPACE;
-
-class RoundRectItem;
-class QAnimationGroup;
-class QPropertyAnimation;
-
-class Panel : public QGraphicsView
-{
- Q_OBJECT
-public:
- Panel(int width, int height);
- ~Panel();
-
-protected:
- void keyPressEvent(QKeyEvent *event);
- void resizeEvent(QResizeEvent *event);
-
-private Q_SLOTS:
- void flip();
-
-private:
- QPointF posForLocation(int index) const;
-
- QGraphicsWidget *selectionItem;
- QGraphicsWidget *baseItem;
- RoundRectItem *backItem;
- QGraphicsWidget *splash;
- int selectedIndex;
-
- QVector<QGraphicsItem*> grid;
-
- int width;
- int height;
- bool flipped;
- Ui_BackSide *ui;
-
- QAnimationGroup *flippingGroup;
- QPropertyAnimation *rotationXanim, *rotationYanim;
-};
diff --git a/examples/animation/padnavigator-ng/roundrectitem.cpp b/examples/animation/padnavigator-ng/roundrectitem.cpp
deleted file mode 100644
index 7e7d423..0000000
--- a/examples/animation/padnavigator-ng/roundrectitem.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "roundrectitem.h"
-
-#include <QtGui/QtGui>
-
-RoundRectItem::RoundRectItem(const QRectF &rect, const QBrush &brush, QWidget *embeddedWidget)
- : QGraphicsWidget(),
- brush(brush),
- proxyWidget(0),
- m_rect(rect)
-{
- if (embeddedWidget) {
- proxyWidget = new QGraphicsProxyWidget(this);
- proxyWidget->setFocusPolicy(Qt::StrongFocus);
- proxyWidget->setWidget(embeddedWidget);
- }
-}
-
-void RoundRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
-{
- const bool widgetHidden = parentItem() == 0 || qAbs(static_cast<QGraphicsWidget*>(parentItem())->yRotation()) < 90;
-
- if (proxyWidget) {
- if (widgetHidden) {
- proxyWidget->hide();
- } else {
- if (!proxyWidget->isVisible()) {
- proxyWidget->setGeometry(boundingRect().adjusted(25, 25, -25, -25));
- proxyWidget->show();
- proxyWidget->setFocus();
- }
- painter->setBrush(brush);
- painter->setPen(QPen(Qt::black, 1));
- painter->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
- painter->drawRoundRect(m_rect);
- }
- } else if (widgetHidden) {
- painter->setPen(Qt::NoPen);
- painter->setBrush(QColor(0, 0, 0, 64));
- painter->drawRoundRect(m_rect.translated(2, 2));
-
- QLinearGradient gradient(m_rect.topLeft(), m_rect.bottomRight());
- const QColor col = brush.color();
- gradient.setColorAt(0, col);
- gradient.setColorAt(1, col.dark(200));
- painter->setBrush(gradient);
- painter->setPen(QPen(Qt::black, 1));
- painter->drawRoundRect(m_rect);
- if (!pix.isNull()) {
- painter->scale(qreal(1.95), qreal(1.95));
- painter->drawPixmap(-pix.width() / 2, -pix.height() / 2, pix);
- }
- }
-
-}
-
-QRectF RoundRectItem::boundingRect() const
-{
- qreal penW = qreal(.5);
- qreal shadowW = 2;
- return m_rect.adjusted(-penW, -penW, penW + shadowW, penW + shadowW);
-}
-
-void RoundRectItem::setPixmap(const QPixmap &pixmap)
-{
- pix = pixmap;
- if (scene() && isVisible())
- update();
-}
-
-void RoundRectItem::keyPressEvent(QKeyEvent *event)
-{
- if (event->isAutoRepeat() || event->key() != Qt::Key_Return) {
- QGraphicsWidget::keyPressEvent(event);
- return;
- }
-
- if (!proxyWidget) {
- setXScale(qreal(.9));
- setYScale(qreal(.9));
- }
- emit activated();
-}
-
-void RoundRectItem::keyReleaseEvent(QKeyEvent *event)
-{
- if (event->isAutoRepeat() || event->key() != Qt::Key_Return) {
- QGraphicsWidget::keyReleaseEvent(event);
- return;
- }
-
- if (!proxyWidget) {
- setXScale(1);
- setYScale(1);
- }
-}
diff --git a/examples/animation/padnavigator-ng/roundrectitem.h b/examples/animation/padnavigator-ng/roundrectitem.h
deleted file mode 100644
index fb142c6..0000000
--- a/examples/animation/padnavigator-ng/roundrectitem.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/qobject.h>
-#include <QtGui/qbrush.h>
-#ifdef QT_EXPERIMENTAL_SOLUTION
-#include "qtgraphicswidget.h"
-#else
-#include <QtGui/qgraphicswidget.h>
-#endif
-
-QT_BEGIN_NAMESPACE
-class QGraphicsProxyWidget;
-QT_END_NAMESPACE;
-
-class RoundRectItem : public QGraphicsWidget
-{
- Q_OBJECT
-public:
- RoundRectItem(const QRectF &rect, const QBrush &brush, QWidget *embeddedWidget = 0);
-
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);
- QRectF boundingRect() const;
-
- void setPixmap(const QPixmap &pixmap);
-
-Q_SIGNALS:
- void activated();
-
-protected:
- void keyPressEvent(QKeyEvent *event);
- void keyReleaseEvent(QKeyEvent *event);
-
-private:
- QRectF m_rect;
- QBrush brush;
- QPixmap pix;
- QGraphicsProxyWidget *proxyWidget;
-};
diff --git a/examples/animation/padnavigator-ng/splashitem.cpp b/examples/animation/padnavigator-ng/splashitem.cpp
deleted file mode 100644
index 1264987..0000000
--- a/examples/animation/padnavigator-ng/splashitem.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "splashitem.h"
-
-#include <QtGui/QtGui>
-
-SplashItem::SplashItem(QGraphicsItem *parent)
- : QGraphicsWidget(parent)
-{
-
- text = tr("Welcome to the Pad Navigator Example. You can use the"
- " keyboard arrows to navigate the icons, and press enter"
- " to activate an item. Please press any key to continue.");
- resize(400, 175);
-}
-
-void SplashItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
-{
- painter->setPen(QPen(Qt::black, 2));
- painter->setBrush(QColor(245, 245, 255, 220));
- painter->setClipRect(rect());
- painter->drawRoundRect(3, -100 + 3, 400 - 6, 250 - 6);
-
- QRectF textRect = rect().adjusted(10, 10, -10, -10);
- int flags = Qt::AlignTop | Qt::AlignLeft | Qt::TextWordWrap;
-
- QFont font;
- font.setPixelSize(18);
- painter->setPen(Qt::black);
- painter->setFont(font);
- painter->drawText(textRect, flags, text);
-}
-
-void SplashItem::keyPressEvent(QKeyEvent * /* event */)
-{
- QVariantAnimation *anim = new QPropertyAnimation(this, "pos");
- anim->setEndValue(QPointF(x(), scene()->sceneRect().top() - rect().height()));
- anim->setDuration(350);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
-
- anim = new QPropertyAnimation(this, "opacity");
- anim->setEndValue(0);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
-
- connect(anim, SIGNAL(finished()), SLOT(close()));
-}
diff --git a/examples/animation/padnavigator-ng/splashitem.h b/examples/animation/padnavigator-ng/splashitem.h
deleted file mode 100644
index 05ff040..0000000
--- a/examples/animation/padnavigator-ng/splashitem.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/qobject.h>
-#ifdef QT_EXPERIMENTAL_SOLUTION
-#include "qtgraphicswidget.h"
-#else
-#include <QtGui/qgraphicswidget.h>
-#endif
-
-class SplashItem : public QGraphicsWidget
-{
- Q_OBJECT
-public:
- SplashItem(QGraphicsItem *parent = 0);
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
-
-protected:
- void keyPressEvent(QKeyEvent *event);
-
-private:
- QString text;
-};
diff --git a/examples/animation/research/memberfunctions/main.cpp b/examples/animation/research/memberfunctions/main.cpp
deleted file mode 100644
index 2663f9c..0000000
--- a/examples/animation/research/memberfunctions/main.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-#include "qvalueanimation.h"
-
-AbstractProperty *qGraphicsItemProperty(QGraphicsItem *item, const char *property)
-{
- if (qstrcmp(property, "pos") == 0) {
- return new MemberFunctionProperty<QGraphicsItem, QPointF>(item, &QGraphicsItem::pos, &QGraphicsItem::setPos);
- }
- return 0;
-}
-
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
-
- QGraphicsScene scene;
- QGraphicsView view(&scene);
-
- QGraphicsItem *item = new QGraphicsRectItem(QRectF(0,0, 200, 100));
- scene.addItem(item);
-
- QValueAnimation *posAnim = new QValueAnimation;
- posAnim->setStartValue(QPointF(0,0));
- posAnim->setEndValue(QPointF(400, 0));
- posAnim->setDuration(1000);
- // Alternative 1
- //posAnim->setMemberFunction(item, &QGraphicsItem::pos, &QGraphicsItem::setPos);
-
- // Alternative 2
- //posAnim->setProperty(qMemberFunctionProperty(item, &QGraphicsItem::pos, &QGraphicsItem::setPos));
-
- // Alternative 3
- posAnim->setProperty(qGraphicsItemProperty(item, "pos"));
-
- // Alternative 4, (by implementing the qGraphicsItemProperty QGraphicsItem::property())
- //posAnim->setProperty(item->property("pos"));
-
- // can also do this, which abstracts away the whole property thing.
- // i.e. this interface can also be used for QObject-properties:
- //posAnim->setAnimationProperty(animationProperty);
-
- posAnim->start();
-
- view.resize(800,600);
- view.show();
- return app.exec();
-}
-
diff --git a/examples/animation/research/memberfunctions/memberfunctions.pro b/examples/animation/research/memberfunctions/memberfunctions.pro
deleted file mode 100644
index 6b67895..0000000
--- a/examples/animation/research/memberfunctions/memberfunctions.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-######################################################################
-# Automatically generated by qmake (2.01a) fr 26. sep 13:21:57 2008
-######################################################################
-
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp \
- qvalueanimation.cpp
-HEADERS += qvalueanimation.h
-
-CONFIG += console
-
diff --git a/examples/animation/research/memberfunctions/qvalueanimation.cpp b/examples/animation/research/memberfunctions/qvalueanimation.cpp
deleted file mode 100644
index de0b8ff..0000000
--- a/examples/animation/research/memberfunctions/qvalueanimation.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qvalueanimation.h"
-#include "qvalueanimation_p.h"
-
-QT_BEGIN_NAMESPACE
-
-
-void QValueAnimationPrivate::initDefaultStartValue()
-{
- Q_Q(QValueAnimation);
- if (animProp && !q->startValue().isValid()
- && (currentTime == 0
- || (currentTime == duration && currentLoop == (loopCount - 1)))) {
- setDefaultStartValue(animProp->read());
- }
-}
-
-
-QValueAnimation::QValueAnimation(QObject *parent) : QVariantAnimation(*new QValueAnimationPrivate, parent)
-{
-}
-
-QValueAnimation::~QValueAnimation()
-{
-}
-
-void QValueAnimation::setProperty(AbstractProperty *animProp)
-{
- Q_D(QValueAnimation);
- d->animProp = animProp;
-}
-
-/*!
- \reimp
- */
-void QValueAnimation::updateCurrentValue(const QVariant &value)
-{
- Q_D(QValueAnimation);
- if (state() == QAbstractAnimation::Stopped)
- return;
-
- d->animProp->write(value);
-}
-
-
-/*!
- \reimp
-*/
-void QValueAnimation::updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState)
-{
- Q_D(QValueAnimation);
- // Initialize start value
- if (oldState == QAbstractAnimation::Stopped && newState == QAbstractAnimation::Running)
- d->initDefaultStartValue();
-}
-
-
-
-#include "moc_qvalueanimation.cpp"
-
-QT_END_NAMESPACE
diff --git a/examples/animation/research/memberfunctions/qvalueanimation.h b/examples/animation/research/memberfunctions/qvalueanimation.h
deleted file mode 100644
index 55c4993..0000000
--- a/examples/animation/research/memberfunctions/qvalueanimation.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QVALUEANIMATION_H
-#define QVALUEANIMATION_H
-
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qvariantanimation.h"
-#else
-# include <QtCore/qvariantanimation.h>
-#endif
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGraphicsItem;
-class QValueAnimationPrivate;
-
-QT_MODULE(Gui)
-
-struct AbstractProperty {
- virtual void write(const QVariant &value) = 0;
- virtual QVariant read() const = 0;
-};
-
-# define CALL_MEMBER_FN(object,ptrToMember) ((object)->*(ptrToMember))
-template <typename Target, typename T>
-class MemberFunctionProperty : public AbstractProperty {
-public:
- typedef void (Target::*RefWrite)(const T &);
- typedef T (Target::*ValRead)(void) const;
-
- MemberFunctionProperty(Target *target, ValRead readFunc, RefWrite writeFunc)
- : m_target(target), m_readFn(readFunc), m_writeFn(writeFunc) {}
-
- virtual void write(const QVariant &value) {
- CALL_MEMBER_FN(m_target, m_writeFn)(qVariantValue<T>(value));
- }
-
- virtual QVariant read() const {
- if (m_readFn)
- return qVariantFromValue<T>(CALL_MEMBER_FN(m_target, m_readFn)());
- return QVariant();
- }
-
-private:
- Target *m_target;
- ValRead m_readFn;
- RefWrite m_writeFn;
-};
-
-
-class QValueAnimation : public QVariantAnimation
-{
- Q_OBJECT
-
-public:
- QValueAnimation(QObject *parent = 0);
- ~QValueAnimation();
-
- template <typename Target, typename T>
- void setMemberFunction(Target *target,
- T (Target::*readFunc)(void) const, // ### useValRead typedef
- void (Target::*writeFunc)(const T &) // ### use RefWrite typedef
- ) {
- // ### ownership of MemberFunctionProperty
- AbstractProperty *animProp = new MemberFunctionProperty<Target, T>(target, readFunc, writeFunc);
- setProperty(animProp);
- }
-
- void updateCurrentValue(const QVariant &value);
- void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
- void setProperty(AbstractProperty *animProp);
-
-private:
- Q_DISABLE_COPY(QValueAnimation);
- Q_DECLARE_PRIVATE(QValueAnimation);
-};
-
-#endif // QVALUEANIMATION_H
diff --git a/examples/animation/research/memberfunctions/qvalueanimation_p.h b/examples/animation/research/memberfunctions/qvalueanimation_p.h
deleted file mode 100644
index 55c8ce1..0000000
--- a/examples/animation/research/memberfunctions/qvalueanimation_p.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QVALUEANIMATION_P_H
-#define QVALUEANIMATION_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of QIODevice. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qvariantanimation_p.h> //###
-
-QT_BEGIN_NAMESPACE
-
-class QValueAnimationPrivate : public QVariantAnimationPrivate
-{
- Q_DECLARE_PUBLIC(QValueAnimation)
-public:
- QValueAnimationPrivate() : QVariantAnimationPrivate(), animProp(0)
- {
- }
-
- void initDefaultStartValue();
-
- AbstractProperty *animProp;
-
- //###TODO
-};
-
-QT_END_NAMESPACE
-
-#endif //QVALUEANIMATION_P_H
diff --git a/examples/animation/research/photobrowser/main.cpp b/examples/animation/research/photobrowser/main.cpp
deleted file mode 100644
index d5ab2a3..0000000
--- a/examples/animation/research/photobrowser/main.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-
-#include "river.h"
-#include "menu.h"
-
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
- if (app.arguments().size() == 1) {
- qWarning("you have to specifiy a path to look for the photos");
- return 0;
- }
-
-
- QGraphicsScene scene;
- scene.setSceneRect(QRectF(QPointF(), River::fixedSize()));
-
- QGraphicsView view(&scene);
- view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-
- const int fw = view.frameWidth() * 2;
- view.setFixedSize(River::fixedSize() + QSize(fw,fw));
-
- River river(app.arguments()[1]);
- scene.addItem(&river);
-
- Menu menu(&river);
- menu.addAction(QLatin1String("River Mode"), &river, SLOT(setRiverMode()));
- menu.addAction(QLatin1String("Grid Mode"), &river, SLOT(setGridMode()));
- menu.addAction(QLatin1String("Cover Flow"), &river, SLOT(setCoverMode()));
- menu.addAction(QLatin1String("Hide Menu"), &menu, SLOT(hide()));
- menu.addAction(QLatin1String("Exit"), &app, SLOT(quit()));
- menu.setZValue(2);
- menu.setFocus();
-
- river.menu = &menu;
- view.show();
-
- return app.exec();
-}
diff --git a/examples/animation/research/photobrowser/menu.cpp b/examples/animation/research/photobrowser/menu.cpp
deleted file mode 100644
index 97493ba..0000000
--- a/examples/animation/research/photobrowser/menu.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "menu.h"
-
-Menu::Menu(QGraphicsItem *parent) : QGraphicsWidget(parent), m_selected(0)
-{
- setFlag(QGraphicsItem::ItemIsFocusable);
- m_selection = new QGraphicsRectItem(this);
- QLinearGradient linearGrad(QPointF(0, 0), QPointF(0,50));
- linearGrad.setColorAt(0, QColor(255,255,255,128));
- linearGrad.setColorAt(1, QColor(255,255,255,16));
- m_selection->setBrush(linearGrad);
- m_selection->setPen(QPen(Qt::transparent));
-}
-
-Menu::~Menu()
-{
-}
-
-
-MenuAction *Menu::addAction(const QString &text, QObject *receiver, const char* slot)
-{
- MenuAction *action = new MenuAction(text, this);
- if (!m_actions.isEmpty()) {
- MenuAction *last = m_actions.last();
- action->setPos(last->pos() + last->boundingRect().bottomLeft());
- }
- m_actions.append(action);
- if (m_selection->boundingRect().width() < action->boundingRect().width())
- m_selection->setRect(action->boundingRect());
-
- QObject::connect(action, SIGNAL(triggered()), receiver, slot);
- return action;
-}
-
-QRectF Menu::boundingRect() const
-{
- QRectF res;
- foreach (MenuAction *a, m_actions)
- res |= a->boundingRect();
- return res;
-}
-
-void Menu::keyPressEvent (QKeyEvent * event)
-{
- switch (event->key()) {
- case Qt::Key_Escape:
- hide();
- break;
- case Qt::Key_Up:
- m_selected -= 2;
- case Qt::Key_Down:
- if (!m_actions.isEmpty()) {
- m_selected = (m_selected + 1 + m_actions.count()) % m_actions.count();
- QItemAnimation *anim = new QItemAnimation(m_selection, QItemAnimation::Position);
- anim->setEndValue(m_actions.at(m_selected)->pos());
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- }
- break;
- case Qt::Key_Enter:
- case Qt::Key_Return:
- if (!m_actions.isEmpty()) {
- QItemAnimation *anim = new QItemAnimation(m_selection, QItemAnimation::RotationX);
- anim->setEndValue(m_selection->xRotation() < 180 ? qreal(360) : qreal(0));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- m_actions.at(m_selected)->trigger();
- hide();
- }
- break;
- default:
- QGraphicsItem::keyPressEvent(event);
- }
-}
-
-void Menu::show()
-{
- QItemAnimation *anim = new QItemAnimation(this, QItemAnimation::Opacity);
- anim->setEndValue(qreal(1.));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- anim = new QItemAnimation(m_selection, QItemAnimation::ScaleFactorX);
- anim->setEndValue(qreal(1));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- anim = new QItemAnimation(m_selection, QItemAnimation::ScaleFactorY);
- anim->setEndValue(qreal(1));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- setFocus();
-}
-
-void Menu::hide()
-{
- QItemAnimation *anim = new QItemAnimation(m_selection, QItemAnimation::ScaleFactorX);
- anim->setEndValue(qreal(.1));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- anim = new QItemAnimation(m_selection, QItemAnimation::ScaleFactorY);
- anim->setEndValue(qreal(.1));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- anim = new QItemAnimation(this, QItemAnimation::Opacity);
- anim->setEndValue(qreal(0));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- parentItem()->setFocus();
-}
-
-
-MenuAction::MenuAction(const QString &text, Menu * parent)
- : QGraphicsTextItem(text,parent)
-{
- QFont f = font();
- f.setPointSize(18);
- setFont(f);
- setDefaultTextColor(Qt::white);
-}
-
-void MenuAction::trigger()
-{
- emit triggered();
-}
diff --git a/examples/animation/research/photobrowser/menu.h b/examples/animation/research/photobrowser/menu.h
deleted file mode 100644
index 3bdfe45..0000000
--- a/examples/animation/research/photobrowser/menu.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __MENU__H__
-#define __MENU__H__
-
-#include <QtGui>
-
-class MenuAction;
-
-class Menu : public QGraphicsWidget
-{
- Q_OBJECT
-public:
- Menu(QGraphicsItem *parent);
- ~Menu();
-
- MenuAction *addAction(const QString&, QObject *receiver = 0, const char* slot = 0 );
-
- QRectF boundingRect() const;
- void keyPressEvent ( QKeyEvent * event );
-public slots:
- void show();
- void hide();
-private:
- QList<MenuAction*> m_actions;
- QGraphicsRectItem *m_selection;
- int m_selected;
-};
-
-class MenuAction : public QGraphicsTextItem
-{
- Q_OBJECT
-public:
- MenuAction(const QString &text, Menu * parent);
- void trigger();
-signals:
- void triggered();
-};
-
-
-#endif //__RIVERITEM__H__
diff --git a/examples/animation/research/photobrowser/photobrowser.pro b/examples/animation/research/photobrowser/photobrowser.pro
deleted file mode 100644
index 21f03d6..0000000
--- a/examples/animation/research/photobrowser/photobrowser.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-######################################################################
-# Automatically generated by qmake (2.01a) ven. 22. aot 13:09:33 2008
-######################################################################
-
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp \
- river.cpp \
- riveritem.cpp \
- menu.cpp
-HEADERS += river.h \
- riveritem.h \
- menu.h
diff --git a/examples/animation/research/photobrowser/river.cpp b/examples/animation/research/photobrowser/river.cpp
deleted file mode 100644
index 6760066..0000000
--- a/examples/animation/research/photobrowser/river.cpp
+++ /dev/null
@@ -1,591 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "river.h"
-#include "riveritem.h"
-
-#include "qvariantanimation.h"
-
-#include <QtCore/QDebug>
-#include <QtGui/QKeyEvent>
-#include <QtGui/QGraphicsScene>
-#include <QtGui/QPainter>
-
-
-#define GRID_ROW_COUNT 3
-#define GRID_COLUMN_COUNT 2
-#define GRID_DIMENSIONS (GRID_ROW_COUNT * GRID_COLUMN_COUNT)
-#define ITEM_COUNT 12
-
-#define RIVER_MAGNIFY(ITEM) (qreal(0.50) + (ITEM)->zValue()*2 )
-#define GRID_MAGNIFY qreal(1.5)
-#define GRID_CURRENT_MAGNIFY 2
-
-River::River(const QString &path) :
-m_images(QDir(path).entryInfoList(QStringList() << QLatin1String("*.jpg") << QLatin1String("*.png"))),
-m_currentImage(0), m_mode(RiverMode), m_selectedItem(-1) , m_topLeftIndex(-1)
-{
- setFocusPolicy(Qt::StrongFocus);
- setGeometry(QRectF( QPointF(), fixedSize()));
-
-
- for (int i = 0; i < ITEM_COUNT; ++i) {
- RiverItem * item = new RiverItem(this);
-
- //here we also randomize the x position (not when looping)
- const int x = qrand() % fixedSize().width();
- item->setPos(x, -1);
-
- m_items.insert(m_currentImage, item);
- addUnusedRiverItem(item);
- }
-
-}
-
-QPointF River::gridItemPosition(int row, int col) const
-{
- if (col < 0) {
- col += GRID_COLUMN_COUNT;
- row --;
- }
- return QPointF(rect().width()*(col*2 + 1)/(GRID_COLUMN_COUNT*2),
- rect().height()*(row*2 + 1)/(GRID_ROW_COUNT*2));
-}
-
-QPixmap River::pixmap(int index) const
-{
- if (index < 0 || index >= m_images.size())
- return QPixmap();
-
- if (m_pixmaps.size() <= index) {
- m_pixmaps.resize(index+1);
- }
-
- if (m_pixmaps.at(index).isNull()) {
- m_pixmaps[index] = QPixmap(m_images.at(index).absoluteFilePath());
- }
-
- return m_pixmaps.at(index);
-}
-
-void River::addUnusedRiverItem(RiverItem * item)
-{
- if (m_images.isEmpty())
- return;
-
- QRectF realItemRect = item->mapToParent(item->boundingRect()).boundingRect();
-
- int y = item->pos().y();
- int x = item->pos().x();
- if (x >= fixedSize().width() || x < -realItemRect.width() || y < 0) {
- //we set the new pixmap
-
- m_items.remove(m_items.key(item));
-
- while (m_items.contains(m_currentImage))
- m_currentImage = (m_currentImage + 1 ) % m_images.size();
-
- item->setPixmap(pixmap(m_currentImage));
-
- m_items.insert(m_currentImage, item);
- //this manages looping as well
- m_currentImage = (m_currentImage + 1 ) % m_images.size();
-
- item->setZValue(qreal(qrand()%100)/200.0);
-
- QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene());
- anim->setEndValue(RIVER_MAGNIFY(item));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene());
- anim->setEndValue(RIVER_MAGNIFY(item));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
-
- realItemRect = item->mapToParent(item->boundingRect()).boundingRect();
-
- y = -realItemRect.y() + qrand() % (fixedSize().height() - int(realItemRect.height()));
- if (x >= fixedSize().width()) {
- x = -realItemRect.width()/2;
- }
- }
-
- item->setPos(x, y);
-
- const QPointF target(QPointF(fixedSize().width() + realItemRect.width()/2, y));
-
- const int distance = target.x() - x;
-
- const int duration = (40 - 50*item->zValue() ) * distance;
- QItemAnimation *a = new QItemAnimation(item, QItemAnimation::Position, scene());
- a->setEndValue(target);
- a->setDuration(duration);
- a->start(QAbstractAnimation::DeleteWhenStopped);
- connect(a, SIGNAL(finished()), SLOT(animationFinished()));
-}
-
-void River::animationFinished()
-{
- QItemAnimation *anim = qobject_cast<QItemAnimation*>(sender());
- if (!anim || anim->propertyName() != QItemAnimation::Position)
- return;
-
- /*RiverItem *item = static_cast<RiverItem*>(anim->graphicsItem());
- if (m_mode != RiverMode) {*/
- /*int key = m_items.key(item);
- if (key < m_topLeftIndex || key >= m_topLeftIndex + GRID_DIMENSIONS) {
- delete item;
- m_items.remove(key);
- }*/
- //return;
-
- //}
-
- addUnusedRiverItem(static_cast<RiverItem*>(anim->targetItem()));
-}
-
-void River::switchPaused()
-{
- const bool paused = m_pausedAnimations.isEmpty();
- if (paused)
- m_pausedAnimations = scene()->findChildren<QItemAnimation*>();
-
- foreach(QItemAnimation *anim, m_pausedAnimations) {
- if (paused)
- anim->pause();
- else
- anim->resume();
- }
-
- if (!paused)
- m_pausedAnimations.clear();
-}
-
-void River::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
-{
- painter->fillRect(option->rect, Qt::black);
-}
-
-void River::setMode(Mode m)
-{
- if (m_mode == m)
- return;
-
- Mode oldMode = m_mode;
- m_mode = m;
- switch(m)
- {
- case RiverMode:
- m_mode = oldMode; //some animation may be stopt, and we don't want that animationFinished we were in that mode yet
- foreach (RiverItem *item, m_items) {
- const int x = qrand() % fixedSize().width();
- const int y = qrand() % fixedSize().width();
- QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene());
- anim->setEndValue(RIVER_MAGNIFY(item));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene());
- anim->setEndValue(RIVER_MAGNIFY(item));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- anim = new QItemAnimation(item, QItemAnimation::Position, scene());
- anim->setEndValue(QPointF(x, y));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- connect(anim, SIGNAL(finished()), SLOT(animationFinished()));
- }
- m_mode = m;
- break;
-
- case GridMode:
-
- if (oldMode == GridFullScreenMode) {
- currentItem()->setFullScreen(false, GRID_CURRENT_MAGNIFY);
- } else {
- m_topLeftIndex = -GRID_DIMENSIONS;
- foreach (RiverItem *item, m_items) {
- QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene());
- anim->setEndValue(GRID_MAGNIFY);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene());
- anim->setEndValue(GRID_MAGNIFY);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- }
- adjustGrid(m_currentImage - GRID_DIMENSIONS + 1);
- setCurrentItem(m_topLeftIndex);
- }
- break;
- case GridFullScreenMode:
- //let's put the current item fullscreen
- currentItem()->setFullScreen(true, GRID_CURRENT_MAGNIFY);
- break;
- case CoverMode:
- m_gridItem = m_items.values();
- setCurrentItem(m_gridItem.count()/2);
- default:
- break;
- }
-}
-
-River::Mode River::mode() const
-{
- return m_mode;
-}
-
-QSize River::fixedSize()
-{
- return QSize(352, 416);
-}
-
-//the name of this method is not that good...
-void River::makeCenterAvailable(qreal size)
-{
- QRectF center(QPointF(), QSizeF(size, size));
- center.moveCenter(rect().center());
-
- const QList<QGraphicsItem*> list = scene()->items(center);
-
- foreach(QGraphicsItem *item, m_items) {
-
- if (!list.contains(item))
- continue;
-
- QPointF pos = item->pos();
-
- if (pos.y() < rect().center().y()) {
- //item is above center
- pos.ry() = center.top() - item->boundingRect().height() - 1;
- } else {
- //item is below the center
- pos.ry() = center.bottom() + 1;
- }
- QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::Position, scene());
- anim->setEndValue(pos);
- anim->setDuration(150);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- }
-}
-
-
-//this is there just to test small interaction
-void River::keyPressEvent ( QKeyEvent * keyEvent )
-{
- switch(keyEvent->key())
- {
- case Qt::Key_O:
- {
- QItemAnimation *anim = new QItemAnimation(this, QItemAnimation::Opacity, scene());
- anim->setDuration(2000);
- anim->setEndValue(qreal(.5));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- }
- break;
- case Qt::Key_N:
- //that's a test
- makeCenterAvailable(60);
- break;
- case Qt::Key_P:
- switchPaused();
- break;
- case Qt::Key_V:
- setMode(GridMode);
- break;
- case Qt::Key_R:
- setMode(RiverMode);
- break;
- case Qt::Key_C:
- setMode(CoverMode);
- break;
- case Qt::Key_Return:
- case Qt::Key_Enter:
- if (m_mode == RiverMode) {
- setMode(GridMode);
- } else if (m_mode == GridMode) {
- setMode(GridFullScreenMode);
- } else if (m_mode == GridFullScreenMode) {
- setMode(GridMode);
- }
- break;
- case Qt::Key_Escape:
- if (m_mode == GridFullScreenMode) {
- setMode(GridMode);
- } else if (m_mode == GridMode || m_mode == CoverMode) {
- setMode(RiverMode);
- } else if (m_mode == RiverMode) {
- menu->show();
- }
- break;
- case Qt::Key_Right:
- if (m_mode == GridMode) {
- navigateBy(+1);
- } else if (m_mode == CoverMode) {
- setCurrentItem(m_selectedItem + 1);
- }
- break;
- case Qt::Key_Left:
- if (m_mode == GridMode) {
- navigateBy(-1);
- } else if (m_mode == CoverMode) {
- setCurrentItem(m_selectedItem - 1);
- }
- break;
- case Qt::Key_Down:
- if (m_mode == GridMode) {
- navigateBy(GRID_COLUMN_COUNT);
- }
- break;
- case Qt::Key_Up:
- if (m_mode == GridMode) {
- navigateBy(-GRID_COLUMN_COUNT);
- }
- break;
-// case Qt::Key_PageUp:
- case Qt::Key_M:
- menu->show();
- break;
- case Qt::Key_Space:
- if (m_mode == GridMode) {
- RiverItem *item = currentItem();
- if(!item)
- break;
-
- //stupid sequence.
- QPointF pos = item->pos();
- QAnimationGroup *group = new QSequentialAnimationGroup();
- //item->animator()->beginSequence();
-
- QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::Position, scene());
- anim->setEndValue(pos);
- group->addAnimation(anim);
- anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene());
- anim->setEndValue(qreal(1.));
- anim->setDuration(500);
- group->addAnimation(anim);
- anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene());
- anim->setEndValue(qreal(1.));
- anim->setDuration(500);
- group->addAnimation(anim);
- anim = new QItemAnimation(item, QItemAnimation::RotationX, scene());
- anim->setEndValue(qreal(0));
- group->addAnimation(anim);
- group->start(QAbstractAnimation::DeleteWhenStopped);
- }
- default:
- break;
- }
-
- QGraphicsItem::keyPressEvent(keyEvent);
-}
-
-
-void River::setGridMode()
-{
- setMode(GridMode);
-}
-
-void River::setRiverMode()
-{
- setMode(RiverMode);
-}
-
-void River::setCoverMode()
-{
- setMode(CoverMode);
-}
-
-
-void River::adjustGrid(int newTopLeft)
-{
- for (int i = newTopLeft ; i < newTopLeft + GRID_DIMENSIONS; i++) {
- if (!m_items.contains(i)) {
- RiverItem *item = createItem(i);
- int row = (i - m_topLeftIndex) / GRID_COLUMN_COUNT;
- int col = (i - m_topLeftIndex) % GRID_COLUMN_COUNT;
- item->setPos(gridItemPosition(row, col));
- item->setXScale(0);
- item->setYScale(0);
- QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene());
- anim->setEndValue(GRID_MAGNIFY);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene());
- anim->setEndValue(GRID_MAGNIFY);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- }
- }
- newTopLeft = newTopLeft - newTopLeft % GRID_COLUMN_COUNT;
-
- QHash<int, RiverItem *>::iterator it = m_items.begin();
- while (it != m_items.constEnd()) {
- const int imageIdx = it.key();
- RiverItem *item = *it;
- QSizeF itemSize = item->boundingRect().size();
- if ((imageIdx >= newTopLeft && imageIdx < newTopLeft + GRID_DIMENSIONS)
- || boundingRect().adjusted(-itemSize.width()/2, -itemSize.height()/2, itemSize.width()/2, itemSize.height()/2)
- .contains(item->pos())) {
- int row = (imageIdx-newTopLeft) / GRID_COLUMN_COUNT;
- int col = (imageIdx-newTopLeft) % GRID_COLUMN_COUNT;
- QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::Position, scene());
- anim->setEndValue(gridItemPosition(row, col));
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- ++it;
- } else {
- ++it; /* ### ideally we should remove the items, but this cause the photobrowser to crash
- because the QItemAnimations are not notified the item is deleted
- delete item;
- it = m_items.erase(it);
- */
- }
- }
-
- m_topLeftIndex = newTopLeft;
-}
-
-
-RiverItem *River::createItem(int imageIndex)
-{
- Q_ASSERT(!m_items.contains(imageIndex));
- RiverItem * item = new RiverItem(this);
- item->setPixmap(pixmap(imageIndex));
- m_items.insert(imageIndex,item);
- return item;
-}
-
-void River::setCurrentItem(int newCurrentItem)
-{
- if (m_mode == CoverMode)
- {
- m_selectedItem = newCurrentItem;
- for (int i = 0; i < m_gridItem.count(); i++) {
- QVariantAnimation *anim;
- RiverItem *item = m_gridItem.at(i);
-
- qreal rotation = 0;
- qreal width = boundingRect().width() / 2;
- qreal x = width;
- qreal scale = 3;
- qreal z = 1;
- qreal y = boundingRect().height()/2;
-
- if (i < newCurrentItem - 4) {
- item->setVisible(false);
- item->setPos(QPointF(0, y));
- continue;
- } else if(i > newCurrentItem + 4) {
- item->setVisible(false);
- item->setPos(QPointF(boundingRect().width(), y));
- continue;
- } else if (i < newCurrentItem) {
- x = (i - newCurrentItem + 4) * width/7;
- rotation = -75;
- scale = 2;
- z = 1.+qreal(i-newCurrentItem)/10.;
- } else if (i > newCurrentItem) {
- x = width + (i - newCurrentItem + 3) * width/7;
- rotation = 75;
- scale = 2;
- z = 1.-qreal(i-newCurrentItem)/8.;
- }
-
- item->setVisible(true);
- item->setZValue(z);
-
- anim = new QItemAnimation(item, QItemAnimation::RotationY, scene());
- anim->setEndValue(rotation);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
-
- anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene());
- anim->setEndValue(scale);
- anim->start(QVariantAnimation::DeleteWhenStopped);
-
- anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene());
- anim->setEndValue(scale);
- anim->start(QVariantAnimation::DeleteWhenStopped);
-
- anim = new QItemAnimation(item, QItemAnimation::Position, scene());
- anim->setEndValue(QPointF(x,y));
- anim->start(QVariantAnimation::DeleteWhenStopped);
- }
- return;
- }
-
-
- //deselect the current item
- if (m_selectedItem >= 0 && m_items.contains(m_selectedItem)) {
- RiverItem *item = m_items.value(m_selectedItem);
- item->setZValue(qreal(qrand()%100)/200.0);
- QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene());
- anim->setEndValue(GRID_MAGNIFY);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene());
- anim->setEndValue(GRID_MAGNIFY);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- }
-
- if (newCurrentItem < 0) {
- m_selectedItem = newCurrentItem;
- return;
- }
-
- //ensure visible;
- if (newCurrentItem < m_topLeftIndex) {
- adjustGrid(newCurrentItem);
- } else if (newCurrentItem >= m_topLeftIndex + GRID_DIMENSIONS) {
- adjustGrid(newCurrentItem - GRID_DIMENSIONS + GRID_COLUMN_COUNT);
- }
-
- //select the new one
- m_selectedItem = newCurrentItem;
- RiverItem *item = currentItem();
- Q_ASSERT(item);
- item->setZValue(1);
-
- QItemAnimation *anim = new QItemAnimation(item, QItemAnimation::ScaleFactorX, scene());
- anim->setEndValue(GRID_CURRENT_MAGNIFY);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
- anim = new QItemAnimation(item, QItemAnimation::ScaleFactorY, scene());
- anim->setEndValue(GRID_CURRENT_MAGNIFY);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
-}
-
-void River::navigateBy(int offset)
-{
- int newSelection = m_selectedItem + offset;
- const int imageCount = m_images.size();
- while (newSelection < 0)
- newSelection += imageCount;
- newSelection %= imageCount;
- setCurrentItem(newSelection);
-}
diff --git a/examples/animation/research/photobrowser/river.h b/examples/animation/research/photobrowser/river.h
deleted file mode 100644
index d6bfc76..0000000
--- a/examples/animation/research/photobrowser/river.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __RIVER__H__
-#define __RIVER__H__
-
-#include <QtCore/QDirIterator>
-#include <QtGui/QGraphicsWidget>
-
-#include "menu.h"
-
-class RiverItem;
-
-class River : public QGraphicsWidget
-{
- Q_OBJECT
-public:
- enum Mode
- {
- RiverMode,
- GridMode,
- GridFullScreenMode,
- CoverMode
- };
-
- River(const QString &path);
- void addUnusedRiverItem(RiverItem * item);
-
- static QSize fixedSize();
-
- void switchPaused();
-
- void setMode(Mode m);
- Mode mode() const;
-
- Menu *menu;
-
-protected:
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
- void keyPressEvent ( QKeyEvent * keyEvent );
- void makeCenterAvailable(qreal size);
- QPointF gridItemPosition(int row, int col) const;
- QPixmap pixmap(int index) const;
-
-protected slots:
- void animationFinished();
-public slots:
- void setRiverMode();
- void setGridMode();
- void setCoverMode();
-
-private:
- const QFileInfoList m_images;
- int m_currentImage;
- mutable QVector<QPixmap> m_pixmaps;
- QHash<int, RiverItem*> m_items;
- QList<RiverItem*> m_gridItem;
- QList<QItemAnimation*> m_pausedAnimations;
- Mode m_mode;
-
- void adjustGrid(int topRight);
- RiverItem *currentItem() { return m_items.value(m_selectedItem); }
- RiverItem *createItem(int imageIndex);
- void setCurrentItem(int currentItem);
- void navigateBy(int offset);
-
- int m_selectedItem;
- int m_topLeftIndex;
-
-};
-
-
-#endif //__RIVERITEM__H__
diff --git a/examples/animation/research/photobrowser/riveritem.cpp b/examples/animation/research/photobrowser/riveritem.cpp
deleted file mode 100644
index 9692d30..0000000
--- a/examples/animation/research/photobrowser/riveritem.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "riveritem.h"
-#include "river.h"
-
-RiverItem::RiverItem(QGraphicsItem *parent) : QGraphicsPixmapItem(parent), m_fullscreen(false)
-{
- setCacheMode(DeviceCoordinateCache);
-}
-
-RiverItem::~RiverItem()
-{
-}
-
-void RiverItem::setPixmap(const QPixmap &pix)
-{
- const QSize oldSize = pixmap().size();
- const QSize newSize = pix.size();
- QGraphicsPixmapItem::setPixmap(pix);
-
- if (newSize != oldSize) {
- setOffset(-newSize.width()/2, -newSize.height()/2);
- const qreal scaleFactor = qreal(River::fixedSize().height())/(qreal(pix.height()*7));
- setTransform(QTransform().scale(scaleFactor, scaleFactor));
- prepareGeometryChange();
- }
-}
-
-
-void RiverItem::setFullScreen(bool b, qreal originScaleFactor)
-{
- if (m_fullscreen == b)
- return;
-
- m_fullscreen = b;
-
- QPointF newPos;
- qreal rotationZ;
- qreal scaleX, scaleY;
-
- if (b) {
- const QSizeF basePixmapSize = transform().map(boundingRect()).boundingRect().size();
-
- newPos = parentItem()->boundingRect().center();
- rotationZ = 90;
- scaleY = qreal(River::fixedSize().width()) / basePixmapSize.height() * yScale();
- scaleX = qreal(River::fixedSize().height()) / basePixmapSize.width() * xScale();
-
- if (m_nonFSPos.isNull()) {
- m_nonFSPos = pos(); //let's save our current (non fullscreen) position
- }
-
- } else {
- Q_ASSERT(!m_nonFSPos.isNull());
- rotationZ = 0;
- scaleX = originScaleFactor;
- scaleY = originScaleFactor;
- newPos = m_nonFSPos;
- }
-
- QAnimationGroup *group = new QParallelAnimationGroup(scene());
- QItemAnimation *anim = new QItemAnimation(this, QItemAnimation::Position);
- anim->setEndValue(newPos);
- group->addAnimation(anim);
- anim = new QItemAnimation(this, QItemAnimation::RotationZ);
- anim->setEndValue(rotationZ);
- group->addAnimation(anim);
- anim = new QItemAnimation(this, QItemAnimation::ScaleFactorX);
- anim->setEndValue(scaleX);
- group->addAnimation(anim);
- anim = new QItemAnimation(this, QItemAnimation::ScaleFactorY);
- anim->setEndValue(scaleY);
- group->addAnimation(anim);
- group->start(QAbstractAnimation::DeleteWhenStopped);
-}
-
-void RiverItem::mousePressEvent(QGraphicsSceneMouseEvent*)
-{
- //just let it rotate on itself
- QItemAnimation *anim = new QItemAnimation(this, QItemAnimation::RotationY);
- anim->setEndValue(yRotation() < 180 ? 360 : 0);
- anim->setDuration(500);
- anim->start(QAbstractAnimation::DeleteWhenStopped);
-}
-
-
diff --git a/examples/animation/research/photobrowser/riveritem.h b/examples/animation/research/photobrowser/riveritem.h
deleted file mode 100644
index 2023c44..0000000
--- a/examples/animation/research/photobrowser/riveritem.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __RIVERITEM__H__
-#define __RIVERITEM__H__
-
-#include <QtGui/QGraphicsPixmapItem>
-
-class RiverItemAnimator;
-
-class RiverItem : public QGraphicsPixmapItem
-{
-public:
- RiverItem(QGraphicsItem *parent);
- ~RiverItem();
-
- void setPixmap(const QPixmap &);
- void setFullScreen(bool b, qreal originScaleFactor);
-
-protected:
- void mousePressEvent(QGraphicsSceneMouseEvent*);
-
-private:
- QPointF m_nonFSPos; //to save the position when not in fullscreen
- bool m_fullscreen;
-};
-
-#endif //__RIVERITEM__H__
diff --git a/examples/animation/research/piemenu/main.cpp b/examples/animation/research/piemenu/main.cpp
deleted file mode 100644
index 8076da8..0000000
--- a/examples/animation/research/piemenu/main.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-#include "scene.h"
-#include "qgraphicspiemenu.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- Scene scene;
-
- QGraphicsView view(&scene);
- view.show();
-
- return app.exec();
-}
diff --git a/examples/animation/research/piemenu/piemenu.pro b/examples/animation/research/piemenu/piemenu.pro
deleted file mode 100644
index 4d7a067..0000000
--- a/examples/animation/research/piemenu/piemenu.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-SOURCES += \
- main.cpp \
- qgraphicspiemenu.cpp \
- scene.cpp
-HEADERS += \
- qgraphicspiemenu.h \
- qgraphicspiemenu_p.h \
- scene.h
diff --git a/examples/animation/research/piemenu/qgraphicspiemenu.cpp b/examples/animation/research/piemenu/qgraphicspiemenu.cpp
deleted file mode 100644
index a199119..0000000
--- a/examples/animation/research/piemenu/qgraphicspiemenu.cpp
+++ /dev/null
@@ -1,250 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgraphicspiemenu.h"
-#include "qgraphicspiemenu_p.h"
-
-#include <QtGui/qaction.h>
-
-QGraphicsPieMenu::QGraphicsPieMenu(QGraphicsItem *parent)
- : QGraphicsWidget(parent), d_ptr(new QGraphicsPieMenuPrivate)
-{
- d_ptr->q_ptr = this;
- d_ptr->machine = new QStateMachine();
- d_ptr->popupState = new QState(d_ptr->machine->rootState());
- d_ptr->machine->setInitialState(d_ptr->popupState);
- d_ptr->menuAction = new QAction(this);
-}
-
-QGraphicsPieMenu::QGraphicsPieMenu(const QString &title, QGraphicsItem *parent)
- : QGraphicsWidget(parent), d_ptr(new QGraphicsPieMenuPrivate)
-{
- d_ptr->q_ptr = this;
- d_ptr->machine = new QStateMachine();
- d_ptr->popupState = new QState(d_ptr->machine->rootState());
- d_ptr->machine->setInitialState(d_ptr->popupState);
- d_ptr->menuAction = new QAction(this);
- setTitle(title);
-}
-
-QGraphicsPieMenu::QGraphicsPieMenu(const QIcon &icon, const QString &title, QGraphicsItem *parent)
- : QGraphicsWidget(parent), d_ptr(new QGraphicsPieMenuPrivate)
-{
- d_ptr->q_ptr = this;
- d_ptr->machine = new QStateMachine();
- d_ptr->popupState = new QState(d_ptr->machine->rootState());
- d_ptr->machine->setInitialState(d_ptr->popupState);
- d_ptr->menuAction = new QAction(this);
- setIcon(icon);
- setTitle(title);
-}
-
-QGraphicsPieMenu::~QGraphicsPieMenu()
-{
- delete d_ptr;
-}
-
-QAction *QGraphicsPieMenu::addAction(const QString &text)
-{
- QAction *action = new QAction(text, this);
- addAction(action);
- return action;
-}
-
-QAction *QGraphicsPieMenu::addAction(const QIcon &icon, const QString &text)
-{
- QAction *action = new QAction(icon, text, this);
- addAction(action);
- return action;
-}
-
-QAction *QGraphicsPieMenu::addAction(const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut)
-{
- QAction *action = new QAction(text, this);
- action->setShortcut(shortcut);
- connect(action, SIGNAL(triggered(bool)), receiver, member);
- addAction(action);
- return action;
-}
-
-QAction *QGraphicsPieMenu::addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut)
-{
- QAction *action = new QAction(icon, text, this);
- action->setShortcut(shortcut);
- connect(action, SIGNAL(triggered(bool)), receiver, member);
- addAction(action);
- return action;
-}
-
-QAction *QGraphicsPieMenu::addMenu(QGraphicsPieMenu *menu)
-{
- QAction *action = menu->menuAction();
- addAction(action);
- return action;
-}
-
-QGraphicsPieMenu *QGraphicsPieMenu::addMenu(const QString &title)
-{
- QGraphicsPieMenu *menu = new QGraphicsPieMenu(title, this);
- addMenu(menu);
- return menu;
-}
-
-QGraphicsPieMenu *QGraphicsPieMenu::addMenu(const QIcon &icon, const QString &title)
-{
- QGraphicsPieMenu *menu = new QGraphicsPieMenu(icon, title, this);
- addMenu(menu);
- return menu;
-}
-
-QAction *QGraphicsPieMenu::addSeparator()
-{
- QAction *action = new QAction(this);
- action->setSeparator(true);
- addAction(action);
- return action;
-}
-
-QAction *QGraphicsPieMenu::insertMenu(QAction *before, QGraphicsPieMenu *menu)
-{
- QAction *action = menu->menuAction();
- insertAction(before, action);
- return action;
-}
-
-QAction *QGraphicsPieMenu::insertSeparator(QAction *before)
-{
- QAction *action = new QAction(this);
- action->setSeparator(true);
- insertAction(before, action);
- return action;
-}
-
-QAction *QGraphicsPieMenu::menuAction() const
-{
- return d_func()->menuAction;
-}
-
-bool QGraphicsPieMenu::isEmpty() const
-{
- // ### d->actions
- QList<QAction *> actionList = actions();
- bool ret = true;
- for (int i = 0; ret && i < actionList.size(); ++i) {
- const QAction *action = actionList.at(i);
- if (!action->isSeparator() && action->isVisible()) {
- ret = false;
- break;
- }
- }
- return ret;
-}
-
-void QGraphicsPieMenu::clear()
-{
- // ### d->actions
- QList<QAction *> actionList = actions();
- for(int i = 0; i < actionList.size(); i++) {
- QAction *action = actionList.at(i);
- removeAction(action);
- if (action->parent() == this && action->associatedGraphicsWidgets().isEmpty())
- delete action;
- }
-}
-
-void QGraphicsPieMenu::popup(const QPointF &pos)
-{
- Q_UNUSED(pos);
- Q_D(QGraphicsPieMenu);
- d->machine->start();
-}
-
-QAction *QGraphicsPieMenu::exec()
-{
- return exec(pos());
-}
-
-QAction *QGraphicsPieMenu::exec(const QPointF &pos)
-{
- Q_UNUSED(pos);
- return 0;
-}
-
-QAction *QGraphicsPieMenu::exec(QList<QAction *> actions, const QPointF &pos)
-{
- QGraphicsPieMenu menu;
- for (QList<QAction *>::ConstIterator it = actions.constBegin(); it != actions.constEnd(); ++it)
- menu.addAction(*it);
- return menu.exec(pos);
-}
-
-QString QGraphicsPieMenu::title() const
-{
- Q_D(const QGraphicsPieMenu);
- return d->title;
-}
-
-void QGraphicsPieMenu::setTitle(const QString &title)
-{
- Q_D(QGraphicsPieMenu);
- d->title = title;
- updateGeometry();
-}
-
-QIcon QGraphicsPieMenu::icon() const
-{
- Q_D(const QGraphicsPieMenu);
- return d->icon;
-}
-
-void QGraphicsPieMenu::setIcon(const QIcon &icon)
-{
- Q_D(QGraphicsPieMenu);
- d->icon = icon;
- updateGeometry();
-}
-
-QSizeF QGraphicsPieMenu::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
-{
- Q_UNUSED(which);
- Q_UNUSED(constraint);
- return QSizeF(1, 1);
-}
diff --git a/examples/animation/research/piemenu/qgraphicspiemenu.h b/examples/animation/research/piemenu/qgraphicspiemenu.h
deleted file mode 100644
index d784f93..0000000
--- a/examples/animation/research/piemenu/qgraphicspiemenu.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGRAPHICSPIEMENU_H
-#define QGRAPHICSPIEMENU_H
-
-#include <QtGui/qgraphicswidget.h>
-
-class QGraphicsPieMenuPrivate;
-class QGraphicsPieMenu : public QGraphicsWidget
-{
- Q_OBJECT
-public:
- QGraphicsPieMenu(QGraphicsItem *parent = 0);
- QGraphicsPieMenu(const QString &title, QGraphicsItem *parent = 0);
- QGraphicsPieMenu(const QIcon &icon, const QString &title, QGraphicsItem *parent = 0);
- ~QGraphicsPieMenu();
-
-#ifdef Q_NO_USING_KEYWORD
- inline void addAction(QAction *action) { QGraphicsWidget::addAction(action); }
-#else
- using QGraphicsWidget::addAction;
-#endif
- QAction *addAction(const QString &text);
- QAction *addAction(const QIcon &icon, const QString &text);
- QAction *addAction(const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut = 0);
- QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut = 0);
- QAction *addMenu(QGraphicsPieMenu *menu);
- QGraphicsPieMenu *addMenu(const QString &title);
- QGraphicsPieMenu *addMenu(const QIcon &icon, const QString &title);
- QAction *addSeparator();
- QAction *insertMenu(QAction *before, QGraphicsPieMenu *menu);
- QAction *insertSeparator(QAction *before);
-
- QAction *menuAction() const;
-
- bool isEmpty() const;
- void clear();
-
- void popup(const QPointF &pos);
- QAction *exec();
- QAction *exec(const QPointF &pos);
- static QAction *exec(QList<QAction *> actions, const QPointF &pos);
-
- QString title() const;
- void setTitle(const QString &title);
-
- QIcon icon() const;
- void setIcon(const QIcon &icon);
-
-Q_SIGNALS:
- void aboutToShow();
- void aboutToHide();
- void triggered(QAction *action);
- void hovered(QAction *action);
-
-protected:
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
-
-private:
- Q_DISABLE_COPY(QGraphicsPieMenu)
- Q_DECLARE_PRIVATE(QGraphicsPieMenu)
- QGraphicsPieMenuPrivate *d_ptr;
-};
-
-#endif
diff --git a/examples/animation/research/piemenu/qgraphicspiemenu_p.h b/examples/animation/research/piemenu/qgraphicspiemenu_p.h
deleted file mode 100644
index 458b8f1..0000000
--- a/examples/animation/research/piemenu/qgraphicspiemenu_p.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGRAPHICSPIEMENU_P_H
-#define QGRAPHICSPIEMENU_P_H
-
-#include "qgraphicspiemenu.h"
-#include "qgraphicspiemenusection_p.h"
-
-#include <QtGui/qicon.h>
-#include <QtCore/qstate.h>
-#include <QtCore/qtransition.h>
-#include <QtCore/qstatemachine.h>
-
-class QAction;
-class QEventLoop;
-class QGraphicsPieMenuSection;
-
-class QGraphicsPieMenuPrivate
-{
- Q_DECLARE_PUBLIC(QGraphicsPieMenu);
-public:
- void init(const QIcon &icon = QIcon(), const QString &title = QString());
-
- QIcon icon;
- QString title;
- QStateMachine *machine;
- QState *popupState;
- //QTransition *transition;
- QList<QGraphicsPieMenuSection *> sections;
-
- QEventLoop *eventLoop;
-
- QAction *menuAction;
- QGraphicsPieMenu *q_ptr;
-
- void updatePopupState();
-};
-
-#endif
diff --git a/examples/animation/research/piemenu/qgraphicspiemenusection_p.h b/examples/animation/research/piemenu/qgraphicspiemenusection_p.h
deleted file mode 100644
index 2d71a06..0000000
--- a/examples/animation/research/piemenu/qgraphicspiemenusection_p.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGRAPHICSPIEMENUSECTION_H
-#define QGRAPHICSPIEMENUSECTION_H
-
-#include <QtGui/qgraphicswidget.h>
-#include <QtGui/qpainter.h>
-
-class QGraphicsPieMenuSection : public QGraphicsWidget
-{
- Q_OBJECT
- Q_PROPERTY(qreal rotation READ rotation WRITE setRotation)
-public:
- QGraphicsPieMenuSection(QGraphicsItem *parent = 0)
- : QGraphicsWidget(parent), rot(0)
- { }
-
- qreal rotation() const
- {
- return rot;
- }
- void setRotation(qreal rotation)
- {
- rot = rotation;
- setTransform(QTransform().rotate(rot));
- }
-
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0)
- {
- Q_UNUSED(option);
- Q_UNUSED(widget);
- painter->setPen(QPen(Qt::black, 1));
- painter->setBrush(QBrush(Qt::gray));
- painter->drawPie(QRectF(-100, -100, 200, 200), 0, -30 * 16);
- }
-
-protected:
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF &size = QSizeF()) const
- {
- Q_UNUSED(which);
- Q_UNUSED(size);
- return QSizeF(100, 30);
- }
-
-private:
- qreal rot;
-};
-
-#endif
diff --git a/examples/animation/research/piemenu/scene.cpp b/examples/animation/research/piemenu/scene.cpp
deleted file mode 100644
index 6309975..0000000
--- a/examples/animation/research/piemenu/scene.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgraphicspiemenu.h"
-#include "scene.h"
-
-#include <QtGui/qaction.h>
-#include <QtGui/qgraphicssceneevent.h>
-
-Scene::Scene(qreal x, qreal y, qreal width, qreal height, QObject *parent)
- : QGraphicsScene(x, y, width, height, parent)
-{
-}
-
-Scene::Scene(const QRectF &sceneRect, QObject *parent)
- : QGraphicsScene(sceneRect, parent)
-{
-}
-
-Scene::Scene(QObject *parent)
- : QGraphicsScene(parent)
-{
-}
-
-Scene::~Scene()
-{
-}
-
-void Scene::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
- QGraphicsPieMenu *menu = new QGraphicsPieMenu;
- for (int i = 0; i < 5; ++i)
- menu->addAction(new QAction(QString("Item %1").arg(i), menu));
- menu->popup(event->scenePos());
-}
diff --git a/examples/animation/research/piemenu/scene.h b/examples/animation/research/piemenu/scene.h
deleted file mode 100644
index bbfe6d3..0000000
--- a/examples/animation/research/piemenu/scene.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SCENE_H
-#define SCENE_H
-
-#include <QtGui/qgraphicsscene.h>
-
-class Scene : public QGraphicsScene
-{
- Q_OBJECT
-public:
- Scene(qreal x, qreal y, qreal width, qreal height, QObject *parent = 0);
- Scene(const QRectF &sceneRect, QObject *parent = 0);
- Scene(QObject *parent = 0);
- ~Scene();
-
-protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *event);
-};
-
-#endif
diff --git a/examples/animation/research/propertytransform/main.cpp b/examples/animation/research/propertytransform/main.cpp
deleted file mode 100644
index 99cd769..0000000
--- a/examples/animation/research/propertytransform/main.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-
-#include "qpropertytransform.h"
-
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
-
- QGraphicsScene scene;
- QGraphicsView view(&scene);
-
- QGraphicsItem *item = new QGraphicsRectItem(QRectF(0,0, 200, 100));
- scene.addItem(item);
- QPropertyTransform transform;
- transform.setTargetItem(item);
-
- QAnimationGroup *group = new QAnimationGroup(QAnimationGroup::Parallel, &scene);
- QPropertyAnimation *scaleAnim = new QPropertyAnimation(&transform, "scaleX");
- scaleAnim->setStartValue(1.0);
- scaleAnim->setTargetValue(2.0);
- scaleAnim->setDuration(10000);
- group->add(scaleAnim);
-
- QPropertyAnimation *scaleAnim2 = new QPropertyAnimation(&transform, "scaleY");
- scaleAnim2->setStartValue(.0);
- scaleAnim2->setTargetValue(2.0);
- scaleAnim2->setDuration(10000);
- QEasingCurve curve(QEasingCurve::InElastic);
- curve.setPeriod(2);
- curve.setAmplitude(2);
-
- //scaleAnim2->setEasingCurve(curve);
- //scaleAnim2->setEasingCurve(QEasingCurve(QEasingCurve::OutElastic , 2, 2 ));
- group->add(scaleAnim2);
-
- QPropertyAnimation *rotAnim = new QPropertyAnimation(&transform, "rotation");
- rotAnim->setStartValue(0);
- rotAnim->setTargetValue(90);
- rotAnim->setDuration(10000);
- group->add(rotAnim);
-
- group->start();
-
- view.resize(800,600);
- view.show();
- return app.exec();
-}
diff --git a/examples/animation/research/propertytransform/propertytransform.pro b/examples/animation/research/propertytransform/propertytransform.pro
deleted file mode 100644
index 94c36b8..0000000
--- a/examples/animation/research/propertytransform/propertytransform.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-######################################################################
-# Automatically generated by qmake (2.01a) fr 26. sep 13:21:57 2008
-######################################################################
-
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp
-HEADERS += qpropertytransform.h
-CONFIG += console
-
diff --git a/examples/animation/research/propertytransform/qpropertytransform.h b/examples/animation/research/propertytransform/qpropertytransform.h
deleted file mode 100644
index e27987f..0000000
--- a/examples/animation/research/propertytransform/qpropertytransform.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/QObject>
-#include <QtCore/QPoint>
-#include <QtGui/QGraphicsItem>
-#include <QtGui/QTransform>
-#include <QtCore/QDebug>
-
-/**
- * Experimental.
- * Pros:
- * 1. Does not add ugly/confusing API to QGraphicsItem.
- *
- * Cons:
- * 1. apply() /m_item->setTransform() is called too many times. (FIXED NOW?)
- *
- *
- */
-class QPropertyTransform : public QObject {
- Q_OBJECT
-public:
- Q_PROPERTY(QPointF center READ center WRITE setCenter);
- Q_PROPERTY(qreal rotation READ rotation WRITE setRotation);
- Q_PROPERTY(qreal scaleX READ scaleX WRITE setScaleX);
- Q_PROPERTY(qreal scaleY READ scaleY WRITE setScaleY);
-public:
- QPropertyTransform() : m_item(0), m_rotationZ(0), m_scaleX(1.), m_scaleY(1.) {}
-
- void setTargetItem(QGraphicsItem *item) {
- m_item = item;
- }
-
- void setCenter(const QPointF &center) {
- m_center = center;
- apply();
- }
-
- QPointF center() const { return m_center; }
-
- void setRotation(qreal rotation) {
- m_rotationZ = rotation;
- apply();
- }
-
- qreal rotation() const { return m_rotationZ; }
-
- void setScaleX(qreal scale) {
- m_scaleX = scale;
- apply();
- }
-
- qreal scaleX() const { return m_scaleX; }
-
- void setScaleY(qreal scale) {
- m_scaleY = scale;
- apply();
- }
-
- qreal scaleY() const { return m_scaleY; }
-
-private:
- QTransform transform() const {
- return QTransform().translate(m_center.x(), m_center.y())
- .rotate(m_rotationZ)
- .scale(m_scaleX, m_scaleY)
- .translate(-m_center.x(), -m_center.y());
- }
-
- void apply() {
- if (m_item)
- m_item->setTransform(transform());
- }
-
- QGraphicsItem *m_item;
- QPointF m_center;
- qreal m_rotationZ;
- qreal m_scaleX;
- qreal m_scaleY;
-};
-
diff --git a/examples/animation/research/sound/main.cpp b/examples/animation/research/sound/main.cpp
deleted file mode 100644
index ffbc44c..0000000
--- a/examples/animation/research/sound/main.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtCore 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//The purpose of this example is to show that it is possible to have your own
-// animation with undefined duration
-
-#include <QtGui/QtGui>
-#include <phonon>
-
-class SoundAnimation : public QAbstractAnimation
-{
-public:
- SoundAnimation(const QString &file)
- {
- //in an idea case we should also control the errors
- Phonon::createPath(&m_media, &m_audio);
- m_media.setCurrentSource(file);
- connect(&m_media, SIGNAL(finished()), SLOT(stop()));
- }
-
- int duration() const
- {
- return -1;
- }
-
- void updateCurrentTime(int msecs)
- {
- //nothing to do here...
- qDebug() << "updateCurrentTime" << msecs;
- }
-
- void updateState(State state)
- {
- switch(state)
- {
- case Running:
- m_media.play();
- break;
- case Stopped:
- m_media.stop();
- break;
- case Paused:
- m_media.pause();
- break;
- }
- }
-
-
-private:
- Phonon::MediaObject m_media;
- Phonon::AudioOutput m_audio;
-
-};
-
-
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
- Q_INIT_RESOURCE(sound);
-
- SoundAnimation anim(QLatin1String(":/media/sax.mp3"));
- app.connect(&anim, SIGNAL(finished()), SLOT(quit()));
- anim.start();
-
- return app.exec();
-}
diff --git a/examples/animation/research/sound/media/sax.mp3 b/examples/animation/research/sound/media/sax.mp3
deleted file mode 100644
index 0a078b1..0000000
--- a/examples/animation/research/sound/media/sax.mp3
+++ /dev/null
Binary files differ
diff --git a/examples/animation/research/sound/sound.pro b/examples/animation/research/sound/sound.pro
deleted file mode 100644
index 0ad3050..0000000
--- a/examples/animation/research/sound/sound.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-######################################################################
-# Automatically generated by qmake (2.01a) mer. 21. janv. 13:53:26 2009
-######################################################################
-
-TEMPLATE = app
-QT += phonon
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-RESOURCES = sound.qrc
-
-# Input
-SOURCES += main.cpp
diff --git a/examples/animation/states/main.cpp b/examples/animation/states/main.cpp
index 06b0667..17a7a8e 100644
--- a/examples/animation/states/main.cpp
+++ b/examples/animation/states/main.cpp
@@ -40,14 +40,6 @@
****************************************************************************/
#include <QtGui>
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qstate.h"
-# include "qstatemachine.h"
-# include "qtransition.h"
-# include "qparallelanimationgroup.h"
-# include "qsequentialanimationgroup.h"
-# include "qpropertyanimation.h"
-#endif
class Pixmap : public QGraphicsWidget
{
diff --git a/examples/animation/stickman/animation.h b/examples/animation/stickman/animation.h
index e6c375e..b0b39c9 100644
--- a/examples/animation/stickman/animation.h
+++ b/examples/animation/stickman/animation.h
@@ -47,7 +47,9 @@
#include <QString>
class Frame;
+QT_BEGIN_NAMESPACE
class QIODevice;
+QT_END_NAMESPACE
class Animation
{
public:
diff --git a/examples/animation/stickman/editor/animationdialog.h b/examples/animation/stickman/editor/animationdialog.h
index 764cdaf..6025088 100644
--- a/examples/animation/stickman/editor/animationdialog.h
+++ b/examples/animation/stickman/editor/animationdialog.h
@@ -45,8 +45,10 @@
#include <QDialog>
#include <QMessageBox>
+QT_BEGIN_NAMESPACE
class QSpinBox;
class QLineEdit;
+QT_END_NAMESPACE
class StickMan;
class Animation;
class AnimationDialog: public QDialog
diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp
index 423d7ad..eb4ed11 100644
--- a/examples/animation/stickman/lifecycle.cpp
+++ b/examples/animation/stickman/lifecycle.cpp
@@ -47,15 +47,6 @@
#include <QtCore>
#include <QtGui>
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-#include "qstatemachine.h"
-#include "qstate.h"
-#include "qeventtransition.h"
-#include "qsignaltransition.h"
-#include "qsignalevent.h"
-#include "qpropertyanimation.h"
-#include "qparallelanimationgroup.h"
-#endif
class KeyPressTransition: public QSignalTransition
{
@@ -82,6 +73,7 @@ private:
Qt::Key m_key;
};
+//! [4]
class LightningStrikesTransition: public QEventTransition
{
public:
@@ -97,6 +89,7 @@ public:
return QEventTransition::eventTest(e) && ((qrand() % 50) == 0);
}
};
+//! [4]
LifeCycle::LifeCycle(StickMan *stickMan, GraphicsView *keyReceiver)
: m_stickMan(stickMan), m_keyReceiver(keyReceiver)
@@ -110,7 +103,10 @@ LifeCycle::LifeCycle(StickMan *stickMan, GraphicsView *keyReceiver)
}
// Set up intial state graph
+//! [3]
m_machine = new QStateMachine();
+ m_machine->addDefaultAnimation(m_animationGroup);
+//! [3]
m_alive = new QState(m_machine->rootState());
m_alive->setObjectName("alive");
@@ -122,11 +118,13 @@ LifeCycle::LifeCycle(StickMan *stickMan, GraphicsView *keyReceiver)
lightningBlink->assignProperty(m_stickMan, "fillColor", Qt::white);
lightningBlink->assignProperty(m_stickMan, "isDead", true);
+//! [5]
QTimer *timer = new QTimer(lightningBlink);
timer->setSingleShot(true);
timer->setInterval(100);
QObject::connect(lightningBlink, SIGNAL(entered()), timer, SLOT(start()));
QObject::connect(lightningBlink, SIGNAL(exited()), timer, SLOT(stop()));
+//! [5]
m_dead = new QState(m_machine->rootState());
m_dead->assignProperty(m_stickMan->scene(), "backgroundBrush", Qt::black);
@@ -142,8 +140,9 @@ LifeCycle::LifeCycle(StickMan *stickMan, GraphicsView *keyReceiver)
// Lightning strikes at random
m_alive->addTransition(new LightningStrikesTransition(lightningBlink));
- //m_alive->addTransition(new KeyPressTransition(m_keyReceiver, Qt::Key_L, lightningBlink));
- connectByAnimation(lightningBlink, m_dead, new QSignalTransition(timer, SIGNAL(timeout())));
+//! [0]
+ lightningBlink->addTransition(timer, SIGNAL(timeout()), m_dead);
+//! [0]
m_machine->setInitialState(m_alive);
}
@@ -159,22 +158,10 @@ void LifeCycle::start()
m_machine->start();
}
-void LifeCycle::connectByAnimation(QState *s1, QAbstractState *s2,
- QAbstractTransition *transition)
-{
- if (transition == 0) {
- transition = s1->addTransition(s2);
- } else {
- transition->setTargetState(s2);
- s1->addTransition(transition);
- }
- transition->addAnimation(m_animationGroup);
-}
-
void LifeCycle::addActivity(const QString &fileName, Qt::Key key)
{
QState *state = makeState(m_alive, fileName);
- connectByAnimation(m_alive, state, new KeyPressTransition(m_keyReceiver, key));
+ m_alive->addTransition(new KeyPressTransition(m_keyReceiver, key, state));
}
QState *LifeCycle::makeState(QState *parentState, const QString &animationFileName)
@@ -191,26 +178,28 @@ QState *LifeCycle::makeState(QState *parentState, const QString &animationFileNa
const int frameCount = animation.totalFrames();
QState *previousState = 0;
for (int i=0; i<frameCount; ++i) {
- QState *frameState = new QState(topLevel);
- frameState->setObjectName(QString::fromLatin1("frame %0").arg(i));
-
animation.setCurrentFrame(i);
+
+//! [1]
+ QState *frameState = new QState(topLevel);
const int nodeCount = animation.nodeCount();
for (int j=0; j<nodeCount; ++j)
frameState->assignProperty(m_stickMan->node(j), "position", animation.nodePos(j));
+//! [1]
- if (previousState == 0) {
+ frameState->setObjectName(QString::fromLatin1("frame %0").arg(i));
+ if (previousState == 0)
topLevel->setInitialState(frameState);
- } else {
- connectByAnimation(previousState, frameState,
- new QSignalTransition(previousState, SIGNAL(polished())));
- }
+ else
+//! [2]
+ previousState->addTransition(previousState, SIGNAL(polished()), frameState);
+//! [2]
+
previousState = frameState;
}
// Loop
- connectByAnimation(previousState, topLevel->initialState(),
- new QSignalTransition(previousState, SIGNAL(polished())));
+ previousState->addTransition(previousState, SIGNAL(polished()), topLevel->initialState());
return topLevel;
diff --git a/examples/animation/stickman/lifecycle.h b/examples/animation/stickman/lifecycle.h
index e520402..2be4762 100644
--- a/examples/animation/stickman/lifecycle.h
+++ b/examples/animation/stickman/lifecycle.h
@@ -45,11 +45,13 @@
#include <Qt>
class StickMan;
+QT_BEGIN_NAMESPACE
class QStateMachine;
class QAnimationGroup;
class QState;
class QAbstractState;
class QAbstractTransition;
+QT_END_NAMESPACE
class GraphicsView;
class LifeCycle
{
@@ -63,8 +65,6 @@ public:
void start();
private:
- void connectByAnimation(QState *s1, QAbstractState *s2,
- QAbstractTransition *transition = 0);
QState *makeState(QState *parentState, const QString &animationFileName);
StickMan *m_stickMan;
diff --git a/examples/animation/stickman/node.cpp b/examples/animation/stickman/node.cpp
index ed18108..9c485d9 100644
--- a/examples/animation/stickman/node.cpp
+++ b/examples/animation/stickman/node.cpp
@@ -75,7 +75,7 @@ QVariant Node::itemChange(GraphicsItemChange change, const QVariant &value)
return QGraphicsItem::itemChange(change, value);
}
-void Node::mousePressEvent(QGraphicsSceneMouseEvent *event)
+void Node::mousePressEvent(QGraphicsSceneMouseEvent *)
{
m_dragging = true;
}
@@ -86,7 +86,7 @@ void Node::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
setPos(mapToParent(event->pos()));
}
-void Node::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+void Node::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
{
m_dragging = false;
}
diff --git a/examples/animation/stickman/stickman.cpp b/examples/animation/stickman/stickman.cpp
index 5eb392f..a3b200c 100644
--- a/examples/animation/stickman/stickman.cpp
+++ b/examples/animation/stickman/stickman.cpp
@@ -48,6 +48,10 @@
#define _USE_MATH_DEFINES
#include <math.h>
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
static const int NodeCount = 16;
static const qreal Coords[NodeCount * 2] = {
0.0, -150.0, // head, #0
@@ -178,7 +182,7 @@ Node *StickMan::node(int idx) const
return 0;
}
-void StickMan::timerEvent(QTimerEvent *e)
+void StickMan::timerEvent(QTimerEvent *)
{
update();
}
diff --git a/examples/animation/stickman/stickman.h b/examples/animation/stickman/stickman.h
index 46863a3..6395272 100644
--- a/examples/animation/stickman/stickman.h
+++ b/examples/animation/stickman/stickman.h
@@ -47,7 +47,9 @@
const int LimbCount = 16;
class Node;
+QT_BEGIN_NAMESPACE
class QTimer;
+QT_END_NAMESPACE
class StickMan: public QObject, public QGraphicsItem
{
Q_OBJECT
diff --git a/examples/animation/stickman/stickman.pro b/examples/animation/stickman/stickman.pro
index bfee5b0..1dbbce9 100644
--- a/examples/animation/stickman/stickman.pro
+++ b/examples/animation/stickman/stickman.pro
@@ -1,14 +1,21 @@
-######################################################################
-# Automatically generated by qmake (2.01a) ti 3. feb 19:50:14 2009
-######################################################################
+HEADERS += stickman.h \
+ animation.h \
+ node.h \
+ lifecycle.h \
+ graphicsview.h
+SOURCES += main.cpp \
+ stickman.cpp \
+ animation.cpp \
+ node.cpp \
+ lifecycle.cpp \
+ graphicsview.cpp
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
+INCLUDEPATH += $$PWD
include(editor/editor.pri)
-# Input
-HEADERS += stickman.h animation.h node.h lifecycle.h graphicsview.h
-SOURCES += main.cpp stickman.cpp animation.cpp node.cpp lifecycle.cpp graphicsview.cpp
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/animation/stickman
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS stickman.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/animation/stickman
+INSTALLS += target sources
diff --git a/examples/animation/sub-attaq/animationmanager.cpp b/examples/animation/sub-attaq/animationmanager.cpp
index 5b9282a..477d3bd 100644
--- a/examples/animation/sub-attaq/animationmanager.cpp
+++ b/examples/animation/sub-attaq/animationmanager.cpp
@@ -43,11 +43,7 @@
#include "animationmanager.h"
//Qt
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qabstractanimation.h"
-#else
-# include <QtCore/QAbstractAnimation>
-#endif
+#include <QtCore/QAbstractAnimation>
#include <QtCore/QDebug>
// the universe's only animation manager
diff --git a/examples/animation/sub-attaq/animationmanager.h b/examples/animation/sub-attaq/animationmanager.h
index 69ec3d7..a563c96 100644
--- a/examples/animation/sub-attaq/animationmanager.h
+++ b/examples/animation/sub-attaq/animationmanager.h
@@ -44,7 +44,9 @@
#include <QtCore/QObject>
+QT_BEGIN_NAMESPACE
class QAbstractAnimation;
+QT_END_NAMESPACE
class AnimationManager : public QObject
{
diff --git a/examples/animation/sub-attaq/boat.cpp b/examples/animation/sub-attaq/boat.cpp
index 143cf94..63d12bb 100644
--- a/examples/animation/sub-attaq/boat.cpp
+++ b/examples/animation/sub-attaq/boat.cpp
@@ -50,22 +50,12 @@
#include "qanimationstate.h"
//Qt
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qpropertyanimation.h"
-# include "qstatemachine.h"
-# include "qhistorystate.h"
-# include "qfinalstate.h"
-# include "qstate.h"
-# include "qpauseanimation.h"
-#include "qsequentialanimationgroup.h"
-#else
#include <QtCore/QPropertyAnimation>
#include <QtCore/QStateMachine>
#include <QtCore/QHistoryState>
#include <QtCore/QFinalState>
#include <QtCore/QState>
#include <QtCore/QSequentialAnimationGroup>
-#endif
static QAbstractAnimation *setupDestroyAnimation(Boat *boat)
{
diff --git a/examples/animation/sub-attaq/boat.h b/examples/animation/sub-attaq/boat.h
index b28cf20..b412739 100644
--- a/examples/animation/sub-attaq/boat.h
+++ b/examples/animation/sub-attaq/boat.h
@@ -46,22 +46,19 @@
#include <QtCore/QObject>
#include <QtGui/QKeyEvent>
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qtgraphicswidget.h"
-#else
-# include <QtGui/QGraphicsWidget>
-#endif
+#include <QtGui/QGraphicsWidget>
class PixmapItem;
class Bomb;
+QT_BEGIN_NAMESPACE
class QVariantAnimation;
class QAbstractAnimation;
class QStateMachine;
+QT_END_NAMESPACE
class Boat : public QGraphicsWidget
{
Q_OBJECT
-Q_PROPERTY(QPointF pos READ pos WRITE setPos)
public:
enum Movement {
None = 0,
@@ -87,7 +84,7 @@ public:
virtual int type() const;
-Q_SIGNALS:
+signals:
void boatDestroyed();
void boatExecutionFinished();
diff --git a/examples/animation/sub-attaq/boat_p.h b/examples/animation/sub-attaq/boat_p.h
index 6f03e48..a8a24a6 100644
--- a/examples/animation/sub-attaq/boat_p.h
+++ b/examples/animation/sub-attaq/boat_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -42,16 +42,23 @@
#ifndef BOAT_P_H
#define BOAT_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
//Own
#include "bomb.h"
#include "graphicsscene.h"
// Qt
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qkeyeventtransition.h"
-#else
-# include <QtGui/QKeyEventTransition>
-#endif
+#include <QtGui/QKeyEventTransition>
static const int MAX_BOMB = 5;
diff --git a/examples/animation/sub-attaq/bomb.cpp b/examples/animation/sub-attaq/bomb.cpp
index 04310aa..f1f5324 100644
--- a/examples/animation/sub-attaq/bomb.cpp
+++ b/examples/animation/sub-attaq/bomb.cpp
@@ -47,18 +47,10 @@
#include "qanimationstate.h"
//Qt
-
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-#include "qpropertyanimation.h"
-#include "qsequentialanimationgroup.h"
-#include "qstatemachine.h"
-#include "qfinalstate.h"
-#else
#include <QtCore/QSequentialAnimationGroup>
#include <QtCore/QPropertyAnimation>
#include <QtCore/QStateMachine>
#include <QtCore/QFinalState>
-#endif
Bomb::Bomb(QGraphicsItem * parent, Qt::WindowFlags wFlags)
: QGraphicsWidget(parent,wFlags), launchAnimation(0)
diff --git a/examples/animation/sub-attaq/bomb.h b/examples/animation/sub-attaq/bomb.h
index 9191e6e..cfd42e5 100644
--- a/examples/animation/sub-attaq/bomb.h
+++ b/examples/animation/sub-attaq/bomb.h
@@ -43,20 +43,14 @@
#define __BOMB__H__
//Qt
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qanimationgroup.h"
-# include "qgraphicswidget.h"
-#else
-# include <QtGui/QGraphicsWidget>
-# include <QtCore/QAnimationGroup>
-#endif
+#include <QtGui/QGraphicsWidget>
+#include <QtCore/QAnimationGroup>
class PixmapItem;
class Bomb : public QGraphicsWidget
{
Q_OBJECT
-Q_PROPERTY(QPointF pos READ pos WRITE setPos)
public:
enum Direction {
Left = 0,
@@ -66,7 +60,7 @@ public:
void launch(Direction direction);
void destroy();
-Q_SIGNALS:
+signals:
void bombExplosed();
void bombExecutionFinished();
diff --git a/examples/animation/sub-attaq/custompropertyanimation.cpp b/examples/animation/sub-attaq/custompropertyanimation.cpp
index f7ab269..8226cca 100644
--- a/examples/animation/sub-attaq/custompropertyanimation.cpp
+++ b/examples/animation/sub-attaq/custompropertyanimation.cpp
@@ -44,9 +44,6 @@
// Qt
#include <QtCore/qdebug.h>
-QT_BEGIN_NAMESPACE
-
-
CustomPropertyAnimation::CustomPropertyAnimation(QObject *parent) :
QVariantAnimation(parent), animProp(0)
{
@@ -108,8 +105,4 @@ void CustomPropertyAnimation::updateState(QAbstractAnimation::State oldState, QA
QVariantAnimation::updateState(oldState, newState);
}
-
-
#include "moc_custompropertyanimation.cpp"
-
-QT_END_NAMESPACE
diff --git a/examples/animation/sub-attaq/custompropertyanimation.h b/examples/animation/sub-attaq/custompropertyanimation.h
index 48a50c9..8654aeb 100644
--- a/examples/animation/sub-attaq/custompropertyanimation.h
+++ b/examples/animation/sub-attaq/custompropertyanimation.h
@@ -42,13 +42,11 @@
#ifndef CUSTOMPROPERTYANIMATION_H
#define CUSTOMPROPERTYANIMATION_H
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qvariantanimation.h"
-#else
-# include <QtCore/qvariantanimation.h>
-#endif
+#include <QtCore/qvariantanimation.h>
+QT_BEGIN_NAMESPACE
class QGraphicsItem;
+QT_END_NAMESPACE
struct AbstractProperty
{
diff --git a/examples/animation/sub-attaq/graphicsscene.cpp b/examples/animation/sub-attaq/graphicsscene.cpp
index 2a6f83c..e773dae 100644
--- a/examples/animation/sub-attaq/graphicsscene.cpp
+++ b/examples/animation/sub-attaq/graphicsscene.cpp
@@ -53,21 +53,12 @@
#include "progressitem.h"
//Qt
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-#include "qpropertyanimation.h"
-#include "qsequentialanimationgroup.h"
-#include "qparallelanimationgroup.h"
-#include "qstatemachine.h"
-#include "qfinalstate.h"
-#include "qpauseanimation.h"
-#else
#include <QtCore/QPropertyAnimation>
#include <QtCore/QSequentialAnimationGroup>
#include <QtCore/QParallelAnimationGroup>
#include <QtCore/QStateMachine>
#include <QtCore/QFinalState>
#include <QtCore/QPauseAnimation>
-#endif
#include <QtGui/QAction>
#include <QtCore/QDir>
#include <QtGui/QApplication>
@@ -129,7 +120,7 @@ GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode)
//parse the xml that contain all data of the game
QXmlStreamReader reader;
- QFile file(QDir::currentPath() + "/data.xml");
+ QFile file(":data.xml");
file.open(QIODevice::ReadOnly);
reader.setDevice(&file);
LevelDescription currentLevel;
diff --git a/examples/animation/sub-attaq/graphicsscene.h b/examples/animation/sub-attaq/graphicsscene.h
index 0840564..1e6618a 100644
--- a/examples/animation/sub-attaq/graphicsscene.h
+++ b/examples/animation/sub-attaq/graphicsscene.h
@@ -45,12 +45,7 @@
//Qt
#include <QtGui/QGraphicsScene>
#include <QtCore/QSet>
-
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qstate.h"
-#else
-# include <QtCore/QState>
-#endif
+#include <QtCore/QState>
class Boat;
@@ -59,7 +54,9 @@ class Torpedo;
class Bomb;
class PixmapItem;
class ProgressItem;
+QT_BEGIN_NAMESPACE
class QAction;
+QT_END_NAMESPACE
class GraphicsScene : public QGraphicsScene
{
@@ -93,7 +90,7 @@ public:
void clearScene();
QGraphicsPixmapItem *addWelcomeItem(const QPixmap &pm);
-Q_SIGNALS:
+signals:
void subMarineDestroyed(int);
void allSubMarineDestroyed(int);
diff --git a/examples/animation/sub-attaq/mainwindow.cpp b/examples/animation/sub-attaq/mainwindow.cpp
index a166241..5e8e259 100644
--- a/examples/animation/sub-attaq/mainwindow.cpp
+++ b/examples/animation/sub-attaq/mainwindow.cpp
@@ -43,11 +43,14 @@
#include "mainwindow.h"
#include "graphicsscene.h"
-#ifndef QT_NO_OPENGL
+//Qt
+#ifdef QT_NO_OPENGL
+ #include <QtGui/QMenuBar>
+ #include <QtGui/QLayout>
+ #include <QtGui/QApplication>
+#else
#include <QtOpenGL/QtOpenGL>
#endif
-//Qt
-#include <QtGui/QGraphicsView>
MainWindow::MainWindow() : QMainWindow(0)
{
diff --git a/examples/animation/sub-attaq/mainwindow.h b/examples/animation/sub-attaq/mainwindow.h
index 72d1324..87f194a 100644
--- a/examples/animation/sub-attaq/mainwindow.h
+++ b/examples/animation/sub-attaq/mainwindow.h
@@ -44,9 +44,10 @@
//Qt
#include <QtGui/QMainWindow>
-
class GraphicsScene;
+QT_BEGIN_NAMESPACE
class QGraphicsView;
+QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
diff --git a/examples/animation/sub-attaq/qanimationstate.cpp b/examples/animation/sub-attaq/qanimationstate.cpp
index 0f30ac2..d4d109c 100644
--- a/examples/animation/sub-attaq/qanimationstate.cpp
+++ b/examples/animation/sub-attaq/qanimationstate.cpp
@@ -41,14 +41,7 @@
#include "qanimationstate.h"
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qstate.h"
-# include "qstate_p.h"
-#else
-# include <QtCore/qstate.h>
-# include <private/qstate_p.h>
-#endif
-
+#include <QtCore/qstate.h>
QT_BEGIN_NAMESPACE
@@ -81,25 +74,11 @@ machine.start();
#ifndef QT_NO_ANIMATION
-class QAnimationStatePrivate : public QStatePrivate
-{
- Q_DECLARE_PUBLIC(QAnimationState)
-public:
- QAnimationStatePrivate()
- : animation(0)
- {
-
- }
- ~QAnimationStatePrivate() {}
-
- QAbstractAnimation *animation;
-};
-
/*!
Constructs a new state with the given \a parent state.
*/
QAnimationState::QAnimationState(QState *parent)
- : QState(*new QAnimationStatePrivate, parent)
+ : QState(parent), m_animation(0)
{
}
@@ -117,20 +96,18 @@ QAnimationState::~QAnimationState()
*/
void QAnimationState::setAnimation(QAbstractAnimation *animation)
{
- Q_D(QAnimationState);
-
- if (animation == d->animation)
+ if (animation == m_animation)
return;
//Disconnect from the previous animation if exist
- if(d->animation)
- disconnect(d->animation, SIGNAL(finished()), this, SIGNAL(animationFinished()));
+ if(m_animation)
+ disconnect(m_animation, SIGNAL(finished()), this, SIGNAL(animationFinished()));
- d->animation = animation;
+ m_animation = animation;
- if (d->animation) {
+ if (m_animation) {
//connect the new animation
- connect(d->animation, SIGNAL(finished()), this, SIGNAL(animationFinished()));
+ connect(m_animation, SIGNAL(finished()), this, SIGNAL(animationFinished()));
}
}
@@ -139,8 +116,7 @@ void QAnimationState::setAnimation(QAbstractAnimation *animation)
*/
QAbstractAnimation* QAnimationState::animation() const
{
- Q_D(const QAnimationState);
- return d->animation;
+ return m_animation;
}
/*!
@@ -148,9 +124,8 @@ QAbstractAnimation* QAnimationState::animation() const
*/
void QAnimationState::onEntry(QEvent *)
{
- Q_D(QAnimationState);
- if (d->animation)
- d->animation->start();
+ if (m_animation)
+ m_animation->start();
}
/*!
@@ -158,9 +133,8 @@ void QAnimationState::onEntry(QEvent *)
*/
void QAnimationState::onExit(QEvent *)
{
- Q_D(QAnimationState);
- if (d->animation)
- d->animation->stop();
+ if (m_animation)
+ m_animation->stop();
}
/*!
diff --git a/examples/animation/sub-attaq/qanimationstate.h b/examples/animation/sub-attaq/qanimationstate.h
index 88c0a6d..72bb2d9 100644
--- a/examples/animation/sub-attaq/qanimationstate.h
+++ b/examples/animation/sub-attaq/qanimationstate.h
@@ -58,7 +58,7 @@ QT_MODULE(Gui)
#ifndef QT_NO_ANIMATION
-class QAnimationStatePrivate;
+class QAbstractAnimation;
class QAnimationState : public QState
{
@@ -70,7 +70,7 @@ public:
void setAnimation(QAbstractAnimation *animation);
QAbstractAnimation* animation() const;
-Q_SIGNALS:
+signals:
void animationFinished();
protected:
@@ -80,7 +80,7 @@ protected:
private:
Q_DISABLE_COPY(QAnimationState)
- Q_DECLARE_PRIVATE(QAnimationState)
+ QAbstractAnimation *m_animation;
};
#endif
diff --git a/examples/animation/sub-attaq/states.cpp b/examples/animation/sub-attaq/states.cpp
index 7650b0f..adc8bd0 100644
--- a/examples/animation/sub-attaq/states.cpp
+++ b/examples/animation/sub-attaq/states.cpp
@@ -51,17 +51,10 @@
//Qt
#include <QtGui/QMessageBox>
#include <QtGui/QGraphicsView>
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-#include "qstatemachine.h"
-#include "qkeyeventtransition.h"
-#include "qsignalevent.h"
-#include "qfinalstate.h"
-#else
#include <QtCore/QStateMachine>
#include <QtGui/QKeyEventTransition>
#include <QtCore/QSignalEvent>
#include <QtCore/QFinalState>
-#endif
PlayState::PlayState(GraphicsScene *scene, QState *parent)
: QState(parent),
diff --git a/examples/animation/sub-attaq/states.h b/examples/animation/sub-attaq/states.h
index a1cb5ff..71375e0 100644
--- a/examples/animation/sub-attaq/states.h
+++ b/examples/animation/sub-attaq/states.h
@@ -43,23 +43,18 @@
#define STATES_H
//Qt
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-#include "qstate.h"
-#include "qsignaltransition.h"
-#include "qpropertyanimation.h"
-#include "qkeyeventtransition.h"
-#else
#include <QtCore/QState>
#include <QtCore/QSignalTransition>
#include <QtCore/QPropertyAnimation>
-# include <QtGui/QKeyEventTransition>
-#endif
+#include <QtGui/QKeyEventTransition>
#include <QtCore/QSet>
class GraphicsScene;
class Boat;
class SubMarine;
+QT_BEGIN_NAMESPACE
class QStateMachine;
+QT_END_NAMESPACE
class PlayState : public QState
{
diff --git a/examples/animation/sub-attaq/sub-attaq.pro b/examples/animation/sub-attaq/sub-attaq.pro
index 961a9b5..d13a099 100644
--- a/examples/animation/sub-attaq/sub-attaq.pro
+++ b/examples/animation/sub-attaq/sub-attaq.pro
@@ -1,14 +1,5 @@
-# #####################################################################
-# Automatically generated by qmake (2.01a) Thu Oct 9 10:53:30 2008
-# #####################################################################
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-QT += xml
contains(QT_CONFIG, opengl):QT += opengl
-# Input
HEADERS += boat.h \
bomb.h \
mainwindow.h \
@@ -37,3 +28,9 @@ SOURCES += boat.cpp \
qanimationstate.cpp \
progressitem.cpp
RESOURCES += subattaq.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/animation/sub-attaq
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS sub-attaq.pro pics
+sources.path = $$[QT_INSTALL_EXAMPLES]/animation/sub-attaq
+INSTALLS += target sources
diff --git a/examples/animation/sub-attaq/subattaq.qrc b/examples/animation/sub-attaq/subattaq.qrc
index c76f8ef..80a3af1 100644
--- a/examples/animation/sub-attaq/subattaq.qrc
+++ b/examples/animation/sub-attaq/subattaq.qrc
@@ -34,5 +34,6 @@
<file alias="big/explosion/submarine/step2" >pics/big/explosion/submarine/step2.png</file>
<file alias="big/explosion/submarine/step3" >pics/big/explosion/submarine/step3.png</file>
<file alias="big/explosion/submarine/step4" >pics/big/explosion/submarine/step4.png</file>
+ <file>data.xml</file>
</qresource>
</RCC>
diff --git a/examples/animation/sub-attaq/submarine.cpp b/examples/animation/sub-attaq/submarine.cpp
index 0f03efc..d8cf1da 100644
--- a/examples/animation/sub-attaq/submarine.cpp
+++ b/examples/animation/sub-attaq/submarine.cpp
@@ -49,18 +49,10 @@
#include "custompropertyanimation.h"
#include "qanimationstate.h"
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qpropertyanimation.h"
-# include "qstatemachine.h"
-# include "qfinalstate.h"
-# include "qsequentialanimationgroup.h"
-# include "qpauseanimation.h"
-#else
#include <QtCore/QPropertyAnimation>
#include <QtCore/QStateMachine>
#include <QtCore/QFinalState>
#include <QtCore/QSequentialAnimationGroup>
-#endif
static QAbstractAnimation *setupDestroyAnimation(SubMarine *sub)
{
diff --git a/examples/animation/sub-attaq/submarine.h b/examples/animation/sub-attaq/submarine.h
index 7ee587d..b8dd2da 100644
--- a/examples/animation/sub-attaq/submarine.h
+++ b/examples/animation/sub-attaq/submarine.h
@@ -43,13 +43,8 @@
#define __SUBMARINE__H__
//Qt
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-#include "qvariantanimation.h"
-#include "qgraphicswidget.h"
-#else
#include <QtCore/QVariantAnimation>
#include <QtGui/QGraphicsWidget>
-#endif
class PixmapItem;
@@ -80,7 +75,7 @@ public:
virtual int type() const;
-Q_SIGNALS:
+signals:
void subMarineDestroyed();
void subMarineExecutionFinished();
void subMarineStateChanged();
diff --git a/examples/animation/sub-attaq/submarine_p.h b/examples/animation/sub-attaq/submarine_p.h
index c76d991..8c31eb7 100644
--- a/examples/animation/sub-attaq/submarine_p.h
+++ b/examples/animation/sub-attaq/submarine_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -42,17 +42,24 @@
#ifndef SUBMARINE_P_H
#define SUBMARINE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
//Own
#include "animationmanager.h"
#include "submarine.h"
#include "qanimationstate.h"
//Qt
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-#include "qpropertyanimation.h"
-#else
#include <QtCore/QPropertyAnimation>
-#endif
#include <QtGui/QGraphicsScene>
//This state is describing when the boat is moving right
diff --git a/examples/animation/sub-attaq/torpedo.cpp b/examples/animation/sub-attaq/torpedo.cpp
index 88f1112..02a54fc 100644
--- a/examples/animation/sub-attaq/torpedo.cpp
+++ b/examples/animation/sub-attaq/torpedo.cpp
@@ -47,15 +47,9 @@
#include "animationmanager.h"
#include "qanimationstate.h"
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-#include "qpropertyanimation.h"
-#include "qstatemachine.h"
-#include "qfinalstate.h"
-#else
#include <QtCore/QPropertyAnimation>
#include <QtCore/QStateMachine>
#include <QtCore/QFinalState>
-#endif
Torpedo::Torpedo(QGraphicsItem * parent, Qt::WindowFlags wFlags)
: QGraphicsWidget(parent,wFlags), currentSpeed(0), launchAnimation(0)
diff --git a/examples/animation/sub-attaq/torpedo.h b/examples/animation/sub-attaq/torpedo.h
index 2e44e41..f5ab614 100644
--- a/examples/animation/sub-attaq/torpedo.h
+++ b/examples/animation/sub-attaq/torpedo.h
@@ -45,27 +45,21 @@
//Qt
#include <QtCore/QObject>
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qvariantanimation.h"
-# include "qgraphicswidget.h"
-#else
-# include <QtCore/QVariantAnimation>
-# include <QtGui/QGraphicsWidget>
-#endif
+#include <QtCore/QVariantAnimation>
+#include <QtGui/QGraphicsWidget>
class PixmapItem;
class Torpedo : public QGraphicsWidget
{
Q_OBJECT
-Q_PROPERTY(QPointF pos READ pos WRITE setPos)
public:
Torpedo(QGraphicsItem * parent = 0, Qt::WindowFlags wFlags = 0);
void launch();
void setCurrentSpeed(int speed);
void destroy();
-Q_SIGNALS:
+signals:
void torpedoExplosed();
void torpedoExecutionFinished();
diff --git a/examples/examples.pro b/examples/examples.pro
index 4677a23..8a20845 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -1,5 +1,6 @@
TEMPLATE = subdirs
SUBDIRS = \
+ animation \
desktop \
dialogs \
draganddrop \
@@ -26,7 +27,6 @@ SUBDIRS = \
contains(QT_CONFIG, phonon):!static: SUBDIRS += phonon
contains(QT_CONFIG, webkit): SUBDIRS += webkit
-contains(QT_CONFIG, animation): SUBDIRS += animation
embedded:SUBDIRS += qws
!wince*: {
!contains(QT_EDITION, Console):contains(QT_BUILD_PARTS, tools):SUBDIRS += designer
diff --git a/examples/itemviews/puzzle/puzzle.pro b/examples/itemviews/puzzle/puzzle.pro
index deed112..4f5aaad 100644
--- a/examples/itemviews/puzzle/puzzle.pro
+++ b/examples/itemviews/puzzle/puzzle.pro
@@ -12,3 +12,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/puzzle
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.jpg
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/puzzle
INSTALLS += target sources
+
+wince* {
+ DEPLOYMENT_PLUGIN += qjpeg qgif qtiff
+}
+
diff --git a/examples/network/googlesuggest/googlesuggest.pro b/examples/network/googlesuggest/googlesuggest.pro
index afd600f..33b79de 100644
--- a/examples/network/googlesuggest/googlesuggest.pro
+++ b/examples/network/googlesuggest/googlesuggest.pro
@@ -3,7 +3,7 @@ SOURCES = main.cpp searchbox.cpp googlesuggest.cpp
HEADERS = searchbox.h googlesuggest.h
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/webkit/googlesuggest
+target.path = $$[QT_INSTALL_EXAMPLES]/network/googlesuggest
sources.files = $$SOURCES $$HEADERS *.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/googlesuggest
+sources.path = $$[QT_INSTALL_EXAMPLES]/network/googlesuggest
INSTALLS += target sources
diff --git a/examples/opengl/framebufferobject/glwidget.cpp b/examples/opengl/framebufferobject/glwidget.cpp
index d3591d6..3cb3929 100644
--- a/examples/opengl/framebufferobject/glwidget.cpp
+++ b/examples/opengl/framebufferobject/glwidget.cpp
@@ -53,7 +53,18 @@ GLWidget::GLWidget(QWidget *parent)
{
setWindowTitle(tr("OpenGL framebuffer objects"));
makeCurrent();
- fbo = new QGLFramebufferObject(1024, 1024);
+
+ if (QGLFramebufferObject::hasOpenGLFramebufferBlit()) {
+ QGLFramebufferObjectFormat format;
+ format.setSamples(4);
+
+ render_fbo = new QGLFramebufferObject(512, 512, format);
+ texture_fbo = new QGLFramebufferObject(512, 512);
+ } else {
+ render_fbo = new QGLFramebufferObject(1024, 1024);
+ texture_fbo = render_fbo;
+ }
+
rot_x = rot_y = rot_z = 0.0f;
scale = 0.1f;
anim = new QTimeLine(750, this);
@@ -113,7 +124,9 @@ GLWidget::~GLWidget()
{
delete[] wave;
glDeleteLists(tile_list, 1);
- delete fbo;
+ delete texture_fbo;
+ if (render_fbo != texture_fbo)
+ delete render_fbo;
}
void GLWidget::paintEvent(QPaintEvent *)
@@ -129,10 +142,16 @@ void GLWidget::draw()
saveGLState();
// render the 'bubbles.svg' file into our framebuffer object
- QPainter fbo_painter(fbo);
+ QPainter fbo_painter(render_fbo);
svg_renderer->render(&fbo_painter);
fbo_painter.end();
+ if (render_fbo != texture_fbo) {
+ QRect rect(0, 0, render_fbo->width(), render_fbo->height());
+ QGLFramebufferObject::blitFramebuffer(texture_fbo, rect,
+ render_fbo, rect);
+ }
+
// draw into the GL widget
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
@@ -145,8 +164,9 @@ void GLWidget::draw()
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glBindTexture(GL_TEXTURE_2D, fbo->texture());
+ glBindTexture(GL_TEXTURE_2D, texture_fbo->texture());
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glEnable(GL_TEXTURE_2D);
glEnable(GL_MULTISAMPLE);
glEnable(GL_CULL_FACE);
diff --git a/examples/opengl/framebufferobject/glwidget.h b/examples/opengl/framebufferobject/glwidget.h
index b64cfa8..d97ef78 100644
--- a/examples/opengl/framebufferobject/glwidget.h
+++ b/examples/opengl/framebufferobject/glwidget.h
@@ -77,6 +77,7 @@ private:
QImage logo;
QTimeLine *anim;
QSvgRenderer *svg_renderer;
- QGLFramebufferObject *fbo;
+ QGLFramebufferObject *render_fbo;
+ QGLFramebufferObject *texture_fbo;
};
diff --git a/examples/qtconcurrent/imagescaling/imagescaling.pro b/examples/qtconcurrent/imagescaling/imagescaling.pro
index fbf864a..0a25efb 100644
--- a/examples/qtconcurrent/imagescaling/imagescaling.pro
+++ b/examples/qtconcurrent/imagescaling/imagescaling.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/imagescaling
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/imagescaling
INSTALLS += target sources
+
+wince*: DEPLOYMENT_PLUGIN += qgif qjpeg qtiff
diff --git a/examples/qtconcurrent/qtconcurrent.pro b/examples/qtconcurrent/qtconcurrent.pro
index 53008f0..5d73533 100644
--- a/examples/qtconcurrent/qtconcurrent.pro
+++ b/examples/qtconcurrent/qtconcurrent.pro
@@ -1,10 +1,13 @@
TEMPLATE = subdirs
SUBDIRS = imagescaling \
map \
- progressdialog \
runfunction \
wordcount
+!wince* {
+ SUBDIRS += progressdialog
+}
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qtconcurrent.pro README
diff --git a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro
index 1881fce..c216a30 100644
--- a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro
+++ b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro
@@ -8,3 +8,6 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/sqlwidgetmapper
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/sqlwidgetmapper
INSTALLS += target sources
+
+wince*: DEPLOYMENT_PLUGIN += qsqlite
+
diff --git a/examples/statemachine/citizenquartz/citizenquartz.pro b/examples/statemachine/citizenquartz/citizenquartz.pro
deleted file mode 100644
index 58039a0..0000000
--- a/examples/statemachine/citizenquartz/citizenquartz.pro
+++ /dev/null
@@ -1,20 +0,0 @@
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp \
- clock.cpp \
- clockbutton.cpp \
- clockdisplay.cpp \
- propertyaddstate.cpp \
-
-HEADERS += clock.h \
- clockbutton.h \
- clockdisplay.h \
- propertyaddstate.h \
- timeperiod.h \
-
-RESOURCES += citizenquartz.qrc
-CONFIG += console
diff --git a/examples/statemachine/citizenquartz/citizenquartz.qrc b/examples/statemachine/citizenquartz/citizenquartz.qrc
deleted file mode 100644
index fc09ef9..0000000
--- a/examples/statemachine/citizenquartz/citizenquartz.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>sound/alarm.wav</file>
- <file>images/alarm.png</file>
-</qresource>
-</RCC> \ No newline at end of file
diff --git a/examples/statemachine/citizenquartz/clock.cpp b/examples/statemachine/citizenquartz/clock.cpp
deleted file mode 100644
index 1b2b21e..0000000
--- a/examples/statemachine/citizenquartz/clock.cpp
+++ /dev/null
@@ -1,390 +0,0 @@
-#include "clock.h"
-#include "clockbutton.h"
-#include "clockdisplay.h"
-#include "propertyaddstate.h"
-#include "timeperiod.h"
-
-#include <QStateMachine>
-#include <QState>
-#include <QHistoryState>
-
-#include <QPainter>
-#include <QTimer>
-#include <QSound>
-
-Clock::Clock(QGraphicsItem *parent)
- : QGraphicsItem(parent),
- m_stateMachine(0),
- m_clockDisplay(0),
- m_buttonA(0),
- m_buttonB(0),
- m_buttonC(0),
- m_buttonD(0),
- m_alarmState(0),
- m_timeState(0),
- m_updateState(0),
- m_regularState(0),
- m_displaysHistoryState(0),
- m_alarmSound(new QSound(":/sound/alarm.wav", this))
-{
-}
-
-void Clock::initializeUi()
-{
- QPainterPath path = shape();
- QPointF pap;
- qreal aap;
-
- m_buttonA = new ClockButton("Button A", this);
- pap = path.pointAtPercent(0.05);
- aap = path.angleAtPercent(0.05);
- m_buttonA->translate(pap.x(), pap.y());
- m_buttonA->rotate(-aap);
- connect(m_buttonA, SIGNAL(pressed()), this, SIGNAL(anyButtonPressed()));
-
- m_buttonB = new ClockButton("Button B", this);
- pap = path.pointAtPercent(0.77);
- aap = path.angleAtPercent(0.77);
- m_buttonB->translate(pap.x(), pap.y());
- m_buttonB->rotate(-aap);
- connect(m_buttonB, SIGNAL(pressed()), this, SIGNAL(anyButtonPressed()));
-
- m_buttonC = new ClockButton("Button C", this);
- pap = path.pointAtPercent(0.67);
- aap = path.angleAtPercent(0.67);
- m_buttonC->translate(pap.x(), pap.y());
- m_buttonC->rotate(-aap);
- connect(m_buttonC, SIGNAL(pressed()), this, SIGNAL(anyButtonPressed()));
-
- m_buttonD = new ClockButton("Button D", this);
- pap = path.pointAtPercent(0.57);
- aap = path.angleAtPercent(0.57);
- m_buttonD->translate(pap.x(), pap.y());
- m_buttonD->rotate(-aap);
- connect(m_buttonD, SIGNAL(pressed()), this, SIGNAL(anyButtonPressed()));
-
- QGraphicsSimpleTextItem *label = new QGraphicsSimpleTextItem(this);
- label->setText("CITIZEN");
- label->setPos(0.0 - label->boundingRect().width() / 2.0, -100.0);
-
- m_clockDisplay = new ClockDisplay(this);
- m_clockDisplay->setCurrentTime(QDateTime::currentDateTime());
-
- QTimer *timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(updateTime()));
- timer->setInterval(1);
- timer->start();
- m_time.start();
-}
-
-void Clock::initializeStateMachine()
-{
- m_stateMachine = new QStateMachine;
-
- QState *displays = new QState(m_stateMachine->rootState());
- displays->setObjectName("displays");
- initializeDisplaysState(displays);
-
- QState *alarmsBeepState = new QState(m_stateMachine->rootState());
- alarmsBeepState->setObjectName("alarmsBeep");
- alarmsBeepState->invokeMethodOnEntry(this, "playSound");
- alarmsBeepState->invokeMethodOnExit(this, "stopSound");
-
- QTimer *alarmTimeOut = new QTimer(alarmsBeepState);
- alarmTimeOut->setInterval(30000);
- alarmsBeepState->invokeMethodOnEntry(alarmTimeOut, "start");
- alarmsBeepState->invokeMethodOnExit(alarmTimeOut, "stop");
-
- displays->addTransition(m_clockDisplay, SIGNAL(alarmTriggered()), alarmsBeepState);
- alarmsBeepState->addTransition(this, SIGNAL(anyButtonPressed()), m_displaysHistoryState);
- alarmsBeepState->addTransition(alarmTimeOut, SIGNAL(timeout()), m_displaysHistoryState);
-
- m_stateMachine->setInitialState(displays);
- m_stateMachine->start();
-}
-
-void Clock::initializeUpdateState(QState *updateState)
-{
- QState *sec = new QState(updateState);
- sec->setObjectName("sec");
- sec->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::EditSecondMode);
- updateState->setInitialState(sec);
-
- PropertyAddState *secIncrease = new PropertyAddState(updateState);
- secIncrease->setObjectName("sec ++");
- secIncrease->addToProperty(m_clockDisplay, "currentTime", TimePeriod().setSeconds(1));
- sec->addTransition(m_buttonD, SIGNAL(pressed()), secIncrease);
- secIncrease->addTransition(sec);
-
- QState *oneMin = new QState(updateState);
- oneMin->setObjectName("1 min");
- oneMin->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::EditMinuteMode);
- sec->addTransition(m_buttonC, SIGNAL(pressed()), oneMin);
-
- PropertyAddState *oneMinIncrease = new PropertyAddState(updateState);
- oneMinIncrease->setObjectName("1 min ++");
- oneMinIncrease->addToProperty(m_clockDisplay, "currentTime", TimePeriod().setMinutes(1));
- oneMin->addTransition(m_buttonD, SIGNAL(pressed()), oneMinIncrease);
- oneMinIncrease->addTransition(oneMin);
-
- QState *tenMin = new QState(updateState);
- tenMin->setObjectName("10 min");
- tenMin->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::EditMinuteMode);
- oneMin->addTransition(m_buttonC, SIGNAL(pressed()), tenMin);
-
- PropertyAddState *tenMinIncrease = new PropertyAddState(updateState);
- tenMinIncrease->setObjectName("10 min ++");
- tenMinIncrease->addToProperty(m_clockDisplay, "currentTime", TimePeriod().setMinutes(10));
- tenMin->addTransition(m_buttonD, SIGNAL(pressed()), tenMinIncrease);
- tenMinIncrease->addTransition(tenMin);
-
- QState *hr = new QState(updateState);
- hr->setObjectName("hr");
- hr->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::EditHourMode);
- tenMin->addTransition(m_buttonC, SIGNAL(pressed()), hr);
-
- PropertyAddState *hrIncrease = new PropertyAddState(updateState);
- hrIncrease->setObjectName("hr ++");
- hrIncrease->addToProperty(m_clockDisplay, "currentTime", TimePeriod().setHours(1));
- hr->addTransition(m_buttonD, SIGNAL(pressed()), hrIncrease);
- hrIncrease->addTransition(hr);
-
- QState *mon = new QState(updateState);
- mon->setObjectName("mon");
- mon->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::EditMonthMode);
- hr->addTransition(m_buttonC, SIGNAL(pressed()), mon);
-
- PropertyAddState *monIncrease = new PropertyAddState(updateState);
- monIncrease->setObjectName("mon ++");
- monIncrease->addToProperty(m_clockDisplay, "currentTime", TimePeriod().setMonths(1));
- mon->addTransition(m_buttonD, SIGNAL(pressed()), monIncrease);
- monIncrease->addTransition(mon);
-
- QState *day = new QState(updateState);
- day->setObjectName("day");
- day->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::EditDayMode);
- mon->addTransition(m_buttonC, SIGNAL(pressed()), day);
-
- PropertyAddState *dayIncrease = new PropertyAddState(updateState);
- dayIncrease->setObjectName("day ++");
- dayIncrease->addToProperty(m_clockDisplay, "currentTime", TimePeriod().setDays(1));
- day->addTransition(m_buttonD, SIGNAL(pressed()), dayIncrease);
- dayIncrease->addTransition(day);
-
- QState *year = new QState(updateState);
- year->setObjectName("year");
- year->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::EditYearMode);
- day->addTransition(m_buttonC, SIGNAL(pressed()), year);
-
- PropertyAddState *yearIncrease = new PropertyAddState(updateState);
- yearIncrease->setObjectName("year ++");
- yearIncrease->addToProperty(m_clockDisplay, "currentTime", TimePeriod().setYears(1));
- year->addTransition(m_buttonD, SIGNAL(pressed()), yearIncrease);
- yearIncrease->addTransition(year);
- year->addTransition(m_buttonC, SIGNAL(pressed()), m_timeState);
-}
-
-void Clock::initializeRegularState(QState *regular)
-{
- m_timeState = new QState(regular);
- m_timeState->setObjectName("time");
- m_timeState->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::CurrentTimeMode);
-
- QState *date = new QState(regular);
- date->setObjectName("date");
- date->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::CurrentDateMode);
-
- QState *dateTimerState = new QState(date);
- dateTimerState->setObjectName("dateTimerState");
-
- // Date state exits after 2 m
- QTimer *dateTimer = new QTimer(dateTimerState);
- dateTimer->setSingleShot(true);
- dateTimer->setInterval(2*60000);
- dateTimerState->invokeMethodOnEntry(dateTimer, "start");
- dateTimerState->invokeMethodOnExit(dateTimer, "stop");
-
- date->setInitialState(dateTimerState);
-
- m_updateState = new QState(regular);
- m_updateState->setObjectName("update");
-
- // Update state exits after 2 m
- QTimer *updateTimer = new QTimer(m_updateState);
- updateTimer->setSingleShot(true);
- updateTimer->setInterval(2 * 60000);
- m_updateState->invokeMethodOnEntry(updateTimer, "start");
- m_updateState->invokeMethodOnExit(updateTimer, "stop");
-
- initializeUpdateState(m_updateState);
-
- m_timeState->addTransition(m_buttonD, SIGNAL(pressed()), date);
- date->addTransition(m_buttonD, SIGNAL(pressed()), m_timeState);
- date->addTransition(dateTimer, SIGNAL(timeout()), m_timeState);
-
- m_updateState->addTransition(updateTimer, SIGNAL(timeout()), m_timeState);
- m_updateState->addTransition(m_buttonB, SIGNAL(pressed()), m_timeState);
-
- regular->setInitialState(m_timeState);
-}
-
-void Clock::initializeAlarmUpdateState(QState *update)
-{
- QState *hr = new QState(update);
- hr->setObjectName("hr");
- hr->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::EditAlarmHourMode);
-
- PropertyAddState *hrInc = new PropertyAddState(update);
- hrInc->setObjectName("hr ++");
- hrInc->addToProperty(m_clockDisplay, "alarm", TimePeriod().setHours(1));
- hr->addTransition(m_buttonD, SIGNAL(pressed()), hrInc);
- hrInc->addTransition(hr);
-
- QState *tenMin = new QState(update);
- tenMin->setObjectName("10 min");
- tenMin->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::EditAlarmTenMinuteMode);
- hr->addTransition(m_buttonC, SIGNAL(pressed()), tenMin);
-
- PropertyAddState *tenMinInc = new PropertyAddState(update);
- tenMinInc->setObjectName("10 min ++");
- tenMinInc->addToProperty(m_clockDisplay, "alarm", TimePeriod().setMinutes(10));
- tenMin->addTransition(m_buttonD, SIGNAL(pressed()), tenMinInc);
- tenMinInc->addTransition(tenMin);
-
- QState *oneMin = new QState(update);
- oneMin->setObjectName("1 min");
- oneMin->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::EditAlarmMinuteMode);
- tenMin->addTransition(m_buttonC, SIGNAL(pressed()), oneMin);
-
- PropertyAddState *oneMinInc = new PropertyAddState(update);
- oneMinInc->setObjectName("1 min ++");
- oneMinInc->addToProperty(m_clockDisplay, "alarm", TimePeriod().setMinutes(1));
- oneMin->addTransition(m_buttonD, SIGNAL(pressed()), oneMinInc);
- oneMinInc->addTransition(oneMin);
-
- oneMin->addTransition(m_buttonC, SIGNAL(pressed()), m_alarmState);
- m_alarmState->addTransition(m_buttonC, SIGNAL(pressed()), hr);
-}
-
-void Clock::initializeOutState(QState *out)
-{
- m_alarmState = new QState(out);
- m_alarmState->setObjectName("alarmState");
- m_alarmState->setPropertyOnEntry(m_clockDisplay, "displayMode", ClockDisplay::AlarmMode);
- initializeAlarmState(m_alarmState);
- out->setInitialState(m_alarmState);
-
- QState *alarmUpdate = new QState(out);
- alarmUpdate->setObjectName("alarmUpdate");
- initializeAlarmUpdateState(alarmUpdate);
-
- alarmUpdate->addTransition(m_buttonB, SIGNAL(pressed()), m_alarmState);
- m_alarmState->addTransition(m_buttonA, SIGNAL(pressed()), m_regularState);
-}
-
-void Clock::initializeDisplaysState(QState *displays)
-{
- m_regularState = new QState(displays);
- m_regularState->setObjectName("regular");
- initializeRegularState(m_regularState);
- displays->setInitialState(m_regularState);
-
- QState *out = new QState(displays);
- out->setObjectName("out");
-
- QTimer *outTimer = new QTimer(out);
- outTimer->setSingleShot(true);
- outTimer->setInterval(2 * 60000);
- out->invokeMethodOnEntry(outTimer, "start");
- out->invokeMethodOnExit(outTimer, "stop");
-
- initializeOutState(out);
-
- QState *wait = new QState(displays);
- wait->setObjectName("wait");
-
- QTimer *waitTimer = new QTimer(wait);
- waitTimer->setSingleShot(true);
- waitTimer->setInterval(2000);
- wait->invokeMethodOnEntry(waitTimer, "start");
- wait->invokeMethodOnExit(waitTimer, "stop");
-
- m_displaysHistoryState = displays->addHistoryState(QState::DeepHistory);
-
- m_timeState->addTransition(m_buttonC, SIGNAL(pressed()), wait);
- wait->addTransition(waitTimer, SIGNAL(timeout()), m_updateState);
- wait->addTransition(m_buttonC, SIGNAL(released()), m_timeState);
- m_timeState->addTransition(m_buttonA, SIGNAL(pressed()), m_alarmState);
- out->addTransition(outTimer, SIGNAL(timeout()), m_regularState);
-}
-
-void Clock::initializeAlarmState(QState *alarmState)
-{
- QState *offState = new QState(alarmState);
- offState->setObjectName("alarmOff");
- offState->setPropertyOnEntry(m_clockDisplay, "alarmEnabled", false);
-
- QState *onState = new QState(alarmState);
- onState->setObjectName("alarmOn");
- onState->setPropertyOnEntry(m_clockDisplay, "alarmEnabled", true);
-
- QHistoryState *history = alarmState->addHistoryState();
- history->setObjectName("alarmHistory");
- history->setDefaultState(offState);
-
- offState->addTransition(m_buttonD, SIGNAL(pressed()), onState);
- onState->addTransition(m_buttonD, SIGNAL(pressed()), offState);
-
- QState *intermediate = new QState(alarmState);
- intermediate->addTransition(history);
-
- alarmState->setInitialState(intermediate);
-}
-
-QRectF Clock::boundingRect() const
-{
- return shape().boundingRect();
-}
-
-QPainterPath Clock::shape() const
-{
- QPainterPath path;
- path.addRoundedRect(QRectF(-140.0, -100.0, 280.0, 200.0), 50.0, 50.0, Qt::RelativeSize);
-
- return path;
-}
-
-void Clock::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
-{
- painter->setPen(Qt::black);
- painter->setBrush(Qt::NoBrush);
-
- // Clock face
- painter->drawPath(shape());
-}
-
-void Clock::updateTime()
-{
- int elapsed = m_time.elapsed();
- if (elapsed > 0) {
- m_time.restart();
- QDateTime currentTime = m_clockDisplay->currentTime();
- m_clockDisplay->setCurrentTime(currentTime.addMSecs(elapsed));
-
- update();
- }
-}
-
-void Clock::playSound()
-{
- qDebug("playing sound");
- m_alarmSound->stop();
- m_alarmSound->play();
-}
-
-void Clock::stopSound()
-{
- qDebug("stopping sound");
- m_alarmSound->stop();
-}
-
diff --git a/examples/statemachine/citizenquartz/clock.h b/examples/statemachine/citizenquartz/clock.h
deleted file mode 100644
index afd6433..0000000
--- a/examples/statemachine/citizenquartz/clock.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef CLOCK_H
-#define CLOCK_H
-
-#include <QGraphicsItem>
-#include <QTime>
-
-class ClockButton ;
-class ClockDisplay ;
-class QStateMachine ;
-class QState ;
-class QTimerState ;
-class QSound ;
-class QHistoryState ;
-
-class Clock: public QObject, public QGraphicsItem
-{
- Q_OBJECT
-public:
- Clock(QGraphicsItem *parent = 0);
-
- void initializeUi();
- void initializeStateMachine();
-
- virtual QRectF boundingRect() const;
- virtual QPainterPath shape() const;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-
-signals:
- void anyButtonPressed();
-
-public slots:
- void updateTime();
- void playSound();
- void stopSound();
-
-private:
- void initializeDisplaysState(QState *displays);
- void initializeAlarmState(QState *alarmState);
- void initializeRegularState(QState *regular);
- void initializeUpdateState(QState *update);
- void initializeOutState(QState *out);
- void initializeAlarmUpdateState(QState *update);
-
- QStateMachine *m_stateMachine;
- ClockDisplay *m_clockDisplay;
- ClockButton *m_buttonA;
- ClockButton *m_buttonB;
- ClockButton *m_buttonC;
- ClockButton *m_buttonD;
-
- QState *m_alarmState;
- QState *m_timeState;
- QState *m_updateState;
- QState *m_regularState;
-
- QHistoryState *m_displaysHistoryState;
-
- QSound *m_alarmSound;
- QTime m_time;
-};
-
-#endif // CLOCK_H
diff --git a/examples/statemachine/citizenquartz/clockbutton.cpp b/examples/statemachine/citizenquartz/clockbutton.cpp
deleted file mode 100644
index 7b86891..0000000
--- a/examples/statemachine/citizenquartz/clockbutton.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "clockbutton.h"
-
-#include <QPainter>
-
-ClockButton::ClockButton(const QString &name, QGraphicsItem *parent) : QGraphicsItem(parent)
-{
- setObjectName(name);
- setToolTip(name);
- setAcceptedMouseButtons(Qt::LeftButton);
-}
-
-QRectF ClockButton::boundingRect() const
-{
- return QRectF(-10.0, -10.0, 20.0, 20.0);
-}
-
-QPainterPath ClockButton::shape() const
-{
- QPainterPath path;
- path.addRoundedRect(boundingRect(), 15.0, 15.0, Qt::RelativeSize);
-
- return path;
-}
-
-void ClockButton::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
-{
- painter->setBrush(Qt::black);
- painter->drawPath(shape());
-}
-
-void ClockButton::mousePressEvent(QGraphicsSceneMouseEvent *)
-{
- emit pressed();
-}
-
-void ClockButton::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
- emit released();
-} \ No newline at end of file
diff --git a/examples/statemachine/citizenquartz/clockbutton.h b/examples/statemachine/citizenquartz/clockbutton.h
deleted file mode 100644
index 02a7ccd..0000000
--- a/examples/statemachine/citizenquartz/clockbutton.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef CLOCKBUTTON_H
-#define CLOCKBUTTON_H
-
-#include <QGraphicsItem>
-
-class ClockButton: public QObject, public QGraphicsItem
-{
- Q_OBJECT
-public:
- ClockButton(const QString &name, QGraphicsItem *parent = 0);
-
- virtual QRectF boundingRect() const;
- virtual QPainterPath shape() const;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);
-
-protected:
- virtual void mousePressEvent(QGraphicsSceneMouseEvent *);
- virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-
-signals:
- void pressed();
- void released();
-};
-
-#endif //CLOCKBUTTON_H
diff --git a/examples/statemachine/citizenquartz/clockdisplay.cpp b/examples/statemachine/citizenquartz/clockdisplay.cpp
deleted file mode 100644
index db026f5..0000000
--- a/examples/statemachine/citizenquartz/clockdisplay.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-#include "clockdisplay.h"
-
-#include <QPainter>
-#include <QTimer>
-
-ClockDisplay::ClockDisplay(QGraphicsItem *parent)
- : QGraphicsItem(parent),
- m_displayMode(CurrentTimeMode),
- m_currentTime(QDate(1970, 1, 1), QTime(0, 0)),
- m_alarm(0, 0),
- m_alarmEnabled(false),
- m_blink(false)
-
-{
- m_text = new QGraphicsTextItem(this);
-
- QTimer *timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(toggleBlinkFlag()));
- timer->start(500);
-
- QFont font = m_text->font();
- font.setPointSizeF(20.0);
- m_text->setFont(font);
-
- m_text->translate(-100.0, -20.0);
-
- QPixmap pm(":/images/alarm.png");
- m_alarmSymbol = new QGraphicsPixmapItem(pm, this);
- m_alarmSymbol->translate(-100.0, -60.0);
- m_alarmSymbol->setOffset(5.0, 5.0);
- m_alarmSymbol->scale(0.5, 0.5);
-}
-
-ClockDisplay::~ClockDisplay()
-{
-}
-
-void ClockDisplay::toggleBlinkFlag()
-{
- m_blink = !m_blink;
- update();
-}
-
-void ClockDisplay::updateText()
-{
- switch (m_displayMode) {
- case EditSecondMode:
- if (m_blink) {
- m_text->setHtml(m_currentTime.toString("hh:mm:'<font color=\"transparent\">'ss'</font>'"));
- break;
- }
- // fall throoough
- case EditMinuteMode:
- if (m_blink) {
- m_text->setHtml(m_currentTime.toString("hh:'<font color=\"transparent\">'mm'</font>':ss"));
- break;
- }
-
- // fall throoough
- case EditHourMode:
- if (m_blink) {
- m_text->setHtml(m_currentTime.toString("'<font color=\"transparent\">'hh'</font>':mm:ss"));
- break;
- }
-
- // fall throoough
- case CurrentTimeMode:
- m_text->setHtml(m_currentTime.toString("hh:mm:ss"));
- break;
-
- case EditMonthMode:
- if (m_blink) {
- m_text->setHtml(m_currentTime.toString("yyyy.'<font color=\"transparent\">'MM'</font>'.dd"));
- break;
- }
-
- // fall throoough
- case EditDayMode:
- if (m_blink) {
- m_text->setHtml(m_currentTime.toString("yyyy.MM.'<font color=\"transparent\">'dd'</font>'"));
- break;
- }
-
- // fall throoough
- case EditYearMode:
- if (m_blink) {
- m_text->setHtml(m_currentTime.toString("'<font color=\"transparent\">'yyyy'</font>'.MM.dd"));
- break;
- }
-
- // fall throoough
- case CurrentDateMode:
- m_text->setHtml(m_currentTime.toString("yyyy.MM.dd"));
- break;
-
- case EditAlarmHourMode:
- if (m_blink) {
- m_text->setHtml(m_alarm.toString("'<font color=\"transparent\">'hh'</font>':mm"));
- break;
- }
-
- // fall throooough
- case EditAlarmTenMinuteMode:
- case EditAlarmMinuteMode:
- if (m_blink) {
- m_text->setHtml(m_alarm.toString("hh:'<font color=\"transparent\">'mm'</font>'"));
- break;
- }
-
- // fall throoough
- case AlarmMode:
- m_text->setHtml(m_alarm.toString("hh:mm"));
- break;
-
- default:
- m_text->setHtml("Not implemented");
- };
-}
-
-QRectF ClockDisplay::boundingRect() const
-{
- return QRectF(-100.0, -60.0, 200.0, 120.0);
-}
-
-void ClockDisplay::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
-{
- m_alarmSymbol->setVisible(m_alarmEnabled);
-
- updateText();
-
- // Screen
- painter->drawRoundedRect(boundingRect(), 15.0, 15.0, Qt::RelativeSize);
-
- // Button grid
- painter->drawLine(QPointF(-100.0, -20.0), QPointF(100.0, -20.0));
- painter->drawLine(QPointF(-50.0, -60.0), QPointF(-50.0, -20.0));
- painter->drawLine(QPointF(0.0, -60.0), QPointF(0.0, -20.0));
- painter->drawLine(QPointF(50.0, -60.0), QPointF(50.0, -20.0));
-}
diff --git a/examples/statemachine/citizenquartz/clockdisplay.h b/examples/statemachine/citizenquartz/clockdisplay.h
deleted file mode 100644
index ec86509..0000000
--- a/examples/statemachine/citizenquartz/clockdisplay.h
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef CLOCKDISPLAY_H
-#define CLOCKDISPLAY_H
-
-#include <QObject>
-#include <QGraphicsItem>
-#include <QDateTime>
-
-class ClockDisplay: public QObject, public QGraphicsItem
-{
- Q_OBJECT
- Q_ENUMS(DisplayMode)
- Q_PROPERTY(DisplayMode displayMode READ displayMode WRITE setDisplayMode)
- Q_PROPERTY(QDateTime currentTime READ currentTime WRITE setCurrentTime)
- Q_PROPERTY(QTime alarm READ alarm WRITE setAlarm)
- Q_PROPERTY(bool alarmEnabled READ alarmEnabled WRITE setAlarmEnabled)
-public:
- enum DisplayMode {
- CurrentTimeMode,
- EditSecondMode,
- EditMinuteMode,
- EditHourMode,
-
- CurrentDateMode,
- EditMonthMode,
- EditDayMode,
- EditYearMode,
-
- AlarmMode,
- EditAlarmHourMode,
- EditAlarmTenMinuteMode,
- EditAlarmMinuteMode,
-
- ChimeMode,
- StopWatchMode,
- ModeCount
- };
-
- ClockDisplay(QGraphicsItem *parent = 0);
- virtual ~ClockDisplay();
-
- void setDisplayMode(DisplayMode displayMode) { m_displayMode = displayMode; update(); }
- DisplayMode displayMode() const { return m_displayMode; }
-
- QDateTime currentTime() const { return m_currentTime; }
- void setCurrentTime(const QDateTime &time)
- {
- if (m_alarmEnabled && !alarmMatches(m_currentTime) && alarmMatches(time))
- emit alarmTriggered();
- m_currentTime = time;
- update();
- }
-
- QTime alarm() const { return m_alarm; }
- void setAlarm(const QTime &time) { m_alarm = time; update(); }
-
- bool alarmEnabled() const { return m_alarmEnabled; }
- void setAlarmEnabled(bool enabled) { m_alarmEnabled = enabled; update(); }
-
- virtual QRectF boundingRect() const;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);
-
-signals:
- void alarmTriggered();
-
-private slots:
- void toggleBlinkFlag();
-
-private:
- void updateText();
-
- bool alarmMatches(const QDateTime &dt)
- {
- return (dt.time().hour() == m_alarm.hour() && dt.time().minute() == m_alarm.minute());
- }
-
- DisplayMode m_displayMode;
-
- QDateTime m_currentTime;
- QTime m_alarm;
-
- QGraphicsTextItem *m_text;
- QGraphicsPixmapItem *m_alarmSymbol;
-
- uint m_alarmEnabled : 1;
- uint m_blink : 1;
- uint m_reserved : 30;
-};
-
-#endif
diff --git a/examples/statemachine/citizenquartz/images/alarm.png b/examples/statemachine/citizenquartz/images/alarm.png
deleted file mode 100644
index a19778d..0000000
--- a/examples/statemachine/citizenquartz/images/alarm.png
+++ /dev/null
Binary files differ
diff --git a/examples/statemachine/citizenquartz/main.cpp b/examples/statemachine/citizenquartz/main.cpp
deleted file mode 100644
index 2c6b14c..0000000
--- a/examples/statemachine/citizenquartz/main.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <QApplication>
-#include <QGraphicsScene>
-#include <QGraphicsView>
-
-#include "clock.h"
-
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
-
- QGraphicsScene scene;
-
- Clock *clock = new Clock;
- clock->initializeUi();
- clock->initializeStateMachine();
- scene.addItem(clock);
-
- QGraphicsView view(&scene);
- view.setRenderHint(QPainter::Antialiasing);
- view.show();
-
- return app.exec();
-}
diff --git a/examples/statemachine/citizenquartz/propertyaddstate.cpp b/examples/statemachine/citizenquartz/propertyaddstate.cpp
deleted file mode 100644
index dd23948..0000000
--- a/examples/statemachine/citizenquartz/propertyaddstate.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "PropertyAddState.h"
-#include "timeperiod.h"
-
-#include <QDateTime>
-#include <QDebug>
-
-PropertyAddState::PropertyAddState(QState *parent)
- : QState(parent)
-{
-}
-
-void PropertyAddState::addToProperty(QObject *object, const char *propertyName,
- const QVariant &valueToAdd)
-{
- m_propertyAdditions.append(PropertyAdder(object, propertyName, valueToAdd));
-}
-
-QVariant PropertyAddState::addProperties(const QVariant &current, const QVariant &toAdd) const
-{
- QVariant result;
- switch (current.type()) {
- case QVariant::DateTime:
- result = current.toDateTime() + qvariant_cast<TimePeriod>(toAdd);
- break;
- case QVariant::Time:
- result = current.toTime() + qvariant_cast<TimePeriod>(toAdd);
- break;
- default:
- qWarning("PropertyAddState::addProperties: QVariant type '%s' not supported",
- current.typeName());
- };
-
- return result;
-}
-
-void PropertyAddState::onEntry()
-{
- foreach (PropertyAdder propertyAdder, m_propertyAdditions) {
- QObject *object = propertyAdder.object;
- QByteArray propertyName = propertyAdder.propertyName;
- QVariant toAdd = propertyAdder.valueToAdd;
- QVariant current = object->property(propertyName);
-
- object->setProperty(propertyName, addProperties(current, toAdd));
- }
-}
diff --git a/examples/statemachine/citizenquartz/propertyaddstate.h b/examples/statemachine/citizenquartz/propertyaddstate.h
deleted file mode 100644
index 4d28055..0000000
--- a/examples/statemachine/citizenquartz/propertyaddstate.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef PropertyAddState_H
-#define PropertyAddState_H
-
-#include <qstate.h>
-
-#include <QVariant>
-#include <QList>
-
-class PropertyAddState: public QState
-{
-public:
- PropertyAddState(QState *parent = 0);
-
- void addToProperty(QObject *object, const char *propertyName, const QVariant &valueToAdd);
- virtual void onEntry();
-
-private:
- QVariant addProperties(const QVariant &current, const QVariant &toAdd) const;
-
- struct PropertyAdder {
- PropertyAdder(QObject *_object, const char *_propertyName, const QVariant &_valueToAdd)
- : object(_object), propertyName(_propertyName), valueToAdd(_valueToAdd)
- {
- }
-
- QObject *object;
- QByteArray propertyName;
- QVariant valueToAdd;
- };
- QList<PropertyAdder> m_propertyAdditions;
-};
-
-#endif // PropertyAddState_H
diff --git a/examples/statemachine/citizenquartz/sound/alarm.wav b/examples/statemachine/citizenquartz/sound/alarm.wav
deleted file mode 100644
index 1d9486f..0000000
--- a/examples/statemachine/citizenquartz/sound/alarm.wav
+++ /dev/null
Binary files differ
diff --git a/examples/statemachine/citizenquartz/timeperiod.h b/examples/statemachine/citizenquartz/timeperiod.h
deleted file mode 100644
index c5a3a16..0000000
--- a/examples/statemachine/citizenquartz/timeperiod.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef TIMEPERIOD_H
-#define TIMEPERIOD_H
-
-#include <QDateTime>
-#include <QTime>
-#include <QDebug>
-
-class TimePeriod
-{
-public:
- TimePeriod() : m_seconds(0), m_minutes(0), m_hours(0), m_days(0), m_months(0), m_years(0)
- {
- }
-
- TimePeriod &setSeconds(int seconds) { m_seconds = seconds; return *this; }
- int seconds() const { return m_seconds; }
-
- TimePeriod &setMinutes(int minutes) { m_minutes = minutes; return *this; }
- int minutes() const { return m_minutes; }
-
- TimePeriod &setHours(int hours) { m_hours = hours; return *this; }
- int hours() const { return m_hours; }
-
- TimePeriod &setDays(int days) { m_days = days; return *this; }
- int days() const { return m_days; }
-
- TimePeriod &setMonths(int months) { m_months = months; return *this; }
- int months() const { return m_months; }
-
- TimePeriod &setYears(int years) { m_years = years; return *this; }
- int years() const { return m_years; }
-
- operator QVariant() const
- {
- QVariant v;
- qVariantSetValue<TimePeriod>(v, *this);
- return v;
- }
-
-private:
- int m_seconds;
- int m_minutes;
- int m_hours;
- int m_days;
- int m_months;
- int m_years;
-};
-
-inline void operator+=(QDateTime &dateTime, const TimePeriod &timePeriod)
-{
- dateTime = dateTime.addSecs(timePeriod.seconds());
- dateTime = dateTime.addSecs(timePeriod.minutes() * 60);
- dateTime = dateTime.addSecs(timePeriod.hours() * 3600);
- dateTime = dateTime.addDays(timePeriod.days());
- dateTime = dateTime.addMonths(timePeriod.months());
- dateTime = dateTime.addYears(timePeriod.years());
-}
-
-inline QDateTime operator+(const QDateTime &dateTime, const TimePeriod &timePeriod)
-{
- QDateTime result(dateTime);
- result += timePeriod;
-
- return result;
-}
-
-inline void operator+=(QTime &time, const TimePeriod &timePeriod)
-{
- time = time.addSecs(timePeriod.seconds());
- time = time.addSecs(timePeriod.minutes() * 60);
- time = time.addSecs(timePeriod.hours() * 3600);
-}
-
-inline QTime operator+(const QTime &time, const TimePeriod &timePeriod)
-{
- QTime result(time);
- result += timePeriod;
-
- return result;
-}
-
-Q_DECLARE_METATYPE(TimePeriod)
-
-#endif \\ TIMEPERIOD_H
diff --git a/examples/statemachine/eventtransitions/eventtransitions.pro b/examples/statemachine/eventtransitions/eventtransitions.pro
index 6a976cb..7e92cf2 100644
--- a/examples/statemachine/eventtransitions/eventtransitions.pro
+++ b/examples/statemachine/eventtransitions/eventtransitions.pro
@@ -1,7 +1,7 @@
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
+SOURCES = main.cpp
-# Input
-SOURCES += main.cpp
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/eventtransitions
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS eventtransitions.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/eventtransitions
+INSTALLS += target sources
diff --git a/examples/statemachine/factorial/factorial.pro b/examples/statemachine/factorial/factorial.pro
index ac79117..14a6833 100644
--- a/examples/statemachine/factorial/factorial.pro
+++ b/examples/statemachine/factorial/factorial.pro
@@ -1,10 +1,11 @@
-TEMPLATE = app
-TARGET =
QT = core
win32: CONFIG += console
mac:CONFIG -= app_bundle
-DEPENDPATH += .
-INCLUDEPATH += .
-# Input
SOURCES += main.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/factorial
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS factorial.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/factorial
+INSTALLS += target sources
diff --git a/examples/statemachine/pingpong/pingpong.pro b/examples/statemachine/pingpong/pingpong.pro
index bff9cb8..42eab6c 100644
--- a/examples/statemachine/pingpong/pingpong.pro
+++ b/examples/statemachine/pingpong/pingpong.pro
@@ -1,10 +1,11 @@
QT = core
-TEMPLATE = app
-TARGET =
win32: CONFIG += console
mac:CONFIG -= app_bundle
-DEPENDPATH += .
-INCLUDEPATH += .
-# Input
-SOURCES += main.cpp
+SOURCES = main.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/pingpong
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS pingpong.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/pingpong
+INSTALLS += target sources
diff --git a/examples/statemachine/tankgame/gameitem.cpp b/examples/statemachine/tankgame/gameitem.cpp
index 1a2af71..ad8b37c 100644
--- a/examples/statemachine/tankgame/gameitem.cpp
+++ b/examples/statemachine/tankgame/gameitem.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "gameitem.h"
#include <QGraphicsScene>
diff --git a/examples/statemachine/tankgame/gameitem.h b/examples/statemachine/tankgame/gameitem.h
index 43b8785..90b0a6c 100644
--- a/examples/statemachine/tankgame/gameitem.h
+++ b/examples/statemachine/tankgame/gameitem.h
@@ -1,9 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef GAMEITEM_H
#define GAMEITEM_H
#include <QGraphicsItem>
+QT_BEGIN_NAMESPACE
class QLineF;
+QT_END_NAMESPACE
class GameItem: public QObject, public QGraphicsItem
{
Q_OBJECT
diff --git a/examples/statemachine/tankgame/gameovertransition.cpp b/examples/statemachine/tankgame/gameovertransition.cpp
index cec786e..360e902 100644
--- a/examples/statemachine/tankgame/gameovertransition.cpp
+++ b/examples/statemachine/tankgame/gameovertransition.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "gameovertransition.h"
#include "tankitem.h"
@@ -8,7 +49,7 @@ GameOverTransition::GameOverTransition(QAbstractState *targetState)
: QSignalTransition(new QSignalMapper(), SIGNAL(mapped(QObject*)))
{
setTargetState(targetState);
-
+
QSignalMapper *mapper = qobject_cast<QSignalMapper *>(senderObject());
mapper->setParent(this);
}
@@ -36,4 +77,4 @@ bool GameOverTransition::eventTest(QEvent *e)
} else {
return false;
}
-} \ No newline at end of file
+}
diff --git a/examples/statemachine/tankgame/gameovertransition.h b/examples/statemachine/tankgame/gameovertransition.h
index 9a86b83..5e99a75 100644
--- a/examples/statemachine/tankgame/gameovertransition.h
+++ b/examples/statemachine/tankgame/gameovertransition.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef GAMEOVERTRANSITION_H
#define GAMEOVERTRANSITION_H
diff --git a/examples/statemachine/tankgame/main.cpp b/examples/statemachine/tankgame/main.cpp
index 26fc1bb..185ad68 100644
--- a/examples/statemachine/tankgame/main.cpp
+++ b/examples/statemachine/tankgame/main.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include <QApplication>
#include "mainwindow.h"
diff --git a/examples/statemachine/tankgame/mainwindow.cpp b/examples/statemachine/tankgame/mainwindow.cpp
index fcc0325..46e0db3 100644
--- a/examples/statemachine/tankgame/mainwindow.cpp
+++ b/examples/statemachine/tankgame/mainwindow.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "mainwindow.h"
#include "tankitem.h"
#include "rocketitem.h"
@@ -97,7 +138,7 @@ void MainWindow::init()
addWall(QRectF(centerOfMap - QPointF(-50.0, -60.0), centerOfMap - QPointF(50.0, -50.0)));
addWall(QRectF(centerOfMap + QPointF(-50.0, -50.0), centerOfMap + QPointF(-40.0, 50.0)));
addWall(QRectF(centerOfMap - QPointF(-50.0, -50.0), centerOfMap - QPointF(-40.0, 50.0)));
-
+
addWall(QRectF(sceneRect.topLeft() + QPointF(sceneRect.width() / 2.0 - 5.0, -10.0),
sceneRect.topLeft() + QPointF(sceneRect.width() / 2.0 + 5.0, 100.0)));
addWall(QRectF(sceneRect.bottomLeft() + QPointF(sceneRect.width() / 2.0 - 5.0, 10.0),
@@ -108,18 +149,18 @@ void MainWindow::init()
sceneRect.topRight() + QPointF(-100.0, sceneRect.height() / 2.0 + 5.0)));
- QAction *addTankAction = menuBar()->addAction("&Add tank");
- QAction *runGameAction = menuBar()->addAction("&Run game");
+ QAction *addTankAction = menuBar()->addAction("&Add tank");
+ QAction *runGameAction = menuBar()->addAction("&Run game");
runGameAction->setObjectName("runGameAction");
- QAction *stopGameAction = menuBar()->addAction("&Stop game");
+ QAction *stopGameAction = menuBar()->addAction("&Stop game");
menuBar()->addSeparator();
QAction *quitAction = menuBar()->addAction("&Quit");
-
+
connect(addTankAction, SIGNAL(triggered()), this, SLOT(addTank()));
connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
-
- m_machine = new QStateMachine(this);
- QState *stoppedState = new QState(m_machine->rootState());
+
+ m_machine = new QStateMachine(this);
+ QState *stoppedState = new QState(m_machine->rootState());
stoppedState->setObjectName("stoppedState");
stoppedState->assignProperty(runGameAction, "enabled", true);
stoppedState->assignProperty(stopGameAction, "enabled", false);
@@ -127,19 +168,19 @@ void MainWindow::init()
m_machine->setInitialState(stoppedState);
//! [5]
- QState *spawnsAvailable = new QState(stoppedState);
+ QState *spawnsAvailable = new QState(stoppedState);
spawnsAvailable->assignProperty(addTankAction, "enabled", true);
- QState *noSpawnsAvailable = new QState(stoppedState);
+ QState *noSpawnsAvailable = new QState(stoppedState);
noSpawnsAvailable->assignProperty(addTankAction, "enabled", false);
-//! [5]
+//! [5]
spawnsAvailable->setObjectName("spawnsAvailable");
noSpawnsAvailable->setObjectName("noSpawnsAvailable");
spawnsAvailable->addTransition(this, SIGNAL(mapFull()), noSpawnsAvailable);
//! [3]
- QHistoryState *hs = new QHistoryState(stoppedState);
+ QHistoryState *hs = new QHistoryState(stoppedState);
hs->setDefaultState(spawnsAvailable);
//! [3]
hs->setObjectName("hs");
@@ -158,7 +199,7 @@ void MainWindow::init()
gameOverState->setObjectName("gameOverState");
gameOverState->assignProperty(stopGameAction, "enabled", false);
connect(gameOverState, SIGNAL(entered()), this, SLOT(gameOver()));
-
+
stoppedState->addTransition(runGameAction, SIGNAL(triggered()), m_runningState);
m_runningState->addTransition(stopGameAction, SIGNAL(triggered()), stoppedState);
@@ -168,12 +209,12 @@ void MainWindow::init()
QTimer *timer = new QTimer(this);
timer->setInterval(100);
connect(timer, SIGNAL(timeout()), this, SLOT(runStep()));
- connect(m_runningState, SIGNAL(entered()), timer, SLOT(start()));
+ connect(m_runningState, SIGNAL(entered()), timer, SLOT(start()));
connect(m_runningState, SIGNAL(exited()), timer, SLOT(stop()));
m_machine->start();
m_time.start();
-}
+}
void MainWindow::runStep()
{
@@ -201,12 +242,12 @@ void MainWindow::gameOver()
TankItem *lastTankStanding = 0;
foreach (QGraphicsItem *item, items) {
if (GameItem *gameItem = qgraphicsitem_cast<GameItem *>(item)) {
- if (lastTankStanding = qobject_cast<TankItem *>(gameItem))
+ if ((lastTankStanding = qobject_cast<TankItem *>(gameItem)) != 0)
break;
}
}
- QMessageBox::information(this, "Game over!",
+ QMessageBox::information(this, "Game over!",
QString::fromLatin1("The tank played by '%1' has won!").arg(lastTankStanding->objectName()));
}
@@ -216,7 +257,7 @@ void MainWindow::addRocket()
if (tankItem != 0) {
RocketItem *rocketItem = new RocketItem;
- QPointF s = tankItem->mapToScene(QPointF(tankItem->boundingRect().right() + 10.0,
+ QPointF s = tankItem->mapToScene(QPointF(tankItem->boundingRect().right() + 10.0,
tankItem->boundingRect().center().y()));
rocketItem->setPos(s);
rocketItem->setDirection(tankItem->direction());
@@ -264,10 +305,10 @@ void MainWindow::addTank()
bool ok;
//! [1]
- QString selectedName = QInputDialog::getItem(this, "Select a tank type", "Tank types",
+ QString selectedName = QInputDialog::getItem(this, "Select a tank type", "Tank types",
itemNames, 0, false, &ok);
//! [1]
-
+
if (ok && !selectedName.isEmpty()) {
int idx = itemNames.indexOf(selectedName);
if (Plugin *plugin = idx >= 0 ? items.at(idx) : 0) {
@@ -280,7 +321,7 @@ void MainWindow::addTank()
emit mapFull();
m_gameOverTransition->addTankItem(tankItem);
-
+
QState *region = new QState(m_runningState);
region->setObjectName(QString::fromLatin1("region%1").arg(m_spawns.size()));
//! [2]
diff --git a/examples/statemachine/tankgame/mainwindow.h b/examples/statemachine/tankgame/mainwindow.h
index 40e1595..4ae8f7a 100644
--- a/examples/statemachine/tankgame/mainwindow.h
+++ b/examples/statemachine/tankgame/mainwindow.h
@@ -1,14 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTime>
+QT_BEGIN_NAMESPACE
class QGraphicsScene;
class QStateMachine;
class QState;
+QT_END_NAMESPACE
class GameOverTransition;
class TankItem;
+
class MainWindow: public QMainWindow
{
Q_OBJECT
@@ -34,14 +78,14 @@ private:
void addWall(const QRectF &wall);
QGraphicsScene *m_scene;
-
+
QStateMachine *m_machine;
QState *m_runningState;
GameOverTransition *m_gameOverTransition;
QList<TankItem *> m_spawns;
QTime m_time;
-
+
bool m_started : 1;
};
diff --git a/examples/statemachine/tankgame/plugin.h b/examples/statemachine/tankgame/plugin.h
index 2b48d43..ddd10b7 100644
--- a/examples/statemachine/tankgame/plugin.h
+++ b/examples/statemachine/tankgame/plugin.h
@@ -1,9 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef PLUGIN_H
#define PLUGIN_H
#include <QtPlugin>
+QT_BEGIN_NAMESPACE
class QState;
+QT_END_NAMESPACE
class Plugin
{
public:
@@ -12,6 +55,8 @@ public:
virtual QState *create(QState *parentState, QObject *tank) = 0;
};
+QT_BEGIN_NAMESPACE
Q_DECLARE_INTERFACE(Plugin, "TankPlugin")
+QT_END_NAMESPACE
#endif
diff --git a/examples/statemachine/tankgame/rocketitem.cpp b/examples/statemachine/tankgame/rocketitem.cpp
index c324980..3ace8e8 100644
--- a/examples/statemachine/tankgame/rocketitem.cpp
+++ b/examples/statemachine/tankgame/rocketitem.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "rocketitem.h"
#include "tankitem.h"
@@ -53,7 +94,7 @@ void RocketItem::idle(qreal elapsed)
if (tankItem != 0)
tankItem->hitByRocket();
}
-
+
scene()->removeItem(this);
delete this;
}
diff --git a/examples/statemachine/tankgame/rocketitem.h b/examples/statemachine/tankgame/rocketitem.h
index 189a1dd..31146a6 100644
--- a/examples/statemachine/tankgame/rocketitem.h
+++ b/examples/statemachine/tankgame/rocketitem.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef ROCKETITEM_H
#define ROCKETITEM_H
@@ -12,7 +53,7 @@ public:
virtual void idle(qreal elapsed);
qreal speed() const { return 100.0; }
void setDirection(qreal direction) { m_direction = direction; }
-
+
protected:
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QRectF boundingRect() const;
@@ -22,5 +63,4 @@ private:
qreal m_distance;
};
-
#endif
diff --git a/examples/statemachine/tankgame/tankgame.pro b/examples/statemachine/tankgame/tankgame.pro
index 46cfe2e..59415be 100644
--- a/examples/statemachine/tankgame/tankgame.pro
+++ b/examples/statemachine/tankgame/tankgame.pro
@@ -1,13 +1,19 @@
-######################################################################
-# Automatically generated by qmake (2.01a) on 22. apr 14:11:33 2009
-######################################################################
-
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += C:/dev/kinetic/examples/statemachine/tankgame/. .
-
-# Input
-HEADERS += mainwindow.h plugin.h tankitem.h rocketitem.h gameitem.h gameovertransition.h
-SOURCES += main.cpp mainwindow.cpp tankitem.cpp rocketitem.cpp gameitem.cpp gameovertransition.cpp
+HEADERS += mainwindow.h \
+ plugin.h \
+ tankitem.h \
+ rocketitem.h \
+ gameitem.h \
+ gameovertransition.h
+SOURCES += main.cpp \
+ mainwindow.cpp \
+ tankitem.cpp \
+ rocketitem.cpp \
+ gameitem.cpp \
+ gameovertransition.cpp
CONFIG += console
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/tankgame
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tankgame.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/tankgame
+INSTALLS += target sources
diff --git a/examples/statemachine/tankgame/tankitem.cpp b/examples/statemachine/tankgame/tankitem.cpp
index c322d21..393d65f 100644
--- a/examples/statemachine/tankgame/tankitem.cpp
+++ b/examples/statemachine/tankgame/tankitem.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "tankitem.h"
#include <QPainter>
@@ -35,15 +76,15 @@ public:
m_reverse = m_distance < 0.0;
}
- bool apply(qreal timeDelta)
+ bool apply(qreal timeDelta)
{
qreal dist = timeDelta * item()->speed() * (m_reverse ? -1.0 : 1.0);
- bool done = false;
- if (qAbs(m_distance) < qAbs(dist)) {
+ bool done = false;
+ if (qAbs(m_distance) < qAbs(dist)) {
done = true;
dist = m_distance;
- }
+ }
m_distance -= dist;
qreal a = item()->direction() * M_PI / 180.0;
@@ -69,14 +110,14 @@ public:
m_reverse = m_distance < 0.0;
}
- bool apply(qreal timeDelta)
+ bool apply(qreal timeDelta)
{
qreal dist = timeDelta * item()->angularSpeed() * (m_reverse ? -1.0 : 1.0);
- bool done = false;
+ bool done = false;
if (qAbs(m_distance) < qAbs(dist)) {
done = true;
dist = m_distance;
- }
+ }
m_distance -= dist;
item()->setDirection(item()->direction() + dist);
@@ -88,7 +129,7 @@ private:
bool m_reverse;
};
-TankItem::TankItem(QObject *parent)
+TankItem::TankItem(QObject *parent)
: GameItem(parent), m_currentAction(0), m_currentDirection(0.0), m_enabled(true)
{
connect(this, SIGNAL(cannonFired()), this, SIGNAL(actionCompleted()));
@@ -106,7 +147,7 @@ void TankItem::idle(qreal elapsed)
QGraphicsItem *item = 0;
qreal distance = distanceToObstacle(&item);
if (TankItem *tankItem = qgraphicsitem_cast<TankItem *>(item))
- emit tankSpotted(tankItem->direction(), distance);
+ emit tankSpotted(tankItem->direction(), distance);
}
}
}
@@ -119,7 +160,7 @@ void TankItem::hitByRocket()
void TankItem::setAction(Action *newAction)
{
- if (m_currentAction != 0)
+ if (m_currentAction != 0)
delete m_currentAction;
m_currentAction = newAction;
@@ -184,9 +225,9 @@ void TankItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge
QRectF cannonBase = brect.adjusted(10.0, 6.0, -12.0, -6.0);
painter->drawEllipse(cannonBase);
- painter->drawRect(QRectF(QPointF(cannonBase.center().x(), cannonBase.center().y() - 2.0),
+ painter->drawRect(QRectF(QPointF(cannonBase.center().x(), cannonBase.center().y() - 2.0),
QPointF(brect.right(), cannonBase.center().y() + 2.0)));
-
+
// left track
painter->setBrush(QBrush(Qt::black, Qt::VerPattern));
QRectF leftTrackRect = QRectF(brect.topLeft(), QPointF(brect.right() - 2.0, brect.top() + 4.0));
@@ -223,7 +264,7 @@ qreal TankItem::direction() const
void TankItem::setDirection(qreal newDirection)
{
- int fullRotations = int(newDirection) / 360;
+ int fullRotations = int(newDirection) / 360;
newDirection -= fullRotations * 360.0;
qreal diff = newDirection - m_currentDirection;
@@ -245,8 +286,8 @@ qreal TankItem::distanceToObstacle(QGraphicsItem **obstacle) const
QPointF nextPosition = tryMove(requestedPosition, 0, &collidedItem);
if (collidedItem != 0) {
if (obstacle != 0)
- *obstacle = collidedItem;
-
+ *obstacle = collidedItem;
+
QPointF d = nextPosition - pos();
return sqrt(pow(d.x(), 2) + pow(d.y(), 2));
} else {
@@ -259,5 +300,3 @@ qreal TankItem::distanceToObstacle() const
return distanceToObstacle(0);
}
-
-
diff --git a/examples/statemachine/tankgame/tankitem.h b/examples/statemachine/tankgame/tankitem.h
index 9475397..942fca8 100644
--- a/examples/statemachine/tankgame/tankitem.h
+++ b/examples/statemachine/tankgame/tankitem.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef TANKITEM_H
#define TANKITEM_H
@@ -12,9 +53,9 @@ class TankItem: public GameItem
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled)
Q_PROPERTY(qreal direction READ direction WRITE turnTo)
Q_PROPERTY(qreal distanceToObstacle READ distanceToObstacle)
-public:
+public:
TankItem(QObject *parent = 0);
-
+
void setColor(const QColor &color) { m_color = color; }
QColor color() const { return m_color; }
@@ -53,7 +94,7 @@ public slots:
//! [0]
protected:
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
private:
diff --git a/examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.cpp b/examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.cpp
index c196247..d360de9 100644
--- a/examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.cpp
+++ b/examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "random_ai_plugin.h"
#include <QState>
diff --git a/examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.h b/examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.h
index f5e3b6f..9faeeac 100644
--- a/examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.h
+++ b/examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef RANDOM_AI_PLUGIN_H
#define RANDOM_AI_PLUGIN_H
@@ -19,7 +60,7 @@ signals:
void moveForwardsSelected();
void moveBackwardsSelected();
void turnSelected();
-
+
protected:
void onEntry(QEvent *)
{
diff --git a/examples/statemachine/tankgameplugins/seek_ai/seek_ai.cpp b/examples/statemachine/tankgameplugins/seek_ai/seek_ai.cpp
index 2fb05d4..6aae015 100644
--- a/examples/statemachine/tankgameplugins/seek_ai/seek_ai.cpp
+++ b/examples/statemachine/tankgameplugins/seek_ai/seek_ai.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "seek_ai.h"
QState *SeekAi::create(QState *parentState, QObject *tank)
@@ -12,10 +53,10 @@ QState *SeekAi::create(QState *parentState, QObject *tank)
QState *lookForNearestWall = new SearchState(tank, seek);
lookForNearestWall->setObjectName("lookForNearestWall");
seek->setInitialState(lookForNearestWall);
-
+
QState *driveToFirstObstacle = new QState(seek);
driveToFirstObstacle->setObjectName("driveToFirstObstacle");
- lookForNearestWall->addTransition(lookForNearestWall, SIGNAL(nearestObstacleStraightAhead()),
+ lookForNearestWall->addTransition(lookForNearestWall, SIGNAL(nearestObstacleStraightAhead()),
driveToFirstObstacle);
QState *drive = new QState(driveToFirstObstacle);
@@ -23,25 +64,25 @@ QState *SeekAi::create(QState *parentState, QObject *tank)
driveToFirstObstacle->setInitialState(drive);
connect(drive, SIGNAL(entered()), tank, SLOT(moveForwards()));
connect(drive, SIGNAL(exited()), tank, SLOT(stop()));
-
+
// Go in loop
QState *finishedDriving = new QState(driveToFirstObstacle);
finishedDriving->setObjectName("finishedDriving");
drive->addTransition(tank, SIGNAL(actionCompleted()), finishedDriving);
finishedDriving->addTransition(drive);
-
+
QState *turnTo = new QState(seek);
turnTo->setObjectName("turnTo");
driveToFirstObstacle->addTransition(new CollisionTransition(tank, turnTo));
-
+
turnTo->addTransition(tank, SIGNAL(actionCompleted()), driveToFirstObstacle);
ChaseState *chase = new ChaseState(tank, topLevel);
- chase->setObjectName("chase");
- seek->addTransition(new TankSpottedTransition(tank, chase));
+ chase->setObjectName("chase");
+ seek->addTransition(new TankSpottedTransition(tank, chase));
chase->addTransition(chase, SIGNAL(finished()), driveToFirstObstacle);
chase->addTransition(new TankSpottedTransition(tank, chase));
-
+
return topLevel;
}
diff --git a/examples/statemachine/tankgameplugins/seek_ai/seek_ai.h b/examples/statemachine/tankgameplugins/seek_ai/seek_ai.h
index 9d4aabc..e44ad07 100644
--- a/examples/statemachine/tankgameplugins/seek_ai/seek_ai.h
+++ b/examples/statemachine/tankgameplugins/seek_ai/seek_ai.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef SEEK_AI_H
#define SEEK_AI_H
@@ -15,18 +56,18 @@ class SearchState: public QState
{
Q_OBJECT
public:
- SearchState(QObject *tank, QState *parentState = 0)
- : QState(parentState),
- m_tank(tank),
- m_distanceToTurn(360.0),
+ SearchState(QObject *tank, QState *parentState = 0)
+ : QState(parentState),
+ m_tank(tank),
+ m_distanceToTurn(360.0),
m_nearestDistance(-1.0),
- m_directionOfNearestObstacle(0.0)
+ m_directionOfNearestObstacle(0.0)
{
}
public slots:
void turnAlittle()
- {
+ {
qreal dist = m_tank->property("distanceToObstacle").toDouble();
if (m_nearestDistance < 0.0 || dist < m_nearestDistance) {
@@ -72,7 +113,7 @@ private:
class CollisionTransition: public QSignalTransition
{
public:
- CollisionTransition(QObject *tank, QState *turnTo)
+ CollisionTransition(QObject *tank, QState *turnTo)
: QSignalTransition(tank, SIGNAL(collision(QLineF))),
m_tank(tank),
m_turnTo(turnTo)
@@ -99,7 +140,7 @@ protected:
if (qrand() % 2 == 0)
newDirection = angleOfWall;
else
- newDirection = angleOfWall - 180.0;
+ newDirection = angleOfWall - 180.0;
m_turnTo->assignProperty(m_tank, "direction", newDirection);
}
@@ -115,7 +156,7 @@ class ChaseState: public QState
class GoToLocationState: public QState
{
public:
- GoToLocationState(QObject *tank, QState *parentState = 0)
+ GoToLocationState(QObject *tank, QState *parentState = 0)
: QState(parentState), m_tank(tank), m_distance(0.0)
{
}
@@ -123,7 +164,7 @@ class ChaseState: public QState
void setDistance(qreal distance) { m_distance = distance; }
protected:
- void onEntry()
+ void onEntry()
{
QMetaObject::invokeMethod(m_tank, "moveForwards", Q_ARG(qreal, m_distance));
}
diff --git a/examples/statemachine/tankgameplugins/spin_ai/spin_ai.cpp b/examples/statemachine/tankgameplugins/spin_ai/spin_ai.cpp
index de95f41..581a6b2 100644
--- a/examples/statemachine/tankgameplugins/spin_ai/spin_ai.cpp
+++ b/examples/statemachine/tankgameplugins/spin_ai/spin_ai.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "spin_ai.h"
#include <QtPlugin>
@@ -5,24 +46,24 @@
QState *SpinAi::create(QState *parentState, QObject *tank)
{
QState *topLevel = new QState(parentState);
- QState *spinState = new SpinState(tank, topLevel);
+ QState *spinState = new SpinState(tank, topLevel);
topLevel->setInitialState(spinState);
// When tank is spotted, fire two times and go back to spin state
QState *fireState = new QState(topLevel);
QState *fireOnce = new QState(fireState);
- fireState->setInitialState(fireOnce);
+ fireState->setInitialState(fireOnce);
connect(fireOnce, SIGNAL(entered()), tank, SLOT(fireCannon()));
QState *fireTwice = new QState(fireState);
connect(fireTwice, SIGNAL(entered()), tank, SLOT(fireCannon()));
-
+
fireOnce->addTransition(tank, SIGNAL(actionCompleted()), fireTwice);
fireTwice->addTransition(tank, SIGNAL(actionCompleted()), spinState);
-
+
spinState->addTransition(tank, SIGNAL(tankSpotted(qreal,qreal)), fireState);
-
+
return topLevel;
}
diff --git a/examples/statemachine/tankgameplugins/spin_ai/spin_ai.h b/examples/statemachine/tankgameplugins/spin_ai/spin_ai.h
index d8d3d73..652e8b8 100644
--- a/examples/statemachine/tankgameplugins/spin_ai/spin_ai.h
+++ b/examples/statemachine/tankgameplugins/spin_ai/spin_ai.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef SPIN_AI_H
#define SPIN_AI_H
@@ -16,7 +57,7 @@ public:
}
public slots:
- void spin()
+ void spin()
{
m_tank->setProperty("direction", m_tank->property("direction").toDouble() + 90.0);
}
@@ -25,7 +66,7 @@ protected:
void onEntry(QEvent *)
{
connect(m_tank, SIGNAL(actionCompleted()), this, SLOT(spin()));
- spin();
+ spin();
}
void onExit(QEvent *)
diff --git a/examples/statemachine/tankgameplugins/spin_ai_with_error/spin_ai_with_error.cpp b/examples/statemachine/tankgameplugins/spin_ai_with_error/spin_ai_with_error.cpp
index 5499ba3..19137b2 100644
--- a/examples/statemachine/tankgameplugins/spin_ai_with_error/spin_ai_with_error.cpp
+++ b/examples/statemachine/tankgameplugins/spin_ai_with_error/spin_ai_with_error.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "spin_ai_with_error.h"
#include <QtPlugin>
@@ -5,7 +46,7 @@
QState *SpinAiWithError::create(QState *parentState, QObject *tank)
{
QState *topLevel = new QState(parentState);
- QState *spinState = new SpinState(tank, topLevel);
+ QState *spinState = new SpinState(tank, topLevel);
topLevel->setInitialState(spinState);
// When tank is spotted, fire two times and go back to spin state
@@ -17,12 +58,12 @@ QState *SpinAiWithError::create(QState *parentState, QObject *tank)
QState *fireTwice = new QState(fireState);
connect(fireTwice, SIGNAL(entered()), tank, SLOT(fireCannon()));
-
+
fireOnce->addTransition(tank, SIGNAL(actionCompleted()), fireTwice);
fireTwice->addTransition(tank, SIGNAL(actionCompleted()), spinState);
-
+
spinState->addTransition(tank, SIGNAL(tankSpotted(qreal,qreal)), fireState);
-
+
return topLevel;
}
diff --git a/examples/statemachine/tankgameplugins/spin_ai_with_error/spin_ai_with_error.h b/examples/statemachine/tankgameplugins/spin_ai_with_error/spin_ai_with_error.h
index 456ba01..e040bf2 100644
--- a/examples/statemachine/tankgameplugins/spin_ai_with_error/spin_ai_with_error.h
+++ b/examples/statemachine/tankgameplugins/spin_ai_with_error/spin_ai_with_error.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef SPIN_AI_WITH_ERROR_H
#define SPIN_AI_WITH_ERROR_H
@@ -16,7 +57,7 @@ public:
}
public slots:
- void spin()
+ void spin()
{
m_tank->setProperty("direction", m_tank->property("direction").toDouble() + 90.0);
}
@@ -25,7 +66,7 @@ protected:
void onEntry(QEvent *)
{
connect(m_tank, SIGNAL(actionCompleted()), this, SLOT(spin()));
- spin();
+ spin();
}
void onExit(QEvent *)
diff --git a/examples/statemachine/trafficlight/trafficlight.pro b/examples/statemachine/trafficlight/trafficlight.pro
index 730bd75..684575a 100644
--- a/examples/statemachine/trafficlight/trafficlight.pro
+++ b/examples/statemachine/trafficlight/trafficlight.pro
@@ -1,9 +1,4 @@
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-SOURCES += main.cpp
+SOURCES = main.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/trafficlight
diff --git a/examples/statemachine/twowaybutton/twowaybutton.pro b/examples/statemachine/twowaybutton/twowaybutton.pro
index 6a976cb..f6cbc57 100644
--- a/examples/statemachine/twowaybutton/twowaybutton.pro
+++ b/examples/statemachine/twowaybutton/twowaybutton.pro
@@ -1,7 +1,7 @@
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
+SOURCES = main.cpp
-# Input
-SOURCES += main.cpp
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/twowaybutton
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS twowaybutton.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/twowaybutton
+INSTALLS += target sources
diff --git a/examples/webkit/fancybrowser/mainwindow.h b/examples/webkit/fancybrowser/mainwindow.h
index 2e1068c..ba0bede 100644
--- a/examples/webkit/fancybrowser/mainwindow.h
+++ b/examples/webkit/fancybrowser/mainwindow.h
@@ -41,8 +41,8 @@
#include <QtGui>
-QT_BEGIN_NAMESPACE
class QWebView;
+QT_BEGIN_NAMESPACE
class QLineEdit;
QT_END_NAMESPACE
diff --git a/examples/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro
index 1c7cbae..6aa5780 100644
--- a/examples/widgets/movie/movie.pro
+++ b/examples/widgets/movie/movie.pro
@@ -7,3 +7,11 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/movie
sources.files = $$SOURCES $$HEADERS $$RESOURCES movie.pro animation.mng
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/movie
INSTALLS += target sources
+
+wince*: {
+ addFiles.sources += *.mng
+ addFiles.path = .
+ DEPLOYMENT += addFiles
+ DEPLOYMENT_PLUGIN += qmng
+}
+
diff --git a/mkspecs/common/wince.conf b/mkspecs/common/wince.conf
index d017cae..d6e4ba7 100644
--- a/mkspecs/common/wince.conf
+++ b/mkspecs/common/wince.conf
@@ -19,7 +19,8 @@ QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t-
QMAKE_CFLAGS_WARN_ON = -W3
QMAKE_CFLAGS_WARN_OFF = -W0
-QMAKE_CFLAGS_RELEASE = -O2 -GL -MD
+QMAKE_CFLAGS_RELEASE = -O2 -MD
+QMAKE_CFLAGS_LTCG = -GL
QMAKE_CFLAGS_DEBUG = -DDEBUG -D_DEBUG -Zi -MDd
QMAKE_CFLAGS_YACC =
@@ -34,6 +35,7 @@ QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
+QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_STL_ON = -EHsc
QMAKE_CXXFLAGS_STL_OFF =
@@ -55,8 +57,9 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<<
QMAKE_LINK = link
QMAKE_LFLAGS = /NOLOGO /NODEFAULTLIB:OLDNAMES.LIB
-QMAKE_LFLAGS_RELEASE = /LTCG /INCREMENTAL:NO
+QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
QMAKE_LFLAGS_DEBUG = /DEBUG
+QMAKE_LFLAGS_LTCG = /LTCG
QMAKE_LIBS_NETWORK = ws2.lib
QMAKE_LIBS_OPENGL =
QMAKE_LIBS_COMPAT =
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index d83ef8e..02336af 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -36,7 +36,7 @@ INCLUDEPATH = $$QMAKE_INCDIR_QT $$INCLUDEPATH #prepending prevents us from picki
win32:INCLUDEPATH += $$QMAKE_INCDIR_QT/ActiveQt
# As order does matter for static libs, we reorder the QT variable here
-TMPLIBS = declarative webkit phonon dbus testlib script scripttools svg qt3support sql xmlpatterns xml opengl experimental-animation gui network core
+TMPLIBS = declarative webkit phonon dbus testlib script scripttools svg qt3support sql xmlpatterns xml opengl gui network core
for(QTLIB, $$list($$TMPLIBS)) {
contains(QT, $$QTLIB): QT_ORDERED += $$QTLIB
}
@@ -147,7 +147,6 @@ for(QTLIB, $$list($$lower($$unique(QT)))) {
else:isEqual(QTLIB, svg):qlib = QtSvg
else:isEqual(QTLIB, script):qlib = QtScript
else:isEqual(QTLIB, scripttools):qlib = QtScriptTools
- else:isEqual(QTLIB, experimental-animation):qlib = QtAnimation
else:isEqual(QTLIB, testlib):qlib = QtTest
else:isEqual(QTLIB, dbus):qlib = QtDBus
else:isEqual(QTLIB, phonon):qlib = phonon
diff --git a/projects.pro b/projects.pro
index 2596c0a..3817792 100644
--- a/projects.pro
+++ b/projects.pro
@@ -61,6 +61,7 @@ unix {
(cd config.tests/unix/mysql_r && $(MAKE) distclean); \
(cd config.tests/unix/nis && $(MAKE) distclean); \
(cd config.tests/unix/nix && $(MAKE) distclean); \
+ (cd config.tests/unix/iodbc && $(MAKE) distclean); \
(cd config.tests/unix/odbc && $(MAKE) distclean); \
(cd config.tests/unix/oci && $(MAKE) distclean); \
(cd config.tests/unix/tds && $(MAKE) distclean); \
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 87f55cf..c7f00dd 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -626,7 +626,7 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
// do this here so we can set DEST_TARGET to be the complete path to the final target if it is needed.
QString orgDestDir = var("DESTDIR");
QString destDir = Option::fixPathToTargetOS(orgDestDir, false);
- if (orgDestDir.endsWith('/') || orgDestDir.endsWith(Option::dir_sep))
+ if (!destDir.isEmpty() && (orgDestDir.endsWith('/') || orgDestDir.endsWith(Option::dir_sep)))
destDir += Option::dir_sep;
QString target = QString(project->first("TARGET")+project->first("TARGET_EXT"));
target.remove("\"");
diff --git a/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp b/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp
index 36c170a..e9659cf 100644
--- a/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp
+++ b/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp
@@ -624,7 +624,7 @@ LuceneLock* FSDirectory::makeLock(const QString& name)
QString lockFile(getLockPrefix());
- lockFile.append(QLatin1String("-")).append(name);
+ lockFile.append(QLatin1Char('-')).append(name);
return _CLNEW FSLock(lockDir, lockFile);
}
diff --git a/src/3rdparty/clucene/src/CLucene/util/Misc.cpp b/src/3rdparty/clucene/src/CLucene/util/Misc.cpp
index 069b487..cb2efe2 100644
--- a/src/3rdparty/clucene/src/CLucene/util/Misc.cpp
+++ b/src/3rdparty/clucene/src/CLucene/util/Misc.cpp
@@ -181,12 +181,9 @@ void Misc::segmentname(QString& buffer, int32_t bufferLen,
CND_PRECONDITION(!segment.isEmpty(), "segment is NULL");
CND_PRECONDITION(!ext.isEmpty(), "extention is NULL");
- buffer.clear();
- if (x == -1) {
- buffer = QString(segment + ext);
- } else {
- buffer = QString(QLatin1String("%1%2%3")).arg(segment).arg(ext).arg(x);
- }
+ buffer = segment + ext;
+ if (x != -1)
+ buffer += QString::number(x);
}
// #pragma mark -- TCHAR related utils
diff --git a/src/3rdparty/easing/easing.cpp b/src/3rdparty/easing/easing.cpp
index 5bd3997..81af40f 100644
--- a/src/3rdparty/easing/easing.cpp
+++ b/src/3rdparty/easing/easing.cpp
@@ -26,6 +26,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#define M_PI_2 (M_PI / 2)
#endif
+QT_USE_NAMESPACE
/**
* Easing equation function for a simple linear tweening, with no easing.
diff --git a/src/3rdparty/phonon/phonon/effectwidget.cpp b/src/3rdparty/phonon/phonon/effectwidget.cpp
index da5a51a..d5c6c81 100644
--- a/src/3rdparty/phonon/phonon/effectwidget.cpp
+++ b/src/3rdparty/phonon/phonon/effectwidget.cpp
@@ -165,6 +165,7 @@ void EffectWidgetPrivate::autogenerateUi()
if (minValue == -1. && maxValue == 1.) {
//Special case values between -1 and 1.0 to use a slider for improved usability
QSlider *slider = new QSlider(Qt::Horizontal, q);
+ control = slider;
slider->setRange(-SLIDER_RANGE, +SLIDER_RANGE);
slider->setValue(int(SLIDER_RANGE * value.toDouble()));
slider->setTickPosition(QSlider::TicksBelow);
@@ -188,10 +189,10 @@ void EffectWidgetPrivate::autogenerateUi()
break;
}
+ if (control) {
#ifndef QT_NO_TOOLTIP
control->setToolTip(para.description());
#endif
- if (control) {
#ifndef QT_NO_SHORTCUT
label->setBuddy(control);
#endif
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 7adbd6f..7d5d1c5 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
and has the sha1 checksum
- 40b523e9eaaba38c182e5a9c319f0069ebf98330
+ 4ee8af9348b3f57d3c0f3575ae0a58336cf07a92
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index a4cb62d..072beee 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,42 @@
+2009-05-19 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ Do not call the parent implementation (Widget::) in show() and hide()
+ of the PluginViewQt, as it always changes the visible state of the
+ platformWidget (equal to the platformPluginWidget in the Qt port),
+ thus ignoring the isParentVisible() test.
+
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::PluginView::show):
+ (WebCore::PluginView::hide):
+
+2009-04-22 Tamas Szirbucz <szirbucz.tamas@stud.u-szeged.hu>
+
+ Reviewed by Ariya Hidayat.
+
+ https://bugs.webkit.org/show_bug.cgi?id=25023
+ Delete reply in QNetworkReplyHandler::abort() to avoid leak.
+
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::QNetworkReplyHandler::abort):
+
+2009-05-20 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24510
+
+ Fix a bug where the browserfuncs were not properly assigned,
+ make hasproperty use _NP_HasProperty and hasmethod _NP_HasMethod.
+
+ Test: plugins/netscape-invoke-browserfuncs.html
+
+ * plugins/gtk/PluginPackageGtk.cpp:
+ (WebCore::PluginPackage::load): Fix assignment
+ * plugins/qt/PluginPackageQt.cpp:
+ (WebCore::PluginPackage::load): Fix assignment
+
2009-05-11 Yael Aharon <yael.aharon@nokia.com>
Reviewed by Holger Freyther.
diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp b/src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp
index 4b94a94..26323e8 100644
--- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp
+++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp
@@ -337,7 +337,7 @@ JSValuePtr QtField::valueFromInstance(ExecState* exec, const Instance* inst) con
return ret;
} else {
- QString msg = QString(QLatin1String("cannot access member `%1' of deleted QObject")).arg(QLatin1String(name()));
+ QString msg = QString::fromLatin1("cannot access member `%1' of deleted QObject").arg(QLatin1String(name()));
return throwError(exec, GeneralError, msg.toLatin1().constData());
}
}
@@ -362,7 +362,7 @@ void QtField::setValueToInstance(ExecState* exec, const Instance* inst, JSValueP
} else if (m_type == DynamicProperty)
obj->setProperty(m_dynamicProperty.constData(), val);
} else {
- QString msg = QString(QLatin1String("cannot access member `%1' of deleted QObject")).arg(QLatin1String(name()));
+ QString msg = QString::fromLatin1("cannot access member `%1' of deleted QObject").arg(QLatin1String(name()));
throwError(exec, GeneralError, msg.toLatin1().constData());
}
}
diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
index c7ba6c2..5a73dc7 100644
--- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
+++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
@@ -1515,7 +1515,7 @@ JSValuePtr QtRuntimeConnectionMethod::call(ExecState* exec, JSObject* functionOb
bool ok = QMetaObject::connect(sender, signalIndex, conn, conn->metaObject()->methodOffset());
if (!ok) {
delete conn;
- QString msg = QString(QLatin1String("QtMetaMethod.connect: failed to connect to %1::%2()"))
+ QString msg = QString::fromLatin1("QtMetaMethod.connect: failed to connect to %1::%2()")
.arg(QLatin1String(sender->metaObject()->className()))
.arg(QLatin1String(d->m_signature));
return throwError(exec, GeneralError, msg.toLatin1().constData());
@@ -1541,14 +1541,14 @@ JSValuePtr QtRuntimeConnectionMethod::call(ExecState* exec, JSObject* functionOb
}
if (!ret) {
- QString msg = QString(QLatin1String("QtMetaMethod.disconnect: failed to disconnect from %1::%2()"))
+ QString msg = QString::fromLatin1("QtMetaMethod.disconnect: failed to disconnect from %1::%2()")
.arg(QLatin1String(sender->metaObject()->className()))
.arg(QLatin1String(d->m_signature));
return throwError(exec, GeneralError, msg.toLatin1().constData());
}
}
} else {
- QString msg = QString(QLatin1String("QtMetaMethod.%1: %2::%3() is not a signal"))
+ QString msg = QString::fromLatin1("QtMetaMethod.%1: %2::%3() is not a signal")
.arg(QLatin1String(d->m_isConnect ? "connect": "disconnect"))
.arg(QLatin1String(sender->metaObject()->className()))
.arg(QLatin1String(d->m_signature));
diff --git a/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp b/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp
index 2050a70..39ccefe 100644
--- a/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp
+++ b/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp
@@ -357,7 +357,7 @@ HashMap<String, String> parseAttributes(const String& string, bool& attrsOK)
state.gotAttributes = false;
QXmlStreamReader stream;
- QString dummy = QString(QLatin1String("<?xml version=\"1.0\"?><attrs %1 />")).arg(string);
+ QString dummy = QString::fromLatin1("<?xml version=\"1.0\"?><attrs %1 />").arg(string);
stream.addData(dummy);
while (!stream.atEnd()) {
stream.readNext();
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp
index e68be2b..bff9edb 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp
@@ -286,10 +286,10 @@ String Path::debugString() const
switch (cur.type) {
case QPainterPath::MoveToElement:
- ret += QString(QLatin1String("M %1 %2")).arg(cur.x).arg(cur.y);
+ ret += QString::fromLatin1("M %1 %2").arg(cur.x).arg(cur.y);
break;
case QPainterPath::LineToElement:
- ret += QString(QLatin1String("L %1 %2")).arg(cur.x).arg(cur.y);
+ ret += QString::fromLatin1("L %1 %2").arg(cur.x).arg(cur.y);
break;
case QPainterPath::CurveToElement:
{
@@ -299,7 +299,7 @@ String Path::debugString() const
Q_ASSERT(c1.type == QPainterPath::CurveToDataElement);
Q_ASSERT(c2.type == QPainterPath::CurveToDataElement);
- ret += QString(QLatin1String("C %1 %2 %3 %4 %5 %6")).arg(cur.x).arg(cur.y).arg(c1.x).arg(c1.y).arg(c2.x).arg(c2.y);
+ ret += QString::fromLatin1("C %1 %2 %3 %4 %5 %6").arg(cur.x).arg(cur.y).arg(c1.x).arg(c1.y).arg(c2.x).arg(c2.y);
i += 2;
break;
diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index 2c730a6..3e9b239 100644
--- a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -174,6 +174,7 @@ void QNetworkReplyHandler::abort()
if (m_reply) {
QNetworkReply* reply = release();
reply->abort();
+ reply->deleteLater();
deleteLater();
}
}
diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp
index 4387813..13f5394 100644
--- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp
@@ -151,8 +151,8 @@ bool PluginPackage::load()
m_browserFuncs.getproperty = _NPN_GetProperty;
m_browserFuncs.setproperty = _NPN_SetProperty;
m_browserFuncs.removeproperty = _NPN_RemoveProperty;
- m_browserFuncs.hasproperty = _NPN_HasMethod;
- m_browserFuncs.hasmethod = _NPN_HasProperty;
+ m_browserFuncs.hasproperty = _NPN_HasProperty;
+ m_browserFuncs.hasmethod = _NPN_HasMethod;
m_browserFuncs.setexception = _NPN_SetException;
m_browserFuncs.enumerate = _NPN_Enumerate;
m_browserFuncs.construct = _NPN_Construct;
diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp
index 43c772f..e856f92 100644
--- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp
@@ -113,7 +113,9 @@ void PluginView::show()
if (isParentVisible() && platformPluginWidget())
platformPluginWidget()->setVisible(true);
- Widget::show();
+ // do not call parent impl. here as it will set the platformWidget
+ // (same as platformPluginWidget in the Qt port) to visible, even
+ // when parent isn't visible.
}
void PluginView::hide()
@@ -123,7 +125,9 @@ void PluginView::hide()
if (isParentVisible() && platformPluginWidget())
platformPluginWidget()->setVisible(false);
- Widget::hide();
+ // do not call parent impl. here as it will set the platformWidget
+ // (same as platformPluginWidget in the Qt port) to invisible, even
+ // when parent isn't visible.
}
void PluginView::paint(GraphicsContext* context, const IntRect& rect)
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index 5dc6363..e565476 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -268,7 +268,7 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object
}
/*!
- Returns the frame's content, converted to HTML.
+ Returns the frame's content as HTML, enclosed in HTML and BODY tags.
\sa setHtml(), toPlainText()
*/
@@ -280,7 +280,8 @@ QString QWebFrame::toHtml() const
}
/*!
- Returns the content of this frame converted to plain text.
+ Returns the content of this frame converted to plain text, completely
+ stripped of all HTML formatting.
\sa toHtml()
*/
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 2aeb8da..d9f925a 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,17 @@
+2009-05-19 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ Fix a plugin bug in the WebKit code, similar to the one in WebCore.
+
+ The problem is when a non visible QtPluginWidget would show it self
+ in a sibling frame. The problem was due to our clipping. In Qt,
+ if setMask is set with an empty QRegion, no clipping will
+ be performed, so in that case we hide the PluginContainer
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::):
+
2009-03-27 Erik L. Bunce <elbunce@xendom.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index c421d42..a2b33c0 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -1058,7 +1058,13 @@ public:
IntRect clipRect(static_cast<FrameView*>(parentScrollView)->windowClipRect());
clipRect.move(-windowRect.x(), -windowRect.y());
clipRect.intersect(platformWidget()->rect());
- platformWidget()->setMask(QRegion(clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height()));
+
+ QRegion clipRegion = QRegion(clipRect);
+ platformWidget()->setMask(clipRegion);
+
+ // if setMask is set with an empty QRegion, no clipping will
+ // be performed, so in that case we hide the platformWidget
+ platformWidget()->setVisible(!clipRegion.isEmpty());
}
};
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp
index 44c3e9e..e1ffb81 100644
--- a/src/activeqt/container/qaxbase.cpp
+++ b/src/activeqt/container/qaxbase.cpp
@@ -421,7 +421,7 @@ public:
argv[p + 1] = varp + p + 1;
} else {
argv[p + 1] = const_cast<void*>(varp[p + 1].constData());
- if (ptype.endsWith("*")) {
+ if (ptype.endsWith('*')) {
argv_pointer[p + 1] = argv[p + 1];
argv[p + 1] = argv_pointer + p + 1;
}
@@ -648,7 +648,7 @@ QByteArray QAxEventSink::findProperty(DISPID dispID)
int index = mo->indexOfProperty(propname);
const QMetaProperty prop = mo->property(index);
propsignal += prop.typeName();
- propsignal += ")";
+ propsignal += ')';
addProperty(dispID, propname, propsignal);
return propname;
@@ -1661,7 +1661,7 @@ private:
void addProperty(const QByteArray &type, const QByteArray &name, uint flags)
{
QByteArray propertyType(type);
- if (propertyType.endsWith("&"))
+ if (propertyType.endsWith('&'))
propertyType.chop(1);
Property &prop = property_list[name];
@@ -2046,11 +2046,11 @@ QByteArray MetaObjectGenerator::guessTypes(const TYPEDESC &tdesc, ITypeInfo *inf
case VT_INT:
case VT_UINT:
case VT_CY:
- str += "&";
+ str += '&';
break;
case VT_PTR:
if (str == "QFont" || str == "QPixmap") {
- str += "&";
+ str += '&';
break;
} else if (str == "void*") {
str = "void **";
@@ -2059,19 +2059,19 @@ QByteArray MetaObjectGenerator::guessTypes(const TYPEDESC &tdesc, ITypeInfo *inf
// FALLTHROUGH
default:
if (str == "QColor")
- str += "&";
+ str += '&';
else if (str == "QDateTime")
- str += "&";
+ str += '&';
else if (str == "QVariantList")
- str += "&";
+ str += '&';
else if (str == "QByteArray")
- str += "&";
+ str += '&';
else if (str == "QStringList")
- str += "&";
+ str += '&';
else if (!str.isEmpty() && hasEnum(str))
- str += "&";
+ str += '&';
else if (!str.isEmpty() && str != "QFont" && str != "QPixmap" && str != "QVariant")
- str += "*";
+ str += '*';
}
break;
case VT_SAFEARRAY:
@@ -2089,7 +2089,7 @@ QByteArray MetaObjectGenerator::guessTypes(const TYPEDESC &tdesc, ITypeInfo *inf
default:
str = guessTypes(tdesc.lpadesc->tdescElem, info, function);
if (!str.isEmpty())
- str = "QList<" + str + ">";
+ str = "QList<" + str + '>';
break;
}
break;
@@ -2097,7 +2097,7 @@ QByteArray MetaObjectGenerator::guessTypes(const TYPEDESC &tdesc, ITypeInfo *inf
str = guessTypes(tdesc.lpadesc->tdescElem, info, function);
if (!str.isEmpty()) {
for (int index = 0; index < tdesc.lpadesc->cDims; ++index)
- str += "[" + QByteArray::number((int)tdesc.lpadesc->rgbounds[index].cElements) + "]";
+ str += '[' + QByteArray::number((int)tdesc.lpadesc->rgbounds[index].cElements) + ']';
}
break;
case VT_USERDEFINED:
@@ -2114,7 +2114,7 @@ QByteArray MetaObjectGenerator::guessTypes(const TYPEDESC &tdesc, ITypeInfo *inf
}
if (tdesc.vt & VT_BYREF)
- str += "&";
+ str += '&';
str.replace("&*", "**");
return str;
@@ -2141,7 +2141,7 @@ void MetaObjectGenerator::readClassInfo()
if (d->useClassInfo && !hasClassInfo("CoClass")) {
QString coClassIDstr = iidnames.value(QLatin1String("/CLSID/") + coClassID + QLatin1String("/Default"), coClassID).toString();
addClassInfo("CoClass", coClassIDstr.isEmpty() ? coClassID.toLatin1() : coClassIDstr.toLatin1());
- QByteArray version = QByteArray::number(typeattr->wMajorVerNum) + "." + QByteArray::number(typeattr->wMinorVerNum);
+ QByteArray version = QByteArray::number(typeattr->wMajorVerNum) + '.' + QByteArray::number(typeattr->wMinorVerNum);
if (version != "0.0")
addClassInfo("Version", version);
}
@@ -2174,7 +2174,7 @@ void MetaObjectGenerator::readClassInfo()
while (tlfile.isEmpty() && vit != versions.end()) {
QString version = *vit;
++vit;
- tlfile = controls.value(QLatin1String("/") + version + QLatin1String("/0/win32/.")).toString();
+ tlfile = controls.value(QLatin1Char('/') + version + QLatin1String("/0/win32/.")).toString();
}
controls.endGroup();
} else {
@@ -2347,7 +2347,7 @@ void MetaObjectGenerator::addChangedSignal(const QByteArray &function, const QBy
// generate changed signal
QByteArray signalName(function);
signalName += "Changed";
- QByteArray signalProto = signalName + "(" + replaceType(type) + ")";
+ QByteArray signalProto = signalName + '(' + replaceType(type) + ')';
if (!hasSignal(signalProto))
addSignal(signalProto, function);
if (eventSink)
@@ -2364,7 +2364,7 @@ void MetaObjectGenerator::addSetterSlot(const QByteArray &property)
set = "set";
prototype[0] = toupper(prototype[0]);
}
- prototype = set + prototype + "(" + propertyType(property) + ")";
+ prototype = set + prototype + '(' + propertyType(property) + ')';
if (!hasSlot(prototype))
addSlot(0, prototype, property);
}
@@ -2381,7 +2381,7 @@ QByteArray MetaObjectGenerator::createPrototype(FUNCDESC *funcdesc, ITypeInfo *t
type = guessTypes(funcdesc->lprgelemdescParam->tdesc, typeinfo, function);
}
- prototype = function + "(";
+ prototype = function + '(';
if (funcdesc->invkind == INVOKE_FUNC && type == hresult)
type = 0;
@@ -2395,7 +2395,7 @@ QByteArray MetaObjectGenerator::createPrototype(FUNCDESC *funcdesc, ITypeInfo *t
QByteArray ptype = guessTypes(tdesc, typeinfo, function);
if (pdesc.wParamFlags & PARAMFLAG_FRETVAL) {
- if (ptype.endsWith("&")) {
+ if (ptype.endsWith('&')) {
ptype.truncate(ptype.length() - 1);
} else if (ptype.endsWith("**")) {
ptype.truncate(ptype.length() - 1);
@@ -2403,8 +2403,8 @@ QByteArray MetaObjectGenerator::createPrototype(FUNCDESC *funcdesc, ITypeInfo *t
type = ptype;
} else {
prototype += ptype;
- if (pdesc.wParamFlags & PARAMFLAG_FOUT && !ptype.endsWith("&") && !ptype.endsWith("**"))
- prototype += "&";
+ if (pdesc.wParamFlags & PARAMFLAG_FOUT && !ptype.endsWith('&') && !ptype.endsWith("**"))
+ prototype += '&';
if (optional || pdesc.wParamFlags & PARAMFLAG_FOPT)
paramName += "=0";
else if (pdesc.wParamFlags & PARAMFLAG_FHASDEFAULT) {
@@ -2414,22 +2414,22 @@ QByteArray MetaObjectGenerator::createPrototype(FUNCDESC *funcdesc, ITypeInfo *t
parameters << paramName;
}
if (p < funcdesc->cParams && !(pdesc.wParamFlags & PARAMFLAG_FRETVAL))
- prototype += ",";
+ prototype += ',';
}
if (!prototype.isEmpty()) {
- if (prototype.right(1) == ",") {
+ if (prototype.endsWith(',')) {
if (funcdesc->invkind == INVOKE_PROPERTYPUT && p == funcdesc->cParams) {
TYPEDESC tdesc = funcdesc->lprgelemdescParam[p-1].tdesc;
QByteArray ptype = guessTypes(tdesc, typeinfo, function);
prototype += ptype;
- prototype += ")";
+ prototype += ')';
parameters << "rhs";
} else {
prototype[prototype.length()-1] = ')';
}
} else {
- prototype += ")";
+ prototype += ')';
}
}
@@ -2577,11 +2577,11 @@ void MetaObjectGenerator::readFuncsInfo(ITypeInfo *typeinfo, ushort nFuncs)
if (defargs) {
parameters.takeLast();
- int lastParam = prototype.lastIndexOf(",");
+ int lastParam = prototype.lastIndexOf(',');
if (lastParam == -1)
- lastParam = prototype.indexOf("(") + 1;
+ lastParam = prototype.indexOf('(') + 1;
prototype.truncate(lastParam);
- prototype += ")";
+ prototype += ')';
}
} while (defargs);
}
@@ -2597,8 +2597,8 @@ void MetaObjectGenerator::readFuncsInfo(ITypeInfo *typeinfo, ushort nFuncs)
QString strDocu = QString::fromUtf16((const ushort*)bstrDocu);
SysFreeString(bstrDocu);
if (!!strDocu)
- desc += "[" + strDocu + "]";
- desc += "\n";
+ desc += '[' + strDocu + ']';
+ desc += '\n';
#endif
typeinfo->ReleaseFuncDesc(funcdesc);
}
@@ -2680,8 +2680,8 @@ void MetaObjectGenerator::readVarsInfo(ITypeInfo *typeinfo, ushort nVars)
QString strDocu = QString::fromUtf16((const ushort*)bstrDocu);
SysFreeString(bstrDocu);
if (!!strDocu)
- desc += "[" + strDocu + "]";
- desc += "\n";
+ desc += '[' + strDocu + ']';
+ desc += '\n';
#endif
typeinfo->ReleaseVarDesc(vardesc);
}
@@ -2827,8 +2827,8 @@ void MetaObjectGenerator::readEventInterface(ITypeInfo *eventinfo, IConnectionPo
QString strDocu = QString::fromUtf16((const ushort*)bstrDocu);
SysFreeString(bstrDocu);
if (!!strDocu)
- desc += "[" + strDocu + "]";
- desc += "\n";
+ desc += '[' + strDocu + ']';
+ desc += '\n';
#endif
eventinfo->ReleaseFuncDesc(funcdesc);
}
@@ -4398,8 +4398,8 @@ QVariant QAxBase::asVariant() const
cn = cn.mid(cn.lastIndexOf(':') + 1);
QObject *object = qObject();
if (QMetaType::type(cn))
- qvar = QVariant(qRegisterMetaType<QObject*>(cn + "*"), &object);
-// qVariantSetValue(qvar, qObject(), cn + "*");
+ qvar = QVariant(qRegisterMetaType<QObject*>(cn + '*'), &object);
+// qVariantSetValue(qvar, qObject(), cn + '*');
}
return qvar;
diff --git a/src/activeqt/container/qaxdump.cpp b/src/activeqt/container/qaxdump.cpp
index 62ef0a4..c3218a9 100644
--- a/src/activeqt/container/qaxdump.cpp
+++ b/src/activeqt/container/qaxdump.cpp
@@ -94,14 +94,14 @@ static QByteArray namedPrototype(const QList<QByteArray> &parameterTypes, const
prototype += type;
if (p < parameterNames.count())
- prototype += " " + parameterNames.at(p);
+ prototype += ' ' + parameterNames.at(p);
if (numDefArgs >= parameterTypes.count() - p)
prototype += " = 0";
if (p < parameterTypes.count() - 1)
prototype += ", ";
}
- prototype += ")";
+ prototype += ')';
return prototype;
}
@@ -196,8 +196,8 @@ QString qax_generateDocumentation(QAxBase *that)
prototype = namedPrototype(slot.parameterTypes(), slot.parameterNames());
QString detail = QString::fromLatin1("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>") +
- QString::fromLatin1(returntype.constData()) + QLatin1String(" ") +
- QString::fromLatin1(name.constData()) + QLatin1String(" ") +
+ QLatin1String(returntype.constData()) + QLatin1Char(' ') +
+ QLatin1String(name.constData()) + QLatin1Char(' ') +
QString::fromLatin1(prototype.constData()) + QLatin1String("<tt> [slot]</tt></h3>\n");
prototype = namedPrototype(slot.parameterTypes(), QList<QByteArray>());
detail += docuFromName(typeInfo, QString::fromLatin1(name.constData()));
@@ -220,14 +220,14 @@ QString qax_generateDocumentation(QAxBase *that)
returntype = "QAxObject *";
}
if (returntype != "void")
- detail += QString::fromLatin1(returntype.constData()) + QLatin1String(" result = ");
- detail += QLatin1String("object->") + QString::fromLatin1(functionToCall.constData()) +
- QLatin1String("(\"" + name + prototype + "\"");
+ detail += QLatin1String(returntype.constData()) + QLatin1String(" result = ");
+ detail += QLatin1String("object->") + QLatin1String(functionToCall.constData()) +
+ QLatin1String("(\"" + name + prototype + '\"');
if (hasParams)
detail += QLatin1String(", params");
- detail += QLatin1String(")");
+ detail += QLatin1Char(')');
if (returntype != "void" && returntype != "QAxObject *" && returntype != "QVariant")
- detail += QLatin1String(".") + QString::fromLatin1(toType(returntype));
+ detail += QLatin1Char('.') + QLatin1String(toType(returntype));
detail += QLatin1String(";</pre>\n");
} else {
detail += QLatin1String("<p>This function has parameters of unsupported types and cannot be called directly.");
@@ -262,9 +262,9 @@ QString qax_generateDocumentation(QAxBase *that)
QByteArray name = signature.left(signature.indexOf('('));
stream << "<li>void <a href=\"#" << name << "\"><b>" << name << "</b></a>" << prototype << ";</li>" << endl;
- QString detail = QLatin1String("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>void ") +
- QString::fromLatin1(name.constData()) + QLatin1String(" ") +
- QString::fromLatin1(prototype.constData()) + QLatin1String("<tt> [signal]</tt></h3>\n");
+ QString detail = QLatin1String("<h3><a name=") + QLatin1String(name.constData()) + QLatin1String("></a>void ") +
+ QLatin1String(name.constData()) + QLatin1Char(' ') +
+ QLatin1String(prototype.constData()) + QLatin1String("<tt> [signal]</tt></h3>\n");
if (typeLib) {
interCount = 0;
do {
@@ -311,8 +311,8 @@ QString qax_generateDocumentation(QAxBase *that)
stream << "<li>" << type << " <a href=\"#" << name << "\"><b>" << name << "</b></a>;</li>" << endl;
QString detail = QLatin1String("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>") +
- QString::fromLatin1(type.constData()) +
- QLatin1String(" ") + QString::fromLatin1(name.constData()) + QLatin1String("</h3>\n");
+ QLatin1String(type.constData()) +
+ QLatin1Char(' ') + QLatin1String(name.constData()) + QLatin1String("</h3>\n");
detail += docuFromName(typeInfo, QString::fromLatin1(name));
QVariant::Type vartype = QVariant::nameToType(type);
if (!prop.isReadable())
@@ -326,14 +326,14 @@ QString qax_generateDocumentation(QAxBase *that)
if (prop.isEnumType())
detail += QLatin1String("\tint val = ");
else
- detail += QLatin1String("\t") + QString::fromLatin1(type.constData()) + QLatin1String(" val = ");
- detail += QLatin1String("object->property(\"") + QString::fromLatin1(name.constData()) +
- QLatin1String("\").") + QString::fromLatin1(toType(type).constData()) + QLatin1String(";\n");
+ detail += QLatin1Char('\t') + QLatin1String(type.constData()) + QLatin1String(" val = ");
+ detail += QLatin1String("object->property(\"") + QLatin1String(name.constData()) +
+ QLatin1String("\").") + QLatin1String(toType(type).constData()) + QLatin1String(";\n");
detail += QLatin1String("</pre>\n");
} else if (type == "IDispatch*" || type == "IUnknown*") {
detail += QLatin1String("<p>Get the subobject using querySubObject:<pre>\n");
- detail += QLatin1String("\tQAxObject *") + QString::fromLatin1(name.constData()) +
- QLatin1String(" = object->querySubObject(\"") + QString::fromLatin1(name.constData()) + QLatin1String("\");\n");
+ detail += QLatin1String("\tQAxObject *") + QLatin1String(name.constData()) +
+ QLatin1String(" = object->querySubObject(\"") + QLatin1String(name.constData()) + QLatin1String("\");\n");
detail += QLatin1String("</pre>\n");
} else {
detail += QLatin1String("<p>This property is of an unsupported type.\n");
diff --git a/src/activeqt/container/qaxscript.cpp b/src/activeqt/container/qaxscript.cpp
index c69fea0..8f8186a 100644
--- a/src/activeqt/container/qaxscript.cpp
+++ b/src/activeqt/container/qaxscript.cpp
@@ -1203,9 +1203,9 @@ QString QAxScriptManager::scriptFileFilter()
continue;
allFiles += QLatin1String(" *") + engine.extension;
- specialFiles += QLatin1String(";;") + engine.name + QLatin1String(" Files (*") + engine.extension + QLatin1String(")");
+ specialFiles += QLatin1String(";;") + engine.name + QLatin1String(" Files (*") + engine.extension + QLatin1Char(')');
}
- allFiles += QLatin1String(")");
+ allFiles += QLatin1Char(')');
return allFiles + specialFiles + QLatin1String(";;All Files (*.*)");
}
diff --git a/src/activeqt/control/qaxserver.cpp b/src/activeqt/control/qaxserver.cpp
index d919382..1771293 100644
--- a/src/activeqt/control/qaxserver.cpp
+++ b/src/activeqt/control/qaxserver.cpp
@@ -90,7 +90,7 @@ QAxFactory *qAxFactory()
QStringList keys(qax_factory->featureList());
for (int i = 0; i < keys.count(); ++i) {
QString key(keys.at(i));
- qRegisterMetaType((key + QLatin1String("*")).toLatin1(), (void**)0);
+ qRegisterMetaType((key + QLatin1Char('*')).toLatin1(), (void**)0);
}
}
return qax_factory;
@@ -208,9 +208,9 @@ HRESULT UpdateRegistry(BOOL bRegister)
{
qAxIsServer = false;
QString file = QString::fromLocal8Bit(qAxModuleFilename);
- QString path = file.left(file.lastIndexOf(QLatin1String("\\"))+1);
+ QString path = file.left(file.lastIndexOf(QLatin1Char('\\'))+1);
QString module = file.right(file.length() - path.length());
- module = module.left(module.lastIndexOf(QLatin1String(".")));
+ module = module.left(module.lastIndexOf(QLatin1Char('.')));
const QString appId = qAxFactory()->appID().toString().toUpper();
const QString libId = qAxFactory()->typeLibID().toString().toUpper();
@@ -226,7 +226,7 @@ HRESULT UpdateRegistry(BOOL bRegister)
DWORD major = libAttr->wMajorVerNum;
DWORD minor = libAttr->wMinorVerNum;
- typeLibVersion = QString::number((uint)major) + QLatin1String(".") + QString::number((uint)minor);
+ typeLibVersion = QString::number((uint)major) + QLatin1Char('.') + QString::number((uint)minor);
if (bRegister)
RegisterTypeLib(qAxTypeLibrary, (TCHAR*)libFile.utf16(), 0);
@@ -271,12 +271,12 @@ HRESULT UpdateRegistry(BOOL bRegister)
className = qax_clean_type(className, mo);
if (object) { // don't register subobject classes
- QString classVersion = mo ? QString(QLatin1String(mo->classInfo(mo->indexOfClassInfo("Version")).value())) : QString();
+ QString classVersion = mo ? QString::fromLatin1(mo->classInfo(mo->indexOfClassInfo("Version")).value()) : QString();
if (classVersion.isNull())
classVersion = QLatin1String("1.0");
bool insertable = mo && !qstricmp(mo->classInfo(mo->indexOfClassInfo("Insertable")).value(), "yes");
bool control = object->isWidgetType();
- const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1String(".")));
+ const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1Char('.')));
uint olemisc = OLEMISC_SETCLIENTSITEFIRST
|OLEMISC_ACTIVATEWHENVISIBLE
|OLEMISC_INSIDEOUT
@@ -287,17 +287,17 @@ HRESULT UpdateRegistry(BOOL bRegister)
else if (qFindChild<QMenuBar*>(object) && !qax_disable_inplaceframe)
olemisc |= OLEMISC_WANTSTOMENUMERGE;
- settings.setValue(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/."), className + QLatin1String(" Class"));
- settings.setValue(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/CLSID/."), classId);
+ settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/."), className + QLatin1String(" Class"));
+ settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/CLSID/."), classId);
if (insertable)
- settings.setValue(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/Insertable/."), QVariant(QLatin1String("")));
+ settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/Insertable/."), QVariant(QLatin1String("")));
- settings.setValue(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String("/."), className + QLatin1String(" Class"));
- settings.setValue(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String("/CLSID/."), classId);
- settings.setValue(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String("/CurVer/."), module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion);
+ settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/."), className + QLatin1String(" Class"));
+ settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/CLSID/."), classId);
+ settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/CurVer/."), module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion);
settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/."), className + QLatin1String(" Class"));
- if (file.right(3).toLower() == QLatin1String("exe"))
+ if (file.endsWith(QLatin1String("exe"), Qt::CaseInsensitive))
settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/AppID"), appId);
if (control)
settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/Control/."), QVariant(QLatin1String("")));
@@ -307,15 +307,15 @@ HRESULT UpdateRegistry(BOOL bRegister)
settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/InProcServer32/."), file);
else
settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/LocalServer32/."),
- QLatin1String("\"") + file + QLatin1String("\" -activex"));
+ QLatin1Char('\"') + file + QLatin1String("\" -activex"));
settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/MiscStatus/."), control ? QLatin1String("1") : QLatin1String("0"));
settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/MiscStatus/1/."), QString::number(olemisc));
settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/Programmable/."), QVariant(QLatin1String("")));
- settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/ToolboxBitmap32/."), QLatin1String("\"") +
+ settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/ToolboxBitmap32/."), QLatin1Char('\"') +
file + QLatin1String("\", 101"));
settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/TypeLib/."), libId); settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/Version/."), classVersion);
- settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/VersionIndependentProgID/."), module + QLatin1String(".") + className);
- settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/ProgID/."), module + QLatin1String(".") + className + QLatin1String(".") + classVersion.left(classVersion.indexOf(QLatin1Char('.'))));
+ settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/VersionIndependentProgID/."), module + QLatin1Char('.') + className);
+ settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/ProgID/."), module + QLatin1Char('.') + className + QLatin1Char('.') + classVersion.left(classVersion.indexOf(QLatin1Char('.'))));
QString mime = QLatin1String(mo->classInfo(mo->indexOfClassInfo("MIME")).value());
if (!mime.isEmpty()) {
@@ -330,15 +330,15 @@ HRESULT UpdateRegistry(BOOL bRegister)
mime = mime.left(mime.length() - extension.length() - 1);
// Prepend '.' before extension, if required.
extension = extension.trimmed();
- if (extension[0] != QChar(QLatin1Char('.')))
- extension = QLatin1String(".") + extension;
+ if (extension[0] != QLatin1Char('.'))
+ extension = QLatin1Char('.') + extension;
}
if (!extension.isEmpty()) {
- settings.setValue(QLatin1String("/") + extension + QLatin1String("/."), module + QLatin1String(".") + className);
- settings.setValue(QLatin1String("/") + extension + QLatin1String("/Content Type"), mime);
+ settings.setValue(QLatin1Char('/') + extension + QLatin1String("/."), module + QLatin1Char('.') + className);
+ settings.setValue(QLatin1Char('/') + extension + QLatin1String("/Content Type"), mime);
- mime = mime.replace(QLatin1String("/"), QLatin1String("\\"));
+ mime = mime.replace(QLatin1Char('/'), QLatin1Char('\\'));
settings.setValue(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/CLSID"), classId);
settings.setValue(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/Extension"), extension);
}
@@ -358,22 +358,22 @@ HRESULT UpdateRegistry(BOOL bRegister)
const QString classId = qAxFactory()->classID(className).toString().toUpper();
className = qax_clean_type(className, mo);
- QString classVersion = mo ? QString(QLatin1String(mo->classInfo(mo->indexOfClassInfo("Version")).value())) : QString();
+ QString classVersion = mo ? QString::fromLatin1(mo->classInfo(mo->indexOfClassInfo("Version")).value()) : QString();
if (classVersion.isNull())
classVersion = QLatin1String("1.0");
- const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1String(".")));
+ const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1Char('.')));
qAxFactory()->unregisterClass(*key, &settings);
- settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/CLSID/."));
- settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/Insertable/."));
- settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion + QLatin1String("/."));
- settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String(".") + classMajorVersion);
+ settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/CLSID/."));
+ settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/Insertable/."));
+ settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/."));
+ settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion);
- settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String("/CLSID/."));
- settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String("/CurVer/."));
- settings.remove(QLatin1String("/") + module + QLatin1String(".") + className + QLatin1String("/."));
- settings.remove(QLatin1String("/") + module + QLatin1String(".") + className);
+ settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/CLSID/."));
+ settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/CurVer/."));
+ settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/."));
+ settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className);
settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/AppID"));
settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/Control/."));
@@ -404,14 +404,14 @@ HRESULT UpdateRegistry(BOOL bRegister)
mime = mime.left(mime.length() - extension.length() - 1);
// Prepend '.' before extension, if required.
extension = extension.trimmed();
- if (extension[0] != QChar(QLatin1Char('.')))
- extension = QLatin1String(".") + extension;
+ if (extension[0] != QLatin1Char('.'))
+ extension.prepend(QLatin1Char('.'));
}
if (!extension.isEmpty()) {
- settings.remove(QLatin1String("/") + extension + QLatin1String("/Content Type"));
- settings.remove(QLatin1String("/") + extension + QLatin1String("/."));
- settings.remove(QLatin1String("/") + extension);
- mime = mime.replace(QLatin1String("/"), QLatin1String("\\"));
+ settings.remove(QLatin1Char('/') + extension + QLatin1String("/Content Type"));
+ settings.remove(QLatin1Char('/') + extension + QLatin1String("/."));
+ settings.remove(QLatin1Char('/') + extension);
+ mime.replace(QLatin1Char('/'), QLatin1Char('\\'));
settings.remove(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/Extension"));
settings.remove(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/CLSID"));
settings.remove(QLatin1String("/MIME/Database/Content Type/") + mime + QLatin1String("/."));
@@ -455,8 +455,8 @@ static const char* const type_map[][2] =
{ "QFont", "IFontDisp*" },
{ "QPixmap", "IPictureDisp*" },
{ "QVariant", "VARIANT" },
- { "QVariantList", "SAFEARRAY(VARIANT)" },
- { "QList<QVariant>","SAFEARRAY(VARIANT)" },
+ { "QVariantList", "SAFEARRAY(VARIANT)" },
+ { "QList<QVariant>", "SAFEARRAY(VARIANT)" },
{ "quint64", "CY" },
{ "qint64", "CY" },
{ "qulonglong", "CY" },
@@ -464,8 +464,8 @@ static const char* const type_map[][2] =
{ "QByteArray", "SAFEARRAY(BYTE)" },
{ "QStringList", "SAFEARRAY(BSTR)" },
// Userdefined Qt datatypes - some not on Borland though
- { "QCursor", "enum MousePointer" },
- { "Qt::FocusPolicy","enum FocusPolicy" },
+ { "QCursor", "enum MousePointer" },
+ { "Qt::FocusPolicy", "enum FocusPolicy" },
#ifndef Q_CC_BOR
# if __REQUIRED_RPCNDR_H_VERSION__ >= Q_REQUIRED_RPCNDR_H_VERSION
{ "QRect", "struct QRect" },
@@ -578,7 +578,7 @@ static QByteArray renameOverloads(const QByteArray &name)
int n = mapping.value(name);
if (mapping.contains(name)) {
int n = mapping.value(name);
- newName = name + "_" + QByteArray::number(n);
+ newName = name + '_' + QByteArray::number(n);
mapping.insert(name, n+1);
} else {
mapping.insert(name, 1);
@@ -686,13 +686,13 @@ static QByteArray prototype(const QList<QByteArray> &parameterTypes, const QList
QByteArray type(parameterTypes.at(p));
QByteArray name(parameterNames.at(p));
- if (type.endsWith("&")) {
+ if (type.endsWith('&')) {
out = true;
type.truncate(type.length() - 1);
} else if (type.endsWith("**")) {
out = true;
type.truncate(type.length() - 1);
- } else if (type.endsWith("*") && !subtypes.contains(type)) {
+ } else if (type.endsWith('*') && !subtypes.contains(type)) {
type.truncate(type.length() - 1);
}
if (type.isEmpty()) {
@@ -701,14 +701,14 @@ static QByteArray prototype(const QList<QByteArray> &parameterTypes, const QList
}
type = convertTypes(type, ok);
if (!out)
- prototype += "[in] " + type + " ";
+ prototype += "[in] " + type + ' ';
else
- prototype += "[in,out] " + type + " ";
+ prototype += "[in,out] " + type + ' ';
if (out)
- prototype += "*";
+ prototype += '*';
if (name.isEmpty())
- prototype += "p" + QByteArray::number(p);
+ prototype += 'p' + QByteArray::number(p);
else
prototype += "p_" + replaceKeyword(name);
@@ -728,12 +728,12 @@ static QByteArray addDefaultArguments(const QByteArray &prototype, int numDefArg
QByteArray ptype(prototype);
int in = -1;
while (numDefArgs) {
- in = ptype.lastIndexOf("]", in);
+ in = ptype.lastIndexOf(']', in);
ptype.replace(in, 1, ",optional]");
in = ptype.indexOf(' ', in) + 1;
QByteArray type = ptype.mid(in, ptype.indexOf(' ', in) - in);
if (type == "enum")
- type += " " + ptype.mid(in + 5, ptype.indexOf(' ', in + 5) - in - 5);
+ type += ' ' + ptype.mid(in + 5, ptype.indexOf(' ', in + 5) - in - 5);
ptype.replace(in, type.length(), QByteArray("VARIANT /*was: ") + type + "*/");
--numDefArgs;
}
@@ -801,7 +801,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
for (int j = 0; j < enumerator.keyCount(); ++j) {
QByteArray key(enumerator.key(j));
while (enumValues.contains(key)) {
- key += "_";
+ key += '_';
}
enumValues.append(key);
uint value = (uint)enumerator.value(j);
@@ -822,32 +822,32 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
if (!enums.contains("MousePointer")) {
enums.append("MousePointer");
out << "\tenum MousePointer {" << endl;
- out << "\t\tArrowCursor = " << Qt::ArrowCursor << "," << endl;
- out << "\t\tUpArrowCursor = " << Qt::UpArrowCursor << "," << endl;
- out << "\t\tCrossCursor = " << Qt::CrossCursor << "," << endl;
- out << "\t\tWaitCursor = " << Qt::WaitCursor << "," << endl;
- out << "\t\tIBeamCursor = " << Qt::IBeamCursor << "," << endl;
- out << "\t\tSizeVerCursor = " << Qt::SizeVerCursor << "," << endl;
- out << "\t\tSizeHorCursor = " << Qt::SizeHorCursor << "," << endl;
- out << "\t\tSizeBDiagCursor = " << Qt::SizeBDiagCursor << "," << endl;
- out << "\t\tSizeFDiagCursor = " << Qt::SizeFDiagCursor << "," << endl;
- out << "\t\tSizeAllCursor = " << Qt::SizeAllCursor << "," << endl;
- out << "\t\tBlankCursor = " << Qt::BlankCursor << "," << endl;
- out << "\t\tSplitVCursor = " << Qt::SplitVCursor << "," << endl;
- out << "\t\tSplitHCursor = " << Qt::SplitHCursor << "," << endl;
- out << "\t\tPointingHandCursor = " << Qt::PointingHandCursor << "," << endl;
- out << "\t\tForbiddenCursor = " << Qt::ForbiddenCursor << "," << endl;
- out << "\t\tWhatsThisCursor = " << Qt::WhatsThisCursor << "," << endl;
+ out << "\t\tArrowCursor = " << Qt::ArrowCursor << ',' << endl;
+ out << "\t\tUpArrowCursor = " << Qt::UpArrowCursor << ',' << endl;
+ out << "\t\tCrossCursor = " << Qt::CrossCursor << ',' << endl;
+ out << "\t\tWaitCursor = " << Qt::WaitCursor << ',' << endl;
+ out << "\t\tIBeamCursor = " << Qt::IBeamCursor << ',' << endl;
+ out << "\t\tSizeVerCursor = " << Qt::SizeVerCursor << ',' << endl;
+ out << "\t\tSizeHorCursor = " << Qt::SizeHorCursor << ',' << endl;
+ out << "\t\tSizeBDiagCursor = " << Qt::SizeBDiagCursor << ',' << endl;
+ out << "\t\tSizeFDiagCursor = " << Qt::SizeFDiagCursor << ',' << endl;
+ out << "\t\tSizeAllCursor = " << Qt::SizeAllCursor << ',' << endl;
+ out << "\t\tBlankCursor = " << Qt::BlankCursor << ',' << endl;
+ out << "\t\tSplitVCursor = " << Qt::SplitVCursor << ',' << endl;
+ out << "\t\tSplitHCursor = " << Qt::SplitHCursor << ',' << endl;
+ out << "\t\tPointingHandCursor = " << Qt::PointingHandCursor << ',' << endl;
+ out << "\t\tForbiddenCursor = " << Qt::ForbiddenCursor << ',' << endl;
+ out << "\t\tWhatsThisCursor = " << Qt::WhatsThisCursor << ',' << endl;
out << "\t\tBusyCursor\t= " << Qt::BusyCursor << endl;
out << "\t};" << endl << endl;
}
if (!enums.contains("FocusPolicy")) {
enums.append("FocusPolicy");
out << "\tenum FocusPolicy {" << endl;
- out << "\t\tNoFocus = " << Qt::NoFocus << "," << endl;
- out << "\t\tTabFocus = " << Qt::TabFocus << "," << endl;
- out << "\t\tClickFocus = " << Qt::ClickFocus << "," << endl;
- out << "\t\tStrongFocus = " << Qt::StrongFocus << "," << endl;
+ out << "\t\tNoFocus = " << Qt::NoFocus << ',' << endl;
+ out << "\t\tTabFocus = " << Qt::TabFocus << ',' << endl;
+ out << "\t\tClickFocus = " << Qt::ClickFocus << ',' << endl;
+ out << "\t\tStrongFocus = " << Qt::StrongFocus << ',' << endl;
out << "\t\tWheelFocus = " << Qt::WheelFocus << endl;
out << "\t};" << endl << endl;
}
@@ -877,7 +877,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
if (!ok)
out << "\t/****** Property is of unsupported datatype" << endl;
- out << "\t\t[id(" << id << ")";
+ out << "\t\t[id(" << id << ')';
if (!property.isWritable())
out << ", readonly";
if (isBindable && property.isScriptable(o))
@@ -886,9 +886,9 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
out << ", nonbrowsable";
if (isBindable)
out << ", requestedit";
- if (defProp == QString::fromLatin1(name.constData()))
+ if (defProp == QLatin1String(name))
out << ", uidefault";
- out << "] " << type << " " << name << ";" << endl;
+ out << "] " << type << ' ' << name << ';' << endl;
if (!ok)
out << "\t******/" << endl;
@@ -939,7 +939,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
if (!ok)
outBuffer += "\t/****** Slot parameter uses unsupported datatype\n";
- outBuffer += "\t\t[id(" + QString::number(id).toLatin1() + ")] " + type + " " + name + "(" + ptype + ");\n";
+ outBuffer += "\t\t[id(" + QString::number(id).toLatin1() + ")] " + type + ' ' + name + '(' + ptype + ");\n";
if (!ok)
outBuffer += "\t******/\n";
@@ -991,7 +991,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
QList<QByteArray> parameterTypes(signal.parameterTypes());
QList<QByteArray> parameterNames(signal.parameterNames());
- bool isDefault = defSignal == QString::fromLatin1(name.constData());
+ bool isDefault = defSignal == QLatin1String(name);
name = renameOverloads(replaceKeyword(name));
bool ok = true;
@@ -1003,10 +1003,10 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
if (!ok)
out << "\t/****** Signal parameter uses unsupported datatype" << endl;
- out << "\t\t[id(" << id << ")";
+ out << "\t\t[id(" << id << ')';
if (isDefault)
out << ", uidefault";
- out << "] void " << name << "(" << ptype << ");" << endl;
+ out << "] void " << name << '(' << ptype << ");" << endl;
if (!ok)
out << "\t******/" << endl;
@@ -1031,7 +1031,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
const char *classVersion = mo->classInfo(mo->indexOfClassInfo("Version")).value();
if (classVersion)
out << "\t\tversion(" << classVersion << ")," << endl;
- out << "\t\tuuid(" << classID << ")";
+ out << "\t\tuuid(" << classID << ')';
if (control) {
out << ", " << endl;
out << "\t\tcontrol";
@@ -1043,7 +1043,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
out << "\t]" << endl;
out << "\tcoclass " << cleanClassName << endl;
out << "\t{" << endl;
- out << "\t\t[default] dispinterface I" << cleanClassName << ";" << endl;
+ out << "\t\t[default] dispinterface I" << cleanClassName << ';' << endl;
if (hasEvents)
out << "\t\t[default, source] dispinterface I" << cleanClassName << "Events;" << endl;
out << "\t};" << endl;
@@ -1068,7 +1068,7 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
file.remove();
QString filebase = QString::fromLocal8Bit(qAxModuleFilename);
- filebase = filebase.left(filebase.lastIndexOf(QLatin1String(".")));
+ filebase = filebase.left(filebase.lastIndexOf(QLatin1Char('.')));
QString appID = qAxFactory()->appID().toString().toUpper();
if (QUuid(appID).isNull())
@@ -1103,7 +1103,7 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
out << "/****************************************************************************" << endl;
out << "** Interface definition generated for ActiveQt project" << endl;
out << "**" << endl;
- out << "** '" << qAxModuleFilename << "'" << endl;
+ out << "** '" << qAxModuleFilename << '\'' << endl;
out << "**" << endl;
out << "** Created: " << QDateTime::currentDateTime().toString() << endl;
out << "**" << endl;
@@ -1121,13 +1121,13 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
delete_qApp = true;
}
- out << "[" << endl;
+ out << '[' << endl;
out << "\tuuid(" << typeLibID << ")," << endl;
out << "\tversion(" << version << ")," << endl;
- out << "\thelpstring(\"" << typelib << " " << version << " Type Library\")" << endl;
- out << "]" << endl;
+ out << "\thelpstring(\"" << typelib << ' ' << version << " Type Library\")" << endl;
+ out << ']' << endl;
out << "library " << typelib << "Lib" << endl;
- out << "{" << endl;
+ out << '{' << endl;
out << "\timportlib(\"stdole32.tlb\");" << endl;
out << "\timportlib(\"stdole2.tlb\");" << endl << endl;
@@ -1188,11 +1188,12 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
// We have meta object information for this type. Forward declare it.
if (mo) {
QByteArray cleanType = qax_clean_type(*key, mo).toLatin1();
- out << "\tcoclass " << cleanType << ";" << endl;
+ out << "\tcoclass " << cleanType << ';' << endl;
+ subtypes.append(cleanType);
+ qRegisterMetaType(cleanType, (void**)0);
+ cleanType += '*';
subtypes.append(cleanType);
- subtypes.append(cleanType + "*");
qRegisterMetaType(cleanType, (void**)0);
- qRegisterMetaType(cleanType + "*", (void**)0);
}
}
out << endl;
@@ -1225,7 +1226,7 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
QByteArray cleanType = qax_clean_type(*key, mo).toLatin1();
subtypes.append(cleanType);
- subtypes.append(cleanType + "*");
+ subtypes.append(cleanType + '*');
res = classIDL(o, mo, QString::fromLatin1(className.constData()), isBindable, out);
delete o;
if (res != S_OK)
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp
index f3e1dff..19c2404 100644
--- a/src/activeqt/control/qaxserverbase.cpp
+++ b/src/activeqt/control/qaxserverbase.cpp
@@ -2446,10 +2446,10 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
int nameLength = 0;
if (index == -1) {
nameLength = name.length();
- name += "(";
+ name += '(';
// no parameter - shortcut
if (!pDispParams->cArgs)
- index = mo->indexOfSlot((name + ")"));
+ index = mo->indexOfSlot((name + ')'));
// search
if (index == -1) {
for (int i = 0; i < mo->methodCount(); ++i) {
@@ -2463,7 +2463,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
if (index == -1) {
QRegExp regexp(QLatin1String("_([0-9])\\("));
if (regexp.lastIndexIn(QString::fromLatin1(name.constData())) != -1) {
- name = name.left(name.length() - regexp.cap(0).length()) + "(";
+ name = name.left(name.length() - regexp.cap(0).length()) + '(';
int overload = regexp.cap(1).toInt() + 1;
for (int s = 0; s < qt.object->metaObject()->methodCount(); ++s) {
@@ -2559,7 +2559,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
argv[p + 1] = varp + p + 1;
} else {
argv[p + 1] = const_cast<void*>(varp[p + 1].constData());
- if (ptype.endsWith("*")) {
+ if (ptype.endsWith('*')) {
argv_pointer[p + 1] = argv[p + 1];
argv[p + 1] = argv_pointer + p + 1;
}
@@ -2590,7 +2590,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
} else {
argv[0] = const_cast<void*>(varp[0].constData());
}
- if (type.endsWith("*")) {
+ if (type.endsWith('*')) {
argv_pointer[0] = argv[0];
argv[0] = argv_pointer;
}
diff --git a/src/activeqt/control/qaxservermain.cpp b/src/activeqt/control/qaxservermain.cpp
index a50fef0..e3e1e5d 100644
--- a/src/activeqt/control/qaxservermain.cpp
+++ b/src/activeqt/control/qaxservermain.cpp
@@ -253,7 +253,7 @@ EXTERN_C int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR,
run = false;
break;
} else {
- unprocessed += cmds.at(i) + " ";
+ unprocessed += cmds.at(i) + ' ';
}
}
diff --git a/src/activeqt/shared/qaxtypes.cpp b/src/activeqt/shared/qaxtypes.cpp
index ace81e7..12307f3 100644
--- a/src/activeqt/shared/qaxtypes.cpp
+++ b/src/activeqt/shared/qaxtypes.cpp
@@ -1111,7 +1111,7 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
if (iface) {
QObject *qObj = iface->qObject();
iface->Release();
- var = QVariant(qRegisterMetaType<QObject*>(qObj ? QByteArray(qObj->metaObject()->className()) + "*" : typeName), &qObj);
+ var = QVariant(qRegisterMetaType<QObject*>(qObj ? QByteArray(qObj->metaObject()->className()) + '*' : typeName), &qObj);
} else
#endif
{
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 6328d04..b0ce10c 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -43,8 +43,7 @@
\class QAbstractAnimation
\ingroup group_animation
\brief The QAbstractAnimation class is the base of all animations.
- \since 4.5
- \preliminary
+ \since 4.6
The class defines the functions for the functionality shared by
all animations. By inheriting this class, you can create custom
@@ -189,32 +188,6 @@ void QUnifiedTimer::updateRecentlyStartedAnimations()
animationsToStart.clear();
}
-/*
- defines the timing interval. Default is DEFAULT_TIMER_INTERVAL
-*/
-void QUnifiedTimer::setTimingInterval(int interval)
-{
- timingInterval = interval;
- if (animationTimer.isActive()) {
- //we changed the timing interval
- animationTimer.start(timingInterval, this);
- }
-}
-
-/*
- this allows to have a consistent timer interval at each tick from the timer
- not taking the real time that passed into account.
-*/
-void QUnifiedTimer::setConsistentTiming(bool b)
-{
- consistentTiming = b;
-}
-
-int QUnifiedTimer::elapsedTime() const
-{
- return lastTick;
-}
-
void QUnifiedTimer::timerEvent(QTimerEvent *event)
{
//this is simply the time we last received a tick
@@ -352,42 +325,22 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
\sa QVariantAnimation, QAnimationGroup
*/
-#ifdef QT_EXPERIMENTAL_SOLUTION
-QAbstractAnimation::QAbstractAnimation(QObject *parent)
- : d_ptr(new QAbstractAnimationPrivate)
-{
- // Allow auto-add on reparent
- setParent(parent);
- d_ptr->q_ptr = this;
-}
-#else
QAbstractAnimation::QAbstractAnimation(QObject *parent)
: QObject(*new QAbstractAnimationPrivate, 0)
{
// Allow auto-add on reparent
setParent(parent);
}
-#endif
/*!
\internal
*/
-#ifdef QT_EXPERIMENTAL_SOLUTION
-QAbstractAnimation::QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent)
- : d_ptr(&dd)
-{
- // Allow auto-add on reparent
- setParent(parent);
- d_ptr->q_ptr = this;
-}
-#else
QAbstractAnimation::QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent)
: QObject(dd, 0)
{
// Allow auto-add on reparent
setParent(parent);
}
-#endif
/*!
Stops the animation if it's running, then destroys the
diff --git a/src/corelib/animation/qabstractanimation.h b/src/corelib/animation/qabstractanimation.h
index a7f0082..d6d50dc 100644
--- a/src/corelib/animation/qabstractanimation.h
+++ b/src/corelib/animation/qabstractanimation.h
@@ -123,10 +123,6 @@ protected:
virtual void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
virtual void updateDirection(QAbstractAnimation::Direction direction);
-#ifdef QT_EXPERIMENTAL_SOLUTION
- QAbstractAnimationPrivate *d_ptr;
-#endif
-
private:
Q_DISABLE_COPY(QAbstractAnimation)
Q_DECLARE_PRIVATE(QAbstractAnimation)
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index 41983a5..7a4bfcf 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -56,19 +56,13 @@
#include <QtCore/qbasictimer.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qtimer.h>
-#ifndef QT_EXPERIMENTAL_SOLUTION
#include <private/qobject_p.h>
-#endif
QT_BEGIN_NAMESPACE
class QAnimationGroup;
class QAbstractAnimation;
-#ifdef QT_EXPERIMENTAL_SOLUTION
-class QAbstractAnimationPrivate
-#else
class QAbstractAnimationPrivate : public QObjectPrivate
-#endif
{
public:
QAbstractAnimationPrivate()
@@ -101,30 +95,41 @@ public:
int currentLoop;
QAnimationGroup *group;
-#ifdef QT_EXPERIMENTAL_SOLUTION
- QAbstractAnimation *q_ptr;
-#endif
private:
Q_DECLARE_PUBLIC(QAbstractAnimation)
};
-class Q_CORE_EXPORT QUnifiedTimer : public QObject
+class QUnifiedTimer : public QObject
{
private:
QUnifiedTimer();
public:
- static QUnifiedTimer *instance();
+ //XXX this is needed by dui
+ static Q_CORE_EXPORT QUnifiedTimer *instance();
void registerAnimation(QAbstractAnimation *animation);
void unregisterAnimation(QAbstractAnimation *animation);
- void setTimingInterval(int interval);
- void setConsistentTiming(bool consistent);
+ //defines the timing interval. Default is DEFAULT_TIMER_INTERVAL
+ void setTimingInterval(int interval)
+ {
+ timingInterval = interval;
+ if (animationTimer.isActive()) {
+ //we changed the timing interval
+ animationTimer.start(timingInterval, this);
+ }
+ }
+
+ /*
+ this allows to have a consistent timer interval at each tick from the timer
+ not taking the real time that passed into account.
+ */
+ void setConsistentTiming(bool consistent) { consistentTiming = consistent; }
- int elapsedTime() const;
+ int elapsedTime() const { return lastTick; }
protected:
void timerEvent(QTimerEvent *);
diff --git a/src/corelib/animation/qanimationgroup.cpp b/src/corelib/animation/qanimationgroup.cpp
index 0745d39..839b522 100644
--- a/src/corelib/animation/qanimationgroup.cpp
+++ b/src/corelib/animation/qanimationgroup.cpp
@@ -42,9 +42,8 @@
/*!
\class QAnimationGroup
\brief The QAnimationGroup class is an abstract base class for groups of animations.
- \since 4.5
- \ingroup group_animation
- \preliminary
+ \since 4.6
+ \ingroup animation
An animation group is a container for animations (subclasses of
QAbstractAnimation). A group is usually responsible for managing
@@ -159,7 +158,7 @@ int QAnimationGroup::animationCount() const
Returns the index of \a animation. The returned index can be passed
to the other functions that take an index as an argument.
- \sa insertAnimationAt() animationAt(), takeAnimationAt()
+ \sa insertAnimationAt(), animationAt(), takeAnimationAt()
*/
int QAnimationGroup::indexOfAnimation(QAbstractAnimation *animation) const
{
@@ -169,7 +168,11 @@ int QAnimationGroup::indexOfAnimation(QAbstractAnimation *animation) const
/*!
Adds \a animation to this group. This will call insertAnimationAt with
- index equals to animationCount()
+ index equals to animationCount().
+
+ \note The group takes ownership of the animation.
+
+ \sa removeAnimation()
*/
void QAnimationGroup::addAnimation(QAbstractAnimation *animation)
{
@@ -181,7 +184,10 @@ void QAnimationGroup::addAnimation(QAbstractAnimation *animation)
Inserts \a animation into this animation group at \a index.
If \a index is 0 the animation is inserted at the beginning.
If \a index is animationCount(), the animation is inserted at the end.
- \sa takeAnimationAt(), addAnimation(), indexOfAnimation()
+
+ \note The group takes ownership of the animation.
+
+ \sa takeAnimationAt(), addAnimation(), indexOfAnimation(), removeAnimation()
*/
void QAnimationGroup::insertAnimationAt(int index, QAbstractAnimation *animation)
{
@@ -226,11 +232,11 @@ void QAnimationGroup::removeAnimation(QAbstractAnimation *animation)
}
/*!
- Removes the animation at \a index from this animation group. The ownership
- of the animation is transferred to the caller, and a pointer to the removed
- animation is returned.
+ Returns the animation at \a index and removes it from the animation group.
+
+ \note The ownership of the animation is transferred to the caller.
- \sa addAnimation()
+ \sa removeAnimation(), addAnimation(), insertAnimationAt(), indexOfAnimation()
*/
QAbstractAnimation *QAnimationGroup::takeAnimationAt(int index)
{
diff --git a/src/corelib/animation/qanimationgroup.h b/src/corelib/animation/qanimationgroup.h
index 7dee070..263bc38 100644
--- a/src/corelib/animation/qanimationgroup.h
+++ b/src/corelib/animation/qanimationgroup.h
@@ -42,11 +42,7 @@
#ifndef QANIMATIONGROUP_H
#define QANIMATIONGROUP_H
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qabstractanimation.h"
-#else
-# include <QtCore/qabstractanimation.h>
-#endif
+#include <QtCore/qabstractanimation.h>
QT_BEGIN_HEADER
diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp
index 68dbb9e..13f6073 100644
--- a/src/corelib/animation/qparallelanimationgroup.cpp
+++ b/src/corelib/animation/qparallelanimationgroup.cpp
@@ -42,9 +42,8 @@
/*!
\class QParallelAnimationGroup
\brief The QParallelAnimationGroup class provides a parallel group of animations.
- \since 4.5
- \ingroup group_animation
- \preliminary
+ \since 4.6
+ \ingroup animation
QParallelAnimationGroup--a \l{QAnimationGroup}{container for
animations}--starts all its animations when it is
diff --git a/src/corelib/animation/qparallelanimationgroup.h b/src/corelib/animation/qparallelanimationgroup.h
index 48d66a3..57a8146 100644
--- a/src/corelib/animation/qparallelanimationgroup.h
+++ b/src/corelib/animation/qparallelanimationgroup.h
@@ -42,11 +42,7 @@
#ifndef QPARALLELANIMATIONGROUP_H
#define QPARALLELANIMATIONGROUP_H
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qanimationgroup.h"
-#else
-# include <QtCore/qanimationgroup.h>
-#endif
+#include <QtCore/qanimationgroup.h>
QT_BEGIN_HEADER
diff --git a/src/corelib/animation/qpauseanimation.cpp b/src/corelib/animation/qpauseanimation.cpp
index cf3bb3b..b175f0c 100644
--- a/src/corelib/animation/qpauseanimation.cpp
+++ b/src/corelib/animation/qpauseanimation.cpp
@@ -42,9 +42,8 @@
/*!
\class QPauseAnimation
\brief The QPauseAnimation class provides a pause for QSequentialAnimationGroup.
- \since 4.5
- \ingroup group_animation
- \preliminary
+ \since 4.6
+ \ingroup animation
If you wish to introduce a delay between animations in a
QSequentialAnimationGroup, you can insert a QPauseAnimation. This
diff --git a/src/corelib/animation/qpauseanimation.h b/src/corelib/animation/qpauseanimation.h
index 595f2d0..cb6e041 100644
--- a/src/corelib/animation/qpauseanimation.h
+++ b/src/corelib/animation/qpauseanimation.h
@@ -42,11 +42,7 @@
#ifndef QPAUSEANIMATION_P_H
#define QPAUSEANIMATION_P_H
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qanimationgroup.h"
-#else
-# include <QtCore/qanimationgroup.h>
-#endif
+#include <QtCore/qanimationgroup.h>
QT_BEGIN_HEADER
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index 4bdffa4..47361a5 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -42,8 +42,8 @@
/*!
\class QPropertyAnimation
\brief The QPropertyAnimation class animates Qt properties
- \ingroup group_animation
- \preliminary
+ \since 4.6
+ \ingroup animation
QPropertyAnimation interpolates over \l{Qt's Property System}{Qt
properties}. As property values are stored in \l{QVariant}s, the
@@ -110,17 +110,16 @@ void QPropertyAnimationPrivate::updateMetaProperty()
if (!target || propertyName.isEmpty())
return;
- if (hasMetaProperty == 0 && !property.isValid()) {
+ if (!hasMetaProperty && !property.isValid()) {
const QMetaObject *mo = target->metaObject();
propertyIndex = mo->indexOfProperty(propertyName);
if (propertyIndex != -1) {
- hasMetaProperty = 1;
+ hasMetaProperty = true;
property = mo->property(propertyIndex);
propertyType = property.userType();
} else {
if (!target->dynamicPropertyNames().contains(propertyName))
qWarning("QPropertyAnimation: you're trying to animate a non-existing property %s of your QObject", propertyName.constData());
- hasMetaProperty = 2;
}
}
@@ -133,7 +132,7 @@ void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue)
if (!target || state == QAbstractAnimation::Stopped)
return;
- if (hasMetaProperty == 1) {
+ if (hasMetaProperty) {
if (newValue.userType() == propertyType) {
//no conversion is needed, we directly call the QObject::qt_metacall
void *data = const_cast<void*>(newValue.constData());
@@ -146,6 +145,14 @@ void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue)
}
}
+void QPropertyAnimationPrivate::_q_targetDestroyed()
+{
+ Q_Q(QPropertyAnimation);
+ //we stop here so that this animation is removed from the global hash
+ q->stop();
+ target = 0;
+}
+
/*!
Construct a QPropertyAnimation object. \a parent is passed to QObject's
constructor.
@@ -188,14 +195,27 @@ QObject *QPropertyAnimation::targetObject() const
Q_D(const QPropertyAnimation);
return d->target;
}
+
void QPropertyAnimation::setTargetObject(QObject *target)
{
Q_D(QPropertyAnimation);
if (d->target == target)
return;
+ if (d->state != QAbstractAnimation::Stopped) {
+ qWarning("QPropertyAnimation::setTargetObject: you can't change the target of a running animation");
+ return;
+ }
+
+ //we need to get notified when the target is destroyed
+ if (d->target)
+ disconnect(d->target, SIGNAL(destroyed()), this, SLOT(_q_targetDestroyed()));
+
+ if (target)
+ connect(target, SIGNAL(destroyed()), SLOT(_q_targetDestroyed()));
+
d->target = target;
- d->hasMetaProperty = 0;
+ d->hasMetaProperty = false;
d->updateMetaProperty();
}
@@ -211,11 +231,17 @@ QByteArray QPropertyAnimation::propertyName() const
Q_D(const QPropertyAnimation);
return d->propertyName;
}
+
void QPropertyAnimation::setPropertyName(const QByteArray &propertyName)
{
Q_D(QPropertyAnimation);
+ if (d->state != QAbstractAnimation::Stopped) {
+ qWarning("QPropertyAnimation::setPropertyName: you can't change the property name of a running animation");
+ return;
+ }
+
d->propertyName = propertyName;
- d->hasMetaProperty = 0;
+ d->hasMetaProperty = false;
d->updateMetaProperty();
}
diff --git a/src/corelib/animation/qpropertyanimation.h b/src/corelib/animation/qpropertyanimation.h
index b619256..39317ba 100644
--- a/src/corelib/animation/qpropertyanimation.h
+++ b/src/corelib/animation/qpropertyanimation.h
@@ -42,11 +42,7 @@
#ifndef QPROPERTYANIMATION_H
#define QPROPERTYANIMATION_H
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qvariantanimation.h"
-#else
-# include <QtCore/qvariantanimation.h>
-#endif
+#include <QtCore/qvariantanimation.h>
QT_BEGIN_HEADER
@@ -76,10 +72,11 @@ public:
protected:
bool event(QEvent *event);
-
void updateCurrentValue(const QVariant &value);
void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
+
private:
+ Q_PRIVATE_SLOT(d_func(), void _q_targetDestroyed());
Q_DISABLE_COPY(QPropertyAnimation)
Q_DECLARE_PRIVATE(QPropertyAnimation)
};
diff --git a/src/corelib/animation/qpropertyanimation_p.h b/src/corelib/animation/qpropertyanimation_p.h
index 9d9dd31..a4387dd 100644
--- a/src/corelib/animation/qpropertyanimation_p.h
+++ b/src/corelib/animation/qpropertyanimation_p.h
@@ -55,7 +55,6 @@
#include "qpropertyanimation.h"
#include <QtCore/qmetaobject.h>
-#include <QtCore/qpointer.h>
#include "qvariantanimation_p.h"
@@ -70,14 +69,16 @@ public:
{
}
- QPointer<QObject> target;
+ void _q_targetDestroyed();
+
+ QObject *target;
//for the QProperty
QMetaProperty property;
int propertyType;
int propertyIndex;
- int hasMetaProperty;
+ bool hasMetaProperty;
QByteArray propertyName;
void updateProperty(const QVariant &);
void updateMetaProperty();
diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp
index c610b4f..14814a7 100644
--- a/src/corelib/animation/qsequentialanimationgroup.cpp
+++ b/src/corelib/animation/qsequentialanimationgroup.cpp
@@ -42,9 +42,8 @@
/*!
\class QSequentialAnimationGroup
\brief The QSequentialAnimationGroup class provides a sequential group of animations.
- \since 4.5
- \ingroup group_animation
- \preliminary
+ \since 4.6
+ \ingroup animation
QSequentialAnimationGroup is a QAnimationGroup that runs its
animations in sequence, i.e., it starts one animation after
diff --git a/src/corelib/animation/qsequentialanimationgroup.h b/src/corelib/animation/qsequentialanimationgroup.h
index 4c52d1b..4701a76 100644
--- a/src/corelib/animation/qsequentialanimationgroup.h
+++ b/src/corelib/animation/qsequentialanimationgroup.h
@@ -42,11 +42,7 @@
#ifndef QSEQUENTIALANIMATIONGROUP_H
#define QSEQUENTIALANIMATIONGROUP_H
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qanimationgroup.h"
-#else
-# include <QtCore/qanimationgroup.h>
-#endif
+#include <QtCore/qanimationgroup.h>
QT_BEGIN_HEADER
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
index e27cde8..827993c 100644
--- a/src/corelib/animation/qvariantanimation.cpp
+++ b/src/corelib/animation/qvariantanimation.cpp
@@ -56,17 +56,15 @@ QT_BEGIN_NAMESPACE
\class QVariantAnimation
\ingroup group_animation
\brief The QVariantAnimation class provides an abstract base class for animations.
- \since 4.5
- \preliminary
+ \since 4.6
This class is part of \l{The Animation Framework}. It serves as a
base class for property and item animations, with functions for
shared functionality.
QVariantAnimation cannot be used directly as it is an abstract
- class; it does not implement
- \l{QAbstractAnimation::}{updateCurrentValue()} from
- QAbstractAnimation. The class performs interpolation over
+ class; it has a pure virtual method called updateCurrentValue().
+ The class performs interpolation over
\l{QVariant}s, but leaves using the interpolated values to its
subclasses. Currently, Qt provides QPropertyAnimation, which
animates Qt \l{Qt's Property System}{properties}. See the
@@ -131,11 +129,26 @@ QT_BEGIN_NAMESPACE
\sa currentValue, startValue, endValue
*/
+/*!
+ \fn void QVariantAnimation::updateCurrentValue(const QVariant &value) = 0;
+
+ This pure virtual function is called every time the animation's current
+ value changes. The \a value argument is the new current value.
+
+ \sa currentValue
+*/
+
+
static bool animationValueLessThan(const QVariantAnimation::KeyValue &p1, const QVariantAnimation::KeyValue &p2)
{
return p1.first < p2.first;
}
+static QVariant defaultInterpolator(const void *, const void *, qreal)
+{
+ return QVariant();
+}
+
template<> Q_INLINE_TEMPLATE QRect _q_interpolate(const QRect &f, const QRect &t, qreal progress)
{
QRect ret;
@@ -166,15 +179,39 @@ template<> Q_INLINE_TEMPLATE QLineF _q_interpolate(const QLineF &f, const QLineF
return QLineF( _q_interpolate(f.p1(), t.p1(), progress), _q_interpolate(f.p2(), t.p2(), progress));
}
+QVariantAnimationPrivate::QVariantAnimationPrivate() : duration(250), hasStartValue(false),
+ interpolator(&defaultInterpolator),
+ changedSignalMask(1 << QVariantAnimation::staticMetaObject.indexOfSignal("valueChanged(QVariant)"))
+{
+ //we keep the mask so that we emit valueChanged only when needed (for performance reasons)
+}
+
void QVariantAnimationPrivate::convertValues(int t)
{
//this ensures that all the keyValues are of type t
for (int i = 0; i < keyValues.count(); ++i) {
QVariantAnimation::KeyValue &pair = keyValues[i];
- if (pair.second.userType() != t)
- pair.second.convert(static_cast<QVariant::Type>(t));
+ pair.second.convert(static_cast<QVariant::Type>(t));
}
- interpolator = 0; // if the type changed we need to update the interpolator
+ //we also need update to the current interval if needed
+ currentInterval.start.second.convert(static_cast<QVariant::Type>(t));
+ currentInterval.end.second.convert(static_cast<QVariant::Type>(t));
+
+ //... and the interpolator
+ updateInterpolator();
+}
+
+void QVariantAnimationPrivate::updateInterpolator()
+{
+ int type = currentInterval.start.second.userType();
+ if (type == currentInterval.end.second.userType())
+ interpolator = getInterpolator(type);
+ else
+ interpolator = 0;
+
+ //we make sure that the interpolator is always set to something
+ if (!interpolator)
+ interpolator = &defaultInterpolator;
}
/*!
@@ -212,17 +249,12 @@ void QVariantAnimationPrivate::recalculateCurrentInterval(bool force/*=false*/)
// update all the values of the currentInterval
currentInterval.start = *itStart;
currentInterval.end = *itEnd;
+ updateInterpolator();
}
}
setCurrentValueForProgress(progress);
}
-void QVariantAnimationPrivate::setCurrentValue()
-{
- const qreal progress = easing.valueForProgress(((duration == 0) ? qreal(1) : qreal(currentTime) / qreal(duration)));
- setCurrentValueForProgress(progress);
-}
-
void QVariantAnimationPrivate::setCurrentValueForProgress(const qreal progress)
{
Q_Q(QVariantAnimation);
@@ -236,10 +268,7 @@ void QVariantAnimationPrivate::setCurrentValueForProgress(const qreal progress)
localProgress);
qSwap(currentValue, ret);
q->updateCurrentValue(currentValue);
-#ifndef QT_EXPERIMENTAL_SOLUTION
- if (connectedSignals & changedSignalMask)
-#endif
- if (currentValue != ret) {
+ if ((connectedSignals & changedSignalMask) && currentValue != ret) {
//the value has changed
emit q->valueChanged(currentValue);
}
@@ -292,7 +321,6 @@ void QVariantAnimationPrivate::setDefaultStartValue(const QVariant &value)
*/
QVariantAnimation::QVariantAnimation(QObject *parent) : QAbstractAnimation(*new QVariantAnimationPrivate, parent)
{
- d_func()->init();
}
/*!
@@ -300,7 +328,6 @@ QVariantAnimation::QVariantAnimation(QObject *parent) : QAbstractAnimation(*new
*/
QVariantAnimation::QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent) : QAbstractAnimation(dd, parent)
{
- d_func()->init();
}
/*!
@@ -626,15 +653,7 @@ void QVariantAnimation::updateState(QAbstractAnimation::State oldState,
*/
QVariant QVariantAnimation::interpolated(const QVariant &from, const QVariant &to, qreal progress) const
{
- Q_D(const QVariantAnimation);
- if (d->interpolator == 0) {
- if (from.userType() == to.userType())
- d->interpolator = QVariantAnimationPrivate::getInterpolator(from.userType());
- if (d->interpolator == 0) //no interpolator found
- return QVariant();
- }
-
- return d->interpolator(from.constData(), to.constData(), progress);
+ return d_func()->interpolator(from.constData(), to.constData(), progress);
}
/*!
@@ -642,9 +661,8 @@ QVariant QVariantAnimation::interpolated(const QVariant &from, const QVariant &t
*/
void QVariantAnimation::updateCurrentTime(int msecs)
{
- Q_D(QVariantAnimation);
Q_UNUSED(msecs);
- d->recalculateCurrentInterval();
+ d_func()->recalculateCurrentInterval();
}
QT_END_NAMESPACE
diff --git a/src/corelib/animation/qvariantanimation.h b/src/corelib/animation/qvariantanimation.h
index 69dbbf3..3ae172f 100644
--- a/src/corelib/animation/qvariantanimation.h
+++ b/src/corelib/animation/qvariantanimation.h
@@ -42,13 +42,8 @@
#ifndef QANIMATION_H
#define QANIMATION_H
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qabstractanimation.h"
-# include "qeasingcurve.h"
-#else
-# include <QtCore/qeasingcurve.h>
-# include <QtCore/qabstractanimation.h>
-#endif
+#include <QtCore/qeasingcurve.h>
+#include <QtCore/qabstractanimation.h>
#include <QtCore/qvector.h>
#include <QtCore/qvariant.h>
#include <QtCore/qpair.h>
@@ -122,7 +117,7 @@ private:
};
template <typename T>
-static void qRegisterAnimationInterpolator(QVariant (*func)(const T &from, const T &to, qreal progress)) {
+void qRegisterAnimationInterpolator(QVariant (*func)(const T &from, const T &to, qreal progress)) {
QVariantAnimation::registerInterpolator(reinterpret_cast<QVariantAnimation::Interpolator>(func), qMetaTypeId<T>());
}
diff --git a/src/corelib/animation/qvariantanimation_p.h b/src/corelib/animation/qvariantanimation_p.h
index 9e81649..aee2324 100644
--- a/src/corelib/animation/qvariantanimation_p.h
+++ b/src/corelib/animation/qvariantanimation_p.h
@@ -54,11 +54,7 @@
//
#include "qvariantanimation.h"
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qeasingcurve.h"
-#else
-# include <QtCore/qeasingcurve.h>
-#endif
+#include <QtCore/qeasingcurve.h>
#include <QtCore/qmetaobject.h>
#include <QtCore/qvector.h>
@@ -66,22 +62,12 @@
QT_BEGIN_NAMESPACE
-class Q_CORE_EXPORT QVariantAnimationPrivate : public QAbstractAnimationPrivate
+class QVariantAnimationPrivate : public QAbstractAnimationPrivate
{
Q_DECLARE_PUBLIC(QVariantAnimation)
public:
- QVariantAnimationPrivate() : duration(250), hasStartValue(false)
- {
- }
-
- void init()
- {
- //we keep the mask so that we emit valueChanged only when needed (for performance reasons)
- changedSignalMask = (1 << q_func()->metaObject()->indexOfSignal("valueChanged(QVariant)"));
- currentInterval.start.first = currentInterval.end.first = 2; //will force the initial refresh
- interpolator = 0;
- }
+ QVariantAnimationPrivate();
static QVariantAnimationPrivate *get(QVariantAnimation *q)
{
@@ -104,18 +90,20 @@ public:
QVariantAnimation::KeyValue start, end;
} currentInterval;
- mutable QVariantAnimation::Interpolator interpolator;
+ QVariantAnimation::Interpolator interpolator;
- quint32 changedSignalMask;
+ const quint32 changedSignalMask;
- void setCurrentValue();
void setCurrentValueForProgress(const qreal progress);
void recalculateCurrentInterval(bool force=false);
void setValueAt(qreal, const QVariant &);
QVariant valueAt(qreal step) const;
void convertValues(int t);
- static QVariantAnimation::Interpolator getInterpolator(int interpolationType);
+ void updateInterpolator();
+
+ //XXX this is needed by dui
+ static Q_CORE_EXPORT QVariantAnimation::Interpolator getInterpolator(int interpolationType);
};
//this should make the interpolation faster
diff --git a/src/corelib/arch/qatomic_bootstrap.h b/src/corelib/arch/qatomic_bootstrap.h
index af76903..7584b84 100644
--- a/src/corelib/arch/qatomic_bootstrap.h
+++ b/src/corelib/arch/qatomic_bootstrap.h
@@ -92,20 +92,6 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValu
return false;
}
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
-{
- T *currentValue = _q_value;
- _q_value = newValue;
- return currentValue;
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
-{
- return testAndSetOrdered(expectedValue, newValue);
-}
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/concurrent/qfuturewatcher_p.h b/src/corelib/concurrent/qfuturewatcher_p.h
index 324839d..d53a1bd 100644
--- a/src/corelib/concurrent/qfuturewatcher_p.h
+++ b/src/corelib/concurrent/qfuturewatcher_p.h
@@ -63,8 +63,8 @@
QT_BEGIN_NAMESPACE
class QFutureWatcherBase;
-class Q_CORE_EXPORT QFutureWatcherBasePrivate : public QObjectPrivate,
- public QFutureCallOutInterface
+class QFutureWatcherBasePrivate : public QObjectPrivate,
+ public QFutureCallOutInterface
{
Q_DECLARE_PUBLIC(QFutureWatcherBase)
diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt
index 5d63e46..23ec7b0 100644
--- a/src/corelib/global/qfeatures.txt
+++ b/src/corelib/global/qfeatures.txt
@@ -1157,6 +1157,14 @@ Requires: PROPERTIES
Name: Accessibility
SeeAlso: ???
+Feature: ANIMATION
+Description: Provides a framework for animations.
+Section: Utilities
+Requires: PROPERTIES
+Name: Animation
+SeeAlso: ???
+
+
# SVG
Feature: SVG
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index ce98ec4..763935e 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -125,7 +125,8 @@ QT_BEGIN_NAMESPACE
If you want to use QFlags for your own enum types, use
the Q_DECLARE_FLAGS() and Q_DECLARE_OPERATORS_FOR_FLAGS().
- For example:
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 1
@@ -442,14 +443,18 @@ QT_BEGIN_NAMESPACE
function. You can retrieve the minimum and maximum of two given
objects using qMin() and qMax() respectively. All these functions
return a corresponding template type; the template types can be
- replaced by any other type. For example:
+ replaced by any other type.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 3
<QtGlobal> also contains functions that generate messages from the
given string argument: qCritical(), qDebug(), qFatal() and
qWarning(). These functions call the message handler with the
- given message. For example:
+ given message.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 4
@@ -694,7 +699,9 @@ QT_BEGIN_NAMESPACE
\relates <QtGlobal>
Wraps the signed 64-bit integer \a literal in a
- platform-independent way. For example:
+ platform-independent way.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 8
@@ -705,7 +712,9 @@ QT_BEGIN_NAMESPACE
\relates <QtGlobal>
Wraps the unsigned 64-bit integer \a literal in a
- platform-independent way. For example:
+ platform-independent way.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 9
@@ -734,7 +743,11 @@ QT_BEGIN_NAMESPACE
/*! \fn const T &qAbs(const T &value)
\relates <QtGlobal>
- Returns the absolute value of \a value. For example:
+ Compares \a value to the 0 of type T and returns the absolute
+ value. Thus if T is \e {double}, then \a value is compared to
+ \e{(double) 0}.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 10
*/
@@ -742,7 +755,9 @@ QT_BEGIN_NAMESPACE
/*! \fn int qRound(qreal value)
\relates <QtGlobal>
- Rounds \a value to the nearest integer. For example:
+ Rounds \a value to the nearest integer.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 11
*/
@@ -750,7 +765,9 @@ QT_BEGIN_NAMESPACE
/*! \fn qint64 qRound64(qreal value)
\relates <QtGlobal>
- Rounds \a value to the nearest 64-bit integer. For example:
+ Rounds \a value to the nearest 64-bit integer.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 12
*/
@@ -758,7 +775,9 @@ QT_BEGIN_NAMESPACE
/*! \fn const T &qMin(const T &value1, const T &value2)
\relates <QtGlobal>
- Returns the minimum of \a value1 and \a value2. For example:
+ Returns the minimum of \a value1 and \a value2.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 13
@@ -768,7 +787,9 @@ QT_BEGIN_NAMESPACE
/*! \fn const T &qMax(const T &value1, const T &value2)
\relates <QtGlobal>
- Returns the maximum of \a value1 and \a value2. For example:
+ Returns the maximum of \a value1 and \a value2.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 14
@@ -779,7 +800,9 @@ QT_BEGIN_NAMESPACE
\relates <QtGlobal>
Returns \a value bounded by \a min and \a max. This is equivalent
- to qMax(\a min, qMin(\a value, \a max)). For example:
+ to qMax(\a min, qMin(\a value, \a max)).
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 15
@@ -925,7 +948,9 @@ QT_BEGIN_NAMESPACE
4.1.2, the QT_VERSION macro will expand to 0x040102.
You can use QT_VERSION to use the latest Qt features where
- available. For example:
+ available.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 16
@@ -1985,7 +2010,7 @@ void qt_message_output(QtMsgType msgType, const char *buf)
mac_default_handler(buf);
#elif defined(Q_OS_WINCE)
QString fstr = QString::fromLatin1(buf);
- fstr += QLatin1String("\n");
+ fstr += QLatin1Char('\n');
OutputDebugString(reinterpret_cast<const wchar_t *> (fstr.utf16()));
#else
fprintf(stderr, "%s\n", buf);
@@ -2243,7 +2268,7 @@ bool qputenv(const char *varName, const QByteArray& value)
return _putenv_s(varName, value.constData()) == 0;
#else
QByteArray buffer(varName);
- buffer += "=";
+ buffer += '=';
buffer += value;
return putenv(qstrdup(buffer.constData())) == 0;
#endif
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 41265ba..f6c90f7 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -128,22 +128,6 @@ namespace QT_NAMESPACE {}
#endif /* __cplusplus */
-/**
- * For animation framework to work seamlessly as a solution
- */
-#if 0
-# define QT_EXPERIMENTAL_BEGIN_NAMESPACE namespace QtExperimental {
-# define QT_EXPERIMENTAL_END_NAMESPACE }
-# define QT_EXPERIMENTAL_USE_NAMESPACE using namespace QtExperimental;
-# define QT_EXPERIMENTAL_PREPEND_NAMESPACE(name) QtExperimental::name
-namespace QtExperimental {}
-#else
-# define QT_EXPERIMENTAL_BEGIN_NAMESPACE
-# define QT_EXPERIMENTAL_END_NAMESPACE
-# define QT_EXPERIMENTAL_USE_NAMESPACE
-# define QT_EXPERIMENTAL_PREPEND_NAMESPACE(name) name
-#endif
-
#if defined(Q_OS_MAC) && !defined(Q_CC_INTEL)
#define QT_BEGIN_HEADER extern "C++" {
#define QT_END_HEADER }
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 29e356e..7f6ff20 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -434,14 +434,14 @@ QLibraryInfo::location(LibraryLocation loc)
#else
if (QCoreApplication::instance()) {
#ifdef Q_OS_MAC
- CFBundleRef bundleRef = CFBundleGetMainBundle();
- if (bundleRef) {
- QCFType<CFURLRef> urlRef = CFBundleCopyBundleURL(bundleRef);
- if (urlRef) {
- QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
- return QDir::cleanPath(path + QLatin1String("/Contents"));
- }
- }
+ CFBundleRef bundleRef = CFBundleGetMainBundle();
+ if (bundleRef) {
+ QCFType<CFURLRef> urlRef = CFBundleCopyBundleURL(bundleRef);
+ if (urlRef) {
+ QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
+ return QDir::cleanPath(path + QLatin1String("/Contents/") + ret);
+ }
+ }
#endif
return QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(ret);
} else {
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 3367581..9e53d89 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1327,7 +1327,8 @@ public:
DirectConnection,
QueuedConnection,
AutoCompatConnection,
- BlockingQueuedConnection
+ BlockingQueuedConnection,
+ UniqueConnection = 0x80
};
enum ShortcutContext {
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp
index b203899..e324ffe 100644
--- a/src/corelib/io/qdatastream.cpp
+++ b/src/corelib/io/qdatastream.cpp
@@ -622,11 +622,16 @@ QDataStream &QDataStream::operator>>(qint16 &i)
setStatus(ReadPastEnd);
}
} else {
- register uchar *p = (uchar *)(&i);
+ union {
+ qint16 val1;
+ char val2[2];
+ } x;
+ char *p = x.val2;
char b[2];
if (dev->read(b, 2) == 2) {
*p++ = b[1];
*p = b[0];
+ i = x.val1;
} else {
setStatus(ReadPastEnd);
}
@@ -660,13 +665,18 @@ QDataStream &QDataStream::operator>>(qint32 &i)
setStatus(ReadPastEnd);
}
} else { // swap bytes
- uchar *p = (uchar *)(&i);
+ union {
+ qint32 val1;
+ char val2[4];
+ } x;
+ char *p = x.val2;
char b[4];
if (dev->read(b, 4) == 4) {
*p++ = b[3];
*p++ = b[2];
*p++ = b[1];
*p = b[0];
+ i = x.val1;
} else {
setStatus(ReadPastEnd);
}
@@ -703,7 +713,12 @@ QDataStream &QDataStream::operator>>(qint64 &i)
setStatus(ReadPastEnd);
}
} else { // swap bytes
- uchar *p = (uchar *)(&i);
+ union {
+ qint64 val1;
+ char val2[8];
+ } x;
+
+ char *p = x.val2;
char b[8];
if (dev->read(b, 8) == 8) {
*p++ = b[7];
@@ -714,6 +729,7 @@ QDataStream &QDataStream::operator>>(qint64 &i)
*p++ = b[2];
*p++ = b[1];
*p = b[0];
+ i = x.val1;
} else {
setStatus(ReadPastEnd);
}
@@ -751,13 +767,19 @@ QDataStream &QDataStream::operator>>(float &f)
setStatus(ReadPastEnd);
}
} else { // swap bytes
- uchar *p = (uchar *)(&f);
+ union {
+ float val1;
+ char val2[4];
+ } x;
+
+ char *p = x.val2;
char b[4];
if (dev->read(b, 4) == 4) {
*p++ = b[3];
*p++ = b[2];
*p++ = b[1];
*p = b[0];
+ f = x.val1;
} else {
setStatus(ReadPastEnd);
}
@@ -788,7 +810,11 @@ QDataStream &QDataStream::operator>>(double &f)
setStatus(ReadPastEnd);
}
} else { // swap bytes
- register uchar *p = (uchar *)(&f);
+ union {
+ double val1;
+ char val2[8];
+ } x;
+ char *p = x.val2;
char b[8];
if (dev->read(b, 8) == 8) {
*p++ = b[7];
@@ -799,13 +825,18 @@ QDataStream &QDataStream::operator>>(double &f)
*p++ = b[2];
*p++ = b[1];
*p = b[0];
+ f = x.val1;
} else {
setStatus(ReadPastEnd);
}
}
#else
//non-standard floating point format
- register uchar *p = (uchar *)(&f);
+ union {
+ double val1;
+ char val2[8];
+ } x;
+ char *p = x.val2;
char b[8];
if (dev->read(b, 8) == 8) {
if (noswap) {
@@ -827,6 +858,7 @@ QDataStream &QDataStream::operator>>(double &f)
*p++ = b[Q_DF(1)];
*p = b[Q_DF(0)];
}
+ f = x.val1;
} else {
setStatus(ReadPastEnd);
}
@@ -970,7 +1002,12 @@ QDataStream &QDataStream::operator<<(qint16 i)
if (noswap) {
dev->write((char *)&i, sizeof(qint16));
} else { // swap bytes
- register uchar *p = (uchar *)(&i);
+ union {
+ qint16 val1;
+ char val2[2];
+ } x;
+ x.val1 = i;
+ char *p = x.val2;
char b[2];
b[1] = *p++;
b[0] = *p;
@@ -992,7 +1029,12 @@ QDataStream &QDataStream::operator<<(qint32 i)
if (noswap) {
dev->write((char *)&i, sizeof(qint32));
} else { // swap bytes
- register uchar *p = (uchar *)(&i);
+ union {
+ qint32 val1;
+ char val2[4];
+ } x;
+ x.val1 = i;
+ char *p = x.val2;
char b[4];
b[3] = *p++;
b[2] = *p++;
@@ -1022,13 +1064,18 @@ QDataStream &QDataStream::operator<<(qint64 i)
{
CHECK_STREAM_PRECOND(*this)
if (version() < 6) {
- quint32 i1 = i & 0xffffffff;
- quint32 i2 = i >> 32;
- *this << i2 << i1;
+ quint32 i1 = i & 0xffffffff;
+ quint32 i2 = i >> 32;
+ *this << i2 << i1;
} else if (noswap) { // no conversion needed
dev->write((char *)&i, sizeof(qint64));
} else { // swap bytes
- register uchar *p = (uchar *)(&i);
+ union {
+ qint64 val1;
+ char val2[8];
+ } x;
+ x.val1 = i;
+ char *p = x.val2;
char b[8];
b[7] = *p++;
b[6] = *p++;
@@ -1077,7 +1124,12 @@ QDataStream &QDataStream::operator<<(float f)
if (noswap) { // no conversion needed
dev->write((char *)&g, sizeof(float));
} else { // swap bytes
- register uchar *p = (uchar *)(&g);
+ union {
+ float val1;
+ char val2[4];
+ } x;
+ x.val1 = f;
+ char *p = x.val2;
char b[4];
b[3] = *p++;
b[2] = *p++;
@@ -1103,7 +1155,12 @@ QDataStream &QDataStream::operator<<(double f)
if (noswap) {
dev->write((char *)&f, sizeof(double));
} else {
- register uchar *p = (uchar *)(&f);
+ union {
+ double val1;
+ char val2[8];
+ } x;
+ x.val1 = f;
+ char *p = x.val2;
char b[8];
b[7] = *p++;
b[6] = *p++;
@@ -1116,7 +1173,12 @@ QDataStream &QDataStream::operator<<(double f)
dev->write(b, 8);
}
#else
- register uchar *p = (uchar *)(&f);
+ union {
+ double val1;
+ char val2[8];
+ } x;
+ x.val1 = f;
+ char *p = x.val2;
char b[8];
if (noswap) {
b[Q_DF(0)] = *p++;
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 9b0fbe5..54121f6 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -85,11 +85,11 @@ public:
delete stream;
}
}
- inline QDebug &space() { stream->space = true; stream->ts << " "; return *this; }
+ inline QDebug &space() { stream->space = true; stream->ts << ' '; return *this; }
inline QDebug &nospace() { stream->space = false; return *this; }
- inline QDebug &maybeSpace() { if (stream->space) stream->ts << " "; return *this; }
+ inline QDebug &maybeSpace() { if (stream->space) stream->ts << ' '; return *this; }
- inline QDebug &operator<<(QChar t) { stream->ts << "\'" << t << "\'"; return maybeSpace(); }
+ inline QDebug &operator<<(QChar t) { stream->ts << '\'' << t << '\''; return maybeSpace(); }
inline QDebug &operator<<(QBool t) { stream->ts << (bool(t) ? "true" : "false"); return maybeSpace(); }
inline QDebug &operator<<(bool t) { stream->ts << (t ? "true" : "false"); return maybeSpace(); }
inline QDebug &operator<<(char t) { stream->ts << t; return maybeSpace(); }
@@ -106,10 +106,10 @@ public:
inline QDebug &operator<<(float t) { stream->ts << t; return maybeSpace(); }
inline QDebug &operator<<(double t) { stream->ts << t; return maybeSpace(); }
inline QDebug &operator<<(const char* t) { stream->ts << QString::fromAscii(t); return maybeSpace(); }
- inline QDebug &operator<<(const QString & t) { stream->ts << "\"" << t << "\""; return maybeSpace(); }
+ inline QDebug &operator<<(const QString & t) { stream->ts << '\"' << t << '\"'; return maybeSpace(); }
inline QDebug &operator<<(const QStringRef & t) { return operator<<(t.toString()); }
- inline QDebug &operator<<(const QLatin1String &t) { stream->ts << "\"" << t.latin1() << "\""; return maybeSpace(); }
- inline QDebug &operator<<(const QByteArray & t) { stream->ts << "\"" << t << "\""; return maybeSpace(); }
+ inline QDebug &operator<<(const QLatin1String &t) { stream->ts << '\"' << t.latin1() << '\"'; return maybeSpace(); }
+ inline QDebug &operator<<(const QByteArray & t) { stream->ts << '\"' << t << '\"'; return maybeSpace(); }
inline QDebug &operator<<(const void * t) { stream->ts << t; return maybeSpace(); }
inline QDebug &operator<<(QTextStreamFunction f) {
stream->ts << f;
@@ -159,13 +159,13 @@ template <class T>
inline QDebug operator<<(QDebug debug, const QList<T> &list)
#endif
{
- debug.nospace() << "(";
+ debug.nospace() << '(';
for (Q_TYPENAME QList<T>::size_type i = 0; i < list.count(); ++i) {
if (i)
debug << ", ";
debug << list.at(i);
}
- debug << ")";
+ debug << ')';
return debug.space();
}
@@ -192,9 +192,9 @@ inline QDebug operator<<(QDebug debug, const QMap<aKey, aT> &map)
debug.nospace() << "QMap(";
for (typename QMap<aKey, aT>::const_iterator it = map.constBegin();
it != map.constEnd(); ++it) {
- debug << "(" << it.key() << ", " << it.value() << ")";
+ debug << '(' << it.key() << ", " << it.value() << ')';
}
- debug << ")";
+ debug << ')';
return debug.space();
}
@@ -209,8 +209,8 @@ inline QDebug operator<<(QDebug debug, const QHash<aKey, aT> &hash)
debug.nospace() << "QHash(";
for (typename QHash<aKey, aT>::const_iterator it = hash.constBegin();
it != hash.constEnd(); ++it)
- debug << "(" << it.key() << ", " << it.value() << ")";
- debug << ")";
+ debug << '(' << it.key() << ", " << it.value() << ')';
+ debug << ')';
return debug.space();
}
@@ -222,7 +222,7 @@ template <class T1, class T2>
inline QDebug operator<<(QDebug debug, const QPair<T1, T2> &pair)
#endif
{
- debug.nospace() << "QPair(" << pair.first << "," << pair.second << ")";
+ debug.nospace() << "QPair(" << pair.first << ',' << pair.second << ')';
return debug.space();
}
@@ -247,7 +247,7 @@ inline QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache)
if (i != cache.lastIndex())
debug << ", ";
}
- debug << ")";
+ debug << ')';
return debug.space();
}
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 0dc8a63..7d330e6 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -2417,7 +2417,7 @@ QDebug operator<<(QDebug debug, QDir::Filters filters)
if (filters & QDir::System) flags << QLatin1String("System");
if (filters & QDir::CaseSensitive) flags << QLatin1String("CaseSensitive");
}
- debug << "QDir::Filters(" << qPrintable(flags.join(QLatin1String("|"))) << ")";
+ debug << "QDir::Filters(" << qPrintable(flags.join(QLatin1String("|"))) << ')';
return debug;
}
@@ -2439,8 +2439,8 @@ QDebug operator<<(QDebug debug, QDir::SortFlags sorting)
if (sorting & QDir::LocaleAware) flags << QLatin1String("LocaleAware");
if (sorting & QDir::Type) flags << QLatin1String("Type");
debug << "QDir::SortFlags(" << qPrintable(type)
- << "|"
- << qPrintable(flags.join(QLatin1String("|"))) << ")";
+ << '|'
+ << qPrintable(flags.join(QLatin1String("|"))) << ')';
}
return debug;
}
@@ -2452,9 +2452,9 @@ QDebug operator<<(QDebug debug, const QDir &dir)
<< qPrintable(dir.nameFilters().join(QLatin1String(",")))
<< "}, "
<< dir.sorting()
- << ","
+ << ','
<< dir.filter()
- << ")";
+ << ')';
return debug.space();
}
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 04750b0..4deaddb 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -719,38 +719,47 @@ QFile::rename(const QString &newName)
return true;
}
- QFile in(fileName());
+ if (isSequential()) {
+ d->setError(QFile::RenameError, tr("Will not rename sequential file using block copy"));
+ return false;
+ }
+
QFile out(newName);
- if (in.open(QIODevice::ReadOnly)) {
+ if (open(QIODevice::ReadOnly)) {
if (out.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
bool error = false;
char block[4096];
- qint64 read;
- while ((read = in.read(block, sizeof(block))) > 0) {
- if (read != out.write(block, read)) {
+ qint64 bytes;
+ while ((bytes = read(block, sizeof(block))) > 0) {
+ if (bytes != out.write(block, bytes)) {
d->setError(QFile::RenameError, out.errorString());
error = true;
break;
}
}
- if (read == -1) {
- d->setError(QFile::RenameError, in.errorString());
+ if (bytes == -1) {
+ d->setError(QFile::RenameError, errorString());
error = true;
}
if(!error) {
- if (!in.remove()) {
+ if (!remove()) {
d->setError(QFile::RenameError, tr("Cannot remove source file"));
error = true;
}
}
if (error)
out.remove();
- else
+ else {
+ setPermissions(permissions());
+ unsetError();
setFileName(newName);
+ }
+ close();
return !error;
}
+ close();
}
- d->setError(QFile::RenameError, out.isOpen() ? in.errorString() : out.errorString());
+ d->setError(QFile::RenameError, out.isOpen() ? errorString() : out.errorString());
}
return false;
}
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index e073a08..65cfb71 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -118,7 +118,7 @@ public:
void stop();
-private slots:
+private Q_SLOTS:
void timeout();
};
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 61ea7cc..07f3c9c 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -312,6 +312,10 @@ bool QFSFileEnginePrivate::openFh(QIODevice::OpenMode openMode, FILE *fh)
if (ret == -1) {
q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError,
qt_error_string(int(errno)));
+
+ this->openMode = QIODevice::NotOpen;
+ this->fh = 0;
+
return false;
}
}
@@ -335,6 +339,7 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode, int fd)
if ((openMode & QFile::WriteOnly) && !(openMode & (QFile::ReadOnly | QFile::Append)))
openMode |= QFile::Truncate;
+ d->openMode = openMode;
d->lastFlushFailed = false;
d->closeFileHandle = false;
d->nativeFilePath.clear();
@@ -367,6 +372,10 @@ bool QFSFileEnginePrivate::openFd(QIODevice::OpenMode openMode, int fd)
if (ret == -1) {
q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError,
qt_error_string(int(errno)));
+
+ this->openMode = QIODevice::NotOpen;
+ this->fd = -1;
+
return false;
}
}
@@ -868,6 +877,119 @@ bool QFSFileEngine::supportsExtension(Extension extension) const
return false;
}
+/*! \fn bool QFSFileEngine::caseSensitive() const
+ Returns true for Windows, false for Unix.
+*/
+
+/*! \fn bool QFSFileEngine::copy(const QString &copyName)
+
+ For windows, copy the file to file \a copyName.
+
+ Not implemented for Unix.
+*/
+
+/*! \fn QString QFSFileEngine::currentPath(const QString &fileName)
+ For Unix, returns the current working directory for the file
+ engine.
+
+ For Windows, returns the canonicalized form of the current path used
+ by the file engine for the drive specified by \a fileName. On
+ Windows, each drive has its own current directory, so a different
+ path is returned for file names that include different drive names
+ (e.g. A: or C:).
+
+ \sa setCurrentPath()
+*/
+
+/*! \fn QFileInfoList QFSFileEngine::drives()
+ For Windows, returns the list of drives in the file system as a list
+ of QFileInfo objects. On unix, Mac OS X and Windows CE, only the
+ root path is returned. On Windows, this function returns all drives
+ (A:\, C:\, D:\, etc.).
+
+ For Unix, the list contains just the root path "/".
+*/
+
+/*! \fn QString QFSFileEngine::fileName(FileName file) const
+ \reimp
+*/
+
+/*! \fn QDateTime QFSFileEngine::fileTime(FileTime time) const
+ \reimp
+*/
+
+/*! \fn QString QFSFileEngine::homePath()
+ Returns the home path of the current user.
+
+ \sa rootPath()
+*/
+
+/*! \fn bool QFSFileEngine::isRelativePath() const
+ \reimp
+*/
+
+/*! \fn bool QFSFileEngine::link(const QString &newName)
+
+ Creates a link from the file currently specified by fileName() to
+ \a newName. What a link is depends on the underlying filesystem
+ (be it a shortcut on Windows or a symbolic link on Unix). Returns
+ true if successful; otherwise returns false.
+*/
+
+/*! \fn bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) const
+ \reimp
+*/
+
+/*! \fn uint QFSFileEngine::ownerId(FileOwner own) const
+ In Unix, if stat() is successful, the \c uid is returned if
+ \a own is the owner. Otherwise the \c gid is returned. If stat()
+ is unsuccessful, -2 is reuturned.
+
+ For Windows, -2 is always returned.
+*/
+
+/*! \fn QString QFSFileEngine::owner(FileOwner own) const
+ \reimp
+*/
+
+/*! \fn bool QFSFileEngine::remove()
+ \reimp
+*/
+
+/*! \fn bool QFSFileEngine::rename(const QString &newName)
+ \reimp
+*/
+
+/*! \fn bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) const
+ \reimp
+*/
+
+/*! \fn QString QFSFileEngine::rootPath()
+ Returns the root path.
+
+ \sa homePath()
+*/
+
+/*! \fn bool QFSFileEngine::setCurrentPath(const QString &path)
+ Sets the current path (e.g., for QDir), to \a path. Returns true if the
+ new path exists; otherwise this function does nothing, and returns false.
+
+ \sa currentPath()
+*/
+
+/*! \fn bool QFSFileEngine::setPermissions(uint perms)
+ \reimp
+*/
+
+/*! \fn bool QFSFileEngine::setSize(qint64 size)
+ \reimp
+*/
+
+/*! \fn QString QFSFileEngine::tempPath()
+ Returns the temporary path (i.e., a path in which it is safe
+ to store temporary files).
+*/
+
QT_END_NAMESPACE
#endif // QT_NO_FSFILEENGINE
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 7a6a85b..3c443ff 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -83,12 +83,12 @@ static QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QString &
} else if (flags & QIODevice::WriteOnly) {
mode = "wb";
if (flags & QIODevice::ReadOnly)
- mode += "+";
+ mode += '+';
}
if (flags & QIODevice::Append) {
mode = "ab";
if (flags & QIODevice::ReadOnly)
- mode += "+";
+ mode += '+';
}
return mode;
}
@@ -273,9 +273,8 @@ qint64 QFSFileEnginePrivate::nativeRead(char *data, qint64 len)
int oldFlags = fcntl(QT_FILENO(fh), F_GETFL);
for (int i = 0; i < 2; ++i) {
// Unix: Make the underlying file descriptor non-blocking
- int v = 1;
if ((oldFlags & O_NONBLOCK) == 0)
- fcntl(QT_FILENO(fh), F_SETFL, oldFlags | O_NONBLOCK, &v, sizeof(v));
+ fcntl(QT_FILENO(fh), F_SETFL, oldFlags | O_NONBLOCK);
// Cross platform stdlib read
size_t read = 0;
@@ -293,8 +292,7 @@ qint64 QFSFileEnginePrivate::nativeRead(char *data, qint64 len)
// Unix: Restore the blocking state of the underlying socket
if ((oldFlags & O_NONBLOCK) == 0) {
- int v = 1;
- fcntl(QT_FILENO(fh), F_SETFL, oldFlags, &v, sizeof(v));
+ fcntl(QT_FILENO(fh), F_SETFL, oldFlags);
if (readBytes == 0) {
int readByte = 0;
do {
@@ -311,8 +309,7 @@ qint64 QFSFileEnginePrivate::nativeRead(char *data, qint64 len)
}
// Unix: Restore the blocking state of the underlying socket
if ((oldFlags & O_NONBLOCK) == 0) {
- int v = 1;
- fcntl(QT_FILENO(fh), F_SETFL, oldFlags, &v, sizeof(v));
+ fcntl(QT_FILENO(fh), F_SETFL, oldFlags);
}
if (readBytes == 0 && !feof(fh)) {
// if we didn't read anything and we're not at EOF, it must be an error
@@ -726,7 +723,7 @@ QString QFSFileEngine::fileName(FileName file) const
bool isDir = ret.endsWith(QLatin1Char('/'));
ret = QDir::cleanPath(ret);
if (isDir)
- ret += QLatin1String("/");
+ ret += QLatin1Char('/');
if (file == AbsolutePathName) {
int slash = ret.lastIndexOf(QLatin1Char('/'));
if (slash == -1)
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index c5b54b4..790f1eb 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -433,7 +433,7 @@ static QString nativeAbsoluteFilePathW(const QString &path)
if (retLen != 0)
ret = QString::fromUtf16((unsigned short *)buf.data(), retLen);
#else
- if (path.startsWith(QLatin1String("/")) || path.startsWith(QLatin1String("\\")))
+ if (path.startsWith(QLatin1Char('/')) || path.startsWith(QLatin1Char('\\')))
ret = QDir::toNativeSeparators(path);
else
ret = QDir::toNativeSeparators(QDir::cleanPath(qfsPrivateCurrentDir + QLatin1Char('/') + path));
@@ -946,9 +946,6 @@ bool QFSFileEnginePrivate::nativeIsSequential() const
return false;
}
-/*!
- \reimp
-*/
bool QFSFileEngine::remove()
{
Q_D(QFSFileEngine);
@@ -959,9 +956,6 @@ bool QFSFileEngine::remove()
});
}
-/*!
- \reimp
-*/
bool QFSFileEngine::copy(const QString &copyName)
{
Q_D(QFSFileEngine);
@@ -974,9 +968,6 @@ bool QFSFileEngine::copy(const QString &copyName)
});
}
-/*!
- \reimp
-*/
bool QFSFileEngine::rename(const QString &newName)
{
Q_D(QFSFileEngine);
@@ -1017,9 +1008,6 @@ static inline bool mkDir(const QString &path)
});
}
-/*!
- \reimp
-*/
static inline bool rmDir(const QString &path)
{
QT_WA({
@@ -1029,9 +1017,6 @@ static inline bool rmDir(const QString &path)
});
}
-/*!
- \reimp
-*/
static inline bool isDirPath(const QString &dirPath, bool *existed)
{
QString path = dirPath;
@@ -1054,9 +1039,6 @@ static inline bool isDirPath(const QString &dirPath, bool *existed)
return fileAttrib & FILE_ATTRIBUTE_DIRECTORY;
}
-/*!
- \reimp
-*/
bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) const
{
QString dirName = name;
@@ -1097,9 +1079,6 @@ bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) con
return mkDir(name);
}
-/*!
- \reimp
-*/
bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) const
{
QString dirName = name;
@@ -1120,20 +1099,11 @@ bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) co
return rmDir(name);
}
-/*!
- \reimp
-*/
bool QFSFileEngine::caseSensitive() const
{
return false;
}
-/*!
- Sets the current path (e.g., for QDir), to \a path. Returns true if the
- new path exists; otherwise this function does nothing, and returns false.
-
- \sa currentPath()
-*/
bool QFSFileEngine::setCurrentPath(const QString &path)
{
if (!QDir(path).exists())
@@ -1153,16 +1123,6 @@ bool QFSFileEngine::setCurrentPath(const QString &path)
#endif
}
-/*!
- Returns the canonicalized form of the current path used by the file
- engine for the drive specified by \a fileName.
-
- On Windows, each drive has its own current directory, so a different
- path is returned for file names that include different drive names
- (e.g. A: or C:).
-
- \sa setCurrentPath()
-*/
QString QFSFileEngine::currentPath(const QString &fileName)
{
#if !defined(Q_OS_WINCE)
@@ -1219,11 +1179,6 @@ QString QFSFileEngine::currentPath(const QString &fileName)
#endif
}
-/*!
- Returns the home path of the current user.
-
- \sa rootPath()
-*/
QString QFSFileEngine::homePath()
{
QString ret;
@@ -1277,11 +1232,6 @@ QString QFSFileEngine::homePath()
return QDir::fromNativeSeparators(ret);
}
-/*!
- Returns the root path.
-
- \sa homePath()
-*/
QString QFSFileEngine::rootPath()
{
#if defined(Q_OS_WINCE)
@@ -1290,7 +1240,7 @@ QString QFSFileEngine::rootPath()
QString ret = QString::fromLatin1(qgetenv("SystemDrive").constData());
if(ret.isEmpty())
ret = QLatin1String("c:");
- ret += QLatin1String("/");
+ ret += QLatin1Char('/');
#elif defined(Q_OS_OS2EMX)
char dir[4];
_abspath(dir, QLatin1String("/"), _MAX_PATH);
@@ -1299,10 +1249,6 @@ QString QFSFileEngine::rootPath()
return ret;
}
-/*!
- Returns the temporary path (i.e., a path in which it is safe to store
- temporary files).
-*/
QString QFSFileEngine::tempPath()
{
QString ret;
@@ -1330,11 +1276,6 @@ QString QFSFileEngine::tempPath()
return ret;
}
-/*!
- Returns the list of drives in the file system as a list of QFileInfo
- objects. On unix, Mac OS X and Windows CE, only the root path is returned.
- On Windows, this function returns all drives (A:\, C:\, D:\, etc.).
-*/
QFileInfoList QFSFileEngine::drives()
{
QFileInfoList ret;
@@ -1347,19 +1288,17 @@ QFileInfoList QFSFileEngine::drives()
exit(1);
driveBits &= 0x3ffffff;
#endif
- char driveName[4];
-
- qstrcpy(driveName, "A:/");
+ char driveName[] = "A:/";
while(driveBits) {
if(driveBits & 1)
- ret.append(QString::fromLatin1(driveName).toUpper());
+ ret.append(QString::fromLatin1(driveName));
driveName[0]++;
driveBits = driveBits >> 1;
}
return ret;
#else
- ret.append(QString::fromLatin1("/").toUpper());
+ ret.append(QString::fromLatin1("/"));
return ret;
#endif
}
@@ -1554,9 +1493,6 @@ QString QFSFileEnginePrivate::getLink() const
return readLink(filePath);
}
-/*!
- \reimp
-*/
bool QFSFileEngine::link(const QString &newName)
{
#if !defined(Q_OS_WINCE)
@@ -1814,9 +1750,6 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(QAbstractFileEngine::Fil
return ret;
}
-/*!
- \reimp
-*/
QString QFSFileEngine::fileName(FileName file) const
{
Q_D(const QFSFileEngine);
@@ -1837,10 +1770,10 @@ QString QFSFileEngine::fileName(FileName file) const
if(slash == -1) {
if(d->filePath.length() >= 2 && d->filePath.at(1) == QLatin1Char(':'))
return d->filePath.left(2);
- return QString::fromLatin1(".");
+ return QLatin1Char('.');
} else {
if(!slash)
- return QString::fromLatin1("/");
+ return QLatin1Char('/');
if(slash == 2 && d->filePath.length() >= 2 && d->filePath.at(1) == QLatin1Char(':'))
slash++;
return d->filePath.left(slash);
@@ -1898,7 +1831,7 @@ QString QFSFileEngine::fileName(FileName file) const
if (slash == -1)
ret = QDir::currentPath();
else if (slash == 0)
- ret = QLatin1String("/");
+ ret = QLatin1Char('/');
ret = ret.left(slash);
}
return ret;
@@ -1910,9 +1843,6 @@ QString QFSFileEngine::fileName(FileName file) const
return d->filePath;
}
-/*!
- \reimp
-*/
bool QFSFileEngine::isRelativePath() const
{
Q_D(const QFSFileEngine);
@@ -1922,18 +1852,12 @@ bool QFSFileEngine::isRelativePath() const
|| (d->filePath.at(0) == QLatin1Char('/') && d->filePath.at(1) == QLatin1Char('/'))))); // drive, e.g. a:
}
-/*!
- \reimp
-*/
uint QFSFileEngine::ownerId(FileOwner /*own*/) const
{
static const uint nobodyID = (uint) -2;
return nobodyID;
}
-/*!
- \reimp
-*/
QString QFSFileEngine::owner(FileOwner own) const
{
#if !defined(QT_NO_LIBRARY)
@@ -1969,12 +1893,9 @@ QString QFSFileEngine::owner(FileOwner own) const
#else
Q_UNUSED(own);
#endif
- return QString(QLatin1String(""));
+ return QString();
}
-/*!
- \reimp
-*/
bool QFSFileEngine::setPermissions(uint perms)
{
Q_D(QFSFileEngine);
@@ -2001,9 +1922,6 @@ bool QFSFileEngine::setPermissions(uint perms)
return ret;
}
-/*!
- \reimp
-*/
bool QFSFileEngine::setSize(qint64 size)
{
Q_D(QFSFileEngine);
@@ -2073,9 +1991,6 @@ static inline QDateTime fileTimeToQDateTime(const FILETIME *time)
return ret;
}
-/*!
- \reimp
-*/
QDateTime QFSFileEngine::fileTime(FileTime time) const
{
Q_D(const QFSFileEngine);
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 2ccc6ea..8924b77 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1745,7 +1745,7 @@ QDebug operator<<(QDebug debug, QIODevice::OpenMode modes)
}
qSort(modeList);
debug << modeList.join(QLatin1String("|"));
- debug << ")";
+ debug << ')';
return debug;
}
#endif
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp
index 6233fde..f50acdb 100644
--- a/src/corelib/io/qnoncontiguousbytedevice.cpp
+++ b/src/corelib/io/qnoncontiguousbytedevice.cpp
@@ -458,7 +458,9 @@ qint64 QByteDeviceWrappingIoDevice::readData( char * data, qint64 maxSize)
qint64 QByteDeviceWrappingIoDevice::writeData( const char* data, qint64 maxSize)
{
- return -1;
+ Q_UNUSED(data);
+ Q_UNUSED(maxSize);
+ return -1;
}
/*!
diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h
index 2a7e40b..acfc6eb 100644
--- a/src/corelib/io/qnoncontiguousbytedevice_p.h
+++ b/src/corelib/io/qnoncontiguousbytedevice_p.h
@@ -77,7 +77,7 @@ protected:
virtual ~QNonContiguousByteDevice();
bool resetDisabled;
-signals:
+Q_SIGNALS:
void readyRead();
void readProgress(qint64 current, qint64 total);
};
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 30f4291..afeaad6 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1586,7 +1586,7 @@ void QProcess::start(const QString &program, const QStringList &arguments, OpenM
}
#if defined QPROCESS_DEBUG
- qDebug() << "QProcess::start(" << program << "," << arguments << "," << mode << ")";
+ qDebug() << "QProcess::start(" << program << ',' << arguments << ',' << mode << ')';
#endif
d->outputReadBuffer.clear();
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 2f05f6e..e87c314 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -140,15 +140,6 @@ static void qt_native_close(int fd)
} while (ret == -1 && errno == EINTR);
}
-static void qt_native_sigaction(int signum, const struct sigaction *act,
- struct sigaction *oldact)
-{
- int ret;
- do {
- ret = ::sigaction(signum, act, oldact);
- } while (ret == -1 && errno == EINTR);
-}
-
static void qt_native_dup2(int oldfd, int newfd)
{
int ret;
@@ -255,7 +246,7 @@ QProcessManager::QProcessManager()
memset(&action, 0, sizeof(action));
action.sa_handler = qt_sa_sigchld_handler;
action.sa_flags = SA_NOCLDSTOP;
- qt_native_sigaction(SIGCHLD, &action, &oldAction);
+ ::sigaction(SIGCHLD, &action, &oldAction);
if (oldAction.sa_handler != qt_sa_sigchld_handler)
qt_sa_old_sigchld_handler = oldAction.sa_handler;
}
@@ -282,9 +273,9 @@ QProcessManager::~QProcessManager()
memset(&action, 0, sizeof(action));
action.sa_handler = qt_sa_old_sigchld_handler;
action.sa_flags = SA_NOCLDSTOP;
- qt_native_sigaction(SIGCHLD, &action, &oldAction);
+ ::sigaction(SIGCHLD, &action, &oldAction);
if (oldAction.sa_handler != qt_sa_sigchld_handler) {
- qt_native_sigaction(SIGCHLD, &oldAction, 0);
+ ::sigaction(SIGCHLD, &oldAction, 0);
}
}
@@ -394,17 +385,10 @@ static void qt_create_pipe(int *pipe)
qt_native_close(pipe[0]);
if (pipe[1] != -1)
qt_native_close(pipe[1]);
-#ifdef Q_OS_IRIX
- if (::socketpair(AF_UNIX, SOCK_STREAM, 0, pipe) == -1) {
- qWarning("QProcessPrivate::createPipe: Cannot create pipe %p: %s",
- pipe, qPrintable(qt_error_string(errno)));
- }
-#else
if (::pipe(pipe) != 0) {
qWarning("QProcessPrivate::createPipe: Cannot create pipe %p: %s",
pipe, qPrintable(qt_error_string(errno)));
}
-#endif
::fcntl(pipe[0], F_SETFD, FD_CLOEXEC);
::fcntl(pipe[1], F_SETFD, FD_CLOEXEC);
}
@@ -596,29 +580,27 @@ void QProcessPrivate::startProcess()
processManager()->start();
// Initialize pipes
+ if (!createChannel(stdinChannel) ||
+ !createChannel(stdoutChannel) ||
+ !createChannel(stderrChannel))
+ return;
qt_create_pipe(childStartedPipe);
+ qt_create_pipe(deathPipe);
+ ::fcntl(deathPipe[0], F_SETFD, FD_CLOEXEC);
+ ::fcntl(deathPipe[1], F_SETFD, FD_CLOEXEC);
+
if (threadData->eventDispatcher) {
startupSocketNotifier = new QSocketNotifier(childStartedPipe[0],
QSocketNotifier::Read, q);
QObject::connect(startupSocketNotifier, SIGNAL(activated(int)),
q, SLOT(_q_startupNotification()));
- }
- qt_create_pipe(deathPipe);
- ::fcntl(deathPipe[0], F_SETFD, FD_CLOEXEC);
- ::fcntl(deathPipe[1], F_SETFD, FD_CLOEXEC);
- if (threadData->eventDispatcher) {
deathNotifier = new QSocketNotifier(deathPipe[0],
QSocketNotifier::Read, q);
QObject::connect(deathNotifier, SIGNAL(activated(int)),
q, SLOT(_q_processDied()));
}
- if (!createChannel(stdinChannel) ||
- !createChannel(stdoutChannel) ||
- !createChannel(stderrChannel))
- return;
-
// Start the process (platform dependent)
q->setProcessState(QProcess::Starting);
@@ -906,7 +888,7 @@ static void qt_ignore_sigpipe()
struct sigaction noaction;
memset(&noaction, 0, sizeof(noaction));
noaction.sa_handler = SIG_IGN;
- qt_native_sigaction(SIGPIPE, &noaction, 0);
+ ::sigaction(SIGPIPE, &noaction, 0);
}
}
@@ -1276,7 +1258,7 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
struct sigaction noaction;
memset(&noaction, 0, sizeof(noaction));
noaction.sa_handler = SIG_IGN;
- qt_native_sigaction(SIGPIPE, &noaction, 0);
+ ::sigaction(SIGPIPE, &noaction, 0);
::setsid();
@@ -1322,7 +1304,7 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
struct sigaction noaction;
memset(&noaction, 0, sizeof(noaction));
noaction.sa_handler = SIG_IGN;
- qt_native_sigaction(SIGPIPE, &noaction, 0);
+ ::sigaction(SIGPIPE, &noaction, 0);
// '\1' means execv failed
char c = '\1';
@@ -1333,7 +1315,7 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
struct sigaction noaction;
memset(&noaction, 0, sizeof(noaction));
noaction.sa_handler = SIG_IGN;
- qt_native_sigaction(SIGPIPE, &noaction, 0);
+ ::sigaction(SIGPIPE, &noaction, 0);
// '\2' means internal error
char c = '\2';
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 5d862e5..179c3d0 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -272,12 +272,12 @@ static QString qt_create_commandline(const QString &program, const QStringList &
QString args;
if (!program.isEmpty()) {
QString programName = program;
- if (!programName.startsWith(QLatin1Char('\"')) && !programName.endsWith(QLatin1Char('\"')) && programName.contains(QLatin1String(" ")))
- programName = QLatin1String("\"") + programName + QLatin1String("\"");
- programName.replace(QLatin1String("/"), QLatin1String("\\"));
+ if (!programName.startsWith(QLatin1Char('\"')) && !programName.endsWith(QLatin1Char('\"')) && programName.contains(QLatin1Char(' ')))
+ programName = QLatin1Char('\"') + programName + QLatin1Char('\"');
+ programName.replace(QLatin1Char('/'), QLatin1Char('\\'));
// add the prgram as the first arg ... it works better
- args = programName + QLatin1String(" ");
+ args = programName + QLatin1Char(' ');
}
for (int i=0; i<arguments.size(); ++i) {
@@ -285,16 +285,16 @@ static QString qt_create_commandline(const QString &program, const QStringList &
// in the case of \" already being in the string the \ must also be escaped
tmp.replace( QLatin1String("\\\""), QLatin1String("\\\\\"") );
// escape a single " because the arguments will be parsed
- tmp.replace( QLatin1String("\""), QLatin1String("\\\"") );
+ tmp.replace( QLatin1Char('\"'), QLatin1String("\\\"") );
if (tmp.isEmpty() || tmp.contains(QLatin1Char(' ')) || tmp.contains(QLatin1Char('\t'))) {
// The argument must not end with a \ since this would be interpreted
// as escaping the quote -- rather put the \ behind the quote: e.g.
// rather use "foo"\ than "foo\"
- QString endQuote(QLatin1String("\""));
+ QString endQuote(QLatin1Char('\"'));
int i = tmp.length();
while (i>0 && tmp.at(i-1) == QLatin1Char('\\')) {
--i;
- endQuote += QLatin1String("\\");
+ endQuote += QLatin1Char('\\');
}
args += QLatin1String(" \"") + tmp.left(i) + endQuote;
} else {
@@ -427,7 +427,7 @@ void QProcessPrivate::startProcess()
QString fullPathProgram = program;
if (!QDir::isAbsolutePath(fullPathProgram))
fullPathProgram = QFileInfo(fullPathProgram).absoluteFilePath();
- fullPathProgram.replace(QLatin1String("/"), QLatin1String("\\"));
+ fullPathProgram.replace(QLatin1Char('/'), QLatin1Char('\\'));
success = CreateProcessW((WCHAR*)fullPathProgram.utf16(),
(WCHAR*)args.utf16(),
0, 0, false, 0, 0, 0, 0, pid);
@@ -887,8 +887,8 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
#if defined(Q_OS_WINCE)
QString fullPathProgram = program;
if (!QDir::isAbsolutePath(fullPathProgram))
- fullPathProgram.prepend(QDir::currentPath().append(QLatin1String("/")));
- fullPathProgram.replace(QLatin1String("/"), QLatin1String("\\"));
+ fullPathProgram.prepend(QDir::currentPath().append(QLatin1Char('/')));
+ fullPathProgram.replace(QLatin1Char('/'), QLatin1Char('\\'));
success = CreateProcessW((WCHAR*)fullPathProgram.utf16(),
(WCHAR*)args.utf16(),
0, 0, false, CREATE_NEW_CONSOLE, 0, 0, 0, &pinfo);
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 3b704f6..94dfd4d 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -623,14 +623,14 @@ int QResourceRoot::findNode(const QString &_path, const QLocale &locale) const
QString root = mappingRoot();
if(!root.isEmpty()) {
if(root == path) {
- path = QLatin1String("/");
+ path = QLatin1Char('/');
} else {
- if(!root.endsWith(QLatin1String("/")))
- root += QLatin1String("/");
+ if(!root.endsWith(QLatin1Char('/')))
+ root += QLatin1Char('/');
if(path.size() >= root.size() && path.startsWith(root))
path = path.mid(root.length()-1);
if(path.isEmpty())
- path = QLatin1String("/");
+ path = QLatin1Char('/');
}
}
}
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 14fc2d4..6152518 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -3468,7 +3468,7 @@ void QSettings::setPath(Format format, Scope scope, const QString &path)
\typedef QSettings::SettingsMap
Typedef for QMap<QString, QVariant>.
-
+
\sa registerFormat()
*/
@@ -3479,6 +3479,11 @@ void QSettings::setPath(Format format, Scope scope, const QString &path)
\snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 27
+ \c ReadFunc is used in \c registerFormat() as a pointer to a function
+ that reads a set of key/value pairs. \c ReadFunc should read all the
+ options in one pass, and return all the settings in the \c SettingsMap
+ container, which is initially empty.
+
\sa WriteFunc, registerFormat()
*/
@@ -3489,6 +3494,10 @@ void QSettings::setPath(Format format, Scope scope, const QString &path)
\snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 28
+ \c WriteFunc is used in \c registerFormat() as a pointer to a function
+ that writes a set of key/value pairs. \c WriteFunc is only called once,
+ so you need to output the settings in one go.
+
\sa ReadFunc, registerFormat()
*/
@@ -3504,7 +3513,7 @@ void QSettings::setPath(Format format, Scope scope, const QString &path)
extension associated to the format (without the '.').
The \a readFunc and \a writeFunc parameters are pointers to
- functions that read and write a set of (key, value) pairs. The
+ functions that read and write a set of key/value pairs. The
QIODevice parameter to the read and write functions is always
opened in binary mode (i.e., without the QIODevice::Text flag).
diff --git a/src/corelib/io/qsettings_win.cpp b/src/corelib/io/qsettings_win.cpp
index a08c969..57f65d6 100644
--- a/src/corelib/io/qsettings_win.cpp
+++ b/src/corelib/io/qsettings_win.cpp
@@ -148,7 +148,7 @@ static QString errorCodeToString(DWORD errorCode)
if (data != 0)
LocalFree(data);
})
- if (result.endsWith(QLatin1String("\n")))
+ if (result.endsWith(QLatin1Char('\n')))
result.truncate(result.length() - 1);
return result;
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 6a9125c..728bf4f 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -203,7 +203,7 @@ static int _gettemp(char *path, int *doopen, int domkdir, int slen)
if (QDir::isAbsolutePath(QString::fromLatin1(path)))
targetPath = QLatin1String(path);
else
- targetPath = QDir::currentPath().append(QLatin1String("/")) + QLatin1String(path);
+ targetPath = QDir::currentPath().append(QLatin1Char('/')) + QLatin1String(path);
if ((*doopen =
QT_OPEN(targetPath.toLocal8Bit(), O_CREAT|O_EXCL|O_RDWR
@@ -291,14 +291,22 @@ class QTemporaryFileEngine : public QFSFileEngine
{
Q_DECLARE_PRIVATE(QFSFileEngine)
public:
- QTemporaryFileEngine(const QString &file) : QFSFileEngine(file) { }
+ QTemporaryFileEngine(const QString &file, bool fileIsTemplate = true)
+ : QFSFileEngine(file), filePathIsTemplate(fileIsTemplate)
+ {
+ }
+
~QTemporaryFileEngine();
+ bool isReallyOpen();
void setFileName(const QString &file);
bool open(QIODevice::OpenMode flags);
bool remove();
+ bool rename(const QString &newName);
bool close();
+
+ bool filePathIsTemplate;
};
QTemporaryFileEngine::~QTemporaryFileEngine()
@@ -306,6 +314,21 @@ QTemporaryFileEngine::~QTemporaryFileEngine()
QFSFileEngine::close();
}
+bool QTemporaryFileEngine::isReallyOpen()
+{
+ Q_D(QFSFileEngine);
+
+ if (!((0 == d->fh) && (-1 == d->fd)
+#if defined Q_OS_WIN
+ && (INVALID_HANDLE_VALUE == d->fileHandle)
+#endif
+ ))
+ return true;
+
+ return false;
+
+}
+
void QTemporaryFileEngine::setFileName(const QString &file)
{
// Really close the file, so we don't leak
@@ -316,13 +339,16 @@ void QTemporaryFileEngine::setFileName(const QString &file)
bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode)
{
Q_D(QFSFileEngine);
+ Q_ASSERT(!isReallyOpen());
+
+ if (!filePathIsTemplate)
+ return QFSFileEngine::open(openMode);
QString qfilename = d->filePath;
if(!qfilename.contains(QLatin1String("XXXXXX")))
qfilename += QLatin1String(".XXXXXX");
int suffixLength = qfilename.length() - (qfilename.lastIndexOf(QLatin1String("XXXXXX"), -1, Qt::CaseSensitive) + 6);
- d->closeFileHandle = true;
char *filename = qstrdup(qfilename.toLocal8Bit());
#ifndef Q_WS_WIN
@@ -330,16 +356,20 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode)
if (fd != -1) {
// First open the fd as an external file descriptor to
// initialize the engine properly.
- QFSFileEngine::open(openMode, fd);
+ if (QFSFileEngine::open(openMode, fd)) {
- // Allow the engine to close the handle even if it's "external".
- d->closeFileHandle = true;
+ // Allow the engine to close the handle even if it's "external".
+ d->closeFileHandle = true;
- // Restore the file names (open() resets them).
- d->filePath = QString::fromLocal8Bit(filename); //changed now!
- d->nativeInitFileName();
- delete [] filename;
- return true;
+ // Restore the file names (open() resets them).
+ d->filePath = QString::fromLocal8Bit(filename); //changed now!
+ filePathIsTemplate = false;
+ d->nativeInitFileName();
+ delete [] filename;
+ return true;
+ }
+
+ QT_CLOSE(fd);
}
delete [] filename;
setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError, qt_error_string(errno));
@@ -351,6 +381,7 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode)
}
d->filePath = QString::fromLocal8Bit(filename);
+ filePathIsTemplate = false;
d->nativeInitFileName();
d->closeFileHandle = true;
delete [] filename;
@@ -364,9 +395,17 @@ bool QTemporaryFileEngine::remove()
// Since the QTemporaryFileEngine::close() does not really close the file,
// we must explicitly call QFSFileEngine::close() before we remove it.
QFSFileEngine::close();
- bool removed = QFSFileEngine::remove();
- d->filePath.clear();
- return removed;
+ if (QFSFileEngine::remove()) {
+ d->filePath.clear();
+ return true;
+ }
+ return false;
+}
+
+bool QTemporaryFileEngine::rename(const QString &newName)
+{
+ QFSFileEngine::close();
+ return QFSFileEngine::rename(newName);
}
bool QTemporaryFileEngine::close()
@@ -388,17 +427,14 @@ protected:
bool autoRemove;
QString templateName;
- mutable QTemporaryFileEngine *fileEngine;
};
-QTemporaryFilePrivate::QTemporaryFilePrivate() : autoRemove(true), fileEngine(0)
+QTemporaryFilePrivate::QTemporaryFilePrivate() : autoRemove(true)
{
}
QTemporaryFilePrivate::~QTemporaryFilePrivate()
{
- delete fileEngine;
- fileEngine = 0;
}
//************* QTemporaryFile
@@ -430,8 +466,8 @@ QTemporaryFilePrivate::~QTemporaryFilePrivate()
file will exist and be kept open internally by QTemporaryFile.
The file name of the temporary file can be found by calling fileName().
- Note that this is only defined while the file is open; the function returns
- an empty string before the file is opened and after it is closed.
+ Note that this is only defined after the file is first opened; the function
+ returns an empty string before this.
A temporary file will have some static part of the name and some
part that is calculated to be unique. The default filename \c
@@ -601,7 +637,8 @@ void QTemporaryFile::setAutoRemove(bool b)
QString QTemporaryFile::fileName() const
{
- if(!isOpen())
+ Q_D(const QTemporaryFile);
+ if(d->fileName.isEmpty())
return QString();
return fileEngine()->fileName(QAbstractFileEngine::DefaultName);
}
@@ -695,8 +732,12 @@ QTemporaryFile *QTemporaryFile::createLocalFile(QFile &file)
QAbstractFileEngine *QTemporaryFile::fileEngine() const
{
Q_D(const QTemporaryFile);
- if(!d->fileEngine)
- d->fileEngine = new QTemporaryFileEngine(d->templateName);
+ if(!d->fileEngine) {
+ if (d->fileName.isEmpty())
+ d->fileEngine = new QTemporaryFileEngine(d->templateName);
+ else
+ d->fileEngine = new QTemporaryFileEngine(d->fileName, false);
+ }
return d->fileEngine;
}
@@ -711,10 +752,13 @@ bool QTemporaryFile::open(OpenMode flags)
{
Q_D(QTemporaryFile);
if (!d->fileName.isEmpty()) {
- setOpenMode(flags);
- return true;
+ if (static_cast<QTemporaryFileEngine*>(fileEngine())->isReallyOpen()) {
+ setOpenMode(flags);
+ return true;
+ }
}
+ flags |= QIODevice::ReadWrite;
if (QFile::open(flags)) {
d->fileName = d->fileEngine->fileName(QAbstractFileEngine::DefaultName);
return true;
@@ -722,6 +766,8 @@ bool QTemporaryFile::open(OpenMode flags)
return false;
}
+QT_END_NAMESPACE
+
#endif // QT_NO_TEMPORARYFILE
-QT_END_NAMESPACE
+
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 612d7f7..7c925f1 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -333,7 +333,7 @@ public:
this->stream = stream;
}
-public slots:
+public Q_SLOTS:
inline void flushStream() { stream->flush(); }
private:
@@ -2292,7 +2292,7 @@ bool QTextStreamPrivate::putNumber(qulonglong number, bool negative)
// ShowBase flag set zero should be written as '00'
if (number == 0 && base == 8 && numberFlags & QTextStream::ShowBase
&& result == QLatin1String("0")) {
- result.prepend(QLatin1String("0"));
+ result.prepend(QLatin1Char('0'));
}
}
return putString(result, true);
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index d1a5cdd..5846e23 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -5330,7 +5330,7 @@ QString QUrl::toString(FormattingOptions options) const
url += QLatin1Char('/');
url += ourPath;
// check if we need to remove trailing slashes
- while ((options & StripTrailingSlash) && url.right(1) == QLatin1String("/"))
+ while ((options & StripTrailingSlash) && url.endsWith(QLatin1Char('/')))
url.chop(1);
}
@@ -5698,7 +5698,7 @@ QUrl QUrl::fromLocalFile(const QString &localFile)
// magic for drives on windows
if (deslashified.length() > 1 && deslashified.at(1) == QLatin1Char(':') && deslashified.at(0) != QLatin1Char('/')) {
- url.setPath(QLatin1String("/") + deslashified);
+ url.setPath(QLatin1Char('/') + deslashified);
// magic for shared drive on windows
} else if (deslashified.startsWith(QLatin1String("//"))) {
int indexOfPath = deslashified.indexOf(QLatin1Char('/'), 2);
@@ -5728,7 +5728,7 @@ QString QUrl::toLocalFile() const
// magic for shared drive on windows
if (!d->host.isEmpty()) {
tmp = QLatin1String("//") + d->host + (ourPath.length() > 0 && ourPath.at(0) != QLatin1Char('/')
- ? QLatin1String("/") + ourPath : ourPath);
+ ? QLatin1Char('/') + ourPath : ourPath);
} else {
tmp = ourPath;
// magic for drives on windows
@@ -5976,7 +5976,7 @@ QDataStream &operator>>(QDataStream &in, QUrl &url)
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const QUrl &url)
{
- d.maybeSpace() << "QUrl(" << url.toString() << ")";
+ d.maybeSpace() << "QUrl(" << url.toString() << ')';
return d.space();
}
#endif
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index 9242092..e9c4a8d 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -223,7 +223,7 @@ public:
inline QT3_SUPPORT QString ref() const { return fragment(); }
inline QT3_SUPPORT void setRef(const QString &txt) { setFragment(txt); }
inline QT3_SUPPORT bool hasRef() const { return !fragment().isEmpty(); }
- inline QT3_SUPPORT void addPath(const QString &p) { setPath(path() + QLatin1String("/") + p); }
+ inline QT3_SUPPORT void addPath(const QString &p) { setPath(path() + QLatin1Char('/') + p); }
QT3_SUPPORT void setFileName(const QString &txt);
QT3_SUPPORT QString fileName() const;
QT3_SUPPORT QString dirPath() const;
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 93e7333..4d7d8b7 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -52,10 +52,10 @@ SOURCES += \
kernel/qtimer.cpp \
kernel/qtranslator.cpp \
kernel/qvariant.cpp \
- kernel/qcoreglobaldata.cpp \
- kernel/qsharedmemory.cpp \
- kernel/qsystemsemaphore.cpp \
- kernel/qmetaobjectbuilder.cpp \
+ kernel/qcoreglobaldata.cpp \
+ kernel/qsharedmemory.cpp \
+ kernel/qsystemsemaphore.cpp \
+ kernel/qmetaobjectbuilder.cpp \
kernel/qpointer.cpp
win32 {
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 93a0985..dd4f3f3 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -428,8 +428,8 @@ bool QPersistentModelIndex::isValid() const
QDebug operator<<(QDebug dbg, const QModelIndex &idx)
{
#ifndef Q_BROKEN_DEBUG_STREAM
- dbg.nospace() << "QModelIndex(" << idx.row() << "," << idx.column()
- << "," << idx.internalPointer() << "," << idx.model() << ")";
+ dbg.nospace() << "QModelIndex(" << idx.row() << ',' << idx.column()
+ << ',' << idx.internalPointer() << ',' << idx.model() << ')';
return dbg.space();
#else
qWarning("This compiler doesn't support streaming QModelIndex to QDebug");
@@ -540,7 +540,7 @@ void QAbstractItemModelPrivate::rowsInserted(const QModelIndex &parent,
if (data->index.isValid()) {
persistent.insertMultiAtEnd(data->index, data);
} else {
- qWarning() << "QAbstractItemModel::endInsertRows: Invalid index (" << old.row() + count << "," << old.column() << ") in model" << q_func();
+ qWarning() << "QAbstractItemModel::endInsertRows: Invalid index (" << old.row() + count << ',' << old.column() << ") in model" << q_func();
}
}
}
@@ -589,7 +589,7 @@ void QAbstractItemModelPrivate::rowsRemoved(const QModelIndex &parent,
if (data->index.isValid()) {
persistent.insertMultiAtEnd(data->index, data);
} else {
- qWarning() << "QAbstractItemModel::endRemoveRows: Invalid index (" << old.row() - count << "," << old.column() << ") in model" << q_func();
+ qWarning() << "QAbstractItemModel::endRemoveRows: Invalid index (" << old.row() - count << ',' << old.column() << ") in model" << q_func();
}
}
QVector<QPersistentModelIndexData *> persistent_invalidated = persistent.invalidated.pop();
@@ -634,7 +634,7 @@ void QAbstractItemModelPrivate::columnsInserted(const QModelIndex &parent,
if (data->index.isValid()) {
persistent.insertMultiAtEnd(data->index, data);
} else {
- qWarning() << "QAbstractItemModel::endInsertColumns: Invalid index (" << old.row() << "," << old.column() + count << ") in model" << q_func();
+ qWarning() << "QAbstractItemModel::endInsertColumns: Invalid index (" << old.row() << ',' << old.column() + count << ") in model" << q_func();
}
}
}
@@ -684,7 +684,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
if (data->index.isValid()) {
persistent.insertMultiAtEnd(data->index, data);
} else {
- qWarning() << "QAbstractItemModel::endRemoveColumns: Invalid index (" << old.row() << "," << old.column() - count << ") in model" << q_func();
+ qWarning() << "QAbstractItemModel::endRemoveColumns: Invalid index (" << old.row() << ',' << old.column() - count << ") in model" << q_func();
}
}
QVector<QPersistentModelIndexData *> persistent_invalidated = persistent.invalidated.pop();
diff --git a/src/corelib/kernel/qabstractitemmodel_p.h b/src/corelib/kernel/qabstractitemmodel_p.h
index 10d3793..fb42e77 100644
--- a/src/corelib/kernel/qabstractitemmodel_p.h
+++ b/src/corelib/kernel/qabstractitemmodel_p.h
@@ -61,7 +61,7 @@
QT_BEGIN_NAMESPACE
-class Q_CORE_EXPORT QPersistentModelIndexData
+class QPersistentModelIndexData
{
public:
QPersistentModelIndexData() : model(0) {}
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 77ef096..cb40f19 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1798,7 +1798,7 @@ QString QCoreApplication::applicationFilePath()
*/
QByteArray pEnv = qgetenv("PATH");
QDir currentDir = QDir::current();
- QStringList paths = QString::fromLocal8Bit(pEnv.constData()).split(QLatin1String(":"));
+ QStringList paths = QString::fromLocal8Bit(pEnv.constData()).split(QLatin1Char(':'));
for (QStringList::const_iterator p = paths.constBegin(); p != paths.constEnd(); ++p) {
if ((*p).isEmpty())
continue;
@@ -1908,7 +1908,7 @@ QStringList QCoreApplication::arguments()
wchar_t tempFilename[MAX_PATH+1];
if (GetModuleFileNameW(0, tempFilename, MAX_PATH)) {
tempFilename[MAX_PATH] = 0;
- cmdline.prepend(QString(QLatin1String("\"")) + QString::fromUtf16((unsigned short *)tempFilename) + QString(QLatin1String("\" ")));
+ cmdline.prepend(QLatin1Char('\"') + QString::fromUtf16((unsigned short *)tempFilename) + QLatin1String("\" "));
}
#endif // Q_OS_WINCE
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index 225821f..815a558 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -51,12 +51,11 @@
QT_BEGIN_NAMESPACE
-// ############### DON'T EXPORT HERE!!!
-Q_CORE_EXPORT char appFileName[MAX_PATH+1]; // application file name
-Q_CORE_EXPORT char theAppName[MAX_PATH+1]; // application name
-Q_CORE_EXPORT HINSTANCE appInst = 0; // handle to app instance
-Q_CORE_EXPORT HINSTANCE appPrevInst = 0; // handle to prev app instance
-Q_CORE_EXPORT int appCmdShow = 0;
+char appFileName[MAX_PATH+1]; // application file name
+char theAppName[MAX_PATH+1]; // application name
+HINSTANCE appInst = 0; // handle to app instance
+HINSTANCE appPrevInst = 0; // handle to prev app instance
+int appCmdShow = 0;
bool usingWinMain = false; // whether the qWinMain() is used or not
Q_CORE_EXPORT HINSTANCE qWinAppInst() // get Windows app handle
@@ -69,6 +68,12 @@ Q_CORE_EXPORT HINSTANCE qWinAppPrevInst() // get Windows prev app
return appPrevInst;
}
+Q_CORE_EXPORT int qWinAppCmdShow() // get main window show command
+{
+ return appCmdShow;
+}
+
+
void set_winapp_name()
{
static bool already_set = false;
@@ -89,6 +94,14 @@ void set_winapp_name()
int l = qstrlen(theAppName);
if ((l > 4) && !qstricmp(theAppName + l - 4, ".exe"))
theAppName[l-4] = '\0'; // drop .exe extension
+
+ if (appInst == 0) {
+ QT_WA({
+ appInst = GetModuleHandle(0);
+ }, {
+ appInst = GetModuleHandleA(0);
+ });
+ }
}
}
@@ -134,11 +147,11 @@ Q_CORE_EXPORT void qWinMsgHandler(QtMsgType t, const char* str)
staticCriticalSection.lock();
QT_WA({
QString s(QString::fromLocal8Bit(str));
- s += QLatin1String("\n");
+ s += QLatin1Char('\n');
OutputDebugStringW((TCHAR*)s.utf16());
}, {
QByteArray s(str);
- s += "\n";
+ s += '\n';
OutputDebugStringA(s.data());
})
staticCriticalSection.unlock();
@@ -173,14 +186,14 @@ void qWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam,
// Create command line
- set_winapp_name();
-
argv = qWinCmdLine<char>(cmdParam, int(strlen(cmdParam)), argc);
// Get Windows parameters
appInst = instance;
appPrevInst = prevInstance;
appCmdShow = cmdShow;
+
+ set_winapp_name();
}
/*!
@@ -618,7 +631,7 @@ QString valueCheck(uint actual, ...)
#ifdef Q_CC_BOR
-Q_CORE_EXPORT QString decodeMSG(const MSG& msg)
+QString decodeMSG(const MSG& msg)
{
return QString::fromLatin1("THis is not supported on Borland");
}
@@ -827,7 +840,7 @@ QString decodeMSG(const MSG& msg)
FLGSTR(ISC_SHOWUICANDIDATEWINDOW << 2),
FLGSTR(ISC_SHOWUICANDIDATEWINDOW << 3),
FLAG_STRING());
- parameters.sprintf("Input context(%s) Show flags(%s)", (fSet?"Active":"Inactive"), showFlgs.toLatin1().data());
+ parameters.sprintf("Input context(%s) Show flags(%s)", (fSet? "Active" : "Inactive"), showFlgs.toLatin1().data());
}
break;
#endif
diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h
index 41329cf..8c08bd2 100644
--- a/src/corelib/kernel/qeventdispatcher_unix_p.h
+++ b/src/corelib/kernel/qeventdispatcher_unix_p.h
@@ -153,14 +153,14 @@ public:
int activateTimers();
};
-struct Q_CORE_EXPORT QSockNot
+struct QSockNot
{
QSocketNotifier *obj;
int fd;
fd_set *queue;
};
-class Q_CORE_EXPORT QSockNotType
+class QSockNotType
{
public:
QSockNotType();
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index c4061f4..2dd5534 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -396,13 +396,6 @@ Q_CORE_EXPORT bool winPostMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
{ return PostMessageA(hWnd, msg, wParam, lParam); });
}
-Q_CORE_EXPORT bool winGetMessage(MSG* msg, HWND hWnd, UINT wMsgFilterMin,
- UINT wMsgFilterMax)
-{
- QT_WA({ return GetMessage(msg, hWnd, wMsgFilterMin, wMsgFilterMax); } ,
- { return GetMessageA(msg, hWnd, wMsgFilterMin, wMsgFilterMax); });
-}
-
// This function is called by a workerthread
void WINAPI CALLBACK qt_fast_timer_proc(uint timerId, uint /*reserved*/, DWORD_PTR user, DWORD_PTR /*reserved*/, DWORD_PTR /*reserved*/)
{
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 1bf2358..751bc44 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -92,8 +92,8 @@ static int *queuedConnectionTypes(const QList<QByteArray> &typeNames)
return types;
}
-QBasicAtomicPointer<QMutexPool> signalSlotMutexes = Q_BASIC_ATOMIC_INITIALIZER(0);
-QBasicAtomicInt objectCount = Q_BASIC_ATOMIC_INITIALIZER(0);
+static QBasicAtomicPointer<QMutexPool> signalSlotMutexes = Q_BASIC_ATOMIC_INITIALIZER(0);
+static QBasicAtomicInt objectCount = Q_BASIC_ATOMIC_INITIALIZER(0);
/** \internal
* mutex to be locked when accessing the connectionlists or the senders list
@@ -117,8 +117,7 @@ extern "C" Q_CORE_EXPORT void qt_addObject(QObject *)
extern "C" Q_CORE_EXPORT void qt_removeObject(QObject *)
{
if(!objectCount.deref()) {
- QMutexPool *old = signalSlotMutexes;
- signalSlotMutexes.testAndSetAcquire(old, 0);
+ QMutexPool *old = signalSlotMutexes.fetchAndStoreAcquire(0);
delete old;
}
}
@@ -304,7 +303,6 @@ void QObjectPrivate::addConnection(int signal, Connection *c)
ConnectionList &connectionList = (*connectionLists)[signal];
connectionList.append(c);
-
cleanConnectionLists();
}
@@ -2388,7 +2386,8 @@ int QObject::receivers(const char *signal) const
can be connected to one slot.
If a signal is connected to several slots, the slots are activated
- in an arbitrary order when the signal is emitted.
+ in the same order as the order the connection was made, when the
+ signal is emitted.
The function returns true if it successfully connects the signal
to the slot. It will return false if it cannot create the
@@ -2396,9 +2395,13 @@ int QObject::receivers(const char *signal) const
existence of either \a signal or \a method, or if their signatures
aren't compatible.
- For every connection you make, a signal is emitted; two signals are emitted
- for duplicate connections. You can break all of these connections with a
- single disconnect() call.
+ By default, a signal is emitted for every connection you make;
+ two signals are emitted for duplicate connections. You can break
+ all of these connections with a single disconnect() call.
+ If you pass the Qt::UniqueConnection \a type, the connection will only
+ be made if it is not a duplicate. If there is already a duplicate
+ (exact same signal to the exact same slot on the same objects),
+ the connection will fail and connect will return false
The optional \a type parameter describes the type of connection
to establish. In particular, it determines whether a particular
@@ -2531,7 +2534,8 @@ bool QObject::connect(const QObject *sender, const char *signal,
}
}
#endif
- QMetaObject::connect(sender, signal_index, receiver, method_index, type, types);
+ if (!QMetaObject::connect(sender, signal_index, receiver, method_index, type, types))
+ return false;
const_cast<QObject*>(sender)->connectNotify(signal - 1);
return true;
}
@@ -2782,6 +2786,22 @@ bool QMetaObject::connect(const QObject *sender, int signal_index,
QObject *s = const_cast<QObject *>(sender);
QObject *r = const_cast<QObject *>(receiver);
+ QOrderedMutexLocker locker(signalSlotLock(sender),
+ signalSlotLock(receiver));
+
+ if (type & Qt::UniqueConnection) {
+ QObjectConnectionListVector *connectionLists = s->d_func()->connectionLists;
+ if (connectionLists && connectionLists->count() > signal_index) {
+ QObjectPrivate::ConnectionList &connectionList = (*connectionLists)[signal_index];
+ for (int i = 0; i < connectionList.count(); ++i) {
+ QObjectPrivate::Connection *c2 = connectionList.at(i);
+ if (c2->receiver == receiver && c2->method == method_index)
+ return false;
+ }
+ }
+ type &= Qt::UniqueConnection - 1;
+ }
+
QObjectPrivate::Connection *c = new QObjectPrivate::Connection;
c->sender = s;
c->receiver = r;
@@ -2789,9 +2809,6 @@ bool QMetaObject::connect(const QObject *sender, int signal_index,
c->connectionType = type;
c->argumentTypes = types;
- QOrderedMutexLocker locker(signalSlotLock(sender),
- signalSlotLock(receiver));
-
s->d_func()->addConnection(signal_index, c);
r->d_func()->senders.append(c);
@@ -3472,7 +3489,7 @@ QDebug operator<<(QDebug dbg, const QObject *o) {
#ifndef Q_BROKEN_DEBUG_STREAM
if (!o)
return dbg << "QObject(0x0) ";
- dbg.nospace() << o->metaObject()->className() << "(" << (void *)o;
+ dbg.nospace() << o->metaObject()->className() << '(' << (void *)o;
if (!o->objectName().isEmpty())
dbg << ", name = " << o->objectName();
dbg << ')';
diff --git a/src/corelib/kernel/qsharedmemory_unix.cpp b/src/corelib/kernel/qsharedmemory_unix.cpp
index cd248dc..9187ad3 100644
--- a/src/corelib/kernel/qsharedmemory_unix.cpp
+++ b/src/corelib/kernel/qsharedmemory_unix.cpp
@@ -47,9 +47,10 @@
#include <qdir.h>
#include <qdebug.h>
+#include <errno.h>
+
#ifndef QT_NO_SHAREDMEMORY
-#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
diff --git a/src/corelib/kernel/qsystemsemaphore_p.h b/src/corelib/kernel/qsystemsemaphore_p.h
index 81d4f10..a4a7389 100644
--- a/src/corelib/kernel/qsystemsemaphore_p.h
+++ b/src/corelib/kernel/qsystemsemaphore_p.h
@@ -101,9 +101,9 @@ public:
QSystemSemaphore::SystemSemaphoreError error;
};
-#endif // QT_NO_SYSTEMSEMAPHORE
+QT_END_NAMESPACE
+#endif // QT_NO_SYSTEMSEMAPHORE
-QT_END_NAMESPACE
#endif // QSYSTEMSEMAPHORE_P_H
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 4b3feb0..08821d4 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -269,7 +269,7 @@ class QSingleShotTimer : public QObject
public:
~QSingleShotTimer();
QSingleShotTimer(int msec, QObject *r, const char * m);
-signals:
+Q_SIGNALS:
void timeout();
protected:
void timerEvent(QTimerEvent *);
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index 77d6599..3e4b467 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -819,6 +819,6 @@ bool QTranslator::isEmpty() const
Use translate(\a context, \a sourceText, \a comment) instead.
*/
-#endif // QT_NO_TRANSLATION
-
QT_END_NAMESPACE
+
+#endif // QT_NO_TRANSLATION
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 08bd2d0..de1baac 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -71,7 +71,7 @@ static QString qdlerror()
#else
const char *err = strerror(errno);
#endif
- return err ? QLatin1String("(")+QString::fromLocal8Bit(err) + QLatin1String(")"): QString();
+ return err ? QLatin1Char('(') + QString::fromLocal8Bit(err) + QLatin1Char(')'): QString();
}
bool QLibraryPrivate::load_sys()
diff --git a/src/corelib/statemachine/qabstractstate.cpp b/src/corelib/statemachine/qabstractstate.cpp
index 7e59a7d..942722f 100644
--- a/src/corelib/statemachine/qabstractstate.cpp
+++ b/src/corelib/statemachine/qabstractstate.cpp
@@ -84,11 +84,6 @@ QAbstractStatePrivate *QAbstractStatePrivate::get(QAbstractState *q)
return q->d_func();
}
-const QAbstractStatePrivate *QAbstractStatePrivate::get(const QAbstractState *q)
-{
- return q->d_func();
-}
-
QStateMachine *QAbstractStatePrivate::machine() const
{
Q_Q(const QAbstractState);
diff --git a/src/corelib/statemachine/qabstractstate_p.h b/src/corelib/statemachine/qabstractstate_p.h
index 1a99d6c..b4f3108 100644
--- a/src/corelib/statemachine/qabstractstate_p.h
+++ b/src/corelib/statemachine/qabstractstate_p.h
@@ -60,8 +60,7 @@ QT_BEGIN_NAMESPACE
class QStateMachine;
class QAbstractState;
-class Q_CORE_EXPORT QAbstractStatePrivate
- : public QObjectPrivate
+class QAbstractStatePrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QAbstractState)
@@ -69,7 +68,6 @@ public:
QAbstractStatePrivate();
static QAbstractStatePrivate *get(QAbstractState *q);
- static const QAbstractStatePrivate *get(const QAbstractState *q);
QStateMachine *machine() const;
diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp
index a930581..dfcafeb 100644
--- a/src/corelib/statemachine/qabstracttransition.cpp
+++ b/src/corelib/statemachine/qabstracttransition.cpp
@@ -108,11 +108,6 @@ QAbstractTransitionPrivate *QAbstractTransitionPrivate::get(QAbstractTransition
return q->d_func();
}
-const QAbstractTransitionPrivate *QAbstractTransitionPrivate::get(const QAbstractTransition *q)
-{
- return q->d_func();
-}
-
QStateMachine *QAbstractTransitionPrivate::machine() const
{
Q_Q(const QAbstractTransition);
@@ -321,7 +316,7 @@ QList<QAbstractAnimation*> QAbstractTransition::animations() const
#endif
/*!
- \fn QAbstractTransition::eventTest(QEvent *event) const
+ \fn QAbstractTransition::eventTest(QEvent *event)
This function is called to determine whether the given \a event should cause
this transition to trigger. Reimplement this function and return true if the
diff --git a/src/corelib/statemachine/qabstracttransition_p.h b/src/corelib/statemachine/qabstracttransition_p.h
index a6db220..f067984 100644
--- a/src/corelib/statemachine/qabstracttransition_p.h
+++ b/src/corelib/statemachine/qabstracttransition_p.h
@@ -73,7 +73,6 @@ public:
QAbstractTransitionPrivate();
static QAbstractTransitionPrivate *get(QAbstractTransition *q);
- static const QAbstractTransitionPrivate *get(const QAbstractTransition *q);
bool callEventTest(QEvent *e);
void callOnTransition(QEvent *e);
diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp
index 74eb577..f25d821 100644
--- a/src/corelib/statemachine/qeventtransition.cpp
+++ b/src/corelib/statemachine/qeventtransition.cpp
@@ -111,19 +111,20 @@ QEventTransitionPrivate *QEventTransitionPrivate::get(QEventTransition *q)
return q->d_func();
}
-void QEventTransitionPrivate::invalidate()
+void QEventTransitionPrivate::unregister()
{
Q_Q(QEventTransition);
- if (registered) {
- QState *source = sourceState();
- QStatePrivate *source_d = QStatePrivate::get(source);
- QStateMachinePrivate *mach = QStateMachinePrivate::get(source_d->machine());
- if (mach) {
- mach->unregisterEventTransition(q);
- if (mach->configuration.contains(source))
- mach->registerEventTransition(q);
- }
- }
+ if (!registered || !machine())
+ return;
+ QStateMachinePrivate::get(machine())->unregisterEventTransition(q);
+}
+
+void QEventTransitionPrivate::maybeRegister()
+{
+ Q_Q(QEventTransition);
+ if (!machine() || !machine()->configuration().contains(sourceState()))
+ return;
+ QStateMachinePrivate::get(machine())->registerEventTransition(q);
}
/*!
@@ -223,8 +224,9 @@ void QEventTransition::setEventType(QEvent::Type type)
Q_D(QEventTransition);
if (d->eventType == type)
return;
+ d->unregister();
d->eventType = type;
- d->invalidate();
+ d->maybeRegister();
}
/*!
@@ -245,8 +247,9 @@ void QEventTransition::setEventObject(QObject *object)
Q_D(QEventTransition);
if (d->object == object)
return;
+ d->unregister();
d->object = object;
- d->invalidate();
+ d->maybeRegister();
}
/*!
diff --git a/src/corelib/statemachine/qeventtransition_p.h b/src/corelib/statemachine/qeventtransition_p.h
index fca8c0d..600cec0 100644
--- a/src/corelib/statemachine/qeventtransition_p.h
+++ b/src/corelib/statemachine/qeventtransition_p.h
@@ -66,7 +66,8 @@ public:
static QEventTransitionPrivate *get(QEventTransition *q);
- void invalidate();
+ void unregister();
+ void maybeRegister();
bool registered;
QObject *object;
diff --git a/src/corelib/statemachine/qhistorystate.cpp b/src/corelib/statemachine/qhistorystate.cpp
index d1b2391..517faa8 100644
--- a/src/corelib/statemachine/qhistorystate.cpp
+++ b/src/corelib/statemachine/qhistorystate.cpp
@@ -126,11 +126,6 @@ QHistoryStatePrivate *QHistoryStatePrivate::get(QHistoryState *q)
return q->d_func();
}
-const QHistoryStatePrivate *QHistoryStatePrivate::get(const QHistoryState *q)
-{
- return q->d_func();
-}
-
/*!
Constructs a new shallow history state with the given \a parent state.
*/
diff --git a/src/corelib/statemachine/qhistorystate_p.h b/src/corelib/statemachine/qhistorystate_p.h
index 2f17496..5aaa64c 100644
--- a/src/corelib/statemachine/qhistorystate_p.h
+++ b/src/corelib/statemachine/qhistorystate_p.h
@@ -68,7 +68,6 @@ public:
QHistoryStatePrivate();
static QHistoryStatePrivate *get(QHistoryState *q);
- static const QHistoryStatePrivate *get(const QHistoryState *q);
QAbstractState *defaultState;
QHistoryState::HistoryType historyType;
diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp
index 4caa917..9ffcb9c 100644
--- a/src/corelib/statemachine/qsignaltransition.cpp
+++ b/src/corelib/statemachine/qsignaltransition.cpp
@@ -118,19 +118,20 @@ QSignalTransitionPrivate *QSignalTransitionPrivate::get(QSignalTransition *q)
return q->d_func();
}
-void QSignalTransitionPrivate::invalidate()
+void QSignalTransitionPrivate::unregister()
{
Q_Q(QSignalTransition);
- if (signalIndex != -1) {
- QState *source = sourceState();
- QStatePrivate *source_d = QStatePrivate::get(source);
- QStateMachinePrivate *mach = QStateMachinePrivate::get(source_d->machine());
- if (mach) {
- mach->unregisterSignalTransition(q);
- if (mach->configuration.contains(source))
- mach->registerSignalTransition(q);
- }
- }
+ if ((signalIndex == -1) || !machine())
+ return;
+ QStateMachinePrivate::get(machine())->unregisterSignalTransition(q);
+}
+
+void QSignalTransitionPrivate::maybeRegister()
+{
+ Q_Q(QSignalTransition);
+ if (!machine() || !machine()->configuration().contains(sourceState()))
+ return;
+ QStateMachinePrivate::get(machine())->registerSignalTransition(q);
}
/*!
@@ -193,8 +194,9 @@ void QSignalTransition::setSenderObject(QObject *sender)
Q_D(QSignalTransition);
if (sender == d->sender)
return;
+ d->unregister();
d->sender = sender;
- d->invalidate();
+ d->maybeRegister();
}
/*!
@@ -214,8 +216,9 @@ void QSignalTransition::setSignal(const QByteArray &signal)
Q_D(QSignalTransition);
if (signal == d->signal)
return;
+ d->unregister();
d->signal = signal;
- d->invalidate();
+ d->maybeRegister();
}
/*!
diff --git a/src/corelib/statemachine/qsignaltransition_p.h b/src/corelib/statemachine/qsignaltransition_p.h
index a23e58c..339de63 100644
--- a/src/corelib/statemachine/qsignaltransition_p.h
+++ b/src/corelib/statemachine/qsignaltransition_p.h
@@ -66,7 +66,8 @@ public:
static QSignalTransitionPrivate *get(QSignalTransition *q);
- void invalidate();
+ void unregister();
+ void maybeRegister();
QObject *sender;
QByteArray signal;
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index e42e463..5463059 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -129,20 +129,6 @@ QStatePrivate::~QStatePrivate()
{
}
-QStatePrivate *QStatePrivate::get(QState *q)
-{
- if (!q)
- return 0;
- return q->d_func();
-}
-
-const QStatePrivate *QStatePrivate::get(const QState *q)
-{
- if (!q)
- return 0;
- return q->d_func();
-}
-
void QStatePrivate::emitFinished()
{
Q_Q(QState);
diff --git a/src/corelib/statemachine/qstate_p.h b/src/corelib/statemachine/qstate_p.h
index 1f913b4..93744b9 100644
--- a/src/corelib/statemachine/qstate_p.h
+++ b/src/corelib/statemachine/qstate_p.h
@@ -79,15 +79,15 @@ class QAbstractTransition;
class QHistoryState;
class QState;
-class Q_CORE_EXPORT QStatePrivate : public QAbstractStatePrivate
+class Q_AUTOTEST_EXPORT QStatePrivate : public QAbstractStatePrivate
{
Q_DECLARE_PUBLIC(QState)
public:
QStatePrivate();
~QStatePrivate();
- static QStatePrivate *get(QState *q);
- static const QStatePrivate *get(const QState *q);
+ static QStatePrivate *get(QState *q) { return q ? q->d_func() : 0; }
+ static const QStatePrivate *get(const QState *q) { return q? q->d_func() : 0; }
QList<QAbstractState*> childStates() const;
QList<QHistoryState*> historyStates() const;
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 744515b..84619d7 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -354,7 +354,7 @@ bool QStateMachinePrivate::isPreempted(const QAbstractState *s, const QSet<QAbst
QAbstractState *lca = findLCA(lst);
if (isDescendantOf(s, lca)) {
#ifdef QSTATEMACHINE_DEBUG
- qDebug() << q_func() << ":" << transitions << "preempts selection of a transition from"
+ qDebug() << q_func() << ':' << transitions << "preempts selection of a transition from"
<< s << "because" << s << "is a descendant of" << lca;
#endif
return true;
@@ -403,7 +403,7 @@ QSet<QAbstractTransition*> QStateMachinePrivate::selectTransitions(QEvent *event
void QStateMachinePrivate::microstep(QEvent *event, const QList<QAbstractTransition*> &enabledTransitions)
{
#ifdef QSTATEMACHINE_DEBUG
- qDebug() << q_func() << ": begin microstep( enabledTransitions:" << enabledTransitions << ")";
+ qDebug() << q_func() << ": begin microstep( enabledTransitions:" << enabledTransitions << ')';
qDebug() << q_func() << ": configuration before exiting states:" << configuration;
#endif
QList<QAbstractState*> exitedStates = exitStates(event, enabledTransitions);
@@ -421,7 +421,7 @@ void QStateMachinePrivate::microstep(QEvent *event, const QList<QAbstractTransit
QList<QAbstractState*> QStateMachinePrivate::exitStates(QEvent *event, const QList<QAbstractTransition*> &enabledTransitions)
{
-// qDebug() << "exitStates(" << enabledTransitions << ")";
+// qDebug() << "exitStates(" << enabledTransitions << ')';
QSet<QAbstractState*> statesToExit;
// QSet<QAbstractState*> statesToSnapshot;
for (int i = 0; i < enabledTransitions.size(); ++i) {
@@ -470,7 +470,7 @@ QList<QAbstractState*> QStateMachinePrivate::exitStates(QEvent *event, const QLi
}
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q_func() << ": recorded" << ((QHistoryStatePrivate::get(h)->historyType == QHistoryState::DeepHistory) ? "deep" : "shallow")
- << "history for" << s << "in" << h << ":" << QHistoryStatePrivate::get(h)->configuration;
+ << "history for" << s << "in" << h << ':' << QHistoryStatePrivate::get(h)->configuration;
#endif
}
}
@@ -503,7 +503,7 @@ QList<QAbstractState*> QStateMachinePrivate::enterStates(QEvent *event, const QL
#ifdef QSTATEMACHINE_DEBUG
Q_Q(QStateMachine);
#endif
-// qDebug() << "enterStates(" << enabledTransitions << ")";
+// qDebug() << "enterStates(" << enabledTransitions << ')';
QSet<QAbstractState*> statesToEnter;
QSet<QAbstractState*> statesForDefaultEntry;
@@ -609,7 +609,7 @@ void QStateMachinePrivate::addStatesToEnter(QAbstractState *s, QState *root,
#ifdef QSTATEMACHINE_DEBUG
qDebug() <<q_func() << ": restoring"
<< ((QHistoryStatePrivate::get(h)->historyType == QHistoryState::DeepHistory) ? "deep" : "shallow")
- << "history from" << s << ":" << hconf;
+ << "history from" << s << ':' << hconf;
#endif
} else {
QList<QAbstractState*> hlst;
@@ -624,7 +624,7 @@ void QStateMachinePrivate::addStatesToEnter(QAbstractState *s, QState *root,
addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry);
}
#ifdef QSTATEMACHINE_DEBUG
- qDebug() << q_func() << ": initial history targets for" << s << ":" << hlst;
+ qDebug() << q_func() << ": initial history targets for" << s << ':' << hlst;
#endif
}
}
@@ -678,9 +678,11 @@ void QStateMachinePrivate::applyProperties(const QList<QAbstractTransition*> &tr
const QList<QAbstractState*> &exitedStates,
const QList<QAbstractState*> &enteredStates)
{
- Q_Q(QStateMachine);
#ifdef QT_NO_ANIMATION
Q_UNUSED(transitionList);
+ Q_UNUSED(exitedStates);
+#else
+ Q_Q(QStateMachine);
#endif
// Process the property assignments of the entered states.
QHash<QAbstractState*, QList<QPropertyAssignment> > propertyAssignmentsForState;
@@ -801,8 +803,7 @@ void QStateMachinePrivate::applyProperties(const QList<QAbstractTransition*> &tr
stateForAnimation.insert(a, s);
animationsForState[s].append(a);
// ### connect to just the top-level animation?
- QObject::disconnect(a, SIGNAL(finished()), q, SLOT(_q_animationFinished()));
- QObject::connect(a, SIGNAL(finished()), q, SLOT(_q_animationFinished()));
+ QObject::connect(a, SIGNAL(finished()), q, SLOT(_q_animationFinished()), Qt::UniqueConnection);
}
it2 = assignments.erase(it2);
} else {
@@ -851,7 +852,11 @@ void QStateMachinePrivate::applyProperties(const QList<QAbstractTransition*> &tr
// Emit polished signal for entered states that have no animated properties.
for (int i = 0; i < enteredStates.size(); ++i) {
QState *s = qobject_cast<QState*>(enteredStates.at(i));
- if (s && !animationsForState.contains(s))
+ if (s
+#ifndef QT_NO_ANIMATION
+ && !animationsForState.contains(s)
+#endif
+ )
QStatePrivate::get(s)->emitPolished();
}
}
@@ -968,7 +973,7 @@ QVariant QStateMachinePrivate::restorableValue(QObject *object, const QByteArray
*/
void QStateMachinePrivate::unregisterRestorable(QObject *object, const QByteArray &propertyName)
{
-// qDebug() << "unregisterRestorable(" << object << propertyName << ")";
+// qDebug() << "unregisterRestorable(" << object << propertyName << ')';
RestorableId id(object, propertyName);
registeredRestorables.remove(id);
}
@@ -1296,22 +1301,6 @@ void QStateMachinePrivate::unregisterTransition(QAbstractTransition *transition)
#endif
}
-static int senderSignalIndex(const QObject *sender)
-{
- QObjectPrivate *d = QObjectPrivate::get(const_cast<QObject*>(sender));
- QMutexLocker(&d->threadData->mutex);
- if (!d->currentSender)
- return -1;
-
- // Return -1 if d->currentSender isn't in d->senders
- bool found = false;
- for (int i = 0; !found && i < d->senders.count(); ++i)
- found = (d->senders.at(i)->sender == d->currentSender->sender);
- if (!found)
- return -1;
- return d->currentSender->signal;
-}
-
void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transition)
{
Q_Q(QStateMachine);
@@ -1341,7 +1330,7 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": FAILED to add signal transition from" << transition->sourceState()
<< ": ( sender =" << sender << ", signal =" << (signal.mid(1))
- << ", targets =" << transition->targetStates() << ")";
+ << ", targets =" << transition->targetStates() << ')';
#endif
return;
}
@@ -1351,7 +1340,7 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": added signal transition from" << transition->sourceState()
<< ": ( sender =" << sender << ", signal =" << (signal.mid(1))
- << ", targets =" << transition->targetStates() << ")";
+ << ", targets =" << transition->targetStates() << ')';
#endif
}
@@ -1412,7 +1401,7 @@ void QStateMachinePrivate::registerEventTransition(QEventTransition *transition)
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": added event transition from" << transition->sourceState()
<< ": ( object =" << object << ", event =" << transition->eventType()
- << ", targets =" << transition->targetStates() << ")";
+ << ", targets =" << transition->targetStates() << ')';
#endif
}
@@ -1442,8 +1431,7 @@ void QStateMachinePrivate::unregisterEventTransition(QEventTransition *transitio
void QStateMachinePrivate::handleTransitionSignal(const QObject *sender, int signalIndex,
void **argv)
{
- const QVector<int> &connectedSignalIndexes = connections[sender];
- Q_ASSERT(connectedSignalIndexes.at(signalIndex) != 0);
+ Q_ASSERT(connections[sender].at(signalIndex) != 0);
const QMetaObject *meta = sender->metaObject();
QMetaMethod method = meta->method(signalIndex);
QList<QByteArray> parameterTypes = method.parameterTypes();
@@ -1456,7 +1444,7 @@ void QStateMachinePrivate::handleTransitionSignal(const QObject *sender, int sig
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q_func() << ": sending signal event ( sender =" << sender
- << ", signal =" << sender->metaObject()->method(signalIndex).signature() << ")";
+ << ", signal =" << sender->metaObject()->method(signalIndex).signature() << ')';
#endif
internalEventQueue.append(new QSignalEvent(sender, signalIndex, vargs));
scheduleProcess();
@@ -2083,10 +2071,15 @@ int QSignalEventGenerator::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
switch (_id) {
case 0: {
// ### in Qt 4.6 we can use QObject::senderSignalIndex()
- int signalIndex = senderSignalIndex(this);
+ QObjectPrivate *d = static_cast<QObjectPrivate *>(d_ptr);
+ int signalIndex = -1;
+ QObject *sender = this->sender();
+ if (sender && d->currentSender)
+ signalIndex = d->currentSender->signal;
+
Q_ASSERT(signalIndex != -1);
QStateMachine *machine = qobject_cast<QStateMachine*>(parent());
- QStateMachinePrivate::get(machine)->handleTransitionSignal(sender(), signalIndex, _a);
+ QStateMachinePrivate::get(machine)->handleTransitionSignal(sender, signalIndex, _a);
break;
}
default: ;
diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h
index dfa5575..54953b4 100644
--- a/src/corelib/statemachine/qstatemachine_p.h
+++ b/src/corelib/statemachine/qstatemachine_p.h
@@ -81,8 +81,7 @@ class QAbstractAnimation;
#endif
class QStateMachine;
-class Q_CORE_EXPORT QStateMachinePrivate
- : public QObjectPrivate
+class QStateMachinePrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QStateMachine)
public:
@@ -209,7 +208,7 @@ public:
f_cloneEvent cloneEvent;
};
- static const Handler *handler;
+ static Q_CORE_EXPORT const Handler *handler;
};
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qmutexpool.cpp b/src/corelib/thread/qmutexpool.cpp
index 96a9940..0d7c890 100644
--- a/src/corelib/thread/qmutexpool.cpp
+++ b/src/corelib/thread/qmutexpool.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
// qt_global_mutexpool is here for backwards compatability only,
// use QMutexpool::instance() in new clode.
Q_CORE_EXPORT QMutexPool *qt_global_mutexpool = 0;
-Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (true))
+Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (QMutex::Recursive))
/*!
\class QMutexPool
@@ -88,17 +88,17 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (true))
*/
/*!
- Constructs a QMutexPool, reserving space for \a size QMutexes. If
- \a recursive is true, all QMutexes in the pool will be recursive
- mutexes; otherwise they will all be non-recursive (the default).
+ Constructs a QMutexPool, reserving space for \a size QMutexes. All
+ mutexes in the pool are created with \a recursionMode. By default,
+ all mutexes are non-recursive.
The QMutexes are created when needed, and deleted when the
QMutexPool is destructed.
*/
-QMutexPool::QMutexPool(bool recursive, int size)
- : mutexes(size), count(size), recurs(recursive)
+QMutexPool::QMutexPool(QMutex::RecursionMode recursionMode, int size)
+ : mutexes(size), recursionMode(recursionMode)
{
- for (int index = 0; index < count; ++index) {
+ for (int index = 0; index < mutexes.count(); ++index) {
mutexes[index] = 0;
}
}
@@ -109,7 +109,7 @@ QMutexPool::QMutexPool(bool recursive, int size)
*/
QMutexPool::~QMutexPool()
{
- for (int index = 0; index < count; ++index) {
+ for (int index = 0; index < mutexes.count(); ++index) {
delete mutexes[index];
mutexes[index] = 0;
}
@@ -130,11 +130,11 @@ QMutexPool *QMutexPool::instance()
QMutex *QMutexPool::get(const void *address)
{
Q_ASSERT_X(address != 0, "QMutexPool::get()", "'address' argument cannot be zero");
- int index = int((quintptr(address) >> (sizeof(address) >> 1)) % count);
+ int index = int((quintptr(address) >> (sizeof(address) >> 1)) % mutexes.count());
if (!mutexes[index]) {
// mutex not created, create one
- QMutex *newMutex = new QMutex(recurs ? QMutex::Recursive : QMutex::NonRecursive);
+ QMutex *newMutex = new QMutex(recursionMode);
if (!mutexes[index].testAndSetOrdered(0, newMutex))
delete newMutex;
}
diff --git a/src/corelib/thread/qmutexpool_p.h b/src/corelib/thread/qmutexpool_p.h
index 1009ebb..30a16d4 100644
--- a/src/corelib/thread/qmutexpool_p.h
+++ b/src/corelib/thread/qmutexpool_p.h
@@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QMutexPool
{
public:
- explicit QMutexPool(bool recursive = false, int size = 128);
+ explicit QMutexPool(QMutex::RecursionMode recursionMode = QMutex::NonRecursive, int size = 131);
~QMutexPool();
QMutex *get(const void *address);
@@ -72,9 +72,8 @@ public:
static QMutex *globalInstanceGet(const void *address);
private:
- QVarLengthArray<QAtomicPointer<QMutex>, 128> mutexes;
- int count;
- bool recurs;
+ QVarLengthArray<QAtomicPointer<QMutex>, 131> mutexes;
+ QMutex::RecursionMode recursionMode;
};
extern Q_CORE_EXPORT QMutexPool *qt_global_mutexpool;
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 6aa35f3..49dd52d 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -579,7 +579,7 @@ static inline char qToLower(char c)
return c;
}
-Q_CORE_EXPORT QByteArray::Data QByteArray::shared_null = {Q_BASIC_ATOMIC_INITIALIZER(1),
+QByteArray::Data QByteArray::shared_null = {Q_BASIC_ATOMIC_INITIALIZER(1),
0, 0, shared_null.array, {0} };
QByteArray::Data QByteArray::shared_empty = { Q_BASIC_ATOMIC_INITIALIZER(1),
0, 0, shared_empty.array, {0} };
diff --git a/src/corelib/tools/qcontiguouscache.cpp b/src/corelib/tools/qcontiguouscache.cpp
index 7db3a5a..996ac18 100644
--- a/src/corelib/tools/qcontiguouscache.cpp
+++ b/src/corelib/tools/qcontiguouscache.cpp
@@ -40,10 +40,13 @@
****************************************************************************/
#include "qcontiguouscache.h"
+#ifdef QT_QCONTIGUOUSCACHE_DEBUG
#include <QDebug>
+#endif
QT_BEGIN_NAMESPACE
+#ifdef QT_QCONTIGUOUSCACHE_DEBUG
void QContiguousCacheData::dump() const
{
qDebug() << "capacity:" << alloc;
@@ -51,6 +54,7 @@ void QContiguousCacheData::dump() const
qDebug() << "start:" << start;
qDebug() << "offset:" << offset;
}
+#endif
/*! \class QContiguousCache
\brief The QContiguousCache class is a template class that provides a contiguous cache.
diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h
index 5cd1582..2437f63 100644
--- a/src/corelib/tools/qcontiguouscache.h
+++ b/src/corelib/tools/qcontiguouscache.h
@@ -49,8 +49,10 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+#undef QT_QCONTIGUOUSCACHE_DEBUG
QT_MODULE(Core)
+
struct Q_CORE_EXPORT QContiguousCacheData
{
QBasicAtomicInt ref;
@@ -60,7 +62,9 @@ struct Q_CORE_EXPORT QContiguousCacheData
int offset;
uint sharable : 1;
+#ifdef QT_QCONTIGUOUSCACHE_DEBUG
void dump() const;
+#endif
};
template <typename T>
@@ -131,8 +135,10 @@ public:
{ return d->offset >= 0 && d->offset < INT_MAX - d->count && (d->offset % d->alloc) == d->start; }
inline void normalizeIndexes() { d->offset = d->start; }
- // debug
+
+#ifdef QT_QCONTIGUOUSCACHE_DEBUG
void dump() const { p->dump(); }
+#endif
private:
void detach_helper();
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 7232626..e438179 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -74,7 +74,7 @@ public:
QCryptographicHash can be used to generate cryptographic hashes of binary or text data.
- Currently MD4, MD5, and SHA1 are supported.
+ Currently MD4, MD5, and SHA-1 are supported.
*/
/*!
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 781514c..de41360 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -3833,19 +3833,19 @@ void QDateTimePrivate::getUTC(QDate &outDate, QTime &outTime) const
#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DATESTRING)
QDebug operator<<(QDebug dbg, const QDate &date)
{
- dbg.nospace() << "QDate(" << date.toString() << ")";
+ dbg.nospace() << "QDate(" << date.toString() << ')';
return dbg.space();
}
QDebug operator<<(QDebug dbg, const QTime &time)
{
- dbg.nospace() << "QTime(" << time.toString() << ")";
+ dbg.nospace() << "QTime(" << time.toString() << ')';
return dbg.space();
}
QDebug operator<<(QDebug dbg, const QDateTime &date)
{
- dbg.nospace() << "QDateTime(" << date.toString() << ")";
+ dbg.nospace() << "QDateTime(" << date.toString() << ')';
return dbg.space();
}
#endif
@@ -4688,7 +4688,7 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos
if (fixup && tmpstate == Intermediate && used < sn.count) {
const FieldInfo fi = fieldInfo(index);
if ((fi & (Numeric|FixedWidth)) == (Numeric|FixedWidth)) {
- const QString newText = QString(QLatin1String("%1")).arg(num, sn.count, 10, QLatin1Char('0'));
+ const QString newText = QString::fromLatin1("%1").arg(num, sn.count, 10, QLatin1Char('0'));
input.replace(pos, used, newText);
used = sn.count;
}
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index da86442..2b027fc 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -53,7 +53,8 @@
/*!
\class QEasingCurve
- \ingroup group_animation
+ \since 4.6
+ \ingroup animation
\brief The QEasingCurve class provides easing curves for controlling animation.
Easing curves describe a function that controls how the speed of the interpolation
@@ -99,7 +100,7 @@
\br
Easing equation function for a simple linear tweening,
with no easing.
- \value InQuad \inlineimage qeasingcurve-inquad.png
+ \value InQuad \inlineimage qeasingcurve-inquad.png
\br
Easing equation function for a quadratic (t^2) easing
in: accelerating from zero velocity.
@@ -107,7 +108,7 @@
\br
Easing equation function for a quadratic (t^2) easing
out: decelerating to zero velocity.
- \value InOutQuad \inlineimage qeasingcurve-inoutquad.png
+ \value InOutQuad \inlineimage qeasingcurve-inoutquad.png
\br
Easing equation function for a quadratic (t^2) easing
in/out: acceleration until halfway, then deceleration.
@@ -121,11 +122,11 @@
in: accelerating from zero velocity.
\value OutCubic \inlineimage qeasingcurve-outcubic.png
\br
- Easing equation function for a cubic (t^3) easing
+ Easing equation function for a cubic (t^3) easing
out: decelerating from zero velocity.
\value InOutCubic \inlineimage qeasingcurve-inoutcubic.png
\br
- Easing equation function for a cubic (t^3) easing
+ Easing equation function for a cubic (t^3) easing
in/out: acceleration until halfway, then deceleration.
\value OutInCubic \inlineimage qeasingcurve-outincubic.png
\br
@@ -133,55 +134,55 @@
out/in: deceleration until halfway, then acceleration.
\value InQuart \inlineimage qeasingcurve-inquart.png
\br
- Easing equation function for a quartic (t^4) easing
+ Easing equation function for a quartic (t^4) easing
in: accelerating from zero velocity.
\value OutQuart \inlineimage qeasingcurve-outquart.png
\br
- Easing equation function for a quartic (t^4) easing
+ Easing equation function for a quartic (t^4) easing
out: decelerating from zero velocity.
\value InOutQuart \inlineimage qeasingcurve-inoutquart.png
\br
- Easing equation function for a quartic (t^4) easing
+ Easing equation function for a quartic (t^4) easing
in/out: acceleration until halfway, then deceleration.
\value OutInQuart \inlineimage qeasingcurve-outinquart.png
\br
- Easing equation function for a quartic (t^4) easing
+ Easing equation function for a quartic (t^4) easing
out/in: deceleration until halfway, then acceleration.
\value InQuint \inlineimage qeasingcurve-inquint.png
\br
- Easing equation function for a quintic (t^5) easing
+ Easing equation function for a quintic (t^5) easing
in: accelerating from zero velocity.
\value OutQuint \inlineimage qeasingcurve-outquint.png
\br
- Easing equation function for a quintic (t^5) easing
+ Easing equation function for a quintic (t^5) easing
out: decelerating from zero velocity.
\value InOutQuint \inlineimage qeasingcurve-inoutquint.png
\br
- Easing equation function for a quintic (t^5) easing
+ Easing equation function for a quintic (t^5) easing
in/out: acceleration until halfway, then deceleration.
\value OutInQuint \inlineimage qeasingcurve-outinquint.png
\br
- Easing equation function for a quintic (t^5) easing
+ Easing equation function for a quintic (t^5) easing
out/in: deceleration until halfway, then acceleration.
\value InSine \inlineimage qeasingcurve-insine.png
\br
- Easing equation function for a sinusoidal (sin(t)) easing
+ Easing equation function for a sinusoidal (sin(t)) easing
in: accelerating from zero velocity.
\value OutSine \inlineimage qeasingcurve-outsine.png
\br
- Easing equation function for a sinusoidal (sin(t)) easing
+ Easing equation function for a sinusoidal (sin(t)) easing
out: decelerating from zero velocity.
\value InOutSine \inlineimage qeasingcurve-inoutsine.png
\br
- Easing equation function for a sinusoidal (sin(t)) easing
+ Easing equation function for a sinusoidal (sin(t)) easing
in/out: acceleration until halfway, then deceleration.
\value OutInSine \inlineimage qeasingcurve-outinsine.png
\br
- Easing equation function for a sinusoidal (sin(t)) easing
+ Easing equation function for a sinusoidal (sin(t)) easing
out/in: deceleration until halfway, then acceleration.
\value InExpo \inlineimage qeasingcurve-inexpo.png
\br
- Easing equation function for an exponential (2^t) easing
+ Easing equation function for an exponential (2^t) easing
in: accelerating from zero velocity.
\value OutExpo \inlineimage qeasingcurve-outexpo.png
\br
@@ -213,47 +214,47 @@
out/in: deceleration until halfway, then acceleration.
\value InElastic \inlineimage qeasingcurve-inelastic.png
\br
- Easing equation function for an elastic
- (exponentially decaying sine wave) easing in:
+ Easing equation function for an elastic
+ (exponentially decaying sine wave) easing in:
accelerating from zero velocity. The peak amplitude
can be set with the \e amplitude parameter, and the
period of decay by the \e period parameter.
\value OutElastic \inlineimage qeasingcurve-outelastic.png
\br
- Easing equation function for an elastic
- (exponentially decaying sine wave) easing out:
- decelerating from zero velocity. The peak amplitude
- can be set with the \e amplitude parameter, and the
+ Easing equation function for an elastic
+ (exponentially decaying sine wave) easing out:
+ decelerating from zero velocity. The peak amplitude
+ can be set with the \e amplitude parameter, and the
period of decay by the \e period parameter.
\value InOutElastic \inlineimage qeasingcurve-inoutelastic.png
\br
- Easing equation function for an elastic
- (exponentially decaying sine wave) easing in/out:
+ Easing equation function for an elastic
+ (exponentially decaying sine wave) easing in/out:
acceleration until halfway, then deceleration.
\value OutInElastic \inlineimage qeasingcurve-outinelastic.png
\br
- Easing equation function for an elastic
- (exponentially decaying sine wave) easing out/in:
+ Easing equation function for an elastic
+ (exponentially decaying sine wave) easing out/in:
deceleration until halfway, then acceleration.
\value InBack \inlineimage qeasingcurve-inback.png
\br
- Easing equation function for a back (overshooting
- cubic easing: (s+1)*t^3 - s*t^2) easing in:
+ Easing equation function for a back (overshooting
+ cubic easing: (s+1)*t^3 - s*t^2) easing in:
accelerating from zero velocity.
\value OutBack \inlineimage qeasingcurve-outback.png
\br
- Easing equation function for a back (overshooting
- cubic easing: (s+1)*t^3 - s*t^2) easing out:
+ Easing equation function for a back (overshooting
+ cubic easing: (s+1)*t^3 - s*t^2) easing out:
decelerating from zero velocity.
\value InOutBack \inlineimage qeasingcurve-inoutback.png
\br
- Easing equation function for a back (overshooting
- cubic easing: (s+1)*t^3 - s*t^2) easing in/out:
+ Easing equation function for a back (overshooting
+ cubic easing: (s+1)*t^3 - s*t^2) easing in/out:
acceleration until halfway, then deceleration.
\value OutInBack \inlineimage qeasingcurve-outinback.png
\br
- Easing equation function for a back (overshooting
- cubic easing: (s+1)*t^3 - s*t^2) easing out/in:
+ Easing equation function for a back (overshooting
+ cubic easing: (s+1)*t^3 - s*t^2) easing out/in:
deceleration until halfway, then acceleration.
\value InBounce \inlineimage qeasingcurve-inbounce.png
\br
@@ -283,18 +284,22 @@
\omitvalue NCurveTypes
*/
-/*!
+/*!
\typedef QEasingCurve::EasingFunction
This is a typedef for a pointer to a function with the following
signature:
\snippet doc/src/snippets/code/src_corelib_tools_qeasingcurve.cpp 0
-
*/
#include "qeasingcurve.h"
+#ifndef QT_NO_DEBUG_STREAM
+#include <QtCore/qdebug.h>
+#include <QtCore/QString>
+#endif
+
QT_BEGIN_NAMESPACE
static bool isConfigFunction(QEasingCurve::Type type)
@@ -341,11 +346,9 @@ bool QEasingCurveFunction::operator==(const QEasingCurveFunction& other)
_o == other._o;
}
-#ifdef QT_EXPERIMENTAL_SOLUTION
-# include "easing.cpp"
-#else
-# include "../3rdparty/easing/easing.cpp"
-#endif
+QT_BEGIN_INCLUDE_NAMESPACE
+#include "../../3rdparty/easing/easing.cpp"
+QT_END_INCLUDE_NAMESPACE
class QEasingCurvePrivate
{
@@ -355,6 +358,7 @@ public:
config(0),
func(&easeNone)
{ }
+ ~QEasingCurvePrivate() { delete config; }
void setType_helper(QEasingCurve::Type);
QEasingCurve::Type type;
@@ -646,10 +650,10 @@ bool QEasingCurve::operator==(const QEasingCurve &other) const
\fn bool QEasingCurve::operator!=(const QEasingCurve &other) const
Compare this easing curve with \a other and returns true if they are not equal.
It will also compare the properties of a curve.
-
+
\sa operator==()
*/
-
+
/*!
Returns the amplitude. This is not applicable for all curve types.
It is only applicable for bounce and elastic curves (curves of type()
@@ -664,8 +668,8 @@ qreal QEasingCurve::amplitude() const
/*!
Sets the amplitude to \a amplitude.
-
- This will set the amplitude of the bounce or the amplitude of the
+
+ This will set the amplitude of the bounce or the amplitude of the
elastic "spring" effect. The higher the number, the higher the amplitude.
\sa amplitude()
*/
@@ -688,7 +692,7 @@ qreal QEasingCurve::period() const
/*!
Sets the period to \a period.
- Setting a small period value will give a high frequency of the curve. A
+ Setting a small period value will give a high frequency of the curve. A
large period will give it a small frequency.
\sa period()
@@ -745,7 +749,7 @@ void QEasingCurvePrivate::setType_helper(QEasingCurve::Type newType)
delete config;
config = 0;
}
-
+
if (isConfigFunction(newType) || (amp != -1.0) || (period != -1.0) || (overshoot != -1.0)) {
config = curveToFunctionObject(newType);
if (amp != -1.0)
@@ -800,7 +804,7 @@ void QEasingCurve::setCustomType(EasingFunction func)
/*!
Returns the function pointer to the custom easing curve.
- If type() does not return QEasingCurve::Custom, this function
+ If type() does not return QEasingCurve::Custom, this function
will return 0.
*/
QEasingCurve::EasingFunction QEasingCurve::customType() const
@@ -826,11 +830,9 @@ qreal QEasingCurve::valueForProgress(qreal progress) const
}
#ifndef QT_NO_DEBUG_STREAM
-#include <QtCore/qdebug.h>
-#include <QtCore/QString>
QDebug operator<<(QDebug debug, const QEasingCurve &item)
{
- debug << "type:" << item.d_ptr->type
+ debug << "type:" << item.d_ptr->type
<< "func:" << item.d_ptr->func;
if (item.d_ptr->config) {
debug << QString::fromAscii("period:%1").arg(item.d_ptr->config->_p, 0, 'f', 20)
diff --git a/src/corelib/tools/qline.cpp b/src/corelib/tools/qline.cpp
index f615dcd..88825a3 100644
--- a/src/corelib/tools/qline.cpp
+++ b/src/corelib/tools/qline.cpp
@@ -260,7 +260,7 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const QLine &p)
{
- d << "QLine(" << p.p1() << "," << p.p2() << ")";
+ d << "QLine(" << p.p1() << ',' << p.p2() << ')';
return d;
}
#endif
@@ -822,7 +822,7 @@ qreal QLineF::angle(const QLineF &l) const
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const QLineF &p)
{
- d << "QLineF(" << p.p1() << "," << p.p2() << ")";
+ d << "QLineF(" << p.p1() << ',' << p.p2() << ')';
return d;
}
#endif
diff --git a/src/corelib/tools/qlistdata.cpp b/src/corelib/tools/qlistdata.cpp
index d40b6b6..34a5d80 100644
--- a/src/corelib/tools/qlistdata.cpp
+++ b/src/corelib/tools/qlistdata.cpp
@@ -1173,7 +1173,8 @@ void **QListData::erase(void **xi)
/*! \typedef QList::iterator::iterator_category
- \internal
+ A synonym for \e {std::random_access_iterator_tag} indicating
+ this iterator is a random access iterator.
*/
/*! \typedef QList::iterator::difference_type
@@ -1432,7 +1433,8 @@ void **QListData::erase(void **xi)
/*! \typedef QList::const_iterator::iterator_category
- \internal
+ A synonym for \e {std::random_access_iterator_tag} indicating
+ this iterator is a random access iterator.
*/
/*! \typedef QList::const_iterator::difference_type
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 66e3921..9953155 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -120,7 +120,7 @@ static char *_qdtoa( NEEDS_VOLATILE double d, int mode, int ndigits, int *decpt,
Q_CORE_EXPORT char *qdtoa(double d, int mode, int ndigits, int *decpt,
int *sign, char **rve, char **digits_str);
Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok);
-Q_CORE_EXPORT qlonglong qstrtoll(const char *nptr, const char **endptr, register int base, bool *ok);
+static qlonglong qstrtoll(const char *nptr, const char **endptr, register int base, bool *ok);
static qulonglong qstrtoull(const char *nptr, const char **endptr, register int base, bool *ok);
/******************************************************************************
@@ -321,7 +321,7 @@ static QString readEscapedFormatString(const QString &format, int *idx)
{
int &i = *idx;
- Q_ASSERT(format.at(i).unicode() == '\'');
+ Q_ASSERT(format.at(i) == QLatin1Char('\''));
++i;
if (i == format.size())
return QString();
@@ -635,7 +635,7 @@ static QLocale::MeasurementSystem winSystemMeasurementSystem()
QString iMeasure = QT_WA_INLINE(
QString::fromUtf16(reinterpret_cast<ushort*>(output)),
QString::fromLocal8Bit(reinterpret_cast<char*>(output)));
- if (iMeasure == QString::fromLatin1("1")) {
+ if (iMeasure == QLatin1String("1")) {
return QLocale::ImperialSystem;
}
}
@@ -1136,7 +1136,7 @@ static QString macToQtFormat(const QString &sys_fmt)
break;
case 'S': // fractional second
if (repeat < 3)
- result += QLatin1String("z");
+ result += QLatin1Char('z');
else
result += QLatin1String("zzz");
break;
@@ -1150,7 +1150,7 @@ static QString macToQtFormat(const QString &sys_fmt)
if (repeat >= 2)
result += QLatin1String("dd");
else
- result += QLatin1String("d");
+ result += QLatin1Char('d');
break;
case 'a':
result += QLatin1String("AP");
@@ -4671,7 +4671,7 @@ static qulonglong qstrtoull(const char *nptr, const char **endptr, register int
* Ignores `locale' stuff. Assumes that the upper and lower case
* alphabets and digits are each contiguous.
*/
-Q_CORE_EXPORT qlonglong qstrtoll(const char *nptr, const char **endptr, register int base, bool *ok)
+static qlonglong qstrtoll(const char *nptr, const char **endptr, register int base, bool *ok)
{
register const char *s;
register qulonglong acc;
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index 0699400..07df28d 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -902,7 +902,8 @@ void QMapData::dump()
/*! \typedef QMap::iterator::iterator_category
- \internal
+ A synonym for \e {std::bidirectional_iterator_tag} indicating
+ this iterator is a bidirectional iterator.
*/
/*! \typedef QMap::iterator::pointer
@@ -1123,7 +1124,8 @@ void QMapData::dump()
/*! \typedef QMap::const_iterator::iterator_category
- \internal
+ A synonym for \e {std::bidirectional_iterator_tag} indicating
+ this iterator is a bidirectional iterator.
*/
/*! \typedef QMap::const_iterator::pointer
diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp
index 5cc71d6..90b44b1 100644
--- a/src/corelib/tools/qpoint.cpp
+++ b/src/corelib/tools/qpoint.cpp
@@ -373,7 +373,7 @@ QDebug operator<<(QDebug dbg, const QPoint &p) {
QDebug operator<<(QDebug d, const QPointF &p)
{
- d.nospace() << "QPointF(" << p.x() << ", " << p.y() << ")";
+ d.nospace() << "QPointF(" << p.x() << ", " << p.y() << ')';
return d;
}
#endif
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index c3649e3..c64e1d6 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -195,6 +195,68 @@ static int ucstrnicmp(const ushort *a, const ushort *b, int l)
return ucstricmp(a, a + l, b, b + l);
}
+static bool qMemEquals(const quint16 *a, const quint16 *b, int length)
+{
+ // Benchmarking indicates that doing memcmp is much slower than
+ // executing the comparison ourselves.
+ // To make it even faster, we do a 32-bit comparison, comparing
+ // twice the amount of data as a normal word-by-word comparison.
+ //
+ // Benchmarking results on a 2.33 GHz Core2 Duo, with a 64-QChar
+ // block of data, with 4194304 iterations (per iteration):
+ // operation usec cpu ticks
+ // memcmp 330 710
+ // 16-bit 79 167-171
+ // 32-bit aligned 49 105-109
+ //
+ // Testing also indicates that unaligned 32-bit loads are as
+ // performant as 32-bit aligned.
+ if (a == b || !length)
+ return true;
+
+ register union {
+ const quint16 *w;
+ const quint32 *d;
+ quintptr value;
+ } sa, sb;
+ sa.w = a;
+ sb.w = b;
+
+ // check alignment
+ if ((sa.value & 2) == (sb.value & 2)) {
+ // both addresses have the same alignment
+ if (sa.value & 2) {
+ // both addresses are not aligned to 4-bytes boundaries
+ // compare the first character
+ if (*sa.w != *sb.w)
+ return false;
+ --length;
+ ++sa.w;
+ ++sb.w;
+
+ // now both addresses are 4-bytes aligned
+ }
+
+ // both addresses are 4-bytes aligned
+ // do a fast 32-bit comparison
+ register const quint32 *e = sa.d + (length >> 1);
+ for ( ; sa.d != e; ++sa.d, ++sb.d) {
+ if (*sa.d != *sb.d)
+ return false;
+ }
+
+ // do we have a tail?
+ return (length & 1) ? *sa.w == *sb.w : true;
+ } else {
+ // one of the addresses isn't 4-byte aligned but the other is
+ register const quint16 *e = sa.w + length;
+ for ( ; sa.w != e; ++sa.w, ++sb.w) {
+ if (*sa.w != *sb.w)
+ return false;
+ }
+ }
+ return true;
+}
/*!
\internal
@@ -882,6 +944,23 @@ QString::QString(int size, QChar ch)
}
}
+/*!
+ Constructs a string of the given \a size without initializing the
+ characters. This is only used in \c QStringBuilder::toString().
+
+ \internal
+*/
+
+QString::QString(int size, Uninitialized)
+{
+ d = (Data*) qMalloc(sizeof(Data)+size*sizeof(QChar));
+ d->ref = 1;
+ d->alloc = d->size = size;
+ d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
+ d->data = d->array;
+ d->array[size] = '\0';
+}
+
/*! \fn QString::QString(const QLatin1String &str)
Constructs a copy of the Latin-1 string \a str.
@@ -1908,8 +1987,10 @@ QString &QString::replace(QChar c, const QLatin1String &after, Qt::CaseSensitivi
*/
bool QString::operator==(const QString &other) const
{
- return (size() == other.size()) &&
- (memcmp((char*)unicode(),(char*)other.unicode(), size()*sizeof(QChar))==0);
+ if (d->size != other.d->size)
+ return false;
+
+ return qMemEquals(d->data, other.d->data, d->size);
}
/*!
@@ -3136,7 +3217,7 @@ bool QString::startsWith(const QString& s, Qt::CaseSensitivity cs) const
if (s.d->size > d->size)
return false;
if (cs == Qt::CaseSensitive) {
- return memcmp((char*)d->data, (char*)s.d->data, s.d->size*sizeof(QChar)) == 0;
+ return qMemEquals(d->data, s.d->data, s.d->size);
} else {
uint last = 0;
uint olast = 0;
@@ -3207,7 +3288,7 @@ bool QString::endsWith(const QString& s, Qt::CaseSensitivity cs) const
if (pos < 0)
return false;
if (cs == Qt::CaseSensitive) {
- return memcmp((char*)&d->data[pos], (char*)s.d->data, s.d->size*sizeof(QChar)) == 0;
+ return qMemEquals(d->data + pos, s.d->data, s.d->size);
} else {
uint last = 0;
uint olast = 0;
@@ -7692,7 +7773,8 @@ QString QStringRef::toString() const {
*/
bool operator==(const QStringRef &s1,const QStringRef &s2)
{ return (s1.size() == s2.size() &&
- (memcmp((char*)s1.unicode(), (char*)s2.unicode(), s1.size()*sizeof(QChar))==0)); }
+ qMemEquals((const ushort *)s1.unicode(), (const ushort *)s2.unicode(), s1.size()));
+}
/*! \relates QStringRef
@@ -7701,7 +7783,8 @@ bool operator==(const QStringRef &s1,const QStringRef &s2)
*/
bool operator==(const QString &s1,const QStringRef &s2)
{ return (s1.size() == s2.size() &&
- (memcmp((char*)s1.unicode(), (char*)s2.unicode(), s1.size()*sizeof(QChar))==0)); }
+ qMemEquals((const ushort *)s1.unicode(), (const ushort *)s2.unicode(), s1.size()));
+}
/*! \relates QStringRef
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 69c4f2f..7c0d6a3 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -579,6 +579,9 @@ public:
bool isSimpleText() const { if (!d->clean) updateProperties(); return d->simpletext; }
bool isRightToLeft() const { if (!d->clean) updateProperties(); return d->righttoleft; }
+ struct Uninitialized {};
+ QString(int size, Uninitialized);
+
private:
#if defined(QT_NO_CAST_FROM_ASCII) && !defined(Q_NO_DECLARED_NOT_DEFINED)
QString &operator+=(const char *s);
@@ -1001,13 +1004,15 @@ inline int QByteArray::findRev(const QString &s, int from) const
# endif // QT3_SUPPORT
#endif // QT_NO_CAST_TO_ASCII
+#ifndef QT_USE_FAST_OPERATOR_PLUS
+# ifndef QT_USE_FAST_CONCATENATION
inline const QString operator+(const QString &s1, const QString &s2)
{ QString t(s1); t += s2; return t; }
inline const QString operator+(const QString &s1, QChar s2)
{ QString t(s1); t += s2; return t; }
inline const QString operator+(QChar s1, const QString &s2)
{ QString t(s1); t += s2; return t; }
-#ifndef QT_NO_CAST_FROM_ASCII
+# ifndef QT_NO_CAST_FROM_ASCII
inline QT_ASCII_CAST_WARN const QString operator+(const QString &s1, const char *s2)
{ QString t(s1); t += QString::fromAscii(s2); return t; }
inline QT_ASCII_CAST_WARN const QString operator+(const char *s1, const QString &s2)
@@ -1020,7 +1025,9 @@ inline QT_ASCII_CAST_WARN const QString operator+(const QByteArray &ba, const QS
{ QString t = QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); t += s; return t; }
inline QT_ASCII_CAST_WARN const QString operator+(const QString &s, const QByteArray &ba)
{ QString t(s); t += QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); return t; }
-#endif
+# endif // QT_NO_CAST_FROM_ASCII
+# endif // QT_USE_FAST_CONCATENATION
+#endif // QT_USE_FAST_OPERATOR_PLUS
#ifndef QT_NO_STL
inline std::string QString::toStdString() const
@@ -1229,6 +1236,8 @@ inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QStringRef
QT_END_NAMESPACE
-QT_END_HEADER
+#ifdef QT_USE_FAST_CONCATENATION
+#include <QtCore/qstringbuilder.h>
+#endif
#endif // QSTRING_H
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp
new file mode 100644
index 0000000..b807a89
--- /dev/null
+++ b/src/corelib/tools/qstringbuilder.cpp
@@ -0,0 +1,135 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qstringbuilder.h"
+
+/*!
+ \class QLatin1Literal
+ \reentrant
+ \since 4.6
+
+ \brief The QLatin1Literal class provides a thin wrapper around string
+ literals used in source code.
+
+ \ingroup tools
+ \ingroup shared
+ \ingroup text
+ \mainclass
+
+ Unlike \c QLatin1String, a \c QLatin1Literal can retrieve its size
+ without iterating over the literal.
+
+ The main use of \c QLatin1Literal is in conjunction with \c QStringBuilder
+ to reduce the number of reallocations needed to build up a string from
+ smaller chunks.
+
+ \sa QStringBuilder, QLatin1String, QString, QStringRef
+*/
+
+/*! \fn QLatin1Literal::QLatin1Literal(const char(&string)[])
+
+ Constructs a new literal from the given \a string.
+*/
+
+/*! \fn int QLatin1Literal::size() const
+
+ Returns the number of characters in the literal \i{excluding} the trailing
+ NUL char.
+*/
+
+/*! \fn char *QLatin1Literal::data() const
+
+ Returns a pointer to the first character of the string literal.
+ The string literal is terminated by a NUL character.
+*/
+
+/*! \fn QLatin1Literal::operator QString() const
+
+ Converts the \c QLatin1Literal into a \c QString object.
+*/
+
+
+
+/*!
+ \class QStringBuilder
+ \reentrant
+ \since 4.6
+
+ \brief QStringBuilder is a template class that provides a facility to build
+ up QStrings from smaller chunks.
+
+ \ingroup tools
+ \ingroup shared
+ \ingroup text
+ \mainclass
+
+ When creating strings from smaller chunks, typically \c QString::operator+()
+ is used, resulting in \i{n - 1} reallocations when operating on \i{n} chunks.
+
+ QStringBuilder uses expression templates to collect the individual parts,
+ compute the total size, allocate memory for the resulting QString object,
+ and copy the contents of the chunks into the result.
+
+ The QStringBuilder class is not to be used explicitly in user code.
+ Instances of the class are created as return values of the operator%()
+ function, acting on objects of type \c QString, \c QLatin1String,
+ \c QLatin1Literal, \c \QStringRef, \c QChar,
+ \c QLatin1Char, and \c char.
+
+ Concatenating strings with operator%() generally yields better
+ performance then using \c QString::operator+() on the same chunks
+ if there are three or more of them, and performs equally well in other
+ cases.
+
+ \sa QLatin1Literal, QString
+*/
+
+/* !fn template <class A, class B> QStringBuilder<A, B> operator%(const A &a, const B &b)
+
+ Returns a \c QStringBuilder object that is converted to a QString object
+ when assigned to a variable of QString type or passed to a function that
+ takes a QString parameter.
+
+ This function is usable with arguments of type \c QString,
+ \c QLatin1String, \c QLatin1Literal, \c QStringRef,
+ \c QChar, \c QLatin1Char, and \c char.
+*/
+
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
new file mode 100644
index 0000000..1e67b7d
--- /dev/null
+++ b/src/corelib/tools/qstringbuilder.h
@@ -0,0 +1,207 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSTRINGBUILDER_H
+#define QSTRINGBUILDER_H
+
+#include <QtCore/qstring.h>
+
+#include <string.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Core)
+
+// ### Qt 5: merge with QLatin1String
+class QLatin1Literal
+{
+public:
+ template <int N>
+ QLatin1Literal(const char (&str)[N]) : m_size(N - 1), m_data(str) {}
+
+ inline int size() const { return m_size; }
+ inline const char *data() const { return m_data; }
+
+private:
+ const int m_size;
+ const char *m_data;
+};
+
+
+template <typename T> class QConcatenable {};
+
+template <typename A, typename B>
+class QStringBuilder
+{
+public:
+ QStringBuilder(const A &a_, const B &b_) : a(a_), b(b_) {}
+
+ operator QString() const
+ {
+ QString s(QConcatenable< QStringBuilder<A, B> >::size(*this),
+ QString::Uninitialized());
+
+ QChar *d = s.data();
+ QConcatenable< QStringBuilder<A, B> >::appendTo(*this, d);
+ return s;
+ }
+ QByteArray toLatin1() const { return QString(*this).toLatin1(); }
+
+ const A &a;
+ const B &b;
+};
+
+
+template <> struct QConcatenable<char>
+{
+ typedef char type;
+ static int size(const char) { return 1; }
+ static inline void appendTo(const char c, QChar *&out)
+ {
+ *out++ = QLatin1Char(c);
+ }
+};
+
+template <> struct QConcatenable<QLatin1Char>
+{
+ typedef QLatin1Char type;
+ static int size(const QLatin1Char) { return 1; }
+ static inline void appendTo(const QLatin1Char c, QChar *&out)
+ {
+ *out++ = c;
+ }
+};
+
+template <> struct QConcatenable<QChar>
+{
+ typedef QChar type;
+ static int size(const QChar) { return 1; }
+ static inline void appendTo(const QChar c, QChar *&out)
+ {
+ *out++ = c;
+ }
+};
+
+template <> struct QConcatenable<QLatin1String>
+{
+ typedef QLatin1String type;
+ static int size(const QLatin1String &a) { return qstrlen(a.latin1()); }
+ static inline void appendTo(const QLatin1String &a, QChar *&out)
+ {
+ for (const char *s = a.latin1(); *s; )
+ *out++ = QLatin1Char(*s++);
+ }
+
+};
+
+template <> struct QConcatenable<QLatin1Literal>
+{
+ typedef QLatin1Literal type;
+ static int size(const QLatin1Literal &a) { return a.size(); }
+ static inline void appendTo(const QLatin1Literal &a, QChar *&out)
+ {
+ for (const char *s = a.data(); *s; )
+ *out++ = QLatin1Char(*s++);
+ }
+};
+
+template <> struct QConcatenable<QString>
+{
+ typedef QString type;
+ static int size(const QString &a) { return a.size(); }
+ static inline void appendTo(const QString &a, QChar *&out)
+ {
+ const int n = a.size();
+ memcpy(out, (char*)a.constData(), sizeof(QChar) * n);
+ out += n;
+ }
+};
+
+template <> struct QConcatenable<QStringRef>
+{
+ typedef QStringRef type;
+ static int size(const QStringRef &a) { return a.size(); }
+ static inline void appendTo(QStringRef a, QChar *&out)
+ {
+ const int n = a.size();
+ memcpy(out, (char*)a.constData(), sizeof(QChar) * n);
+ out += n;
+ }
+};
+
+template <typename A, typename B>
+struct QConcatenable< QStringBuilder<A, B> >
+{
+ typedef QStringBuilder<A, B> type;
+ static int size(const type &p)
+ {
+ return QConcatenable<A>::size(p.a) + QConcatenable<B>::size(p.b);
+ }
+ static inline void appendTo(const QStringBuilder<A, B> &p, QChar *&out)
+ {
+ QConcatenable<A>::appendTo(p.a, out);
+ QConcatenable<B>::appendTo(p.b, out);
+ }
+};
+
+template <typename A, typename B>
+QStringBuilder<typename QConcatenable<A>::type, typename QConcatenable<B>::type>
+operator%(const A &a, const B &b)
+{
+ return QStringBuilder<A, B>(a, b);
+}
+
+#ifdef QT_USE_FAST_OPERATOR_PLUS
+template <typename A, typename B>
+QStringBuilder<typename QConcatenable<A>::type, typename QConcatenable<B>::type>
+operator+(const A &a, const B &b)
+{
+ return QStringBuilder<A, B>(a, b);
+}
+#endif
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QSTRINGBUILDER_H
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index e22f122..cf1bff8 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -621,8 +621,6 @@ int QtPrivate::QStringList_lastIndexOf(const QStringList *that, QRegExp &rx, int
the list, searching forward from index position \a from. Returns
-1 if no item matched.
- By default, this function is case sensitive.
-
\sa lastIndexOf(), contains(), QList::indexOf()
*/
diff --git a/src/corelib/tools/qtimeline.h b/src/corelib/tools/qtimeline.h
index 314dd7c..48c9232 100644
--- a/src/corelib/tools/qtimeline.h
+++ b/src/corelib/tools/qtimeline.h
@@ -45,8 +45,6 @@
#include <QtCore/qeasingcurve.h>
#include <QtCore/qobject.h>
-QT_EXPERIMENTAL_USE_NAMESPACE
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 90287cb..aea0c6c 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -32,6 +32,7 @@ HEADERS += \
tools/qsize.h \
tools/qstack.h \
tools/qstring.h \
+ tools/qstringbuilder.h \
tools/qstringlist.h \
tools/qstringmatcher.h \
tools/qtextboundaryfinder.h \
@@ -62,6 +63,7 @@ SOURCES += \
tools/qsharedpointer.cpp \
tools/qsize.cpp \
tools/qstring.cpp \
+ tools/qstringbuilder.cpp \
tools/qstringlist.cpp \
tools/qtextboundaryfinder.cpp \
tools/qtimeline.cpp \
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index ff1a01f..5e1fec3 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -3058,7 +3058,7 @@ QXmlStreamPrivateTagStack::NamespaceDeclaration &QXmlStreamWriterPrivate::findNa
QString s;
int n = ++namespacePrefixCount;
forever {
- s = QLatin1String("n") + QString::number(n++);
+ s = QLatin1Char('n') + QString::number(n++);
int j = namespaceDeclarations.size() - 2;
while (j >= 0 && namespaceDeclarations.at(j).prefix != s)
--j;
diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp
index 955a31c..2347a54 100644
--- a/src/dbus/qdbuserror.cpp
+++ b/src/dbus/qdbuserror.cpp
@@ -339,7 +339,7 @@ QString QDBusError::errorString(ErrorType error)
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QDBusError &msg)
{
- dbg.nospace() << "QDBusError(" << msg.name() << ", " << msg.message() << ")";
+ dbg.nospace() << "QDBusError(" << msg.name() << ", " << msg.message() << ')';
return dbg.space();
}
#endif
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index f40a45f..33f44ab 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -74,7 +74,7 @@ static inline QDebug operator<<(QDebug dbg, const QThread *th)
dbg.nospace() << "QThread(ptr=" << (void*)th;
if (th && !th->objectName().isEmpty())
dbg.nospace() << ", name=" << th->objectName();
- dbg.nospace() << ")";
+ dbg.nospace() << ')';
return dbg.space();
}
@@ -90,7 +90,7 @@ static inline QDebug operator<<(QDebug dbg, const QDBusConnectionPrivate *conn)
dbg.nospace() << "same thread";
else
dbg.nospace() << conn->thread();
- dbg.nospace() << ")";
+ dbg.nospace() << ')';
return dbg.space();
}
@@ -565,7 +565,7 @@ static void huntAndEmit(DBusConnection *connection, DBusMessage *msg,
QDBusConnectionPrivate::ObjectTreeNode::DataList::ConstIterator it = haystack.children.constBegin();
QDBusConnectionPrivate::ObjectTreeNode::DataList::ConstIterator end = haystack.children.constEnd();
for ( ; it != end; ++it)
- huntAndEmit(connection, msg, needle, *it, isScriptable, isAdaptor, path + QLatin1String("/") + it->name);
+ huntAndEmit(connection, msg, needle, *it, isScriptable, isAdaptor, path + QLatin1Char('/') + it->name);
if (needle == haystack.obj) {
// is this a signal we should relay?
diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp
index 8eb8b1a..ce76ecc 100644
--- a/src/dbus/qdbusmetaobject.cpp
+++ b/src/dbus/qdbusmetaobject.cpp
@@ -601,7 +601,7 @@ QDBusMetaObject *QDBusMetaObject::createMetaObject(const QString &interface, con
// mark as an error
error = QDBusError(QDBusError::UnknownInterface,
- QString( QLatin1String("Interface '%1' was not found") )
+ QString::fromLatin1("Interface '%1' was not found")
.arg(interface));
return 0;
}
diff --git a/src/dbus/qdbusutil.cpp b/src/dbus/qdbusutil.cpp
index 471b899..dd983a0 100644
--- a/src/dbus/qdbusutil.cpp
+++ b/src/dbus/qdbusutil.cpp
@@ -80,15 +80,15 @@ static bool variantToString(const QVariant &arg, QString &out)
int argType = arg.userType();
if (argType == QVariant::StringList) {
- out += QLatin1String("{");
+ out += QLatin1Char('{');
QStringList list = arg.toStringList();
foreach (QString item, list)
out += QLatin1Char('\"') + item + QLatin1String("\", ");
if (!list.isEmpty())
out.chop(2);
- out += QLatin1String("}");
+ out += QLatin1Char('}');
} else if (argType == QVariant::ByteArray) {
- out += QLatin1String("{");
+ out += QLatin1Char('{');
QByteArray list = arg.toByteArray();
for (int i = 0; i < list.count(); ++i) {
out += QString::number(list.at(i));
@@ -96,9 +96,9 @@ static bool variantToString(const QVariant &arg, QString &out)
}
if (!list.isEmpty())
out.chop(2);
- out += QLatin1String("}");
+ out += QLatin1Char('}');
} else if (argType == QVariant::List) {
- out += QLatin1String("{");
+ out += QLatin1Char('{');
QList<QVariant> list = arg.toList();
foreach (QVariant item, list) {
if (!variantToString(item, out))
@@ -107,7 +107,7 @@ static bool variantToString(const QVariant &arg, QString &out)
}
if (!list.isEmpty())
out.chop(2);
- out += QLatin1String("}");
+ out += QLatin1Char('}');
} else if (argType == QMetaType::Char || argType == QMetaType::Short || argType == QMetaType::Int
|| argType == QMetaType::Long || argType == QMetaType::LongLong) {
out += QString::number(arg.toLongLong());
@@ -142,7 +142,7 @@ static bool variantToString(const QVariant &arg, QString &out)
return false;
out += QLatin1Char(']');
} else if (arg.canConvert(QVariant::String)) {
- out += QLatin1String("\"") + arg.toString() + QLatin1String("\"");
+ out += QLatin1Char('\"') + arg.toString() + QLatin1Char('\"');
} else {
out += QLatin1Char('[');
out += QLatin1String(arg.typeName());
@@ -226,7 +226,7 @@ bool argToString(const QDBusArgument &busArg, QString &out)
if (elementType != QDBusArgument::BasicType && elementType != QDBusArgument::VariantType
&& elementType != QDBusArgument::MapEntryType)
- out += QLatin1String("]");
+ out += QLatin1Char(']');
return true;
}
diff --git a/src/declarative/canvas/qsimplecanvas.h b/src/declarative/canvas/qsimplecanvas.h
index 880fae0..1cbd3c7 100644
--- a/src/declarative/canvas/qsimplecanvas.h
+++ b/src/declarative/canvas/qsimplecanvas.h
@@ -88,27 +88,11 @@ namespace QSimpleCanvasConfig
#elif defined(QFX_RENDER_QPAINTER)
typedef QTransform Matrix;
- typedef QImage Image;
inline Matrix transformToMatrix(const QTransform &t)
{ return t; }
inline QTransform matrixToTransform(const Matrix &t)
{ return t; }
- inline bool needConvert(ImageType type, const Image &img) {
- QImage::Format f = img.format();
- return !((type == Opaque && f == QImage::Format_RGB16) ||
- (type == Translucent && f == QImage::Format_ARGB32_Premultiplied));
- }
- inline Image convert(ImageType type, const Image &img) {
- if (type == Opaque)
- return img.convertToFormat(QImage::Format_RGB16);
- else
- return img.convertToFormat(QImage::Format_ARGB32_Premultiplied);
- }
- inline Image create(const QSize &s)
- { return QImage(s, QImage::Format_ARGB32_Premultiplied); }
- inline const Image &toImage(const QImage &i)
- { return i; }
#endif
}
diff --git a/src/declarative/canvas/qsimplecanvas_opengl.cpp b/src/declarative/canvas/qsimplecanvas_opengl.cpp
index 98f92d7..72f8324 100644
--- a/src/declarative/canvas/qsimplecanvas_opengl.cpp
+++ b/src/declarative/canvas/qsimplecanvas_opengl.cpp
@@ -416,13 +416,13 @@ QGLShaderProgram *QSimpleCanvasItem::GLPainter::useColorShader(const QColor &col
return item->basicShaders()->constantColor();
}
-void QSimpleCanvasItem::GLPainter::drawImage(const QPointF &point,
+void QSimpleCanvasItem::GLPainter::drawPixmap(const QPointF &point,
const GLTexture &texture)
{
- drawImage(QRectF(point, QSizeF(texture.width(), texture.height())), texture);
+ drawPixmap(QRectF(point, QSizeF(texture.width(), texture.height())), texture);
}
-void QSimpleCanvasItem::GLPainter::drawImage(const QRectF &rect,
+void QSimpleCanvasItem::GLPainter::drawPixmap(const QRectF &rect,
const GLTexture &img)
{
QGLShaderProgram *shader = useTextureShader();
diff --git a/src/declarative/canvas/qsimplecanvas_opengl1.cpp b/src/declarative/canvas/qsimplecanvas_opengl1.cpp
index 3fd8490..6e50ef8 100644
--- a/src/declarative/canvas/qsimplecanvas_opengl1.cpp
+++ b/src/declarative/canvas/qsimplecanvas_opengl1.cpp
@@ -386,16 +386,16 @@ void QSimpleCanvasPrivate::release(QGLFramebufferObject *)
{
}
-void QSimpleCanvasItem::GLPainter::drawImage(const QPointF &point,
+void QSimpleCanvasItem::GLPainter::drawPixmap(const QPointF &point,
const GLTexture &texture)
{
- drawImage(QRectF(point, QSizeF(texture.width(), texture.height())), texture);
+ drawPixmap(QRectF(point, QSizeF(texture.width(), texture.height())), texture);
}
-void QSimpleCanvasItem::GLPainter::drawImage(const QRectF &rect,
+void QSimpleCanvasItem::GLPainter::drawPixmap(const QRectF &rect,
const GLTexture &img)
{
- qFatal("Cannot call QSimpleCanvasItem::GLPainter::drawImage() when using OpenGL ES 1.1");
+ qFatal("Cannot call QSimpleCanvasItem::GLPainter::drawPixmap() when using OpenGL ES 1.1");
}
QT_END_NAMESPACE
diff --git a/src/declarative/canvas/qsimplecanvasdebugplugin.cpp b/src/declarative/canvas/qsimplecanvasdebugplugin.cpp
index f5f4f53..0fd0f81 100644
--- a/src/declarative/canvas/qsimplecanvasdebugplugin.cpp
+++ b/src/declarative/canvas/qsimplecanvasdebugplugin.cpp
@@ -122,7 +122,12 @@ void QSimpleCanvasSceneDebugPlugin::refresh(QDataStream &ds,
ds << QmlDebugServerPlugin::objectToString(item) << item->x() << item->y()
<< item->z() << item->width() << item->height()
<< (int)item->transformOrigin() << item->scale() << (int)item->flip()
- << item->transform() << item->hasActiveFocus() << (int)item->options();
+#ifdef QFX_RENDER_OPENGL
+ << item->transform().toTransform()
+#elif defined(QFX_RENDER_QPAINTER)
+ << item->transform()
+#endif
+ << item->hasActiveFocus() << (int)item->options();
QPixmap pix;
diff --git a/src/declarative/canvas/qsimplecanvasitem.cpp b/src/declarative/canvas/qsimplecanvasitem.cpp
index 3666b82..f2222a9 100644
--- a/src/declarative/canvas/qsimplecanvasitem.cpp
+++ b/src/declarative/canvas/qsimplecanvasitem.cpp
@@ -1852,12 +1852,12 @@ QSimpleCanvasItem *QSimpleCanvasItem::findNextFocus(QSimpleCanvasItem *item)
return 0;
}
-QImage QSimpleCanvasItem::string(const QString &str, const QColor &c, const QFont &f)
+QPixmap QSimpleCanvasItem::string(const QString &str, const QColor &c, const QFont &f)
{
QFontMetrics fm(f);
QSize size(fm.width(str), fm.height()*(str.count(QLatin1Char('\n'))+1)); //fm.boundingRect(str).size();
- QImage img(size, QImage::Format_ARGB32_Premultiplied);
- img.fill(0);
+ QPixmap img(size);
+ img.fill(Qt::transparent);
QPainter p(&img);
p.setPen(c);
p.setFont(f);
diff --git a/src/declarative/canvas/qsimplecanvasitem.h b/src/declarative/canvas/qsimplecanvasitem.h
index b928319..f817799 100644
--- a/src/declarative/canvas/qsimplecanvasitem.h
+++ b/src/declarative/canvas/qsimplecanvasitem.h
@@ -175,8 +175,8 @@ public:
QGLShaderProgram *useTextureShader();
QGLShaderProgram *useColorShader(const QColor &);
- void drawImage(const QPointF &, const GLTexture &);
- void drawImage(const QRectF &, const GLTexture &);
+ void drawPixmap(const QPointF &, const GLTexture &);
+ void drawPixmap(const QRectF &, const GLTexture &);
private:
GLPainter(const GLPainter &);
GLPainter &operator=(const GLPainter &);
@@ -228,7 +228,7 @@ public:
GLBasicShaders *basicShaders() const;
- static QImage string(const QString &, const QColor & = Qt::black, const QFont & = QFont());
+ static QPixmap string(const QString &, const QColor & = Qt::black, const QFont & = QFont());
protected:
virtual void geometryChanged(const QRectF &newGeometry,
diff --git a/src/declarative/debugger/qmldebugclient.cpp b/src/declarative/debugger/qmldebugclient.cpp
index 85ccf0b..3dacf01 100644
--- a/src/declarative/debugger/qmldebugclient.cpp
+++ b/src/declarative/debugger/qmldebugclient.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include "qmldebugclient.h"
-#include <private/qtcpsocket_p.h>
+#include <private/qobject_p.h>
#include <QtDeclarative/qpacketprotocol.h>
#include <QtCore/qdebug.h>
#include <QtCore/qstringlist.h>
diff --git a/src/declarative/fx/qfxblendedimage.cpp b/src/declarative/fx/qfxblendedimage.cpp
index 73eb3c4..4c6eb58 100644
--- a/src/declarative/fx/qfxblendedimage.cpp
+++ b/src/declarative/fx/qfxblendedimage.cpp
@@ -192,9 +192,9 @@ void QFxBlendedImage::paintContents(QPainter &p)
}
if (_blend < 0.75)
- p.drawImage(0, 0, primPix);
+ p.drawPixmap(0, 0, primPix);
else
- p.drawImage(0, 0, secPix);
+ p.drawPixmap(0, 0, secPix);
if (_smooth) {
p.restore();
@@ -212,8 +212,8 @@ void QFxBlendedImage::paintGLContents(GLPainter &p)
if (dirty) {
prim.clear();
sec.clear();
- prim.setImage(primPix);
- sec.setImage(secPix);
+ prim.setImage(primPix.toImage());
+ sec.setImage(secPix.toImage());
dirty = false;
}
diff --git a/src/declarative/fx/qfxblendedimage.h b/src/declarative/fx/qfxblendedimage.h
index 4e6204d..baf4b64 100644
--- a/src/declarative/fx/qfxblendedimage.h
+++ b/src/declarative/fx/qfxblendedimage.h
@@ -99,8 +99,8 @@ private:
GLTexture prim;
GLTexture sec;
#endif
- QFxPixmap primPix;
- QFxPixmap secPix;
+ QPixmap primPix;
+ QPixmap secPix;
};
QML_DECLARE_TYPE(QFxBlendedImage)
diff --git a/src/declarative/fx/qfxhighlightfilter.cpp b/src/declarative/fx/qfxhighlightfilter.cpp
index 9807e21..6bf3148 100644
--- a/src/declarative/fx/qfxhighlightfilter.cpp
+++ b/src/declarative/fx/qfxhighlightfilter.cpp
@@ -135,10 +135,10 @@ QString QFxHighlightFilter::source() const
void QFxHighlightFilter::imageLoaded()
{
- QImage img = QFxPixmap(d->url);
+ QPixmap img = QFxPixmap(d->url);
#if defined(QFX_RENDER_OPENGL2)
if (!img.isNull())
- d->tex.setImage(img);
+ d->tex.setImage(img.toImage());
#endif
emit sourceChanged(d->source);
update();
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp
index 55aecd7..22e5d97 100644
--- a/src/declarative/fx/qfximage.cpp
+++ b/src/declarative/fx/qfximage.cpp
@@ -141,16 +141,15 @@ QFxImage::~QFxImage()
QPixmap QFxImage::pixmap() const
{
Q_D(const QFxImage);
- return d->_pix.pixmap();
+ return d->_pix;
}
void QFxImage::setPixmap(const QPixmap &pix)
{
Q_D(QFxImage);
d->url = QUrl();
- d->_pix.setPixmap(pix);
+ d->_pix = pix;
d->_opaque=false;
- d->_pix.setOpaque(false);
setImplicitWidth(d->_pix.width());
setImplicitHeight(d->_pix.height());
@@ -255,7 +254,6 @@ void QFxImage::setOpaque(bool o)
if (o == d->_opaque)
return;
d->_opaque = o;
- d->_pix.setOpaque(o);
update();
}
@@ -326,21 +324,21 @@ void QFxImage::paintContents(QPainter &p)
if (d->_smooth)
p.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->_smooth);
- QSimpleCanvasConfig::Image pix = d->_pix;
+ QPixmap pix = d->_pix;
if (d->_tiled) {
p.save();
p.setClipRect(0, 0, width(), height(), Qt::IntersectClip);
QRect me = QRect(0, 0, width(), height());
- int pw = d->_pix.width();
- int ph = d->_pix.height();
+ int pw = pix.width();
+ int ph = pix.height();
int yy = 0;
while(yy < height()) {
int xx = 0;
while(xx < width()) {
- p.drawImage(xx, yy, d->_pix);
+ p.drawPixmap(xx, yy, pix);
xx += pw;
}
yy += ph;
@@ -354,10 +352,10 @@ void QFxImage::paintContents(QPainter &p)
height() / qreal(pix.height()));
QTransform old = p.transform();
p.setWorldTransform(scale * old);
- p.drawImage(0, 0, pix);
+ p.drawPixmap(0, 0, pix);
p.setWorldTransform(old);
} else {
- p.drawImage(0, 0, pix);
+ p.drawPixmap(0, 0, pix);
}
} else {
int sgl = d->_scaleGrid->left();
@@ -377,40 +375,40 @@ void QFxImage::paintContents(QPainter &p)
// Upper left
if (sgt && sgl)
- p.drawImage(QRect(0, 0, sgl, sgt), pix, QRect(0, 0, sgl, sgt));
+ p.drawPixmap(QRect(0, 0, sgl, sgt), pix, QRect(0, 0, sgl, sgt));
// Upper middle
if (pix.width() - xSide && sgt)
- p.drawImage(QRect(sgl, 0, w - xSide, sgt), pix,
+ p.drawPixmap(QRect(sgl, 0, w - xSide, sgt), pix,
QRect(sgl, 0, pix.width() - xSide, sgt));
// Upper right
if (sgt && pix.width() - sgr)
- p.drawImage(QPoint(w-sgr, 0), pix,
+ p.drawPixmap(QPoint(w-sgr, 0), pix,
QRect(pix.width()-sgr, 0, sgr, sgt));
// Middle left
if (sgl && pix.height() - ySide)
- p.drawImage(QRect(0, sgt, sgl, h - ySide), pix,
+ p.drawPixmap(QRect(0, sgt, sgl, h - ySide), pix,
QRect(0, sgt, sgl, pix.height() - ySide));
// Middle
if (pix.width() - xSide && pix.height() - ySide)
- p.drawImage(QRect(sgl, sgt, w - xSide, h - ySide),
+ p.drawPixmap(QRect(sgl, sgt, w - xSide, h - ySide),
pix,
QRect(sgl, sgt, pix.width() - xSide, pix.height() - ySide));
// Middle right
if (sgr && pix.height() - ySide)
- p.drawImage(QRect(w-sgr, sgt, sgr, h - ySide), pix,
+ p.drawPixmap(QRect(w-sgr, sgt, sgr, h - ySide), pix,
QRect(pix.width()-sgr, sgt, sgr, pix.height() - ySide));
// Lower left
if (sgl && sgr)
- p.drawImage(QPoint(0, h - sgb), pix,
+ p.drawPixmap(QPoint(0, h - sgb), pix,
QRect(0, pix.height() - sgb, sgl, sgb));
// Lower Middle
if (pix.width() - xSide && sgb)
- p.drawImage(QRect(sgl, h - sgb, w - xSide, sgb), pix,
+ p.drawPixmap(QRect(sgl, h - sgb, w - xSide, sgb), pix,
QRect(sgl, pix.height() - sgb, pix.width() - xSide, sgb));
// Lower Right
if (sgr && sgb)
- p.drawImage(QPoint(w-sgr, h - sgb), pix,
+ p.drawPixmap(QPoint(w-sgr, h - sgb), pix,
QRect(pix.width()-sgr, pix.height() - sgb, sgr, sgb));
}
@@ -461,7 +459,7 @@ uint QFxImage::glSimpleItemData(float *vertices, float *texVertices,
void QFxImagePrivate::checkDirty()
{
if (_texDirty && !_pix.isNull()) {
- _tex.setImage(_pix);
+ _tex.setImage(_pix.toImage());
_tex.setHorizontalWrap(GLTexture::Repeat);
_tex.setVerticalWrap(GLTexture::Repeat);
}
@@ -945,7 +943,6 @@ void QFxImage::requestFinished()
d->status = Error;
}
d->_pix = QFxPixmap(d->url);
- d->_pix.setOpaque(d->_opaque);
setOptions(QFxImage::SimpleItem, true);
}
setImplicitWidth(d->_pix.width());
diff --git a/src/declarative/fx/qfximage_p.h b/src/declarative/fx/qfximage_p.h
index 8227ce4..b3cccf9 100644
--- a/src/declarative/fx/qfximage_p.h
+++ b/src/declarative/fx/qfximage_p.h
@@ -95,7 +95,7 @@ public:
}
QFxScaleGrid *_scaleGrid;
- QFxPixmap _pix;
+ QPixmap _pix;
bool _tiled : 1;
bool _smooth : 1;
bool _opaque : 1;
diff --git a/src/declarative/fx/qfxpainteditem.cpp b/src/declarative/fx/qfxpainteditem.cpp
index 4d2e327..44adba7 100644
--- a/src/declarative/fx/qfxpainteditem.cpp
+++ b/src/declarative/fx/qfxpainteditem.cpp
@@ -271,7 +271,7 @@ void QFxPaintedItem::paintGLContents(GLPainter &p)
QRect area = d->imagecache[i]->area;
if (topaint.contains(area)) {
QRectF target(area.x(), area.y(), area.width(), area.height());
- p.drawImage(target.toRect(), d->imagecache[i]->image);
+ p.drawPixmap(target.toRect(), d->imagecache[i]->image);
topaint -= area;
d->imagecache[i]->age=0;
} else {
@@ -303,12 +303,8 @@ void QFxPaintedItem::paintGLContents(GLPainter &p)
const QVector<QRect> rects = bigger.rects();
for (int i = 0; i < rects.count(); ++i) {
const QRect &r = rects.at(i);
-#if defined(QFX_RENDER_QPAINTER)
- QImage img(r.size(),QImage::Format_ARGB32_Premultiplied);
-#else
- QImage img(r.size(),QImage::Format_ARGB32);
-#endif
- img.fill(0);
+ QPixmap img(r.size());
+ img.fill(Qt::transparent);
{
QPainter qp(&img);
qp.translate(-r.x(),-r.y());
@@ -317,13 +313,13 @@ void QFxPaintedItem::paintGLContents(GLPainter &p)
QFxPaintedItemPrivate::ImageCacheItem *newitem = new QFxPaintedItemPrivate::ImageCacheItem;
newitem->area = r;
#if defined(QFX_RENDER_QPAINTER)
- newitem->image = QSimpleCanvasConfig::Image(QSimpleCanvasConfig::toImage(img));
+ newitem->image = img;
#else
- newitem->image.setImage(img);
+ newitem->image.setImage(img.toImage());
#endif
d->imagecache.append(newitem);
QRectF target(r.x(), r.y(), r.width(), r.height());
- p.drawImage(target.toRect(), newitem->image);
+ p.drawPixmap(target.toRect(), newitem->image);
}
}
#if defined(QFX_RENDER_OPENGL2)
diff --git a/src/declarative/fx/qfxpainteditem_p.h b/src/declarative/fx/qfxpainteditem_p.h
index 5d5da6b..d8d1a2a 100644
--- a/src/declarative/fx/qfxpainteditem_p.h
+++ b/src/declarative/fx/qfxpainteditem_p.h
@@ -78,7 +78,7 @@ public:
int age;
QRect area;
#if defined(QFX_RENDER_QPAINTER)
- QSimpleCanvasConfig::Image image;
+ QPixmap image;
#else
GLTexture image;
#endif
diff --git a/src/declarative/fx/qfxparticles.cpp b/src/declarative/fx/qfxparticles.cpp
index e9f38b0..41fb5bc 100644
--- a/src/declarative/fx/qfxparticles.cpp
+++ b/src/declarative/fx/qfxparticles.cpp
@@ -397,7 +397,7 @@ public:
QString source;
QUrl url;
- QSimpleCanvasConfig::Image image;
+ QPixmap image;
int count;
int lifeSpan;
int lifeSpanDev;
@@ -671,7 +671,7 @@ void QFxParticles::setSource(const QString &name)
if (name.isEmpty()) {
d->source = name;
d->url = QUrl();
- d->image = QSimpleCanvasConfig::Image();
+ d->image = QPixmap();
#if defined(QFX_RENDER_OPENGL)
d->texDirty = true;
d->tex.clear();
@@ -1124,7 +1124,7 @@ void QFxParticlesPainter::paintContents(QPainter &p)
for (int i = 0; i < d->particles.count(); ++i) {
const QFxParticle &particle = d->particles.at(i);
p.setOpacity(particle.opacity);
- p.drawImage(particle.x - myX, particle.y - myY, d->image);
+ p.drawPixmap(particle.x - myX, particle.y - myY, d->image);
}
update();//Should I need this? (GV does)
}
@@ -1143,7 +1143,7 @@ void QFxParticlesPainter::paintGLContents(GLPainter &p)
updateSize();
if (d->texDirty && !d->image.isNull()) {
- d->tex.setImage(d->image);
+ d->tex.setImage(d->image.toImage());
d->tex.setHorizontalWrap(GLTexture::Repeat);
d->tex.setVerticalWrap(GLTexture::Repeat);
}
diff --git a/src/declarative/fx/qfxpixmap.cpp b/src/declarative/fx/qfxpixmap.cpp
index 0e5a10f..0ea94f5 100644
--- a/src/declarative/fx/qfxpixmap.cpp
+++ b/src/declarative/fx/qfxpixmap.cpp
@@ -42,44 +42,49 @@
#include "qfxpixmap.h"
#include <QHash>
#include <QNetworkReply>
+#include <QPixmapCache>
#include <qfxperf.h>
#include <QtDeclarative/qmlengine.h>
#include <QFile>
-
QT_BEGIN_NAMESPACE
-class QFxPixmapCacheItem;
-typedef QHash<QString, QFxPixmapCacheItem *> QFxPixmapCache;
-static QFxPixmapCache qfxPixmapCache;
+class QSharedNetworkReply;
+typedef QHash<QString, QSharedNetworkReply *> QFxSharedNetworkReplyHash;
+static QFxSharedNetworkReplyHash qfxActiveNetworkReplies;
-class QFxPixmapCacheItem
+class QSharedNetworkReply
{
public:
- QFxPixmapCacheItem() : reply(0), refCount(1) {}
- QString key;
+ QSharedNetworkReply(QNetworkReply *r) : reply(r), refCount(1) {}
+ ~QSharedNetworkReply()
+ {
+ reply->deleteLater();
+ }
QNetworkReply *reply;
-#if defined(QFX_RENDER_OPENGL)
- QImage image;
-#else
- QImage image;
- QImage opaqueImage;
-#endif
int refCount;
- void addRef() { ++refCount; }
- void release() { Q_ASSERT(refCount > 0); --refCount; if (refCount == 0) { qfxPixmapCache.remove(key); delete this; } }
+ void addRef()
+ {
+ ++refCount;
+ }
+ void release()
+ {
+ Q_ASSERT(refCount > 0);
+ --refCount;
+ if (refCount == 0) {
+ QString key = reply->url().toString();
+ qfxActiveNetworkReplies.remove(key);
+ delete this;
+ }
+ }
};
-static QFxPixmapCacheItem qfxPixmapCacheDummyItem;
-
class QFxPixmapPrivate
{
public:
- QFxPixmapPrivate()
- : opaque(false), pixmap(&qfxPixmapCacheDummyItem) { pixmap->addRef(); }
+ QFxPixmapPrivate() {}
- bool opaque;
- QFxPixmapCacheItem *pixmap;
+ QPixmap pixmap;
};
/*!
@@ -102,131 +107,71 @@ QFxPixmap::QFxPixmap(const QUrl &url)
#ifdef Q_ENABLE_PERFORMANCE_LOG
QFxPerfTimer<QFxPerf::PixmapLoad> perf;
#endif
- QString key = url.toString();
- QFxPixmapCache::Iterator iter = qfxPixmapCache.find(key);
- if (iter == qfxPixmapCache.end()) {
- qWarning() << "QFxPixmap: URL not loaded" << url;
- } else {
- QNetworkReply *reply = (*iter)->reply;
- if (reply) {
- if (reply->error()) {
- qWarning() << "Error loading" << url << reply->errorString();
+#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
+ if (url.scheme()==QLatin1String("file")) {
+ d->pixmap.load(url.toLocalFile());
+ } else
+#endif
+ {
+ QString key = url.toString();
+ if (!QPixmapCache::find(key,&d->pixmap)) {
+ QFxSharedNetworkReplyHash::Iterator iter = qfxActiveNetworkReplies.find(key);
+ if (iter == qfxActiveNetworkReplies.end()) {
+ // API usage error
+ qWarning() << "QFxPixmap: URL not loaded" << url;
} else {
- (*iter)->image.load(reply, 0);
+ if ((*iter)->reply->error()) {
+ qWarning() << "Network error loading" << url << (*iter)->reply->errorString();
+ } else {
+ QImage img;
+ if (img.load((*iter)->reply, 0)) {
+ d->pixmap = QPixmap::fromImage(img);
+ QPixmapCache::insert(key, d->pixmap);
+ } else {
+ qWarning() << "Format error loading" << url;
+ }
+ }
+ (*iter)->release();
}
- reply->deleteLater();
- (*iter)->reply = 0;
}
- (*iter)->addRef();
}
-
- d->pixmap = *iter;
}
QFxPixmap::QFxPixmap(const QFxPixmap &o)
: d(new QFxPixmapPrivate)
{
- d->opaque = o.d->opaque;
- o.d->pixmap->addRef();
- d->pixmap->release();
d->pixmap = o.d->pixmap;
}
QFxPixmap::~QFxPixmap()
{
- d->pixmap->release();
delete d;
}
QFxPixmap &QFxPixmap::operator=(const QFxPixmap &o)
{
- d->opaque = o.d->opaque;
- o.d->pixmap->addRef();
- d->pixmap->release();
d->pixmap = o.d->pixmap;
return *this;
}
bool QFxPixmap::isNull() const
{
- return d->pixmap->image.isNull();
-}
-
-bool QFxPixmap::opaque() const
-{
- return d->opaque;
-}
-
-void QFxPixmap::setOpaque(bool o)
-{
- d->opaque = o;
+ return d->pixmap.isNull();
}
int QFxPixmap::width() const
{
- return d->pixmap->image.width();
+ return d->pixmap.width();
}
int QFxPixmap::height() const
{
- return d->pixmap->image.height();
-}
-
-QPixmap QFxPixmap::pixmap() const
-{
- return QPixmap::fromImage(d->pixmap->image);
+ return d->pixmap.height();
}
-void QFxPixmap::setPixmap(const QPixmap &pix)
+QFxPixmap::operator const QPixmap &() const
{
- QFxPixmapCache::Iterator iter = qfxPixmapCache.find(QString::number(pix.cacheKey()));
- if (iter == qfxPixmapCache.end()) {
- QFxPixmapCacheItem *item = new QFxPixmapCacheItem;
- item->key = QString::number(pix.cacheKey());
- if (d->pixmap)
- d->pixmap->release();
- d->pixmap = item;
- d->pixmap->image = pix.toImage();
- qfxPixmapCache.insert(QString::number(pix.cacheKey()), item);
- } else {
- (*iter)->addRef();
- d->pixmap = *iter;
- }
-
-#if 0
- int size = 0;
- for (QFxPixmapCache::Iterator iter = qfxPixmapCache.begin(); iter != qfxPixmapCache.end(); ++iter) {
- size += (*iter)->image.width() * (*iter)->image.height();
- }
- qWarning() << qfxPixmapCache.count() << size;
-#endif
-}
-
-QFxPixmap::operator const QSimpleCanvasConfig::Image &() const
-{
-#if defined(QFX_RENDER_OPENGL)
- return d->pixmap->image;
-#else
- if (d->opaque) {
- if (!d->pixmap->image.isNull() && d->pixmap->opaqueImage.isNull()) {
-#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::PixmapLoad> perf;
-#endif
- d->pixmap->opaqueImage = d->pixmap->image.convertToFormat(QPixmap::defaultDepth() == 16 ?
- QImage::Format_RGB16 :
- QImage::Format_RGB32);
- }
- return d->pixmap->opaqueImage;
- } else {
- if (!d->pixmap->image.isNull() && d->pixmap->image.format() != QImage::Format_ARGB32_Premultiplied) {
-#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::PixmapLoad> perf;
-#endif
- d->pixmap->image = d->pixmap->image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
- }
- return d->pixmap->image;
- }
-#endif
+ return d->pixmap;
}
/*!
@@ -239,37 +184,33 @@ QFxPixmap::operator const QSimpleCanvasConfig::Image &() const
*/
QNetworkReply *QFxPixmap::get(QmlEngine *engine, const QUrl& url, QObject* obj, const char* slot)
{
- QString key = url.toString();
- QFxPixmapCache::Iterator iter = qfxPixmapCache.find(key);
- if (iter == qfxPixmapCache.end()) {
- QFxPixmapCacheItem *item = new QFxPixmapCacheItem;
- item->addRef(); // XXX - will never get deleted. Need to revisit caching
- item->key = key;
#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
- if (url.scheme()==QLatin1String("file")) {
- item->image.load(url.toLocalFile(), 0);
- } else
-#endif
- {
- QNetworkRequest req(url);
- req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache);
- item->reply = engine->networkAccessManager()->get(req);
- }
- iter = qfxPixmapCache.insert(item->key, item);
- } else {
- (*iter)->addRef();
+ if (url.scheme()==QLatin1String("file")) {
+ QObject dummy;
+ QObject::connect(&dummy, SIGNAL(destroyed()), obj, slot);
+ return 0;
}
- if ((*iter)->reply) {
- // still loading
- QObject::connect((*iter)->reply, SIGNAL(finished()), obj, slot);
- return (*iter)->reply;
- } else {
- // already loaded
+#endif
+
+ QString key = url.toString();
+ if (QPixmapCache::find(key,0)) {
QObject dummy;
QObject::connect(&dummy, SIGNAL(destroyed()), obj, slot);
+ return 0;
+ }
+
+ QFxSharedNetworkReplyHash::Iterator iter = qfxActiveNetworkReplies.find(key);
+ if (iter == qfxActiveNetworkReplies.end()) {
+ QNetworkRequest req(url);
+ req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache);
+ QSharedNetworkReply *item = new QSharedNetworkReply(engine->networkAccessManager()->get(req));
+ iter = qfxActiveNetworkReplies.insert(key, item);
+ } else {
+ (*iter)->addRef();
}
- return 0;
+ QObject::connect((*iter)->reply, SIGNAL(finished()), obj, slot);
+ return (*iter)->reply;
}
/*!
@@ -282,12 +223,11 @@ QNetworkReply *QFxPixmap::get(QmlEngine *engine, const QUrl& url, QObject* obj,
void QFxPixmap::cancelGet(const QUrl& url, QObject* obj)
{
QString key = url.toString();
- QFxPixmapCache::Iterator iter = qfxPixmapCache.find(key);
- if (iter == qfxPixmapCache.end())
+ QFxSharedNetworkReplyHash::Iterator iter = qfxActiveNetworkReplies.find(key);
+ if (iter == qfxActiveNetworkReplies.end())
return;
- if ((*iter)->reply)
- QObject::disconnect((*iter)->reply, 0, obj, 0);
- // XXX - loading not cancelled. Need to revisit caching
+ QObject::disconnect((*iter)->reply, 0, obj, 0);
+ (*iter)->release();
}
QT_END_NAMESPACE
diff --git a/src/declarative/fx/qfxpixmap.h b/src/declarative/fx/qfxpixmap.h
index fd56ee4..ae693c1 100644
--- a/src/declarative/fx/qfxpixmap.h
+++ b/src/declarative/fx/qfxpixmap.h
@@ -71,16 +71,10 @@ public:
bool isNull() const;
- bool opaque() const;
- void setOpaque(bool);
-
int width() const;
int height() const;
- QPixmap pixmap() const;
- void setPixmap(const QPixmap &pix);
-
- operator const QSimpleCanvasConfig::Image &() const;
+ operator const QPixmap &() const;
private:
QFxPixmapPrivate *d;
diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp
index 4271022..c156753 100644
--- a/src/declarative/fx/qfxrect.cpp
+++ b/src/declarative/fx/qfxrect.cpp
@@ -133,6 +133,12 @@ void QFxPen::setWidth(int w)
Sets a \e color at a \e position in a gradient.
*/
+void QFxGradientStop::updateGradient()
+{
+ if (QFxGradient *grad = qobject_cast<QFxGradient*>(parent()))
+ grad->doUpdate();
+}
+
/*!
\qmlclass Gradient QFxGradient
\brief The Gradient item defines a gradient fill.
@@ -171,6 +177,13 @@ const QGradient *QFxGradient::gradient() const
return m_gradient;
}
+void QFxGradient::doUpdate()
+{
+ delete m_gradient;
+ m_gradient = 0;
+ emit updated();
+}
+
QML_DEFINE_TYPE(QFxRect,Rect)
/*!
@@ -240,7 +253,7 @@ void QFxRect::doUpdate()
{
#if defined(QFX_RENDER_QPAINTER)
Q_D(QFxRect);
- d->_rectImage = QSimpleCanvasConfig::Image();
+ d->_rectImage = QPixmap();
#endif
#if defined(QFX_RENDER_OPENGL)
Q_D(QFxRect);
@@ -308,7 +321,14 @@ QFxGradient *QFxRect::gradient() const
void QFxRect::setGradient(QFxGradient *gradient)
{
Q_D(QFxRect);
+ if (d->gradient == gradient)
+ return;
+ if (d->gradient)
+ disconnect(d->gradient, SIGNAL(updated()), this, SLOT(doUpdate()));
d->gradient = gradient;
+ if (d->gradient)
+ connect(d->gradient, SIGNAL(updated()), this, SLOT(doUpdate()));
+ update();
}
@@ -339,7 +359,7 @@ void QFxRect::setRadius(qreal radius)
d->_radius = radius;
#if defined(QFX_RENDER_QPAINTER)
- d->_rectImage = QSimpleCanvasConfig::Image();
+ d->_rectImage = QPixmap();
#elif defined(QFX_RENDER_OPENGL)
d->_rectTexture.clear();
#endif
@@ -385,7 +405,7 @@ void QFxRect::setColor(const QColor &c)
d->_color = c;
#if defined(QFX_RENDER_QPAINTER)
- d->_rectImage = QSimpleCanvasConfig::Image();
+ d->_rectImage = QPixmap();
#endif
#if defined(QFX_RENDER_OPENGL)
d->_rectTexture.clear();
@@ -463,8 +483,8 @@ void QFxRect::generateRoundedRect()
Q_D(QFxRect);
if (d->_rectImage.isNull()) {
const int pw = d->_pen && d->_pen->isValid() ? d->_pen->width() : 0;
- d->_rectImage = QImage(d->_radius*2 + 3 + pw*2, d->_radius*2 + 3 + pw*2, QImage::Format_ARGB32_Premultiplied);
- d->_rectImage.fill(0);
+ d->_rectImage = QPixmap(d->_radius*2 + 3 + pw*2, d->_radius*2 + 3 + pw*2);
+ d->_rectImage.fill(Qt::transparent);
QPainter p(&(d->_rectImage));
p.setRenderHint(QPainter::Antialiasing);
if (d->_pen && d->_pen->isValid()) {
@@ -483,8 +503,8 @@ void QFxRect::generateBorderedRect()
Q_D(QFxRect);
if (d->_rectImage.isNull()) {
const int pw = d->_pen && d->_pen->isValid() ? d->_pen->width() : 0;
- d->_rectImage = QImage(d->pen()->width()*2 + 3 + pw*2, d->pen()->width()*2 + 3 + pw*2, QImage::Format_ARGB32_Premultiplied);
- d->_rectImage.fill(0);
+ d->_rectImage = QPixmap(d->pen()->width()*2 + 3 + pw*2, d->pen()->width()*2 + 3 + pw*2);
+ d->_rectImage.fill(Qt::transparent);
QPainter p(&(d->_rectImage));
p.setRenderHint(QPainter::Antialiasing);
if (d->_pen && d->_pen->isValid()) {
@@ -607,39 +627,39 @@ void QFxRect::drawRect(QPainter &p)
}
// Upper left
- p.drawImage(QRect(-pw/2, -pw/2, xOffset, yOffset), d->_rectImage, QRect(0, 0, xOffset, yOffset));
+ p.drawPixmap(QRect(-pw/2, -pw/2, xOffset, yOffset), d->_rectImage, QRect(0, 0, xOffset, yOffset));
// Upper middle
if (xMiddles)
- p.drawImage(QRect(xOffset-pw/2, -pw/2, width() - xSide + pw, yOffset), d->_rectImage,
+ p.drawPixmap(QRect(xOffset-pw/2, -pw/2, width() - xSide + pw, yOffset), d->_rectImage,
QRect(d->_rectImage.width()/2, 0, 1, yOffset));
// Upper right
- p.drawImage(QPoint(width()-xOffset+pw/2, -pw/2), d->_rectImage,
+ p.drawPixmap(QPoint(width()-xOffset+pw/2, -pw/2), d->_rectImage,
QRect(d->_rectImage.width()-xOffset, 0, xOffset, yOffset));
// Middle left
if (yMiddles)
- p.drawImage(QRect(-pw/2, yOffset-pw/2, xOffset, height() - ySide + pw), d->_rectImage,
+ p.drawPixmap(QRect(-pw/2, yOffset-pw/2, xOffset, height() - ySide + pw), d->_rectImage,
QRect(0, d->_rectImage.height()/2, xOffset, 1));
// Middle
if (xMiddles && yMiddles)
// XXX paint errors in animation example
//p.fillRect(xOffset-pw/2, yOffset-pw/2, width() - xSide + pw, height() - ySide + pw, d->getColor());
- p.drawImage(QRect(xOffset-pw/2, yOffset-pw/2, width() - xSide + pw, height() - ySide + pw), d->_rectImage,
+ p.drawPixmap(QRect(xOffset-pw/2, yOffset-pw/2, width() - xSide + pw, height() - ySide + pw), d->_rectImage,
QRect(d->_rectImage.width()/2, d->_rectImage.height()/2, 1, 1));
// Middle right
if (yMiddles)
- p.drawImage(QRect(width()-xOffset+pw/2, yOffset-pw/2, xOffset, height() - ySide + pw), d->_rectImage,
+ p.drawPixmap(QRect(width()-xOffset+pw/2, yOffset-pw/2, xOffset, height() - ySide + pw), d->_rectImage,
QRect(d->_rectImage.width()-xOffset, d->_rectImage.height()/2, xOffset, 1));
// Lower left
- p.drawImage(QPoint(-pw/2, height() - yOffset + pw/2), d->_rectImage, QRect(0, d->_rectImage.height() - yOffset, xOffset, yOffset));
+ p.drawPixmap(QPoint(-pw/2, height() - yOffset + pw/2), d->_rectImage, QRect(0, d->_rectImage.height() - yOffset, xOffset, yOffset));
// Lower Middle
if (xMiddles)
- p.drawImage(QRect(xOffset-pw/2, height() - yOffset +pw/2, width() - xSide + pw, yOffset), d->_rectImage,
+ p.drawPixmap(QRect(xOffset-pw/2, height() - yOffset +pw/2, width() - xSide + pw, yOffset), d->_rectImage,
QRect(d->_rectImage.width()/2, d->_rectImage.height() - yOffset, 1, yOffset));
// Lower Right
- p.drawImage(QPoint(width()-xOffset+pw/2, height() - yOffset+pw/2), d->_rectImage,
+ p.drawPixmap(QPoint(width()-xOffset+pw/2, height() - yOffset+pw/2), d->_rectImage,
QRect(d->_rectImage.width()-xOffset, d->_rectImage.height() - yOffset, xOffset, yOffset));
}
}
@@ -652,7 +672,7 @@ void QFxRect::paintGLContents(GLPainter &p)
{
Q_D(QFxRect);
if (d->_radius == 0 && (!d->_pen || !d->_pen->isValid())) {
- if (d->_gradcolor.isValid()) {
+ if (d->gradient) {
float widthV = width();
float heightV = height();
@@ -661,20 +681,16 @@ void QFxRect::paintGLContents(GLPainter &p)
0, 0,
widthV, 0 };
- float r = d->_color.redF();
- float g = d->_color.greenF();
- float b = d->_color.blueF();
- float a = d->_color.alphaF() * p.activeOpacity;
-
- float r2 = d->_gradcolor.redF();
- float g2 = d->_gradcolor.greenF();
- float b2 = d->_gradcolor.blueF();
- float a2 = d->_gradcolor.alphaF() * p.activeOpacity;
-
- GLfloat colors[] = { r2, g2, b2, a2,
- r2, g2, b2, a2,
- r, g, b, a,
- r, g, b, a };
+ int count = d->gradient->stops()->size();
+ GLfloat colors[count*8];
+ for (int i = 0; i < count; i += 8) {
+ QFxGradientStop *g = d->gradient->stops()->at(i);
+ QColor c = g->color();
+ colors[i] = c.redF(); colors[i+4] = colors[i];
+ colors[i+1] = c.greenF(); colors[i+5] = colors[i+1];
+ colors[i+2] = c.blueF(); colors[i+6] = colors[i+2];
+ colors[i+3] = c.alphaF() * p.activeOpacity; colors[i+7] = colors[i+3];
+ }
ColorShader *shader = basicShaders()->color();
shader->enable();
@@ -682,7 +698,7 @@ void QFxRect::paintGLContents(GLPainter &p)
shader->setAttributeArray(ColorShader::Vertices, vertices, 2);
shader->setAttributeArray(ColorShader::Colors, colors, 4);
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, count*2);
shader->disableAttributeArray(ColorShader::Vertices);
shader->disableAttributeArray(ColorShader::Colors);
} else {
diff --git a/src/declarative/fx/qfxrect.h b/src/declarative/fx/qfxrect.h
index 2c59914..c279a1c 100644
--- a/src/declarative/fx/qfxrect.h
+++ b/src/declarative/fx/qfxrect.h
@@ -90,10 +90,13 @@ public:
QFxGradientStop(QObject *parent=0) : QObject(parent) {}
qreal position() const { return m_position; }
- void setPosition(qreal position) { m_position = position; }
+ void setPosition(qreal position) { m_position = position; updateGradient(); }
QColor color() const { return m_color; }
- void setColor(const QColor &color) { m_color = color; }
+ void setColor(const QColor &color) { m_color = color; updateGradient(); }
+
+private:
+ void updateGradient();
private:
qreal m_position;
@@ -109,16 +112,23 @@ class Q_DECLARATIVE_EXPORT QFxGradient : public QObject
Q_CLASSINFO("DefaultProperty", "stops")
public:
- QFxGradient(QObject *parent=0) : QObject(parent), m_gradient(0), m_created(false) {}
+ QFxGradient(QObject *parent=0) : QObject(parent), m_gradient(0) {}
+ ~QFxGradient() { delete m_gradient; }
QList<QFxGradientStop *> *stops() { return &m_stops; }
const QGradient *gradient() const;
+Q_SIGNALS:
+ void updated();
+
+private:
+ void doUpdate();
+
private:
QList<QFxGradientStop *> m_stops;
mutable QGradient *m_gradient;
- mutable bool m_created;
+ friend class QFxGradientStop;
};
QML_DECLARE_TYPE(QFxGradient)
diff --git a/src/declarative/fx/qfxrect_p.h b/src/declarative/fx/qfxrect_p.h
index 8faaa38..8cafcbb 100644
--- a/src/declarative/fx/qfxrect_p.h
+++ b/src/declarative/fx/qfxrect_p.h
@@ -100,7 +100,7 @@ public:
QFxPen *_pen;
qreal _radius;
#if defined(QFX_RENDER_QPAINTER)
- QSimpleCanvasConfig::Image _rectImage;
+ QPixmap _rectImage;
#endif
};
diff --git a/src/declarative/fx/qfxscalegrid.h b/src/declarative/fx/qfxscalegrid.h
index 2a20de7..c59cb32 100644
--- a/src/declarative/fx/qfxscalegrid.h
+++ b/src/declarative/fx/qfxscalegrid.h
@@ -44,7 +44,6 @@
#include <QtCore/QString>
#include <QtCore/QObject>
-#include <QtGui/QImage>
#include <QtDeclarative/qfxglobal.h>
#include <QtDeclarative/qsimplecanvas.h>
#include <QtDeclarative/qfxpixmap.h>
diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp
index 94a1712..702ec81 100644
--- a/src/declarative/fx/qfxtext.cpp
+++ b/src/declarative/fx/qfxtext.cpp
@@ -525,42 +525,44 @@ QString QFxText::propertyInfo() const
void QFxTextPrivate::drawOutline()
{
- QImage img = QImage(imgCache.size(), QImage::Format_ARGB32_Premultiplied);
+ QPixmap img = QPixmap(imgCache.size());
+ img.fill(Qt::transparent);
+
QPainter ppm(&img);
- img.fill(qRgba(0, 0, 0, 0));
QPoint pos(imgCache.rect().topLeft());
pos += QPoint(-1, 0);
- ppm.drawImage(pos, imgStyleCache);
+ ppm.drawPixmap(pos, imgStyleCache);
pos += QPoint(2, 0);
- ppm.drawImage(pos, imgStyleCache);
+ ppm.drawPixmap(pos, imgStyleCache);
pos += QPoint(-1, -1);
- ppm.drawImage(pos, imgStyleCache);
+ ppm.drawPixmap(pos, imgStyleCache);
pos += QPoint(0, 2);
- ppm.drawImage(pos, imgStyleCache);
+ ppm.drawPixmap(pos, imgStyleCache);
pos += QPoint(0, -1);
- QPainter &p = ppm;
- p.drawImage(pos, imgCache);
+ ppm.drawPixmap(pos, imgCache);
+ ppm.end();
- imgCache = QSimpleCanvasConfig::toImage(img);
+ imgCache = img;
}
void QFxTextPrivate::drawOutline(int yOffset)
{
- QImage img = QImage(imgCache.size(), QImage::Format_ARGB32_Premultiplied);
+ QPixmap img = QPixmap(imgCache.size());
+ img.fill(Qt::transparent);
+
QPainter ppm(&img);
- img.fill(qRgba(0, 0, 0, 0));
QPoint pos(imgCache.rect().topLeft());
pos += QPoint(0, yOffset);
- ppm.drawImage(pos, imgStyleCache);
+ ppm.drawPixmap(pos, imgStyleCache);
pos += QPoint(0, -yOffset);
- QPainter &p = ppm;
- p.drawImage(pos, imgCache);
+ ppm.drawPixmap(pos, imgCache);
+ ppm.end();
- imgCache = QSimpleCanvasConfig::toImage(img);
+ imgCache = img;
}
QSize QFxTextPrivate::setupTextLayout(QTextLayout *layout)
@@ -600,7 +602,7 @@ QSize QFxTextPrivate::setupTextLayout(QTextLayout *layout)
return QSize((int)widthUsed, height);
}
-QImage QFxTextPrivate::wrappedTextImage(bool drawStyle)
+QPixmap QFxTextPrivate::wrappedTextImage(bool drawStyle)
{
//do layout
QFont f; if (_font) f = _font->font();
@@ -620,8 +622,8 @@ QImage QFxTextPrivate::wrappedTextImage(bool drawStyle)
}
//paint text
- QImage img(size, QImage::Format_ARGB32_Premultiplied);
- img.fill(0);
+ QPixmap img(size);
+ img.fill(Qt::transparent);
QPainter p(&img);
if (drawStyle) {
p.setPen(styleColor);
@@ -633,13 +635,13 @@ QImage QFxTextPrivate::wrappedTextImage(bool drawStyle)
return img;
}
-QImage QFxTextPrivate::richTextImage(bool drawStyle)
+QPixmap QFxTextPrivate::richTextImage(bool drawStyle)
{
QSize size = doc->size().toSize();
//paint text
- QImage img(size, QImage::Format_ARGB32_Premultiplied);
- img.fill(0);
+ QPixmap img(size);
+ img.fill(Qt::transparent);
QPainter p(&img);
if (drawStyle) {
@@ -667,14 +669,14 @@ void QFxTextPrivate::checkImgCache()
bool empty = text.isEmpty();
if (empty) {
- imgCache = QSimpleCanvasConfig::Image();
- imgStyleCache = QImage();
+ imgCache = QPixmap();
+ imgStyleCache = QPixmap();
} else if (richText) {
- imgCache = QSimpleCanvasConfig::toImage(richTextImage(false));
+ imgCache = richTextImage(false);
if (style != QFxText::Normal)
imgStyleCache = richTextImage(true); //### should use styleColor
} else {
- imgCache = QSimpleCanvasConfig::toImage(wrappedTextImage(false));
+ imgCache = wrappedTextImage(false);
if (style != QFxText::Normal)
imgStyleCache = wrappedTextImage(true); //### should use styleColor
}
@@ -694,7 +696,7 @@ void QFxTextPrivate::checkImgCache()
}
#if defined(QFX_RENDER_OPENGL)
- tex.setImage(imgCache);
+ tex.setImage(imgCache.toImage());
#endif
imgDirty = false;
@@ -745,7 +747,7 @@ void QFxText::paintContents(QPainter &p)
p.save();
p.setClipRect(boundingRect());
}
- p.drawImage(x, y, d->imgCache);
+ p.drawPixmap(x, y, d->imgCache);
if (needClip)
p.restore();
}
diff --git a/src/declarative/fx/qfxtext_p.h b/src/declarative/fx/qfxtext_p.h
index 8bb3142..dfaef63 100644
--- a/src/declarative/fx/qfxtext_p.h
+++ b/src/declarative/fx/qfxtext_p.h
@@ -94,8 +94,8 @@ public:
void drawOutline();
void drawOutline(int yOffset);
- QImage wrappedTextImage(bool drawStyle);
- QImage richTextImage(bool drawStyle);
+ QPixmap wrappedTextImage(bool drawStyle);
+ QPixmap richTextImage(bool drawStyle);
QSize setupTextLayout(QTextLayout *layout);
QString text;
@@ -118,8 +118,8 @@ public:
#if defined(QFX_RENDER_OPENGL)
GLTexture tex;
#endif
- QSimpleCanvasConfig::Image imgCache;
- QImage imgStyleCache;
+ QPixmap imgCache;
+ QPixmap imgStyleCache;
QFxText::HAlignment hAlign;
QFxText::VAlignment vAlign;
Qt::TextElideMode elideMode;
diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp
index fc73ecd..c7a7700 100644
--- a/src/declarative/fx/qfxtextedit.cpp
+++ b/src/declarative/fx/qfxtextedit.cpp
@@ -49,6 +49,7 @@
#endif
#include <qfxperf.h>
+#include "qfxevents_p.h"
#include <QTextLayout>
#include <QTextLine>
#include <QTextDocument>
@@ -158,6 +159,8 @@ QString QFxTextEdit::text() const
void QFxTextEdit::setText(const QString &text)
{
Q_D(QFxTextEdit);
+ if (QFxTextEdit::text() == text)
+ return;
d->text = text;
d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(text));
if (d->richText) {
@@ -472,6 +475,21 @@ void QFxTextEdit::setPreserveSelection(bool on)
d->preserveSelection = on;
}
+qreal QFxTextEdit::textMargin() const
+{
+ Q_D(const QFxTextEdit);
+ return d->textMargin;
+}
+
+void QFxTextEdit::setTextMargin(qreal margin)
+{
+ Q_D(QFxTextEdit);
+ if (d->textMargin == margin)
+ return;
+ d->textMargin = margin;
+ d->document->setDocumentMargin(d->textMargin);
+}
+
void QFxTextEdit::geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry)
{
@@ -657,6 +675,13 @@ Handles the given key \a event.
void QFxTextEdit::keyPressEvent(QKeyEvent *event)
{
Q_D(QFxTextEdit);
+ //### experiment with allowing 'overrides' to key events
+ QFxKeyEvent ke(*event);
+ emit keyPress(&ke);
+ event->setAccepted(ke.isAccepted());
+ if (event->isAccepted())
+ return;
+
QTextCursor c = textCursor();
QTextCursor::MoveOperation op = QTextCursor::NoMove;
if (event == QKeySequence::MoveToNextChar) {
@@ -686,6 +711,13 @@ Handles the given key \a event.
void QFxTextEdit::keyReleaseEvent(QKeyEvent *event)
{
Q_D(QFxTextEdit);
+ //### experiment with allowing 'overrides' to key events
+ QFxKeyEvent ke(*event);
+ emit keyRelease(&ke);
+ event->setAccepted(ke.isAccepted());
+ if (event->isAccepted())
+ return;
+
d->control->processEvent(event, QPointF(0, 0));
}
@@ -819,7 +851,7 @@ void QFxTextEditPrivate::init()
document = control->document();
document->setDefaultFont(font.font());
- document->setDocumentMargin(0);
+ document->setDocumentMargin(textMargin);
document->setUndoRedoEnabled(false); // flush undo buffer.
document->setUndoRedoEnabled(true);
updateDefaultTextOption();
@@ -849,7 +881,7 @@ void QFxTextEdit::updateSize()
else if (d->vAlign == AlignVCenter)
yoff = dy/2;
}
- setBaselineOffset(fm.ascent() + yoff);
+ setBaselineOffset(fm.ascent() + yoff + d->textMargin);
if (!widthValid()) {
int newWidth = (int)d->document->idealWidth();
d->document->setTextWidth(newWidth); // ### QTextDoc> Alignment will not work unless textWidth is set
diff --git a/src/declarative/fx/qfxtextedit.h b/src/declarative/fx/qfxtextedit.h
index 37bc327..e30b9ed 100644
--- a/src/declarative/fx/qfxtextedit.h
+++ b/src/declarative/fx/qfxtextedit.h
@@ -79,7 +79,7 @@ class Q_DECLARATIVE_EXPORT QFxTextEdit : public QFxPaintedItem
Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible)
Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress)
Q_PROPERTY(bool preserveSelection READ preserveSelection WRITE setPreserveSelection)
- Q_CLASSINFO("DefaultProperty", "text")
+ Q_PROPERTY(qreal textMargin READ textMargin WRITE setTextMargin)
public:
QFxTextEdit(QFxItem *parent=0);
@@ -135,6 +135,9 @@ public:
bool preserveSelection() const;
void setPreserveSelection(bool on);
+ qreal textMargin() const;
+ void setTextMargin(qreal margin);
+
virtual void dump(int depth);
virtual QString propertyInfo() const;
diff --git a/src/declarative/fx/qfxtextedit_p.h b/src/declarative/fx/qfxtextedit_p.h
index 78b0018..f733a4c 100644
--- a/src/declarative/fx/qfxtextedit_p.h
+++ b/src/declarative/fx/qfxtextedit_p.h
@@ -70,7 +70,7 @@ public:
QFxTextEditPrivate()
: font(0), color("black"), imgDirty(true), hAlign(QFxTextEdit::AlignLeft), vAlign(QFxTextEdit::AlignTop),
dirty(false), wrap(false), richText(false), cursorVisible(false), focusOnPress(false), preserveSelection(true),
- format(QFxTextEdit::AutoText), document(0)
+ textMargin(0.0), format(QFxTextEdit::AutoText), document(0)
{
}
@@ -89,8 +89,8 @@ public:
#if defined(QFX_RENDER_OPENGL)
GLTexture texture;
#endif
- QSimpleCanvasConfig::Image imgCache;
- QImage imgStyleCache;
+ QPixmap imgCache;
+ QPixmap imgStyleCache;
QFxTextEdit::HAlignment hAlign;
QFxTextEdit::VAlignment vAlign;
bool dirty;
@@ -99,6 +99,7 @@ public:
bool cursorVisible;
bool focusOnPress;
bool preserveSelection;
+ qreal textMargin;
QFxTextEdit::TextFormat format;
QTextDocument *document;
QTextControl *control;
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp
index 4c35cae..bfccd34 100644
--- a/src/declarative/fx/qfxwebview.cpp
+++ b/src/declarative/fx/qfxwebview.cpp
@@ -161,7 +161,7 @@ public:
int age;
QRect area;
#if defined(QFX_RENDER_QPAINTER)
- QSimpleCanvasConfig::Image image;
+ QPixmap image;
#else
GLTexture image;
#endif
diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp
index 38436b4..0ebbbfb 100644
--- a/src/declarative/qml/qmldom.cpp
+++ b/src/declarative/qml/qmldom.cpp
@@ -1415,6 +1415,30 @@ void QmlDomList::setValues(const QList<QmlDomValue> &values)
qWarning("QmlDomList::setValues(const QList<QmlDomValue> &): Not implemented");
}
+/*!
+ Returns the position in the input data where the list started, or 0 if
+ the property is invalid.
+*/
+int QmlDomList::position() const
+{
+ if (d && d->property) {
+ return d->property->listValueRange.offset;
+ } else
+ return 0;
+}
+
+/*!
+ Returns the length in the input data from where the list started upto
+ the end of it, or 0 if the property is invalid.
+*/
+int QmlDomList::length() const
+{
+ if (d && d->property)
+ return d->property->listValueRange.length;
+ else
+ return 0;
+}
+
/*!
\class QmlDomComponent
diff --git a/src/declarative/qml/qmldom.h b/src/declarative/qml/qmldom.h
index 04ce8b9..86eaecb 100644
--- a/src/declarative/qml/qmldom.h
+++ b/src/declarative/qml/qmldom.h
@@ -262,6 +262,9 @@ public:
QList<QmlDomValue> values() const;
void setValues(const QList<QmlDomValue> &);
+ int position() const;
+ int length() const;
+
private:
friend class QmlDomValue;
QSharedDataPointer<QmlDomValuePrivate> d;
diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h
index 020cae5..0fdd26b 100644
--- a/src/declarative/qml/qmlparser_p.h
+++ b/src/declarative/qml/qmlparser_p.h
@@ -276,6 +276,7 @@ namespace QmlParser
bool isDefault;
LocationSpan location;
+ LocationRange listValueRange;
void dump(int = 0) const;
};
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index 75c81a7..31a20be 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -651,6 +651,11 @@ bool ProcessAST::visit(AST::UiArrayBinding *node)
accept(node->members);
+ // For the DOM, store the position of the T_LBRACKET upto the T_RBRACKET as the range:
+ Property* prop = currentProperty();
+ prop->listValueRange.offset = node->lbracketToken.offset;
+ prop->listValueRange.length = node->rbracketToken.offset + node->rbracketToken.length - node->lbracketToken.offset;
+
while (propertyCount--)
_stateStack.pop();
diff --git a/src/declarative/test/qfxtestobjects.cpp b/src/declarative/test/qfxtestobjects.cpp
index 5beefd9..12fc7fb 100644
--- a/src/declarative/test/qfxtestobjects.cpp
+++ b/src/declarative/test/qfxtestobjects.cpp
@@ -47,18 +47,18 @@
QT_BEGIN_NAMESPACE
-QML_DECLARE_TYPE(TestObject);
-QML_DEFINE_TYPE(TestObject,TestObject);
-QML_DECLARE_TYPE(TestFrame);
-QML_DEFINE_TYPE(TestFrame,TestFrame);
-QML_DECLARE_TYPE(TestFullFrame);
-QML_DEFINE_TYPE(TestFullFrame,TestFullFrame);
-QML_DECLARE_TYPE(TestMouse);
-QML_DEFINE_TYPE(TestMouse,TestMouse);
-QML_DECLARE_TYPE(TestKey);
-QML_DEFINE_TYPE(TestKey,TestKey);
-QML_DECLARE_TYPE(TestLog);
-QML_DEFINE_TYPE(TestLog,TestLog);
+QML_DECLARE_TYPE(TestObject)
+QML_DEFINE_TYPE(TestObject,TestObject)
+QML_DECLARE_TYPE(TestFrame)
+QML_DEFINE_TYPE(TestFrame,TestFrame)
+QML_DECLARE_TYPE(TestFullFrame)
+QML_DEFINE_TYPE(TestFullFrame,TestFullFrame)
+QML_DECLARE_TYPE(TestMouse)
+QML_DEFINE_TYPE(TestMouse,TestMouse)
+QML_DECLARE_TYPE(TestKey)
+QML_DEFINE_TYPE(TestKey,TestKey)
+QML_DECLARE_TYPE(TestLog)
+QML_DEFINE_TYPE(TestLog,TestLog)
static QString padding(int pad)
{
diff --git a/src/declarative/test/qfxtestobjects.h b/src/declarative/test/qfxtestobjects.h
index de4d94b..80fcfe7 100644
--- a/src/declarative/test/qfxtestobjects.h
+++ b/src/declarative/test/qfxtestobjects.h
@@ -60,7 +60,7 @@ Q_OBJECT
public:
TestObject(QObject * = 0);
- Q_PROPERTY(int time READ time WRITE setTime NOTIFY dataChanged);
+ Q_PROPERTY(int time READ time WRITE setTime NOTIFY dataChanged)
int time() const;
void setTime(int);
@@ -78,7 +78,7 @@ Q_OBJECT
public:
TestFrame(QObject * = 0);
- Q_PROPERTY(QString hash READ hash WRITE setHash NOTIFY frameChanged);
+ Q_PROPERTY(QString hash READ hash WRITE setHash NOTIFY frameChanged)
QString hash() const;
void setHash(const QString &);
@@ -96,7 +96,7 @@ Q_OBJECT
public:
TestFullFrame(QObject * = 0);
- Q_PROPERTY(int frameId READ frameId WRITE setFrameId NOTIFY frameChanged);
+ Q_PROPERTY(int frameId READ frameId WRITE setFrameId NOTIFY frameChanged)
int frameId() const;
void setFrameId(int);
@@ -114,23 +114,23 @@ Q_OBJECT
public:
TestMouse(QObject * = 0);
- Q_PROPERTY(int type READ type WRITE setType NOTIFY mouseChanged);
+ Q_PROPERTY(int type READ type WRITE setType NOTIFY mouseChanged)
int type() const;
void setType(int);
- Q_PROPERTY(int button READ button WRITE setButton NOTIFY mouseChanged);
+ Q_PROPERTY(int button READ button WRITE setButton NOTIFY mouseChanged)
int button() const;
void setButton(int);
- Q_PROPERTY(int buttons READ buttons WRITE setButtons NOTIFY mouseChanged);
+ Q_PROPERTY(int buttons READ buttons WRITE setButtons NOTIFY mouseChanged)
int buttons() const;
void setButtons(int);
- Q_PROPERTY(QPoint globalPos READ globalPos WRITE setGlobalPos NOTIFY mouseChanged);
+ Q_PROPERTY(QPoint globalPos READ globalPos WRITE setGlobalPos NOTIFY mouseChanged)
QPoint globalPos() const;
void setGlobalPos(const QPoint &);
- Q_PROPERTY(QPoint pos READ pos WRITE setPos NOTIFY mouseChanged);
+ Q_PROPERTY(QPoint pos READ pos WRITE setPos NOTIFY mouseChanged)
QPoint pos() const;
void setPos(const QPoint &);
@@ -153,19 +153,19 @@ Q_OBJECT
public:
TestKey(QObject * = 0);
- Q_PROPERTY(int type READ type WRITE setType NOTIFY keyChanged);
+ Q_PROPERTY(int type READ type WRITE setType NOTIFY keyChanged)
int type() const;
void setType(int);
- Q_PROPERTY(int modifiers READ modifiers WRITE setModifiers NOTIFY keyChanged);
+ Q_PROPERTY(int modifiers READ modifiers WRITE setModifiers NOTIFY keyChanged)
int modifiers() const;
void setModifiers(int);
- Q_PROPERTY(QString text READ text WRITE setText NOTIFY keyChanged);
+ Q_PROPERTY(QString text READ text WRITE setText NOTIFY keyChanged)
QString text() const;
void setText(const QString &);
- Q_PROPERTY(int key READ key WRITE setKey NOTIFY keyChanged);
+ Q_PROPERTY(int key READ key WRITE setKey NOTIFY keyChanged)
int key() const;
void setKey(int);
@@ -187,8 +187,8 @@ Q_OBJECT
public:
TestLog(QObject * = 0);
- Q_CLASSINFO("DefaultProperty", "actions");
- Q_PROPERTY(QList<TestObject *> *actions READ qmlActions);
+ Q_CLASSINFO("DefaultProperty", "actions")
+ Q_PROPERTY(QList<TestObject *> *actions READ qmlActions)
QList<TestObject *> *qmlActions();
QList<TestObject *> &actions();
diff --git a/src/declarative/util/qperformancelog.h b/src/declarative/util/qperformancelog.h
index 9d19bbd..6bb9037 100644
--- a/src/declarative/util/qperformancelog.h
+++ b/src/declarative/util/qperformancelog.h
@@ -64,7 +64,7 @@ namespace QPerformanceLog
void displayData(LogData *);
void clear(LogData *);
#endif
-};
+}
#ifdef Q_ENABLE_PERFORMANCE_LOG
diff --git a/src/gui/accessible/qaccessiblewidget.cpp b/src/gui/accessible/qaccessiblewidget.cpp
index 753ac57..1c2fcef 100644
--- a/src/gui/accessible/qaccessiblewidget.cpp
+++ b/src/gui/accessible/qaccessiblewidget.cpp
@@ -102,24 +102,7 @@ static QString buddyString(const QWidget *widget)
QString Q_GUI_EXPORT qt_accStripAmp(const QString &text)
{
- if (text.isEmpty())
- return text;
-
- const QChar *ch = text.unicode();
- int length = text.length();
- QString str;
- while (length > 0) {
- if (*ch == QLatin1Char('&')) {
- ++ch;
- --length;
- if (!ch)
- --ch;
- }
- str += *ch;
- ++ch;
- --length;
- }
- return str;
+ return QString(text).remove(QLatin1Char('&'));
}
QString Q_GUI_EXPORT qt_accHotKey(const QString &text)
diff --git a/src/gui/animation/qguivariantanimation.cpp b/src/gui/animation/qguivariantanimation.cpp
index ed18caa..37ca6a1 100644
--- a/src/gui/animation/qguivariantanimation.cpp
+++ b/src/gui/animation/qguivariantanimation.cpp
@@ -41,13 +41,8 @@
#ifndef QT_NO_ANIMATION
-#ifdef QT_EXPERIMENTAL_SOLUTION
-# include "qvariantanimation.h"
-# include "qvariantanimation_p.h"
-#else
#include <QtCore/qvariantanimation.h>
#include <private/qvariantanimation_p.h>
-#endif
#include <QtGui/qcolor.h>
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index 903cd74..56b89f0 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -776,6 +776,7 @@ void QFileDialog::selectFile(const QString &filename)
}
QModelIndex index = d->model->index(filename);
+ QString file;
if (!index.isValid()) {
// save as dialog where we want to input a default value
QString text = filename;
@@ -790,13 +791,13 @@ void QFileDialog::selectFile(const QString &filename)
)
text = text.remove(0,1);
}
- if (!isVisible() || !d->lineEdit()->hasFocus())
- d->lineEdit()->setText(text);
+ file = text;
} else {
- d->qFileDialogUi->listView->selectionModel()->clear();
- if (!isVisible() || !d->lineEdit()->hasFocus())
- d->lineEdit()->setText(index.data().toString());
+ file = index.data().toString();
}
+ d->qFileDialogUi->listView->selectionModel()->clear();
+ if (!isVisible() || !d->lineEdit()->hasFocus())
+ d->lineEdit()->setText(file);
}
/**
@@ -837,8 +838,8 @@ QStringList QFileDialogPrivate::addDefaultSuffixToFiles(const QStringList filesT
// This check is needed since we might be at the root directory
// and on Windows it already ends with slash.
QString path = rootPath();
- if (!path.endsWith(QLatin1String("/")))
- path += QLatin1String("/");
+ if (!path.endsWith(QLatin1Char('/')))
+ path += QLatin1Char('/');
path += name;
files.append(path);
}
@@ -2649,7 +2650,7 @@ void QFileDialogPrivate::_q_deleteCurrent()
void QFileDialogPrivate::_q_autoCompleteFileName(const QString &text)
{
- if (text.startsWith(QLatin1String("//")) || text.startsWith(QLatin1String("\\"))) {
+ if (text.startsWith(QLatin1String("//")) || text.startsWith(QLatin1Char('\\'))) {
qFileDialogUi->listView->selectionModel()->clearSelection();
return;
}
@@ -2691,7 +2692,7 @@ void QFileDialogPrivate::_q_updateOkButton()
QStringList files = q->selectedFiles();
QString lineEditText = lineEdit()->text();
- if (lineEditText.startsWith(QLatin1String("//")) || lineEditText.startsWith(QLatin1String("\\"))) {
+ if (lineEditText.startsWith(QLatin1String("//")) || lineEditText.startsWith(QLatin1Char('\\'))) {
button->setEnabled(true);
if (acceptMode == QFileDialog::AcceptSave)
button->setText(isOpenDirectory ? QFileDialog::tr("&Open") : acceptLabel);
@@ -3197,7 +3198,7 @@ QStringList QFSCompletor::splitPath(const QString &path) const
doubleSlash.clear();
#endif
- QRegExp re(QLatin1String("[") + QRegExp::escape(sep) + QLatin1String("]"));
+ QRegExp re(QLatin1Char('[') + QRegExp::escape(sep) + QLatin1Char(']'));
#ifdef Q_OS_WIN
QStringList parts = pathCopy.split(re, QString::SkipEmptyParts);
diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp
index 6962674..75a1820 100644
--- a/src/gui/dialogs/qfiledialog_win.cpp
+++ b/src/gui/dialogs/qfiledialog_win.cpp
@@ -214,10 +214,10 @@ static OPENFILENAMEA *qt_win_make_OFNA(QWidget *parent,
aInitSel = "";
} else {
aInitSel = QDir::toNativeSeparators(initialSelection).toLocal8Bit();
- aInitSel.replace("<", "");
- aInitSel.replace(">", "");
- aInitSel.replace("\"", "");
- aInitSel.replace("|", "");
+ aInitSel.replace('<', "");
+ aInitSel.replace('>', "");
+ aInitSel.replace('\"', "");
+ aInitSel.replace('|', "");
}
int maxLen = mode == QFileDialog::ExistingFiles ? maxMultiLen : maxNameLen;
aInitSel.resize(maxLen + 1); // make room for return value
@@ -286,10 +286,10 @@ static OPENFILENAME* qt_win_make_OFN(QWidget *parent,
tTitle = title;
QString initSel = QDir::toNativeSeparators(initialSelection);
if (!initSel.isEmpty()) {
- initSel.replace(QLatin1String("<"), QLatin1String(""));
- initSel.replace(QLatin1String(">"), QLatin1String(""));
- initSel.replace(QLatin1String("\""), QLatin1String(""));
- initSel.replace(QLatin1String("|"), QLatin1String(""));
+ initSel.remove(QLatin1Char('<'));
+ initSel.remove(QLatin1Char('>'));
+ initSel.remove(QLatin1Char('\"'));
+ initSel.remove(QLatin1Char('|'));
}
int maxLen = mode == QFileDialog::ExistingFiles ? maxMultiLen : maxNameLen;
@@ -811,7 +811,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args)
QDir::setCurrent(currentDir);
if (!result.isEmpty())
- result.replace(QLatin1String("\\"), QLatin1String("/"));
+ result.replace(QLatin1Char('\\'), QLatin1Char('/'));
return result;
}
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp
index 012d3a1..825f8b6 100644
--- a/src/gui/dialogs/qfilesystemmodel.cpp
+++ b/src/gui/dialogs/qfilesystemmodel.cpp
@@ -337,7 +337,7 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS
{
Q_Q(const QFileSystemModel);
Q_UNUSED(q);
- if (path.isEmpty() || path == myComputer() || path.startsWith(QLatin1String(":")))
+ if (path.isEmpty() || path == myComputer() || path.startsWith(QLatin1Char(':')))
return const_cast<QFileSystemModelPrivate::QFileSystemNode*>(&root);
// Construct the nodes up to the new root path if they need to be built
diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp
index d8a2c7c..c7484e7 100644
--- a/src/gui/dialogs/qfontdialog.cpp
+++ b/src/gui/dialogs/qfontdialog.cpp
@@ -337,6 +337,14 @@ void QFontDialogPrivate::init()
QFontDialog::~QFontDialog()
{
+#ifdef Q_WS_MAC
+ Q_D(QFontDialog);
+ if (d->delegate) {
+ QFontDialogPrivate::closeCocoaFontPanel(d->delegate);
+ QFontDialogPrivate::sharedFontPanelAvailable = true;
+ return;
+ }
+#endif
}
/*!
diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm
index 50917a1..3be53db 100644
--- a/src/gui/dialogs/qfontdialog_mac.mm
+++ b/src/gui/dialogs/qfontdialog_mac.mm
@@ -47,6 +47,7 @@
#include <private/qapplication_p.h>
#include <private/qfont_p.h>
#include <private/qfontengine_p.h>
+#include <private/qt_cocoa_helpers_mac_p.h>
#include <private/qt_mac_p.h>
#include <qdebug.h>
#import <AppKit/AppKit.h>
@@ -123,16 +124,16 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
QFont newFont;
if (cocoaFont) {
int pSize = qRound([cocoaFont pointSize]);
- QString family(QCFString::toQString(reinterpret_cast<CFStringRef>([cocoaFont familyName])));
- QString typeface(QCFString::toQString(reinterpret_cast<CFStringRef>([cocoaFont fontName])));
-// qDebug() << "original family" << family << "typeface" << typeface << "psize" << pSize;
+ QString family(qt_mac_NSStringToQString([cocoaFont familyName]));
+ QString typeface(qt_mac_NSStringToQString([cocoaFont fontName]));
+
int hyphenPos = typeface.indexOf(QLatin1Char('-'));
if (hyphenPos != -1) {
typeface.remove(0, hyphenPos + 1);
} else {
typeface = QLatin1String("Normal");
}
-// qDebug() << " massaged family" << family << "typeface" << typeface << "psize" << pSize;
+
newFont = QFontDatabase().font(family, typeface, pSize);
newFont.setUnderline(resolveFont.underline());
newFont.setStrikeOut(resolveFont.strikeOut());
@@ -566,6 +567,7 @@ void *QFontDialogPrivate::openCocoaFontPanel(const QFont &initial,
void QFontDialogPrivate::closeCocoaFontPanel(void *delegate)
{
+ QMacCocoaAutoReleasePool pool;
QCocoaFontPanelDelegate *theDelegate = static_cast<QCocoaFontPanelDelegate *>(delegate);
NSWindow *ourPanel = [theDelegate actualPanel];
[ourPanel close];
@@ -597,15 +599,37 @@ QFont QFontDialogPrivate::execCocoaFontPanel(bool *ok, const QFont &initial,
}
}
-void QFontDialogPrivate::setFont(void * delegate, const QFont &font)
+void QFontDialogPrivate::setFont(void *delegate, const QFont &font)
{
+ QMacCocoaAutoReleasePool pool;
QFontEngine *fe = font.d->engineForScript(QUnicodeTables::Common);
+ NSFontManager *mgr = [NSFontManager sharedFontManager];
+ NSFont *nsFont = 0;
+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if (qstrcmp(fe->name(), "CoreText") == 0) {
- const NSFont *nsFont = reinterpret_cast<const NSFont *>(static_cast<QCoreTextFontEngineMulti *>(fe)->ctfont);
- [[NSFontManager sharedFontManager] setSelectedFont:nsFont isMultiple:NO];
- }
+ nsFont = reinterpret_cast<const NSFont *>(static_cast<QCoreTextFontEngineMulti *>(fe)->ctfont);
+ } else
#endif
+ {
+ int weight = 5;
+ NSFontTraitMask mask = 0;
+ if (font.style() == QFont::StyleItalic) {
+ mask |= NSItalicFontMask;
+ }
+ if (font.weight() == QFont::Bold) {
+ weight = 9;
+ mask |= NSBoldFontMask;
+ }
+
+ NSFontManager *mgr = [NSFontManager sharedFontManager];
+ nsFont = [mgr fontWithFamily:qt_mac_QStringToNSString(font.family())
+ traits:mask
+ weight:weight
+ size:font.pointSize()];
+ }
+
+ [mgr setSelectedFont:nsFont isMultiple:NO];
[static_cast<QCocoaFontPanelDelegate *>(delegate) setQtFont:font];
}
diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp
index 78d99e3..8608334 100644
--- a/src/gui/dialogs/qinputdialog.cpp
+++ b/src/gui/dialogs/qinputdialog.cpp
@@ -307,8 +307,7 @@ void QInputDialogPrivate::ensureEnabledConnection(QAbstractSpinBox *spinBox)
{
if (spinBox) {
QAbstractButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
- QObject::disconnect(spinBox, SIGNAL(textChanged(bool)), okButton, SLOT(setEnabled(bool)));
- QObject::connect(spinBox, SIGNAL(textChanged(bool)), okButton, SLOT(setEnabled(bool)));
+ QObject::connect(spinBox, SIGNAL(textChanged(bool)), okButton, SLOT(setEnabled(bool)), Qt::UniqueConnection);
}
}
diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp
index 533c538..1734e85 100644
--- a/src/gui/dialogs/qmessagebox.cpp
+++ b/src/gui/dialogs/qmessagebox.cpp
@@ -1310,7 +1310,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
if (e == QKeySequence::Copy) {
QString separator = QString::fromLatin1("---------------------------\n");
QString textToCopy = separator;
- separator.prepend(QLatin1String("\n"));
+ separator.prepend(QLatin1Char('\n'));
textToCopy += windowTitle() + separator; // title
textToCopy += d->label->text() + separator; // text
@@ -1684,10 +1684,13 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
}
#endif
- QString translatedTextAboutQt;
- translatedTextAboutQt = QMessageBox::tr(
+ QString translatedTextAboutQtCaption;
+ translatedTextAboutQtCaption = QMessageBox::tr(
"<h3>About Qt</h3>"
"<p>This program uses Qt version %1.</p>"
+ ).arg(QLatin1String(QT_VERSION_STR));
+ QString translatedTextAboutQtText;
+ translatedTextAboutQtText = QMessageBox::tr(
"<p>Qt is a C++ toolkit for cross-platform application "
"development.</p>"
"<p>Qt provides single-source portability across MS&nbsp;Windows, "
@@ -1715,12 +1718,12 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
"<p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p>"
"<p>Qt is a Nokia product. See <a href=\"http://www.qtsoftware.com/qt/\">www.qtsoftware.com/qt</a> "
"for more information.</p>"
- ).arg(QLatin1String(QT_VERSION_STR));
-
+ );
QMessageBox *msgBox = new QMessageBox(parent);
msgBox->setAttribute(Qt::WA_DeleteOnClose);
msgBox->setWindowTitle(title.isEmpty() ? tr("About Qt") : title);
- msgBox->setText(translatedTextAboutQt);
+ msgBox->setText(translatedTextAboutQtCaption);
+ msgBox->setInformativeText(translatedTextAboutQtText);
QPixmap pm(QLatin1String(":/trolltech/qmessagebox/images/qtlogo-64.png"));
if (!pm.isNull())
diff --git a/src/gui/dialogs/qmessagebox.h b/src/gui/dialogs/qmessagebox.h
index 8d9b9fa..c6fb3bc 100644
--- a/src/gui/dialogs/qmessagebox.h
+++ b/src/gui/dialogs/qmessagebox.h
@@ -191,6 +191,8 @@ public:
static StandardButton information(QWidget *parent, const QString &title,
const QString &text, StandardButtons buttons = Ok,
StandardButton defaultButton = NoButton);
+ // ### Qt 5: Replace Ok with Yes|No in question() function.
+ // Also consider if Ok == Yes and Cancel == No.
static StandardButton question(QWidget *parent, const QString &title,
const QString &text, StandardButtons buttons = Ok,
StandardButton defaultButton = NoButton);
diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp
index 87a4e65..8456d13 100644
--- a/src/gui/dialogs/qprintdialog_unix.cpp
+++ b/src/gui/dialogs/qprintdialog_unix.cpp
@@ -669,7 +669,7 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p)
for (int i = 0; i < cupsPrinterCount; ++i) {
QString printerName(QString::fromLocal8Bit(cupsPrinters[i].name));
if (cupsPrinters[i].instance)
- printerName += QLatin1String("/") + QString::fromLocal8Bit(cupsPrinters[i].instance);
+ printerName += QLatin1Char('/') + QString::fromLocal8Bit(cupsPrinters[i].instance);
widget.printers->addItem(printerName);
if (cupsPrinters[i].is_default)
@@ -813,7 +813,7 @@ void QUnixPrintWidgetPrivate::_q_printerChanged(int index)
optionsPane->selectPrinter(0);
#endif
if (lprPrinters.count() > 0) {
- QString type = lprPrinters.at(index).name + QLatin1String("@") + lprPrinters.at(index).host;
+ QString type = lprPrinters.at(index).name + QLatin1Char('@') + lprPrinters.at(index).host;
if (!lprPrinters.at(index).comment.isEmpty())
type += QLatin1String(", ") + lprPrinters.at(index).comment;
widget.type->setText(type);
@@ -1194,9 +1194,9 @@ QVariant QPPDOptionsModel::headerData(int section, Qt::Orientation, int role) co
switch(section){
case 0:
- return QVariant(QApplication::translate("QPPDOptionsModel","Name"));
+ return QVariant(QApplication::translate("QPPDOptionsModel", "Name"));
case 1:
- return QVariant(QApplication::translate("QPPDOptionsModel","Value"));
+ return QVariant(QApplication::translate("QPPDOptionsModel", "Value"));
default:
return QVariant();
}
diff --git a/src/gui/dialogs/qprintpreviewdialog.cpp b/src/gui/dialogs/qprintpreviewdialog.cpp
index 3580fdc..a696160 100644
--- a/src/gui/dialogs/qprintpreviewdialog.cpp
+++ b/src/gui/dialogs/qprintpreviewdialog.cpp
@@ -460,7 +460,7 @@ void QPrintPreviewDialogPrivate::updatePageNumLabel()
int numPages = preview->numPages();
int maxChars = QString::number(numPages).length();
- pageNumLabel->setText(QString(QLatin1String("/ %1")).arg(numPages));
+ pageNumLabel->setText(QString::fromLatin1("/ %1").arg(numPages));
int cyphersWidth = q->fontMetrics().width(QString().fill(QLatin1Char('8'), maxChars));
int maxWidth = pageNumEdit->minimumSizeHint().width() + cyphersWidth;
pageNumEdit->setMinimumWidth(maxWidth);
@@ -558,7 +558,7 @@ void QPrintPreviewDialogPrivate::_q_print()
suffix = QLatin1String(".ps");
}
QString fileName = QFileDialog::getSaveFileName(q, title, printer->outputFileName(),
- QLatin1String("*") + suffix);
+ QLatin1Char('*') + suffix);
if (!fileName.isEmpty()) {
if (QFileInfo(fileName).suffix().isEmpty())
fileName.append(suffix);
@@ -611,7 +611,7 @@ void QPrintPreviewDialogPrivate::_q_zoomFactorChanged()
factor = qMax(qreal(1.0), qMin(qreal(1000.0), factor));
if (ok) {
preview->setZoomFactor(factor/100.0);
- zoomFactor->setEditText(QString(QLatin1String("%1%")).arg(factor));
+ zoomFactor->setEditText(QString::fromLatin1("%1%").arg(factor));
setFitting(false);
}
}
diff --git a/src/gui/embedded/qkbdtty_qws.cpp b/src/gui/embedded/qkbdtty_qws.cpp
index 5c0dec8..7f10e14 100644
--- a/src/gui/embedded/qkbdtty_qws.cpp
+++ b/src/gui/embedded/qkbdtty_qws.cpp
@@ -89,6 +89,7 @@ private:
struct termios m_tty_attr;
char m_last_keycode;
int m_vt_qws;
+ int m_originalKbdMode;
};
@@ -150,6 +151,9 @@ QWSTtyKbPrivate::QWSTtyKbPrivate(QWSTtyKeyboardHandler *h, const QString &device
tcgetattr(m_tty_fd, &termdata);
#if defined(Q_OS_LINUX)
+ // record the original mode so we can restore it again in the constructor
+ ::ioctl(m_tty_fd, KDGKBMODE, m_originalKbdMode);
+
// PLEASE NOTE:
// The tty keycode interface can only report keycodes 0x01 .. 0x7f
// KEY_MAX is however defined to 0x1ff. In practice this is sufficient
@@ -206,7 +210,7 @@ QWSTtyKbPrivate::~QWSTtyKbPrivate()
{
if (m_tty_fd >= 0) {
#if defined(Q_OS_LINUX)
- ::ioctl(m_tty_fd, KDSKBMODE, K_XLATE);
+ ::ioctl(m_tty_fd, KDSKBMODE, m_originalKbdMode);
#endif
tcsetattr(m_tty_fd, TCSANOW, &m_tty_attr);
}
diff --git a/src/gui/embedded/qmouse_qws.cpp b/src/gui/embedded/qmouse_qws.cpp
index 044a574..b5eda0c 100644
--- a/src/gui/embedded/qmouse_qws.cpp
+++ b/src/gui/embedded/qmouse_qws.cpp
@@ -413,8 +413,8 @@ void QWSCalibratedMouseHandler::writeCalibration()
QFile file(calFile);
if (file.open(QIODevice::WriteOnly)) {
QTextStream t(&file);
- t << a << " " << b << " " << c << " ";
- t << d << " " << e << " " << f << " " << s << endl;
+ t << a << ' ' << b << ' ' << c << ' ';
+ t << d << ' ' << e << ' ' << f << ' ' << s << endl;
} else
#endif
{
diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp
index f3f54d9..91121e7 100644
--- a/src/gui/embedded/qscreen_qws.cpp
+++ b/src/gui/embedded/qscreen_qws.cpp
@@ -49,6 +49,7 @@
#include "qpixmap.h"
#include "qvarlengtharray.h"
#include "qwsdisplay_qws.h"
+#include "qpainter.h"
#include <private/qdrawhelper_p.h>
#include <private/qpaintengine_raster_p.h>
#include <private/qpixmap_raster_p.h>
@@ -2710,7 +2711,7 @@ void QScreen::compose(int level, const QRegion &exposed, QRegion &blend,
default:
break;
}
- spanData.setup(qwsServer->backgroundBrush(), 256);
+ spanData.setup(qwsServer->backgroundBrush(), 256, QPainter::CompositionMode_SourceOver);
spanData.dx = off.x();
spanData.dy = off.y();
} else if (!surface->isBuffered()) {
@@ -2775,7 +2776,7 @@ void QScreen::paintBackground(const QRegion &r)
rb.prepare(&img);
QSpanData spanData;
spanData.init(&rb, 0);
- spanData.setup(bg, 256);
+ spanData.setup(bg, 256, QPainter::CompositionMode_Source);
spanData.dx = off.x();
spanData.dy = off.y();
Q_ASSERT(spanData.blend);
diff --git a/src/gui/embedded/qscreenmulti_qws.cpp b/src/gui/embedded/qscreenmulti_qws.cpp
index 1914b44..a639e01 100644
--- a/src/gui/embedded/qscreenmulti_qws.cpp
+++ b/src/gui/embedded/qscreenmulti_qws.cpp
@@ -221,9 +221,9 @@ bool QMultiScreen::connect(const QString &displaySpec)
{
QString dSpec = displaySpec;
if (dSpec.startsWith(QLatin1String("Multi:"), Qt::CaseInsensitive))
- dSpec = dSpec.mid(QString(QLatin1String("Multi:")).size());
+ dSpec = dSpec.mid(QString::fromLatin1("Multi:").size());
- const QString displayIdSpec = QString(QLatin1String(" :%1")).arg(displayId);
+ const QString displayIdSpec = QString::fromLatin1(" :%1").arg(displayId);
if (dSpec.endsWith(displayIdSpec))
dSpec = dSpec.left(dSpec.size() - displayIdSpec.size());
diff --git a/src/gui/embedded/qscreentransformed_qws.cpp b/src/gui/embedded/qscreentransformed_qws.cpp
index e22ea1f..01a18b3 100644
--- a/src/gui/embedded/qscreentransformed_qws.cpp
+++ b/src/gui/embedded/qscreentransformed_qws.cpp
@@ -206,11 +206,11 @@ bool QTransformedScreen::connect(const QString &displaySpec)
{
QString dspec = displaySpec.trimmed();
if (dspec.startsWith(QLatin1String("Transformed:"), Qt::CaseInsensitive))
- dspec = dspec.mid(QString(QLatin1String("Transformed:")).size());
+ dspec = dspec.mid(QString::fromLatin1("Transformed:").size());
else if (!dspec.compare(QLatin1String("Transformed"), Qt::CaseInsensitive))
dspec = QString();
- const QString displayIdSpec = QString(QLatin1String(" :%1")).arg(displayId);
+ const QString displayIdSpec = QString::fromLatin1(" :%1").arg(displayId);
if (dspec.endsWith(displayIdSpec))
dspec = dspec.left(dspec.size() - displayIdSpec.size());
@@ -223,7 +223,7 @@ bool QTransformedScreen::connect(const QString &displaySpec)
if (!QScreenDriverFactory::keys().contains(driver, Qt::CaseInsensitive))
if (!dspec.isEmpty())
- dspec.prepend(QLatin1String(":"));
+ dspec.prepend(QLatin1Char(':'));
const int id = getDisplayId(dspec);
QScreen *s = qt_get_screen(id, dspec.toLatin1().constData());
diff --git a/src/gui/embedded/qscreenvfb_qws.cpp b/src/gui/embedded/qscreenvfb_qws.cpp
index accfe1f..ec393e3 100644
--- a/src/gui/embedded/qscreenvfb_qws.cpp
+++ b/src/gui/embedded/qscreenvfb_qws.cpp
@@ -330,7 +330,7 @@ void QVFbScreen::disconnect()
bool QVFbScreen::initDevice()
{
#ifndef QT_NO_QWS_MOUSE_QVFB
- const QString mouseDev = QString(QLatin1String(QT_VFB_MOUSE_PIPE))
+ const QString mouseDev = QString::fromLatin1(QT_VFB_MOUSE_PIPE)
.arg(displayId);
d_ptr->mouse = new QVFbMouseHandler(QLatin1String("QVFbMouse"), mouseDev);
qwsServer->setDefaultMouse("None");
@@ -339,7 +339,7 @@ bool QVFbScreen::initDevice()
#endif
#if !defined(QT_NO_QWS_KBD_QVFB) && !defined(QT_NO_QWS_KEYBOARD)
- const QString keyboardDev = QString(QLatin1String(QT_VFB_KEYBOARD_PIPE))
+ const QString keyboardDev = QString::fromLatin1(QT_VFB_KEYBOARD_PIPE)
.arg(displayId);
d_ptr->keyboard = new QVFbKeyboardHandler(keyboardDev);
qwsServer->setDefaultKeyboard("None");
diff --git a/src/gui/embedded/qtransportauth_qws.cpp b/src/gui/embedded/qtransportauth_qws.cpp
index 97ba5b8..6677482 100644
--- a/src/gui/embedded/qtransportauth_qws.cpp
+++ b/src/gui/embedded/qtransportauth_qws.cpp
@@ -834,12 +834,12 @@ QString RequestAnalyzer::analyze( QByteArray *msgQueue )
if ( command_type == QWSCommand::QCopSend )
{
QWSQCopSendCommand *sendCommand = static_cast<QWSQCopSendCommand*>(command);
- request += QString( QLatin1String("/QCop/%1/%2") ).arg( sendCommand->channel ).arg( sendCommand->message );
+ request += QString::fromLatin1("/QCop/%1/%2").arg( sendCommand->channel ).arg( sendCommand->message );
}
if ( command_type == QWSCommand::QCopRegisterChannel )
{
QWSQCopRegisterChannelCommand *registerCommand = static_cast<QWSQCopRegisterChannelCommand*>(command);
- request += QString( QLatin1String("/QCop/RegisterChannel/%1") ).arg( registerCommand->channel );
+ request += QString::fromLatin1("/QCop/RegisterChannel/%1").arg( registerCommand->channel );
}
#endif
dataSize = QWS_PROTOCOL_ITEM_SIZE( *command );
diff --git a/src/gui/embedded/qunixsocket.cpp b/src/gui/embedded/qunixsocket.cpp
index 16f2cae..1600505 100644
--- a/src/gui/embedded/qunixsocket.cpp
+++ b/src/gui/embedded/qunixsocket.cpp
@@ -135,7 +135,7 @@ struct QUnixSocketRightsPrivate : public QSharedData
#ifdef QUNIXSOCKET_DEBUG
if(0 != closerv) {
qDebug() << "QUnixSocketRightsPrivate: Unable to close managed"
- " file descriptor (" << ::strerror(errno) << ")";
+ " file descriptor (" << ::strerror(errno) << ')';
}
#endif
}
@@ -166,7 +166,7 @@ QUnixSocketRights::QUnixSocketRights(int fd)
#ifdef QUNIXSOCKET_DEBUG
if(-1 == d->fd) {
qDebug() << "QUnixSocketRights: Unable to duplicate fd "
- << fd << " (" << ::strerror(errno) << ")";
+ << fd << " (" << ::strerror(errno) << ')';
}
#endif
}
@@ -237,7 +237,7 @@ int QUnixSocketRights::dupFd() const
#ifdef QUNIXSOCKET_DEBUG
if(-1 == rv)
qDebug() << "QUnixSocketRights: Unable to duplicate managed file "
- "descriptor (" << ::strerror(errno) << ")";
+ "descriptor (" << ::strerror(errno) << ')';
#endif
return rv;
@@ -927,7 +927,7 @@ bool QUnixSocket::connect(const QByteArray & path)
int crv;
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Connect requested to '"
- << path << "'";
+ << path << '\'';
#endif
abort(); // Reset any existing connection
@@ -949,7 +949,7 @@ bool QUnixSocket::connect(const QByteArray & path)
if(-1 == d->fd) {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Unable to create socket ("
- << strerror(errno) << ")";
+ << strerror(errno) << ')';
#endif
d->error = ResourceError;
goto connect_error;
@@ -962,7 +962,7 @@ bool QUnixSocket::connect(const QByteArray & path)
if(-1 == crv) {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Unable to configure socket ("
- << ::strerror(errno) << ")";
+ << ::strerror(errno) << ')';
#endif
d->error = ResourceError;
@@ -981,7 +981,7 @@ bool QUnixSocket::connect(const QByteArray & path)
if(-1 == crv) {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Unable to connect ("
- << ::strerror(errno) << ")";
+ << ::strerror(errno) << ')';
#endif
if(ECONNREFUSED == errno)
d->error = ConnectionRefused;
@@ -1021,7 +1021,7 @@ connect_error: // Cleanup failed connection
#ifdef QUNIXSOCKET_DEBUG
if(0 != closerv) {
qDebug() << "QUnixSocket: Unable to close file descriptor after "
- "failed connect (" << ::strerror(errno) << ")";
+ "failed connect (" << ::strerror(errno) << ')';
}
#endif
}
@@ -1065,7 +1065,7 @@ bool QUnixSocket::setSocketDescriptor(int socketDescriptor)
if(-1 == crv) {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Unable to configure client provided socket ("
- << ::strerror(errno) << ")";
+ << ::strerror(errno) << ')';
#endif
d->error = ResourceError;
@@ -1136,7 +1136,7 @@ void QUnixSocket::abort()
#ifdef QUNIXSOCKET_DEBUG
if(0 != closerv) {
qDebug() << "QUnixSocket: Unable to close socket during abort ("
- << strerror(errno) << ")";
+ << strerror(errno) << ')';
}
#endif
@@ -1686,11 +1686,11 @@ qint64 QUnixSocketPrivate::writeActivated()
}
#ifdef QUNIXSOCKET_DEBUG
- qDebug() << "QUnixSocket: Transmitting message (length" << m.d->size() << ")";
+ qDebug() << "QUnixSocket: Transmitting message (length" << m.d->size() << ')';
#endif
::ssize_t s = ::sendmsg(fd, &sendmessage, MSG_DONTWAIT | MSG_NOSIGNAL);
#ifdef QUNIXSOCKET_DEBUG
- qDebug() << "QUnixSocket: Transmitted message (" << s << ")";
+ qDebug() << "QUnixSocket: Transmitted message (" << s << ')';
#endif
if(-1 == s) {
@@ -1699,13 +1699,13 @@ qint64 QUnixSocketPrivate::writeActivated()
} else if(EPIPE == errno) {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Remote side disconnected during transmit "
- "(" << ::strerror(errno) << ")";
+ "(" << ::strerror(errno) << ')';
#endif
me->abort();
} else {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Unable to transmit data ("
- << ::strerror(errno) << ")";
+ << ::strerror(errno) << ')';
#endif
error = (QUnixSocket::SocketError)(QUnixSocket::WriteFailure |
CausedAbort);
@@ -1764,12 +1764,12 @@ void QUnixSocketPrivate::readActivated()
int recvrv = ::recvmsg(fd, &message, 0);
#ifdef QUNIXSOCKET_DEBUG
- qDebug() << "QUnixSocket: Received message (" << recvrv << ")";
+ qDebug() << "QUnixSocket: Received message (" << recvrv << ')';
#endif
if(-1 == recvrv) {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Unable to receive data ("
- << ::strerror(errno) << ")";
+ << ::strerror(errno) << ')';
#endif
error = (QUnixSocket::SocketError)(QUnixSocket::ReadFailure |
CausedAbort);
diff --git a/src/gui/embedded/qunixsocketserver.cpp b/src/gui/embedded/qunixsocketserver.cpp
index 6e9347b..489c40a 100644
--- a/src/gui/embedded/qunixsocketserver.cpp
+++ b/src/gui/embedded/qunixsocketserver.cpp
@@ -172,7 +172,7 @@ void QUnixSocketServer::close()
#ifdef QUNIXSOCKET_DEBUG
if(0 != closerv) {
qDebug() << "QUnixSocketServer: Unable to close socket ("
- << strerror(errno) << ")";
+ << strerror(errno) << ')';
}
#endif
}
@@ -245,7 +245,7 @@ bool QUnixSocketServer::listen(const QByteArray & path)
if(-1 == d->fd) {
#ifdef QUNIXSOCKETSERVER_DEBUG
qDebug() << "QUnixSocketServer: Unable to create socket ("
- << strerror(errno) << ")";
+ << strerror(errno) << ')';
#endif
close();
d->error = ResourceError;
@@ -263,7 +263,7 @@ bool QUnixSocketServer::listen(const QByteArray & path)
if(-1 == ::bind(d->fd, (sockaddr *)&addr, sizeof(sockaddr_un))) {
#ifdef QUNIXSOCKETSERVER_DEBUG
qDebug() << "QUnixSocketServer: Unable to bind socket ("
- << strerror(errno) << ")";
+ << strerror(errno) << ')';
#endif
close();
d->error = BindError;
@@ -274,7 +274,7 @@ bool QUnixSocketServer::listen(const QByteArray & path)
if(-1 == ::listen(d->fd, d->maxConns)) {
#ifdef QUNIXSOCKETSERVER_DEBUG
qDebug() << "QUnixSocketServer: Unable to listen socket ("
- << strerror(errno) << ")";
+ << strerror(errno) << ')';
#endif
close();
d->error = ListenError;
diff --git a/src/gui/embedded/qwindowsystem_qws.cpp b/src/gui/embedded/qwindowsystem_qws.cpp
index fdcd193..a15decd 100644
--- a/src/gui/embedded/qwindowsystem_qws.cpp
+++ b/src/gui/embedded/qwindowsystem_qws.cpp
@@ -2210,7 +2210,7 @@ void QWSServer::sendMouseEvent(const QPoint& pos, int state, int wheel)
{
bool block = qwsServerPrivate->screensaverblockevent(MOUSE, qwsServerPrivate->screensaverinterval, state);
#ifdef EVENT_BLOCK_DEBUG
- qDebug() << "sendMouseEvent" << pos.x() << pos.y() << state << (block?"block":"pass");
+ qDebug() << "sendMouseEvent" << pos.x() << pos.y() << state << (block ? "block" : "pass");
#endif
if (state || wheel)
@@ -4110,7 +4110,7 @@ void QWSServer::processKeyEvent(int unicode, int keycode, Qt::KeyboardModifiers
block = qwsServerPrivate->screensaverblockevent(KEY, qwsServerPrivate->screensaverinterval, isPress);
#ifdef EVENT_BLOCK_DEBUG
- qDebug() << "processKeyEvent" << unicode << keycode << modifiers << isPress << autoRepeat << (block?"block":"pass");
+ qDebug() << "processKeyEvent" << unicode << keycode << modifiers << isPress << autoRepeat << (block ? "block" : "pass");
#endif
// If we press a key and it's going to be blocked, wake up the screen
diff --git a/src/gui/embedded/qwscommand_qws.cpp b/src/gui/embedded/qwscommand_qws.cpp
index b0fd78b..26d3435 100644
--- a/src/gui/embedded/qwscommand_qws.cpp
+++ b/src/gui/embedded/qwscommand_qws.cpp
@@ -133,7 +133,7 @@ void QWSHexDump::init()
void QWSHexDump::hexDump()
{
- *outstrm << "(" << dataSize << " bytes):\n" << prefix;
+ *outstrm << '(' << dataSize << " bytes):\n" << prefix;
sprintf(sideviewLayout, " [%%-%us]", wrap);
dataWidth = (2 * wrap) + (wrap / clustering);
@@ -144,7 +144,7 @@ void QWSHexDump::hexDump()
sideview[wrapIndex = i%wrap] = isprint(c) ? c : '.';
if (wrapIndex && (wrapIndex % clustering == 0))
- *outstrm << " ";
+ *outstrm << ' ';
outstrm->setFieldWidth(2);
outstrm->setPadChar('0');
@@ -172,14 +172,14 @@ void QWSHexDump::sideviewDump(int at)
int currentWidth = (2 * at) + (at / clustering) - (at%clustering?0:1);
int missing = qMax(dataWidth - currentWidth, 0);
while (missing--)
- *outstrm << " ";
+ *outstrm << ' ';
*outstrm << " [";
outstrm->setPadChar(' ');
outstrm->setFieldWidth(wrap);
outstrm->setFieldAlignment( QTextStream::AlignLeft );
*outstrm << sideview;
- *outstrm << "]";
+ *outstrm << ']';
}
}
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 007f74c..b9e462b 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -130,12 +130,18 @@
\img graphicsview-parentchild.png
+ \section1 Transformation
+
QGraphicsItem supports affine transformations in addition to its base
position, pos(). To change the item's transformation, you can either pass
- a transformation matrix to setTransform(), or call one of the convenience
- functions rotate(), scale(), translate(), or shear(). Item transformations
- accumulate from parent to child, so if both a parent and child item are
- rotated 90 degrees, the child's total transformation will be 180 degrees.
+ a transformation matrix to setTransform(), or set the different transformation
+ properties (transformOrigin, x/y/zRotation, x/yScale, horizontal/verticalShear).
+ Note that setting the transformation matrix conflicts with using the properties.
+ Setting the properties will overwrite the transformation set with setTransform,
+ and using setTransform will reset the properties.
+
+ Item transformations accumulate from parent to child, so if both a parent and child
+ item are rotated 90 degrees, the child's total transformation will be 180 degrees.
Similarly, if the item's parent is scaled to 2x its original size, its
children will also be twice as large. An item's transformation does not
affect its own local geometry; all geometry functions (e.g., contains(),
@@ -146,6 +152,22 @@
and scenePos(), which returns its position in scene coordinates. To reset
an item's matrix, call resetTransform().
+ The order you set the transformation properties does not affect the resulting transformation
+ The resulting transformation is always computed in the following order
+
+ \code
+ [Origin] [RotateX] [RotateY] [RotateZ] [Shear] [Scale] [-Origin]
+ \endcode
+
+ So the transformation is equivalent to the following code
+
+ \code
+ QTransform().translate(xOrigin, yOrigin).rotate(xRotation, Qt::XAxis).rotate(yRotation, Qt::YAxis).rotate(zRotation, Qt::ZAxis)
+ .shear(horizontalShear, verticalShear).scale(xScale, yScale).translate(-xOrigin, -yOrigin);
+ \endcode
+
+ \section1 Painting
+
The paint() function is called by QGraphicsView to paint the item's
contents. The item has no background or default fill of its own; whatever
is behind the item will shine through all areas that are not explicitly
@@ -161,6 +183,8 @@
high z-values. Stacking order applies to sibling items; parents are always
drawn before their children.
+ \section1 Events
+
QGraphicsItem receives events from QGraphicsScene through the virtual
function sceneEvent(). This function distributes the most common events
to a set of convenience event handlers:
@@ -186,6 +210,8 @@
by the virtual function sceneEventFilter(). You can remove item
event filters by calling removeSceneEventFilter().
+ \section1 Custom Data
+
Sometimes it's useful to register custom data with an item, be it a custom
item, or a standard item. You can call setData() on any item to store data
in it using a key-value pair (the key being an integer, and the value is a
@@ -338,16 +364,17 @@
\value ItemTransformChange The item's transformation matrix changes. This
notification is only sent when the item's local transformation matrix
- changes (i.e., as a result of calling setTransform(), or one of the
- convenience transformation functions, such as rotate()). The value
+ changes (i.e., as a result of calling setTransform(). The value
argument is the new matrix (i.e., a QTransform); to get the old matrix,
- call transform(). Do not call setTransform() or any of the transformation
- convenience functions in itemChange() as this notification is delivered;
+ call transform(). Do not call setTransform() or set any of the transformation
+ properties in itemChange() as this notification is delivered;
instead, you can return the new matrix from itemChange().
+ This notification is not sent if you change the transformation properties.
\value ItemTransformHasChanged The item's transformation matrix has
- changed. This notification is only sent after the item's local
- trasformation matrix has changed. The value argument is the new matrix
+ changed either because setTransform is called, or one of the transformation
+ properties is changed. This notification is only sent after the item's local
+ transformation matrix has changed. The value argument is the new matrix
(same as transform()), and QGraphicsItem ignores the return value for this
notification (i.e., a read-only notification).
@@ -1059,12 +1086,7 @@ QGraphicsItem::~QGraphicsItem()
d_ptr->setParentItemHelper(0, /* deleting = */ true);
if (d_ptr->scene)
d_ptr->scene->d_func()->_q_removeItemLater(this);
-
- if (d_ptr->hasTransform) {
- delete static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- }
-
+
delete d_ptr;
qt_dataStore()->data.remove(this);
@@ -1618,6 +1640,10 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo
if (visible == quint32(newVisible))
return;
+ // Don't show child if parent is not visible
+ if (parent && newVisible && !parent->d_ptr->visible)
+ return;
+
// Modify the property.
const QVariant newVisibleVariant(q_ptr->itemChange(QGraphicsItem::ItemVisibleChange,
quint32(newVisible)));
@@ -2564,8 +2590,13 @@ QMatrix QGraphicsItem::matrix() const
/*!
\since 4.3
- Returns this item's transformation matrix. If no matrix has been set, the
- identity matrix is returned.
+ Returns this item's transformation matrix.
+
+ Either the one set by setTransform, or the resulting transformation from
+ all the transfmation properties
+
+ If no matrix or transformation property has been set, the
+ identity matrix is returned.
\sa setTransform(), sceneTransform()
*/
@@ -2573,24 +2604,401 @@ QTransform QGraphicsItem::transform() const
{
if (!d_ptr->hasTransform)
return QTransform();
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- Q_ASSERT(transformData);
- if (transformData->dirty) {
- QGraphicsItem *that = const_cast<QGraphicsItem *>(this);
- QTransform newTransform;
- QPointF center = transformData->transformCenter;
- newTransform.translate(center.x(), center.y());
- newTransform.rotate(transformData->rotationZ, Qt::ZAxis);
- newTransform.rotate(transformData->rotationY, Qt::YAxis);
- newTransform.rotate(transformData->rotationX, Qt::XAxis);
- newTransform.scale(transformData->scaleX, transformData->scaleY);
- newTransform *= transformData->baseTransform;
- newTransform.translate(-center.x(), -center.y());
- transformData->transform = newTransform;
- transformData->dirty = false;
- }
- return transformData->transform;
+ if (d_ptr->hasDecomposedTransform && d_ptr->dirtyTransform) {
+ QGraphicsItemPrivate::DecomposedTransform *decomposed = d_ptr->decomposedTransform();
+ QTransform x;
+ decomposed->generateTransform(&x);
+ QVariant v(x);
+ d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, v);
+ d_ptr->dirtyTransform = 0;
+ const_cast<QGraphicsItem *>(this)->itemChange(ItemTransformHasChanged, v);
+ return x;
+ }
+ return qVariantValue<QTransform>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform));
+}
+
+/*!
+ \since 4.6
+
+ Returns the rotation around the X axis.
+
+ The default is 0
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, this function return the default value.
+
+ \sa setXRotation(), {Transformations}
+*/
+qreal QGraphicsItem::xRotation() const
+{
+ return d_ptr->decomposedTransform()->xRotation;
+}
+
+/*!
+ \since 4.6
+
+ Sets the rotation around the X axis to \a angle degrees.
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, it will be overwritten.
+
+ \sa xRotation(), {Transformations}
+*/
+void QGraphicsItem::setXRotation(qreal angle)
+{
+ if (!d_ptr->dirtyTransform) {
+ d_ptr->fullUpdateHelper(true);
+ prepareGeometryChange();
+ }
+ QGraphicsItemPrivate::DecomposedTransform *decomposed = d_ptr->decomposedTransform();
+ decomposed->xRotation = angle;
+ if (!d_ptr->dirtyTransform)
+ d_ptr->invalidateSceneTransformCache();
+ d_ptr->dirtyTransform = 1;
+ d_ptr->hasTransform = 1;
+}
+
+/*!
+ \since 4.6
+
+ Returns the rotation around the Y axis.
+
+ The default is 0
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, this function return the default value.
+
+ \sa setYRotation(), {Transformations}
+*/
+qreal QGraphicsItem::yRotation() const
+{
+ return d_ptr->decomposedTransform()->yRotation;
+}
+
+/*!
+ \since 4.6
+
+ Sets the rotation around the Y axis to \a angle degrees.
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, it will be overwritten.
+
+ \sa yRotation(), {Transformations}
+*/
+void QGraphicsItem::setYRotation(qreal angle)
+{
+ if (!d_ptr->dirtyTransform) {
+ d_ptr->fullUpdateHelper(true);
+ prepareGeometryChange();
+ }
+ QGraphicsItemPrivate::DecomposedTransform *decomposed = d_ptr->decomposedTransform();
+ decomposed->yRotation = angle;
+ if (!d_ptr->dirtyTransform)
+ d_ptr->invalidateSceneTransformCache();
+ d_ptr->dirtyTransform = 1;
+ d_ptr->hasTransform = 1;
+}
+
+/*!
+ \since 4.6
+
+ Returns the rotation around the Z axis.
+
+ The default is 0
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, this function return the default value.
+
+ \sa setZRotation(), {Transformations}
+*/
+qreal QGraphicsItem::zRotation() const
+{
+ return d_ptr->decomposedTransform()->zRotation;
+}
+
+/*!
+ \since 4.6
+
+ Sets the rotation around the Z axis to \a angle degrees.
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, it will be overwritten.
+
+ \sa zRotation(), {Transformations}
+*/
+void QGraphicsItem::setZRotation(qreal angle)
+{
+ if (!d_ptr->dirtyTransform) {
+ d_ptr->fullUpdateHelper(true);
+ prepareGeometryChange();
+ }
+ QGraphicsItemPrivate::DecomposedTransform *decomposed = d_ptr->decomposedTransform();
+ decomposed->zRotation = angle;
+ if (!d_ptr->dirtyTransform)
+ d_ptr->invalidateSceneTransformCache();
+ d_ptr->dirtyTransform = 1;
+ d_ptr->hasTransform = 1;
+}
+
+/*!
+ \since 4.6
+
+ This convenience function set the rotation angles around the 3 axes
+ to \a x, \a y and \a z.
+
+ \sa setXRotation(), setYRotation(), setZRotation()
+*/
+void QGraphicsItem::setRotation(qreal x, qreal y, qreal z)
+{
+ setXRotation(x);
+ setYRotation(y);
+ setZRotation(z);
+}
+
+/*!
+ \since 4.6
+
+ Returns the scale factor on the X axis.
+
+ The default is 1
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, this function return the default value.
+
+ \sa setXScale(), {Transformations}
+*/
+qreal QGraphicsItem::xScale() const
+{
+ return d_ptr->decomposedTransform()->xScale;
+}
+
+/*!
+ \since 4.6
+
+ Sets the scale factor on the X axis to \a factor.
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, it will be overwritten.
+
+ \sa xScale(), {Transformations}
+*/
+void QGraphicsItem::setXScale(qreal factor)
+{
+ if (!d_ptr->dirtyTransform) {
+ d_ptr->fullUpdateHelper(true);
+ prepareGeometryChange();
+ }
+ QGraphicsItemPrivate::DecomposedTransform *decomposed = d_ptr->decomposedTransform();
+ decomposed->xScale = factor;
+ if (!d_ptr->dirtyTransform)
+ d_ptr->invalidateSceneTransformCache();
+ d_ptr->dirtyTransform = 1;
+ d_ptr->hasTransform = 1;
+}
+
+/*!
+ \since 4.6
+
+ Returns the scale factor on the Y axis.
+
+ The default is 1
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, this function return the default value.
+
+ \sa setYScale(), {Transformations}
+*/
+qreal QGraphicsItem::yScale() const
+{
+ return d_ptr->decomposedTransform()->yScale;
+}
+
+/*!
+ \since 4.6
+
+ Sets the scale factor on the Y axis to \a factor.
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, it will be overwritten.
+
+ \sa yScale(), {Transformations}
+*/
+void QGraphicsItem::setYScale(qreal factor)
+{
+ if (!d_ptr->dirtyTransform) {
+ d_ptr->fullUpdateHelper(true);
+ prepareGeometryChange();
+ }
+ QGraphicsItemPrivate::DecomposedTransform *decomposed = d_ptr->decomposedTransform();
+ decomposed->yScale = factor;
+ if (!d_ptr->dirtyTransform)
+ d_ptr->invalidateSceneTransformCache();
+ d_ptr->dirtyTransform = 1;
+ d_ptr->hasTransform = 1;
+}
+
+/*!
+ \since 4.6
+
+ This convenience function set the scaling factors on X and Y axis to \a sx and \a sy.
+
+ \sa setXScale(), setYScale()
+*/
+void QGraphicsItem::setScale(qreal sx, qreal sy)
+{
+ setXScale(sx);
+ setYScale(sy);
+}
+
+/*!
+ \since 4.6
+
+ Returns the horizontal shear.
+
+ The default is 0
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, this function return the default value.
+
+ \sa setHorizontalShear(), {Transformations}
+*/
+qreal QGraphicsItem::horizontalShear() const
+{
+ return d_ptr->decomposedTransform()->horizontalShear;
+}
+
+/*!
+ \since 4.6
+
+ Sets the horizontal shear to \a shear.
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, it will be overwritten.
+
+ \sa horizontalShear(), {Transformations}
+*/
+void QGraphicsItem::setHorizontalShear(qreal shear)
+{
+ if (!d_ptr->dirtyTransform) {
+ d_ptr->fullUpdateHelper(true);
+ prepareGeometryChange();
+ }
+ QGraphicsItemPrivate::DecomposedTransform *decomposed = d_ptr->decomposedTransform();
+ decomposed->horizontalShear = shear;
+ if (!d_ptr->dirtyTransform)
+ d_ptr->invalidateSceneTransformCache();
+ d_ptr->dirtyTransform = 1;
+ d_ptr->hasTransform = 1;
+}
+
+/*!
+ \since 4.6
+
+ Returns the vertical shear.
+
+ The default is 0
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, this function return the default value.
+
+ \sa setHorizontalShear(), {Transformations}
+*/
+qreal QGraphicsItem::verticalShear() const
+{
+ return d_ptr->decomposedTransform()->verticalShear;
+}
+
+/*!
+ \since 4.6
+
+ Sets the vertical shear to \a shear.
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, it will be overwritten.
+
+ \sa verticalShear(), {Transformations}
+*/
+void QGraphicsItem::setVerticalShear(qreal shear)
+{
+ if (!d_ptr->dirtyTransform) {
+ d_ptr->fullUpdateHelper(true);
+ prepareGeometryChange();
+ }
+ QGraphicsItemPrivate::DecomposedTransform *decomposed = d_ptr->decomposedTransform();
+ decomposed->verticalShear = shear;
+ if (!d_ptr->dirtyTransform)
+ d_ptr->invalidateSceneTransformCache();
+ d_ptr->dirtyTransform = 1;
+ d_ptr->hasTransform = 1;
+}
+
+/*!
+ \since 4.6
+
+ This convenience function sets the horizontal shear to \a sh and the vertical shear to \a sv.
+
+ \sa setHorizontalShear(), setVerticalShear()
+*/
+void QGraphicsItem::setShear(qreal sh, qreal sv)
+{
+ setHorizontalShear(sh);
+ setVerticalShear(sv);
+}
+
+/*!
+ \since 4.6
+
+ Returns the transformation origin for the transformation properties.
+
+ The default is QPointF(0,0).
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, this function return the default value.
+
+ \sa setTransformOrigin(), {Transformations}
+*/
+QPointF QGraphicsItem::transformOrigin() const
+{
+ const QGraphicsItemPrivate::DecomposedTransform *decomposed = d_ptr->decomposedTransform();
+ return QPointF(decomposed->xOrigin, decomposed->yOrigin);
+}
+
+/*!
+ \fn inline void setTransformOrigin(qreal x, qreal y)
+
+ \since 4.6
+
+ This is an overloaded member function, provided for convenience.
+ Sets the transformation origin for the transformation
+ properties to the point(\a x, \a y).
+
+ \sa setTransformOrigin(), {Transformations}
+*/
+
+/*!
+ \since 4.6
+
+ Sets the transformation origin for the transformation properties to \a origin.
+ This does not apply to the transformation set by setTransform.
+
+ \warning setting this property is conflicting with calling setTransform.
+ If a transform has been set, it will be overwritten.
+
+ \sa transformOrigin(), {Transformations}
+*/
+void QGraphicsItem::setTransformOrigin(const QPointF &origin)
+{
+ if (!d_ptr->dirtyTransform) {
+ d_ptr->fullUpdateHelper(true);
+ prepareGeometryChange();
+ }
+ QGraphicsItemPrivate::DecomposedTransform *decomposed = d_ptr->decomposedTransform();
+ decomposed->xOrigin = origin.x();
+ decomposed->yOrigin = origin.y();
+ if (!d_ptr->dirtyTransform)
+ d_ptr->invalidateSceneTransformCache();
+ d_ptr->dirtyTransform = 1;
+ d_ptr->hasTransform = 1;
}
/*!
@@ -2868,21 +3276,11 @@ QTransform QGraphicsItem::itemTransform(const QGraphicsItem *other, bool *ok) co
Use setTransform() instead.
- \sa transform(), rotate(), scale(), shear(), translate(), {The Graphics View Coordinate System}
+ \sa transform(), {The Graphics View Coordinate System}
*/
void QGraphicsItem::setMatrix(const QMatrix &matrix, bool combine)
{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData) {
- if (matrix.isIdentity())
- return;
- transformData = new QGraphicsItemPrivate::TransformData;
- d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, qVariantFromValue<void *>(transformData));
- }
-
- QTransform oldTransform = transformData->baseTransform;
-
+ QTransform oldTransform = this->transform();
QTransform newTransform;
if (!combine)
newTransform = QTransform(matrix);
@@ -2891,7 +3289,7 @@ void QGraphicsItem::setMatrix(const QMatrix &matrix, bool combine)
if (oldTransform == newTransform)
return;
- // Notify the item that the transformation matrix is changing.
+ // Notify the item that the matrix is changing.
QVariant newTransformVariant(itemChange(ItemMatrixChange,
qVariantFromValue<QMatrix>(newTransform.toAffine())));
newTransform = QTransform(qVariantValue<QMatrix>(newTransformVariant));
@@ -2901,9 +3299,10 @@ void QGraphicsItem::setMatrix(const QMatrix &matrix, bool combine)
// Update and set the new transformation.
d_ptr->fullUpdateHelper(true, true);
prepareGeometryChange();
- transformData->baseTransform = newTransform;
- transformData->dirty = true;
- d_ptr->hasTransform = true;
+ d_ptr->hasTransform = !newTransform.isIdentity();
+ d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, newTransform);
+ d_ptr->dirtyTransformComponents = 1;
+ d_ptr->dirtyTransform = 0;
d_ptr->invalidateSceneTransformCache();
// Send post-notification.
@@ -2927,21 +3326,14 @@ void QGraphicsItem::setMatrix(const QMatrix &matrix, bool combine)
to map an item coordiate to a scene coordinate, or mapFromScene() to map
from scene coordinates to item coordinates.
- \sa transform(), rotate(), scale(), shear(), translate(), {The Graphics View Coordinate System}
+ \warning using this function conflicts with using the transformation properties.
+ If you set a transformation, getting the properties will return default values.
+
+ \sa transform(), setRotation(), setScale(), setShear(), setTransformOrigin() {The Graphics View Coordinate System}
*/
void QGraphicsItem::setTransform(const QTransform &matrix, bool combine)
{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData) {
- if (matrix.isIdentity())
- return;
- transformData = new QGraphicsItemPrivate::TransformData;
- d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, qVariantFromValue<void *>(transformData));
- }
-
- QTransform oldTransform = transformData->baseTransform;
-
+ QTransform oldTransform = this->transform();
QTransform newTransform;
if (!combine)
newTransform = matrix;
@@ -2960,10 +3352,10 @@ void QGraphicsItem::setTransform(const QTransform &matrix, bool combine)
// Update and set the new transformation.
d_ptr->fullUpdateHelper(true, true);
prepareGeometryChange();
- transformData->baseTransform = newTransform;
- transformData->dirty = true;
- d_ptr->hasTransform = true;
- transform(); // ### update transform, bad!
+ d_ptr->hasTransform = !newTransform.isIdentity();
+ d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, newTransform);
+ d_ptr->dirtyTransformComponents = 1;
+ d_ptr->dirtyTransform = 0;
d_ptr->invalidateSceneTransformCache();
// Send post-notification.
@@ -2983,8 +3375,9 @@ void QGraphicsItem::resetMatrix()
/*!
\since 4.3
- Resets this item's transformation matrix to the identity matrix. This is
- equivalent to calling \c setTransform(QTransform()).
+ Resets this item's transformation matrix to the identity matrix or
+ all the transformation properties to their default values.
+ This is equivalent to calling \c setTransform(QTransform()).
\sa setTransform(), transform()
*/
@@ -2994,6 +3387,9 @@ void QGraphicsItem::resetTransform()
}
/*!
+ \obsolete
+ Use setZRotation() instead
+
Rotates the current item transformation \a angle degrees clockwise around
its origin. To translate around an arbitrary point (x, y), you need to
combine translation and rotation with setTransform().
@@ -3002,6 +3398,9 @@ void QGraphicsItem::resetTransform()
\snippet doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp 6
+ \warning using this function conflicts with using the transformation properties.
+ Getting those properties after using this function will return default values.
+
\sa setTransform(), transform(), scale(), shear(), translate()
*/
void QGraphicsItem::rotate(qreal angle)
@@ -3010,6 +3409,9 @@ void QGraphicsItem::rotate(qreal angle)
}
/*!
+ \obsolete
+ Use setScale() instead
+
Scales the current item transformation by (\a sx, \a sy) around its
origin. To scale from an arbitrary point (x, y), you need to combine
translation and scaling with setTransform().
@@ -3018,7 +3420,10 @@ void QGraphicsItem::rotate(qreal angle)
\snippet doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp 7
- \sa setTransform(), transform(), rotate(), shear(), translate()
+ \warning using this function conflicts with using the transformation properties.
+ Getting those properties after using this function will return default values.
+
+ \sa setTransform(), transform()
*/
void QGraphicsItem::scale(qreal sx, qreal sy)
{
@@ -3026,9 +3431,15 @@ void QGraphicsItem::scale(qreal sx, qreal sy)
}
/*!
+ \obsolete
+ Use setShear instead.
+
Shears the current item transformation by (\a sh, \a sv).
- \sa setTransform(), transform(), rotate(), scale(), translate()
+ \warning using this function conflicts with using the transformation properties.
+ Getting those properties after using this function will return default values.
+
+ \sa setTransform(), transform()
*/
void QGraphicsItem::shear(qreal sh, qreal sv)
{
@@ -3036,13 +3447,19 @@ void QGraphicsItem::shear(qreal sh, qreal sv)
}
/*!
+ \obsolete
+ Use setPos() or setTransformOrigin() instead.
+
Translates the current item transformation by (\a dx, \a dy).
If all you want is to move an item, you should call moveBy() or
setPos() instead; this function changes the item's translation,
which is conceptually separate from its position.
- \sa setTransform(), transform(), rotate(), scale(), shear()
+ \warning using this function conflicts with using the transformation properties.
+ Getting those properties after using this function will return default values.
+
+ \sa setTransform(), transform()
*/
void QGraphicsItem::translate(qreal dx, qreal dy)
{
@@ -3050,230 +3467,6 @@ void QGraphicsItem::translate(qreal dx, qreal dy)
}
/*!
- Returns the origin point used for all transformations.
- */
-QPointF QGraphicsItem::transformOrigin() const
-{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData)
- return QPointF();
-
- return transformData->transformCenter;
-}
-
-/*!
- Set a \a center for all transformations.
-*/
-void QGraphicsItem::setTransformOrigin(const QPointF &center)
-{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData) {
- if (center.isNull())
- return;
- transformData = new QGraphicsItemPrivate::TransformData;
- d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, qVariantFromValue<void *>(transformData));
- }
- if (transformData->transformCenter == center)
- return;
-
- d_ptr->fullUpdateHelper(true);
- prepareGeometryChange();
-
- transformData->transformCenter = center;
-
- transformData->dirty = true;
- d_ptr->hasTransform = true;
- d_ptr->fullUpdateHelper();
-
-}
-
-/*!
- Returns the x scale factor.
- */
-qreal QGraphicsItem::xScale() const
-{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData)
- return 1;
-
- return transformData->scaleX;
-}
-
-/*!
- Sets the x scale factor to \a factor.
- */
-void QGraphicsItem::setXScale(qreal factor)
-{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData) {
- if (factor == 1)
- return;
- transformData = new QGraphicsItemPrivate::TransformData;
- d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, qVariantFromValue<void *>(transformData));
- }
- if (transformData->scaleX == factor)
- return;
-
- d_ptr->fullUpdateHelper(true);
- prepareGeometryChange();
-
- transformData->scaleX = factor;
- transformData->dirty = true;
- d_ptr->hasTransform = true;
- d_ptr->invalidateSceneTransformCache();
-}
-
-/*!
- Returns the y scale factor.
- */
-qreal QGraphicsItem::yScale() const
-{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData)
- return 1;
-
- return transformData->scaleY;
-}
-
-/*!
- Sets the y scale factor to \a factor.
- */
-void QGraphicsItem::setYScale(qreal factor)
-{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData) {
- if (factor == 1)
- return;
- transformData = new QGraphicsItemPrivate::TransformData;
- d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, qVariantFromValue<void *>(transformData));
- }
- if (transformData->scaleY == factor)
- return;
-
- d_ptr->fullUpdateHelper(true);
- prepareGeometryChange();
-
- transformData->scaleY = factor;
- transformData->dirty = true;
- d_ptr->hasTransform = true;
- d_ptr->invalidateSceneTransformCache();
-}
-
-/*!
- Returns the x rotation angle.
- */
-qreal QGraphicsItem::xRotation() const
-{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData)
- return 0;
- return transformData->rotationX;
-}
-
-/*!
- Sets the x rotation angle to \a angle.
- */
-void QGraphicsItem::setXRotation(qreal angle)
-{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData) {
- if (qFuzzyCompare(angle + 1, 1))
- return;
- transformData = new QGraphicsItemPrivate::TransformData;
- d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, qVariantFromValue<void *>(transformData));
- }
-
- d_ptr->fullUpdateHelper(true);
- prepareGeometryChange();
-
- transformData->rotationX = angle;
-
- transformData->dirty = true;
- d_ptr->hasTransform = true;
- d_ptr->invalidateSceneTransformCache();
-}
-
-/*!
- Returns the y rotation angle.
- */
-qreal QGraphicsItem::yRotation() const
-{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData)
- return 0;
- return transformData->rotationY;
-}
-
-/*!
- Sets the y rotation angle to \a angle.
- */
-void QGraphicsItem::setYRotation(qreal angle)
-{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData) {
- if (qFuzzyCompare(angle + 1, 1))
- return;
- transformData = new QGraphicsItemPrivate::TransformData;
- d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, qVariantFromValue<void *>(transformData));
- }
-
- d_ptr->fullUpdateHelper(true);
- prepareGeometryChange();
-
- transformData->rotationY = angle;
-
- transformData->dirty = true;
- d_ptr->hasTransform = true;
- d_ptr->invalidateSceneTransformCache();
-}
-
-/*!
- Returns the z rotation angle.
- */
-qreal QGraphicsItem::zRotation() const
-{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData)
- return 0;
- return transformData->rotationZ;
-}
-
-/*!
- Sets the z rotation angle to \a angle.
- */
-void QGraphicsItem::setZRotation(qreal angle)
-{
- QGraphicsItemPrivate::TransformData *transformData = static_cast<QGraphicsItemPrivate::TransformData *>(
- qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraTransform)));
- if (!transformData) {
- if (qFuzzyCompare(angle + 1, 1))
- return;
- transformData = new QGraphicsItemPrivate::TransformData;
- d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, qVariantFromValue<void *>(transformData));
- }
-
- d_ptr->fullUpdateHelper(true);
- prepareGeometryChange();
-
- transformData->rotationZ = angle;
-
- transformData->dirty = true;
- d_ptr->hasTransform = true;
- d_ptr->invalidateSceneTransformCache();
-}
-
-/*!
This virtual function is called twice for all items by the
QGraphicsScene::advance() slot. In the first phase, all items are called
with \a phase == 0, indicating that items on the scene are about to
@@ -3390,7 +3583,7 @@ QRectF QGraphicsItem::childrenBoundingRect() const
Although the item's shape can be arbitrary, the bounding rect is
always rectangular, and it is unaffected by the items'
- transformation (scale(), rotate(), etc.).
+ transformation.
If you want to change the item's bounding rectangle, you must first call
prepareGeometryChange(). This notifies the scene of the imminent change,
@@ -8412,19 +8605,19 @@ bool QGraphicsTextItem::sceneEvent(QEvent *event)
void QGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if ((QGraphicsItem::d_ptr->flags & (ItemIsSelectable | ItemIsMovable))
- && (event->buttons() & Qt::LeftButton) && dd->_q_mouseOnEdge(event)) {
- // User left-pressed on edge of selectable/movable item, use
- // base impl.
- dd->useDefaultImpl = true;
+ && (event->buttons() & Qt::LeftButton) && dd->_q_mouseOnEdge(event)) {
+ // User left-pressed on edge of selectable/movable item, use
+ // base impl.
+ dd->useDefaultImpl = true;
} else if (event->buttons() == event->button()
- && dd->control->textInteractionFlags() == Qt::NoTextInteraction) {
- // User pressed first button on non-interactive item.
- dd->useDefaultImpl = true;
+ && dd->control->textInteractionFlags() == Qt::NoTextInteraction) {
+ // User pressed first button on non-interactive item.
+ dd->useDefaultImpl = true;
}
if (dd->useDefaultImpl) {
QGraphicsItem::mousePressEvent(event);
- if (!event->isAccepted())
- dd->useDefaultImpl = false;
+ if (!event->isAccepted())
+ dd->useDefaultImpl = false;
return;
}
dd->sendControlEvent(event);
@@ -8449,14 +8642,14 @@ void QGraphicsTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (dd->useDefaultImpl) {
QGraphicsItem::mouseReleaseEvent(event);
- if (dd->control->textInteractionFlags() == Qt::NoTextInteraction
- && !event->buttons()) {
- // User released last button on non-interactive item.
+ if (dd->control->textInteractionFlags() == Qt::NoTextInteraction
+ && !event->buttons()) {
+ // User released last button on non-interactive item.
dd->useDefaultImpl = false;
- } else if ((event->buttons() & Qt::LeftButton) == 0) {
- // User released the left button on an interactive item.
+ } else if ((event->buttons() & Qt::LeftButton) == 0) {
+ // User released the left button on an interactive item.
dd->useDefaultImpl = false;
- }
+ }
return;
}
dd->sendControlEvent(event);
@@ -8746,9 +8939,9 @@ bool QGraphicsTextItemPrivate::_q_mouseOnEdge(QGraphicsSceneMouseEvent *event)
Sets the flags \a flags to specify how the text item should react to user
input.
- The default for a QGraphicsTextItem is Qt::NoTextInteraction. Setting a
- value different to Qt::NoTextInteraction will also set the ItemIsFocusable
- QGraphicsItem flag.
+ The default for a QGraphicsTextItem is Qt::NoTextInteraction. This function
+ also affects the ItemIsFocusable QGraphicsItem flag by setting it if \a flags
+ is different from Qt::NoTextInteraction and clearing it otherwise.
By default, the text is read-only. To transform the item into an editor,
set the Qt::TextEditable flag.
@@ -9497,17 +9690,17 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlag flag)
QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlags flags)
{
- debug << "(";
+ debug << '(';
bool f = false;
for (int i = 0; i < 9; ++i) {
if (flags & (1 << i)) {
if (f)
- debug << "|";
+ debug << '|';
f = true;
debug << QGraphicsItem::GraphicsItemFlag(int(flags & (1 << i)));
}
}
- debug << ")";
+ debug << ')';
return debug;
}
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index 42443a2..e398dcf 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -242,25 +242,39 @@ public:
void setTransform(const QTransform &matrix, bool combine = false);
void resetTransform();
- // ### obsolete?
- void rotate(qreal angle);
- void scale(qreal sx, qreal sy);
- void shear(qreal sh, qreal sv);
- void translate(qreal dx, qreal dy);
+ void rotate(qreal angle); // ### obsolete
+ void scale(qreal sx, qreal sy); // ### obsolete
+ void shear(qreal sh, qreal sv); // ### obsolete
+ void translate(qreal dx, qreal dy); // ### obsolete
- // ### experimental
- QPointF transformOrigin() const;
- void setTransformOrigin(const QPointF &center);
- qreal xScale() const;
- void setXScale(qreal factor);
- qreal yScale() const;
- void setYScale(qreal factor);
qreal xRotation() const;
void setXRotation(qreal angle);
+
qreal yRotation() const;
void setYRotation(qreal angle);
+
qreal zRotation() const;
void setZRotation(qreal angle);
+ void setRotation(qreal x, qreal y, qreal z);
+
+ qreal xScale() const;
+ void setXScale(qreal factor);
+
+ qreal yScale() const;
+ void setYScale(qreal factor);
+ void setScale(qreal sx, qreal sy);
+
+ qreal horizontalShear() const;
+ void setHorizontalShear(qreal shear);
+
+ qreal verticalShear() const;
+ void setVerticalShear(qreal shear);
+ void setShear(qreal sh, qreal sv);
+
+ QPointF transformOrigin() const;
+ void setTransformOrigin(const QPointF &origin);
+ inline void setTransformOrigin(qreal x, qreal y)
+ { setTransformOrigin(QPointF(x,y)); }
virtual void advance(int phase);
@@ -1032,4 +1046,3 @@ QT_END_NAMESPACE
QT_END_HEADER
#endif // QGRAPHICSITEM_H
-
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index d03672b..bd81fe5 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -56,6 +56,8 @@
#include "qgraphicsitem.h"
#include "qpixmapcache.h"
+#include <QtCore/qpoint.h>
+
#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
QT_BEGIN_NAMESPACE
@@ -110,7 +112,8 @@ public:
ExtraMaxDeviceCoordCacheSize,
ExtraBoundingRegionGranularity,
ExtraOpacity,
- ExtraEffectiveOpacity
+ ExtraEffectiveOpacity,
+ ExtraDecomposedTransform
};
enum AncestorFlag {
@@ -154,6 +157,9 @@ public:
inSetPosHelper(0),
flags(0),
allChildrenCombineOpacity(1),
+ hasDecomposedTransform(0),
+ dirtyTransform(0),
+ dirtyTransformComponents(0),
globalStackingOrder(-1),
sceneTransformIndex(-1),
q_ptr(0)
@@ -341,17 +347,86 @@ public:
// New 32 bits
quint32 flags : 10;
quint32 allChildrenCombineOpacity : 1;
- quint32 padding : 21; // feel free to use
+ quint32 hasDecomposedTransform : 1;
+ quint32 dirtyTransform : 1;
+ quint32 dirtyTransformComponents : 1;
+ quint32 padding : 18; // feel free to use
// Optional stacking order
int globalStackingOrder;
int sceneTransformIndex;
+ struct DecomposedTransform;
+ DecomposedTransform *decomposedTransform() const
+ {
+ QGraphicsItemPrivate *that = const_cast<QGraphicsItemPrivate *>(this);
+ DecomposedTransform *decomposed;
+ if (hasDecomposedTransform) {
+ decomposed = qVariantValue<DecomposedTransform *>(extra(ExtraDecomposedTransform));
+ } else {
+ decomposed = new DecomposedTransform;
+ that->setExtra(ExtraDecomposedTransform, qVariantFromValue<DecomposedTransform *>(decomposed));
+ that->hasDecomposedTransform = 1;
+ if (!dirtyTransformComponents)
+ decomposed->reset();
+ }
+ if (dirtyTransformComponents) {
+ decomposed->initFrom(q_ptr->transform());
+ that->dirtyTransformComponents = 0;
+ }
+ return decomposed;
+ }
+
+ struct DecomposedTransform {
+ qreal xScale;
+ qreal yScale;
+ qreal xRotation;
+ qreal yRotation;
+ qreal zRotation;
+ qreal horizontalShear;
+ qreal verticalShear;
+ qreal xOrigin;
+ qreal yOrigin;
+
+ inline void reset()
+ {
+ xScale = 1.0;
+ yScale = 1.0;
+ xRotation = 0.0;
+ yRotation = 0.0;
+ zRotation = 0.0;
+ horizontalShear = 0.0;
+ verticalShear = 0.0;
+ xOrigin = 0.0;
+ yOrigin = 0.0;
+ }
+
+ inline void initFrom(const QTransform &x)
+ {
+ reset();
+ // ### decompose transform
+ Q_UNUSED(x);
+ }
+
+ inline void generateTransform(QTransform *x) const
+ {
+ x->translate(xOrigin, yOrigin);
+ x->rotate(xRotation, Qt::XAxis);
+ x->rotate(yRotation, Qt::YAxis);
+ x->rotate(zRotation, Qt::ZAxis);
+ x->shear(horizontalShear, verticalShear);
+ x->scale(xScale, yScale);
+ x->translate(-xOrigin, -yOrigin);
+ }
+ };
+
QGraphicsItem *q_ptr;
};
QT_END_NAMESPACE
+Q_DECLARE_METATYPE(QGraphicsItemPrivate::DecomposedTransform *)
+
#endif // QT_NO_GRAPHICSVIEW
#endif
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 1fbda85..1fc4567 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -4759,10 +4759,7 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte
}
// Find pixmap in cache.
- if (!itemCache->allExposed)
- pixmapFound = QPixmapCache::find(pixmapKey, &pix);
- else
- pixmapFound = false;
+ pixmapFound = QPixmapCache::find(pixmapKey, &pix);
// Render using item coordinate cache mode.
if (cacheMode == QGraphicsItem::ItemCoordinateCache) {
@@ -4787,6 +4784,12 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte
// Redraw any newly exposed areas.
if (itemCache->allExposed || !itemCache->exposed.isEmpty()) {
+
+ //We know that we will modify the pixmap, removing it from the cache
+ //will detach the one we have and avoid a deep copy
+ if (pixmapFound)
+ QPixmapCache::remove(pixmapKey);
+
// Fit the item's bounding rect into the pixmap's coordinates.
QTransform itemToPixmap;
if (fixedCacheSize) {
@@ -4815,12 +4818,8 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte
_q_paintIntoCache(&pix, item, pixmapExposed, itemToPixmap, painter->renderHints(),
&cacheOption, painterStateProtection);
- if (!pixmapFound) {
- // insert this pixmap into the cache.
- itemCache->key = QPixmapCache::insert(pix);
- } else {
- QPixmapCache::replace(pixmapKey, pix);
- }
+ // insert this pixmap into the cache.
+ itemCache->key = QPixmapCache::insert(pix);
// Reset expose data.
itemCache->allExposed = false;
@@ -4947,6 +4946,11 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte
// Check for newly invalidated areas.
if (itemCache->allExposed || !itemCache->exposed.isEmpty() || !scrollExposure.isEmpty()) {
+ //We know that we will modify the pixmap, removing it from the cache
+ //will detach the one we have and avoid a deep copy
+ if (pixmapFound)
+ QPixmapCache::remove(pixmapKey);
+
// Construct an item-to-pixmap transform.
QPointF p = deviceRect.topLeft();
QTransform itemToPixmap = painter->worldTransform();
@@ -4987,13 +4991,8 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte
}
if (pixModified) {
- if (!pixmapFound) {
- // Insert this pixmap into the cache.
- deviceData->key = QPixmapCache::insert(pix);
- } else {
- //otherwise we replace the pixmap in the cache
- QPixmapCache::replace(pixmapKey, pix);
- }
+ // Insert this pixmap into the cache.
+ deviceData->key = QPixmapCache::insert(pix);
}
// Redraw the exposed area using an untransformed painter. This
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 396618c..10b837a 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -200,16 +200,7 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime <
Note that setting a flag usually imposes a side effect, and this effect
can vary between paint devices and platforms.
- \value DontClipPainter QGraphicsView sometimes clips the painter when
- rendering the scene contents. This can generally improve performance
- (e.g., rendering only small parts of a large pixmap), and protects against
- rendering mistakes (e.g., drawing outside bounding rectangles, or outside
- the exposed area). In some situations, however, the painter clip can slow
- down rendering; especially when all painting is restricted to inside
- exposed areas. By enabling this flag, QGraphicsView will completely
- disable its implicit clipping. Note that rendering artifacts from using a
- semi-transparent foreground or background brush can occur if clipping is
- disabled.
+ \value DontClipPainter This value is obsolete and has no effect.
\value DontSavePainterState When rendering, QGraphicsView protects the
painter state (see QPainter::save()) when rendering the background or
@@ -3389,7 +3380,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
#ifdef QGRAPHICSVIEW_DEBUG
QTime stopWatch;
stopWatch.start();
- qDebug() << "QGraphicsView::paintEvent(" << exposedRegion << ")";
+ qDebug() << "QGraphicsView::paintEvent(" << exposedRegion << ')';
#endif
// Find all exposed items
diff --git a/src/gui/graphicsview/qgraphicsview.h b/src/gui/graphicsview/qgraphicsview.h
index e77e45c..c3ea6e5 100644
--- a/src/gui/graphicsview/qgraphicsview.h
+++ b/src/gui/graphicsview/qgraphicsview.h
@@ -110,7 +110,7 @@ public:
};
enum OptimizationFlag {
- DontClipPainter = 0x1,
+ DontClipPainter = 0x1, // obsolete
DontSavePainterState = 0x2,
DontAdjustForAntialiasing = 0x4
};
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 2e2f5ca..5302925 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -240,7 +240,55 @@ QT_BEGIN_NAMESPACE
/*!
\property QGraphicsWidget::pos
\brief the position of the widget
-*/
+*/
+
+/*!
+ \property QGraphicsWidget::xRotation
+ \since 4.6
+ \brief the rotation angle in degrees around the X axis
+*/
+
+/*!
+ \property QGraphicsWidget::yRotation
+ \since 4.6
+ \brief the rotation angle in degrees around the Y axis
+*/
+
+/*!
+ \property QGraphicsWidget::zRotation
+ \since 4.6
+ \brief the rotation angle in degrees around the Z axis
+*/
+
+/*!
+ \property QGraphicsWidget::xScale
+ \since 4.6
+ \brief the scale factor on the X axis.
+*/
+
+/*!
+ \property QGraphicsWidget::yScale
+ \since 4.6
+ \brief the scale factor on the Y axis.
+*/
+
+/*!
+ \property QGraphicsWidget::horizontalShear
+ \since 4.6
+ \brief the horizontal shear.
+*/
+
+/*!
+ \property QGraphicsWidget::verticalShear
+ \since 4.6
+ \brief the vertical shear.
+*/
+
+/*!
+ \property QGraphicsWidget::transformOrigin
+ \since 4.6
+ \brief the transformation origin for the transformation properties.
+*/
/*!
Constructs a QGraphicsWidget instance. The optional \a parent argument is
@@ -2337,7 +2385,7 @@ void QGraphicsWidget::dumpFocusChain()
qWarning("Found a focus chain that is not circular, (next == 0)");
break;
}
- qDebug() << i++ << QString::number(uint(next), 16) << next->className() << next->data(0) << QString::fromAscii("focusItem:%1").arg(next->hasFocus() ? "1" : "0") << QLatin1String("next:") << next->d_func()->focusNext->data(0) << QLatin1String("prev:") << next->d_func()->focusPrev->data(0);
+ qDebug() << i++ << QString::number(uint(next), 16) << next->className() << next->data(0) << QString::fromAscii("focusItem:%1").arg(next->hasFocus() ? '1' : '0') << QLatin1String("next:") << next->d_func()->focusNext->data(0) << QLatin1String("prev:") << next->d_func()->focusPrev->data(0);
if (visited.contains(next)) {
qWarning("Already visited this node. However, I expected to dump until I found myself.");
break;
diff --git a/src/gui/graphicsview/qgraphicswidget.h b/src/gui/graphicsview/qgraphicswidget.h
index 476ca1f..1a835df 100644
--- a/src/gui/graphicsview/qgraphicswidget.h
+++ b/src/gui/graphicsview/qgraphicswidget.h
@@ -59,7 +59,6 @@ class QGraphicsLayout;
class QGraphicsSceneMoveEvent;
class QGraphicsWidgetPrivate;
class QGraphicsSceneResizeEvent;
-class QGraphicsWidgetAnimator;
class QStyle;
class QStyleOption;
@@ -83,12 +82,14 @@ class Q_GUI_EXPORT QGraphicsWidget : public QObject, public QGraphicsItem, publi
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
Q_PROPERTY(QPointF pos READ pos WRITE setPos)
Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometry)
- Q_PROPERTY(qreal xScale READ xScale WRITE setXScale)
- Q_PROPERTY(qreal yScale READ yScale WRITE setYScale)
- Q_PROPERTY(qreal zRotation READ zRotation WRITE setZRotation)
+ Q_PROPERTY(QPointF transformOrigin READ transformOrigin WRITE setTransformOrigin)
Q_PROPERTY(qreal xRotation READ xRotation WRITE setXRotation)
Q_PROPERTY(qreal yRotation READ yRotation WRITE setYRotation)
-
+ Q_PROPERTY(qreal zRotation READ zRotation WRITE setZRotation)
+ Q_PROPERTY(qreal xScale READ xScale WRITE setXScale)
+ Q_PROPERTY(qreal yScale READ yScale WRITE setYScale)
+ Q_PROPERTY(qreal horizontalShear READ horizontalShear WRITE setHorizontalShear)
+ Q_PROPERTY(qreal verticalShear READ verticalShear WRITE setVerticalShear)
public:
QGraphicsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
~QGraphicsWidget();
diff --git a/src/gui/graphicsview/qgridlayoutengine.cpp b/src/gui/graphicsview/qgridlayoutengine.cpp
index c150b0e..88712c2 100644
--- a/src/gui/graphicsview/qgridlayoutengine.cpp
+++ b/src/gui/graphicsview/qgridlayoutengine.cpp
@@ -1131,9 +1131,9 @@ void QGridLayoutEngine::dump(int indent) const
QString message = QLatin1String("[ ");
for (int column = 0; column < internalGridColumnCount(); ++column) {
message += QString::number(q_items.indexOf(itemAt(row, column))).rightJustified(3);
- message += QLatin1String(" ");
+ message += QLatin1Char(' ');
}
- message += QLatin1String("]");
+ message += QLatin1Char(']');
qDebug("%*s %s", indent, "", qPrintable(message));
}
@@ -1157,7 +1157,7 @@ void QGridLayoutEngine::dump(int indent) const
message += QLatin1String((message.isEmpty() ? "[" : ", "));
message += QString::number(cellPos->at(i));
}
- message += QLatin1String("]");
+ message += QLatin1Char(']');
qDebug("%*s %s %s", indent, "", (pass == 0 ? "rows:" : "columns:"), qPrintable(message));
cellPos = &q_xx;
}
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 25c68bc..c1c5631 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -4853,8 +4853,6 @@ bool QImage::operator==(const QImage & i) const
return false;
if (d->format != Format_RGB32) {
- if (d->colortable != i.d->colortable)
- return false;
if (d->format >= Format_ARGB32) { // all bits defined
const int n = d->width * d->depth / 8;
if (n == d->bytes_per_line && n == i.d->bytes_per_line) {
@@ -4867,11 +4865,13 @@ bool QImage::operator==(const QImage & i) const
}
}
} else {
- int w = width();
- int h = height();
+ const int w = width();
+ const int h = height();
+ const QVector<QRgb> &colortable = d->colortable;
+ const QVector<QRgb> &icolortable = i.d->colortable;
for (int y=0; y<h; ++y) {
for (int x=0; x<w; ++x) {
- if (pixelIndex(x, y) != i.pixelIndex(x, y))
+ if (colortable[pixelIndex(x, y)] != icolortable[i.pixelIndex(x, y)])
return false;
}
}
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 3ca685c..8ed9e93 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -2050,4 +2050,99 @@ QPixmapData* QPixmap::pixmapData() const
return data;
}
+/*!
+ \enum QPixmap::HBitmapFormat
+
+ \bold{Win32 only:} This enum defines how the conversion between \c
+ HBITMAP and QPixmap is performed.
+
+ \warning This enum is only available on Windows.
+
+ \value NoAlpha The alpha channel is ignored and always treated as
+ being set to fully opaque. This is preferred if the \c HBITMAP is
+ used with standard GDI calls, such as \c BitBlt().
+
+ \value PremultipliedAlpha The \c HBITMAP is treated as having an
+ alpha channel and premultiplied colors. This is preferred if the
+ \c HBITMAP is accessed through the \c AlphaBlend() GDI function.
+
+ \value Alpha The \c HBITMAP is treated as having a plain alpha
+ channel. This is the preferred format if the \c HBITMAP is going
+ to be used as an application icon or systray icon.
+
+ \sa fromWinHBITMAP(), toWinHBITMAP()
+*/
+
+/*! \fn HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format) const
+ \bold{Win32 only:} Creates a \c HBITMAP equivalent to the QPixmap,
+ based on the given \a format. Returns the \c HBITMAP handle.
+
+ It is the caller's responsibility to free the \c HBITMAP data
+ after use.
+
+ \warning This function is only available on Windows.
+
+ \sa fromWinHBITMAP()
+*/
+
+/*! \fn QPixmap QPixmap::fromWinHBITMAP(HBITMAP bitmap, HBitmapFormat format)
+ \bold{Win32 only:} Returns a QPixmap that is equivalent to the
+ given \a bitmap. The conversion is based on the specified \a
+ format.
+
+ \warning This function is only available on Windows.
+
+ \sa toWinHBITMAP(), {QPixmap#Pixmap Conversion}{Pixmap Conversion}
+
+*/
+
+/*! \fn const QX11Info &QPixmap::x11Info() const
+ \bold{X11 only:} Returns information about the configuration of
+ the X display used to display the widget.
+
+ \warning This function is only available on X11.
+
+ \sa {QPixmap#Pixmap Information}{Pixmap Information}
+*/
+
+/*! \fn Qt::HANDLE QPixmap::x11PictureHandle() const
+ \bold{X11 only:} Returns the X11 Picture handle of the pixmap for
+ XRender support.
+
+ This function will return 0 if XRender support is not compiled
+ into Qt, if the XRender extension is not supported on the X11
+ display, or if the handle could not be created. Use of this
+ function is not portable.
+
+ \warning This function is only available on X11.
+
+ \sa {QPixmap#Pixmap Information}{Pixmap Information}
+*/
+
+/*! \fn int QPixmap::x11SetDefaultScreen(int screen)
+ \internal
+*/
+
+/*! \fn void QPixmap::x11SetScreen(int screen)
+ \internal
+*/
+
+/*! \fn QRgb* QPixmap::clut() const
+ \internal
+*/
+
+/*! \fn int QPixmap::numCols() const
+ \internal
+*/
+
+/*! \fn const uchar* QPixmap::qwsBits() const
+ \internal
+ \since 4.1
+*/
+
+/*! \fn int QPixmap::qwsBytesPerLine() const
+ \internal
+ \since 4.1
+*/
+
QT_END_NAMESPACE
diff --git a/src/gui/image/qpixmap_qws.cpp b/src/gui/image/qpixmap_qws.cpp
index 6cc7981..7e383ab 100644
--- a/src/gui/image/qpixmap_qws.cpp
+++ b/src/gui/image/qpixmap_qws.cpp
@@ -109,9 +109,6 @@ QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h)
return QPixmap::fromImage(img);
}
-/*!
- \internal
-*/
QRgb* QPixmap::clut() const
{
if (data->classId() == QPixmapData::RasterClass) {
@@ -122,9 +119,6 @@ QRgb* QPixmap::clut() const
return 0;
}
-/*!
- \internal
-*/
int QPixmap::numCols() const
{
if (data->classId() == QPixmapData::RasterClass) {
@@ -135,10 +129,6 @@ int QPixmap::numCols() const
return 0;
}
-/*!
- \internal
- \since 4.1
-*/
const uchar* QPixmap::qwsBits() const
{
if (data->classId() == QPixmapData::RasterClass) {
@@ -149,10 +139,6 @@ const uchar* QPixmap::qwsBits() const
return 0;
}
-/*!
- \internal
- \since 4.1
-*/
int QPixmap::qwsBytesPerLine() const
{
if (data->classId() == QPixmapData::RasterClass) {
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index b5556cd..29e4f3f 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -322,25 +322,36 @@ extern int qt_defaultDpiY();
int QRasterPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
{
+ QImageData *d = image.d;
+ if (!d)
+ return 0;
+
// override the image dpi with the screen dpi when rendering to a pixmap
- const int dpmX = qRound(qt_defaultDpiX() * 100 / qreal(2.54));
- const int dpmY = qRound(qt_defaultDpiY() * 100 / qreal(2.54));
switch (metric) {
+ case QPaintDevice::PdmWidth:
+ return d->width;
+ case QPaintDevice::PdmHeight:
+ return d->height;
case QPaintDevice::PdmWidthMM:
- return qRound(image.width() * 1000 / dpmX);
+ return qRound(d->width * 25.4 / qt_defaultDpiX());
case QPaintDevice::PdmHeightMM:
- return qRound(image.height() * 1000 / dpmY);
- case QPaintDevice::PdmDpiX:
- return qRound(dpmX * qreal(0.0254));
- case QPaintDevice::PdmDpiY:
- return qRound(dpmY * qreal(0.0254));
+ return qRound(d->width * 25.4 / qt_defaultDpiY());
+ case QPaintDevice::PdmNumColors:
+ return d->colortable.size();
+ case QPaintDevice::PdmDepth:
+ return d->depth;
+ case QPaintDevice::PdmDpiX: // fall-through
case QPaintDevice::PdmPhysicalDpiX:
- return qRound(dpmX * qreal(0.0254));
+ return qt_defaultDpiX();
+ case QPaintDevice::PdmDpiY: // fall-through
case QPaintDevice::PdmPhysicalDpiY:
- return qRound(dpmY * qreal(0.0254));
+ return qt_defaultDpiY();
default:
- return image.metric(metric);
+ qWarning("QRasterPixmapData::metric(): Unhandled metric type %d", metric);
+ break;
}
+
+ return 0;
}
QImage* QRasterPixmapData::buffer()
diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp
index d4ebef7..ac02f97 100644
--- a/src/gui/image/qpixmap_win.cpp
+++ b/src/gui/image/qpixmap_win.cpp
@@ -119,42 +119,6 @@ QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h )
return pixmap;
}
-
-
-/*!
- \enum QPixmap::HBitmapFormat
-
- This enum defines how the conversion between \c HBITMAP
- and QPixmap is performed.
-
- \warning This enum is only available on Windows.
-
- \value NoAlpha The alpha channel is ignored and always treated as
- being set to fully opaque. This is preferred if the \c HBITMAP is
- used with standard GDI calls, such as \c BitBlt().
-
- \value PremultipliedAlpha The \c HBITMAP is treated as having an
- alpha channel and premultiplied colors. This is preferred if the
- \c HBITMAP is accessed through the \c AlphaBlend() GDI function.
-
- \value Alpha The \c HBITMAP is treated as having a plain alpha
- channel. This is the preferred format if the \c HBITMAP is going
- to be used as an application icon or systray icon.
-
- \sa fromWinHBITMAP(), toWinHBITMAP()
-*/
-
-/*!
- Creates a \c HBITMAP equivalent to the QPixmap, based on the given
- \a format. Returns the \c HBITMAP handle.
-
- It is the caller's responsibility to free the \c HBITMAP data
- after use.
-
- \warning This function is only available on Windows.
-
- \sa fromWinHBITMAP()
-*/
HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format) const
{
HBITMAP bitmap = 0;
@@ -209,15 +173,6 @@ HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format) const
return bitmap;
}
-/*!
- Returns a QPixmap that is equivalent to the given \a bitmap. The
- conversion is based on the specified \a format.
-
- \warning This function is only available on Windows.
-
- \sa toWinHBITMAP(), {QPixmap#Pixmap Conversion}{Pixmap Conversion}
-
-*/
QPixmap QPixmap::fromWinHBITMAP(HBITMAP bitmap, HBitmapFormat format)
{
// Verify size
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index d9c10db..a0ae01f 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -1914,9 +1914,6 @@ QPixmap QX11PixmapData::transformed(const QTransform &transform,
}
}
-/*!
- \internal
-*/
int QPixmap::x11SetDefaultScreen(int screen)
{
int old = defaultScreen;
@@ -1924,9 +1921,6 @@ int QPixmap::x11SetDefaultScreen(int screen)
return old;
}
-/*!
- \internal
-*/
void QPixmap::x11SetScreen(int screen)
{
if (paintingActive()) {
@@ -2034,14 +2028,6 @@ bool QX11PixmapData::hasAlphaChannel() const
return d == 32;
}
-/*!
- Returns information about the configuration of the X display used to display
- the widget.
-
- \warning This function is only available on X11.
-
- \sa {QPixmap#Pixmap Information}{Pixmap Information}
-*/
const QX11Info &QPixmap::x11Info() const
{
if (data->classId() == QPixmapData::X11Class)
@@ -2098,20 +2084,6 @@ QPaintEngine* QX11PixmapData::paintEngine() const
return that->pengine;
}
-/*!
- Returns the X11 Picture handle of the pixmap for XRender
- support.
-
- This function will return 0 if XRender support is not compiled
- into Qt, if the XRender extension is not supported on the X11
- display, or if the handle could not be created. Use of this
- function is not portable.
-
- \warning This function is only available on X11.
-
- \sa {QPixmap#Pixmap Information}{Pixmap Information}
-*/
-
Qt::HANDLE QPixmap::x11PictureHandle() const
{
#ifndef QT_NO_XRENDER
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index 810ce65..82b42b4 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -128,6 +128,11 @@ bool QPixmapCache::Key::operator ==(const Key &key) const
}
/*!
+ \fn bool QPixmapCache::Key::operator !=(const Key &key) const
+ \internal
+*/
+
+/*!
\internal
*/
QPixmapCache::Key &QPixmapCache::Key::operator =(const Key &other)
@@ -183,7 +188,7 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include "qpixmapcache.moc"
QT_END_INCLUDE_NAMESPACE
-static uint qHash(const QPixmapCache::Key &k)
+uint qHash(const QPixmapCache::Key &k)
{
return qHash(QPMCache::get(k)->key);
}
@@ -337,8 +342,10 @@ bool QPMCache::remove(const QString &key)
bool QPMCache::remove(const QPixmapCache::Key &key)
{
+ bool result = QCache<QPixmapCache::Key, QDetachedPixmap>::remove(key);
+ //We release the key after we removed it from the cache
releaseKey(key);
- return QCache<QPixmapCache::Key, QDetachedPixmap>::remove(key);
+ return result;
}
void QPMCache::resizeKeyArray(int size)
@@ -431,8 +438,10 @@ bool QPixmapCache::find(const QString &key, QPixmap& pixmap)
/*!
Looks for a cached pixmap associated with the \a key in the cache.
- If the pixmap is found, the function sets \a pm to that pixmap and
- returns true; otherwise it leaves \a pm alone and returns false.
+ If the pixmap is found, the function sets \a pixmap to that pixmap and
+ returns true; otherwise it leaves \a pixmap alone and returns false.
+
+ \since 4.6
Example:
\snippet doc/src/snippets/code/src_gui_image_qpixmapcache.cpp 1
@@ -448,10 +457,12 @@ bool QPixmapCache::find(const QString &key, QPixmap* pixmap)
/*!
Looks for a cached pixmap associated with the \a key in the cache.
- If the pixmap is found, the function sets \a pm to that pixmap and
- returns true; otherwise it leaves \a pm alone and returns false. If
+ If the pixmap is found, the function sets \a pixmap to that pixmap and
+ returns true; otherwise it leaves \a pixmap alone and returns false. If
the pixmap is not found, it means that the \a key is not valid anymore,
so it will be released for the next insertion.
+
+ \since 4.6
*/
bool QPixmapCache::find(const Key &key, QPixmap* pixmap)
{
@@ -465,7 +476,7 @@ bool QPixmapCache::find(const Key &key, QPixmap* pixmap)
}
/*!
- Inserts a copy of the pixmap \a pm associated with the \a key into
+ Inserts a copy of the pixmap \a pixmap associated with the \a key into
the cache.
All pixmaps inserted by the Qt library have a key starting with
@@ -490,9 +501,8 @@ bool QPixmapCache::insert(const QString &key, const QPixmap &pixmap)
}
/*!
- Inserts a copy of the pixmap \a pm into
- the cache and return you the key. The key is always greater than 0.
- If the key is equals 0 then the insertion failed.
+ Inserts a copy of the pixmap \a pixmap into
+ the cache and return you the key.
When a pixmap is inserted and the cache is about to exceed its
limit, it removes pixmaps until there is enough room for the
@@ -502,6 +512,8 @@ bool QPixmapCache::insert(const QString &key, const QPixmap &pixmap)
deleted when more space is needed.
\sa setCacheLimit(), replace()
+
+ \since 4.6
*/
QPixmapCache::Key QPixmapCache::insert(const QPixmap &pixmap)
{
@@ -510,10 +522,12 @@ QPixmapCache::Key QPixmapCache::insert(const QPixmap &pixmap)
/*!
Replace the pixmap associated to the \a key into
- the cache. It return true if the pixmap \a pm has been correctly
+ the cache. It return true if the pixmap \a pixmap has been correctly
inserted into the cache false otherwise.
\sa setCacheLimit(), insert()
+
+ \since 4.6
*/
bool QPixmapCache::replace(const Key &key, const QPixmap &pixmap)
{
@@ -563,6 +577,8 @@ void QPixmapCache::remove(const QString &key)
/*!
Removes the pixmap associated with \a key from the cache and release
the key for a future insertion.
+
+ \since 4.6
*/
void QPixmapCache::remove(const Key &key)
{
diff --git a/src/gui/image/qpixmapcache_p.h b/src/gui/image/qpixmapcache_p.h
index 5aa6eaf..a35e0d2 100644
--- a/src/gui/image/qpixmapcache_p.h
+++ b/src/gui/image/qpixmapcache_p.h
@@ -60,6 +60,8 @@
QT_BEGIN_NAMESPACE
+uint qHash(const QPixmapCache::Key &k);
+
class QPixmapCache::KeyData
{
public:
diff --git a/src/gui/image/qpixmapdatafactory_p.h b/src/gui/image/qpixmapdatafactory_p.h
index 65e3f11..9604346 100644
--- a/src/gui/image/qpixmapdatafactory_p.h
+++ b/src/gui/image/qpixmapdatafactory_p.h
@@ -65,7 +65,7 @@ QT_MODULE(Gui)
class QPixmapData;
-class Q_GUI_EXPORT QPixmapDataFactory
+class QPixmapDataFactory
{
public:
static QPixmapDataFactory* instance(int screen = 0);
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp
index 8631c8c..4e6adc0 100644
--- a/src/gui/image/qpixmapfilter.cpp
+++ b/src/gui/image/qpixmapfilter.cpp
@@ -401,6 +401,7 @@ static void convolute(
}
yk++;
}
+ delete[] fixedKernel;
}
/*!
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp
index 90bd2ab..f4062ad 100644
--- a/src/gui/image/qxpmhandler.cpp
+++ b/src/gui/image/qxpmhandler.cpp
@@ -1146,7 +1146,7 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const
QTextStream s(device);
s << "/* XPM */" << endl
<< "static char *" << fbname(fileName) << "[]={" << endl
- << "\"" << w << " " << h << " " << ncolors << " " << cpp << "\"";
+ << '\"' << w << ' ' << h << ' ' << ncolors << ' ' << cpp << '\"';
// write palette
QMap<QRgb, int>::Iterator c = colorMap.begin();
@@ -1162,7 +1162,7 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const
qGreen(color),
qBlue(color));
++c;
- s << "," << endl << line;
+ s << ',' << endl << line;
}
// write pixels, limit to 4 characters per pixel
@@ -1184,7 +1184,7 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const
}
}
}
- s << "," << endl << "\"" << line << "\"";
+ s << ',' << endl << '\"' << line << '\"';
}
s << "};" << endl;
return (s.status() == QTextStream::Ok);
diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp
index 054f4cf..434bcde 100644
--- a/src/gui/itemviews/qfileiconprovider.cpp
+++ b/src/gui/itemviews/qfileiconprovider.cpp
@@ -215,8 +215,7 @@ QIcon QFileIconProvider::icon(IconType type) const
QIcon QFileIconProviderPrivate::getWinIcon(const QFileInfo &fileInfo) const
{
QIcon retIcon;
- QString fileExtension = fileInfo.suffix().toUpper();
- fileExtension.prepend( QLatin1String(".") );
+ const QString fileExtension = QLatin1Char('.') + fileInfo.suffix().toUpper();
QString key;
if (fileInfo.isFile() && !fileInfo.isExecutable() && !fileInfo.isSymLink())
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index 6238df5..ad93922 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -1267,8 +1267,10 @@ void QHeaderView::setSortIndicator(int logicalIndex, Qt::SortOrder order)
d->sortIndicatorSection = logicalIndex;
d->sortIndicatorOrder = order;
- if (logicalIndex >= d->sectionCount)
+ if (logicalIndex >= d->sectionCount) {
+ emit sortIndicatorChanged(logicalIndex, order);
return; // nothing to do
+ }
if (old != logicalIndex
&& ((logicalIndex >= 0 && resizeMode(logicalIndex) == ResizeToContents)
diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp
index 3b7eb2d..a748199 100644
--- a/src/gui/itemviews/qitemdelegate.cpp
+++ b/src/gui/itemviews/qitemdelegate.cpp
@@ -47,6 +47,7 @@
#include <qbrush.h>
#include <qlineedit.h>
#include <qtextedit.h>
+#include <qplaintextedit.h>
#include <qpainter.h>
#include <qpalette.h>
#include <qpoint.h>
@@ -1194,7 +1195,7 @@ bool QItemDelegate::eventFilter(QObject *object, QEvent *event)
case Qt::Key_Enter:
case Qt::Key_Return:
#ifndef QT_NO_TEXTEDIT
- if (qobject_cast<QTextEdit*>(editor))
+ if (qobject_cast<QTextEdit *>(editor) || qobject_cast<QPlainTextEdit *>(editor))
return false; // don't filter enter key events for QTextEdit
// We want the editor to be able to process the key press
// before committing the data (e.g. so it can do
diff --git a/src/gui/itemviews/qitemselectionmodel.cpp b/src/gui/itemviews/qitemselectionmodel.cpp
index 8baefdf..696b8fa 100644
--- a/src/gui/itemviews/qitemselectionmodel.cpp
+++ b/src/gui/itemviews/qitemselectionmodel.cpp
@@ -1553,7 +1553,7 @@ QDebug operator<<(QDebug dbg, const QItemSelectionRange &range)
{
#ifndef Q_BROKEN_DEBUG_STREAM
dbg.nospace() << "QItemSelectionRange(" << range.topLeft()
- << "," << range.bottomRight() << ")";
+ << ',' << range.bottomRight() << ')';
return dbg.space();
#else
qWarning("This compiler doesn't support streaming QItemSelectionRange to QDebug");
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index 1071c1d..8b50d0e 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -1973,10 +1973,16 @@ void QListViewPrivate::prepareItemsLayout()
int frameAroundContents = 0;
if (q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents))
frameAroundContents = q->style()->pixelMetric(QStyle::PM_DefaultFrameWidth) * 2;
- int verticalMargin = vbarpolicy==Qt::ScrollBarAlwaysOff ? 0 :
- q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, q->verticalScrollBar()) + frameAroundContents;
- int horizontalMargin = hbarpolicy==Qt::ScrollBarAlwaysOff ? 0 :
- q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, q->horizontalScrollBar()) + frameAroundContents;
+
+ // maximumViewportSize() already takes scrollbar into account if policy is
+ // Qt::ScrollBarAlwaysOn but scrollbar extent must be deduced if policy
+ // is Qt::ScrollBarAsNeeded
+ int verticalMargin = vbarpolicy==Qt::ScrollBarAsNeeded
+ ? q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, q->verticalScrollBar()) + frameAroundContents
+ : 0;
+ int horizontalMargin = hbarpolicy==Qt::ScrollBarAsNeeded
+ ? q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, q->horizontalScrollBar()) + frameAroundContents
+ : 0;
layoutBounds.adjust(0, 0, -verticalMargin, -horizontalMargin);
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp
index 56925b8..96eb6f0 100644
--- a/src/gui/itemviews/qsortfilterproxymodel.cpp
+++ b/src/gui/itemviews/qsortfilterproxymodel.cpp
@@ -1539,7 +1539,8 @@ void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
d->clear_mapping();
reset();
- d->update_source_sort_column();
+ if (d->update_source_sort_column() && d->dynamic_sortfilter)
+ d->sort();
}
/*!
diff --git a/src/gui/itemviews/qstyleditemdelegate.cpp b/src/gui/itemviews/qstyleditemdelegate.cpp
index be0971b..7f2c8ed 100644
--- a/src/gui/itemviews/qstyleditemdelegate.cpp
+++ b/src/gui/itemviews/qstyleditemdelegate.cpp
@@ -47,6 +47,7 @@
#include <qbrush.h>
#include <qlineedit.h>
#include <qtextedit.h>
+#include <qplaintextedit.h>
#include <qpainter.h>
#include <qpalette.h>
#include <qpoint.h>
@@ -646,7 +647,7 @@ bool QStyledItemDelegate::eventFilter(QObject *object, QEvent *event)
case Qt::Key_Enter:
case Qt::Key_Return:
#ifndef QT_NO_TEXTEDIT
- if (qobject_cast<QTextEdit*>(editor))
+ if (qobject_cast<QTextEdit *>(editor) || qobject_cast<QPlainTextEdit *>(editor))
return false; // don't filter enter key events for QTextEdit
// We want the editor to be able to process the key press
// before committing the data (e.g. so it can do
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index 757ecf2..0bded54 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -282,7 +282,7 @@ void QTableViewPrivate::trimHiddenSelections(QItemSelectionRange *range) const
void QTableViewPrivate::setSpan(int row, int column, int rowSpan, int columnSpan)
{
if (row < 0 || column < 0 || rowSpan <= 0 || columnSpan <= 0) {
- qWarning() << "QTableView::setSpan: invalid span given: (" << row << "," << column << "," << rowSpan << "," << columnSpan << ")";
+ qWarning() << "QTableView::setSpan: invalid span given: (" << row << ',' << column << ',' << rowSpan << ',' << columnSpan << ')';
return;
}
QSpanCollection::Span *sp = spans.spanAt(column, row);
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index d742698..7837700 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -246,7 +246,7 @@ void QTreeView::setModel(QAbstractItemModel *model)
connect(d->model, SIGNAL(modelAboutToBeReset()), SLOT(_q_modelAboutToBeReset()));
if (d->sortingEnabled)
- sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder());
+ d->_q_sortIndicatorChanged(header()->sortIndicatorSection(), header()->sortIndicatorOrder());
}
/*!
@@ -844,17 +844,19 @@ void QTreeView::setExpanded(const QModelIndex &index, bool expanded)
void QTreeView::setSortingEnabled(bool enable)
{
Q_D(QTreeView);
- d->sortingEnabled = enable;
header()->setSortIndicatorShown(enable);
header()->setClickable(enable);
if (enable) {
- connect(header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),
- this, SLOT(_q_sortIndicatorChanged(int, Qt::SortOrder)));
+ //sortByColumn has to be called before we connect or set the sortingEnabled flag
+ // because otherwise it will not call sort on the model.
sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder());
+ connect(header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),
+ this, SLOT(_q_sortIndicatorChanged(int, Qt::SortOrder)), Qt::UniqueConnection);
} else {
disconnect(header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),
this, SLOT(_q_sortIndicatorChanged(int, Qt::SortOrder)));
}
+ d->sortingEnabled = enable;
}
bool QTreeView::isSortingEnabled() const
diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp
index 1125610..ea52e11 100644
--- a/src/gui/kernel/qapplication_qws.cpp
+++ b/src/gui/kernel/qapplication_qws.cpp
@@ -194,7 +194,7 @@ QString qws_dataDir()
static QString result;
if (!result.isEmpty())
return result;
- QByteArray dataDir = QString(QLatin1String("/tmp/qtembedded-%1")).arg(qws_display_id).toLocal8Bit();
+ QByteArray dataDir = QString::fromLatin1("/tmp/qtembedded-%1").arg(qws_display_id).toLocal8Bit();
if (QT_MKDIR(dataDir, 0700)) {
if (errno != EEXIST) {
qFatal("Cannot create Qt for Embedded Linux data directory: %s", dataDir.constData());
@@ -215,7 +215,7 @@ QString qws_dataDir()
if ((buf.st_mode & 0677) != 0600)
qFatal("Qt for Embedded Linux data directory has incorrect permissions: %s", dataDir.constData());
#endif
- dataDir += "/";
+ dataDir += '/';
result = QString::fromLocal8Bit(dataDir);
return result;
@@ -224,7 +224,7 @@ QString qws_dataDir()
// Get the filename of the pipe Qt for Embedded Linux uses for server/client comms
Q_GUI_EXPORT QString qws_qtePipeFilename()
{
- return (qws_dataDir() + QString(QLatin1String(QTE_PIPE)).arg(qws_display_id));
+ return (qws_dataDir() + QString::fromLatin1(QTE_PIPE).arg(qws_display_id));
}
static void setMaxWindowRect(const QRect &rect)
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 6237657..670058b 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -376,11 +376,6 @@ QRgb qt_colorref2qrgb(COLORREF col)
Internal variables and functions
*****************************************************************************/
-extern Q_CORE_EXPORT char theAppName[];
-extern Q_CORE_EXPORT char appFileName[];
-extern Q_CORE_EXPORT HINSTANCE appInst; // handle to app instance
-extern Q_CORE_EXPORT HINSTANCE appPrevInst; // handle to prev app instance
-extern Q_CORE_EXPORT int appCmdShow; // main window show command
static HWND curWin = 0; // current window
static HDC displayDC = 0; // display device context
@@ -752,20 +747,11 @@ void qt_init(QApplicationPrivate *priv, int)
priv->argc = j;
}
- // Get the application name/instance if qWinMain() was not invoked
#ifndef Q_WS_WINCE
// No message boxes but important ones
SetErrorMode(SetErrorMode(0) | SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX);
#endif
- if (appInst == 0) {
- QT_WA({
- appInst = GetModuleHandle(0);
- }, {
- appInst = GetModuleHandleA(0);
- });
- }
-
#ifndef Q_WS_WINCE
// Initialize OLE/COM
// S_OK means success and S_FALSE means that it has already
@@ -790,7 +776,7 @@ void qt_init(QApplicationPrivate *priv, int)
#ifndef QT_NO_CURSOR
QCursorData::initialize();
#endif
- qApp->setObjectName(QLatin1String(theAppName));
+ qApp->setObjectName(priv->appName());
#if !defined(Q_WS_WINCE)
// default font
@@ -888,12 +874,6 @@ void qt_cleanup()
Platform specific global and internal functions
*****************************************************************************/
-Q_GUI_EXPORT int qWinAppCmdShow() // get main window show command
-{
- return appCmdShow;
-}
-
-
Q_GUI_EXPORT HDC qt_win_display_dc() // get display DC
{
Q_ASSERT(qApp && qApp->thread() == QThread::currentThread());
@@ -975,8 +955,8 @@ const QString qt_reg_winclass(QWidget *w) // register window class
wchar_t uniqueAppID[256];
GetModuleFileNameW(0, uniqueAppID, 255);
cname = QString::number(RegisterWindowMessageW(
- (const wchar_t *) QString::fromUtf16((const ushort *)uniqueAppID).toLower().replace(QString(QString::fromLatin1("\\")),
- QString(QString::fromLatin1("_"))).utf16()));
+ (const wchar_t *) QString::fromUtf16((const ushort *)uniqueAppID).toLower().replace(QLatin1Char('\\'),
+ QLatin1Char('_')).utf16()));
#endif
// since multiple Qt versions can be used in one process
@@ -989,11 +969,11 @@ const QString qt_reg_winclass(QWidget *w) // register window class
if (classExists == -1) {
QT_WA({
WNDCLASS wcinfo;
- classExists = GetClassInfo((HINSTANCE)qWinAppInst(), (TCHAR*)cname.utf16(), &wcinfo);
+ classExists = GetClassInfo(qWinAppInst(), (TCHAR*)cname.utf16(), &wcinfo);
classExists = classExists && wcinfo.lpfnWndProc != QtWndProc;
}, {
WNDCLASSA wcinfo;
- classExists = GetClassInfoA((HINSTANCE)qWinAppInst(), cname.toLatin1(), &wcinfo);
+ classExists = GetClassInfoA(qWinAppInst(), cname.toLatin1(), &wcinfo);
classExists = classExists && wcinfo.lpfnWndProc != QtWndProc;
});
}
@@ -1013,9 +993,9 @@ const QString qt_reg_winclass(QWidget *w) // register window class
wc.lpfnWndProc = (WNDPROC)QtWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
- wc.hInstance = (HINSTANCE)qWinAppInst();
+ wc.hInstance = qWinAppInst();
if (icon) {
- wc.hIcon = LoadIcon(appInst, L"IDI_ICON1");
+ wc.hIcon = LoadIcon(qWinAppInst(), L"IDI_ICON1");
if (!wc.hIcon)
wc.hIcon = LoadIcon(0, IDI_APPLICATION);
} else {
@@ -1032,9 +1012,9 @@ const QString qt_reg_winclass(QWidget *w) // register window class
wc.lpfnWndProc = (WNDPROC)QtWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
- wc.hInstance = (HINSTANCE)qWinAppInst();
+ wc.hInstance = qWinAppInst();
if (icon) {
- wc.hIcon = LoadIconA(appInst, (char*)"IDI_ICON1");
+ wc.hIcon = LoadIconA(qWinAppInst(), (char*)"IDI_ICON1");
if (!wc.hIcon)
wc.hIcon = LoadIconA(0, (char*)IDI_APPLICATION);
} else {
@@ -1053,9 +1033,9 @@ const QString qt_reg_winclass(QWidget *w) // register window class
wc.lpfnWndProc = (WNDPROC)QtWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
- wc.hInstance = (HINSTANCE)qWinAppInst();
+ wc.hInstance = qWinAppInst();
if (icon) {
- wc.hIcon = LoadIcon(appInst, L"IDI_ICON1");
+ wc.hIcon = LoadIcon(qWinAppInst(), L"IDI_ICON1");
// if (!wc.hIcon)
// wc.hIcon = LoadIcon(0, IDI_APPLICATION);
} else {
@@ -1089,9 +1069,9 @@ static void unregWinClasses()
QHash<QString, int>::ConstIterator it = hash->constBegin();
while (it != hash->constEnd()) {
QT_WA({
- UnregisterClass((TCHAR*)it.key().utf16(), (HINSTANCE)qWinAppInst());
+ UnregisterClass((TCHAR*)it.key().utf16(), qWinAppInst());
} , {
- UnregisterClassA(it.key().toLatin1(), (HINSTANCE)qWinAppInst());
+ UnregisterClassA(it.key().toLatin1(), qWinAppInst());
});
++it;
}
@@ -1126,7 +1106,7 @@ void qWinRequestConfig(WId id, int req, int x, int y, int w, int h)
configRequests->append(r); // store request in queue
}
-Q_GUI_EXPORT void qWinProcessConfigRequests() // perform requests in queue
+static void qWinProcessConfigRequests() // perform requests in queue
{
if (!configRequests)
return;
@@ -1672,20 +1652,23 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
// send the context menu event is a different one
if (!alienWidget->testAttribute(Qt::WA_NativeWindow) && !alienWidget->testAttribute(Qt::WA_PaintOnScreen)) {
alienWidget = QApplication::widgetAt(globalPos);
- pos = alienWidget->mapFromGlobal(globalPos);
+ if (alienWidget)
+ pos = alienWidget->mapFromGlobal(globalPos);
}
- SHRGINFO shrg;
- shrg.cbSize = sizeof(shrg);
- shrg.hwndClient = hwnd;
- shrg.ptDown.x = GET_X_LPARAM(lParam);
- shrg.ptDown.y = GET_Y_LPARAM(lParam);
- shrg.dwFlags = SHRG_RETURNCMD | SHRG_NOANIMATION;
- resolveAygLibs();
- if (ptrRecognizeGesture && (ptrRecognizeGesture(&shrg) == GN_CONTEXTMENU)) {
- if (qApp->activePopupWidget())
- qApp->activePopupWidget()->close();
- QContextMenuEvent e(QContextMenuEvent::Mouse, pos, globalPos);
- result = qt_sendSpontaneousEvent(alienWidget, &e);
+ if (alienWidget) {
+ SHRGINFO shrg;
+ shrg.cbSize = sizeof(shrg);
+ shrg.hwndClient = hwnd;
+ shrg.ptDown.x = GET_X_LPARAM(lParam);
+ shrg.ptDown.y = GET_Y_LPARAM(lParam);
+ shrg.dwFlags = SHRG_RETURNCMD | SHRG_NOANIMATION;
+ resolveAygLibs();
+ if (ptrRecognizeGesture && (ptrRecognizeGesture(&shrg) == GN_CONTEXTMENU)) {
+ if (qApp->activePopupWidget())
+ qApp->activePopupWidget()->close();
+ QContextMenuEvent e(QContextMenuEvent::Mouse, pos, globalPos);
+ result = qt_sendSpontaneousEvent(alienWidget, &e);
+ }
}
}
}
diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
index 9a24645..2ca6a3d 100644
--- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
+++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
@@ -90,6 +90,7 @@
QT_BEGIN_NAMESPACE
extern void onApplicationChangedActivation(bool); // qapplication_mac.mm
+extern void qt_release_apple_event_handler(); //qapplication_mac.mm
QT_END_NAMESPACE
QT_FORWARD_DECLARE_CLASS(QDesktopWidgetImplementation)
@@ -207,7 +208,6 @@ static void cleanupCocoaApplicationDelegate()
{
Q_UNUSED(aNotification);
inLaunch = false;
- extern void qt_release_apple_event_handler(); //qapplication_mac.mm
qt_release_apple_event_handler();
}
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 1cbc960..838f751 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -791,10 +791,22 @@ extern "C" {
bool wheelOK = false;
Qt::KeyboardModifiers keyMods = qt_cocoaModifiers2QtModifiers([theEvent modifierFlags]);
+ QWidget *widgetToGetMouse = qwidget;
+ if (widgetToGetMouse->testAttribute(Qt::WA_TransparentForMouseEvents)) {
+ // Simulate passing the event through since Cocoa doesn't do that for us.
+ // Start by building a tree up.
+ NSView *candidateView = [self viewUnderTransparentForMouseView:self
+ widget:widgetToGetMouse
+ withWindowPoint:windowPoint];
+ if (candidateView != nil) {
+ widgetToGetMouse = QWidget::find(WId(candidateView));
+ }
+ }
+
// Mouse wheel deltas seem to tick in at increments of 0.1. Qt widgets
- // expect the delta to be a multiple of 120.
+ // expect the delta to be a multiple of 120.
const int ScrollFactor = 10 * 120;
- // The qMax(...) factor reduces the
+ // The qMax(...) factor reduces the
// acceleration for large wheel deltas.
int deltaX = [theEvent deltaX] * ScrollFactor * qMax(0.6, 1.1 - qAbs([theEvent deltaX]));
int deltaY = [theEvent deltaY] * ScrollFactor * qMax(0.6, 1.1 - qAbs([theEvent deltaY]));
@@ -802,10 +814,10 @@ extern "C" {
if (deltaX != 0) {
QWheelEvent qwe(qlocal, qglobal, deltaX, buttons, keyMods, Qt::Horizontal);
- qt_sendSpontaneousEvent(qwidget, &qwe);
+ qt_sendSpontaneousEvent(widgetToGetMouse, &qwe);
wheelOK = qwe.isAccepted();
if (!wheelOK && QApplicationPrivate::focus_widget
- && QApplicationPrivate::focus_widget != qwidget) {
+ && QApplicationPrivate::focus_widget != widgetToGetMouse) {
QWheelEvent qwe2(QApplicationPrivate::focus_widget->mapFromGlobal(qglobal), qglobal,
deltaX, buttons, keyMods, Qt::Horizontal);
qt_sendSpontaneousEvent(QApplicationPrivate::focus_widget, &qwe2);
@@ -815,10 +827,10 @@ extern "C" {
if (deltaY) {
QWheelEvent qwe(qlocal, qglobal, deltaY, buttons, keyMods, Qt::Vertical);
- qt_sendSpontaneousEvent(qwidget, &qwe);
+ qt_sendSpontaneousEvent(widgetToGetMouse, &qwe);
wheelOK = qwe.isAccepted();
if (!wheelOK && QApplicationPrivate::focus_widget
- && QApplicationPrivate::focus_widget != qwidget) {
+ && QApplicationPrivate::focus_widget != widgetToGetMouse) {
QWheelEvent qwe2(QApplicationPrivate::focus_widget->mapFromGlobal(qglobal), qglobal,
deltaY, buttons, keyMods, Qt::Vertical);
qt_sendSpontaneousEvent(QApplicationPrivate::focus_widget, &qwe2);
@@ -830,10 +842,10 @@ extern "C" {
// Qt doesn't explicitly support wheels with a Z component. In a misguided attempt to
// try to be ahead of the pack, I'm adding this extra value.
QWheelEvent qwe(qlocal, qglobal, deltaZ, buttons, keyMods, (Qt::Orientation)3);
- qt_sendSpontaneousEvent(qwidget, &qwe);
+ qt_sendSpontaneousEvent(widgetToGetMouse, &qwe);
wheelOK = qwe.isAccepted();
if (!wheelOK && QApplicationPrivate::focus_widget
- && QApplicationPrivate::focus_widget != qwidget) {
+ && QApplicationPrivate::focus_widget != widgetToGetMouse) {
QWheelEvent qwe2(QApplicationPrivate::focus_widget->mapFromGlobal(qglobal), qglobal,
deltaZ, buttons, keyMods, (Qt::Orientation)3);
qt_sendSpontaneousEvent(QApplicationPrivate::focus_widget, &qwe2);
diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h
index 1d4e3e4..be4501f3 100644
--- a/src/gui/kernel/qcocoaview_mac_p.h
+++ b/src/gui/kernel/qcocoaview_mac_p.h
@@ -59,6 +59,7 @@ QT_FORWARD_DECLARE_CLASS(QWidgetPrivate);
QT_FORWARD_DECLARE_CLASS(QWidget);
QT_FORWARD_DECLARE_CLASS(QEvent);
QT_FORWARD_DECLARE_CLASS(QCocoaDropData);
+QT_FORWARD_DECLARE_CLASS(QStringList);
QT_BEGIN_NAMESPACE
struct DnDParams
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index ed7e020..598f4ba 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -375,7 +375,9 @@ void QCursorData::cleanup()
return;
for (int shape = 0; shape <= Qt::LastCursor; ++shape) {
- delete qt_cursorTable[shape];
+ // In case someone has a static QCursor defined with this shape
+ if (!qt_cursorTable[shape]->ref.deref())
+ delete qt_cursorTable[shape];
qt_cursorTable[shape] = 0;
}
QCursorData::initialized = false;
diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h
index 7a0cb7a..9871658 100644
--- a/src/gui/kernel/qdnd_p.h
+++ b/src/gui/kernel/qdnd_p.h
@@ -202,7 +202,7 @@ public:
#endif
};
-class Q_GUI_EXPORT QDragManager: public QObject {
+class QDragManager: public QObject {
Q_OBJECT
QDragManager();
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index c8d40d8..8c8911e 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -3120,7 +3120,7 @@ QDebug operator<<(QDebug dbg, const QEvent *e) {
<< ", " << me->button()
<< ", " << hex << (int)me->buttons()
<< ", " << hex << (int)me->modifiers()
- << ")";
+ << ')';
}
return dbg.space();
@@ -3141,7 +3141,7 @@ QDebug operator<<(QDebug dbg, const QEvent *e) {
#ifndef QT_NO_WHEELEVENT
case QEvent::Wheel:
dbg.nospace() << "QWheelEvent(" << static_cast<const QWheelEvent *>(e)->delta()
- << ")";
+ << ')';
return dbg.space();
#endif
case QEvent::KeyPress:
@@ -3167,7 +3167,7 @@ QDebug operator<<(QDebug dbg, const QEvent *e) {
<< ", \"" << ke->text()
<< "\", " << ke->isAutoRepeat()
<< ", " << ke->count()
- << ")";
+ << ')';
}
return dbg.space();
case QEvent::FocusIn:
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index d1cb572..ee45969 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -145,7 +145,7 @@ static int qtkeyForMacSymbol(const QChar ch)
#else
static bool qt_sequence_no_mnemonics = false;
#endif
-void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemonics = !b; }
+void Q_AUTOTEST_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemonics = !b; }
/*!
\class QKeySequence
@@ -652,8 +652,6 @@ const uint QKeySequencePrivate::numberOfKeyBindings = sizeof(QKeySequencePrivate
This enum represent standard key bindings. They can be used to
assign platform dependent keyboard shortcuts to a QAction.
- QKeyEvent also provides the function QKeyEvent::standardKey() to
- query if it matches an existing key binding.
Note that the key bindings are platform dependent. The currently
bound shortcuts can be queried using keyBindings().
diff --git a/src/gui/kernel/qlayoutengine.cpp b/src/gui/kernel/qlayoutengine.cpp
index fbaa388..3673f08 100644
--- a/src/gui/kernel/qlayoutengine.cpp
+++ b/src/gui/kernel/qlayoutengine.cpp
@@ -329,7 +329,7 @@ void qGeomCalc(QVector<QLayoutStruct> &chain, int start, int count,
qDebug() << "qGeomCalc" << "start" << start << "count" << count << "pos" << pos
<< "space" << space << "spacer" << spacer;
for (i = start; i < start + count; ++i) {
- qDebug() << i << ":" << chain[i].minimumSize << chain[i].smartSizeHint()
+ qDebug() << i << ':' << chain[i].minimumSize << chain[i].smartSizeHint()
<< chain[i].maximumSize << "stretch" << chain[i].stretch
<< "empty" << chain[i].empty << "expansive" << chain[i].expansive
<< "spacing" << chain[i].spacing;
diff --git a/src/gui/kernel/qmime_mac.cpp b/src/gui/kernel/qmime_mac.cpp
index b2eeb5c..9cb8b61 100644
--- a/src/gui/kernel/qmime_mac.cpp
+++ b/src/gui/kernel/qmime_mac.cpp
@@ -218,7 +218,7 @@ QString QMacPasteboardMimeAny::flavorFor(const QString &mime)
if(mime == QLatin1String("application/x-qt-mime-type-name"))
return QString();
QString ret = QLatin1String("com.trolltech.anymime.") + mime;
- return ret.replace(QLatin1String("/"), QLatin1String("--"));
+ return ret.replace(QLatin1Char('/'), QLatin1String("--"));
}
QString QMacPasteboardMimeAny::mimeFor(QString flav)
@@ -394,7 +394,7 @@ QString QMacPasteboardMimeUnicodeText::flavorFor(const QString &mime)
int i = mime.indexOf(QLatin1String("charset="));
if (i >= 0) {
QString cs(mime.mid(i+8).toLower());
- i = cs.indexOf(QLatin1String(";"));
+ i = cs.indexOf(QLatin1Char(';'));
if (i>=0)
cs = cs.left(i);
if (cs == QLatin1String("system"))
diff --git a/src/gui/kernel/qmime_win.cpp b/src/gui/kernel/qmime_win.cpp
index cd0aae6..ad2dec1 100644
--- a/src/gui/kernel/qmime_win.cpp
+++ b/src/gui/kernel/qmime_win.cpp
@@ -852,7 +852,7 @@ QVariant QWindowsMimeHtml::convertToMime(const QString &mime, IDataObject *pData
if (end > start && start > 0) {
html = "<!--StartFragment-->" + html.mid(start, end - start);
html += "<!--EndFragment-->";
- html.replace("\r", "");
+ html.replace('\r', "");
result = QString::fromUtf8(html);
}
}
@@ -1262,16 +1262,16 @@ QVector<FORMATETC> QLastResortMimes::formatsForMime(const QString &mimeType, con
}
return formatetcs;
}
-static const char *x_qt_windows_mime = "application/x-qt-windows-mime;value=\"";
+static const char x_qt_windows_mime[] = "application/x-qt-windows-mime;value=\"";
-bool isCustomMimeType(const QString &mimeType)
+static bool isCustomMimeType(const QString &mimeType)
{
return mimeType.startsWith(QLatin1String(x_qt_windows_mime), Qt::CaseInsensitive);
}
-QString customMimeType(const QString &mimeType)
+static QString customMimeType(const QString &mimeType)
{
- int len = QString(QLatin1String(x_qt_windows_mime)).length();
+ int len = sizeof(x_qt_windows_mime) - 1;
int n = mimeType.lastIndexOf(QLatin1Char('\"'))-len;
return mimeType.mid(len, n);
}
diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp
index f998bb2..3c2fcdd 100644
--- a/src/gui/kernel/qshortcutmap.cpp
+++ b/src/gui/kernel/qshortcutmap.cpp
@@ -109,7 +109,7 @@ QDebug &operator<<(QDebug &dbg, const QShortcutEntry *se) {
dbg.nospace()
<< "QShortcutEntry(" << se->keyseq
<< "), id(" << se->id << "), enabled(" << se->enabled << "), autorepeat(" << se->autorepeat
- << "), owner(" << se->owner << ")";
+ << "), owner(" << se->owner << ')';
return dbg.space();
}
#endif // QT_NO_DEBUGSTREAM
@@ -876,7 +876,7 @@ void QShortcutMap::dispatchEvent(QKeyEvent *e)
qDebug().nospace()
<< "QShortcutMap::dispatchEvent(): Sending QShortcutEvent(\""
<< (QString)next->keyseq << "\", " << next->id << ", "
- << (bool)(enabledShortcuts>1) << ") to object(" << next->owner << ")";
+ << (bool)(enabledShortcuts>1) << ") to object(" << next->owner << ')';
#endif
QShortcutEvent se(next->keyseq, next->id, enabledShortcuts>1);
QApplication::sendEvent(const_cast<QObject *>(next->owner), &se);
diff --git a/src/gui/kernel/qsound_qws.cpp b/src/gui/kernel/qsound_qws.cpp
index e83935f..661544f 100644
--- a/src/gui/kernel/qsound_qws.cpp
+++ b/src/gui/kernel/qsound_qws.cpp
@@ -279,7 +279,7 @@ QAuBucketQWS::QAuBucketQWS( QAuServerQWS *server, QSound *sound, QObject* parent
sound->setObjectName( m_id.toString() );
- m_channel = new QCopChannel(QString( QLatin1String("QPE/QSound/") ).append( m_id ), this );
+ m_channel = new QCopChannel(QLatin1String("QPE/QSound/") + m_id ), this );
connect( m_channel, SIGNAL(received(QString,QByteArray)),
this, SLOT(processMessage(QString,QByteArray)) );
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index d94abb1..c9f624f 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -5236,7 +5236,7 @@ static QString constructWindowTitleFromFilePath(const QString &filePath)
#ifndef Q_WS_MAC
QString appName = QApplication::applicationName();
if (!appName.isEmpty())
- windowTitle += QLatin1String(" ") + QChar(0x2014) + QLatin1String(" ") + appName;
+ windowTitle += QLatin1Char(' ') + QChar(0x2014) + QLatin1Char(' ') + appName;
#endif
return windowTitle;
}
@@ -5300,7 +5300,7 @@ QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widg
&& widget->style()->styleHint(QStyle::SH_TitleBar_ModifyNotification, 0, widget))
cap.replace(lastIndex, 3, QWidget::tr("*"));
else
- cap.replace(lastIndex, 3, QLatin1String(""));
+ cap.remove(lastIndex, 3);
}
index = cap.indexOf(placeHolder, index);
@@ -9203,11 +9203,12 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
d->resolveLayoutDirection();
d->resolveLocale();
- // Note: GL widgets under Windows will always need a ParentChange
- // event to handle recreation/rebinding of the GL context, hence
- // the (f & Qt::MSWindowsOwnDC) clause
+ // Note: GL widgets under WGL or EGL will always need a ParentChange
+ // event to handle recreation/rebinding of the GL context, hence the
+ // (f & Qt::MSWindowsOwnDC) clause (which is set on QGLWidgets on all
+ // platforms).
if (newParent
-#ifdef Q_WS_WIN
+#if defined(Q_WS_WIN) || defined(QT_OPENGL_ES)
|| (f & Qt::MSWindowsOwnDC)
#endif
) {
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index b35740a..7e41ea1 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -893,15 +893,28 @@ void QWidgetPrivate::x11UpdateIsOpaque()
int screen = xinfo.screen();
if (topLevel && X11->use_xrender
&& X11->argbVisuals[screen] && xinfo.depth() != 32) {
- // recreate widget
- QPoint pos = q->pos();
- bool visible = q->isVisible();
- if (visible)
- q->hide();
- q->setParent(q->parentWidget(), q->windowFlags());
- q->move(pos);
- if (visible)
- q->show();
+
+ if (q->inherits("QGLWidget")) {
+ // We send QGLWidgets a ParentChange event which causes them to
+ // recreate their GL context, which in turn causes them to choose
+ // their visual again. Now that WA_TranslucentBackground is set,
+ // QGLContext::chooseVisual will select an ARGB visual.
+ QEvent e(QEvent::ParentChange);
+ QApplication::sendEvent(q, &e);
+ }
+ else {
+ // For regular widgets, reparent them with their parent which
+ // also triggers a recreation of the native window
+ QPoint pos = q->pos();
+ bool visible = q->isVisible();
+ if (visible)
+ q->hide();
+
+ q->setParent(q->parentWidget(), q->windowFlags());
+ q->move(pos);
+ if (visible)
+ q->show();
+ }
}
#endif
}
diff --git a/src/gui/kernel/qwindowdefs_win.h b/src/gui/kernel/qwindowdefs_win.h
index 3899c23..a24afd4 100644
--- a/src/gui/kernel/qwindowdefs_win.h
+++ b/src/gui/kernel/qwindowdefs_win.h
@@ -122,7 +122,7 @@ QT_BEGIN_NAMESPACE
Q_CORE_EXPORT HINSTANCE qWinAppInst();
Q_CORE_EXPORT HINSTANCE qWinAppPrevInst();
-Q_GUI_EXPORT int qWinAppCmdShow();
+Q_CORE_EXPORT int qWinAppCmdShow();
Q_GUI_EXPORT HDC qt_win_display_dc();
QT_END_NAMESPACE
diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp
index 7ed521e..6a206ee 100644
--- a/src/gui/painting/qbezier.cpp
+++ b/src/gui/painting/qbezier.cpp
@@ -673,10 +673,10 @@ static int IntersectBB(const QBezier &a, const QBezier &b)
#ifdef QDEBUG_BEZIER
static QDebug operator<<(QDebug dbg, const QBezier &bz)
{
- dbg <<"["<<bz.x1<<", "<<bz.y1<<"], "
- <<"["<<bz.x2<<", "<<bz.y2<<"], "
- <<"["<<bz.x3<<", "<<bz.y3<<"], "
- <<"["<<bz.x4<<", "<<bz.y4<<"]";
+ dbg << '[' << bz.x1<< ", " << bz.y1 << "], "
+ << '[' << bz.x2 <<", " << bz.y2 << "], "
+ << '[' << bz.x3 <<", " << bz.y3 << "], "
+ << '[' << bz.x4 <<", " << bz.y4 << ']';
return dbg;
}
#endif
diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp
index 8f4a2bf..4bdaf0b 100644
--- a/src/gui/painting/qblendfunctions.cpp
+++ b/src/gui/painting/qblendfunctions.cpp
@@ -104,6 +104,37 @@ struct Blend_RGB16_on_RGB16_ConstAlpha {
quint32 m_ialpha;
};
+struct Blend_ARGB24_on_RGB16_SourceAlpha {
+ inline void write(quint16 *dst, const qargb8565 &src) {
+ const uint alpha = src.alpha();
+ if (alpha) {
+ quint16 s = src.rawValue16();
+ if (alpha < 255)
+ s += BYTE_MUL_RGB16(*dst, 255 - alpha);
+ *dst = s;
+ }
+ }
+};
+
+struct Blend_ARGB24_on_RGB16_SourceAndConstAlpha {
+ inline Blend_ARGB24_on_RGB16_SourceAndConstAlpha(quint32 alpha) {
+ m_alpha = (alpha * 255) >> 8;
+ }
+
+ inline void write(quint16 *dst, qargb8565 src) {
+ src = src.byte_mul(src.alpha(m_alpha));
+ const uint alpha = src.alpha();
+ if (alpha) {
+ quint16 s = src.rawValue16();
+ if (alpha < 255)
+ s += BYTE_MUL_RGB16(*dst, 255 - alpha);
+ *dst = s;
+ }
+ }
+
+ quint32 m_alpha;
+};
+
struct Blend_ARGB32_on_RGB16_SourceAlpha {
inline void write(quint16 *dst, quint32 src) {
const quint8 alpha = qAlpha(src);
@@ -237,6 +268,32 @@ void qt_scale_image_rgb16_on_rgb16(uchar *destPixels, int dbpl,
}
}
+void qt_scale_image_argb24_on_rgb16(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &sourceRect,
+ const QRect &clip,
+ int const_alpha)
+{
+#ifdef QT_DEBUG_DRAW
+ printf("qt_scale_argb24_on_rgb16: dst=(%p, %d), src=(%p, %d), target=(%d, %d), [%d x %d], src=(%d, %d) [%d x %d] alpha=%d\n",
+ destPixels, dbpl, srcPixels, sbpl,
+ targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(),
+ sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height(),
+ const_alpha);
+#endif
+ if (const_alpha == 256) {
+ Blend_ARGB24_on_RGB16_SourceAlpha noAlpha;
+ qt_scale_image_16bit<qargb8565>(destPixels, dbpl, srcPixels, sbpl,
+ targetRect, sourceRect, clip, noAlpha);
+ } else {
+ Blend_ARGB24_on_RGB16_SourceAndConstAlpha constAlpha(const_alpha);
+ qt_scale_image_16bit<qargb8565>(destPixels, dbpl, srcPixels, sbpl,
+ targetRect, sourceRect, clip, constAlpha);
+ }
+}
+
+
void qt_scale_image_argb32_on_rgb16(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
const QRectF &targetRect,
@@ -874,7 +931,7 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] =
0, // Format_ARGB32,
qt_scale_image_argb32_on_rgb16, // Format_ARGB32_Premultiplied,
qt_scale_image_rgb16_on_rgb16, // Format_RGB16,
- 0, // Format_ARGB8565_Premultiplied,
+ qt_scale_image_argb24_on_rgb16, // Format_ARGB8565_Premultiplied,
0, // Format_RGB666,
0, // Format_ARGB6666_Premultiplied,
0, // Format_RGB555,
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 534a425..b1fe3aa 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -2022,12 +2022,12 @@ QDebug operator<<(QDebug dbg, const QColor &c)
if (!c.isValid())
dbg.nospace() << "QColor(Invalid)";
else if (c.spec() == QColor::Rgb)
- dbg.nospace() << "QColor(ARGB " << c.alphaF() << ", " << c.redF() << ", " << c.greenF() << ", " << c.blueF() << ")";
+ dbg.nospace() << "QColor(ARGB " << c.alphaF() << ", " << c.redF() << ", " << c.greenF() << ", " << c.blueF() << ')';
else if (c.spec() == QColor::Hsv)
- dbg.nospace() << "QColor(AHSV " << c.alphaF() << ", " << c.hueF() << ", " << c.saturationF() << ", " << c.valueF() << ")";
+ dbg.nospace() << "QColor(AHSV " << c.alphaF() << ", " << c.hueF() << ", " << c.saturationF() << ", " << c.valueF() << ')';
else if (c.spec() == QColor::Cmyk)
dbg.nospace() << "QColor(ACMYK " << c.alphaF() << ", " << c.cyanF() << ", " << c.magentaF() << ", " << c.yellowF() << ", "
- << c.blackF()<< ")";
+ << c.blackF()<< ')';
return dbg.space();
#else
@@ -2241,4 +2241,12 @@ QDataStream &operator>>(QDataStream &stream, QColor &color)
\sa QColor::rgb(), QColor::rgba()
*/
+/*! \fn void QColormap::initialize()
+ \internal
+*/
+
+/*! \fn void QColormap::cleanup()
+ \internal
+*/
+
QT_END_NAMESPACE
diff --git a/src/gui/painting/qcolormap_x11.cpp b/src/gui/painting/qcolormap_x11.cpp
index ccf6955..c9186b1 100644
--- a/src/gui/painting/qcolormap_x11.cpp
+++ b/src/gui/painting/qcolormap_x11.cpp
@@ -337,8 +337,6 @@ static void init_direct(QColormapPrivate *d, bool ownColormap)
static QColormap **cmaps = 0;
-/*! \internal
-*/
void QColormap::initialize()
{
Display *display = QX11Info::display();
@@ -578,8 +576,6 @@ void QColormap::initialize()
}
}
-/*! \internal
-*/
void QColormap::cleanup()
{
Display *display = QX11Info::display();
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index de97683..38fee8d 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -110,6 +110,7 @@ struct QSpanData;
class QGradient;
class QRasterBuffer;
class QClipData;
+class QRasterPaintEngineState;
typedef QT_FT_SpanFunc ProcessSpans;
typedef void (*BitmapBlitFunc)(QRasterBuffer *rasterBuffer,
@@ -293,7 +294,7 @@ struct QSpanData
};
void init(QRasterBuffer *rb, const QRasterPaintEngine *pe);
- void setup(const QBrush &brush, int alpha);
+ void setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode);
void setupMatrix(const QTransform &matrix, int bilinear);
void initTexture(const QImage *image, int alpha, QTextureData::Type = QTextureData::Plain, const QRect &sourceRect = QRect());
void adjustSpanMethods();
@@ -446,6 +447,7 @@ public:
inline bool operator==(const qargb8565 &v) const;
inline quint32 rawValue() const;
+ inline quint16 rawValue16() const;
private:
friend class qrgb565;
@@ -462,7 +464,7 @@ public:
inline explicit qrgb565(quint32p v);
inline explicit qrgb565(quint32 v);
- inline explicit qrgb565(qargb8565 v);
+ inline explicit qrgb565(const qargb8565 &v);
inline operator quint32() const;
inline operator quint16() const;
@@ -568,6 +570,11 @@ quint32 qargb8565::rawValue() const
return (data[2] << 16) | (data[1] << 8) | data[0];
}
+quint16 qargb8565::rawValue16() const
+{
+ return (data[2] << 8) | data[1];
+}
+
qrgb565::qrgb565(quint32p v)
{
*this = qrgb565(quint32(v));
@@ -582,7 +589,7 @@ qrgb565::qrgb565(quint32 v)
data = (r & 0xf800) | (g & 0x07e0)| (b & 0x001f);
}
-qrgb565::qrgb565(qargb8565 v)
+qrgb565::qrgb565(const qargb8565 &v)
{
data = (v.data[2] << 8) | v.data[1];
}
diff --git a/src/gui/painting/qgraphicssystemfactory_p.h b/src/gui/painting/qgraphicssystemfactory_p.h
index 9e95324..523b908 100644
--- a/src/gui/painting/qgraphicssystemfactory_p.h
+++ b/src/gui/painting/qgraphicssystemfactory_p.h
@@ -63,7 +63,7 @@ QT_MODULE(Gui)
class QGraphicsSystem;
-class Q_GUI_EXPORT QGraphicsSystemFactory
+class QGraphicsSystemFactory
{
public:
static QStringList keys();
diff --git a/src/gui/painting/qgraphicssystemplugin_p.h b/src/gui/painting/qgraphicssystemplugin_p.h
index 2e70333..ea7aa2d 100644
--- a/src/gui/painting/qgraphicssystemplugin_p.h
+++ b/src/gui/painting/qgraphicssystemplugin_p.h
@@ -64,7 +64,7 @@ QT_MODULE(Gui)
class QGraphicsSystem;
-struct Q_GUI_EXPORT QGraphicsSystemFactoryInterface : public QFactoryInterface
+struct QGraphicsSystemFactoryInterface : public QFactoryInterface
{
virtual QGraphicsSystem *create(const QString &key) = 0;
};
diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp
index 31abcad..030415d 100644
--- a/src/gui/painting/qmatrix.cpp
+++ b/src/gui/painting/qmatrix.cpp
@@ -1178,7 +1178,7 @@ QDebug operator<<(QDebug dbg, const QMatrix &m)
<< " 22=" << m.m22()
<< " dx=" << m.dx()
<< " dy=" << m.dy()
- << ")";
+ << ')';
return dbg.space();
}
#endif
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 5b7ae48..3f85095 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -139,7 +139,6 @@ extern bool qt_cleartype_enabled;
* Span functions
*/
static void qt_span_fill_clipRect(int count, const QSpan *spans, void *userData);
-static void qt_span_fill_clipRegion(int count, const QSpan *spans, void *userData);
static void qt_span_fill_clipped(int count, const QSpan *spans, void *userData);
static void qt_span_clip(int count, const QSpan *spans, void *userData);
static void qt_merge_clip(const QClipData *c1, const QClipData *c2, QClipData *result);
@@ -363,7 +362,8 @@ void QRasterPaintEngine::init()
d->basicStroker.setCubicToHook(qt_ft_outline_cubic_to);
d->dashStroker = 0;
- d->baseClip = 0;
+ d->baseClip = new QClipData(d->device->height());
+ d->baseClip->setClipRect(QRect(0, 0, d->device->width(), d->device->height()));
d->image_filler.init(d->rasterBuffer, this);
d->image_filler.type = QSpanData::Texture;
@@ -447,6 +447,8 @@ QRasterPaintEngine::~QRasterPaintEngine()
delete d->outlineMapper;
delete d->rasterizer;
delete d->dashStroker;
+
+ delete d->baseClip;
}
/*!
@@ -483,12 +485,12 @@ bool QRasterPaintEngine::begin(QPaintDevice *device)
d->rasterizer->setClipRect(d->deviceRect);
s->penData.init(d->rasterBuffer, this);
- s->penData.setup(s->pen.brush(), s->intOpacity);
+ s->penData.setup(s->pen.brush(), s->intOpacity, s->composition_mode);
s->stroker = &d->basicStroker;
d->basicStroker.setClipRect(d->deviceRect);
s->brushData.init(d->rasterBuffer, this);
- s->brushData.setup(s->brush, s->intOpacity);
+ s->brushData.setup(s->brush, s->intOpacity, s->composition_mode);
d->rasterBuffer->compositionMode = QPainter::CompositionMode_SourceOver;
@@ -534,19 +536,14 @@ bool QRasterPaintEngine::begin(QPaintDevice *device)
*/
bool QRasterPaintEngine::end()
{
- Q_D(QRasterPaintEngine);
#ifdef QT_DEBUG_DRAW
+ Q_D(QRasterPaintEngine);
qDebug() << "QRasterPaintEngine::end devRect:" << d->deviceRect;
if (d->baseClip) {
dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), d->baseClip);
}
#endif
- if (d->baseClip) {
- delete d->baseClip;
- d->baseClip = 0;
- }
-
return true;
}
@@ -773,7 +770,7 @@ void QRasterPaintEngine::updatePen(const QPen &pen)
s->strokeFlags = 0;
s->penData.clip = d->clip();
- s->penData.setup(pen_style == Qt::NoPen ? QBrush() : pen.brush(), s->intOpacity);
+ s->penData.setup(pen_style == Qt::NoPen ? QBrush() : pen.brush(), s->intOpacity, s->composition_mode);
if (s->strokeFlags & QRasterPaintEngine::DirtyTransform
|| pen.brush().transform().type() >= QTransform::TxNone) {
@@ -873,7 +870,7 @@ void QRasterPaintEngine::updateBrush(const QBrush &brush)
QRasterPaintEngineState *s = state();
// must set clip prior to setup, as setup uses it...
s->brushData.clip = d->clip();
- s->brushData.setup(brush, s->intOpacity);
+ s->brushData.setup(brush, s->intOpacity, s->composition_mode);
if (s->fillFlags & DirtyTransform
|| brush.transform().type() >= QTransform::TxNone)
d_func()->updateMatrixData(&s->brushData, brush, d->brushMatrix());
@@ -1028,6 +1025,10 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt,
{
if (alpha == 0 || !clip.isValid())
return;
+
+ if (alpha ==0)
+ return;
+
Q_ASSERT(img.depth() >= 8);
int srcBPL = img.bytesPerLine();
@@ -1096,11 +1097,10 @@ void QRasterPaintEnginePrivate::systemStateChanged()
if (!systemClip.isEmpty()) {
QRegion clippedDeviceRgn = systemClip & clipRect;
deviceRect = clippedDeviceRgn.boundingRect();
- delete baseClip;
- baseClip = new QClipData(device->height());
baseClip->setClipRegion(clippedDeviceRgn);
} else {
deviceRect = clipRect;
+ baseClip->setClipRect(deviceRect);
}
#ifdef QT_DEBUG_DRAW
qDebug() << "systemStateChanged" << this << "deviceRect" << deviceRect << clipRect << systemClip;
@@ -1172,6 +1172,25 @@ static void checkClipRatios(QRasterPaintEnginePrivate *d)
}
#endif
+static void qrasterpaintengine_state_setNoClip(QRasterPaintEngineState *s)
+{
+ if (s->flags.has_clip_ownership)
+ delete s->clip;
+ s->clip = 0;
+ s->flags.has_clip_ownership = false;
+}
+
+static void qrasterpaintengine_dirty_clip(QRasterPaintEnginePrivate *d, QRasterPaintEngineState *s)
+{
+ s->fillFlags |= QPaintEngine::DirtyClipPath;
+ s->strokeFlags |= QPaintEngine::DirtyClipPath;
+ s->pixmapFlags |= QPaintEngine::DirtyClipPath;
+
+ d->solid_color_filler.clip = d->clip();
+ d->solid_color_filler.adjustSpanMethods();
+}
+
+
/*!
\internal
*/
@@ -1183,12 +1202,12 @@ void QRasterPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
if (path.elements()) {
for (int i=0; i<path.elementCount(); ++i) {
qDebug() << " - " << path.elements()[i]
- << "(" << path.points()[i*2] << ", " << path.points()[i*2+1] << ")";
+ << '(' << path.points()[i*2] << ", " << path.points()[i*2+1] << ')';
}
} else {
for (int i=0; i<path.elementCount(); ++i) {
qDebug() << " ---- "
- << "(" << path.points()[i*2] << ", " << path.points()[i*2+1] << ")";
+ << '(' << path.points()[i*2] << ", " << path.points()[i*2+1] << ')';
}
}
#endif
@@ -1220,10 +1239,7 @@ void QRasterPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
}
if (op == Qt::NoClip) {
- if (s->flags.has_clip_ownership)
- delete s->clip;
- s->clip = 0;
- s->flags.has_clip_ownership = false;
+ qrasterpaintengine_state_setNoClip(s);
} else {
QClipData *base = d->baseClip;
@@ -1265,17 +1281,7 @@ void QRasterPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
s->clip = newClip;
s->flags.has_clip_ownership = true;
}
-
- s->fillFlags |= DirtyClipPath;
- s->strokeFlags |= DirtyClipPath;
- s->pixmapFlags |= DirtyClipPath;
-
- d->solid_color_filler.clip = d->clip();
- d->solid_color_filler.adjustSpanMethods();
-
-#ifdef QT_CLIPPING_RATIOS
- checkClipRatios(d);
-#endif
+ qrasterpaintengine_dirty_clip(d, s);
}
@@ -1293,10 +1299,7 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op)
QRasterPaintEngineState *s = state();
if (op == Qt::NoClip) {
- if (s->flags.has_clip_ownership)
- delete s->clip;
- s->clip = d->baseClip;
- s->flags.has_clip_ownership = false;
+ qrasterpaintengine_state_setNoClip(s);
} else if (op == Qt::UniteClip || s->matrix.type() > QTransform::TxScale) {
QPaintEngineEx::clip(rect, op);
@@ -1340,37 +1343,63 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op)
return;
}
}
-
- s->brushData.clip = d->clip();
- s->penData.clip = d->clip();
-
- s->fillFlags |= DirtyClipPath;
- s->strokeFlags |= DirtyClipPath;
- s->pixmapFlags |= DirtyClipPath;
-
- d->solid_color_filler.clip = d->clip();
- d->solid_color_filler.adjustSpanMethods();
-
-
-#ifdef QT_CLIPPING_RATIOS
- checkClipRatios(d);
-#endif
+ qrasterpaintengine_dirty_clip(d, s);
}
+
/*!
\internal
*/
void QRasterPaintEngine::clip(const QRegion &region, Qt::ClipOperation op)
{
- QPaintEngineEx::clip(region, op);
-}
+#ifdef QT_DEBUG_DRAW
+ qDebug() << "QRasterPaintEngine::clip(): " << region << op;
+#endif
-/*!
- \internal
-*/
-void QRasterPaintEngine::clip(const QPainterPath &path, Qt::ClipOperation op)
-{
- QPaintEngineEx::clip(path, op);
+ Q_D(QRasterPaintEngine);
+
+ if (region.numRects() == 1) {
+ clip(region.boundingRect(), op);
+ return;
+ }
+
+ QRasterPaintEngineState *s = state();
+ const QClipData *clip = d->clip();
+ const QClipData *baseClip = d->baseClip;
+
+ if (op == Qt::NoClip) {
+ qrasterpaintengine_state_setNoClip(s);
+ } else if (s->matrix.type() > QTransform::TxScale
+ || op == Qt::UniteClip
+ || (op == Qt::IntersectClip && !clip->hasRectClip && !clip->hasRegionClip)
+ || (op == Qt::ReplaceClip && !baseClip->hasRectClip && !baseClip->hasRegionClip)) {
+ QPaintEngineEx::clip(region, op);
+ } else {
+ const QClipData *curClip;
+ QClipData *newClip;
+
+ if (op == Qt::IntersectClip)
+ curClip = clip;
+ else
+ curClip = baseClip;
+
+ if (s->flags.has_clip_ownership) {
+ newClip = s->clip;
+ Q_ASSERT(newClip);
+ } else {
+ newClip = new QClipData(d->rasterBuffer->height());
+ s->clip = newClip;
+ s->flags.has_clip_ownership = true;
+ }
+
+ QRegion r = s->matrix.map(region);
+ if (curClip->hasRectClip)
+ newClip->setClipRegion(r & curClip->clipRect);
+ else if (curClip->hasRegionClip)
+ newClip->setClipRegion(r & clip->clipRegion);
+
+ qrasterpaintengine_dirty_clip(d, s);
+ }
}
/*!
@@ -1412,7 +1441,7 @@ static void fillRect_normalized(const QRect &r, QSpanData *data,
{
int x1, x2, y1, y2;
- bool rectClipped = false;
+ bool rectClipped = true;
if (data->clip) {
x1 = qMax(r.x(), data->clip->xmin);
@@ -1742,12 +1771,17 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
static inline QRect toNormalizedFillRect(const QRectF &rect)
{
- const int x1 = qRound(rect.x() + aliasedCoordinateDelta);
- const int y1 = qRound(rect.y() + aliasedCoordinateDelta);
- const int x2 = qRound(rect.right() + aliasedCoordinateDelta);
- const int y2 = qRound(rect.bottom() + aliasedCoordinateDelta);
+ int x1 = int(rect.x() + aliasedCoordinateDelta);
+ int y1 = int(rect.y() + aliasedCoordinateDelta);
+ int x2 = int(rect.right() + aliasedCoordinateDelta);
+ int y2 = int(rect.bottom() + aliasedCoordinateDelta);
+
+ if (x2 < x1)
+ qSwap(x1, x2);
+ if (y2 < y1)
+ qSwap(y1, y2);
- return QRect(x1, y1, x2 - x1, y2 - y1).normalized();
+ return QRect(x1, y1, x2 - x1, y2 - y1);
}
/*!
@@ -1907,9 +1941,12 @@ void QRasterPaintEngine::fillRect(const QRectF &r, const QColor &color)
QRasterPaintEngineState *s = state();
d->solid_color_filler.solid.color = PREMUL(ARGB_COMBINE_ALPHA(color.rgba(), s->intOpacity));
+ if ((d->solid_color_filler.solid.color & 0xff000000) == 0
+ && s->composition_mode == QPainter::CompositionMode_SourceOver) {
+ return;
+ }
d->solid_color_filler.clip = d->clip();
d->solid_color_filler.adjustSpanMethods();
-
fillRect(r, &d->solid_color_filler);
}
@@ -3076,7 +3113,7 @@ bool QRasterPaintEnginePrivate::isUnclipped_normalized(const QRect &r) const
if (cl->clipRect == deviceRect)
return true;
- if (cl->hasRegionClip) {
+ if (cl->hasRectClip) {
// inline contains() for performance (we know the rects are normalized)
const QRect &r1 = cl->clipRect;
return (r.left() >= r1.left() && r.right() <= r1.right()
@@ -4307,6 +4344,7 @@ void QClipData::initialize()
m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight);
m_spans = (QSpan *)malloc(clipSpanHeight*sizeof(QSpan));
+ allocated = clipSpanHeight;
if (hasRectClip) {
int y = 0;
@@ -4351,6 +4389,7 @@ void QClipData::initialize()
int y = 0;
int firstInBand = 0;
+ count = 0;
while (firstInBand < numRects) {
const int currMinY = rects.at(firstInBand).y();
const int currMaxY = currMinY + rects.at(firstInBand).height();
@@ -4411,20 +4450,39 @@ void QClipData::fixup()
ymax = m_spans[count-1].y + 1;
xmin = INT_MAX;
xmax = 0;
+
+ bool isRect = true;
+ int left = m_spans[0].x;
+ int right = m_spans[0].x + m_spans[0].len;
+
for (int i = 0; i < count; ++i) {
-// qDebug() << " " << spans[i].x << spans[i].y << spans[i].len << spans[i].coverage;
if (m_spans[i].y != y) {
+ if (m_spans[i].y != y + 1 && y != -1) {
+ isRect = false;
+ }
y = m_spans[i].y;
m_clipLines[y].spans = m_spans+i;
m_clipLines[y].count = 0;
// qDebug() << " new line: y=" << y;
}
++m_clipLines[y].count;
+ int sl = (int) m_spans[i].x;
+ int sr = sl + m_spans[i].len;
+
xmin = qMin(xmin, (int)m_spans[i].x);
xmax = qMax(xmax, (int)m_spans[i].x + m_spans[i].len);
+
+ if (sl != left || sr != right)
+ isRect = false;
}
++xmax;
-// qDebug("xmin=%d,xmax=%d,ymin=%d,ymax=%d", xmin, xmax, ymin, ymax);
+// qDebug("xmin=%d,xmax=%d,ymin=%d,ymax=%d %s", xmin, xmax, ymin, ymax, isRect ? "rectangular" : "");
+
+ if (isRect) {
+ hasRectClip = true;
+ clipRect.setRect(xmin, ymin, xmax - xmin, ymax - ymin);
+ }
+
}
/*
@@ -4437,6 +4495,7 @@ void QClipData::setClipRect(const QRect &rect)
// qDebug() << "setClipRect" << clipSpanHeight << count << allocated << rect;
hasRectClip = true;
+ hasRegionClip = false;
clipRect = rect;
xmin = rect.x();
@@ -4445,7 +4504,7 @@ void QClipData::setClipRect(const QRect &rect)
ymax = qMin(rect.y() + rect.height(), clipSpanHeight);
if (m_spans) {
- delete m_spans;
+ free(m_spans);
m_spans = 0;
}
@@ -4463,6 +4522,7 @@ void QClipData::setClipRegion(const QRegion &region)
}
hasRegionClip = true;
+ hasRectClip = false;
clipRegion = region;
{ // set bounding rect
@@ -4474,7 +4534,7 @@ void QClipData::setClipRegion(const QRegion &region)
}
if (m_spans) {
- delete m_spans;
+ free(m_spans);
m_spans = 0;
}
@@ -4722,29 +4782,6 @@ static void qt_span_fill_clipRect(int count, const QSpan *spans,
fillData->unclipped_blend(count, spans, fillData);
}
-static void qt_span_fill_clipRegion(int count, const QSpan *spans,
- void *userData)
-{
- QSpanData *fillData = reinterpret_cast<QSpanData *>(userData);
- Q_ASSERT(fillData->blend && fillData->unclipped_blend);
-
- Q_ASSERT(fillData->clip);
- Q_ASSERT(!fillData->clip->clipRegion.isEmpty());
-
- const int NSPANS = 256;
- QSpan cspans[NSPANS];
- int currentClip = 0;
- while (currentClip < count) {
- const int unclipped = qt_intersect_spans(const_cast<QSpan*>(spans),
- count, &currentClip,
- &cspans[0], NSPANS,
- fillData->clip->clipRegion);
- if (unclipped > 0)
- fillData->unclipped_blend(unclipped, cspans, fillData);
- }
-
-}
-
static void qt_span_clip(int count, const QSpan *spans, void *userData)
{
ClipData *clipData = reinterpret_cast<ClipData *>(userData);
@@ -5017,7 +5054,7 @@ void QSpanData::init(QRasterBuffer *rb, const QRasterPaintEngine *pe)
extern QImage qt_imageForBrush(int brushStyle, bool invert);
-void QSpanData::setup(const QBrush &brush, int alpha)
+void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode)
{
Qt::BrushStyle brushStyle = qbrush_style(brush);
switch (brushStyle) {
@@ -5025,6 +5062,10 @@ void QSpanData::setup(const QBrush &brush, int alpha)
type = Solid;
QColor c = qbrush_color(brush);
solid.color = PREMUL(ARGB_COMBINE_ALPHA(c.rgba(), alpha));
+ if ((solid.color & 0xff000000) == 0
+ && compositionMode == QPainter::CompositionMode_SourceOver) {
+ type = None;
+ }
break;
}
@@ -5165,8 +5206,6 @@ void QSpanData::adjustSpanMethods()
blend = unclipped_blend;
} else if (clip->hasRectClip) {
blend = clip->clipRect.isEmpty() ? 0 : qt_span_fill_clipRect;
- } else if (clip->hasRegionClip) {
- blend = clip->clipRegion.isEmpty() ? 0 : qt_span_fill_clipRegion;
} else {
blend = qt_span_fill_clipped;
}
@@ -6165,7 +6204,7 @@ void dumpClip(int width, int height, QClipData *clip)
Q_ASSERT(x1 >= 0);
fprintf(stderr,"clip %d: %d %d - %d %d\n", counter, x0, y0, x1, y1);
- clipImg.save(QString(QLatin1String("clip-%0.png")).arg(counter++));
+ clipImg.save(QString::fromLatin1("clip-%0.png").arg(counter++));
}
#endif
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index 26a2b3f..1f3f006 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -202,7 +202,6 @@ public:
void clip(const QVectorPath &path, Qt::ClipOperation op);
void clip(const QRect &rect, Qt::ClipOperation op);
void clip(const QRegion &region, Qt::ClipOperation op);
- void clip(const QPainterPath &path, Qt::ClipOperation op);
enum ClipType {
RectClip,
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 8eaad60..28f9220 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -105,7 +105,7 @@ QDebug Q_GUI_EXPORT &operator<<(QDebug &s, const QVectorPath &path)
vectorPathBounds.x2 - vectorPathBounds.x1, vectorPathBounds.y2 - vectorPathBounds.y1);
s << "QVectorPath(size:" << path.elementCount()
<< " hints:" << hex << path.hints()
- << rf << ")";
+ << rf << ')';
return s;
}
#endif
@@ -778,7 +778,7 @@ void QPaintEngineEx::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, con
{
QBrush brush(state()->pen.color(), pixmap);
QTransform xform;
- xform.translate(-s.x(), -s.y());
+ xform.translate(r.x() - s.x(), r.y() - s.y());
brush.setTransform(xform);
qreal pts[] = { r.x(), r.y(),
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 7ca5689..e2cd7a3 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -2751,7 +2751,7 @@ qreal QPainterPath::length() const
/*!
Returns percentage of the whole path at the specified length \a len.
- Note that similarly to other percent methods, the percentage measurment
+ Note that similarly to other percent methods, the percentage measurement
is not linear with regards to the length, if curves are present
in the path. When curves are present the percentage argument is mapped
to the t parameter of the Bezier equations.
@@ -2868,7 +2868,7 @@ static inline QBezier bezierAtT(const QPainterPath &path, qreal t, qreal *starti
Returns the point at at the percentage \a t of the current path.
The argument \a t has to be between 0 and 1.
- Note that similarly to other percent methods, the percentage measurment
+ Note that similarly to other percent methods, the percentage measurement
is not linear with regards to the length, if curves are present
in the path. When curves are present the percentage argument is mapped
to the t parameter of the Bezier equations.
@@ -2899,7 +2899,7 @@ QPointF QPainterPath::pointAtPercent(qreal t) const
Positive values for the angles mean counter-clockwise while negative values
mean the clockwise direction. Zero degrees is at the 3 o'clock position.
- Note that similarly to the other percent methods, the percentage measurment
+ Note that similarly to the other percent methods, the percentage measurement
is not linear with regards to the length if curves are present
in the path. When curves are present the percentage argument is mapped
to the t parameter of the Bezier equations.
@@ -2931,7 +2931,7 @@ qreal QPainterPath::angleAtPercent(qreal t) const
Returns the slope of the path at the percentage \a t. The
argument \a t has to be between 0 and 1.
- Note that similarly to other percent methods, the percentage measurment
+ Note that similarly to other percent methods, the percentage measurement
is not linear with regards to the length, if curves are present
in the path. When curves are present the percentage argument is mapped
to the t parameter of the Bezier equations.
@@ -3348,7 +3348,7 @@ QDebug operator<<(QDebug s, const QPainterPath &p)
s.nospace() << "QPainterPath: Element count=" << p.elementCount() << endl;
const char *types[] = {"MoveTo", "LineTo", "CurveTo", "CurveToData"};
for (int i=0; i<p.elementCount(); ++i) {
- s.nospace() << " -> " << types[p.elementAt(i).type] << "(x=" << p.elementAt(i).x << ", y=" << p.elementAt(i).y << ")" << endl;
+ s.nospace() << " -> " << types[p.elementAt(i).type] << "(x=" << p.elementAt(i).x << ", y=" << p.elementAt(i).y << ')' << endl;
}
return s;
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 55006f6..0b2db8c 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -346,7 +346,7 @@ QByteArray QPdf::generateDashes(const QPen &pen)
{
QByteArray result;
ByteStream s(&result);
- s << "[";
+ s << '[';
QVector<qreal> dasharray = pen.dashPattern();
qreal w = pen.widthF();
@@ -357,7 +357,7 @@ QByteArray QPdf::generateDashes(const QPen &pen)
if (dw < 0.0001) dw = 0.0001;
s << dw;
}
- s << "]";
+ s << ']';
//qDebug() << "dasharray: pen has" << dasharray;
//qDebug() << " => " << result;
return result;
@@ -915,17 +915,17 @@ const char *QPdf::paperSizeToString(QPrinter::PaperSize paperSize)
QByteArray QPdf::stripSpecialCharacters(const QByteArray &string)
{
QByteArray s = string;
- s.replace(" ", "");
- s.replace("(", "");
- s.replace(")", "");
- s.replace("<", "");
- s.replace(">", "");
- s.replace("[", "");
- s.replace("]", "");
- s.replace("{", "");
- s.replace("}", "");
- s.replace("/", "");
- s.replace("%", "");
+ s.replace(' ', "");
+ s.replace('(', "");
+ s.replace(')', "");
+ s.replace('<', "");
+ s.replace('>', "");
+ s.replace('[', "");
+ s.replace(']', "");
+ s.replace('{', "");
+ s.replace('}', "");
+ s.replace('/', "");
+ s.replace('%', "");
return s;
}
diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp
index 1d68520..ab60861 100644
--- a/src/gui/painting/qpen.cpp
+++ b/src/gui/painting/qpen.cpp
@@ -978,7 +978,7 @@ QDebug operator<<(QDebug dbg, const QPen &p)
dbg.nospace() << "QPen(" << p.width() << ',' << p.brush()
<< ',' << int(p.style()) << ',' << int(p.capStyle())
<< ',' << int(p.joinStyle()) << ',' << p.dashPattern()
- << "," << p.dashOffset()
+ << ',' << p.dashOffset()
<< ',' << p.miterLimit() << ')';
return dbg.space();
#else
diff --git a/src/gui/painting/qprintengine_pdf.cpp b/src/gui/painting/qprintengine_pdf.cpp
index 2e063b7..e504558 100644
--- a/src/gui/painting/qprintengine_pdf.cpp
+++ b/src/gui/painting/qprintengine_pdf.cpp
@@ -423,7 +423,7 @@ int QPdfEnginePrivate::addConstantAlphaObject(int brushAlpha, int penAlpha)
object = addXrefEntry(-1);
QByteArray alphaDef;
QPdf::ByteStream s(&alphaDef);
- s << "<<\n/ca " << (brushAlpha/qreal(255.)) << "\n";
+ s << "<<\n/ca " << (brushAlpha/qreal(255.)) << '\n';
s << "/CA " << (penAlpha/qreal(255.)) << "\n>>";
xprintf("%s\nendobj\n", alphaDef.constData());
alphaCache.insert(QPair<uint, uint>(brushAlpha, penAlpha), object);
@@ -1010,7 +1010,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font)
s << (char)('A' + (tag % 26));
tag /= 26;
}
- s << "+" << properties.postscriptName << "\n"
+ s << '+' << properties.postscriptName << "\n"
"/Flags " << 4 << "\n"
"/FontBBox ["
<< properties.boundingBox.x()*scale
diff --git a/src/gui/painting/qprintengine_ps.cpp b/src/gui/painting/qprintengine_ps.cpp
index 97ec640..29f364e 100644
--- a/src/gui/painting/qprintengine_ps.cpp
+++ b/src/gui/painting/qprintengine_ps.cpp
@@ -167,7 +167,7 @@ static QByteArray wrapDSC(const QByteArray &str)
}
wrapped += "\n%%+" + tmp;
}
- return wrapped + "\n";
+ return wrapped + '\n';
}
// ----------------------------- Internal class declarations -----------------------------
@@ -422,7 +422,7 @@ void QPSPrintEnginePrivate::drawImageHelper(qreal x, qreal y, qreal w, qreal h,
<< size << " string readstring\n";
ps_r7(*currentPage, out, out.size());
*currentPage << " pop def\n";
- *currentPage << width << ' ' << height << "[" << scaleX << " 0 0 " << scaleY << " 0 0]sl "
+ *currentPage << width << ' ' << height << '[' << scaleX << " 0 0 " << scaleY << " 0 0]sl "
<< bits << (!mask.isNull() ? "mask " : "false ")
<< x << ' ' << y << " di\n";
}
@@ -529,7 +529,7 @@ void QPSPrintEnginePrivate::emitHeader(bool finished)
else
s << "\n%%BoundingBox: 0 0 " << w << h;
}
- s << "\n" << wrapDSC("%%Creator: " + creator.toUtf8());
+ s << '\n' << wrapDSC("%%Creator: " + creator.toUtf8());
if (!title.isEmpty())
s << wrapDSC("%%Title: " + title.toUtf8());
#ifndef QT_NO_DATESTRING
@@ -549,7 +549,7 @@ void QPSPrintEnginePrivate::emitHeader(bool finished)
"% Prolog copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).\n"
"% You may copy this prolog in any way that is directly related to this document.\n"
"% For other use of this prolog, see your licensing agreement for Qt.\n"
- << ps_header << "\n";
+ << ps_header << '\n';
s << "/pageinit {\n";
@@ -560,12 +560,12 @@ void QPSPrintEnginePrivate::emitHeader(bool finished)
s << mtop*scale << mleft*scale << "translate\n";
}
if (orientation == QPrinter::Portrait) {
- s << "% " << printer->widthMM() << "*" << printer->heightMM()
+ s << "% " << printer->widthMM() << '*' << printer->heightMM()
<< "mm (portrait)\n0 " << height*scale
- << "translate " << scale << "-" << scale << "scale } def\n";
+ << "translate " << scale << '-' << scale << "scale } def\n";
} else {
- s << "% " << printer->heightMM() << "*" << printer->widthMM()
- << " mm (landscape)\n 90 rotate " << scale << "-" << scale << "scale } def\n";
+ s << "% " << printer->heightMM() << '*' << printer->widthMM()
+ << " mm (landscape)\n 90 rotate " << scale << '-' << scale << "scale } def\n";
}
s << "%%EndProlog\n";
@@ -619,8 +619,8 @@ void QPSPrintEnginePrivate::flushPage(bool last)
QPdf::ByteStream e(&trailer);
buffer << "%%Page: "
<< pageCount << pageCount << "\n"
- << "%%BeginPageSetup\n"
- << "QI\n";
+ "%%BeginPageSetup\n"
+ "QI\n";
if (hugeDocument) {
for (QHash<QFontEngine::FaceId, QFontSubset *>::const_iterator it = fonts.constBegin();
it != fonts.constEnd(); ++it) {
@@ -776,8 +776,8 @@ bool QPSPrintEngine::end()
d->flushPage(true);
QByteArray trailer;
QPdf::ByteStream s(&trailer);
- s << "%%Trailer\n";
- s << "%%Pages: " << d->pageCount - 1 << "\n" <<
+ s << "%%Trailer\n"
+ "%%Pages: " << d->pageCount - 1 << '\n' <<
wrapDSC("%%DocumentFonts: " + d->fontsUsed);
s << "%%EOF\n";
d->outDevice->write(trailer);
diff --git a/src/gui/painting/qprinterinfo_unix.cpp b/src/gui/painting/qprinterinfo_unix.cpp
index 0f33ea7..5724173 100644
--- a/src/gui/painting/qprinterinfo_unix.cpp
+++ b/src/gui/painting/qprinterinfo_unix.cpp
@@ -822,7 +822,7 @@ QList<QPrinterInfo> QPrinterInfo::availablePrinters()
for (int i = 0; i < cupsPrinterCount; ++i) {
QString printerName(QString::fromLocal8Bit(cupsPrinters[i].name));
if (cupsPrinters[i].instance)
- printerName += QLatin1String("/") + QString::fromLocal8Bit(cupsPrinters[i].instance);
+ printerName += QLatin1Char('/') + QString::fromLocal8Bit(cupsPrinters[i].instance);
list.append(QPrinterInfo(printerName));
if (cupsPrinters[i].is_default)
list[i].d_ptr->m_default = true;
@@ -893,7 +893,7 @@ QPrinterInfo::QPrinterInfo(const QPrinter& printer)
for (int i = 0; i < cupsPrinterCount; ++i) {
QString printerName(QString::fromLocal8Bit(cupsPrinters[i].name));
if (cupsPrinters[i].instance)
- printerName += QLatin1String("/") + QString::fromLocal8Bit(cupsPrinters[i].instance);
+ printerName += QLatin1Char('/') + QString::fromLocal8Bit(cupsPrinters[i].instance);
if (printerName == printer.printerName()) {
if (cupsPrinters[i].is_default)
d->m_default = true;
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index c88af7c..c4cd77a 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -450,9 +450,9 @@ QDebug operator<<(QDebug s, const QRegion &r)
{
QVector<QRect> rects = r.rects();
s.nospace() << "QRegion(size=" << rects.size() << "), "
- << "bounds = " << r.boundingRect() << "\n";
+ << "bounds = " << r.boundingRect() << '\n';
for (int i=0; i<rects.size(); ++i)
- s << "- " << i << rects.at(i) << "\n";
+ s << "- " << i << rects.at(i) << '\n';
return s;
}
#endif
@@ -1601,7 +1601,7 @@ void QRegionPrivate::selfTest() const
for (int i = 0; i < numRects; ++i) {
const QRect r = rects.at(i);
if ((r.width() * r.height()) > innerArea)
- qDebug() << "selfTest(): innerRect" << innerRect << "<" << r;
+ qDebug() << "selfTest(): innerRect" << innerRect << '<' << r;
}
QRect r = rects.first();
diff --git a/src/gui/painting/qtessellator.cpp b/src/gui/painting/qtessellator.cpp
index ce5ab74..9b5efee 100644
--- a/src/gui/painting/qtessellator.cpp
+++ b/src/gui/painting/qtessellator.cpp
@@ -1081,7 +1081,7 @@ void QTessellatorPrivate::addIntersection(const Edge *e1, const Edge *e2)
yi = y;
}
QDEBUG() << " between edges " << e1->edge << "and" << e2->edge << "at point ("
- << Q27Dot5ToDouble(yi) << ")";
+ << Q27Dot5ToDouble(yi) << ')';
Intersection i1;
i1.y = yi;
@@ -1174,7 +1174,7 @@ void QTessellatorPrivate::addIntersections()
for (int i = 0; i < scanline.size; ++i) {
Edge *e = scanline.edges[i];
QDEBUG() << " " << i << e->edge << "isect=(" << e->intersect_left << e->intersect_right
- << ")";
+ << ')';
}
#endif
@@ -1240,8 +1240,8 @@ QRectF QTessellator::tessellate(const QPointF *points, int nPoints)
QDEBUG() << " " << i << ": "
<< "point=" << d->vertices.position(d->vertices.sorted[i])
<< "flags=" << d->vertices.sorted[i]->flags
- << "pos=(" << Q27Dot5ToDouble(d->vertices.sorted[i]->x) << "/"
- << Q27Dot5ToDouble(d->vertices.sorted[i]->y) << ")";
+ << "pos=(" << Q27Dot5ToDouble(d->vertices.sorted[i]->x) << '/'
+ << Q27Dot5ToDouble(d->vertices.sorted[i]->y) << ')';
}
#endif
@@ -1271,9 +1271,9 @@ QRectF QTessellator::tessellate(const QPointF *points, int nPoints)
for (int i = 0; i < d->scanline.size; ++i) {
QDEBUG() << " " << d->scanline.edges[i]->edge
<< "p0= (" << Q27Dot5ToDouble(d->scanline.edges[i]->v0->x)
- << "/" << Q27Dot5ToDouble(d->scanline.edges[i]->v0->y)
+ << '/' << Q27Dot5ToDouble(d->scanline.edges[i]->v0->y)
<< ") p1= (" << Q27Dot5ToDouble(d->scanline.edges[i]->v1->x)
- << "/" << Q27Dot5ToDouble(d->scanline.edges[i]->v1->y) << ")"
+ << '/' << Q27Dot5ToDouble(d->scanline.edges[i]->v1->y) << ')'
<< "x=" << Q27Dot5ToDouble(d->scanline.edges[i]->positionAt(d->y))
<< "isLeftOfNext="
<< ((i < d->scanline.size - 1)
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 3fd1ffb..89df869 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -92,8 +92,8 @@ void QTextureGlyphCache::populate(const QTextItemInt &ti,
int glyph_height = metrics.height.ceil().toInt();
if (glyph_height == 0 || glyph_width == 0)
continue;
- glyph_width += margin * 2 + 2;
- glyph_height += margin * 2 + 2;
+ glyph_width += margin * 2 + 4;
+ glyph_height += margin * 2 + 4;
// align to 8-bit boundary
if (m_type == QFontEngineGlyphCache::Raster_Mono)
glyph_width = (glyph_width+7)&~7;
@@ -189,7 +189,11 @@ void QImageTextureGlyphCache::createTextureData(int width, int height)
int QImageTextureGlyphCache::glyphMargin() const
{
+#ifdef Q_WS_MAC
return 2;
+#else
+ return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0;
+#endif
}
void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g)
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index ec8c1dc..c00012a 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -1020,7 +1020,7 @@ QDebug operator<<(QDebug dbg, const QTransform &m)
<< " 31=" << m.m31()
<< " 32=" << m.m32()
<< " 33=" << m.m33()
- << ")";
+ << ')';
return dbg.space();
}
#endif
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index 7e93f74..aac7c31 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -275,13 +275,6 @@ inline qreal QTransform::dy() const
return affine._dy;
}
-#if defined(Q_CC_GNU)
-# define Q_CC_GNU_VERSION (((__GNUC__)<<16)|((__GNUC_MINOR__)<<8)|(__GNUC_PATCHLEVEL__))
-# if Q_CC_GNU_VERSION >= 0x040201
-# pragma GCC diagnostic ignored "-Wfloat-equal"
-# endif
-#endif
-
inline QTransform &QTransform::operator*=(qreal num)
{
if (num == 1.)
@@ -338,13 +331,6 @@ inline QTransform &QTransform::operator-=(qreal num)
return *this;
}
-#if defined(Q_CC_GNU_VERSION)
-# if Q_CC_GNU_VERSION >= 0x040201
-# pragma GCC diagnostic warning "-Wfloat-equal"
-# endif
-# undef Q_CC_GNU_VERSION
-#endif
-
/****** stream functions *******************/
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTransform &);
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTransform &);
diff --git a/src/gui/painting/qwindowsurface_x11.cpp b/src/gui/painting/qwindowsurface_x11.cpp
index 9e8b498..f29d627 100644
--- a/src/gui/painting/qwindowsurface_x11.cpp
+++ b/src/gui/painting/qwindowsurface_x11.cpp
@@ -128,7 +128,7 @@ void QX11WindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint
return;
// qDebug() << "XSetClipRectangles";
// for (int i = 0; i < num; ++i)
-// qDebug() << " " << i << rects[i].x << rects[i].x << rects[i].y << rects[i].width << rects[i].height;
+// qDebug() << ' ' << i << rects[i].x << rects[i].x << rects[i].y << rects[i].width << rects[i].height;
XSetClipRectangles(X11->display, gc, 0, 0, rects, num, YXBanded);
XCopyArea(X11->display, d_ptr->device.handle(), widget->handle(), gc,
br.x() + offset.x(), br.y() + offset.y(), br.width(), br.height(), wbr.x(), wbr.y());
diff --git a/src/gui/statemachine/qbasickeyeventtransition.cpp b/src/gui/statemachine/qbasickeyeventtransition.cpp
index 7f515cd..f7f1eb6 100644
--- a/src/gui/statemachine/qbasickeyeventtransition.cpp
+++ b/src/gui/statemachine/qbasickeyeventtransition.cpp
@@ -3,22 +3,46 @@
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_LICENSE$
+** $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
**
****************************************************************************/
#include "qbasickeyeventtransition_p.h"
#include <QtGui/qevent.h>
#include <qdebug.h>
-
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qabstracttransition_p.h"
-#else
-# include <private/qabstracttransition_p.h>
-#endif
-
+#include <private/qabstracttransition_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/statemachine/qbasickeyeventtransition_p.h b/src/gui/statemachine/qbasickeyeventtransition_p.h
index 7506747..39fa6ad 100644
--- a/src/gui/statemachine/qbasickeyeventtransition_p.h
+++ b/src/gui/statemachine/qbasickeyeventtransition_p.h
@@ -3,9 +3,39 @@
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_LICENSE$
+** $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
**
****************************************************************************/
@@ -23,12 +53,7 @@
// We mean it.
//
-// Qt
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qabstracttransition.h"
-#else
-# include <QtCore/qabstracttransition.h>
-#endif
+#include <QtCore/qabstracttransition.h>
#include <QtGui/qevent.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/statemachine/qbasicmouseeventtransition.cpp b/src/gui/statemachine/qbasicmouseeventtransition.cpp
index 42b7580..20dd792 100644
--- a/src/gui/statemachine/qbasicmouseeventtransition.cpp
+++ b/src/gui/statemachine/qbasicmouseeventtransition.cpp
@@ -3,9 +3,39 @@
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_LICENSE$
+** $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
**
****************************************************************************/
@@ -13,12 +43,7 @@
#include <QtGui/qevent.h>
#include <QtGui/qpainterpath.h>
#include <qdebug.h>
-
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qabstracttransition_p.h"
-#else
-# include <private/qabstracttransition_p.h>
-#endif
+#include <private/qabstracttransition_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/statemachine/qbasicmouseeventtransition_p.h b/src/gui/statemachine/qbasicmouseeventtransition_p.h
index 57f83c6..6c0afe4 100644
--- a/src/gui/statemachine/qbasicmouseeventtransition_p.h
+++ b/src/gui/statemachine/qbasicmouseeventtransition_p.h
@@ -3,9 +3,39 @@
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_LICENSE$
+** $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
**
****************************************************************************/
@@ -23,12 +53,7 @@
// We mean it.
//
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qabstracttransition.h"
-#else
-# include <QtCore/qabstracttransition.h>
-#endif
-
+#include <QtCore/qabstracttransition.h>
#include <QtGui/qevent.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/statemachine/qguistatemachine.cpp b/src/gui/statemachine/qguistatemachine.cpp
index b7563d7..612e43e 100644
--- a/src/gui/statemachine/qguistatemachine.cpp
+++ b/src/gui/statemachine/qguistatemachine.cpp
@@ -1,11 +1,41 @@
- /****************************************************************************
+/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_LICENSE$
+** $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/statemachine/qkeyeventtransition.cpp b/src/gui/statemachine/qkeyeventtransition.cpp
index 3cf51a3..f803711 100644
--- a/src/gui/statemachine/qkeyeventtransition.cpp
+++ b/src/gui/statemachine/qkeyeventtransition.cpp
@@ -3,21 +3,46 @@
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_LICENSE$
+** $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
**
****************************************************************************/
#include "qkeyeventtransition.h"
#include "qbasickeyeventtransition_p.h"
#include <QtCore/qwrappedevent.h>
-
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qeventtransition_p.h"
-#else
-# include <private/qeventtransition_p.h>
-#endif
+#include <private/qeventtransition_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/statemachine/qkeyeventtransition.h b/src/gui/statemachine/qkeyeventtransition.h
index 08595e8..3c8295f 100644
--- a/src/gui/statemachine/qkeyeventtransition.h
+++ b/src/gui/statemachine/qkeyeventtransition.h
@@ -3,20 +3,47 @@
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_LICENSE$
+** $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QKEYEVENTTRANSITION_H
#define QKEYEVENTTRANSITION_H
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qeventtransition.h"
-#else
-# include <QtCore/qeventtransition.h>
-#endif
+#include <QtCore/qeventtransition.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/gui/statemachine/qmouseeventtransition.cpp b/src/gui/statemachine/qmouseeventtransition.cpp
index 5ffdab0..e4e18eb 100644
--- a/src/gui/statemachine/qmouseeventtransition.cpp
+++ b/src/gui/statemachine/qmouseeventtransition.cpp
@@ -3,9 +3,39 @@
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_LICENSE$
+** $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
**
****************************************************************************/
@@ -13,12 +43,7 @@
#include "qbasicmouseeventtransition_p.h"
#include <QtCore/qwrappedevent.h>
#include <QtGui/qpainterpath.h>
-
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qeventtransition_p.h"
-#else
-# include <private/qeventtransition_p.h>
-#endif
+#include <private/qeventtransition_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/statemachine/qmouseeventtransition.h b/src/gui/statemachine/qmouseeventtransition.h
index e878a58..3f5f3ac 100644
--- a/src/gui/statemachine/qmouseeventtransition.h
+++ b/src/gui/statemachine/qmouseeventtransition.h
@@ -3,21 +3,47 @@
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_LICENSE$
+** $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QMOUSEEVENTTRANSITION_H
#define QMOUSEEVENTTRANSITION_H
-//Qt
-#if defined(QT_EXPERIMENTAL_SOLUTION)
-# include "qeventtransition.h"
-#else
-# include <QtCore/qeventtransition.h>
-#endif
+#include <QtCore/qeventtransition.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp
index 99d7261..f92fd0e 100644
--- a/src/gui/styles/gtksymbols.cpp
+++ b/src/gui/styles/gtksymbols.cpp
@@ -374,8 +374,8 @@ static QString getThemeName()
while(!in.atEnd()) {
QString line = in.readLine();
if (line.contains(QLS("gtk-theme-name"))) {
- line = line.right(line.length() - line.indexOf(QLS("=")) - 1);
- line.remove(QLS("\""));
+ line = line.right(line.length() - line.indexOf(QLatin1Char('=')) - 1);
+ line.remove(QLatin1Char('\"'));
line = line.trimmed();
themeName = line;
break;
@@ -633,31 +633,14 @@ GtkStyle* QGtk::gtkStyle(const QString &path)
return 0;
}
-#ifdef Q_OS_LINUX
-QT_END_NAMESPACE
-
-int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
-int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
-
-QT_BEGIN_NAMESPACE
-#endif
-
void QGtk::initGtkWidgets()
{
// From gtkmain.c
-
- uid_t ruid, rgid, euid, egid, suid, sgid;
-
-#ifdef Q_OS_LINUX
- if (getresuid (&ruid, &euid, &suid) != 0 || getresgid (&rgid, &egid, &sgid) != 0)
-#endif
- {
- suid = ruid = getuid ();
- sgid = rgid = getgid ();
- euid = geteuid ();
- egid = getegid ();
- }
- if (ruid != euid || ruid != suid || rgid != egid || rgid != sgid) {
+ uid_t ruid = getuid ();
+ uid_t rgid = getgid ();
+ uid_t euid = geteuid ();
+ uid_t egid = getegid ();
+ if (ruid != euid || rgid != egid) {
qWarning("\nThis process is currently running setuid or setgid.\nGTK+ does not allow this "
"therefore Qt cannot use the GTK+ integration.\nTry launching your app using \'gksudo\', "
"\'kdesudo\' or a similar tool.\n\n"
@@ -712,7 +695,7 @@ void QGtk::initGtkWidgets()
QHashIterator<QString, GtkWidget*> it(oldMap);
while (it.hasNext()) {
it.next();
- if (!it.key().contains(QLS("."))) {
+ if (!it.key().contains(QLatin1Char('.'))) {
add_all_sub_widgets(it.value());
}
}
diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp
index 3fb63f2..5c37794 100644
--- a/src/gui/styles/qcleanlooksstyle.cpp
+++ b/src/gui/styles/qcleanlooksstyle.cpp
@@ -1646,8 +1646,8 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
QPixmap cache;
QString pixmapName = QStyleHelper::uniqueName(QLatin1String("headersection"), option, option->rect.size());
- pixmapName += QLatin1String("-") + QString::number(int(header->position));
- pixmapName += QLatin1String("-") + QString::number(int(header->orientation));
+ pixmapName += QString::number(- int(header->position));
+ pixmapName += QString::number(- int(header->orientation));
QRect r = option->rect;
QColor gradientStopColor;
QColor gradientStartColor = option->palette.button().color();
@@ -3858,7 +3858,7 @@ void QCleanlooksStyle::polish(QApplication *app)
dataDirs = QLatin1String("/usr/local/share/:/usr/share/");
dataDirs.prepend(QDir::homePath() + QLatin1String("/:"));
- d->iconDirs = dataDirs.split(QLatin1String(":"));
+ d->iconDirs = dataDirs.split(QLatin1Char(':'));
#endif
}
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index 6972803..1285598 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -851,7 +851,7 @@ void QCommonStylePrivate::lookupIconTheme() const
dataDirs.prepend(QDir::homePath() + QLatin1String("/:"));
QStringList kdeDirs = QString::fromLocal8Bit(getenv("KDEDIRS")).split(QLatin1Char(':'));
foreach (const QString &dirName, kdeDirs)
- dataDirs.append(QLatin1String(":") + dirName + QLatin1String("/share"));
+ dataDirs.append(QLatin1Char(':') + dirName + QLatin1String("/share"));
iconDirs = dataDirs.split(QLatin1Char(':'));
QFileInfo fileInfo(QLatin1String("/usr/share/icons/default.kde"));
@@ -893,7 +893,7 @@ QIconTheme QCommonStylePrivate::parseIndexFile(const QString &themeName) const
parents = line.split(QLatin1Char(','));
}
- if (line.startsWith(QLatin1String("["))) {
+ if (line.startsWith(QLatin1Char('['))) {
line = line.trimmed();
line.chop(1);
QString dirName = line.right(line.length() - 1);
@@ -1695,7 +1695,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
if (toolbutton->toolButtonStyle == Qt::ToolButtonTextUnderIcon) {
pr.setHeight(pmSize.height() + 6);
- tr.adjust(0, pr.height(), 0, -3);
+ tr.adjust(0, pr.height() - 1, 0, -3);
pr.translate(shiftX, shiftY);
if (!hasArrow) {
drawItemPixmap(p, pr, Qt::AlignCenter, pm);
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index ca71da2..151dab0 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -140,10 +140,7 @@ static const char * const dock_widget_restore_xpm[] =
class QGtkStyleFilter : public QObject
{
public:
- QGtkStyleFilter() {
- qApp->installEventFilter(this);
- }
-
+ QGtkStyleFilter() {}
private:
bool eventFilter(QObject *obj, QEvent *e);
};
@@ -167,7 +164,12 @@ class QGtkStylePrivate : public QCleanlooksStylePrivate
public:
QGtkStylePrivate()
: QCleanlooksStylePrivate()
- {}
+ {
+ QGtk::initGtkWidgets();
+ if (QGtk::isThemeAvailable())
+ qApp->installEventFilter(&filter);
+
+ }
QGtkStyleFilter filter;
};
@@ -243,7 +245,6 @@ static QString uniqueName(const QString &key, const QStyleOption *option, const
QGtkStyle::QGtkStyle()
: QCleanlooksStyle(*new QGtkStylePrivate)
{
- QGtk::initGtkWidgets();
}
/*!
@@ -939,10 +940,6 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
case PE_FrameLineEdit: {
GtkWidget *gtkEntry = QGtk::gtkWidget(QLS("GtkEntry"));
- if (option->state & State_HasFocus)
- GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
- else
- GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
gboolean interior_focus;
gint focus_line_width;
@@ -956,6 +953,9 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
if (!interior_focus && option->state & State_HasFocus)
rect.adjust(focus_line_width, focus_line_width, -focus_line_width, -focus_line_width);
+
+ if (option->state & State_HasFocus)
+ GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
gtkPainter.paintShadow(gtkEntry, "entry", rect, option->state & State_Enabled ?
GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
GTK_SHADOW_IN, gtkEntry->style,
@@ -964,6 +964,9 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
gtkPainter.paintShadow(gtkEntry, "entry", option->rect, option->state & State_Enabled ?
GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
GTK_SHADOW_IN, gtkEntry->style, QLS("GtkEntryShadowIn"));
+
+ if (option->state & State_HasFocus)
+ GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
}
break;
@@ -1049,17 +1052,13 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
GTK_WIDGET_SET_FLAGS(gtkButton, GTK_HAS_DEFAULT);
gtkPainter.paintBox(gtkButton, "buttondefault", buttonRect, state, GTK_SHADOW_IN,
style, isDefault ? QLS("d") : QString());
- } else
- GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_DEFAULT);
+ }
bool hasFocus = option->state & State_HasFocus;
if (hasFocus) {
key += QLS("def");
GTK_WIDGET_SET_FLAGS(gtkButton, GTK_HAS_FOCUS);
-
- } else {
- GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_FOCUS);
}
if (!interiorFocus)
@@ -1070,6 +1069,10 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
gtkPainter.paintBox(gtkButton, "button", buttonRect, state, shadow,
style, key);
+ if (isDefault)
+ GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_DEFAULT);
+ if (hasFocus)
+ GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_FOCUS);
}
break;
@@ -1333,6 +1336,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
GtkWidget *gtkToggleButton = QGtk::gtkWidget(buttonPath);
QGtk::gtk_widget_set_direction(gtkToggleButton, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
if (gtkToggleButton && (appears_as_list || comboBox->editable)) {
+ if (focus)
+ GTK_WIDGET_SET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
// Draw the combo box as a line edit with a button next to it
if (comboBox->editable || appears_as_list) {
GtkStateType frameState = (state == GTK_STATE_PRELIGHT) ? GTK_STATE_NORMAL : state;
@@ -1346,22 +1351,16 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
else
frameRect.setRight(arrowButtonRect.left());
- // Required for inner blue highlight with clearlooks
- if (focus) {
- GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
- GTK_WIDGET_SET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
-
- } else {
- GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
- GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
- }
-
// Fill the line edit background
// We could have used flat_box with "entry_bg" but that is probably not worth the overhead
uint resolve_mask = option->palette.resolve();
int xt = gtkEntry->style->xthickness;
int yt = gtkEntry->style->ythickness;
QRect contentRect = frameRect.adjusted(xt, yt, -xt, -yt);
+ // Required for inner blue highlight with clearlooks
+ if (focus)
+ GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
+
if (widget && widget->testAttribute(Qt::WA_SetPalette) &&
resolve_mask & (1 << QPalette::Base)) // Palette overridden by user
p->fillRect(contentRect, option->palette.base().color());
@@ -1375,6 +1374,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
GTK_SHADOW_IN, gtkEntry->style, entryPath +
QString::number(focus) + QString::number(comboBox->editable) +
QString::number(option->direction));
+ if (focus)
+ GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
}
GtkStateType buttonState = GTK_STATE_NORMAL;
@@ -1393,22 +1394,21 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
gtkCachedPainter.paintBox( gtkToggleButton, "button", arrowButtonRect, buttonState,
shadow, gtkToggleButton->style, buttonPath +
QString::number(focus) + QString::number(option->direction));
-
+ if (focus)
+ GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
} else {
// Draw combo box as a button
QRect buttonRect = option->rect;
- if (focus) { // Clearlooks actually check the widget for the default state
+ if (focus) // Clearlooks actually check the widget for the default state
GTK_WIDGET_SET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
-
- } else {
- GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
- }
-
gtkCachedPainter.paintBox(gtkToggleButton, "button",
buttonRect, state,
shadow, gtkToggleButton->style,
buttonPath + QString::number(focus));
+ if (focus)
+ GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
+
// Draw the separator between label and arrows
QString vSeparatorPath = buttonPath + QLS(".GtkHBox.GtkVSeparator");
@@ -1774,15 +1774,13 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
shadow = GTK_SHADOW_IN;
style = gtkPainter.getStyle(gtkSpinButton);
- if (option->state & State_HasFocus)
- GTK_WIDGET_SET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
- else
- GTK_WIDGET_UNSET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
QString key;
- if (option->state & State_HasFocus)
- key = QLS("f");
+ if (option->state & State_HasFocus) {
+ key += QLatin1Char('f');
+ GTK_WIDGET_SET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
+ }
uint resolve_mask = option->palette.resolve();
@@ -1815,6 +1813,9 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key);
else
gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key);
+
+ if (option->state & State_HasFocus)
+ GTK_WIDGET_UNSET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
}
if (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) {
@@ -2343,7 +2344,7 @@ void QGtkStyle::drawControl(ControlElement element,
case CE_SizeGrip: {
GtkWidget *gtkStatusbar = QGtk::gtkWidget(QLS("GtkStatusbar.GtkFrame"));
QRect gripRect = option->rect.adjusted(0, 0, -gtkStatusbar->style->xthickness, -gtkStatusbar->style->ythickness);
- gtkPainter.paintResizeGrip( gtkStatusbar, "window", gripRect, GTK_STATE_NORMAL,
+ gtkPainter.paintResizeGrip( gtkStatusbar, "statusbar", gripRect, GTK_STATE_NORMAL,
GTK_SHADOW_OUT, QApplication::isRightToLeft() ?
GDK_WINDOW_EDGE_SOUTH_WEST : GDK_WINDOW_EDGE_SOUTH_EAST,
gtkStatusbar->style);
diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp
index 66464ff..91ad64e 100644
--- a/src/gui/styles/qplastiquestyle.cpp
+++ b/src/gui/styles/qplastiquestyle.cpp
@@ -2845,8 +2845,8 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
QPixmap cache;
QString pixmapName = uniqueName(QLatin1String("headersection"), option, option->rect.size());
- pixmapName += QLatin1String("-") + QString::number(int(header->position));
- pixmapName += QLatin1String("-") + QString::number(int(header->orientation));
+ pixmapName += QString::number(- int(header->position));
+ pixmapName += QString::number(- int(header->orientation));
if (!UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
cache = QPixmap(option->rect.size());
@@ -5460,6 +5460,11 @@ int QPlastiqueStyle::styleHint(StyleHint hint, const QStyleOption *option, const
case SH_Menu_SubMenuPopupDelay:
ret = 96; // from Plastik
break;
+#ifndef Q_OS_WIN
+ case SH_Menu_AllowActiveAndDisabled:
+ ret = false;
+ break;
+#endif
default:
ret = QWindowsStyle::styleHint(hint, option, widget, returnData);
break;
diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp
index de4b5a3..45be9a8 100644
--- a/src/gui/styles/qstyle.cpp
+++ b/src/gui/styles/qstyle.cpp
@@ -2440,7 +2440,7 @@ QDebug operator<<(QDebug debug, QStyle::State state)
qSort(states);
debug << states.join(QLatin1String(" | "));
- debug << ")";
+ debug << ')';
return debug;
}
#endif
diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp
index 5b1bc61..e441101 100644
--- a/src/gui/styles/qstyleoption.cpp
+++ b/src/gui/styles/qstyleoption.cpp
@@ -5362,10 +5362,10 @@ QDebug operator<<(QDebug debug, const QStyleOption &option)
{
debug << "QStyleOption(";
debug << QStyleOption::OptionType(option.type);
- debug << "," << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight");
- debug << "," << option.state;
- debug << "," << option.rect;
- debug << ")";
+ debug << ',' << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight");
+ debug << ',' << option.state;
+ debug << ',' << option.rect;
+ debug << ')';
return debug;
}
#endif
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index fdd51c3..9a8f97e 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -1555,7 +1555,7 @@ QVector<QCss::StyleRule> QStyleSheetStyle::styleRules(const QWidget *w) const
if (widCacheIt == styleSheetCache->constEnd()) {
parser.init(wid->styleSheet());
if (!parser.parse(&ss)) {
- parser.init(QLatin1String("* {") + wid->styleSheet() + QLatin1String("}"));
+ parser.init(QLatin1String("* {") + wid->styleSheet() + QLatin1Char('}'));
if (!parser.parse(&ss))
qWarning("Could not parse stylesheet of widget %p", wid);
}
@@ -2702,14 +2702,10 @@ void QStyleSheetStyle::polish(QWidget *w)
QRenderRule rule = renderRule(sa, PseudoElement_None, PseudoClass_Enabled);
if ((rule.hasBorder() && rule.border()->hasBorderImage())
|| (rule.hasBackground() && !rule.background()->pixmap.isNull())) {
- QObject::disconnect(sa->horizontalScrollBar(), SIGNAL(valueChanged(int)),
- sa, SLOT(update()));
- QObject::disconnect(sa->verticalScrollBar(), SIGNAL(valueChanged(int)),
- sa, SLOT(update()));
QObject::connect(sa->horizontalScrollBar(), SIGNAL(valueChanged(int)),
- sa, SLOT(update()));
+ sa, SLOT(update()), Qt::UniqueConnection);
QObject::connect(sa->verticalScrollBar(), SIGNAL(valueChanged(int)),
- sa, SLOT(update()));
+ sa, SLOT(update()), Qt::UniqueConnection);
}
}
#endif
@@ -5082,9 +5078,12 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
#ifndef QT_NO_COMBOBOX
if (qobject_cast<const QComboBox *>(w)) {
QAbstractItemView *view = qFindChild<QAbstractItemView *>(w);
- QRenderRule subRule = renderRule(view, PseudoElement_None);
- if (subRule.hasBox() || !subRule.hasNativeBorder())
- return QFrame::NoFrame;
+ if (view) {
+ view->ensurePolished();
+ QRenderRule subRule = renderRule(view, PseudoElement_None);
+ if (subRule.hasBox() || !subRule.hasNativeBorder())
+ return QFrame::NoFrame;
+ }
}
#endif // QT_NO_COMBOBOX
break;
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index 38621c1..0494b72 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -1508,7 +1508,7 @@ QRect Declaration::rectValue() const
QStringList func = v.variant.toStringList();
if (func.count() != 2 || func.at(0).compare(QLatin1String("rect")) != 0)
return QRect();
- QStringList args = func[1].split(QLatin1String(" "), QString::SkipEmptyParts);
+ QStringList args = func[1].split(QLatin1Char(' '), QString::SkipEmptyParts);
if (args.count() != 4)
return QRect();
QRect rect(args[0].toInt(), args[1].toInt(), args[2].toInt(), args[3].toInt());
@@ -2153,7 +2153,7 @@ void Parser::init(const QString &css, bool isFile)
if (isFile) {
QFile file(css);
if (file.open(QFile::ReadOnly)) {
- sourcePath = QFileInfo(styleSheet).absolutePath() + QLatin1String("/");
+ sourcePath = QFileInfo(styleSheet).absolutePath() + QLatin1Char('/');
QTextStream stream(&file);
styleSheet = stream.readAll();
} else {
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index f73ffb5..c5096bf 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -1897,6 +1897,20 @@ void QFont::insertSubstitutions(const QString &familyName,
}
}
+/*! \fn void QFont::initialize()
+ \internal
+
+ Internal function that initializes the font system. The font cache
+ and font dict do not alloc the keys. The key is a QString which is
+ shared between QFontPrivate and QXFontName.
+*/
+
+/*! \fn void QFont::cleanup()
+ \internal
+
+ Internal function that cleans up the font system.
+*/
+
// ### mark: should be called removeSubstitutions()
/*!
Removes all the substitutions for \a familyName.
diff --git a/src/gui/text/qfont_x11.cpp b/src/gui/text/qfont_x11.cpp
index 710792c..6b0e46c 100644
--- a/src/gui/text/qfont_x11.cpp
+++ b/src/gui/text/qfont_x11.cpp
@@ -129,13 +129,6 @@ Q_GUI_EXPORT void qt_x11_set_fallback_font_family(int script, const QString &fam
int QFontPrivate::defaultEncodingID = -1;
-/*!
- Internal function that initializes the font system.
-
- \internal
- The font cache and font dict do not alloc the keys. The key is a QString
- which is shared between QFontPrivate and QXFontName.
-*/
void QFont::initialize()
{
extern int qt_encoding_id_for_mib(int mib); // from qfontdatabase_x11.cpp
@@ -184,10 +177,6 @@ void QFont::initialize()
QFontPrivate::defaultEncodingID = qt_encoding_id_for_mib(mib);
}
-/*! \internal
-
- Internal function that cleans up the font system.
-*/
void QFont::cleanup()
{
QFontCache::cleanup();
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index c3fc9f5..d3020b0 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -792,7 +792,7 @@ static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDe
if (! desc.foundry->name.isEmpty() && desc.family->count > 1) {
fontDef->family += QString::fromLatin1(" [");
fontDef->family += desc.foundry->name;
- fontDef->family += QString::fromLatin1("]");
+ fontDef->family += QLatin1Char(']');
}
if (desc.style->smoothScalable)
@@ -1495,7 +1495,7 @@ QStringList QFontDatabase::families(WritingSystem writingSystem) const
if (!foundry.isEmpty()) {
str += QLatin1String(" [");
str += foundry;
- str += QLatin1String("]");
+ str += QLatin1Char(']');
}
flist.append(str);
}
diff --git a/src/gui/text/qfontdatabase_qws.cpp b/src/gui/text/qfontdatabase_qws.cpp
index f62a6d1..9a29de2 100644
--- a/src/gui/text/qfontdatabase_qws.cpp
+++ b/src/gui/text/qfontdatabase_qws.cpp
@@ -767,8 +767,8 @@ QFontEngine *loadSingleEngine(int script, const QFontPrivate *fp,
QString fn = qwsFontPath();
fn += QLatin1Char('/');
fn += family->name.toLower()
- + QLatin1String("_") + QString::number(pixelSize*10)
- + QLatin1String("_") + QString::number(style->key.weight)
+ + QLatin1Char('_') + QString::number(pixelSize*10)
+ + QLatin1Char('_') + QString::number(style->key.weight)
+ (style->key.style == QFont::StyleItalic ?
QLatin1String("i.qpf") : QLatin1String(".qpf"));
//###rotation ###
diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp
index 70e1599..605a7dd 100644
--- a/src/gui/text/qfontdatabase_x11.cpp
+++ b/src/gui/text/qfontdatabase_x11.cpp
@@ -509,9 +509,9 @@ bool qt_fillFontDef(const QByteArray &xlfd, QFontDef *fd, int dpi, QtFontDesc *d
fd->styleStrategy |= QFont::NoAntialias;
fd->family = QString::fromLatin1(tokens[Family]);
QString foundry = QString::fromLatin1(tokens[Foundry]);
- if (! foundry.isEmpty() && foundry != QString::fromLatin1("*") && (!desc || desc->family->count > 1))
+ if (! foundry.isEmpty() && foundry != QLatin1String("*") && (!desc || desc->family->count > 1))
fd->family +=
- QString::fromLatin1(" [") + foundry + QString::fromLatin1("]");
+ QLatin1String(" [") + foundry + QLatin1Char(']');
if (qstrlen(tokens[AddStyle]) > 0)
fd->addStyle = QString::fromLatin1(tokens[AddStyle]);
@@ -1802,30 +1802,30 @@ QFontEngine *QFontDatabase::loadXlfd(int screen, int script, const QFontDef &req
QByteArray xlfd("-");
xlfd += desc.foundry->name.isEmpty() ? QByteArray("*") : desc.foundry->name.toLatin1();
- xlfd += "-";
+ xlfd += '-';
xlfd += desc.family->name.isEmpty() ? QByteArray("*") : desc.family->name.toLatin1();
- xlfd += "-";
+ xlfd += '-';
xlfd += desc.style->weightName ? desc.style->weightName : "*";
- xlfd += "-";
+ xlfd += '-';
xlfd += (desc.style->key.style == QFont::StyleItalic
- ? "i"
- : (desc.style->key.style == QFont::StyleOblique ? "o" : "r"));
- xlfd += "-";
+ ? 'i'
+ : (desc.style->key.style == QFont::StyleOblique ? 'o' : 'r'));
+ xlfd += '-';
xlfd += desc.style->setwidthName ? desc.style->setwidthName : "*";
// ### handle add-style
xlfd += "-*-";
xlfd += QByteArray::number(px);
- xlfd += "-";
+ xlfd += '-';
xlfd += QByteArray::number(desc.encoding->xpoint);
- xlfd += "-";
+ xlfd += '-';
xlfd += QByteArray::number(desc.encoding->xres);
- xlfd += "-";
+ xlfd += '-';
xlfd += QByteArray::number(desc.encoding->yres);
- xlfd += "-";
+ xlfd += '-';
xlfd += desc.encoding->pitch;
- xlfd += "-";
+ xlfd += '-';
xlfd += QByteArray::number(desc.encoding->avgwidth);
- xlfd += "-";
+ xlfd += '-';
xlfd += xlfd_for_id(desc.encoding->encoding);
FM_DEBUG(" using XLFD: %s\n", xlfd.data());
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index d7a9c23..6e8adcf 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -915,7 +915,7 @@ void QFontEngine::loadKerningPairs(QFixed scalingFactor)
end:
qSort(kerning_pairs);
// for (int i = 0; i < kerning_pairs.count(); ++i)
-// qDebug() << "i" << i << "left_right" << hex << kerning_pairs.at(i).left_right;
+// qDebug() << 'i' << i << "left_right" << hex << kerning_pairs.at(i).left_right;
}
#else
@@ -1646,12 +1646,6 @@ bool QFontEngineMulti::canRender(const QChar *string, int len)
return allExist;
}
-QFontEngine *QFontEngineMulti::engine(int at) const
-{
- Q_ASSERT(at < engines.size());
- return engines.at(at);
-}
-
QImage QFontEngineMulti::alphaMapForGlyph(glyph_t)
{
Q_ASSERT(false);
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 6f5ee1f..a93c391 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -54,8 +54,6 @@
#include <private/qpdf_p.h>
#include <private/qharfbuzz_p.h>
-#include <private/qpdf_p.h>
-
#include "qfontengine_ft_p.h"
#include <ft2build.h>
#include FT_FREETYPE_H
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 6b5bd0f..2e62086 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -553,7 +553,9 @@ QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph)
8, im.bytesPerLine(), colorspace,
cgflags);
CGContextSetFontSize(ctx, fontDef.pixelSize);
- CGContextSetShouldAntialias(ctx, fontDef.pointSize > qt_antialiasing_threshold && !(fontDef.styleStrategy & QFont::NoAntialias));
+ CGContextSetShouldAntialias(ctx, fontDef.pointSize > qt_antialiasing_threshold
+ && !(fontDef.styleStrategy & QFont::NoAntialias));
+ CGContextSetShouldSmoothFonts(ctx, false);
CGAffineTransform oldTextMatrix = CGContextGetTextMatrix(ctx);
CGAffineTransform cgMatrix = CGAffineTransformMake(1, 0, 0, 1, 0, 0);
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 92efb6c..0f8d81c 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -353,7 +353,7 @@ private:
int _size;
};
-class Q_GUI_EXPORT QFontEngineMulti : public QFontEngine
+class QFontEngineMulti : public QFontEngine
{
public:
explicit QFontEngineMulti(int engineCount);
@@ -389,7 +389,9 @@ public:
inline virtual const char *name() const
{ return "Multi"; }
- QFontEngine *engine(int at) const;
+ QFontEngine *engine(int at) const
+ {Q_ASSERT(at < engines.size()); return engines.at(at); }
+
protected:
friend class QPSPrintEnginePrivate;
diff --git a/src/gui/text/qfontengine_qpf.cpp b/src/gui/text/qfontengine_qpf.cpp
index b7d1c59..8222b7f 100644
--- a/src/gui/text/qfontengine_qpf.cpp
+++ b/src/gui/text/qfontengine_qpf.cpp
@@ -308,7 +308,7 @@ QFontEngineQPF::QFontEngineQPF(const QFontDef &def, int fileDescriptor, QFontEng
readOnly = true;
#if defined(DEBUG_FONTENGINE)
- qDebug() << "QFontEngineQPF::QFontEngineQPF( fd =" << fd << ", renderingFontEngine =" << renderingFontEngine << ")";
+ qDebug() << "QFontEngineQPF::QFontEngineQPF( fd =" << fd << ", renderingFontEngine =" << renderingFontEngine << ')';
#endif
#ifndef QT_FONTS_ARE_RESOURCES
@@ -316,9 +316,9 @@ QFontEngineQPF::QFontEngineQPF(const QFontDef &def, int fileDescriptor, QFontEng
if (!renderingFontEngine)
return;
- fileName = fontDef.family.toLower() + QLatin1String("_")
+ fileName = fontDef.family.toLower() + QLatin1Char('_')
+ QString::number(fontDef.pixelSize)
- + QLatin1String("_") + QString::number(fontDef.weight)
+ + QLatin1Char('_') + QString::number(fontDef.weight)
+ (fontDef.style != QFont::StyleNormal ?
QLatin1String("_italic") : QLatin1String(""))
+ QLatin1String(".qsf");
@@ -550,7 +550,7 @@ bool QFontEngineQPF::stringToCMap(const QChar *str, int len, QGlyphLayout *glyph
#if 0 && defined(DEBUG_FONTENGINE)
QChar c(uc);
if (!findGlyph(glyphs[glyph_pos].glyph) && !seenGlyphs.contains(c))
- qDebug() << "glyph for character" << c << "/" << hex << uc << "is" << dec << glyphs[glyph_pos].glyph;
+ qDebug() << "glyph for character" << c << '/' << hex << uc << "is" << dec << glyphs[glyph_pos].glyph;
seenGlyphs.insert(c);
#endif
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index feea1f2..002e670 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -1406,8 +1406,8 @@ QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin
#endif
#endif
- QNativeImage *ni = new QNativeImage(iw + 2 * margin + 2,
- ih + 2 * margin + 2,
+ QNativeImage *ni = new QNativeImage(iw + 2 * margin + 4,
+ ih + 2 * margin + 4,
QNativeImage::systemFormat(), true);
ni->image.fill(0xffffffff);
@@ -1449,7 +1449,7 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform)
font = CreateFontIndirectW(&lf);
}
- QNativeImage *mask = drawGDIGlyph(font, glyph, 2, xform);
+ QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform);
if (mask == 0)
return QImage();
diff --git a/src/gui/text/qfontengine_x11.cpp b/src/gui/text/qfontengine_x11.cpp
index 0972b2b..bafc99d 100644
--- a/src/gui/text/qfontengine_x11.cpp
+++ b/src/gui/text/qfontengine_x11.cpp
@@ -227,7 +227,7 @@ static QFontEngine::FaceId fontFile(const QByteArray &_xname, QFreetypeFace **fr
QByteArray best_mapping;
for (QStringList::ConstIterator it = fontpath.constBegin(); it != fontpath.constEnd(); ++it) {
- if ((*it).left(1) != QLatin1String("/"))
+ if (!(*it).startsWith(QLatin1Char('/')))
continue; // not a path name, a font server
QString fontmapname;
int num = 0;
@@ -693,9 +693,8 @@ QFontEngine::FaceId QFontEngineXLFD::faceId() const
if (freetype) {
const_cast<QFontEngineXLFD *>(this)->fsType = freetype->fsType();
} else {
- QFontEngine::Properties properties = QFontEngine::properties();
face_id.index = 0;
- face_id.filename = "-" + properties.postscriptName;
+ face_id.filename = '-' + QFontEngine::properties().postscriptName;
}
}
#endif
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 88d0610..87da628 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -670,8 +670,8 @@ QRect QFontMetrics::boundingRect(const QString &text) const
Returns the rectangle that is covered by ink if character \a ch
were to be drawn at the origin of the coordinate system.
- Note that the bounding rectangle may extend to the left of (0, 0),
- e.g. for italicized fonts, and that the text output may cover \e
+ Note that the bounding rectangle may extend to the left of (0, 0)
+ (e.g., for italicized fonts), and that the text output may cover \e
all pixels in the bounding rectangle. For a space character the rectangle
will usually be empty.
@@ -724,7 +724,7 @@ QRect QFontMetrics::boundingRect(QChar ch) const
\o Qt::AlignCenter (== \c{Qt::AlignHCenter | Qt::AlignVCenter})
\o Qt::TextSingleLine ignores newline characters in the text.
\o Qt::TextExpandTabs expands tabs (see below)
- \o Qt::TextShowMnemonic interprets "&amp;x" as \underline{x}, i.e. underlined.
+ \o Qt::TextShowMnemonic interprets "&x" as \underline{x}; i.e., underlined.
\o Qt::TextWordWrap breaks the text to fit the rectangle.
\endlist
@@ -781,7 +781,7 @@ QRect QFontMetrics::boundingRect(const QRect &rect, int flags, const QString &te
\list
\o Qt::TextSingleLine ignores newline characters.
\o Qt::TextExpandTabs expands tabs (see below)
- \o Qt::TextShowMnemonic interprets "&amp;x" as \underline{x}, i.e. underlined.
+ \o Qt::TextShowMnemonic interprets "&x" as \underline{x}; i.e., underlined.
\o Qt::TextWordBreak breaks the text to fit the rectangle.
\endlist
@@ -1500,7 +1500,7 @@ QRectF QFontMetricsF::boundingRect(QChar ch) const
\o Qt::AlignCenter (== \c{Qt::AlignHCenter | Qt::AlignVCenter})
\o Qt::TextSingleLine ignores newline characters in the text.
\o Qt::TextExpandTabs expands tabs (see below)
- \o Qt::TextShowMnemonic interprets "&amp;x" as \underline{x}, i.e. underlined.
+ \o Qt::TextShowMnemonic interprets "&x" as \underline{x}; i.e., underlined.
\o Qt::TextWordWrap breaks the text to fit the rectangle.
\endlist
@@ -1559,7 +1559,7 @@ QRectF QFontMetricsF::boundingRect(const QRectF &rect, int flags, const QString&
\list
\o Qt::TextSingleLine ignores newline characters.
\o Qt::TextExpandTabs expands tabs (see below)
- \o Qt::TextShowMnemonic interprets "&amp;x" as \underline{x}, i.e. underlined.
+ \o Qt::TextShowMnemonic interprets "&x" as \underline{x}; i.e., underlined.
\o Qt::TextWordBreak breaks the text to fit the rectangle.
\endlist
diff --git a/src/gui/text/qfontsubset.cpp b/src/gui/text/qfontsubset.cpp
index 0d1a884..e4d813d 100644
--- a/src/gui/text/qfontsubset.cpp
+++ b/src/gui/text/qfontsubset.cpp
@@ -333,17 +333,17 @@ QByteArray QFontSubset::glyphName(unsigned int glyph, const QVector<int> reverse
name[0] = 0;
}
if (name[0]) {
- s << "/" << name;
+ s << '/' << name;
} else
#endif
#if defined(Q_WS_X11)
if (fontEngine->type() == QFontEngine::XLFD) {
uint uc = static_cast<QFontEngineXLFD *>(fontEngine)->toUnicode(glyphIndex);
- s << "/" << glyphName(uc, false /* ### */);
+ s << '/' << glyphName(uc, false /* ### */);
} else
#endif
if (reverseMap[glyphIndex] && reverseMap[glyphIndex] < 0x10000) {
- s << "/" << glyphName(reverseMap[glyphIndex], false);
+ s << '/' << glyphName(reverseMap[glyphIndex], false);
} else {
s << "/gl" << (int)glyphIndex;
}
@@ -395,13 +395,13 @@ QByteArray QFontSubset::widthArray() const
int endnonlinear = startLinear ? startLinear : g;
// qDebug(" startLinear=%x endnonlinear=%x", startLinear,endnonlinear);
if (endnonlinear > start) {
- s << start << "[";
+ s << start << '[';
for (int i = start; i < endnonlinear; ++i)
s << (widths[i]*scale).toInt();
s << "]\n";
}
if (startLinear)
- s << startLinear << g - 1 << (widths[startLinear]*scale).toInt() << "\n";
+ s << startLinear << g - 1 << (widths[startLinear]*scale).toInt() << '\n';
}
s << "]\n";
}
@@ -488,14 +488,14 @@ QByteArray QFontSubset::createToUnicodeMap() const
int endnonlinear = startLinear ? startLinear : g;
// qDebug(" startLinear=%x endnonlinear=%x", startLinear,endnonlinear);
if (endnonlinear > start) {
- s << "<" << QPdf::toHex((ushort)start, buf) << "> <";
+ s << '<' << QPdf::toHex((ushort)start, buf) << "> <";
s << QPdf::toHex((ushort)(endnonlinear - 1), buf) << "> ";
if (endnonlinear == start + 1) {
- s << "<" << QPdf::toHex((ushort)reverseMap[start], buf) << ">\n";
+ s << '<' << QPdf::toHex((ushort)reverseMap[start], buf) << ">\n";
} else {
- s << "[";
+ s << '[';
for (int i = start; i < endnonlinear; ++i) {
- s << "<" << QPdf::toHex((ushort)reverseMap[i], buf) << "> ";
+ s << '<' << QPdf::toHex((ushort)reverseMap[i], buf) << "> ";
}
s << "]\n";
}
@@ -508,9 +508,9 @@ QByteArray QFontSubset::createToUnicodeMap() const
int uc_end = uc_start + len - 1;
if ((uc_end >> 8) != (uc_start >> 8))
len = 256 - (uc_start & 0xff);
- s << "<" << QPdf::toHex((ushort)startLinear, buf) << "> <";
+ s << '<' << QPdf::toHex((ushort)startLinear, buf) << "> <";
s << QPdf::toHex((ushort)(startLinear + len - 1), buf) << "> ";
- s << "<" << QPdf::toHex((ushort)reverseMap[startLinear], buf) << ">\n";
+ s << '<' << QPdf::toHex((ushort)reverseMap[startLinear], buf) << ">\n";
checkRanges(ts, ranges, nranges);
startLinear += len;
}
@@ -1655,7 +1655,7 @@ QByteArray QFontSubset::toType1() const
QByteArray id = QByteArray::number(object_id);
QByteArray psname = properties.postscriptName;
- psname.replace(" ", "");
+ psname.replace(' ', "");
standard_font = false;
@@ -1681,12 +1681,12 @@ QByteArray QFontSubset::toType1() const
#endif
s << "/F" << id << "-Base\n";
if (standard_font) {
- s << "/" << psname << " findfont\n"
+ s << '/' << psname << " findfont\n"
"0 dict copy dup /NumGlyphs 0 put dup /CMap 256 array put def\n";
} else {
s << "<<\n";
if(!psname.isEmpty())
- s << "/FontName /" << psname << "\n";
+ s << "/FontName /" << psname << '\n';
s << "/FontInfo <</FsType " << (int)fontEngine->fsType << ">>\n"
"/FontType 1\n"
"/PaintType 0\n"
@@ -1722,7 +1722,7 @@ QByteArray QFontSubset::type1AddedGlyphs() const
int nGlyphs = glyph_indices.size();
QByteArray id = QByteArray::number(object_id);
- s << "F" << id << "-Base [\n";
+ s << 'F' << id << "-Base [\n";
for (int i = downloaded_glyphs; i < nGlyphs; ++i) {
glyph_t g = glyph_indices.at(i);
QPainterPath path;
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index f3d025c..0958b52 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -82,7 +82,7 @@
#include "private/qapplication_p.h"
#include "private/qshortcutmap_p.h"
#include <qkeysequence.h>
-#define ACCEL_KEY(k) (!qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? QLatin1String("\t") + QString(QKeySequence(k)) : QString())
+#define ACCEL_KEY(k) (!qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? QLatin1Char('\t') + QString(QKeySequence(k)) : QString())
#else
#define ACCEL_KEY(k) QString()
#endif
diff --git a/src/gui/text/qtextcontrol_p.h b/src/gui/text/qtextcontrol_p.h
index e50540a..4dac4f7 100644
--- a/src/gui/text/qtextcontrol_p.h
+++ b/src/gui/text/qtextcontrol_p.h
@@ -83,7 +83,7 @@ class QAbstractScrollArea;
class QEvent;
class QTimerEvent;
-class Q_GUI_EXPORT QTextControl : public QObject
+class Q_AUTOTEST_EXPORT QTextControl : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QTextControl)
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index d12e3fe..b9e1c89 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -1361,12 +1361,15 @@ void QTextCursor::deleteChar()
if (!d || !d->priv)
return;
- if (d->position == d->anchor) {
- if (!d->canDelete(d->position))
- return;
- d->adjusted_anchor = d->anchor =
- d->priv->nextCursorPosition(d->anchor, QTextLayout::SkipCharacters);
+ if (d->position != d->anchor) {
+ removeSelectedText();
+ return;
}
+
+ if (!d->canDelete(d->position))
+ return;
+ d->adjusted_anchor = d->anchor =
+ d->priv->nextCursorPosition(d->anchor, QTextLayout::SkipCharacters);
d->remove();
d->setX();
}
@@ -1381,27 +1384,29 @@ void QTextCursor::deletePreviousChar()
{
if (!d || !d->priv)
return;
-
- if (d->position == d->anchor) {
- if (d->anchor < 1 || !d->canDelete(d->anchor-1))
- return;
- d->anchor--;
-
- QTextDocumentPrivate::FragmentIterator fragIt = d->priv->find(d->anchor);
- const QTextFragmentData * const frag = fragIt.value();
- int fpos = fragIt.position();
- QChar uc = d->priv->buffer().at(d->anchor - fpos + frag->stringPosition);
- if (d->anchor > fpos && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) {
- // second half of a surrogate, check if we have the first half as well,
- // if yes delete both at once
- uc = d->priv->buffer().at(d->anchor - 1 - fpos + frag->stringPosition);
- if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00)
- --d->anchor;
- }
-
- d->adjusted_anchor = d->anchor;
+
+ if (d->position != d->anchor) {
+ removeSelectedText();
+ return;
}
-
+
+ if (d->anchor < 1 || !d->canDelete(d->anchor-1))
+ return;
+ d->anchor--;
+
+ QTextDocumentPrivate::FragmentIterator fragIt = d->priv->find(d->anchor);
+ const QTextFragmentData * const frag = fragIt.value();
+ int fpos = fragIt.position();
+ QChar uc = d->priv->buffer().at(d->anchor - fpos + frag->stringPosition);
+ if (d->anchor > fpos && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) {
+ // second half of a surrogate, check if we have the first half as well,
+ // if yes delete both at once
+ uc = d->priv->buffer().at(d->anchor - 1 - fpos + frag->stringPosition);
+ if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00)
+ --d->anchor;
+ }
+
+ d->adjusted_anchor = d->anchor;
d->remove();
d->setX();
}
@@ -1517,7 +1522,9 @@ void QTextCursor::removeSelectedText()
if (!d || !d->priv || d->position == d->anchor)
return;
+ d->priv->beginEditBlock();
d->remove();
+ d->priv->endEditBlock();
d->setX();
}
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 873f846..23c3c20 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -2201,7 +2201,7 @@ void QTextHtmlExporter::emitTextLength(const char *attribute, const QTextLength
if (length.type() == QTextLength::PercentageLength)
html += QLatin1String("%\"");
else
- html += QLatin1String("\"");
+ html += QLatin1Char('\"');
}
void QTextHtmlExporter::emitAlignment(Qt::Alignment align)
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index c66d0c1..fa032e6 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -2500,7 +2500,7 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
LDEBUG << "layoutBlock from=" << layoutFrom << "to=" << layoutTo;
-// qDebug() << "layoutBlock; width" << layoutStruct->x_right - layoutStruct->x_left << "(maxWidth is btw" << tl->maximumWidth() << ")";
+// qDebug() << "layoutBlock; width" << layoutStruct->x_right - layoutStruct->x_left << "(maxWidth is btw" << tl->maximumWidth() << ')';
if (previousBlockFormat) {
qreal margin = qMax(blockFormat.topMargin(), previousBlockFormat->bottomMargin());
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index faa06b7..a28c655 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -363,7 +363,7 @@ static bool bidiItemize(QTextEngine *engine, QScriptAnalysis *analysis, QBidiCon
#if (BIDI_DEBUG >= 2)
// qDebug() << "pos=" << current << " dir=" << directions[dir]
// << " current=" << directions[dirCurrent] << " last=" << directions[status.last]
-// << " eor=" << eor << "/" << directions[status.eor]
+// << " eor=" << eor << '/' << directions[status.eor]
// << " sor=" << sor << " lastStrong="
// << directions[status.lastStrong]
// << " level=" << (int)control.level << " override=" << (bool)control.override;
@@ -1099,6 +1099,16 @@ void QTextEngine::shapeTextWithCE(int item) const
}
#endif
+static inline void moveGlyphData(const QGlyphLayout &destination, const QGlyphLayout &source, int num)
+{
+ if (num > 0 && destination.glyphs != source.glyphs) {
+ memmove(destination.glyphs, source.glyphs, num * sizeof(HB_Glyph));
+ memmove(destination.attributes, source.attributes, num * sizeof(HB_GlyphAttributes));
+ memmove(destination.advances_x, source.advances_x, num * sizeof(HB_Fixed));
+ memmove(destination.offsets, source.offsets, num * sizeof(HB_FixedPoint));
+ }
+}
+
/// take the item from layoutData->items and
void QTextEngine::shapeTextWithHarfbuzz(int item) const
{
@@ -1189,7 +1199,7 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const
- int initial_glyph_pos = 0;
+ int remaining_glyphs = entire_shaper_item.num_glyphs;
int glyph_pos = 0;
// for each item shape using harfbuzz and store the results in our layoutData's glyphs array.
for (int k = 0; k < itemBoundaries.size(); k += 2) { // for the +2, see the comment at the definition of itemBoundaries
@@ -1209,7 +1219,7 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const
QFontEngine *actualFontEngine = font;
uint engineIdx = 0;
if (font->type() == QFontEngine::Multi) {
- engineIdx = uint(initialGlyphs.glyphs[itemBoundaries[k + 1]] >> 24);
+ engineIdx = uint(availableGlyphs(&si).glyphs[glyph_pos] >> 24);
actualFontEngine = static_cast<QFontEngineMulti *>(font)->engine(engineIdx);
}
@@ -1219,16 +1229,18 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const
shaper_item.glyphIndicesPresent = true;
+ remaining_glyphs -= shaper_item.initialGlyphCount;
+
do {
- ensureSpace(glyph_pos + shaper_item.num_glyphs);
- initialGlyphs = availableGlyphs(&si).mid(0, entire_shaper_item.num_glyphs);
- shaper_item.num_glyphs = layoutData->glyphLayout.numGlyphs - layoutData->used - glyph_pos;
+ ensureSpace(glyph_pos + shaper_item.num_glyphs + remaining_glyphs);
- const QGlyphLayout g = availableGlyphs(&si);
- shaper_item.glyphs = g.glyphs + glyph_pos;
- shaper_item.attributes = g.attributes + glyph_pos;
- shaper_item.advances = reinterpret_cast<HB_Fixed *>(g.advances_x + glyph_pos);
- shaper_item.offsets = reinterpret_cast<HB_FixedPoint *>(g.offsets + glyph_pos);
+ const QGlyphLayout g = availableGlyphs(&si).mid(glyph_pos);
+ moveGlyphData(g.mid(shaper_item.num_glyphs), g.mid(shaper_item.initialGlyphCount), remaining_glyphs);
+
+ shaper_item.glyphs = g.glyphs;
+ shaper_item.attributes = g.attributes;
+ shaper_item.advances = reinterpret_cast<HB_Fixed *>(g.advances_x);
+ shaper_item.offsets = reinterpret_cast<HB_FixedPoint *>(g.offsets);
if (shaper_item.glyphIndicesPresent) {
for (hb_uint32 i = 0; i < shaper_item.initialGlyphCount; ++i)
@@ -1241,18 +1253,18 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const
} while (!qShapeItem(&shaper_item)); // this does the actual shaping via harfbuzz.
QGlyphLayout g = availableGlyphs(&si).mid(glyph_pos, shaper_item.num_glyphs);
+ moveGlyphData(g.mid(shaper_item.num_glyphs), g.mid(shaper_item.initialGlyphCount), remaining_glyphs);
- for (hb_uint32 i = 0; i < shaper_item.item.length; ++i) {
+ for (hb_uint32 i = 0; i < shaper_item.num_glyphs; ++i)
g.glyphs[i] = g.glyphs[i] | (engineIdx << 24);
+
+ for (hb_uint32 i = 0; i < shaper_item.item.length; ++i)
shaper_item.log_clusters[i] += glyph_pos;
- }
if (kerningEnabled && !shaper_item.kerning_applied)
font->doKerning(&g, option.useDesignMetrics() ? QFlag(QTextEngine::DesignMetrics) : QFlag(0));
glyph_pos += shaper_item.num_glyphs;
-
- initial_glyph_pos += shaper_item.initialGlyphCount;
}
// qDebug(" -> item: script=%d num_glyphs=%d", shaper_item.script, shaper_item.num_glyphs);
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index b1f1b75..ee743dc 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -499,7 +499,7 @@ void QTextHtmlParser::dumpHtml()
{
for (int i = 0; i < count(); ++i) {
qDebug().nospace() << qPrintable(QString(depth(i)*4, QLatin1Char(' ')))
- << qPrintable(at(i).tag) << ":"
+ << qPrintable(at(i).tag) << ':'
<< quoteNewline(at(i).text);
;
}
diff --git a/src/gui/text/qtextimagehandler_p.h b/src/gui/text/qtextimagehandler_p.h
index f5426b5..1f29642 100644
--- a/src/gui/text/qtextimagehandler_p.h
+++ b/src/gui/text/qtextimagehandler_p.h
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
class QTextImageFormat;
-class Q_GUI_EXPORT QTextImageHandler : public QObject,
+class QTextImageHandler : public QObject,
public QTextObjectInterface
{
Q_OBJECT
@@ -72,7 +72,7 @@ public:
virtual void drawObject(QPainter *p, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format);
typedef QImage (*ExternalImageLoaderFunction)(const QString &name, const QString &context);
- static ExternalImageLoaderFunction externalLoader;
+ static Q_GUI_EXPORT ExternalImageLoaderFunction externalLoader; //this is needed by Qt3Support
};
QT_END_NAMESPACE
diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp
index faa4e7b..bed10dc 100644
--- a/src/gui/util/qcompleter.cpp
+++ b/src/gui/util/qcompleter.cpp
@@ -1664,7 +1664,7 @@ QStringList QCompleter::splitPath(const QString& path) const
doubleSlash.clear();
#endif
- QRegExp re(QLatin1String("[") + QRegExp::escape(sep) + QLatin1String("]"));
+ QRegExp re(QLatin1Char('[') + QRegExp::escape(sep) + QLatin1Char(']'));
QStringList parts = pathCopy.split(re);
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
diff --git a/src/gui/util/qdesktopservices_mac.cpp b/src/gui/util/qdesktopservices_mac.cpp
index fdafa1e..fb1e193 100644
--- a/src/gui/util/qdesktopservices_mac.cpp
+++ b/src/gui/util/qdesktopservices_mac.cpp
@@ -154,7 +154,7 @@ QString QDesktopServices::storageLocation(StandardLocation type)
QString appName = QCoreApplication::applicationName();
if (!appName.isEmpty() &&
(QDesktopServices::DataLocation == type || QDesktopServices::CacheLocation == type))
- path += QLatin1String("/") + appName;
+ path += QLatin1Char('/') + appName;
return path;
}
diff --git a/src/gui/util/qdesktopservices_x11.cpp b/src/gui/util/qdesktopservices_x11.cpp
index b3486e8..8c4a597 100644
--- a/src/gui/util/qdesktopservices_x11.cpp
+++ b/src/gui/util/qdesktopservices_x11.cpp
@@ -164,8 +164,8 @@ QString QDesktopServices::storageLocation(StandardLocation type)
QString key = lst.at(1);
QString value = lst.at(2);
if (value.length() > 2
- && value.startsWith(QLatin1String("\""))
- && value.endsWith(QLatin1String("\"")))
+ && value.startsWith(QLatin1Char('\"'))
+ && value.endsWith(QLatin1Char('\"')))
value = value.mid(1, value.length() - 2);
// Store the key and value: "DESKTOP", "$HOME/Desktop"
lines[key] = value;
diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp
index a6dcea6..c46c929 100644
--- a/src/gui/util/qsystemtrayicon_win.cpp
+++ b/src/gui/util/qsystemtrayicon_win.cpp
@@ -662,7 +662,7 @@ void QSystemTrayIconPrivate::showMessage_sys(const QString &title, const QString
//message is limited to 255 chars + NULL
QString messageString;
if (message.isEmpty() && !title.isEmpty())
- messageString = QLatin1String(" "); //ensures that the message shows when only title is set
+ messageString = QLatin1Char(' '); //ensures that the message shows when only title is set
else
messageString = message.left(255) + QChar();
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp
index 0d8b4de..5eed745 100644
--- a/src/gui/widgets/qabstractscrollarea.cpp
+++ b/src/gui/widgets/qabstractscrollarea.cpp
@@ -1265,6 +1265,12 @@ QSize QAbstractScrollArea::minimumSizeHint() const
int hsbExt = d->hbar->sizeHint().height();
int vsbExt = d->vbar->sizeHint().width();
int extra = 2 * d->frameWidth;
+ QStyleOption opt;
+ opt.initFrom(this);
+ if ((d->frameStyle != QFrame::NoFrame)
+ && style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, &opt, this)) {
+ extra += style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarSpacing, &opt, this);
+ }
return QSize(d->scrollBarContainers[Qt::Horizontal]->sizeHint().width() + vsbExt + extra,
d->scrollBarContainers[Qt::Vertical]->sizeHint().height() + hsbExt + extra);
}
diff --git a/src/gui/widgets/qabstractspinbox.cpp b/src/gui/widgets/qabstractspinbox.cpp
index d640c70..09accc7 100644
--- a/src/gui/widgets/qabstractspinbox.cpp
+++ b/src/gui/widgets/qabstractspinbox.cpp
@@ -1781,8 +1781,8 @@ void QAbstractSpinBoxPrivate::interpret(EmitPolicy ep)
q->fixup(tmp);
QASBDEBUG() << "QAbstractSpinBoxPrivate::interpret() text '"
<< edit->displayText()
- << "' >> '" << copy << "'"
- << "' >> '" << tmp << "'";
+ << "' >> '" << copy << '\''
+ << "' >> '" << tmp << '\'';
doInterpret = tmp != copy && (q->validate(tmp, pos) == QValidator::Acceptable);
if (!doInterpret) {
diff --git a/src/gui/widgets/qcalendarwidget.cpp b/src/gui/widgets/qcalendarwidget.cpp
index 4436c04..8703139 100644
--- a/src/gui/widgets/qcalendarwidget.cpp
+++ b/src/gui/widgets/qcalendarwidget.cpp
@@ -198,7 +198,7 @@ QString QCalendarDayValidator::text() const
{
QString str;
if (m_day / 10 == 0)
- str += QLatin1String("0");
+ str += QLatin1Char('0');
str += QString::number(m_day);
return highlightString(str, m_pos);
}
@@ -210,7 +210,7 @@ QString QCalendarDayValidator::text(const QDate &date, int repeat) const
} else if (repeat == 2) {
QString str;
if (date.day() / 10 == 0)
- str += QLatin1String("0");
+ str += QLatin1Char('0');
return str + QString::number(date.day());
} else if (repeat == 3) {
return m_locale.dayName(date.dayOfWeek(), QLocale::ShortFormat);
@@ -316,7 +316,7 @@ QString QCalendarMonthValidator::text() const
{
QString str;
if (m_month / 10 == 0)
- str += QLatin1String("0");
+ str += QLatin1Char('0');
str += QString::number(m_month);
return highlightString(str, m_pos);
}
@@ -328,7 +328,7 @@ QString QCalendarMonthValidator::text(const QDate &date, int repeat) const
} else if (repeat == 2) {
QString str;
if (date.month() / 10 == 0)
- str += QLatin1String("0");
+ str += QLatin1Char('0');
return str + QString::number(date.month());
} else if (repeat == 3) {
return m_locale.standaloneMonthName(date.month(), QLocale::ShortFormat);
@@ -432,7 +432,7 @@ QString QCalendarYearValidator::text() const
int pow = 10;
for (int i = 0; i < 3; i++) {
if (m_year / pow == 0)
- str += QLatin1String("0");
+ str += QLatin1Char('0');
pow *= 10;
}
str += QString::number(m_year);
@@ -445,7 +445,7 @@ QString QCalendarYearValidator::text(const QDate &date, int repeat) const
QString str;
int year = date.year() % 100;
if (year / 10 == 0)
- str = QLatin1String("0");
+ str = QLatin1Char('0');
return str + QString::number(year);
}
return QString::number(date.year());
@@ -577,7 +577,7 @@ void QCalendarDateValidator::setFormat(const QString &format)
clear();
int pos = 0;
- const QLatin1String quote("'");
+ const QLatin1Char quote('\'');
bool quoting = false;
QString separator;
while (pos < format.size()) {
diff --git a/src/gui/widgets/qcombobox_p.h b/src/gui/widgets/qcombobox_p.h
index ee0da62..0998e52 100644
--- a/src/gui/widgets/qcombobox_p.h
+++ b/src/gui/widgets/qcombobox_p.h
@@ -290,7 +290,7 @@ public:
QComboBoxDelegate(QObject *parent, QComboBox *cmb) : QItemDelegate(parent), mCombo(cmb) {}
static bool isSeparator(const QModelIndex &index) {
- return index.data(Qt::AccessibleDescriptionRole).toString() == QString::fromLatin1("separator");
+ return index.data(Qt::AccessibleDescriptionRole).toString() == QLatin1String("separator");
}
static void setSeparator(QAbstractItemModel *model, const QModelIndex &index) {
model->setData(index, QString::fromLatin1("separator"), Qt::AccessibleDescriptionRole);
diff --git a/src/gui/widgets/qframe.cpp b/src/gui/widgets/qframe.cpp
index 6f81331..22a990b 100644
--- a/src/gui/widgets/qframe.cpp
+++ b/src/gui/widgets/qframe.cpp
@@ -59,8 +59,7 @@ QFramePrivate::QFramePrivate()
midLineWidth(0),
frameWidth(0),
leftFrameWidth(0), rightFrameWidth(0),
- topFrameWidth(0), bottomFrameWidth(0),
- oldFrameStyle(QFrame::NoFrame | QFrame::Plain)
+ topFrameWidth(0), bottomFrameWidth(0)
{
}
@@ -333,7 +332,6 @@ void QFrame::setFrameStyle(int style)
d->frameStyle = (short)style;
update();
d->updateFrameWidth();
- d->oldFrameStyle = (short)style;
}
/*!
diff --git a/src/gui/widgets/qframe_p.h b/src/gui/widgets/qframe_p.h
index 3ea0c8b..537f5bf 100644
--- a/src/gui/widgets/qframe_p.h
+++ b/src/gui/widgets/qframe_p.h
@@ -74,7 +74,6 @@ public:
short frameWidth;
short leftFrameWidth, rightFrameWidth;
short topFrameWidth, bottomFrameWidth;
- short oldFrameStyle;
inline void init();
diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp
index 016b7c1..1aef133 100644
--- a/src/gui/widgets/qlabel.cpp
+++ b/src/gui/widgets/qlabel.cpp
@@ -1170,7 +1170,7 @@ void QLabelPrivate::updateShortcut()
shortcutCursor.deleteChar(); // remove the ampersand
shortcutCursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
} else {
- if (!text.contains(QLatin1String("&")))
+ if (!text.contains(QLatin1Char('&')))
return;
hasShortcut = true;
shortcutId = q->grabShortcut(QKeySequence::mnemonic(text));
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index 128f243..a4b0b4f 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -79,7 +79,7 @@
#include "private/qapplication_p.h"
#include "private/qshortcutmap_p.h"
#include "qkeysequence.h"
-#define ACCEL_KEY(k) (!qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? QLatin1String("\t") + QString(QKeySequence(k)) : QString())
+#define ACCEL_KEY(k) (!qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? QLatin1Char('\t') + QString(QKeySequence(k)) : QString())
#else
#define ACCEL_KEY(k) QString()
#endif
diff --git a/src/gui/widgets/qprogressbar.cpp b/src/gui/widgets/qprogressbar.cpp
index cdb3836..804220d 100644
--- a/src/gui/widgets/qprogressbar.cpp
+++ b/src/gui/widgets/qprogressbar.cpp
@@ -448,19 +448,19 @@ QString QProgressBar::text() const
qint64 totalSteps = qint64(d->maximum) - qint64(d->minimum);
QString result = d->format;
- result.replace(QLatin1String("%m"), QString::fromLatin1("%1").arg(totalSteps));
- result.replace(QLatin1String("%v"), QString::fromLatin1("%1").arg(d->value));
+ result.replace(QLatin1String("%m"), QString::number(totalSteps));
+ result.replace(QLatin1String("%v"), QString::number(d->value));
// If max and min are equal and we get this far, it means that the
// progress bar has one step and that we are on that step. Return
// 100% here in order to avoid division by zero further down.
if (totalSteps == 0) {
- result.replace(QLatin1String("%p"), QString::fromLatin1("%1").arg(100));
+ result.replace(QLatin1String("%p"), QString::number(100));
return result;
}
int progress = int(((qreal(d->value) - qreal(d->minimum)) * 100.0) / totalSteps);
- result.replace(QLatin1String("%p"), QString::fromLatin1("%1").arg(progress));
+ result.replace(QLatin1String("%p"), QString::number(progress));
return result;
}
diff --git a/src/gui/widgets/qpushbutton.cpp b/src/gui/widgets/qpushbutton.cpp
index 03ca751..ca58f87 100644
--- a/src/gui/widgets/qpushbutton.cpp
+++ b/src/gui/widgets/qpushbutton.cpp
@@ -527,8 +527,7 @@ void QPushButton::setMenu(QMenu* menu)
return;
if (menu && !d->menu) {
- disconnect(this, SIGNAL(pressed()), this, SLOT(_q_popupPressed()));
- connect(this, SIGNAL(pressed()), this, SLOT(_q_popupPressed()));
+ connect(this, SIGNAL(pressed()), this, SLOT(_q_popupPressed()), Qt::UniqueConnection);
}
if (d->menu)
removeAction(d->menu->menuAction());
diff --git a/src/gui/widgets/qspinbox.cpp b/src/gui/widgets/qspinbox.cpp
index c691eaf..f12946c 100644
--- a/src/gui/widgets/qspinbox.cpp
+++ b/src/gui/widgets/qspinbox.cpp
@@ -1030,7 +1030,7 @@ QVariant QSpinBoxPrivate::validateAndInterpret(QString &input, int &pos,
{
if (cachedText == input && !input.isEmpty()) {
state = cachedState;
- QSBDEBUG() << "cachedText was" << "'" << cachedText << "'" << "state was "
+ QSBDEBUG() << "cachedText was '" << cachedText << "' state was "
<< state << " and value was " << cachedValue;
return cachedValue;
@@ -1048,7 +1048,7 @@ QVariant QSpinBoxPrivate::validateAndInterpret(QString &input, int &pos,
|| (min >= 0 && copy == QLatin1String("+")))) {
state = QValidator::Intermediate;
QSBDEBUG() << __FILE__ << __LINE__<< "num is set to" << num;
- } else if (copy.startsWith(QLatin1String("-")) && min >= 0) {
+ } else if (copy.startsWith(QLatin1Char('-')) && min >= 0) {
state = QValidator::Invalid; // special-case -0 will be interpreted as 0 and thus not be invalid with a range from 0-100
} else {
bool ok = false;
@@ -1254,9 +1254,7 @@ QVariant QDoubleSpinBoxPrivate::valueFromText(const QString &f) const
double QDoubleSpinBoxPrivate::round(double value) const
{
- Q_Q(const QDoubleSpinBox);
- const QString strDbl = q->locale().toString(value, 'f', decimals);
- return q->locale().toDouble(strDbl);
+ return QString::number(value, 'f', decimals).toDouble();
}
@@ -1271,7 +1269,7 @@ QVariant QDoubleSpinBoxPrivate::validateAndInterpret(QString &input, int &pos,
{
if (cachedText == input && !input.isEmpty()) {
state = cachedState;
- QSBDEBUG() << "cachedText was" << "'" << cachedText << "'" << "state was "
+ QSBDEBUG() << "cachedText was '" << cachedText << "' state was "
<< state << " and value was " << cachedValue;
return cachedValue;
}
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index 0b4ce9d..bd8a1b0 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -1535,9 +1535,10 @@ void QTabBar::paintEvent(QPaintEvent *)
}
if (!d->dragInProgress)
p.drawControl(QStyle::CE_TabBarTab, tab);
- else
- d->movingTab->setGeometry(tab.rect);
-
+ else {
+ int taboverlap = style()->pixelMetric(QStyle::PM_TabBarTabOverlap, 0, this);
+ d->movingTab->setGeometry(tab.rect.adjusted(-taboverlap, 0, taboverlap, 0));
+ }
}
// Only draw the tear indicator if necessary. Most of the time we don't need too.
@@ -1804,7 +1805,9 @@ void QTabBarPrivate::setupMovableTab()
if (!movingTab)
movingTab = new QWidget(q);
+ int taboverlap = q->style()->pixelMetric(QStyle::PM_TabBarTabOverlap, 0 ,q);
QRect grabRect = q->tabRect(pressedIndex);
+ grabRect.adjust(-taboverlap, 0, taboverlap, 0);
QPixmap grabImage(grabRect.size());
grabImage.fill(Qt::transparent);
@@ -1812,7 +1815,7 @@ void QTabBarPrivate::setupMovableTab()
QStyleOptionTabV3 tab;
q->initStyleOption(&tab, pressedIndex);
- tab.rect.moveTopLeft(QPoint(0, 0));
+ tab.rect.moveTopLeft(QPoint(taboverlap, 0));
p.drawControl(QStyle::CE_TabBarTab, tab);
p.end();
diff --git a/src/network/access/qhttp.cpp b/src/network/access/qhttp.cpp
index c761a02..49ce5a3 100644
--- a/src/network/access/qhttp.cpp
+++ b/src/network/access/qhttp.cpp
@@ -64,10 +64,10 @@
# include "qtimer.h"
#endif
-QT_BEGIN_NAMESPACE
-
#ifndef QT_NO_HTTP
+QT_BEGIN_NAMESPACE
+
class QHttpNormalRequest;
class QHttpRequest
{
diff --git a/src/network/access/qhttpnetworkrequest.cpp b/src/network/access/qhttpnetworkrequest.cpp
index 7df68fc..b9b9d84 100644
--- a/src/network/access/qhttpnetworkrequest.cpp
+++ b/src/network/access/qhttpnetworkrequest.cpp
@@ -127,11 +127,11 @@ QByteArray QHttpNetworkRequestPrivate::header(const QHttpNetworkRequest &request
{
QByteArray ba = request.d->methodName();
QByteArray uri = request.d->uri(throughProxy);
- ba += " " + uri;
+ ba += ' ' + uri;
QString majorVersion = QString::number(request.majorVersion());
QString minorVersion = QString::number(request.minorVersion());
- ba += " HTTP/" + majorVersion.toLatin1() + "." + minorVersion.toLatin1() + "\r\n";
+ ba += " HTTP/" + majorVersion.toLatin1() + '.' + minorVersion.toLatin1() + "\r\n";
QList<QPair<QByteArray, QByteArray> > fields = request.header();
QList<QPair<QByteArray, QByteArray> >::const_iterator it = fields.constBegin();
diff --git a/src/network/access/qnetworkaccessfilebackend.cpp b/src/network/access/qnetworkaccessfilebackend.cpp
index 6374fde..d905b70 100644
--- a/src/network/access/qnetworkaccessfilebackend.cpp
+++ b/src/network/access/qnetworkaccessfilebackend.cpp
@@ -109,7 +109,7 @@ void QNetworkAccessFileBackend::open()
QString fileName = url.toLocalFile();
if (fileName.isEmpty()) {
if (url.scheme() == QLatin1String("qrc"))
- fileName = QLatin1String(":") + url.path();
+ fileName = QLatin1Char(':') + url.path();
else
fileName = url.toString(QUrl::RemoveAuthority | QUrl::RemoveFragment | QUrl::RemoveQuery);
}
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index 67df526..29bf042 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -1026,7 +1026,7 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug s, const QNetworkCookie &cookie)
{
- s.nospace() << "QNetworkCookie(" << cookie.toRawForm(QNetworkCookie::Full) << ")";
+ s.nospace() << "QNetworkCookie(" << cookie.toRawForm(QNetworkCookie::Full) << ')';
return s.space();
}
#endif
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 749a462..a146358 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -414,7 +414,8 @@ void QNetworkReplyImplPrivate::appendDownstreamData(const QByteArray &data)
void QNetworkReplyImplPrivate::appendDownstreamData(QIODevice *data)
{
Q_Q(QNetworkReplyImpl);
- Q_ASSERT(q->isOpen());
+ if (!q->isOpen())
+ return;
// read until EOF from data
if (copyDevice) {
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index 33795aa..b672765 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -511,13 +511,13 @@ QByteArray QAuthenticatorPrivate::digestMd5Response(const QByteArray &challenge,
credentials += "uri=\"" + path + "\", ";
if (!opaque.isEmpty())
credentials += "opaque=\"" + opaque + "\", ";
- credentials += "response=\"" + response + "\"";
+ credentials += "response=\"" + response + '\"';
if (!options.value("algorithm").isEmpty())
credentials += ", algorithm=" + options.value("algorithm");
if (!options.value("qop").isEmpty()) {
credentials += ", qop=" + qop + ", ";
credentials += "nc=" + nonceCountString + ", ";
- credentials += "cnonce=\"" + cnonce + "\"";
+ credentials += "cnonce=\"" + cnonce + '\"';
}
return credentials;
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index b225c17..c2fb690 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -1078,7 +1078,7 @@ QPair<QHostAddress, int> QHostAddress::parseSubnet(const QString &subnet)
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const QHostAddress &address)
{
- d.maybeSpace() << "QHostAddress(" << address.toString() << ")";
+ d.maybeSpace() << "QHostAddress(" << address.toString() << ')';
return d.space();
}
#endif
diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp
index 0a34e2b..472bc4b 100644
--- a/src/network/kernel/qhostinfo_win.cpp
+++ b/src/network/kernel/qhostinfo_win.cpp
@@ -72,21 +72,6 @@ struct qt_addrinfo
qt_addrinfo *ai_next;
};
-// sockaddr_in6 size changed between old and new SDK
-// Only the new version is the correct one, so always
-// use this structure.
-struct qt_in6_addr {
- uchar qt_s6_addr[16];
-};
-
-struct qt_sockaddr_in6 {
- short sin6_family; /* AF_INET6 */
- u_short sin6_port; /* Transport level port number */
- u_long sin6_flowinfo; /* IPv6 flow information */
- struct qt_in6_addr sin6_addr; /* IPv6 address */
- u_long sin6_scope_id; /* set of interfaces for a scope */
-};
-
//###
#define QT_SOCKLEN_T int
#ifndef NI_MAXHOST // already defined to 1025 in ws2tcpip.h?
diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp
index 960999e..f12b0c0 100644
--- a/src/network/kernel/qnetworkinterface.cpp
+++ b/src/network/kernel/qnetworkinterface.cpp
@@ -594,7 +594,7 @@ static inline QDebug operator<<(QDebug debug, const QNetworkAddressEntry &entry)
debug.nospace() << ", netmask = " << entry.netmask();
if (!entry.broadcast().isNull())
debug.nospace() << ", broadcast = " << entry.broadcast();
- debug.nospace() << ")";
+ debug.nospace() << ')';
return debug.space();
}
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 62bdfc7..fd3a85a 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -1258,6 +1258,6 @@ QList<QNetworkProxy> QNetworkProxyFactory::proxyForQuery(const QNetworkProxyQuer
return globalNetworkProxy()->proxyForQuery(query);
}
-#endif // QT_NO_NETWORKPROXY
-
QT_END_NAMESPACE
+
+#endif // QT_NO_NETWORKPROXY
diff --git a/src/network/kernel/qurlinfo.cpp b/src/network/kernel/qurlinfo.cpp
index 255c9ea..d90c480 100644
--- a/src/network/kernel/qurlinfo.cpp
+++ b/src/network/kernel/qurlinfo.cpp
@@ -726,6 +726,6 @@ bool QUrlInfo::isValid() const
return d != 0;
}
-#endif // QT_NO_URLINFO
-
QT_END_NAMESPACE
+
+#endif // QT_NO_URLINFO
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 336a7e7..2d37e2e 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -99,7 +99,7 @@
the client has read the data). Note that Qt does not limit the
write buffer size. You can monitor its size by listening to this
signal.
-
+
The readyRead() signal is emitted every time a new chunk of data
has arrived. bytesAvailable() then returns the number of bytes
that are available for reading. Typically, you would connect the
@@ -199,9 +199,10 @@
parameter describes the type of error that occurred.
QAbstractSocket::SocketError is not a registered metatype, so for queued
- connections, you will have to register it with Q_REGISTER_METATYPE.
+ connections, you will have to register it with Q_DECLARE_METATYPE() and
+ qRegisterMetaType().
- \sa error(), errorString()
+ \sa error(), errorString(), {Creating Custom Qt Types}
*/
/*!
@@ -211,9 +212,10 @@
The \a socketState parameter is the new state.
QAbstractSocket::SocketState is not a registered metatype, so for queued
- connections, you will have to register it with Q_REGISTER_METATYPE.
+ connections, you will have to register it with Q_REGISTER_METATYPE() and
+ qRegisterMetaType().
- \sa state()
+ \sa state(), {Creating Custom Qt Types}
*/
/*!
@@ -850,7 +852,7 @@ void QAbstractSocketPrivate::_q_startConnecting(const QHostInfo &hostInfo)
if (i != 0) s += ", ";
s += addresses.at(i).toString();
}
- s += "}";
+ s += '}';
qDebug("QAbstractSocketPrivate::_q_startConnecting(hostInfo == %s)", s.toLatin1().constData());
#endif
@@ -1864,9 +1866,9 @@ bool QAbstractSocket::waitForDisconnected(int msecs)
}
/*!
- Aborts the current connection and resets the socket. Unlike
- disconnectFromHost(), this function immediately closes the socket, discarding
- any pending data in the write buffer.
+ Aborts the current connection and resets the socket. Unlike disconnectFromHost(),
+ this function immediately closes the socket, discarding any pending data in the
+ write buffer.
\sa disconnectFromHost(), close()
*/
@@ -2163,7 +2165,12 @@ void QAbstractSocket::setPeerName(const QString &name)
}
/*!
- Disconnects the socket's connection with the host.
+ Closes the I/O device for the socket, disconnects the socket's connection with the
+ host, closes the socket, and resets the name, address, port number and underlying
+ socket descriptor.
+
+ See QIODevice::close() for a description of the actions that occur when an I/O
+ device is closed.
\sa abort()
*/
@@ -2456,7 +2463,8 @@ QNetworkProxy QAbstractSocket::proxy() const
#endif // QT_NO_NETWORKPROXY
#ifdef QT3_SUPPORT
-/*! \enum QAbstractSocket::Error
+/*!
+ \enum QAbstractSocket::Error
\compat
Use QAbstractSocket::SocketError instead.
@@ -2588,7 +2596,7 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, QAbstractSocket::SocketError er
debug << "QAbstractSocket::ProxyProtocolError";
break;
default:
- debug << "QAbstractSocket::SocketError(" << int(error) << ")";
+ debug << "QAbstractSocket::SocketError(" << int(error) << ')';
break;
}
return debug;
@@ -2619,7 +2627,7 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, QAbstractSocket::SocketState st
debug << "QAbstractSocket::ClosingState";
break;
default:
- debug << "QAbstractSocket::SocketState(" << int(state) << ")";
+ debug << "QAbstractSocket::SocketState(" << int(state) << ')';
break;
}
return debug;
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index 540c443..5a2a746 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -768,6 +768,6 @@ QAbstractSocketEngine *QHttpSocketEngineHandler::createSocketEngine(int, QObject
return 0;
}
-#endif
-
QT_END_NAMESPACE
+
+#endif
diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp
index 327bfc6..9411130 100644
--- a/src/network/socket/qlocalsocket.cpp
+++ b/src/network/socket/qlocalsocket.cpp
@@ -468,7 +468,7 @@ QDebug operator<<(QDebug debug, QLocalSocket::LocalSocketError error)
debug << "QLocalSocket::UnknownSocketError";
break;
default:
- debug << "QLocalSocket::SocketError(" << int(error) << ")";
+ debug << "QLocalSocket::SocketError(" << int(error) << ')';
break;
}
return debug;
@@ -490,7 +490,7 @@ QDebug operator<<(QDebug debug, QLocalSocket::LocalSocketState state)
debug << "QLocalSocket::ClosingState";
break;
default:
- debug << "QLocalSocket::SocketState(" << int(state) << ")";
+ debug << "QLocalSocket::SocketState(" << int(state) << ')';
break;
}
return debug;
diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h
index 3366f2d..eb031d3 100644
--- a/src/network/socket/qnativesocketengine_p.h
+++ b/src/network/socket/qnativesocketengine_p.h
@@ -56,7 +56,9 @@
#include "QtNetwork/qhostaddress.h"
#include "private/qabstractsocketengine_p.h"
#ifndef Q_OS_WIN
-#include "qplatformdefs.h"
+# include "qplatformdefs.h"
+#else
+# include <winsock2.h>
#endif
QT_BEGIN_NAMESPACE
@@ -90,6 +92,39 @@ static inline int qt_socket_socket(int domain, int type, int protocol)
#endif
+// Use our own defines and structs which we know are correct
+# define QT_SS_MAXSIZE 128
+# define QT_SS_ALIGNSIZE (sizeof(qint64))
+# define QT_SS_PAD1SIZE (QT_SS_ALIGNSIZE - sizeof (short))
+# define QT_SS_PAD2SIZE (QT_SS_MAXSIZE - (sizeof (short) + QT_SS_PAD1SIZE + QT_SS_ALIGNSIZE))
+struct qt_sockaddr_storage {
+ short ss_family;
+ char __ss_pad1[QT_SS_PAD1SIZE];
+ qint64 __ss_align;
+ char __ss_pad2[QT_SS_PAD2SIZE];
+};
+
+// sockaddr_in6 size changed between old and new SDK
+// Only the new version is the correct one, so always
+// use this structure.
+struct qt_in6_addr {
+ quint8 qt_s6_addr[16];
+};
+struct qt_sockaddr_in6 {
+ short sin6_family; /* AF_INET6 */
+ quint16 sin6_port; /* Transport level port number */
+ quint32 sin6_flowinfo; /* IPv6 flow information */
+ struct qt_in6_addr sin6_addr; /* IPv6 address */
+ quint32 sin6_scope_id; /* set of interfaces for a scope */
+};
+
+union qt_sockaddr {
+ sockaddr a;
+ sockaddr_in a4;
+ qt_sockaddr_in6 a6;
+ qt_sockaddr_storage storage;
+};
+
class QNativeSocketEnginePrivate;
class Q_AUTOTEST_EXPORT QNativeSocketEngine : public QAbstractSocketEngine
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index cc372a6..75b5a64 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -114,36 +114,34 @@ static void qt_ignore_sigpipe()
Extracts the port and address from a sockaddr, and stores them in
\a port and \a addr if they are non-null.
*/
-static inline void qt_socket_getPortAndAddress(struct sockaddr *sa, quint16 *port, QHostAddress *addr)
+static inline void qt_socket_getPortAndAddress(const qt_sockaddr *s, quint16 *port, QHostAddress *addr)
{
#if !defined(QT_NO_IPV6)
- if (sa->sa_family == AF_INET6) {
- struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa;
+ if (s->a.sa_family == AF_INET6) {
Q_IPV6ADDR tmp;
- memcpy(&tmp, &sa6->sin6_addr.s6_addr, sizeof(tmp));
+ memcpy(&tmp, &s->a6.sin6_addr, sizeof(tmp));
if (addr) {
QHostAddress tmpAddress;
tmpAddress.setAddress(tmp);
*addr = tmpAddress;
#ifndef QT_NO_IPV6IFNAME
char scopeid[IFNAMSIZ];
- if (::if_indextoname(sa6->sin6_scope_id, scopeid) > 0) {
+ if (::if_indextoname(s->a6.sin6_scope_id, scopeid) > 0) {
addr->setScopeId(QLatin1String(scopeid));
} else
#endif
- addr->setScopeId(QString::number(sa6->sin6_scope_id));
+ addr->setScopeId(QString::number(s->a6.sin6_scope_id));
}
if (port)
- *port = ntohs(sa6->sin6_port);
+ *port = ntohs(s->a6.sin6_port);
return;
}
#endif
- struct sockaddr_in *sa4 = (struct sockaddr_in *)sa;
if (port)
- *port = ntohs(sa4->sin_port);
+ *port = ntohs(s->a4.sin_port);
if (addr) {
QHostAddress tmpAddress;
- tmpAddress.setAddress(ntohl(sa4->sin_addr.s_addr));
+ tmpAddress.setAddress(ntohl(s->a4.sin_addr.s_addr));
*addr = tmpAddress;
}
}
@@ -521,26 +519,16 @@ qint64 QNativeSocketEnginePrivate::nativeBytesAvailable() const
bool QNativeSocketEnginePrivate::nativeHasPendingDatagrams() const
{
// Create a sockaddr struct and reset its port number.
-#if !defined(QT_NO_IPV6)
- struct sockaddr_storage storage;
- sockaddr_in6 *storagePtrIPv6 = reinterpret_cast<sockaddr_in6 *>(&storage);
- storagePtrIPv6->sin6_port = 0;
-#else
- struct sockaddr storage;
-#endif
- sockaddr *storagePtr = reinterpret_cast<sockaddr *>(&storage);
- storagePtr->sa_family = 0;
-
- sockaddr_in *storagePtrIPv4 = reinterpret_cast<sockaddr_in *>(&storage);
- storagePtrIPv4->sin_port = 0;
+ qt_sockaddr storage;
QT_SOCKLEN_T storageSize = sizeof(storage);
+ memset(&storage, 0, storageSize);
// Peek 0 bytes into the next message. The size of the message may
// well be 0, so we can't check recvfrom's return value.
ssize_t readBytes;
do {
char c;
- readBytes = ::recvfrom(socketDescriptor, &c, 1, MSG_PEEK, storagePtr, &storageSize);
+ readBytes = ::recvfrom(socketDescriptor, &c, 1, MSG_PEEK, &storage.a, &storageSize);
} while (readBytes == -1 && errno == EINTR);
// If there's no error, or if our buffer was too small, there must be a
@@ -583,11 +571,7 @@ qint64 QNativeSocketEnginePrivate::nativePendingDatagramSize() const
qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxSize,
QHostAddress *address, quint16 *port)
{
-#if !defined(QT_NO_IPV6)
- struct sockaddr_storage aa;
-#else
- struct sockaddr_in aa;
-#endif
+ qt_sockaddr aa;
memset(&aa, 0, sizeof(aa));
QT_SOCKLEN_T sz;
sz = sizeof(aa);
@@ -596,13 +580,13 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxS
do {
char c;
recvFromResult = ::recvfrom(socketDescriptor, maxSize ? data : &c, maxSize ? maxSize : 1,
- 0, (struct sockaddr *)&aa, &sz);
+ 0, &aa.a, &sz);
} while (recvFromResult == -1 && errno == EINTR);
if (recvFromResult == -1) {
setError(QAbstractSocket::NetworkError, ReceiveDatagramErrorString);
} else if (port || address) {
- qt_socket_getPortAndAddress((struct sockaddr *) &aa, port, address);
+ qt_socket_getPortAndAddress(&aa, port, address);
}
#if defined (QNATIVESOCKETENGINE_DEBUG)
@@ -682,21 +666,16 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters()
if (socketDescriptor == -1)
return false;
-#if !defined(QT_NO_IPV6)
- struct sockaddr_storage sa;
-#else
- struct sockaddr_in sa;
-#endif
- struct sockaddr *sockAddrPtr = (struct sockaddr *) &sa;
+ qt_sockaddr sa;
QT_SOCKLEN_T sockAddrSize = sizeof(sa);
// Determine local address
memset(&sa, 0, sizeof(sa));
- if (::getsockname(socketDescriptor, sockAddrPtr, &sockAddrSize) == 0) {
- qt_socket_getPortAndAddress(sockAddrPtr, &localPort, &localAddress);
+ if (::getsockname(socketDescriptor, &sa.a, &sockAddrSize) == 0) {
+ qt_socket_getPortAndAddress(&sa, &localPort, &localAddress);
// Determine protocol family
- switch (sockAddrPtr->sa_family) {
+ switch (sa.a.sa_family) {
case AF_INET:
socketProtocol = QAbstractSocket::IPv4Protocol;
break;
@@ -716,8 +695,8 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters()
}
// Determine the remote address
- if (!::getpeername(socketDescriptor, sockAddrPtr, &sockAddrSize))
- qt_socket_getPortAndAddress(sockAddrPtr, &peerPort, &peerAddress);
+ if (!::getpeername(socketDescriptor, &sa.a, &sockAddrSize))
+ qt_socket_getPortAndAddress(&sa, &peerPort, &peerAddress);
// Determine the socket type (UDP/TCP)
int value = 0;
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index d140be2..b08d7b0 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -149,41 +149,6 @@ static QByteArray qt_prettyDebug(const char *data, int len, int maxLength)
#endif
-#if !defined (QT_NO_IPV6)
-
-// Use our own defines and structs which we know are correct
-# define QT_SS_MAXSIZE 128
-# define QT_SS_ALIGNSIZE (sizeof(__int64))
-# define QT_SS_PAD1SIZE (QT_SS_ALIGNSIZE - sizeof (short))
-# define QT_SS_PAD2SIZE (QT_SS_MAXSIZE - (sizeof (short) + QT_SS_PAD1SIZE + QT_SS_ALIGNSIZE))
-struct qt_sockaddr_storage {
- short ss_family;
- char __ss_pad1[QT_SS_PAD1SIZE];
- __int64 __ss_align;
- char __ss_pad2[QT_SS_PAD2SIZE];
-};
-
-// sockaddr_in6 size changed between old and new SDK
-// Only the new version is the correct one, so always
-// use this structure.
-struct qt_in6_addr {
- u_char qt_s6_addr[16];
-};
-typedef struct {
- short sin6_family; /* AF_INET6 */
- u_short sin6_port; /* Transport level port number */
- u_long sin6_flowinfo; /* IPv6 flow information */
- struct qt_in6_addr sin6_addr; /* IPv6 address */
- u_long sin6_scope_id; /* set of interfaces for a scope */
-} qt_sockaddr_in6;
-
-#else
-
-typedef void * qt_sockaddr_in6 ;
-
-
-#endif
-
#ifndef AF_INET6
#define AF_INET6 23 /* Internetwork Version 6 */
#endif
diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp
index c41e32d..40d86ac 100644
--- a/src/network/socket/qsocks5socketengine.cpp
+++ b/src/network/socket/qsocks5socketengine.cpp
@@ -153,7 +153,7 @@ static inline QString dump(const QByteArray &) { return QString(); }
*/
static bool qt_socks5_set_host_address_and_port(const QHostAddress &address, quint16 port, QByteArray *pBuf)
{
- QSOCKS5_DEBUG << "setting [" << address << ":" << port << "]";
+ QSOCKS5_DEBUG << "setting [" << address << ':' << port << ']';
union {
quint16 port;
@@ -186,7 +186,7 @@ static bool qt_socks5_set_host_address_and_port(const QHostAddress &address, qui
*/
static bool qt_socks5_set_host_name_and_port(const QString &hostname, quint16 port, QByteArray *pBuf)
{
- QSOCKS5_DEBUG << "setting [" << hostname << ":" << port << "]";
+ QSOCKS5_DEBUG << "setting [" << hostname << ':' << port << ']';
QByteArray encodedHostName = QUrl::toAce(hostname);
QByteArray &buf = *pBuf;
@@ -265,7 +265,7 @@ static bool qt_socks5_get_host_address_and_port(const QByteArray &buf, QHostAddr
}
if (ret) {
- QSOCKS5_DEBUG << "got [" << address << ":" << port << "]";
+ QSOCKS5_DEBUG << "got [" << address << ':' << port << ']';
*pAddress = address;
*pPort = port;
*pPos = pos;
@@ -1124,7 +1124,7 @@ bool QSocks5SocketEngine::connectInternal()
bool QSocks5SocketEngine::connectToHost(const QHostAddress &address, quint16 port)
{
Q_D(QSocks5SocketEngine);
- QSOCKS5_DEBUG << "connectToHost" << address << ":" << port;
+ QSOCKS5_DEBUG << "connectToHost" << address << ':' << port;
setPeerAddress(address);
setPeerPort(port);
@@ -1379,7 +1379,7 @@ bool QSocks5SocketEngine::bind(const QHostAddress &address, quint16 port)
//### reset and error
return false;
}
- QSOCKS5_DEBUG << "udp actual address and port" << d->localAddress << ":" << d->localPort;
+ QSOCKS5_DEBUG << "udp actual address and port" << d->localAddress << ':' << d->localPort;
return true;
#endif // QT_NO_UDPSOCKET
}
@@ -1478,7 +1478,7 @@ qint64 QSocks5SocketEngine::bytesAvailable() const
qint64 QSocks5SocketEngine::read(char *data, qint64 maxlen)
{
Q_D(QSocks5SocketEngine);
- QSOCKS5_Q_DEBUG << "read( , maxlen = " << maxlen << ")";
+ QSOCKS5_Q_DEBUG << "read( , maxlen = " << maxlen << ')';
if (d->mode == QSocks5SocketEnginePrivate::ConnectMode) {
if (d->connectData->readBuffer.size() == 0) {
if (d->data->controlSocket->state() == QAbstractSocket::UnconnectedState) {
@@ -1766,7 +1766,7 @@ void QSocks5SocketEngine::setReadNotificationEnabled(bool enable)
{
Q_D(QSocks5SocketEngine);
- QSOCKS5_Q_DEBUG << "setReadNotificationEnabled(" << enable << ")";
+ QSOCKS5_Q_DEBUG << "setReadNotificationEnabled(" << enable << ')';
bool emitSignal = false;
if (!d->readNotificationEnabled
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index a2ba644..7ee0f07 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -267,7 +267,7 @@ QByteArray QSslCertificate::serialNumber() const
/*!
Returns a cryptographic digest of this certificate. By default,
- and MD5 digest will be generated, but you can also specify a
+ an MD5 digest will be generated, but you can also specify a
custom \a algorithm.
*/
QByteArray QSslCertificate::digest(QCryptographicHash::Algorithm algorithm) const
@@ -766,16 +766,16 @@ QDebug operator<<(QDebug debug, const QSslCertificate &certificate)
{
debug << "QSslCertificate("
<< certificate.version()
- << "," << certificate.serialNumber()
- << "," << certificate.digest().toBase64()
- << "," << certificate.issuerInfo(QSslCertificate::Organization)
- << "," << certificate.subjectInfo(QSslCertificate::Organization)
- << "," << certificate.alternateSubjectNames()
+ << ',' << certificate.serialNumber()
+ << ',' << certificate.digest().toBase64()
+ << ',' << certificate.issuerInfo(QSslCertificate::Organization)
+ << ',' << certificate.subjectInfo(QSslCertificate::Organization)
+ << ',' << certificate.alternateSubjectNames()
#ifndef QT_NO_TEXTSTREAM
- << "," << certificate.effectiveDate()
- << "," << certificate.expiryDate()
+ << ',' << certificate.effectiveDate()
+ << ',' << certificate.expiryDate()
#endif
- << ")";
+ << ')';
return debug;
}
QDebug operator<<(QDebug debug, QSslCertificate::SubjectInfo info)
diff --git a/src/network/ssl/qsslcipher.cpp b/src/network/ssl/qsslcipher.cpp
index 7fec2df..696db1e 100644
--- a/src/network/ssl/qsslcipher.cpp
+++ b/src/network/ssl/qsslcipher.cpp
@@ -231,7 +231,7 @@ QDebug operator<<(QDebug debug, const QSslCipher &cipher)
debug << "QSslCipher(name=" << qPrintable(cipher.name())
<< ", bits=" << cipher.usedBits()
<< ", proto=" << qPrintable(cipher.protocolString())
- << ")";
+ << ')';
return debug;
}
#endif
diff --git a/src/network/ssl/qsslkey.cpp b/src/network/ssl/qsslkey.cpp
index 8d550c0..6dbdc29 100644
--- a/src/network/ssl/qsslkey.cpp
+++ b/src/network/ssl/qsslkey.cpp
@@ -460,7 +460,7 @@ QDebug operator<<(QDebug debug, const QSslKey &key)
<< (key.type() == QSsl::PublicKey ? "PublicKey" : "PrivateKey")
<< ", " << (key.algorithm() == QSsl::Rsa ? "RSA" : "DSA")
<< ", " << key.length()
- << ")";
+ << ')';
return debug;
}
#endif
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 92054a4..16033b6 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -442,8 +442,8 @@ bool QSslSocket::setSocketDescriptor(int socketDescriptor, SocketState state, Op
{
Q_D(QSslSocket);
#ifdef QSSLSOCKET_DEBUG
- qDebug() << "QSslSocket::setSocketDescriptor(" << socketDescriptor << ","
- << state << "," << openMode << ")";
+ qDebug() << "QSslSocket::setSocketDescriptor(" << socketDescriptor << ','
+ << state << ',' << openMode << ')';
#endif
if (!d->plainSocket)
d->createPlainSocket(openMode);
@@ -1608,7 +1608,7 @@ void QSslSocket::connectToHostImplementation(const QString &hostName, quint16 po
#ifdef QSSLSOCKET_DEBUG
qDebug() << "QSslSocket::connectToHostImplementation("
- << hostName << "," << port << "," << openMode << ")";
+ << hostName << ',' << port << ',' << openMode << ')';
#endif
if (!d->plainSocket) {
#ifdef QSSLSOCKET_DEBUG
@@ -1682,7 +1682,7 @@ qint64 QSslSocket::readData(char *data, qint64 maxlen)
} while (!d->readBuffer.isEmpty() && readBytes < maxlen);
}
#ifdef QSSLSOCKET_DEBUG
- qDebug() << "QSslSocket::readData(" << (void *)data << "," << maxlen << ") ==" << readBytes;
+ qDebug() << "QSslSocket::readData(" << (void *)data << ',' << maxlen << ") ==" << readBytes;
#endif
return readBytes;
}
@@ -1694,7 +1694,7 @@ qint64 QSslSocket::writeData(const char *data, qint64 len)
{
Q_D(QSslSocket);
#ifdef QSSLSOCKET_DEBUG
- qDebug() << "QSslSocket::writeData(" << (void *)data << "," << len << ")";
+ qDebug() << "QSslSocket::writeData(" << (void *)data << ',' << len << ')';
#endif
if (d->mode == UnencryptedMode && !d->autoStartHandshake)
return d->plainSocket->write(data, len);
@@ -1999,7 +1999,7 @@ void QSslSocketPrivate::_q_stateChangedSlot(QAbstractSocket::SocketState state)
{
Q_Q(QSslSocket);
#ifdef QSSLSOCKET_DEBUG
- qDebug() << "QSslSocket::_q_stateChangedSlot(" << state << ")";
+ qDebug() << "QSslSocket::_q_stateChangedSlot(" << state << ')';
#endif
q->setSocketState(state);
emit q->stateChanged(state);
@@ -2012,7 +2012,7 @@ void QSslSocketPrivate::_q_errorSlot(QAbstractSocket::SocketError error)
{
Q_Q(QSslSocket);
#ifdef QSSLSOCKET_DEBUG
- qDebug() << "QSslSocket::_q_errorSlot(" << error << ")";
+ qDebug() << "QSslSocket::_q_errorSlot(" << error << ')';
qDebug() << "\tstate =" << q->state();
qDebug() << "\terrorString =" << q->errorString();
#endif
@@ -2047,7 +2047,7 @@ void QSslSocketPrivate::_q_bytesWrittenSlot(qint64 written)
{
Q_Q(QSslSocket);
#ifdef QSSLSOCKET_DEBUG
- qDebug() << "QSslSocket::_q_bytesWrittenSlot(" << written << ")";
+ qDebug() << "QSslSocket::_q_bytesWrittenSlot(" << written << ')';
#endif
if (mode == QSslSocket::UnencryptedMode)
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 49798e0..4017c4d 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -276,7 +276,7 @@ init_context:
if (first)
first = false;
else
- cipherString.append(":");
+ cipherString.append(':');
cipherString.append(cipher.name().toLatin1());
}
@@ -482,30 +482,7 @@ void QSslSocketPrivate::resetDefaultCiphers()
QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
{
-#ifdef QQ_OS_UNIX
- // Check known locations for the system's default bundle. ### On Windows,
- // we should use CAPI to find the bundle, and not rely on default unix
- // locations.
- const char *standardLocations[] = {"/etc/ssl/certs/",
-#if 0
- // KDE uses KConfig for its SSL store,
- // but it also stores the bundle at
- // this location
- "$HOME/.kde/share/apps/kssl/ca-bundle.crt",
-#endif
- 0};
- const char **it = standardLocations;
- QStringList nameFilter;
- nameFilter << QLatin1String("*.pem") << QLatin1String("*.crt");
- while (*it) {
- if (QDirIterator(QLatin1String(*it), nameFilter).hasNext())
- return certificatesFromPath(QLatin1String(*it));
- ++it;
- }
-#endif
-
- // Qt provides a default bundle when we cannot detect the system's default
- // bundle.
+ // Qt provides a default bundle of certificates
QFile caBundle(QLatin1String(":/trolltech/network/ssl/qt-ca-bundle.crt"));
if (caBundle.open(QIODevice::ReadOnly | QIODevice::Text))
return QSslCertificate::fromDevice(&caBundle);
diff --git a/src/opengl/gl2paintengineex/glgc_shader_source.h b/src/opengl/gl2paintengineex/glgc_shader_source.h
deleted file mode 100644
index 5b9d28b..0000000
--- a/src/opengl/gl2paintengineex/glgc_shader_source.h
+++ /dev/null
@@ -1,289 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtOpenGL 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef GLGC_SHADER_SOURCE_H
-#define GLGC_SHADER_SOURCE_H
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(OpenGL)
-
-static const char* qglslImageVertexShader = "\
- attribute highp vec4 inputVertex; \
- attribute lowp vec2 textureCoord; \
- uniform highp mat4 pmvMatrix; \
- varying lowp vec2 fragTextureCoord; \
- void main(void) \
- {\
- gl_Position = pmvMatrix * inputVertex;\
- fragTextureCoord = textureCoord; \
- }";
-
-static const char* qglslImageFragmentShader = "\
- varying lowp vec2 fragTextureCoord;\
- uniform sampler2D textureSampler;\
- uniform lowp float opacity; \
- void main(void) \
- {\
- gl_FragColor = texture2D(textureSampler, fragTextureCoord) * opacity; \
- }";
-
-static const char* qglslTextFragmentShader = "\
- varying lowp vec2 fragTextureCoord;\
- uniform mediump vec4 fragmentColor;\
- uniform sampler2D textureSampler;\
- void main(void) \
- {\
- highp vec4 tex = texture2D(textureSampler, fragTextureCoord); \
- tex = fragmentColor * tex.r; \
- gl_FragColor = tex; \
- }";
-
-static const char* qglslDefaultVertexShader = "\
- attribute highp vec4 inputVertex;\
- uniform highp mat4 pmvMatrix;\
- void main(void)\
- {\
- gl_Position = pmvMatrix * inputVertex;\
- }";
-
-static const char* qglslSimpleFragmentShader = "\
- void main (void)\
- {\
- gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\
- }";
-
-
-/**** FRAGMENT SHADER MAIN FUNCTIONS ****/
-// NOTE: Currently, the engine assumes brushes return colors already in pre-multiplied
-// format. However, this may change if we add support for non-premultiplied
-
-static const char* qglslNoOpacityFragmentShaderMain = "\n\
- mediump vec4 brush();\
- void main (void)\
- {\
- gl_FragColor = brush();\
- }\n";
-
-static const char* qglslFragmentShaderMain = "\n\
- mediump vec4 brush();\
- uniform lowp float opacity; \
- void main (void)\
- {\
- gl_FragColor = brush() * opacity;\
- }\n";
-
-
-
-/**** BRUSH SHADERS ****/
-
-// This should never actually be used
-static const char* qglslNoBrushFragmentShader = "\n\
- mediump vec4 brush() { \
- discard; \
- return vec4(1.0, 0.8, 0.8, 1.0);\
- }\n";
-
-// Solid Fill Brush
-static const char* qglslSolidBrushFragmentShader = "\n\
- uniform mediump vec4 fragmentColor; \
- mediump vec4 brush() { \
- return fragmentColor;\
- }\n";
-
-// Texture Brush
-static const char* qglslTextureBrushVertexShader = "\
- attribute highp vec4 inputVertex; \
- uniform highp mat4 pmvMatrix; \
- uniform mediump vec2 halfViewportSize; \
- uniform mediump vec2 invertedTextureSize; \
- uniform mediump mat3 brushTransform; \
- varying mediump vec2 texCoords; \
- void main(void) { \
- gl_Position = pmvMatrix * inputVertex;\
- gl_Position.xy = gl_Position.xy / gl_Position.w; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \
- gl_Position.w = invertedHTexCoordsZ; \
- texCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \
- texCoords.y = -texCoords.y; \
- }";
-
-static const char* qglslTextureBrushFragmentShader = "\n\
- varying mediump vec2 texCoords;\
- uniform sampler2D brushTexture;\
- mediump vec4 brush() { \
- return texture2D(brushTexture, texCoords); \
- }\n";
-
-
-// Pattern Brush - This assumes the texture size is 8x8 and thus, the inverted size is 0.125
-static const char* qglslPatternBrushVertexShader = "\
- attribute highp vec4 inputVertex; \
- uniform highp mat4 pmvMatrix; \
- uniform mediump vec2 halfViewportSize; \
- uniform mediump vec2 invertedTextureSize; \
- uniform mediump mat3 brushTransform; \
- varying mediump vec2 texCoords; \
- void main(void) { \
- gl_Position = pmvMatrix * inputVertex;\
- gl_Position.xy = gl_Position.xy / gl_Position.w; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \
- gl_Position.w = invertedHTexCoordsZ; \
- texCoords.xy = (hTexCoords.xy * 0.125) * invertedHTexCoordsZ; \
- texCoords.y = -texCoords.y; \
- }";
-
-static const char* qglslPatternBrushFragmentShader = "\n\
- uniform sampler2D brushTexture;\
- uniform lowp vec4 patternColor; \
- varying mediump vec2 texCoords;\
- mediump vec4 brush() { \
- return patternColor * texture2D(brushTexture, texCoords).r; \
- }\n";
-
-
-// Linear Gradient Brush
-static const char* qglslLinearGradientBrushVertexShader = "\
- attribute highp vec4 inputVertex; \
- uniform highp mat4 pmvMatrix; \
- uniform mediump vec2 halfViewportSize; \
- uniform highp vec3 linearData; \
- uniform mediump mat3 brushTransform; \
- varying mediump float index ; \
- void main() { \
- gl_Position = pmvMatrix * inputVertex;\
- gl_Position.xy = gl_Position.xy / gl_Position.w; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \
- gl_Position.w = invertedHTexCoordsZ; \
- index = (dot(linearData.xy, hTexCoords.xy) * linearData.z) * invertedHTexCoordsZ; \
- }";
-
-static const char* qglslLinearGradientBrushFragmentShader = "\n\
- uniform sampler2D brushTexture; \
- varying mediump float index; \
- mediump vec4 brush() { \
- mediump vec2 val = vec2(index, 0.5); \
- return texture2D(brushTexture, val); \
- }\n";
-
-
-static const char* qglslRadialGradientBrushVertexShader = "\
- attribute highp vec4 inputVertex;\
- uniform highp mat4 pmvMatrix;\
- uniform mediump vec2 halfViewportSize; \
- uniform highp mat3 brushTransform; \
- uniform highp vec2 fmp; \
- varying highp float b; \
- varying highp vec2 A; \
- void main(void) \
- {\
- gl_Position = pmvMatrix * inputVertex;\
- gl_Position.xy = gl_Position.xy / gl_Position.w; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \
- gl_Position.w = invertedHTexCoordsZ; \
- A = hTexCoords.xy * invertedHTexCoordsZ; \
- b = 2.0 * fmp * (A.x + A.y); \
-\
- }";
-
-static const char* qglslRadialGradientBrushFragmentShader = "\n\
- uniform sampler2D brushTexture; \
- uniform highp float fmp2_m_radius2; \
- uniform highp float inverse_2_fmp2_m_radius2; \
- varying highp float b; \
- varying highp vec2 A; \
-\
- mediump vec4 brush() { \
- highp float c = -dot(A, A); \
- highp vec2 val = vec2((-b + sqrt(b*b - 4.0*fmp2_m_radius2*c)) * inverse_2_fmp2_m_radius2, 0.5); \
- return texture2D(brushTexture, val); \
- }\n";
-
-static const char* qglslConicalGradientBrushVertexShader = "\
- attribute highp vec4 inputVertex;\
- uniform highp mat4 pmvMatrix;\
- uniform mediump vec2 halfViewportSize; \
- uniform highp mat3 brushTransform; \
- varying highp vec2 A; \
- void main(void)\
- {\
- gl_Position = pmvMatrix * inputVertex;\
- gl_Position.xy = gl_Position.xy / gl_Position.w; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \
- gl_Position.w = invertedHTexCoordsZ; \
- A = hTexCoords.xy * invertedHTexCoordsZ; \
- }";
-
-static const char* qglslConicalGradientBrushFragmentShader = "\n\
- #define INVERSE_2PI 0.1591549430918953358 \n\
- uniform sampler2D brushTexture; \
- uniform mediump float angle; \
- varying highp vec2 A; \
- mediump vec4 brush() { \
- if (abs(A.y) == abs(A.x)) \
- A.y += 0.002; \
- highp float t = (atan2(-A.y, A.x) + angle) * INVERSE_2PI; \
- return texture2D(brushTexture, vec2(t - floor(t), 0.5)); \
- }\n";
-
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // GLGC_SHADER_SOURCE_H
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
index 0352d39..560ad3a 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
@@ -43,6 +43,8 @@
#include <private/qbezier_p.h>
+QT_BEGIN_NAMESPACE
+
void QGL2PEXVertexArray::clear()
{
vertexArray.reset();
@@ -59,6 +61,12 @@ QGLRect QGL2PEXVertexArray::boundingRect() const
return QGLRect(minX, minY, maxX, maxY);
}
+void QGL2PEXVertexArray::addRect(const QRectF &rect)
+{
+ vertexArray << rect.topLeft() << rect.topRight() << rect.bottomRight()
+ << rect.bottomRight() << rect.bottomLeft() << rect.topLeft();
+}
+
void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseScale)
{
const QPointF* const points = reinterpret_cast<const QPointF*>(path.points());
@@ -154,3 +162,5 @@ void QGL2PEXVertexArray::curveToArray(const QGLPoint &cp1, const QGLPoint &cp2,
}
}
}
+
+QT_END_NAMESPACE
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
index c205022..d7a9f73 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
@@ -50,19 +50,24 @@
// We mean it.
//
+#ifndef QGL2PEXVERTEXARRAY_P_H
+#define QGL2PEXVERTEXARRAY_P_H
+
#include <QRectF>
#include <private/qdatabuffer_p.h>
#include <private/qvectorpath_p.h>
#include <private/qgl_p.h>
+QT_BEGIN_NAMESPACE
+
class QGLPoint
{
public:
QGLPoint(GLfloat new_x, GLfloat new_y) :
x(new_x), y(new_y) {};
- QGLPoint(QPointF p) :
+ QGLPoint(const QPointF &p) :
x(p.x()), y(p.y()) {};
QGLPoint(const QPointF* p) :
@@ -77,7 +82,7 @@ public:
struct QGLRect
{
- QGLRect(QRectF r)
+ QGLRect(const QRectF &r)
: left(r.left()), top(r.top()), right(r.right()), bottom(r.bottom()) {}
QGLRect(GLfloat l, GLfloat t, GLfloat r, GLfloat b)
@@ -98,6 +103,7 @@ public:
maxX(-2e10), maxY(-2e10), minX(2e10), minY(2e10),
boundingRectDirty(true) {}
+ void addRect(const QRectF &rect);
void addPath(const QVectorPath &path, GLfloat curveInverseScale);
void clear();
@@ -119,3 +125,7 @@ private:
inline void curveToArray(const QGLPoint &cp1, const QGLPoint &cp2, const QGLPoint &ep, GLfloat inverseScale);
};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
new file mode 100644
index 0000000..f64af85
--- /dev/null
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -0,0 +1,467 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtOpenGL 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qglengineshadermanager_p.h"
+#include "qglengineshadersource_p.h"
+
+#if defined(QT_DEBUG)
+#include <QMetaEnum>
+#endif
+
+
+QT_BEGIN_NAMESPACE
+
+const char* QGLEngineShaderManager::qglEngineShaderSourceCode[] = {
+ 0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0
+};
+
+QGLEngineShaderManager::QGLEngineShaderManager(QGLContext* context)
+ : ctx(context),
+ shaderProgNeedsChanging(true),
+ srcPixelType(Qt::NoBrush),
+ useGlobalOpacity(false),
+ maskType(NoMask),
+ useTextureCoords(false),
+ compositionMode(QPainter::CompositionMode_SourceOver),
+ simpleShaderProg(0),
+ currentShaderProg(0)
+{
+ memset(compiledShaders, 0, sizeof(compiledShaders));
+
+/*
+ Rather than having the shader source array statically initialised, it is initialised
+ here instead. This is to allow new shader names to be inserted or existing names moved
+ around without having to change the order of the glsl strings. It is hoped this will
+ make future hard-to-find runtime bugs more obvious and generally give more solid code.
+*/
+ static bool qglEngineShaderSourceCodePopulated = false;
+ if (!qglEngineShaderSourceCodePopulated) {
+
+ const char** code = qglEngineShaderSourceCode; // shortcut
+
+ code[MainVertexShader] = qglslMainVertexShader;
+ code[MainWithTexCoordsVertexShader] = qglslMainWithTexCoordsVertexShader;
+
+ code[PositionOnlyVertexShader] = qglslPositionOnlyVertexShader;
+ code[PositionWithPatternBrushVertexShader] = qglslPositionWithPatternBrushVertexShader;
+ code[PositionWithLinearGradientBrushVertexShader] = qglslPositionWithLinearGradientBrushVertexShader;
+ code[PositionWithConicalGradientBrushVertexShader] = qglslPositionWithConicalGradientBrushVertexShader;
+ code[PositionWithRadialGradientBrushVertexShader] = qglslPositionWithRadialGradientBrushVertexShader;
+ code[PositionWithTextureBrushVertexShader] = qglslPositionWithTextureBrushVertexShader;
+ code[AffinePositionWithPatternBrushVertexShader] = qglslAffinePositionWithPatternBrushVertexShader;
+ code[AffinePositionWithLinearGradientBrushVertexShader] = qglslAffinePositionWithLinearGradientBrushVertexShader;
+ code[AffinePositionWithConicalGradientBrushVertexShader] = qglslAffinePositionWithConicalGradientBrushVertexShader;
+ code[AffinePositionWithRadialGradientBrushVertexShader] = qglslAffinePositionWithRadialGradientBrushVertexShader;
+ code[AffinePositionWithTextureBrushVertexShader] = qglslAffinePositionWithTextureBrushVertexShader;
+
+ code[MainFragmentShader_CMO] = qglslMainFragmentShader_CMO;
+ code[MainFragmentShader_CM] = qglslMainFragmentShader_CM;
+ code[MainFragmentShader_MO] = qglslMainFragmentShader_MO;
+ code[MainFragmentShader_M] = qglslMainFragmentShader_M;
+ code[MainFragmentShader_CO] = qglslMainFragmentShader_CO;
+ code[MainFragmentShader_C] = qglslMainFragmentShader_C;
+ code[MainFragmentShader_O] = qglslMainFragmentShader_O;
+ code[MainFragmentShader] = qglslMainFragmentShader;
+
+ code[ImageSrcFragmentShader] = qglslImageSrcFragmentShader;
+ code[NonPremultipliedImageSrcFragmentShader] = qglslNonPremultipliedImageSrcFragmentShader;
+ code[SolidBrushSrcFragmentShader] = qglslSolidBrushSrcFragmentShader;
+ code[TextureBrushSrcFragmentShader] = qglslTextureBrushSrcFragmentShader;
+ code[PatternBrushSrcFragmentShader] = qglslPatternBrushSrcFragmentShader;
+ code[LinearGradientBrushSrcFragmentShader] = qglslLinearGradientBrushSrcFragmentShader;
+ code[RadialGradientBrushSrcFragmentShader] = qglslRadialGradientBrushSrcFragmentShader;
+ code[ConicalGradientBrushSrcFragmentShader] = qglslConicalGradientBrushSrcFragmentShader;
+ code[ShockingPinkSrcFragmentShader] = qglslShockingPinkSrcFragmentShader;
+
+ code[MaskFragmentShader] = qglslMaskFragmentShader;
+ code[RgbMaskFragmentShader] = ""; //###
+ code[RgbMaskWithGammaFragmentShader] = ""; //###
+
+ code[MultiplyCompositionModeFragmentShader] = ""; //###
+ code[ScreenCompositionModeFragmentShader] = ""; //###
+ code[OverlayCompositionModeFragmentShader] = ""; //###
+ code[DarkenCompositionModeFragmentShader] = ""; //###
+ code[LightenCompositionModeFragmentShader] = ""; //###
+ code[ColorDodgeCompositionModeFragmentShader] = ""; //###
+ code[ColorBurnCompositionModeFragmentShader] = ""; //###
+ code[HardLightCompositionModeFragmentShader] = ""; //###
+ code[SoftLightCompositionModeFragmentShader] = ""; //###
+ code[DifferenceCompositionModeFragmentShader] = ""; //###
+ code[ExclusionCompositionModeFragmentShader] = ""; //###
+
+#if defined(QT_DEBUG)
+ // Check that all the elements have been filled:
+ for (int i = 0; i < TotalShaderCount; ++i) {
+ if (qglEngineShaderSourceCode[i] == 0) {
+ int enumIndex = staticMetaObject.indexOfEnumerator("ShaderName");
+ QMetaEnum m = staticMetaObject.enumerator(enumIndex);
+
+ qCritical() << "qglEngineShaderSourceCode: Source for" << m.valueToKey(i)
+ << "(shader" << i << ") missing!";
+ }
+ }
+#endif
+ qglEngineShaderSourceCodePopulated = true;
+ }
+
+ // Compile up the simple shader:
+ simpleShaderProg = new QGLShaderProgram(ctx, this);
+ compileNamedShader(MainVertexShader, QGLShader::PartialVertexShader);
+ compileNamedShader(PositionOnlyVertexShader, QGLShader::PartialVertexShader);
+ compileNamedShader(MainFragmentShader, QGLShader::PartialFragmentShader);
+ compileNamedShader(ShockingPinkSrcFragmentShader, QGLShader::PartialFragmentShader);
+ simpleShaderProg->addShader(compiledShaders[MainVertexShader]);
+ simpleShaderProg->addShader(compiledShaders[PositionOnlyVertexShader]);
+ simpleShaderProg->addShader(compiledShaders[MainFragmentShader]);
+ simpleShaderProg->addShader(compiledShaders[ShockingPinkSrcFragmentShader]);
+ simpleShaderProg->link();
+ if (!simpleShaderProg->isLinked()) {
+ qCritical() << "Errors linking simple shader:"
+ << simpleShaderProg->log();
+ }
+}
+
+QGLEngineShaderManager::~QGLEngineShaderManager()
+{
+ //###
+}
+
+
+
+
+
+void QGLEngineShaderManager::optimiseForBrushTransform(const QTransform &transform)
+{
+ Q_UNUSED(transform); // Currently ignored
+}
+
+void QGLEngineShaderManager::setSrcPixelType(Qt::BrushStyle style)
+{
+ srcPixelType = style;
+ shaderProgNeedsChanging = true; //###
+}
+
+void QGLEngineShaderManager::setSrcPixelType(PixelSrcType type)
+{
+ srcPixelType = type;
+ shaderProgNeedsChanging = true; //###
+}
+
+void QGLEngineShaderManager::setTextureCoordsEnabled(bool enabled)
+{
+ useTextureCoords = enabled;
+ shaderProgNeedsChanging = true; //###
+}
+
+void QGLEngineShaderManager::setUseGlobalOpacity(bool useOpacity)
+{
+ useGlobalOpacity = useOpacity;
+ shaderProgNeedsChanging = true; //###
+}
+
+void QGLEngineShaderManager::setMaskType(MaskType type)
+{
+ maskType = type;
+ shaderProgNeedsChanging = true; //###
+}
+
+void QGLEngineShaderManager::setCompositionMode(QPainter::CompositionMode mode)
+{
+ compositionMode = mode;
+ shaderProgNeedsChanging = true; //###
+}
+
+QGLShaderProgram* QGLEngineShaderManager::currentProgram()
+{
+ return currentShaderProg;
+}
+
+QGLShaderProgram* QGLEngineShaderManager::simpleProgram()
+{
+ return simpleShaderProg;
+}
+
+
+
+
+// Select & use the correct shader program using the current state.
+// Returns true if program needed changing.
+bool QGLEngineShaderManager::useCorrectShaderProg()
+{
+ if (!shaderProgNeedsChanging)
+ return false;
+
+ QGLEngineShaderProg requiredProgram;
+ requiredProgram.program = 0;
+
+ // Choose vertex shader main function
+ QGLEngineShaderManager::ShaderName mainVertexShaderName = InvalidShaderName;
+ if (useTextureCoords)
+ mainVertexShaderName = MainWithTexCoordsVertexShader;
+ else
+ mainVertexShaderName = MainVertexShader;
+ compileNamedShader(mainVertexShaderName, QGLShader::PartialVertexShader);
+ requiredProgram.mainVertexShader = compiledShaders[mainVertexShaderName];
+
+ // Choose vertex shader shader position function (which typically also sets
+ // varyings) and the source pixel (srcPixel) fragment shader function:
+ QGLEngineShaderManager::ShaderName positionVertexShaderName = InvalidShaderName;
+ QGLEngineShaderManager::ShaderName srcPixelFragShaderName = InvalidShaderName;
+ bool isAffine = brushTransform.isAffine();
+ if ( (srcPixelType >= Qt::Dense1Pattern) && (srcPixelType <= Qt::DiagCrossPattern) ) {
+ if (isAffine)
+ positionVertexShaderName = AffinePositionWithPatternBrushVertexShader;
+ else
+ positionVertexShaderName = PositionWithPatternBrushVertexShader;
+
+ srcPixelFragShaderName = PatternBrushSrcFragmentShader;
+ }
+ else switch (srcPixelType) {
+ default:
+ case Qt::NoBrush:
+ qCritical("QGLEngineShaderManager::useCorrectShaderProg() - I'm scared, Qt::NoBrush style is set");
+ break;
+ case QGLEngineShaderManager::ImageSrc:
+ srcPixelFragShaderName = ImageSrcFragmentShader;
+ positionVertexShaderName = PositionOnlyVertexShader;
+ break;
+ case QGLEngineShaderManager::NonPremultipliedImageSrc:
+ srcPixelFragShaderName = NonPremultipliedImageSrcFragmentShader;
+ positionVertexShaderName = PositionOnlyVertexShader;
+ break;
+ case Qt::SolidPattern:
+ srcPixelFragShaderName = SolidBrushSrcFragmentShader;
+ positionVertexShaderName = PositionOnlyVertexShader;
+ break;
+ case Qt::LinearGradientPattern:
+ srcPixelFragShaderName = LinearGradientBrushSrcFragmentShader;
+ positionVertexShaderName = isAffine ? AffinePositionWithLinearGradientBrushVertexShader
+ : PositionWithLinearGradientBrushVertexShader;
+ break;
+ case Qt::ConicalGradientPattern:
+ srcPixelFragShaderName = ConicalGradientBrushSrcFragmentShader;
+ positionVertexShaderName = isAffine ? AffinePositionWithConicalGradientBrushVertexShader
+ : PositionWithConicalGradientBrushVertexShader;
+ break;
+ case Qt::RadialGradientPattern:
+ srcPixelFragShaderName = RadialGradientBrushSrcFragmentShader;
+ positionVertexShaderName = isAffine ? AffinePositionWithRadialGradientBrushVertexShader
+ : PositionWithRadialGradientBrushVertexShader;
+ break;
+ case Qt::TexturePattern:
+ srcPixelFragShaderName = TextureBrushSrcFragmentShader;
+ positionVertexShaderName = isAffine ? AffinePositionWithTextureBrushVertexShader
+ : PositionWithTextureBrushVertexShader;
+ break;
+ };
+ compileNamedShader(positionVertexShaderName, QGLShader::PartialVertexShader);
+ compileNamedShader(srcPixelFragShaderName, QGLShader::PartialFragmentShader);
+ requiredProgram.positionVertexShader = compiledShaders[positionVertexShaderName];
+ requiredProgram.srcPixelFragShader = compiledShaders[srcPixelFragShaderName];
+
+
+ const bool hasCompose = compositionMode > QPainter::CompositionMode_Plus;
+ const bool hasMask = maskType != QGLEngineShaderManager::NoMask;
+
+ // Choose fragment shader main function:
+ QGLEngineShaderManager::ShaderName mainFragShaderName;
+
+ if (hasCompose && hasMask && useGlobalOpacity)
+ mainFragShaderName = MainFragmentShader_CMO;
+ if (hasCompose && hasMask && !useGlobalOpacity)
+ mainFragShaderName = MainFragmentShader_CM;
+ if (!hasCompose && hasMask && useGlobalOpacity)
+ mainFragShaderName = MainFragmentShader_MO;
+ if (!hasCompose && hasMask && !useGlobalOpacity)
+ mainFragShaderName = MainFragmentShader_M;
+ if (hasCompose && !hasMask && useGlobalOpacity)
+ mainFragShaderName = MainFragmentShader_CO;
+ if (hasCompose && !hasMask && !useGlobalOpacity)
+ mainFragShaderName = MainFragmentShader_C;
+ if (!hasCompose && !hasMask && useGlobalOpacity)
+ mainFragShaderName = MainFragmentShader_O;
+ if (!hasCompose && !hasMask && !useGlobalOpacity)
+ mainFragShaderName = MainFragmentShader;
+
+ compileNamedShader(mainFragShaderName, QGLShader::PartialFragmentShader);
+ requiredProgram.mainFragShader = compiledShaders[mainFragShaderName];
+
+ if (hasMask) {
+ QGLEngineShaderManager::ShaderName maskShaderName = QGLEngineShaderManager::InvalidShaderName;
+ if (maskType == PixelMask)
+ maskShaderName = MaskFragmentShader;
+ else if (maskType == SubPixelMask)
+ maskShaderName = RgbMaskFragmentShader;
+ else if (maskType == SubPixelWithGammaMask)
+ maskShaderName = RgbMaskWithGammaFragmentShader;
+ else
+ qCritical("QGLEngineShaderManager::useCorrectShaderProg() - Unknown mask type");
+
+ compileNamedShader(maskShaderName, QGLShader::PartialFragmentShader);
+ requiredProgram.maskFragShader = compiledShaders[maskShaderName];
+ }
+ else
+ requiredProgram.maskFragShader = 0;
+
+ if (hasCompose) {
+ QGLEngineShaderManager::ShaderName compositionShaderName = QGLEngineShaderManager::InvalidShaderName;
+ switch (compositionMode) {
+ case QPainter::CompositionMode_Multiply:
+ compositionShaderName = MultiplyCompositionModeFragmentShader;
+ break;
+ case QPainter::CompositionMode_Screen:
+ compositionShaderName = ScreenCompositionModeFragmentShader;
+ break;
+ case QPainter::CompositionMode_Overlay:
+ compositionShaderName = OverlayCompositionModeFragmentShader;
+ break;
+ case QPainter::CompositionMode_Darken:
+ compositionShaderName = DarkenCompositionModeFragmentShader;
+ break;
+ case QPainter::CompositionMode_Lighten:
+ compositionShaderName = LightenCompositionModeFragmentShader;
+ break;
+ case QPainter::CompositionMode_ColorDodge:
+ compositionShaderName = ColorDodgeCompositionModeFragmentShader;
+ break;
+ case QPainter::CompositionMode_ColorBurn:
+ compositionShaderName = ColorBurnCompositionModeFragmentShader;
+ break;
+ case QPainter::CompositionMode_HardLight:
+ compositionShaderName = HardLightCompositionModeFragmentShader;
+ break;
+ case QPainter::CompositionMode_SoftLight:
+ compositionShaderName = SoftLightCompositionModeFragmentShader;
+ break;
+ case QPainter::CompositionMode_Difference:
+ compositionShaderName = DifferenceCompositionModeFragmentShader;
+ break;
+ case QPainter::CompositionMode_Exclusion:
+ compositionShaderName = ExclusionCompositionModeFragmentShader;
+ break;
+ default:
+ qWarning("QGLEngineShaderManager::useCorrectShaderProg() - Unsupported composition mode");
+ }
+ compileNamedShader(compositionShaderName, QGLShader::PartialFragmentShader);
+ requiredProgram.compositionFragShader = compiledShaders[compositionShaderName];
+ }
+ else
+ requiredProgram.compositionFragShader = 0;
+
+
+ // At this point, requiredProgram is fully populated so try to find the program in the cache
+ foreach (const QGLEngineShaderProg &prog, cachedPrograms) {
+ if ( (prog.mainVertexShader == requiredProgram.mainVertexShader)
+ && (prog.positionVertexShader == requiredProgram.positionVertexShader)
+ && (prog.mainFragShader == requiredProgram.mainFragShader)
+ && (prog.srcPixelFragShader == requiredProgram.srcPixelFragShader)
+ && (prog.compositionFragShader == requiredProgram.compositionFragShader) )
+ {
+ currentShaderProg = prog.program;
+ currentShaderProg->enable();
+ shaderProgNeedsChanging = false;
+ return true;
+ }
+ }
+
+ // Shader program not found in cache, create it now.
+ requiredProgram.program = new QGLShaderProgram(ctx, this);
+ requiredProgram.program->addShader(requiredProgram.mainVertexShader);
+ requiredProgram.program->addShader(requiredProgram.positionVertexShader);
+ requiredProgram.program->addShader(requiredProgram.mainFragShader);
+ requiredProgram.program->addShader(requiredProgram.srcPixelFragShader);
+ requiredProgram.program->addShader(requiredProgram.maskFragShader);
+ requiredProgram.program->addShader(requiredProgram.compositionFragShader);
+
+ // We have to bind the vertex attribute names before the program is linked:
+ requiredProgram.program->bindAttributeLocation("inputVertex", QT_VERTEX_COORDS_ATTR);
+ if (useTextureCoords)
+ requiredProgram.program->bindAttributeLocation("textureCoordArray", QT_TEXTURE_COORDS_ATTR);
+
+ requiredProgram.program->link();
+ if (!requiredProgram.program->isLinked()) {
+ QString error;
+ qWarning() << "Shader program failed to link,"
+#if defined(QT_DEBUG)
+ << '\n'
+ << " Shaders Used:" << '\n'
+ << " mainVertexShader = " << requiredProgram.mainVertexShader->objectName() << '\n'
+ << " positionVertexShader = " << requiredProgram.positionVertexShader->objectName() << '\n'
+ << " mainFragShader = " << requiredProgram.mainFragShader->objectName() << '\n'
+ << " srcPixelFragShader = " << requiredProgram.srcPixelFragShader->objectName() << '\n'
+ << " maskFragShader = " << requiredProgram.maskFragShader->objectName() << '\n'
+ << " compositionFragShader = "<< requiredProgram.compositionFragShader->objectName() << '\n'
+#endif
+ << " Error Log:" << '\n'
+ << " " << requiredProgram.program->log();
+ qWarning() << error;
+ }
+ else {
+ cachedPrograms.append(requiredProgram);
+ currentShaderProg = requiredProgram.program;
+ currentShaderProg->enable();
+ }
+ shaderProgNeedsChanging = false;
+ return true;
+}
+
+void QGLEngineShaderManager::compileNamedShader(QGLEngineShaderManager::ShaderName name, QGLShader::ShaderType type)
+{
+ if (compiledShaders[name])
+ return;
+
+ QGLShader *newShader = new QGLShader(type, ctx, this);
+ newShader->setSourceCode(qglEngineShaderSourceCode[name]);
+ // newShader->compile(); ### does not exist?
+
+#if defined(QT_DEBUG)
+ // Name the shader for easier debugging
+ QMetaEnum m = staticMetaObject.enumerator(staticMetaObject.indexOfEnumerator("ShaderName"));
+ newShader->setObjectName(QLatin1String(m.valueToKey(name)));
+#endif
+
+ compiledShaders[name] = newShader;
+}
+
+QT_END_NAMESPACE
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
new file mode 100644
index 0000000..b8b2745
--- /dev/null
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
@@ -0,0 +1,385 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtOpenGL 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+/*
+ VERTEX SHADERS
+ ==============
+
+ Vertex shaders are specified as multiple (partial) shaders. On desktop,
+ this works fine. On ES, QGLShader & QGLShaderProgram will make partial
+ shaders work by concatenating the source in each QGLShader and compiling
+ it as a single shader. This is abstracted nicely by QGLShaderProgram and
+ the GL2 engine doesn't need to worry about it.
+
+ Generally, there's two vertex shader objects. The position shaders are
+ the ones which set gl_Position. There's also two "main" vertex shaders,
+ one which just calls the position shader and another which also passes
+ through some texture coordinates from a vertex attribute array to a
+ varying. These texture coordinates are used for mask position in text
+ rendering and for the source coordinates in drawImage/drawPixmap. There's
+ also a "Simple" vertex shader for rendering a solid colour (used to render
+ into the stencil buffer where the actual colour value is discarded).
+
+ The position shaders for brushes look scary. This is because many of the
+ calculations which logically belong in the fragment shader have been moved
+ into the vertex shader to improve performance. This is why the position
+ calculation is in a seperate shader. Not only does it calculate the
+ position, but it also calculates some data to be passed to the fragment
+ shader as a varying. It is optimal to move as much of the calculation as
+ possible into the vertex shader as this is executed less often.
+
+ The varyings passed to the fragment shaders are interpolated (which is
+ cheap). Unfortunately, GL will apply perspective correction to the
+ interpolation calusing errors. To get around this, the vertex shader must
+ apply perspective correction itself and set the w-value of gl_Position to
+ zero. That way, GL will be tricked into thinking it doesn't need to apply a
+ perspective correction and use linear interpolation instead (which is what
+ we want). Of course, if the brush transform is affeine, no perspective
+ correction is needed and a simpler vertex shader can be used instead.
+
+ So there are the following "main" vertex shaders:
+ qglslMainVertexShader
+ qglslMainWithTexCoordsVertexShader
+
+ And the the following position vertex shaders:
+ qglslPositionOnlyVertexShader
+ qglslPositionWithTextureBrushVertexShader
+ qglslPositionWithPatternBrushVertexShader
+ qglslPositionWithLinearGradientBrushVertexShader
+ qglslPositionWithRadialGradientBrushVertexShader
+ qglslPositionWithConicalGradientBrushVertexShader
+ qglslAffinePositionWithTextureBrushVertexShader
+ qglslAffinePositionWithPatternBrushVertexShader
+ qglslAffinePositionWithLinearGradientBrushVertexShader
+ qglslAffinePositionWithRadialGradientBrushVertexShader
+ qglslAffinePositionWithConicalGradientBrushVertexShader
+
+ Leading to 23 possible vertex shaders
+
+
+ FRAGMENT SHADERS
+ ================
+
+ Fragment shaders are also specified as multiple (partial) shaders. The
+ different fragment shaders represent the different stages in Qt's fragment
+ pipeline. There are 1-3 stages in this pipeline: First stage is to get the
+ fragment's colour value. The next stage is to get the fragment's mask value
+ (coverage value for anti-aliasing) and the final stage is to blend the
+ incoming fragment with the background (for composition modes not supported
+ by GL).
+
+ Of these, the first stage will always be present. If Qt doesn't need to
+ apply anti-aliasing (because it's off or handled by multisampling) then
+ the coverage value doesn't need to be applied. (Note: There are two types
+ of mask, one for regular anti-aliasing and one for sub-pixel anti-
+ aliasing.) If the composition mode is one which GL supports natively then
+ the blending stage doesn't need to be applied.
+
+ As eash stage can have multiple implementations, they are abstracted as
+ GLSL function calls with the following signatures:
+
+ Brushes & image drawing are implementations of "qcolorp vec4 srcPixel()":
+ qglslImageSrcFragShader
+ qglslNonPremultipliedImageSrcFragShader
+ qglslSolidBrushSrcFragShader
+ qglslTextureBrushSrcFragShader
+ qglslPatternBrushSrcFragShader
+ qglslLinearGradientBrushSrcFragShader
+ qglslRadialGradientBrushSrcFragShader
+ qglslConicalGradientBrushSrcFragShader
+ NOTE: It is assumed the colour returned by srcPixel() is pre-multiplied
+
+ Masks are implementations of "qcolorp vec4 applyMask(qcolorp vec4 src)":
+ qglslMaskFragmentShader
+ qglslRgbMaskFragmentShader
+ qglslRgbMaskWithGammaFragmentShader
+
+ Composition modes are "qcolorp vec4 compose(qcolorp vec4 src)":
+ qglslColorBurnCompositionModeFragmentShader
+ qglslColorDodgeCompositionModeFragmentShader
+ qglslDarkenCompositionModeFragmentShader
+ qglslDifferenceCompositionModeFragmentShader
+ qglslExclusionCompositionModeFragmentShader
+ qglslHardLightCompositionModeFragmentShader
+ qglslLightenCompositionModeFragmentShader
+ qglslMultiplyCompositionModeFragmentShader
+ qglslOverlayCompositionModeFragmentShader
+ qglslScreenCompositionModeFragmentShader
+ qglslSoftLightCompositionModeFragmentShader
+
+
+ Note: In the future, some GLSL compilers will support an extension allowing
+ a new 'color' precision specifier. To support this, qcolorp is used for
+ all color components so it can be defined to colorp or lowp depending upon
+ the implementation.
+
+ So there are differnt frament shader main functions, depending on the
+ number & type of pipelines the fragment needs to go through.
+
+ The choice of which main() fragment shader string to use depends on:
+ - Use of global opacity
+ - Brush style (some brushes apply opacity themselves)
+ - Use & type of mask (TODO: Need to support high quality anti-aliasing & text)
+ - Use of non-GL Composition mode
+
+ Leading to the following fragment shader main functions:
+ gl_FragColor = compose(applyMask(srcPixel()*globalOpacity));
+ gl_FragColor = compose(applyMask(srcPixel()));
+ gl_FragColor = applyMask(srcPixel()*globalOpacity);
+ gl_FragColor = applyMask(srcPixel());
+ gl_FragColor = compose(srcPixel()*globalOpacity);
+ gl_FragColor = compose(srcPixel());
+ gl_FragColor = srcPixel()*globalOpacity;
+ gl_FragColor = srcPixel();
+
+ Called:
+ qglslMainFragmentShader_CMO
+ qglslMainFragmentShader_CM
+ qglslMainFragmentShader_MO
+ qglslMainFragmentShader_M
+ qglslMainFragmentShader_CO
+ qglslMainFragmentShader_C
+ qglslMainFragmentShader_O
+ qglslMainFragmentShader
+
+ Where:
+ M = Mask
+ C = Composition
+ O = Global Opacity
+
+
+ CUSTOM SHADER CODE (idea, depricated)
+ ==================
+
+ The use of custom shader code is supported by the engine for drawImage and
+ drawPixmap calls. This is implemented via hooks in the fragment pipeline.
+ The custom shader is passed to the engine as a partial fragment shader
+ (QGLCustomizedShader). The shader will implement a pre-defined method name
+ which Qt's fragment pipeline will call. There are two different hooks which
+ can be implemented as custom shader code:
+
+ mediump vec4 customShader(sampler2d src, vec2 srcCoords)
+ mediump vec4 customShaderWithDest(sampler2d dest, sampler2d src, vec2 srcCoords)
+
+*/
+
+#ifndef QGLENGINE_SHADER_MANAGER_H
+#define QGLENGINE_SHADER_MANAGER_H
+
+#include <QGLShader>
+#include <QGLShaderProgram>
+#include <QPainter>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(OpenGL)
+
+
+struct QGLEngineShaderProg
+{
+ QGLShader* mainVertexShader;
+ QGLShader* positionVertexShader;
+ QGLShader* mainFragShader;
+ QGLShader* srcPixelFragShader;
+ QGLShader* maskFragShader; // Can be null for no mask
+ QGLShader* compositionFragShader; // Can be null for GL-handled mode
+ QGLShaderProgram* program;
+};
+
+/*
+struct QGLEngineCachedShaderProg
+{
+ QGLEngineCachedShaderProg(QGLEngineShaderManager::ShaderName vertexMain,
+ QGLEngineShaderManager::ShaderName vertexPosition,
+ QGLEngineShaderManager::ShaderName fragMain,
+ QGLEngineShaderManager::ShaderName pixelSrc,
+ QGLEngineShaderManager::ShaderName mask,
+ QGLEngineShaderManager::ShaderName composition);
+
+ int cacheKey;
+ QGLShaderProgram* program;
+}
+*/
+
+static const GLuint QT_VERTEX_COORDS_ATTR = 0;
+static const GLuint QT_TEXTURE_COORDS_ATTR = 1;
+
+class QGLEngineShaderManager : public QObject
+{
+ Q_OBJECT;
+public:
+ QGLEngineShaderManager(QGLContext* context);
+ ~QGLEngineShaderManager();
+
+ enum MaskType {NoMask, PixelMask, SubPixelMask, SubPixelWithGammaMask};
+ enum PixelSrcType {
+ ImageSrc = Qt::TexturePattern+1,
+ NonPremultipliedImageSrc = Qt::TexturePattern+2
+ };
+
+ // There are optimisations we can do, depending on the brush transform:
+ // 1) May not have to apply perspective-correction
+ // 2) Can use lower precision for matrix
+ void optimiseForBrushTransform(const QTransform &transform);
+ void setSrcPixelType(Qt::BrushStyle);
+ void setSrcPixelType(PixelSrcType); // For non-brush sources, like pixmaps & images
+ void setTextureCoordsEnabled(bool); // For images & text glyphs
+ void setUseGlobalOpacity(bool);
+ void setMaskType(MaskType);
+ void setCompositionMode(QPainter::CompositionMode);
+
+ bool useCorrectShaderProg(); // returns true if the shader program needed to be changed
+
+ QGLShaderProgram* currentProgram(); // Returns pointer to the shader the manager has chosen
+ QGLShaderProgram* simpleProgram(); // Used to draw into e.g. stencil buffers
+
+ enum ShaderName {
+ MainVertexShader,
+ MainWithTexCoordsVertexShader,
+
+ PositionOnlyVertexShader,
+ PositionWithPatternBrushVertexShader,
+ PositionWithLinearGradientBrushVertexShader,
+ PositionWithConicalGradientBrushVertexShader,
+ PositionWithRadialGradientBrushVertexShader,
+ PositionWithTextureBrushVertexShader,
+ AffinePositionWithPatternBrushVertexShader,
+ AffinePositionWithLinearGradientBrushVertexShader,
+ AffinePositionWithConicalGradientBrushVertexShader,
+ AffinePositionWithRadialGradientBrushVertexShader,
+ AffinePositionWithTextureBrushVertexShader,
+
+ MainFragmentShader_CMO,
+ MainFragmentShader_CM,
+ MainFragmentShader_MO,
+ MainFragmentShader_M,
+ MainFragmentShader_CO,
+ MainFragmentShader_C,
+ MainFragmentShader_O,
+ MainFragmentShader,
+
+ ImageSrcFragmentShader,
+ NonPremultipliedImageSrcFragmentShader,
+ SolidBrushSrcFragmentShader,
+ TextureBrushSrcFragmentShader,
+ PatternBrushSrcFragmentShader,
+ LinearGradientBrushSrcFragmentShader,
+ RadialGradientBrushSrcFragmentShader,
+ ConicalGradientBrushSrcFragmentShader,
+ ShockingPinkSrcFragmentShader,
+
+ MaskFragmentShader,
+ RgbMaskFragmentShader,
+ RgbMaskWithGammaFragmentShader,
+
+ MultiplyCompositionModeFragmentShader,
+ ScreenCompositionModeFragmentShader,
+ OverlayCompositionModeFragmentShader,
+ DarkenCompositionModeFragmentShader,
+ LightenCompositionModeFragmentShader,
+ ColorDodgeCompositionModeFragmentShader,
+ ColorBurnCompositionModeFragmentShader,
+ HardLightCompositionModeFragmentShader,
+ SoftLightCompositionModeFragmentShader,
+ DifferenceCompositionModeFragmentShader,
+ ExclusionCompositionModeFragmentShader,
+
+ TotalShaderCount, InvalidShaderName
+ };
+
+/*
+ // These allow the ShaderName enum to be used as a cache key
+ const int mainVertexOffset = 0;
+ const int positionVertexOffset = (1<<2) - PositionOnlyVertexShader;
+ const int mainFragOffset = (1<<6) - MainFragmentShader_CMO;
+ const int srcPixelOffset = (1<<10) - ImageSrcFragmentShader;
+ const int maskOffset = (1<<14) - NoMaskShader;
+ const int compositionOffset = (1 << 16) - MultiplyCompositionModeFragmentShader;
+*/
+
+#if defined (QT_DEBUG)
+ Q_ENUMS(ShaderName);
+#endif
+
+
+private:
+ QGLContext* ctx;
+ bool shaderProgNeedsChanging;
+
+ // Current state variables which influence the choice of shader:
+ QTransform brushTransform;
+ int srcPixelType;
+ bool useGlobalOpacity;
+ MaskType maskType;
+ bool useTextureCoords;
+ QPainter::CompositionMode compositionMode;
+
+ QGLShaderProgram* simpleShaderProg;
+ QGLShaderProgram* currentShaderProg;
+
+ // TODO: Possibly convert to a LUT
+ QList<QGLEngineShaderProg> cachedPrograms;
+
+ QGLShader* compiledShaders[TotalShaderCount];
+
+ void compileNamedShader(QGLEngineShaderManager::ShaderName name, QGLShader::ShaderType type);
+
+ static const char* qglEngineShaderSourceCode[TotalShaderCount];
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif //QGLENGINE_SHADER_MANAGER_H
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
new file mode 100644
index 0000000..fdbba72
--- /dev/null
+++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
@@ -0,0 +1,383 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtOpenGL 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+
+#ifndef QGL_ENGINE_SHADER_SOURCE_H
+#define QGL_ENGINE_SHADER_SOURCE_H
+
+#include "qglengineshadermanager_p.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(OpenGL)
+
+
+static const char* const qglslMainVertexShader = "\
+ void setPosition();\
+ void main(void)\
+ {\
+ setPosition();\
+ }";
+
+static const char* const qglslMainWithTexCoordsVertexShader = "\
+ attribute lowp vec2 textureCoordArray; \
+ varying lowp vec2 textureCoords; \
+ void setPosition();\
+ void main(void) \
+ {\
+ setPosition();\
+ textureCoords = textureCoordArray; \
+ }";
+
+
+static const char* const qglslPositionOnlyVertexShader = "\
+ attribute highp vec4 vertexCoordsArray;\
+ uniform highp mat4 pmvMatrix;\
+ void setPosition(void)\
+ {\
+ gl_Position = pmvMatrix * vertexCoordsArray;\
+ }";
+
+
+// Pattern Brush - This assumes the texture size is 8x8 and thus, the inverted size is 0.125
+static const char* const qglslPositionWithPatternBrushVertexShader = "\
+ attribute highp vec4 vertexCoordsArray; \
+ uniform highp mat4 pmvMatrix; \
+ uniform mediump vec2 halfViewportSize; \
+ uniform mediump vec2 invertedTextureSize; \
+ uniform mediump mat3 brushTransform; \
+ varying mediump vec2 patternTexCoords; \
+ void setPosition(void) { \
+ gl_Position = pmvMatrix * vertexCoordsArray;\
+ gl_Position.xy = gl_Position.xy / gl_Position.w; \
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
+ gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \
+ gl_Position.w = invertedHTexCoordsZ; \
+ patternTexCoords.xy = (hTexCoords.xy * 0.125) * invertedHTexCoordsZ; \
+ patternTexCoords.y = -patternTexCoords.y; \
+ }";
+
+static const char* const qglslAffinePositionWithPatternBrushVertexShader
+ = qglslPositionWithPatternBrushVertexShader;
+
+static const char* const qglslPatternBrushSrcFragmentShader = "\
+ uniform sampler2D brushTexture;\
+ uniform lowp vec4 patternColor; \
+ varying mediump vec2 patternTexCoords;\
+ lowp vec4 srcPixel() { \
+ return patternColor * texture2D(brushTexture, patternTexCoords).r; \
+ }\n";
+
+
+// Linear Gradient Brush
+static const char* const qglslPositionWithLinearGradientBrushVertexShader = "\
+ attribute highp vec4 vertexCoordsArray; \
+ uniform highp mat4 pmvMatrix; \
+ uniform mediump vec2 halfViewportSize; \
+ uniform highp vec3 linearData; \
+ uniform highp mat3 brushTransform; \
+ varying mediump float index ; \
+ void setPosition() { \
+ gl_Position = pmvMatrix * vertexCoordsArray;\
+ gl_Position.xy = gl_Position.xy / gl_Position.w; \
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
+ gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \
+ gl_Position.w = invertedHTexCoordsZ; \
+ index = (dot(linearData.xy, hTexCoords.xy) * linearData.z) * invertedHTexCoordsZ; \
+ }";
+
+static const char* const qglslAffinePositionWithLinearGradientBrushVertexShader
+ = qglslPositionWithLinearGradientBrushVertexShader;
+
+static const char* const qglslLinearGradientBrushSrcFragmentShader = "\
+ uniform sampler2D brushTexture; \
+ varying mediump float index; \
+ lowp vec4 srcPixel() { \
+ mediump vec2 val = vec2(index, 0.5); \
+ return texture2D(brushTexture, val); \
+ }\n";
+
+
+// Conical Gradient Brush
+static const char* const qglslPositionWithConicalGradientBrushVertexShader = "\
+ attribute highp vec4 vertexCoordsArray;\
+ uniform highp mat4 pmvMatrix;\
+ uniform mediump vec2 halfViewportSize; \
+ uniform highp mat3 brushTransform; \
+ varying highp vec2 A; \
+ void setPosition(void)\
+ {\
+ gl_Position = pmvMatrix * vertexCoordsArray;\
+ gl_Position.xy = gl_Position.xy / gl_Position.w; \
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
+ gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \
+ gl_Position.w = invertedHTexCoordsZ; \
+ A = hTexCoords.xy * invertedHTexCoordsZ; \
+ }";
+
+static const char* const qglslAffinePositionWithConicalGradientBrushVertexShader
+ = qglslPositionWithConicalGradientBrushVertexShader;
+
+static const char* const qglslConicalGradientBrushSrcFragmentShader = "\n\
+ #define INVERSE_2PI 0.1591549430918953358 \n\
+ uniform sampler2D brushTexture; \n\
+ uniform mediump float angle; \
+ varying highp vec2 A; \
+ lowp vec4 srcPixel() { \
+ highp float t; \
+ if (abs(A.y) == abs(A.x)) \
+ t = (atan(-A.y + 0.002, A.x) + angle) * INVERSE_2PI; \
+ else \
+ t = (atan(-A.y, A.x) + angle) * INVERSE_2PI; \
+ return texture2D(brushTexture, vec2(t - floor(t), 0.5)); \
+ }";
+
+
+// Radial Gradient Brush
+static const char* const qglslPositionWithRadialGradientBrushVertexShader = "\
+ attribute highp vec4 vertexCoordsArray;\
+ uniform highp mat4 pmvMatrix;\
+ uniform mediump vec2 halfViewportSize; \
+ uniform highp mat3 brushTransform; \
+ uniform highp vec2 fmp; \
+ varying highp float b; \
+ varying highp vec2 A; \
+ void setPosition(void) \
+ {\
+ gl_Position = pmvMatrix * vertexCoordsArray;\
+ gl_Position.xy = gl_Position.xy / gl_Position.w; \
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
+ gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \
+ gl_Position.w = invertedHTexCoordsZ; \
+ A = hTexCoords.xy * invertedHTexCoordsZ; \
+ b = 2.0 * dot(A, fmp); \
+ }";
+
+static const char* const qglslAffinePositionWithRadialGradientBrushVertexShader
+ = qglslPositionWithRadialGradientBrushVertexShader;
+
+static const char* const qglslRadialGradientBrushSrcFragmentShader = "\
+ uniform sampler2D brushTexture; \
+ uniform highp float fmp2_m_radius2; \
+ uniform highp float inverse_2_fmp2_m_radius2; \
+ varying highp float b; \
+ varying highp vec2 A; \
+ lowp vec4 srcPixel() { \
+ highp float c = -dot(A, A); \
+ highp vec2 val = vec2((-b + sqrt(b*b - 4.0*fmp2_m_radius2*c)) * inverse_2_fmp2_m_radius2, 0.5); \
+ return texture2D(brushTexture, val); \
+ }";
+
+
+// Texture Brush
+static const char* const qglslPositionWithTextureBrushVertexShader = "\
+ attribute highp vec4 vertexCoordsArray; \
+ uniform highp mat4 pmvMatrix; \
+ uniform mediump vec2 halfViewportSize; \
+ uniform mediump vec2 invertedTextureSize; \
+ uniform mediump mat3 brushTransform; \
+ varying mediump vec2 brushTextureCoords; \
+ void setPosition(void) { \
+ gl_Position = pmvMatrix * vertexCoordsArray;\
+ gl_Position.xy = gl_Position.xy / gl_Position.w; \
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
+ gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \
+ gl_Position.w = invertedHTexCoordsZ; \
+ brushTextureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \
+ brushTextureCoords.y = -brushTextureCoords.y; \
+ }";
+
+static const char* const qglslAffinePositionWithTextureBrushVertexShader
+ = qglslPositionWithTextureBrushVertexShader;
+
+static const char* const qglslTextureBrushSrcFragmentShader = "\
+ varying mediump vec2 brushTextureCoords; \
+ uniform sampler2D brushTexture; \
+ lowp vec4 srcPixel() { \
+ return texture2D(brushTexture, brushTextureCoords); \
+ }";
+
+
+// Solid Fill Brush
+static const char* const qglslSolidBrushSrcFragmentShader = "\
+ uniform lowp vec4 fragmentColor; \
+ lowp vec4 srcPixel() { \
+ return fragmentColor; \
+ }";
+
+static const char* const qglslImageSrcFragmentShader = "\
+ varying highp vec2 textureCoords; \
+ uniform sampler2D imageTexture; \
+ lowp vec4 srcPixel() { \
+ return texture2D(imageTexture, textureCoords); \
+ }";
+
+static const char* const qglslNonPremultipliedImageSrcFragmentShader = "\
+ varying highp vec2 textureCoords; \
+ uniform sampler2D imageTexture; \
+ lowp vec4 srcPixel() { \
+ lowp vec4 sample = texture2D(imageTexture, textureCoords); \
+ sample.rgb = sample.rgb * sample.a; \
+ return sample; \
+ }";
+
+static const char* const qglslShockingPinkSrcFragmentShader = "\
+ lowp vec4 srcPixel() { \
+ return vec4(0.98, 0.06, 0.75, 1.0); \
+ }";
+
+
+static const char* const qglslMainFragmentShader_CMO = "\
+ uniform lowp float globalOpacity; \
+ lowp vec4 srcPixel(); \
+ lowp vec4 applyMask(lowp vec4); \
+ lowp vec4 compose(lowp vec4); \
+ void main() { \
+ gl_FragColor = applyMask(compose(srcPixel()*globalOpacity))); \
+ }";
+
+static const char* const qglslMainFragmentShader_CM = "\
+ lowp vec4 srcPixel(); \
+ lowp vec4 applyMask(lowp vec4); \
+ lowp vec4 compose(lowp vec4); \
+ void main() { \
+ gl_FragColor = applyMask(compose(srcPixel())); \
+ }";
+
+static const char* const qglslMainFragmentShader_MO = "\
+ uniform lowp float globalOpacity; \
+ lowp vec4 srcPixel(); \
+ lowp vec4 applyMask(lowp vec4); \
+ void main() { \
+ gl_FragColor = applyMask(srcPixel()*globalOpacity); \
+ }";
+
+static const char* const qglslMainFragmentShader_M = "\
+ lowp vec4 srcPixel(); \
+ lowp vec4 applyMask(lowp vec4); \
+ void main() { \
+ gl_FragColor = applyMask(srcPixel()); \
+ }";
+
+static const char* const qglslMainFragmentShader_CO = "\
+ uniform lowp float globalOpacity; \
+ lowp vec4 srcPixel(); \
+ lowp vec4 compose(lowp vec4); \
+ void main() { \
+ gl_FragColor = compose(srcPixel()*globalOpacity); \
+ }";
+
+static const char* const qglslMainFragmentShader_C = "\
+ lowp vec4 srcPixel(); \
+ lowp vec4 compose(lowp vec4); \
+ void main() { \
+ gl_FragColor = compose(srcPixel()); \
+ }";
+
+static const char* const qglslMainFragmentShader_O = "\
+ uniform lowp float globalOpacity; \
+ lowp vec4 srcPixel(); \
+ void main() { \
+ gl_FragColor = srcPixel()*globalOpacity; \
+ }";
+
+static const char* const qglslMainFragmentShader = "\
+ lowp vec4 srcPixel(); \
+ void main() { \
+ gl_FragColor = srcPixel(); \
+ }";
+
+static const char* const qglslMaskFragmentShader = "\
+ varying highp vec2 textureCoords;\
+ uniform sampler2D maskTexture;\
+ lowp vec4 applyMask(lowp vec4 src) \
+ {\
+ lowp vec4 mask = texture2D(maskTexture, textureCoords); \
+ return src * mask.r; \
+ }";
+
+/*
+ Left to implement:
+ RgbMaskFragmentShader,
+ RgbMaskWithGammaFragmentShader,
+
+ MultiplyCompositionModeFragmentShader,
+ ScreenCompositionModeFragmentShader,
+ OverlayCompositionModeFragmentShader,
+ DarkenCompositionModeFragmentShader,
+ LightenCompositionModeFragmentShader,
+ ColorDodgeCompositionModeFragmentShader,
+ ColorBurnCompositionModeFragmentShader,
+ HardLightCompositionModeFragmentShader,
+ SoftLightCompositionModeFragmentShader,
+ DifferenceCompositionModeFragmentShader,
+ ExclusionCompositionModeFragmentShader,
+*/
+
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // GLGC_SHADER_SOURCE_H
diff --git a/src/opengl/gl2paintengineex/qglgradientcache.cpp b/src/opengl/gl2paintengineex/qglgradientcache.cpp
index b4591b2..f1a8850 100644
--- a/src/opengl/gl2paintengineex/qglgradientcache.cpp
+++ b/src/opengl/gl2paintengineex/qglgradientcache.cpp
@@ -44,7 +44,9 @@
#include "qglgradientcache_p.h"
-void QGLGradientCache::cleanCache() {
+QT_BEGIN_NAMESPACE
+
+void QGL2GradientCache::cleanCache() {
QGLGradientColorTableHash::const_iterator it = cache.constBegin();
for (; it != cache.constEnd(); ++it) {
const CacheInfo &cache_info = it.value();
@@ -53,7 +55,7 @@ void QGLGradientCache::cleanCache() {
cache.clear();
}
-GLuint QGLGradientCache::getBuffer(const QGradient &gradient, qreal opacity, const QGLContext *ctx)
+GLuint QGL2GradientCache::getBuffer(const QGradient &gradient, qreal opacity, const QGLContext *ctx)
{
if (buffer_ctx && !qgl_share_reg()->checkSharing(buffer_ctx, ctx))
cleanCache();
@@ -84,7 +86,7 @@ GLuint QGLGradientCache::getBuffer(const QGradient &gradient, qreal opacity, con
}
-GLuint QGLGradientCache::addCacheElement(quint64 hash_val, const QGradient &gradient, qreal opacity)
+GLuint QGL2GradientCache::addCacheElement(quint64 hash_val, const QGradient &gradient, qreal opacity)
{
if (cache.size() == maxCacheSize()) {
int elem_to_remove = qrand() % maxCacheSize();
@@ -109,34 +111,31 @@ GLuint QGLGradientCache::addCacheElement(quint64 hash_val, const QGradient &grad
}
-// GL's expects pixels in RGBA, bin-endian (ABGR on x86).
-// Qt stores in ARGB using whatever byte-order the mancine uses.
+// GL's expects pixels in RGBA (when using GL_RGBA), bin-endian (ABGR on x86).
+// Qt always stores in ARGB reguardless of the byte-order the mancine uses.
static inline uint qtToGlColor(uint c)
{
uint o;
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
- o = c & 0xFF00FF00; // alpha & green already in the right place
- o |= (c >> 16) & 0x000000FF; // red
- o |= (c << 16) & 0x00FF0000; // blue
-
+ o = (c & 0xff00ff00) // alpha & green already in the right place
+ | ((c >> 16) & 0x000000ff) // red
+ | ((c << 16) & 0x00ff0000); // blue
#else //Q_BIG_ENDIAN
- o = c & 0x00FF00FF; // alpha & green already in the right place
- o |= (c << 16) & 0xFF000000; // red
- o |= (c >> 16) & 0x0000FF00; // blue
-#error big endian not tested with QGLGraphicsContext
+ o = (c << 8)
+ | ((c >> 24) & 0x000000ff);
#endif // Q_BYTE_ORDER
return o;
}
//TODO: Let GL generate the texture using an FBO
-void QGLGradientCache::generateGradientColorTable(const QGradient& gradient, uint *colorTable, int size, qreal opacity) const
+void QGL2GradientCache::generateGradientColorTable(const QGradient& gradient, uint *colorTable, int size, qreal opacity) const
{
int pos = 0;
QGradientStops s = gradient.stops();
QVector<uint> colors(s.size());
for (int i = 0; i < s.size(); ++i)
- colors[i] = s[i].second.rgba(); // Qt LIES! It returns ARGB
+ colors[i] = s[i].second.rgba(); // Qt LIES! It returns ARGB (on little-endian AND on big-endian)
bool colorInterpolation = (gradient.interpolationMode() == QGradient::ColorInterpolation);
@@ -183,3 +182,5 @@ void QGLGradientCache::generateGradientColorTable(const QGradient& gradient, uin
// Make sure the last color stop is represented at the end of the table
colorTable[size-1] = last_color;
}
+
+QT_END_NAMESPACE
diff --git a/src/opengl/gl2paintengineex/qglgradientcache_p.h b/src/opengl/gl2paintengineex/qglgradientcache_p.h
index 346ea13..9bf58c7 100644
--- a/src/opengl/gl2paintengineex/qglgradientcache_p.h
+++ b/src/opengl/gl2paintengineex/qglgradientcache_p.h
@@ -54,7 +54,9 @@
#include <QObject>
#include <QtOpenGL>
-class QGLGradientCache : public QObject
+QT_BEGIN_NAMESPACE
+
+class QGL2GradientCache : public QObject
{
Q_OBJECT
struct CacheInfo
@@ -71,7 +73,7 @@ class QGLGradientCache : public QObject
typedef QMultiHash<quint64, CacheInfo> QGLGradientColorTableHash;
public:
- QGLGradientCache() : QObject(), buffer_ctx(0)
+ QGL2GradientCache() : QObject(), buffer_ctx(0)
{
/*
connect(QGLSignalProxy::instance(),
@@ -104,5 +106,5 @@ public slots:
}
};
-
+QT_END_NAMESPACE
diff --git a/src/opengl/gl2paintengineex/qglpexshadermanager.cpp b/src/opengl/gl2paintengineex/qglpexshadermanager.cpp
deleted file mode 100644
index e460e08..0000000
--- a/src/opengl/gl2paintengineex/qglpexshadermanager.cpp
+++ /dev/null
@@ -1,450 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtOpenGL 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qglpexshadermanager_p.h"
-
-#include "glgc_shader_source.h"
-
-QGLPEXShaderManager::QGLPEXShaderManager(const QGLContext* context)
-{
- ctx = const_cast<QGLContext*>(context);
-
- defaultVertexShader= new QGLShader(QGLShader::VertexShader, context);
- defaultVertexShader->addSource(QLatin1String(qglslDefaultVertexShader));
- if (!defaultVertexShader->compile())
- qWarning() << "Default vertex shader failed to compile: " << defaultVertexShader->log();
-
- noBrushShader = new QGLShader(QGLShader::FragmentShader, context);
- noBrushShader->addSource(QLatin1String(qglslFragmentShaderMain));
- noBrushShader->addSource(QLatin1String(qglslNoBrushFragmentShader));
- if (!noBrushShader->compile())
- qWarning() << "No brush shader failed to compile:" << noBrushShader->log();
-
-
- // Create a program for noBrush:
- QGLShaderProgram* noBrushProg = new QGLShaderProgram(ctx);
- noBrushProg->addShader(defaultVertexShader);
- noBrushProg->addShader(noBrushShader);
- if (!noBrushProg->link())
- qWarning() << "NoBrush shader program failed to link:" << noBrushProg->log();
-
- // Add noBrush Program to cache:
- QGLCachedShaderProg cachedProg;
- cachedProg.vertexShader = defaultVertexShader;
- cachedProg.brushShader = noBrushShader;
- cachedProg.compositionShader = 0;
- cachedProg.shader = noBrushProg;
- cachedPrograms.append(cachedProg);
-
-
- // Set state
- useGlobalOpacity = true;
- currentBrushStyle = Qt::NoBrush;
- currentTransformType = FullTransform;
- shaderProgNeedsChanging = false;
- activeProgram = noBrushProg;
-
- solidBrushShader = 0;
-
- conicalBrushVertexShader = 0;
- conicalBrushFragmentShader = 0;
-
- radialBrushVertexShader = 0;
- radialBrushFragmentShader = 0;
-
- linearBrushVertexShader = 0;
- linearBrushFragmentShader = 0;
-
- patternBrushVertexShader = 0;
- patternBrushFragmentShader = 0;
-
- textureBrushFragmentShader = 0;
- textureBrushVertexShader = 0;
-
- simpleFragmentShader = 0;
- simpleShaderProgram = 0;
-
- imageVertexShader = 0;
- imageFragmentShader = 0;
- imageShaderProgram = 0;
-
- textVertexShader = 0;
- textFragmentShader = 0;
- textShaderProgram = 0;
-}
-
-QGLPEXShaderManager::~QGLPEXShaderManager()
-{
- delete defaultVertexShader;
- delete imageVertexShader;
- delete imageFragmentShader;
- delete imageShaderProgram;
- delete textVertexShader;
- delete textFragmentShader;
- delete textShaderProgram;
- delete noBrushShader;
- delete solidBrushShader;
-
- delete conicalBrushVertexShader;
- delete conicalBrushFragmentShader;
-
- delete radialBrushVertexShader;
- delete radialBrushFragmentShader;
-
- delete linearBrushFragmentShader;
- delete linearBrushVertexShader;
-
- delete patternBrushFragmentShader;
- delete patternBrushVertexShader;
-
- delete textureBrushFragmentShader;
- delete textureBrushVertexShader;
-
- delete simpleFragmentShader;
- delete simpleShaderProgram;
-}
-
-void QGLPEXShaderManager::setUseGlobalOpacity(bool value)
-{
- if (value != useGlobalOpacity)
- shaderProgNeedsChanging = true;
-
- useGlobalOpacity = value;
-}
-
-void QGLPEXShaderManager::setBrushStyle(Qt::BrushStyle style)
-{
- if (currentBrushStyle != style)
- shaderProgNeedsChanging = true;
-
- currentBrushStyle = style;
-}
-
-void QGLPEXShaderManager::setAffineOnlyBrushTransform(bool value)
-{
- Q_UNUSED(value);
- // TODO
-}
-
-bool QGLPEXShaderManager::useCorrectShaderProg()
-{
- if (!shaderProgNeedsChanging) {
- activeProgram->use();
- return false;
- }
-
- const char* fragmentShaderMainSrc = qglslFragmentShaderMain;
- QGLShader* vertexShader = defaultVertexShader;
- QGLShader* fragmentShader = noBrushShader;
-
- // Make sure we compile up the correct brush shader
- switch (currentBrushStyle) {
- case Qt::NoBrush:
- break;
- case Qt::SolidPattern:
- if (!solidBrushShader) {
- qDebug("Compiling qglslSolidBrushFragmentShader");
- solidBrushShader = new QGLShader(QGLShader::FragmentShader, ctx);
- solidBrushShader->addSource(QLatin1String(qglslNoOpacityFragmentShaderMain));
- solidBrushShader->addSource(QLatin1String(qglslSolidBrushFragmentShader));
- if (!solidBrushShader->compile())
- qWarning() << "qglslSolidBrush failed to compile:" << solidBrushShader->log();
- }
- fragmentShader = solidBrushShader;
- break;
- case Qt::TexturePattern:
- if (!textureBrushVertexShader) {
- qDebug("Compiling qglslTextureBrushVertexShader");
- textureBrushVertexShader = new QGLShader(QGLShader::VertexShader, ctx);
- textureBrushVertexShader->addSource(QLatin1String(qglslTextureBrushVertexShader));
- if (!textureBrushVertexShader->compile()) {
- qWarning() << "qglslTextureBrushVertexShader failed to compile: "
- << textureBrushVertexShader->log();
- }
- }
- vertexShader = textureBrushVertexShader;
-
- if (!textureBrushFragmentShader) {
- qDebug("Compiling qglslTextureBrushFragmentShader");
- textureBrushFragmentShader = new QGLShader(QGLShader::FragmentShader, ctx);
- textureBrushFragmentShader->addSource(QLatin1String(fragmentShaderMainSrc));
- textureBrushFragmentShader->addSource(QLatin1String(qglslTextureBrushFragmentShader));
- if (!textureBrushFragmentShader->compile()) {
- qWarning() << "qglslTextureBrushFragmentShader failed to compile:"
- << textureBrushFragmentShader->log();
- }
- }
- fragmentShader = textureBrushFragmentShader;
- break;
- case Qt::LinearGradientPattern:
- if (!linearBrushVertexShader) {
- qDebug("Compiling qglslLinearGradientBrushVertexShader");
- linearBrushVertexShader = new QGLShader(QGLShader::VertexShader, ctx);
- linearBrushVertexShader->addSource(QLatin1String(qglslLinearGradientBrushVertexShader));
- if (!linearBrushVertexShader->compile()) {
- qWarning() << "qglslLinearGradientBrushVertexShader failed to compile: "
- << linearBrushVertexShader->log();
- }
- }
- vertexShader = linearBrushVertexShader;
-
- if (!linearBrushFragmentShader) {
- qDebug("Compiling qglslLinearGradientBrushFragmentShader");
- linearBrushFragmentShader = new QGLShader(QGLShader::FragmentShader, ctx);
- linearBrushFragmentShader->addSource(QLatin1String(fragmentShaderMainSrc));
- linearBrushFragmentShader->addSource(QLatin1String(qglslLinearGradientBrushFragmentShader));
- if (!linearBrushFragmentShader->compile()) {
- qWarning() << "qglslLinearGradientBrushFragmentShader failed to compile:"
- << linearBrushFragmentShader->log();
- }
- }
- fragmentShader = linearBrushFragmentShader;
- break;
- case Qt::RadialGradientPattern:
- if (!radialBrushVertexShader) {
- qDebug("Compiling qglslRadialGradientBrushVertexShader");
- radialBrushVertexShader = new QGLShader(QGLShader::VertexShader, ctx);
- radialBrushVertexShader->addSource(QLatin1String(qglslRadialGradientBrushVertexShader));
- if (!radialBrushVertexShader->compile()) {
- qWarning() << "qglslRadialGradientBrushVertexShader failed to compile: "
- << radialBrushVertexShader->log();
- }
- }
- vertexShader = radialBrushVertexShader;
-
- if (!radialBrushFragmentShader) {
- qDebug("Compiling qglslRadialGradientBrushFragmentShader");
- radialBrushFragmentShader = new QGLShader(QGLShader::FragmentShader, ctx);
- radialBrushFragmentShader->addSource(QLatin1String(fragmentShaderMainSrc));
- radialBrushFragmentShader->addSource(QLatin1String(qglslRadialGradientBrushFragmentShader));
- if (!radialBrushFragmentShader->compile()) {
- qWarning() << "qglslRadialGradientBrushFragmentShader failed to compile:"
- << radialBrushFragmentShader->log();
- }
- }
- fragmentShader = radialBrushFragmentShader;
- break;
- case Qt::ConicalGradientPattern:
- // FIXME: We currently use the same vertex shader as radial brush
- if (!conicalBrushVertexShader) {
- qDebug("Compiling qglslConicalGradientBrushVertexShader");
- conicalBrushVertexShader = new QGLShader(QGLShader::VertexShader, ctx);
- conicalBrushVertexShader->addSource(QLatin1String(qglslConicalGradientBrushVertexShader));
- if (!conicalBrushVertexShader->compile()) {
- qWarning() << "qglslConicalGradientBrushVertexShader failed to compile: "
- << conicalBrushVertexShader->log();
- }
- }
- vertexShader = conicalBrushVertexShader;
-
- if (!conicalBrushFragmentShader) {
- qDebug("Compiling qglslConicalGradientBrushFragmentShader");
- conicalBrushFragmentShader = new QGLShader(QGLShader::FragmentShader, ctx);
- conicalBrushFragmentShader->addSource(QLatin1String(fragmentShaderMainSrc));
- conicalBrushFragmentShader->addSource(QLatin1String(qglslConicalGradientBrushFragmentShader));
- if (!conicalBrushFragmentShader->compile()) {
- qWarning() << "qglslConicalGradientBrushFragmentShader failed to compile:"
- << conicalBrushFragmentShader->log();
- }
- }
- fragmentShader = conicalBrushFragmentShader;
- break;
- case Qt::Dense1Pattern:
- case Qt::Dense2Pattern:
- case Qt::Dense3Pattern:
- case Qt::Dense4Pattern:
- case Qt::Dense5Pattern:
- case Qt::Dense6Pattern:
- case Qt::Dense7Pattern:
- case Qt::HorPattern:
- case Qt::VerPattern:
- case Qt::CrossPattern:
- case Qt::BDiagPattern:
- case Qt::FDiagPattern:
- case Qt::DiagCrossPattern:
- if (!patternBrushVertexShader) {
- qDebug("Compiling qglslPatternBrushVertexShader");
- patternBrushVertexShader = new QGLShader(QGLShader::VertexShader, ctx);
- patternBrushVertexShader->addSource(QLatin1String(qglslPatternBrushVertexShader));
- if (!patternBrushVertexShader->compile()) {
- qWarning() << "qglslPatternBrushVertexShader failed to compile: "
- << patternBrushVertexShader->log();
- }
- }
- vertexShader = patternBrushVertexShader;
-
- if (!patternBrushFragmentShader) {
- qDebug("Compiling qglslPatternBrushFragmentShader");
- patternBrushFragmentShader = new QGLShader(QGLShader::FragmentShader, ctx);
- patternBrushFragmentShader->addSource(QLatin1String(qglslNoOpacityFragmentShaderMain));
- patternBrushFragmentShader->addSource(QLatin1String(qglslPatternBrushFragmentShader));
- if (!patternBrushFragmentShader->compile()) {
- qWarning() << "qglslPatternBrushFragmentShader failed to compile:"
- << patternBrushFragmentShader->log();
- }
- }
- fragmentShader = patternBrushFragmentShader;
- break;
- default:
- qWarning("Unimplemented brush style (%d)", currentBrushStyle);
- }
-
- // Now newBrushShader is set correctly, check to see if we already have the program
- // already linked and ready to go in the cache:
- bool foundProgram = false;
- foreach (QGLCachedShaderProg cachedProg, cachedPrograms) {
- if ((cachedProg.vertexShader == vertexShader) &&
- (cachedProg.brushShader == fragmentShader) &&
- (cachedProg.compositionShader == 0) ) {
-
- activeProgram = cachedProg.shader;
- foundProgram = true;
- break;
- }
- }
-
- if (!foundProgram) {
- qDebug() << "Linking shader program for " << currentBrushStyle;
- // Required program not found - create it.
- QGLShaderProgram* newProg = new QGLShaderProgram(ctx);
-
- newProg->addShader(vertexShader);
- newProg->addShader(fragmentShader);
-
- if (!newProg->link())
- qWarning() << "Shader program for " << currentBrushStyle << "failed to link:" << newProg->log();
-
- QGLCachedShaderProg cachedProg;
- cachedProg.vertexShader = vertexShader;
- cachedProg.brushShader = fragmentShader;
- cachedProg.compositionShader = 0;
- cachedProg.shader = newProg;
-
- cachedPrograms.append(cachedProg);
- activeProgram = newProg;
- }
-
- activeProgram->use();
- shaderProgNeedsChanging = false;
- return true;
-}
-
-QGLShaderProgram* QGLPEXShaderManager::brushShader()
-{
- return activeProgram;
-}
-
-// The only uniform the simple shader has is the PMV matrix
-QGLShaderProgram* QGLPEXShaderManager::simpleShader()
-{
- if (!simpleShaderProgram) {
- simpleShaderProgram = new QGLShaderProgram(ctx);
-
- if (!simpleFragmentShader) {
- simpleFragmentShader = new QGLShader(QGLShader::FragmentShader, ctx);
- simpleFragmentShader->addSource(QLatin1String(qglslSimpleFragmentShader));
- if (!simpleFragmentShader->compile())
- qWarning() << "qglslSimpleFragmentShader failed to compile:" << simpleFragmentShader->log();
- }
-
- simpleShaderProgram->addShader(defaultVertexShader);
- simpleShaderProgram->addShader(simpleFragmentShader);
- if (!simpleShaderProgram->link())
- qWarning() << "Simple shader program failed to link:" << simpleShaderProgram->log();
- }
-
- return simpleShaderProgram;
-}
-
-QGLShaderProgram* QGLPEXShaderManager::imageShader()
-{
- if (!imageShaderProgram) {
- if (!imageVertexShader) {
- imageVertexShader = new QGLShader(QGLShader::VertexShader, ctx);
- imageVertexShader->addSource(QLatin1String(qglslImageVertexShader));
- if (!imageVertexShader->compile())
- qWarning() << "Image/Pixmap vertex shader failed to compile:" << imageVertexShader->log();
- }
-
- if (!imageFragmentShader) {
- imageFragmentShader = new QGLShader(QGLShader::FragmentShader, ctx);
- imageFragmentShader->addSource(QLatin1String(qglslImageFragmentShader));
- if (!imageFragmentShader->compile())
- qWarning() << "Image/Pixmap fragment shader failed to compile:" << imageFragmentShader->log();
- }
-
- imageShaderProgram = new QGLShaderProgram(ctx);
- imageShaderProgram->addShader(imageVertexShader);
- imageShaderProgram->addShader(imageFragmentShader);
- if (!imageShaderProgram->link())
- qWarning() << "Image/Pixmap shader program failed to link:" << imageShaderProgram->log();
- }
-
- return imageShaderProgram;
-}
-
-QGLShaderProgram* QGLPEXShaderManager::textShader()
-{
- if (!textShaderProgram) {
- if (!textVertexShader) {
- textVertexShader = new QGLShader(QGLShader::VertexShader, ctx);
- textVertexShader->addSource(QLatin1String(qglslImageVertexShader));
- if (!textVertexShader->compile())
- qWarning() << "Text vertex shader failed to compile:" << textVertexShader->log();
- }
-
- if (!textFragmentShader) {
- textFragmentShader = new QGLShader(QGLShader::FragmentShader, ctx);
- textFragmentShader->addSource(QLatin1String(qglslTextFragmentShader));
- if (!textFragmentShader->compile())
- qWarning() << "Text fragment shader failed to compile:" << textFragmentShader->log();
- }
-
- textShaderProgram = new QGLShaderProgram(ctx);
- textShaderProgram->addShader(textVertexShader);
- textShaderProgram->addShader(textFragmentShader);
- if (!textShaderProgram->link())
- qWarning() << "Text shader program failed to link:" << textShaderProgram->log();
- }
-
- return textShaderProgram;
-}
-
diff --git a/src/opengl/gl2paintengineex/qglpexshadermanager_p.h b/src/opengl/gl2paintengineex/qglpexshadermanager_p.h
deleted file mode 100644
index c8f47b2..0000000
--- a/src/opengl/gl2paintengineex/qglpexshadermanager_p.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtOpenGL 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qglshader_p.h"
-
-
-// Worstcase combo: Brush->Mask->Composition
-
-/*
- Vertex shader source is specified with a single string. This string
- contains the main function and sets the gl_Position. The choice of
- which vertex shader to use depends on:
- - Brush style
- - Brush transform->isAffine()
-
- Fragment shaders are specified as multiple strings, one for the main
- function, one for the brush calculation and optionally one for the
- extended composition mode. Brushes are implementations of
- "mediump vec4 brush()"
- Composition modes are implemented as a
- "mediump vec4 compose(mediump vec4 color)"
- NOTE: Precision may change in future.
-
- The choice of which main() fragment shader string to use depends on:
- - Global opacity
- - Brush style (some brushes apply opacity themselves)
- - Use of mask (TODO: Need to support high quality anti-aliasing & text)
- - Composition mode
-
- The choice of which brush() fragment shader to use depends on:
- - Brush style
-
-*/
-
-
-struct QGLCachedShaderProg
-{
- QGLShader* vertexShader;
- QGLShader* brushShader;
- QGLShader* compositionShader;
- QGLShaderProgram* shader;
-};
-
-class QGLPEXShaderManager
-{
-public:
- QGLPEXShaderManager(const QGLContext* context);
- ~QGLPEXShaderManager();
-
- enum TransformType {IdentityTransform, ScaleTransform, TranslateTransform, FullTransform};
-
- void optimiseForBrushTransform(const QTransform& transform);
- void setBrushStyle(Qt::BrushStyle style);
- void setUseGlobalOpacity(bool value);
- void setAffineOnlyBrushTransform(bool value); // I.e. Do we need to apply perspective-correction?
- // Not doing so saves some vertex shader calculations.
-
- bool useCorrectShaderProg(); // returns true if the shader program has changed
-
- QGLShaderProgram* brushShader();
- QGLShaderProgram* simpleShader(); // Used to draw into e.g. stencil buffers
- QGLShaderProgram* imageShader();
- QGLShaderProgram* textShader();
-
-private:
- QGLShader* defaultVertexShader;
-
- QGLShader* imageVertexShader;
- QGLShader* imageFragmentShader;
- QGLShaderProgram* imageShaderProgram;
-
- QGLShader* textVertexShader;
- QGLShader* textFragmentShader;
- QGLShaderProgram* textShaderProgram;
-
- QGLShader* noBrushShader;
- QGLShader* solidBrushShader;
-
- QGLShader* conicalBrushVertexShader;
- QGLShader* conicalBrushFragmentShader;
-
- QGLShader* radialBrushVertexShader;
- QGLShader* radialBrushFragmentShader;
-
- QGLShader* linearBrushVertexShader;
- QGLShader* linearBrushFragmentShader;
-
- QGLShader* patternBrushVertexShader;
- QGLShader* patternBrushFragmentShader;
-
- QGLShader* textureBrushFragmentShader;
- QGLShader* textureBrushVertexShader;
-
- QGLShader* simpleFragmentShader;
- QGLShaderProgram* simpleShaderProgram;
-
- QGLShaderProgram* activeProgram;
-
- Qt::BrushStyle currentBrushStyle;
- bool useGlobalOpacity;
- TransformType currentTransformType;
- bool shaderProgNeedsChanging;
-
- QList<QGLCachedShaderProg> cachedPrograms;
-
- QGLContext* ctx;
-};
diff --git a/src/opengl/gl2paintengineex/qglshader.cpp b/src/opengl/gl2paintengineex/qglshader.cpp
deleted file mode 100644
index 634be84..0000000
--- a/src/opengl/gl2paintengineex/qglshader.cpp
+++ /dev/null
@@ -1,605 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtOpenGL 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qglshader_p.h"
-
-
-// Windows needs to resolve OpenGL 2.0 function pointers for each context. The
-// QGL OpenGL 2.0 functions are actually macros, which take a "ctx" parameter.
-#define Q_CTX QGLContext* ctx = d->ctx; \
- if (!ctx) \
- return false; \
- ctx->makeCurrent(); \
-
-
-
-
-class QGLShaderPrivate
-{
-public:
- QGLShaderPrivate() : shaderId(0), valid(false), ctx(0) {}
-
- GLuint shaderId;
- QString source;
- bool valid;
- QGLShader::ShaderType type;
- QGLContext* ctx;
-};
-
-
-QGLShader::QGLShader(QGLShader::ShaderType type, const QGLContext* ctx)
- : d_ptr(new QGLShaderPrivate)
-{
- Q_D(QGLShader);
-
- if (!ctx)
- ctx = QGLContext::currentContext();
-
- if (!ctx) {
- qWarning("QGLShader being created without a context");
- return;
- }
-
- d->ctx = const_cast<QGLContext*>(ctx);
- d->ctx->makeCurrent();
-
- if (type == QGLShader::FragmentShader)
- d->shaderId = glCreateShader(GL_FRAGMENT_SHADER);
- else
- d->shaderId = glCreateShader(GL_VERTEX_SHADER);
-
- if (d->shaderId == 0) {
- qWarning("Error creating shader object");
- return;
- }
-
- d->type = type;
-}
-
-GLuint QGLShader::id()
-{
- Q_D(QGLShader);
- return d->shaderId;
-}
-
-const QGLContext* QGLShader::context()
-{
- Q_D(QGLShader);
- return d->ctx;
-}
-
-void QGLShader::clearSource()
-{
- Q_D(QGLShader);
- d->source.clear();
- d->valid = false;
-}
-
-void QGLShader::addSource(const QLatin1String& newSource)
-{
- Q_D(QGLShader);
- d->source += newSource;
- d->valid = false;
-}
-
-
-bool QGLShader::compile()
-{
- Q_D(QGLShader);
-
- d->valid = false;
-
- if (d->source.size() == 0)
- return false;
-
- const QByteArray src_ba = d->source.toAscii();
- const char* src = src_ba.constData();
-
- glShaderSource(d->shaderId, 1, &src, 0);
-
- glCompileShader(d->shaderId);
-
- GLint shaderCompiled;
- glGetShaderiv(d->shaderId, GL_COMPILE_STATUS, &shaderCompiled);
- if (!shaderCompiled)
- return false;
-
- d->valid = true;
- return true;
-}
-
-bool QGLShader::isValid()
-{
- Q_D(QGLShader);
- return d->valid;
-}
-
-QString QGLShader::log()
-{
- Q_D(QGLShader);
-
- char* logData;
- GLint logSize;
- GLint logLength;
-
- glGetShaderiv(d->shaderId, GL_INFO_LOG_LENGTH, &logSize);
-
- if (!logSize)
- return QString();
-
- logData = new char[logSize];
- glGetShaderInfoLog(d->shaderId, logSize, &logLength, logData);
- QString result = QString::fromAscii(logData);
- delete [] logData;
-
- return result;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-class QGLShaderProgramPrivate
-{
-public:
- QGLShaderProgramPrivate() : valid(false), programId(0), ctx(0) {}
- void populateVariableLists();
-
- QVector<QGLShader*> shaders;
- QGLUniformList uniforms;
- QGLVertexAttributeList attributeArrays;
- bool valid;
- GLuint programId;
- QGLContext* ctx;
-};
-
-
-
-void QGLShaderProgramPrivate::populateVariableLists()
-{
- attributeArrays.clear();
- uniforms.clear();
-
- int count;
- int sizeOfNameBuff;
- char* name;
- GLint nameLength;
- GLenum type;
- GLint size;
- GLint location;
-
- glGetProgramiv(programId, GL_ACTIVE_ATTRIBUTES, &count);
- glGetProgramiv(programId, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &sizeOfNameBuff);
- name = new char[sizeOfNameBuff];
-
- for (int i = 0; i < count; ++i) {
- nameLength = -1;
- glGetActiveAttrib(programId, i, sizeOfNameBuff, &nameLength, &size, &type, name);
- if (nameLength == -1)
- continue;
-
- location = glGetAttribLocation(programId, name);
- attributeArrays.insert(QString::fromAscii(name), QGLVertexAttribute(type, location, ctx));
- }
-
- delete [] name;
-
-
- glGetProgramiv(programId, GL_ACTIVE_UNIFORMS, &count);
- glGetProgramiv(programId, GL_ACTIVE_UNIFORM_MAX_LENGTH, &sizeOfNameBuff);
-
- name = new char[sizeOfNameBuff];
-
- for (int i = 0; i < count; ++i) {
- nameLength = -1;
- glGetActiveUniform(programId, i, sizeOfNameBuff, &nameLength, &size, &type, name);
- if (nameLength == -1)
- continue;
-
- location = glGetUniformLocation(programId, name);
- uniforms.insert(QString::fromAscii(name), QGLUniform(type, location, ctx));
- }
-}
-
-
-QGLShaderProgram::QGLShaderProgram(const QGLContext* ctx)
- : d_ptr(new QGLShaderProgramPrivate)
-{
- Q_D(QGLShaderProgram);
- if (!ctx)
- ctx = QGLContext::currentContext();
-
- if (!ctx) {
- qWarning("QGLShaderProgram being created without a context");
- return;
- }
-
- d->ctx = const_cast<QGLContext*>(ctx);
- d->ctx->makeCurrent();
-
- d->programId = glCreateProgram();
-
- d->valid = false;
-}
-
-
-const QGLUniformList & QGLShaderProgram::uniforms()
-{
- Q_D(QGLShaderProgram);
- return const_cast<const QGLUniformList&>(d->uniforms);
-}
-
-
-const QGLVertexAttributeList& QGLShaderProgram::vertexAttributes()
-{
- Q_D(QGLShaderProgram);
- return const_cast<const QGLVertexAttributeList&>(d->attributeArrays);
-}
-
-
-bool QGLShaderProgram::addShader(QGLShader* newShader)
-{
- Q_D(QGLShaderProgram);
- if (!newShader || !d->ctx)
- return false;
-
- if (newShader->context() != d->ctx) {
- qWarning("Shader object's context does not match program's context");
- return false;
- }
-
- if (!newShader->isValid())
- return false;
-
- QGLContext* ctx = d->ctx;
- if (!ctx)
- return false;
- ctx->makeCurrent();
-
- glAttachShader(d->programId, newShader->id());
-
- d->shaders.append(newShader);
- return true;
-}
-
-
-bool QGLShaderProgram::removeShader(QGLShader* oldShader)
-{
- Q_D(QGLShaderProgram);
-
- int idx = d->shaders.indexOf(oldShader);
-
- if (idx == -1)
- return false;
-
- d->shaders.remove(idx);
-
- QGLContext* ctx = d->ctx;
- if (!ctx)
- return false;
- ctx->makeCurrent();
-
- glDetachShader(d->programId, oldShader->id());
- return true;
-}
-
-
-bool QGLShaderProgram::removeAllShaders()
-{
- Q_D(QGLShaderProgram);
-
- QGLContext* ctx = d->ctx;
- if (!ctx)
- return false;
- ctx->makeCurrent();
-
- foreach (QGLShader* shader, d->shaders)
- glDetachShader(d->programId, shader->id());
-
- d->shaders.clear();
- return true;
-}
-
-#include <stdio.h>
-
-bool QGLShaderProgram::link()
-{
- Q_D(QGLShaderProgram);
-
- QGLContext* ctx = d->ctx;
- if (!ctx)
- return false;
- ctx->makeCurrent();
-
- glLinkProgram(d->programId);
-
-
- GLint linked;
- glGetProgramiv(d->programId, GL_LINK_STATUS, &linked);
-
- if (!linked)
- return false;
-
- d->populateVariableLists();
-
- d->valid = true;
- return true;
-}
-
-void QGLShaderProgram::use()
-{
- Q_D(QGLShaderProgram);
- if (!d->valid)
- return;
-
- glUseProgram(d->programId);
-}
-
-
-QString QGLShaderProgram::log()
-{
- Q_D(QGLShaderProgram);
-
- QGLContext* ctx = d->ctx;
- if (!ctx)
- return QString();
- ctx->makeCurrent();
-
- GLint logSize = -666;
- glGetProgramiv(d->programId, GL_INFO_LOG_LENGTH, &logSize);
-
- char* logData = new char[logSize];
- GLint logLength;
-
- glGetProgramInfoLog(d->programId, logSize, &logLength, logData);
-
- QString result = QString::fromAscii(logData);
- delete [] logData;
-
- return result;
-}
-
-GLuint QGLShaderProgram::id()
-{
- Q_D(QGLShaderProgram);
- return d->programId;
-}
-
-/////////////////////////////////////////////////////////////////////////
-
-
-
-
-QGLUniform::QGLUniform()
- : m_id(0), m_type(QGLInvalidType), ctx(0)
-{
- qWarning("Unknown uniform! Either the uniform doesn't exist or it was removed at shader link");
-}
-
-const QGLUniform& QGLUniform::operator=(const GLfloat& rhs) const
-{
- if (m_type != QGLFloatType)
- return *this;
-
- glUniform1f(m_id, rhs);
-
- return *this;
-}
-
-const QGLUniform& QGLUniform::operator=(const QGLVec2& rhs) const
-{
- if (m_type != QGLVec2Type)
- return *this;
-
- glUniform2fv(m_id, 1, (const GLfloat*)&rhs);
-
- return *this;
-}
-
-const QGLUniform& QGLUniform::operator=(const QSizeF& rhs) const
-{
- if (m_type != QGLVec2Type)
- return *this;
-
- glUniform2f(m_id, rhs.width(), rhs.height());
-
- return *this;
-}
-
-const QGLUniform& QGLUniform::operator=(const QPointF& rhs) const
-{
- if (m_type != QGLVec2Type)
- return *this;
-
- glUniform2f(m_id, rhs.x(), rhs.y());
-
- return *this;
-}
-
-const QGLUniform& QGLUniform::operator=(const QGLVec3& rhs) const
-{
- if (m_type != QGLVec3Type)
- return *this;
-
- glUniform3fv(m_id, 1, (const GLfloat*)&rhs);
-
- return *this;
-}
-
-const QGLUniform& QGLUniform::operator=(const QGLVec4& rhs) const
-{
- if (m_type != QGLVec4Type)
- return *this;
-
- glUniform4fv(m_id, 1, (const GLfloat*)&rhs);
-
- return *this;
-}
-
-const QGLUniform& QGLUniform::operator=(const QColor& rhs) const
-{
- if (m_type != QGLVec4Type)
- return *this;
-
- glUniform4f(m_id, rhs.redF(), rhs.greenF(), rhs.blueF(), rhs.alphaF());
-
- return *this;
-}
-
-const QGLUniform& QGLUniform::operator=(const GLfloat rhs[2][2]) const
-{
- if (m_type != QGLMat2Type)
- return *this;
-
- glUniformMatrix2fv(m_id, 1, GL_FALSE, (GLfloat*)rhs);
-
- return *this;
-}
-
-const QGLUniform& QGLUniform::operator=(const GLfloat rhs[3][3]) const
-{
- if (m_type != QGLMat3Type)
- return *this;
-
- glUniformMatrix3fv(m_id, 1, GL_FALSE, (GLfloat*)rhs);
-
- return *this;
-}
-
-// Transposes ready for GL
-const QGLUniform& QGLUniform::operator=(const QTransform& rhs) const
-{
- if (m_type != QGLMat3Type)
- return *this;
-
- GLfloat mat3[3][3] = {
- {rhs.m11(), rhs.m12(), rhs.m13()},
- {rhs.m21(), rhs.m22(), rhs.m23()},
- {rhs.m31(), rhs.m32(), rhs.m33()}
- };
-
- glUniformMatrix3fv(m_id, 1, GL_FALSE, (GLfloat*)mat3);
-
- return *this;
-}
-
-const QGLUniform& QGLUniform::operator=(const GLfloat rhs[4][4]) const
-{
- if (m_type != QGLMat4Type)
- return *this;
-
- glUniformMatrix4fv(m_id, 1, GL_FALSE, (GLfloat*)rhs);
-
- return *this;
-}
-
-const QGLUniform& QGLUniform::operator=(const GLuint& rhs) const
-{
- if ((m_type != QGLSampler2DType) || (m_type != QGLSamplerCubeType))
- return *this;
-
- glUniform1i(m_id, rhs);
-
- return *this;
-}
-
-
-
-
-/////////////////////////////////////////////////////////////////////////
-
-QGLVertexAttribute::QGLVertexAttribute()
- : m_id(0), m_type(QGLInvalidType), ctx(0)
-{
- qWarning("Unknown vertex attribute!");
-}
-
-void QGLVertexAttribute::enable() const
-{
- glEnableVertexAttribArray(m_id);
-}
-
-void QGLVertexAttribute::disable() const
-{
- glDisableVertexAttribArray(m_id);
-}
-
-// NOTE: Under PC emulation, QGLVec4Type is _always_ returned as the type, so this
-// method isn't very useful. I.e. The datatypes are needed to distinguish the different
-// sizes for the function signatures.
-const QGLVertexAttribute& QGLVertexAttribute::operator=(const GLfloat* rhs) const
-{
- int size = -1;
- if (m_type == QGLFloatType)
- size = 1;
- else if (m_type == QGLVec2Type)
- size = 2;
- else if (m_type == QGLVec3Type)
- size = 3;
- else if (m_type == QGLVec4Type)
- size = 4;
- else if (m_type == QGLMat2Type) //### Not sure if this is right for matrix attributes...
- size = 4;
- else if (m_type == QGLMat3Type) //### Not sure if this is right for matrix attributes...
- size = 9;
- else if (m_type == QGLMat4Type) //### Not sure if this is right for matrix attributes...
- size = 16;
- else
- return *this;
-
- glVertexAttribPointer(m_id, size, GL_FLOAT, GL_FALSE, 0, rhs);
-
- return *this;
-}
-
-const QGLVertexAttribute& QGLVertexAttribute::operator=(const QGLVec3* rhs) const
-{
- glVertexAttribPointer(m_id, 3, GL_FLOAT, GL_FALSE, 0, (GLfloat*)rhs);
-
- return *this;
-}
diff --git a/src/opengl/gl2paintengineex/qglshader_p.h b/src/opengl/gl2paintengineex/qglshader_p.h
deleted file mode 100644
index 64c9a42..0000000
--- a/src/opengl/gl2paintengineex/qglshader_p.h
+++ /dev/null
@@ -1,262 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtOpenGL 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-/*
-Uniform Types in OpenGL ES 2.0
-==============================
-GL_FLOAT GLfloat GLfloat
-GL_FLOAT_VEC2 QGLVec2 GLfloat[2]
-GL_FLOAT_VEC3 QGLVec3 GLfloat[3]
-GL_FLOAT_VEC4 QGLVec4 GLfloat[4]
-GL_INT GLint GLint
-GL_INT_VEC2 QGLIVec2 GLint[2]
-GL_INT_VEC3 QGLIVec3 GLint[3]
-GL_INT_VEC4 QGLIVec4 GLint[4]
-GL_BOOL GLbool GLbool
-GL_BOOL_VEC2 QGLBVec2 GLbool[2]
-GL_BOOL_VEC3 QGLBVec3 GLbool[3]
-GL_BOOL_VEC4 QGLBVec4 GLbool[4]
-GL_FLOAT_MAT2 QGLMat2 GLfloat[2][2]
-GL_FLOAT_MAT3 QGLMat3 GLfloat[3][3]
-GL_FLOAT_MAT4 QGLMat4 GLfloat[4][4]
-GL_SAMPLER_2D QGLSampler2D GLuint
-GL_SAMPLER_CUBE QGLSamplerCube GLuint
-
-Additional Types in Desktop OpenGL 2.0
-======================================
-SAMPLER_1D,
-SAMPLER_3D,
-SAMPLER_1D_SHADOW,
-SAMPLER_2D_SHADOW.
-*/
-
-#include <QtOpenGL>
-
-#define QGLShader QGLEngineShader
-#define QGLShaderProgram QGLEngineShaderProgram
-
-typedef struct {
- GLfloat a;
- GLfloat b;
-} QGLVec2;
-
-typedef struct {
- GLfloat a;
- GLfloat b;
- GLfloat c;
-} QGLVec3;
-
-typedef struct {
- GLfloat a;
- GLfloat b;
- GLfloat c;
- GLfloat d;
-} QGLVec4;
-
-
-class QGLShaderProgram;
-
-class QGLShaderPrivate;
-
-class QGLShader : QObject
-{
- Q_OBJECT
-public:
- enum ShaderType {VertexShader, FragmentShader};
-
- QGLShader(ShaderType type, const QGLContext* ctx = 0);
-
- GLuint id();
- void clearSource();
- void addSource(const QLatin1String& newSource);
- bool compile();
- bool isValid();
- QString log();
- const QGLContext* context(); //maybe make private with prog a friend?
-
-private:
- QGLShaderPrivate* d_ptr;
- Q_DECLARE_PRIVATE(QGLShader);
-
-/*
-public slots:
- void cleanupGLContextRefs(const QGLContext *context);
-*/
-};
-
-
-enum QGLType {
- QGLInvalidType = 0,
- QGLFloatType = GL_FLOAT,
- QGLVec2Type = GL_FLOAT_VEC2,
- QGLVec3Type = GL_FLOAT_VEC3,
- QGLVec4Type = GL_FLOAT_VEC4,
- QGLIntType = GL_INT,
- QGLIVec2Type = GL_INT_VEC2,
- QGLIVec3Type = GL_INT_VEC3,
- QGLIVec4Type = GL_INT_VEC4,
- QGLBoolType = GL_BOOL,
- QGLBVec2Type = GL_BOOL_VEC2,
- QGLBVec3Type = GL_BOOL_VEC3,
- QGLBVec4Type = GL_BOOL_VEC4,
- QGLMat2Type = GL_FLOAT_MAT2,
- QGLMat3Type = GL_FLOAT_MAT3,
- QGLMat4Type = GL_FLOAT_MAT4,
- QGLSampler2DType = GL_SAMPLER_2D,
- QGLSamplerCubeType = GL_SAMPLER_CUBE
-};
-
-class QGLUniform
-{
-public:
-
- QGLUniform(GLenum glType, GLint location, QGLContext* context)
- : m_id(location), m_type(QGLType(glType)), ctx(context) {}
-
- QGLUniform(); // Called by QMap when there's no match on the name
-
- QGLType type() const {return m_type;}
- GLuint id() const {return m_id;}
-
- // Seems odd to be const, but it doesn't actually modify any of the
- // class members, only the GL state!
- const QGLUniform& operator=(const GLfloat&) const;
-
- const QGLUniform& operator=(const QGLVec2&) const;
- const QGLUniform& operator=(const QSizeF&) const;
- const QGLUniform& operator=(const QPointF&) const;
-
- const QGLUniform& operator=(const QGLVec3&) const;
-
- const QGLUniform& operator=(const QGLVec4&) const;
- const QGLUniform& operator=(const QColor&) const;
-
- const QGLUniform& operator=(const GLfloat[2][2]) const;
-
- const QGLUniform& operator=(const GLfloat[3][3]) const;
- const QGLUniform& operator=(const QTransform&) const;
-
- const QGLUniform& operator=(const GLfloat[4][4]) const;
-
- const QGLUniform& operator=(const GLuint&) const; // sampler2d, specifying a texture unit
-
-
-protected:
- GLuint m_id;
- QGLType m_type;
- QGLContext* ctx;
-};
-
-typedef QMap<QString, QGLUniform> QGLUniformList;
-typedef QMapIterator<QString, QGLUniform> QGLUniformListIterator;
-
-
-class QGLVertexAttribute
-{
-public:
- QGLVertexAttribute(GLenum glType, GLuint location, QGLContext* context)
- : m_id(location), m_type(QGLType(glType)), ctx(context) {}
-
- QGLVertexAttribute(); // Called by QMap when there's no match on the name
-
- QGLType type() const {return m_type;}
- GLuint id() const {return m_id;}
- void enable() const;
- void disable() const;
-
- const QGLVertexAttribute& operator=(const GLfloat* rhs) const;
- const QGLVertexAttribute& operator=(const QGLVec3* rhs) const;
-
-protected:
- GLuint m_id;
- QGLType m_type;
- QGLContext* ctx;
-};
-
-//TODO: Convert into setter overloads on QGLShaderProgram
-typedef QMap<QString, QGLVertexAttribute> QGLVertexAttributeList;
-typedef QMapIterator<QString, QGLVertexAttribute> QGLVertexAttributeListIterator;
-
-
-
-class QGLShaderProgramPrivate;
-
-class QGLShaderProgram : QObject
-{
- Q_OBJECT
-public:
- QGLShaderProgram(const QGLContext* ctx = 0);
-
- const QGLUniformList & uniforms();
- const QGLVertexAttributeList& vertexAttributes();
-
- bool addShader(QGLShader* newShader);
- bool removeShader(QGLShader* oldShader);
- bool removeAllShaders();
-
- bool link();
- QString log();
- bool isValid();
- void use();
-
- GLuint id();
-
-private:
- QGLShaderProgramPrivate* d_ptr;
- Q_DECLARE_PRIVATE(QGLShaderProgram);
-
-/*
-public slots:
- void cleanupGLContextRefs(const QGLContext *context);
-*/
-};
-
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index a74f044..e7b6ee4 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -62,7 +62,6 @@
and use the correct program when we really need it.
*/
-
#include "qpaintengineex_opengl2_p.h"
#include <string.h> //for memcpy
@@ -77,93 +76,20 @@
#include <private/qtextureglyphcache_p.h>
#include "qglgradientcache_p.h"
-#include "qglpexshadermanager_p.h"
+#include "qglengineshadermanager_p.h"
#include "qgl2pexvertexarray_p.h"
-extern QImage qt_imageForBrush(int brushStyle, bool invert); //in qbrush.cpp
-
-
#include <QDebug>
+QT_BEGIN_NAMESPACE
-static const GLuint QT_VERTEX_COORDS_ATTR = 0;
-static const GLuint QT_TEXTURE_COORDS_ATTR = 1;
-static const GLuint QT_BRUSH_TEXTURE_UNIT = 0;
-
-class QGL2PaintEngineExPrivate : public QPaintEngineExPrivate
-{
- Q_DECLARE_PUBLIC(QGL2PaintEngineEx)
-public:
- QGL2PaintEngineExPrivate(QGL2PaintEngineEx *q_ptr) :
- q(q_ptr),
- width(0), height(0),
- ctx(0),
- currentBrush( &(q->state()->brush) ),
- inverseScale(1),
- shaderManager(0)
- { }
-
- ~QGL2PaintEngineExPrivate();
-
- void updateBrushTexture();
- void updateBrushUniforms();
- void updateMatrix();
- void updateCompositionMode();
- void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform);
-
- void setBrush(const QBrush* brush);
-
- void drawTexture(const QGLRect& dest, const QGLRect& src, int txtWidth, int txtHeight);
-
- void fill(const QVectorPath &path);
- void drawOutline(const QVectorPath& path);
-
- void drawVertexArrays(QGL2PEXVertexArray& vertexArray, GLenum primitive);
- // ^ draws whatever is in the vertex array
- void composite(const QGLRect& boundingRect);
- // ^ Composites the bounding rect onto dest buffer
- void fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill);
- // ^ Calls drawVertexArrays to render into stencil buffer
- void cleanStencilBuffer(const QGLRect& area);
-
- void prepareForDraw();
-
- inline void useSimpleShader();
- inline QColor premultiplyColor(QColor c, GLfloat opacity);
-
- QGL2PaintEngineEx* q;
-
- //### Move into QGLDrawable
- int width, height;
- QGLContext* ctx;
-
- // Dirty flags
- bool matrixDirty; // Implies matrix uniforms are also dirty
- bool compositionModeDirty;
- bool brushTextureDirty;
- bool brushUniformsDirty;
- bool simpleShaderMatrixUniformDirty;
- bool brushShaderMatrixUniformDirty;
- bool imageShaderMatrixUniformDirty;
- bool textShaderMatrixUniformDirty;
- bool stencilBuferDirty;
-
- const QBrush* currentBrush; // May not be the state's brush!
-
- GLfloat inverseScale;
-
- QGL2PEXVertexArray pathVertexArray;
-
- GLfloat pmvMatrix[4][4];
-
- QGLPEXShaderManager* shaderManager;
-
- // Clipping & state stuff stolen from QOpenGLPaintEngine:
- void updateDepthClip();
- uint use_system_clip : 1;
-};
+extern QImage qt_imageForBrush(int brushStyle, bool invert);
+static const GLuint QT_BRUSH_TEXTURE_UNIT = 0;
+static const GLuint QT_IMAGE_TEXTURE_UNIT = 0; //Can be the same as brush texture unit
+static const GLuint QT_MASK_TEXTURE_UNIT = 1;
+static const GLuint QT_BACKGROUND_TEXTURE_UNIT = 2;
////////////////////////////////// Private Methods //////////////////////////////////////////
@@ -177,7 +103,7 @@ QGL2PaintEngineExPrivate::~QGL2PaintEngineExPrivate()
void QGL2PaintEngineExPrivate::updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform)
{
- glActiveTexture(QT_BRUSH_TEXTURE_UNIT);
+// glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); //### Is it always this texture unit?
if (smoothPixmapTransform) {
glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -206,27 +132,27 @@ void QGL2PaintEngineExPrivate::setBrush(const QBrush* brush)
currentBrush = brush;
brushTextureDirty = true;
brushUniformsDirty = true;
- shaderManager->setBrushStyle(currentBrush->style());
- shaderManager->setAffineOnlyBrushTransform(currentBrush->transform().isAffine());
+ shaderManager->setSrcPixelType(currentBrush->style());
+ shaderManager->optimiseForBrushTransform(currentBrush->transform());
}
// Unless this gets used elsewhere, it's probably best to merge it into fillStencilWithVertexArray
void QGL2PaintEngineExPrivate::useSimpleShader()
{
- shaderManager->simpleShader()->use();
+ shaderManager->simpleProgram()->enable();
if (matrixDirty)
updateMatrix();
if (simpleShaderMatrixUniformDirty) {
- shaderManager->simpleShader()->uniforms()[QLatin1String("pmvMatrix")] = pmvMatrix;
+ shaderManager->simpleProgram()->setUniformValue("pmvMatrix", pmvMatrix);
simpleShaderMatrixUniformDirty = false;
}
}
-Q_GLOBAL_STATIC(QGLGradientCache, qt_opengl_gradient_cache)
+Q_GLOBAL_STATIC(QGL2GradientCache, qt_opengl_gradient_cache)
void QGL2PaintEngineExPrivate::updateBrushTexture()
{
@@ -237,7 +163,7 @@ void QGL2PaintEngineExPrivate::updateBrushTexture()
// Get the image data for the pattern
QImage texImage = qt_imageForBrush(style, true);
- glActiveTexture(QT_BRUSH_TEXTURE_UNIT);
+ glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
ctx->d_func()->bindTexture(texImage, GL_TEXTURE_2D, GL_RGBA, true);
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, true);
}
@@ -257,12 +183,13 @@ void QGL2PaintEngineExPrivate::updateBrushTexture()
else
updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE, true);
+ glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
glBindTexture(GL_TEXTURE_2D, texId);
}
else if (style == Qt::TexturePattern) {
const QPixmap& texPixmap = currentBrush->texture();
- glActiveTexture(QT_BRUSH_TEXTURE_UNIT);
+ glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
ctx->d_func()->bindTexture(texPixmap, GL_TEXTURE_2D, GL_RGBA, true);
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, true);
}
@@ -278,17 +205,11 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
if (style == Qt::NoBrush)
return;
- GLfloat opacity = 1.0;
- if (q->state()->opacity < 0.99f)
- opacity = (GLfloat)q->state()->opacity;
- bool setOpacity = true;
-
QTransform brushQTransform = currentBrush->transform();
if (style == Qt::SolidPattern) {
- QColor col = premultiplyColor(currentBrush->color(), opacity);
- shaderManager->brushShader()->uniforms()[QLatin1String("fragmentColor")] = col;
- setOpacity = false;
+ QColor col = premultiplyColor(currentBrush->color(), (GLfloat)q->state()->opacity);
+ shaderManager->currentProgram()->setUniformValue("fragmentColor", col);
}
else {
// All other brushes have a transform and thus need the translation point:
@@ -297,13 +218,12 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
if (style <= Qt::DiagCrossPattern) {
translationPoint = q->state()->brushOrigin;
- QColor col = premultiplyColor(currentBrush->color(), opacity);
+ QColor col = premultiplyColor(currentBrush->color(), (GLfloat)q->state()->opacity);
- shaderManager->brushShader()->uniforms()[QLatin1String("patternColor")] = col;
- setOpacity = false; //So code below doesn't try to set the opacity uniform
+ shaderManager->currentProgram()->setUniformValue("patternColor", col);
- QGLVec2 halfViewportSize = { width*0.5, height*0.5 };
- shaderManager->brushShader()->uniforms()[QLatin1String("halfViewportSize")] = halfViewportSize;
+ QVector2D halfViewportSize(width*0.5, height*0.5);
+ shaderManager->currentProgram()->setUniformValue("halfViewportSize", halfViewportSize);
}
else if (style == Qt::LinearGradientPattern) {
const QLinearGradient *g = static_cast<const QLinearGradient *>(currentBrush->gradient());
@@ -314,17 +234,16 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
QPointF l = realFinal - realStart;
- // ###
- QGLVec3 linearData = {
+ QVector3D linearData(
l.x(),
l.y(),
1.0f / (l.x() * l.x() + l.y() * l.y())
- };
+ );
- shaderManager->brushShader()->uniforms()[QLatin1String("linearData")] = linearData;
+ shaderManager->currentProgram()->setUniformValue("linearData", linearData);
- QGLVec2 halfViewportSize = { width*0.5, height*0.5 };
- shaderManager->brushShader()->uniforms()[QLatin1String("halfViewportSize")] = halfViewportSize;
+ QVector2D halfViewportSize(width*0.5, height*0.5);
+ shaderManager->currentProgram()->setUniformValue("halfViewportSize", halfViewportSize);
}
else if (style == Qt::ConicalGradientPattern) {
const QConicalGradient *g = static_cast<const QConicalGradient *>(currentBrush->gradient());
@@ -332,10 +251,10 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
GLfloat angle = -(g->angle() * 2 * Q_PI) / 360.0;
- shaderManager->brushShader()->uniforms()[QLatin1String("angle")] = angle;
+ shaderManager->currentProgram()->setUniformValue("angle", angle);
- QGLVec2 halfViewportSize = { width*0.5, height*0.5 };
- shaderManager->brushShader()->uniforms()[QLatin1String("halfViewportSize")] = halfViewportSize;
+ QVector2D halfViewportSize(width*0.5, height*0.5);
+ shaderManager->currentProgram()->setUniformValue("halfViewportSize", halfViewportSize);
}
else if (style == Qt::RadialGradientPattern) {
const QRadialGradient *g = static_cast<const QRadialGradient *>(currentBrush->gradient());
@@ -345,16 +264,15 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
translationPoint = realFocal;
QPointF fmp = realCenter - realFocal;
- shaderManager->brushShader()->uniforms()[QLatin1String("fmp")] = fmp;
+ shaderManager->currentProgram()->setUniformValue("fmp", fmp);
GLfloat fmp2_m_radius2 = -fmp.x() * fmp.x() - fmp.y() * fmp.y() + realRadius*realRadius;
- shaderManager->brushShader()->uniforms()[QLatin1String("fmp2_m_radius2")] = fmp2_m_radius2;
+ shaderManager->currentProgram()->setUniformValue("fmp2_m_radius2", fmp2_m_radius2);
+ shaderManager->currentProgram()->setUniformValue("inverse_2_fmp2_m_radius2",
+ GLfloat(1.0 / (2.0*fmp2_m_radius2)));
- shaderManager->brushShader()->uniforms()[QLatin1String("inverse_2_fmp2_m_radius2")] =
- GLfloat(1.0 / (2.0*fmp2_m_radius2));
-
- QGLVec2 halfViewportSize = { width*0.5, height*0.5 };
- shaderManager->brushShader()->uniforms()[QLatin1String("halfViewportSize")] = halfViewportSize;
+ QVector2D halfViewportSize(width*0.5, height*0.5);
+ shaderManager->currentProgram()->setUniformValue("halfViewportSize", halfViewportSize);
}
else if (style == Qt::TexturePattern) {
translationPoint = q->state()->brushOrigin;
@@ -362,10 +280,10 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
const QPixmap& texPixmap = currentBrush->texture();
QSizeF invertedTextureSize( 1.0 / texPixmap.width(), 1.0 / texPixmap.height() );
- shaderManager->brushShader()->uniforms()[QLatin1String("invertedTextureSize")] = invertedTextureSize;
+ shaderManager->currentProgram()->setUniformValue("invertedTextureSize", invertedTextureSize);
- QGLVec2 halfViewportSize = { width*0.5, height*0.5 };
- shaderManager->brushShader()->uniforms()[QLatin1String("halfViewportSize")] = halfViewportSize;
+ QVector2D halfViewportSize(width*0.5, height*0.5);
+ shaderManager->currentProgram()->setUniformValue("halfViewportSize", halfViewportSize);
}
else
qWarning("QGL2PaintEngineEx: Unimplemented fill style");
@@ -374,11 +292,8 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
QTransform gl_to_qt(1, 0, 0, -1, 0, height);
QTransform inv_matrix = gl_to_qt * (brushQTransform * q->state()->matrix).inverted() * translate;
- shaderManager->brushShader()->uniforms()[QLatin1String("brushTransform")] = inv_matrix;
- shaderManager->brushShader()->uniforms()[QLatin1String("brushTexture")] = QT_BRUSH_TEXTURE_UNIT;
-
- if (setOpacity)
- shaderManager->brushShader()->uniforms()[QLatin1String("opacity")] = opacity;
+ shaderManager->currentProgram()->setUniformValue("brushTransform", inv_matrix);
+ shaderManager->currentProgram()->setUniformValue("brushTexture", QT_BRUSH_TEXTURE_UNIT);
}
brushUniformsDirty = false;
}
@@ -397,38 +312,51 @@ void QGL2PaintEngineExPrivate::updateMatrix()
{0.0, 0.0, 0.0, 1.0}
};
- // Use the (3x3) transform for the Model~View matrix:
const QTransform& transform = q->state()->matrix;
- GLfloat MV[4][4] = {
- {transform.m11(), transform.m21(), 0.0, transform.dx() + 0.5},
- {transform.m12(), transform.m22(), 0.0, transform.dy() + 0.5},
- {0.0, 0.0, 1.0, 0.0},
- {transform.m13(), transform.m23(), 0.0, transform.m33()}
- };
- // NOTE: OpenGL ES works with column-major matrices, so when we multiply the matrices,
- // we also transpose them ready for GL.
- for (int row = 0; row < 4; ++row) {
- for (int col = 0; col < 4; ++col) {
- pmvMatrix[col][row] = 0.0;
- for (int n = 0; n < 4; ++n)
- pmvMatrix[col][row] += P[row][n] * MV[n][col];
+ if (mode == TextDrawingMode) {
+ // Text drawing mode is only used for non-scaling transforms
+ for (int row = 0; row < 4; ++row)
+ for (int col = 0; col < 4; ++col)
+ pmvMatrix[col][row] = P[row][col];
+
+ pmvMatrix[3][0] += P[0][0] * qRound(transform.dx());
+ pmvMatrix[3][1] += P[1][1] * qRound(transform.dy());
+
+ inverseScale = 1;
+ } else {
+ // Use the (3x3) transform for the Model~View matrix:
+ GLfloat MV[4][4] = {
+ {transform.m11(), transform.m21(), 0.0, transform.dx()},
+ {transform.m12(), transform.m22(), 0.0, transform.dy()},
+ {0.0, 0.0, 1.0, 0.0},
+ {transform.m13(), transform.m23(), 0.0, transform.m33()}
+ };
+
+ // NOTE: OpenGL ES works with column-major matrices, so when we multiply the matrices,
+ // we also transpose them ready for GL.
+ for (int row = 0; row < 4; ++row) {
+ for (int col = 0; col < 4; ++col) {
+ pmvMatrix[col][row] = 0.0;
+
+ // P[row][n] is 0.0 for n < row
+ for (int n = row; n < 4; ++n)
+ pmvMatrix[col][row] += P[row][n] * MV[n][col];
+ }
}
- }
- // 1/10000 == 0.0001, so we have good enough res to cover curves
- // that span the entire widget...
- inverseScale = qMax(1 / qMax( qMax(qAbs(transform.m11()), qAbs(transform.m22())),
- qMax(qAbs(transform.m12()), qAbs(transform.m21())) ),
- qreal(0.0001));
+ // 1/10000 == 0.0001, so we have good enough res to cover curves
+ // that span the entire widget...
+ inverseScale = qMax(1 / qMax( qMax(qAbs(transform.m11()), qAbs(transform.m22())),
+ qMax(qAbs(transform.m12()), qAbs(transform.m21())) ),
+ qreal(0.0001));
+ }
matrixDirty = false;
// The actual data has been updated so both shader program's uniforms need updating
simpleShaderMatrixUniformDirty = true;
- brushShaderMatrixUniformDirty = true;
- imageShaderMatrixUniformDirty = true;
- textShaderMatrixUniformDirty = true;
+ shaderMatrixUniformDirty = true;
}
@@ -485,120 +413,140 @@ void QGL2PaintEngineExPrivate::updateCompositionMode()
compositionModeDirty = false;
}
+static inline void setCoords(GLfloat *coords, const QGLRect &rect)
+{
+ coords[0] = rect.left;
+ coords[1] = rect.top;
+ coords[2] = rect.right;
+ coords[3] = rect.top;
+ coords[4] = rect.right;
+ coords[5] = rect.bottom;
+ coords[6] = rect.left;
+ coords[7] = rect.bottom;
+}
-void QGL2PaintEngineExPrivate::drawTexture(const QGLRect& dest, const QGLRect& src, int txtWidth, int txtHeight)
+void QGL2PaintEngineExPrivate::drawTexture(const QGLRect& dest, const QGLRect& src, const QSize &textureSize, bool opaque)
{
-// qDebug("QGL2PaintEngineExPrivate::drawImage()");
+ transferMode(ImageDrawingMode);
- // We have a shader specifically for drawPixmap/drawImage...
- shaderManager->imageShader()->use();
+ updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
- updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false);
+ // Setup for texture drawing
+ shaderManager->setSrcPixelType(QGLEngineShaderManager::ImageSrc);
+ shaderManager->setTextureCoordsEnabled(true);
+ prepareForDraw(opaque);
- if (compositionModeDirty)
- updateCompositionMode();
+ shaderManager->currentProgram()->setUniformValue("imageTexture", QT_IMAGE_TEXTURE_UNIT);
- if (matrixDirty)
- updateMatrix();
+ GLfloat dx = 1.0 / textureSize.width();
+ GLfloat dy = 1.0 / textureSize.height();
- if (imageShaderMatrixUniformDirty) {
- shaderManager->imageShader()->uniforms()[QLatin1String("pmvMatrix")] = pmvMatrix;
- imageShaderMatrixUniformDirty = false;
- }
+ QGLRect srcTextureRect(src.left*dx, 1.0 - src.top*dy, src.right*dx, 1.0 - src.bottom*dy);
- shaderManager->imageShader()->uniforms()[QLatin1String("textureSampler")] = QT_BRUSH_TEXTURE_UNIT;
+ setCoords(staticVertexCoordinateArray, dest);
+ setCoords(staticTextureCoordinateArray, srcTextureRect);
-// if (q->state()->opacity < 0.99f)
- shaderManager->imageShader()->uniforms()[QLatin1String("opacity")] = (GLfloat)q->state()->opacity;
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+}
- GLfloat vertexCoords[] = {
- dest.left, dest.top,
- dest.left, dest.bottom,
- dest.right, dest.bottom,
- dest.right, dest.top
- };
+void QGL2PaintEngineExPrivate::transferMode(EngineMode newMode)
+{
+ if (newMode == mode)
+ return;
- glEnableVertexAttribArray(QT_VERTEX_COORDS_ATTR);
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoords);
+ if (mode == TextDrawingMode || mode == ImageDrawingMode) {
+ glDisableVertexAttribArray(QT_TEXTURE_COORDS_ATTR);
+ glDisableVertexAttribArray(QT_VERTEX_COORDS_ATTR);
+ }
- GLfloat dx = 1.0 / txtWidth;
- GLfloat dy = 1.0 / txtHeight;
+ if (mode == TextDrawingMode)
+ matrixDirty = true;
- QGLRect srcTextureRect(src.left*dx, 1.0 - src.top*dy, src.right*dx, 1.0 - src.bottom*dy);
+ if (newMode == TextDrawingMode) {
+ glEnableVertexAttribArray(QT_VERTEX_COORDS_ATTR);
+ glEnableVertexAttribArray(QT_TEXTURE_COORDS_ATTR);
- GLfloat textureCoords[] = {
- srcTextureRect.left, srcTextureRect.top,
- srcTextureRect.left, srcTextureRect.bottom,
- srcTextureRect.right, srcTextureRect.bottom,
- srcTextureRect.right, srcTextureRect.top
- };
+ glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray.data());
+ glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray.data());
- glEnableVertexAttribArray(QT_TEXTURE_COORDS_ATTR);
- glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoords);
+ matrixDirty = true;
+ }
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ if (newMode == ImageDrawingMode) {
+ glEnableVertexAttribArray(QT_VERTEX_COORDS_ATTR);
+ glEnableVertexAttribArray(QT_TEXTURE_COORDS_ATTR);
- glDisableVertexAttribArray(QT_TEXTURE_COORDS_ATTR);
- glDisableVertexAttribArray(QT_VERTEX_COORDS_ATTR);
-}
+ glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, staticVertexCoordinateArray);
+ glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, staticTextureCoordinateArray);
+ }
+ // This needs to change when we implement high-quality anti-aliasing...
+ if (newMode != TextDrawingMode)
+ shaderManager->setMaskType(QGLEngineShaderManager::NoMask);
+
+ mode = newMode;
+}
void QGL2PaintEngineExPrivate::drawOutline(const QVectorPath& path)
{
-// qDebug("QGL2PaintEngineExPrivate::drawOutline()");
+ transferMode(BrushDrawingMode);
+
+ // Might need to call updateMatrix to re-calculate inverseScale
if (matrixDirty)
updateMatrix();
- pathVertexArray.clear();
- pathVertexArray.addPath(path, inverseScale);
+ vertexCoordinateArray.clear();
+ vertexCoordinateArray.addPath(path, inverseScale);
if (path.hasImplicitClose()) {
// Close the path's outline
- pathVertexArray.lineToArray(path.points()[0], path.points()[1]);
- pathVertexArray.stops().last() += 1;
+ vertexCoordinateArray.lineToArray(path.points()[0], path.points()[1]);
+ vertexCoordinateArray.stops().last() += 1;
}
- prepareForDraw();
- drawVertexArrays(pathVertexArray, GL_LINE_STRIP);
+ prepareForDraw(currentBrush->isOpaque());
+ drawVertexArrays(vertexCoordinateArray, GL_LINE_STRIP);
}
// Assumes everything is configured for the brush you want to use
void QGL2PaintEngineExPrivate::fill(const QVectorPath& path)
{
+ transferMode(BrushDrawingMode);
+
+ // Might need to call updateMatrix to re-calculate inverseScale
if (matrixDirty)
updateMatrix();
const QPointF* const points = reinterpret_cast<const QPointF*>(path.points());
-
// Check to see if there's any hints
if (path.shape() == QVectorPath::RectangleHint) {
QGLRect rect(points[0].x(), points[0].y(), points[2].x(), points[2].y());
- prepareForDraw();
+ prepareForDraw(currentBrush->isOpaque());
composite(rect);
}
else if (path.shape() == QVectorPath::EllipseHint) {
- pathVertexArray.clear();
- pathVertexArray.addPath(path, inverseScale);
- prepareForDraw();
- drawVertexArrays(pathVertexArray, GL_TRIANGLE_FAN);
+ vertexCoordinateArray.clear();
+ vertexCoordinateArray.addPath(path, inverseScale);
+ prepareForDraw(currentBrush->isOpaque());
+ drawVertexArrays(vertexCoordinateArray, GL_TRIANGLE_FAN);
}
else {
// The path is too complicated & needs the stencil technique
- pathVertexArray.clear();
- pathVertexArray.addPath(path, inverseScale);
+ vertexCoordinateArray.clear();
+ vertexCoordinateArray.addPath(path, inverseScale);
- fillStencilWithVertexArray(pathVertexArray, path.hasWindingFill());
+ fillStencilWithVertexArray(vertexCoordinateArray, path.hasWindingFill());
// Stencil the brush onto the dest buffer
glStencilFunc(GL_NOTEQUAL, 0, 0xFFFF); // Pass if stencil buff value != 0
glEnable(GL_STENCIL_TEST);
- prepareForDraw();
- composite(pathVertexArray.boundingRect());
+ prepareForDraw(currentBrush->isOpaque());
+ composite(vertexCoordinateArray.boundingRect());
glDisable(GL_STENCIL_TEST);
- cleanStencilBuffer(pathVertexArray.boundingRect());
+ cleanStencilBuffer(vertexCoordinateArray.boundingRect());
}
}
@@ -674,32 +622,54 @@ void QGL2PaintEngineExPrivate::cleanStencilBuffer(const QGLRect& area)
glDisable(GL_STENCIL_TEST);
}
-void QGL2PaintEngineExPrivate::prepareForDraw()
+void QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque)
{
- if (brushTextureDirty)
+ if (brushTextureDirty && mode != ImageDrawingMode)
updateBrushTexture();
if (compositionModeDirty)
updateCompositionMode();
+ if (matrixDirty)
+ updateMatrix();
+
+ const bool stateHasOpacity = q->state()->opacity < 0.99f;
+ if (q->state()->compositionMode() == QPainter::CompositionMode_Source
+ || (q->state()->compositionMode() == QPainter::CompositionMode_SourceOver
+ && srcPixelsAreOpaque && !stateHasOpacity))
+ glDisable(GL_BLEND);
+ else
+ glEnable(GL_BLEND);
+
+ bool useGlobalOpacityUniform = stateHasOpacity;
+ if (stateHasOpacity && (mode != ImageDrawingMode)) {
+ // Using a brush
+ bool brushIsPattern = (currentBrush->style() >= Qt::Dense1Pattern) &&
+ (currentBrush->style() <= Qt::DiagCrossPattern);
+
+ if ((currentBrush->style() == Qt::SolidPattern) || brushIsPattern)
+ useGlobalOpacityUniform = false; // Global opacity handled by srcPixel shader
+ }
+ shaderManager->setUseGlobalOpacity(useGlobalOpacityUniform);
+
+
+ // If the shader program needs changing, we change it and mark all uniforms as dirty
if (shaderManager->useCorrectShaderProg()) {
// The shader program has changed so mark all uniforms as dirty:
brushUniformsDirty = true;
- brushShaderMatrixUniformDirty = true;
+ shaderMatrixUniformDirty = true;
}
- if (brushUniformsDirty)
+ if (brushUniformsDirty && mode != ImageDrawingMode)
updateBrushUniforms();
- if (brushShaderMatrixUniformDirty) {
- shaderManager->brushShader()->uniforms()[QLatin1String("pmvMatrix")] = pmvMatrix;
- brushShaderMatrixUniformDirty = false;
+ if (shaderMatrixUniformDirty) {
+ shaderManager->currentProgram()->setUniformValue("pmvMatrix", pmvMatrix);
+ shaderMatrixUniformDirty = false;
}
- if ((q->state()->opacity < 0.99f) || !currentBrush->isOpaque())
- glEnable(GL_BLEND);
- else
- glDisable(GL_BLEND);
+ if (useGlobalOpacityUniform)
+ shaderManager->currentProgram()->setUniformValue("globalOpacity", (GLfloat)q->state()->opacity);
}
void QGL2PaintEngineExPrivate::composite(const QGLRect& boundingRect)
@@ -749,8 +719,6 @@ void QGL2PaintEngineExPrivate::drawVertexArrays(QGL2PEXVertexArray& vertexArray,
QGL2PaintEngineEx::QGL2PaintEngineEx()
: QPaintEngineEx(*(new QGL2PaintEngineExPrivate(this)))
{
- qDebug("QGL2PaintEngineEx::QGL2PaintEngineEx()");
-
}
QGL2PaintEngineEx::~QGL2PaintEngineEx()
@@ -761,8 +729,10 @@ void QGL2PaintEngineEx::fill(const QVectorPath &path, const QBrush &brush)
{
Q_D(QGL2PaintEngineEx);
- QTime startTime = QTime::currentTime();
+ if (brush.style() == Qt::NoBrush)
+ return;
+ ensureActive();
d->setBrush(&brush);
d->fill(path);
d->setBrush(&(state()->brush)); // reset back to the state's brush
@@ -775,6 +745,8 @@ void QGL2PaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
if (pen.style() == Qt::NoPen)
return;
+ ensureActive();
+
if ( (pen.isCosmetic() && (pen.style() == Qt::SolidLine)) && (pen.widthF() < 2.5f) )
{
// We only handle solid, cosmetic pens with a width of 1 pixel
@@ -790,7 +762,6 @@ void QGL2PaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
d->setBrush(&(state()->brush));
} else
return QPaintEngineEx::stroke(path, pen);
-
}
void QGL2PaintEngineEx::penChanged()
@@ -819,7 +790,6 @@ void QGL2PaintEngineEx::opacityChanged()
Q_D(QGL2PaintEngineEx);
Q_ASSERT(d->shaderManager);
- d->shaderManager->setUseGlobalOpacity(state()->opacity > 0.999);
d->brushUniformsDirty = true;
}
@@ -845,45 +815,42 @@ void QGL2PaintEngineEx::transformChanged()
void QGL2PaintEngineEx::drawPixmap(const QRectF& dest, const QPixmap & pixmap, const QRectF & src)
{
Q_D(QGL2PaintEngineEx);
- glActiveTexture(QT_BRUSH_TEXTURE_UNIT);
+ ensureActive();
+ d->transferMode(ImageDrawingMode);
- d->ctx->d_func()->bindTexture(pixmap, GL_TEXTURE_2D, GL_RGBA, true);
+ QGLContext *ctx = d->ctx;
+ glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
+ ctx->d_func()->bindTexture(pixmap, GL_TEXTURE_2D, GL_RGBA, true);
//FIXME: we should use hasAlpha() instead, but that's SLOW at the moment
- if ((state()->opacity < 0.99f) || pixmap.hasAlphaChannel())
- glEnable(GL_BLEND);
- else
- glDisable(GL_BLEND);
-
- d->drawTexture(dest, src, pixmap.width(), pixmap.height());
+ d->drawTexture(dest, src, pixmap.size(), !pixmap.hasAlphaChannel());
}
void QGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, const QRectF& src,
Qt::ImageConversionFlags)
{
Q_D(QGL2PaintEngineEx);
- glActiveTexture(QT_BRUSH_TEXTURE_UNIT);
- d->ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, true);
+ ensureActive();
+ d->transferMode(ImageDrawingMode);
- if ((state()->opacity < 0.99f) || image.hasAlphaChannel())
- glEnable(GL_BLEND);
- else
- glDisable(GL_BLEND);
+ QGLContext *ctx = d->ctx;
+ glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
+ ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, true);
- d->drawTexture(dest, src, image.width(), image.height());
+ d->drawTexture(dest, src, image.size(), !image.hasAlphaChannel());
}
void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem)
{
- QOpenGLPaintEngineState *s = state();
+ Q_D(QGL2PaintEngineEx);
+
+ ensureActive();
+ QOpenGL2PaintEngineState *s = state();
const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
bool drawCached = true;
- if (state()->pen.brush().style() != Qt::SolidPattern)
- drawCached = false;
-
if (s->matrix.type() > QTransform::TxTranslate)
drawCached = false;
@@ -892,17 +859,19 @@ void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem
drawCached = false;
if (drawCached) {
- drawCachedGlyphs(p, ti);
+ d->drawCachedGlyphs(p, ti);
return;
}
QPaintEngineEx::drawTextItem(p, ti);
}
-void QGL2PaintEngineEx::drawCachedGlyphs(const QPointF &p, const QTextItemInt &ti)
+void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, const QTextItemInt &ti)
{
- Q_D(QGL2PaintEngineEx);
- QOpenGLPaintEngineState *s = state();
+ transferMode(TextDrawingMode);
+
+ Q_Q(QGL2PaintEngineEx);
+ QOpenGL2PaintEngineState *s = q->state();
QVarLengthArray<QFixedPoint> positions;
QVarLengthArray<glyph_t> glyphs;
@@ -910,10 +879,22 @@ void QGL2PaintEngineEx::drawCachedGlyphs(const QPointF &p, const QTextItemInt &t
matrix.translate(p.x(), p.y());
ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
+
QFontEngineGlyphCache::Type glyphType = ti.fontEngine->glyphFormat >= 0
? QFontEngineGlyphCache::Type(ti.fontEngine->glyphFormat)
: QFontEngineGlyphCache::Raster_A8;
+ GLenum maskFormat = GL_RGBA;
+ if (glyphType == QFontEngineGlyphCache::Raster_A8) {
+ shaderManager->setMaskType(QGLEngineShaderManager::PixelMask);
+// maskFormat = GL_ALPHA;
+ }
+ else if (glyphType == QFontEngineGlyphCache::Raster_RGBMask)
+ shaderManager->setMaskType(QGLEngineShaderManager::SubPixelMask);
+ //### TODO: Gamma correction
+ shaderManager->setTextureCoordsEnabled(true);
+
+
QImageTextureGlyphCache *cache =
(QImageTextureGlyphCache *) ti.fontEngine->glyphCache(glyphType, s->matrix);
if (!cache) {
@@ -926,66 +907,46 @@ void QGL2PaintEngineEx::drawCachedGlyphs(const QPointF &p, const QTextItemInt &t
const QImage &image = cache->image();
int margin = cache->glyphMargin();
- glActiveTexture(QT_BRUSH_TEXTURE_UNIT);
- d->ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, true);
-
- glEnable(GL_BLEND);
-
- d->shaderManager->textShader()->use();
- d->updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false);
-
- if (d->compositionModeDirty)
- d->updateCompositionMode();
-
- if (d->matrixDirty)
- d->updateMatrix();
-
- if (d->textShaderMatrixUniformDirty) {
- d->shaderManager->textShader()->uniforms()[QLatin1String("pmvMatrix")] = d->pmvMatrix;
- d->textShaderMatrixUniformDirty = false;
- }
-
- d->shaderManager->textShader()->uniforms()[QLatin1String("textureSampler")] = QT_BRUSH_TEXTURE_UNIT;
- QColor col = d->premultiplyColor(state()->pen.color(), (GLfloat)state()->opacity);
- d->shaderManager->textShader()->uniforms()[QLatin1String("fragmentColor")] = col;
+ if (image.isNull())
+ return;
GLfloat dx = 1.0 / image.width();
GLfloat dy = 1.0 / image.height();
- glEnableVertexAttribArray(QT_VERTEX_COORDS_ATTR);
- glEnableVertexAttribArray(QT_TEXTURE_COORDS_ATTR);
+ QGLPoint *oldVertexCoordinateDataPtr = vertexCoordinateArray.data();
+ QGLPoint *oldTextureCoordinateDataPtr = textureCoordinateArray.data();
+
+ vertexCoordinateArray.clear();
+ textureCoordinateArray.clear();
+
for (int i=0; i<glyphs.size(); ++i) {
const QTextureGlyphCache::Coord &c = cache->coords.value(glyphs[i]);
int x = positions[i].x.toInt() + c.baseLineX - margin;
int y = positions[i].y.toInt() - c.baseLineY - margin;
- QGLRect dest = QRectF(x, y, c.w, c.h);
- QGLRect src = QRectF(c.x, c.y, c.w, c.h);
+ vertexCoordinateArray.addRect(QRectF(x, y, c.w, c.h));
+ textureCoordinateArray.addRect(QRectF(c.x*dx, 1 - c.y*dy, c.w * dx, -c.h * dy));
+ }
- GLfloat vertexCoords[] = {
- dest.left, dest.top,
- dest.left, dest.bottom,
- dest.right, dest.bottom,
- dest.right, dest.top
- };
+ glActiveTexture(GL_TEXTURE0 + QT_MASK_TEXTURE_UNIT);
+ ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, true);
+ updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false);
- glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoords);
+ QBrush pensBrush = q->state()->pen.brush();
+ setBrush(&pensBrush);
- QGLRect srcTextureRect(src.left*dx, 1.0 - src.top*dy, src.right*dx, 1.0 - src.bottom*dy);
+ prepareForDraw(false); // Text always causes src pixels to be transparent
- GLfloat textureCoords[] = {
- srcTextureRect.left, srcTextureRect.top,
- srcTextureRect.left, srcTextureRect.bottom,
- srcTextureRect.right, srcTextureRect.bottom,
- srcTextureRect.right, srcTextureRect.top
- };
+ shaderManager->currentProgram()->setUniformValue("maskTexture", QT_MASK_TEXTURE_UNIT);
- glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoords);
+ if (vertexCoordinateArray.data() != oldVertexCoordinateDataPtr)
+ glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray.data());
+ if (textureCoordinateArray.data() != oldTextureCoordinateDataPtr)
+ glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray.data());
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- }
- glDisableVertexAttribArray(QT_TEXTURE_COORDS_ATTR);
- glDisableVertexAttribArray(QT_VERTEX_COORDS_ATTR);
+ glDrawArrays(GL_TRIANGLES, 0, 6 * glyphs.size());
+
+ setBrush(&(q->state()->brush)); //###
}
bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
@@ -993,15 +954,30 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
Q_D(QGL2PaintEngineEx);
// qDebug("QGL2PaintEngineEx::begin()");
+ d->drawable.setDevice(pdev);
+ d->ctx = d->drawable.context();
+
+ if (d->ctx->d_ptr->active_engine) {
+ QGL2PaintEngineEx *engine = static_cast<QGL2PaintEngineEx *>(d->ctx->d_ptr->active_engine);
+ QGL2PaintEngineExPrivate *p = static_cast<QGL2PaintEngineExPrivate *>(engine->d_ptr);
+ p->transferMode(BrushDrawingMode);
+ p->drawable.doneCurrent();
+ }
+
+ d->ctx->d_ptr->active_engine = this;
+
+ d->drawable.makeCurrent();
+ QSize sz = d->drawable.size();
+ d->width = sz.width();
+ d->height = sz.height();
+ d->mode = BrushDrawingMode;
- QGLWidget* widget = static_cast<QGLWidget*>(pdev);
- d->ctx = const_cast<QGLContext*>(widget->context());
- d->ctx->makeCurrent();
- d->width = widget->width();
- d->height = widget->height();
+#if !defined(QT_OPENGL_ES_2)
+ qt_resolve_version_2_0_functions(d->ctx);
+#endif
if (!d->shaderManager)
- d->shaderManager = new QGLPEXShaderManager(d->ctx);
+ d->shaderManager = new QGLEngineShaderManager(d->ctx);
glViewport(0, 0, d->width, d->height);
@@ -1020,17 +996,82 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->use_system_clip = !systemClip().isEmpty();
glDisable(GL_DEPTH_TEST);
+ glDisable(GL_SCISSOR_TEST);
+
+ QGLPixmapData *source = d->drawable.copyOnBegin();
+ if (d->drawable.context()->d_func()->clear_on_painter_begin && d->drawable.autoFillBackground()) {
+ if (d->drawable.hasTransparentBackground())
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ else {
+ const QColor &c = d->drawable.backgroundColor();
+ float alpha = c.alphaF();
+ glClearColor(c.redF() * alpha, c.greenF() * alpha, c.blueF() * alpha, alpha);
+ }
+ glClear(GL_COLOR_BUFFER_BIT);
+ } else if (source) {
+ QGLContext *ctx = d->ctx;
+
+ d->transferMode(ImageDrawingMode);
+
+ glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
+ source->bind(false);
+
+ QRect rect(0, 0, source->width(), source->height());
+ d->drawTexture(QRectF(rect), QRectF(rect), rect.size(), true);
+ }
+ updateClipRegion(QRegion(), Qt::NoClip);
return true;
}
bool QGL2PaintEngineEx::end()
{
Q_D(QGL2PaintEngineEx);
- d->ctx->swapBuffers();
+ QGLContext *ctx = d->ctx;
+ if (ctx->d_ptr->active_engine != this) {
+ QGL2PaintEngineEx *engine = static_cast<QGL2PaintEngineEx *>(ctx->d_ptr->active_engine);
+ if (engine && engine->isActive()) {
+ QGL2PaintEngineExPrivate *p = static_cast<QGL2PaintEngineExPrivate *>(engine->d_ptr);
+ p->transferMode(BrushDrawingMode);
+ p->drawable.doneCurrent();
+ }
+ d->drawable.makeCurrent();
+ }
+
+ glUseProgram(0);
+ d->transferMode(BrushDrawingMode);
+ d->drawable.swapBuffers();
+ d->drawable.doneCurrent();
+ d->ctx->d_ptr->active_engine = 0;
+
return false;
}
+void QGL2PaintEngineEx::ensureActive()
+{
+ Q_D(QGL2PaintEngineEx);
+ QGLContext *ctx = d->ctx;
+
+ if (isActive() && ctx->d_ptr->active_engine != this) {
+ QGL2PaintEngineEx *engine = static_cast<QGL2PaintEngineEx *>(ctx->d_ptr->active_engine);
+ if (engine && engine->isActive()) {
+ QGL2PaintEngineExPrivate *p = static_cast<QGL2PaintEngineExPrivate *>(engine->d_ptr);
+ p->transferMode(BrushDrawingMode);
+ p->drawable.doneCurrent();
+ }
+ d->drawable.makeCurrent();
+
+ ctx->d_ptr->active_engine = this;
+
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_SCISSOR_TEST);
+
+ glViewport(0, 0, d->width, d->height);
+ setState(state());
+ d->updateDepthClip();
+ }
+}
+
/////////////////////////////////// State/Clipping stolen from QOpenGLPaintEngine //////////////////////////////////////////
@@ -1161,14 +1202,19 @@ void QGL2PaintEngineEx::updateClipRegion(const QRegion &clipRegion, Qt::ClipOper
state()->hasClipping = op != Qt::NoClip || d->use_system_clip;
}
- if (state()->hasClipping && state()->clipRegion.rects().size() == 1)
- state()->fastClip = state()->clipRegion.rects().at(0);
- else
- state()->fastClip = QRect();
-
d->updateDepthClip();
}
+void QGL2PaintEngineExPrivate::systemStateChanged()
+{
+ Q_Q(QGL2PaintEngineEx);
+ use_system_clip = !systemClip.isEmpty();
+
+ if (q->painter()->hasClipping())
+ q->updateClipRegion(q->painter()->clipRegion(), Qt::ReplaceClip);
+ else
+ q->updateClipRegion(QRegion(), Qt::NoClip);
+}
void QGL2PaintEngineExPrivate::updateDepthClip()
{
@@ -1176,20 +1222,17 @@ void QGL2PaintEngineExPrivate::updateDepthClip()
Q_Q(QGL2PaintEngineEx);
+ q->ensureActive();
glDisable(GL_DEPTH_TEST);
glDisable(GL_SCISSOR_TEST);
if (!q->state()->hasClipping)
return;
- QRect fastClip;
- if (q->state()->clipEnabled) {
- fastClip = q->state()->fastClip;
- } else if (use_system_clip && q->systemClip().rects().count() == 1) {
- fastClip = q->systemClip().rects().at(0);
- }
+ const QVector<QRect> rects = q->state()->clipEnabled ? q->state()->clipRegion.rects() : q->systemClip().rects();
+ if (rects.size() == 1) {
+ QRect fastClip = rects.at(0);
- if (!fastClip.isEmpty()) {
glEnable(GL_SCISSOR_TEST);
const int left = fastClip.left();
@@ -1201,12 +1244,11 @@ void QGL2PaintEngineExPrivate::updateDepthClip()
return;
}
- glClearDepthf(0x0);
+ glClearDepth(0x0);
glDepthMask(true);
glClear(GL_DEPTH_BUFFER_BIT);
- glClearDepthf(0x1);
+ glClearDepth(0x1);
- const QVector<QRect> rects = q->state()->clipEnabled ? q->state()->clipRegion.rects() : q->systemClip().rects();
glEnable(GL_SCISSOR_TEST);
for (int i = 0; i < rects.size(); ++i) {
QRect rect = rects.at(i);
@@ -1229,50 +1271,57 @@ void QGL2PaintEngineExPrivate::updateDepthClip()
-void QGL2PaintEngineEx::setState(QPainterState *s)
+void QGL2PaintEngineEx::setState(QPainterState *new_state)
{
// qDebug("QGL2PaintEngineEx::setState()");
Q_D(QGL2PaintEngineEx);
+
+ QOpenGL2PaintEngineState *s = static_cast<QOpenGL2PaintEngineState *>(new_state);
+
+ QOpenGL2PaintEngineState *old_state = state();
+ const bool needsDepthClipUpdate = !old_state
+ || s->clipEnabled != old_state->clipEnabled
+ || (s->clipEnabled && s->clipRegion != old_state->clipRegion);
+
QPaintEngineEx::setState(s);
- d->updateDepthClip();
+ if (needsDepthClipUpdate)
+ d->updateDepthClip();
d->matrixDirty = true;
d->compositionModeDirty = true;
d->brushTextureDirty = true;
d->brushUniformsDirty = true;
d->simpleShaderMatrixUniformDirty = true;
- d->brushShaderMatrixUniformDirty = true;
- d->imageShaderMatrixUniformDirty = true;
- d->textShaderMatrixUniformDirty = true;
+ d->shaderMatrixUniformDirty = true;
}
QPainterState *QGL2PaintEngineEx::createState(QPainterState *orig) const
{
- QOpenGLPaintEngineState *s;
+ QOpenGL2PaintEngineState *s;
if (!orig)
- s = new QOpenGLPaintEngineState();
+ s = new QOpenGL2PaintEngineState();
else
- s = new QOpenGLPaintEngineState(*static_cast<QOpenGLPaintEngineState *>(orig));
+ s = new QOpenGL2PaintEngineState(*static_cast<QOpenGL2PaintEngineState *>(orig));
return s;
}
-QOpenGLPaintEngineState::QOpenGLPaintEngineState(QOpenGLPaintEngineState &other)
+QOpenGL2PaintEngineState::QOpenGL2PaintEngineState(QOpenGL2PaintEngineState &other)
: QPainterState(other)
{
clipRegion = other.clipRegion;
hasClipping = other.hasClipping;
- fastClip = other.fastClip;
}
-QOpenGLPaintEngineState::QOpenGLPaintEngineState()
+QOpenGL2PaintEngineState::QOpenGL2PaintEngineState()
{
hasClipping = false;
}
-QOpenGLPaintEngineState::~QOpenGLPaintEngineState()
+QOpenGL2PaintEngineState::~QOpenGL2PaintEngineState()
{
}
+QT_END_NAMESPACE
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index ce66e4b..dececa3 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -53,21 +53,32 @@
// We mean it.
//
+#include <QDebug>
+
#include <private/qpaintengineex_p.h>
+#include <private/qglengineshadermanager_p.h>
+#include <private/qgl2pexvertexarray_p.h>
+
+enum EngineMode {
+ ImageDrawingMode,
+ TextDrawingMode,
+ BrushDrawingMode
+};
+
+QT_BEGIN_NAMESPACE
class QGL2PaintEngineExPrivate;
-class QOpenGLPaintEngineState : public QPainterState
+class QOpenGL2PaintEngineState : public QPainterState
{
public:
- QOpenGLPaintEngineState(QOpenGLPaintEngineState &other);
- QOpenGLPaintEngineState();
- ~QOpenGLPaintEngineState();
+ QOpenGL2PaintEngineState(QOpenGL2PaintEngineState &other);
+ QOpenGL2PaintEngineState();
+ ~QOpenGL2PaintEngineState();
QRegion clipRegion;
bool hasClipping;
- QRect fastClip;
};
@@ -81,6 +92,8 @@ public:
bool begin(QPaintDevice *device);
bool end();
+ void ensureActive();
+
virtual void fill(const QVectorPath &path, const QBrush &brush);
virtual void stroke(const QVectorPath &path, const QPen &pen);
virtual void clip(const QVectorPath &path, Qt::ClipOperation op);
@@ -100,19 +113,17 @@ public:
virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
Qt::ImageConversionFlags flags = Qt::AutoColor);
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem);
- void drawCachedGlyphs(const QPointF &p, const QTextItemInt &ti);
Type type() const { return OpenGL; }
-
// State stuff is just for clipping and ripped off from QGLPaintEngine
void setState(QPainterState *s);
QPainterState *createState(QPainterState *orig) const;
- inline QOpenGLPaintEngineState *state() {
- return static_cast<QOpenGLPaintEngineState *>(QPaintEngineEx::state());
+ inline QOpenGL2PaintEngineState *state() {
+ return static_cast<QOpenGL2PaintEngineState *>(QPaintEngineEx::state());
}
- inline const QOpenGLPaintEngineState *state() const {
- return static_cast<const QOpenGLPaintEngineState *>(QPaintEngineEx::state());
+ inline const QOpenGL2PaintEngineState *state() const {
+ return static_cast<const QOpenGL2PaintEngineState *>(QPaintEngineEx::state());
}
void updateClipRegion(const QRegion &clipRegion, Qt::ClipOperation op);
@@ -120,6 +131,86 @@ private:
Q_DISABLE_COPY(QGL2PaintEngineEx)
};
+class QGL2PaintEngineExPrivate : public QPaintEngineExPrivate
+{
+ Q_DECLARE_PUBLIC(QGL2PaintEngineEx)
+public:
+ QGL2PaintEngineExPrivate(QGL2PaintEngineEx *q_ptr) :
+ q(q_ptr),
+ width(0), height(0),
+ ctx(0),
+ currentBrush( &(q->state()->brush) ),
+ inverseScale(1),
+ shaderManager(0)
+ { }
+
+ ~QGL2PaintEngineExPrivate();
+
+ void updateBrushTexture();
+ void updateBrushUniforms();
+ void updateMatrix();
+ void updateCompositionMode();
+ void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform);
+
+ void setBrush(const QBrush* brush);
+
+ void transferMode(EngineMode newMode);
+
+ // fill, drawOutline, drawTexture & drawCachedGlyphs are the rendering entry points:
+ void fill(const QVectorPath &path);
+ void drawOutline(const QVectorPath& path);
+ void drawTexture(const QGLRect& dest, const QGLRect& src, const QSize &textureSize, bool opaque);
+ void drawCachedGlyphs(const QPointF &p, const QTextItemInt &ti);
+
+ void drawVertexArrays(QGL2PEXVertexArray& vertexArray, GLenum primitive);
+ // ^ draws whatever is in the vertex array
+ void composite(const QGLRect& boundingRect);
+ // ^ Composites the bounding rect onto dest buffer
+ void fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill);
+ // ^ Calls drawVertexArrays to render into stencil buffer
+ void cleanStencilBuffer(const QGLRect& area);
+
+ void prepareForDraw(bool srcPixelsAreOpaque);
+
+ inline void useSimpleShader();
+ inline QColor premultiplyColor(QColor c, GLfloat opacity);
+
+ QGL2PaintEngineEx* q;
+ QGLDrawable drawable;
+ int width, height;
+ QGLContext *ctx;
+
+ EngineMode mode;
+
+ // Dirty flags
+ bool matrixDirty; // Implies matrix uniforms are also dirty
+ bool compositionModeDirty;
+ bool brushTextureDirty;
+ bool brushUniformsDirty;
+ bool simpleShaderMatrixUniformDirty;
+ bool shaderMatrixUniformDirty;
+ bool stencilBuferDirty;
+
+ const QBrush* currentBrush; // May not be the state's brush!
+
+ GLfloat inverseScale;
+
+ QGL2PEXVertexArray vertexCoordinateArray;
+ QGL2PEXVertexArray textureCoordinateArray;
+
+ GLfloat staticVertexCoordinateArray[8];
+ GLfloat staticTextureCoordinateArray[8];
+
+ GLfloat pmvMatrix[4][4];
+
+ QGLEngineShaderManager* shaderManager;
+
+ // Clipping & state stuff stolen from QOpenGLPaintEngine:
+ void updateDepthClip();
+ void systemStateChanged();
+ uint use_system_clip : 1;
+};
+QT_END_NAMESPACE
#endif
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index ad75a5f..73af174 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -13,47 +13,51 @@ include(../qbase.pri)
!win32:!embedded:!mac:CONFIG += x11
contains(QT_CONFIG, opengl):CONFIG += opengl
contains(QT_CONFIG, opengles1):CONFIG += opengles1
+contains(QT_CONFIG, opengles1):CONFIG += opengles1cl
contains(QT_CONFIG, opengles2):CONFIG += opengles2
-!contains(QT_CONFIG, opengles2) {
- HEADERS += qgraphicssystem_gl_p.h qwindowsurface_gl_p.h qpixmapdata_gl_p.h
- SOURCES += qgraphicssystem_gl.cpp qwindowsurface_gl.cpp qpixmapdata_gl.cpp
-}
-
HEADERS += qgl.h \
qgl_p.h \
qglcolormap.h \
qglpixelbuffer.h \
qglframebufferobject.h \
- qglshaderprogram.h
+ qglextensions_p.h
SOURCES += qgl.cpp \
qglcolormap.cpp \
qglpixelbuffer.cpp \
qglframebufferobject.cpp \
qglextensions.cpp \
- qglshaderprogram.cpp
!contains(QT_CONFIG, opengles2) {
- HEADERS += qpaintengine_opengl_p.h qglpixmapfilter_p.h
- SOURCES += qpaintengine_opengl.cpp qglpixmapfilter.cpp
+ HEADERS += qpaintengine_opengl_p.h
+ SOURCES += qpaintengine_opengl.cpp
}
-contains(QT_CONFIG, opengles2) {
- SOURCES += gl2paintengineex/qglgradientcache.cpp \
- gl2paintengineex/qglpexshadermanager.cpp \
- gl2paintengineex/qglshader.cpp \
+!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl) {
+ HEADERS += qglshaderprogram.h \
+ qglpixmapfilter_p.h \
+ qgraphicssystem_gl_p.h \
+ qwindowsurface_gl_p.h \
+ qpixmapdata_gl_p.h \
+ gl2paintengineex/qglgradientcache_p.h \
+ gl2paintengineex/qglengineshadermanager_p.h \
+ gl2paintengineex/qgl2pexvertexarray_p.h \
+ gl2paintengineex/qpaintengineex_opengl2_p.h \
+ gl2paintengineex/qglengineshadersource_p.h
+
+ SOURCES += qglshaderprogram.cpp \
+ qglpixmapfilter.cpp \
+ qgraphicssystem_gl.cpp \
+ qwindowsurface_gl.cpp \
+ qpixmapdata_gl.cpp \
+ gl2paintengineex/qglgradientcache.cpp \
+ gl2paintengineex/qglengineshadermanager.cpp \
gl2paintengineex/qgl2pexvertexarray.cpp \
gl2paintengineex/qpaintengineex_opengl2.cpp
- HEADERS += gl2paintengineex/qglgradientcache_p.h \
- gl2paintengineex/qglpexshadermanager_p.h \
- gl2paintengineex/qglshader_p.h \
- gl2paintengineex/qgl2pexvertexarray_p.h \
- gl2paintengineex/qpaintengineex_opengl2_p.h
}
-
x11 {
contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles1cl)|contains(QT_CONFIG, opengles2) {
SOURCES += qgl_x11egl.cpp \
diff --git a/src/opengl/qegl.cpp b/src/opengl/qegl.cpp
index 165a0f3..f1ae4ed 100644
--- a/src/opengl/qegl.cpp
+++ b/src/opengl/qegl.cpp
@@ -119,7 +119,7 @@ bool QEglContext::chooseConfig
if (red == props.value(EGL_RED_SIZE) &&
green == props.value(EGL_GREEN_SIZE) &&
blue == props.value(EGL_BLUE_SIZE) &&
- (props.value(EGL_ALPHA_SIZE) == EGL_DONT_CARE ||
+ (props.value(EGL_ALPHA_SIZE) == 0 ||
alpha == props.value(EGL_ALPHA_SIZE))) {
cfg = configs[index];
delete [] configs;
@@ -405,7 +405,54 @@ int QEglProperties::value(int name) const
if (props[index] == name)
return props[index + 1];
}
- return EGL_DONT_CARE;
+
+ // If the attribute has not been explicitly set, return the EGL default
+ // The following defaults were taken from the EGL 1.4 spec:
+ switch(name) {
+ case EGL_BUFFER_SIZE: return 0;
+ case EGL_RED_SIZE: return 0;
+ case EGL_GREEN_SIZE: return 0;
+ case EGL_BLUE_SIZE: return 0;
+ case EGL_LUMINANCE_SIZE: return 0;
+ case EGL_ALPHA_SIZE: return 0;
+ case EGL_ALPHA_MASK_SIZE: return 0;
+ case EGL_BIND_TO_TEXTURE_RGB: return EGL_DONT_CARE;
+ case EGL_BIND_TO_TEXTURE_RGBA: return EGL_DONT_CARE;
+ case EGL_COLOR_BUFFER_TYPE: return EGL_RGB_BUFFER;
+ case EGL_CONFIG_CAVEAT: return EGL_DONT_CARE;
+ case EGL_CONFIG_ID: return EGL_DONT_CARE;
+ case EGL_DEPTH_SIZE: return 0;
+ case EGL_LEVEL: return 0;
+ case EGL_NATIVE_RENDERABLE: return EGL_DONT_CARE;
+ case EGL_NATIVE_VISUAL_TYPE: return EGL_DONT_CARE;
+ case EGL_MAX_SWAP_INTERVAL: return EGL_DONT_CARE;
+ case EGL_MIN_SWAP_INTERVAL: return EGL_DONT_CARE;
+ case EGL_RENDERABLE_TYPE: return EGL_OPENGL_ES_BIT;
+ case EGL_SAMPLE_BUFFERS: return 0;
+ case EGL_SAMPLES: return 0;
+ case EGL_STENCIL_SIZE: return 0;
+ case EGL_SURFACE_TYPE: return EGL_WINDOW_BIT;
+ case EGL_TRANSPARENT_TYPE: return EGL_NONE;
+ case EGL_TRANSPARENT_RED_VALUE: return EGL_DONT_CARE;
+ case EGL_TRANSPARENT_GREEN_VALUE: return EGL_DONT_CARE;
+ case EGL_TRANSPARENT_BLUE_VALUE: return EGL_DONT_CARE;
+
+#if defined(EGL_VERSION_1_3)
+ case EGL_CONFORMANT: return 0;
+ case EGL_MATCH_NATIVE_PIXMAP: return EGL_NONE;
+#endif
+
+ case EGL_MAX_PBUFFER_HEIGHT:
+ case EGL_MAX_PBUFFER_WIDTH:
+ case EGL_MAX_PBUFFER_PIXELS:
+ case EGL_NATIVE_VISUAL_ID:
+ case EGL_NONE:
+ qWarning("QEglProperties::value() - Attibute %d does not affect config selection", name);
+ return EGL_DONT_CARE;
+ default:
+ qWarning("QEglProperties::value() - Attibute %d is unknown in EGL <=1.4", name);
+ return EGL_DONT_CARE;
+ }
}
// Set the value associated with a property, replacing an existing
@@ -535,7 +582,7 @@ QString QEglProperties::toString() const
if (val != EGL_DONT_CARE) {
str += QLatin1String("id=");
str += QString::number(val);
- str += QLatin1String(" ");
+ str += QLatin1Char(' ');
}
#ifdef EGL_RENDERABLE_TYPE
@@ -570,11 +617,11 @@ QString QEglProperties::toString() const
bufferSize = EGL_DONT_CARE;
str += QLatin1String(" rgba=");
str += QString::number(red);
- str += QLatin1String(",");
+ str += QLatin1Char(',');
str += QString::number(green);
- str += QLatin1String(",");
+ str += QLatin1Char(',');
str += QString::number(blue);
- str += QLatin1String(",");
+ str += QLatin1Char(',');
str += QString::number(alpha);
if (bufferSize != EGL_DONT_CARE) {
// Only report buffer size if different than r+g+b+a.
@@ -593,13 +640,13 @@ QString QEglProperties::toString() const
#endif
val = value(EGL_DEPTH_SIZE);
- if (val != EGL_DONT_CARE) {
+ if (val != 0) {
addTag(str, QLatin1String(" depth="));
str += QString::number(val);
}
val = value(EGL_STENCIL_SIZE);
- if (val != EGL_DONT_CARE) {
+ if (val != 0) {
addTag(str, QLatin1String(" stencil="));
str += QString::number(val);
}
@@ -649,7 +696,7 @@ QString QEglProperties::toString() const
}
val = value(EGL_LEVEL);
- if (val != EGL_DONT_CARE) {
+ if (val != 0) {
addTag(str, QLatin1String(" level="));
str += QString::number(val);
}
@@ -661,7 +708,7 @@ QString QEglProperties::toString() const
if (height != EGL_DONT_CARE || width != EGL_DONT_CARE) {
addTag(str, QLatin1String(" max-pbuffer-size="));
str += QString::number(width);
- str += QLatin1String("x");
+ str += QLatin1Char('x');
str += QString::number(height);
if (pixels != (width * height)) {
addTag(str, QLatin1String(" max-pbuffer-pixels="));
@@ -700,13 +747,13 @@ QString QEglProperties::toString() const
#endif
val = value(EGL_SAMPLES);
- if (val != EGL_DONT_CARE) {
+ if (val != 0) {
addTag(str, QLatin1String(" samples="));
str += QString::number(val);
}
val = value(EGL_SAMPLE_BUFFERS);
- if (val != EGL_DONT_CARE) {
+ if (val != 0) {
addTag(str, QLatin1String(" sample-buffers="));
str += QString::number(val);
}
@@ -715,9 +762,9 @@ QString QEglProperties::toString() const
if (val == EGL_TRANSPARENT_RGB) {
addTag(str, QLatin1String(" transparent-rgb="));
str += QString::number(value(EGL_TRANSPARENT_RED_VALUE));
- str += QLatin1String(",");
+ str += QLatin1Char(',');
str += QString::number(value(EGL_TRANSPARENT_GREEN_VALUE));
- str += QLatin1String(",");
+ str += QLatin1Char(',');
str += QString::number(value(EGL_TRANSPARENT_BLUE_VALUE));
}
@@ -755,7 +802,7 @@ QString QEglProperties::toString() const
#ifdef EGL_LUMINANCE_SIZE
val = value(EGL_LUMINANCE_SIZE);
- if (val != EGL_DONT_CARE) {
+ if (val != 0) {
addTag(str, QLatin1String(" luminance="));
str += QString::number(val);
}
@@ -763,7 +810,7 @@ QString QEglProperties::toString() const
#ifdef EGL_ALPHA_MASK_SIZE
val = value(EGL_ALPHA_MASK_SIZE);
- if (val != EGL_DONT_CARE) {
+ if (val != 0) {
addTag(str, QLatin1String(" alpha-mask="));
str += QString::number(val);
}
@@ -771,7 +818,7 @@ QString QEglProperties::toString() const
#ifdef EGL_CONFORMANT
val = value(EGL_CONFORMANT);
- if (val != EGL_DONT_CARE) {
+ if (val != 0) {
if (val)
addTag(str, QLatin1String(" conformant=true"));
else
diff --git a/src/opengl/qegl_x11egl.cpp b/src/opengl/qegl_x11egl.cpp
index 8efe7e7..c703900 100644
--- a/src/opengl/qegl_x11egl.cpp
+++ b/src/opengl/qegl_x11egl.cpp
@@ -42,6 +42,7 @@
#include <QtGui/qpaintdevice.h>
#include <QtGui/qpixmap.h>
#include <QtGui/qwidget.h>
+#include <QtCore/qdebug.h>
#include "qegl_p.h"
#if defined(QT_OPENGL_ES) || defined(QT_OPENVG)
@@ -80,8 +81,10 @@ bool QEglContext::createSurface(QPaintDevice *device)
surf = eglCreateWindowSurface(dpy, cfg, windowDrawable, 0);
else
surf = eglCreatePixmapSurface(dpy, cfg, pixmapDrawable, 0);
+
if (surf == EGL_NO_SURFACE) {
- qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
+ qWarning() << "QEglContext::createSurface(): Unable to create EGL surface:"
+ << errorString(eglGetError());
return false;
}
return true;
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index a534cc5..60039eb 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -65,15 +65,20 @@
#include "qimage.h"
#include "qgl_p.h"
-#if defined(QT_OPENGL_ES_2)
#include "gl2paintengineex/qpaintengineex_opengl2_p.h"
-#else
+
+#ifndef QT_OPENGL_ES_2
#include <private/qpaintengine_opengl_p.h>
#endif
+#include <qglpixelbuffer.h>
+#include <qglframebufferobject.h>
+
#include <private/qimage_p.h>
#include <private/qpixmapdata_p.h>
#include <private/qpixmapdata_gl_p.h>
+#include <private/qglpixelbuffer_p.h>
+#include <private/qwindowsurface_gl_p.h>
#include "qcolormap.h"
#include "qcache.h"
#include "qfile.h"
@@ -1290,6 +1295,7 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format)
eglContext = 0;
#endif
pbo = 0;
+ fbo = 0;
crWin = false;
initDone = false;
sharing = false;
@@ -1298,6 +1304,7 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format)
version_flags_cached = false;
version_flags = QGLFormat::OpenGL_Version_None;
current_fbo = 0;
+ active_engine = 0;
}
QGLContext* QGLContext::currentCtx = 0;
@@ -1308,12 +1315,8 @@ QGLContext* QGLContext::currentCtx = 0;
QGLFramebufferObject::toImage()
*/
-QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha)
+static void convertFromGLImage(QImage &img, int w, int h, bool alpha_format, bool include_alpha)
{
- QImage img(size, alpha_format ? QImage::Format_ARGB32 : QImage::Format_RGB32);
- int w = size.width();
- int h = size.height();
- glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
// OpenGL gives RGBA; Qt wants ARGB
uint *p = (uint*)img.bits();
@@ -1344,7 +1347,30 @@ QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include
}
}
- return img.mirrored();
+ img = img.mirrored();
+}
+
+QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha)
+{
+ QImage img(size, alpha_format ? QImage::Format_ARGB32 : QImage::Format_RGB32);
+ int w = size.width();
+ int h = size.height();
+ glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
+ convertFromGLImage(img, w, h, alpha_format, include_alpha);
+ return img;
+}
+
+QImage qt_gl_read_texture(const QSize &size, bool alpha_format, bool include_alpha)
+{
+ QImage img(size, alpha_format ? QImage::Format_ARGB32 : QImage::Format_RGB32);
+ int w = size.width();
+ int h = size.height();
+#if !defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ //### glGetTexImage not in GL ES 2.0, need to do something else here!
+ glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
+#endif
+ convertFromGLImage(img, w, h, alpha_format, include_alpha);
+ return img;
}
// returns the highest number closest to v, which is a power of 2
@@ -1548,7 +1574,7 @@ void QGLContextPrivate::cleanup()
Q_Q(QGLContext);
if (pbo) {
QGLContext *ctx = q;
- glDeleteBuffersARB(1, &pbo);
+ glDeleteBuffers(1, &pbo);
pbo = 0;
}
}
@@ -1813,7 +1839,7 @@ GLuint QGLContextPrivate::bindTexture(const QImage &image, GLenum target, GLint
use_pbo = qt_resolve_buffer_extensions(ctx);
if (use_pbo && pbo == 0)
- glGenBuffersARB(1, &pbo);
+ glGenBuffers(1, &pbo);
}
// the GL_BGRA format is only present in GL version >= 1.2
@@ -1864,8 +1890,8 @@ GLuint QGLContextPrivate::bindTexture(const QImage &image, GLenum target, GLint
uchar *ptr = 0;
if (use_pbo) {
- glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pbo);
- glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, img.width() * img.height() * 4, 0, GL_STREAM_DRAW_ARB);
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo);
+ glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, img.width() * img.height() * 4, 0, GL_STREAM_DRAW_ARB);
ptr = reinterpret_cast<uchar *>(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY_ARB));
}
@@ -1892,7 +1918,7 @@ GLuint QGLContextPrivate::bindTexture(const QImage &image, GLenum target, GLint
}
if (use_pbo)
- glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
// this assumes the size of a texture is always smaller than the max cache size
int cost = img.width()*img.height()*4/1024;
@@ -1944,11 +1970,13 @@ GLuint QGLContextPrivate::bindTexture(const QImage &image, GLenum target, GLint
/*! \internal */
GLuint QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, GLint format, bool clean)
{
-#if !defined(QT_OPENGL_ES_2)
- if (target == qt_gl_preferredTextureTarget() && pixmap.pixmapData()->classId() == QPixmapData::OpenGLClass) {
- const QGLPixmapData *data = static_cast<const QGLPixmapData *>(pixmap.pixmapData());
+ Q_Q(QGLContext);
+ QPixmapData *pd = pixmap.pixmapData();
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ if (target == GL_TEXTURE_2D && pd->classId() == QPixmapData::OpenGLClass) {
+ const QGLPixmapData *data = static_cast<const QGLPixmapData *>(pd);
- if (data->isValidContext(QGLContext::currentContext()))
+ if (data->isValidContext(q))
return data->bind();
}
#endif
@@ -2100,12 +2128,34 @@ void QGLContext::deleteTexture(QMacCompatGLuint id)
}
#endif
-// qpaintengine_opengl.cpp
-#if !defined(QT_OPENGL_ES_2)
-extern void qt_add_rect_to_array(const QRectF &r, q_vertexType *array);
-#else
-void qt_add_rect_to_array(const QRectF &r, q_vertexType *array) {};
-#endif
+void qt_add_rect_to_array(const QRectF &r, q_vertexType *array)
+{
+ qreal left = r.left();
+ qreal right = r.right();
+ qreal top = r.top();
+ qreal bottom = r.bottom();
+
+ array[0] = f2vt(left);
+ array[1] = f2vt(top);
+ array[2] = f2vt(right);
+ array[3] = f2vt(top);
+ array[4] = f2vt(right);
+ array[5] = f2vt(bottom);
+ array[6] = f2vt(left);
+ array[7] = f2vt(bottom);
+}
+
+void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, q_vertexType *array)
+{
+ array[0] = f2vt(x1);
+ array[1] = f2vt(y1);
+ array[2] = f2vt(x2);
+ array[3] = f2vt(y1);
+ array[4] = f2vt(x2);
+ array[5] = f2vt(y2);
+ array[6] = f2vt(x1);
+ array[7] = f2vt(y2);
+}
static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint textureHeight, GLenum textureTarget)
{
@@ -2558,6 +2608,42 @@ const QGLContext* QGLContext::currentContext()
visual. On other platforms it may work differently.
*/
+/*! \fn int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc)
+
+ \bold{Win32 only:} This virtual function chooses a pixel format
+ that matches the OpenGL \link setFormat() format\endlink.
+ Reimplement this function in a subclass if you need a custom
+ context.
+
+ \warning The \a dummyPfd pointer and \a pdc are used as a \c
+ PIXELFORMATDESCRIPTOR*. We use \c void to avoid using
+ Windows-specific types in our header files.
+
+ \sa chooseContext()
+*/
+
+/*! \fn void *QGLContext::chooseVisual()
+
+ \bold{X11 only:} This virtual function tries to find a visual that
+ matches the format, reducing the demands if the original request
+ cannot be met.
+
+ The algorithm for reducing the demands of the format is quite
+ simple-minded, so override this method in your subclass if your
+ application has spcific requirements on visual selection.
+
+ \sa chooseContext()
+*/
+
+/*! \fn void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth)
+ \internal
+
+ \bold{X11 only:} This virtual function chooses a visual that matches
+ the OpenGL \link format() format\endlink. Reimplement this function
+ in a subclass if you need a custom visual.
+
+ \sa chooseContext()
+*/
/*!
\fn void QGLContext::reset()
@@ -3074,11 +3160,10 @@ void QGLWidget::setFormat(const QGLFormat &format)
*/
/*
- \obsolete
-
\fn void QGLWidget::setContext(QGLContext *context,
- const QGLContext* shareContext,
- bool deleteOldContext)
+ const QGLContext* shareContext,
+ bool deleteOldContext)
+ \obsolete
Sets a new context for this widget. The QGLContext \a context must
be created using \e new. QGLWidget will delete \a context when
@@ -3228,9 +3313,10 @@ void QGLWidget::resizeOverlayGL(int, int)
{
}
-
+/*! \fn bool QGLWidget::event(QEvent *e)
+ \reimp
+*/
#if !defined(Q_OS_WINCE) && !defined(Q_WS_QWS)
-/*! \reimp */
bool QGLWidget::event(QEvent *e)
{
Q_D(QGLWidget);
@@ -3256,7 +3342,7 @@ bool QGLWidget::event(QEvent *e)
glFinish();
doneCurrent();
} else if (e->type() == QEvent::ParentChange) {
- if (d->glcx->d_func()->screen != d->xinfo.screen()) {
+ if (d->glcx->d_func()->screen != d->xinfo.screen() || testAttribute(Qt::WA_TranslucentBackground)) {
setContext(new QGLContext(d->glcx->requestedFormat(), this));
// ### recreating the overlay isn't supported atm
}
@@ -4112,14 +4198,16 @@ void QGLWidget::drawTexture(const QPointF &point, QMacCompatGLuint textureId, QM
}
#endif
-#if defined(QT_OPENGL_ES_2)
-Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_engine)
-#else
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_2_engine)
+#endif
+
+#ifndef QT_OPENGL_ES_2
Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_engine)
#endif
#ifdef Q_WS_QWS
-Q_OPENGL_EXPORT QOpenGLPaintEngine* qt_qgl_paint_engine()
+Q_OPENGL_EXPORT QPaintEngine* qt_qgl_paint_engine()
{
#if !defined(QT_OPENGL_ES_2)
return qt_gl_engine();
@@ -4137,7 +4225,16 @@ Q_OPENGL_EXPORT QOpenGLPaintEngine* qt_qgl_paint_engine()
*/
QPaintEngine *QGLWidget::paintEngine() const
{
+#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
return qt_gl_engine();
+#elif defined(QT_OPENGL_ES_2)
+ return qt_gl_2_engine();
+#else
+ if (!qt_gl_preferGL2Engine())
+ return qt_gl_engine();
+ else
+ return qt_gl_2_engine();
+#endif
}
#ifdef QT3_SUPPORT
@@ -4226,6 +4323,8 @@ void QGLExtensions::init_extensions()
glExtensions |= FramebufferObject;
glExtensions |= GenerateMipmap;
#endif
+ if (extensions.contains(QLatin1String("EXT_framebuffer_blit")))
+ glExtensions |= FramebufferBlit;
QGLContext cx(QGLFormat::defaultFormat());
if (glExtensions & TextureCompression) {
@@ -4266,7 +4365,7 @@ Q_OPENGL_EXPORT const QString qt_gl_library_name()
{
if (qt_gl_lib_name()->isNull()) {
#if defined(Q_WS_X11) || defined(Q_WS_QWS)
- return QString(QLatin1String("GL"));
+ return QLatin1String("GL");
#else // Q_WS_MAC
return QLatin1String("/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib");
#endif
@@ -4275,4 +4374,226 @@ Q_OPENGL_EXPORT const QString qt_gl_library_name()
}
#endif
+void QGLDrawable::setDevice(QPaintDevice *pdev)
+{
+ wasBound = false;
+ widget = 0;
+ buffer = 0;
+ fbo = 0;
+#ifdef Q_WS_QWS
+ wsurf = 0;
+#endif
+
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ if (pdev->devType() == QInternal::Pixmap) {
+ QPixmapData *data = static_cast<QPixmap *>(pdev)->pixmapData();
+ Q_ASSERT(data->classId() == QPixmapData::OpenGLClass);
+ pixmapData = static_cast<QGLPixmapData *>(data);
+
+ fbo = pixmapData->fbo();
+ }
+#else
+ Q_ASSERT(pdev->devType() != QInternal::Pixmap);
+#endif
+
+ if (pdev->devType() == QInternal::Widget)
+ widget = static_cast<QGLWidget *>(pdev);
+ else if (pdev->devType() == QInternal::Pbuffer)
+ buffer = static_cast<QGLPixelBuffer *>(pdev);
+ else if (pdev->devType() == QInternal::FramebufferObject)
+ fbo = static_cast<QGLFramebufferObject *>(pdev);
+#ifdef Q_WS_QWS
+ else if (pdev->devType() == QInternal::UnknownDevice)
+ wsurf = static_cast<QWSGLPaintDevice*>(pdev)->windowSurface();
+#elif !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ else if (pdev->devType() == QInternal::UnknownDevice)
+ wsurf = static_cast<QGLWindowSurface *>(pdev);
+#endif
+}
+
+void QGLDrawable::swapBuffers()
+{
+ if (widget) {
+ if (widget->autoBufferSwap())
+ widget->swapBuffers();
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ } else if (pixmapData) {
+ pixmapData->swapBuffers();
+#endif
+ } else {
+ glFlush();
+ }
+}
+
+void QGLDrawable::makeCurrent()
+{
+ previous_fbo = 0;
+ if (!pixmapData && !fbo) {
+ QGLContext *ctx = context();
+ previous_fbo = ctx->d_ptr->current_fbo;
+ ctx->d_ptr->current_fbo = 0;
+ if (previous_fbo)
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
+ }
+
+ if (widget)
+ widget->makeCurrent();
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ else if (pixmapData)
+ pixmapData->makeCurrent();
+#endif
+ else if (buffer)
+ buffer->makeCurrent();
+#if defined(Q_WS_QWS) || (!defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL))
+ else if (wsurf)
+ wsurf->context()->makeCurrent();
+#endif
+ else if (fbo) {
+ wasBound = fbo->isBound();
+ if (!wasBound)
+ fbo->bind();
+ }
+}
+
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+QGLPixmapData *QGLDrawable::copyOnBegin() const
+{
+ if (!pixmapData || pixmapData->isUninitialized())
+ return 0;
+ return pixmapData;
+}
+#endif
+
+void QGLDrawable::doneCurrent()
+{
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ if (pixmapData) {
+ pixmapData->doneCurrent();
+ return;
+ }
+#endif
+
+ if (previous_fbo) {
+ QGLContext *ctx = context();
+ ctx->d_ptr->current_fbo = previous_fbo;
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, previous_fbo);
+ }
+
+ if (fbo && !wasBound)
+ fbo->release();
+}
+
+QSize QGLDrawable::size() const
+{
+ if (widget) {
+ return QSize(widget->d_func()->glcx->device()->width(),
+ widget->d_func()->glcx->device()->height());
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ } else if (pixmapData) {
+ return pixmapData->size();
+#endif
+ } else if (buffer) {
+ return buffer->size();
+ } else if (fbo) {
+ return fbo->size();
+ }
+#ifdef Q_WS_QWS
+ else if (wsurf)
+ return wsurf->window()->frameSize();
+#elif !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ else if (wsurf)
+ return QSize(wsurf->width(), wsurf->height());
+#endif
+ return QSize();
+}
+
+QGLFormat QGLDrawable::format() const
+{
+ if (widget)
+ return widget->format();
+ else if (buffer)
+ return buffer->format();
+#if defined(Q_WS_QWS) || (!defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL))
+ else if (wsurf)
+ return wsurf->context()->format();
+#endif
+ else if (fbo && QGLContext::currentContext()) {
+ QGLFormat fmt = QGLContext::currentContext()->format();
+ fmt.setStencil(fbo->attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ fmt.setDepth(fbo->attachment() != QGLFramebufferObject::NoAttachment);
+ return fmt;
+ }
+
+ return QGLFormat();
+}
+
+GLuint QGLDrawable::bindTexture(const QImage &image, GLenum target, GLint format)
+{
+ if (widget)
+ return widget->d_func()->glcx->d_func()->bindTexture(image, target, format, true);
+ else if (buffer)
+ return buffer->d_func()->qctx->d_func()->bindTexture(image, target, format, true);
+ else if (fbo && QGLContext::currentContext())
+ return const_cast<QGLContext *>(QGLContext::currentContext())->d_func()->bindTexture(image, target, format, true);
+#if defined(Q_WS_QWS) || (!defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL))
+ else if (wsurf)
+ return wsurf->context()->d_func()->bindTexture(image, target, format, true);
+#endif
+ return 0;
+}
+
+GLuint QGLDrawable::bindTexture(const QPixmap &pixmap, GLenum target, GLint format)
+{
+ if (widget)
+ return widget->d_func()->glcx->d_func()->bindTexture(pixmap, target, format, true);
+ else if (buffer)
+ return buffer->d_func()->qctx->d_func()->bindTexture(pixmap, target, format, true);
+ else if (fbo && QGLContext::currentContext())
+ return const_cast<QGLContext *>(QGLContext::currentContext())->d_func()->bindTexture(pixmap, target, format, true);
+#if defined(Q_WS_QWS) || (!defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL))
+ else if (wsurf)
+ return wsurf->context()->d_func()->bindTexture(pixmap, target, format, true);
+#endif
+ return 0;
+}
+
+QColor QGLDrawable::backgroundColor() const
+{
+ if (widget)
+ return widget->palette().brush(widget->backgroundRole()).color();
+ else if (pixmapData)
+ return pixmapData->fillColor();
+ return QApplication::palette().brush(QPalette::Background).color();
+}
+
+bool QGLDrawable::hasTransparentBackground() const
+{
+ return widget && widget->testAttribute(Qt::WA_TranslucentBackground);
+}
+
+QGLContext *QGLDrawable::context() const
+{
+ if (widget)
+ return widget->d_func()->glcx;
+ else if (buffer)
+ return buffer->d_func()->qctx;
+ else if (fbo)
+ return const_cast<QGLContext *>(QGLContext::currentContext());
+#if defined(Q_WS_QWS) || (!defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL))
+ else if (wsurf)
+ return wsurf->context();
+#endif
+ return 0;
+}
+
+bool QGLDrawable::autoFillBackground() const
+{
+ if (widget)
+ return widget->autoFillBackground();
+ else if (pixmapData)
+ return pixmapData->needsFill();
+ else
+ return false;
+}
+
QT_END_NAMESPACE
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index 32fbce2..19d779a 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -372,8 +372,8 @@ private:
friend QGLContextPrivate *qt_phonon_get_dptr(const QGLContext *);
#endif
friend class QGLFramebufferObject;
-#ifdef Q_WS_WIN
friend class QGLFramebufferObjectPrivate;
+#ifdef Q_WS_WIN
friend bool qt_resolve_GLSL_functions(QGLContext *ctx);
friend bool qt_createGLSLProgram(QGLContext *ctx, GLuint &program, const char *shader_src, GLuint &shader);
#endif
diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index 98c5710..287c537 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -57,14 +57,14 @@ void qt_egl_set_format(QEglProperties& props, int deviceType, const QGLFormat& f
// Set the pixel format to that contained in the QGLFormat
// if the system hasn't already chosen a fixed format to
// match the pixmap, widget, etc.
- if (props.value(EGL_RED_SIZE) == EGL_DONT_CARE || f.redBufferSize() != -1)
+ if (props.value(EGL_RED_SIZE) == 0 || f.redBufferSize() != -1)
props.setValue(EGL_RED_SIZE, f.redBufferSize() == -1 ? 1 : f.redBufferSize());
- if (props.value(EGL_GREEN_SIZE) == EGL_DONT_CARE || f.greenBufferSize() != -1)
+ if (props.value(EGL_GREEN_SIZE) == 0 || f.greenBufferSize() != -1)
props.setValue(EGL_GREEN_SIZE, f.greenBufferSize() == -1 ? 1 : f.greenBufferSize());
- if (props.value(EGL_BLUE_SIZE) == EGL_DONT_CARE || f.blueBufferSize() != -1)
+ if (props.value(EGL_BLUE_SIZE) == 0 || f.blueBufferSize() != -1)
props.setValue(EGL_BLUE_SIZE, f.blueBufferSize() == -1 ? 1 : f.blueBufferSize());
if (f.alpha()) {
- if (props.value(EGL_ALPHA_SIZE) == EGL_DONT_CARE || f.alphaBufferSize() != -1)
+ if (props.value(EGL_ALPHA_SIZE) == 0 || f.alphaBufferSize() != -1)
props.setValue(EGL_ALPHA_SIZE, f.alphaBufferSize() == -1 ? 1 : f.alphaBufferSize());
}
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 1214f20..b1a63b5 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -61,6 +61,10 @@
#include "QtCore/qhash.h"
#include "private/qwidget_p.h"
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+#include "private/qpixmapdata_gl_p.h"
+#endif
+
#ifndef QT_OPENGL_ES_1_CL
#define q_vertexType float
#define q_vertexTypeEnum GL_FLOAT
@@ -239,6 +243,7 @@ public:
QGLFormat glFormat;
QGLFormat reqFormat;
GLuint pbo;
+ GLuint fbo;
uint valid : 1;
uint sharing : 1;
@@ -256,6 +261,7 @@ public:
GLint max_texture_size;
GLuint current_fbo;
+ QPaintEngine *active_engine;
#ifdef Q_WS_WIN
static inline QGLExtensionFuncs& qt_get_extension_funcs(const QGLContext *ctx) { return ctx->d_ptr->extensionFuncs; }
@@ -283,6 +289,54 @@ Q_SIGNALS:
void aboutToDestroyContext(const QGLContext *context);
};
+class QGLPixelBuffer;
+class QGLFramebufferObject;
+class QWSGLWindowSurface;
+class QGLWindowSurface;
+class QGLDrawable {
+public:
+ QGLDrawable() : widget(0), buffer(0), fbo(0)
+#if defined(Q_WS_QWS) || (!defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL))
+ , wsurf(0)
+#endif
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ , pixmapData(0)
+#endif
+ {}
+ void setDevice(QPaintDevice *pdev);
+ void swapBuffers();
+ void makeCurrent();
+ void doneCurrent();
+ QSize size() const;
+ QGLFormat format() const;
+ GLuint bindTexture(const QImage &image, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA);
+ GLuint bindTexture(const QPixmap &pixmap, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA);
+ QColor backgroundColor() const;
+ QGLContext *context() const;
+ bool autoFillBackground() const;
+ bool hasTransparentBackground() const;
+
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ QGLPixmapData *copyOnBegin() const;
+#endif
+
+private:
+ bool wasBound;
+ QGLWidget *widget;
+ QGLPixelBuffer *buffer;
+ QGLFramebufferObject *fbo;
+#ifdef Q_WS_QWS
+ QWSGLWindowSurface *wsurf;
+#elif !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ QGLWindowSurface *wsurf;
+#endif
+
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+ QGLPixmapData *pixmapData;
+#endif
+ int previous_fbo;
+};
+
// GL extension definitions
class QGLExtensions {
public:
@@ -298,7 +352,8 @@ public:
StencilWrap = 0x00000100,
PackedDepthStencil = 0x00000200,
NVFloatBuffer = 0x00000400,
- PixelBufferObject = 0x00000800
+ PixelBufferObject = 0x00000800,
+ FramebufferBlit = 0x00001000
};
Q_DECLARE_FLAGS(Extensions, Extension)
@@ -379,6 +434,16 @@ extern QOpenGLPaintEngine* qt_qgl_paint_engine();
extern EGLDisplay qt_qgl_egl_display();
#endif
+inline bool qt_gl_preferGL2Engine()
+{
+#if defined(QT_OPENGL_ES_2)
+ return true;
+#else
+ return (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0)
+ && !qgetenv("QT_GL_USE_OPENGL2ENGINE").isEmpty();
+#endif
+}
+
inline GLenum qt_gl_preferredTextureFormat()
{
return QSysInfo::ByteOrder == QSysInfo::BigEndian ? GL_RGBA : GL_BGRA;
@@ -386,12 +451,16 @@ inline GLenum qt_gl_preferredTextureFormat()
inline GLenum qt_gl_preferredTextureTarget()
{
+#if defined(QT_OPENGL_ES_2)
+ return GL_TEXTURE_2D;
+#else
return (QGLExtensions::glExtensions & QGLExtensions::TextureRectangle)
+ && !qt_gl_preferGL2Engine()
? GL_TEXTURE_RECTANGLE_NV
: GL_TEXTURE_2D;
+#endif
}
-
QT_END_NAMESPACE
#endif // QGL_P_H
diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp
index bd8569a..217b0fc 100644
--- a/src/opengl/qgl_win.cpp
+++ b/src/opengl/qgl_win.cpp
@@ -884,19 +884,9 @@ static bool qLogEq(bool a, bool b)
return (((!a) && (!b)) || (a && b));
}
-/*!
- \bold{Win32 only:} This virtual function chooses a pixel
- format that matches the OpenGL \link setFormat() format\endlink.
- Reimplement this function in a subclass if you need a custom
- context.
-
- \warning The \a dummyPfd pointer and \a pdc are used as a \c
- PIXELFORMATDESCRIPTOR*. We use \c void to avoid using
- Windows-specific types in our header files.
-
- \sa chooseContext()
-*/
-
+/*
+ See qgl.cpp for qdoc comment.
+ */
int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc)
{
Q_D(QGLContext);
diff --git a/src/opengl/qgl_wince.cpp b/src/opengl/qgl_wince.cpp
index cb51598..7429071 100644
--- a/src/opengl/qgl_wince.cpp
+++ b/src/opengl/qgl_wince.cpp
@@ -552,9 +552,6 @@ void QGLWidgetPrivate::updateColormap()
ReleaseDC(q->winId(), hdc);
}
-/*!
- \reimp
-\*/
bool QGLWidget::event(QEvent *e)
{
Q_D(QGLWidget);
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index 28c34de..28a50bd 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -433,7 +433,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
if (!d->gpm)
return false;
}
- QString glxExt = QString(QLatin1String(glXGetClientString(QX11Info::display(), GLX_EXTENSIONS)));
+ QString glxExt = QLatin1String(glXGetClientString(QX11Info::display(), GLX_EXTENSIONS));
if (glxExt.contains(QLatin1String("GLX_SGI_video_sync"))) {
if (d->glFormat.swapInterval() == -1)
d->glFormat.setSwapInterval(0);
@@ -443,19 +443,9 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
return true;
}
-
-/*!
- \bold{X11 only:} This virtual function tries to find a
- visual that matches the format, reducing the demands if the original
- request cannot be met.
-
- The algorithm for reducing the demands of the format is quite
- simple-minded, so override this method in your subclass if your
- application has spcific requirements on visual selection.
-
- \sa chooseContext()
-*/
-
+/*
+ See qgl.cpp for qdoc comment.
+ */
void *QGLContext::chooseVisual()
{
Q_D(QGLContext);
@@ -519,25 +509,28 @@ void *QGLContext::chooseVisual()
return vis;
}
-
-/*!
- \internal
-
- \bold{X11 only:} This virtual function chooses a visual
- that matches the OpenGL \link format() format\endlink. Reimplement this
- function in a subclass if you need a custom visual.
-
- \sa chooseContext()
-*/
-
+/*
+ See qgl.cpp for qdoc comment.
+ */
void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth)
{
Q_D(QGLContext);
- int spec[40];
+ int spec[45];
int i = 0;
spec[i++] = GLX_LEVEL;
spec[i++] = f.plane();
const QX11Info *xinfo = qt_x11Info(d->paintDevice);
+ bool useFBConfig = false;
+
+#if defined(GLX_VERSION_1_3) && !defined(QT_NO_XRENDER)
+ QWidget* widget = 0;
+ if (d->paintDevice->devType() == QInternal::Widget)
+ widget = static_cast<QWidget*>(d->paintDevice);
+
+ // Only use glXChooseFBConfig for widgets if we're trying to get an ARGB visual
+ if (widget && widget->testAttribute(Qt::WA_TranslucentBackground) && X11->use_xrender)
+ useFBConfig = true;
+#endif
#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_info)
static bool useTranspExt = false;
@@ -565,28 +558,41 @@ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth)
useTranspExtChecked = true;
}
- if (f.plane() && useTranspExt) {
+ if (f.plane() && useTranspExt && !useFBConfig) {
// Required to avoid non-transparent overlay visual(!) on some systems
spec[i++] = GLX_TRANSPARENT_TYPE_EXT;
spec[i++] = f.rgba() ? GLX_TRANSPARENT_RGB_EXT : GLX_TRANSPARENT_INDEX_EXT;
}
#endif
+#if defined(GLX_VERSION_1_3)
+ // GLX_RENDER_TYPE is only in glx >=1.3
+ if (useFBConfig) {
+ spec[i++] = GLX_RENDER_TYPE;
+ spec[i++] = f.rgba() ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
+ }
+#endif
+
if (f.doubleBuffer())
spec[i++] = GLX_DOUBLEBUFFER;
+ if (useFBConfig)
+ spec[i++] = True;
if (f.depth()) {
spec[i++] = GLX_DEPTH_SIZE;
spec[i++] = f.depthBufferSize() == -1 ? 1 : f.depthBufferSize();
}
if (f.stereo()) {
spec[i++] = GLX_STEREO;
+ if (useFBConfig)
+ spec[i++] = True;
}
if (f.stencil()) {
spec[i++] = GLX_STENCIL_SIZE;
spec[i++] = f.stencilBufferSize() == -1 ? 1 : f.stencilBufferSize();
}
if (f.rgba()) {
- spec[i++] = GLX_RGBA;
+ if (!useFBConfig)
+ spec[i++] = GLX_RGBA;
spec[i++] = GLX_RED_SIZE;
spec[i++] = f.redBufferSize() == -1 ? 1 : f.redBufferSize();
spec[i++] = GLX_GREEN_SIZE;
@@ -621,8 +627,86 @@ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth)
spec[i++] = f.samples() == -1 ? 4 : f.samples();
}
+#if defined(GLX_VERSION_1_3)
+ if (useFBConfig) {
+ spec[i++] = GLX_DRAWABLE_TYPE;
+ switch(d->paintDevice->devType()) {
+ case QInternal::Pixmap:
+ spec[i++] = GLX_PIXMAP_BIT;
+ break;
+ case QInternal::Pbuffer:
+ spec[i++] = GLX_PBUFFER_BIT;
+ break;
+ default:
+ qWarning("QGLContext: Unknown paint device type %d", d->paintDevice->devType());
+ // Fall-through & assume it's a window
+ case QInternal::Widget:
+ spec[i++] = GLX_WINDOW_BIT;
+ break;
+ };
+ }
+#endif
+
spec[i] = XNone;
- return glXChooseVisual(xinfo->display(), xinfo->screen(), spec);
+
+
+ XVisualInfo* chosenVisualInfo = 0;
+
+#if defined(GLX_VERSION_1_3)
+ while (useFBConfig) {
+ GLXFBConfig *configs;
+ int configCount = 0;
+ configs = glXChooseFBConfig(xinfo->display(), xinfo->screen(), spec, &configCount);
+
+ if (!configs)
+ break; // fallback to trying glXChooseVisual
+
+ for (i = 0; i < configCount; ++i) {
+ XVisualInfo* vi;
+ vi = glXGetVisualFromFBConfig(xinfo->display(), configs[i]);
+ if (!vi)
+ continue;
+
+#if !defined(QT_NO_XRENDER)
+ QWidget* w = 0;
+ if (d->paintDevice->devType() == QInternal::Widget)
+ w = static_cast<QWidget*>(d->paintDevice);
+
+ if (w && w->testAttribute(Qt::WA_TranslucentBackground) && f.alpha()) {
+ // Attempt to find a config who's visual has a proper alpha channel
+ XRenderPictFormat *pictFormat;
+ pictFormat = XRenderFindVisualFormat(xinfo->display(), vi->visual);
+
+ if (pictFormat && (pictFormat->type == PictTypeDirect) && pictFormat->direct.alphaMask) {
+ // The pict format for the visual matching the FBConfig indicates ARGB
+ if (chosenVisualInfo)
+ XFree(chosenVisualInfo);
+ chosenVisualInfo = vi;
+ break;
+ }
+ } else
+#endif //QT_NO_XRENDER
+ if (chosenVisualInfo) {
+ // If we've got a visual we can use and we're not trying to find one with a
+ // real alpha channel, we might as well just use the one we've got
+ break;
+ }
+
+ if (!chosenVisualInfo)
+ chosenVisualInfo = vi; // Have something to fall back to
+ else
+ XFree(vi);
+ }
+
+ XFree(configs);
+ break;
+ }
+#endif // defined(GLX_VERSION_1_3)
+
+ if (!chosenVisualInfo)
+ chosenVisualInfo = glXChooseVisual(xinfo->display(), xinfo->screen(), spec);
+
+ return chosenVisualInfo;
}
@@ -703,7 +787,7 @@ void QGLContext::swapBuffers() const
static qt_glXWaitVideoSyncSGI glXWaitVideoSyncSGI = 0;
static bool resolved = false;
if (!resolved) {
- QString glxExt = QString(QLatin1String(glXGetClientString(QX11Info::display(), GLX_EXTENSIONS)));
+ QString glxExt = QLatin1String(glXGetClientString(QX11Info::display(), GLX_EXTENSIONS));
if (glxExt.contains(QLatin1String("GLX_SGI_video_sync"))) {
#if defined(Q_OS_LINUX) || defined(Q_OS_BSD4)
void *handle = dlopen(NULL, RTLD_LAZY);
@@ -948,7 +1032,7 @@ void *QGLContext::getProcAddress(const QString &proc) const
if (resolved && !glXGetProcAddressARB)
return 0;
if (!glXGetProcAddressARB) {
- QString glxExt = QString(QLatin1String(glXGetClientString(QX11Info::display(), GLX_EXTENSIONS)));
+ QString glxExt = QLatin1String(glXGetClientString(QX11Info::display(), GLX_EXTENSIONS));
if (glxExt.contains(QLatin1String("GLX_ARB_get_proc_address"))) {
#if defined(Q_OS_LINUX) || defined(Q_OS_BSD4)
void *handle = dlopen(NULL, RTLD_LAZY);
@@ -1191,6 +1275,12 @@ void QGLWidget::setContext(QGLContext *context,
d_func()->xinfo = parentWidget()->d_func()->xinfo;
}
+ // If the application has set WA_TranslucentBackground and not explicitly set
+ // the alpha buffer size to zero, modify the format so it have an alpha channel
+ QGLFormat& fmt = d->glcx->d_func()->glFormat;
+ if (testAttribute(Qt::WA_TranslucentBackground) && fmt.alphaBufferSize() == -1)
+ fmt.setAlphaBufferSize(1);
+
bool createFailed = false;
if (!d->glcx->isValid()) {
if (!d->glcx->create(shareContext ? shareContext : oldcx))
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index f8ea8de..3c745b8 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -114,13 +114,6 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
eglSwapInterval(d->eglContext->display(), d->glFormat.swapInterval());
#endif
- // Create the EGL surface to draw into.
- if (!d->eglContext->createSurface(device())) {
- delete d->eglContext;
- d->eglContext = 0;
- return false;
- }
-
return true;
}
@@ -262,27 +255,125 @@ void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext,
d_func()->xinfo = parentWidget()->d_func()->xinfo;
}
+ // If the application has set WA_TranslucentBackground and not explicitly set
+ // the alpha buffer size to zero, modify the format so it have an alpha channel
+ QGLFormat& fmt = d->glcx->d_func()->glFormat;
+ if (testAttribute(Qt::WA_TranslucentBackground) && fmt.alphaBufferSize() == -1)
+ fmt.setAlphaBufferSize(1);
+
+ bool createFailed = false;
+ if (!d->glcx->isValid()) {
+ if (!d->glcx->create(shareContext ? shareContext : oldcx))
+ createFailed = true;
+ }
+ if (createFailed) {
+ if (deleteOldContext)
+ delete oldcx;
+ return;
+ }
+
+ if (d->glcx->windowCreated() || d->glcx->deviceIsPixmap()) {
+ if (deleteOldContext)
+ delete oldcx;
+ return;
+ }
+
bool visible = isVisible();
if (visible)
hide();
XVisualInfo vi;
+ memset(&vi, 0, sizeof(XVisualInfo));
+
+ // Check to see if EGL is suggesting an appropriate visual id:
+ EGLint nativeVisualId;
+ QEglContext* qeglCtx = d->glcx->d_func()->eglContext;
+ qeglCtx->configAttrib(EGL_NATIVE_VISUAL_ID, &nativeVisualId);
+ vi.visualid = nativeVisualId;
+
+ if (vi.visualid) {
+ // EGL has suggested a visual id, so get the rest of the visual info for that id:
+ XVisualInfo *chosenVisualInfo;
+ int matchingCount = 0;
+ chosenVisualInfo = XGetVisualInfo(x11Info().display(), VisualIDMask, &vi, &matchingCount);
+ if (chosenVisualInfo) {
+ qDebug("Using X Visual ID (%d) provided by EGL", (int)vi.visualid);
+ vi = *chosenVisualInfo;
+ XFree(chosenVisualInfo);
+ }
+ else {
+ qWarning("Warning: EGL suggested using X visual ID %d for config %d, but this seems to be invalid!",
+ nativeVisualId, (int)qeglCtx->config());
+ vi.visualid = 0;
+ }
+ }
- if (parentWidget()) {
- vi.depth = parentWidget()->x11Info().depth();
- vi.screen = parentWidget()->x11Info().screen();
- vi.visual = (Visual *)(parentWidget()->x11Info().visual());
- } else {
- int err = XMatchVisualInfo(x11Info().display(), x11Info().screen(), x11Info().depth(), TrueColor, &vi);
- if (err == 0) {
- qWarning("Error: Couldn't get a matching X visual for format");
- return;
+ // If EGL does not know the visual ID, so try to select an appropriate one ourselves, first
+ // using XRender if we're supposed to have an alpha, then falling back to XGetVisualInfo
+
+ bool useArgb = context->format().alpha() && !context->deviceIsPixmap();
+#if !defined(QT_NO_XRENDER)
+ if (vi.visualid == 0 && useArgb) {
+ // Try to use XRender to find an ARGB visual we can use
+ vi.screen = x11Info().screen();
+ vi.depth = 32;
+ vi.c_class = TrueColor;
+ XVisualInfo *matchingVisuals;
+ int matchingCount = 0;
+ matchingVisuals = XGetVisualInfo(x11Info().display(),
+ VisualScreenMask|VisualDepthMask|VisualClassMask,
+ &vi, &matchingCount);
+
+ for (int i = 0; i < matchingCount; ++i) {
+ XRenderPictFormat *format;
+ format = XRenderFindVisualFormat(x11Info().display(), matchingVisuals[i].visual);
+ if (format->type == PictTypeDirect && format->direct.alphaMask) {
+ vi = matchingVisuals[i];
+ qDebug("Using X Visual ID (%d) for ARGB visual as provided by XRender", (int)vi.visualid);
+ break;
+ }
}
+ XFree(matchingVisuals);
+ }
+#endif
+
+ if (vi.visualid == 0) {
+ EGLint depth;
+ qeglCtx->configAttrib(EGL_BUFFER_SIZE, &depth);
+ int err;
+ err = XMatchVisualInfo(x11Info().display(), x11Info().screen(), depth, TrueColor, &vi);
+ if (err == 0) {
+ qWarning("Warning: Can't find an X visual which matches the EGL config(%d)'s depth (%d)!",
+ (int)qeglCtx->config(), depth);
+ depth = x11Info().depth();
+ err = XMatchVisualInfo(x11Info().display(), x11Info().screen(), depth, TrueColor, &vi);
+ if (err == 0) {
+ qWarning("Error: Couldn't get any matching X visual!");
+ return;
+ } else
+ qWarning(" - Falling back to X11 suggested depth (%d)", depth);
+ } else
+ qDebug("Using X Visual ID (%d) for EGL provided depth (%d)", (int)vi.visualid, depth);
+
+ // Don't try to use ARGB now unless the visual is 32-bit - even then it might stil fail :-(
+ if (useArgb)
+ useArgb = vi.depth == 32;
}
+// qDebug("Visual Info:");
+// qDebug(" bits_per_rgb=%d", vi.bits_per_rgb);
+// qDebug(" red_mask=0x%x", vi.red_mask);
+// qDebug(" green_mask=0x%x", vi.green_mask);
+// qDebug(" blue_mask=0x%x", vi.blue_mask);
+// qDebug(" colormap_size=%d", vi.colormap_size);
+// qDebug(" c_class=%d", vi.c_class);
+// qDebug(" depth=%d", vi.depth);
+// qDebug(" screen=%d", vi.screen);
+// qDebug(" visualid=%d", vi.visualid);
+
XSetWindowAttributes a;
- Window p = RootWindow(X11->display, vi.screen);
+ Window p = RootWindow(x11Info().display(), x11Info().screen());
if (parentWidget())
p = parentWidget()->winId();
@@ -290,9 +381,14 @@ void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext,
a.background_pixel = colmap.pixel(palette().color(backgroundRole()));
a.border_pixel = colmap.pixel(Qt::black);
- Window w = XCreateWindow(X11->display, p, x(), y(), width(), height(),
- 0, vi.depth, InputOutput, vi.visual,
- CWBackPixel|CWBorderPixel, &a);
+ unsigned int valueMask = CWBackPixel|CWBorderPixel;
+ if(useArgb) {
+ a.colormap = XCreateColormap(x11Info().display(), p, vi.visual, AllocNone);
+ valueMask |= CWColormap;
+ }
+
+ Window w = XCreateWindow(x11Info().display(), p, x(), y(), width(), height(),
+ 0, vi.depth, InputOutput, vi.visual, valueMask, &a);
if (deleteOldContext)
delete oldcx;
@@ -300,28 +396,20 @@ void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext,
create(w); // Create with the ID of the window we've just created
- d->eglSurfaceWindowId = w; // Remember the window id we created the surface for
- if (visible)
- show();
-
- bool createFailed = false;
- if (!d->glcx->isValid()) {
- if (!d->glcx->create(shareContext ? shareContext : oldcx))
- createFailed = true;
- }
- if (createFailed) {
- if (deleteOldContext)
- delete oldcx;
+ // Create the EGL surface to draw into.
+ if (!d->glcx->d_func()->eglContext->createSurface(this)) {
+ delete d->glcx->d_func()->eglContext;
+ d->glcx->d_func()->eglContext = 0;
return;
}
- if (d->glcx->windowCreated() || d->glcx->deviceIsPixmap()) {
- if (deleteOldContext)
- delete oldcx;
- return;
- }
+ d->eglSurfaceWindowId = w; // Remember the window id we created the surface for
+
+ if (visible)
+ show();
+ XFlush(X11->display);
d->glcx->setWindowCreated(true);
}
diff --git a/src/opengl/qglextensions.cpp b/src/opengl/qglextensions.cpp
index 5ba669b..3c198fb 100644
--- a/src/opengl/qglextensions.cpp
+++ b/src/opengl/qglextensions.cpp
@@ -45,9 +45,15 @@ QT_BEGIN_NAMESPACE
bool qt_resolve_framebufferobject_extensions(QGLContext *ctx)
{
-#if !defined(QT_OPENGL_ES_2)
- if (glIsRenderbufferEXT != 0)
+#if defined(QT_OPENGL_ES_2)
+ static bool have_resolved = false;
+ if (have_resolved)
return true;
+ have_resolved = true;
+#else
+ if (glIsRenderbuffer != 0)
+ return true;
+#endif
if (ctx == 0) {
qWarning("QGLFramebufferObject: Unable to resolve framebuffer object extensions -"
@@ -55,32 +61,37 @@ bool qt_resolve_framebufferobject_extensions(QGLContext *ctx)
return false;
}
- glIsRenderbufferEXT = (_glIsRenderbufferEXT) ctx->getProcAddress(QLatin1String("glIsRenderbufferEXT"));
- glBindRenderbufferEXT = (_glBindRenderbufferEXT) ctx->getProcAddress(QLatin1String("glBindRenderbufferEXT"));
- glDeleteRenderbuffersEXT = (_glDeleteRenderbuffersEXT) ctx->getProcAddress(QLatin1String("glDeleteRenderbuffersEXT"));
- glGenRenderbuffersEXT = (_glGenRenderbuffersEXT) ctx->getProcAddress(QLatin1String("glGenRenderbuffersEXT"));
- glRenderbufferStorageEXT = (_glRenderbufferStorageEXT) ctx->getProcAddress(QLatin1String("glRenderbufferStorageEXT"));
- glGetRenderbufferParameterivEXT =
- (_glGetRenderbufferParameterivEXT) ctx->getProcAddress(QLatin1String("glGetRenderbufferParameterivEXT"));
- glIsFramebufferEXT = (_glIsFramebufferEXT) ctx->getProcAddress(QLatin1String("glIsFramebufferEXT"));
- glBindFramebufferEXT = (_glBindFramebufferEXT) ctx->getProcAddress(QLatin1String("glBindFramebufferEXT"));
- glDeleteFramebuffersEXT = (_glDeleteFramebuffersEXT) ctx->getProcAddress(QLatin1String("glDeleteFramebuffersEXT"));
- glGenFramebuffersEXT = (_glGenFramebuffersEXT) ctx->getProcAddress(QLatin1String("glGenFramebuffersEXT"));
- glCheckFramebufferStatusEXT = (_glCheckFramebufferStatusEXT) ctx->getProcAddress(QLatin1String("glCheckFramebufferStatusEXT"));
- glFramebufferTexture1DEXT = (_glFramebufferTexture1DEXT) ctx->getProcAddress(QLatin1String("glFramebufferTexture1DEXT"));
- glFramebufferTexture2DEXT = (_glFramebufferTexture2DEXT) ctx->getProcAddress(QLatin1String("glFramebufferTexture2DEXT"));
- glFramebufferTexture3DEXT = (_glFramebufferTexture3DEXT) ctx->getProcAddress(QLatin1String("glFramebufferTexture3DEXT"));
- glFramebufferRenderbufferEXT = (_glFramebufferRenderbufferEXT) ctx->getProcAddress(QLatin1String("glFramebufferRenderbufferEXT"));
- glGetFramebufferAttachmentParameterivEXT =
- (_glGetFramebufferAttachmentParameterivEXT) ctx->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivEXT"));
- glGenerateMipmapEXT = (_glGenerateMipmapEXT) ctx->getProcAddress(QLatin1String("glGenerateMipmapEXT"));
- return glIsRenderbufferEXT;
+
+ glBlitFramebufferEXT = (_glBlitFramebufferEXT) ctx->getProcAddress(QLatin1String("glBlitFramebufferEXT"));
+ glRenderbufferStorageMultisampleEXT =
+ (_glRenderbufferStorageMultisampleEXT) ctx->getProcAddress(QLatin1String("glRenderbufferStorageMultisampleEXT"));
+
+#if !defined(QT_OPENGL_ES_2)
+ glIsRenderbuffer = (_glIsRenderbuffer) ctx->getProcAddress(QLatin1String("glIsRenderbufferEXT"));
+ glBindRenderbuffer = (_glBindRenderbuffer) ctx->getProcAddress(QLatin1String("glBindRenderbufferEXT"));
+ glDeleteRenderbuffers = (_glDeleteRenderbuffers) ctx->getProcAddress(QLatin1String("glDeleteRenderbuffersEXT"));
+ glGenRenderbuffers = (_glGenRenderbuffers) ctx->getProcAddress(QLatin1String("glGenRenderbuffersEXT"));
+ glRenderbufferStorage = (_glRenderbufferStorage) ctx->getProcAddress(QLatin1String("glRenderbufferStorageEXT"));
+ glGetRenderbufferParameteriv =
+ (_glGetRenderbufferParameteriv) ctx->getProcAddress(QLatin1String("glGetRenderbufferParameterivEXT"));
+ glIsFramebuffer = (_glIsFramebuffer) ctx->getProcAddress(QLatin1String("glIsFramebufferEXT"));
+ glBindFramebuffer = (_glBindFramebuffer) ctx->getProcAddress(QLatin1String("glBindFramebufferEXT"));
+ glDeleteFramebuffers = (_glDeleteFramebuffers) ctx->getProcAddress(QLatin1String("glDeleteFramebuffersEXT"));
+ glGenFramebuffers = (_glGenFramebuffers) ctx->getProcAddress(QLatin1String("glGenFramebuffersEXT"));
+ glCheckFramebufferStatus = (_glCheckFramebufferStatus) ctx->getProcAddress(QLatin1String("glCheckFramebufferStatusEXT"));
+ glFramebufferTexture2D = (_glFramebufferTexture2D) ctx->getProcAddress(QLatin1String("glFramebufferTexture2DEXT"));
+ glFramebufferRenderbuffer = (_glFramebufferRenderbuffer) ctx->getProcAddress(QLatin1String("glFramebufferRenderbufferEXT"));
+ glGetFramebufferAttachmentParameteriv =
+ (_glGetFramebufferAttachmentParameteriv) ctx->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivEXT"));
+ glGenerateMipmap = (_glGenerateMipmap) ctx->getProcAddress(QLatin1String("glGenerateMipmapEXT"));
+
+ return glIsRenderbuffer;
#else
- Q_UNUSED(ctx);
return true;
#endif
}
+#if !defined(QT_OPENGL_ES_2)
bool qt_resolve_version_1_3_functions(QGLContext *ctx)
{
if (glMultiTexCoord4f != 0)
@@ -89,14 +100,12 @@ bool qt_resolve_version_1_3_functions(QGLContext *ctx)
QGLContext cx(QGLFormat::defaultFormat());
glMultiTexCoord4f = (_glMultiTexCoord4f) ctx->getProcAddress(QLatin1String("glMultiTexCoord4f"));
-#if defined(QT_OPENGL_ES_2)
- return glMultiTexCoord4f;
-#else
glActiveTexture = (_glActiveTexture) ctx->getProcAddress(QLatin1String("glActiveTexture"));
return glMultiTexCoord4f && glActiveTexture;
-#endif
}
+#endif
+#if !defined(QT_OPENGL_ES_2)
bool qt_resolve_stencil_face_extension(QGLContext *ctx)
{
if (glActiveStencilFaceEXT != 0)
@@ -107,7 +116,10 @@ bool qt_resolve_stencil_face_extension(QGLContext *ctx)
return glActiveStencilFaceEXT;
}
+#endif
+
+#if !defined(QT_OPENGL_ES_2)
bool qt_resolve_frag_program_extensions(QGLContext *ctx)
{
if (glProgramStringARB != 0)
@@ -126,26 +138,36 @@ bool qt_resolve_frag_program_extensions(QGLContext *ctx)
&& glGenProgramsARB
&& glProgramLocalParameter4fvARB;
}
+#endif
+
bool qt_resolve_buffer_extensions(QGLContext *ctx)
{
- if (glBindBufferARB && glDeleteBuffersARB && glGenBuffersARB && glBufferDataARB
- && glMapBufferARB && glUnmapBufferARB)
+ if (glMapBufferARB && glUnmapBufferARB
+#if !defined(QT_OPENGL_ES_2)
+ && glBindBuffer && glDeleteBuffers && glGenBuffers && glBufferData
+#endif
+ )
return true;
- glBindBufferARB = (_glBindBufferARB) ctx->getProcAddress(QLatin1String("glBindBufferARB"));
- glDeleteBuffersARB = (_glDeleteBuffersARB) ctx->getProcAddress(QLatin1String("glDeleteBuffersARB"));
- glGenBuffersARB = (_glGenBuffersARB) ctx->getProcAddress(QLatin1String("glGenBuffersARB"));
- glBufferDataARB = (_glBufferDataARB) ctx->getProcAddress(QLatin1String("glBufferDataARB"));
+#if !defined(QT_OPENGL_ES_2)
+ glBindBuffer = (_glBindBuffer) ctx->getProcAddress(QLatin1String("glBindBufferARB"));
+ glDeleteBuffers = (_glDeleteBuffers) ctx->getProcAddress(QLatin1String("glDeleteBuffersARB"));
+ glGenBuffers = (_glGenBuffers) ctx->getProcAddress(QLatin1String("glGenBuffersARB"));
+ glBufferData = (_glBufferData) ctx->getProcAddress(QLatin1String("glBufferDataARB"));
+#endif
glMapBufferARB = (_glMapBufferARB) ctx->getProcAddress(QLatin1String("glMapBufferARB"));
glUnmapBufferARB = (_glUnmapBufferARB) ctx->getProcAddress(QLatin1String("glUnmapBufferARB"));
- return glBindBufferARB
- && glDeleteBuffersARB
- && glGenBuffersARB
- && glBufferDataARB
- && glMapBufferARB
- && glUnmapBufferARB;
+ return glMapBufferARB
+ && glUnmapBufferARB
+#if !defined(QT_OPENGL_ES_2)
+ && glBindBuffer
+ && glDeleteBuffers
+ && glGenBuffers
+ && glBufferData
+#endif
+ ;
}
bool qt_resolve_glsl_extensions(QGLContext *ctx)
@@ -211,6 +233,7 @@ bool qt_resolve_glsl_extensions(QGLContext *ctx)
glVertexAttribPointer = (_glVertexAttribPointer) ctx->getProcAddress(QLatin1String("glVertexAttribPointer"));
glDisableVertexAttribArray = (_glDisableVertexAttribArray) ctx->getProcAddress(QLatin1String("glDisableVertexAttribArray"));
glEnableVertexAttribArray = (_glEnableVertexAttribArray) ctx->getProcAddress(QLatin1String("glEnableVertexAttribArray"));
+
} else {
// We may not have the standard shader functions, but we might
// have the older ARB functions instead.
@@ -304,4 +327,26 @@ bool qt_resolve_glsl_extensions(QGLContext *ctx)
#endif
}
+#if !defined(QT_OPENGL_ES_2)
+bool qt_resolve_version_2_0_functions(QGLContext *ctx)
+{
+ bool gl2supported = true;
+ if (!qt_resolve_glsl_extensions(ctx))
+ gl2supported = false;
+
+ if (!qt_resolve_version_1_3_functions(ctx))
+ gl2supported = false;
+
+ if (glStencilOpSeparate)
+ return gl2supported;
+
+ glStencilOpSeparate = (_glStencilOpSeparate) ctx->getProcAddress(QLatin1String("glStencilOpSeparate"));
+ if (!glStencilOpSeparate)
+ gl2supported = false;
+
+ return gl2supported;
+}
+#endif
+
+
QT_END_NAMESPACE
diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h
index f71ae9d..d6edfb6 100644
--- a/src/opengl/qglextensions_p.h
+++ b/src/opengl/qglextensions_p.h
@@ -74,11 +74,15 @@
typedef ptrdiff_t GLsizeiptrARB;
#endif
+#ifndef GL_VERSION_2_0
+typedef char GLchar;
+#endif
+
// ARB_pixel_buffer_object
-typedef void (APIENTRY *_glBindBufferARB) (GLenum, GLuint);
-typedef void (APIENTRY *_glDeleteBuffersARB) (GLsizei, const GLuint *);
-typedef void (APIENTRY *_glGenBuffersARB) (GLsizei, GLuint *);
-typedef void (APIENTRY *_glBufferDataARB) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
+typedef void (APIENTRY *_glBindBuffer) (GLenum, GLuint);
+typedef void (APIENTRY *_glDeleteBuffers) (GLsizei, const GLuint *);
+typedef void (APIENTRY *_glGenBuffers) (GLsizei, GLuint *);
+typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
typedef GLvoid* (APIENTRY *_glMapBufferARB) (GLenum, GLenum);
typedef GLboolean (APIENTRY *_glUnmapBufferARB) (GLenum);
@@ -141,47 +145,57 @@ typedef void (APIENTRY *_glEnableVertexAttribArray) (GLuint);
typedef void (APIENTRY *_glGetProgramBinaryOES) (GLuint, GLsizei, GLsizei *, GLenum *, void *);
typedef void (APIENTRY *_glProgramBinaryOES) (GLuint, GLenum, const void *, GLint);
-typedef void (APIENTRY *_glActiveStencilFaceEXT) (GLenum );
typedef void (APIENTRY *_glMultiTexCoord4f) (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (APIENTRY *_glActiveStencilFaceEXT) (GLenum );
+
+// Needed for GL2 engine:
+typedef void (APIENTRY *_glStencilOpSeparate) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
typedef void (APIENTRY *_glActiveTexture) (GLenum);
+
// EXT_GL_framebuffer_object
-typedef GLboolean (APIENTRY *_glIsRenderbufferEXT) (GLuint renderbuffer);
-typedef void (APIENTRY *_glBindRenderbufferEXT) (GLenum target, GLuint renderbuffer);
-typedef void (APIENTRY *_glDeleteRenderbuffersEXT) (GLsizei n, const GLuint *renderbuffers);
-typedef void (APIENTRY *_glGenRenderbuffersEXT) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRY *_glRenderbufferStorageEXT) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRY *_glGetRenderbufferParameterivEXT) (GLenum target, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRY *_glIsFramebufferEXT) (GLuint framebuffer);
-typedef void (APIENTRY *_glBindFramebufferEXT) (GLenum target, GLuint framebuffer);
-typedef void (APIENTRY *_glDeleteFramebuffersEXT) (GLsizei n, const GLuint *framebuffers);
-typedef void (APIENTRY *_glGenFramebuffersEXT) (GLsizei n, GLuint *framebuffers);
-typedef GLenum (APIENTRY *_glCheckFramebufferStatusEXT) (GLenum target);
-typedef void (APIENTRY *_glFramebufferTexture1DEXT) (GLenum target, GLenum attachment, GLenum textarget,
- GLuint texture, GLint level);
-typedef void (APIENTRY *_glFramebufferTexture2DEXT) (GLenum target, GLenum attachment, GLenum textarget,
+typedef GLboolean (APIENTRY *_glIsRenderbuffer) (GLuint renderbuffer);
+typedef void (APIENTRY *_glBindRenderbuffer) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRY *_glDeleteRenderbuffers) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRY *_glGenRenderbuffers) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRY *_glRenderbufferStorage) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRY *_glGetRenderbufferParameteriv) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRY *_glIsFramebuffer) (GLuint framebuffer);
+typedef void (APIENTRY *_glBindFramebuffer) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRY *_glDeleteFramebuffers) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRY *_glGenFramebuffers) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRY *_glCheckFramebufferStatus) (GLenum target);
+typedef void (APIENTRY *_glFramebufferTexture2D) (GLenum target, GLenum attachment, GLenum textarget,
GLuint texture, GLint level);
-typedef void (APIENTRY *_glFramebufferTexture3DEXT) (GLenum target, GLenum attachment, GLenum textarget,
- GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRY *_glFramebufferRenderbufferEXT) (GLenum target, GLenum attachment, GLenum renderbuffertarget,
+typedef void (APIENTRY *_glFramebufferRenderbuffer) (GLenum target, GLenum attachment, GLenum renderbuffertarget,
GLuint renderbuffer);
-typedef void (APIENTRY *_glGetFramebufferAttachmentParameterivEXT) (GLenum target, GLenum attachment, GLenum pname,
+typedef void (APIENTRY *_glGetFramebufferAttachmentParameteriv) (GLenum target, GLenum attachment, GLenum pname,
GLint *params);
-typedef void (APIENTRY *_glGenerateMipmapEXT) (GLenum target);
+typedef void (APIENTRY *_glGenerateMipmap) (GLenum target);
+
+// EXT_GL_framebuffer_blit
+typedef void (APIENTRY *_glBlitFramebufferEXT) (int srcX0, int srcY0, int srcX1, int srcY1,
+ int dstX0, int dstY0, int dstX1, int dstY1,
+ GLbitfield mask, GLenum filter);
+
+// EXT_GL_framebuffer_multisample
+typedef void (APIENTRY *_glRenderbufferStorageMultisampleEXT) (GLenum target, GLsizei samples,
+ GLenum internalformat, GLsizei width, GLsizei height);
QT_BEGIN_NAMESPACE
struct QGLExtensionFuncs
{
QGLExtensionFuncs() {
+#if !defined(QT_OPENGL_ES_2)
qt_glProgramStringARB = 0;
qt_glBindProgramARB = 0;
qt_glDeleteProgramsARB = 0;
qt_glGenProgramsARB = 0;
qt_glProgramLocalParameter4fvARB = 0;
-#if !defined(QT_OPENGL_ES_2)
+ // GLSL
qt_glCreateShader = 0;
qt_glShaderSource = 0;
qt_glShaderBinary = 0;
@@ -229,6 +243,13 @@ struct QGLExtensionFuncs
qt_glVertexAttribPointer = 0;
qt_glDisableVertexAttribArray = 0;
qt_glEnableVertexAttribArray = 0;
+
+ // Extras for GL2 engine:
+ qt_glActiveTexture = 0;
+ qt_glStencilOpSeparate = 0;
+
+ qt_glActiveStencilFaceEXT = 0;
+ qt_glMultiTexCoord4f = 0;
#else
qt_glslResolved = false;
@@ -236,46 +257,46 @@ struct QGLExtensionFuncs
qt_glProgramBinaryOES = 0;
#endif
- qt_glActiveStencilFaceEXT = 0;
-
- qt_glMultiTexCoord4f = 0;
- qt_glActiveTexture = 0;
+ // FBOs
+#if !defined(QT_OPENGL_ES_2)
+ qt_glIsRenderbuffer = 0;
+ qt_glBindRenderbuffer = 0;
+ qt_glDeleteRenderbuffers = 0;
+ qt_glGenRenderbuffers = 0;
+ qt_glRenderbufferStorage = 0;
+ qt_glGetRenderbufferParameteriv = 0;
+ qt_glIsFramebuffer = 0;
+ qt_glBindFramebuffer = 0;
+ qt_glDeleteFramebuffers = 0;
+ qt_glGenFramebuffers = 0;
+ qt_glCheckFramebufferStatus = 0;
+ qt_glFramebufferTexture2D = 0;
+ qt_glFramebufferRenderbuffer = 0;
+ qt_glGetFramebufferAttachmentParameteriv = 0;
+ qt_glGenerateMipmap = 0;
+#endif
+ qt_glBlitFramebufferEXT = 0;
+ qt_glRenderbufferStorageMultisampleEXT = 0;
+ // Buffer objects:
#if !defined(QT_OPENGL_ES_2)
- qt_glIsRenderbufferEXT = 0;
- qt_glBindRenderbufferEXT = 0;
- qt_glDeleteRenderbuffersEXT = 0;
- qt_glGenRenderbuffersEXT = 0;
- qt_glRenderbufferStorageEXT = 0;
- qt_glGetRenderbufferParameterivEXT = 0;
- qt_glIsFramebufferEXT = 0;
- qt_glBindFramebufferEXT = 0;
- qt_glDeleteFramebuffersEXT = 0;
- qt_glGenFramebuffersEXT = 0;
- qt_glCheckFramebufferStatusEXT = 0;
- qt_glFramebufferTexture1DEXT = 0;
- qt_glFramebufferTexture2DEXT = 0;
- qt_glFramebufferTexture3DEXT = 0;
- qt_glFramebufferRenderbufferEXT = 0;
- qt_glGetFramebufferAttachmentParameterivEXT = 0;
- qt_glGenerateMipmapEXT = 0;
-#endif
-
- qt_glBindBufferARB = 0;
- qt_glDeleteBuffersARB = 0;
- qt_glGenBuffersARB = 0;
- qt_glBufferDataARB = 0;
+ qt_glBindBuffer = 0;
+ qt_glDeleteBuffers = 0;
+ qt_glGenBuffers = 0;
+ qt_glBufferData = 0;
+#endif
qt_glMapBufferARB = 0;
qt_glUnmapBufferARB = 0;
}
+
+#if !defined(QT_OPENGL_ES_2)
_glProgramStringARB qt_glProgramStringARB;
_glBindProgramARB qt_glBindProgramARB;
_glDeleteProgramsARB qt_glDeleteProgramsARB;
_glGenProgramsARB qt_glGenProgramsARB;
_glProgramLocalParameter4fvARB qt_glProgramLocalParameter4fvARB;
-#if !defined(QT_OPENGL_ES_2)
// GLSL definitions
_glCreateShader qt_glCreateShader;
_glShaderSource qt_glShaderSource;
@@ -324,6 +345,7 @@ struct QGLExtensionFuncs
_glVertexAttribPointer qt_glVertexAttribPointer;
_glDisableVertexAttribArray qt_glDisableVertexAttribArray;
_glEnableVertexAttribArray qt_glEnableVertexAttribArray;
+
#else
bool qt_glslResolved;
@@ -332,36 +354,45 @@ struct QGLExtensionFuncs
#endif
_glActiveStencilFaceEXT qt_glActiveStencilFaceEXT;
-
_glMultiTexCoord4f qt_glMultiTexCoord4f;
+
+#if !defined(QT_OPENGL_ES_2)
+ // Extras needed for GL2 engine:
_glActiveTexture qt_glActiveTexture;
+ _glStencilOpSeparate qt_glStencilOpSeparate;
+#endif
+ // FBOs
#if !defined(QT_OPENGL_ES_2)
- _glIsRenderbufferEXT qt_glIsRenderbufferEXT;
- _glBindRenderbufferEXT qt_glBindRenderbufferEXT;
- _glDeleteRenderbuffersEXT qt_glDeleteRenderbuffersEXT;
- _glGenRenderbuffersEXT qt_glGenRenderbuffersEXT;
- _glRenderbufferStorageEXT qt_glRenderbufferStorageEXT;
- _glGetRenderbufferParameterivEXT qt_glGetRenderbufferParameterivEXT;
- _glIsFramebufferEXT qt_glIsFramebufferEXT;
- _glBindFramebufferEXT qt_glBindFramebufferEXT;
- _glDeleteFramebuffersEXT qt_glDeleteFramebuffersEXT;
- _glGenFramebuffersEXT qt_glGenFramebuffersEXT;
- _glCheckFramebufferStatusEXT qt_glCheckFramebufferStatusEXT;
- _glFramebufferTexture1DEXT qt_glFramebufferTexture1DEXT;
- _glFramebufferTexture2DEXT qt_glFramebufferTexture2DEXT;
- _glFramebufferTexture3DEXT qt_glFramebufferTexture3DEXT;
- _glFramebufferRenderbufferEXT qt_glFramebufferRenderbufferEXT;
- _glGetFramebufferAttachmentParameterivEXT qt_glGetFramebufferAttachmentParameterivEXT;
- _glGenerateMipmapEXT qt_glGenerateMipmapEXT;
-#endif
-
- _glBindBufferARB qt_glBindBufferARB;
- _glDeleteBuffersARB qt_glDeleteBuffersARB;
- _glGenBuffersARB qt_glGenBuffersARB;
- _glBufferDataARB qt_glBufferDataARB;
+ _glIsRenderbuffer qt_glIsRenderbuffer;
+ _glBindRenderbuffer qt_glBindRenderbuffer;
+ _glDeleteRenderbuffers qt_glDeleteRenderbuffers;
+ _glGenRenderbuffers qt_glGenRenderbuffers;
+ _glRenderbufferStorage qt_glRenderbufferStorage;
+ _glGetRenderbufferParameteriv qt_glGetRenderbufferParameteriv;
+ _glIsFramebuffer qt_glIsFramebuffer;
+ _glBindFramebuffer qt_glBindFramebuffer;
+ _glDeleteFramebuffers qt_glDeleteFramebuffers;
+ _glGenFramebuffers qt_glGenFramebuffers;
+ _glCheckFramebufferStatus qt_glCheckFramebufferStatus;
+ _glFramebufferTexture2D qt_glFramebufferTexture2D;
+ _glFramebufferRenderbuffer qt_glFramebufferRenderbuffer;
+ _glGetFramebufferAttachmentParameteriv qt_glGetFramebufferAttachmentParameteriv;
+ _glGenerateMipmap qt_glGenerateMipmap;
+#endif
+ _glBlitFramebufferEXT qt_glBlitFramebufferEXT;
+ _glRenderbufferStorageMultisampleEXT qt_glRenderbufferStorageMultisampleEXT;
+
+ // Buffer objects
+#if !defined(QT_OPENGL_ES_2)
+ _glBindBuffer qt_glBindBuffer;
+ _glDeleteBuffers qt_glDeleteBuffers;
+ _glGenBuffers qt_glGenBuffers;
+ _glBufferData qt_glBufferData;
+#endif
_glMapBufferARB qt_glMapBufferARB;
_glUnmapBufferARB qt_glUnmapBufferARB;
+
};
@@ -489,6 +520,28 @@ struct QGLExtensionFuncs
#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
#endif
+// GL_EXT_framebuffer_blit
+#ifndef GL_READ_FRAMEBUFFER_EXT
+#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
+#endif
+
+// GL_EXT_framebuffer_multisample
+#ifndef GL_RENDERBUFFER_SAMPLES_EXT
+#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
+#endif
+
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
+#endif
+
+#ifndef GL_MAX_SAMPLES_EXT
+#define GL_MAX_SAMPLES_EXT 0x8D5
+#endif
+
+#ifndef GL_DRAW_FRAMEBUFFER_EXT
+#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
+#endif
+
#ifndef GL_EXT_packed_depth_stencil
#define GL_DEPTH_STENCIL_EXT 0x84F9
#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
@@ -508,6 +561,42 @@ struct QGLExtensionFuncs
#define GL_UNPACK_IMAGE_HEIGHT 0x806E
#endif
+#ifndef GL_VERSION_1_4
+#define GL_INCR_WRAP 0x8507
+#define GL_DECR_WRAP 0x8508
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_FLOAT_VEC2 0x8B50
+#define GL_FLOAT_VEC3 0x8B51
+#define GL_FLOAT_VEC4 0x8B52
+#define GL_INT_VEC2 0x8B53
+#define GL_INT_VEC3 0x8B54
+#define GL_INT_VEC4 0x8B55
+#define GL_BOOL 0x8B56
+#define GL_BOOL_VEC2 0x8B57
+#define GL_BOOL_VEC3 0x8B58
+#define GL_BOOL_VEC4 0x8B59
+#define GL_FLOAT_MAT2 0x8B5A
+#define GL_FLOAT_MAT3 0x8B5B
+#define GL_FLOAT_MAT4 0x8B5C
+#define GL_SAMPLER_1D 0x8B5D
+#define GL_SAMPLER_2D 0x8B5E
+#define GL_SAMPLER_3D 0x8B5F
+#define GL_SAMPLER_CUBE 0x8B60
+#define GL_COMPILE_STATUS 0x8B81
+#define GL_LINK_STATUS 0x8B82
+#define GL_INFO_LOG_LENGTH 0x8B84
+#define GL_ACTIVE_UNIFORMS 0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
+#define GL_ACTIVE_ATTRIBUTES 0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
+#endif
+
+
+#if !defined(QT_OPENGL_ES_2)
#define glProgramStringARB QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glProgramStringARB
#define glBindProgramARB QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glBindProgramARB
#define glDeleteProgramsARB QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glDeleteProgramsARB
@@ -518,59 +607,44 @@ struct QGLExtensionFuncs
#define glMultiTexCoord4f QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glMultiTexCoord4f
-#if !defined(QT_OPENGL_ES_2)
#define glActiveTexture QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glActiveTexture
-#endif
+#endif // !defined(QT_OPENGL_ES_2)
-#if !defined(QT_OPENGL_ES_2)
-
-#define glIsRenderbufferEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glIsRenderbufferEXT
-#define glBindRenderbufferEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glBindRenderbufferEXT
-#define glDeleteRenderbuffersEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glDeleteRenderbuffersEXT
-#define glGenRenderbuffersEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glGenRenderbuffersEXT
-#define glRenderbufferStorageEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glRenderbufferStorageEXT
-#define glGetRenderbufferParameterivEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glGetRenderbufferParameterivEXT
-#define glIsFramebufferEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glIsFramebufferEXT
-#define glBindFramebufferEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glBindFramebufferEXT
-#define glDeleteFramebuffersEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glDeleteFramebuffersEXT
-#define glGenFramebuffersEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glGenFramebuffersEXT
-#define glCheckFramebufferStatusEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glCheckFramebufferStatusEXT
-#define glFramebufferTexture1DEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glFramebufferTexture1DEXT
-#define glFramebufferTexture2DEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glFramebufferTexture2DEXT
-#define glFramebufferTexture3DEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glFramebufferTexture3DEXT
-#define glFramebufferRenderbufferEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glFramebufferRenderbufferEXT
-#define glGetFramebufferAttachmentParameterivEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glGetFramebufferAttachmentParameterivEXT
-#define glGenerateMipmapEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glGenerateMipmapEXT
-
-#else // QT_OPENGL_ES_2
-
-#define glIsRenderbufferEXT glIsRenderbuffer
-#define glBindRenderbufferEXT glBindRenderbuffer
-#define glDeleteRenderbuffersEXT glDeleteRenderbuffers
-#define glGenRenderbuffersEXT glGenRenderbuffers
-#define glRenderbufferStorageEXT glRenderbufferStorage
-#define glGetRenderbufferParameterivEXT glGetRenderbufferParameteriv
-#define glIsFramebufferEXT glIsFramebuffer
-#define glBindFramebufferEXT glBindFramebuffer
-#define glDeleteFramebuffersEXT glDeleteFramebuffers
-#define glGenFramebuffersEXT glGenFramebuffers
-#define glCheckFramebufferStatusEXT glCheckFramebufferStatus
-#define glFramebufferTexture1DEXT glFramebufferTexture1D
-#define glFramebufferTexture2DEXT glFramebufferTexture2D
-#define glFramebufferTexture3DEXT glFramebufferTexture3D
-#define glFramebufferRenderbufferEXT glFramebufferRenderbuffer
-#define glGetFramebufferAttachmentParameterivEXT glGetFramebufferAttachmentParameteriv
-#define glGenerateMipmapEXT glGenerateMipmap
+// FBOs
+#if !defined(QT_OPENGL_ES_2)
+#define glIsRenderbuffer QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glIsRenderbuffer
+#define glBindRenderbuffer QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glBindRenderbuffer
+#define glDeleteRenderbuffers QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glDeleteRenderbuffers
+#define glGenRenderbuffers QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glGenRenderbuffers
+#define glRenderbufferStorage QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glRenderbufferStorage
+#define glGetRenderbufferParameteriv QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glGetRenderbufferParameteriv
+#define glIsFramebuffer QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glIsFramebuffer
+#define glBindFramebuffer QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glBindFramebuffer
+#define glDeleteFramebuffers QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glDeleteFramebuffers
+#define glGenFramebuffers QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glGenFramebuffers
+#define glCheckFramebufferStatus QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glCheckFramebufferStatus
+#define glFramebufferTexture2D QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glFramebufferTexture2D
+#define glFramebufferRenderbuffer QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glFramebufferRenderbuffer
+#define glGetFramebufferAttachmentParameteriv QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glGetFramebufferAttachmentParameteriv
+#define glGenerateMipmap QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glGenerateMipmap
#endif // QT_OPENGL_ES_2
+#define glBlitFramebufferEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glBlitFramebufferEXT
+#define glRenderbufferStorageMultisampleEXT QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glRenderbufferStorageMultisampleEXT
+
-#define glBindBufferARB QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glBindBufferARB
-#define glDeleteBuffersARB QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glDeleteBuffersARB
-#define glGenBuffersARB QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glGenBuffersARB
-#define glBufferDataARB QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glBufferDataARB
+// Buffer objects
+#if !defined(QT_OPENGL_ES_2)
+#define glBindBuffer QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glBindBuffer
+#define glDeleteBuffers QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glDeleteBuffers
+#define glGenBuffers QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glGenBuffers
+#define glBufferData QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glBufferData
+#endif
#define glMapBufferARB QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glMapBufferARB
#define glUnmapBufferARB QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glUnmapBufferARB
+
+// GLSL
#if !defined(QT_OPENGL_ES_2)
#define glCreateShader QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glCreateShader
@@ -628,10 +702,20 @@ struct QGLExtensionFuncs
#endif // QT_OPENGL_ES_2
+
+#if !defined(QT_OPENGL_ES_2)
+#define glStencilOpSeparate QGLContextPrivate::qt_get_extension_funcs(ctx).qt_glStencilOpSeparate
+#endif
+
+#if defined(QT_OPENGL_ES_2)
+#define glClearDepth glClearDepthf
+#endif
+
extern bool qt_resolve_framebufferobject_extensions(QGLContext *ctx);
bool qt_resolve_buffer_extensions(QGLContext *ctx);
bool qt_resolve_version_1_3_functions(QGLContext *ctx);
+bool qt_resolve_version_2_0_functions(QGLContext *ctx);
bool qt_resolve_stencil_face_extension(QGLContext *ctx);
bool qt_resolve_frag_program_extensions(QGLContext *ctx);
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 4ba9213..3e7ca0a 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -43,7 +43,12 @@
#include <qdebug.h>
#include <private/qgl_p.h>
+#include <private/qpaintengineex_opengl2_p.h>
+
+#ifndef QT_OPENGL_ES_2
#include <private/qpaintengine_opengl_p.h>
+#endif
+
#include <qglframebufferobject.h>
#include <qlibrary.h>
#include <qimage.h>
@@ -67,6 +72,215 @@ extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool);
} \
}
+class QGLFramebufferObjectFormatPrivate
+{
+public:
+ int samples;
+ QGLFramebufferObject::Attachment attachment;
+ GLenum target;
+ GLenum internal_format;
+};
+
+/*!
+ \class QGLFramebufferObjectFormat
+ \brief The QGLFramebufferObjectFormat class specifies the format of an OpenGL
+ framebuffer object.
+
+ \since 4.6
+
+ \ingroup multimedia
+
+ A framebuffer object has several characteristics:
+ \list
+ \i \link setSamples() Number of samples per pixels.\endlink
+ \i \link setAttachment() Depth and/or stencil attachments.\endlink
+ \i \link setTextureTarget() Texture target.\endlink
+ \i \link setInternalFormat() Internal format.\endlink
+ \endlist
+
+ Note that the desired attachments or number of samples per pixels might not
+ be supported by the hardware driver. Call QGLFramebufferObject::format()
+ after creating a QGLFramebufferObject to find the exact format that was
+ used to create the frame buffer object.
+
+ \sa QGLFramebufferObject
+*/
+
+/*!
+ \since 4.6
+
+ Creates a QGLFramebufferObjectFormat object with properties specifying
+ the format of an OpenGL framebuffer object.
+
+ A multisample framebuffer object is specified by setting \a samples
+ to a value different from zero. If the desired amount of samples per pixel is
+ not supported by the hardware then the maximum number of samples per pixel
+ will be used. Note that multisample framebuffer objects can not be bound as
+ textures. Also, the \c{GL_EXT_framebuffer_multisample} extension is required
+ to create a framebuffer with more than one sample per pixel.
+
+ For multisample framebuffer objects a color render buffer is created,
+ otherwise a texture with the texture target \a target is created.
+ The color render buffer or texture will have the internal format
+ \a internalFormat, and will be bound to the \c GL_COLOR_ATTACHMENT0
+ attachment in the framebuffer object.
+
+ The \a attachment parameter describes the depth/stencil buffer
+ configuration.
+
+ \sa samples(), attachment(), target(), internalFormat()
+*/
+
+QGLFramebufferObjectFormat::QGLFramebufferObjectFormat(int samples,
+ QGLFramebufferObject::Attachment attachment,
+ GLenum target,
+ GLenum internalFormat)
+{
+ d = new QGLFramebufferObjectFormatPrivate;
+ d->samples = samples;
+ d->attachment = attachment;
+ d->target = target;
+ d->internal_format = internalFormat;
+}
+
+/*!
+ \since 4.6
+
+ Constructs a copy of \a other.
+*/
+
+QGLFramebufferObjectFormat::QGLFramebufferObjectFormat(const QGLFramebufferObjectFormat &other)
+{
+ d = new QGLFramebufferObjectFormatPrivate;
+ *d = *other.d;
+}
+
+/*!
+ \since 4.6
+
+ Assigns \a other to this object.
+*/
+
+QGLFramebufferObjectFormat &QGLFramebufferObjectFormat::operator=(const QGLFramebufferObjectFormat &other)
+{
+ *d = *other.d;
+ return *this;
+}
+
+/*!
+ \since 4.6
+
+ Destroys the QGLFramebufferObjectFormat.
+*/
+QGLFramebufferObjectFormat::~QGLFramebufferObjectFormat()
+{
+ delete d;
+}
+
+/*!
+ \since 4.6
+
+ Sets the number of samples per pixel for a multisample framebuffer object
+ to \a samples.
+ A sample count of 0 represents a regular non-multisample framebuffer object.
+
+ \sa samples()
+*/
+void QGLFramebufferObjectFormat::setSamples(int samples)
+{
+ d->samples = samples;
+}
+
+/*!
+ \since 4.6
+
+ Returns the number of samples per pixel if a framebuffer object
+ is a multisample framebuffer object. Otherwise, returns 0.
+
+ \sa setSamples()
+*/
+int QGLFramebufferObjectFormat::samples() const
+{
+ return d->samples;
+}
+
+/*!
+ \since 4.6
+
+ Sets the attachments a framebuffer object should have to \a attachment.
+
+ \sa attachment()
+*/
+void QGLFramebufferObjectFormat::setAttachment(QGLFramebufferObject::Attachment attachment)
+{
+ d->attachment = attachment;
+}
+
+/*!
+ \since 4.6
+
+ Returns the status of the depth and stencil buffers attached to
+ a framebuffer object.
+
+ \sa setAttachment()
+*/
+QGLFramebufferObject::Attachment QGLFramebufferObjectFormat::attachment() const
+{
+ return d->attachment;
+}
+
+/*!
+ \since 4.6
+
+ Sets the texture target of the texture attached to a framebuffer object to
+ \a target. Ignored for multisample framebuffer objects.
+
+ \sa textureTarget(), samples()
+*/
+void QGLFramebufferObjectFormat::setTextureTarget(GLenum target)
+{
+ d->target = target;
+}
+
+/*!
+ \since 4.6
+
+ Returns the texture target of the texture attached to a framebuffer object.
+ Ignored for multisample framebuffer objects.
+
+ \sa setTextureTarget(), samples()
+*/
+GLenum QGLFramebufferObjectFormat::textureTarget() const
+{
+ return d->target;
+}
+
+/*!
+ \since 4.6
+
+ Sets the internal format of a framebuffer object's texture or multisample
+ framebuffer object's color buffer to \a internalFormat.
+
+ \sa internalFormat()
+*/
+void QGLFramebufferObjectFormat::setInternalFormat(GLenum internalFormat)
+{
+ d->internal_format = internalFormat;
+}
+
+/*!
+ \since 4.6
+
+ Returns the internal format of a framebuffer object's texture or
+ multisample framebuffer object's color buffer.
+
+ \sa setInternalFormat()
+*/
+GLenum QGLFramebufferObjectFormat::internalFormat() const
+{
+ return d->internal_format;
+}
+
class QGLFramebufferObjectPrivate
{
public:
@@ -74,13 +288,16 @@ public:
~QGLFramebufferObjectPrivate() {}
void init(const QSize& sz, QGLFramebufferObject::Attachment attachment,
- GLenum internal_format, GLenum texture_target);
+ GLenum internal_format, GLenum texture_target, GLint samples = 0);
bool checkFramebufferStatus() const;
GLuint texture;
GLuint fbo;
GLuint depth_stencil_buffer;
+ GLuint color_buffer;
GLenum target;
QSize size;
+ QGLFramebufferObjectFormat format;
+ int samples;
uint valid : 1;
uint bound : 1;
QGLFramebufferObject::Attachment fbo_attachment;
@@ -90,7 +307,7 @@ public:
bool QGLFramebufferObjectPrivate::checkFramebufferStatus() const
{
- GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+ GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT);
switch(status) {
case GL_NO_ERROR:
case GL_FRAMEBUFFER_COMPLETE_EXT:
@@ -122,6 +339,9 @@ bool QGLFramebufferObjectPrivate::checkFramebufferStatus() const
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
qDebug("QGLFramebufferObject: Framebuffer incomplete, missing read buffer.");
break;
+ case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT:
+ qDebug("QGLFramebufferObject: Framebuffer incomplete, attachments must have same number of samples per pixel.");
+ break;
default:
qDebug() <<"QGLFramebufferObject: An undefined error has occurred: "<< status;
break;
@@ -130,7 +350,7 @@ bool QGLFramebufferObjectPrivate::checkFramebufferStatus() const
}
void QGLFramebufferObjectPrivate::init(const QSize &sz, QGLFramebufferObject::Attachment attachment,
- GLenum texture_target, GLenum internal_format)
+ GLenum texture_target, GLenum internal_format, GLint samples)
{
ctx = const_cast<QGLContext *>(QGLContext::currentContext());
bool ext_detected = (QGLExtensions::glExtensions & QGLExtensions::FramebufferObject);
@@ -142,81 +362,137 @@ void QGLFramebufferObjectPrivate::init(const QSize &sz, QGLFramebufferObject::At
// texture dimensions
while (glGetError() != GL_NO_ERROR) {} // reset error state
- glGenFramebuffersEXT(1, &fbo);
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
+ glGenFramebuffers(1, &fbo);
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, fbo);
QT_CHECK_GLERROR();
// init texture
- glGenTextures(1, &texture);
- glBindTexture(target, texture);
- glTexImage2D(target, 0, internal_format, size.width(), size.height(), 0,
- GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ if (samples == 0) {
+ glGenTextures(1, &texture);
+ glBindTexture(target, texture);
+ glTexImage2D(target, 0, internal_format, size.width(), size.height(), 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, NULL);
#ifndef QT_OPENGL_ES
- glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
#else
- glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterf(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameterf(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
#endif
- glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
- target, texture, 0);
+ glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+ target, texture, 0);
- QT_CHECK_GLERROR();
- valid = checkFramebufferStatus();
+ QT_CHECK_GLERROR();
+ valid = checkFramebufferStatus();
+
+ color_buffer = 0;
+ samples = 0;
+ } else {
+ GLint maxSamples;
+ glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSamples);
+
+ samples = qBound(1, int(samples), int(maxSamples));
+
+ glGenRenderbuffers(1, &color_buffer);
+ glBindRenderbuffer(GL_RENDERBUFFER_EXT, color_buffer);
+ if (glRenderbufferStorageMultisampleEXT) {
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples,
+ internal_format, size.width(), size.height());
+ } else {
+ samples = 0;
+ glRenderbufferStorage(GL_RENDERBUFFER_EXT, internal_format,
+ size.width(), size.height());
+ }
+
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+ GL_RENDERBUFFER_EXT, color_buffer);
+
+ QT_CHECK_GLERROR();
+ valid = checkFramebufferStatus();
+
+ if (valid)
+ glGetRenderbufferParameteriv(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_SAMPLES_EXT, &samples);
+ }
if (attachment == QGLFramebufferObject::CombinedDepthStencil
&& (QGLExtensions::glExtensions & QGLExtensions::PackedDepthStencil)) {
// depth and stencil buffer needs another extension
- glGenRenderbuffersEXT(1, &depth_stencil_buffer);
- Q_ASSERT(!glIsRenderbufferEXT(depth_stencil_buffer));
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth_stencil_buffer);
- Q_ASSERT(glIsRenderbufferEXT(depth_stencil_buffer));
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH24_STENCIL8_EXT, size.width(), size.height());
+ glGenRenderbuffers(1, &depth_stencil_buffer);
+ Q_ASSERT(!glIsRenderbuffer(depth_stencil_buffer));
+ glBindRenderbuffer(GL_RENDERBUFFER_EXT, depth_stencil_buffer);
+ Q_ASSERT(glIsRenderbuffer(depth_stencil_buffer));
+ if (samples != 0 && glRenderbufferStorageMultisampleEXT)
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples,
+ GL_DEPTH24_STENCIL8_EXT, size.width(), size.height());
+ else
+ glRenderbufferStorage(GL_RENDERBUFFER_EXT,
+ GL_DEPTH24_STENCIL8_EXT, size.width(), size.height());
+
GLint i = 0;
- glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
+ glGetRenderbufferParameteriv(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, depth_stencil_buffer);
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, depth_stencil_buffer);
fbo_attachment = QGLFramebufferObject::CombinedDepthStencil;
+
valid = checkFramebufferStatus();
if (!valid)
- glDeleteRenderbuffersEXT(1, &depth_stencil_buffer);
+ glDeleteRenderbuffers(1, &depth_stencil_buffer);
} else if (attachment == QGLFramebufferObject::Depth
|| attachment == QGLFramebufferObject::CombinedDepthStencil)
{
- glGenRenderbuffersEXT(1, &depth_stencil_buffer);
- Q_ASSERT(!glIsRenderbufferEXT(depth_stencil_buffer));
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth_stencil_buffer);
- Q_ASSERT(glIsRenderbufferEXT(depth_stencil_buffer));
+ glGenRenderbuffers(1, &depth_stencil_buffer);
+ Q_ASSERT(!glIsRenderbuffer(depth_stencil_buffer));
+ glBindRenderbuffer(GL_RENDERBUFFER_EXT, depth_stencil_buffer);
+ Q_ASSERT(glIsRenderbuffer(depth_stencil_buffer));
+ if (samples != 0 && glRenderbufferStorageMultisampleEXT) {
#ifdef QT_OPENGL_ES
#define GL_DEPTH_COMPONENT16 0x81A5
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16, size.width(), size.height());
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples,
+ GL_DEPTH_COMPONENT16, size.width(), size.height());
#else
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, size.width(), size.height());
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples,
+ GL_DEPTH_COMPONENT, size.width(), size.height());
#endif
+ } else {
+#ifdef QT_OPENGL_ES
+#define GL_DEPTH_COMPONENT16 0x81A5
+ glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16, size.width(), size.height());
+#else
+ glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, size.width(), size.height());
+#endif
+ }
GLint i = 0;
- glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
+ glGetRenderbufferParameteriv(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, depth_stencil_buffer);
fbo_attachment = QGLFramebufferObject::Depth;
valid = checkFramebufferStatus();
if (!valid)
- glDeleteRenderbuffersEXT(1, &depth_stencil_buffer);
+ glDeleteRenderbuffers(1, &depth_stencil_buffer);
} else {
fbo_attachment = QGLFramebufferObject::NoAttachment;
}
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->current_fbo);
if (!valid) {
- glDeleteTextures(1, &texture);
- glDeleteFramebuffersEXT(1, &fbo);
+ if (color_buffer)
+ glDeleteRenderbuffers(1, &color_buffer);
+ else
+ glDeleteTextures(1, &texture);
+ glDeleteFramebuffers(1, &fbo);
}
QT_CHECK_GLERROR();
+
+ format.setTextureTarget(target);
+ format.setSamples(int(samples));
+ format.setAttachment(fbo_attachment);
+ format.setInternalFormat(internal_format);
}
/*!
@@ -264,13 +540,18 @@ void QGLFramebufferObjectPrivate::init(const QSize &sz, QGLFramebufferObject::At
framebuffer objects more portable.
\endlist
- Note that primitives drawn to a QGLFramebufferObject with QPainter
- will only be antialiased if the QPainter::HighQualityAntialiasing
- render hint is set. This is because there is currently no support
- for the \c{GL_EXT_framebuffer_multisample} extension, which is
- required to do multisample based antialiasing. Also note that the
- QPainter::HighQualityAntialiasing render hint requires the
- \c{GL_ARB_fragment_program} extension to work in OpenGL.
+ Note that you need to create a QGLFramebufferObject with more than one
+ sample per pixel for primitives to be antialiased when drawing using a
+ QPainter, unless if the QPainter::HighQualityAntialiasing render hint is
+ set. The QPainter::HighQualityAntialiasing render hint will enable
+ antialiasing as long as the \c{GL_ARB_fragment_program} extension is
+ present. To create a multisample framebuffer object you should use one of
+ the constructors that take a QGLFramebufferObject parameter, and set the
+ QGLFramebufferObject::samples() property to a non-zero value.
+
+ If you want to use a framebuffer object with multisampling enabled
+ as a texture, you first need to copy from it to a regular framebuffer
+ object using QGLContext::blitFramebuffer().
\sa {Framebuffer Object Example}
*/
@@ -358,6 +639,32 @@ QGLFramebufferObject::QGLFramebufferObject(int width, int height, GLenum target)
d->init(QSize(width, height), NoAttachment, target, DEFAULT_FORMAT);
}
+/*! \overload
+
+ Constructs an OpenGL framebuffer object of the given \a size based on the
+ supplied \a format.
+*/
+
+QGLFramebufferObject::QGLFramebufferObject(const QSize &size, const QGLFramebufferObjectFormat &format)
+ : d_ptr(new QGLFramebufferObjectPrivate)
+{
+ Q_D(QGLFramebufferObject);
+ d->init(size, format.attachment(), format.textureTarget(), format.internalFormat(), format.samples());
+}
+
+/*! \overload
+
+ Constructs an OpenGL framebuffer object of the given \a width and \a height
+ based on the supplied \a format.
+*/
+
+QGLFramebufferObject::QGLFramebufferObject(int width, int height, const QGLFramebufferObjectFormat &format)
+ : d_ptr(new QGLFramebufferObjectPrivate)
+{
+ Q_D(QGLFramebufferObject);
+ d->init(QSize(width, height), format.attachment(), format.textureTarget(), format.internalFormat(), format.samples());
+}
+
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
/*! \internal */
QGLFramebufferObject::QGLFramebufferObject(int width, int height, QMacCompatGLenum target)
@@ -445,9 +752,11 @@ QGLFramebufferObject::~QGLFramebufferObject()
|| qgl_share_reg()->checkSharing(d->ctx, QGLContext::currentContext())))
{
glDeleteTextures(1, &d->texture);
+ if (d->color_buffer)
+ glDeleteRenderbuffers(1, &d->color_buffer);
if (d->depth_stencil_buffer)
- glDeleteRenderbuffersEXT(1, &d->depth_stencil_buffer);
- glDeleteFramebuffersEXT(1, &d->fbo);
+ glDeleteRenderbuffers(1, &d->depth_stencil_buffer);
+ glDeleteFramebuffers(1, &d->fbo);
}
delete d_ptr;
}
@@ -490,13 +799,15 @@ bool QGLFramebufferObject::bind()
return false;
Q_D(QGLFramebufferObject);
QGL_FUNC_CONTEXT;
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, d->fbo);
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, d->fbo);
d->bound = d->valid = d->checkFramebufferStatus();
const QGLContext *context = QGLContext::currentContext();
if (d->valid && context) {
// Save the previous setting to automatically restore in release().
- d->previous_fbo = context->d_ptr->current_fbo;
- context->d_ptr->current_fbo = d->fbo;
+ if (context->d_ptr->current_fbo != d->fbo) {
+ d->previous_fbo = context->d_ptr->current_fbo;
+ context->d_ptr->current_fbo = d->fbo;
+ }
}
return d->valid;
}
@@ -520,18 +831,19 @@ bool QGLFramebufferObject::release()
return false;
Q_D(QGLFramebufferObject);
QGL_FUNC_CONTEXT;
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- d->valid = d->checkFramebufferStatus();
d->bound = false;
+
const QGLContext *context = QGLContext::currentContext();
- if (d->valid && context) {
+ if (context) {
// Restore the previous setting for stacked framebuffer objects.
- context->d_ptr->current_fbo = d->previous_fbo;
- if (d->previous_fbo)
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, d->previous_fbo);
+ if (d->previous_fbo != context->d_ptr->current_fbo) {
+ context->d_ptr->current_fbo = d->previous_fbo;
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, d->previous_fbo);
+ }
d->previous_fbo = 0;
}
- return d->valid;
+
+ return true;
}
/*!
@@ -540,6 +852,9 @@ bool QGLFramebufferObject::release()
Returns the texture id for the texture attached as the default
rendering target in this framebuffer object. This texture id can
be bound as a normal texture in your own GL code.
+
+ If a multisample framebuffer object is used then the value returned
+ from this function will be invalid.
*/
GLuint QGLFramebufferObject::texture() const
{
@@ -560,6 +875,15 @@ QSize QGLFramebufferObject::size() const
}
/*!
+ Returns the format of this framebuffer object.
+*/
+const QGLFramebufferObjectFormat &QGLFramebufferObject::format() const
+{
+ Q_D(const QGLFramebufferObject);
+ return d->format;
+}
+
+/*!
\fn QImage QGLFramebufferObject::toImage() const
Returns the contents of this framebuffer object as a QImage.
@@ -577,17 +901,27 @@ QImage QGLFramebufferObject::toImage() const
return image;
}
-#if !defined(QT_OPENGL_ES_2)
-Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_buffer_paintengine)
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_buffer_2_engine)
+#endif
+
+#ifndef QT_OPENGL_ES_2
+Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_buffer_engine)
#endif
/*! \reimp */
QPaintEngine *QGLFramebufferObject::paintEngine() const
{
-#if !defined(QT_OPENGL_ES_2)
- return qt_buffer_paintengine();
+#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
+ return qt_buffer_engine();
+#elif defined(QT_OPENGL_ES_2)
+ return qt_buffer_2_engine();
#else
- return 0;
+ Q_D(const QGLFramebufferObject);
+ if (d->ctx->d_func()->internal_context || qt_gl_preferGL2Engine())
+ return qt_buffer_2_engine();
+ else
+ return qt_buffer_engine();
#endif
}
@@ -599,7 +933,8 @@ QPaintEngine *QGLFramebufferObject::paintEngine() const
*/
bool QGLFramebufferObject::hasOpenGLFramebufferObjects()
{
- QGLWidget dmy; // needed to detect and init the QGLExtensions object
+ if (!QGLContext::currentContext())
+ QGLWidget dmy; // needed to detect and init the QGLExtensions object
return (QGLExtensions::glExtensions & QGLExtensions::FramebufferObject);
}
@@ -654,15 +989,16 @@ void QGLFramebufferObject::drawTexture(const QPointF &point, QMacCompatGLuint te
}
#endif
-extern int qt_defaultDpi();
+extern int qt_defaultDpiX();
+extern int qt_defaultDpiY();
/*! \reimp */
int QGLFramebufferObject::metric(PaintDeviceMetric metric) const
{
Q_D(const QGLFramebufferObject);
- float dpmx = qt_defaultDpi()*100./2.54;
- float dpmy = qt_defaultDpi()*100./2.54;
+ float dpmx = qt_defaultDpiX()*100./2.54;
+ float dpmy = qt_defaultDpiY()*100./2.54;
int w = d->size.width();
int h = d->size.height();
switch (metric) {
@@ -685,16 +1021,16 @@ int QGLFramebufferObject::metric(PaintDeviceMetric metric) const
return 32;//d->depth;
case PdmDpiX:
- return (int)(dpmx * 0.0254);
+ return qRound(dpmx * 0.0254);
case PdmDpiY:
- return (int)(dpmy * 0.0254);
+ return qRound(dpmy * 0.0254);
case PdmPhysicalDpiX:
- return (int)(dpmx * 0.0254);
+ return qRound(dpmx * 0.0254);
case PdmPhysicalDpiY:
- return (int)(dpmy * 0.0254);
+ return qRound(dpmy * 0.0254);
default:
qWarning("QGLFramebufferObject::metric(), Unhandled metric type: %d.\n", metric);
@@ -750,4 +1086,85 @@ bool QGLFramebufferObject::isBound() const
return d->bound;
}
+/*!
+ \fn bool QGLFramebufferObject::hasOpenGLFramebufferBlit()
+
+ \since 4.6
+
+ Returns true if the OpenGL \c{GL_EXT_framebuffer_blit} extension
+ is present on this system; otherwise returns false.
+*/
+bool QGLFramebufferObject::hasOpenGLFramebufferBlit()
+{
+ if (!QGLContext::currentContext())
+ QGLWidget dmy; // needed to detect and init the QGLExtensions object
+ return (QGLExtensions::glExtensions & QGLExtensions::FramebufferBlit);
+}
+
+/*!
+ \since 4.6
+
+ Blits from the \a sourceRect rectangle in the \a source framebuffer
+ object to the \a targetRect rectangle in the \a target framebuffer object.
+
+ If \a source or \a target is 0, the default framebuffer will be used
+ instead of a framebuffer object as source or target respectively.
+
+ The \a buffers parameter should be a mask consisting of any combination of
+ COLOR_BUFFER_BIT, DEPTH_BUFFER_BIT, and STENCIL_BUFFER_BIT. Any buffer type
+ that is not present both in the source and target buffers is ignored.
+
+ The \a sourceRect and \a targetRect rectangles may have different sizes;
+ in this case \a buffers should not contain DEPTH_BUFFER_BIT or
+ STENCIL_BUFFER_BIT. The \a filter parameter should be set to GL_LINEAR or
+ GL_NEAREST, and specifies whether linear or nearest interpolation should
+ be used when scaling is performed.
+
+ If \a source equals \a target a copy is performed within the same buffer.
+ Results are undefined if the source and target rectangles overlap and
+ have different sizes. The sizes must also be the same if any of the
+ framebuffer objects are multisample framebuffers.
+
+ Note that the scissor test will restrict the blit area if enabled.
+
+ This function will have no effect unless hasOpenGLFramebufferBlit() returns
+ true.
+*/
+void QGLFramebufferObject::blitFramebuffer(QGLFramebufferObject *target, const QRect &targetRect,
+ QGLFramebufferObject *source, const QRect &sourceRect,
+ GLbitfield buffers,
+ GLenum filter)
+{
+ if (!(QGLExtensions::glExtensions & QGLExtensions::FramebufferBlit))
+ return;
+
+ const QGLContext *ctx = QGLContext::currentContext();
+ if (!ctx)
+ return;
+
+ const int height = ctx->device()->height();
+
+ const int sh = source ? source->height() : height;
+ const int th = target ? target->height() : height;
+
+ const int sx0 = sourceRect.left();
+ const int sx1 = sourceRect.left() + sourceRect.width();
+ const int sy0 = sh - (sourceRect.top() + sourceRect.height());
+ const int sy1 = sh - sourceRect.top();
+
+ const int tx0 = targetRect.left();
+ const int tx1 = targetRect.left() + targetRect.width();
+ const int ty0 = th - (targetRect.top() + targetRect.height());
+ const int ty1 = th - targetRect.top();
+
+ glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, source ? source->handle() : 0);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, target ? target->handle() : 0);
+
+ glBlitFramebufferEXT(sx0, sy0, sx1, sy1,
+ tx0, ty0, tx1, ty1,
+ buffers, filter);
+
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->current_fbo);
+}
+
QT_END_NAMESPACE
diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h
index a9e1b2f..0a2a9d2 100644
--- a/src/opengl/qglframebufferobject.h
+++ b/src/opengl/qglframebufferobject.h
@@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(OpenGL)
class QGLFramebufferObjectPrivate;
+class QGLFramebufferObjectFormat;
class Q_OPENGL_EXPORT QGLFramebufferObject : public QPaintDevice
{
@@ -77,6 +78,9 @@ public:
GLenum target = GL_TEXTURE_2D, GLenum internal_format = GL_RGBA);
#endif
+ QGLFramebufferObject(const QSize &size, const QGLFramebufferObjectFormat &format);
+ QGLFramebufferObject(int width, int height, const QGLFramebufferObjectFormat &format);
+
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
QGLFramebufferObject(const QSize &size, QMacCompatGLenum target = GL_TEXTURE_2D);
QGLFramebufferObject(int width, int height, QMacCompatGLenum target = GL_TEXTURE_2D);
@@ -89,10 +93,13 @@ public:
virtual ~QGLFramebufferObject();
+ const QGLFramebufferObjectFormat &format() const;
+
bool isValid() const;
bool isBound() const;
bool bind();
bool release();
+
GLuint texture() const;
QSize size() const;
QImage toImage() const;
@@ -110,6 +117,12 @@ public:
void drawTexture(const QPointF &point, QMacCompatGLuint textureId, QMacCompatGLenum textureTarget = GL_TEXTURE_2D);
#endif
+ static bool hasOpenGLFramebufferBlit();
+ static void blitFramebuffer(QGLFramebufferObject *target, const QRect &targetRect,
+ QGLFramebufferObject *source, const QRect &sourceRect,
+ GLbitfield buffers = GL_COLOR_BUFFER_BIT,
+ GLenum filter = GL_NEAREST);
+
protected:
int metric(PaintDeviceMetric metric) const;
int devType() const { return QInternal::FramebufferObject; }
@@ -120,6 +133,42 @@ private:
friend class QGLDrawable;
};
+class QGLFramebufferObjectFormatPrivate;
+class Q_OPENGL_EXPORT QGLFramebufferObjectFormat
+{
+public:
+#if !defined(QT_OPENGL_ES) || defined(Q_QDOC)
+ QGLFramebufferObjectFormat(int samples = 0,
+ QGLFramebufferObject::Attachment attachment = QGLFramebufferObject::NoAttachment,
+ GLenum target = GL_TEXTURE_2D,
+ GLenum internalFormat = GL_RGBA8);
+#else
+ QGLFramebufferObjectFormat(int samples = 0,
+ QGLFramebufferObject::Attachment attachment = QGLFramebufferObject::NoAttachment,
+ GLenum target = GL_TEXTURE_2D,
+ GLenum internalFormat = GL_RGBA);
+#endif
+
+ QGLFramebufferObjectFormat(const QGLFramebufferObjectFormat &other);
+ QGLFramebufferObjectFormat &operator=(const QGLFramebufferObjectFormat &other);
+ ~QGLFramebufferObjectFormat();
+
+ void setSamples(int samples);
+ int samples() const;
+
+ void setAttachment(QGLFramebufferObject::Attachment attachment);
+ QGLFramebufferObject::Attachment attachment() const;
+
+ void setTextureTarget(GLenum target);
+ GLenum textureTarget() const;
+
+ void setInternalFormat(GLenum internalFormat);
+ GLenum internalFormat() const;
+
+private:
+ QGLFramebufferObjectFormatPrivate *d;
+};
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp
index 5f74f26..483856a 100644
--- a/src/opengl/qglpixelbuffer.cpp
+++ b/src/opengl/qglpixelbuffer.cpp
@@ -76,12 +76,13 @@
\sa {opengl/pbuffers}{Pbuffers Example}
*/
+#include <private/qpaintengineex_opengl2_p.h>
#include <qglpixelbuffer.h>
#include <private/qglpixelbuffer_p.h>
#include <qimage.h>
-#if !defined(QT_OPENGL_ES_2)
+#ifndef QT_OPENGL_ES_2
#include <private/qpaintengine_opengl_p.h>
#endif
@@ -363,29 +364,39 @@ bool QGLPixelBuffer::isValid() const
return !d->invalid;
}
-#if !defined(QT_OPENGL_ES_2)
-Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_buffer_paintengine)
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
+Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_buffer_2_engine)
+#endif
+
+#ifndef QT_OPENGL_ES_2
+Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_buffer_engine)
#endif
/*! \reimp */
QPaintEngine *QGLPixelBuffer::paintEngine() const
{
-#if !defined(QT_OPENGL_ES_2)
- return qt_buffer_paintengine();
+#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
+ return qt_buffer_engine();
+#elif defined(QT_OPENGL_ES_2)
+ return qt_buffer_2_engine();
#else
- return 0;
+ if (d_ptr->qctx->d_func()->internal_context || qt_gl_preferGL2Engine())
+ return qt_buffer_2_engine();
+ else
+ return qt_buffer_engine();
#endif
}
-extern int qt_defaultDpi();
+extern int qt_defaultDpiX();
+extern int qt_defaultDpiY();
/*! \reimp */
int QGLPixelBuffer::metric(PaintDeviceMetric metric) const
{
Q_D(const QGLPixelBuffer);
- float dpmx = qt_defaultDpi()*100./2.54;
- float dpmy = qt_defaultDpi()*100./2.54;
+ float dpmx = qt_defaultDpiX()*100./2.54;
+ float dpmy = qt_defaultDpiY()*100./2.54;
int w = d->req_size.width();
int h = d->req_size.height();
switch (metric) {
@@ -408,16 +419,16 @@ int QGLPixelBuffer::metric(PaintDeviceMetric metric) const
return 32;//d->depth;
case PdmDpiX:
- return (int)(dpmx * 0.0254);
+ return qRound(dpmx * 0.0254);
case PdmDpiY:
- return (int)(dpmy * 0.0254);
+ return qRound(dpmy * 0.0254);
case PdmPhysicalDpiX:
- return (int)(dpmx * 0.0254);
+ return qRound(dpmx * 0.0254);
case PdmPhysicalDpiY:
- return (int)(dpmy * 0.0254);
+ return qRound(dpmy * 0.0254);
default:
qWarning("QGLPixelBuffer::metric(), Unhandled metric type: %d\n", metric);
diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp
index 83e6717..275bbed 100644
--- a/src/opengl/qglpixmapfilter.cpp
+++ b/src/opengl/qglpixmapfilter.cpp
@@ -116,10 +116,8 @@ QPixmapFilter *QGLContextPrivate::createPixmapFilter(int type) const
return 0;
}
-#if !defined(QT_OPENGL_ES_2)
extern void qt_add_rect_to_array(const QRectF &r, q_vertexType *array);
extern void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, q_vertexType *array);
-#endif
static void qgl_drawTexture(const QRectF &rect, int tx_width, int tx_height, const QRectF & src)
{
@@ -194,15 +192,15 @@ bool QGLPixmapColorizeFilter::processGL(QPainter *, const QPointF &pos, const QP
// generates convolution filter code for arbitrary sized kernel
QByteArray QGLPixmapConvolutionFilter::generateConvolutionShader() const {
QByteArray code;
- code.append("uniform sampler2D texture;\n");
- code.append("uniform vec2 inv_texture_size;\n");
- code.append("uniform float matrix[");
+ code.append("uniform sampler2D texture;\n"
+ "uniform vec2 inv_texture_size;\n"
+ "uniform float matrix[");
code.append(QByteArray::number(m_kernelWidth * m_kernelHeight));
- code.append("];\n");
- code.append("vec2 offset[");
+ code.append("];\n"
+ "vec2 offset[");
code.append(QByteArray::number(m_kernelWidth*m_kernelHeight));
- code.append("];\n");
- code.append("void main(void) {\n");
+ code.append("];\n"
+ "void main(void) {\n");
for(int y = 0; y < m_kernelHeight; y++) {
for(int x = 0; x < m_kernelWidth; x++) {
@@ -212,22 +210,21 @@ QByteArray QGLPixmapConvolutionFilter::generateConvolutionShader() const {
code.append(QByteArray::number(x-(int)(m_kernelWidth/2)));
code.append(".0, inv_texture_size.y * ");
code.append(QByteArray::number((int)(m_kernelHeight/2)-y));
- code.append(".0)");
- code.append(";\n");
+ code.append(".0);\n");
}
}
- code.append(" int i = 0;\n");
- code.append(" vec2 coords = gl_TexCoord[0].st;\n");
- code.append(" vec4 sum = vec4(0.0);\n");
- code.append(" for (i = 0; i < ");
+ code.append(" int i = 0;\n"
+ " vec2 coords = gl_TexCoord[0].st;\n"
+ " vec4 sum = vec4(0.0);\n"
+ " for (i = 0; i < ");
code.append(QByteArray::number(m_kernelWidth * m_kernelHeight));
- code.append("; i++) {\n");
- code.append(" vec4 tmp = texture2D(texture,coords+offset[i]);\n");
- code.append(" sum += matrix[i] * tmp;\n");
- code.append(" }\n");
- code.append(" gl_FragColor = sum;\n");
- code.append("}");
+ code.append("; i++) {\n"
+ " vec4 tmp = texture2D(texture,coords+offset[i]);\n"
+ " sum += matrix[i] * tmp;\n"
+ " }\n"
+ " gl_FragColor = sum;\n"
+ "}");
return code;
}
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index 4259a5c..e3d8a1d 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -39,7 +39,6 @@
**
****************************************************************************/
-#include <private/qtextengine_p.h>
#include <qdebug.h>
#include <private/qfontengine_p.h>
#include <qmath.h>
@@ -57,13 +56,11 @@
#include "qpen.h"
#include "qvarlengtharray.h"
#include <private/qpainter_p.h>
-#include <qglpixelbuffer.h>
#include <private/qglpixelbuffer_p.h>
#include <private/qbezier_p.h>
#include <qglframebufferobject.h>
#include "private/qtessellator_p.h"
-#include "private/qwindowsurface_gl_p.h"
#include "util/fragmentprograms_p.h"
@@ -125,35 +122,6 @@ struct QT_PointF {
qreal y;
};
-void qt_add_rect_to_array(const QRectF &r, q_vertexType *array)
-{
- qreal left = r.left();
- qreal right = r.right();
- qreal top = r.top();
- qreal bottom = r.bottom();
-
- array[0] = f2vt(left);
- array[1] = f2vt(top);
- array[2] = f2vt(right);
- array[3] = f2vt(top);
- array[4] = f2vt(right);
- array[5] = f2vt(bottom);
- array[6] = f2vt(left);
- array[7] = f2vt(bottom);
-}
-
-void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, q_vertexType *array)
-{
- array[0] = f2vt(x1);
- array[1] = f2vt(y1);
- array[2] = f2vt(x2);
- array[3] = f2vt(y1);
- array[4] = f2vt(x2);
- array[5] = f2vt(y2);
- array[6] = f2vt(x1);
- array[7] = f2vt(y2);
-}
-
struct QGLTrapezoid
{
QGLTrapezoid()
@@ -190,180 +158,6 @@ const QGLTrapezoid QGLTrapezoid::translated(const QPointF &delta) const
return trap;
}
-class QGLDrawable {
-public:
- QGLDrawable() : widget(0), buffer(0), fbo(0)
- , wsurf(0)
- {}
- inline void setDevice(QPaintDevice *pdev);
- inline void swapBuffers();
- inline void makeCurrent();
- inline void doneCurrent();
- inline QSize size() const;
- inline QGLFormat format() const;
- inline GLuint bindTexture(const QImage &image, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA);
- inline GLuint bindTexture(const QPixmap &pixmap, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA);
- inline QColor backgroundColor() const;
- inline QGLContext *context() const;
- inline bool autoFillBackground() const;
-
-private:
- bool wasBound;
- QGLWidget *widget;
- QGLPixelBuffer *buffer;
- QGLFramebufferObject *fbo;
-#ifdef Q_WS_QWS
- QWSGLWindowSurface *wsurf;
-#else
- QGLWindowSurface *wsurf;
-#endif
-};
-
-void QGLDrawable::setDevice(QPaintDevice *pdev)
-{
- wasBound = false;
- widget = 0;
- buffer = 0;
- fbo = 0;
-#ifdef Q_WS_QWS
- wsurf = 0;
-#endif
- if (pdev->devType() == QInternal::Widget)
- widget = static_cast<QGLWidget *>(pdev);
- else if (pdev->devType() == QInternal::Pbuffer)
- buffer = static_cast<QGLPixelBuffer *>(pdev);
- else if (pdev->devType() == QInternal::FramebufferObject)
- fbo = static_cast<QGLFramebufferObject *>(pdev);
- else if (pdev->devType() == QInternal::UnknownDevice)
-#ifdef Q_WS_QWS
- wsurf = static_cast<QWSGLPaintDevice*>(pdev)->windowSurface();
-#else
- wsurf = static_cast<QGLWindowSurface *>(pdev);
-#endif
-}
-
-inline void QGLDrawable::swapBuffers()
-{
- if (widget) {
- if (widget->autoBufferSwap())
- widget->swapBuffers();
- } else {
- glFlush();
- }
-}
-
-inline void QGLDrawable::makeCurrent()
-{
- if (widget)
- widget->makeCurrent();
- else if (buffer)
- buffer->makeCurrent();
- else if (wsurf)
- wsurf->context()->makeCurrent();
- else if (fbo) {
- wasBound = fbo->isBound();
- if (!wasBound)
- fbo->bind();
- }
-}
-
-inline void QGLDrawable::doneCurrent()
-{
- if (fbo && !wasBound)
- fbo->release();
-}
-
-inline QSize QGLDrawable::size() const
-{
- if (widget) {
- return QSize(widget->d_func()->glcx->device()->width(),
- widget->d_func()->glcx->device()->height());
- } else if (buffer) {
- return buffer->size();
- } else if (fbo) {
- return fbo->size();
- } else if (wsurf) {
-#ifdef Q_WS_QWS
- return wsurf->window()->frameSize();
-#else
- return QSize(wsurf->width(), wsurf->height());
-#endif
- }
- return QSize();
-}
-
-inline QGLFormat QGLDrawable::format() const
-{
- if (widget)
- return widget->format();
- else if (buffer)
- return buffer->format();
- else if (wsurf)
- return wsurf->context()->format();
- else if (fbo && QGLContext::currentContext()) {
- QGLFormat fmt = QGLContext::currentContext()->format();
- fmt.setStencil(fbo->attachment() == QGLFramebufferObject::CombinedDepthStencil);
- fmt.setDepth(fbo->attachment() != QGLFramebufferObject::NoAttachment);
- return fmt;
- }
-
- return QGLFormat();
-}
-
-inline GLuint QGLDrawable::bindTexture(const QImage &image, GLenum target, GLint format)
-{
- if (widget)
- return widget->d_func()->glcx->d_func()->bindTexture(image, target, format, true);
- else if (buffer)
- return buffer->d_func()->qctx->d_func()->bindTexture(image, target, format, true);
- else if (fbo && QGLContext::currentContext())
- return const_cast<QGLContext *>(QGLContext::currentContext())->d_func()->bindTexture(image, target, format, true);
- else if (wsurf)
- return wsurf->context()->d_func()->bindTexture(image, target, format, true);
- return 0;
-}
-
-inline GLuint QGLDrawable::bindTexture(const QPixmap &pixmap, GLenum target, GLint format)
-{
- if (widget)
- return widget->d_func()->glcx->d_func()->bindTexture(pixmap, target, format, true);
- else if (buffer)
- return buffer->d_func()->qctx->d_func()->bindTexture(pixmap, target, format, true);
- else if (fbo && QGLContext::currentContext())
- return const_cast<QGLContext *>(QGLContext::currentContext())->d_func()->bindTexture(pixmap, target, format, true);
- else if (wsurf)
- return wsurf->context()->d_func()->bindTexture(pixmap, target, format, true);
- return 0;
-}
-
-inline QColor QGLDrawable::backgroundColor() const
-{
- if (widget)
- return widget->palette().brush(widget->backgroundRole()).color();
- return QApplication::palette().brush(QPalette::Background).color();
-}
-
-inline QGLContext *QGLDrawable::context() const
-{
- if (widget)
- return widget->d_func()->glcx;
- else if (buffer)
- return buffer->d_func()->qctx;
- else if (fbo)
- return const_cast<QGLContext *>(QGLContext::currentContext());
- else if (wsurf)
- return wsurf->context();
- return 0;
-}
-
-inline bool QGLDrawable::autoFillBackground() const
-{
- if (widget)
- return widget->autoFillBackground();
- else
- return false;
-}
-
class QOpenGLImmediateModeTessellator;
class QGLMaskGenerator;
@@ -1536,9 +1330,15 @@ bool QOpenGLPaintEngine::begin(QPaintDevice *pdev)
d->offscreen.begin();
- const QColor &c = d->drawable.backgroundColor();
- glClearColor(c.redF(), c.greenF(), c.blueF(), 1.0);
if (d->drawable.context()->d_func()->clear_on_painter_begin && d->drawable.autoFillBackground()) {
+
+ if (d->drawable.hasTransparentBackground())
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ else {
+ const QColor &c = d->drawable.backgroundColor();
+ glClearColor(c.redF(), c.greenF(), c.blueF(), 1.0);
+ }
+
GLbitfield clearBits = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT;
#ifndef QT_OPENGL_ES
clearBits |= GL_ACCUM_BUFFER_BIT;
@@ -2444,11 +2244,12 @@ void QOpenGLPaintEnginePrivate::updateDepthClip()
return;
}
-#ifndef QT_OPENGL_ES
- glClearDepth(0.0f);
-#else
+#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_ES_1_CL)
glClearDepthf(0.0f);
+#else
+ glClearDepth(0.0f);
#endif
+
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glClear(GL_DEPTH_BUFFER_BIT);
@@ -3284,6 +3085,9 @@ QGLTrapezoidMaskGenerator::QGLTrapezoidMaskGenerator(const QPainterPath &path, c
{
}
+extern void qt_add_rect_to_array(const QRectF &r, q_vertexType *array);
+extern void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, q_vertexType *array);
+
void QGLTrapezoidMaskGenerator::drawMask(const QRect &rect)
{
#ifdef QT_OPENGL_ES
@@ -5766,9 +5570,11 @@ void QOpenGLPaintEnginePrivate::ensureDrawableTexture()
QPixmapFilter *QOpenGLPaintEngine::createPixmapFilter(int type) const
{
+#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
if (QGLContext::currentContext())
return QGLContext::currentContext()->d_func()->createPixmapFilter(type);
else
+#endif
return 0;
}
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index b079557..85bcda5 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "qpixmap.h"
+#include "qglframebufferobject.h"
#include <private/qpaintengine_raster_p.h>
@@ -48,6 +49,8 @@
#include <private/qgl_p.h>
#include <private/qdrawhelper_p.h>
+#include <private/qpaintengineex_opengl2_p.h>
+
QT_BEGIN_NAMESPACE
extern QGLWidget* qt_gl_share_widget();
@@ -57,12 +60,14 @@ class QGLShareContextScope
public:
QGLShareContextScope(const QGLContext *ctx)
: m_oldContext(0)
- , m_ctx(const_cast<QGLContext *>(ctx))
{
- const QGLContext *currentContext = QGLContext::currentContext();
+ QGLContext *currentContext = const_cast<QGLContext *>(QGLContext::currentContext());
if (currentContext != ctx && !qgl_share_reg()->checkSharing(ctx, currentContext)) {
- m_oldContext = const_cast<QGLContext *>(currentContext);
+ m_oldContext = currentContext;
+ m_ctx = const_cast<QGLContext *>(ctx);
m_ctx->makeCurrent();
+ } else {
+ m_ctx = currentContext;
}
}
@@ -87,58 +92,29 @@ private:
QGLContext *m_ctx;
};
-void qt_gl_convertFromGLImage(QImage *img)
-{
- const int w = img->width();
- const int h = img->height();
-
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
- uint *p = (uint*)img->bits();
- uint *end = p + w*h;
-
- while (p < end) {
- uint a = *p << 24;
- *p = (*p >> 8) | a;
- p++;
- }
-
- *img = img->mirrored();
- } else {
- // mirror image
- uint *data = (uint *)img->bits();
-
- const int mid = h/2;
-
- for (int y = 0; y < mid; ++y) {
- uint *p = data + y * w;
- uint *end = p + w;
- uint *q = data + (h - y - 1) * w;
-
- while (p < end)
- qSwap(*p++, *q++);
- }
- }
-}
-
-
static int qt_gl_pixmap_serial = 0;
QGLPixmapData::QGLPixmapData(PixelType type)
: QPixmapData(type, OpenGLClass)
, m_width(0)
, m_height(0)
- , m_texture(0)
+ , m_renderFbo(0)
+ , m_textureId(0)
+ , m_engine(0)
+ , m_ctx(0)
, m_dirty(false)
+ , m_hasFillColor(false)
{
setSerialNumber(++qt_gl_pixmap_serial);
}
QGLPixmapData::~QGLPixmapData()
{
- if (m_texture && qt_gl_share_widget()) {
- QGLShareContextScope ctx(qt_gl_share_widget()->context());
- glDeleteTextures(1, &m_texture);
- }
+ QGLWidget *shareWidget = qt_gl_share_widget();
+ if (!shareWidget)
+ return;
+ QGLShareContextScope ctx(shareWidget->context());
+ glDeleteTextures(1, &m_textureId);
}
bool QGLPixmapData::isValid() const
@@ -148,6 +124,9 @@ bool QGLPixmapData::isValid() const
bool QGLPixmapData::isValidContext(const QGLContext *ctx) const
{
+ if (ctx == m_ctx)
+ return true;
+
const QGLContext *share_ctx = qt_gl_share_widget()->context();
return ctx == share_ctx || qgl_share_reg()->checkSharing(ctx, share_ctx);
}
@@ -160,6 +139,12 @@ void QGLPixmapData::resize(int width, int height)
m_width = width;
m_height = height;
+ if (m_textureId) {
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ glDeleteTextures(1, &m_textureId);
+ m_textureId = 0;
+ }
+
m_source = QImage();
m_dirty = isValid();
setSerialNumber(++qt_gl_pixmap_serial);
@@ -173,28 +158,37 @@ void QGLPixmapData::ensureCreated() const
m_dirty = false;
QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ m_ctx = ctx;
const GLenum format = qt_gl_preferredTextureFormat();
- const GLenum target = qt_gl_preferredTextureTarget();
-
- if (!m_texture)
- glGenTextures(1, &m_texture);
-
- glBindTexture(target, m_texture);
+ const GLenum target = GL_TEXTURE_2D;
+
+ if (!m_textureId) {
+ glGenTextures(1, &m_textureId);
+ glBindTexture(target, m_textureId);
+ glTexImage2D(target, 0, GL_RGBA, m_width, m_height, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, 0);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ }
- if (m_source.isNull()) {
- glTexImage2D(target, 0, GL_RGBA, m_width, m_height, 0, format, GL_UNSIGNED_BYTE, 0);
- } else {
+ if (!m_source.isNull()) {
const QImage tx = ctx->d_func()->convertToGLFormat(m_source, true, format);
- glBindTexture(target, m_texture);
- glTexImage2D(target, 0, GL_RGBA, m_width, m_height, 0, format,
- GL_UNSIGNED_BYTE, tx.bits());
+ glBindTexture(target, m_textureId);
+ glTexSubImage2D(target, 0, 0, 0, m_width, m_height, format,
+ GL_UNSIGNED_BYTE, tx.bits());
- m_source = QImage();
+ if (useFramebufferObjects())
+ m_source = QImage();
}
}
+QGLFramebufferObject *QGLPixmapData::fbo() const
+{
+ return m_renderFbo;
+}
+
void QGLPixmapData::fromImage(const QImage &image,
Qt::ImageConversionFlags)
{
@@ -203,6 +197,13 @@ void QGLPixmapData::fromImage(const QImage &image,
resize(image.width(), image.height());
m_source = image;
m_dirty = true;
+ m_hasFillColor = false;
+
+ if (m_textureId) {
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ glDeleteTextures(1, &m_textureId);
+ m_textureId = 0;
+ }
}
bool QGLPixmapData::scroll(int dx, int dy, const QRect &rect)
@@ -213,12 +214,27 @@ bool QGLPixmapData::scroll(int dx, int dy, const QRect &rect)
return false;
}
+void QGLPixmapData::copy(const QPixmapData *data, const QRect &rect)
+{
+ if (data->classId() != QPixmapData::OpenGLClass) {
+ QPixmapData::copy(data, rect);
+ return;
+ }
+
+ // can be optimized to do a framebuffer blit or similar ...
+ QPixmapData::copy(data, rect);
+}
+
void QGLPixmapData::fill(const QColor &color)
{
if (!isValid())
return;
- if (!m_source.isNull()) {
+ if (useFramebufferObjects()) {
+ m_source = QImage();
+ m_hasFillColor = true;
+ m_fillColor = color;
+ } else if (!m_source.isNull()) {
m_source.fill(PREMUL(color.rgba()));
} else {
// ## TODO: improve performance here
@@ -239,29 +255,114 @@ QImage QGLPixmapData::toImage() const
if (!isValid())
return QImage();
- if (!m_source.isNull())
+ if (m_renderFbo) {
+ copyBackFromRenderFbo(true);
+ } else if (!m_source.isNull()) {
return m_source;
- else if (m_dirty)
- return QImage(m_width, m_height, QImage::Format_ARGB32_Premultiplied);
+ } else if (m_dirty || m_hasFillColor) {
+ QImage img(m_width, m_height, QImage::Format_ARGB32_Premultiplied);
+ if (m_hasFillColor)
+ img.fill(PREMUL(m_fillColor.rgba()));
+ return img;
+ } else {
+ ensureCreated();
+ }
+
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ extern QImage qt_gl_read_texture(const QSize &size, bool alpha_format, bool include_alpha);
+ glBindTexture(GL_TEXTURE_2D, m_textureId);
+ return qt_gl_read_texture(QSize(m_width, m_height), true, true);
+}
+
+struct TextureBuffer
+{
+ QGLFramebufferObject *fbo;
+ QGL2PaintEngineEx *engine;
+};
+
+static QVector<TextureBuffer> textureBufferStack;
+static int currentTextureBuffer = 0;
+
+void QGLPixmapData::copyBackFromRenderFbo(bool keepCurrentFboBound) const
+{
+ if (!isValid())
+ return;
+
+ m_hasFillColor = false;
+
+ const QGLContext *share_ctx = qt_gl_share_widget()->context();
+ QGLShareContextScope ctx(share_ctx);
ensureCreated();
- QGLShareContextScope ctx(qt_gl_share_widget()->context());
- QImage img(m_width, m_height, QImage::Format_ARGB32_Premultiplied);
+ if (!ctx->d_ptr->fbo)
+ glGenFramebuffers(1, &ctx->d_ptr->fbo);
+
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->fbo);
+ glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+ GL_TEXTURE_2D, m_textureId, 0);
+
+ const int x0 = 0;
+ const int x1 = m_width;
+ const int y0 = 0;
+ const int y1 = m_height;
+
+ glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, m_renderFbo->handle());
+
+ glDisable(GL_SCISSOR_TEST);
+
+ glBlitFramebufferEXT(x0, y0, x1, y1,
+ x0, y0, x1, y1,
+ GL_COLOR_BUFFER_BIT,
+ GL_NEAREST);
+
+ if (keepCurrentFboBound)
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->current_fbo);
+}
+
+void QGLPixmapData::swapBuffers()
+{
+ if (!isValid())
+ return;
+
+ copyBackFromRenderFbo(false);
+ m_renderFbo->release();
+
+ --currentTextureBuffer;
+
+ m_renderFbo = 0;
+ m_engine = 0;
+}
+
+void QGLPixmapData::makeCurrent()
+{
+ if (isValid() && m_renderFbo)
+ m_renderFbo->bind();
+}
- GLenum format = qt_gl_preferredTextureFormat();
- GLenum target = qt_gl_preferredTextureTarget();
+void QGLPixmapData::doneCurrent()
+{
+ if (isValid() && m_renderFbo)
+ m_renderFbo->release();
+}
- glBindTexture(target, m_texture);
-#ifndef QT_OPENGL_ES
- glGetTexImage(target, 0, format, GL_UNSIGNED_BYTE, img.bits());
-#else
- // XXX - cannot download textures this way on OpenGL/ES.
-#endif
+static TextureBuffer createTextureBuffer(const QSize &size, QGL2PaintEngineEx *engine = 0)
+{
+ TextureBuffer buffer;
+ QGLFramebufferObjectFormat fmt;
+ fmt.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+ fmt.setSamples(4);
- qt_gl_convertFromGLImage(&img);
+ buffer.fbo = new QGLFramebufferObject(size, fmt);
+ buffer.engine = engine ? engine : new QGL2PaintEngineEx;
- return img;
+ return buffer;
+}
+
+bool QGLPixmapData::useFramebufferObjects()
+{
+ return QGLFramebufferObject::hasOpenGLFramebufferObjects()
+ && QGLFramebufferObject::hasOpenGLFramebufferBlit();
}
QPaintEngine* QGLPixmapData::paintEngine() const
@@ -269,23 +370,72 @@ QPaintEngine* QGLPixmapData::paintEngine() const
if (!isValid())
return 0;
- m_source = toImage();
- m_dirty = true;
+ if (m_engine)
+ return m_engine;
+ else if (!useFramebufferObjects()) {
+ m_dirty = true;
+ if (m_source.size() != size())
+ m_source = QImage(size(), QImage::Format_ARGB32_Premultiplied);
+ if (m_hasFillColor) {
+ m_source.fill(PREMUL(m_fillColor.rgba()));
+ m_hasFillColor = false;
+ }
+ return m_source.paintEngine();
+ }
+
+ extern QGLWidget* qt_gl_share_widget();
- return m_source.paintEngine();
+ if (!QGLContext::currentContext())
+ qt_gl_share_widget()->makeCurrent();
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+
+ if (textureBufferStack.size() <= currentTextureBuffer) {
+ textureBufferStack << createTextureBuffer(size());
+ } else {
+ QSize sz = textureBufferStack.at(currentTextureBuffer).fbo->size();
+ if (sz.width() < m_width || sz.height() < m_height) {
+ if (sz.width() < m_width)
+ sz.setWidth(qMax(m_width, qRound(sz.width() * 1.5)));
+ if (sz.height() < m_height)
+ sz.setHeight(qMax(m_height, qRound(sz.height() * 1.5)));
+ delete textureBufferStack.at(currentTextureBuffer).fbo;
+ textureBufferStack[currentTextureBuffer] =
+ createTextureBuffer(sz, textureBufferStack.at(currentTextureBuffer).engine);
+ qDebug() << "Creating new pixmap texture buffer:" << sz;
+ }
+ }
+
+ m_renderFbo = textureBufferStack.at(currentTextureBuffer).fbo;
+ m_engine = textureBufferStack.at(currentTextureBuffer).engine;
+
+ ++currentTextureBuffer;
+
+ return m_engine;
}
-GLuint QGLPixmapData::bind() const
+GLuint QGLPixmapData::bind(bool copyBack) const
{
- ensureCreated();
- glBindTexture(qt_gl_preferredTextureTarget(), m_texture);
- return m_texture;
+ if (m_renderFbo && copyBack) {
+ copyBackFromRenderFbo(true);
+ } else {
+ if (m_hasFillColor) {
+ m_dirty = true;
+ m_source = QImage(m_width, m_height, QImage::Format_ARGB32_Premultiplied);
+ m_source.fill(PREMUL(m_fillColor.rgba()));
+ m_hasFillColor = false;
+ }
+ ensureCreated();
+ }
+
+ GLuint id = m_textureId;
+ glBindTexture(GL_TEXTURE_2D, id);
+ return id;
}
GLuint QGLPixmapData::textureId() const
{
ensureCreated();
- return m_texture;
+ return m_textureId;
}
extern int qt_defaultDpiX();
diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h
index e450f01..1b6b7ae 100644
--- a/src/opengl/qpixmapdata_gl_p.h
+++ b/src/opengl/qpixmapdata_gl_p.h
@@ -60,6 +60,7 @@
QT_BEGIN_NAMESPACE
class QPaintEngine;
+class QGLFramebufferObject;
class QGLPixmapData : public QPixmapData
{
@@ -72,6 +73,7 @@ public:
void resize(int width, int height);
void fromImage(const QImage &image,
Qt::ImageConversionFlags flags);
+ void copy(const QPixmapData *data, const QRect &rect);
bool scroll(int dx, int dy, const QRect &rect);
@@ -80,13 +82,28 @@ public:
QImage toImage() const;
QPaintEngine* paintEngine() const;
- GLuint bind() const;
+ GLuint bind(bool copyBack = true) const;
GLuint textureId() const;
bool isValidContext(const QGLContext *ctx) const;
void ensureCreated() const;
+ bool isUninitialized() const { return m_dirty && m_source.isNull(); }
+
+ bool needsFill() const { return m_hasFillColor; }
+ QColor fillColor() const { return m_fillColor; }
+
+ QSize size() const { return QSize(m_width, m_height); }
+ int width() const { return m_width; }
+ int height() const { return m_height; }
+
+ QGLFramebufferObject *fbo() const;
+
+ void makeCurrent();
+ void doneCurrent();
+ void swapBuffers();
+
protected:
int metric(QPaintDevice::PaintDeviceMetric metric) const;
@@ -94,12 +111,26 @@ private:
QGLPixmapData(const QGLPixmapData &other);
QGLPixmapData &operator=(const QGLPixmapData &other);
+ void copyBackFromRenderFbo(bool keepCurrentFboBound) const;
+
+ static bool useFramebufferObjects();
+
int m_width;
int m_height;
- mutable GLuint m_texture;
- mutable bool m_dirty;
+ mutable QGLFramebufferObject *m_renderFbo;
+ mutable GLuint m_textureId;
+ mutable QPaintEngine *m_engine;
+ mutable QGLContext *m_ctx;
mutable QImage m_source;
+
+ // the texture is not in sync with the source image
+ mutable bool m_dirty;
+
+ // fill has been called and no painting has been done, so the pixmap is
+ // represented by a single fill color
+ mutable QColor m_fillColor;
+ mutable bool m_hasFillColor;
};
QT_END_NAMESPACE
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index b41adf9..965c7a5 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -69,7 +69,8 @@
#include <private/qglpixelbuffer_p.h>
#include <private/qgraphicssystem_gl_p.h>
-#include <private/qpaintengine_opengl_p.h>
+
+#include <private/qpaintengineex_opengl2_p.h>
#ifndef GLX_ARB_multisample
#define GLX_SAMPLE_BUFFERS_ARB 100000
@@ -100,17 +101,19 @@ QGLGraphicsSystem::QGLGraphicsSystem()
int i = 0;
int spec[16];
spec[i++] = GLX_RGBA;
-#if 0
spec[i++] = GLX_DOUBLEBUFFER;
- spec[i++] = GLX_DEPTH_SIZE;
- spec[i++] = 8;
- spec[i++] = GLX_STENCIL_SIZE;
- spec[i++] = 8;
- spec[i++] = GLX_SAMPLE_BUFFERS_ARB;
- spec[i++] = 1;
- spec[i++] = GLX_SAMPLES_ARB;
- spec[i++] = 4;
-#endif
+
+ if (!qgetenv("QT_GL_SWAPBUFFER_PRESERVE").isNull()) {
+ spec[i++] = GLX_DEPTH_SIZE;
+ spec[i++] = 8;
+ spec[i++] = GLX_STENCIL_SIZE;
+ spec[i++] = 8;
+ spec[i++] = GLX_SAMPLE_BUFFERS_ARB;
+ spec[i++] = 1;
+ spec[i++] = GLX_SAMPLES_ARB;
+ spec[i++] = 4;
+ }
+
spec[i++] = XNone;
XVisualInfo *vi = glXChooseVisual(X11->display, X11->defaultScreen, spec);
@@ -187,9 +190,10 @@ public:
}
void cleanup() {
- delete widget;
- widget = 0;
+ QGLWidget *w = widget;
cleanedUp = true;
+ widget = 0;
+ delete w;
}
static bool cleanedUp;
@@ -227,6 +231,7 @@ struct QGLWindowSurfacePrivate
int tried_fbo : 1;
int tried_pb : 1;
+ int destructive_swap_buffers : 1;
QGLContext *ctx;
@@ -250,6 +255,7 @@ QGLWindowSurface::QGLWindowSurface(QWidget *window)
d_ptr->ctx = 0;
d_ptr->tried_fbo = false;
d_ptr->tried_pb = false;
+ d_ptr->destructive_swap_buffers = qgetenv("QT_GL_SWAPBUFFER_PRESERVE").isNull();
}
QGLWindowSurface::~QGLWindowSurface()
@@ -287,18 +293,12 @@ void QGLWindowSurface::hijackWindow(QWidget *widget)
qDebug() << "hijackWindow() context created for" << widget << d_ptr->contexts.size();
}
-#if !defined(QT_OPENGL_ES_2)
-Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_window_surface_paintengine)
-#endif
+Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_window_surface_2_engine)
/*! \reimp */
QPaintEngine *QGLWindowSurface::paintEngine() const
{
-#if !defined(QT_OPENGL_ES_2)
- return qt_gl_window_surface_paintengine();
-#else
- return 0;
-#endif
+ return qt_gl_window_surface_2_engine();
}
int QGLWindowSurface::metric(PaintDeviceMetric m) const
@@ -313,6 +313,8 @@ QGLContext *QGLWindowSurface::context() const
QPaintDevice *QGLWindowSurface::paintDevice()
{
+ updateGeometry();
+
if (d_ptr->pb)
return d_ptr->pb;
@@ -328,6 +330,7 @@ static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize,
void QGLWindowSurface::beginPaint(const QRegion &)
{
+ updateGeometry();
}
void QGLWindowSurface::endPaint(const QRegion &rgn)
@@ -343,6 +346,9 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
QWidget *parent = widget->internalWinId() ? widget : widget->nativeParentWidget();
Q_ASSERT(parent);
+ if (!geometry().isValid())
+ return;
+
hijackWindow(parent);
QRect br = rgn.boundingRect().translated(offset);
@@ -350,53 +356,57 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
QPoint wOffset = qt_qwidget_data(parent)->wrect.topLeft();
QRect rect = br.translated(-offset - wOffset);
- const GLenum target = qt_gl_preferredTextureTarget();
+ const GLenum target = GL_TEXTURE_2D;
if (context()) {
context()->makeCurrent();
if (context()->format().doubleBuffer()) {
- glBindTexture(target, d_ptr->tex_id);
+#if !defined(QT_OPENGL_ES_2)
+ if (d_ptr->destructive_swap_buffers) {
+ glBindTexture(target, d_ptr->tex_id);
- QVector<QRect> rects = d_ptr->paintedRegion.rects();
- for (int i = 0; i < rects.size(); ++i) {
- QRect br = rects.at(i);
- if (br.isEmpty())
- continue;
+ QVector<QRect> rects = d_ptr->paintedRegion.rects();
+ for (int i = 0; i < rects.size(); ++i) {
+ QRect br = rects.at(i);
+ if (br.isEmpty())
+ continue;
- const uint bottom = window()->height() - (br.y() + br.height());
- glCopyTexSubImage2D(target, 0, br.x(), bottom, br.x(), bottom, br.width(), br.height());
- }
+ const uint bottom = window()->height() - (br.y() + br.height());
+ glCopyTexSubImage2D(target, 0, br.x(), bottom, br.x(), bottom, br.width(), br.height());
+ }
- glBindTexture(target, 0);
+ glBindTexture(target, 0);
- QRegion dirtyRegion = QRegion(window()->rect()) - d_ptr->paintedRegion;
+ QRegion dirtyRegion = QRegion(window()->rect()) - d_ptr->paintedRegion;
- if (!dirtyRegion.isEmpty()) {
- context()->makeCurrent();
+ if (!dirtyRegion.isEmpty()) {
+ context()->makeCurrent();
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
#ifndef QT_OPENGL_ES
- glOrtho(0, window()->width(), window()->height(), 0, -999999, 999999);
+ glOrtho(0, window()->width(), window()->height(), 0, -999999, 999999);
#else
- glOrthof(0, window()->width(), window()->height(), 0, -999999, 999999);
+ glOrthof(0, window()->width(), window()->height(), 0, -999999, 999999);
#endif
- glViewport(0, 0, window()->width(), window()->height());
+ glViewport(0, 0, window()->width(), window()->height());
- QVector<QRect> rects = dirtyRegion.rects();
- glColor4f(1, 1, 1, 1);
- for (int i = 0; i < rects.size(); ++i) {
- QRect rect = rects.at(i);
- if (rect.isEmpty())
- continue;
+ QVector<QRect> rects = dirtyRegion.rects();
+ glColor4f(1, 1, 1, 1);
+ for (int i = 0; i < rects.size(); ++i) {
+ QRect rect = rects.at(i);
+ if (rect.isEmpty())
+ continue;
- drawTexture(rect, d_ptr->tex_id, window()->size(), rect);
+ drawTexture(rect, d_ptr->tex_id, window()->size(), rect);
+ }
}
}
+#endif
d_ptr->paintedRegion = QRegion();
context()->swapBuffers();
@@ -421,48 +431,75 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
}
QSize size = widget->rect().size();
- if (ctx->format().doubleBuffer()) {
+ if (d_ptr->destructive_swap_buffers && ctx->format().doubleBuffer()) {
rect = parent->rect();
br = rect.translated(wOffset);
size = parent->size();
}
- ctx->makeCurrent();
+ glDisable(GL_SCISSOR_TEST);
+
+ if (d_ptr->fbo && QGLExtensions::glExtensions & QGLExtensions::FramebufferBlit) {
+ const int h = d_ptr->fbo->height();
+
+ const int x0 = rect.left();
+ const int x1 = rect.left() + rect.width();
+ const int y0 = h - (rect.top() + rect.height());
+ const int y1 = h - rect.top();
+
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, 0);
+
+ glBlitFramebufferEXT(x0, y0, x1, y1,
+ x0, y0, x1, y1,
+ GL_COLOR_BUFFER_BIT,
+ GL_NEAREST);
+
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, d_ptr->fbo->handle());
+ }
+#if !defined(QT_OPENGL_ES_2)
+ else {
+ glDisable(GL_DEPTH_TEST);
+
+ if (d_ptr->fbo) {
+ d_ptr->fbo->release();
+ } else {
+ ctx->makeCurrent();
#ifdef Q_WS_MAC
- ctx->updatePaintDevice();
+ ctx->updatePaintDevice();
#endif
- if (d_ptr->fbo)
- d_ptr->fbo->release();
+ }
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
#ifndef QT_OPENGL_ES
- glOrtho(0, size.width(), size.height(), 0, -999999, 999999);
+ glOrtho(0, size.width(), size.height(), 0, -999999, 999999);
#else
- glOrthof(0, size.width(), size.height(), 0, -999999, 999999);
+ glOrthof(0, size.width(), size.height(), 0, -999999, 999999);
#endif
- glViewport(0, 0, size.width(), size.height());
+ glViewport(0, 0, size.width(), size.height());
- glColor4f(1, 1, 1, 1);
- drawTexture(rect, texture, window()->size(), br);
+ glColor4f(1, 1, 1, 1);
+ drawTexture(rect, texture, window()->size(), br);
+
+ if (d_ptr->fbo)
+ d_ptr->fbo->bind();
+ }
+#endif
if (ctx->format().doubleBuffer())
ctx->swapBuffers();
else
glFlush();
-
- if (d_ptr->fbo)
- d_ptr->fbo->bind();
}
-void QGLWindowSurface::setGeometry(const QRect &rect)
+void QGLWindowSurface::updateGeometry()
{
- QWindowSurface::setGeometry(rect);
+ QRect rect = QWindowSurface::geometry();
- const GLenum target = qt_gl_preferredTextureTarget();
+ const GLenum target = GL_TEXTURE_2D;
if (rect.width() <= 0 || rect.height() <= 0)
return;
@@ -473,13 +510,51 @@ void QGLWindowSurface::setGeometry(const QRect &rect)
d_ptr->size = rect.size();
if (d_ptr->ctx) {
- glBindTexture(target, d_ptr->tex_id);
- glTexImage2D(target, 0, GL_RGBA, rect.width(), rect.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
- glBindTexture(target, 0);
+ if (d_ptr->destructive_swap_buffers) {
+ glBindTexture(target, d_ptr->tex_id);
+ glTexImage2D(target, 0, GL_RGBA, rect.width(), rect.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
+ glBindTexture(target, 0);
+ }
return;
}
- if (d_ptr->pb || !d_ptr->tried_pb) {
+ if (d_ptr->destructive_swap_buffers
+ && (QGLExtensions::glExtensions & QGLExtensions::FramebufferObject)
+#ifdef QT_OPENGL_ES_2
+ && (QGLExtensions::glExtensions & QGLExtensions::FramebufferBlit)
+#endif
+ && (d_ptr->fbo || !d_ptr->tried_fbo))
+ {
+ d_ptr->tried_fbo = true;
+ hijackWindow(window());
+ QGLContext *ctx = reinterpret_cast<QGLContext *>(window()->d_func()->extraData()->glContext);
+ ctx->d_ptr->internal_context = true;
+ ctx->makeCurrent();
+ delete d_ptr->fbo;
+
+ QGLFramebufferObjectFormat format;
+ format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+ format.setInternalFormat(GL_RGBA);
+ format.setTextureTarget(target);
+
+ if (QGLExtensions::glExtensions & QGLExtensions::FramebufferBlit)
+ format.setSamples(8);
+
+ d_ptr->fbo = new QGLFramebufferObject(rect.size(), format);
+ d_ptr->fbo->bind();
+ if (d_ptr->fbo->isValid()) {
+ qDebug() << "Created Window Surface FBO" << rect.size()
+ << "with samples" << d_ptr->fbo->format().samples();
+ return;
+ } else {
+ qDebug() << "QGLWindowSurface: Failed to create valid FBO, falling back";
+ delete d_ptr->fbo;
+ d_ptr->fbo = 0;
+ }
+ }
+
+#if !defined(QT_OPENGL_ES_2)
+ if (d_ptr->destructive_swap_buffers && (d_ptr->pb || !d_ptr->tried_pb)) {
d_ptr->tried_pb = true;
if (d_ptr->pb) {
@@ -494,7 +569,7 @@ void QGLWindowSurface::setGeometry(const QRect &rect)
qt_gl_share_widget());
if (d_ptr->pb->isValid()) {
- qDebug() << "PB Sample buffers:" << d_ptr->pb->format().sampleBuffers();
+ qDebug() << "Created Window Surface Pixelbuffer, Sample buffers:" << d_ptr->pb->format().sampleBuffers();
d_ptr->pb->makeCurrent();
glGenTextures(1, &d_ptr->pb_tex_id);
@@ -521,44 +596,32 @@ void QGLWindowSurface::setGeometry(const QRect &rect)
d_ptr->pb = 0;
}
}
-
- if ((QGLExtensions::glExtensions & QGLExtensions::FramebufferObject) && (d_ptr->fbo || !d_ptr->tried_fbo)) {
- d_ptr->tried_fbo = true;
- hijackWindow(window());
- QGLContext *ctx = reinterpret_cast<QGLContext *>(window()->d_func()->extraData()->glContext);
- ctx->d_ptr->internal_context = true;
- ctx->makeCurrent();
- delete d_ptr->fbo;
- d_ptr->fbo = new QGLFramebufferObject(rect.size(), QGLFramebufferObject::CombinedDepthStencil,
- GLenum(target), GLenum(GL_RGBA));
-
- d_ptr->fbo->bind();
- if (d_ptr->fbo->isValid()) {
- return;
- } else {
- qDebug() << "QGLWindowSurface: Failed to create valid FBO, falling back";
- delete d_ptr->fbo;
- d_ptr->fbo = 0;
- }
- }
+#endif // !defined(QT_OPENGL_ES_2)
hijackWindow(window());
QGLContext *ctx = reinterpret_cast<QGLContext *>(window()->d_func()->extraData()->glContext);
ctx->makeCurrent();
- glGenTextures(1, &d_ptr->tex_id);
- glBindTexture(target, d_ptr->tex_id);
- glTexImage2D(target, 0, GL_RGBA, rect.width(), rect.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
+ if (d_ptr->destructive_swap_buffers) {
+ glGenTextures(1, &d_ptr->tex_id);
+ glBindTexture(target, d_ptr->tex_id);
+ glTexImage2D(target, 0, GL_RGBA, rect.width(), rect.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
- glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glBindTexture(target, 0);
+ glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glBindTexture(target, 0);
+ }
qDebug() << "QGLWindowSurface: Using plain widget as window surface" << this;;
d_ptr->ctx = ctx;
d_ptr->ctx->d_ptr->internal_context = true;
}
+void QGLWindowSurface::setGeometry(const QRect &rect)
+{
+ QWindowSurface::setGeometry(rect);
+}
+
bool QGLWindowSurface::scroll(const QRegion &area, int dx, int dy)
{
// this code randomly fails currently for unknown reasons
@@ -582,7 +645,7 @@ bool QGLWindowSurface::scroll(const QRegion &area, int dx, int dy)
return true;
#endif
- const GLenum target = qt_gl_preferredTextureTarget();
+ const GLenum target = GL_TEXTURE_2D;
glBindTexture(target, d_ptr->tex_id);
glCopyTexImage2D(target, 0, GL_RGBA, br.x(), d_ptr->pb->height() - (br.y() + br.height()), br.width(), br.height(), 0);
@@ -595,7 +658,7 @@ bool QGLWindowSurface::scroll(const QRegion &area, int dx, int dy)
static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize, const QRectF &br)
{
- const GLenum target = qt_gl_preferredTextureTarget();
+ const GLenum target = GL_TEXTURE_2D;
QRectF src = br.isEmpty()
? QRectF(QPointF(), texSize)
: QRectF(QPointF(br.x(), texSize.height() - br.bottom()), br.size());
@@ -623,6 +686,7 @@ static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize,
extern void qt_add_rect_to_array(const QRectF &r, q_vertexType *array); // qpaintengine_opengl.cpp
qt_add_rect_to_array(rect, vertexArray);
+#if !defined(QT_OPENGL_ES_2)
glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray);
glTexCoordPointer(2, q_vertexTypeEnum, 0, texCoordArray);
@@ -634,6 +698,7 @@ static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize,
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+#endif
glDisable(target);
glBindTexture(target, 0);
diff --git a/src/opengl/qwindowsurface_gl_p.h b/src/opengl/qwindowsurface_gl_p.h
index 0194378..d47e3e3 100644
--- a/src/opengl/qwindowsurface_gl_p.h
+++ b/src/opengl/qwindowsurface_gl_p.h
@@ -74,6 +74,7 @@ public:
QPaintDevice *paintDevice();
void flush(QWidget *widget, const QRegion &region, const QPoint &offset);
void setGeometry(const QRect &rect);
+ void updateGeometry();
bool scroll(const QRegion &area, int dx, int dy);
void beginPaint(const QRegion &region);
diff --git a/src/opengl/util/generator.cpp b/src/opengl/util/generator.cpp
index de2450d..dac5a2d 100644
--- a/src/opengl/util/generator.cpp
+++ b/src/opengl/util/generator.cpp
@@ -116,7 +116,7 @@ QList<QStringPair> readConf(const QString &confFile)
lineStream >> enumerator;
if (lineStream.atEnd()) {
- qDebug() << "Error in file" << confFile << "(" << enumerator << ")";
+ qDebug() << "Error in file" << confFile << '(' << enumerator << ')';
exit(0);
}
diff --git a/src/plugins/accessible/widgets/rangecontrols.cpp b/src/plugins/accessible/widgets/rangecontrols.cpp
index 9297d6e..6d8c184 100644
--- a/src/plugins/accessible/widgets/rangecontrols.cpp
+++ b/src/plugins/accessible/widgets/rangecontrols.cpp
@@ -799,7 +799,7 @@ int QAccessibleSlider::defaultAction(int /*child*/) const
/*! \internal */
QString QAccessibleSlider::actionText(int /*action*/, Text /*t*/, int /*child*/) const
{
- return QString(QLatin1String(""));
+ return QLatin1String("");
}
QAccessibleAbstractSlider::QAccessibleAbstractSlider(QWidget *w, Role r)
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index 989a37a..a68bc8f 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -383,7 +383,7 @@ void QDirectFBPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
{
Q_D(QDirectFBPaintEngine);
d->dirtyClip = true;
- const QPoint bottom = d->transform.map(QPoint(0, path.controlPointRect().y2));
+ const QPoint bottom = d->transform.map(QPoint(0, int(path.controlPointRect().y2)));
if (bottom.y() >= d->lastLockedHeight)
d->lock();
QRasterPaintEngine::clip(path, op);
diff --git a/src/plugins/gfxdrivers/hybrid/hybridscreen.cpp b/src/plugins/gfxdrivers/hybrid/hybridscreen.cpp
index 3a40b4c..da61a22 100644
--- a/src/plugins/gfxdrivers/hybrid/hybridscreen.cpp
+++ b/src/plugins/gfxdrivers/hybrid/hybridscreen.cpp
@@ -103,11 +103,11 @@ bool HybridScreen::connect(const QString &displaySpec)
{
QString dspec = displaySpec;
if (dspec.startsWith(QLatin1String("hybrid:"), Qt::CaseInsensitive))
- dspec = dspec.mid(QString(QLatin1String("hybrid:")).size());
+ dspec = dspec.mid(QString::fromLatin1("hybrid:").size());
else if (dspec.compare(QLatin1String("hybrid"), Qt::CaseInsensitive) == 0)
dspec = QString();
- const QString displayIdSpec = QString(QLatin1String(" :%1")).arg(displayId);
+ const QString displayIdSpec = QString::fromLatin1(" :%1").arg(displayId);
if (dspec.endsWith(displayIdSpec))
dspec = dspec.left(dspec.size() - displayIdSpec.size());
diff --git a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
index b7f03ba..8be3672 100644
--- a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
+++ b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
@@ -2100,11 +2100,11 @@ bool QVNCScreen::connect(const QString &displaySpec)
{
QString dspec = displaySpec;
if (dspec.startsWith(QLatin1String("vnc:"), Qt::CaseInsensitive))
- dspec = dspec.mid(QString(QLatin1String("vnc:")).size());
+ dspec = dspec.mid(QString::fromLatin1("vnc:").size());
else if (dspec.compare(QLatin1String("vnc"), Qt::CaseInsensitive) == 0)
dspec = QString();
- const QString displayIdSpec = QString(QLatin1String(" :%1")).arg(displayId);
+ const QString displayIdSpec = QString::fromLatin1(" :%1").arg(displayId);
if (dspec.endsWith(displayIdSpec))
dspec = dspec.left(dspec.size() - displayIdSpec.size());
diff --git a/src/plugins/sqldrivers/odbc/odbc.pro b/src/plugins/sqldrivers/odbc/odbc.pro
index 0835ce1..3de8ab2 100644
--- a/src/plugins/sqldrivers/odbc/odbc.pro
+++ b/src/plugins/sqldrivers/odbc/odbc.pro
@@ -4,15 +4,9 @@ HEADERS = ../../../sql/drivers/odbc/qsql_odbc.h
SOURCES = main.cpp \
../../../sql/drivers/odbc/qsql_odbc.cpp
-mac {
- !contains( LIBS, .*odbc.* ) {
- LIBS *= -liodbc
- }
-}
-
unix {
!contains( LIBS, .*odbc.* ) {
- LIBS *= -lodbc
+ LIBS *= $$QT_LFLAGS_ODBC
}
}
diff --git a/src/qt3support/dialogs/q3filedialog.cpp b/src/qt3support/dialogs/q3filedialog.cpp
index b9f8196..e41941b 100644
--- a/src/qt3support/dialogs/q3filedialog.cpp
+++ b/src/qt3support/dialogs/q3filedialog.cpp
@@ -3879,7 +3879,7 @@ void Q3FileDialog::detailViewSelectionChanged()
d->moreFiles->setSelected(f->i, i->isSelected());
}
if (i->isSelected() && !((Q3FileDialogPrivate::File *)i)->info.isDir())
- str += QString(QLatin1String("\"%1\" ")).arg(i->text(0));
+ str += QString::fromLatin1("\"%1\" ").arg(i->text(0));
i = i->nextSibling();
}
d->moreFiles->blockSignals(false);
@@ -3931,7 +3931,7 @@ void Q3FileDialog::listBoxSelectionChanged()
}
if (d->moreFiles->isSelected(i)
&& !((Q3FileDialogPrivate::File*)(mcitem)->i)->info.isDir()) {
- str += QString(QLatin1String("\"%1\" ")).arg(i->text());
+ str += QString::fromLatin1("\"%1\" ").arg(i->text());
if (j == 0)
j = i;
}
@@ -5757,8 +5757,8 @@ void Q3FileDialog::insertEntry(const Q3ValueList<QUrlInfo> &lst, Q3NetworkOperat
if (!bShowHiddenFiles && inf.name() != QLatin1String("..")) {
if (d->url.isLocalFile()) {
QString file = d->url.path();
- if (!file.endsWith(QLatin1String("/")))
- file.append(QLatin1String("/"));
+ if (!file.endsWith(QLatin1Char('/')))
+ file.append(QLatin1Char('/'));
file += inf.name();
QT_WA({
if (GetFileAttributesW((TCHAR*)file.ucs2()) & FILE_ATTRIBUTE_HIDDEN)
diff --git a/src/qt3support/dialogs/q3filedialog_mac.cpp b/src/qt3support/dialogs/q3filedialog_mac.cpp
index f1c749ec..18bebf1 100644
--- a/src/qt3support/dialogs/q3filedialog_mac.cpp
+++ b/src/qt3support/dialogs/q3filedialog_mac.cpp
@@ -554,7 +554,7 @@ QString Q3FileDialog::macGetSaveFileName(const QString &start, const QString &fi
retstr = QString::fromUtf8((const char *)str_buffer);
//now filename
CFStringGetCString(ret.saveFileName, (char *)str_buffer, 1024, kCFStringEncodingUTF8);
- retstr += QLatin1String("/") + QString::fromUtf8((const char *)str_buffer);
+ retstr += QLatin1Char('/') + QString::fromUtf8((const char *)str_buffer);
}
NavDisposeReply(&ret);
if(selectedFilter)
diff --git a/src/qt3support/dialogs/q3filedialog_win.cpp b/src/qt3support/dialogs/q3filedialog_win.cpp
index 1be797a..a1c98f3 100644
--- a/src/qt3support/dialogs/q3filedialog_win.cpp
+++ b/src/qt3support/dialogs/q3filedialog_win.cpp
@@ -737,7 +737,7 @@ QString Q3FileDialog::winGetExistingDirectory(const QString& initialDirectory,
QDir::setCurrent(currentDir);
if (!result.isEmpty())
- result.replace(QLatin1String("\\"), QLatin1String("/"));
+ result.replace(QLatin1Char('\\'), QLatin1Char('/'));
return result;
#else
return QString();
diff --git a/src/qt3support/itemviews/q3iconview.cpp b/src/qt3support/itemviews/q3iconview.cpp
index d1a9c1e..a5664de 100644
--- a/src/qt3support/itemviews/q3iconview.cpp
+++ b/src/qt3support/itemviews/q3iconview.cpp
@@ -614,7 +614,7 @@ QByteArray Q3IconDrag::encodedData(const char* mime) const
(*it).item.textRect().x()).arg((*it).item.textRect().y()).
arg((*it).item.textRect().width()).arg(
(*it).item.textRect().height());
- k += QString(QLatin1String((*it).data.data())) + QLatin1String("$@@$");
+ k += QString::fromLatin1((*it).data.data()) + QLatin1String("$@@$");
s += k;
}
@@ -1820,8 +1820,8 @@ void Q3IconViewItem::calcRect(const QString &text_)
tw = r.width();
th = r.height();
- if (tw < view->d->fm->width(QLatin1String("X")))
- tw = view->d->fm->width(QLatin1String("X"));
+ if (tw < view->d->fm->width(QLatin1Char('X')))
+ tw = view->d->fm->width(QLatin1Char('X'));
itemTextRect.setWidth(tw);
itemTextRect.setHeight(th);
diff --git a/src/qt3support/network/q3dns.cpp b/src/qt3support/network/q3dns.cpp
index c53f2ff..3ca3977 100644
--- a/src/qt3support/network/q3dns.cpp
+++ b/src/qt3support/network/q3dns.cpp
@@ -1738,7 +1738,7 @@ void Q3Dns::setLabel( const QString & label )
const char * dom;
while( (dom=it.current()) != 0 ) {
++it;
- n.append( l.lower() + QLatin1String(".") + QLatin1String(dom) );
+ n.append( l.lower() + QLatin1Char('.') + QLatin1String(dom) );
}
}
n.append( l.lower() );
@@ -1902,8 +1902,8 @@ QString Q3Dns::toInAddrArpaDomain( const QHostAddress &address )
s = QLatin1String("ip6.arpa");
uint b = 0;
while( b < 16 ) {
- s = QString::number( i.c[b]%16, 16 ) + QLatin1String(".") +
- QString::number( i.c[b]/16, 16 ) + QLatin1String(".") + s;
+ s = QString::number( i.c[b]%16, 16 ) + QLatin1Char('.') +
+ QString::number( i.c[b]/16, 16 ) + QLatin1Char('.') + s;
b++;
}
}
@@ -2347,7 +2347,7 @@ void Q3Dns::doResInit()
nameServer += QLatin1String(dnsServer->IpAddress.String);
dnsServer = dnsServer->Next;
if ( dnsServer != 0 )
- nameServer += QLatin1String(" ");
+ nameServer += QLatin1Char(' ');
}
searchList = QLatin1String("");
separator = ' ';
@@ -2360,12 +2360,12 @@ void Q3Dns::doResInit()
}
if ( !gotNetworkParams ) {
if ( getDnsParamsFromRegistry(
- QString( QLatin1String("System\\CurrentControlSet\\Services\\Tcpip\\Parameters") ),
+ QLatin1String("System\\CurrentControlSet\\Services\\Tcpip\\Parameters"),
&domainName, &nameServer, &searchList )) {
// for NT
separator = ' ';
} else if ( getDnsParamsFromRegistry(
- QString( QLatin1String("System\\CurrentControlSet\\Services\\VxD\\MSTCP") ),
+ QLatin1String("System\\CurrentControlSet\\Services\\VxD\\MSTCP"),
&domainName, &nameServer, &searchList )) {
// for Windows 98
separator = ',';
@@ -2395,7 +2395,7 @@ void Q3Dns::doResInit()
} while( first < (int)nameServer.length() );
}
- searchList = searchList + QLatin1String(" ") + domainName;
+ searchList += QLatin1Char(' ') + domainName;
searchList = searchList.simplifyWhiteSpace().lower();
first = 0;
do {
@@ -2488,7 +2488,7 @@ void Q3Dns::doResInit()
while ( !stream.atEnd() ) {
line = stream.readLine();
QStringList list = QStringList::split( QLatin1String(" "), line );
- if( line.startsWith( QLatin1String("#") ) || list.size() < 2 )
+ if( line.startsWith( QLatin1Char('#') ) || list.size() < 2 )
continue;
const QString type = list[0].lower();
diff --git a/src/qt3support/network/q3ftp.cpp b/src/qt3support/network/q3ftp.cpp
index 5ab84cc..44c1f5c 100644
--- a/src/qt3support/network/q3ftp.cpp
+++ b/src/qt3support/network/q3ftp.cpp
@@ -485,7 +485,7 @@ bool Q3FtpDTP::parseDir( const QString &buffer, const QString &userName, QUrlInf
dateStr += lst[ 6 ];
dateStr += QLatin1Char(' ');
- if ( lst[ 7 ].contains( QLatin1String(":") ) ) {
+ if ( lst[ 7 ].contains( QLatin1Char(':') ) ) {
time = QTime( lst[ 7 ].left( 2 ).toInt(), lst[ 7 ].right( 2 ).toInt() );
dateStr += QString::number( QDate::currentDate().year() );
} else {
@@ -495,7 +495,7 @@ bool Q3FtpDTP::parseDir( const QString &buffer, const QString &userName, QUrlInf
QDate date = QDate::fromString( dateStr );
info->setLastModified( QDateTime( date, time ) );
- if ( lst[ 7 ].contains( QLatin1String(":") ) ) {
+ if ( lst[ 7 ].contains( QLatin1Char(':') ) ) {
const int futureTolerance = 600;
if( info->lastModified().secsTo( QDateTime::currentDateTime() ) < -futureTolerance ) {
QDateTime dt = info->lastModified();
@@ -512,7 +512,7 @@ bool Q3FtpDTP::parseDir( const QString &buffer, const QString &userName, QUrlInf
else {
QString n;
for ( uint i = 8; i < (uint) lst.count(); ++i )
- n += lst[ i ] + QLatin1String(" ");
+ n += lst[ i ] + QLatin1Char(' ');
n = n.stripWhiteSpace();
info->setName( n );
}
@@ -897,7 +897,7 @@ bool Q3FtpPI::processReply()
// ### error handling
} else {
QStringList lst = addrPortPattern.capturedTexts();
- QString host = lst[1] + QLatin1String(".") + lst[2] + QLatin1String(".") + lst[3] + QLatin1String(".") + lst[4];
+ QString host = lst[1] + QLatin1Char('.') + lst[2] + QLatin1Char('.') + lst[3] + QLatin1Char('.') + lst[4];
Q_UINT16 port = ( lst[5].toUInt() << 8 ) + lst[6].toUInt();
waitForDtpToConnect = true;
dtp.connectToHost( host, port );
@@ -1435,8 +1435,8 @@ int Q3Ftp::connectToHost( const QString &host, Q_UINT16 port )
int Q3Ftp::login( const QString &user, const QString &password )
{
QStringList cmds;
- cmds << ( QString(QLatin1String("USER ")) + ( user.isNull() ? QString(QLatin1String("anonymous")) : user ) + QLatin1String("\r\n") );
- cmds << ( QString(QLatin1String("PASS ")) + ( password.isNull() ? QString(QLatin1String("anonymous@")) : password ) + QLatin1String("\r\n") );
+ cmds << ( QString::fromLatin1("USER ") + ( user.isNull() ? QString::fromLatin1("anonymous") : user ) + QLatin1String("\r\n") );
+ cmds << ( QString::fromLatin1("PASS ") + ( password.isNull() ? QString::fromLatin1("anonymous@") : password ) + QLatin1String("\r\n") );
return addCommand( new Q3FtpCommand( Login, cmds ) );
}
@@ -2095,7 +2095,7 @@ void Q3Ftp::operationListChildren( Q3NetworkOperation *op )
{
op->setState( StInProgress );
- cd( ( url()->path().isEmpty() ? QString( QLatin1String("/") ) : url()->path() ) );
+ cd( ( url()->path().isEmpty() ? QString::fromLatin1("/") : url()->path() ) );
list();
emit start( op );
}
@@ -2115,7 +2115,7 @@ void Q3Ftp::operationRemove( Q3NetworkOperation *op )
{
op->setState( StInProgress );
- cd( ( url()->path().isEmpty() ? QString( QLatin1String("/") ) : url()->path() ) );
+ cd( ( url()->path().isEmpty() ? QString::fromLatin1("/") : url()->path() ) );
remove( Q3Url( op->arg( 0 ) ).path() );
}
@@ -2125,7 +2125,7 @@ void Q3Ftp::operationRename( Q3NetworkOperation *op )
{
op->setState( StInProgress );
- cd( ( url()->path().isEmpty() ? QString( QLatin1String("/") ) : url()->path() ) );
+ cd( ( url()->path().isEmpty() ? QString::fromLatin1("/") : url()->path() ) );
rename( op->arg( 0 ), op->arg( 1 ));
}
@@ -2179,8 +2179,8 @@ bool Q3Ftp::checkConnection( Q3NetworkOperation *op )
connectToHost( url()->host(), url()->port() != -1 ? url()->port() : 21 );
break;
}
- QString user = url()->user().isEmpty() ? QString( QLatin1String("anonymous") ) : url()->user();
- QString pass = url()->password().isEmpty() ? QString( QLatin1String("anonymous@") ) : url()->password();
+ QString user = url()->user().isEmpty() ? QString::fromLatin1("anonymous") : url()->user();
+ QString pass = url()->password().isEmpty() ? QString::fromLatin1("anonymous@") : url()->password();
login( user, pass );
}
diff --git a/src/qt3support/network/q3http.cpp b/src/qt3support/network/q3http.cpp
index 591b381..aabf4a3 100644
--- a/src/qt3support/network/q3http.cpp
+++ b/src/qt3support/network/q3http.cpp
@@ -468,7 +468,7 @@ bool Q3HttpHeader::parse( const QString& str )
if ( !(*it).isEmpty() ) {
if ( (*it)[0].isSpace() ) {
if ( !lines.isEmpty() ) {
- lines.last() += QLatin1String(" ");
+ lines.last() += QLatin1Char(' ');
lines.last() += (*it).stripWhiteSpace();
}
} else {
@@ -562,7 +562,7 @@ void Q3HttpHeader::removeValue( const QString& key )
*/
bool Q3HttpHeader::parseLine( const QString& line, int )
{
- int i = line.find( QLatin1String(":") );
+ int i = line.find( QLatin1Char(':') );
if ( i == -1 )
return false;
@@ -647,7 +647,7 @@ QString Q3HttpHeader::contentType() const
if ( type.isEmpty() )
return QString();
- int pos = type.find( QLatin1String(";") );
+ int pos = type.find( QLatin1Char(';') );
if ( pos == -1 )
return type;
@@ -2210,7 +2210,7 @@ void Q3Http::clientReply( const Q3HttpResponseHeader &rep )
if ( rep.statusCode() >= 400 && rep.statusCode() < 600 ) {
op->setState( StFailed );
op->setProtocolDetail(
- QString(QLatin1String("%1 %2")).arg(rep.statusCode()).arg(rep.reasonPhrase())
+ QString::fromLatin1("%1 %2").arg(rep.statusCode()).arg(rep.reasonPhrase())
);
switch ( rep.statusCode() ) {
case 401:
diff --git a/src/qt3support/network/q3url.cpp b/src/qt3support/network/q3url.cpp
index fc2fdb2..68753b6 100644
--- a/src/qt3support/network/q3url.cpp
+++ b/src/qt3support/network/q3url.cpp
@@ -211,8 +211,8 @@ Q3Url::Q3Url( const Q3Url& url )
bool Q3Url::isRelativeUrl( const QString &url )
{
- int colon = url.find( QLatin1String(":") );
- int slash = url.find( QLatin1String("/") );
+ int colon = url.find( QLatin1Char(':') );
+ int slash = url.find( QLatin1Char('/') );
return ( slash != 0 && ( colon == -1 || ( slash != -1 && colon > slash ) ) );
}
@@ -280,8 +280,8 @@ Q3Url::Q3Url( const Q3Url& url, const QString& relUrl, bool checkSlash )
if ( !d->host.isEmpty() && !d->user.isEmpty() && !d->pass.isEmpty() )
p = QLatin1String("/");
}
- if ( !p.isEmpty() && p.right(1)!=QLatin1String("/") )
- p += QLatin1String("/");
+ if ( !p.isEmpty() && !p.endsWith(QLatin1Char('/')) )
+ p += QLatin1Char('/');
p += rel;
d->path = p;
d->cleanPathDirty = true;
@@ -678,7 +678,7 @@ bool Q3Url::parse( const QString& url )
++cs;
while ( url_[ cs ] == QLatin1Char('/') )
++cs;
- int slash = url_.find( QLatin1String("/"), cs );
+ int slash = url_.find( QLatin1Char('/'), cs );
if ( slash == -1 )
slash = url_.length() - 1;
QString tmp = url_.mid( cs, slash - cs + 1 );
@@ -686,7 +686,7 @@ bool Q3Url::parse( const QString& url )
if ( !tmp.isEmpty() ) { // if this part exists
// look for the @ in this part
- int at = tmp.find( QLatin1String("@") );
+ int at = tmp.find( QLatin1Char('@') );
if ( at != -1 )
at += cs;
// we have no @, which means host[:port], so directly
@@ -793,7 +793,7 @@ bool Q3Url::parse( const QString& url )
// hack for windows
if ( d->path.length() == 2 && d->path[ 1 ] == QLatin1Char(':') )
- d->path += QLatin1String("/");
+ d->path += QLatin1Char('/');
// #### do some corrections, should be done nicer too
if ( !d->pass.isEmpty() ) {
@@ -808,7 +808,7 @@ bool Q3Url::parse( const QString& url )
if ( d->path[ 0 ] == QLatin1Char('@') || d->path[ 0 ] == QLatin1Char(':') )
d->path.remove( (uint)0, 1 );
if ( d->path[ 0 ] != QLatin1Char('/') && !relPath && d->path[ 1 ] != QLatin1Char(':') )
- d->path.prepend( QLatin1String("/") );
+ d->path.prepend( QLatin1Char('/') );
}
if ( !d->refEncoded.isEmpty() && d->refEncoded[ 0 ] == QLatin1Char('#') )
d->refEncoded.remove( (uint)0, 1 );
@@ -820,9 +820,9 @@ bool Q3Url::parse( const QString& url )
#if defined(Q_OS_WIN32)
// hack for windows file://machine/path syntax
if ( d->protocol == QLatin1String("file") ) {
- if ( url.left( 7 ) == QLatin1String("file://") &&
+ if ( url.startsWith(QLatin1String("file://")) &&
d->path.length() > 1 && d->path[ 1 ] != QLatin1Char(':') )
- d->path.prepend( QLatin1String("/") );
+ d->path.prepend( QLatin1Char('/') );
}
#endif
@@ -942,7 +942,7 @@ void Q3Url::setFileName( const QString& name )
p += fn;
if ( !d->queryEncoded.isEmpty() )
- p += QLatin1String("?") + d->queryEncoded;
+ p += QLatin1Char('?') + d->queryEncoded;
setEncodedPathAndQuery( p );
}
@@ -961,7 +961,7 @@ QString Q3Url::encodedPathAndQuery()
encode( p );
if ( !d->queryEncoded.isEmpty() ) {
- p += QLatin1String("?");
+ p += QLatin1Char('?');
p += d->queryEncoded;
}
@@ -1011,7 +1011,7 @@ QString Q3Url::path( bool correct ) const
} else if ( isLocalFile() ) {
#if defined(Q_OS_WIN32)
// hack for stuff like \\machine\path and //machine/path on windows
- if ( ( d->path.left( 1 ) == QLatin1String("/") || d->path.left( 1 ) == QLatin1String("\\") ) &&
+ if ( ( d->path.startsWith(QLatin1Char('/')) || d->path.startsWith(QLatin1Char('\\')) ) &&
d->path.length() > 1 ) {
d->cleanPath = d->path;
bool share = (d->cleanPath[0] == QLatin1Char('\\') && d->cleanPath[1] == QLatin1Char('\\')) ||
@@ -1021,7 +1021,7 @@ QString Q3Url::path( bool correct ) const
if ( share ) {
check = false;
while (d->cleanPath.at(0) != QLatin1Char('/') || d->cleanPath.at(1) != QLatin1Char('/'))
- d->cleanPath.prepend(QLatin1String("/"));
+ d->cleanPath.prepend(QLatin1Char('/'));
}
}
#endif
@@ -1036,7 +1036,7 @@ QString Q3Url::path( bool correct ) const
dir = QDir::cleanDirPath( canPath );
else
dir = QDir::cleanDirPath( QDir( d->path ).absPath() );
- dir += QLatin1String("/");
+ dir += QLatin1Char('/');
if ( dir == QLatin1String("//") )
d->cleanPath = QLatin1String("/");
else
@@ -1046,14 +1046,13 @@ QString Q3Url::path( bool correct ) const
QDir::cleanDirPath( (qt_resolve_symlinks ?
fi.dir().canonicalPath() :
fi.dir().absPath()) );
- d->cleanPath = p + QLatin1String("/") + fi.fileName();
+ d->cleanPath = p + QLatin1Char('/') + fi.fileName();
}
}
} else {
- if ( d->path != QLatin1String("/") && d->path[ (int)d->path.length() - 1 ] == QLatin1Char('/') )
- d->cleanPath = QDir::cleanDirPath( d->path ) + QLatin1String("/");
- else
d->cleanPath = QDir::cleanDirPath( d->path );
+ if ( d->path.length() > 1 && d->path.endsWith(QLatin1Char('/')) )
+ d->cleanPath += QLatin1Char('/');
}
if ( check )
@@ -1084,9 +1083,9 @@ bool Q3Url::isLocalFile() const
QString Q3Url::fileName() const
{
- if ( d->path.isEmpty() || d->path.endsWith( QLatin1String("/") )
+ if ( d->path.isEmpty() || d->path.endsWith( QLatin1Char('/') )
#ifdef Q_WS_WIN
- || d->path.endsWith( QLatin1String("\\") )
+ || d->path.endsWith( QLatin1Char('\\') )
#endif
)
return QString();
@@ -1110,12 +1109,12 @@ void Q3Url::addPath( const QString& pa )
if ( path().isEmpty() ) {
if ( p[ 0 ] != QLatin1Char( '/' ) )
- d->path = QLatin1String("/") + p;
+ d->path = QLatin1Char('/') + p;
else
d->path = p;
} else {
if ( p[ 0 ] != QLatin1Char( '/' ) && d->path[ (int)d->path.length() - 1 ] != QLatin1Char('/') )
- d->path += QLatin1String("/") + p;
+ d->path += QLatin1Char('/') + p;
else
d->path += p;
}
@@ -1250,11 +1249,11 @@ QString Q3Url::toString( bool encodedPath, bool forcePrependProtocol ) const
if ( isLocalFile() ) {
if ( forcePrependProtocol )
- res = d->protocol + QLatin1String(":") + p;
+ res = d->protocol + QLatin1Char(':') + p;
else
res = p;
} else if ( d->protocol == QLatin1String("mailto") ) {
- res = d->protocol + QLatin1String(":") + p;
+ res = d->protocol + QLatin1Char(':') + p;
} else {
res = d->protocol + QLatin1String("://");
if ( !d->user.isEmpty() || !d->pass.isEmpty() ) {
@@ -1267,24 +1266,24 @@ QString Q3Url::toString( bool encodedPath, bool forcePrependProtocol ) const
if ( !d->pass.isEmpty() ) {
tmp = d->pass;
encode( tmp );
- res += QLatin1String(":") + tmp;
+ res += QLatin1Char(':') + tmp;
}
- res += QLatin1String("@");
+ res += QLatin1Char('@');
}
res += d->host;
if ( d->port != -1 )
- res += QLatin1String(":") + QString( QLatin1String("%1") ).arg( d->port );
+ res += QLatin1Char(':') + QString::number( d->port );
if ( !p.isEmpty() ) {
if ( !d->host.isEmpty() && p[0]!= QLatin1Char( '/' ) )
- res += QLatin1String("/");
+ res += QLatin1Char('/');
res += p;
}
}
if ( !d->refEncoded.isEmpty() )
- res += QLatin1String("#") + d->refEncoded;
+ res += QLatin1Char('#') + d->refEncoded;
if ( !d->queryEncoded.isEmpty() )
- res += QLatin1String("?") + d->queryEncoded;
+ res += QLatin1Char('?') + d->queryEncoded;
return res;
}
diff --git a/src/qt3support/network/q3urloperator.cpp b/src/qt3support/network/q3urloperator.cpp
index b415e12..6afd8ab 100644
--- a/src/qt3support/network/q3urloperator.cpp
+++ b/src/qt3support/network/q3urloperator.cpp
@@ -579,7 +579,7 @@ Q3PtrList<Q3NetworkOperation> Q3UrlOperator::copy( const QString &from, const QS
if (frm == to + file)
return ops;
- file.prepend( QLatin1String("/") );
+ file.prepend( QLatin1Char('/') );
// uFrom and uTo are deleted when the Q3NetworkProtocol deletes itself via
// autodelete
diff --git a/src/qt3support/other/q3dragobject.cpp b/src/qt3support/other/q3dragobject.cpp
index fb57220..89ffe24 100644
--- a/src/qt3support/other/q3dragobject.cpp
+++ b/src/qt3support/other/q3dragobject.cpp
@@ -93,7 +93,7 @@ public:
Q3TextDragPrivate() { setSubType(QLatin1String("plain")); }
void setSubType(const QString & st) {
subtype = st;
- fmt = QString(QLatin1String("text/")).toLatin1() + subtype.toLatin1();
+ fmt = "text/" + subtype.toLatin1();
}
QString txt;
@@ -208,11 +208,6 @@ void Q3DragObject::setPixmap(QPixmap pm, const QPoint& hotspot)
Q_D(Q3DragObject);
d->pixmap = pm;
d->hot = hotspot;
-#if 0
- QDragManager *manager = QDragManager::self();
- if (manager && manager->object == d->data)
- manager->updatePixmap();
-#endif
}
/*!
@@ -1302,7 +1297,7 @@ QByteArray Q3UriDrag::localFileToUri(const QString& filename)
r.prepend(QString::fromLatin1(hostname));
}
#endif
- return unicodeUriToUri(QString(QLatin1String("file://") + r));
+ return unicodeUriToUri(QLatin1String("file://") + r);
}
/*!
@@ -1357,7 +1352,7 @@ QString Q3UriDrag::uriToLocalFile(const char* uri)
return file;
if (0==qstrnicmp(uri,"file:/",6)) // It is a local file uri
uri += 6;
- else if (QString(QLatin1String(uri)).indexOf(QLatin1String(":/")) != -1) // It is a different scheme uri
+ else if (QString::fromLatin1(uri).indexOf(QLatin1String(":/")) != -1) // It is a different scheme uri
return file;
bool local = uri[0] != '/' || (uri[0] != '\0' && uri[1] == '/');
diff --git a/src/qt3support/other/q3process.cpp b/src/qt3support/other/q3process.cpp
index 6eac812..9689de9 100644
--- a/src/qt3support/other/q3process.cpp
+++ b/src/qt3support/other/q3process.cpp
@@ -483,7 +483,7 @@ QString Q3Process::readLineStdout()
return QString();
if ( !buf->scanNewline( &a ) )
- return QString( QLatin1String(buf->readAll()) );
+ return QLatin1String(buf->readAll());
}
uint size = a.size();
diff --git a/src/qt3support/other/q3process_unix.cpp b/src/qt3support/other/q3process_unix.cpp
index 098c581..2492bf2 100644
--- a/src/qt3support/other/q3process_unix.cpp
+++ b/src/qt3support/other/q3process_unix.cpp
@@ -828,7 +828,7 @@ bool Q3Process::start( QStringList *env )
#ifndef QT_NO_DIR
QFileInfo fileInfo( dir, command );
#else
- QFileInfo fileInfo( dir + "/" + command );
+ QFileInfo fileInfo( dir + QLatin1Char('/') + command );
#endif
if ( fileInfo.isExecutable() ) {
#if defined(Q_OS_MACX)
diff --git a/src/qt3support/other/q3process_win.cpp b/src/qt3support/other/q3process_win.cpp
index 3c862ee..7dc28cb 100644
--- a/src/qt3support/other/q3process_win.cpp
+++ b/src/qt3support/other/q3process_win.cpp
@@ -285,7 +285,7 @@ bool Q3Process::start( QStringList *env )
for ( ; it != _arguments.end(); ++it ) {
QString tmp = *it;
// escape a single " because the arguments will be parsed
- tmp.replace( QLatin1String("\""), QLatin1String("\\\"") );
+ tmp.replace( QLatin1Char('\"'), QLatin1String("\\\"") );
if ( tmp.isEmpty() || tmp.contains( QLatin1Char(' ') ) || tmp.contains( QLatin1Char('\t') ) ) {
// The argument must not end with a \ since this would be interpreted
// as escaping the quote -- rather put the \ behind the quote: e.g.
@@ -294,9 +294,9 @@ bool Q3Process::start( QStringList *env )
int i = tmp.length();
while ( i>0 && tmp.at( i-1 ) == QLatin1Char('\\') ) {
--i;
- endQuote += QLatin1String("\\");
+ endQuote += QLatin1Char('\\');
}
- args += QString( QLatin1String(" \"") ) + tmp.left( i ) + endQuote;
+ args += QLatin1String(" \"") + tmp.left( i ) + endQuote;
} else {
args += QLatin1Char(' ') + tmp;
}
@@ -330,7 +330,7 @@ bool Q3Process::start( QStringList *env )
// add PATH if necessary (for DLL loading)
QByteArray path = qgetenv( "PATH" );
if ( env->grep( QRegExp(QLatin1String("^PATH="),FALSE) ).empty() && !path.isNull() ) {
- QString tmp = QString( QLatin1String("PATH=%1") ).arg(QString::fromLatin1(path.constData()));
+ QString tmp = QString::fromLatin1("PATH=%1").arg(QLatin1String(path.constData()));
uint tmpSize = sizeof(TCHAR) * (tmp.length()+1);
envlist.resize( envlist.size() + tmpSize );
memcpy( envlist.data()+pos, tmp.ucs2(), tmpSize );
@@ -378,7 +378,7 @@ bool Q3Process::start( QStringList *env )
// add PATH if necessary (for DLL loading)
QByteArray path = qgetenv( "PATH" );
if ( env->grep( QRegExp(QLatin1String("^PATH="),FALSE) ).empty() && !path.isNull() ) {
- Q3CString tmp = QString( QLatin1String("PATH=%1") ).arg(QString::fromLatin1(path.constData())).local8Bit();
+ Q3CString tmp = QString::fromLatin1("PATH=%1").arg(QString::fromLatin1(path.constData())).local8Bit();
uint tmpSize = tmp.length() + 1;
envlist.resize( envlist.size() + tmpSize );
memcpy( envlist.data()+pos, tmp.data(), tmpSize );
diff --git a/src/qt3support/painting/q3paintengine_svg.cpp b/src/qt3support/painting/q3paintengine_svg.cpp
index 95528e8..22e0d49 100644
--- a/src/qt3support/painting/q3paintengine_svg.cpp
+++ b/src/qt3support/painting/q3paintengine_svg.cpp
@@ -263,7 +263,7 @@ void Q3SVGPaintEngine::updateClipPath(const QPainterPath &path, Qt::ClipOperatio
QDomElement e;
d->currentClip++;
e = d->doc.createElement(QLatin1String("clipPath"));
- e.setAttribute(QLatin1String("id"), QString(QLatin1String("clip%1")).arg(d->currentClip));
+ e.setAttribute(QLatin1String("id"), QString::fromLatin1("clip%1").arg(d->currentClip));
QDomElement path_element = d->doc.createElement(QLatin1String("path"));
path_element.setAttribute(QLatin1String("d"), qt_svg_compose_path(path));
@@ -509,14 +509,14 @@ bool Q3SVGPaintEngine::save(const QString &fileName)
int icount = 0;
ImageList::Iterator iit = d->images.begin();
for (; iit != d->images.end(); ++iit) {
- QString href = QString(QLatin1String("%1_%2.png")).arg(svgName).arg(icount);
+ QString href = QString::fromLatin1("%1_%2.png").arg(svgName).arg(icount);
(*iit).image.save(href, "PNG");
(*iit).element.setAttribute(QLatin1String("xlink:href"), href);
icount++;
}
PixmapList::Iterator pit = d->pixmaps.begin();
for (; pit != d->pixmaps.end(); ++pit) {
- QString href = QString(QLatin1String("%1_%2.png")).arg(svgName).arg(icount);
+ QString href = QString::fromLatin1("%1_%2.png").arg(svgName).arg(icount);
(*pit).pixmap.save(href, "PNG");
(*pit).element.setAttribute(QLatin1String("xlink:href"), href);
icount++;
@@ -592,7 +592,7 @@ void Q3SVGPaintEnginePrivate::appendChild(QDomElement &e, QPicturePrivate::Paint
if (c == QPicturePrivate::PdcSetClipRegion || c == QPicturePrivate::PdcSetClipPath) {
QDomElement ne;
ne = doc.createElement(QLatin1String("g"));
- ne.setAttribute(QLatin1String("style"), QString(QLatin1String("clip-path:url(#clip%1)")).arg(currentClip));
+ ne.setAttribute(QLatin1String("style"), QString::fromLatin1("clip-path:url(#clip%1)").arg(currentClip));
if (dirtyTransform) {
applyTransform(&ne);
dirtyTransform = false;
@@ -621,12 +621,12 @@ void Q3SVGPaintEnginePrivate::applyStyle(QDomElement *e, QPicturePrivate::PaintC
if (c == QPicturePrivate::PdcDrawText2 || c == QPicturePrivate::PdcDrawText2Formatted) {
// QPainter has a reversed understanding of pen/stroke vs.
// brush/fill for text
- s += QString(QLatin1String("fill:rgb(%1,%2,%3);")).arg(pcol.red()).arg(pcol.green()).arg(pcol.blue());
- s += QString(QLatin1String("stroke-width:0;"));
+ s += QString::fromLatin1("fill:rgb(%1,%2,%3);").arg(pcol.red()).arg(pcol.green()).arg(pcol.blue());
+ s += QLatin1String("stroke-width:0;");
QFont f = cfont;
QFontInfo fi(f);
- s += QString(QLatin1String("font-size:%1;")).arg(fi.pointSize());
- s += QString(QLatin1String("font-style:%1;")).arg(f.italic() ? QLatin1String("italic") : QLatin1String("normal"));
+ s += QString::fromLatin1("font-size:%1;").arg(fi.pointSize());
+ s += QString::fromLatin1("font-style:%1;").arg(f.italic() ? QLatin1String("italic") : QLatin1String("normal"));
// not a very scientific distribution
QString fw;
if (f.weight() <= QFont::Light)
@@ -641,32 +641,32 @@ void Q3SVGPaintEnginePrivate::applyStyle(QDomElement *e, QPicturePrivate::PaintC
fw = QLatin1String("800");
else
fw = QLatin1String("900");
- s += QString(QLatin1String("font-weight:%1;")).arg(fw);
- s += QString(QLatin1String("font-family:%1;")).arg(f.family());
+ s += QString::fromLatin1("font-weight:%1;").arg(fw);
+ s += QString::fromLatin1("font-family:%1;").arg(f.family());
} else {
- s += QString(QLatin1String("stroke:rgb(%1,%2,%3);")).arg(pcol.red()).arg(pcol.green()).arg(pcol.blue());
+ s += QString::fromLatin1("stroke:rgb(%1,%2,%3);").arg(pcol.red()).arg(pcol.green()).arg(pcol.blue());
if (pcol.alpha() != 255)
- s += QString(QLatin1String("stroke-opacity:%1;")).arg(pcol.alpha()/255.0);
+ s += QString::fromLatin1("stroke-opacity:%1;").arg(pcol.alpha()/255.0);
if (bcol.alpha() != 255)
- s += QString(QLatin1String("fill-opacity:%1;")).arg(bcol.alpha()/255.0);
+ s += QString::fromLatin1("fill-opacity:%1;").arg(bcol.alpha()/255.0);
double pw = cpen.width();
if (pw == 0 && cpen.style() != Qt::NoPen)
pw = 0.9;
if (c == QPicturePrivate::PdcDrawLine)
pw /= (qAbs(worldMatrix.m11()) + qAbs(worldMatrix.m22())) / 2.0;
- s += QString(QLatin1String("stroke-width:%1;")).arg(pw);
+ s += QString::fromLatin1("stroke-width:%1;").arg(pw);
if (cpen.style() == Qt::DashLine)
- s+= QString(QLatin1String("stroke-dasharray:18,6;"));
+ s+= QLatin1String("stroke-dasharray:18,6;");
else if (cpen.style() == Qt::DotLine)
- s+= QString(QLatin1String("stroke-dasharray:3;"));
+ s+= QLatin1String("stroke-dasharray:3;");
else if (cpen.style() == Qt::DashDotLine)
- s+= QString(QLatin1String("stroke-dasharray:9,6,3,6;"));
+ s+= QLatin1String("stroke-dasharray:9,6,3,6;");
else if (cpen.style() == Qt::DashDotDotLine)
- s+= QString(QLatin1String("stroke-dasharray:9,3,3;"));
+ s+= QLatin1String("stroke-dasharray:9,3,3;");
if (cbrush.style() == Qt::NoBrush || c == QPicturePrivate::PdcDrawPolyline || c == QPicturePrivate::PdcDrawCubicBezier)
s += QLatin1String("fill:none;"); // Qt polylines use no brush, neither do Beziers
else
- s += QString(QLatin1String("fill:rgb(%1,%2,%3);")).arg(bcol.red()).arg(bcol.green()).arg(bcol.blue());
+ s += QString::fromLatin1("fill:rgb(%1,%2,%3);").arg(bcol.red()).arg(bcol.green()).arg(bcol.blue());
}
e->setAttribute(QLatin1String("style"), s);
}
@@ -679,13 +679,13 @@ void Q3SVGPaintEnginePrivate::applyTransform(QDomElement *e) const
bool rot = (m.m11() != 1.0 || m.m12() != 0.0 ||
m.m21() != 0.0 || m.m22() != 1.0);
if (!rot && (m.dx() != 0.0 || m.dy() != 0.0)) {
- s = QString(QLatin1String("translate(%1,%2)")).arg(m.dx()).arg(m.dy());
+ s = QString::fromLatin1("translate(%1,%2)").arg(m.dx()).arg(m.dy());
} else if (rot) {
if (m.m12() == 0.0 && m.m21() == 0.0 &&
m.dx() == 0.0 && m.dy() == 0.0)
- s = QString(QLatin1String("scale(%1,%2)")).arg(m.m11()).arg(m.m22());
+ s = QString::fromLatin1("scale(%1,%2)").arg(m.m11()).arg(m.m22());
else
- s = QString(QLatin1String("matrix(%1,%2,%3,%4,%5,%6)"))
+ s = QString::fromLatin1("matrix(%1,%2,%3,%4,%5,%6)")
.arg(m.m11()).arg(m.m12())
.arg(m.m21()).arg(m.m22())
.arg(m.dx()).arg(m.dy());
@@ -730,9 +730,9 @@ bool Q3SVGPaintEngine::play(QPainter *pt)
d->brect.setX(x);
d->brect.setY(y);
QString wstr = attr.contains(QLatin1String("width"))
- ? attr.namedItem(QLatin1String("width")).nodeValue() : QString(QLatin1String("100%"));
+ ? attr.namedItem(QLatin1String("width")).nodeValue() : QString::fromLatin1("100%");
QString hstr = attr.contains(QLatin1String("height"))
- ? attr.namedItem(QLatin1String("height")).nodeValue() : QString(QLatin1String("100%"));
+ ? attr.namedItem(QLatin1String("height")).nodeValue() : QString::fromLatin1("100%");
double width = d->parseLen(wstr, 0, true);
double height = d->parseLen(hstr, 0, false);
// SVG doesn't respect x and y. But we want a proper bounding rect.
diff --git a/src/qt3support/text/q3richtext.cpp b/src/qt3support/text/q3richtext.cpp
index e508001..d02f961 100644
--- a/src/qt3support/text/q3richtext.cpp
+++ b/src/qt3support/text/q3richtext.cpp
@@ -1678,7 +1678,7 @@ void Q3TextDocument::setRichTextInternal(const QString &text, Q3TextCursor* curs
if (curtag.style->displayMode() == Q3StyleSheetItem::DisplayListItem) {
// we are in a li and a new block comes along
- if (nstyle->name() == QString(QLatin1String("ul")) || nstyle->name() == QLatin1String("ol"))
+ if (nstyle->name() == QLatin1String("ul") || nstyle->name() == QLatin1String("ol"))
hasNewPar = false; // we want an empty li (like most browsers)
if (!hasNewPar) {
/* do not add new blocks inside
@@ -1857,7 +1857,7 @@ void Q3TextDocument::setRichTextInternal(const QString &text, Q3TextCursor* curs
curtag.format = curtag.format.makeTextFormat(nstyle, attr, scaleFontsFactor);
if (nstyle->isAnchor()) {
if (!anchorName.isEmpty())
- anchorName += QLatin1String("#") + attr[QLatin1String("name")];
+ anchorName += QLatin1Char('#') + attr[QLatin1String("name")];
else
anchorName = attr[QLatin1String("name")];
curtag.anchorHref = attr[QLatin1String("href")];
@@ -2436,7 +2436,7 @@ QString Q3TextDocument::richText() const
list_type = QLatin1String(" type=") + list_style_to_string(p->listStyle());
for (int i = pastListDepth; i < listDepth; i++) {
s += list_is_ordered(p->listStyle()) ? QLatin1String("<ol") : QLatin1String("<ul");
- s += list_type + QLatin1String(">");
+ s += list_type + QLatin1Char('>');
}
} else {
s += QLatin1Char('\n');
@@ -2463,7 +2463,7 @@ QString Q3TextDocument::richText() const
s += margin_to_string(item_li, p->utm, p->ubm, p->ulm, p->urm, p->uflm);
s += list_value_to_string(p->listValue());
s += direction_to_string(p->direction());
- s += QLatin1String(">");
+ s += QLatin1Char('>');
s += ps;
s += QLatin1String("</li>");
} else if (p->listDepth()) {
@@ -2471,7 +2471,7 @@ QString Q3TextDocument::richText() const
s += align_to_string(p->alignment());
s += margin_to_string(item_div, p->utm, p->ubm, p->ulm, p->urm, p->uflm);
s += direction_to_string(p->direction());
- s += QLatin1String(">");
+ s += QLatin1Char('>');
s += ps;
s += QLatin1String("</div>");
} else {
@@ -2480,7 +2480,7 @@ QString Q3TextDocument::richText() const
s += align_to_string(p->alignment());
s += margin_to_string(item_p, p->utm, p->ubm, p->ulm, p->urm, p->uflm);
s += direction_to_string(p->direction());
- s += QLatin1String(">");
+ s += QLatin1Char('>');
s += ps;
s += QLatin1String("</p>");
}
@@ -6667,7 +6667,7 @@ Q3TextImage::Q3TextImage(Q3TextDocument *p, const QMap<QString, QString> &attr,
imageName = attr[QLatin1String("source")];
if (!imageName.isEmpty()) {
- imgId = QString(QLatin1String("%1,%2,%3,%4")).arg(imageName).arg(width).arg(height).arg((ulong)&factory);
+ imgId = QString::fromLatin1("%1,%2,%3,%4").arg(imageName).arg(width).arg(height).arg((ulong)&factory);
if (!pixmap_map)
pixmap_map = new QMap<QString, QPixmapInt>;
if (pixmap_map->contains(imgId)) {
@@ -6761,13 +6761,13 @@ QString Q3TextImage::richText() const
s += QLatin1String("<img ");
QMap<QString, QString>::ConstIterator it = attributes.begin();
for (; it != attributes.end(); ++it) {
- s += it.key() + QLatin1String("=");
+ s += it.key() + QLatin1Char('=');
if ((*it).contains(QLatin1Char(' ')))
- s += QLatin1String("\"") + *it + QLatin1String("\" ");
+ s += QLatin1Char('\"') + *it + QLatin1String("\" ");
else
- s += *it + QLatin1String(" ");
+ s += *it + QLatin1Char(' ');
}
- s += QLatin1String(">");
+ s += QLatin1Char('>');
return s;
}
@@ -7722,7 +7722,7 @@ QString Q3TextTable::richText() const
s = QLatin1String("<table ");
QMap<QString, QString>::ConstIterator it = attributes.begin();
for (; it != attributes.end(); ++it)
- s += it.key() + QLatin1String("=") + *it + QLatin1String(" ");
+ s += it.key() + QLatin1Char('=') + *it + QLatin1Char(' ');
s += QLatin1String(">\n");
int lastRow = -1;
@@ -7739,8 +7739,8 @@ QString Q3TextTable::richText() const
s += QLatin1String("<td");
it = cell->attributes.constBegin();
for (; it != cell->attributes.constEnd(); ++it)
- s += QLatin1String(" ") + it.key() + QLatin1String("=") + *it;
- s += QLatin1String(">");
+ s += QLatin1Char(' ') + it.key() + QLatin1Char('=') + *it;
+ s += QLatin1Char('>');
s += cell->richText()->richText();
s += QLatin1String("</td>");
}
diff --git a/src/qt3support/text/q3textedit.cpp b/src/qt3support/text/q3textedit.cpp
index 7577dce..d1db1e4 100644
--- a/src/qt3support/text/q3textedit.cpp
+++ b/src/qt3support/text/q3textedit.cpp
@@ -77,7 +77,7 @@
#include <qkeysequence.h>
#define ACCEL_KEY(k) QLatin1Char('\t') + QString(QKeySequence(Qt::CTRL | Qt::Key_ ## k))
#else
-#define ACCEL_KEY(k) QLatin1Char('\t' )+ QString(QLatin1String("Ctrl+" #k))
+#define ACCEL_KEY(k) QLatin1Char('\t' )+ QString::fromLatin1("Ctrl+" #k)
#endif
#ifdef QT_TEXTEDIT_OPTIMIZATION
@@ -6625,7 +6625,7 @@ void Q3TextEdit::optimSetTextFormat(Q3TextDocument * td, Q3TextCursor * cur,
}
if (tag) {
QString col = tag->tag.simplified();
- if (col.left(10) == QLatin1String("font color")) {
+ if (col.startsWith(QLatin1String("font color"))) {
int i = col.indexOf(QLatin1Char('='), 10);
col = col.mid(i + 1).simplified();
if (col[0] == QLatin1Char('\"'))
diff --git a/src/qt3support/widgets/q3mainwindow.cpp b/src/qt3support/widgets/q3mainwindow.cpp
index 2ee3bdc..ae80321 100644
--- a/src/qt3support/widgets/q3mainwindow.cpp
+++ b/src/qt3support/widgets/q3mainwindow.cpp
@@ -2261,7 +2261,7 @@ static void saveDockArea(QTextStream &ts, Q3DockArea *a)
for (int i = 0; i < l.size(); ++i) {
Q3DockWindow *dw = l.at(i);
ts << QString(dw->windowTitle());
- ts << ",";
+ ts << ',';
}
ts << endl;
ts << *a;
@@ -2287,7 +2287,7 @@ QTextStream &operator<<(QTextStream &ts, const Q3MainWindow &mainWindow)
for (int i = 0; i < l.size(); ++i) {
Q3DockWindow *dw = l.at(i);
ts << dw->windowTitle();
- ts << ",";
+ ts << ',';
}
ts << endl;
@@ -2295,17 +2295,17 @@ QTextStream &operator<<(QTextStream &ts, const Q3MainWindow &mainWindow)
for (int i = 0; i < l.size(); ++i) {
Q3DockWindow *dw = l.at(i);
ts << dw->windowTitle();
- ts << ",";
+ ts << ',';
}
ts << endl;
for (int i = 0; i < l.size(); ++i) {
Q3DockWindow *dw = l.at(i);
- ts << "[" << dw->windowTitle() << ","
- << (int)dw->geometry().x() << ","
- << (int)dw->geometry().y() << ","
- << (int)dw->geometry().width() << ","
- << (int)dw->geometry().height() << ","
- << (int)dw->isVisible() << "]";
+ ts << '[' << dw->windowTitle() << ','
+ << (int)dw->geometry().x() << ','
+ << (int)dw->geometry().y() << ','
+ << (int)dw->geometry().width() << ','
+ << (int)dw->geometry().height() << ','
+ << (int)dw->isVisible() << ']';
}
ts << endl;
diff --git a/src/script/qscriptcontext.cpp b/src/script/qscriptcontext.cpp
index 020601b..ff519c7 100644
--- a/src/script/qscriptcontext.cpp
+++ b/src/script/qscriptcontext.cpp
@@ -469,7 +469,7 @@ QString QScriptContext::toString() const
QScriptValue arg = argument(i);
result.append(safeValueToString(arg));
}
- result.append(QLatin1String(")"));
+ result.append(QLatin1Char(')'));
QString fileName = info.fileName();
int lineNumber = info.lineNumber();
diff --git a/src/script/qscriptcontext_p.cpp b/src/script/qscriptcontext_p.cpp
index 199c9d4..f19ba9c 100644
--- a/src/script/qscriptcontext_p.cpp
+++ b/src/script/qscriptcontext_p.cpp
@@ -841,7 +841,7 @@ Ltop:
flags = iPtr->operand[1].m_int_value;
#ifndef QT_NO_REGEXP
if (flags != 0) {
- literal += QLatin1String("/");
+ literal += QLatin1Char('/');
literal += QString::number(flags);
}
#endif
@@ -2396,10 +2396,10 @@ QStringList QScriptContextPrivate::backtrace() const
s += QLatin1String("<global>");
}
}
- s += QLatin1String("(");
+ s += QLatin1Char('(');
for (int i = 0; i < ctx->argc; ++i) {
if (i > 0)
- s += QLatin1String(",");
+ s += QLatin1Char(',');
QScriptValueImpl arg = ctx->args[i];
if (arg.isObject())
s += QLatin1String("[object Object]"); // don't do a function call
diff --git a/src/script/qscriptecmaerror.cpp b/src/script/qscriptecmaerror.cpp
index fc39bf9..0dde68c 100644
--- a/src/script/qscriptecmaerror.cpp
+++ b/src/script/qscriptecmaerror.cpp
@@ -318,18 +318,18 @@ QStringList Error::backtrace(const QScriptValueImpl &error)
} else {
s += functionName;
}
- s += QLatin1String("(");
+ s += QLatin1Char('(');
QScriptValueImpl arguments = frame.property(QLatin1String("arguments"));
if (arguments.isObject()) {
int argCount = arguments.property(QLatin1String("length")).toInt32();
for (int j = 0; j < argCount; ++j) {
if (j > 0)
- s += QLatin1String(",");
+ s += QLatin1Char(',');
s += arguments.property(j).toString();
}
}
s += QLatin1String(")@") + o.property(QLatin1String("fileName")).toString()
- + QLatin1String(":") + o.property(QLatin1String("lineNumber")).toString();
+ + QLatin1Char(':') + o.property(QLatin1String("lineNumber")).toString();
result.append(s);
}
return result;
diff --git a/src/script/qscriptecmafunction.cpp b/src/script/qscriptecmafunction.cpp
index ec45ae4..a1e5b58 100644
--- a/src/script/qscriptecmafunction.cpp
+++ b/src/script/qscriptecmafunction.cpp
@@ -197,7 +197,7 @@ QString Function::buildFunction(QScriptContextPrivate *context)
// the formals
for (int i = 0; i < argc - 1; ++i) {
if (i != 0)
- code += QLatin1String(",");
+ code += QLatin1Char(',');
code += context->argument(i).toString();
}
diff --git a/src/script/qscriptecmaglobal.cpp b/src/script/qscriptecmaglobal.cpp
index da7ab9e..b5cf675 100644
--- a/src/script/qscriptecmaglobal.cpp
+++ b/src/script/qscriptecmaglobal.cpp
@@ -296,7 +296,7 @@ public:
QString result;
for (int i = 0; i < context->argumentCount(); ++i) {
if (i != 0)
- result.append(QLatin1String(" "));
+ result.append(QLatin1Char(' '));
QString s = context->argument(i).toString();
if (context->state() == QScriptContext::ExceptionState)
diff --git a/src/script/qscriptecmaobject.cpp b/src/script/qscriptecmaobject.cpp
index 694f479..c4a1b08 100644
--- a/src/script/qscriptecmaobject.cpp
+++ b/src/script/qscriptecmaobject.cpp
@@ -113,7 +113,7 @@ QScriptValueImpl Object::method_toString(QScriptContextPrivate *context, QScript
QString s = QLatin1String("[object ");
QScriptValueImpl self = context->thisObject();
s += self.classInfo()->name();
- s += QLatin1String("]");
+ s += QLatin1Char(']');
return (QScriptValueImpl(eng, s));
}
diff --git a/src/script/qscriptparser.cpp b/src/script/qscriptparser.cpp
index 0b04df1..7408ec5 100644
--- a/src/script/qscriptparser.cpp
+++ b/src/script/qscriptparser.cpp
@@ -1148,9 +1148,9 @@ case 266: {
error_message += QLatin1String (", ");
first = false;
- error_message += QLatin1String("`");
+ error_message += QLatin1Char('`');
error_message += QLatin1String (spell [expected_tokens [s]]);
- error_message += QLatin1String("'");
+ error_message += QLatin1Char('\'');
}
}
diff --git a/src/script/qscriptprettypretty.cpp b/src/script/qscriptprettypretty.cpp
index 6ee1e55..b221b0a 100644
--- a/src/script/qscriptprettypretty.cpp
+++ b/src/script/qscriptprettypretty.cpp
@@ -73,13 +73,13 @@ PrettyPretty::~PrettyPretty()
void PrettyPretty::acceptAsBlock(AST::Node *node)
{
- out << "{";
+ out << '{';
pushIndentLevel();
newlineAndIndent();
accept(node);
popIndentLevel();
newlineAndIndent();
- out << "}";
+ out << '}';
}
int PrettyPretty::operatorPrecedenceLevel(int op)
@@ -230,8 +230,8 @@ void PrettyPretty::endVisit(AST::FalseLiteral *node)
bool PrettyPretty::visit(AST::StringLiteral *node)
{
QString lit = QScriptEnginePrivate::toString(node->value);
- lit.replace(QLatin1String("\\"), QLatin1String("\\\\"));
- out << "\"" << lit << "\"";
+ lit.replace(QLatin1Char('\\'), QLatin1String("\\\\"));
+ out << '\"' << lit << '\"';
return false;
}
@@ -253,7 +253,7 @@ void PrettyPretty::endVisit(AST::NumericLiteral *node)
bool PrettyPretty::visit(AST::RegExpLiteral *node)
{
- out << "/" << QScriptEnginePrivate::toString(node->pattern) << "/";
+ out << '/' << QScriptEnginePrivate::toString(node->pattern) << '/';
if (node->flags)
out << QScript::Ecma::RegExp::flagsToString(node->flags);
@@ -267,10 +267,10 @@ void PrettyPretty::endVisit(AST::RegExpLiteral *node)
bool PrettyPretty::visit(AST::ArrayLiteral *node)
{
- out << "[";
+ out << '[';
accept(node->elements);
accept(node->elision);
- out << "]";
+ out << ']';
return false;
}
@@ -281,7 +281,7 @@ void PrettyPretty::endVisit(AST::ArrayLiteral *node)
bool PrettyPretty::visit(AST::ObjectLiteral *node)
{
- out << "{";
+ out << '{';
if (node->properties) {
pushIndentLevel();
AST::PropertyNameAndValueList *prop;
@@ -289,12 +289,12 @@ bool PrettyPretty::visit(AST::ObjectLiteral *node)
newlineAndIndent();
accept(prop);
if (prop->next)
- out << ",";
+ out << ',';
}
popIndentLevel();
newlineAndIndent();
}
- out << "}";
+ out << '}';
return false;
}
@@ -384,9 +384,9 @@ void PrettyPretty::endVisit(AST::NumericLiteralPropertyName *node)
bool PrettyPretty::visit(AST::ArrayMemberExpression *node)
{
accept(node->base);
- out << "[";
+ out << '[';
accept(node->expression);
- out << "]";
+ out << ']';
return false;
}
@@ -398,7 +398,7 @@ void PrettyPretty::endVisit(AST::ArrayMemberExpression *node)
bool PrettyPretty::visit(AST::FieldMemberExpression *node)
{
accept(node->base);
- out << "." << QScriptEnginePrivate::toString(node->name);
+ out << '.' << QScriptEnginePrivate::toString(node->name);
return false;
}
@@ -411,9 +411,9 @@ bool PrettyPretty::visit(AST::NewMemberExpression *node)
{
out << "new ";
accept(node->base);
- out << "(";
+ out << '(';
accept(node->arguments);
- out << ")";
+ out << ')';
return false;
}
@@ -437,9 +437,9 @@ void PrettyPretty::endVisit(AST::NewExpression *node)
bool PrettyPretty::visit(AST::CallExpression *node)
{
accept(node->base);
- out << "(";
+ out << '(';
accept(node->arguments);
- out << ")";
+ out << ')';
return false;
}
@@ -549,13 +549,13 @@ void PrettyPretty::endVisit(AST::PreDecrementExpression *node)
bool PrettyPretty::visit(AST::UnaryPlusExpression *node)
{
- out << "+";
+ out << '+';
bool needParens = (node->expression->binaryExpressionCast() != 0);
if (needParens)
- out << "(";
+ out << '(';
accept(node->expression);
if (needParens)
- out << ")";
+ out << ')';
return false;
}
@@ -566,13 +566,13 @@ void PrettyPretty::endVisit(AST::UnaryPlusExpression *node)
bool PrettyPretty::visit(AST::UnaryMinusExpression *node)
{
- out << "-";
+ out << '-';
bool needParens = (node->expression->binaryExpressionCast() != 0);
if (needParens)
- out << "(";
+ out << '(';
accept(node->expression);
if (needParens)
- out << ")";
+ out << ')';
return false;
}
@@ -583,13 +583,13 @@ void PrettyPretty::endVisit(AST::UnaryMinusExpression *node)
bool PrettyPretty::visit(AST::TildeExpression *node)
{
- out << "~";
+ out << '~';
bool needParens = (node->expression->binaryExpressionCast() != 0);
if (needParens)
- out << "(";
+ out << '(';
accept(node->expression);
if (needParens)
- out << ")";
+ out << ')';
return false;
}
@@ -600,13 +600,13 @@ void PrettyPretty::endVisit(AST::TildeExpression *node)
bool PrettyPretty::visit(AST::NotExpression *node)
{
- out << "!";
+ out << '!';
bool needParens = (node->expression->binaryExpressionCast() != 0);
if (needParens)
- out << "(";
+ out << '(';
accept(node->expression);
if (needParens)
- out << ")";
+ out << ')';
return false;
}
@@ -620,10 +620,10 @@ bool PrettyPretty::visit(AST::BinaryExpression *node)
bool needParens = node->left->binaryExpressionCast()
&& (compareOperatorPrecedence(node->left->binaryExpressionCast()->op, node->op) < 0);
if (needParens)
- out << "(";
+ out << '(';
accept(node->left);
if (needParens)
- out << ")";
+ out << ')';
QString s;
switch (node->op) {
case QSOperator::Add:
@@ -699,14 +699,14 @@ bool PrettyPretty::visit(AST::BinaryExpression *node)
default:
Q_ASSERT (0);
}
- out << " " << s << " ";
+ out << ' ' << s << ' ';
needParens = node->right->binaryExpressionCast()
&& (compareOperatorPrecedence(node->right->binaryExpressionCast()->op, node->op) <= 0);
if (needParens)
- out << "(";
+ out << '(';
accept(node->right);
if (needParens)
- out << ")";
+ out << ')';
return false;
}
@@ -798,7 +798,7 @@ bool PrettyPretty::visit(AST::VariableStatement *node)
void PrettyPretty::endVisit(AST::VariableStatement *node)
{
Q_UNUSED(node);
- out << ";";
+ out << ';';
}
bool PrettyPretty::visit(AST::VariableDeclaration *node)
@@ -819,7 +819,7 @@ void PrettyPretty::endVisit(AST::VariableDeclaration *node)
bool PrettyPretty::visit(AST::EmptyStatement *node)
{
Q_UNUSED(node);
- out << ";";
+ out << ';';
return true;
}
@@ -831,7 +831,7 @@ void PrettyPretty::endVisit(AST::EmptyStatement *node)
bool PrettyPretty::visit(AST::ExpressionStatement *node)
{
accept(node->expression);
- out << ";";
+ out << ';';
return false;
}
@@ -959,9 +959,9 @@ bool PrettyPretty::visit(AST::ContinueStatement *node)
{
out << "continue";
if (node->label) {
- out << " " << QScriptEnginePrivate::toString(node->label);
+ out << ' ' << QScriptEnginePrivate::toString(node->label);
}
- out << ";";
+ out << ';';
return false;
}
@@ -974,9 +974,9 @@ bool PrettyPretty::visit(AST::BreakStatement *node)
{
out << "break";
if (node->label) {
- out << " " << QScriptEnginePrivate::toString(node->label);
+ out << ' ' << QScriptEnginePrivate::toString(node->label);
}
- out << ";";
+ out << ';';
return false;
}
@@ -989,10 +989,10 @@ bool PrettyPretty::visit(AST::ReturnStatement *node)
{
out << "return";
if (node->expression) {
- out << " ";
+ out << ' ';
accept(node->expression);
}
- out << ";";
+ out << ';';
return false;
}
@@ -1067,7 +1067,7 @@ bool PrettyPretty::visit(AST::CaseClause *node)
{
out << "case ";
accept(node->expression);
- out << ":";
+ out << ':';
if (node->statements) {
newlineAndIndent();
accept(node->statements);
@@ -1109,7 +1109,7 @@ bool PrettyPretty::visit(AST::ThrowStatement *node)
Q_UNUSED(node);
out << "throw ";
accept(node->expression);
- out << ";";
+ out << ';';
return false;
}
@@ -1166,10 +1166,10 @@ bool PrettyPretty::visit(AST::FunctionDeclaration *node)
out << "function";
if (node->name)
- out << " " << QScriptEnginePrivate::toString(node->name);
+ out << ' ' << QScriptEnginePrivate::toString(node->name);
// the arguments
- out << "(";
+ out << '(';
for (AST::FormalParameterList *it = node->formals; it; it = it->next) {
if (it->name)
out << QScriptEnginePrivate::toString(it->name);
@@ -1177,7 +1177,7 @@ bool PrettyPretty::visit(AST::FunctionDeclaration *node)
if (it->next)
out << ", ";
}
- out << ")";
+ out << ')';
// the function body
out << " {";
@@ -1190,7 +1190,7 @@ bool PrettyPretty::visit(AST::FunctionDeclaration *node)
newlineAndIndent();
}
- out << "}";
+ out << '}';
return false;
}
@@ -1205,10 +1205,10 @@ bool PrettyPretty::visit(AST::FunctionExpression *node)
out << "function";
if (node->name)
- out << " " << QScriptEnginePrivate::toString(node->name);
+ out << ' ' << QScriptEnginePrivate::toString(node->name);
// the arguments
- out << "(";
+ out << '(';
for (AST::FormalParameterList *it = node->formals; it; it = it->next) {
if (it->name)
out << QScriptEnginePrivate::toString(it->name);
@@ -1216,7 +1216,7 @@ bool PrettyPretty::visit(AST::FunctionExpression *node)
if (it->next)
out << ", ";
}
- out << ")";
+ out << ')';
// the function body
out << " {";
@@ -1229,7 +1229,7 @@ bool PrettyPretty::visit(AST::FunctionExpression *node)
newlineAndIndent();
}
- out << "}";
+ out << '}';
return false;
}
@@ -1320,7 +1320,7 @@ bool PrettyPretty::visit(AST::DebuggerStatement *node)
void PrettyPretty::endVisit(AST::DebuggerStatement *node)
{
Q_UNUSED(node);
- out << ";";
+ out << ';';
}
bool PrettyPretty::preVisit(AST::Node *node)
diff --git a/src/script/qscriptsyntaxchecker.cpp b/src/script/qscriptsyntaxchecker.cpp
index 9653bc1..74ca00f 100644
--- a/src/script/qscriptsyntaxchecker.cpp
+++ b/src/script/qscriptsyntaxchecker.cpp
@@ -186,9 +186,9 @@ SyntaxChecker::Result SyntaxChecker::checkSyntax(const QString &code)
error_message += QLatin1String (", ");
first = false;
- error_message += QLatin1String("`");
+ error_message += QLatin1Char('`');
error_message += QLatin1String (spell [expected_tokens [s]]);
- error_message += QLatin1String("'");
+ error_message += QLatin1Char('\'');
}
}
diff --git a/src/script/qscriptvalueimpl.cpp b/src/script/qscriptvalueimpl.cpp
index 15d1b8a..a890839 100644
--- a/src/script/qscriptvalueimpl.cpp
+++ b/src/script/qscriptvalueimpl.cpp
@@ -395,7 +395,7 @@ QDebug &operator<<(QDebug &d, const QScriptValueImpl &object)
QScriptObject *od = object.objectValue();
for (int i=0; i<od->memberCount(); ++i) {
if (i != 0)
- d << ",";
+ d << ',';
QScript::Member m;
od->member(i, &m);
@@ -404,7 +404,7 @@ QDebug &operator<<(QDebug &d, const QScriptValueImpl &object)
d << object.engine()->toString(m.nameId());
QScriptValueImpl o;
od->get(m, &o);
- d.nospace() << QLatin1String(":")
+ d.nospace() << QLatin1Char(':')
<< (o.classInfo()
? o.classInfo()->name()
: QLatin1String("?"));
@@ -415,14 +415,14 @@ QDebug &operator<<(QDebug &d, const QScriptValueImpl &object)
QScriptValueImpl scope = object.scope();
while (scope.isValid()) {
Q_ASSERT(scope.isObject());
- d.nospace() << " " << scope.objectValue();
+ d.nospace() << ' ' << scope.objectValue();
scope = scope.scope();
}
- d.nospace() << "}";
+ d.nospace() << '}';
break;
}
- d << ")";
+ d << ')';
return d;
}
diff --git a/src/script/qscriptxmlgenerator.cpp b/src/script/qscriptxmlgenerator.cpp
index 131882b..163b60c 100644
--- a/src/script/qscriptxmlgenerator.cpp
+++ b/src/script/qscriptxmlgenerator.cpp
@@ -121,10 +121,10 @@ QTextStream &XmlGenerator::startTag(const QString &name, AST::Node *locationNode
{
pushIndentLevel();
newlineAndIndent();
- out << QLatin1String("<") << name;
+ out << QLatin1Char('<') << name;
if (locationNode)
- out << QLatin1String(" line=\"") << locationNode->startLine << QLatin1String("\"");
- out << QLatin1String(">");
+ out << QLatin1String(" line=\"") << locationNode->startLine << QLatin1Char('\"');
+ out << QLatin1Char('>');
return out;
}
@@ -132,7 +132,7 @@ QTextStream &XmlGenerator::endTag(const QString &name)
{
newlineAndIndent();
popIndentLevel();
- out << QLatin1String("</") << escape(name) << QLatin1String(">");
+ out << QLatin1String("</") << escape(name) << QLatin1Char('>');
return out;
}
@@ -233,7 +233,7 @@ void XmlGenerator::endVisit(AST::NumericLiteral *)
bool XmlGenerator::visit(AST::RegExpLiteral *node)
{
startTag(QLatin1String("regexp"));
- out << QLatin1String("/") << escape(QScriptEnginePrivate::toString(node->pattern)) << QLatin1String("/");
+ out << QLatin1Char('/') << escape(QScriptEnginePrivate::toString(node->pattern)) << QLatin1Char('/');
if (node->flags)
out << QScript::Ecma::RegExp::flagsToString(node->flags);
out << QLatin1String("</regexp>");
diff --git a/src/scripttools/debugging/qscriptcompletiontask.cpp b/src/scripttools/debugging/qscriptcompletiontask.cpp
index 119b96a..2f3c2cf 100644
--- a/src/scripttools/debugging/qscriptcompletiontask.cpp
+++ b/src/scripttools/debugging/qscriptcompletiontask.cpp
@@ -158,7 +158,7 @@ void QScriptCompletionTaskPrivate::completeScriptExpression()
if (path.size() > 1) {
const QString &topLevelIdent = path.at(0);
QScriptValue obj;
- if (topLevelIdent == QString::fromLatin1("this")) {
+ if (topLevelIdent == QLatin1String("this")) {
obj = ctx->thisObject();
} else {
QScriptValueList scopeChain;
@@ -256,9 +256,9 @@ void QScriptCompletionTask::start()
}
QString argType = cmd->argumentTypes().value(argNum);
if (!argType.isEmpty()) {
- if (argType == QString::fromLatin1("command-or-group-name")) {
+ if (argType == QLatin1String("command-or-group-name")) {
d->results = d->console->commandManager()->completions(arg);
- } else if (argType == QString::fromLatin1("script-filename")) {
+ } else if (argType == QLatin1String("script-filename")) {
// ### super-cheating for now; have to use the async API
QScriptEngineDebuggerFrontend *edf = static_cast<QScriptEngineDebuggerFrontend*>(d->frontend);
QScriptDebuggerBackend *backend = edf->backend();
@@ -269,13 +269,13 @@ void QScriptCompletionTask::start()
if (isPrefixOf(arg, fileName))
d->results.append(fileName);
}
- } else if (argType == QString::fromLatin1("subcommand-name")) {
+ } else if (argType == QLatin1String("subcommand-name")) {
for (int i = 0; i < cmd->subCommands().size(); ++i) {
QString name = cmd->subCommands().at(i);
if (isPrefixOf(arg, name))
d->results.append(name);
}
- } else if (argType == QString::fromLatin1("script")) {
+ } else if (argType == QLatin1String("script")) {
d->completeScriptExpression();
}
if ((d->type == NoCompletion) && !d->results.isEmpty()) {
diff --git a/src/scripttools/debugging/qscriptdebuggerbackend.cpp b/src/scripttools/debugging/qscriptdebuggerbackend.cpp
index 3c29130..0771d0b 100644
--- a/src/scripttools/debugging/qscriptdebuggerbackend.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerbackend.cpp
@@ -292,7 +292,7 @@ QScriptValue QScriptDebuggerBackendPrivate::trace(QScriptContext *context,
QString str;
for (int i = 0; i < context->argumentCount(); ++i) {
if (i > 0)
- str.append(QLatin1String(" "));
+ str.append(QLatin1Char(' '));
str.append(context->argument(i).toString());
}
QScriptDebuggerEvent e(QScriptDebuggerEvent::Trace);
diff --git a/src/scripttools/debugging/qscriptdebuggerconsole.cpp b/src/scripttools/debugging/qscriptdebuggerconsole.cpp
index 70bb8b1..546ec63 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsole.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerconsole.cpp
@@ -163,10 +163,10 @@ QScriptDebuggerConsoleCommandJob *QScriptDebuggerConsolePrivate::createJob(
.arg(name));
for (int j = 0; j < completions.size(); ++j) {
if (j > 0)
- msg.append(QString::fromLatin1(", "));
+ msg.append(QLatin1String(", "));
msg.append(completions.at(j));
}
- msg.append(QString::fromLatin1("."));
+ msg.append(QLatin1Char('.'));
messageHandler->message(QtWarningMsg, msg);
return 0;
}
diff --git a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
index caeb971..e096ba8 100644
--- a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
@@ -807,7 +807,7 @@ QVariant QScriptDebuggerLocalsModel::data(const QModelIndex &index, int role) co
QString str = node->property.valueAsString();
if (node->property.value().type() == QScriptDebuggerValue::StringValue) {
// escape
- str.replace(QLatin1String("\""), QLatin1String("\\\""));
+ str.replace(QLatin1Char('\"'), QLatin1String("\\\""));
str.prepend(QLatin1Char('\"'));
str.append(QLatin1Char('\"'));
}
diff --git a/src/scripttools/debugging/qscriptenginedebugger.cpp b/src/scripttools/debugging/qscriptenginedebugger.cpp
index e35bd1d..0f8b600 100644
--- a/src/scripttools/debugging/qscriptenginedebugger.cpp
+++ b/src/scripttools/debugging/qscriptenginedebugger.cpp
@@ -63,16 +63,23 @@
#include <QtGui/qtoolbar.h>
#include <QtGui/qboxlayout.h>
+// this has to be outside the namespace
+static void initScriptEngineDebuggerResources()
+{
+ Q_INIT_RESOURCE(scripttools_debugging);
+}
+
+QT_BEGIN_NAMESPACE
+
class QtScriptDebuggerResourceInitializer
{
public:
QtScriptDebuggerResourceInitializer() {
- Q_INIT_RESOURCE(scripttools_debugging);
+ // call outside-the-namespace function
+ initScriptEngineDebuggerResources();
}
};
-QT_BEGIN_NAMESPACE
-
/*!
\since 4.5
\class QScriptEngineDebugger
diff --git a/src/sql/drivers/db2/qsql_db2.cpp b/src/sql/drivers/db2/qsql_db2.cpp
index 11d0041..c7cbc9b 100644
--- a/src/sql/drivers/db2/qsql_db2.cpp
+++ b/src/sql/drivers/db2/qsql_db2.cpp
@@ -1666,7 +1666,7 @@ QVariant QDB2Driver::handle() const
QString QDB2Driver::escapeIdentifier(const QString &identifier, IdentifierType) const
{
QString res = identifier;
- if(!identifier.isEmpty() && identifier.left(1) != QString(QLatin1Char('"')) && identifier.right(1) != QString(QLatin1Char('"')) ) {
+ if(!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('"')) && !identifier.endsWith(QLatin1Char('"')) ) {
res.replace(QLatin1Char('"'), QLatin1String("\"\""));
res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
res.replace(QLatin1Char('.'), QLatin1String("\".\""));
diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp
index 1645555..199ad8e 100644
--- a/src/sql/drivers/ibase/qsql_ibase.cpp
+++ b/src/sql/drivers/ibase/qsql_ibase.cpp
@@ -1732,7 +1732,7 @@ bool QIBaseDriver::subscribeToNotificationImplementation(const QString &name)
eBuffer->resultBuffer);
if (status[0] == 1 && status[1]) {
- setLastError(QSqlError(QString(QLatin1String("Could not subscribe to event notifications for %1.")).arg(name)));
+ setLastError(QSqlError(QString::fromLatin1("Could not subscribe to event notifications for %1.").arg(name)));
d->eventBuffers.remove(name);
qFreeEventBuffer(eBuffer);
return false;
@@ -1760,7 +1760,7 @@ bool QIBaseDriver::unsubscribeFromNotificationImplementation(const QString &name
isc_cancel_events(status, &d->ibase, &eBuffer->eventId);
if (status[0] == 1 && status[1]) {
- setLastError(QSqlError(QString(QLatin1String("Could not unsubscribe from event notifications for %1.")).arg(name)));
+ setLastError(QSqlError(QString::fromLatin1("Could not unsubscribe from event notifications for %1.").arg(name)));
return false;
}
@@ -1818,7 +1818,7 @@ void QIBaseDriver::qHandleEventNotification(void *updatedResultBuffer)
QString QIBaseDriver::escapeIdentifier(const QString &identifier, IdentifierType) const
{
QString res = identifier;
- if(!identifier.isEmpty() && identifier.left(1) != QString(QLatin1Char('"')) && identifier.right(1) != QString(QLatin1Char('"')) ) {
+ if(!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('"')) && !identifier.endsWith(QLatin1Char('"')) ) {
res.replace(QLatin1Char('"'), QLatin1String("\"\""));
res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
res.replace(QLatin1Char('.'), QLatin1String("\".\""));
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp
index 51fc306..82ed124 100644
--- a/src/sql/drivers/mysql/qsql_mysql.cpp
+++ b/src/sql/drivers/mysql/qsql_mysql.cpp
@@ -927,6 +927,7 @@ bool QMYSQLResult::exec()
nullVector[i] = static_cast<my_bool>(val.isNull());
currBind->is_null = &nullVector[i];
currBind->length = 0;
+ currBind->is_unsigned = 0;
switch (val.type()) {
case QVariant::ByteArray:
@@ -973,7 +974,6 @@ bool QMYSQLResult::exec()
currBind->buffer_type = MYSQL_TYPE_DOUBLE;
currBind->buffer = data;
currBind->buffer_length = sizeof(double);
- currBind->is_unsigned = 0;
break;
case QVariant::LongLong:
case QVariant::ULongLong:
@@ -989,7 +989,6 @@ bool QMYSQLResult::exec()
currBind->buffer_type = MYSQL_TYPE_STRING;
currBind->buffer = const_cast<char *>(ba.constData());
currBind->buffer_length = ba.length();
- currBind->is_unsigned = 0;
break; }
}
}
@@ -1469,7 +1468,7 @@ QString QMYSQLDriver::formatValue(const QSqlField &field, bool trimStrings) cons
QString QMYSQLDriver::escapeIdentifier(const QString &identifier, IdentifierType) const
{
QString res = identifier;
- if(!identifier.isEmpty() && identifier.left(1) != QString(QLatin1Char('`')) && identifier.right(1) != QString(QLatin1Char('`')) ) {
+ if(!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('`')) && !identifier.endsWith(QLatin1Char('`')) ) {
res.prepend(QLatin1Char('`')).append(QLatin1Char('`'));
res.replace(QLatin1Char('.'), QLatin1String("`.`"));
}
@@ -1479,12 +1478,9 @@ QString QMYSQLDriver::escapeIdentifier(const QString &identifier, IdentifierType
bool QMYSQLDriver::isIdentifierEscapedImplementation(const QString &identifier, IdentifierType type) const
{
Q_UNUSED(type);
- bool isLeftDelimited = (identifier.left(1) == QString(QLatin1Char('`')));
- bool isRightDelimited = (identifier.right(1) == QString(QLatin1Char('`')));
- if( identifier.size() > 2 && isLeftDelimited && isRightDelimited )
- return true;
- else
- return false;
+ return identifier.size() > 2
+ && identifier.startsWith(QLatin1Char('`')) //left delimited
+ && identifier.endsWith(QLatin1Char('`')); //right delimited
}
QT_END_NAMESPACE
diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp
index d63c482..e6ee63d 100644
--- a/src/sql/drivers/oci/qsql_oci.cpp
+++ b/src/sql/drivers/oci/qsql_oci.cpp
@@ -1789,7 +1789,7 @@ bool QOCIResult::prepare(const QString& query)
bool QOCIResult::exec()
{
int r = 0;
- ub2 stmtType;
+ ub2 stmtType=0;
ub4 iters;
ub4 mode;
QList<QByteArray> tmpStorage;
@@ -1803,6 +1803,16 @@ bool QOCIResult::exec()
OCI_ATTR_STMT_TYPE,
d->err);
+ if (r != OCI_SUCCESS && r != OCI_SUCCESS_WITH_INFO) {
+ qOraWarning("QOCIResult::exec: Unable to get statement type:", d->err);
+ setLastError(qMakeError(QCoreApplication::translate("QOCIResult",
+ "Unable to get statement type"), QSqlError::StatementError, d->err));
+#ifdef QOCI_DEBUG
+ qDebug() << "lastQuery()" << lastQuery();
+#endif
+ return false;
+ }
+
if (stmtType == OCI_STMT_SELECT) {
iters = 0;
mode = OCI_DEFAULT;
@@ -2030,8 +2040,8 @@ bool QOCIDriver::open(const QString & db,
QString connectionString = db;
if (!hostname.isEmpty())
connectionString =
- QString(QLatin1String("(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=%1)(Port=%2))"
- "(CONNECT_DATA=(SID=%3)))")).arg(hostname).arg((port > -1 ? port : 1521)).arg(db);
+ QString::fromLatin1("(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=%1)(Port=%2))"
+ "(CONNECT_DATA=(SID=%3)))").arg(hostname).arg((port > -1 ? port : 1521)).arg(db);
r = OCIHandleAlloc(d->env, reinterpret_cast<void **>(&d->srvhp), OCI_HTYPE_SERVER, 0, 0);
if (r == OCI_SUCCESS)
@@ -2209,7 +2219,7 @@ QStringList QOCIDriver::tables(QSql::TableType type) const
while (t.next()) {
if (t.value(0).toString().toUpper() != user.toUpper())
- tl.append(t.value(0).toString() + QLatin1String(".") + t.value(1).toString());
+ tl.append(t.value(0).toString() + QLatin1Char('.') + t.value(1).toString());
else
tl.append(t.value(1).toString());
}
@@ -2225,7 +2235,7 @@ QStringList QOCIDriver::tables(QSql::TableType type) const
"and owner != 'WMSYS'"));
while (t.next()) {
if (t.value(0).toString().toUpper() != d->user.toUpper())
- tl.append(t.value(0).toString() + QLatin1String(".") + t.value(1).toString());
+ tl.append(t.value(0).toString() + QLatin1Char('.') + t.value(1).toString());
else
tl.append(t.value(1).toString());
}
@@ -2287,7 +2297,7 @@ QSqlRecord QOCIDriver::record(const QString& tablename) const
else
owner = owner.toUpper();
- tmpStmt += QLatin1String(" and owner='") + owner + QLatin1String("'");
+ tmpStmt += QLatin1String(" and owner='") + owner + QLatin1Char('\'');
t.setForwardOnly(true);
t.exec(tmpStmt);
if (!t.next()) { // try and see if the tablename is a synonym
@@ -2342,7 +2352,7 @@ QSqlIndex QOCIDriver::primaryIndex(const QString& tablename) const
else
table = table.toUpper();
- tmpStmt = stmt + QLatin1String(" and a.table_name='") + table + QLatin1String("'");
+ tmpStmt = stmt + QLatin1String(" and a.table_name='") + table + QLatin1Char('\'');
if (owner.isEmpty()) {
owner = d->user;
}
@@ -2352,7 +2362,7 @@ QSqlIndex QOCIDriver::primaryIndex(const QString& tablename) const
else
owner = owner.toUpper();
- tmpStmt += QLatin1String(" and a.owner='") + owner + QLatin1String("'");
+ tmpStmt += QLatin1String(" and a.owner='") + owner + QLatin1Char('\'');
t.setForwardOnly(true);
t.exec(tmpStmt);
@@ -2376,7 +2386,7 @@ QSqlIndex QOCIDriver::primaryIndex(const QString& tablename) const
tt.exec(QLatin1String("select data_type from all_tab_columns where table_name='") +
t.value(2).toString() + QLatin1String("' and column_name='") +
t.value(0).toString() + QLatin1String("' and owner='") +
- owner +QLatin1String("'"));
+ owner + QLatin1Char('\''));
if (!tt.next()) {
return QSqlIndex();
}
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index ee500a0..8eaa8bf 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -213,14 +213,14 @@ static QString qWarnODBCHandle(int handleType, SQLHANDLE handle, int *nativeCode
static QString qODBCWarn(const QODBCPrivate* odbc, int *nativeCode = 0)
{
- return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->hEnv) + QLatin1String(" ")
- + qWarnODBCHandle(SQL_HANDLE_DBC, odbc->hDbc) + QLatin1String(" ")
+ return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->hEnv) + QLatin1Char(' ')
+ + qWarnODBCHandle(SQL_HANDLE_DBC, odbc->hDbc) + QLatin1Char(' ')
+ qWarnODBCHandle(SQL_HANDLE_STMT, odbc->hStmt, nativeCode));
}
static QString qODBCWarn(const QODBCDriverPrivate* odbc, int *nativeCode = 0)
{
- return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->hEnv) + QLatin1String(" ")
+ return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->hEnv) + QLatin1Char(' ')
+ qWarnODBCHandle(SQL_HANDLE_DBC, odbc->hDbc, nativeCode));
}
@@ -2414,12 +2414,12 @@ QString QODBCDriver::escapeIdentifier(const QString &identifier, IdentifierType)
{
QString res = identifier;
if (d->isMySqlServer) {
- if(!identifier.isEmpty() && identifier.left(1) != QString(QLatin1Char('`')) && identifier.right(1) != QString(QLatin1Char('`')) ) {
+ if(!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('`')) && !identifier.endsWith(QLatin1Char('`')) ) {
res.prepend(QLatin1Char('`')).append(QLatin1Char('`'));
res.replace(QLatin1Char('.'), QLatin1String("`.`"));
}
} else {
- if(!identifier.isEmpty() && identifier.left(1) != QString(QLatin1Char('"')) && identifier.right(1) != QString(QLatin1Char('"')) ) {
+ if(!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('"')) && !identifier.endsWith(QLatin1Char('"')) ) {
res.replace(QLatin1Char('"'), QLatin1String("\"\""));
res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
res.replace(QLatin1Char('.'), QLatin1String("\".\""));
@@ -2430,13 +2430,10 @@ QString QODBCDriver::escapeIdentifier(const QString &identifier, IdentifierType)
bool QODBCDriver::isIdentifierEscapedImplementation(const QString &identifier, IdentifierType) const
{
- QString quote = d->quoteChar();
- bool isLeftDelimited = identifier.left(1) == quote;
- bool isRightDelimited = identifier.right(1) == quote;
- if( identifier.size() > 2 && isLeftDelimited && isRightDelimited )
- return true;
- else
- return false;
+ QChar quote = d->quoteChar();
+ return identifier.size() > 2
+ && identifier.startsWith(quote) //left delimited
+ && identifier.endsWith(quote); //right delimited
}
QT_END_NAMESPACE
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp
index 16d19f1..ce0b8c5 100644
--- a/src/sql/drivers/psql/qsql_psql.cpp
+++ b/src/sql/drivers/psql/qsql_psql.cpp
@@ -541,7 +541,7 @@ bool QPSQLResult::prepare(const QString &query)
qDeallocatePreparedStmt(d);
const QString stmtId = qMakePreparedStmtId();
- const QString stmt = QString(QLatin1String("PREPARE %1 AS ")).arg(stmtId).append(qReplacePlaceholderMarkers(query));
+ const QString stmt = QString::fromLatin1("PREPARE %1 AS ").arg(stmtId).append(qReplacePlaceholderMarkers(query));
PGresult *result = PQexec(d->driver->connection,
d->driver->isUtf8 ? stmt.toUtf8().constData()
@@ -570,9 +570,9 @@ bool QPSQLResult::exec()
QString stmt;
const QString params = qCreateParamString(boundValues(), d->q->driver());
if (params.isEmpty())
- stmt = QString(QLatin1String("EXECUTE %1")).arg(d->preparedStmtId);
+ stmt = QString::fromLatin1("EXECUTE %1").arg(d->preparedStmtId);
else
- stmt = QString(QLatin1String("EXECUTE %1 (%2)")).arg(d->preparedStmtId).arg(params);
+ stmt = QString::fromLatin1("EXECUTE %1 (%2)").arg(d->preparedStmtId).arg(params);
d->result = PQexec(d->driver->connection,
d->driver->isUtf8 ? stmt.toUtf8().constData()
@@ -1102,12 +1102,12 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const
QTime tm = field.value().toDateTime().time();
// msecs need to be right aligned otherwise psql
// interpretes them wrong
- r = QLatin1String("'") + QString::number(dt.year()) + QLatin1String("-")
- + QString::number(dt.month()) + QLatin1String("-")
- + QString::number(dt.day()) + QLatin1String(" ")
- + tm.toString() + QLatin1String(".")
+ r = QLatin1Char('\'') + QString::number(dt.year()) + QLatin1Char('-')
+ + QString::number(dt.month()) + QLatin1Char('-')
+ + QString::number(dt.day()) + QLatin1Char(' ')
+ + tm.toString() + QLatin1Char('.')
+ QString::number(tm.msec()).rightJustified(3, QLatin1Char('0'))
- + QLatin1String("'");
+ + QLatin1Char('\'');
} else {
r = QLatin1String("NULL");
}
@@ -1162,7 +1162,7 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const
QString QPSQLDriver::escapeIdentifier(const QString &identifier, IdentifierType) const
{
QString res = identifier;
- if(!identifier.isEmpty() && identifier.left(1) != QString(QLatin1Char('"')) && identifier.right(1) != QString(QLatin1Char('"')) ) {
+ if(!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('"')) && !identifier.endsWith(QLatin1Char('"')) ) {
res.replace(QLatin1Char('"'), QLatin1String("\"\""));
res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
res.replace(QLatin1Char('.'), QLatin1String("\".\""));
@@ -1195,7 +1195,7 @@ bool QPSQLDriver::subscribeToNotificationImplementation(const QString &name)
int socket = PQsocket(d->connection);
if (socket) {
- QString query = QString(QLatin1String("LISTEN %1")).arg(escapeIdentifier(name, QSqlDriver::TableName));
+ QString query = QLatin1String("LISTEN ") + escapeIdentifier(name, QSqlDriver::TableName);
if (PQresultStatus(PQexec(d->connection,
d->isUtf8 ? query.toUtf8().constData()
: query.toLocal8Bit().constData())
@@ -1227,7 +1227,7 @@ bool QPSQLDriver::unsubscribeFromNotificationImplementation(const QString &name)
return false;
}
- QString query = QString(QLatin1String("UNLISTEN %1")).arg(escapeIdentifier(name, QSqlDriver::TableName));
+ QString query = QLatin1String("UNLISTEN ") + escapeIdentifier(name, QSqlDriver::TableName);
if (PQresultStatus(PQexec(d->connection,
d->isUtf8 ? query.toUtf8().constData()
: query.toLocal8Bit().constData())
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index f732077..05d63ca 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.cpp
+++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp
@@ -631,9 +631,9 @@ static QSqlIndex qGetTableInfo(QSqlQuery &q, const QString &tableName, bool only
{
QString schema;
QString table(tableName);
- int indexOfSeparator = tableName.indexOf(QLatin1String("."));
+ int indexOfSeparator = tableName.indexOf(QLatin1Char('.'));
if (indexOfSeparator > -1) {
- schema = tableName.left(indexOfSeparator).append(QLatin1String("."));
+ schema = tableName.left(indexOfSeparator).append(QLatin1Char('.'));
table = tableName.mid(indexOfSeparator + 1);
}
q.exec(QLatin1String("PRAGMA ") + schema + QLatin1String("table_info ('") + table + QLatin1String("')"));
diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp
index d0c6e18..cb72ff0 100644
--- a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp
+++ b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp
@@ -170,8 +170,8 @@ void QSQLite2ResultPrivate::init(const char **cnames, int numCols)
//remove quotations around the field name if any
QString fieldStr = QString::fromAscii(fieldName);
- QString quote = QString::fromLatin1("\"");
- if ( fieldStr.length() > 2 && fieldStr.left(1) == quote && fieldStr.right(1) == quote) {
+ QLatin1Char quote('\"');
+ if ( fieldStr.length() > 2 && fieldStr.startsWith(quote) && fieldStr.endsWith(quote)) {
fieldStr = fieldStr.mid(1);
fieldStr.chop(1);
}
@@ -561,7 +561,7 @@ QVariant QSQLite2Driver::handle() const
QString QSQLite2Driver::escapeIdentifier(const QString &identifier, IdentifierType /*type*/) const
{
QString res = identifier;
- if(!identifier.isEmpty() && identifier.left(1) != QString(QLatin1Char('"')) && identifier.right(1) != QString(QLatin1Char('"')) ) {
+ if(!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('"')) && !identifier.endsWith(QLatin1Char('"')) ) {
res.replace(QLatin1Char('"'), QLatin1String("\"\""));
res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
res.replace(QLatin1Char('.'), QLatin1String("\".\""));
diff --git a/src/sql/drivers/tds/qsql_tds.cpp b/src/sql/drivers/tds/qsql_tds.cpp
index 515f0de..298b008 100644
--- a/src/sql/drivers/tds/qsql_tds.cpp
+++ b/src/sql/drivers/tds/qsql_tds.cpp
@@ -181,7 +181,7 @@ static int CS_PUBLIC qTdsMsgHandler (DBPROCESS* dbproc,
}
if (severity > 0) {
- QString errMsg = QString(QLatin1String("%1 (%2)")).arg(QString::fromAscii(msgtext)).arg(
+ QString errMsg = QString::fromLatin1("%1 (%2)").arg(QString::fromAscii(msgtext)).arg(
msgstate);
p->addErrorMsg(errMsg);
}
@@ -211,8 +211,8 @@ static int CS_PUBLIC qTdsErrHandler(DBPROCESS* dbproc,
}
- QString errMsg = QString(QLatin1String("%1 %2\n")).arg(QString::fromAscii(dberrstr)).arg(
- QString::fromAscii(oserrstr));
+ QString errMsg = QString::fromLatin1("%1 %2\n").arg(QLatin1String(dberrstr)).arg(
+ QLatin1String(oserrstr));
errMsg += p->getErrorMsgs();
p->lastError = qMakeError(errMsg, QSqlError::UnknownError, dberr);
p->clearErrorMsgs();
diff --git a/src/sql/kernel/qsqldriver.cpp b/src/sql/kernel/qsqldriver.cpp
index 40bc0df..477d531 100644
--- a/src/sql/kernel/qsqldriver.cpp
+++ b/src/sql/kernel/qsqldriver.cpp
@@ -520,7 +520,7 @@ QString QSqlDriver::sqlStatement(StatementType type, const QString &tableName,
continue;
s.append(prepareIdentifier(rec.fieldName(i), QSqlDriver::FieldName, this)).append(QLatin1String(", "));
if (preparedStatement)
- vals.append(QLatin1String("?"));
+ vals.append(QLatin1Char('?'));
else
vals.append(formatValue(rec.field(i)));
vals.append(QLatin1String(", "));
@@ -530,7 +530,7 @@ QString QSqlDriver::sqlStatement(StatementType type, const QString &tableName,
} else {
vals.chop(2); // remove trailing comma
s[s.length() - 2] = QLatin1Char(')');
- s.append(QLatin1String("VALUES (")).append(vals).append(QLatin1String(")"));
+ s.append(QLatin1String("VALUES (")).append(vals).append(QLatin1Char(')'));
}
break; }
}
@@ -625,10 +625,7 @@ QString QSqlDriver::formatValue(const QSqlField &field, bool trimStrings) const
break;
}
case QVariant::Bool:
- if (field.value().toBool())
- r = QLatin1String("1");
- else
- r = QLatin1String("0");
+ r = QString::number(field.value().toBool());
break;
case QVariant::ByteArray : {
if (hasFeature(BLOB)) {
@@ -884,12 +881,9 @@ QStringList QSqlDriver::subscribedToNotificationsImplementation() const
bool QSqlDriver::isIdentifierEscapedImplementation(const QString &identifier, IdentifierType type) const
{
Q_UNUSED(type);
- bool isLeftDelimited = identifier.left(1) == QString(QLatin1Char('"'));
- bool isRightDelimited = identifier.right(1) == QString(QLatin1Char('"'));
- if( identifier.size() > 2 && isLeftDelimited && isRightDelimited )
- return true;
- else
- return false;
+ return identifier.size() > 2
+ && identifier.startsWith(QLatin1Char('"')) //left delimited
+ && identifier.endsWith(QLatin1Char('"')); //right delimited
}
/*!
diff --git a/src/sql/kernel/qsqlerror.cpp b/src/sql/kernel/qsqlerror.cpp
index 14fc050..b1fa6e2 100644
--- a/src/sql/kernel/qsqlerror.cpp
+++ b/src/sql/kernel/qsqlerror.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
QDebug operator<<(QDebug dbg, const QSqlError &s)
{
dbg.nospace() << "QSqlError(" << s.number() << ", " << s.driverText() <<
- ", " << s.databaseText() << ")";
+ ", " << s.databaseText() << ')';
return dbg.space();
}
#endif
diff --git a/src/sql/kernel/qsqlfield.cpp b/src/sql/kernel/qsqlfield.cpp
index 8a808b6..46a5135 100644
--- a/src/sql/kernel/qsqlfield.cpp
+++ b/src/sql/kernel/qsqlfield.cpp
@@ -514,8 +514,8 @@ QDebug operator<<(QDebug dbg, const QSqlField &f)
if (f.typeID() >= 0)
dbg.nospace() << ", typeID: " << f.typeID();
if (!f.defaultValue().isNull())
- dbg.nospace() << ", auto-value: \"" << f.defaultValue() << "\"";
- dbg.nospace() << ")";
+ dbg.nospace() << ", auto-value: \"" << f.defaultValue() << '\"';
+ dbg.nospace() << ')';
return dbg.space();
#else
qWarning("This compiler doesn't support streaming QSqlField to QDebug");
diff --git a/src/sql/kernel/qsqlrecord.cpp b/src/sql/kernel/qsqlrecord.cpp
index 0162664..95f6020 100644
--- a/src/sql/kernel/qsqlrecord.cpp
+++ b/src/sql/kernel/qsqlrecord.cpp
@@ -589,7 +589,7 @@ void QSqlRecord::detach()
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QSqlRecord &r)
{
- dbg << "QSqlRecord(" << r.count() << ")";
+ dbg << "QSqlRecord(" << r.count() << ')';
for (int i = 0; i < r.count(); ++i)
dbg << '\n' << QString::fromLatin1("%1:").arg(i, 2) << r.field(i) << r.value(i).toString();
return dbg;
diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp
index 12eae84..1b8fb4c 100644
--- a/src/sql/models/qsqlrelationaltablemodel.cpp
+++ b/src/sql/models/qsqlrelationaltablemodel.cpp
@@ -573,7 +573,7 @@ QString QSqlRelationalTableModel::selectStatement() const
}
// this needs fixing!! the below if is borken.
- tables.append(relation.tableName().append(QLatin1String(" ")).append(relTableAlias));
+ tables.append(relation.tableName().append(QLatin1Char(' ')).append(relTableAlias));
if(!where.isEmpty())
where.append(QLatin1String(" AND "));
where.append(d->relationField(tableName(), d->db.driver()->escapeIdentifier(rec.fieldName(i), QSqlDriver::FieldName)));
diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp
index 2b5fbd5..d51636f 100644
--- a/src/svg/qsvggenerator.cpp
+++ b/src/svg/qsvggenerator.cpp
@@ -261,7 +261,7 @@ public:
constantAlpha &= (stops.at(i).second.alpha() == alpha);
if (!constantAlpha) {
- const qreal spacing = 0.02;
+ const qreal spacing = qreal(0.02);
QGradientStops newStops;
QRgb fromColor = PREMUL(stops.at(0).second.rgba());
QRgb toColor;
@@ -362,7 +362,7 @@ public:
translate_dashPattern(spen.dashPattern(), penWidth, &dashPattern);
// SVG uses absolute offset
- dashOffset = QString::fromLatin1("%1").arg(spen.dashOffset() * penWidth);
+ dashOffset = QString::number(spen.dashOffset() * penWidth);
d_func()->attributes.stroke = color;
d_func()->attributes.strokeOpacity = colorOpacity;
@@ -403,8 +403,8 @@ public:
}
switch (spen.joinStyle()) {
case Qt::MiterJoin:
- stream() << "stroke-linejoin=\"miter\" ";
- stream() << "stroke-miterlimit=\""<<spen.miterLimit()<<"\" ";
+ stream() << "stroke-linejoin=\"miter\" "
+ "stroke-miterlimit=\""<<spen.miterLimit()<<"\" ";
break;
case Qt::BevelJoin:
stream() << "stroke-linejoin=\"bevel\" ";
@@ -413,8 +413,8 @@ public:
stream() << "stroke-linejoin=\"round\" ";
break;
case Qt::SvgMiterJoin:
- stream() << "stroke-linejoin=\"miter\" ";
- stream() << "stroke-miterlimit=\""<<spen.miterLimit()<<"\" ";
+ stream() << "stroke-linejoin=\"miter\" "
+ "stroke-miterlimit=\""<<spen.miterLimit()<<"\" ";
break;
default:
qWarning("Unhandled join style");
@@ -427,8 +427,8 @@ public:
case Qt::SolidPattern: {
QString color, colorOpacity;
translate_color(sbrush.color(), &color, &colorOpacity);
- stream() << "fill=\"" << color << "\" ";
- stream() << "fill-opacity=\""
+ stream() << "fill=\"" << color << "\" "
+ "fill-opacity=\""
<< colorOpacity << "\" ";
d_func()->attributes.fill = color;
d_func()->attributes.fillOpacity = colorOpacity;
@@ -493,9 +493,9 @@ public:
d->attributes.font_style = d->font.italic() ? QLatin1String("italic") : QLatin1String("normal");
*d->stream << "font-family=\"" << d->attributes.font_family << "\" "
- << "font-size=\"" << d->attributes.font_size << "\" "
- << "font-weight=\"" << d->attributes.font_weight << "\" "
- << "font-style=\"" << d->attributes.font_style << "\" "
+ "font-size=\"" << d->attributes.font_size << "\" "
+ "font-weight=\"" << d->attributes.font_weight << "\" "
+ "font-style=\"" << d->attributes.font_style << "\" "
<< endl;
}
};
@@ -849,13 +849,13 @@ bool QSvgPaintEngine::begin(QPaintDevice *)
}
if (d->viewBox.isValid()) {
- *d->stream << " viewBox=\"" << d->viewBox.left() << " " << d->viewBox.top();
- *d->stream << " " << d->viewBox.width() << " " << d->viewBox.height() << "\"" << endl;
+ *d->stream << " viewBox=\"" << d->viewBox.left() << ' ' << d->viewBox.top();
+ *d->stream << ' ' << d->viewBox.width() << ' ' << d->viewBox.height() << '\"' << endl;
}
*d->stream << " xmlns=\"http://www.w3.org/2000/svg\""
- << " xmlns:xlink=\"http://www.w3.org/1999/xlink\" "
- << " version=\"1.2\" baseProfile=\"tiny\">" << endl;
+ " xmlns:xlink=\"http://www.w3.org/1999/xlink\" "
+ " version=\"1.2\" baseProfile=\"tiny\">" << endl;
if (!d->attributes.document_title.isEmpty()) {
*d->stream << "<title>" << d->attributes.document_title << "</title>" << endl;
@@ -918,10 +918,10 @@ void QSvgPaintEngine::drawImage(const QRectF &r, const QImage &image,
Q_UNUSED(sr);
Q_UNUSED(flags);
stream() << "<image ";
- stream() << "x=\""<<r.x()<<"\" ";
- stream() << "y=\""<<r.y()<<"\" ";
- stream() << "width=\""<<r.width()<<"\" ";
- stream() << "height=\""<<r.height()<<"\" ";
+ stream() << "x=\""<<r.x()<<"\" "
+ "y=\""<<r.y()<<"\" "
+ "width=\""<<r.width()<<"\" "
+ "height=\""<<r.height()<<"\" ";
QByteArray data;
QBuffer buffer(&data);
@@ -930,8 +930,7 @@ void QSvgPaintEngine::drawImage(const QRectF &r, const QImage &image,
buffer.close();
stream() << "xlink:href=\"data:image/png;base64,"
<< data.toBase64()
- <<"\" ";
- stream() << "/>\n";
+ <<"\" />\n";
}
void QSvgPaintEngine::updateState(const QPaintEngineState &state)
@@ -958,10 +957,10 @@ void QSvgPaintEngine::updateState(const QPaintEngineState &state)
if (flags & QPaintEngine::DirtyTransform) {
d->matrix = state.matrix();
- *d->stream << "transform=\"matrix(" << d->matrix.m11() << ","
- << d->matrix.m12() << ","
- << d->matrix.m21() << "," << d->matrix.m22() << ","
- << d->matrix.dx() << "," << d->matrix.dy()
+ *d->stream << "transform=\"matrix(" << d->matrix.m11() << ','
+ << d->matrix.m12() << ','
+ << d->matrix.m21() << ',' << d->matrix.m22() << ','
+ << d->matrix.dx() << ',' << d->matrix.dy()
<< ")\""
<< endl;
}
@@ -975,7 +974,7 @@ void QSvgPaintEngine::updateState(const QPaintEngineState &state)
stream() << "opacity=\""<<state.opacity()<<"\" ";
}
- *d->stream << ">" << endl;
+ *d->stream << '>' << endl;
d->afterFirstUpdate = true;
}
@@ -984,10 +983,8 @@ void QSvgPaintEngine::drawPath(const QPainterPath &p)
{
Q_D(QSvgPaintEngine);
- *d->stream << "<path ";
-
-
- *d->stream << "fill-rule=";
+ *d->stream << "<path "
+ "fill-rule=";
if (p.fillRule() == Qt::OddEvenFill)
*d->stream << "\"evenodd\" ";
else
@@ -999,13 +996,13 @@ void QSvgPaintEngine::drawPath(const QPainterPath &p)
const QPainterPath::Element &e = p.elementAt(i);
switch (e.type) {
case QPainterPath::MoveToElement:
- *d->stream << "M" << e.x << "," << e.y;
+ *d->stream << 'M' << e.x << ',' << e.y;
break;
case QPainterPath::LineToElement:
- *d->stream << "L" << e.x << "," << e.y;
+ *d->stream << 'L' << e.x << ',' << e.y;
break;
case QPainterPath::CurveToElement:
- *d->stream << "C" << e.x << "," << e.y;
+ *d->stream << 'C' << e.x << ',' << e.y;
++i;
while (i < p.elementCount()) {
const QPainterPath::Element &e = p.elementAt(i);
@@ -1013,8 +1010,8 @@ void QSvgPaintEngine::drawPath(const QPainterPath &p)
--i;
break;
} else
- *d->stream << " ";
- *d->stream << e.x << "," << e.y;
+ *d->stream << ' ';
+ *d->stream << e.x << ',' << e.y;
++i;
}
break;
@@ -1022,7 +1019,7 @@ void QSvgPaintEngine::drawPath(const QPainterPath &p)
break;
}
if (i != p.elementCount() - 1) {
- *d->stream << " ";
+ *d->stream << ' ';
}
}
@@ -1044,7 +1041,7 @@ void QSvgPaintEngine::drawPolygon(const QPointF *points, int pointCount,
stream() << "<polyline fill=\"none\" points=\"";
for (int i = 0; i < pointCount; ++i) {
const QPointF &pt = points[i];
- stream() << pt.x() << "," << pt.y() << " ";
+ stream() << pt.x() << ',' << pt.y() << ' ';
}
stream() << "\" />" <<endl;
} else {
@@ -1063,10 +1060,10 @@ void QSvgPaintEngine::drawTextItem(const QPointF &pt, const QTextItem &textItem)
QString s = QString::fromRawData(ti.chars, ti.num_chars);
*d->stream << "<text "
- << "fill=\"" << d->attributes.stroke << "\" "
- << "fill-opacity=\"" << d->attributes.strokeOpacity << "\" "
- << "stroke=\"none\" "
- << "x=\"" << pt.x() << "\" y=\"" << pt.y() << "\" ";
+ "fill=\"" << d->attributes.stroke << "\" "
+ "fill-opacity=\"" << d->attributes.strokeOpacity << "\" "
+ "stroke=\"none\" "
+ "x=\"" << pt.x() << "\" y=\"" << pt.y() << "\" ";
qfontToSvg(textItem.font());
*d->stream << " >"
<< Qt::escape(s)
diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h
index 8bb6e84..b6340f8 100644
--- a/src/testlib/qbenchmark_p.h
+++ b/src/testlib/qbenchmark_p.h
@@ -81,7 +81,7 @@ struct QBenchmarkContext
QString toString() const
{
- QString s = QString(QLatin1String("%1,%2,%3")).arg(slotName).arg(tag).arg(checkpointIndex);
+ QString s = QString::fromLatin1("%1,%2,%3").arg(slotName).arg(tag).arg(checkpointIndex);
return s;
}
diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp
index bcce147..c61460d 100644
--- a/src/testlib/qbenchmarkvalgrind.cpp
+++ b/src/testlib/qbenchmarkvalgrind.cpp
@@ -133,12 +133,12 @@ QString QBenchmarkValgrindUtils::getNewestFileName()
QString base = QBenchmarkGlobalData::current->callgrindOutFileBase;
Q_ASSERT(!base.isEmpty());
- nameFilters << QString(QLatin1String("%1.*")).arg(base);
+ nameFilters << QString::fromLatin1("%1.*").arg(base);
QFileInfoList fiList = QDir().entryInfoList(nameFilters, QDir::Files | QDir::Readable);
Q_ASSERT(!fiList.empty());
int hiSuffix = -1;
QFileInfo lastFileInfo;
- const QString pattern = QString(QLatin1String("%1.(\\d+)")).arg(base);
+ const QString pattern = QString::fromLatin1("%1.(\\d+)").arg(base);
const QRegExp rx(pattern);
foreach (QFileInfo fileInfo, fiList) {
const int index = rx.indexIn(fileInfo.fileName());
@@ -168,8 +168,8 @@ void QBenchmarkValgrindUtils::cleanup()
QString base = QBenchmarkGlobalData::current->callgrindOutFileBase;
Q_ASSERT(!base.isEmpty());
nameFilters
- << QString(QLatin1String("%1")).arg(base) // overall summary
- << QString(QLatin1String("%1.*")).arg(base); // individual dumps
+ << base // overall summary
+ << QString::fromLatin1("%1.*").arg(base); // individual dumps
QFileInfoList fiList = QDir().entryInfoList(nameFilters, QDir::Files | QDir::Readable);
foreach (QFileInfo fileInfo, fiList) {
const bool removeOk = QFile::remove(fileInfo.fileName());
@@ -180,7 +180,7 @@ void QBenchmarkValgrindUtils::cleanup()
QString QBenchmarkValgrindUtils::outFileBase(qint64 pid)
{
- return QString(QLatin1String("callgrind.out.%1")).arg(
+ return QString::fromLatin1("callgrind.out.%1").arg(
pid != -1 ? pid : QCoreApplication::applicationPid());
}
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index 6f10d72..8ffdca2 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -216,9 +216,9 @@ namespace QTest {
template <typename T> QString formatResult(T number, int significantDigits)
{
if (number < T(0))
- return QString(QLatin1String("NAN"));
+ return QLatin1String("NAN");
if (number == T(0))
- return QString(QLatin1String("0"));
+ return QLatin1String("0");
QString beforeDecimalPoint = QString::number(qint64(number), 'f', 0);
QString afterDecimalPoint = QString::number(number, 'f', 20);
diff --git a/src/testlib/qsignaldumper.cpp b/src/testlib/qsignaldumper.cpp
index 0a32a6d..3a9d75e 100644
--- a/src/testlib/qsignaldumper.cpp
+++ b/src/testlib/qsignaldumper.cpp
@@ -87,7 +87,7 @@ static void qSignalDumperCallback(QObject *caller, int method_index, void **argv
str.fill(' ', QTest::iLevel++ * QTest::IndentSpacesCount);
str += "Signal: ";
str += mo->className();
- str += "(";
+ str += '(';
QString objname = caller->objectName();
str += objname.toLocal8Bit();
@@ -114,15 +114,15 @@ static void qSignalDumperCallback(QObject *caller, int method_index, void **argv
str.append(QByteArray::number(addr, 16));
} else if (typeId != QMetaType::Void) {
str.append(arg)
- .append("(")
+ .append('(')
.append(QVariant(typeId, argv[i + 1]).toString().toLocal8Bit())
- .append(")");
+ .append(')');
}
str.append(", ");
}
if (str.endsWith(", "))
str.chop(2);
- str.append(")");
+ str.append(')');
qPrintMessage(str);
}
@@ -143,7 +143,7 @@ static void qSignalDumperCallbackSlot(QObject *caller, int method_index, void **
str.fill(' ', QTest::iLevel * QTest::IndentSpacesCount);
str += "Slot: ";
str += mo->className();
- str += "(";
+ str += '(';
QString objname = caller->objectName();
str += objname.toLocal8Bit();
diff --git a/src/tools/idc/main.cpp b/src/tools/idc/main.cpp
index eb04114..8d2f0cc 100644
--- a/src/tools/idc/main.cpp
+++ b/src/tools/idc/main.cpp
@@ -50,8 +50,8 @@ QT_BEGIN_NAMESPACE
static QString quotePath(const QString &s)
{
- if (!s.startsWith(QLatin1String("\"")) && s.contains(QLatin1Char(' ')))
- return QLatin1String("\"") + s + QLatin1String("\"");
+ if (!s.startsWith(QLatin1Char('\"')) && s.contains(QLatin1Char(' ')))
+ return QLatin1Char('\"') + s + QLatin1Char('\"');
return s;
}
@@ -282,7 +282,7 @@ int runIdc(int argc, char **argv)
fprintf(stderr, "Server unregistered successfully!\n");
return 0;
} else if (p[0] == QLatin1Char('/') || p[0] == QLatin1Char('-')) {
- error = QLatin1String("Unknown option \"") + p + QLatin1String("\"");
+ error = QLatin1String("Unknown option \"") + p + QLatin1Char('\"');
break;
} else {
input = QLatin1String(argv[i]);
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index dbad4dc..b6bd1ad 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -1171,8 +1171,8 @@ void Generator::_generateFunctions(QList<FunctionDef> &list, int type)
for (int j = 0; j < f.arguments.count(); ++j) {
const ArgumentDef &a = f.arguments.at(j);
if (j) {
- sig += ",";
- arguments += ",";
+ sig += ',';
+ arguments += ',';
}
sig += a.normalizedType;
arguments += a.name;
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 74ca1ad..72ed7af 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -755,14 +755,14 @@ void Moc::generate(FILE *out)
if (!noInclude) {
- if (includePath.size() && includePath.right(1) != "/")
- includePath += "/";
+ if (includePath.size() && !includePath.endsWith('/'))
+ includePath += '/';
for (int i = 0; i < includeFiles.size(); ++i) {
QByteArray inc = includeFiles.at(i);
if (inc[0] != '<' && inc[0] != '"') {
if (includePath.size() && includePath != "./")
inc.prepend(includePath);
- inc = "\"" + inc + "\"";
+ inc = '\"' + inc + '\"';
}
fprintf(out, "#include %s\n", inc.constData());
}
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index 45cbbfd..3260ca2 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -807,7 +807,7 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed)
continue;
QByteArray frameworkCandidate = include.left(slashPos);
frameworkCandidate.append(".framework/Headers/");
- fi.setFile(QString::fromLocal8Bit(p.path + "/" + frameworkCandidate), QString::fromLocal8Bit(include.mid(slashPos + 1)));
+ fi.setFile(QString::fromLocal8Bit(p.path + '/' + frameworkCandidate), QString::fromLocal8Bit(include.mid(slashPos + 1)));
} else {
fi.setFile(QString::fromLocal8Bit(p.path), QString::fromLocal8Bit(include));
}
diff --git a/src/tools/uic/cpp/cppwriteicondata.cpp b/src/tools/uic/cpp/cppwriteicondata.cpp
index 53b108f..08d552d 100644
--- a/src/tools/uic/cpp/cppwriteicondata.cpp
+++ b/src/tools/uic/cpp/cppwriteicondata.cpp
@@ -161,9 +161,9 @@ void WriteIconData::writeImage(QTextStream &output, const QString &indent, DomIm
for (a = 0; a < (int) (data.length()/2)-1; a++) {
output << "0x" << QString(data[2*a]) << QString(data[2*a+1]) << ',';
if (a % 12 == 11)
- output << "\n" << indent;
+ output << '\n' << indent;
else
- output << " ";
+ output << ' ';
}
output << "0x" << QString(data[2*a]) << QString(data[2*a+1]) << '\n';
output << "};\n\n";
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index 47566ad..5a2f487 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -2813,7 +2813,7 @@ QString WriteInitialization::Item::writeSetupUi(const QString &parent, Item::Emp
bool generateMultiDirective = false;
if (emptyItemPolicy == Item::ConstructItemOnly && m_children.size() == 0) {
if (m_setupUiData.policy == ItemData::DontGenerate) {
- m_setupUiStream << m_indent << "new " << m_itemClassName << "(" << parent << ");\n";
+ m_setupUiStream << m_indent << "new " << m_itemClassName << '(' << parent << ");\n";
return QString();
} else if (m_setupUiData.policy == ItemData::GenerateWithMultiDirective) {
generateMultiDirective = true;
@@ -2824,11 +2824,11 @@ QString WriteInitialization::Item::writeSetupUi(const QString &parent, Item::Emp
generateMultiDirectiveBegin(m_setupUiStream, m_setupUiData.directives);
const QString uniqueName = m_driver->unique(QLatin1String("__") + m_itemClassName.toLower());
- m_setupUiStream << m_indent << m_itemClassName << " *" << uniqueName << " = new " << m_itemClassName << "(" << parent << ");\n";
+ m_setupUiStream << m_indent << m_itemClassName << " *" << uniqueName << " = new " << m_itemClassName << '(' << parent << ");\n";
if (generateMultiDirective) {
m_setupUiStream << "#else\n";
- m_setupUiStream << m_indent << "new " << m_itemClassName << "(" << parent << ");\n";
+ m_setupUiStream << m_indent << "new " << m_itemClassName << '(' << parent << ");\n";
generateMultiDirectiveEnd(m_setupUiStream, m_setupUiData.directives);
}
diff --git a/src/tools/uic3/embed.cpp b/src/tools/uic3/embed.cpp
index 882328a..b406c1f 100644
--- a/src/tools/uic3/embed.cpp
+++ b/src/tools/uic3/embed.cpp
@@ -238,7 +238,7 @@ void Ui3Reader::embed(const char *project, const QStringList &images)
out << "true, ";
else
out << "false, ";
- out << "\"" << e->name << "\" },\n";
+ out << '\"' << e->name << "\" },\n";
delete e;
}
#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION
diff --git a/src/tools/uic3/form.cpp b/src/tools/uic3/form.cpp
index d9e968b..b484210 100644
--- a/src/tools/uic3/form.cpp
+++ b/src/tools/uic3/form.cpp
@@ -185,14 +185,14 @@ void Ui3Reader::createFormDecl(const QDomElement &e, bool implicitIncludes)
for (it = globalIncludes.constBegin(); it != globalIncludes.constEnd(); ++it) {
if (!(*it).isEmpty()) {
QString header = fixHeaderName(*it);
- out << "#include <" << header << ">" << endl;
+ out << "#include <" << header << '>' << endl;
}
}
localIncludes = unique(localIncludes);
for (it = localIncludes.constBegin(); it != localIncludes.constEnd(); ++it) {
if (!(*it).isEmpty()) {
QString header = fixHeaderName(*it);
- out << "#include \"" << header << "\"" << endl;
+ out << "#include \"" << header << '\"' << endl;
}
}
out << endl;
@@ -216,7 +216,7 @@ void Ui3Reader::createFormDecl(const QDomElement &e, bool implicitIncludes)
typeDefs = unique(typeDefs);
for (it = typeDefs.constBegin(); it != typeDefs.constEnd(); ++it) {
if (!(*it).isEmpty())
- out << "typedef " << *it << ";" << endl;
+ out << "typedef " << *it << ';' << endl;
}
nl = e.parentNode().toElement().elementsByTagName(QLatin1String("forward"));
@@ -236,17 +236,17 @@ void Ui3Reader::createFormDecl(const QDomElement &e, bool implicitIncludes)
out << "namespace " << *ns << " {" << endl;
++ns;
}
- out << "class " << forwardName << ";" << endl;
+ out << "class " << forwardName << ';' << endl;
for (int i = 0; i < (int) forwardNamespaces.count(); i++)
- out << "}" << endl;
+ out << '}' << endl;
}
}
for (it = forwardDecl2.constBegin(); it != forwardDecl2.constEnd(); ++it) {
QString fd = *it;
fd = fd.trimmed();
- if (!fd.endsWith(QLatin1String(";")))
- fd += QLatin1String(";");
+ if (!fd.endsWith(QLatin1Char(';')))
+ fd += QLatin1Char(';');
out << fd << endl;
}
@@ -279,7 +279,7 @@ void Ui3Reader::createWrapperDecl(const QDomElement &e, const QString &converted
out << "#ifndef " << protector << endl;
out << "#define " << protector << endl;
out << endl;
- out << "#include \"" << convertedUiFile << "\"" << endl;
+ out << "#include \"" << convertedUiFile << '\"' << endl;
createWrapperDeclContents(e);
out << endl;
@@ -309,8 +309,8 @@ void Ui3Reader::createWrapperDeclContents(const QDomElement &e)
out << "class ";
if (!exportMacro.isEmpty())
- out << exportMacro << " ";
- out << bareNameOfClass << " : public " << objClass << ", public Ui::" << bareNameOfClass << endl << "{" << endl;
+ out << exportMacro << ' ';
+ out << bareNameOfClass << " : public " << objClass << ", public Ui::" << bareNameOfClass << endl << '{' << endl;
/* qmake ignore Q_OBJECT */
out << " Q_OBJECT" << endl;
@@ -362,8 +362,8 @@ void Ui3Reader::createWrapperDeclContents(const QDomElement &e)
continue;
QString returnType = n.attribute(QLatin1String("returnType"), QLatin1String("void"));
QString functionName = n.firstChild().toText().data().trimmed();
- if (functionName.endsWith(QLatin1String(";")))
- functionName = functionName.left(functionName.length() - 1);
+ if (functionName.endsWith(QLatin1Char(';')))
+ functionName.chop(1);
QString specifier = n.attribute(QLatin1String("specifier"));
QString access = n.attribute(QLatin1String("access"));
if (access == QLatin1String(QLatin1String("protected"))) {
@@ -394,8 +394,8 @@ void Ui3Reader::createWrapperDeclContents(const QDomElement &e)
continue;
QString returnType = n.attribute(QLatin1String("returnType"), QLatin1String("void"));
QString functionName = n.firstChild().toText().data().trimmed();
- if (functionName.endsWith(QLatin1String(";")))
- functionName = functionName.left(functionName.length() - 1);
+ if (functionName.endsWith(QLatin1Char(';')))
+ functionName.chop(1);
QString specifier = n.attribute(QLatin1String("specifier"));
QString access = n.attribute(QLatin1String("access"));
if (access == QLatin1String("protected")) {
@@ -423,8 +423,8 @@ void Ui3Reader::createWrapperDeclContents(const QDomElement &e)
// continue;
QString access = n.attribute(QLatin1String("access"), QLatin1String("protected"));
QString var = fixDeclaration(n.firstChild().toText().data().trimmed());
- if (!var.endsWith(QLatin1String(";")))
- var += QLatin1String(";");
+ if (!var.endsWith(QLatin1Char(';')))
+ var += QLatin1Char(';');
if (access == QLatin1String("public"))
publicVars += var;
else if (access == QLatin1String("private"))
@@ -458,7 +458,7 @@ void Ui3Reader::createWrapperDeclContents(const QDomElement &e)
if (n.attribute(QLatin1String("language"), QLatin1String("C++")) != QLatin1String("C++"))
continue;
QString sigName = n.firstChild().toText().data().trimmed();
- if (sigName.endsWith(QLatin1String(";")))
+ if (sigName.endsWith(QLatin1Char(';')))
sigName = sigName.left(sigName.length() - 1);
extraSignals += fixDeclaration(sigName);
}
@@ -467,7 +467,7 @@ void Ui3Reader::createWrapperDeclContents(const QDomElement &e)
if (!extraSignals.isEmpty()) {
out << "signals:" << endl;
for (it = extraSignals.constBegin(); it != extraSignals.constEnd(); ++it)
- out << " void " << (*it) << ";" << endl;
+ out << " void " << (*it) << ';' << endl;
out << endl;
}
@@ -513,7 +513,7 @@ void Ui3Reader::createWrapperDeclContents(const QDomElement &e)
out << "};" << endl;
for (i = 0; i < (int) namespaces.count(); i++)
- out << "}" << endl;
+ out << '}' << endl;
out << endl;
}
@@ -543,7 +543,7 @@ void Ui3Reader::writeFunctionsDecl(const QStringList &fuLst, const QStringList &
signature = fixDeclaration(signature);
type = fixType(type);
- out << " " << specifier << type << " " << signature << pure << ";" << endl;
+ out << " " << specifier << type << ' ' << signature << pure << ';' << endl;
}
out << endl;
}
@@ -583,8 +583,8 @@ void Ui3Reader::createFormImpl(const QDomElement &e)
if (n.attribute(QLatin1String("language"), QLatin1String("C++")) != QLatin1String("C++"))
continue;
QString functionName = n.firstChild().toText().data().trimmed();
- if (functionName.endsWith(QLatin1String(";")))
- functionName = functionName.left(functionName.length() - 1);
+ if (functionName.endsWith(QLatin1Char(';')))
+ functionName.chop(1);
extraFuncts += functionName;
extraFunctTyp += n.attribute(QLatin1String("returnType"), QLatin1String("void"));
extraFunctSpecifier += n.attribute(QLatin1String("specifier"), QLatin1String("virtual"));
@@ -598,8 +598,8 @@ void Ui3Reader::createFormImpl(const QDomElement &e)
if (n.attribute(QLatin1String("language"), QLatin1String("C++")) != QLatin1String("C++"))
continue;
QString functionName = n.firstChild().toText().data().trimmed();
- if (functionName.endsWith(QLatin1String(";")))
- functionName = functionName.left(functionName.length() - 1);
+ if (functionName.endsWith(QLatin1Char(';')))
+ functionName.chop(1);
extraFuncts += functionName;
extraFunctTyp += n.attribute(QLatin1String("returnType"), QLatin1String("void"));
extraFunctSpecifier += n.attribute(QLatin1String("specifier"), QLatin1String("virtual"));
@@ -663,7 +663,7 @@ void Ui3Reader::createFormImpl(const QDomElement &e)
globalIncludes = unique(globalIncludes);
for (it = globalIncludes.begin(); it != globalIncludes.end(); ++it) {
if (!(*it).isEmpty())
- out << "#include <" << fixHeaderName(*it) << ">" << endl;
+ out << "#include <" << fixHeaderName(*it) << '>' << endl;
}
if (externPixmaps) {
@@ -677,14 +677,14 @@ void Ui3Reader::createFormImpl(const QDomElement &e)
localIncludes = unique(localIncludes);
for (it = localIncludes.begin(); it != localIncludes.end(); ++it) {
if (!(*it).isEmpty() && *it != QFileInfo(fileName + QLatin1String(".h")).fileName())
- out << "#include \"" << fixHeaderName(*it) << "\"" << endl;
+ out << "#include \"" << fixHeaderName(*it) << '\"' << endl;
}
QString uiDotH = fileName + QLatin1String(".h");
if (QFile::exists(uiDotH)) {
if (!outputFileName.isEmpty())
uiDotH = QString::fromUtf8(combinePath(uiDotH.ascii(), outputFileName.ascii()));
- out << "#include \"" << uiDotH << "\"" << endl;
+ out << "#include \"" << uiDotH << '\"' << endl;
writeFunctImpl = false;
}
@@ -702,7 +702,7 @@ void Ui3Reader::createFormImpl(const QDomElement &e)
out << " * name 'name' and widget flags set to 'f'." << endl;
out << " *" << endl;
out << " * The " << objClass.mid(1).toLower() << " will by default be modeless, unless you set 'modal' to" << endl;
- out << " * true to construct a modal " << objClass.mid(1).toLower() << "." << endl;
+ out << " * true to construct a modal " << objClass.mid(1).toLower() << '.' << endl;
out << " */" << endl;
out << nameOfClass << "::" << bareNameOfClass << "(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)" << endl;
out << " : " << objClass << "(parent, name, modal, fl)";
@@ -733,7 +733,7 @@ void Ui3Reader::createFormImpl(const QDomElement &e)
out << endl;
- out << "{" << endl;
+ out << '{' << endl;
//
// setup the gui
@@ -775,7 +775,7 @@ void Ui3Reader::createFormImpl(const QDomElement &e)
out << indent << "init();" << endl;
// end of constructor
- out << "}" << endl;
+ out << '}' << endl;
out << endl;
// destructor
@@ -783,11 +783,11 @@ void Ui3Reader::createFormImpl(const QDomElement &e)
out << " * Destroys the object and frees any allocated resources" << endl;
out << " */" << endl;
out << nameOfClass << "::~" << bareNameOfClass << "()" << endl;
- out << "{" << endl;
+ out << '{' << endl;
if (extraFuncts.contains(QLatin1String("destroy()")))
out << indent << "destroy();" << endl;
out << indent << "// no need to delete child widgets, Qt does it all for us" << endl;
- out << "}" << endl;
+ out << '}' << endl;
out << endl;
// handle application events if required
@@ -816,9 +816,9 @@ void Ui3Reader::createFormImpl(const QDomElement &e)
out << " * language." << endl;
out << " */" << endl;
out << "void " << nameOfClass << "::languageChange()" << endl;
- out << "{" << endl;
+ out << '{' << endl;
out << " retranslateUi(this);" << endl;
- out << "}" << endl;
+ out << '}' << endl;
out << endl;
// create stubs for additional slots if necessary
@@ -833,8 +833,8 @@ void Ui3Reader::createFormImpl(const QDomElement &e)
type = type.simplified();
QString fname = fixDeclaration(Parser::cleanArgs(*it));
if (!(*it3).startsWith(QLatin1String("pure"))) { // "pure virtual" or "pureVirtual"
- out << type << " " << nameOfClass << "::" << fname << endl;
- out << "{" << endl;
+ out << type << ' ' << nameOfClass << "::" << fname << endl;
+ out << '{' << endl;
if (*it != QLatin1String("init()") && *it != QLatin1String("destroy()")) {
QRegExp numeric(QLatin1String("^(?:signed|unsigned|u?char|u?short|u?int"
"|u?long|Q_U?INT(?:8|16|32)|Q_U?LONG|float"
@@ -868,14 +868,14 @@ void Ui3Reader::createFormImpl(const QDomElement &e)
if (type == QLatin1String("bool")) {
retVal = QLatin1String("false");
- } else if (isBasicNumericType || type.endsWith(QLatin1String("*"))) {
+ } else if (isBasicNumericType || type.endsWith(QLatin1Char('*'))) {
retVal = QLatin1String("0");
- } else if (type.endsWith(QLatin1String("&"))) {
+ } else if (type.endsWith(QLatin1Char('&'))) {
do {
type.chop(1);
- } while (type.endsWith(QLatin1String(" ")));
+ } while (type.endsWith(QLatin1Char(' ')));
retVal = QLatin1String("uic_temp_var");
- out << indent << "static " << type << " " << retVal << ";" << endl;
+ out << indent << "static " << type << ' ' << retVal << ';' << endl;
} else {
retVal = type + QLatin1String("()");
}
@@ -883,9 +883,9 @@ void Ui3Reader::createFormImpl(const QDomElement &e)
out << indent << "qWarning(\"" << nameOfClass << "::" << fname << ": Not implemented yet\");" << endl;
if (!retVal.isEmpty())
- out << indent << "return " << retVal << ";" << endl;
+ out << indent << "return " << retVal << ';' << endl;
}
- out << "}" << endl;
+ out << '}' << endl;
out << endl;
}
++it;
diff --git a/src/tools/uic3/main.cpp b/src/tools/uic3/main.cpp
index d581016..9535b91 100644
--- a/src/tools/uic3/main.cpp
+++ b/src/tools/uic3/main.cpp
@@ -367,7 +367,7 @@ int runUic3(int argc, char * argv[])
}
if (headerFile) {
- out << "#include \"" << headerFile << "\"" << endl << endl;
+ out << "#include \"" << headerFile << '\"' << endl << endl;
}
QString convertedUi;
diff --git a/src/tools/uic3/parser.cpp b/src/tools/uic3/parser.cpp
index 744dd30..395cc4d 100644
--- a/src/tools/uic3/parser.cpp
+++ b/src/tools/uic3/parser.cpp
@@ -48,14 +48,14 @@ QT_BEGIN_NAMESPACE
QString Parser::cleanArgs(const QString &func)
{
QString slot(func);
- int begin = slot.indexOf(QLatin1String("(")) + 1;
+ int begin = slot.indexOf(QLatin1Char('(')) + 1;
QString args = slot.mid(begin);
- args = args.left(args.indexOf(QLatin1String(")")));
+ args = args.left(args.indexOf(QLatin1Char(')')));
QStringList lst = args.split(QLatin1Char(','));
QString res = slot.left(begin);
for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it) {
if (it != lst.begin())
- res += QLatin1String(",");
+ res += QLatin1Char(',');
QString arg = *it;
int pos = 0;
if ((pos = arg.indexOf(QLatin1Char('&'))) != -1) {
@@ -65,7 +65,7 @@ QString Parser::cleanArgs(const QString &func)
} else {
arg = arg.simplified();
if ((pos = arg.indexOf(QLatin1Char(':'))) != -1)
- arg = arg.left(pos).simplified() + QLatin1String(":") + arg.mid(pos + 1).simplified();
+ arg = arg.left(pos).simplified() + QLatin1Char(':') + arg.mid(pos + 1).simplified();
QStringList l = arg.split(QLatin1Char(' '));
if (l.count() == 2) {
if (l[0] != QLatin1String("const")
@@ -73,12 +73,12 @@ QString Parser::cleanArgs(const QString &func)
&& l[0] != QLatin1String("var"))
arg = l[0];
} else if (l.count() == 3) {
- arg = l[0] + QLatin1String(" ") + l[1];
+ arg = l[0] + QLatin1Char(' ') + l[1];
}
}
res += arg;
}
- res += QLatin1String(")");
+ res += QLatin1Char(')');
return res;
}
diff --git a/src/tools/uic3/qt3to4.cpp b/src/tools/uic3/qt3to4.cpp
index 9e5b64b..2862727 100644
--- a/src/tools/uic3/qt3to4.cpp
+++ b/src/tools/uic3/qt3to4.cpp
@@ -149,7 +149,7 @@ void Porting::readXML(RuleList *renamedHeaders, RuleList *renamedClasses, RuleLi
QString fileName = QLatin1String("q3porting.xml");
QString filePath;
//check QLibraryInfo::DataPath/filename
- filePath = QDir::cleanPath(QLibraryInfo::location(QLibraryInfo::DataPath) + QLatin1String("/") + fileName) ;
+ filePath = QDir::cleanPath(QLibraryInfo::location(QLibraryInfo::DataPath) + QLatin1Char('/') + fileName) ;
//check QLibraryInfo::PrefixPath/tools/porting/src/filename
if (!QFile::exists(filePath))
diff --git a/src/tools/uic3/subclassing.cpp b/src/tools/uic3/subclassing.cpp
index e590ab7..85c2218 100644
--- a/src/tools/uic3/subclassing.cpp
+++ b/src/tools/uic3/subclassing.cpp
@@ -69,7 +69,7 @@ void Ui3Reader::createSubDecl( const QDomElement &e, const QString& subClass )
return;
out << "class " << subClass << " : public " << nameOfClass << endl;
- out << "{" << endl;
+ out << '{' << endl;
/* tmake ignore Q_OBJECT */
out << " Q_OBJECT" << endl;
@@ -105,8 +105,8 @@ void Ui3Reader::createSubDecl( const QDomElement &e, const QString& subClass )
continue;
QString returnType = n.attribute(QLatin1String("returnType"), QLatin1String("void"));
QString functionName = n.firstChild().toText().data().trimmed();
- if ( functionName.endsWith(QLatin1String(";")))
- functionName = functionName.left( functionName.length() - 1 );
+ if ( functionName.endsWith(QLatin1Char(';')))
+ functionName.chop(1);
QString specifier = n.attribute(QLatin1String("specifier"));
QString access = n.attribute(QLatin1String("access"));
if ( access == QLatin1String("protected") ) {
@@ -133,8 +133,8 @@ void Ui3Reader::createSubDecl( const QDomElement &e, const QString& subClass )
continue;
QString returnType = n.attribute(QLatin1String("returnType"), QLatin1String("void"));
QString functionName = n.firstChild().toText().data().trimmed();
- if ( functionName.endsWith(QLatin1String(";")) )
- functionName = functionName.left( functionName.length() - 1 );
+ if ( functionName.endsWith(QLatin1Char(';')) )
+ functionName.chop(1);
QString specifier = n.attribute(QLatin1String("specifier"));
QString access = n.attribute(QLatin1String("access"));
if ( access == QLatin1String("protected") ) {
@@ -195,7 +195,7 @@ void Ui3Reader::writeFunctionsSubDecl( const QStringList &fuLst, const QStringLi
type = QLatin1String("void");
if ( *it3 == QLatin1String("non virtual") )
continue;
- out << " " << type << " " << fixDeclaration(*it) << ";" << endl;
+ out << " " << type << ' ' << fixDeclaration(*it) << ';' << endl;
}
out << endl;
}
@@ -223,7 +223,7 @@ void Ui3Reader::createSubImpl( const QDomElement &e, const QString& subClass )
out << " * name 'name' and widget flags set to 'f' " << endl;
out << " *" << endl;
out << " * The " << objClass.mid(1).toLower() << " will by default be modeless, unless you set 'modal' to" << endl;
- out << " * true to construct a modal " << objClass.mid(1).toLower() << "." << endl;
+ out << " * true to construct a modal " << objClass.mid(1).toLower() << '.' << endl;
out << " */" << endl;
out << subClass << "::" << subClass << "( QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl )" << endl;
out << " : " << nameOfClass << "( parent, name, modal, fl )" << endl;
@@ -235,8 +235,8 @@ void Ui3Reader::createSubImpl( const QDomElement &e, const QString& subClass )
out << subClass << "::" << subClass << "( QWidget* parent, const char* name, Qt::WindowFlags fl )" << endl;
out << " : " << nameOfClass << "( parent, name, fl )" << endl;
}
- out << "{" << endl;
- out << "}" << endl;
+ out << '{' << endl;
+ out << '}' << endl;
out << endl;
// destructor
@@ -244,9 +244,9 @@ void Ui3Reader::createSubImpl( const QDomElement &e, const QString& subClass )
out << " * Destroys the object and frees any allocated resources" << endl;
out << " */" << endl;
out << subClass << "::~" << subClass << "()" << endl;
- out << "{" << endl;
+ out << '{' << endl;
out << " // no need to delete child widgets, Qt does it all for us" << endl;
- out << "}" << endl;
+ out << '}' << endl;
out << endl;
@@ -268,8 +268,8 @@ void Ui3Reader::createSubImpl( const QDomElement &e, const QString& subClass )
continue;
QString returnType = n.attribute(QLatin1String("returnType"), QLatin1String("void"));
QString functionName = n.firstChild().toText().data().trimmed();
- if ( functionName.endsWith(QLatin1String(";")) )
- functionName = functionName.left( functionName.length() - 1 );
+ if ( functionName.endsWith(QLatin1Char(';')) )
+ functionName.chop(1);
QString specifier = n.attribute(QLatin1String("specifier"));
QString access = n.attribute(QLatin1String("access"));
if ( access == QLatin1String("protected") ) {
@@ -296,8 +296,8 @@ void Ui3Reader::createSubImpl( const QDomElement &e, const QString& subClass )
continue;
QString returnType = n.attribute(QLatin1String("returnType"), QLatin1String("void"));
QString functionName = n.firstChild().toText().data().trimmed();
- if ( functionName.endsWith(QLatin1String(";")) )
- functionName = functionName.left( functionName.length() - 1 );
+ if ( functionName.endsWith(QLatin1Char(';')) )
+ functionName.chop(1);
QString specifier = n.attribute(QLatin1String("specifier"));
QString access = n.attribute(QLatin1String("access"));
if ( access == QLatin1String("protected") ) {
@@ -351,10 +351,10 @@ void Ui3Reader::writeFunctionsSubImpl( const QStringList &fuLst, const QStringLi
out << "/*" << endl;
out << " * " << descr << endl;
out << " */" << endl;
- out << type << " " << subClass << "::" << fixDeclaration(*it) << endl;
- out << "{" << endl;
+ out << type << ' ' << subClass << "::" << fixDeclaration(*it) << endl;
+ out << '{' << endl;
out << " qWarning( \"" << subClass << "::" << fixDeclaration(*it) << " not yet implemented!\" );" << endl;
- out << "}" << endl << endl;
+ out << '}' << endl << endl;
}
out << endl;
}
diff --git a/src/tools/uic3/ui3reader.cpp b/src/tools/uic3/ui3reader.cpp
index 1ba4b2f..539565c 100644
--- a/src/tools/uic3/ui3reader.cpp
+++ b/src/tools/uic3/ui3reader.cpp
@@ -125,10 +125,10 @@ QString Ui3Reader::fixString(const QString &str, bool encode)
QString s;
if (!encode) {
s = str;
- s.replace(QLatin1String("\\"), QLatin1String("\\\\"));
- s.replace(QLatin1String("\""), QLatin1String("\\\""));
- s.replace(QLatin1String("\r"), QLatin1String(""));
- s.replace(QLatin1String("\n"), QLatin1String("\\n\"\n\""));
+ s.replace(QLatin1Char('\\'), QLatin1String("\\\\"));
+ s.replace(QLatin1Char('\"'), QLatin1String("\\\""));
+ s.remove(QLatin1Char('\r'));
+ s.replace(QLatin1Char('\n'), QLatin1String("\\n\"\n\""));
} else {
QByteArray utf8 = str.utf8();
const int l = utf8.length();
@@ -136,7 +136,7 @@ QString Ui3Reader::fixString(const QString &str, bool encode)
s += QLatin1String("\\x") + QString::number((uchar)utf8[i], 16);
}
- return QLatin1String("\"") + s + QLatin1String("\"");
+ return QLatin1Char('\"') + s + QLatin1Char('\"');
}
QString Ui3Reader::trcall(const QString& sourceText, const QString& comment)
@@ -158,12 +158,12 @@ QString Ui3Reader::trcall(const QString& sourceText, const QString& comment)
}
if (comment.isEmpty()) {
- return t + QLatin1String("(") + fixString(sourceText, encode) + QLatin1String(")");
+ return t + QLatin1Char('(') + fixString(sourceText, encode) + QLatin1Char(')');
} else {
- return t + QLatin1String("(")
+ return t + QLatin1Char('(')
+ fixString(sourceText, encode)
+ QLatin1String(", ")
- + fixString(comment, encode) + QLatin1String(")");
+ + fixString(comment, encode) + QLatin1Char(')');
}
}
@@ -480,10 +480,10 @@ void Ui3Reader::createColorGroupImpl(const QString& name, const QDomElement& e)
QString pixmap = n.firstChild().toText().data();
if (!pixmapLoaderFunction.isEmpty()) {
pixmap.prepend(pixmapLoaderFunction
- + QLatin1String("(")
+ + QLatin1Char('(')
+ QLatin1String(externPixmaps ? "\"" : ""));
- pixmap.append(QLatin1String(externPixmaps ? "\"" : "") + QLatin1String(")"));
+ pixmap.append(QLatin1String(externPixmaps ? "\"" : "") + QLatin1Char(')'));
}
out << indent << name << ".setBrush(QColorGroup::"
<< ColorRole[r] << ", QBrush(" << color << ", " << pixmap << "));" << endl;
@@ -578,9 +578,9 @@ QString Ui3Reader::registerObject(const QString& name)
if (objectNames.contains(result)) {
int i = 2;
- while (objectNames.contains(result + QLatin1String("_") + QString::number(i)))
+ while (objectNames.contains(result + QLatin1Char('_') + QString::number(i)))
i++;
- result += QLatin1String("_");
+ result += QLatin1Char('_');
result += QString::number(i);
}
objectNames += result;
diff --git a/src/winmain/qtmain_win.cpp b/src/winmain/qtmain_win.cpp
index a3bc0e0..e5b3259 100644
--- a/src/winmain/qtmain_win.cpp
+++ b/src/winmain/qtmain_win.cpp
@@ -100,7 +100,7 @@ int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR /*cmdPara
#if defined(Q_OS_WINCE)
TCHAR appName[256];
GetModuleFileName(0, appName, 255);
- cmdParam = QString(QLatin1String("\"%1\" ")).arg(QString::fromUtf16((const unsigned short *)appName)).toLocal8Bit() + cmdParam;
+ cmdParam.prepend(QString::fromLatin1("\"%1\" ").arg(QString::fromUtf16((const unsigned short *)appName)).toLocal8Bit());
#endif
int argc = 0;
@@ -110,7 +110,7 @@ int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR /*cmdPara
#if defined(Q_OS_WINCE)
TCHAR uniqueAppID[256];
GetModuleFileName(0, uniqueAppID, 255);
- QString uid = QString::fromUtf16((const unsigned short *)uniqueAppID).toLower().replace(QString(QLatin1String("\\")), QString(QLatin1String("_")));
+ QString uid = QString::fromUtf16((const unsigned short *)uniqueAppID).toLower().replace(QLatin1Char('\\'), QLatin1Char('_'));
// If there exists an other instance of this application
// it will be the owner of a mutex with the unique ID.
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 550abc9..da0e31b 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -2694,7 +2694,7 @@ void QDomNode::save(QTextStream& str, int indent) const
If the document contains invalid XML characters or characters that cannot be
encoded in the given encoding, the result and behavior is undefined.
- \since 4.2
+ \since 4.2
*/
void QDomNode::save(QTextStream& str, int indent, EncodingPolicy encodingPolicy) const
{
@@ -4589,7 +4589,7 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const
qName = prefix + QLatin1Char(':') + name;
nsDecl = QLatin1String(" xmlns:") + prefix;
}
- nsDecl += QLatin1String("=\"") + encodeText(namespaceURI, s) + QLatin1String("\"");
+ nsDecl += QLatin1String("=\"") + encodeText(namespaceURI, s) + QLatin1Char('\"');
}
s << '<' << qName << nsDecl;
@@ -4597,9 +4597,9 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const
/* Write out attributes. */
if (!m_attr->map.isEmpty()) {
- s << ' ';
QHash<QString, QDomNodePrivate *>::const_iterator it = m_attr->map.constBegin();
for (; it != m_attr->map.constEnd(); ++it) {
+ s << ' ';
if (it.value()->namespaceURI.isNull()) {
s << it.value()->name << "=\"" << encodeText(it.value()->value, s, true, true) << '\"';
} else {
@@ -4622,7 +4622,6 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const
outputtedPrefixes.insert(it.value()->prefix);
}
}
- s << ' ';
}
}
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
index ade0339..db50f01 100644
--- a/src/xml/sax/qxml.cpp
+++ b/src/xml/sax/qxml.cpp
@@ -5464,7 +5464,7 @@ bool QXmlSimpleReaderPrivate::parsePEReference()
if (skipIt) {
if (contentHnd) {
- if (!contentHnd->skippedEntity(QString::fromLatin1("%") + ref())) {
+ if (!contentHnd->skippedEntity(QLatin1Char('%') + ref())) {
reportParseError(contentHnd->errorString());
return false;
}
@@ -5476,7 +5476,7 @@ bool QXmlSimpleReaderPrivate::parsePEReference()
return false;
} else if (parsePEReference_context == InDTD) {
// Included as PE
- if (!insertXmlRef(QString::fromLatin1(" ")+xmlRefString+QString::fromLatin1(" "), ref(), false))
+ if (!insertXmlRef(QLatin1Char(' ') + xmlRefString + QLatin1Char(' '), ref(), false))
return false;
}
}
@@ -6728,7 +6728,7 @@ bool QXmlSimpleReaderPrivate::parseEntityDecl()
if ( !entityExist(name())) {
parameterEntities.insert(name(), string());
if (declHnd) {
- if (!declHnd->internalEntityDecl(QString::fromLatin1("%")+name(), string())) {
+ if (!declHnd->internalEntityDecl(QLatin1Char('%') + name(), string())) {
reportParseError(declHnd->errorString());
return false;
}
@@ -6740,7 +6740,7 @@ bool QXmlSimpleReaderPrivate::parseEntityDecl()
if ( !entityExist(name())) {
externParameterEntities.insert(name(), QXmlSimpleReaderPrivate::ExternParameterEntity(publicId, systemId));
if (declHnd) {
- if (!declHnd->externalEntityDecl(QString::fromLatin1("%")+name(), publicId, systemId)) {
+ if (!declHnd->externalEntityDecl(QLatin1Char('%') + name(), publicId, systemId)) {
reportParseError(declHnd->errorString());
return false;
}
@@ -7864,8 +7864,8 @@ bool QXmlSimpleReaderPrivate::insertXmlRef(const QString &data, const QString &n
{
if (inLiteral) {
QString tmp = data;
- xmlRefStack.push(XmlRef(name, tmp.replace(QLatin1String("\""),
- QLatin1String("&quot;")).replace(QLatin1String("'"), QLatin1String("&apos;"))));
+ xmlRefStack.push(XmlRef(name, tmp.replace(QLatin1Char('\"'),
+ QLatin1String("&quot;")).replace(QLatin1Char('\''), QLatin1String("&apos;"))));
} else {
xmlRefStack.push(XmlRef(name, data));
}
diff --git a/src/xmlpatterns/acceltree/qacceltree.cpp b/src/xmlpatterns/acceltree/qacceltree.cpp
index 60e6e27..6bc1794 100644
--- a/src/xmlpatterns/acceltree/qacceltree.cpp
+++ b/src/xmlpatterns/acceltree/qacceltree.cpp
@@ -71,7 +71,7 @@ void AccelTree::printStats(const NamePool::Ptr &np) const
for(int i = 0; i < len; ++i)
{
const BasicNodeData &v = basicData.at(i);
- pDebug() << "|" << i
+ pDebug() << '|' << i
<< "\t\t|" << v.depth()
<< "\t|" << v.size()
<< "\t|" << postNumber(i)
@@ -81,12 +81,12 @@ void AccelTree::printStats(const NamePool::Ptr &np) const
: data.value(i))
<< "\t|";
/*
- pDebug() << "|" << QString().arg(i, 14)
- << "|" << QString().arg(v.depth(), 6)
- << "|" << QString().arg(v.size(), 6)
- << "|" << QString().arg(postNumber(i), 14)
- << "|" << QString().arg(v.kind(), 6)
- << "|";
+ pDebug() << '|' << QString().arg(i, 14)
+ << '|' << QString().arg(v.depth(), 6)
+ << '|' << QString().arg(v.size(), 6)
+ << '|' << QString().arg(postNumber(i), 14)
+ << '|' << QString().arg(v.kind(), 6)
+ << '|';
*/
}
pDebug() << "+---------------+-------+-------+---------------+-------+--------------+";
diff --git a/src/xmlpatterns/api/qsourcelocation.cpp b/src/xmlpatterns/api/qsourcelocation.cpp
index 4eee39c..1dd8ffd 100644
--- a/src/xmlpatterns/api/qsourcelocation.cpp
+++ b/src/xmlpatterns/api/qsourcelocation.cpp
@@ -206,7 +206,7 @@ QDebug operator<<(QDebug debug, const QSourceLocation &sourceLocation)
<< sourceLocation.line()
<< ", column:"
<< sourceLocation.column()
- << ")";
+ << ')';
return debug;
}
#endif
diff --git a/src/xmlpatterns/data/qabstractfloat.cpp b/src/xmlpatterns/data/qabstractfloat.cpp
index b6226b5..a45b0fd 100644
--- a/src/xmlpatterns/data/qabstractfloat.cpp
+++ b/src/xmlpatterns/data/qabstractfloat.cpp
@@ -186,7 +186,7 @@ QString AbstractFloat<isDouble>::stringValue() const
if(sign)
valueAsString += QLatin1Char('-');
- valueAsString += qret.left(1);
+ valueAsString += qret.at(0);
valueAsString += QLatin1Char('.');
if(1 == qret.size())
diff --git a/src/xmlpatterns/data/qcommonvalues.cpp b/src/xmlpatterns/data/qcommonvalues.cpp
index 07a273d..99a8086 100644
--- a/src/xmlpatterns/data/qcommonvalues.cpp
+++ b/src/xmlpatterns/data/qcommonvalues.cpp
@@ -57,7 +57,7 @@ using namespace QPatternist;
// STATIC DATA
const AtomicString::Ptr CommonValues::EmptyString
- (new AtomicString(QString(QLatin1String(""))));
+ (new AtomicString(QLatin1String("")));
const AtomicString::Ptr CommonValues::TrueString
(new AtomicString(QLatin1String("true")));
const AtomicString::Ptr CommonValues::FalseString
diff --git a/src/xmlpatterns/expr/qexpression_p.h b/src/xmlpatterns/expr/qexpression_p.h
index 5eb63de..65918e6 100644
--- a/src/xmlpatterns/expr/qexpression_p.h
+++ b/src/xmlpatterns/expr/qexpression_p.h
@@ -884,7 +884,7 @@ namespace QPatternist
{
pDebug() << "AST REWRITE:" << old.data() << "to" << New.data()
<< '(' << old->actualReflection() << "to" << New->actualReflection() << ", "
- << old->description() << "to" << New->description() << ")";
+ << old->description() << "to" << New->description() << ')';
/* The order of these two lines is significant.. */
context->addLocation(New.data(), context->locationFor(old->actualReflection()));
diff --git a/tests/auto/_networkselftest/_networkselftest.pro b/tests/auto/_networkselftest/_networkselftest.pro
new file mode 100644
index 0000000..9e2ad0e
--- /dev/null
+++ b/tests/auto/_networkselftest/_networkselftest.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+
+SOURCES += tst_networkselftest.cpp
+QT = core network
+DEFINES += SRCDIR=\\\"$$PWD\\\"
+
diff --git a/tests/auto/_networkselftest/tst_networkselftest.cpp b/tests/auto/_networkselftest/tst_networkselftest.cpp
new file mode 100644
index 0000000..dab4433
--- /dev/null
+++ b/tests/auto/_networkselftest/tst_networkselftest.cpp
@@ -0,0 +1,592 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtNetwork/QtNetwork>
+#include "../network-settings.h"
+
+class tst_NetworkSelfTest: public QObject
+{
+ Q_OBJECT
+private slots:
+ void hostTest();
+ void dnsResolution_data();
+ void dnsResolution();
+ void serverReachability();
+ void remotePortsOpen_data();
+ void remotePortsOpen();
+
+ // specific protocol tests
+ void ftpServer();
+ void imapServer();
+ void httpServer();
+ void httpsServer();
+ void httpProxy();
+ void httpProxyBasicAuth();
+ void httpProxyNtlmAuth();
+ void socks5Proxy();
+ void socks5ProxyAuth();
+};
+
+class Chat
+{
+public:
+ enum Type {
+ Reconnect,
+ Send,
+ Expect,
+ SkipBytes,
+ DiscardUntil,
+ DiscardUntilDisconnect,
+ Disconnect,
+ RemoteDisconnect,
+ StartEncryption
+ };
+ Chat(Type t, const QByteArray &d)
+ : data(d), type(t)
+ {
+ }
+ Chat(Type t, int val = 0)
+ : value(val), type(t)
+ {
+ }
+
+ static inline Chat send(const QByteArray &data)
+ { return Chat(Send, data); }
+ static inline Chat expect(const QByteArray &data)
+ { return Chat(Expect, data); }
+ static inline Chat discardUntil(const QByteArray &data)
+ { return Chat(DiscardUntil, data); }
+ static inline Chat skipBytes(int count)
+ { return Chat(SkipBytes, count); }
+
+ QByteArray data;
+ int value;
+ Type type;
+};
+
+static QString prettyByteArray(const QByteArray &array)
+{
+ // any control chars?
+ QString result;
+ result.reserve(array.length() + array.length() / 3);
+ for (int i = 0; i < array.length(); ++i) {
+ char c = array.at(i);
+ switch (c) {
+ case '\n':
+ result += "\\n";
+ continue;
+ case '\r':
+ result += "\\r";
+ continue;
+ case '\t':
+ result += "\\t";
+ continue;
+ case '"':
+ result += "\\\"";
+ continue;
+ default:
+ break;
+ }
+
+ if (c < 0x20 || uchar(c) >= 0x7f) {
+ result += '\\';
+ result += QString::number(uchar(c), 8);
+ } else {
+ result += c;
+ }
+ }
+ return result;
+}
+
+static bool doSocketRead(QTcpSocket *socket, int minBytesAvailable, int timeout = 2000)
+{
+ QTime timer;
+ timer.start();
+ forever {
+ if (socket->bytesAvailable() >= minBytesAvailable)
+ return true;
+ if (socket->state() == QAbstractSocket::UnconnectedState
+ || timer.elapsed() >= timeout)
+ return false;
+ if (!socket->waitForReadyRead(timeout - timer.elapsed()))
+ return false;
+ }
+}
+
+static bool doSocketFlush(QTcpSocket *socket, int timeout = 2000)
+{
+#ifndef QT_NO_OPENSSL
+ QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket);
+#endif
+ QTime timer;
+ timer.start();
+ forever {
+ if (socket->bytesToWrite() == 0
+#ifndef QT_NO_OPENSSL
+ && sslSocket->encryptedBytesToWrite() == 0
+#endif
+ )
+ return true;
+ if (socket->state() == QAbstractSocket::UnconnectedState
+ || timer.elapsed() >= timeout)
+ return false;
+ if (!socket->waitForBytesWritten(timeout - timer.elapsed()))
+ return false;
+ }
+}
+
+static void netChat(int port, const QList<Chat> &chat)
+{
+#ifndef QT_NO_OPENSSL
+ QSslSocket socket;
+#else
+ QTcpSocket socket;
+#endif
+
+ socket.connectToHost(QtNetworkSettings::serverName(), port);
+ qDebug() << 0 << "Connecting to server on port" << port;
+ QVERIFY2(socket.waitForConnected(10000),
+ QString("Failed to connect to server in step 0: %1").arg(socket.errorString()).toLocal8Bit());
+
+ // now start the chat
+ QList<Chat>::ConstIterator it = chat.constBegin();
+ for (int i = 1; it != chat.constEnd(); ++it, ++i) {
+ if (it->type != Chat::Reconnect
+ && socket.state() != QAbstractSocket::ConnectedState
+ && socket.state() != QAbstractSocket::ClosingState)
+ QFAIL(QString("Internal error: socket is in invalid state %1 in step %2")
+ .arg(socket.state()).arg(i).toLocal8Bit());
+
+ switch (it->type) {
+ case Chat::Expect: {
+ qDebug() << i << "Expecting" << prettyByteArray(it->data);
+ if (!doSocketRead(&socket, it->data.length()))
+ QFAIL(QString("Failed to receive data in step %1: timeout").arg(i).toLocal8Bit());
+
+ // pop that many bytes off the socket
+ QByteArray received = socket.read(it->data.length());
+
+ // is it what we expected?
+ QVERIFY2(received == it->data,
+ QString("Did not receive expected data in step %1: data received was:\n%2")
+ .arg(i).arg(prettyByteArray(received)).toLocal8Bit());
+
+ break;
+ }
+
+ case Chat::DiscardUntil:
+ qDebug() << i << "Discarding until" << prettyByteArray(it->data);
+ while (true) {
+ // scan the buffer until we have our string
+ if (!doSocketRead(&socket, it->data.length()))
+ QFAIL(QString("Failed to receive data in step %1: timeout").arg(i).toLocal8Bit());
+
+ QByteArray buffer;
+ buffer.resize(socket.bytesAvailable());
+ socket.peek(buffer.data(), socket.bytesAvailable());
+
+ int pos = buffer.indexOf(it->data);
+ if (pos == -1) {
+ // data not found, keep trying
+ continue;
+ }
+
+ buffer = socket.read(pos + it->data.length());
+ qDebug() << i << "Discarded" << prettyByteArray(buffer);
+ break;
+ }
+ break;
+
+ case Chat::SkipBytes: {
+ qDebug() << i << "Skipping" << it->value << "bytes";
+ if (!doSocketRead(&socket, it->value))
+ QFAIL(QString("Failed to receive data in step %1: timeout").arg(i).toLocal8Bit());
+
+ // now discard the bytes
+ QByteArray buffer = socket.read(it->value);
+ qDebug() << i << "Skipped" << prettyByteArray(buffer);
+ break;
+ }
+
+ case Chat::Send: {
+ qDebug() << i << "Sending" << prettyByteArray(it->data);
+ socket.write(it->data);
+ if (!doSocketFlush(&socket)) {
+ QVERIFY2(socket.state() == QAbstractSocket::ConnectedState,
+ QString("Socket disconnected while sending data in step %1").arg(i).toLocal8Bit());
+ QFAIL(QString("Failed to send data in step %1: timeout").arg(i).toLocal8Bit());
+ }
+ break;
+ }
+
+ case Chat::Disconnect:
+ qDebug() << i << "Disconnecting from host";
+ socket.disconnectFromHost();
+
+ // is this the last command?
+ if (it + 1 != chat.constEnd())
+ break;
+
+ // fall through:
+ case Chat::RemoteDisconnect:
+ case Chat::DiscardUntilDisconnect:
+ qDebug() << i << "Waiting for remote disconnect";
+ if (socket.state() != QAbstractSocket::UnconnectedState)
+ socket.waitForDisconnected(10000);
+ QVERIFY2(socket.state() == QAbstractSocket::UnconnectedState,
+ QString("Socket did not disconnect as expected in step %1").arg(i).toLocal8Bit());
+
+ // any data left?
+ if (it->type == Chat::DiscardUntilDisconnect) {
+ QByteArray buffer = socket.readAll();
+ qDebug() << i << "Discarded in the process:" << prettyByteArray(buffer);
+ }
+
+ if (socket.bytesAvailable() != 0)
+ QFAIL(QString("Unexpected bytes still on buffer when disconnecting in step %1:\n%2")
+ .arg(i).arg(prettyByteArray(socket.readAll())).toLocal8Bit());
+ break;
+
+ case Chat::Reconnect:
+ qDebug() << i << "Reconnecting to server on port" << port;
+ socket.connectToHost(QtNetworkSettings::serverName(), port);
+ QVERIFY2(socket.waitForConnected(10000),
+ QString("Failed to reconnect to server in step %1: %2").arg(i).arg(socket.errorString()).toLocal8Bit());
+ break;
+
+ case Chat::StartEncryption:
+#ifdef QT_NO_OPENSSL
+ QFAIL("Internal error: SSL required for this test");
+#else
+ qDebug() << i << "Starting client encryption";
+ socket.ignoreSslErrors();
+ socket.startClientEncryption();
+ QVERIFY2(socket.waitForEncrypted(5000),
+ QString("Failed to start client encryption in step %1: %2").arg(i)
+ .arg(socket.errorString()).toLocal8Bit());
+ break;
+#endif
+ }
+ }
+}
+
+void tst_NetworkSelfTest::hostTest()
+{
+ // this is a localhost self-test
+ QHostInfo localhost = QHostInfo::fromName("localhost");
+ QCOMPARE(localhost.error(), QHostInfo::NoError);
+ QVERIFY(!localhost.addresses().isEmpty());
+
+ QTcpServer server;
+ QVERIFY(server.listen());
+
+ QTcpSocket socket;
+ socket.connectToHost("127.0.0.1", server.serverPort());
+ QVERIFY(socket.waitForConnected(10000));
+}
+
+void tst_NetworkSelfTest::dnsResolution_data()
+{
+ QTest::addColumn<QString>("hostName");
+ QTest::newRow("local-name") << QtNetworkSettings::serverLocalName();
+ QTest::newRow("fqdn") << QtNetworkSettings::serverName();
+}
+
+void tst_NetworkSelfTest::dnsResolution()
+{
+ QFETCH(QString, hostName);
+ QHostInfo resolved = QHostInfo::fromName(hostName);
+ QVERIFY2(resolved.error() == QHostInfo::NoError,
+ QString("Failed to resolve hostname %1: %2").arg(hostName, resolved.errorString()).toLocal8Bit());
+}
+
+void tst_NetworkSelfTest::serverReachability()
+{
+ // check that we get a proper error connecting to port 1
+ QTcpSocket socket;
+ socket.connectToHost(QtNetworkSettings::serverName(), 1);
+ socket.waitForConnected(10000);
+ QVERIFY2(socket.state() == QAbstractSocket::UnconnectedState, "Socket connected unexpectedly!");
+ QVERIFY2(socket.error() == QAbstractSocket::ConnectionRefusedError,
+ QString("Could not reach server: %1").arg(socket.errorString()).toLocal8Bit());
+}
+
+void tst_NetworkSelfTest::remotePortsOpen_data()
+{
+ QTest::addColumn<int>("portNumber");
+ QTest::newRow("ftp") << 21;
+ QTest::newRow("ssh") << 22;
+ QTest::newRow("imap") << 143;
+ QTest::newRow("http") << 80;
+ QTest::newRow("https") << 443;
+ QTest::newRow("http-proxy") << 3128;
+ QTest::newRow("http-proxy-auth-basic") << 3129;
+ QTest::newRow("http-proxy-auth-ntlm") << 3130;
+ QTest::newRow("socks5-proxy") << 1080;
+ QTest::newRow("socks5-proxy-auth") << 1081;
+}
+
+void tst_NetworkSelfTest::remotePortsOpen()
+{
+ QFETCH(int, portNumber);
+ QTcpSocket socket;
+ socket.connectToHost(QtNetworkSettings::serverName(), portNumber);
+
+ if (!socket.waitForConnected(10000)) {
+ if (socket.error() == QAbstractSocket::SocketTimeoutError)
+ QFAIL(QString("Network timeout connecting to the server on port %1").arg(portNumber).toLocal8Bit());
+ else
+ QFAIL(QString("Error connecting to server on port %1: %2").arg(portNumber).arg(socket.errorString()).toLocal8Bit());
+ }
+ QVERIFY(socket.state() == QAbstractSocket::ConnectedState);
+}
+
+static QList<Chat> ftpChat()
+{
+ return QList<Chat>() << Chat::expect("220")
+ << Chat::discardUntil("\r\n")
+ << Chat::send("USER anonymous\r\n")
+ << Chat::expect("331")
+ << Chat::discardUntil("\r\n")
+ << Chat::send("PASS user@hostname\r\n")
+ << Chat::expect("230")
+ << Chat::discardUntil("\r\n")
+ << Chat::send("QUIT\r\n")
+ << Chat::expect("221")
+ << Chat::discardUntil("\r\n")
+ << Chat::RemoteDisconnect;
+}
+
+void tst_NetworkSelfTest::ftpServer()
+{
+ netChat(21, ftpChat());
+}
+
+void tst_NetworkSelfTest::imapServer()
+{
+ netChat(143, QList<Chat>()
+ << Chat::expect("* OK ")
+ << Chat::discardUntil("\r\n")
+ << Chat::send("1 CAPABILITY\r\n")
+ << Chat::expect("* CAPABILITY ")
+ << Chat::discardUntil("1 OK")
+ << Chat::discardUntil("\r\n")
+ << Chat::send("2 LOGOUT\r\n")
+ << Chat::discardUntil("2 OK")
+ << Chat::discardUntil("\r\n")
+ << Chat::RemoteDisconnect);
+}
+
+void tst_NetworkSelfTest::httpServer()
+{
+ netChat(80, QList<Chat>()
+ // HTTP/0.9 chat:
+ << Chat::send("GET /\r\n")
+ << Chat::DiscardUntilDisconnect
+
+ // HTTP/1.0 chat:
+ << Chat::Reconnect
+ << Chat::send("GET / HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Connection: close\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("200 ")
+ << Chat::DiscardUntilDisconnect
+
+ // HTTP/1.0 POST:
+ << Chat::Reconnect
+ << Chat::send("POST / HTTP/1.0\r\n"
+ "Content-Length: 5\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Connection: close\r\n"
+ "\r\n"
+ "Hello")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("200 ")
+ << Chat::DiscardUntilDisconnect
+ );
+}
+
+void tst_NetworkSelfTest::httpsServer()
+{
+#ifndef QT_NO_OPENSSL
+ netChat(443, QList<Chat>()
+ << Chat::StartEncryption
+ << Chat::send("GET / HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Connection: close\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("200 ")
+ << Chat::DiscardUntilDisconnect);
+#else
+ QSKIP("SSL not enabled, cannot test");
+#endif
+}
+
+void tst_NetworkSelfTest::httpProxy()
+{
+ netChat(3128, QList<Chat>()
+ // proxy GET
+ << Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Proxy-connection: close\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("200 ")
+ << Chat::DiscardUntilDisconnect
+
+ // proxy CONNECT
+ << Chat::Reconnect
+ << Chat::send("CONNECT " + QtNetworkSettings::serverName().toLatin1() + ":21 HTTP/1.0\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("200 ")
+ << Chat::discardUntil("\r\n\r\n")
+ << ftpChat());
+}
+
+void tst_NetworkSelfTest::httpProxyBasicAuth()
+{
+ netChat(3129, QList<Chat>()
+ // test auth required response
+ << Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Proxy-connection: close\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("407 ")
+ << Chat::discardUntil("\r\nProxy-Authenticate: Basic realm=\"")
+ << Chat::DiscardUntilDisconnect
+
+ // now try sending our credentials
+ << Chat::Reconnect
+ << Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Proxy-connection: close\r\n"
+ "Proxy-Authorization: Basic cXNvY2tzdGVzdDpwYXNzd29yZA==\r\n"
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("200 ")
+ << Chat::DiscardUntilDisconnect);
+}
+
+void tst_NetworkSelfTest::httpProxyNtlmAuth()
+{
+ netChat(3130, QList<Chat>()
+ // test auth required response
+ << Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n"
+ "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
+ "Proxy-connection: keep-alive\r\n" // NTLM auth will disconnect
+ "\r\n")
+ << Chat::expect("HTTP/1.")
+ << Chat::discardUntil(" ")
+ << Chat::expect("407 ")
+ << Chat::discardUntil("\r\nProxy-Authenticate: NTLM\r\n")
+ << Chat::DiscardUntilDisconnect
+ );
+}
+
+// SOCKSv5 is a binary protocol
+static const char handshakeNoAuth[] = "\5\1\0";
+static const char handshakeOkNoAuth[] = "\5\0";
+static const char handshakeAuthPassword[] = "\5\1\2\1\12qsockstest\10password";
+static const char handshakeOkPasswdAuth[] = "\5\2\1\0";
+static const char handshakeAuthNotOk[] = "\5\377";
+static const char connect1[] = "\5\1\0\1\177\0\0\1\0\25"; // Connect IPv4 127.0.0.1 port 21
+static const char connect2[] = "\5\1\0\3\11localhost\0\25"; // Connect hostname localhost 21
+static const char connected[] = "\5\0\0";
+
+void tst_NetworkSelfTest::socks5Proxy()
+{
+ netChat(1080, QList<Chat>()
+ // IP address connection
+ << Chat::send(QByteArray(handshakeNoAuth, -1 + sizeof handshakeNoAuth))
+ << Chat::expect(QByteArray(handshakeOkNoAuth, -1 + sizeof handshakeOkNoAuth))
+ << Chat::send(QByteArray(connect1, -1 + sizeof connect1))
+ << Chat::expect(QByteArray(connected, -1 + sizeof connected))
+ << Chat::expect("\1") // IPv4 address following
+ << Chat::skipBytes(6) // the server's local address and port
+ << ftpChat()
+
+ // hostname connection
+ << Chat::Reconnect
+ << Chat::send(QByteArray(handshakeNoAuth, -1 + sizeof handshakeNoAuth))
+ << Chat::expect(QByteArray(handshakeOkNoAuth, -1 + sizeof handshakeOkNoAuth))
+ << Chat::send(QByteArray(connect2, -1 + sizeof connect2))
+ << Chat::expect(QByteArray(connected, -1 + sizeof connected))
+ << Chat::expect("\1") // IPv4 address following
+ << Chat::skipBytes(6) // the server's local address and port
+ << ftpChat()
+ );
+}
+
+void tst_NetworkSelfTest::socks5ProxyAuth()
+{
+ netChat(1081, QList<Chat>()
+ // unauthenticated connect -- will get error
+ << Chat::send(QByteArray(handshakeNoAuth, -1 + sizeof handshakeNoAuth))
+ << Chat::expect(QByteArray(handshakeAuthNotOk, -1 + sizeof handshakeAuthNotOk))
+ << Chat::RemoteDisconnect
+
+ // now try to connect with authentication
+ << Chat::Reconnect
+ << Chat::send(QByteArray(handshakeAuthPassword, -1 + sizeof handshakeAuthPassword))
+ << Chat::expect(QByteArray(handshakeOkPasswdAuth, -1 + sizeof handshakeOkPasswdAuth))
+ << Chat::send(QByteArray(connect1, -1 + sizeof connect1))
+ << Chat::expect(QByteArray(connected, -1 + sizeof connected))
+ << Chat::expect("\1") // IPv4 address following
+ << Chat::skipBytes(6) // the server's local address and port
+ << ftpChat()
+ );
+}
+
+QTEST_MAIN(tst_NetworkSelfTest)
+#include "tst_networkselftest.moc"
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 331546d..c4da3ce 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -4,7 +4,8 @@ TEMPLATE = subdirs
!wince*:SUBDIRS += \
headers
-SUBDIRS += bic \
+SUBDIRS += _networkselftest \
+ bic \
dynamicobject \
collections \
compile \
@@ -296,6 +297,7 @@ SUBDIRS += bic \
qstandarditem \
qstandarditemmodel \
qstate \
+ qstatemachine \
qstatusbar \
qstl \
qstring \
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index 2fff6d0..816b2e8 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -2171,7 +2171,7 @@ void tst_QComboBox::noScrollbar_data()
QTest::newRow("everything and more") << QString::fromLatin1("QAbstractItemView { border: 1px 3px 5px 1px solid blue; "
" padding: 2px 5px 3px 1px; margin: 2px 5px 3px 1px; } "
" QAbstractItemView::item { border: 2px solid green; "
- " padding: 1px 1px 2px 2px margin: 1px; } " );
+ " padding: 1px 1px 2px 2px; margin: 1px; } " );
}
void tst_QComboBox::noScrollbar()
@@ -2179,10 +2179,11 @@ void tst_QComboBox::noScrollbar()
QStringList initialContent;
initialContent << "foo" << "bar" << "foobar" << "moo";
QFETCH(QString, stylesheet);
+ QString oldCss = qApp->styleSheet();
+ qApp->setStyleSheet(stylesheet);
{
QComboBox comboBox;
- comboBox.setStyleSheet(stylesheet);
comboBox.addItems(initialContent);
comboBox.show();
comboBox.resize(200, comboBox.height());
@@ -2196,7 +2197,6 @@ void tst_QComboBox::noScrollbar()
{
QTableWidget *table = new QTableWidget(2,2);
QComboBox comboBox;
- comboBox.setStyleSheet(stylesheet);
comboBox.setView(table);
comboBox.setModel(table->model());
comboBox.show();
@@ -2207,6 +2207,8 @@ void tst_QComboBox::noScrollbar()
QVERIFY(!comboBox.view()->horizontalScrollBar()->isVisible());
QVERIFY(!comboBox.view()->verticalScrollBar()->isVisible());
}
+
+ qApp->setStyleSheet(oldCss);
}
void tst_QComboBox::setItemDelegate()
diff --git a/tests/auto/qdate/tst_qdate.cpp b/tests/auto/qdate/tst_qdate.cpp
index d4273d0..4d6c80c 100644
--- a/tests/auto/qdate/tst_qdate.cpp
+++ b/tests/auto/qdate/tst_qdate.cpp
@@ -82,6 +82,8 @@ private slots:
void operator_gt_eq();
void fromString_data();
void fromString();
+ void fromString_format_data();
+ void fromString_format();
void toString_format_data();
void toString_format();
void isLeapYear();
@@ -618,6 +620,30 @@ void tst_QDate::fromString()
QCOMPARE( QDate::fromString( str2, Qt::ISODate ), d1 );
}
+void tst_QDate::fromString_format_data()
+{
+ QTest::addColumn<QString>("string");
+ QTest::addColumn<QString>("format");
+ QTest::addColumn<QDate>("date");
+
+ //year with yy is always 19xx for compatibility
+ QTest::newRow( "data0" ) << QString("21052006") << QString("ddMMyyyy") << QDate(2006,5,21);
+ QTest::newRow( "data1" ) << QString("210506") << QString("ddMMyy") << QDate(1906,5,21);
+ QTest::newRow( "data2" ) << QString("21/5/2006") << QString("d/M/yyyy") << QDate(2006,5,21);
+ QTest::newRow( "data3" ) << QString("21/5/06") << QString("d/M/yy") << QDate(1906,5,21);
+ QTest::newRow( "data4" ) << QString("20060521") << QString("yyyyMMdd") << QDate(2006,5,21);
+ QTest::newRow( "data5" ) << QString("060521") << QString("yyMMdd") << QDate(1906,5,21);
+}
+
+void tst_QDate::fromString_format()
+{
+ QFETCH( QString, string );
+ QFETCH( QString, format );
+ QFETCH( QDate, date );
+
+ QCOMPARE( QDate::fromString( string, format ), date );
+}
+
void tst_QDate::toString_format_data()
{
QTest::addColumn<QDate>("t");
diff --git a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp
index 8d42e5e..b25cdc7 100644
--- a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp
+++ b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp
@@ -179,196 +179,197 @@ void tst_QEasingCurve::propertyDefaults()
}
typedef QList<int> IntList;
+typedef QList<qreal> RealList;
Q_DECLARE_METATYPE(IntList)
+Q_DECLARE_METATYPE(RealList)
void tst_QEasingCurve::valueForProgress_data()
{
QTest::addColumn<int>("type");
QTest::addColumn<IntList>("at");
- QTest::addColumn<IntList>("expected");
+ QTest::addColumn<RealList>("expected");
// automatically generated.
// note that values are scaled from range [0,1] to range [0, 100] in order to store them as
// integer values and avoid fp inaccuracies
-
QTest::newRow("Linear") << int(QEasingCurve::Linear)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.1 << 0.2 << 0.3 << 0.4 << 0.5 << 0.6 << 0.7 << 0.8 << 0.9 << 1);
QTest::newRow("InQuad") << int(QEasingCurve::InQuad)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 1 << 4 << 9 << 16 << 25 << 36 << 48 << 64 << 81 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.01 << 0.04 << 0.09 << 0.16 << 0.25 << 0.36 << 0.49 << 0.64 << 0.81 << 1);
QTest::newRow("OutQuad") << int(QEasingCurve::OutQuad)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 19 << 36 << 51 << 64 << 75 << 84 << 90 << 96 << 99 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.19 << 0.36 << 0.51 << 0.64 << 0.75 << 0.84 << 0.91 << 0.96 << 0.99 << 1);
QTest::newRow("InOutQuad") << int(QEasingCurve::InOutQuad)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 2 << 8 << 18 << 32 << 50 << 68 << 82 << 92 << 98 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.02 << 0.08 << 0.18 << 0.32 << 0.5 << 0.68 << 0.82 << 0.92 << 0.98 << 1);
QTest::newRow("OutInQuad") << int(QEasingCurve::OutInQuad)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 18 << 32 << 42 << 48 << 50 << 52 << 57 << 68 << 82 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.18 << 0.32 << 0.42 << 0.48 << 0.5 << 0.52 << 0.58 << 0.68 << 0.82 << 1);
QTest::newRow("InCubic") << int(QEasingCurve::InCubic)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 0 << 0 << 2 << 6 << 12 << 21 << 34 << 51 << 72 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.001 << 0.008 << 0.027 << 0.064 << 0.125 << 0.216 << 0.343 << 0.512 << 0.729 << 1);
QTest::newRow("OutCubic") << int(QEasingCurve::OutCubic)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 27 << 48 << 65 << 78 << 87 << 93 << 97 << 99 << 99 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.271 << 0.488 << 0.657 << 0.784 << 0.875 << 0.936 << 0.973 << 0.992 << 0.999 << 1);
QTest::newRow("InOutCubic") << int(QEasingCurve::InOutCubic)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 0 << 3 << 10 << 25 << 50 << 74 << 89 << 96 << 99 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.004 << 0.032 << 0.108 << 0.256 << 0.5 << 0.744 << 0.892 << 0.968 << 0.996 << 1);
QTest::newRow("OutInCubic") << int(QEasingCurve::OutInCubic)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 24 << 39 << 46 << 49 << 50 << 50 << 53 << 60 << 75 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.244 << 0.392 << 0.468 << 0.496 << 0.5 << 0.504 << 0.532 << 0.608 << 0.756 << 1);
QTest::newRow("InQuart") << int(QEasingCurve::InQuart)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 0 << 0 << 0 << 2 << 6 << 12 << 24 << 40 << 65 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.0001 << 0.0016 << 0.0081 << 0.0256 << 0.0625 << 0.1296 << 0.2401 << 0.4096 << 0.6561 << 1);
QTest::newRow("OutQuart") << int(QEasingCurve::OutQuart)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 34 << 59 << 75 << 87 << 93 << 97 << 99 << 99 << 99 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.3439 << 0.5904 << 0.7599 << 0.8704 << 0.9375 << 0.9744 << 0.9919 << 0.9984 << 0.9999 << 1);
QTest::newRow("InOutQuart") << int(QEasingCurve::InOutQuart)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 0 << 1 << 6 << 20 << 50 << 79 << 93 << 98 << 99 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.0008 << 0.0128 << 0.0648 << 0.2048 << 0.5 << 0.7952 << 0.9352 << 0.9872 << 0.9992 << 1);
QTest::newRow("OutInQuart") << int(QEasingCurve::OutInQuart)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 29 << 43 << 48 << 49 << 50 << 50 << 51 << 56 << 70 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.2952 << 0.4352 << 0.4872 << 0.4992 << 0.5 << 0.5008 << 0.5128 << 0.5648 << 0.7048 << 1);
QTest::newRow("InQuint") << int(QEasingCurve::InQuint)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 0 << 0 << 0 << 1 << 3 << 7 << 16 << 32 << 59 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 1e-05 << 0.00032 << 0.00243 << 0.01024 << 0.03125 << 0.07776 << 0.1681 << 0.3277 << 0.5905 << 1);
QTest::newRow("OutQuint") << int(QEasingCurve::OutQuint)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 40 << 67 << 83 << 92 << 96 << 98 << 99 << 99 << 99 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.4095 << 0.6723 << 0.8319 << 0.9222 << 0.9688 << 0.9898 << 0.9976 << 0.9997 << 1 << 1);
QTest::newRow("InOutQuint") << int(QEasingCurve::InOutQuint)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 0 << 0 << 3 << 16 << 50 << 83 << 96 << 99 << 99 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.00016 << 0.00512 << 0.03888 << 0.1638 << 0.5 << 0.8362 << 0.9611 << 0.9949 << 0.9998 << 1);
QTest::newRow("OutInQuint") << int(QEasingCurve::OutInQuint)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 33 << 46 << 49 << 49 << 50 << 50 << 50 << 53 << 66 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.3362 << 0.4611 << 0.4949 << 0.4998 << 0.5 << 0.5002 << 0.5051 << 0.5389 << 0.6638 << 1);
QTest::newRow("InSine") << int(QEasingCurve::InSine)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 1 << 4 << 10 << 19 << 29 << 41 << 54 << 69 << 84 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.01231 << 0.04894 << 0.109 << 0.191 << 0.2929 << 0.4122 << 0.546 << 0.691 << 0.8436 << 1);
QTest::newRow("OutSine") << int(QEasingCurve::OutSine)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 15 << 30 << 45 << 58 << 70 << 80 << 89 << 95 << 98 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.1564 << 0.309 << 0.454 << 0.5878 << 0.7071 << 0.809 << 0.891 << 0.9511 << 0.9877 << 1);
QTest::newRow("InOutSine") << int(QEasingCurve::InOutSine)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 2 << 9 << 20 << 34 << 49 << 65 << 79 << 90 << 97 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.02447 << 0.09549 << 0.2061 << 0.3455 << 0.5 << 0.6545 << 0.7939 << 0.9045 << 0.9755 << 1);
QTest::newRow("OutInSine") << int(QEasingCurve::OutInSine)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 15 << 29 << 40 << 47 << 50 << 52 << 59 << 70 << 84 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.1545 << 0.2939 << 0.4045 << 0.4755 << 0.5 << 0.5245 << 0.5955 << 0.7061 << 0.8455 << 1);
QTest::newRow("InExpo") << int(QEasingCurve::InExpo)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 0 << 0 << 0 << 1 << 3 << 6 << 12 << 24 << 49 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.0009531 << 0.002906 << 0.006812 << 0.01462 << 0.03025 << 0.0615 << 0.124 << 0.249 << 0.499 << 1);
QTest::newRow("OutExpo") << int(QEasingCurve::OutExpo)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 50 << 75 << 87 << 93 << 96 << 98 << 99 << 99 << 99 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.5005 << 0.7507 << 0.8759 << 0.9384 << 0.9697 << 0.9854 << 0.9932 << 0.9971 << 0.999 << 1);
QTest::newRow("InOutExpo") << int(QEasingCurve::InOutExpo)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 0 << 0 << 3 << 12 << 50 << 87 << 96 << 99 << 99 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.001453 << 0.007312 << 0.03075 << 0.1245 << 0.5002 << 0.8754 << 0.9692 << 0.9927 << 0.9985 << 1);
QTest::newRow("OutInExpo") << int(QEasingCurve::OutInExpo)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 37 << 46 << 49 << 49 << 50 << 50 << 50 << 53 << 62 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.3754 << 0.4692 << 0.4927 << 0.4985 << 0.5 << 0.5015 << 0.5073 << 0.5308 << 0.6245 << 1);
QTest::newRow("InCirc") << int(QEasingCurve::InCirc)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 0 << 2 << 4 << 8 << 13 << 19 << 28 << 40 << 56 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.005013 << 0.0202 << 0.04606 << 0.08348 << 0.134 << 0.2 << 0.2859 << 0.4 << 0.5641 << 1);
QTest::newRow("OutCirc") << int(QEasingCurve::OutCirc)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 43 << 59 << 71 << 80 << 86 << 91 << 95 << 97 << 99 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.4359 << 0.6 << 0.7141 << 0.8 << 0.866 << 0.9165 << 0.9539 << 0.9798 << 0.995 << 1);
QTest::newRow("InOutCirc") << int(QEasingCurve::InOutCirc)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 1 << 4 << 9 << 20 << 50 << 80 << 89 << 95 << 98 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.0101 << 0.04174 << 0.1 << 0.2 << 0.5 << 0.8 << 0.9 << 0.9583 << 0.9899 << 1);
QTest::newRow("OutInCirc") << int(QEasingCurve::OutInCirc)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 29 << 40 << 45 << 48 << 50 << 51 << 54 << 60 << 70 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.3 << 0.4 << 0.4583 << 0.4899 << 0.5 << 0.5101 << 0.5417 << 0.6 << 0.7 << 1);
QTest::newRow("InElastic") << int(QEasingCurve::InElastic)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 0 << 0 << 0 << 1 << -1 << -3 << 12 << -12 << -25 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.001953 << -0.001953 << -0.003906 << 0.01562 << -0.01562 << -0.03125 << 0.125 << -0.125 << -0.25 << 1);
QTest::newRow("OutElastic") << int(QEasingCurve::OutElastic)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 125 << 112 << 87 << 103 << 101 << 98 << 100 << 100 << 99 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 1.25 << 1.125 << 0.875 << 1.031 << 1.016 << 0.9844 << 1.004 << 1.002 << 0.998 << 1);
QTest::newRow("InOutElastic") << int(QEasingCurve::InOutElastic)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 0 << 0 << -1 << -6 << 50 << 106 << 101 << 99 << 100 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << -0.0009766 << 0.007812 << -0.01563 << -0.0625 << 0.5 << 1.062 << 1.016 << 0.9922 << 1.001 << 1);
QTest::newRow("OutInElastic") << int(QEasingCurve::OutInElastic)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 37 << 56 << 49 << 49 << 50 << 49 << 50 << 53 << 24 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.375 << 0.5625 << 0.4922 << 0.498 << 0.5 << 0.4961 << 0.5078 << 0.5313 << 0.25 << 1);
QTest::newRow("InBack") << int(QEasingCurve::InBack)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << -1 << -4 << -8 << -9 << -8 << -2 << 9 << 29 << 59 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << -0.01431 << -0.04645 << -0.0802 << -0.09935 << -0.0877 << -0.02903 << 0.09287 << 0.2942 << 0.5912 << 1);
QTest::newRow("OutBack") << int(QEasingCurve::OutBack)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 40 << 70 << 90 << 102 << 108 << 109 << 108 << 104 << 101 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.4088 << 0.7058 << 0.9071 << 1.029 << 1.088 << 1.099 << 1.08 << 1.046 << 1.014 << 1);
QTest::newRow("InOutBack") << int(QEasingCurve::InOutBack)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << -3 << -9 << -7 << 8 << 50 << 91 << 107 << 109 << 103 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << -0.03752 << -0.09256 << -0.07883 << 0.08993 << 0.5 << 0.9101 << 1.079 << 1.093 << 1.038 << 1);
QTest::newRow("OutInBack") << int(QEasingCurve::OutInBack)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 35 << 51 << 54 << 52 << 50 << 47 << 45 << 48 << 64 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.3529 << 0.5145 << 0.5497 << 0.5232 << 0.5 << 0.4768 << 0.4503 << 0.4855 << 0.6471 << 1);
QTest::newRow("InBounce") << int(QEasingCurve::InBounce)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 1 << 6 << 6 << 22 << 23 << 9 << 31 << 69 << 92 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.01188 << 0.06 << 0.06937 << 0.2275 << 0.2344 << 0.09 << 0.3194 << 0.6975 << 0.9244 << 1);
QTest::newRow("OutBounce") << int(QEasingCurve::OutBounce)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 7 << 30 << 68 << 90 << 76 << 77 << 93 << 94 << 98 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.07563 << 0.3025 << 0.6806 << 0.91 << 0.7656 << 0.7725 << 0.9306 << 0.94 << 0.9881 << 1);
QTest::newRow("InOutBounce") << int(QEasingCurve::InOutBounce)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 3 << 11 << 4 << 34 << 50 << 65 << 95 << 88 << 97 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.03 << 0.1138 << 0.045 << 0.3488 << 0.5 << 0.6512 << 0.955 << 0.8862 << 0.97 << 1);
QTest::newRow("OutInBounce") << int(QEasingCurve::OutInBounce)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 15 << 40 << 27 << 43 << 50 << 56 << 72 << 58 << 84 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.1513 << 0.41 << 0.2725 << 0.44 << 0.5 << 0.56 << 0.7275 << 0.59 << 0.8488 << 1);
QTest::newRow("InCurve") << int(QEasingCurve::InCurve)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 2 << 10 << 23 << 37 << 50 << 60 << 70 << 80 << 90 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.02447 << 0.1059 << 0.2343 << 0.3727 << 0.5 << 0.6055 << 0.7 << 0.8 << 0.9 << 1);
QTest::newRow("OutCurve") << int(QEasingCurve::OutCurve)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 10 << 20 << 30 << 39 << 50 << 62 << 76 << 89 << 97 << 100);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.1 << 0.2 << 0.3 << 0.3945 << 0.5 << 0.6273 << 0.7657 << 0.8941 << 0.9755 << 1);
QTest::newRow("SineCurve") << int(QEasingCurve::SineCurve)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 0 << 9 << 34 << 65 << 90 << 100 << 90 << 65 << 34 << 9 << 0);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0 << 0.09549 << 0.3455 << 0.6545 << 0.9045 << 1 << 0.9045 << 0.6545 << 0.3455 << 0.09549 << 0);
QTest::newRow("CosineCurve") << int(QEasingCurve::CosineCurve)
- << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (IntList() << 50 << 79 << 97 << 97 << 79 << 50 << 20 << 2 << 2 << 20 << 49);
+ << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
+ << (RealList() << 0.5 << 0.7939 << 0.9755 << 0.9755 << 0.7939 << 0.5 << 0.2061 << 0.02447 << 0.02447 << 0.2061 << 0.5);
}
@@ -389,12 +390,11 @@ void tst_QEasingCurve::valueForProgress()
for (int t = 0; t <= 100; t+= 10) {
qreal ease = curve.valueForProgress(t/qreal(100));
strInputs += QString::fromAscii(" << %1").arg(t);
- strOutputs += QString::fromAscii(" << %1").arg(int(100*ease));
-
+ strOutputs += " << " + QString().setNum(ease, 'g', 4);
}
QString str = QString::fromAscii(" QTest::newRow(\"%1\") << int(QEasingCurve::%2)\n"
- "\t\t << (IntList() %3)\n"
- "\t\t << (IntList() %4);\n\n")
+ " << (IntList() %3)\n"
+ " << (RealList()%4);\n\n")
.arg(strCurve)
.arg(strCurve)
.arg(strInputs)
@@ -406,13 +406,19 @@ void tst_QEasingCurve::valueForProgress()
#else
QFETCH(int, type);
QFETCH(IntList, at);
- QFETCH(IntList, expected);
+ QFETCH(RealList, expected);
QEasingCurve curve((QEasingCurve::Type)type);
for (int i = 0; i < at.count(); ++i) {
qreal ease = curve.valueForProgress(at.at(i)/qreal(100));
- int ex = expected.at(i);
- QCOMPARE(int(100*ease), ex);
+ // converting ease to 4 precision qreal to match the generated samples
+ qreal easeConv = qreal(QString().setNum(ease, 'g', 4).toDouble());
+ qreal ex = expected.at(i);
+
+ // the least significant digit it is still subject to rounding errors
+ qreal error = easeConv - ex;
+ // accept the potential rounding error in the least significant digit
+ QVERIFY(error <= 0.00001 );
}
#endif
}
diff --git a/examples/animation/research/sound/sound.qrc b/tests/auto/qfile/copy-fallback.qrc
index 8919142..864491f 100644
--- a/examples/animation/research/sound/sound.qrc
+++ b/tests/auto/qfile/copy-fallback.qrc
@@ -1,5 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
-<file>media/sax.mp3</file>
+ <file>copy-fallback.qrc</file>
</qresource>
</RCC>
diff --git a/tests/auto/qfile/test/test.pro b/tests/auto/qfile/test/test.pro
index 68f4c05..8d26f5e 100644
--- a/tests/auto/qfile/test/test.pro
+++ b/tests/auto/qfile/test/test.pro
@@ -17,7 +17,7 @@ QT = core network
DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
-RESOURCES += ../qfile.qrc ../rename-fallback.qrc
+RESOURCES += ../qfile.qrc ../rename-fallback.qrc ../copy-fallback.qrc
TARGET = ../tst_qfile
diff --git a/tests/auto/qfile/tst_qfile.cpp b/tests/auto/qfile/tst_qfile.cpp
index cb8091b..d650b0d 100644
--- a/tests/auto/qfile/tst_qfile.cpp
+++ b/tests/auto/qfile/tst_qfile.cpp
@@ -126,6 +126,7 @@ private slots:
void copyAfterFail();
void copyRemovesTemporaryFile() const;
void copyShouldntOverwrite();
+ void copyFallback();
void link();
void linkToDir();
void absolutePathLinkToRelativePath();
@@ -214,6 +215,13 @@ void tst_QFile::cleanup()
// TODO: Add cleanup code here.
// This will be executed immediately after each test is run.
+ // for copyFallback()
+ if (QFile::exists("file-copy-destination.txt")) {
+ QFile::setPermissions("file-copy-destination.txt",
+ QFile::ReadOwner | QFile::WriteOwner);
+ QFile::remove("file-copy-destination.txt");
+ }
+
// for renameFallback()
QFile::remove("file-rename-destination.txt");
@@ -948,6 +956,34 @@ void tst_QFile::copyShouldntOverwrite()
QFile::remove("tst_qfile.cpy");
}
+void tst_QFile::copyFallback()
+{
+ // Using a resource file to trigger QFile::copy's fallback handling
+ QFile file(":/copy-fallback.qrc");
+ QFile::remove("file-copy-destination.txt");
+
+ QVERIFY2(file.exists(), "test precondition");
+ QVERIFY2(!QFile::exists("file-copy-destination.txt"), "test precondition");
+
+ // Fallback copy of closed file.
+ QVERIFY(file.copy("file-copy-destination.txt"));
+ QVERIFY(QFile::exists("file-copy-destination.txt"));
+ QVERIFY(!file.isOpen());
+
+ // Need to reset permissions on Windows to be able to delete
+ QVERIFY(QFile::setPermissions("file-copy-destination.txt",
+ QFile::ReadOwner | QFile::WriteOwner));
+ QVERIFY(QFile::remove("file-copy-destination.txt"));
+
+ // Fallback copy of open file.
+ QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY(file.copy("file-copy-destination.txt"));
+ QVERIFY(QFile::exists("file-copy-destination.txt"));
+ QVERIFY(!file.isOpen());
+
+ QFile::remove("file-copy-destination.txt");
+}
+
#ifdef Q_OS_WIN
#include <objbase.h>
#include <shlobj.h>
@@ -2122,6 +2158,7 @@ void tst_QFile::renameFallback()
QVERIFY(!file.rename("file-rename-destination.txt"));
QVERIFY(!QFile::exists("file-rename-destination.txt"));
+ QVERIFY(!file.isOpen());
}
void tst_QFile::renameMultiple()
diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp
index 689f73d..16c84d8 100644
--- a/tests/auto/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp
@@ -159,6 +159,7 @@ private slots:
void task218353_relativePaths();
void task251321_sideBarHiddenEntries();
void task251341_sideBarRemoveEntries();
+ void task254490_selectFileMultipleTimes();
private:
QByteArray userSettings;
@@ -1981,5 +1982,37 @@ void tst_QFiledialog::task251341_sideBarRemoveEntries()
current.rmdir("testDir");
}
+void tst_QFiledialog::task254490_selectFileMultipleTimes()
+{
+ QString tempPath = QDir::tempPath();
+ QTemporaryFile *t;
+ t = new QTemporaryFile;
+ t->open();
+ QNonNativeFileDialog fd(0, "TestFileDialog");
+
+ fd.setDirectory(tempPath);
+ fd.setViewMode(QFileDialog::List);
+ fd.setAcceptMode(QFileDialog::AcceptSave);
+ fd.setFileMode(QFileDialog::AnyFile);
+
+ //This should select the file in the QFileDialog
+ fd.selectFile(t->fileName());
+
+ //This should clear the selection and write it into the filename line edit
+ fd.selectFile("new_file.txt");
+
+ fd.show();
+ QTest::qWait(250);
+
+ QLineEdit *lineEdit = qFindChild<QLineEdit*>(&fd, "fileNameEdit");
+ QVERIFY(lineEdit);
+ QCOMPARE(lineEdit->text(),QLatin1String("new_file.txt"));
+ QListView *list = qFindChild<QListView*>(&fd, "listView");
+ QVERIFY(list);
+ QCOMPARE(list->selectionModel()->selectedRows(0).count(), 0);
+
+ t->deleteLater();
+}
+
QTEST_MAIN(tst_QFiledialog)
#include "tst_qfiledialog.moc"
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index b3ae60a..8afdeb4 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -219,6 +219,8 @@ private slots:
void updateCachedItemAfterMove();
void deviceTransform_data();
void deviceTransform();
+ void setTransformProperties_data();
+ void setTransformProperties();
// task specific tests below me
void task141694_textItemEnsureVisible();
@@ -228,6 +230,7 @@ private slots:
void task240400_clickOnTextItem_data();
void task240400_clickOnTextItem();
void task243707_addChildBeforeParent();
+ void task197802_childrenVisibility();
};
void tst_QGraphicsItem::init()
@@ -5435,6 +5438,41 @@ void tst_QGraphicsItem::task243707_addChildBeforeParent()
QVERIFY(!widget2->commonAncestorItem(widget));
}
+void tst_QGraphicsItem::task197802_childrenVisibility()
+{
+ QGraphicsScene scene;
+ QGraphicsRectItem item(QRectF(0,0,20,20));
+
+ QGraphicsRectItem *item2 = new QGraphicsRectItem(QRectF(0,0,10,10), &item);
+ scene.addItem(&item);
+
+ //freshly created: both visible
+ QVERIFY(item.isVisible());
+ QVERIFY(item2->isVisible());
+
+ //hide child: parent visible, child not
+ item2->hide();
+ QVERIFY(item.isVisible());
+ QVERIFY(!item2->isVisible());
+
+ //hide parent: parent and child invisible
+ item.hide();
+ QVERIFY(!item.isVisible());
+ QVERIFY(!item2->isVisible());
+
+ //ask to show the child: parent and child invisible anyways
+ item2->show();
+ QVERIFY(!item.isVisible());
+ QVERIFY(!item2->isVisible());
+
+ //show the parent: both parent and child visible
+ item.show();
+ QVERIFY(item.isVisible());
+ QVERIFY(item2->isVisible());
+
+ delete item2;
+}
+
void tst_QGraphicsItem::boundingRegion_data()
{
QTest::addColumn<QLineF>("line");
@@ -6390,5 +6428,129 @@ void tst_QGraphicsItem::deviceTransform()
QCOMPARE(rect3->deviceTransform(deviceX).map(QPointF(50, 50)), mapResult3);
}
+void tst_QGraphicsItem::setTransformProperties_data()
+{
+ QTest::addColumn<QPointF>("origin");
+ QTest::addColumn<qreal>("rotationX");
+ QTest::addColumn<qreal>("rotationY");
+ QTest::addColumn<qreal>("rotationZ");
+ QTest::addColumn<qreal>("scaleX");
+ QTest::addColumn<qreal>("scaleY");
+ QTest::addColumn<qreal>("shearX");
+ QTest::addColumn<qreal>("shearY");
+
+ QTest::newRow("nothing") << QPointF() << qreal(0.0) << qreal(0.0) << qreal(0.0)
+ << qreal(1) << qreal(1) << qreal(0.0) << qreal(0.0);
+
+ QTest::newRow("rotationZ") << QPointF() << qreal(0.0) << qreal(0.0) << qreal(42.2)
+ << qreal(1) << qreal(1) << qreal(0.0) << qreal(0.0);
+
+ QTest::newRow("rotationXY") << QPointF() << qreal(12.5) << qreal(53.6) << qreal(0.0)
+ << qreal(1) << qreal(1) << qreal(0.0) << qreal(0.0);
+
+ QTest::newRow("rotationXYZ") << QPointF() << qreal(-25) << qreal(12) << qreal(556)
+ << qreal(1) << qreal(1) << qreal(0.0) << qreal(0.0);
+
+ QTest::newRow("rotationXYZ dicentred") << QPointF(-53, 25.2)
+ << qreal(-2578.2) << qreal(4565.2) << qreal(56)
+ << qreal(1) << qreal(1) << qreal(0.0) << qreal(0.0);
+
+ QTest::newRow("Scale") << QPointF() << qreal(0.0) << qreal(0.0) << qreal(0.0)
+ << qreal(6) << qreal(0.5) << qreal(0.0) << qreal(0.0);
+
+ QTest::newRow("Shear") << QPointF() << qreal(0.0) << qreal(0.0) << qreal(0.0)
+ << qreal(1) << qreal(1) << qreal(2.2) << qreal(0.5);
+
+ QTest::newRow("Scale and Shear") << QPointF() << qreal(0.0) << qreal(0.0) << qreal(0.0)
+ << qreal(5.2) << qreal(2.1) << qreal(5.2) << qreal(5.5);
+
+ QTest::newRow("Everything") << QPointF() << qreal(41) << qreal(-23) << qreal(0.56)
+ << qreal(8.2) << qreal(-0.2) << qreal(-12) << qreal(-0.8);
+
+ QTest::newRow("Everything dicentred") << QPointF(qreal(22.3), qreal(-56.2)) << qreal(-175) << qreal(196) << qreal(-1260)
+ << qreal(4) << qreal(2) << qreal(2.56) << qreal(0.8);
+}
+
+void tst_QGraphicsItem::setTransformProperties()
+{
+ QFETCH(QPointF,origin);
+ QFETCH(qreal,rotationX);
+ QFETCH(qreal,rotationY);
+ QFETCH(qreal,rotationZ);
+ QFETCH(qreal,scaleX);
+ QFETCH(qreal,scaleY);
+ QFETCH(qreal,shearX);
+ QFETCH(qreal,shearY);
+
+ QTransform result;
+ result.translate(origin.x(), origin.y());
+ result.rotate(rotationX, Qt::XAxis);
+ result.rotate(rotationY, Qt::YAxis);
+ result.rotate(rotationZ, Qt::ZAxis);
+ result.shear(shearX, shearY);
+ result.scale(scaleX, scaleY);
+ result.translate(-origin.x(), -origin.y());
+
+ QGraphicsScene scene;
+ QGraphicsRectItem *item = new QGraphicsRectItem(QRectF(0, 0, 100, 100));
+ scene.addItem(item);
+ item->setPos(100, 100);
+
+ item->setRotation(rotationX, rotationY, rotationZ);
+ item->setScale(scaleX, scaleY);
+ item->setShear(shearX, shearY);
+ item->setTransformOrigin(origin);
+
+ QCOMPARE(item->xRotation(), rotationX);
+ QCOMPARE(item->yRotation(), rotationY);
+ QCOMPARE(item->zRotation(), rotationZ);
+ QCOMPARE(item->xScale(), scaleX);
+ QCOMPARE(item->yScale(), scaleY);
+ QCOMPARE(item->horizontalShear(), shearX);
+ QCOMPARE(item->verticalShear(), shearY);
+ QCOMPARE(item->transformOrigin(), origin);
+
+ QCOMPARE(result, item->transform());
+
+ //-----------------------------------------------------------------
+ //Change the rotation Z
+ item->setZRotation(45);
+ QTransform result2;
+ result2.translate(origin.x(), origin.y());
+ result2.rotate(rotationX, Qt::XAxis);
+ result2.rotate(rotationY, Qt::YAxis);
+ result2.rotate(45, Qt::ZAxis);
+ result2.shear(shearX, shearY);
+ result2.scale(scaleX, scaleY);
+ result2.translate(-origin.x(), -origin.y());
+
+ QCOMPARE(item->xRotation(), rotationX);
+ QCOMPARE(item->yRotation(), rotationY);
+ QCOMPARE(item->zRotation(), 45.0);
+ QCOMPARE(item->xScale(), scaleX);
+ QCOMPARE(item->yScale(), scaleY);
+ QCOMPARE(item->horizontalShear(), shearX);
+ QCOMPARE(item->verticalShear(), shearY);
+ QCOMPARE(item->transformOrigin(), origin);
+
+ QCOMPARE(result2, item->transform());
+
+ //-----------------------------------------------------------------
+ // calling setTransform() should reset the properties to their default
+ item->setTransform(result);
+
+ QCOMPARE(item->xRotation(), 0.0);
+ QCOMPARE(item->yRotation(), 0.0);
+ QCOMPARE(item->zRotation(), 0.0);
+ QCOMPARE(item->xScale(), 1.0);
+ QCOMPARE(item->yScale(), 1.0);
+ QCOMPARE(item->horizontalShear(), 0.0);
+ QCOMPARE(item->verticalShear(), 0.0);
+ QCOMPARE(item->transformOrigin(), QPointF(0,0));
+
+ QCOMPARE(result, item->transform());
+}
+
+
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"
diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp
index c6b0560..b7199f3 100644
--- a/tests/auto/qimage/tst_qimage.cpp
+++ b/tests/auto/qimage/tst_qimage.cpp
@@ -131,6 +131,8 @@ private slots:
void nullSize();
void premultipliedAlphaConsistency();
+
+ void compareIndexed();
};
tst_QImage::tst_QImage()
@@ -1762,5 +1764,31 @@ void tst_QImage::premultipliedAlphaConsistency()
}
}
+void tst_QImage::compareIndexed()
+{
+ QImage img(256, 1, QImage::Format_Indexed8);
+
+ QVector<QRgb> colorTable(256);
+ for (int i = 0; i < 256; ++i)
+ colorTable[i] = qRgb(i, i, i);
+ img.setColorTable(colorTable);
+
+ for (int i = 0; i < 256; ++i) {
+ img.setPixel(i, 0, i);
+ }
+
+ QImage imgInverted(256, 1, QImage::Format_Indexed8);
+ QVector<QRgb> invertedColorTable(256);
+ for (int i = 0; i < 256; ++i)
+ invertedColorTable[255-i] = qRgb(i, i, i);
+ imgInverted.setColorTable(invertedColorTable);
+
+ for (int i = 0; i < 256; ++i) {
+ imgInverted.setPixel(i, 0, (255-i));
+ }
+
+ QCOMPARE(img, imgInverted);
+}
+
QTEST_MAIN(tst_QImage)
#include "tst_qimage.moc"
diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
index 27741e0..615ac01 100644
--- a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
@@ -59,6 +59,8 @@
#include <QItemDelegate>
#include <QAbstractItemDelegate>
+#include <QTextEdit>
+#include <QPlainTextEdit>
Q_DECLARE_METATYPE(QAbstractItemDelegate::EndEditHint)
@@ -226,6 +228,8 @@ private slots:
void decoration();
void editorEvent_data();
void editorEvent();
+ void enterKey_data();
+ void enterKey();
};
@@ -1048,6 +1052,80 @@ void tst_QItemDelegate::editorEvent()
QCOMPARE(index.data(Qt::CheckStateRole).toInt(), expectedCheckState);
}
+void tst_QItemDelegate::enterKey_data()
+{
+ QTest::addColumn<int>("widget");
+ QTest::addColumn<int>("key");
+ QTest::addColumn<bool>("expectedFocus");
+
+ QTest::newRow("lineedit enter") << 1 << int(Qt::Key_Enter) << false;
+ QTest::newRow("textedit enter") << 2 << int(Qt::Key_Enter) << true;
+ QTest::newRow("plaintextedit enter") << 3 << int(Qt::Key_Enter) << true;
+ QTest::newRow("plaintextedit return") << 3 << int(Qt::Key_Return) << true;
+ QTest::newRow("plaintextedit tab") << 3 << int(Qt::Key_Tab) << false;
+ QTest::newRow("lineedit tab") << 1 << int(Qt::Key_Tab) << false;
+}
+
+void tst_QItemDelegate::enterKey()
+{
+ QFETCH(int, widget);
+ QFETCH(int, key);
+ QFETCH(bool, expectedFocus);
+
+ QStandardItemModel model;
+ model.appendRow(new QStandardItem());
+
+ QListView view;
+ view.setModel(&model);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ view.setFocus();
+ QTest::qWait(30);
+
+ struct TestDelegate : public QItemDelegate
+ {
+ int widgetType;
+ virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& /*option*/, const QModelIndex& /*index*/) const
+ {
+ QWidget *editor = 0;
+ switch(widgetType) {
+ case 1:
+ editor = new QLineEdit(parent);
+ break;
+ case 2:
+ editor = new QTextEdit(parent);
+ break;
+ case 3:
+ editor = new QPlainTextEdit(parent);
+ break;
+ }
+ editor->setObjectName(QString::fromLatin1("TheEditor"));
+ return editor;
+ }
+ } delegate;
+
+ delegate.widgetType = widget;
+
+ view.setItemDelegate(&delegate);
+ QModelIndex index = model.index(0, 0);
+ view.setCurrentIndex(index); // the editor will only selectAll on the current index
+ view.edit(index);
+ QTest::qWait(30);
+
+ QList<QWidget*> lineEditors = qFindChildren<QWidget *>(view.viewport(), QString::fromLatin1("TheEditor"));
+ QCOMPARE(lineEditors.count(), 1);
+
+ QWidget *editor = lineEditors.at(0);
+ QCOMPARE(editor->hasFocus(), true);
+
+ QTest::keyClick(editor, Qt::Key(key));
+ QApplication::processEvents();
+
+ QCOMPARE(editor->hasFocus(), expectedFocus);
+}
+
+
+
// ### _not_ covered:
// editing with a custom editor factory
diff --git a/tests/auto/qmake/tst_qmake.cpp b/tests/auto/qmake/tst_qmake.cpp
index 70f1f3c..1178c81 100644
--- a/tests/auto/qmake/tst_qmake.cpp
+++ b/tests/auto/qmake/tst_qmake.cpp
@@ -63,6 +63,7 @@ public slots:
private slots:
void simple_app();
+ void simple_app_shadowbuild();
void simple_lib();
void simple_dll();
void subdirs();
@@ -143,6 +144,21 @@ void tst_qmake::simple_app()
QVERIFY( test_compiler.removeMakefile( workDir ) );
}
+void tst_qmake::simple_app_shadowbuild()
+{
+ QString workDir = base_path + "/testdata/simple_app";
+ QString buildDir = base_path + "/testdata/simple_app_build";
+
+ QVERIFY( test_compiler.qmake( workDir, "simple_app", buildDir ));
+ QVERIFY( test_compiler.make( buildDir ));
+ QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" ));
+ QVERIFY( test_compiler.makeClean( buildDir ));
+ QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean
+ QVERIFY( test_compiler.makeDistClean( buildDir ));
+ QVERIFY( !test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean
+ QVERIFY( test_compiler.removeMakefile( buildDir ) );
+}
+
void tst_qmake::simple_dll()
{
QString workDir = base_path + "/testdata/simple_dll";
diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp
index fb46073..399d021 100644
--- a/tests/auto/qobject/tst_qobject.cpp
+++ b/tests/auto/qobject/tst_qobject.cpp
@@ -116,6 +116,7 @@ private slots:
void dumpObjectInfo();
void connectToSender();
void qobjectConstCast();
+ void uniqConnection();
protected:
};
@@ -204,12 +205,20 @@ public:
sequence_slot3 = 0;
sequence_slot2 = 0;
sequence_slot1 = 0;
+ count_slot1 = 0;
+ count_slot2 = 0;
+ count_slot3 = 0;
+ count_slot4 = 0;
}
int sequence_slot1;
int sequence_slot2;
int sequence_slot3;
int sequence_slot4;
+ int count_slot1;
+ int count_slot2;
+ int count_slot3;
+ int count_slot4;
bool called(int slot) {
switch (slot) {
@@ -224,10 +233,10 @@ public:
static int sequence;
public slots:
- void slot1() { sequence_slot1 = ++sequence; }
- void slot2() { sequence_slot2 = ++sequence; }
- void slot3() { sequence_slot3 = ++sequence; }
- void slot4() { sequence_slot4 = ++sequence; }
+ void slot1() { sequence_slot1 = ++sequence; count_slot1++; }
+ void slot2() { sequence_slot2 = ++sequence; count_slot2++; }
+ void slot3() { sequence_slot3 = ++sequence; count_slot3++; }
+ void slot4() { sequence_slot4 = ++sequence; count_slot4++; }
};
@@ -2783,5 +2792,69 @@ void tst_QObject::qobjectConstCast()
QVERIFY(qobject_cast<const FooObject *>(cptr));
}
+void tst_QObject::uniqConnection()
+{
+ SenderObject *s = new SenderObject;
+ ReceiverObject *r1 = new ReceiverObject;
+ ReceiverObject *r2 = new ReceiverObject;
+ r1->reset();
+ r2->reset();
+ ReceiverObject::sequence = 0;
+
+ QVERIFY( connect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) , Qt::UniqueConnection) );
+ QVERIFY( connect( s, SIGNAL( signal1() ), r2, SLOT( slot1() ) , Qt::UniqueConnection) );
+ QVERIFY( connect( s, SIGNAL( signal1() ), r1, SLOT( slot3() ) , Qt::UniqueConnection) );
+ QVERIFY( connect( s, SIGNAL( signal3() ), r1, SLOT( slot3() ) , Qt::UniqueConnection) );
+
+ s->emitSignal1();
+ s->emitSignal2();
+ s->emitSignal3();
+ s->emitSignal4();
+
+ QCOMPARE( r1->count_slot1, 1 );
+ QCOMPARE( r1->count_slot2, 0 );
+ QCOMPARE( r1->count_slot3, 2 );
+ QCOMPARE( r1->count_slot4, 0 );
+ QCOMPARE( r2->count_slot1, 1 );
+ QCOMPARE( r2->count_slot2, 0 );
+ QCOMPARE( r2->count_slot3, 0 );
+ QCOMPARE( r2->count_slot4, 0 );
+ QCOMPARE( r1->sequence_slot1, 1 );
+ QCOMPARE( r2->sequence_slot1, 2 );
+ QCOMPARE( r1->sequence_slot3, 4 );
+
+ r1->reset();
+ r2->reset();
+ ReceiverObject::sequence = 0;
+
+ QVERIFY( connect( s, SIGNAL( signal4() ), r1, SLOT( slot4() ) , Qt::UniqueConnection) );
+ QVERIFY( connect( s, SIGNAL( signal4() ), r2, SLOT( slot4() ) , Qt::UniqueConnection) );
+ QVERIFY(!connect( s, SIGNAL( signal4() ), r2, SLOT( slot4() ) , Qt::UniqueConnection) );
+ QVERIFY( connect( s, SIGNAL( signal1() ), r2, SLOT( slot4() ) , Qt::UniqueConnection) );
+ QVERIFY(!connect( s, SIGNAL( signal4() ), r1, SLOT( slot4() ) , Qt::UniqueConnection) );
+
+ s->emitSignal4();
+ QCOMPARE( r1->count_slot4, 1 );
+ QCOMPARE( r2->count_slot4, 1 );
+ QCOMPARE( r1->sequence_slot4, 1 );
+ QCOMPARE( r2->sequence_slot4, 2 );
+
+ r1->reset();
+ r2->reset();
+ ReceiverObject::sequence = 0;
+
+ connect( s, SIGNAL( signal4() ), r1, SLOT( slot4() ) );
+
+ s->emitSignal4();
+ QCOMPARE( r1->count_slot4, 2 );
+ QCOMPARE( r2->count_slot4, 1 );
+ QCOMPARE( r1->sequence_slot4, 3 );
+ QCOMPARE( r2->sequence_slot4, 2 );
+
+ delete s;
+ delete r1;
+ delete r2;
+}
+
QTEST_MAIN(tst_QObject)
#include "tst_qobject.moc"
diff --git a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
index 405ac34..fb5998a 100644
--- a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
@@ -369,6 +369,14 @@ void tst_QPixmapCache::remove()
key = QPixmapCache::insert(p1);
QCOMPARE(getPrivate(key)->key, 1);
+ //Test if pixmaps are correctly deleted
+ QPixmapCache::clear();
+ key = QPixmapCache::insert(p1);
+ QCOMPARE(getPrivate(key)->key, 1);
+ QVERIFY(QPixmapCache::find(key, &p1) != 0);
+ QPixmapCache::remove(key);
+ QCOMPARE(p1.isDetached(), true);
+
//We mix both part of the API
QPixmapCache::clear();
p1.fill(Qt::red);
diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
index 7e910d4..0aeac91 100644
--- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
+++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
@@ -63,6 +63,18 @@ protected:
}
};
+class MyObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal x READ x WRITE setX)
+public:
+ MyObject() : m_x(0) { }
+ qreal x() const { return m_x; }
+ void setX(qreal x) { m_x = x; }
+private:
+ qreal m_x;
+};
+
class tst_QPropertyAnimation : public QObject
{
Q_OBJECT
@@ -92,6 +104,7 @@ private slots:
void startWithoutStartValue();
void playForwardBackward();
void interpolated();
+ void setStartEndValues_data();
void setStartEndValues();
void zeroDurationStart();
void operationsInStates_data();
@@ -283,7 +296,7 @@ void tst_QPropertyAnimation::statesAndSignals()
void tst_QPropertyAnimation::deletion1()
{
QObject *object = new QWidget;
- QPointer<QPropertyAnimation> anim = new QPropertyAnimation(object,"minimumWidth");
+ QPointer<QPropertyAnimation> anim = new QPropertyAnimation(object, "minimumWidth");
//test that the animation is deleted correctly depending of the deletion flag passed in start()
QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
@@ -686,52 +699,78 @@ void tst_QPropertyAnimation::interpolated()
}
}
+Q_DECLARE_METATYPE(QVariant)
+
+void tst_QPropertyAnimation::setStartEndValues_data()
+{
+ QTest::addColumn<QByteArray>("propertyName");
+ QTest::addColumn<QVariant>("initialValue");
+ QTest::addColumn<QVariant>("startValue");
+ QTest::addColumn<QVariant>("endValue");
+
+ QTest::newRow("dynamic property") << QByteArray("ole") << QVariant(42) << QVariant(0) << QVariant(10);
+ QTest::newRow("real property, with unmatching types") << QByteArray("x") << QVariant(42.) << QVariant(0) << QVariant(10.);
+}
+
void tst_QPropertyAnimation::setStartEndValues()
{
+ MyObject object;
+ QFETCH(QByteArray, propertyName);
+ QFETCH(QVariant, initialValue);
+ QFETCH(QVariant, startValue);
+ QFETCH(QVariant, endValue);
+
//this tests the start value, end value and default start value
- QObject o;
- o.setProperty("ole", 42);
- QPropertyAnimation anim(&o, "ole");
+ object.setProperty(propertyName, initialValue);
+ QPropertyAnimation anim(&object, propertyName);
QVariantAnimation::KeyValues values;
QCOMPARE(anim.keyValues(), values);
//let's add a start value
- anim.setStartValue(0);
- values << QVariantAnimation::KeyValue(0, 0);
+ anim.setStartValue(startValue);
+ values << QVariantAnimation::KeyValue(0, startValue);
QCOMPARE(anim.keyValues(), values);
- anim.setEndValue(10);
- values << QVariantAnimation::KeyValue(1, 10);
+ anim.setEndValue(endValue);
+ values << QVariantAnimation::KeyValue(1, endValue);
QCOMPARE(anim.keyValues(), values);
//now we can play with objects
- QCOMPARE(o.property("ole").toInt(), 42);
- QCOMPARE(o.property("ole").toInt(), 42);
+ QCOMPARE(object.property(propertyName).toDouble(), initialValue.toDouble());
anim.start();
QVERIFY(anim.startValue().isValid());
- QCOMPARE(o.property("ole"), anim.startValue());
+ QCOMPARE(object.property(propertyName), anim.startValue());
+ anim.setCurrentTime(anim.duration()/2);
+ QCOMPARE(object.property(propertyName).toDouble(), (startValue.toDouble() + endValue.toDouble())/2 ); //just in the middle of the animation
+ anim.setCurrentTime(anim.duration()); //we go to the end of the animation
+ QCOMPARE(anim.state(), QAnimationGroup::Stopped); //it should have stopped
+ QVERIFY(anim.endValue().isValid());
+ QCOMPARE(object.property(propertyName), anim.endValue()); //end of the animations
//now we remove the explicit start value and test the implicit one
anim.stop();
- o.setProperty("ole", 42);
+ object.setProperty(propertyName, initialValue);
+
+ //let's reset the start value
values.remove(0);
- anim.setStartValue(QVariant()); //reset the start value
+ anim.setStartValue(QVariant());
QCOMPARE(anim.keyValues(), values);
QVERIFY(!anim.startValue().isValid());
+
anim.start();
- QCOMPARE(o.property("ole").toInt(), 42);
+ QCOMPARE(object.property(propertyName), initialValue);
anim.setCurrentTime(anim.duration()/2);
- QCOMPARE(o.property("ole").toInt(), 26); //just in the middle of the animation
- anim.setCurrentTime(anim.duration());
+ QCOMPARE(object.property(propertyName).toDouble(), (initialValue.toDouble() + endValue.toDouble())/2 ); //just in the middle of the animation
+ anim.setCurrentTime(anim.duration()); //we go to the end of the animation
QCOMPARE(anim.state(), QAnimationGroup::Stopped); //it should have stopped
QVERIFY(anim.endValue().isValid());
- QCOMPARE(o.property("ole"), anim.endValue()); //end of the animations
+ QCOMPARE(object.property(propertyName), anim.endValue()); //end of the animations
//now we set back the startValue
- anim.setStartValue(5);
+ anim.setStartValue(startValue);
QVERIFY(anim.startValue().isValid());
anim.start();
- QCOMPARE(o.property("ole").toInt(), 5);
+ QCOMPARE(object.property(propertyName), startValue);
}
void tst_QPropertyAnimation::zeroDurationStart()
diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index f414d3a..d7c231f 100644
--- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
@@ -2585,6 +2585,16 @@ void tst_QSortFilterProxyModel::task248868_dynamicSorting()
QModelIndex index = proxy1.index(row, 0, QModelIndex());
QCOMPARE(proxy1.data(index, Qt::DisplayRole).toString(), expected.at(row));
}
+
+ //set up the sorting before seting the model up
+ QSortFilterProxyModel proxy2;
+ proxy2.setDynamicSortFilter(true);
+ proxy2.sort(0);
+ proxy2.setSourceModel(&model2);
+ for (int row = 0; row < proxy2.rowCount(QModelIndex()); ++row) {
+ QModelIndex index = proxy2.index(row, 0, QModelIndex());
+ QCOMPARE(proxy2.data(index, Qt::DisplayRole).toString(), expected.at(row));
+ }
}
class QtTestModel: public QAbstractItemModel
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index 7476831..768a683 100644
--- a/tests/auto/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp
@@ -81,6 +81,24 @@ static int globalTick;
QCoreApplication::exec(); \
}
+class SignalEmitter : public QObject
+{
+Q_OBJECT
+ public:
+ SignalEmitter(QObject *parent = 0)
+ : QObject(parent) {}
+ void emitSignalWithNoArg()
+ { emit signalWithNoArg(); }
+ void emitSignalWithIntArg(int arg)
+ { emit signalWithIntArg(arg); }
+ void emitSignalWithStringArg(const QString &arg)
+ { emit signalWithStringArg(arg); }
+Q_SIGNALS:
+ void signalWithNoArg();
+ void signalWithIntArg(int);
+ void signalWithStringArg(const QString &);
+};
+
class tst_QStateMachine : public QObject
{
Q_OBJECT
@@ -212,32 +230,12 @@ protected:
}
};
-static QtMsgType s_msgType;
-static QByteArray s_msg;
-static bool s_countWarnings;
-static QtMsgHandler s_oldHandler;
-
-static void defaultErrorStateTestMessageHandler(QtMsgType type, const char *msg)
-{
- s_msgType = type;
- s_msg = msg;
-
- if (s_countWarnings)
- s_oldHandler(type, msg);
-}
-
void tst_QStateMachine::init()
{
- s_msg = QByteArray();
- s_msgType = QtDebugMsg;
- s_countWarnings = true;
-
- s_oldHandler = qInstallMsgHandler(defaultErrorStateTestMessageHandler);
}
void tst_QStateMachine::cleanup()
{
- qInstallMsgHandler(s_oldHandler);
}
class EventTransition : public QAbstractTransition
@@ -256,14 +254,13 @@ private:
void tst_QStateMachine::transitionToRootState()
{
- s_countWarnings = false;
-
QStateMachine machine;
QState *initialState = new QState();
machine.addState(initialState);
machine.setInitialState(initialState);
+ QTest::ignoreMessage(QtWarningMsg, "QAbstractTransition::setTargetStates: root state cannot be target of transition");
initialState->addTransition(new EventTransition(QEvent::User, machine.rootState()));
machine.start();
@@ -346,8 +343,6 @@ void tst_QStateMachine::transitionEntersParent()
void tst_QStateMachine::defaultErrorState()
{
- s_countWarnings = false; // we expect warnings here
-
QStateMachine machine;
QVERIFY(machine.errorState() != 0);
@@ -360,14 +355,12 @@ void tst_QStateMachine::defaultErrorState()
QState *childState = new QState(brokenState);
childState->setObjectName("childState");
+ QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: Missing initial state in compound state 'MyInitialState'");
+
// initialState has no initial state
machine.start();
QCoreApplication::processEvents();
- QCOMPARE(s_msgType, QtWarningMsg);
- QCOMPARE(QString::fromLatin1(s_msg.data()),
- QString::fromLatin1("Unrecoverable error detected in running state machine: Missing initial state in compound state 'MyInitialState'"));
-
QCOMPARE(machine.error(), QStateMachine::NoInitialStateError);
QCOMPARE(machine.errorString(), QString::fromLatin1("Missing initial state in compound state 'MyInitialState'"));
@@ -436,8 +429,6 @@ void tst_QStateMachine::customGlobalErrorState()
QCOMPARE(customErrorState->errorString, QString::fromLatin1("Missing initial state in compound state 'brokenState'"));
QCOMPARE(machine.error(), QStateMachine::NoInitialStateError);
QCOMPARE(machine.errorString(), QString::fromLatin1("Missing initial state in compound state 'brokenState'"));
- QVERIFY(s_msg.isEmpty());
- QCOMPARE(s_msgType, QtDebugMsg);
}
void tst_QStateMachine::customLocalErrorStateInBrokenState()
@@ -453,7 +444,7 @@ void tst_QStateMachine::customLocalErrorStateInBrokenState()
QState *brokenState = new QState();
brokenState->setObjectName("brokenState");
- machine.addState(brokenState);
+ machine.addState(brokenState);
brokenState->setErrorState(customErrorState);
QState *childState = new QState(brokenState);
@@ -461,7 +452,7 @@ void tst_QStateMachine::customLocalErrorStateInBrokenState()
initialState->addTransition(new EventTransition(QEvent::Type(QEvent::User + 1), brokenState));
- machine.start();
+ machine.start();
QCoreApplication::processEvents();
machine.postEvent(new QEvent(QEvent::Type(QEvent::User + 1)));
@@ -470,19 +461,17 @@ void tst_QStateMachine::customLocalErrorStateInBrokenState()
QCOMPARE(machine.configuration().count(), 1);
QVERIFY(machine.configuration().contains(customErrorState));
QCOMPARE(customErrorState->error, QStateMachine::NoInitialStateError);
- QVERIFY(s_msg.isEmpty());
}
void tst_QStateMachine::customLocalErrorStateInOtherState()
{
- s_countWarnings = false;
-
QStateMachine machine;
CustomErrorState *customErrorState = new CustomErrorState(&machine);
machine.addState(customErrorState);
QState *initialState = new QState();
initialState->setObjectName("initialState");
+ QTest::ignoreMessage(QtWarningMsg, "QState::setErrorState: error state cannot belong to a different state machine");
initialState->setErrorState(customErrorState);
machine.addState(initialState);
machine.setInitialState(initialState);
@@ -497,6 +486,7 @@ void tst_QStateMachine::customLocalErrorStateInOtherState()
initialState->addTransition(new EventTransition(QEvent::Type(QEvent::User + 1), brokenState));
+ QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: Missing initial state in compound state 'brokenState'");
machine.start();
QCoreApplication::processEvents();
@@ -505,7 +495,6 @@ void tst_QStateMachine::customLocalErrorStateInOtherState()
QCOMPARE(machine.configuration().count(), 1);
QVERIFY(machine.configuration().contains(machine.errorState()));
- QCOMPARE(s_msgType, QtWarningMsg);
}
void tst_QStateMachine::customLocalErrorStateInParentOfBrokenState()
@@ -522,8 +511,7 @@ void tst_QStateMachine::customLocalErrorStateInParentOfBrokenState()
QState *parentOfBrokenState = new QState();
machine.addState(parentOfBrokenState);
parentOfBrokenState->setObjectName("parentOfBrokenState");
- parentOfBrokenState->setErrorState(customErrorState);
-
+ parentOfBrokenState->setErrorState(customErrorState);
QState *brokenState = new QState(parentOfBrokenState);
brokenState->setObjectName("brokenState");
@@ -542,7 +530,6 @@ void tst_QStateMachine::customLocalErrorStateInParentOfBrokenState()
QCOMPARE(machine.configuration().count(), 1);
QVERIFY(machine.configuration().contains(customErrorState));
- QVERIFY(s_msg.isEmpty());
}
void tst_QStateMachine::customLocalErrorStateOverridesParent()
@@ -584,7 +571,6 @@ void tst_QStateMachine::customLocalErrorStateOverridesParent()
QVERIFY(machine.configuration().contains(customErrorStateForBrokenState));
QCOMPARE(customErrorStateForBrokenState->error, QStateMachine::NoInitialStateError);
QCOMPARE(customErrorStateForParent->error, QStateMachine::NoError);
- QVERIFY(s_msg.isEmpty());
}
void tst_QStateMachine::errorStateHasChildren()
@@ -623,14 +609,11 @@ void tst_QStateMachine::errorStateHasChildren()
QCOMPARE(machine.configuration().count(), 2);
QVERIFY(machine.configuration().contains(customErrorState));
QVERIFY(machine.configuration().contains(childOfErrorState));
- QVERIFY(s_msg.isEmpty());
}
void tst_QStateMachine::errorStateHasErrors()
{
- s_countWarnings = false;
-
QStateMachine machine;
CustomErrorState *customErrorState = new CustomErrorState(&machine);
customErrorState->setObjectName("customErrorState");
@@ -660,21 +643,19 @@ void tst_QStateMachine::errorStateHasErrors()
QCoreApplication::processEvents();
machine.postEvent(new QEvent(QEvent::Type(QEvent::User + 1)));
+ QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: Missing initial state in compound state 'customErrorState'");
QCoreApplication::processEvents();
QCOMPARE(machine.configuration().count(), 1);
QVERIFY(machine.configuration().contains(oldErrorState)); // Fall back to default
QCOMPARE(machine.error(), QStateMachine::NoInitialStateError);
QCOMPARE(machine.errorString(), QString::fromLatin1("Missing initial state in compound state 'customErrorState'"));
-
- QCOMPARE(s_msgType, QtWarningMsg);
}
void tst_QStateMachine::errorStateIsRootState()
{
- s_countWarnings = false;
-
QStateMachine machine;
+ QTest::ignoreMessage(QtWarningMsg, "QStateMachine::setErrorState: root state cannot be error state");
machine.setErrorState(machine.rootState());
QState *initialState = new QState();
@@ -695,6 +676,7 @@ void tst_QStateMachine::errorStateIsRootState()
QCoreApplication::processEvents();
machine.postEvent(new QEvent(QEvent::Type(QEvent::User + 1)));
+ QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: Missing initial state in compound state 'brokenState'");
QCoreApplication::processEvents();
QCOMPARE(machine.configuration().count(), 1);
@@ -775,8 +757,6 @@ void tst_QStateMachine::errorStateEntersParentFirst()
void tst_QStateMachine::customErrorStateIsNull()
{
- s_countWarnings = false;
-
QStateMachine machine;
QAbstractState *oldErrorState = machine.errorState();
machine.rootState()->setErrorState(0);
@@ -795,12 +775,12 @@ void tst_QStateMachine::customErrorStateIsNull()
QCoreApplication::processEvents();
machine.postEvent(new QEvent(QEvent::User));
+ QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: Missing initial state in compound state ''");
QCoreApplication::processEvents();
QCOMPARE(machine.errorState(), reinterpret_cast<void *>(0));
QCOMPARE(machine.configuration().count(), 1);
QVERIFY(machine.configuration().contains(oldErrorState));
- QCOMPARE(s_msgType, QtWarningMsg);
}
void tst_QStateMachine::clearError()
@@ -891,7 +871,7 @@ void tst_QStateMachine::brokenStateIsNeverEntered()
{
QStateMachine machine;
- QObject *entryController = new QObject();
+ QObject *entryController = new QObject(&machine);
entryController->setProperty("brokenStateEntered", false);
entryController->setProperty("childStateEntered", false);
entryController->setProperty("errorStateEntered", false);
@@ -925,19 +905,18 @@ void tst_QStateMachine::brokenStateIsNeverEntered()
void tst_QStateMachine::transitionToStateNotInGraph()
{
- s_countWarnings = false;
-
- QStateMachine machine;
+ QStateMachine machine;
QState *initialState = new QState(machine.rootState());
initialState->setObjectName("initialState");
machine.setInitialState(initialState);
- QState *independentState = new QState();
- independentState->setObjectName("independentState");
- initialState->addTransition(independentState);
+ QState independentState;
+ independentState.setObjectName("independentState");
+ initialState->addTransition(&independentState);
machine.start();
+ QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: No common ancestor for targets and source of transition from state 'initialState'");
QCoreApplication::processEvents();
QCOMPARE(machine.configuration().count(), 1);
@@ -946,14 +925,13 @@ void tst_QStateMachine::transitionToStateNotInGraph()
void tst_QStateMachine::customErrorStateNotInGraph()
{
- s_countWarnings = false;
-
QStateMachine machine;
- QState *errorState = new QState();
- errorState->setObjectName("errorState");
- machine.setErrorState(errorState);
- QVERIFY(errorState != machine.errorState());
+ QState errorState;
+ errorState.setObjectName("errorState");
+ QTest::ignoreMessage(QtWarningMsg, "QState::setErrorState: error state cannot belong to a different state machine");
+ machine.setErrorState(&errorState);
+ QVERIFY(&errorState != machine.errorState());
QState *initialBrokenState = new QState(machine.rootState());
initialBrokenState->setObjectName("initialBrokenState");
@@ -961,6 +939,7 @@ void tst_QStateMachine::customErrorStateNotInGraph()
new QState(initialBrokenState);
machine.start();
+ QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: Missing initial state in compound state 'initialBrokenState'");
QCoreApplication::processEvents();
QCOMPARE(machine.configuration().count(), 1);
@@ -969,13 +948,14 @@ void tst_QStateMachine::customErrorStateNotInGraph()
void tst_QStateMachine::restoreProperties()
{
- QObject *object = new QObject();
- object->setProperty("a", 1);
- object->setProperty("b", 2);
-
QStateMachine machine;
+ QCOMPARE(machine.globalRestorePolicy(), QStateMachine::DoNotRestoreProperties);
machine.setGlobalRestorePolicy(QStateMachine::RestoreProperties);
+ QObject *object = new QObject(&machine);
+ object->setProperty("a", 1);
+ object->setProperty("b", 2);
+
QState *S1 = new QState();
S1->setObjectName("S1");
S1->assignProperty(object, "a", 3);
@@ -1024,6 +1004,7 @@ void tst_QStateMachine::rootState()
QVERIFY(qobject_cast<QState*>(machine.rootState()) != 0);
QCOMPARE(qobject_cast<QState*>(machine.rootState())->parentState(), (QState*)0);
QCOMPARE(machine.rootState()->parent(), (QObject*)&machine);
+ QCOMPARE(machine.rootState()->machine(), &machine);
QState *s1 = new QState(machine.rootState());
QCOMPARE(s1->parentState(), machine.rootState());
@@ -1045,7 +1026,9 @@ void tst_QStateMachine::addAndRemoveState()
QState *s1 = new QState();
QCOMPARE(s1->parentState(), (QState*)0);
+ QCOMPARE(s1->machine(), (QStateMachine*)0);
machine.addState(s1);
+ QCOMPARE(s1->machine(), &machine);
QCOMPARE(s1->parentState(), machine.rootState());
QCOMPARE(root_d->childStates().size(), 2);
QCOMPARE(root_d->childStates().at(0), (QAbstractState*)machine.errorState());
@@ -1080,6 +1063,20 @@ void tst_QStateMachine::addAndRemoveState()
QTest::ignoreMessage(QtWarningMsg, "QStateMachine::removeState: cannot remove null state");
machine.removeState(0);
+ {
+ QStateMachine machine2;
+ {
+ char warning[256];
+ sprintf(warning, "QStateMachine::removeState: state %p's machine (%p) is different from this machine (%p)",
+ machine2.rootState(), &machine2, &machine);
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ machine.removeState(machine2.rootState());
+ }
+ // ### check this behavior
+ machine.addState(machine2.rootState());
+ QCOMPARE(machine2.rootState()->parent(), (QObject*)machine.rootState());
+ }
+
delete s1;
delete s2;
// ### how to deal with this?
@@ -1102,13 +1099,40 @@ void tst_QStateMachine::stateEntryAndExit()
TestState *s2 = new TestState(machine.rootState());
QFinalState *s3 = new QFinalState(machine.rootState());
+
TestTransition *t = new TestTransition(s2);
+ QCOMPARE(t->machine(), (QStateMachine*)0);
+ QCOMPARE(t->sourceState(), (QState*)0);
+ QCOMPARE(t->targetState(), s2);
+ QCOMPARE(t->targetStates().size(), 1);
+ QCOMPARE(t->targetStates().at(0), s2);
+ t->setTargetState(0);
+ QCOMPARE(t->targetState(), (QState*)0);
+ QVERIFY(t->targetStates().isEmpty());
+ t->setTargetState(s2);
+ QCOMPARE(t->targetState(), s2);
+ QTest::ignoreMessage(QtWarningMsg, "QAbstractTransition::setTargetStates: target state(s) cannot be null");
+ t->setTargetStates(QList<QAbstractState*>() << 0);
+ QCOMPARE(t->targetState(), s2);
+ t->setTargetStates(QList<QAbstractState*>() << s2);
+ QCOMPARE(t->targetState(), s2);
+ QCOMPARE(t->targetStates().size(), 1);
+ QCOMPARE(t->targetStates().at(0), s2);
QCOMPARE(s1->addTransition(t), (QAbstractTransition*)t);
+ QCOMPARE(t->sourceState(), s1);
+ QCOMPARE(t->machine(), &machine);
+
{
QAbstractTransition *trans = s2->addTransition(s3);
QVERIFY(trans != 0);
QCOMPARE(trans->sourceState(), (QAbstractState*)s2);
QCOMPARE(trans->targetState(), (QAbstractState*)s3);
+ {
+ char warning[256];
+ sprintf(warning, "QState::removeTransition: transition %p's source state (%p) is different from this state (%p)", trans, s2, s1);
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ s1->removeTransition(trans);
+ }
s2->removeTransition(trans);
QCOMPARE(trans->sourceState(), (QAbstractState*)0);
QCOMPARE(trans->targetState(), (QAbstractState*)s3);
@@ -1120,6 +1144,14 @@ void tst_QStateMachine::stateEntryAndExit()
QSignalSpy stoppedSpy(&machine, SIGNAL(stopped()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
machine.setInitialState(s1);
+ QCOMPARE(machine.initialState(), (QAbstractState*)s1);
+ {
+ char warning[256];
+ sprintf(warning, "QState::setInitialState: state %p is not a child of this state (%p)", machine.rootState(), machine.rootState());
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ machine.setInitialState(machine.rootState());
+ QCOMPARE(machine.initialState(), (QAbstractState*)s1);
+ }
QVERIFY(machine.configuration().isEmpty());
globalTick = 0;
QVERIFY(!machine.isRunning());
@@ -1252,6 +1284,11 @@ void tst_QStateMachine::assignPropertyWithAnimation()
// Single animation
{
QStateMachine machine;
+ QVERIFY(machine.animationsEnabled());
+ machine.setAnimationsEnabled(false);
+ QVERIFY(!machine.animationsEnabled());
+ machine.setAnimationsEnabled(true);
+ QVERIFY(machine.animationsEnabled());
QObject obj;
obj.setProperty("foo", 321);
obj.setProperty("bar", 654);
@@ -1261,9 +1298,22 @@ void tst_QStateMachine::assignPropertyWithAnimation()
s2->assignProperty(&obj, "foo", 456);
s2->assignProperty(&obj, "bar", 789);
QAbstractTransition *trans = s1->addTransition(s2);
+ QVERIFY(trans->animations().isEmpty());
+ QTest::ignoreMessage(QtWarningMsg, "QAbstractTransition::addAnimation: cannot add null animation");
+ trans->addAnimation(0);
QPropertyAnimation anim(&obj, "foo");
anim.setDuration(250);
trans->addAnimation(&anim);
+ QCOMPARE(trans->animations().size(), 1);
+ QCOMPARE(trans->animations().at(0), (QAbstractAnimation*)&anim);
+ QCOMPARE(anim.parent(), (QObject*)0);
+ QTest::ignoreMessage(QtWarningMsg, "QAbstractTransition::removeAnimation: cannot remove null animation");
+ trans->removeAnimation(0);
+ trans->removeAnimation(&anim);
+ QVERIFY(trans->animations().isEmpty());
+ trans->addAnimation(&anim);
+ QCOMPARE(trans->animations().size(), 1);
+ QCOMPARE(trans->animations().at(0), (QAbstractAnimation*)&anim);
QFinalState *s3 = new QFinalState(machine.rootState());
s2->addTransition(s2, SIGNAL(polished()), s3);
@@ -1339,6 +1389,10 @@ void tst_QStateMachine::assignPropertyWithAnimation()
obj.setProperty("bar", 654);
QState *s1 = new QState(machine.rootState());
QCOMPARE(s1->childMode(), QState::ExclusiveStates);
+ s1->setChildMode(QState::ParallelStates);
+ QCOMPARE(s1->childMode(), QState::ParallelStates);
+ s1->setChildMode(QState::ExclusiveStates);
+ QCOMPARE(s1->childMode(), QState::ExclusiveStates);
QCOMPARE(s1->initialState(), (QAbstractState*)0);
s1->setObjectName("s1");
s1->assignProperty(&obj, "foo", 123);
@@ -1375,6 +1429,44 @@ void tst_QStateMachine::assignPropertyWithAnimation()
QCOMPARE(obj.property("foo").toInt(), 321);
QCOMPARE(obj.property("bar").toInt(), 789);
}
+ // Aborted animation
+ {
+ QStateMachine machine;
+ SignalEmitter emitter;
+ QObject obj;
+ obj.setProperty("foo", 321);
+ obj.setProperty("bar", 654);
+ QState *group = new QState(machine.rootState());
+ QState *s1 = new QState(group);
+ group->setInitialState(s1);
+ s1->assignProperty(&obj, "foo", 123);
+ QState *s2 = new QState(group);
+ s2->assignProperty(&obj, "foo", 456);
+ s2->assignProperty(&obj, "bar", 789);
+ QAbstractTransition *trans = s1->addTransition(&emitter, SIGNAL(signalWithNoArg()), s2);
+ QPropertyAnimation anim(&obj, "foo");
+ anim.setDuration(8000);
+ trans->addAnimation(&anim);
+ QPropertyAnimation anim2(&obj, "bar");
+ anim2.setDuration(8000);
+ trans->addAnimation(&anim2);
+ QState *s3 = new QState(group);
+ s3->assignProperty(&obj, "foo", 911);
+ s2->addTransition(&emitter, SIGNAL(signalWithNoArg()), s3);
+
+ machine.setInitialState(group);
+ machine.start();
+ QTRY_COMPARE(machine.configuration().contains(s1), true);
+ QSignalSpy polishedSpy(s2, SIGNAL(polished()));
+ emitter.emitSignalWithNoArg();
+ QTRY_COMPARE(machine.configuration().contains(s2), true);
+ QVERIFY(polishedSpy.isEmpty());
+ emitter.emitSignalWithNoArg(); // will cause animations from s1-->s2 to abort
+ QTRY_COMPARE(machine.configuration().contains(s3), true);
+ QVERIFY(polishedSpy.isEmpty());
+ QCOMPARE(obj.property("foo").toInt(), 911);
+ QCOMPARE(obj.property("bar").toInt(), 789);
+ }
}
struct StringEvent : public QEvent
@@ -1412,47 +1504,59 @@ class StringEventPoster : public QState
{
public:
StringEventPoster(QStateMachine *machine, const QString &value, QState *parent = 0)
- : QState(parent), m_machine(machine), m_value(value) {}
+ : QState(parent), m_machine(machine), m_value(value), m_delay(0) {}
void setString(const QString &value)
{ m_value = value; }
+ void setDelay(int delay)
+ { m_delay = delay; }
protected:
virtual void onEntry(QEvent *)
{
- m_machine->postEvent(new StringEvent(m_value));
+ m_machine->postEvent(new StringEvent(m_value), m_delay);
}
virtual void onExit(QEvent *) {}
private:
QStateMachine *m_machine;
QString m_value;
+ int m_delay;
};
void tst_QStateMachine::postEvent()
{
- QStateMachine machine;
- StringEventPoster *s1 = new StringEventPoster(&machine, "a");
- QFinalState *s2 = new QFinalState;
- s1->addTransition(new StringTransition("a", s2));
- machine.addState(s1);
- machine.addState(s2);
- machine.setInitialState(s1);
- QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
- machine.start();
- QTRY_COMPARE(finishedSpy.count(), 1);
- QCOMPARE(machine.configuration().size(), 1);
- QVERIFY(machine.configuration().contains(s2));
+ for (int x = 0; x < 2; ++x) {
+ QStateMachine machine;
+ {
+ QEvent e(QEvent::None);
+ QTest::ignoreMessage(QtWarningMsg, "QStateMachine::postEvent: cannot post event when the state machine is not running");
+ machine.postEvent(&e);
+ }
+ StringEventPoster *s1 = new StringEventPoster(&machine, "a");
+ if (x == 1)
+ s1->setDelay(100);
+ QFinalState *s2 = new QFinalState;
+ s1->addTransition(new StringTransition("a", s2));
+ machine.addState(s1);
+ machine.addState(s2);
+ machine.setInitialState(s1);
+ QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ machine.start();
+ QTRY_COMPARE(finishedSpy.count(), 1);
+ QCOMPARE(machine.configuration().size(), 1);
+ QVERIFY(machine.configuration().contains(s2));
- s1->setString("b");
- QFinalState *s3 = new QFinalState();
- machine.addState(s3);
- s1->addTransition(new StringTransition("b", s3));
- finishedSpy.clear();
- machine.start();
- QTRY_COMPARE(finishedSpy.count(), 1);
- QCOMPARE(machine.configuration().size(), 1);
- QVERIFY(machine.configuration().contains(s3));
+ s1->setString("b");
+ QFinalState *s3 = new QFinalState();
+ machine.addState(s3);
+ s1->addTransition(new StringTransition("b", s3));
+ finishedSpy.clear();
+ machine.start();
+ QTRY_COMPARE(finishedSpy.count(), 1);
+ QCOMPARE(machine.configuration().size(), 1);
+ QVERIFY(machine.configuration().contains(s3));
+ }
}
void tst_QStateMachine::stateFinished()
@@ -1489,6 +1593,12 @@ void tst_QStateMachine::parallelStates()
QFinalState *s1_2_f = new QFinalState(s1_2);
s1_2_1->addTransition(s1_2_f);
s1_2->setInitialState(s1_2_1);
+ {
+ char warning[256];
+ sprintf(warning, "QState::setInitialState: ignoring attempt to set initial state of parallel state group %p", s1);
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ s1->setInitialState(0);
+ }
machine.addState(s1);
QFinalState *s2 = new QFinalState();
@@ -1566,29 +1676,11 @@ void tst_QStateMachine::allSourceToTargetConfigurations()
QTRY_COMPARE(finishedSpy.count(), 1);
}
-class SignalEmitter : public QObject
-{
-Q_OBJECT
- public:
- SignalEmitter(QObject *parent = 0)
- : QObject(parent) {}
- void emitSignalWithNoArg()
- { emit signalWithNoArg(); }
- void emitSignalWithIntArg(int arg)
- { emit signalWithIntArg(arg); }
- void emitSignalWithStringArg(const QString &arg)
- { emit signalWithStringArg(arg); }
-Q_SIGNALS:
- void signalWithNoArg();
- void signalWithIntArg(int);
- void signalWithStringArg(const QString &);
-};
-
class TestSignalTransition : public QSignalTransition
{
public:
- TestSignalTransition()
- : QSignalTransition() {}
+ TestSignalTransition(QState *sourceState = 0)
+ : QSignalTransition(sourceState) {}
TestSignalTransition(QObject *sender, const char *signal,
QAbstractState *target)
: QSignalTransition(sender, signal, QList<QAbstractState*>() << target) {}
@@ -1626,14 +1718,12 @@ void tst_QStateMachine::signalTransitions()
QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: no such signal SignalEmitter::noSuchSignal()");
QCOMPARE(s0->addTransition(&emitter, SIGNAL(noSuchSignal()), s1), (QObject*)0);
- {
- QSignalTransition *trans = s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), s1);
- QVERIFY(trans != 0);
- QCOMPARE(trans->sourceState(), s0);
- QCOMPARE(trans->targetState(), (QAbstractState*)s1);
- QCOMPARE(trans->senderObject(), (QObject*)&emitter);
- QCOMPARE(trans->signal(), QByteArray(SIGNAL(signalWithNoArg())));
- }
+ QSignalTransition *trans = s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), s1);
+ QVERIFY(trans != 0);
+ QCOMPARE(trans->sourceState(), s0);
+ QCOMPARE(trans->targetState(), (QAbstractState*)s1);
+ QCOMPARE(trans->senderObject(), (QObject*)&emitter);
+ QCOMPARE(trans->signal(), QByteArray(SIGNAL(signalWithNoArg())));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
machine.setInitialState(s0);
@@ -1645,6 +1735,33 @@ void tst_QStateMachine::signalTransitions()
QTRY_COMPARE(finishedSpy.count(), 1);
emitter.emitSignalWithNoArg();
+
+ trans->setSignal(SIGNAL(signalWithIntArg(int)));
+ QCOMPARE(trans->signal(), QByteArray(SIGNAL(signalWithIntArg(int))));
+ machine.start();
+ QCoreApplication::processEvents();
+ emitter.emitSignalWithIntArg(123);
+ QTRY_COMPARE(finishedSpy.count(), 2);
+
+ machine.start();
+ QCoreApplication::processEvents();
+ trans->setSignal(SIGNAL(signalWithNoArg()));
+ QCOMPARE(trans->signal(), QByteArray(SIGNAL(signalWithNoArg())));
+ emitter.emitSignalWithNoArg();
+ QTRY_COMPARE(finishedSpy.count(), 3);
+
+ SignalEmitter emitter2;
+ machine.start();
+ QCoreApplication::processEvents();
+ trans->setSenderObject(&emitter2);
+ emitter2.emitSignalWithNoArg();
+ QTRY_COMPARE(finishedSpy.count(), 4);
+
+ machine.start();
+ QCoreApplication::processEvents();
+ QTest::ignoreMessage(QtWarningMsg, "QSignalTransition: no such signal: SignalEmitter::noSuchSignal()");
+ trans->setSignal(SIGNAL(noSuchSignal()));
+ QCOMPARE(trans->signal(), QByteArray(SIGNAL(noSuchSignal())));
}
{
QStateMachine machine;
@@ -1756,20 +1873,65 @@ void tst_QStateMachine::signalTransitions()
QCOMPARE(machine.configuration().size(), 1);
QVERIFY(machine.configuration().contains(s1));
}
+ // multiple signal transitions from same source
+ {
+ QStateMachine machine;
+ SignalEmitter emitter;
+ QState *s0 = new QState(machine.rootState());
+ QFinalState *s1 = new QFinalState(machine.rootState());
+ s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), s1);
+ QFinalState *s2 = new QFinalState(machine.rootState());
+ s0->addTransition(&emitter, SIGNAL(signalWithIntArg(int)), s2);
+ QFinalState *s3 = new QFinalState(machine.rootState());
+ s0->addTransition(&emitter, SIGNAL(signalWithStringArg(QString)), s3);
+
+ QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ machine.setInitialState(s0);
+
+ machine.start();
+ QTRY_COMPARE(startedSpy.count(), 1);
+ emitter.emitSignalWithNoArg();
+ QTRY_COMPARE(finishedSpy.count(), 1);
+ QCOMPARE(machine.configuration().size(), 1);
+ QVERIFY(machine.configuration().contains(s1));
+
+ machine.start();
+ QTRY_COMPARE(startedSpy.count(), 2);
+ emitter.emitSignalWithIntArg(123);
+ QTRY_COMPARE(finishedSpy.count(), 2);
+ QCOMPARE(machine.configuration().size(), 1);
+ QVERIFY(machine.configuration().contains(s2));
+
+ machine.start();
+ QTRY_COMPARE(startedSpy.count(), 3);
+ emitter.emitSignalWithStringArg("hello");
+ QTRY_COMPARE(finishedSpy.count(), 3);
+ QCOMPARE(machine.configuration().size(), 1);
+ QVERIFY(machine.configuration().contains(s3));
+ }
}
void tst_QStateMachine::eventTransitions()
{
QPushButton button;
- {
+ for (int x = 0; x < 2; ++x) {
QStateMachine machine;
QState *s0 = new QState(machine.rootState());
QFinalState *s1 = new QFinalState(machine.rootState());
- QMouseEventTransition *trans = new QMouseEventTransition(&button, QEvent::MouseButtonPress, Qt::LeftButton);
+ QMouseEventTransition *trans;
+ if (x == 0) {
+ trans = new QMouseEventTransition(&button, QEvent::MouseButtonPress, Qt::LeftButton);
+ QCOMPARE(trans->targetState(), (QAbstractState*)0);
+ trans->setTargetState(s1);
+ } else {
+ trans = new QMouseEventTransition(&button, QEvent::MouseButtonPress,
+ Qt::LeftButton, QList<QAbstractState*>() << s1);
+ }
QCOMPARE(trans->eventType(), QEvent::MouseButtonPress);
QCOMPARE(trans->button(), Qt::LeftButton);
- trans->setTargetState(s1);
+ QCOMPARE(trans->targetState(), (QAbstractState*)s1);
s0->addTransition(trans);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
@@ -1778,25 +1940,53 @@ void tst_QStateMachine::eventTransitions()
QCoreApplication::processEvents();
QTest::mousePress(&button, Qt::LeftButton);
- QCoreApplication::processEvents();
-
QTRY_COMPARE(finishedSpy.count(), 1);
QTest::mousePress(&button, Qt::LeftButton);
+
+ trans->setEventType(QEvent::MouseButtonRelease);
+ QCOMPARE(trans->eventType(), QEvent::MouseButtonRelease);
+ machine.start();
+ QCoreApplication::processEvents();
+ QTest::mouseRelease(&button, Qt::LeftButton);
+ QTRY_COMPARE(finishedSpy.count(), 2);
+
+ machine.start();
+ QCoreApplication::processEvents();
+ trans->setEventType(QEvent::MouseButtonPress);
+ QTest::mousePress(&button, Qt::LeftButton);
+ QTRY_COMPARE(finishedSpy.count(), 3);
+
+ QPushButton button2;
+ machine.start();
+ QCoreApplication::processEvents();
+ trans->setEventObject(&button2);
+ QTest::mousePress(&button2, Qt::LeftButton);
+ QTRY_COMPARE(finishedSpy.count(), 4);
}
- {
+ for (int x = 0; x < 3; ++x) {
QStateMachine machine;
QState *s0 = new QState(machine.rootState());
QFinalState *s1 = new QFinalState(machine.rootState());
- QEventTransition *trans = new QEventTransition();
- QCOMPARE(trans->eventObject(), (QObject*)0);
- QCOMPARE(trans->eventType(), QEvent::None);
- trans->setEventObject(&button);
+ QEventTransition *trans;
+ if (x == 0) {
+ trans = new QEventTransition();
+ QCOMPARE(trans->eventObject(), (QObject*)0);
+ QCOMPARE(trans->eventType(), QEvent::None);
+ trans->setEventObject(&button);
+ trans->setEventType(QEvent::MouseButtonPress);
+ trans->setTargetState(s1);
+ } else if (x == 1) {
+ trans = new QEventTransition(&button, QEvent::MouseButtonPress);
+ trans->setTargetState(s1);
+ } else {
+ trans = new QEventTransition(&button, QEvent::MouseButtonPress,
+ QList<QAbstractState*>() << s1);
+ }
QCOMPARE(trans->eventObject(), (QObject*)&button);
- trans->setEventType(QEvent::MouseButtonPress);
QCOMPARE(trans->eventType(), QEvent::MouseButtonPress);
- trans->setTargetState(s1);
+ QCOMPARE(trans->targetState(), (QAbstractState*)s1);
s0->addTransition(trans);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
@@ -1929,57 +2119,123 @@ void tst_QStateMachine::eventTransitions()
QCOMPARE(machine.configuration().size(), 1);
QVERIFY(machine.configuration().contains(s1));
}
+ // multiple event transitions from same source
+ {
+ QStateMachine machine;
+ QState *s0 = new QState(machine.rootState());
+ QFinalState *s1 = new QFinalState(machine.rootState());
+ QFinalState *s2 = new QFinalState(machine.rootState());
+ QEventTransition *t0 = new QEventTransition(&button, QEvent::MouseButtonPress);
+ t0->setTargetState(s1);
+ s0->addTransition(t0);
+ QEventTransition *t1 = new QEventTransition(&button, QEvent::MouseButtonRelease);
+ t1->setTargetState(s2);
+ s0->addTransition(t1);
+
+ QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ machine.setInitialState(s0);
+
+ machine.start();
+ QTRY_COMPARE(startedSpy.count(), 1);
+ QTest::mousePress(&button, Qt::LeftButton);
+ QTRY_COMPARE(finishedSpy.count(), 1);
+ QCOMPARE(machine.configuration().size(), 1);
+ QVERIFY(machine.configuration().contains(s1));
+
+ machine.start();
+ QTRY_COMPARE(startedSpy.count(), 2);
+ QTest::mouseRelease(&button, Qt::LeftButton);
+ QTRY_COMPARE(finishedSpy.count(), 2);
+ QCOMPARE(machine.configuration().size(), 1);
+ QVERIFY(machine.configuration().contains(s2));
+ }
+ // custom event
+ {
+ QStateMachine machine;
+ QState *s0 = new QState(machine.rootState());
+ QFinalState *s1 = new QFinalState(machine.rootState());
+
+ QEventTransition *trans = new QEventTransition(&button, QEvent::Type(QEvent::User+1));
+ trans->setTargetState(s1);
+ s0->addTransition(trans);
+
+ QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ machine.setInitialState(s0);
+ machine.start();
+ QTest::ignoreMessage(QtWarningMsg, "QObject event transitions are not supported for custom types");
+ QTRY_COMPARE(startedSpy.count(), 1);
+ }
}
void tst_QStateMachine::historyStates()
{
- QStateMachine machine;
- QState *root = machine.rootState();
- QState *s0 = new QState(root);
- QState *s00 = new QState(s0);
- QState *s01 = new QState(s0);
- QHistoryState *s0h = new QHistoryState(s0);
- QState *s1 = new QState(root);
- QFinalState *s2 = new QFinalState(root);
-
- s00->addTransition(new StringTransition("a", s01));
- s0->addTransition(new StringTransition("b", s1));
- s1->addTransition(new StringTransition("c", s0h));
- s0->addTransition(new StringTransition("d", s2));
-
- root->setInitialState(s0);
- s0->setInitialState(s00);
+ for (int x = 0; x < 2; ++x) {
+ QStateMachine machine;
+ QState *root = machine.rootState();
+ QState *s0 = new QState(root);
+ QState *s00 = new QState(s0);
+ QState *s01 = new QState(s0);
+ QHistoryState *s0h;
+ if (x == 0) {
+ s0h = new QHistoryState(s0);
+ QCOMPARE(s0h->historyType(), QHistoryState::ShallowHistory);
+ s0h->setHistoryType(QHistoryState::DeepHistory);
+ } else {
+ s0h = new QHistoryState(QHistoryState::DeepHistory, s0);
+ }
+ QCOMPARE(s0h->historyType(), QHistoryState::DeepHistory);
+ s0h->setHistoryType(QHistoryState::ShallowHistory);
+ QCOMPARE(s0h->historyType(), QHistoryState::ShallowHistory);
+ QCOMPARE(s0h->defaultState(), (QAbstractState*)0);
+ s0h->setDefaultState(s00);
+ QCOMPARE(s0h->defaultState(), (QAbstractState*)s00);
+ char warning[256];
+ sprintf(warning, "QHistoryState::setDefaultState: state %p does not belong to this history state's group (%p)", s0, s0);
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ s0h->setDefaultState(s0);
+ QState *s1 = new QState(root);
+ QFinalState *s2 = new QFinalState(root);
+
+ s00->addTransition(new StringTransition("a", s01));
+ s0->addTransition(new StringTransition("b", s1));
+ s1->addTransition(new StringTransition("c", s0h));
+ s0->addTransition(new StringTransition("d", s2));
+
+ root->setInitialState(s0);
+ s0->setInitialState(s00);
- QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
- machine.start();
- QCoreApplication::processEvents();
- QCOMPARE(machine.configuration().size(), 2);
- QVERIFY(machine.configuration().contains(s0));
- QVERIFY(machine.configuration().contains(s00));
+ QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ machine.start();
+ QCoreApplication::processEvents();
+ QCOMPARE(machine.configuration().size(), 2);
+ QVERIFY(machine.configuration().contains(s0));
+ QVERIFY(machine.configuration().contains(s00));
- machine.postEvent(new StringEvent("a"));
- QCoreApplication::processEvents();
- QCOMPARE(machine.configuration().size(), 2);
- QVERIFY(machine.configuration().contains(s0));
- QVERIFY(machine.configuration().contains(s01));
+ machine.postEvent(new StringEvent("a"));
+ QCoreApplication::processEvents();
+ QCOMPARE(machine.configuration().size(), 2);
+ QVERIFY(machine.configuration().contains(s0));
+ QVERIFY(machine.configuration().contains(s01));
- machine.postEvent(new StringEvent("b"));
- QCoreApplication::processEvents();
- QCOMPARE(machine.configuration().size(), 1);
- QVERIFY(machine.configuration().contains(s1));
+ machine.postEvent(new StringEvent("b"));
+ QCoreApplication::processEvents();
+ QCOMPARE(machine.configuration().size(), 1);
+ QVERIFY(machine.configuration().contains(s1));
- machine.postEvent(new StringEvent("c"));
- QCoreApplication::processEvents();
- QCOMPARE(machine.configuration().size(), 2);
- QVERIFY(machine.configuration().contains(s0));
- QVERIFY(machine.configuration().contains(s01));
+ machine.postEvent(new StringEvent("c"));
+ QCoreApplication::processEvents();
+ QCOMPARE(machine.configuration().size(), 2);
+ QVERIFY(machine.configuration().contains(s0));
+ QVERIFY(machine.configuration().contains(s01));
- machine.postEvent(new StringEvent("d"));
- QCoreApplication::processEvents();
- QCOMPARE(machine.configuration().size(), 1);
- QVERIFY(machine.configuration().contains(s2));
+ machine.postEvent(new StringEvent("d"));
+ QCoreApplication::processEvents();
+ QCOMPARE(machine.configuration().size(), 1);
+ QVERIFY(machine.configuration().contains(s2));
- QTRY_COMPARE(finishedSpy.count(), 1);
+ QTRY_COMPARE(finishedSpy.count(), 1);
+ }
}
void tst_QStateMachine::startAndStop()
@@ -2010,6 +2266,9 @@ void tst_QStateMachine::startAndStop()
QCOMPARE(machine.configuration().count(), 1);
QVERIFY(machine.configuration().contains(s1));
+ QTest::ignoreMessage(QtWarningMsg, "QStateMachine::start(): already running");
+ machine.start();
+
machine.stop();
QTRY_COMPARE(machine.isRunning(), false);
QTRY_COMPARE(stoppedSpy.count(), 1);
@@ -2018,6 +2277,11 @@ void tst_QStateMachine::startAndStop()
QCOMPARE(machine.configuration().count(), 1);
QVERIFY(machine.configuration().contains(s1));
+
+ machine.start();
+ machine.stop();
+ QTRY_COMPARE(startedSpy.count(), 2);
+ QCOMPARE(stoppedSpy.count(), 2);
}
void tst_QStateMachine::targetStateWithNoParent()
@@ -2025,8 +2289,8 @@ void tst_QStateMachine::targetStateWithNoParent()
QStateMachine machine;
QState *s1 = new QState(machine.rootState());
s1->setObjectName("s1");
- QState *s2 = new QState();
- s1->addTransition(s2);
+ QState s2;
+ s1->addTransition(&s2);
machine.setInitialState(s1);
QSignalSpy startedSpy(&machine, SIGNAL(started()));
QSignalSpy stoppedSpy(&machine, SIGNAL(stopped()));
@@ -2058,7 +2322,7 @@ void tst_QStateMachine::defaultGlobalRestorePolicy()
{
QStateMachine machine;
- QObject *propertyHolder = new QObject();
+ QObject *propertyHolder = new QObject(&machine);
propertyHolder->setProperty("a", 1);
propertyHolder->setProperty("b", 2);
@@ -2147,7 +2411,7 @@ void tst_QStateMachine::globalRestorePolicySetToDoNotRestore()
QStateMachine machine;
machine.setGlobalRestorePolicy(QStateMachine::DoNotRestoreProperties);
- QObject *propertyHolder = new QObject();
+ QObject *propertyHolder = new QObject(&machine);
propertyHolder->setProperty("a", 1);
propertyHolder->setProperty("b", 2);
@@ -2308,7 +2572,7 @@ void tst_QStateMachine::globalRestorePolicySetToRestore()
QStateMachine machine;
machine.setGlobalRestorePolicy(QStateMachine::RestoreProperties);
- QObject *propertyHolder = new QObject();
+ QObject *propertyHolder = new QObject(&machine);
propertyHolder->setProperty("a", 1);
propertyHolder->setProperty("b", 2);
@@ -2428,7 +2692,7 @@ void tst_QStateMachine::simpleAnimation()
{
QStateMachine machine;
- QObject *object = new QObject();
+ QObject *object = new QObject(&machine);
object->setProperty("fooBar", 1.0);
QState *s1 = new QState(machine.rootState());
@@ -2471,7 +2735,7 @@ void tst_QStateMachine::twoAnimations()
{
QStateMachine machine;
- QObject *object = new QObject();
+ QObject *object = new QObject(&machine);
object->setProperty("foo", 1.0);
object->setProperty("bar", 3.0);
@@ -2515,7 +2779,7 @@ void tst_QStateMachine::twoAnimatedTransitions()
{
QStateMachine machine;
- QObject *object = new QObject();
+ QObject *object = new QObject(&machine);
object->setProperty("foo", 1.0);
QState *s1 = new QState(machine.rootState());
@@ -2559,7 +2823,7 @@ void tst_QStateMachine::playAnimationTwice()
{
QStateMachine machine;
- QObject *object = new QObject();
+ QObject *object = new QObject(&machine);
object->setProperty("foo", 1.0);
QState *s1 = new QState(machine.rootState());
@@ -2602,7 +2866,7 @@ void tst_QStateMachine::nestedTargetStateForAnimation()
{
QStateMachine machine;
- QObject *object = new QObject();
+ QObject *object = new QObject(&machine);
object->setProperty("foo", 1.0);
object->setProperty("bar", 3.0);
@@ -2659,7 +2923,7 @@ void tst_QStateMachine::animatedGlobalRestoreProperty()
QStateMachine machine;
machine.setGlobalRestorePolicy(QStateMachine::RestoreProperties);
- QObject *object = new QObject();
+ QObject *object = new QObject(&machine);
object->setProperty("foo", 1.0);
SlotCalledCounter counter;
@@ -2705,7 +2969,7 @@ void tst_QStateMachine::specificTargetValueOfAnimation()
{
QStateMachine machine;
- QObject *object = new QObject();
+ QObject *object = new QObject(&machine);
object->setProperty("foo", 1.0);
QState *s1 = new QState(machine.rootState());
@@ -2769,7 +3033,7 @@ void tst_QStateMachine::addDefaultAnimationWithUnusedAnimation()
{
QStateMachine machine;
- QObject *object = new QObject();
+ QObject *object = new QObject(&machine);
object->setProperty("foo", 1.0);
object->setProperty("bar", 2.0);
@@ -2848,7 +3112,7 @@ void tst_QStateMachine::overrideDefaultAnimationWithSpecific()
{
QStateMachine machine;
- QObject *object = new QObject();
+ QObject *object = new QObject(&machine);
object->setProperty("foo", 1.0);
SlotCalledCounter counter;
diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
index 2daa0f6..26f5f40 100644
--- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -77,6 +77,7 @@ private slots:
void fileTemplate_data();
void getSetCheck();
void fileName();
+ void fileNameIsEmpty();
void autoRemove();
void write();
void openCloseOpenClose();
@@ -86,6 +87,8 @@ private slots:
void stressTest();
void rename();
void renameFdLeak();
+ void reOpenThroughQFile();
+
public:
};
@@ -189,6 +192,27 @@ void tst_QTemporaryFile::fileName()
QCOMPARE(absoluteFilePath, absoluteTempPath);
}
+void tst_QTemporaryFile::fileNameIsEmpty()
+{
+ QString filename;
+ {
+ QTemporaryFile file;
+ QVERIFY(file.fileName().isEmpty());
+
+ QVERIFY(file.open());
+ QVERIFY(!file.fileName().isEmpty());
+
+ filename = file.fileName();
+ QVERIFY(QFile::exists(filename));
+
+ file.close();
+ QVERIFY(!file.isOpen());
+ QVERIFY(QFile::exists(filename));
+ QVERIFY(!file.fileName().isEmpty());
+ }
+ QVERIFY(!QFile::exists(filename));
+}
+
void tst_QTemporaryFile::autoRemove()
{
// Test auto remove
@@ -358,6 +382,7 @@ void tst_QTemporaryFile::rename()
QVERIFY(file.rename("temporary-file.txt"));
QVERIFY(!dir.exists(tempname));
QVERIFY(dir.exists("temporary-file.txt"));
+ QCOMPARE(file.fileName(), QString("temporary-file.txt"));
}
QVERIFY(!dir.exists(tempname));
@@ -401,5 +426,18 @@ void tst_QTemporaryFile::renameFdLeak()
#endif
}
+void tst_QTemporaryFile::reOpenThroughQFile()
+{
+ QByteArray data("abcdefghij");
+
+ QTemporaryFile file;
+ QVERIFY(((QFile &)file).open(QIODevice::WriteOnly));
+ QCOMPARE(file.write(data), (qint64)data.size());
+
+ file.close();
+ QVERIFY(file.open());
+ QCOMPARE(file.readAll(), data);
+}
+
QTEST_MAIN(tst_QTemporaryFile)
#include "tst_qtemporaryfile.moc"
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index c4517d6..2ef76a4 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -227,6 +227,7 @@ private slots:
void task246536_scrollbarsNotWorking();
void task250683_wrongSectionSize();
void task239271_addRowsWithFirstColumnHidden();
+ void task254234_proxySort();
};
class QtTestModel: public QAbstractItemModel
@@ -2498,7 +2499,6 @@ void tst_QTreeView::sortByColumn()
QCOMPARE(view.header()->sortIndicatorSection(), 0);
QCOMPARE(view.model()->data(view.model()->index(0,0)).toString(), QString::fromLatin1("a"));
QCOMPARE(view.model()->data(view.model()->index(1,0)).toString(), QString::fromLatin1("b"));
-
}
/*
@@ -3346,7 +3346,6 @@ void tst_QTreeView::task246536_scrollbarsNotWorking()
QVERIFY(o.count > 0);
}
-
void tst_QTreeView::task250683_wrongSectionSize()
{
QDirModel model;
@@ -3400,5 +3399,32 @@ void tst_QTreeView::task239271_addRowsWithFirstColumnHidden()
QVERIFY(delegate.paintedIndexes.contains(sub11.index()));
}
+void tst_QTreeView::task254234_proxySort()
+{
+ //based on tst_QTreeView::sortByColumn
+ // it used not to work when setting the source of a proxy after enabling sorting
+ QTreeView view;
+ QStandardItemModel model(4,2);
+ model.setItem(0,0,new QStandardItem("b"));
+ model.setItem(1,0,new QStandardItem("d"));
+ model.setItem(2,0,new QStandardItem("c"));
+ model.setItem(3,0,new QStandardItem("a"));
+ model.setItem(0,1,new QStandardItem("e"));
+ model.setItem(1,1,new QStandardItem("g"));
+ model.setItem(2,1,new QStandardItem("h"));
+ model.setItem(3,1,new QStandardItem("f"));
+
+ view.sortByColumn(1);
+ view.setSortingEnabled(true);
+
+ QSortFilterProxyModel proxy;
+ proxy.setDynamicSortFilter(true);
+ view.setModel(&proxy);
+ proxy.setSourceModel(&model);
+ QCOMPARE(view.header()->sortIndicatorSection(), 1);
+ QCOMPARE(view.model()->data(view.model()->index(0,1)).toString(), QString::fromLatin1("h"));
+ QCOMPARE(view.model()->data(view.model()->index(1,1)).toString(), QString::fromLatin1("g"));
+}
+
QTEST_MAIN(tst_QTreeView)
#include "tst_qtreeview.moc"
diff --git a/tests/benchmarks/qgraphicsitem/qgraphicsitem.pro b/tests/benchmarks/qgraphicsitem/qgraphicsitem.pro
new file mode 100644
index 0000000..c8fc07b
--- /dev/null
+++ b/tests/benchmarks/qgraphicsitem/qgraphicsitem.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_qgraphicsitem
+
+SOURCES += tst_qgraphicsitem.cpp
+
diff --git a/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp
new file mode 100644
index 0000000..68e3aa1
--- /dev/null
+++ b/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -0,0 +1,170 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QGraphicsItem>
+#include <QGraphicsScene>
+#include <QGraphicsView>
+
+//TESTED_FILES=
+
+class tst_QGraphicsItem : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QGraphicsItem();
+ virtual ~tst_QGraphicsItem();
+
+public slots:
+ void init();
+ void cleanup();
+
+private slots:
+ void setPos_data();
+ void setPos();
+ void setTransform_data();
+ void setTransform();
+ void rotate();
+ void scale();
+ void shear();
+ void translate();
+ void setRotation();
+ void setRotationXYZ();
+};
+
+tst_QGraphicsItem::tst_QGraphicsItem()
+{
+}
+
+tst_QGraphicsItem::~tst_QGraphicsItem()
+{
+}
+
+void tst_QGraphicsItem::init()
+{
+}
+
+void tst_QGraphicsItem::cleanup()
+{
+}
+
+void tst_QGraphicsItem::setPos_data()
+{
+ QTest::addColumn<QPointF>("pos");
+
+ QTest::newRow("0, 0") << QPointF(0, 0);
+ QTest::newRow("10, 10") << QPointF(10, 10);
+ QTest::newRow("-10, -10") << QPointF(-10, -10);
+}
+
+void tst_QGraphicsItem::setPos()
+{
+ QFETCH(QPointF, pos);
+
+ QGraphicsScene scene;
+ QGraphicsRectItem *rect = scene.addRect(QRectF(0, 0, 100, 100));
+
+ QBENCHMARK {
+ rect->setPos(10, 10);
+ rect->transform(); // prevent lazy optimizing
+ }
+}
+
+void tst_QGraphicsItem::setTransform_data()
+{
+ QTest::addColumn<QTransform>("transform");
+
+ QTest::newRow("id") << QTransform();
+ QTest::newRow("rotate 45z") << QTransform().rotate(45);
+ QTest::newRow("scale 2x2") << QTransform().scale(2, 2);
+ QTest::newRow("translate 100, 100") << QTransform().translate(100, 100);
+ QTest::newRow("rotate 45x 45y 45z") << QTransform().rotate(45, Qt::XAxis)
+ .rotate(45, Qt::YAxis).rotate(45, Qt::ZAxis);
+}
+
+void tst_QGraphicsItem::setTransform()
+{
+ QFETCH(QTransform, transform);
+
+ QGraphicsScene scene;
+ QGraphicsRectItem *item = scene.addRect(QRectF(0, 0, 100, 100));
+
+ QBENCHMARK {
+ item->setTransform(transform);
+ item->transform(); // prevent lazy optimizing
+ }
+}
+
+void tst_QGraphicsItem::rotate()
+{
+ QGraphicsScene scene;
+ QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
+
+ QBENCHMARK {
+ item->rotate(45);
+ item->transform(); // prevent lazy optimizing
+ }
+}
+
+void tst_QGraphicsItem::scale()
+{
+ QGraphicsScene scene;
+ QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
+
+ QBENCHMARK {
+ item->scale(2, 2);
+ item->transform(); // prevent lazy optimizing
+ }
+}
+
+void tst_QGraphicsItem::shear()
+{
+ QGraphicsScene scene;
+ QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
+
+ QBENCHMARK {
+ item->shear(1.5, 1.5);
+ item->transform(); // prevent lazy optimizing
+ }
+}
+
+void tst_QGraphicsItem::translate()
+{
+ QGraphicsScene scene;
+ QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
+
+ QBENCHMARK {
+ item->translate(100, 100);
+ item->transform(); // prevent lazy optimizing
+ }
+}
+
+void tst_QGraphicsItem::setRotation()
+{
+ QGraphicsScene scene;
+ QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
+
+ QBENCHMARK {
+ item->setXRotation(45);
+ item->transform(); // prevent lazy optimizing
+ }
+}
+
+void tst_QGraphicsItem::setRotationXYZ()
+{
+ QGraphicsScene scene;
+ QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
+
+ QBENCHMARK {
+ item->setRotation(45, 45, 45);
+ item->transform(); // prevent lazy optimizing
+ }
+}
+
+QTEST_MAIN(tst_QGraphicsItem)
+#include "tst_qgraphicsitem.moc"
diff --git a/tests/benchmarks/qgraphicsview/images/wine-big.jpeg b/tests/benchmarks/qgraphicsview/images/wine-big.jpeg
new file mode 100644
index 0000000..9900a50
--- /dev/null
+++ b/tests/benchmarks/qgraphicsview/images/wine-big.jpeg
Binary files differ
diff --git a/tests/benchmarks/qgraphicsview/qgraphicsview.qrc b/tests/benchmarks/qgraphicsview/qgraphicsview.qrc
index 5e80029..3681648 100644
--- a/tests/benchmarks/qgraphicsview/qgraphicsview.qrc
+++ b/tests/benchmarks/qgraphicsview/qgraphicsview.qrc
@@ -2,6 +2,7 @@
<qresource>
<file>images/designer.png</file>
<file>images/wine.jpeg</file>
+ <file>images/wine-big.jpeg</file>
<file>random.data</file>
</qresource>
</RCC>
diff --git a/tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp
index a06e033..570f744 100644
--- a/tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp
@@ -124,6 +124,8 @@ private slots:
void textRiver();
void moveItemCache_data();
void moveItemCache();
+ void paintItemCache_data();
+ void paintItemCache();
};
tst_QGraphicsView::tst_QGraphicsView()
@@ -796,5 +798,105 @@ void tst_QGraphicsView::moveItemCache()
}
}
+class UpdatedPixmapCacheItem : public QGraphicsPixmapItem
+{
+public:
+ UpdatedPixmapCacheItem(bool partial, QGraphicsItem *parent = 0)
+ : QGraphicsPixmapItem(parent), partial(partial)
+ {
+ }
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0)
+ {
+ QGraphicsPixmapItem::paint(painter,option,widget);
+ }
+protected:
+ void advance(int i)
+ {
+ if (partial)
+ update(QRectF(boundingRect().center().x(), boundingRect().center().x(), 30, 30));
+ else
+ update();
+ }
+
+private:
+ bool partial;
+};
+
+void tst_QGraphicsView::paintItemCache_data()
+{
+ QTest::addColumn<bool>("updatePartial");
+ QTest::addColumn<bool>("rotation");
+ QTest::addColumn<int>("cacheMode");
+ QTest::newRow("Partial Update : ItemCoordinate Cache") << true << false << (int)QGraphicsItem::ItemCoordinateCache;
+ QTest::newRow("Partial Update : DeviceCoordinate Cache") << true << false << (int)QGraphicsItem::DeviceCoordinateCache;
+ QTest::newRow("Partial Update : No Cache") << true << false << (int)QGraphicsItem::NoCache;
+ QTest::newRow("Full Update : ItemCoordinate Cache") << false << false << (int)QGraphicsItem::ItemCoordinateCache;
+ QTest::newRow("Full Update : DeviceCoordinate Cache") << false << false << (int)QGraphicsItem::DeviceCoordinateCache;
+ QTest::newRow("Full Update : No Cache") << false << false << (int)QGraphicsItem::NoCache;
+ QTest::newRow("Partial Update : ItemCoordinate Cache item rotated") << true << true << (int)QGraphicsItem::ItemCoordinateCache;
+ QTest::newRow("Partial Update : DeviceCoordinate Cache item rotated") << true << true << (int)QGraphicsItem::DeviceCoordinateCache;
+ QTest::newRow("Partial Update : No Cache item rotated") << true << true << (int)QGraphicsItem::NoCache;
+ QTest::newRow("Full Update : ItemCoordinate Cache item rotated") << false << true << (int)QGraphicsItem::ItemCoordinateCache;
+ QTest::newRow("Full Update : DeviceCoordinate Cache item rotated") << false << true << (int)QGraphicsItem::DeviceCoordinateCache;
+ QTest::newRow("Full Update : No Cache item rotated") << false << true <<(int)QGraphicsItem::NoCache;
+}
+
+void tst_QGraphicsView::paintItemCache()
+{
+ QFETCH(bool, updatePartial);
+ QFETCH(bool, rotation);
+ QFETCH(int, cacheMode);
+
+ QGraphicsScene scene(0, 0, 300, 300);
+
+ CountPaintEventView view(&scene);
+ view.resize(600, 600);
+ view.setFrameStyle(0);
+ view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ view.show();
+
+ QPixmap pix(":/images/wine.jpeg");
+ QVERIFY(!pix.isNull());
+
+ QList<QGraphicsItem *> items;
+ QFile file(":/random.data");
+ QVERIFY(file.open(QIODevice::ReadOnly));
+ QDataStream str(&file);
+ UpdatedPixmapCacheItem *item = new UpdatedPixmapCacheItem(updatePartial);
+ item->setPixmap(pix);
+ item->setCacheMode((QGraphicsItem::CacheMode)cacheMode);
+ if (rotation)
+ item->setTransform(QTransform().rotate(45));
+ item->setPos(-100, -100);
+ scene.addItem(item);
+
+ QPixmap pix2(":/images/wine-big.jpeg");
+ item = new UpdatedPixmapCacheItem(updatePartial);
+ item->setPixmap(pix2);
+ item->setCacheMode((QGraphicsItem::CacheMode)cacheMode);
+ if (rotation)
+ item->setTransform(QTransform().rotate(45));
+ item->setPos(0, 0);
+ scene.addItem(item);
+
+ view.count = 0;
+
+ QBENCHMARK {
+#ifdef CALLGRIND_DEBUG
+ CALLGRIND_START_INSTRUMENTATION
+#endif
+ for (int i = 0; i < 50; ++i) {
+ scene.advance();
+ while (view.count < (i+1))
+ qApp->processEvents();
+ }
+#ifdef CALLGRIND_DEBUG
+ CALLGRIND_STOP_INSTRUMENTATION
+#endif
+ }
+}
+
QTEST_MAIN(tst_QGraphicsView)
#include "tst_qgraphicsview.moc"
diff --git a/tests/benchmarks/qstring/main.cpp b/tests/benchmarks/qstring/main.cpp
new file mode 100644
index 0000000..cbbf0a1
--- /dev/null
+++ b/tests/benchmarks/qstring/main.cpp
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QStringList>
+#include <qtest.h>
+
+class tst_QString: public QObject
+{
+ Q_OBJECT
+private slots:
+ void equals() const;
+ void equals_data() const;
+};
+
+void tst_QString::equals() const
+{
+ QFETCH(QString, a);
+ QFETCH(QString, b);
+
+ QBENCHMARK {
+ a == b;
+ }
+}
+
+void tst_QString::equals_data() const
+{
+ static const struct {
+ ushort data[80];
+ int dummy; // just to ensure 4-byte alignment
+ } data = {
+ {
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, // 16
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, // 32
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, // 48
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, // 64
+ 64, 64, 64, 64, 96, 96, 96, 96,
+ 64, 64, 96, 96, 96, 96, 96, 96 // 80
+ }, 0
+ };
+ const QChar *ptr = reinterpret_cast<const QChar *>(data.data);
+
+ QTest::addColumn<QString>("a");
+ QTest::addColumn<QString>("b");
+ QString base = QString::fromRawData(ptr, 64);
+
+ QTest::newRow("different-length") << base << QString::fromRawData(ptr, 4);
+ QTest::newRow("same-string") << base << base;
+ QTest::newRow("same-data") << base << QString::fromRawData(ptr, 64);
+
+ // try to avoid crossing a cache line (that is, at ptr[64])
+ QTest::newRow("aligned-aligned-4n")
+ << QString::fromRawData(ptr, 60) << QString::fromRawData(ptr + 2, 60);
+ QTest::newRow("aligned-unaligned-4n")
+ << QString::fromRawData(ptr, 60) << QString::fromRawData(ptr + 1, 60);
+ QTest::newRow("unaligned-unaligned-4n")
+ << QString::fromRawData(ptr + 1, 60) << QString::fromRawData(ptr + 3, 60);
+
+ QTest::newRow("aligned-aligned-4n+1")
+ << QString::fromRawData(ptr, 61) << QString::fromRawData(ptr + 2, 61);
+ QTest::newRow("aligned-unaligned-4n+1")
+ << QString::fromRawData(ptr, 61) << QString::fromRawData(ptr + 1, 61);
+ QTest::newRow("unaligned-unaligned-4n+1")
+ << QString::fromRawData(ptr + 1, 61) << QString::fromRawData(ptr + 3, 61);
+
+ QTest::newRow("aligned-aligned-4n-1")
+ << QString::fromRawData(ptr, 59) << QString::fromRawData(ptr + 2, 59);
+ QTest::newRow("aligned-unaligned-4n-1")
+ << QString::fromRawData(ptr, 59) << QString::fromRawData(ptr + 1, 59);
+ QTest::newRow("unaligned-unaligned-4n-1")
+ << QString::fromRawData(ptr + 1, 59) << QString::fromRawData(ptr + 3, 59);
+
+ QTest::newRow("aligned-aligned-2n")
+ << QString::fromRawData(ptr, 58) << QString::fromRawData(ptr + 2, 58);
+ QTest::newRow("aligned-unaligned-2n")
+ << QString::fromRawData(ptr, 58) << QString::fromRawData(ptr + 1, 58);
+ QTest::newRow("unaligned-unaligned-2n")
+ << QString::fromRawData(ptr + 1, 58) << QString::fromRawData(ptr + 3, 58);
+}
+
+QTEST_MAIN(tst_QString)
+
+#include "main.moc"
diff --git a/tests/benchmarks/qstring/qstring.pro b/tests/benchmarks/qstring/qstring.pro
new file mode 100644
index 0000000..74423e7
--- /dev/null
+++ b/tests/benchmarks/qstring/qstring.pro
@@ -0,0 +1,4 @@
+load(qttest_p4)
+TARGET = tst_qstring
+QT -= gui
+SOURCES += main.cpp
diff --git a/tests/benchmarks/qstringbuilder/main.cpp b/tests/benchmarks/qstringbuilder/main.cpp
new file mode 100644
index 0000000..8eb4e78
--- /dev/null
+++ b/tests/benchmarks/qstringbuilder/main.cpp
@@ -0,0 +1,304 @@
+
+#include "qstringbuilder.h"
+
+#include <QDebug>
+#include <QString>
+
+#include <qtest.h>
+
+
+#define COMPARE(a, b) QCOMPARE(a, b)
+//#define COMPARE(a, b)
+
+#define SEP(s) qDebug() << "\n\n-------- " s " ---------";
+#define L(s) QLatin1String(s)
+
+class tst_qstringbuilder : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_qstringbuilder()
+ : l1literal("some string literal"),
+ l1string("some string literal"),
+ ba("some string literal"),
+ string(l1string),
+ stringref(&string, 2, 10),
+ achar('c')
+ {}
+
+
+public:
+ enum { N = 10000 };
+
+ int run_traditional()
+ {
+ int s = 0;
+ for (int i = 0; i < N; ++i) {
+#if 0
+ s += QString(l1string + l1string).size();
+ s += QString(l1string + l1string + l1string).size();
+ s += QString(l1string + l1string + l1string + l1string).size();
+ s += QString(l1string + l1string + l1string + l1string + l1string).size();
+#endif
+ s += QString(achar + l1string + achar).size();
+ }
+ return s;
+ }
+
+ int run_builder()
+ {
+ int s = 0;
+ for (int i = 0; i < N; ++i) {
+#if 0
+ s += QString(l1literal % l1literal).size();
+ s += QString(l1literal % l1literal % l1literal).size();
+ s += QString(l1literal % l1literal % l1literal % l1literal).size();
+ s += QString(l1literal % l1literal % l1literal % l1literal % l1literal).size();
+#endif
+ s += QString(achar % l1literal % achar).size();
+ }
+ return s;
+ }
+
+private slots:
+
+ void separator_0() {
+ qDebug() << "\nIn each block the QStringBuilder based result appear first, "
+ "QStringBased second.\n";
+ }
+
+ void separator_1() { SEP("literal + literal (builder first)"); }
+
+ void b_2_l1literal() {
+ QBENCHMARK { r = l1literal % l1literal; }
+ COMPARE(r, QString(l1string + l1string));
+ }
+ void s_2_l1string() {
+ QBENCHMARK { r = l1string + l1string; }
+ COMPARE(r, QString(l1literal % l1literal));
+ }
+
+
+ void separator_2() { SEP("2 strings"); }
+
+ void b_2_string() {
+ QBENCHMARK { r = string % string; }
+ COMPARE(r, QString(string + string));
+ }
+ void s_2_string() {
+ QBENCHMARK { r = string + string; }
+ COMPARE(r, QString(string % string));
+ }
+
+
+ void separator_2c() { SEP("2 string refs"); }
+
+ void b_2_stringref() {
+ QBENCHMARK { r = stringref % stringref; }
+ COMPARE(r, QString(stringref.toString() + stringref.toString()));
+ }
+ void s_2_stringref() {
+ QBENCHMARK { r = stringref.toString() + stringref.toString(); }
+ COMPARE(r, QString(stringref % stringref));
+ }
+
+
+ void separator_2b() { SEP("3 strings"); }
+
+ void b_3_string() {
+ QBENCHMARK { r = string % string % string; }
+ COMPARE(r, QString(string + string + string));
+ }
+ void s_3_string() {
+ QBENCHMARK { r = string + string + string; }
+ COMPARE(r, QString(string % string % string));
+ }
+
+
+ void separator_2a() { SEP("string + literal (builder first)"); }
+
+ void b_string_l1literal() {
+ QBENCHMARK { r = string % l1literal; }
+ COMPARE(r, QString(string + l1string));
+ }
+ void b_string_l1string() {
+ QBENCHMARK { r = string % l1string; }
+ COMPARE(r, QString(string + l1string));
+ }
+ void s_string_l1literal() {
+ QBENCHMARK { r = string + l1string; }
+ COMPARE(r, QString(string % l1literal));
+ }
+ void s_string_l1string() {
+ QBENCHMARK { r = string + l1string; }
+ COMPARE(r, QString(string % l1literal));
+ }
+
+
+ void separator_3() { SEP("3 literals"); }
+
+ void b_3_l1literal() {
+ QBENCHMARK { r = l1literal % l1literal % l1literal; }
+ COMPARE(r, QString(l1string + l1string + l1string));
+ }
+ void s_3_l1string() {
+ QBENCHMARK { r = l1string + l1string + l1string; }
+ COMPARE(r, QString(l1literal % l1literal % l1literal));
+ }
+
+
+ void separator_4() { SEP("4 literals"); }
+
+ void b_4_l1literal() {
+ QBENCHMARK { r = l1literal % l1literal % l1literal % l1literal; }
+ COMPARE(r, QString(l1string + l1string + l1string + l1string));
+ }
+ void s_4_l1string() {
+ QBENCHMARK { r = l1string + l1string + l1string + l1string; }
+ COMPARE(r, QString(l1literal % l1literal % l1literal % l1literal));
+ }
+
+
+ void separator_5() { SEP("5 literals"); }
+
+ void b_5_l1literal() {
+ QBENCHMARK { r = l1literal % l1literal % l1literal % l1literal %l1literal; }
+ COMPARE(r, QString(l1string + l1string + l1string + l1string + l1string));
+ }
+
+ void s_5_l1string() {
+ QBENCHMARK { r = l1string + l1string + l1string + l1string + l1string; }
+ COMPARE(r, QString(l1literal % l1literal % l1literal % l1literal % l1literal));
+ }
+
+
+ void separator_6() { SEP("4 chars"); }
+
+ void b_string_4_char() {
+ QBENCHMARK { r = string + achar + achar + achar + achar; }
+ COMPARE(r, QString(string % achar % achar % achar % achar));
+ }
+
+ void s_string_4_char() {
+ QBENCHMARK { r = string + achar + achar + achar + achar; }
+ COMPARE(r, QString(string % achar % achar % achar % achar));
+ }
+
+
+ void separator_7() { SEP("char + string + char"); }
+
+ void b_char_string_char() {
+ QBENCHMARK { r = achar + string + achar; }
+ COMPARE(r, QString(achar % string % achar));
+ }
+
+ void s_char_string_char() {
+ QBENCHMARK { r = achar + string + achar; }
+ COMPARE(r, QString(achar % string % achar));
+ }
+
+ void separator_8() { SEP("string.arg"); }
+
+ void b_string_arg() {
+ const QString pattern = l1string + QLatin1String("%1") + l1string;
+ QBENCHMARK { r = l1literal % string % l1literal; }
+ COMPARE(r, QString(l1string + string + l1string));
+ }
+
+ void s_string_arg() {
+ const QString pattern = l1string + QLatin1String("%1") + l1string;
+ QBENCHMARK { r = pattern.arg(string); }
+ COMPARE(r, QString(l1string + string + l1string));
+ }
+
+ void s_bytearray_arg() {
+ QByteArray result;
+ QBENCHMARK { result = ba + ba + ba; }
+ }
+
+
+ void separator_9() { SEP("QString::reserve()"); }
+
+ void b_reserve() {
+ QBENCHMARK {
+ r.clear();
+ r = string % string % string % string;
+ }
+ COMPARE(r, QString(string + string + string + string));
+ }
+ void b_reserve_lit() {
+ QBENCHMARK {
+ r.clear();
+ r = string % l1literal % string % string;
+ }
+ COMPARE(r, QString(string + string + string + string));
+ }
+ void s_reserve() {
+ QBENCHMARK {
+ r.clear();
+ r.reserve(string.size() + string.size() + string.size() + string.size());
+ r += string;
+ r += string;
+ r += string;
+ r += string;
+ }
+ COMPARE(r, QString(string + string + string + string));
+ }
+ void s_reserve_lit() {
+ QBENCHMARK {
+ r.clear();
+ //r.reserve(string.size() + qstrlen(l1string.latin1())
+ // + string.size() + string.size());
+ r.reserve(1024);
+ r += string;
+ r += l1string;
+ r += string;
+ r += string;
+ }
+ COMPARE(r, QString(string + string + string + string));
+ }
+
+private:
+ const QLatin1Literal l1literal;
+ const QLatin1String l1string;
+ const QByteArray ba;
+ const QString string;
+ const QStringRef stringref;
+ const QLatin1Char achar;
+
+ QString r;
+};
+
+
+//void operator%(QString, int) {}
+
+int main(int argc, char *argv[])
+{
+ //qDebug() << (QString("xx") * QLatin1String("y")).toString();
+ //42 % 3; // Sanity test, should always work.
+ //QString("x") % 2; // Sanity test, should only compile when the
+ // operator%(QString, int) is visible.
+
+ if (argc == 2 && (argv[1] == L("--run-builder") || argv[1] == L("-b"))) {
+ tst_qstringbuilder test;
+ return test.run_builder();
+ }
+
+ if (argc == 2 && (argv[1] == L("--run-traditional") || argv[1] == L("-t"))) {
+ tst_qstringbuilder test;
+ return test.run_traditional();
+ }
+
+ if (argc == 1) {
+ QCoreApplication app(argc, argv);
+ QStringList args = app.arguments();
+ tst_qstringbuilder test;
+ return QTest::qExec(&test, argc, argv);
+ }
+
+ qDebug() << "Usage: " << argv[0] << " [--run-builder|-r|--run-traditional|-t]";
+}
+
+
+#include "main.moc"
diff --git a/tests/benchmarks/qstringbuilder/qstringbuilder.pro b/tests/benchmarks/qstringbuilder/qstringbuilder.pro
new file mode 100644
index 0000000..02daaaa
--- /dev/null
+++ b/tests/benchmarks/qstringbuilder/qstringbuilder.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_qstringbuilder
+
+# Uncomment to test compilation of the drop-in
+# replacement operator+()
+#DEFINES += QT_USE_FAST_OPERATOR_PLUS
+
+QMAKE_CXXFLAGS += -g
+QMAKE_CFLAGS += -g
+
+QT -= gui
+
+CONFIG += release
+
+SOURCES += main.cpp
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp
index b78f346..52d48d5 100644
--- a/tools/assistant/tools/assistant/centralwidget.cpp
+++ b/tools/assistant/tools/assistant/centralwidget.cpp
@@ -87,6 +87,7 @@ namespace {
FindWidget::FindWidget(QWidget *parent)
: QWidget(parent)
+ , appPalette(qApp->palette())
{
QHBoxLayout *hboxLayout = new QHBoxLayout(this);
QString resourcePath = QLatin1String(":/trolltech/assistant/images/");
@@ -148,6 +149,34 @@ FindWidget::~FindWidget()
{
}
+void FindWidget::hideEvent(QHideEvent* event)
+{
+#if !defined(QT_NO_WEBKIT)
+ // TODO: remove this once webkit supports setting the palette
+ if (!event->spontaneous())
+ qApp->setPalette(appPalette);
+#else
+ Q_UNUSED(event);
+#endif
+}
+
+void FindWidget::showEvent(QShowEvent* event)
+{
+#if !defined(QT_NO_WEBKIT)
+ // TODO: remove this once webkit supports setting the palette
+ if (!event->spontaneous()) {
+ QPalette p = appPalette;
+ p.setColor(QPalette::Inactive, QPalette::Highlight,
+ p.color(QPalette::Active, QPalette::Highlight));
+ p.setColor(QPalette::Inactive, QPalette::HighlightedText,
+ p.color(QPalette::Active, QPalette::HighlightedText));
+ qApp->setPalette(p);
+ }
+#else
+ Q_UNUSED(event);
+#endif
+}
+
void FindWidget::updateButtons()
{
if (editFind->text().isEmpty()) {
@@ -245,12 +274,14 @@ CentralWidget::CentralWidget(QHelpEngine *engine, MainWindow *parent)
SLOT(showTabBarContextMenu(QPoint)));
}
- QPalette p = qApp->palette();
+#if defined(QT_NO_WEBKIT)
+ QPalette p = palette();
p.setColor(QPalette::Inactive, QPalette::Highlight,
p.color(QPalette::Active, QPalette::Highlight));
p.setColor(QPalette::Inactive, QPalette::HighlightedText,
p.color(QPalette::Active, QPalette::HighlightedText));
- qApp->setPalette(p);
+ setPalette(p);
+#endif
}
CentralWidget::~CentralWidget()
@@ -848,60 +879,64 @@ void CentralWidget::keyPressEvent(QKeyEvent *e)
QWidget::keyPressEvent(e);
}
-void CentralWidget::find(QString ttf, bool forward, bool backward)
+void CentralWidget::find(const QString &ttf, bool forward, bool backward)
{
- QTextCursor cursor;
- QTextDocument *doc = 0;
- QTextBrowser *browser = 0;
-
- HelpViewer *viewer = currentHelpViewer();
QPalette p = findWidget->editFind->palette();
p.setColor(QPalette::Active, QPalette::Base, Qt::white);
-#if !defined(QT_NO_WEBKIT)
- Q_UNUSED(forward)
- Q_UNUSED(doc)
- Q_UNUSED(browser)
-
- if (viewer) {
- QWebPage::FindFlags options;
- if (backward)
- options |= QWebPage::FindBackward;
+ if (!ttf.isEmpty()) {
+ HelpViewer *viewer = currentHelpViewer();
- if (findWidget->checkCase->isChecked())
- options |= QWebPage::FindCaseSensitively;
+ bool found = false;
+#if !defined(QT_NO_WEBKIT)
+ if (viewer) {
+ QWebPage::FindFlags options;
+ if (backward)
+ options |= QWebPage::FindBackward;
- bool found = viewer->findText(ttf, options);
- findWidget->labelWrapped->hide();
+ if (findWidget->checkCase->isChecked())
+ options |= QWebPage::FindCaseSensitively;
- if (!found) {
- options |= QWebPage::FindWrapsAroundDocument;
found = viewer->findText(ttf, options);
+ findWidget->labelWrapped->hide();
if (!found) {
- p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102));
- } else {
- findWidget->labelWrapped->show();
+ options |= QWebPage::FindWrapsAroundDocument;
+ found = viewer->findText(ttf, options);
+ if (found)
+ findWidget->labelWrapped->show();
}
+ } else if (tabWidget->currentWidget() == m_searchWidget) {
+ QTextBrowser *browser = qFindChild<QTextBrowser*>(m_searchWidget);
+ found = findInTextBrowser(browser, ttf, forward, backward);
}
- }
#else
- if (viewer) {
- doc = viewer->document();
- cursor = viewer->textCursor();
- browser = qobject_cast<QTextBrowser*>(viewer);
- }
+ QTextBrowser *browser = qobject_cast<QTextBrowser*>(viewer);
+ if (tabWidget->currentWidget() == m_searchWidget)
+ browser = qFindChild<QTextBrowser*>(m_searchWidget);
+ found = findInTextBrowser(browser, ttf, forward, backward);
+#endif
- if (tabWidget->currentWidget() == m_searchWidget) {
- QTextBrowser *browser = qFindChild<QTextBrowser*>(m_searchWidget);
- if (browser) {
- doc = browser->document();
- cursor = browser->textCursor();
- }
+ if (!found)
+ p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102));
}
- if (!browser || !doc || cursor.isNull())
- return;
+ if (!findWidget->isVisible())
+ findWidget->show();
+ findWidget->editFind->setPalette(p);
+}
+
+bool CentralWidget::findInTextBrowser(QTextBrowser* browser, const QString &ttf,
+ bool forward, bool backward)
+{
+ if (!browser)
+ return false;
+
+ QTextDocument *doc = browser->document();
+ QTextCursor cursor = browser->textCursor();
+
+ if (!doc || cursor.isNull())
+ return false;
QTextDocument::FindFlags options;
@@ -910,44 +945,33 @@ void CentralWidget::find(QString ttf, bool forward, bool backward)
QTextCursor::MoveAnchor);
}
- QTextCursor newCursor = cursor;
+ if (backward)
+ options |= QTextDocument::FindBackward;
- if (!ttf.isEmpty()) {
- if (backward)
- options |= QTextDocument::FindBackward;
-
- if (findWidget->checkCase->isChecked())
- options |= QTextDocument::FindCaseSensitively;
+ if (findWidget->checkCase->isChecked())
+ options |= QTextDocument::FindCaseSensitively;
- if (findWidget->checkWholeWords->isChecked())
- options |= QTextDocument::FindWholeWords;
+ if (findWidget->checkWholeWords->isChecked())
+ options |= QTextDocument::FindWholeWords;
- newCursor = doc->find(ttf, cursor, options);
- findWidget->labelWrapped->hide();
+ findWidget->labelWrapped->hide();
+ bool found = true;
+ QTextCursor newCursor = doc->find(ttf, cursor, options);
+ if (newCursor.isNull()) {
+ QTextCursor ac(doc);
+ ac.movePosition(options & QTextDocument::FindBackward
+ ? QTextCursor::End : QTextCursor::Start);
+ newCursor = doc->find(ttf, ac, options);
if (newCursor.isNull()) {
- QTextCursor ac(doc);
- ac.movePosition(options & QTextDocument::FindBackward
- ? QTextCursor::End : QTextCursor::Start);
- newCursor = doc->find(ttf, ac, options);
- if (newCursor.isNull()) {
- p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102));
- newCursor = cursor;
- } else {
- findWidget->labelWrapped->show();
- }
+ found = false;
+ newCursor = cursor;
+ } else {
+ findWidget->labelWrapped->show();
}
}
-#endif
-
- if (!findWidget->isVisible())
- findWidget->show();
-
-#if defined(QT_NO_WEBKIT)
- if (browser)
- browser->setTextCursor(newCursor);
-#endif
- findWidget->editFind->setPalette(p);
+ browser->setTextCursor(newCursor);
+ return found;
}
void CentralWidget::updateBrowserFont()
diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h
index e3ce200..d59dbe5 100644
--- a/tools/assistant/tools/assistant/centralwidget.h
+++ b/tools/assistant/tools/assistant/centralwidget.h
@@ -55,6 +55,7 @@ class QLabel;
class QAction;
class QCheckBox;
class QLineEdit;
+class QTextBrowser;
class QToolButton;
class HelpViewer;
@@ -79,6 +80,10 @@ signals:
void findNext();
void findPrevious();
+protected:
+ void hideEvent(QHideEvent* event);
+ void showEvent(QShowEvent * event);
+
private slots:
void updateButtons();
@@ -94,6 +99,7 @@ private:
QToolButton *toolPrevious;
QCheckBox *checkWholeWords;
+ QPalette appPalette;
friend class CentralWidget;
};
@@ -176,7 +182,9 @@ private slots:
private:
void connectSignals();
bool eventFilter(QObject *object, QEvent *e);
- void find(QString ttf, bool forward, bool backward);
+ void find(const QString &ttf, bool forward, bool backward);
+ bool findInTextBrowser(QTextBrowser* browser, const QString &ttf,
+ bool forward, bool backward);
void initPrinter();
QString quoteTabTitle(const QString &title) const;
void highlightSearchTerms();
diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp
index 75955ec..f63cc65 100644
--- a/tools/assistant/tools/assistant/main.cpp
+++ b/tools/assistant/tools/assistant/main.cpp
@@ -230,7 +230,7 @@ int main(int argc, char *argv[])
if (file.isEmpty())
file = MainWindow::defaultHelpCollectionFileName();
QString path = QFileInfo(file).path();
- path += QLatin1String("/") + indexFilesFolder(file);
+ path += QLatin1Char('/') + indexFilesFolder(file);
QLocalSocket localSocket;
localSocket.connectToServer(QString(QLatin1String("QtAssistant%1"))
diff --git a/tools/assistant/translations/qt_help.pro b/tools/assistant/translations/qt_help.pro
index efad6bf..e6208a6 100644
--- a/tools/assistant/translations/qt_help.pro
+++ b/tools/assistant/translations/qt_help.pro
@@ -44,5 +44,6 @@ TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/qt_help_de.ts \
$$[QT_INSTALL_TRANSLATIONS]/qt_help_pl.ts \
$$[QT_INSTALL_TRANSLATIONS]/qt_help_untranslated.ts \
$$[QT_INSTALL_TRANSLATIONS]/qt_help_zh_CN.ts \
- $$[QT_INSTALL_TRANSLATIONS]/qt_help_zh_TW.ts
+ $$[QT_INSTALL_TRANSLATIONS]/qt_help_zh_TW.ts \
+ $$[QT_INSTALL_TRANSLATIONS]/qt_help_da.ts
error("This is a dummy profile to be used for translations ONLY.")
diff --git a/tools/assistant/translations/translations.pro b/tools/assistant/translations/translations.pro
index 58de554..8572123 100644
--- a/tools/assistant/translations/translations.pro
+++ b/tools/assistant/translations/translations.pro
@@ -45,4 +45,5 @@ TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/assistant_de.ts \
$$[QT_INSTALL_TRANSLATIONS]/assistant_pl.ts \
$$[QT_INSTALL_TRANSLATIONS]/assistant_untranslated.ts \
$$[QT_INSTALL_TRANSLATIONS]/assistant_zh_CN.ts \
- $$[QT_INSTALL_TRANSLATIONS]/assistant_zh_TW.ts
+ $$[QT_INSTALL_TRANSLATIONS]/assistant_zh_TW.ts \
+ $$[QT_INSTALL_TRANSLATIONS]/assistant_da.ts
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 02bb744..8c2405e 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -1325,6 +1325,7 @@ void Configure::applySpecSpecifics()
dictionary[ "WEBKIT" ] = "no";
dictionary[ "PHONON" ] = "yes";
dictionary[ "DIRECTSHOW" ] = "no";
+ dictionary[ "LTCG" ] = "yes";
// We only apply MMX/IWMMXT for mkspecs we know they work
if (dictionary[ "XQMAKESPEC" ].startsWith("wincewm")) {
dictionary[ "MMX" ] = "yes";
diff --git a/tools/designer/src/components/formeditor/formwindow.cpp b/tools/designer/src/components/formeditor/formwindow.cpp
index 07d785a..66bab9b 100644
--- a/tools/designer/src/components/formeditor/formwindow.cpp
+++ b/tools/designer/src/components/formeditor/formwindow.cpp
@@ -2136,7 +2136,10 @@ void FormWindow::layoutContainer(QWidget *w, int type)
bool FormWindow::hasInsertedChildren(QWidget *widget) const // ### move
{
if (QDesignerContainerExtension *container = qt_extension<QDesignerContainerExtension*>(core()->extensionManager(), widget)) {
- widget = container->widget(container->currentIndex());
+ const int index = container->currentIndex();
+ if (index < 0)
+ return false;
+ widget = container->widget(index);
}
const QWidgetList l = widgets(widget);
diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.cpp b/tools/designer/src/components/formeditor/qdesigner_resource.cpp
index 75a53b7..f94fb5c 100644
--- a/tools/designer/src/components/formeditor/qdesigner_resource.cpp
+++ b/tools/designer/src/components/formeditor/qdesigner_resource.cpp
@@ -159,6 +159,7 @@ private:
QDesignerFormEditorInterface *m_core;
DesignerPixmapCache *m_pixmapCache;
DesignerIconCache *m_iconCache;
+ const QDesignerLanguageExtension *m_lang;
bool m_saveRelative;
mutable QMap<QString, bool> m_usedQrcFiles;
mutable QMap<QString, bool> m_loadedQrcFiles;
@@ -168,13 +169,18 @@ QDesignerResourceBuilder::QDesignerResourceBuilder(QDesignerFormEditorInterface
m_core(core),
m_pixmapCache(pixmapCache),
m_iconCache(iconCache),
+ m_lang(qt_extension<QDesignerLanguageExtension *>(core->extensionManager(), core)),
m_saveRelative(true)
{
}
-static inline void setIconPixmap(QIcon::Mode m, QIcon::State s, const QDir &workingDirectory, const QString &v, PropertySheetIconValue &icon)
+static inline void setIconPixmap(QIcon::Mode m, QIcon::State s, const QDir &workingDirectory,
+ QString path, PropertySheetIconValue &icon,
+ const QDesignerLanguageExtension *lang = 0)
{
- icon.setPixmap(m, s, PropertySheetPixmapValue(QFileInfo(workingDirectory, v).absoluteFilePath()));
+ if (lang == 0 || !lang->isLanguageResource(path))
+ path = QFileInfo(workingDirectory, path).absoluteFilePath();
+ icon.setPixmap(m, s, PropertySheetPixmapValue(path));
}
QVariant QDesignerResourceBuilder::loadResource(const QDir &workingDirectory, const DomProperty *property) const
@@ -184,7 +190,11 @@ QVariant QDesignerResourceBuilder::loadResource(const QDir &workingDirectory, co
PropertySheetPixmapValue pixmap;
DomResourcePixmap *dp = property->elementPixmap();
if (!dp->text().isEmpty()) {
- pixmap.setPath(QFileInfo(workingDirectory, dp->text()).absoluteFilePath());
+ if (m_lang != 0 && m_lang->isLanguageResource(dp->text())) {
+ pixmap.setPath(dp->text());
+ } else {
+ pixmap.setPath(QFileInfo(workingDirectory, dp->text()).absoluteFilePath());
+ }
#ifdef OLD_RESOURCE_FORMAT
if (dp->hasAttributeResource())
m_loadedQrcFiles.insert(QFileInfo(workingDirectory, dp->attributeResource()).absoluteFilePath(), false);
@@ -198,24 +208,24 @@ QVariant QDesignerResourceBuilder::loadResource(const QDir &workingDirectory, co
DomResourceIcon *di = property->elementIconSet();
if (const int flags = iconStateFlags(di)) { // new, post 4.4 format
if (flags & NormalOff)
- setIconPixmap(QIcon::Normal, QIcon::Off, workingDirectory, di->elementNormalOff()->text(), icon);
+ setIconPixmap(QIcon::Normal, QIcon::Off, workingDirectory, di->elementNormalOff()->text(), icon, m_lang);
if (flags & NormalOn)
- setIconPixmap(QIcon::Normal, QIcon::On, workingDirectory, di->elementNormalOn()->text(), icon);
+ setIconPixmap(QIcon::Normal, QIcon::On, workingDirectory, di->elementNormalOn()->text(), icon, m_lang);
if (flags & DisabledOff)
- setIconPixmap(QIcon::Disabled, QIcon::Off, workingDirectory, di->elementDisabledOff()->text(), icon);
+ setIconPixmap(QIcon::Disabled, QIcon::Off, workingDirectory, di->elementDisabledOff()->text(), icon, m_lang);
if (flags & DisabledOn)
- setIconPixmap(QIcon::Disabled, QIcon::On, workingDirectory, di->elementDisabledOn()->text(), icon);
+ setIconPixmap(QIcon::Disabled, QIcon::On, workingDirectory, di->elementDisabledOn()->text(), icon, m_lang);
if (flags & ActiveOff)
- setIconPixmap(QIcon::Active, QIcon::Off, workingDirectory, di->elementActiveOff()->text(), icon);
+ setIconPixmap(QIcon::Active, QIcon::Off, workingDirectory, di->elementActiveOff()->text(), icon, m_lang);
if (flags & ActiveOn)
- setIconPixmap(QIcon::Active, QIcon::On, workingDirectory, di->elementActiveOn()->text(), icon);
+ setIconPixmap(QIcon::Active, QIcon::On, workingDirectory, di->elementActiveOn()->text(), icon, m_lang);
if (flags & SelectedOff)
- setIconPixmap(QIcon::Selected, QIcon::Off, workingDirectory, di->elementSelectedOff()->text(), icon);
+ setIconPixmap(QIcon::Selected, QIcon::Off, workingDirectory, di->elementSelectedOff()->text(), icon, m_lang);
if (flags & SelectedOn)
- setIconPixmap(QIcon::Selected, QIcon::On, workingDirectory, di->elementSelectedOn()->text(), icon);
+ setIconPixmap(QIcon::Selected, QIcon::On, workingDirectory, di->elementSelectedOn()->text(), icon, m_lang);
} else {
#ifdef OLD_RESOURCE_FORMAT
- setIconPixmap(QIcon::Normal, QIcon::Off, workingDirectory, di->text(), icon);
+ setIconPixmap(QIcon::Normal, QIcon::Off, workingDirectory, di->text(), icon, m_lang);
if (di->hasAttributeResource())
m_loadedQrcFiles.insert(QFileInfo(workingDirectory, di->attributeResource()).absoluteFilePath(), false);
#endif
@@ -743,26 +753,6 @@ void QDesignerResource::setSaveRelative(bool relative)
m_resourceBuilder->setSaveRelative(relative);
}
-static bool addFakeMethods(const DomSlots *domSlots, QStringList &fakeSlots, QStringList &fakeSignals)
-{
- if (!domSlots)
- return false;
-
- bool rc = false;
- foreach (const QString &fakeSlot, domSlots->elementSlot())
- if (fakeSlots.indexOf(fakeSlot) == -1) {
- fakeSlots += fakeSlot;
- rc = true;
- }
-
- foreach (const QString &fakeSignal, domSlots->elementSignal())
- if (fakeSignals.indexOf(fakeSignal) == -1) {
- fakeSignals += fakeSignal;
- rc = true;
- }
- return rc;
-}
-
QWidget *QDesignerResource::create(DomUI *ui, QWidget *parentWidget)
{
// Load extra info extension. This is used by Jambi for preventing
@@ -1425,108 +1415,9 @@ DomLayoutItem *QDesignerResource::createDom(QLayoutItem *item, DomLayout *ui_lay
return ui_item;
}
-static void addFakeMethodsToWidgetDataBase(const DomCustomWidget *domCustomWidget, WidgetDataBaseItem *item)
-{
- const DomSlots *domSlots = domCustomWidget->elementSlots();
- if (!domSlots)
- return;
-
- // Merge in new slots, signals
- QStringList fakeSlots = item->fakeSlots();
- QStringList fakeSignals = item->fakeSignals();
- if (addFakeMethods(domSlots, fakeSlots, fakeSignals)) {
- item->setFakeSlots(fakeSlots);
- item->setFakeSignals(fakeSignals);
- }
-}
-
-void QDesignerResource::addCustomWidgetsToWidgetDatabase(DomCustomWidgetList& custom_widget_list)
-{
- // Perform one iteration of adding the custom widgets to the database,
- // looking up the base class and inheriting its data.
- // Remove the succeeded custom widgets from the list.
- // Classes whose base class could not be found are left in the list.
- QDesignerWidgetDataBaseInterface *db = m_formWindow->core()->widgetDataBase();
- for (int i=0; i < custom_widget_list.size(); ) {
- bool classInserted = false;
- DomCustomWidget *custom_widget = custom_widget_list[i];
- const QString customClassName = custom_widget->elementClass();
- const QString base_class = custom_widget->elementExtends();
- QString includeFile;
- IncludeType includeType = IncludeLocal;
- if (const DomHeader *header = custom_widget->elementHeader()) {
- includeFile = header->text();
- if (header->hasAttributeLocation() && header->attributeLocation() == QLatin1String("global"))
- includeType = IncludeGlobal;
- }
- const bool domIsContainer = custom_widget->elementContainer();
- // Append a new item
- if (base_class.isEmpty()) {
- WidgetDataBaseItem *item = new WidgetDataBaseItem(customClassName);
- item->setPromoted(false);
- item->setGroup(QApplication::translate("Designer", "Custom Widgets"));
- item->setIncludeFile(buildIncludeFile(includeFile, includeType));
- item->setContainer(domIsContainer);
- item->setCustom(true);
- addFakeMethodsToWidgetDataBase(custom_widget, item);
- db->append(item);
- custom_widget_list.removeAt(i);
- classInserted = true;
- } else {
- // Create a new entry cloned from base class. Note that this will ignore existing
- // classes, eg, plugin custom widgets.
- QDesignerWidgetDataBaseItemInterface *item =
- appendDerived(db, customClassName, QApplication::translate("Designer", "Promoted Widgets"),
- base_class,
- buildIncludeFile(includeFile, includeType),
- true,true);
- // Ok, base class found.
- if (item) {
- // Hack to accommodate for old UI-files in which "contains" is not set properly:
- // Apply "contains" from DOM only if true (else, eg classes from QFrame might not accept
- // dropping child widgets on them as container=false). This also allows for
- // QWidget-derived stacked pages.
- if (domIsContainer)
- item->setContainer(domIsContainer);
-
- addFakeMethodsToWidgetDataBase(custom_widget, static_cast<WidgetDataBaseItem*>(item));
- custom_widget_list.removeAt(i);
- classInserted = true;
- }
- }
- // Skip failed item.
- if (!classInserted)
- i++;
- }
-
-}
void QDesignerResource::createCustomWidgets(DomCustomWidgets *dom_custom_widgets)
{
- if (dom_custom_widgets == 0)
- return;
- DomCustomWidgetList custom_widget_list = dom_custom_widgets->elementCustomWidget();
- // Attempt to insert each item derived from its base class.
- // This should at most require two iterations in the event that the classes are out of order
- // (derived first, max depth: promoted custom plugin = 2)
- for (int iteration = 0; iteration < 2; iteration++) {
- addCustomWidgetsToWidgetDatabase(custom_widget_list);
- if (custom_widget_list.empty())
- return;
- }
- // Oops, there are classes left whose base class could not be found.
- // Default them to QWidget with warnings.
- const QString fallBackBaseClass = QLatin1String("QWidget");
- for (int i=0; i < custom_widget_list.size(); i++ ) {
- DomCustomWidget *custom_widget = custom_widget_list[i];
- const QString customClassName = custom_widget->elementClass();
- const QString base_class = custom_widget->elementExtends();
- qDebug() << "** WARNING The base class " << base_class << " of the custom widget class " << customClassName
- << " could not be found. Defaulting to " << fallBackBaseClass << '.';
- custom_widget->setElementExtends(fallBackBaseClass);
- }
- // One more pass.
- addCustomWidgetsToWidgetDatabase(custom_widget_list);
- Q_ASSERT(custom_widget_list.empty());
+ QSimpleResource::handleDomCustomWidgets(core(), dom_custom_widgets);
}
DomTabStops *QDesignerResource::saveTabStops()
diff --git a/tools/designer/src/lib/shared/newformwidget.cpp b/tools/designer/src/lib/shared/newformwidget.cpp
index d79d77a..503e597 100644
--- a/tools/designer/src/lib/shared/newformwidget.cpp
+++ b/tools/designer/src/lib/shared/newformwidget.cpp
@@ -310,9 +310,8 @@ QImage NewFormWidget::grabForm(QDesignerFormEditorInterface *core,
const QString &workingDir,
const qdesigner_internal::DeviceProfile &dp)
{
- qdesigner_internal::QDesignerFormBuilder formBuilder(core,
- qdesigner_internal::QDesignerFormBuilder::DisableScripts,
- dp);
+ qdesigner_internal::NewFormWidgetFormBuilder
+ formBuilder(core, qdesigner_internal::QDesignerFormBuilder::DisableScripts, dp);
if (!workingDir.isEmpty())
formBuilder.setWorkingDirectory(workingDir);
diff --git a/tools/designer/src/lib/shared/qdesigner_formbuilder.cpp b/tools/designer/src/lib/shared/qdesigner_formbuilder.cpp
index 6394847..b92a48d 100644
--- a/tools/designer/src/lib/shared/qdesigner_formbuilder.cpp
+++ b/tools/designer/src/lib/shared/qdesigner_formbuilder.cpp
@@ -473,6 +473,20 @@ QPixmap QDesignerFormBuilder::createPreviewPixmap(const QDesignerFormWindowInter
return rc;
}
+// ---------- NewFormWidgetFormBuilder
+
+NewFormWidgetFormBuilder::NewFormWidgetFormBuilder(QDesignerFormEditorInterface *core,
+ Mode mode,
+ const DeviceProfile &deviceProfile) :
+ QDesignerFormBuilder(core, mode, deviceProfile)
+{
+}
+
+void NewFormWidgetFormBuilder::createCustomWidgets(DomCustomWidgets *dc)
+{
+ QSimpleResource::handleDomCustomWidgets(core(), dc);
+}
+
} // namespace qdesigner_internal
QT_END_NAMESPACE
diff --git a/tools/designer/src/lib/shared/qdesigner_formbuilder_p.h b/tools/designer/src/lib/shared/qdesigner_formbuilder_p.h
index b982e1c..ee40085 100644
--- a/tools/designer/src/lib/shared/qdesigner_formbuilder_p.h
+++ b/tools/designer/src/lib/shared/qdesigner_formbuilder_p.h
@@ -75,7 +75,7 @@ namespace qdesigner_internal {
class DesignerPixmapCache;
class DesignerIconCache;
-/* Form builder used for previewing forms, widget box and new form dialog.
+/* Form builder used for previewing forms and widget box.
* It applies the system settings to its toplevel window. */
class QDESIGNER_SHARED_EXPORT QDesignerFormBuilder: public QFormBuilder
@@ -159,6 +159,21 @@ private:
bool m_mainWidget;
};
+// Form builder for a new form widget (preview). To allow for promoted
+// widgets in the template, it implements the handling of custom widgets
+// (adding of them to the widget database).
+
+class QDESIGNER_SHARED_EXPORT NewFormWidgetFormBuilder: public QDesignerFormBuilder {
+public:
+ NewFormWidgetFormBuilder(QDesignerFormEditorInterface *core,
+ Mode mode,
+ const DeviceProfile &deviceProfile = DeviceProfile());
+
+protected:
+ virtual void createCustomWidgets(DomCustomWidgets *);
+};
+
+
} // namespace qdesigner_internal
QT_END_NAMESPACE
diff --git a/tools/designer/src/lib/shared/qdesigner_toolbar.cpp b/tools/designer/src/lib/shared/qdesigner_toolbar.cpp
index 0bb91ee..898be1e 100644
--- a/tools/designer/src/lib/shared/qdesigner_toolbar.cpp
+++ b/tools/designer/src/lib/shared/qdesigner_toolbar.cpp
@@ -440,18 +440,14 @@ QAction *ToolBarEventFilter::actionAt(const QToolBar *tb, const QPoint &pos)
return tb->actions().at(index);
}
+//that's a trick to get acces to the initStyleOption which is a protected member
+class FriendlyToolBar : public QToolBar {
+public:
+ friend class ToolBarEventFilter;
+};
+
QRect ToolBarEventFilter::handleArea(const QToolBar *tb)
{
- //that's a trick to get acces to the initStyleOption which is a protected member
- class FriendlyToolBar : public QToolBar
- {
- public:
-#ifdef Q_NO_USING_KEYWORD
- void initStyleOption(QStyleOptionToolBar *option) { QToolBar::initStyleOption(option); }
-#else
- using QToolBar::initStyleOption;
-#endif
- };
QStyleOptionToolBar opt;
static_cast<const FriendlyToolBar*>(tb)->initStyleOption(&opt);
return tb->style()->subElementRect(QStyle::SE_ToolBarHandle, &opt, tb);
diff --git a/tools/designer/src/lib/shared/qsimpleresource.cpp b/tools/designer/src/lib/shared/qsimpleresource.cpp
index 8d29002..69d48fd 100644
--- a/tools/designer/src/lib/shared/qsimpleresource.cpp
+++ b/tools/designer/src/lib/shared/qsimpleresource.cpp
@@ -41,6 +41,7 @@
#include "qsimpleresource_p.h"
#include "widgetfactory_p.h"
+#include "widgetdatabase_p.h"
#include <formscriptrunner_p.h>
#include <properties_p.h>
@@ -57,6 +58,8 @@
#include <QtGui/QWidget>
#include <QtGui/QAction>
#include <QtCore/QDebug>
+#include <QtCore/QCoreApplication>
+
QT_BEGIN_NAMESPACE
@@ -267,6 +270,136 @@ bool QSimpleResource::warningsEnabled()
return m_warningsEnabled;
}
+// Custom widgets handling helpers
+
+// Add unique fake slots and signals to lists
+bool QSimpleResource::addFakeMethods(const DomSlots *domSlots, QStringList &fakeSlots, QStringList &fakeSignals)
+{
+ if (!domSlots)
+ return false;
+
+ bool rc = false;
+ foreach (const QString &fakeSlot, domSlots->elementSlot())
+ if (fakeSlots.indexOf(fakeSlot) == -1) {
+ fakeSlots += fakeSlot;
+ rc = true;
+ }
+
+ foreach (const QString &fakeSignal, domSlots->elementSignal())
+ if (fakeSignals.indexOf(fakeSignal) == -1) {
+ fakeSignals += fakeSignal;
+ rc = true;
+ }
+ return rc;
+}
+
+void QSimpleResource::addFakeMethodsToWidgetDataBase(const DomCustomWidget *domCustomWidget, WidgetDataBaseItem *item)
+{
+ const DomSlots *domSlots = domCustomWidget->elementSlots();
+ if (!domSlots)
+ return;
+
+ // Merge in new slots, signals
+ QStringList fakeSlots = item->fakeSlots();
+ QStringList fakeSignals = item->fakeSignals();
+ if (addFakeMethods(domSlots, fakeSlots, fakeSignals)) {
+ item->setFakeSlots(fakeSlots);
+ item->setFakeSignals(fakeSignals);
+ }
+}
+
+// Perform one iteration of adding the custom widgets to the database,
+// looking up the base class and inheriting its data.
+// Remove the succeeded custom widgets from the list.
+// Classes whose base class could not be found are left in the list.
+
+void QSimpleResource::addCustomWidgetsToWidgetDatabase(const QDesignerFormEditorInterface *core,
+ QList<DomCustomWidget*>& custom_widget_list)
+{
+ QDesignerWidgetDataBaseInterface *db = core->widgetDataBase();
+ for (int i=0; i < custom_widget_list.size(); ) {
+ bool classInserted = false;
+ DomCustomWidget *custom_widget = custom_widget_list[i];
+ const QString customClassName = custom_widget->elementClass();
+ const QString base_class = custom_widget->elementExtends();
+ QString includeFile;
+ IncludeType includeType = IncludeLocal;
+ if (const DomHeader *header = custom_widget->elementHeader()) {
+ includeFile = header->text();
+ if (header->hasAttributeLocation() && header->attributeLocation() == QLatin1String("global"))
+ includeType = IncludeGlobal;
+ }
+ const bool domIsContainer = custom_widget->elementContainer();
+ // Append a new item
+ if (base_class.isEmpty()) {
+ WidgetDataBaseItem *item = new WidgetDataBaseItem(customClassName);
+ item->setPromoted(false);
+ item->setGroup(QCoreApplication::translate("Designer", "Custom Widgets"));
+ item->setIncludeFile(buildIncludeFile(includeFile, includeType));
+ item->setContainer(domIsContainer);
+ item->setCustom(true);
+ addFakeMethodsToWidgetDataBase(custom_widget, item);
+ db->append(item);
+ custom_widget_list.removeAt(i);
+ classInserted = true;
+ } else {
+ // Create a new entry cloned from base class. Note that this will ignore existing
+ // classes, eg, plugin custom widgets.
+ QDesignerWidgetDataBaseItemInterface *item =
+ appendDerived(db, customClassName, QCoreApplication::translate("Designer", "Promoted Widgets"),
+ base_class,
+ buildIncludeFile(includeFile, includeType),
+ true,true);
+ // Ok, base class found.
+ if (item) {
+ // Hack to accommodate for old UI-files in which "container" is not set properly:
+ // Apply "container" from DOM only if true (else, eg classes from QFrame might not accept
+ // dropping child widgets on them as container=false). This also allows for
+ // QWidget-derived stacked pages.
+ if (domIsContainer)
+ item->setContainer(domIsContainer);
+
+ addFakeMethodsToWidgetDataBase(custom_widget, static_cast<WidgetDataBaseItem*>(item));
+ custom_widget_list.removeAt(i);
+ classInserted = true;
+ }
+ }
+ // Skip failed item.
+ if (!classInserted)
+ i++;
+ }
+
+}
+
+void QSimpleResource::handleDomCustomWidgets(const QDesignerFormEditorInterface *core,
+ const DomCustomWidgets *dom_custom_widgets)
+{
+ if (dom_custom_widgets == 0)
+ return;
+ QList<DomCustomWidget*> custom_widget_list = dom_custom_widgets->elementCustomWidget();
+ // Attempt to insert each item derived from its base class.
+ // This should at most require two iterations in the event that the classes are out of order
+ // (derived first, max depth: promoted custom plugin = 2)
+ for (int iteration = 0; iteration < 2; iteration++) {
+ addCustomWidgetsToWidgetDatabase(core, custom_widget_list);
+ if (custom_widget_list.empty())
+ return;
+ }
+ // Oops, there are classes left whose base class could not be found.
+ // Default them to QWidget with warnings.
+ const QString fallBackBaseClass = QLatin1String("QWidget");
+ for (int i=0; i < custom_widget_list.size(); i++ ) {
+ DomCustomWidget *custom_widget = custom_widget_list[i];
+ const QString customClassName = custom_widget->elementClass();
+ const QString base_class = custom_widget->elementExtends();
+ qDebug() << "** WARNING The base class " << base_class << " of the custom widget class " << customClassName
+ << " could not be found. Defaulting to " << fallBackBaseClass << '.';
+ custom_widget->setElementExtends(fallBackBaseClass);
+ }
+ // One more pass.
+ addCustomWidgetsToWidgetDatabase(core, custom_widget_list);
+}
+
// ------------ FormBuilderClipboard
FormBuilderClipboard::FormBuilderClipboard(QWidget *w)
diff --git a/tools/designer/src/lib/shared/qsimpleresource_p.h b/tools/designer/src/lib/shared/qsimpleresource_p.h
index 8d45c3c..a25cb88 100644
--- a/tools/designer/src/lib/shared/qsimpleresource_p.h
+++ b/tools/designer/src/lib/shared/qsimpleresource_p.h
@@ -55,15 +55,21 @@
#include "shared_global_p.h"
#include "abstractformbuilder.h"
+#include <QtCore/QStringList>
QT_BEGIN_NAMESPACE
class DomScript;
+class DomCustomWidgets;
+class DomCustomWidget;
+class DomSlots;
class QDesignerFormEditorInterface;
namespace qdesigner_internal {
+class WidgetDataBaseItem;
+
class QDESIGNER_SHARED_EXPORT QSimpleResource : public QAbstractFormBuilder
{
public:
@@ -92,6 +98,11 @@ public:
static QString customWidgetScript(QDesignerFormEditorInterface *core, const QString &className);
static bool hasCustomWidgetScript(QDesignerFormEditorInterface *core, QObject *object);
+ // Implementation for FormBuilder::createDomCustomWidgets() that adds
+ // the custom widgets to the widget database
+ static void handleDomCustomWidgets(const QDesignerFormEditorInterface *core,
+ const DomCustomWidgets *dom_custom_widgets);
+
protected:
virtual QIcon nameToIcon(const QString &filePath, const QString &qrcPath);
virtual QString iconToFilePath(const QIcon &pm) const;
@@ -105,7 +116,13 @@ protected:
typedef QList<DomScript*> DomScripts;
static void addScript(const QString &script, ScriptSource source, DomScripts &domScripts);
+ static bool addFakeMethods(const DomSlots *domSlots, QStringList &fakeSlots, QStringList &fakeSignals);
+
private:
+ static void addCustomWidgetsToWidgetDatabase(const QDesignerFormEditorInterface *core,
+ QList<DomCustomWidget*>& custom_widget_list);
+ static void addFakeMethodsToWidgetDataBase(const DomCustomWidget *domCustomWidget, WidgetDataBaseItem *item);
+
static bool m_warningsEnabled;
QDesignerFormEditorInterface *m_core;
};
diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp
index bdc6c9a..ce17b6f 100644
--- a/tools/linguist/lconvert/main.cpp
+++ b/tools/linguist/lconvert/main.cpp
@@ -97,6 +97,11 @@ static int usage(const QStringList &args)
" Drop obsolete messages.\n\n"
" --no-finished\n"
" Drop finished messages.\n\n"
+ " --locations {absolute|relative|none}\n"
+ " Override how source code references are saved in ts files.\n"
+ " Default is absolute.\n}n"
+ " --no-ui-lines\n"
+ " Drop line numbers from references to .ui files.\n\n"
" --verbose\n"
" be a bit more verbose\n\n"
"Long options can be specified with only one leading dash, too.\n\n"
@@ -129,6 +134,8 @@ int main(int argc, char *argv[])
bool noObsolete = false;
bool noFinished = false;
bool verbose = false;
+ bool noUiLines = false;
+ Translator::LocationsType locations = Translator::DefaultLocations;
ConversionData cd;
Translator tr;
@@ -180,6 +187,19 @@ int main(int argc, char *argv[])
noObsolete = true;
} else if (args[i] == QLatin1String("-no-finished")) {
noFinished = true;
+ } else if (args[i] == QLatin1String("-locations")) {
+ if (++i >= args.size())
+ return usage(args);
+ if (args[i] == QLatin1String("none"))
+ locations = Translator::NoLocations;
+ else if (args[i] == QLatin1String("relative"))
+ locations = Translator::RelativeLocations;
+ else if (args[i] == QLatin1String("absolute"))
+ locations = Translator::AbsoluteLocations;
+ else
+ return usage(args);
+ } else if (args[i] == QLatin1String("-no-ui-lines")) {
+ noUiLines = true;
} else if (args[i] == QLatin1String("-verbose")) {
verbose = true;
} else if (args[i].startsWith(QLatin1Char('-'))) {
@@ -224,6 +244,10 @@ int main(int argc, char *argv[])
tr.stripFinishedMessages();
if (dropTranslations)
tr.dropTranslations();
+ if (noUiLines)
+ tr.dropUiLines();
+ if (locations != Translator::DefaultLocations)
+ tr.setLocationsType(locations);
if (!tr.save(outFileName, cd, outFormat)) {
qWarning("%s", qPrintable(cd.error()));
diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp
index 921b8b6..f91175d 100644
--- a/tools/linguist/linguist/mainwindow.cpp
+++ b/tools/linguist/linguist/mainwindow.cpp
@@ -127,7 +127,7 @@ static Ending ending(QString str, QLocale::Language lang)
switch (ch) {
case 0x002e: // full stop
- if (str.endsWith(QString(QLatin1String("..."))))
+ if (str.endsWith(QLatin1String("...")))
return End_Ellipsis;
else
return End_FullStop;
diff --git a/tools/linguist/linguist/phrase.cpp b/tools/linguist/linguist/phrase.cpp
index 300f6e8..b1f9818 100644
--- a/tools/linguist/linguist/phrase.cpp
+++ b/tools/linguist/linguist/phrase.cpp
@@ -152,10 +152,10 @@ bool QphHandler::startElement(const QString & /* namespaceURI */,
const QString &qName,
const QXmlAttributes &atts)
{
- if (qName == QString(QLatin1String("QPH"))) {
+ if (qName == QLatin1String("QPH")) {
m_language = atts.value(QLatin1String("language"));
m_sourceLanguage = atts.value(QLatin1String("sourcelanguage"));
- } else if (qName == QString(QLatin1String("phrase"))) {
+ } else if (qName == QLatin1String("phrase")) {
source.truncate(0);
target.truncate(0);
definition.truncate(0);
@@ -168,13 +168,13 @@ bool QphHandler::endElement(const QString & /* namespaceURI */,
const QString & /* localName */,
const QString &qName)
{
- if (qName == QString(QLatin1String("source")))
+ if (qName == QLatin1String("source"))
source = accum;
- else if (qName == QString(QLatin1String("target")))
+ else if (qName == QLatin1String("target"))
target = accum;
- else if (qName == QString(QLatin1String("definition")))
+ else if (qName == QLatin1String("definition"))
definition = accum;
- else if (qName == QString(QLatin1String("phrase")))
+ else if (qName == QLatin1String("phrase"))
pb->m_phrases.append(new Phrase(source, target, definition, pb));
return true;
}
diff --git a/tools/linguist/lupdate/java.cpp b/tools/linguist/lupdate/java.cpp
index 31024f9..658aebf 100644
--- a/tools/linguist/lupdate/java.cpp
+++ b/tools/linguist/lupdate/java.cpp
@@ -375,22 +375,13 @@ static bool matchString( QString &s )
return true;
}
-static bool matchInteger( qlonglong *number)
-{
- bool matches = (yyTok == Tok_Integer);
- if (matches) {
- yyTok = getToken();
- *number = yyInteger;
- }
- return matches;
-}
-
static bool matchStringOrNull(QString &s)
{
bool matches = matchString(s);
if (!matches) {
matches = (yyTok == Tok_null);
- if (matches) yyTok = getToken();
+ if (matches)
+ yyTok = getToken();
}
return matches;
}
diff --git a/tools/linguist/lupdate/merge.cpp b/tools/linguist/lupdate/merge.cpp
index c4f4448..4849d6e 100644
--- a/tools/linguist/lupdate/merge.cpp
+++ b/tools/linguist/lupdate/merge.cpp
@@ -193,7 +193,7 @@ static QString translationAttempt(const QString &oldTranslation,
*/
for (k = 0; k < p; k++) {
if (!met[k])
- attempt += QString(QLatin1String(" {")) + newNumbers[k] + QString(QLatin1String("?}"));
+ attempt += QLatin1String(" {") + newNumbers[k] + QLatin1String("?}");
}
/*
@@ -205,8 +205,8 @@ static QString translationAttempt(const QString &oldTranslation,
for (ell = 0; ell < p; ell++) {
if (k != ell && oldNumbers[k] == oldNumbers[ell] &&
newNumbers[k] < newNumbers[ell])
- attempt += QString(QLatin1String(" {")) + newNumbers[k] + QString(QLatin1String(" or ")) +
- newNumbers[ell] + QString(QLatin1String("?}"));
+ attempt += QLatin1String(" {") + newNumbers[k] + QLatin1String(" or ") +
+ newNumbers[ell] + QLatin1String("?}");
}
}
return attempt;
diff --git a/tools/linguist/shared/profileevaluator.cpp b/tools/linguist/shared/profileevaluator.cpp
index 0be6bec..ae46ad8 100644
--- a/tools/linguist/shared/profileevaluator.cpp
+++ b/tools/linguist/shared/profileevaluator.cpp
@@ -894,7 +894,7 @@ QStringList ProFileEvaluator::Private::qmakeFeaturePaths()
{
QStringList concat;
{
- const QString base_concat = QDir::separator() + QString(QLatin1String("features"));
+ const QString base_concat = QDir::separator() + QLatin1String("features");
concat << base_concat + QDir::separator() + QLatin1String("mac");
concat << base_concat + QDir::separator() + QLatin1String("macx");
concat << base_concat + QDir::separator() + QLatin1String("unix");
@@ -903,7 +903,7 @@ QStringList ProFileEvaluator::Private::qmakeFeaturePaths()
concat << base_concat + QDir::separator() + QLatin1String("qnx6");
concat << base_concat;
}
- const QString mkspecs_concat = QDir::separator() + QString(QLatin1String("mkspecs"));
+ const QString mkspecs_concat = QDir::separator() + QLatin1String("mkspecs");
QStringList feature_roots;
QByteArray mkspec_path = qgetenv("QMAKEFEATURES");
if (!mkspec_path.isNull())
diff --git a/tools/linguist/shared/proparserutils.h b/tools/linguist/shared/proparserutils.h
index c27c3c0..3eab43f 100644
--- a/tools/linguist/shared/proparserutils.h
+++ b/tools/linguist/shared/proparserutils.h
@@ -282,7 +282,7 @@ static QStringList split_value_list(const QString &vals, bool do_semicolon=false
static QStringList qmake_mkspec_paths()
{
QStringList ret;
- const QString concat = QDir::separator() + QString(QLatin1String("mkspecs"));
+ const QString concat = QDir::separator() + QLatin1String("mkspecs");
QByteArray qmakepath = qgetenv("QMAKEPATH");
if (!qmakepath.isEmpty()) {
const QStringList lst = splitPathList(QString::fromLocal8Bit(qmakepath));
diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp
index 312bb71..c1f242d 100644
--- a/tools/linguist/shared/translator.cpp
+++ b/tools/linguist/shared/translator.cpp
@@ -416,6 +416,26 @@ void Translator::dropTranslations()
}
}
+void Translator::dropUiLines()
+{
+ QString uiXt = QLatin1String(".ui");
+ QString juiXt = QLatin1String(".jui");
+ for (TMM::Iterator it = m_messages.begin(); it != m_messages.end(); ++it) {
+ QHash<QString, int> have;
+ QList<TranslatorMessage::Reference> refs;
+ foreach (const TranslatorMessage::Reference &itref, it->allReferences()) {
+ const QString &fn = itref.fileName();
+ if (fn.endsWith(uiXt) || fn.endsWith(juiXt)) {
+ if (++have[fn] == 1)
+ refs.append(TranslatorMessage::Reference(fn, -1));
+ } else {
+ refs.append(itref);
+ }
+ }
+ it->setReferences(refs);
+ }
+}
+
QSet<TranslatorMessagePtr> Translator::resolveDuplicates()
{
QSet<TranslatorMessagePtr> dups;
diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h
index 4e97000..5d0549b 100644
--- a/tools/linguist/shared/translator.h
+++ b/tools/linguist/shared/translator.h
@@ -132,6 +132,7 @@ public:
void stripNonPluralForms();
void stripIdenticalSourceTranslations();
void dropTranslations();
+ void dropUiLines();
void makeFileNamesAbsolute(const QDir &originalPath);
QSet<TranslatorMessagePtr> resolveDuplicates();
static void reportDuplicates(const QSet<TranslatorMessagePtr> &dupes,
@@ -143,7 +144,7 @@ public:
QString languageCode() const { return m_language; }
QString sourceLanguageCode() const { return m_sourceLanguage; }
- enum LocationsType { NoLocations, RelativeLocations, AbsoluteLocations };
+ enum LocationsType { DefaultLocations, NoLocations, RelativeLocations, AbsoluteLocations };
void setLocationsType(LocationsType lt) { m_locationsType = lt; }
LocationsType locationsType() const { return m_locationsType; }
diff --git a/tools/pixeltool/qpixeltool.cpp b/tools/pixeltool/qpixeltool.cpp
index 6de7741..c55cbd1 100644
--- a/tools/pixeltool/qpixeltool.cpp
+++ b/tools/pixeltool/qpixeltool.cpp
@@ -179,13 +179,13 @@ void QPixelTool::paintEvent(QPaintEvent *)
if (m_displayZoom) {
render_string(&p, w, h,
- QString(QLatin1String("Zoom: x%1")).arg(m_zoom),
+ QString::fromLatin1("Zoom: x%1").arg(m_zoom),
Qt::AlignTop | Qt::AlignRight);
}
if (m_displayGridSize) {
render_string(&p, w, h,
- QString(QLatin1String("Grid size: %1")).arg(m_gridSize),
+ QString::fromLatin1("Grid size: %1").arg(m_gridSize),
Qt::AlignBottom | Qt::AlignLeft);
}
diff --git a/tools/porting/src/logger.cpp b/tools/porting/src/logger.cpp
index fb44de7..bbeac9c 100644
--- a/tools/porting/src/logger.cpp
+++ b/tools/porting/src/logger.cpp
@@ -60,8 +60,8 @@ SourcePointLogEntry::SourcePointLogEntry(QString type, QString location, QString
QString SourcePointLogEntry::description() const
{
return QLatin1String("In file ") + file +
- QLatin1String(" at line ") + QString(QLatin1String("%1")).arg(line + 1) + //line count is zero based, adjust here.
- QLatin1String(" column ") + QString(QLatin1String("%1")).arg(column) +
+ QLatin1String(" at line ") + QString::number(line + 1) + //line count is zero based, adjust here.
+ QLatin1String(" column ") + QString::number(column) +
QLatin1String(": ") + text ;
}
@@ -127,7 +127,7 @@ QStringList Logger::fullReport()
commitSection();
QStringList report;
report << QLatin1String("Log for qt3to4 on ") + QDateTime::currentDateTime().toString() +
- QLatin1String(". Number of log entries: ") + QString(QLatin1String("%1")).arg(logEntries.size());
+ QLatin1String(". Number of log entries: ") + QString::number(logEntries.size());
foreach(LogEntry *logEntry, logEntries) {
report << logEntry->description();
}
diff --git a/tools/qdoc3/codeparser.cpp b/tools/qdoc3/codeparser.cpp
index 9a58bc6..f0ff27e 100644
--- a/tools/qdoc3/codeparser.cpp
+++ b/tools/qdoc3/codeparser.cpp
@@ -241,19 +241,6 @@ void CodeParser::processCommonMetaCommand(const Location &location,
if (node->type() == Node::Fake) {
FakeNode *fake = static_cast<FakeNode *>(node);
fake->setTitle(arg);
-#ifdef QDOC2DOX
- /* qdoc -> doxygen.
- I think this must be done here, because there can be multiple
- "\externalpage" and "\title" metacommands in a single qdoc
- comment, which means, among other things, that the "\title"
- commands are not inserted into the metacommand map used by
- the Doc class. I'm sure there4 is a better way to do this in
- the DoxWriter class using the information in the FakeNode,
- but I don't have time to figure it out right now.
- */
- if (DoxWriter::isDoxPass(1))
- DoxWriter::insertTitle(fake,arg);
-#endif
}
else
location.warning(tr("Ignored '\\%1'").arg(COMMAND_TITLE));
diff --git a/tools/qdoc3/config.cpp b/tools/qdoc3/config.cpp
index c8488f3..aa6b454 100644
--- a/tools/qdoc3/config.cpp
+++ b/tools/qdoc3/config.cpp
@@ -751,7 +751,7 @@ void Config::load(Location location, const QString& fileName)
word += QChar(c.digitValue());
SKIP_CHAR();
}
- else if ((metaCharPos = QString(QLatin1String("abfnrtv")).indexOf(c)) != -1) {
+ else if ((metaCharPos = QString::fromLatin1("abfnrtv").indexOf(c)) != -1) {
word += "\a\b\f\n\r\t\v"[metaCharPos];
SKIP_CHAR();
}
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index f9c3a15..aec6e8f 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -591,22 +591,6 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc,
// ### split(" ") hack is there to support header file syntax
QStringList paths = arg.split(" ");
QStringList path = paths[0].split("::");
-
-#if QDOC2DOX
- // qdoc -> doxygen.
- if (Doc::isDoxPass(1)) {
- if (command == COMMAND_PROPERTY) {
- Doc::insertProperty(path);
- }
- else if (command == COMMAND_VARIABLE) {
- Doc::insertVariable(path);
- }
- else if (command == COMMAND_ENUM) {
- // zzz
- }
- }
-#endif
-
Node *node = 0;
if (!usedNamespaces.isEmpty()) {
foreach (const QString &usedNamespace, usedNamespaces) {
@@ -1906,12 +1890,6 @@ bool CppCodeParser::matchDocsAndStuff()
readToken();
Doc::trimCStyleComment(start_loc,comment);
- /*
- qdoc --> doxygen
- We must also remember the location of the end
- of the comment, so we can construct a diff for
- it.
- */
Location end_loc(location());
/*
diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp
index 601d0bc..f0a4c12 100644
--- a/tools/qdoc3/doc.cpp
+++ b/tools/qdoc3/doc.cpp
@@ -515,14 +515,7 @@ void DocParser::parse(const QString& source,
break;
case CMD_BADCODE:
leavePara();
-#ifdef QDOC2DOX
- if (DoxWriter::isDoxPass())
- append(Atom::CodeBad,getUnmarkedCode(CMD_BADCODE));
- else
- append(Atom::CodeBad,getCode(CMD_BADCODE, marker));
-#else
append(Atom::CodeBad,getCode(CMD_BADCODE, marker));
-#endif
break;
case CMD_BASENAME:
leavePara();
@@ -538,17 +531,8 @@ void DocParser::parse(const QString& source,
case CMD_C:
enterPara();
x = untabifyEtc(getArgument(true));
-#ifdef QDOC2DOX
- if (DoxWriter::isDoxPass())
- append(Atom::C, x);
- else {
- marker = CodeMarker::markerForCode(x);
- append(Atom::C, marker->markedUpCode(x, 0, ""));
- }
-#else
marker = CodeMarker::markerForCode(x);
append(Atom::C, marker->markedUpCode(x, 0, ""));
-#endif
break;
case CMD_CAPTION:
leavePara();
@@ -559,14 +543,7 @@ void DocParser::parse(const QString& source,
break;
case CMD_CODE:
leavePara();
-#ifdef QDOC2DOX
- if (DoxWriter::isDoxPass())
- append(Atom::Code, getUnmarkedCode(CMD_CODE));
- else
- append(Atom::Code, getCode(CMD_CODE, marker));
-#else
append(Atom::Code, getCode(CMD_CODE, marker));
-#endif
break;
#ifdef QDOC_QML
case CMD_QML:
@@ -579,17 +556,6 @@ void DocParser::parse(const QString& source,
#endif
case CMD_CODELINE:
{
-#ifdef QDOC2DOX
- if (!quoting && !DoxWriter::isDoxPass()) {
- if (priv->text.lastAtom()->type() == Atom::Code
- && priv->text.lastAtom()->string().endsWith("\n\n"))
- priv->text.lastAtom()->chopString();
- appendToCode("\n");
- } lse {
- append(Atom::CodeQuoteCommand, cmdStr);
- append(Atom::CodeQuoteArgument, " ");
- }
-#else
if (!quoting) {
if (priv->text.lastAtom()->type() == Atom::Code
&& priv->text.lastAtom()->string().endsWith("\n\n"))
@@ -600,37 +566,10 @@ void DocParser::parse(const QString& source,
append(Atom::CodeQuoteCommand, cmdStr);
append(Atom::CodeQuoteArgument, " ");
}
-#endif
}
break;
case CMD_DOTS:
{
-#ifdef QDOC2DOX
- if (DoxWriter::isDoxPass()) {
- append(Atom::CodeQuoteCommand, cmdStr);
- append(Atom::CodeQuoteArgument, " ...");
- }
- else if (!quoting) {
- if (priv->text.lastAtom()->type() == Atom::Code
- && priv->text.lastAtom()->string().endsWith("\n\n"))
- priv->text.lastAtom()->chopString();
-
- QString arg = getOptionalArgument();
- int indent = 4;
- if (!arg.isEmpty())
- indent = arg.toInt();
- for (int i = 0; i < indent; ++i)
- appendToCode(" ");
- appendToCode("...\n");
- }
- else {
- append(Atom::CodeQuoteCommand, cmdStr);
- QString arg = getOptionalArgument();
- if (arg.isEmpty())
- arg = "4";
- append(Atom::CodeQuoteArgument, arg);
- }
-#else
if (!quoting) {
if (priv->text.lastAtom()->type() == Atom::Code
&& priv->text.lastAtom()->string().endsWith("\n\n"))
@@ -651,7 +590,6 @@ void DocParser::parse(const QString& source,
arg = "4";
append(Atom::CodeQuoteArgument, arg);
}
-#endif
}
break;
case CMD_ELSE:
@@ -953,19 +891,8 @@ void DocParser::parse(const QString& source,
break;
case CMD_OLDCODE:
leavePara();
-#ifdef QDOC2DOX
- if (DoxWriter::isDoxPass()) {
- append(Atom::CodeOld, getUnmarkedCode(CMD_OLDCODE));
- append(Atom::CodeNew, getUnmarkedCode(CMD_NEWCODE));
- }
- else {
- append(Atom::CodeOld, getCode(CMD_OLDCODE, marker));
- append(Atom::CodeNew, getCode(CMD_NEWCODE, marker));
- }
-#else
append(Atom::CodeOld, getCode(CMD_OLDCODE, marker));
append(Atom::CodeNew, getCode(CMD_NEWCODE, marker));
-#endif
break;
case CMD_OMIT:
getUntilEnd(cmd);
@@ -1147,18 +1074,6 @@ void DocParser::parse(const QString& source,
{
QString snippet = getArgument();
QString identifier = getRestOfLine();
-#ifdef QDOC2DOX
- if (quoting || DoxWriter::isDoxPass()) {
- append(Atom::SnippetCommand, cmdStr);
- append(Atom::SnippetLocation, snippet);
- append(Atom::SnippetIdentifier, identifier);
- }
- else {
- Doc::quoteFromFile(location(),quoter,snippet);
- appendToCode(quoter.quoteSnippet(location(),
- identifier));
- }
-#else
if (quoting) {
append(Atom::SnippetCommand, cmdStr);
append(Atom::SnippetLocation, snippet);
@@ -1169,7 +1084,6 @@ void DocParser::parse(const QString& source,
appendToCode(quoter.quoteSnippet(location(),
identifier));
}
-#endif
}
break;
case CMD_SUB:
@@ -1251,7 +1165,7 @@ void DocParser::parse(const QString& source,
append(Atom::FormattingRight, ATOM_FORMATTING_BOLD);
append(Atom::String, " ");
break;
- case CMD_OVERLOAD: // qdoc --> doxygen
+ case CMD_OVERLOAD:
priv->metacommandsUsed.insert(cmdStr);
x.clear();
if (!isBlankLine())
@@ -1265,9 +1179,7 @@ void DocParser::parse(const QString& source,
}
else {
append(Atom::ParaLeft);
- append(Atom::String,
- "This is an overloaded member function, "
- "provided for convenience.");
+ append(Atom::String,"This is an overloaded function.");
append(Atom::ParaRight);
x = getMetaCommandArgument(cmdStr);
}
@@ -2345,7 +2257,7 @@ QString DocParser::getCode(int cmd, CodeMarker *marker)
}
/*!
- Used only for generating doxygen output.
+ Was used only for generating doxygen output.
*/
QString DocParser::getUnmarkedCode(int cmd)
{
@@ -2581,36 +2493,6 @@ QString DocParser::slashed(const QString& str)
#define COMMAND_QMLBRIEF Doc::alias("qmlbrief")
#endif
-#ifdef QDOC2DOX
-#define DOXYGEN_INDENT 2
-#define DOXYGEN_TAB_SIZE 4
-#define DOXYGEN_INDENT_STRING " "
-#define DOXYGEN_TAB_STRING " "
-
-static QRegExp ws_rx("\\s");
-static QRegExp not_ws_rx("\\S");
-
-int DoxWriter::doxPass = 0;
-QString DoxWriter::currentClass;
-QSet<QString> DoxWriter::anchors;
-QStringMap DoxWriter::exampleTitles;
-QStringMap DoxWriter::headerFileTitles;
-QStringMap DoxWriter::fileTitles;
-QStringMap DoxWriter::groupTitles;
-QStringMap DoxWriter::moduleTitles;
-QStringMap DoxWriter::pageTitles;
-QStringMap DoxWriter::externalPageTitles;
-QStringMap DoxWriter::exampleTitlesInverse;
-QStringMap DoxWriter::headerFileTitlesInverse;
-QStringMap DoxWriter::fileTitlesInverse;
-QStringMap DoxWriter::groupTitlesInverse;
-QStringMap DoxWriter::moduleTitlesInverse;
-QStringMap DoxWriter::pageTitlesInverse;
-QStringMap DoxWriter::externalPageTitlesInverse;
-QStringMultiMap DoxWriter::variables;
-QStringMultiMap DoxWriter::properties;
-QStringMultiMap DoxWriter::enums;
-#endif
Doc::Doc(const Location& start_loc,
const Location& end_loc,
@@ -2620,15 +2502,6 @@ Doc::Doc(const Location& start_loc,
priv = new DocPrivate(start_loc,end_loc,source);
DocParser parser;
parser.parse(source,priv,metaCommandSet);
-#ifdef QDOC2DOX
- if (DoxWriter::isDoxPass()) {
- DoxWriter doxWriter(source,priv);
- if (DoxWriter::isDoxPass(1))
- doxWriter.pass1();
- else
- doxWriter.pass2();
- }
-#endif
}
Doc::Doc(const Doc& doc)
@@ -3182,1855 +3055,4 @@ void Doc::detach()
priv = newPriv;
}
-#ifdef QDOC2DOX
-/*!
- Sets the doxygen writer pass to \a pass. You can use
- isDoxPass(), with or without a parameter, to test if
- you are in a doxygen writer run or in a specific pass
- of a doxygen writer run.
-
- This function is only called from main() if either the
- \e doxygen1 or \e doxygen2 flag is passed to qdoc3 on
- the command line.
- */
-void DoxWriter::setDoxPass(int pass)
-{
- qDebug() << "SETTING doxygen pass to " << pass
- << " in DoxWriter::setDoxPass()";
- doxPass = pass;
-}
-
-/*!
- Returns true if the doxygen pass is set to \a pass,
- which means we are in the specified \a pass of a doxygen
- writer run of qdoc3.
- */
-bool DoxWriter::isDoxPass(int pass) { return (doxPass == pass); }
-
-/*!
- Returns true if the doxygen pass is 1 or 2, which
- means this is a doxygen writer run to transform qdoc
- comments into doxygen comments.
- */
-bool DoxWriter::isDoxPass() { return (doxPass > 0); }
-
-bool DoxWriter::conversionRequired() const
-{
- /*
- Loop through all the topic commands searching for
- one that must be transformed to doxygen format. If
- one is found, return true.
- */
- QCommandMap::const_iterator i;
- i = priv->metaCommandMap.constBegin();
- while (i != priv->metaCommandMap.constEnd()) {
- QString s = i.key();
- if (s == "enum")
- return true;
- else if (s == "example")
- return true;
- else if (s == "externalpage")
- return true;
- else if (s == "group")
- return true;
- else if (s == "headerfile")
- return true;
- else if (s == "module")
- return true;
- else if (s == "page")
- return true;
- else if (s == "property")
- return true;
- else if (s == "typedef")
- return true;
- else if (s == "variable")
- return true;
- else if (s == "overload")
- return true;
- else if (s == "reimp")
- return true;
- else if (s == "relates")
- return true;
- else if (s == "macro")
- return true;
- else {
-#if 0
- if (s == "class")
- else if (s == "namespace")
- else if (s == "service")
- else if (s == "inheaderfile")
- else if (s == "file")
- else if (s == "fn")
- else if (s == "contentspage")
- else if (s == "nextpage")
- else if (s == "previous")
- else if (s == "indexpage")
- else if (s == "startpage")
-#endif
- }
- ++i;
- }
-
- /*
- Loop through all the qdoc atoms searching for one
- that must be transformed to doxygen format. If one
- is found, return true.
- */
- const Atom* next = priv->text.firstAtom();
- while (next != 0) {
- Atom::Type atomType = next->type();
- switch (atomType) {
- case Atom::C:
- case Atom::CaptionLeft:
- case Atom::Code:
- case Atom::CodeBad:
- case Atom::CodeNew:
- case Atom::CodeOld:
- case Atom::CodeQuoteArgument:
- case Atom::CodeQuoteCommand:
- case Atom::FootnoteLeft:
- case Atom::FormatElse:
- case Atom::FormatEndif:
- case Atom::FormatIf:
- case Atom::GeneratedList:
- case Atom::Image:
- case Atom::ImageText:
- case Atom::InlineImage:
- case Atom::LegaleseLeft:
- case Atom::LineBreak:
- case Atom::Link:
- case Atom::LinkNode:
- case Atom::ListLeft:
- case Atom::ListItemNumber:
- case Atom::ListTagLeft:
- case Atom::ListItemLeft:
- case Atom::QuotationLeft:
- case Atom::RawString:
- case Atom::SectionLeft:
- case Atom::SectionHeadingLeft:
- case Atom::SidebarLeft:
- case Atom::SnippetCommand:
- case Atom::SnippetIdentifier:
- case Atom::SnippetLocation:
- case Atom::TableLeft:
- case Atom::TableHeaderLeft:
- case Atom::TableRowLeft:
- case Atom::TableItemLeft:
- case Atom::TableOfContents:
- case Atom::Target:
- return true;
- case Atom::AbstractLeft:
- case Atom::AbstractRight:
- case Atom::AutoLink:
- case Atom::BaseName:
- case Atom::BriefLeft:
- case Atom::BriefRight:
- case Atom::CaptionRight:
- case Atom::FormattingLeft:
- case Atom::FormattingRight:
- case Atom::Nop:
- case Atom::ParaLeft:
- case Atom::ParaRight:
- case Atom::FootnoteRight:
- case Atom::LegaleseRight:
- case Atom::ListTagRight:
- case Atom::ListItemRight:
- case Atom::ListRight:
- case Atom::QuotationRight:
- case Atom::SectionRight:
- case Atom::SectionHeadingRight:
- case Atom::SidebarRight:
- case Atom::String:
- case Atom::TableRight:
- case Atom::TableHeaderRight:
- case Atom::TableRowRight:
- case Atom::TableItemRight:
- default:
- break;
- }
- next = next->next();
- }
- return false;
-}
-
-/*!
- A convenience function to write a qdoc metacommand as a
- doxygen command, without conversion. i.e., some of the
- qdoc metacommands don't require conversion for doxygen.
- */
-void DoxWriter::writeCommand(QCommandMap::const_iterator cmd)
-{
- concatenate("\\" + cmd.key() + " " + cmd.value()[0]);
- newLine();
-}
-
-/*!
- Convert the qdoc commands in the metacommand map to
- doxygen format. This function is called only in pass2().
- The metacommand map contains all the metacommands that
- were found in the qdoc comment that is being converted.
- The metacommands are the ones that begin with the '\'.
- These are not considered part of the text of the comment.
- The text is converted by convertText().
- */
-void DoxWriter::convertMetaCommands()
-{
- QCommandMap& metaCmdMap = priv->metaCommandMap;
- QCommandMap::iterator cmd;
- int c;
-
- currentPage.clear();
- currentFn.clear();
- currentTitle.clear();
- currentEnum.clear();
- currentProperty.clear();
- currentVariable.clear();
- currentClass.clear();
- currentExample.clear();
- currentGroup.clear();
- currentModule.clear();
- currentMacro.clear();
- currentService.clear();
- currentTypedef.clear();
- currentHeaderFile.clear();
- commentType = OtherComment;
-
- if ((cmd = metaCmdMap.find("class")) != metaCmdMap.end()) {
- currentClass = cmd.value()[0];
- if ((c = currentClass.indexOf(' ')) > 0)
- currentClass = currentClass.left(c);
- writeCommand(cmd);
- metaCmdMap.erase(cmd);
- commentType = ClassComment;
- }
- else if ((cmd = metaCmdMap.find("fn")) != metaCmdMap.end()) {
- currentFn = cmd.value()[0];
- writeCommand(cmd);
- metaCmdMap.erase(cmd);
- commentType = FnComment;
- }
- else if ((cmd = metaCmdMap.find("enum")) != metaCmdMap.end()) {
- currentEnum = cmd.value()[0];
- if ((c = currentEnum.lastIndexOf("::")) > 0) {
- currentClass = currentEnum.left(c);
- currentEnum = currentEnum.right(currentEnum.size()-c-2);
- qDebug() << "currentEnum =" << currentEnum;
- qDebug() << "currentClass =" << currentClass;
- }
- writeCommand(cmd);
- metaCmdMap.erase(cmd);
- commentType = EnumComment;
- }
- else if ((cmd = metaCmdMap.find("property")) != metaCmdMap.end()) {
- currentClass = cmd.value()[0];
- if ((c = currentClass.lastIndexOf("::")) > 0) {
- currentProperty = currentClass.right(currentClass.size()-c-2);
- currentClass = currentClass.left(c);
- qDebug() << "currentProperty =" << currentProperty;
- qDebug() << "currentClass =" << currentClass;
- }
- writeCommand(cmd);
- metaCmdMap.erase(cmd);
- commentType = PropertyComment;
- }
- else if ((cmd = metaCmdMap.find("variable")) != metaCmdMap.end()) {
- currentClass = cmd.value()[0];
- if ((c = currentClass.lastIndexOf("::")) > 0) {
- currentVariable = currentClass.right(currentClass.size()-c-2);
- currentClass = currentClass.left(c);
- qDebug() << "currentVariable =" << currentVariable;
- qDebug() << "currentClass =" << currentClass;
- }
- concatenate("\\var " + cmd.value()[0]);
- newLine();
- metaCmdMap.erase(cmd);
- commentType = VariableComment;
- }
-
- if ((cmd = metaCmdMap.find("page")) != metaCmdMap.end()) {
- currentPage = cmd.value()[0];
- QString htmlFile = currentPage;
- const QString* title = getPageTitle(htmlFile);
- QStringList parts = htmlFile.split('.');
- metaCmdMap.erase(cmd);
- if (title) {
- concatenate("\\page " + parts[0] + " " + *title);
- newLine();
- }
- commentType = PageComment;
- qDebug() << "currentPage =" << currentPage;
- }
-
- if ((cmd = metaCmdMap.find("example")) != metaCmdMap.end()) {
- currentExample = cmd.value()[0];
- metaCmdMap.erase(cmd);
- commentType = ExampleComment;
- qDebug() << "currentExample =" << currentExample;
- }
-
- if ((cmd = metaCmdMap.find("macro")) != metaCmdMap.end()) {
- currentMacro = cmd.value()[0];
- metaCmdMap.erase(cmd);
- commentType = MacroComment;
- qDebug() << "currentMacro =" << currentMacro;
- }
-
- if ((cmd = metaCmdMap.find("group")) != metaCmdMap.end()) {
- currentGroup = cmd.value()[0];
- metaCmdMap.erase(cmd);
- commentType = GroupComment;
- qDebug() << "currentGroup =" << currentGroup;
- }
-
- if ((cmd = metaCmdMap.find("module")) != metaCmdMap.end()) {
- currentModule = cmd.value()[0];
- metaCmdMap.erase(cmd);
- commentType = ModuleComment;
- qDebug() << "currentModule =" << currentModule;
- }
-
- if ((cmd = metaCmdMap.find("headerfile")) != metaCmdMap.end()) {
- currentHeaderFile = cmd.value()[0];
- metaCmdMap.erase(cmd);
- commentType = HeaderFileComment;
- qDebug() << "currentHeaderFile =" << currentHeaderFile;
- }
-
- if ((cmd = metaCmdMap.find("typedef")) != metaCmdMap.end()) {
- currentClass = cmd.value()[0];
- if ((c = currentClass.lastIndexOf("::")) > 0) {
- currentTypedef = currentClass.right(currentClass.size()-c-2);
- currentClass = currentClass.left(c);
- }
- metaCmdMap.erase(cmd);
- commentType = TypedefComment;
- qDebug() << "currentTypedef =" << currentTypedef;
- qDebug() << "currentClass =" << currentClass;
- }
-
- cmd = priv->metaCommandMap.begin();
- while (cmd != priv->metaCommandMap.end()) {
- for (int i=0; i<cmd.value().size(); i++) {
- concatenate("\\" + cmd.key() + " " + cmd.value()[i]);
- newLine();
- }
- //qDebug() << " " << cmd.key() << ": " << cmd.value();
- ++cmd;
- }
-}
-
-/*!
- Convert the qdoc text to doxygen format. The metacommands
- are converted by convertMetaCommands(). This function is
- called in pass2().
- */
-void DoxWriter::convertText()
-{
- const Atom* prev = 0;
- const Atom* next = priv->text.firstAtom();
- while (next != 0) {
- next->dump();
- Atom::Type atomType = next->type();
- switch (atomType) {
- case Atom::AbstractLeft:
- break;
- case Atom::AbstractRight:
- break;
- case Atom::AutoLink:
- concatenate(next->string());
- break;
- case Atom::BaseName:
- break;
- case Atom::BriefLeft:
- concatenate("\\brief ");
- break;
- case Atom::BriefRight:
- newLine();
- break;
- case Atom::C:
- tt(next);
- break;
- case Atom::CaptionLeft:
- unhandled(next);
- break;
- case Atom::CaptionRight:
- unhandled(next);
- break;
- case Atom::Code:
- code(next);
- break;
- case Atom::CodeBad:
- code(next);
- break;
- case Atom::CodeNew:
- newLine();
- concatenate("you can rewrite it as");
- code(next);
- break;
- case Atom::CodeOld:
- newLine();
- concatenate("For example, if you have code like");
- code(next);
- break;
- case Atom::CodeQuoteArgument:
- unhandled(next);
- break;
- case Atom::CodeQuoteCommand:
- next = codeQuoteCommand(next);
- break;
- case Atom::FootnoteLeft:
- break;
- case Atom::FootnoteRight:
- break;
- case Atom::FormatElse:
- formatElse();
- break;
- case Atom::FormatEndif:
- formatEndif();
- break;
- case Atom::FormatIf:
- formatIf(next);
- break;
- case Atom::FormattingLeft:
- formattingLeft(next,next->next());
- break;
- case Atom::FormattingRight:
- formattingRight(next,prev);
- break;
- case Atom::GeneratedList:
- break;
- case Atom::Image:
- break;
- case Atom::ImageText:
- break;
- case Atom::InlineImage:
- break;
- case Atom::LegaleseLeft:
- break;
- case Atom::LegaleseRight:
- break;
- case Atom::LineBreak:
- break;
- case Atom::Link:
- next = link(next);
- break;
- case Atom::LinkNode:
- break;
- case Atom::ListLeft:
- {
- bool nested = false;
- if (structs.isEmpty()) {
- const Atom* i = next->next();
- while (i->type() != Atom::ListRight) {
- if ((i->type() == Atom::ListLeft) ||
- (i->type() == Atom::TableLeft)) {
- nested = true;
- break;
- }
- i = i->next();
- }
- }
- else
- nested = true;
- StructDesc d(BulletList,nested);
- if (next->string() == "numeric")
- d.structType = NumericList;
- else if (next->string() == "value") {
- d.structType = ValueList;
- }
- else if (next->string() != "bullet")
- qDebug() << "UNKNOWN LIST TYPE" << next->string();
- structs.push(d);
- if (nested || (d.structType != BulletList)) {
- if (d.structType == BulletList)
- concatenate("<ul>");
- else if (d.structType == NumericList)
- concatenate("<ol>");
- else if (d.structType == ValueList)
- concatenate("<dl>");
- newLine();
- }
- }
- break;
- case Atom::ListItemNumber:
- structs.top().count = next->string().toInt();
- break;
- case Atom::ListTagLeft:
- {
- structs.top().count++;
- concatenate("<dt>");
- const Atom* n = next->next();
- if (n->type() == Atom::String) {
- qDebug() << "ENUM VALUE" << n->string();
- }
- else
- qDebug() << "NOT EN ENUM";
- }
- break;
- case Atom::ListTagRight:
- concatenate("</dt>");
- break;
- case Atom::ListItemLeft:
- {
- newLine();
- const StructDesc& d = structs.top();
- if (d.structType == BulletList) {
- if (!d.nested)
- concatenate("\\arg ");
- else
- concatenate("<li>");
- }
- else if (d.structType == NumericList)
- concatenate("<li>");
- else if (d.structType == ValueList)
- concatenate("<dd>");
- }
- break;
- case Atom::ListItemRight:
- {
- const StructDesc& d = structs.top();
- if (d.structType == BulletList) {
- if (d.nested) {
- concatenate("</li>");
- newLine();
- }
- }
- else if (d.structType == NumericList) {
- concatenate("</li>");
- newLine();
- }
- else if (d.structType == ValueList) {
- concatenate("</dd>");
- newLine();
- }
- }
- break;
- case Atom::ListRight:
- {
- if (!structs.isEmpty()) {
- const StructDesc& d = structs.top();
- if (d.nested || (d.structType != BulletList)) {
- if (d.structType == BulletList)
- concatenate("</ul>");
- else if (d.structType == NumericList)
- concatenate("</ol>");
- else if (d.structType == ValueList)
- concatenate("</dl>");
- newLine();
- }
- structs.pop();
- }
- }
- break;
- case Atom::Nop:
- // nothing.
- break;
- case Atom::ParaLeft:
- if (structs.isEmpty())
- newLine();
- break;
- case Atom::ParaRight:
- {
- if (structs.isEmpty())
- newLine();
- else {
- const StructDesc& d = structs.top();
- if (d.nested || (d.structType != BulletList)) {
- Atom::Type t = next->next()->type();
- if ((t != Atom::ListItemRight) &&
- (t != Atom::TableItemRight))
- newLine();
- }
- else
- newLine();
- }
- }
- break;
- case Atom::QuotationLeft:
- break;
- case Atom::QuotationRight:
- break;
- case Atom::RawString:
- concatenate(next->string());
- break;
- case Atom::SectionLeft:
- // nothing.
- break;
- case Atom::SectionRight:
- // nothing.
- break;
- case Atom::SectionHeadingLeft:
- next = sectionHeading(next);
- break;
- case Atom::SectionHeadingRight:
- newLine();
- break;
- case Atom::SidebarLeft:
- break;
- case Atom::SidebarRight:
- break;
- case Atom::SnippetCommand:
- newLine();
- concatenate("\\snippet ");
- break;
- case Atom::SnippetIdentifier:
- newText += next->string();
- lineLength += next->string().size();
- newLine();
- break;
- case Atom::SnippetLocation:
- newText += next->string() + " ";
- lineLength += next->string().size() + 1;
- break;
- case Atom::String:
- wrap(next->string());
- break;
- case Atom::TableLeft:
- {
- bool nested = false;
- if (structs.isEmpty()) {
- const Atom* i = next->next();
- while (i->type() != Atom::TableRight) {
- if ((i->type() == Atom::ListLeft) ||
- (i->type() == Atom::TableLeft)) {
- nested = true;
- break;
- }
- i = i->next();
- }
- }
- else
- nested = true;
- StructDesc d(Table,nested);
- structs.push(d);
- if (next->string().isEmpty())
- concatenate("<table>");
- else {
- QString attrs = "width=\"" + next->string() + "\"";
- attrs += " align=\"center\"";
- concatenate("<table " + attrs + ">");
- }
- newLine();
- }
- break;
- case Atom::TableRight:
- concatenate("</table>");
- if (!structs.isEmpty())
- structs.pop();
- newLine();
- break;
- case Atom::TableHeaderLeft:
- concatenate("<tr>");
- if (!structs.isEmpty())
- structs.top().inTableHeader = true;
- newLine();
- break;
- case Atom::TableHeaderRight:
- concatenate("</tr>");
- if (!structs.isEmpty())
- structs.top().inTableHeader = false;
- newLine();
- break;
- case Atom::TableRowLeft:
- if (!structs.isEmpty()) {
- structs.top().inTableRow = true;
- concatenate("<tr valign=\"top\" class=\"");
- if (structs.top().odd)
- concatenate("odd\">");
- else
- concatenate("even\">");
- structs.top().odd = !structs.top().odd;
- }
- newLine();
- break;
- case Atom::TableRowRight:
- concatenate("</tr>");
- if (!structs.isEmpty())
- structs.top().inTableRow = false;
- newLine();
- break;
- case Atom::TableItemLeft:
- if (!structs.isEmpty()) {
- structs.top().inTableItem = true;
- concatenate("<td>");
- if (structs.top().inTableHeader)
- concatenate("<b> ");
- }
- break;
- case Atom::TableItemRight:
- if (!structs.isEmpty()) {
- structs.top().inTableItem = false;
- if (structs.top().inTableHeader)
- concatenate(" </b>");
- concatenate("</td>");
- }
- newLine();
- break;
- case Atom::TableOfContents:
- break;
- case Atom::Target:
- {
- QString text = next->string();
- text.remove(ws_rx);
- newLine();
- concatenate("\\anchor ");
- newText += text;
- lineLength += text.size();
- newLine();
- }
- break;
- case Atom::UnhandledFormat:
- unhandled(next);
- break;
- case Atom::UnknownCommand:
- unhandled(next);
- break;
- default:
- //next->dump();
- break;
- }
- prev = next;
- next = next->next();
- }
-}
-
-/*!
-
- Pass one looks for topic commands and target and section
- commands, and maybe other stuff. These are serialized to
- text files, which are read back in by pass2().
- */
-void DoxWriter::pass1()
-{
- QCommandMap& metaCmdMap = priv->metaCommandMap;
- if (!metaCmdMap.isEmpty()) {
- int c;
- QCommandMap::iterator cmd;
- if ((cmd = metaCmdMap.find("enum")) != metaCmdMap.end()) {
- commentType = EnumComment;
- currentEnum = cmd.value()[0];
- if ((c = currentEnum.lastIndexOf("::")) > 0) {
- currentClass = currentEnum.left(c);
- currentEnum = currentEnum.right(currentEnum.size()-c-2);
- qDebug() << "currentEnum =" << currentEnum;
- qDebug() << "currentClass =" << currentClass;
- if (enums.contains(currentEnum,currentClass)) {
- qWarning() << "DoxWriter::pass1():"
- << "Duplicate enum:"
- << currentClass << currentEnum;
- }
- else
- enums.insert(currentEnum,currentClass);
- }
- }
- else if ((cmd = metaCmdMap.find("property")) != metaCmdMap.end()) {
- commentType = PropertyComment;
- currentClass = cmd.value()[0];
- if ((c = currentClass.lastIndexOf("::")) > 0) {
- currentProperty = currentClass.right(currentClass.size()-c-2);
- currentClass = currentClass.left(c);
- qDebug() << "currentProperty =" << currentProperty;
- qDebug() << "currentClass =" << currentClass;
- if (properties.contains(currentProperty,currentClass)) {
- qWarning() << "DoxWriter::pass1():"
- << "Duplicate property:"
- << currentClass << currentProperty;
- }
- else
- properties.insert(currentProperty,currentClass);
- }
- }
- else if ((cmd = metaCmdMap.find("variable")) != metaCmdMap.end()) {
- commentType = VariableComment;
- currentClass = cmd.value()[0];
- if ((c = currentClass.lastIndexOf("::")) > 0) {
- currentVariable = currentClass.right(currentClass.size()-c-2);
- currentClass = currentClass.left(c);
- qDebug() << "currentVariable =" << currentVariable;
- qDebug() << "currentClass =" << currentClass;
- if (variables.contains(currentVariable,currentClass)) {
- qWarning() << "DoxWriter::pass1():"
- << "Duplicate variable:"
- << currentClass << currentVariable;
- }
- else
- variables.insert(currentVariable,currentClass);
- }
- }
- }
-
- /*
- */
- const Atom* next = priv->text.firstAtom();
- while (next != 0) {
- switch (next->type()) {
- case Atom::SectionHeadingLeft:
- {
- QString text;
- next = next->next();
- while (next) {
- if (next->type() == Atom::SectionHeadingRight)
- break;
- else
- text += next->string();
- next = next->next();
- }
- //text.remove(ws_rx);
- insertAnchor(text);
- }
- break;
- case Atom::Target:
- {
- QString text = next->string();
- //text.remove(ws_rx);
- insertAnchor(text);
- }
- default:
- break;
- }
- next = next->next();
- }
-}
-
-/*!
- Output a parsed, tokenized qdoc comment as a doxygen
- comment in diff format for input to the patch command.
- */
-void DoxWriter::pass2()
-{
- if (!conversionRequired()) {
- qDebug() << "NO CONVERSION - FILE:" << priv->start_loc.fileName()
- << "START:" << priv->start_loc.lineNo()
- << "END:" << priv->end_loc.lineNo() - 1;
- return;
- }
-
- /*
- Transformation to doxygen required...
- */
- newText = "\n/*! \n";
- convertMetaCommands();
- convertText();
- if (newText[newText.size()-1] == ' ')
- newText.remove(newText.size()-1,1);
- newText += " */\n";
- qDebug() << "CONVERTED COMMENT - FILE:" << priv->start_loc.fileName()
- << "START:" << priv->start_loc.lineNo()
- << "END:" << priv->end_loc.lineNo() - 1;
- qDebug() << newText;
-}
-
-/*!
- Unparse the second parameter of a "\l" command.
- */
-const Atom* DoxWriter::link(const Atom* atom)
-{
- QString first_text = atom->string();
- QString second_text;
- const QString* value = 0;
-
- const Atom* next = atom->next(Atom::FormattingLeft,Atom::LINK_);
- if (next) {
- next->dump();
- while (1) {
- next = next->next();
- next->dump();
- if (next->type() == Atom::FormattingRight) {
- if (next->string() == Atom::LINK_)
- break;
- else {
- // ignore it.
- }
- }
- else
- second_text += next->string();
- }
- int i = first_text.indexOf('#');
- if (i >= 0)
- first_text = first_text.right(first_text.size() - i - 1);
- //newLine();
- if ((value = getExternalPage(first_text))) {
- //qDebug() << "USED AN EXTERNAL PAGE TITLE" << first_text;
- QString href = "<a href=\""+*value+"\">"+first_text+"</a>";
- concatenate(href);
- }
- else if (first_text.startsWith("http:",Qt::CaseInsensitive)) {
- if (first_text == second_text) {
- concatenate(first_text);
- }
- else {
- QString href = "<a href=\""+first_text+"\">"+second_text+"</a>";
- concatenate(href);
- }
- }
- else if ((value = getPageFile(first_text))) {
- //qDebug() << "USED A PAGE TITLE" << first_text;
- QStringList parts = (*value).split('.');
- QString ref = "\\ref " + parts[0] + " \"" + second_text + "\"";
- concatenate(ref);
- }
- else if ((value = getGroup(first_text))) {
- //qDebug() << "USED A GROUP TITLE" << first_text;
- concatenate("\\ref " + *value + " \"" + second_text + "\"");
- }
- else if ((value = getModule(first_text))) {
- //qDebug() << "USED A MODULE TITLE" << first_text;
- concatenate("\\ref " + *value + " \"" + second_text + "\"");
- }
- else if ((value = getExamplePath(first_text))) {
- //qDebug() << "USED AN EXAMPLE TITLE" << first_text;
- first_text.remove(ws_rx);
- QString ref = "\\ref " + first_text + " \"" + second_text + "\"";
- concatenate(ref);
- }
- else if ((value = getFile(first_text))) {
- //qDebug() << "USED A FILE TITLE" << first_text;
- // I think this command is no longer available.
- first_text.remove(ws_rx);
- QString ref = "\\ref " + first_text + " \"" + second_text + "\"";
- concatenate(ref);
- }
- else if ((value = getHeaderFile(first_text))) {
- //qDebug() << "USED A HEADER FILE TITLE" << first_text;
- first_text.remove(ws_rx);
- QString ref = "\\ref " + first_text + " \"" + second_text + "\"";
- concatenate(ref);
- }
- else if (isAnchor(first_text)) {
- //qDebug() << "USED AN ANCHOR" << first_text;
- first_text.remove(ws_rx);
- QString ref = "\\ref " + first_text + " \"" + second_text + "\"";
- concatenate(ref);
- }
- else if ((value = getPageTitle(first_text))) {
- //qDebug() << "USED AN INVERSE PAGE TITLE" << first_text;
- QStringList parts = first_text.split('.');
- QString ref = "\\ref " + parts[0] + " \"" + second_text + "\"";
- concatenate(ref);
- }
- else if ((value = getExampleTitle(first_text))) {
- //qDebug() << "USED AN INVERSE EXAMPLE TITLE" << first_text;
- QString title = *value;
- title.remove(ws_rx);
- QString ref = "\\ref " + title + " \"" + second_text + "\"";
- concatenate(ref);
- }
- else if ((value = getGroupTitle(first_text))) {
- //qDebug() << "USED AN INVERSE GROUP TITLE" << first_text;
- concatenate("\\ref " + first_text + " \"" + second_text + "\"");
- }
- else if ((value = getModuleTitle(first_text))) {
- //qDebug() << "USED AN INVERSE MODULE TITLE" << first_text;
- concatenate("\\ref " + first_text + " \"" + second_text + "\"");
- }
- else if ((value = getFileTitle(first_text))) {
- qDebug() << "USED AN INVERSE FILE TITLE" << first_text;
- }
- else if ((value = getHeaderFileTitle(first_text))) {
- qDebug() << "USED AN INVERSE HEADER FILE TITLE" << first_text;
- }
- else if ((first_text.indexOf("::") >= 0) ||
- (first_text.indexOf("()") >= 0) ||
- (first_text[0] == 'Q')) {
- //qDebug() << "AUTO-LINKABLE" << first_text;
- if (first_text == second_text)
- concatenate(first_text);
- else {
- QString link = first_text + " " + second_text;
- concatenate("\\link " + link + "\\endlink");
- }
- }
- else {
- QString link;
- QStringList propertyClasses;
- QStringList variableClasses;
- QStringList enumClasses;
- bool p = isProperty(first_text,propertyClasses);
- bool v = isVariable(first_text,variableClasses);
- bool e = isEnum(first_text,enumClasses);
- if (e) {
- if (enumClasses.size() == 1)
- link = enumClasses[0];
- else if (enumClasses.contains(currentClass))
- link = currentClass;
- else {
- QString msg = "Unqualified enum name: " + first_text;
- QString details = "Classes: " + enumClasses.join(", ");
- priv->start_loc.error(msg,details);
- }
- if (!link.isEmpty())
- qDebug() << "FOUND ENUM" << link << first_text;
- }
- else if (p && v) {
- if (propertyClasses.size() == 1) {
- if (variableClasses.size() == 1) {
- if (propertyClasses[0] == variableClasses[0])
- link = propertyClasses[0];
- }
- }
- if (link.isEmpty()) {
- if (propertyClasses.contains(currentClass) ||
- variableClasses.contains(currentClass))
- link = currentClass;
- else {
- propertyClasses += variableClasses;
- QString msg = "Unqualified property or variable name: "
- + first_text;
- QString details = "Classes: " +
- propertyClasses.join(", ");
- priv->start_loc.error(msg,details);
- }
- }
- }
- else if (p) {
- if (propertyClasses.size() == 1)
- link = propertyClasses[0];
- else if (propertyClasses.contains(currentClass))
- link = currentClass;
- else {
- QString msg = "Unqualified property name: " + first_text;
- QString details = "Classes: " + propertyClasses.join(", ");
- priv->start_loc.error(msg,details);
- }
- }
- else if (v) {
- if (variableClasses.size() == 1)
- link = variableClasses[0];
- else if (variableClasses.contains(currentClass))
- link = currentClass;
- else {
- QString msg = "Unqualified variable name: " + first_text;
- QString details = "Classes: " + variableClasses.join(", ");
- priv->start_loc.error(msg,details);
- }
- }
- else {
- qDebug() << "NOT AUTO-LINKABLE" << first_text;
- QString s = first_text + " " + second_text;
- concatenate("\\link " + s + "\\endlink");
- }
- if (!link.isEmpty()) {
- link += "::" + first_text + " " + second_text;
- concatenate("\\link " + link + "\\endlink");
- }
- }
- }
- else
- qDebug() << "LINK with no second parameter!!!!";
- return next? next : atom;
-}
-
-/*!
- If the current line length is 0, the current line is
- indented according to the context.
- */
-void DoxWriter::indentLine()
-{
- if (lineLength == 0) {
- newText += DOXYGEN_INDENT_STRING;
- lineLength = DOXYGEN_INDENT;
- if (!structs.isEmpty()) {
- for (int i=1; i<structs.size(); ++i) {
- newText += DOXYGEN_TAB_STRING;
- lineLength += DOXYGEN_TAB_SIZE;
- }
- }
- }
-}
-
-/*!
- Concatenates a newline to the doxygen text, increments the
- line count, and resets the line length to 0.
- */
-void DoxWriter::newLine()
-{
- newText += "\n";
- ++lineCount;
- lineLength = 0;
-}
-
-static const int maxLineLength = 70;
-
-/*!
- Concatenate the \a text to the doxygen comment currently
- under construction and increment the current line length
- by the size of the \a text.
-
- If incrementing the current line length by the \a text size
- would make the current line length longer than the maximum
- line length, then call newLine() and indentLine() \e before
- concatenating the \a text.
- */
-void DoxWriter::concatenate(QString text)
-{
- if ((lineLength + text.size()) > maxLineLength)
- newLine();
- indentLine();
- newText += text;
- lineLength += text.size();
-}
-
-static bool punctuation(QChar c)
-{
- switch (c.toAscii()) {
- case '.':
- case ',':
- case ':':
- case ';':
- case '/':
- case '+':
- case '-':
- case '?':
- case '!':
- case '\"':
- return true;
- default:
- break;
- }
- return false;
-}
-
-/*!
- Concatenate the \a text string to the doxygen text, doing
- line wrapping where necessary.
- */
-void DoxWriter::wrap(QString text)
-{
- int from = 0;
- int to = -1;
-
- if ((lineLength == 0) || (lineLength >= maxLineLength)) {
- if (!text.isEmpty() && (text[0] == ' '))
- text = text.right(text.size() - 1);
- }
-
- indentLine();
- while (text.size()) {
- int avail = maxLineLength - lineLength;
- from = text.indexOf(' ',from);
- if (from >= 0) {
- if (from < avail)
- to = from++;
- else if (from == 1 && punctuation(text[0]))
- to = from++;
- else {
- if (to >= 0) {
- newText += text.left(to+1);
- lineLength += to + 1;
- text = text.right(text.size() - to - 1);
- }
- else {
- newLine();
- indentLine();
- newText += text.left(from+1);
- lineLength += from + 1;
- text = text.right(text.size() - from - 1);
- }
- from = 0;
- to = -1;
- if (text.size() && (lineLength > maxLineLength)) {
- newLine();
- indentLine();
- }
- }
- }
- else
- break;
- }
- if (text.size()) {
- if (lineLength >= maxLineLength) {
- newLine();
- indentLine();
- }
- newText += text;
- lineLength += text.size();
- }
-}
-
-/*!
- This will output something, but it depends on what the
- \a atom string and the \a next atom string are.
- */
-void DoxWriter::formattingLeft(const Atom* atom, const Atom* next)
-{
- if (atom->string() == "parameter") {
- concatenate("\\a ");
- return;
- }
- else if (atom->string() == "underline") {
- concatenate("<u>");
- return;
- }
- else if (atom->string() == "superscript") {
- concatenate("<sup>");
- return;
- }
- else if (atom->string() == "subscript") {
- concatenate("<sub>");
- return;
- }
- int ws = -1;
- if (next)
- ws = next->string().indexOf(ws_rx);
- if (atom->string() == "bold") {
- if (ws < 0)
- concatenate("\\b ");
- else
- concatenate("<b>");
- }
- else if (atom->string() == "italic") {
- if (ws < 0)
- concatenate("\\e ");
- else
- concatenate("<i>");
- }
- else if (atom->string() == "teletype") {
- if (ws < 0)
- concatenate("\\c ");
- else
- concatenate("<tt>");
- }
- else
- qDebug() << "UNHANDLED FormattingLeft: " << atom->string();
-}
-
-/*!
- This will output something, but it depends on what the
- \a atom string and the \a prev atom string are.
- */
-void DoxWriter::formattingRight(const Atom* atom, const Atom* prev)
-{
- if (atom->string() == "parameter")
- return;
- else if (atom->string() == "underline") {
- concatenate("</u>");
- return;
- }
- else if (atom->string() == "superscript") {
- concatenate("</sup>");
- return;
- }
- else if (atom->string() == "subscript") {
- concatenate("</sub>");
- return;
- }
- int ws = -1;
- if (prev)
- ws = prev->string().indexOf(ws_rx);
- if (ws < 0)
- return;
- if (atom->string() == "bold")
- concatenate("</b>");
- else if (atom->string() == "italic")
- concatenate("</i>");
- else if (atom->string() == "teletype")
- concatenate("</tt>");
- else
- qDebug() << "UNHANDLED FormattingRight: " << atom->string();
-}
-
-/*!
- Output a \c or a <tt>...</tt>.
- */
-void DoxWriter::tt(const Atom* atom)
-{
- if (atom->string().indexOf(ws_rx) < 0) {
- concatenate("\\c ");
- concatenate(atom->string());
- }
- else {
- concatenate("<tt>");
- concatenate(atom->string());
- concatenate("</tt>");
- }
-}
-
-/*!
- */
-void DoxWriter::formatIf(const Atom* atom)
-{
- if (atom->string() == "HTML") {
- newLine();
- concatenate("\\htmlonly");
- newLine();
- }
-}
-
-/*!
- */
-void DoxWriter::formatEndif()
-{
- newLine();
- concatenate("\\endhtmlonly");
- newLine();
-}
-
-/*!
- */
-void DoxWriter::formatElse()
-{
- // nothing.
-}
-
-/*!
- Pass 1: Construct a section identifier and insert it into
- the anchor set.
-
- Pass 2: Convert section1, section2, and section3 commands
- to section, subsection, and subsubsection respectively.
- Warn if a section command higher than 3 is seen.
- */
-const Atom* DoxWriter::sectionHeading(const Atom* atom)
-{
- QString heading_level = atom->string();
- QString heading_text;
- const Atom* next = atom->next();
- while (next) {
- next->dump();
- if (next->type() == Atom::SectionHeadingRight) {
- if (next->string() == heading_level)
- break;
- else {
- qDebug() << "WRONG SectionHeading number!!!!";
- }
- }
- else
- heading_text += next->string();
- next = next->next();
- }
-
- QString heading_identifier = heading_text;
- heading_identifier.remove(ws_rx);
-
- newLine();
- if (heading_level == "1")
- heading_level = "\\section ";
- else if (heading_level == "2")
- heading_level = "\\subsection ";
- else if (heading_level == "3")
- heading_level = "\\subsubsection ";
- else if (heading_level == "4") {
- heading_level = "\\subsubsection ";
- qDebug() << "WARNING section4 converted to \\subsubsection";
- }
- else {
- heading_level = "\\subsubsection ";
- qDebug() << "WARNING section5 converted to \\subsubsection";
- }
- concatenate(heading_level);
- newText += heading_identifier + " ";
- lineLength += heading_identifier.size() + 1;
- newText += heading_text;
- lineLength += heading_text.size();
- newLine();
- return next? next : atom;
-}
-
-/*!
- Report an unhandled atom.
- */
-void DoxWriter::unhandled(const Atom* atom)
-{
- qDebug() << "UNHANDLED ATOM";
- atom->dump();
-}
-
-/*!
- Output a code/endcode block.
- */
-void DoxWriter::code(const Atom* atom)
-{
- newLine();
- concatenate("\\code");
- writeCode(atom->string());
- concatenate("\\endcode");
- newLine();
-}
-
-/*!
- Output a code/endcode block depending on the
- CodeQuote Command and CodeQuoteArgument parameters.
- */
-const Atom* DoxWriter::codeQuoteCommand(const Atom* atom)
-{
- QString command = atom->string();
- atom = atom->next();
- concatenate("\\code");
- if (command == "codeline") {
- newLine();
- concatenate(atom->string());
- newLine();
- }
- else if (command == "dots") {
- newLine();
- concatenate(atom->string());
- newLine();
- }
- else {
- writeCode(atom->string());
- }
- concatenate("\\endcode");
- return atom;
-}
-
-/*!
- Appends a block of code to the comment.
- */
-void DoxWriter::writeCode(QString text)
-{
- int cr_count = text.count('\n') - 1;
- if (cr_count >= 0) {
- int last_cr = text.lastIndexOf('\n');
- newText += text.left(last_cr);
- lineCount += cr_count;
- }
- else
- newText += text;
- newLine();
-}
-
-/*!
- Inserts \a text into the anchor set. This function is called
- during doxygen pass 1.
- */
-void DoxWriter::insertAnchor(const QString& text)
-{
- anchors.insert(text);
-}
-
-/*!
- Returns true if \a text identifies an anchor, section,
- subsection, subsubsection, or page.
- */
-bool DoxWriter::isAnchor(const QString& text)
-{
- return anchors.contains(text);
-}
-
-/*!
- Write the set of anchors to a file, one per line.
- */
-void DoxWriter::writeAnchors()
-{
- QFile file("anchors.txt");
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- qWarning("Unable to open anchors.txt for writing.");
- return;
- }
-
- QTextStream out(&file);
- QSet<QString>::const_iterator i = anchors.constBegin();
- while (i != anchors.constEnd()) {
- out << *i << "\n";
- ++i;
- }
- file.close();
-}
-
-/*!
- Read the set of anchors from the anchors file, one per line,
- and insert each one into the anchor set.
- */
-void DoxWriter::readAnchors()
-{
- QFile file("anchors.txt");
- if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- qWarning("Unable to open anchors.txt for reading.");
- return;
- }
-
- QTextStream in(&file);
- while (!in.atEnd()) {
- QString line = in.readLine();
- anchors.insert(line);
- }
- file.close();
-#if 0
- QSet<QString>::const_iterator i = anchors.constBegin();
- while (i != anchors.constEnd()) {
- qDebug() << *i;
- ++i;
- }
-#endif
-}
-
-/*!
- Inserts \a title into one of the title maps. \a title is
- mapped to the \a node name. This function is called during
- doxygen pass 1.
- */
-void DoxWriter::insertTitle(FakeNode* node, const QString& title)
-{
- switch (node->subType()) {
- case Node::Example:
- if (exampleTitles.contains(title)) {
- qWarning() << "DoxWriter::insertTitle():"
- << "Duplicate example title:"
- << title;
- }
- else {
- exampleTitles[title] = node->name();
- exampleTitlesInverse[node->name()] = title;
- }
- break;
- case Node::HeaderFile:
- if (headerFileTitles.contains(title)) {
- qWarning() << "DoxWriter::insertTitle():"
- << "Duplicate header file title:"
- << title;
- }
- else {
- headerFileTitles[title] = node->name();
- headerFileTitlesInverse[node->name()] = title;
- }
- break;
- case Node::File:
- if (fileTitles.contains(title)) {
- qWarning() << "DoxWriter::insertTitle():"
- << "Duplicate file title:"
- << title;
- }
- else {
- fileTitles[title] = node->name();
- fileTitlesInverse[node->name()] = title;
- }
- break;
- case Node::Group:
- if (groupTitles.contains(title)) {
- qWarning() << "DoxWriter::insertTitle():"
- << "Duplicate group title:"
- << title;
- }
- else {
- groupTitles[title] = node->name();
- groupTitlesInverse[node->name()] = title;
- }
- break;
- case Node::Module:
- if (moduleTitles.contains(title)) {
- qWarning() << "DoxWriter::insertTitle():"
- << "Duplicate module title:"
- << title;
- }
- else {
- moduleTitles[title] = node->name();
- moduleTitlesInverse[node->name()] = title;
- }
- break;
- case Node::Page:
- if (pageTitles.contains(title)) {
- qWarning() << "DoxWriter::insertTitle():"
- << "Duplicate page title:"
- << title;
- }
- else {
- pageTitles[title] = node->name();
- pageTitlesInverse[node->name()] = title;
- }
- break;
- case Node::ExternalPage:
- if (externalPageTitles.contains(title)) {
- qWarning() << "DoxWriter::insertTitle():"
- << "Duplicate external page title:"
- << title;
- }
- else {
- externalPageTitles[title] = node->name();
- externalPageTitlesInverse[node->name()] = title;
- }
- break;
- default:
- break;
- }
-}
-
-/*!
- */
-const QString* DoxWriter::getPageFile(const QString& title)
-{
- QStringMapEntry entry = pageTitles.find(title);
- return (entry == pageTitles.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getExamplePath(const QString& title)
-{
- QStringMapEntry entry = exampleTitles.find(title);
- return (entry == exampleTitles.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getFile(const QString& title)
-{
- QStringMapEntry entry = fileTitles.find(title);
- return (entry == fileTitles.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getHeaderFile(const QString& title)
-{
- QStringMapEntry entry = headerFileTitles.find(title);
- return (entry == headerFileTitles.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getGroup(const QString& title)
-{
- QStringMapEntry entry = groupTitles.find(title);
- return (entry == groupTitles.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getModule(const QString& title)
-{
- QStringMapEntry entry = moduleTitles.find(title);
- return (entry == moduleTitles.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getExternalPage(const QString& title)
-{
- QStringMapEntry entry = externalPageTitles.find(title);
- return (entry == externalPageTitles.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getPageTitle(const QString& text)
-{
- QStringMapEntry entry = pageTitlesInverse.find(text);
- return (entry == pageTitlesInverse.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getExampleTitle(const QString& text)
-{
- QStringMapEntry entry = exampleTitlesInverse.find(text);
- return (entry == exampleTitlesInverse.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getFileTitle(const QString& text)
-{
- QStringMapEntry entry = fileTitlesInverse.find(text);
- return (entry == fileTitlesInverse.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getHeaderFileTitle(const QString& text)
-{
- QStringMapEntry entry = headerFileTitlesInverse.find(text);
- return (entry == headerFileTitlesInverse.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getGroupTitle(const QString& text)
-{
- QStringMapEntry entry = groupTitlesInverse.find(text);
- return (entry == groupTitlesInverse.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getModuleTitle(const QString& text)
-{
- QStringMapEntry entry = moduleTitlesInverse.find(text);
- return (entry == moduleTitlesInverse.end()) ? 0 : &entry.value();
-}
-
-/*!
- */
-const QString* DoxWriter::getExternalPageTitle(const QString& text)
-{
- QStringMapEntry entry = externalPageTitlesInverse.find(text);
- return (entry == externalPageTitlesInverse.end()) ? 0 : &entry.value();
-}
-
-/*!
- Serialize \a map to file \a name.
- */
-void DoxWriter::writeMap(const QStringMap& map, const QString& name)
-{
-
- QFile file(name);
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- qWarning() << "Unable to open" << name << "for writing.";
- return;
- }
-
- QTextStream out(&file);
- QStringMap::const_iterator i = map.constBegin();
- while (i != map.constEnd()) {
- out << i.key() << "\n";
- out << i.value() << "\n";
- ++i;
- }
- file.close();
-}
-
-/*!
- Read file \a name into the \a map.
- */
-void DoxWriter::readMap(QStringMap& map, QStringMap& inverseMap, const QString& name)
-{
- QFile file(name);
- if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- qWarning() << "Unable to open" << name << "for reading.";
- return;
- }
-
- QTextStream in(&file);
- while (!in.atEnd()) {
- QString title = in.readLine();
- QString value = in.readLine();
- map[title] = value;
- inverseMap[value] = title;
- }
- file.close();
-}
-
-/*!
- Write the sets of titles to text files, one per line.
- */
-void DoxWriter::writeTitles()
-{
- if (!pageTitles.isEmpty())
- writeMap(pageTitles,"pagetitles.txt");
- if (!fileTitles.isEmpty())
- writeMap(fileTitles,"filetitles.txt");
- if (!headerFileTitles.isEmpty())
- writeMap(headerFileTitles,"headerfiletitles.txt");
- if (!exampleTitles.isEmpty())
- writeMap(exampleTitles,"exampletitles.txt");
- if (!moduleTitles.isEmpty())
- writeMap(moduleTitles,"moduletitles.txt");
- if (!groupTitles.isEmpty())
- writeMap(groupTitles,"grouptitles.txt");
- if (!externalPageTitles.isEmpty())
- writeMap(externalPageTitles,"externalpagetitles.txt");
-}
-
-/*!
- Read the sets of titles from the titles files, one per line,
- and insert each one into the appropriate title set.
- */
-void DoxWriter::readTitles()
-{
- readMap(pageTitles,pageTitlesInverse,"pagetitles.txt");
- readMap(fileTitles,fileTitlesInverse,"filetitles.txt");
- readMap(headerFileTitles,headerFileTitlesInverse,"headerfiletitles.txt");
- readMap(exampleTitles,exampleTitlesInverse,"exampletitles.txt");
- readMap(moduleTitles,moduleTitlesInverse,"moduletitles.txt");
- readMap(groupTitles,groupTitlesInverse,"grouptitles.txt");
- readMap(externalPageTitles,
- externalPageTitlesInverse,
- "externalpagetitles.txt");
-}
-
-/*!
- Serialize \a map to file \a name.
- */
-void DoxWriter::writeMultiMap(const QStringMultiMap& map, const QString& name)
-{
-
- QFile file(name);
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- qWarning() << "Unable to open" << name << "for writing.";
- return;
- }
-
- QTextStream out(&file);
- QStringMultiMap::const_iterator i = map.constBegin();
- while (i != map.constEnd()) {
- out << i.key() << "\n";
- out << i.value() << "\n";
- ++i;
- }
- file.close();
-}
-
-/*!
- Write the4 property names and variable names to text files.
- */
-void DoxWriter::writeMembers()
-{
- if (!variables.isEmpty())
- writeMultiMap(variables,"variables.txt");
- if (!properties.isEmpty())
- writeMultiMap(properties,"properties.txt");
- if (!enums.isEmpty())
- writeMultiMap(enums,"enums.txt");
-}
-
-/*!
- Read file \a name into the \a map.
- */
-void DoxWriter::readMultiMap(QStringMultiMap& map, const QString& name)
-{
- QFile file(name);
- if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- qWarning() << "Unable to open" << name << "for reading.";
- return;
- }
-
- QTextStream in(&file);
- while (!in.atEnd()) {
- QString member = in.readLine();
- QString className = in.readLine();
- map.insert(member,className);
- }
- file.close();
-}
-
-/*!
- Read the property names and variable names from the test files.
- */
-void DoxWriter::readMembers()
-{
- readMultiMap(variables,"variables.txt");
- readMultiMap(properties,"properties.txt");
- readMultiMap(enums,"enums.txt");
-}
-
-/*!
- Return true if \a name is a property. Loads \a classes with
- the names of all the classes in which \a name is a property.
- */
-bool DoxWriter::isProperty(const QString& name, QStringList& classes)
-{
- classes = properties.values(name);
- return !classes.isEmpty();
-}
-
-/*!
- Return true if \a name is a variable. Loads \a classes with
- the names of all the classes in which \a name is a variable.
- */
-bool DoxWriter::isVariable(const QString& name, QStringList& classes)
-{
- classes = variables.values(name);
- return !classes.isEmpty();
-}
-
-/*!
- Return true if \a name is an enum type. Loads \a classes with
- the names of all the classes in which \a name is an enum type.
- */
-bool DoxWriter::isEnum(const QString& name, QStringList& classes)
-{
- classes = enums.values(name);
- return !classes.isEmpty();
-}
-#endif
-
QT_END_NAMESPACE
diff --git a/tools/qdoc3/doc.h b/tools/qdoc3/doc.h
index 6cb6f0a..2c1d29e 100644
--- a/tools/qdoc3/doc.h
+++ b/tools/qdoc3/doc.h
@@ -133,183 +133,6 @@ class Doc
DocPrivate *priv;
};
-#ifdef QDOC2DOX
-
-class DoxWriter
-{
- public:
- DoxWriter(const QString& source, DocPrivate* docPrivate)
- : commentType(OtherComment),
- lineLength(0),
- lineCount(0),
- priv(docPrivate),
- oldText(source) {}
- ~DoxWriter() {}
-
- void pass1();
- void pass2();
-
- static void setDoxPass(int pass);
- static bool isDoxPass(int pass);
- static bool isDoxPass();
- static void insertTitle(FakeNode* node, const QString& title);
- static void writeTitles();
- static void readTitles();
- static void writeMembers();
- static void readMembers();
- static void writeAnchors();
- static void readAnchors();
-
- private:
- void indentLine();
- void newLine();
- void concatenate(QString text);
- void wrap(QString text);
- bool conversionRequired() const;
- void convertMetaCommands();
- void convertText();
- const Atom* link(const Atom* atom);
- void formattingLeft(const Atom* atom, const Atom* next);
- void formattingRight(const Atom* atom, const Atom* prev);
- void tt(const Atom* atom);
- void formatIf(const Atom* atom);
- void formatEndif();
- void formatElse();
- const Atom* sectionHeading(const Atom* atom);
- void unhandled(const Atom* atom);
- void code(const Atom* atom);
- const Atom* codeQuoteCommand(const Atom* atom);
- void writeCode(QString text);
- void writeCommand(QCommandMap::const_iterator cmd);
-
- static void insertAnchor(const QString& text);
- static bool isAnchor(const QString& text);
-
- static const QString* getPageFile(const QString& title);
- static const QString* getFile(const QString& title);
- static const QString* getExamplePath(const QString& title);
- static const QString* getHeaderFile(const QString& title);
- static const QString* getGroup(const QString& title);
- static const QString* getModule(const QString& title);
- static const QString* getExternalPage(const QString& title);
- static const QString* getPageTitle(const QString& text);
- static const QString* getFileTitle(const QString& text);
- static const QString* getExampleTitle(const QString& text);
- static const QString* getHeaderFileTitle(const QString& text);
- static const QString* getGroupTitle(const QString& text);
- static const QString* getModuleTitle(const QString& text);
- static const QString* getExternalPageTitle(const QString& text);
-
- static bool isProperty(const QString& title, QStringList& classes);
- static bool isVariable(const QString& title, QStringList& classes);
- static bool isEnum(const QString& title, QStringList& classes);
-
- private:
- static void writeMap(const QStringMap& map, const QString& name);
- static void readMap(QStringMap& map,
- QStringMap& inverseMap,
- const QString& name);
- static void writeMultiMap(const QStringMultiMap& map, const QString& name);
- static void readMultiMap(QStringMultiMap& map, const QString& name);
-
- public: // VS 6, SunCC need this to be public
- enum StructType { BulletList, NumericList, ValueList, Table };
- private:
- struct StructDesc {
- StructType structType;
- int count;
- bool nested;
- bool inTableHeader;
- bool inTableRow;
- bool inTableItem;
- bool odd;
-
- StructDesc()
- : structType(BulletList),
- count(0),
- nested(false),
- inTableHeader(false),
- inTableRow(false),
- inTableItem(false),
- odd(true) { }
-
- StructDesc(StructType t, bool n)
- : structType(t),
- count(0),
- nested(n),
- inTableHeader(false),
- inTableRow(false),
- inTableItem(false),
- odd(true) { }
- };
-
- typedef QStack<StructDesc> StructStack;
-
- enum CommentType {
- ClassComment,
- EnumComment,
- ExampleComment,
- FnComment,
- GroupComment,
- HeaderFileComment,
- MacroComment,
- ModuleComment,
- PageComment,
- PropertyComment,
- ServiceComment,
- TypedefComment,
- VariableComment,
- OtherComment
- };
-
- private:
- CommentType commentType;
- int lineLength;
- int lineCount;
- DocPrivate* priv;
- QString oldText;
- QString newText;
- StructStack structs;
-
- QString currentPage;
- QString currentFn;
- QString currentTitle;
- QString currentEnum;
- QString currentProperty;
- QString currentVariable;
- QString currentExample;
- QString currentGroup;
- QString currentModule;
- QString currentMacro;
- QString currentService;
- QString currentTypedef;
- QString currentHeaderFile;
- static QString currentClass;
-
- static int doxPass;
- static QSet<QString> anchors;
- static QStringMap exampleTitles;
- static QStringMap headerFileTitles;
- static QStringMap fileTitles;
- static QStringMap groupTitles;
- static QStringMap moduleTitles;
- static QStringMap pageTitles;
- static QStringMap externalPageTitles;
- static QStringMap exampleTitlesInverse;
- static QStringMap headerFileTitlesInverse;
- static QStringMap fileTitlesInverse;
- static QStringMap groupTitlesInverse;
- static QStringMap moduleTitlesInverse;
- static QStringMap pageTitlesInverse;
- static QStringMap externalPageTitlesInverse;
-
- static QStringMultiMap variables;
- static QStringMultiMap properties;
- static QStringMultiMap enums;
-};
-
-#endif
-
QT_END_NAMESPACE
#endif
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index fd1a2e6..c2d2d22 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -2386,23 +2386,19 @@ void HtmlGenerator::generateSectionList(const Section& section,
if (name_alignment) {
out() << "<tr><td class=\"memItemLeft\" "
- << "nowrap align=\"right\" valign=\"top\">";
+ << "align=\"right\" valign=\"top\">";
}
else {
if (twoColumn && i == (int) (section.members.count() + 1) / 2)
out() << "</ul></td><td valign=\"top\"><ul>\n";
- out() << "<li><div class=\"fn\"></div>";
+ out() << "<li><div class=\"fn\">";
}
- if (style == CodeMarker::Accessors)
- out() << "<b>";
generateSynopsis(*m, relative, marker, style, name_alignment);
- if (style == CodeMarker::Accessors)
- out() << "</b>";
if (name_alignment)
out() << "</td></tr>\n";
else
- out() << "</li>\n";
+ out() << "</div></li>\n";
i++;
++m;
}
@@ -2467,8 +2463,10 @@ void HtmlGenerator::generateSynopsis(const Node *node,
marked.replace("<@param>", "<i>");
marked.replace("</@param>", "</i>");
- if (style == CodeMarker::Summary)
- marked.replace("@name>", "b>");
+ if (style == CodeMarker::Summary) {
+ marked.replace("<@name>", ""); // was "<b>"
+ marked.replace("</@name>", ""); // was "</b>"
+ }
if (style == CodeMarker::SeparateList) {
QRegExp extraRegExp("<@extra>.*</@extra>");
@@ -3290,7 +3288,7 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
section.members += property->resetters();
if (!section.members.isEmpty()) {
- out() << "<p>Access functions:</p>\n";
+ out() << "<p><b>Access functions:</b></p>\n";
generateSectionList(section, node, marker, CodeMarker::Accessors);
}
}
diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp
index 3e6f832..514d06e 100644
--- a/tools/qdoc3/main.cpp
+++ b/tools/qdoc3/main.cpp
@@ -43,6 +43,7 @@
main.cpp
*/
+#include <qglobal.h>
#include <QtCore>
#include <stdlib.h>
#include "apigenerator.h"
@@ -97,8 +98,6 @@ static bool slow = false;
static QStringList defines;
static QHash<QString, Tree *> trees;
-//static int doxygen = 0;
-
/*!
Find the Tree for language \a lang and return a pointer to it.
If there is no Tree for language \a lang in the Tree table, add
@@ -136,7 +135,8 @@ static void printHelp()
*/
static void printVersion()
{
- Location::information(tr("qdoc version 4.4.1"));
+ QString s = QString(tr("qdoc version ")) + QString(QT_VERSION_STR);
+ Location::information(s);
}
/*!
@@ -222,18 +222,6 @@ static void processQdocconfFile(const QString &fileName)
QString lang = config.getString(CONFIG_LANGUAGE);
Location langLocation = config.lastLocation();
-#ifdef QDOC2DOX
- // qdoc -> doxygen
- if (doxygen == 2) {
- qDebug() << "READING anchors.txt";
- DoxWriter::readAnchors();
- qDebug() << "READING title maps";
- DoxWriter::readTitles();
- qDebug() << "READING member multimaps";
- DoxWriter::readMembers();
- }
-#endif
-
/*
Initialize the tree where all the parsed sources will be stored.
The tree gets built as the source files are parsed, and then the
@@ -320,17 +308,6 @@ static void processQdocconfFile(const QString &fileName)
tree->resolveGroups();
tree->resolveTargets();
-#ifdef QDOC2DOX
- // qdoc -> doxygen
- if (doxygen == 1) {
- DoxWriter::writeAnchors();
- DoxWriter::writeTitles();
- DoxWriter::writeMembers();
- }
-
- if (doxygen == 0) {
-#endif
-
/*
Now the tree has been built, and all the stuff that needed
resolving has been resolved. Now it is time to traverse
@@ -355,11 +332,6 @@ static void processQdocconfFile(const QString &fileName)
tree->setVersion("");
Generator::terminate();
-
-#ifdef QDOC2DOX
- }
-#endif
-
CodeParser::terminate();
CodeMarker::terminate();
CppToQsConverter::terminate();
@@ -454,26 +426,6 @@ int main(int argc, char **argv)
else if (opt == "-slow") {
slow = true;
}
-
-#ifdef QDOC2DOX
- else if (opt == "-doxygen1") {
- // qdoc -> doxygen
- // Don't use this; it isn't ready yet.
- // Now it's a fossil.
- qDebug() << "doxygen pass 1";
- doxygen = 1;
- DoxWriter::setDoxPass(1);
- }
- else if (opt == "-doxygen2") {
- // qdoc -> doxygen
- // Don't use this; it isn't ready yet.
- // Now it's a fossil.
- qDebug() << "doxygen pass 2";
- doxygen = 2;
- DoxWriter::setDoxPass(2);
- }
-#endif
-
else {
qdocFiles.append(opt);
}
diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css
index c35c633..aef6c5d 100644
--- a/tools/qdoc3/test/classic.css
+++ b/tools/qdoc3/test/classic.css
@@ -1,9 +1,6 @@
BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
font-family: Arial, Geneva, Helvetica, sans-serif;
}
-BODY,TD {
- font-size: 90%;
-}
H1 {
text-align: center;
font-size: 160%;
@@ -86,6 +83,7 @@ table td.memItemLeft {
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
+ white-space: nowrap
}
table td.memItemRight {
padding: 1px 8px 0px 8px;
@@ -127,10 +125,10 @@ table.annotated td {
table tr pre
{
- padding-top: none;
- padding-bottom: none;
- padding-left: none;
- padding-right: none;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ padding-left: 0px;
+ padding-right: 0px;
border: none;
background: none
}
diff --git a/tools/shared/qttoolbardialog/qttoolbardialog.cpp b/tools/shared/qttoolbardialog/qttoolbardialog.cpp
index f15c4bc..9c54e75 100644
--- a/tools/shared/qttoolbardialog/qttoolbardialog.cpp
+++ b/tools/shared/qttoolbardialog/qttoolbardialog.cpp
@@ -637,10 +637,10 @@ QToolBar *QtFullToolBarManager::createToolBar(const QString &toolBarName)
return 0;
QToolBar *toolBar = new QToolBar(toolBarName, mainWindow());
int i = 1;
- const QString prefix = QLatin1String("_Custom_Toolbar_");
- QString name = QString(QLatin1String("%1%2")).arg(prefix).arg(i);
+ const QString prefix = QLatin1String("_Custom_Toolbar_%1");
+ QString name = prefix.arg(i);
while (d_ptr->toolBarByName(name))
- name = QString(QLatin1String("%1%2")).arg(prefix).arg(++i);
+ name = prefix.arg(++i);
toolBar->setObjectName(name);
mainWindow()->addToolBar(toolBar);
d_ptr->customToolBars.append(toolBar);
diff --git a/translations/assistant_da.ts b/translations/assistant_da.ts
new file mode 100644
index 0000000..8d134fc
--- /dev/null
+++ b/translations/assistant_da.ts
@@ -0,0 +1,1166 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="da">
+<context>
+ <name>AboutDialog</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/aboutdialog.cpp" line="+110"/>
+ <source>&amp;Close</source>
+ <translation>&amp;Luk</translation>
+ </message>
+</context>
+<context>
+ <name>AboutLabel</name>
+ <message>
+ <location line="-14"/>
+ <source>Warning</source>
+ <translation>Advarsel</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Unable to launch external application.
+</source>
+ <translation>Kunne ikke starte ekstern applikation.
+</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>OK</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>BookmarkDialog</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="+185"/>
+ <location line="+18"/>
+ <location line="+36"/>
+ <location line="+24"/>
+ <location line="+32"/>
+ <source>Bookmarks</source>
+ <translation>Favoritter</translation>
+ </message>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/bookmarkdialog.ui"/>
+ <source>Add Bookmark</source>
+ <translation>Føj til Favoritter</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Bookmark:</source>
+ <translation>Favorit:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Add in Folder:</source>
+ <translation>Føj til mappen:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>+</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location/>
+ <source>New Folder</source>
+ <translation>Ny mappe</translation>
+ </message>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="-69"/>
+ <source>Delete Folder</source>
+ <translation>Slet mappe</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Rename Folder</source>
+ <translation>Omdøb mappe</translation>
+ </message>
+</context>
+<context>
+ <name>BookmarkManager</name>
+ <message>
+ <location line="+450"/>
+ <source>Bookmarks</source>
+ <translation>Favoritter</translation>
+ </message>
+ <message>
+ <location line="+36"/>
+ <source>Remove</source>
+ <translation>Fjern</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>You are going to delete a Folder, this will also&lt;br&gt;remove it&apos;s content. Are you sure to continue?</source>
+ <translation>Ved at slette denne mappe fjernes hele mappens&lt;br&gt;indhold. Ønsker du alligevel at slette?</translation>
+ </message>
+ <message>
+ <location line="+109"/>
+ <location line="+9"/>
+ <source>New Folder</source>
+ <translation>Ny mappe</translation>
+ </message>
+ <message>
+ <source>You are about to delete a folder which means that its content&lt;br&gt;will also be removed. Do you want to continue?</source>
+ <translation type="obsolete">Ved at slette denne mappe fjernes hele mappens indhold.&lt;br&gt;Ønsker du alligevel at slette?</translation>
+ </message>
+</context>
+<context>
+ <name>BookmarkWidget</name>
+ <message>
+ <location line="-391"/>
+ <source>Filter:</source>
+ <translation>Filter:</translation>
+ </message>
+ <message>
+ <location line="+32"/>
+ <source>Remove</source>
+ <translation>Fjern</translation>
+ </message>
+ <message>
+ <location line="-78"/>
+ <source>Delete Folder</source>
+ <translation>Slet mappe</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Rename Folder</source>
+ <translation>Omdøb mappe</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Show Bookmark</source>
+ <translation>Vis favorit</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show Bookmark in New Tab</source>
+ <translation>Vis favorit på ny fane</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Delete Bookmark</source>
+ <translation>Slet favorit</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Rename Bookmark</source>
+ <translation>Omdøb favorit</translation>
+ </message>
+ <message>
+ <source>Search for:</source>
+ <translation type="obsolete">Søg efter:</translation>
+ </message>
+ <message>
+ <location line="+61"/>
+ <source>Add</source>
+ <translation>Tilføj</translation>
+ </message>
+</context>
+<context>
+ <name>CentralWidget</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="+208"/>
+ <source>Add new page</source>
+ <translation>Tilføj ny side</translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>Close current page</source>
+ <translation>Luk nuværende side</translation>
+ </message>
+ <message>
+ <location line="+282"/>
+ <source>Print Document</source>
+ <translation>Udskriv dokument</translation>
+ </message>
+ <message>
+ <location line="+148"/>
+ <location line="+2"/>
+ <source>unknown</source>
+ <translation>ukendt</translation>
+ </message>
+ <message>
+ <location line="+91"/>
+ <source>Add New Page</source>
+ <translation>Tilføj ny side</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Close This Page</source>
+ <translation>Luk denne side</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Close Other Pages</source>
+ <translation>Luk de andre sider</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Add Bookmark for this Page...</source>
+ <translation>Føj denne side til Favoritter...</translation>
+ </message>
+ <message>
+ <location line="+259"/>
+ <source>Search</source>
+ <translation>Søg</translation>
+ </message>
+</context>
+<context>
+ <name>ContentWindow</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/contentwindow.cpp" line="+155"/>
+ <source>Open Link</source>
+ <translation>Åbn link</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Open Link in New Tab</source>
+ <translation>Åbn link på ny fane</translation>
+ </message>
+</context>
+<context>
+ <name>FilterNameDialogClass</name>
+ <message>
+ <source>FilterNameDialog</source>
+ <translation type="obsolete">FilterNavnDialog</translation>
+ </message>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/filternamedialog.ui"/>
+ <source>Filter Name:</source>
+ <translation>Filternavn:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Add Filter Name</source>
+ <translation>Tilføj filternavn</translation>
+ </message>
+</context>
+<context>
+ <name>FindWidget</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="-876"/>
+ <source>&lt;img src=&quot;:/trolltech/assistant/images/wrap.png&quot;&gt;&amp;nbsp;Search wrapped</source>
+ <translation>&lt;img src=&quot;:/trolltech/assistant/images/wrap.png&quot;&gt;&amp;nbsp;Søgning gentaget fra start</translation>
+ </message>
+ <message>
+ <location line="-23"/>
+ <source>Previous</source>
+ <translation>Forrige</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Next</source>
+ <translation>Næste</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Case Sensitive</source>
+ <translation>Der skelnes mellem store og små bogstaver</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Whole words</source>
+ <translation>Hele ord</translation>
+ </message>
+ <message>
+ <source>&lt;img src=&quot;%1&quot;&gt;&amp;nbsp;Search wrapped</source>
+ <oldsource>&lt;img src=&quot;:/trolltech/assistant/images/wrap.png&quot;&gt;&amp;nbsp;Search wrapped</oldsource>
+ <translation type="obsolete">&lt;img src=&quot;%1&quot;&gt;&amp;nbsp;Søgning startet forfra</translation>
+ </message>
+</context>
+<context>
+ <name>FontPanel</name>
+ <message>
+ <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="+63"/>
+ <source>Font</source>
+ <translation>Skrifttype</translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>&amp;Writing system</source>
+ <translation>&amp;Skrivesystem</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>&amp;Family</source>
+ <translation>&amp;Familie</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>&amp;Style</source>
+ <translation>&amp;Stil</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>&amp;Point size</source>
+ <translation>&amp;Punktstørrelse</translation>
+ </message>
+</context>
+<context>
+ <name>HelpViewer</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/helpviewer.cpp" line="+492"/>
+ <source>Help</source>
+ <translation>Hjælp</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-62"/>
+ <source>&lt;title&gt;Error 404...&lt;/title&gt;&lt;div align=&quot;center&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;h1&gt;The page could not be found&lt;/h1&gt;&lt;br&gt;&lt;h3&gt;&apos;%1&apos;&lt;/h3&gt;&lt;/div&gt;</source>
+ <translation>&lt;title&gt;Fejl 404...&lt;/title&gt;&lt;div align=&quot;center&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;h1&gt;Siden blev ikke fundet&lt;/h1&gt;&lt;br&gt;&lt;h3&gt;&apos;%1&apos;&lt;/h3&gt;&lt;/div&gt;</translation>
+ </message>
+ <message>
+ <location line="+125"/>
+ <source>Copy &amp;Link Location</source>
+ <translation>Kopiér &amp;linkets placering</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Open Link in New Tab Ctrl+LMB</source>
+ <translation>Åbn link på ny fane Ctrl+LMB</translation>
+ </message>
+ <message>
+ <location line="-275"/>
+ <source>Open Link in New Tab</source>
+ <translation>Åbn link på ny fane</translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;Page not found:&lt;p&gt;%1.&lt;/p&gt;&lt;/b&gt;</source>
+ <translation type="obsolete">&lt;b&gt;Kunne ikke finde siden:&lt;p&gt;%1.&lt;/p&gt;&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location line="+209"/>
+ <source>Unable to launch external application.
+</source>
+ <translation>Kunne ikke starte ekstern applikation.
+</translation>
+ </message>
+</context>
+<context>
+ <name>IndexWindow</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/indexwindow.cpp" line="+66"/>
+ <source>&amp;Look for:</source>
+ <translation>&amp;Søg efter:</translation>
+ </message>
+ <message>
+ <location line="+68"/>
+ <source>Open Link</source>
+ <translation>Åbn link</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Open Link in New Tab</source>
+ <translation>Åbn link på ny fane</translation>
+ </message>
+</context>
+<context>
+ <name>InstallDialog</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="+75"/>
+ <location filename="../tools/assistant/tools/assistant/installdialog.ui"/>
+ <source>Install Documentation</source>
+ <translation>Installér dokumentation</translation>
+ </message>
+ <message>
+ <location line="+30"/>
+ <source>Downloading documentation info...</source>
+ <translation>Downloader dokumentationsinformation...</translation>
+ </message>
+ <message>
+ <location line="+48"/>
+ <source>Download canceled.</source>
+ <translation>Download blev annulleret.</translation>
+ </message>
+ <message>
+ <location line="+26"/>
+ <location line="+78"/>
+ <location line="+27"/>
+ <source>Done.</source>
+ <translation>Færdig.</translation>
+ </message>
+ <message>
+ <location line="-90"/>
+ <source>The file %1 already exists. Do you want to overwrite it?</source>
+ <translation>Filen %1 findes allerede. Ønsker du at overskrive?</translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>Unable to save the file %1: %2.</source>
+ <translation>Kunne ikke gemme filen %1: %2.</translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>Downloading %1...</source>
+ <translation>Downloader %1...</translation>
+ </message>
+ <message>
+ <location line="+19"/>
+ <location line="+42"/>
+ <location line="+38"/>
+ <source>Download failed: %1.</source>
+ <translation>Download mislykkedes: %1.</translation>
+ </message>
+ <message>
+ <location line="-70"/>
+ <source>Documentation info file is corrupt!</source>
+ <translation>Dokumentationsinformationsfilen er ødelagt!</translation>
+ </message>
+ <message>
+ <location line="+37"/>
+ <source>Download failed: Downloaded file is corrupted.</source>
+ <translation>Download mislykkedes: Den downloadede fil er ødelagt.</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Installing documentation %1...</source>
+ <translation>Installerer dokumentation %1...</translation>
+ </message>
+ <message>
+ <location line="+22"/>
+ <source>Error while installing documentation:
+%1</source>
+ <translation>Der opstod fejl under installation af dokumentation:
+%1</translation>
+ </message>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/installdialog.ui"/>
+ <source>Available Documentation:</source>
+ <translation>Tilgængeligt dokumentation:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Install</source>
+ <translation>Installér</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Cancel</source>
+ <translation>Annuller</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Close</source>
+ <translation>Luk</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Installation Path:</source>
+ <translation>Installationssti:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>...</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="+108"/>
+ <location line="+354"/>
+ <source>Index</source>
+ <translation>Indeks</translation>
+ </message>
+ <message>
+ <location line="-348"/>
+ <location line="+346"/>
+ <source>Contents</source>
+ <translation>Indhold</translation>
+ </message>
+ <message>
+ <location line="-341"/>
+ <location line="+345"/>
+ <source>Bookmarks</source>
+ <translation>Favoritter</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Search</source>
+ <translation>Søg</translation>
+ </message>
+ <message>
+ <location line="-335"/>
+ <location line="+208"/>
+ <location line="+476"/>
+ <source>Qt Assistant</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-508"/>
+ <location line="+5"/>
+ <source>Unfiltered</source>
+ <translation>Ufiltreret</translation>
+ </message>
+ <message>
+ <location line="+84"/>
+ <source>Page Set&amp;up...</source>
+ <translation>Side&amp;opsætning...</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Print Preview...</source>
+ <translation>Vis udskrift...</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>&amp;Print...</source>
+ <translation>&amp;Udskriv...</translation>
+ </message>
+ <message>
+ <source>CTRL+P</source>
+ <translation type="obsolete">Ctrl+U</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>New &amp;Tab</source>
+ <translation>&amp;Ny Fane</translation>
+ </message>
+ <message>
+ <source>CTRL+T</source>
+ <translation type="obsolete">Ctrl+N</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>&amp;Close Tab</source>
+ <translation>&amp;Luk fane</translation>
+ </message>
+ <message>
+ <source>CTRL+W</source>
+ <translation type="obsolete">Ctrl+L</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>&amp;Quit</source>
+ <translation>&amp;Afslut</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>CTRL+Q</source>
+ <translation>Ctrl+A</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>&amp;Copy selected Text</source>
+ <translation>&amp;Kopiér markeret tekst</translation>
+ </message>
+ <message>
+ <source>Ctrl+C</source>
+ <translation type="obsolete">Ctrl+K</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>&amp;Find in Text...</source>
+ <translation>&amp;Find i tekst...</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Find &amp;Next</source>
+ <translation>Find N&amp;æste</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Find &amp;Previous</source>
+ <translation>Find fo&amp;rrige</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Preferences...</source>
+ <translation>Indstillinger...</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Zoom &amp;in</source>
+ <translation>Zoom &amp;ind</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Zoom &amp;out</source>
+ <translation>Zoom u&amp;d</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Normal &amp;Size</source>
+ <translation>Normal &amp;størrelse</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Ctrl+0</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>ALT+C</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>ALT+I</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>ALT+S</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>&amp;Home</source>
+ <translation>&amp;Hjem</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Ctrl+Home</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>&amp;Back</source>
+ <translation>&amp;Tilbage</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>&amp;Forward</source>
+ <translation>Fr&amp;em</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Sync with Table of Contents</source>
+ <translation>Synkronisér med Indholdsfortegnelse</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Next Page</source>
+ <translation>Næste side</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Ctrl+Alt+Right</source>
+ <translation>Ctrl+Alt+Højre</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Previous Page</source>
+ <translation>Forrige side</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Ctrl+Alt+Left</source>
+ <translation>Ctrl+Alt+Venstre</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Add Bookmark...</source>
+ <translation>Føj til Favoritter...</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>About...</source>
+ <translation>Om...</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Navigation Toolbar</source>
+ <translation>Navigationsværktøjslinie</translation>
+ </message>
+ <message>
+ <location line="+76"/>
+ <source>Toolbars</source>
+ <translation>Værktøjslinier</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Filter Toolbar</source>
+ <translation>Filtrer værktøjslinie</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Filtered by:</source>
+ <translation>Filtreret efter:</translation>
+ </message>
+ <message>
+ <location line="+23"/>
+ <source>Address Toolbar</source>
+ <translation>Adresseværktøjslinie</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Address:</source>
+ <translation>Adresse:</translation>
+ </message>
+ <message>
+ <location line="+114"/>
+ <source>Could not find the associated content item.</source>
+ <translation>Det tilhørende indholdselement kunne ikke findes.</translation>
+ </message>
+ <message>
+ <source>This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development.</source>
+ <translation type="obsolete">Denne version af Qt Assistant er en del af Qt Open Source Edition til brug med henblik på udvikling af Open Source-applikationer. Qt er et omfattende C++ framework for cross-platform applikationsudvikling.</translation>
+ </message>
+ <message>
+ <source>This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution.</source>
+ <translation type="obsolete">Dette program er omfattet af Qt Commercial License Agreement. Se filen LICENCE, der var vedlagt denne software-distribution, for yderligere detaljer.</translation>
+ </message>
+ <message>
+ <location line="+81"/>
+ <source>About %1</source>
+ <translation>Om %1</translation>
+ </message>
+ <message>
+ <location line="+113"/>
+ <source>Updating search index</source>
+ <translation>Opdaterer søgeindeks</translation>
+ </message>
+ <message>
+ <location line="-601"/>
+ <source>Looking for Qt Documentation...</source>
+ <translation>Søger efter Qt-dokumentation...</translation>
+ </message>
+ <message>
+ <location line="+195"/>
+ <source>&amp;Window</source>
+ <translation>&amp;Vindue</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Minimize</source>
+ <translation>Minimér</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Ctrl+M</source>
+ <translation>Ctrl+M</translation>
+ </message>
+ <message>
+ <location line="-2"/>
+ <source>Zoom</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-136"/>
+ <source>&amp;File</source>
+ <translation>&amp;Filer</translation>
+ </message>
+ <message>
+ <location line="+24"/>
+ <source>&amp;Edit</source>
+ <translation>&amp;Redigér</translation>
+ </message>
+ <message>
+ <location line="+24"/>
+ <source>&amp;View</source>
+ <translation>&amp;Vis</translation>
+ </message>
+ <message>
+ <location line="+27"/>
+ <source>&amp;Go</source>
+ <translation>&amp;Gå til</translation>
+ </message>
+ <message>
+ <location line="+29"/>
+ <source>&amp;Bookmarks</source>
+ <translation>F&amp;avoritter</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>&amp;Help</source>
+ <translation>&amp;Hjælp</translation>
+ </message>
+ <message>
+ <location line="-37"/>
+ <source>ALT+O</source>
+ <translation>Alt+F</translation>
+ </message>
+ <message>
+ <location line="+35"/>
+ <source>CTRL+D</source>
+ <translation>Ctrl+Ø</translation>
+ </message>
+ <message>
+ <source>Ctrl+P</source>
+ <translation type="obsolete">Ctrl+U</translation>
+ </message>
+ <message>
+ <source>Ctrl+T</source>
+ <translation type="obsolete">Ctrl+N</translation>
+ </message>
+ <message>
+ <source>Ctrl+W</source>
+ <translation type="obsolete">Ctrl+L</translation>
+ </message>
+ <message>
+ <source>Ctrl+Q</source>
+ <translation type="obsolete">Ctrl+A</translation>
+ </message>
+ <message>
+ <source>Alt+C</source>
+ <translation type="obsolete">Alt+L</translation>
+ </message>
+ <message>
+ <source>Alt+O</source>
+ <translation type="obsolete">Alt+F</translation>
+ </message>
+ <message>
+ <source>Ctrl+D</source>
+ <translation type="obsolete">Ctrl+Ø</translation>
+ </message>
+</context>
+<context>
+ <name>PreferencesDialog</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="+256"/>
+ <location line="+43"/>
+ <source>Add Documentation</source>
+ <translation>Tilføj dokumentation</translation>
+ </message>
+ <message>
+ <location line="-43"/>
+ <source>Qt Compressed Help Files (*.qch)</source>
+ <translation>Qt komprimeret hjælpefil (*.qch)</translation>
+ </message>
+ <message>
+ <location line="+37"/>
+ <source>The specified file is not a valid Qt Help File!</source>
+ <translation>Den anførte fil er ikke en gyldig Qt hjælpefil!</translation>
+ </message>
+ <message>
+ <location line="-8"/>
+ <source>The namespace %1 is already registered!</source>
+ <translation>Navnerummet %1 er allerede registreret!</translation>
+ </message>
+ <message>
+ <location line="+31"/>
+ <source>Remove Documentation</source>
+ <translation>Fjern dokumentation</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents.</source>
+ <translation>Nogle dokumenter der pt er åbne i Assistant refererer til den dokumentation du prøver at fjerne. Fjernelse af dokumentation vil resultere i lukning af disse dokumenter.</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Cancel</source>
+ <translation>Annuller</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+86"/>
+ <source>Use custom settings</source>
+ <translation>Benyt brugerdefineret opsætning</translation>
+ </message>
+</context>
+<context>
+ <name>PreferencesDialogClass</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui"/>
+ <source>Preferences</source>
+ <translation>Indstillinger</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Fonts</source>
+ <translation>Skrifttyper</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Font settings:</source>
+ <translation>Indstillinger for skrifttype:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Browser</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location/>
+ <source>Application</source>
+ <translation>Applikation</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Filters</source>
+ <translation>Filtre</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Filter:</source>
+ <translation>Filter:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Attributes:</source>
+ <translation>Attributter:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>1</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location/>
+ <source>Add</source>
+ <translation>Tilføj</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Remove</source>
+ <translation>Fjern</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Documentation</source>
+ <translation>Dokumentation</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Registered Documentation:</source>
+ <translation>Registreret dokumentation:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Add...</source>
+ <translation>Tilføj...</translation>
+ </message>
+ <message>
+ <source>Network</source>
+ <translation type="obsolete">Netværk</translation>
+ </message>
+ <message>
+ <source>Use Http Proxy</source>
+ <translation type="obsolete">Benyt Http Proxy</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Options</source>
+ <translation>Indstillinger</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Homepage</source>
+ <translation>Hjemmeside</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Current Page</source>
+ <translation>Nuværende side</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Restore to default</source>
+ <translation>Nulstil til default</translation>
+ </message>
+</context>
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="+112"/>
+ <source>The specified collection file does not exist!</source>
+ <translation>Den angivne hjælpesamling findes ikke!</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Missing collection file!</source>
+ <translation>Hjælpesamling mangler!</translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>Invalid URL!</source>
+ <translation>Ugyldig URL!</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Missing URL!</source>
+ <translation>URL mangler!</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <location line="+19"/>
+ <location line="+19"/>
+ <source>Unknown widget: %1</source>
+ <translation>Ukendt widget: %1</translation>
+ </message>
+ <message>
+ <location line="-34"/>
+ <location line="+19"/>
+ <location line="+19"/>
+ <source>Missing widget!</source>
+ <translation>Widget mangler!</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <location line="+12"/>
+ <source>The specified Qt help file does not exist!</source>
+ <translation>Den angivne Qt-hjælpefil findes ikke! </translation>
+ </message>
+ <message>
+ <location line="-7"/>
+ <location line="+12"/>
+ <source>Missing help file!</source>
+ <translation>Hjælpefilen mangler! </translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Missing filter argument!</source>
+ <translation>Manglende filterargument!</translation>
+ </message>
+ <message>
+ <location line="+12"/>
+ <source>Unknown option: %1</source>
+ <translation>Ukendt parameter: %1 </translation>
+ </message>
+ <message>
+ <location line="+30"/>
+ <location line="+2"/>
+ <source>Qt Assistant</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/main.cpp" line="+203"/>
+ <source>Could not register documentation file
+%1
+
+Reason:
+%2</source>
+ <translation>Kunne ikke registrere dokumentationsfil
+%1
+
+Årsag:
+%2</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Documentation successfully registered.</source>
+ <translation>Dokumentationen blev registreret.</translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>Could not unregister documentation file
+%1
+
+Reason:
+%2</source>
+ <translation>Kunne ikke afregistrere dokumentationsfil
+%1
+
+Årsag:
+%2</translation>
+ </message>
+ <message>
+ <location line="-3"/>
+ <source>Documentation successfully unregistered.</source>
+ <translation>Dokumentationen blev afregistreret.</translation>
+ </message>
+ <message>
+ <location line="+40"/>
+ <source>Cannot load sqlite database driver!</source>
+ <translation>Kan ikke indlæse sqlite database-driver!</translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>The specified collection file could not be read!</source>
+ <translation>Den angivne hjælpesamling kunne ikke læses!</translation>
+ </message>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="+167"/>
+ <location line="+1"/>
+ <source>Bookmark</source>
+ <translation>Favorit</translation>
+ </message>
+</context>
+<context>
+ <name>QtDocInstaller</name>
+ <message>
+ <source>The file %1 could not be registered successfully!
+
+Reason: %2</source>
+ <translation type="obsolete">Filen %1 kunne ikke registreres!
+
+Årsag: %2</translation>
+ </message>
+</context>
+<context>
+ <name>RemoteControl</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/remotecontrol.cpp" line="+157"/>
+ <source>Debugging Remote Control</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Received Command: %1 %2</source>
+ <translation>Modtaget kommando: %1 %2</translation>
+ </message>
+</context>
+<context>
+ <name>SearchWidget</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/searchwidget.cpp" line="+195"/>
+ <source>&amp;Copy</source>
+ <translation>&amp;Kopiér</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Copy &amp;Link Location</source>
+ <translation>Kopiér &amp;linkets placering</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Open Link in New Tab</source>
+ <translation>Åbn link på ny fane</translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>Select All</source>
+ <translation>Markér alt</translation>
+ </message>
+ <message>
+ <source>Open Link</source>
+ <translation type="obsolete">Åbn link</translation>
+ </message>
+</context>
+<context>
+ <name>TopicChooser</name>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/topicchooser.cpp" line="+54"/>
+ <source>Choose a topic for &lt;b&gt;%1&lt;/b&gt;:</source>
+ <translation>Vælg et emne for &lt;b&gt;%1&lt;/b&gt;:</translation>
+ </message>
+ <message>
+ <location filename="../tools/assistant/tools/assistant/topicchooser.ui"/>
+ <source>Choose Topic</source>
+ <translation>Vælg emne</translation>
+ </message>
+ <message>
+ <location/>
+ <source>&amp;Topics</source>
+ <translation>&amp;Emner</translation>
+ </message>
+ <message>
+ <location/>
+ <source>&amp;Display</source>
+ <translation>&amp;Vis</translation>
+ </message>
+ <message>
+ <location/>
+ <source>&amp;Close</source>
+ <translation>&amp;Luk</translation>
+ </message>
+ <message>
+ <source>TopicChooser</source>
+ <translation type="obsolete">Emnevælger</translation>
+ </message>
+ <message>
+ <source>unnamed</source>
+ <translation type="obsolete">unavngivet</translation>
+ </message>
+</context>
+</TS>
diff --git a/translations/linguist_ja.qm b/translations/linguist_ja.qm
index cdb7c1c..a377318 100644
--- a/translations/linguist_ja.qm
+++ b/translations/linguist_ja.qm
Binary files differ
diff --git a/translations/linguist_ja.ts b/translations/linguist_ja.ts
index 7af3ebb..685af88 100644
--- a/translations/linguist_ja.ts
+++ b/translations/linguist_ja.ts
@@ -6,7 +6,7 @@
<message>
<location filename="../tools/linguist/linguist/phrasebookbox.cpp" line="+59"/>
<source>(New Entry)</source>
- <translation type="unfinished"></translation>
+ <translation>(新しい項目)</translation>
</message>
</context>
<context>
@@ -48,74 +48,74 @@
<message>
<location line="-37"/>
<source>Batch Translation of &apos;%1&apos; - Qt Linguist</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; の一括翻訳 - Qt Linguist</translation>
</message>
<message numerus="yes">
<location line="+80"/>
<source>Batch translated %n entries</source>
- <translation type="unfinished">
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%n 項目が一括翻訳されました</numerusform>
</translation>
</message>
<message>
<location filename="../tools/linguist/linguist/batchtranslation.ui"/>
<source>Qt Linguist - Batch Translation</source>
- <translation type="unfinished">Qt Linguist - 一括翻訳</translation>
+ <translation>Qt Linguist - 一括翻訳</translation>
</message>
<message>
<location/>
<source>Options</source>
- <translation type="unfinished">オプション</translation>
+ <translation>オプション</translation>
</message>
<message>
<location/>
<source>Set translated entries to finished</source>
- <translation type="unfinished">翻訳された項目を完了にする</translation>
+ <translation>翻訳された項目を完了にする</translation>
</message>
<message>
<location/>
<source>Retranslate entries with existing translation</source>
- <translation type="unfinished"></translation>
+ <translation>訳語がある項目を再度翻訳する</translation>
</message>
<message>
<location/>
<source>Note that the modified entries will be reset to unfinished if &apos;Set translated entries to finished&apos; above is unchecked.</source>
- <translation type="unfinished"></translation>
+ <translation>注意:&apos;翻訳された項目を完了にする&apos;にチェックがついていない場合、翻訳された項目は未完了になります.</translation>
</message>
<message>
<location/>
<source>Translate also finished entries</source>
- <translation type="unfinished"></translation>
+ <translation>完了している項目も翻訳する</translation>
</message>
<message>
<location/>
<source>Phrase book preference</source>
- <translation type="unfinished">フレーズブックの優先度</translation>
+ <translation>フレーズブックの設定</translation>
</message>
<message>
<location/>
<source>Move up</source>
- <translation type="unfinished">上に移動</translation>
+ <translation>上に移動</translation>
</message>
<message>
<location/>
<source>Move down</source>
- <translation type="unfinished">下に移動</translation>
+ <translation>下に移動</translation>
</message>
<message>
<location/>
<source>The batch translator will search through the selected phrase books in the order given above.</source>
- <translation type="unfinished"></translation>
+ <translation>一括翻訳機能は、上記で選択された順にフレーズブックを検索します。</translation>
</message>
<message>
<location/>
<source>&amp;Run</source>
- <translation type="unfinished">実行(&amp;R)</translation>
+ <translation>実行(&amp;R)</translation>
</message>
<message>
<location/>
<source>Cancel</source>
- <translation type="unfinished">キャンセル</translation>
+ <translation>キャンセル</translation>
</message>
</context>
<context>
@@ -138,38 +138,39 @@
<message>
<location filename="../tools/linguist/linguist/messagemodel.cpp" line="+214"/>
<source>&lt;qt&gt;Duplicate messages found in &apos;%1&apos;:</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;qt&gt;&apos;%1&apos; に重複したメッセージが見つかりました:</translation>
</message>
<message>
<location line="+4"/>
<source>&lt;p&gt;[more duplicates omitted]</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;p&gt;[さらに重複している部分は省略されました]</translation>
</message>
<message>
<location line="+3"/>
<source>&lt;p&gt;* Context: %1&lt;br&gt;* Source: %2</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;p&gt;* コンテキスト: %1&lt;br&gt;* ソーステキスト: %2</translation>
</message>
<message>
<location line="+3"/>
<source>&lt;br&gt;* Comment: %3</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;br&gt;* コメント: %3</translation>
</message>
<message>
<location line="+70"/>
<source>Linguist does not know the plural rules for &apos;%1&apos;.
Will assume a single universal form.</source>
- <translation type="unfinished"></translation>
+ <translation>Linguist は&apos;%1&apos;の複数のルールを知りません。
+単一の共通形式とみなします。</translation>
</message>
<message>
<location line="+56"/>
<source>Cannot create &apos;%2&apos;: %1</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%2&apos; を作成できません: %1</translation>
</message>
<message>
<location line="+56"/>
<source>Universal Form</source>
- <translation type="unfinished"></translation>
+ <translation>共通形式</translation>
</message>
</context>
<context>
@@ -200,37 +201,37 @@ Will assume a single universal form.</source>
<message>
<location filename="../tools/linguist/linguist/errorsview.cpp" line="+76"/>
<source>Accelerator possibly superfluous in translation.</source>
- <translation type="unfinished">訳に余分なアクセラレータがついています。</translation>
+ <translation>訳に余分なアクセラレータがついています。</translation>
</message>
<message>
<location line="+3"/>
<source>Accelerator possibly missing in translation.</source>
- <translation type="unfinished">訳にアクセラレータが欠けています。</translation>
+ <translation>訳にアクセラレータが欠けています。</translation>
</message>
<message>
<location line="+3"/>
<source>Translation does not end with the same punctuation as the source text.</source>
- <translation type="unfinished">訳がソーステキストと同じ句読点で終わっていません。</translation>
+ <translation>訳がソーステキストと同じ句読点で終わっていません。</translation>
</message>
<message>
<location line="+3"/>
<source>A phrase book suggestion for &apos;%1&apos; was ignored.</source>
- <translation type="unfinished">&apos;%1&apos; についてのフレーズブックの示唆を無視しています。</translation>
+ <translation>&apos;%1&apos; についてのフレーズブックの示唆を無視しています。</translation>
</message>
<message>
<location line="+3"/>
<source>Translation does not refer to the same place markers as in the source text.</source>
- <translation type="unfinished">訳語にはソーステキストと同じ数の &quot;%&quot; がありません。</translation>
+ <translation>訳語にはソーステキストと同じ数の &quot;%&quot; がありません。</translation>
</message>
<message>
<location line="+3"/>
<source>Translation does not contain the necessary %n place marker.</source>
- <translation type="unfinished"></translation>
+ <translation>訳語に必要な %n 個のプレースマーカー &quot;%&quot; がありません。</translation>
</message>
<message>
<location line="+3"/>
<source>Unknown error</source>
- <translation type="unfinished"></translation>
+ <translation>未知のエラー</translation>
</message>
</context>
<context>
@@ -248,37 +249,37 @@ Will assume a single universal form.</source>
<message>
<location/>
<source>Find</source>
- <translation type="unfinished"></translation>
+ <translation>検索</translation>
</message>
<message>
<location/>
<source>&amp;Find what:</source>
- <translation type="unfinished"></translation>
+ <translation>検索する文字列(&amp;F):</translation>
</message>
<message>
<location/>
<source>&amp;Source texts</source>
- <translation type="unfinished"></translation>
+ <translation>ソーステキスト(&amp;S)</translation>
</message>
<message>
<location/>
<source>&amp;Translations</source>
- <translation type="unfinished"></translation>
+ <translation>訳語(&amp;T)</translation>
</message>
<message>
<location/>
<source>&amp;Match case</source>
- <translation type="unfinished"></translation>
+ <translation>大/小文字の区別(&amp;M)</translation>
</message>
<message>
<location/>
<source>&amp;Comments</source>
- <translation type="unfinished"></translation>
+ <translation>コメント(&amp;C)</translation>
</message>
<message>
<location/>
<source>Ignore &amp;accelerators</source>
- <translation type="unfinished"></translation>
+ <translation>アクセラレータを無視(&amp;A)</translation>
</message>
<message>
<location/>
@@ -388,16 +389,18 @@ Will assume a single universal form.</source>
<location filename="../tools/linguist/shared/qm.cpp" line="+715"/>
<source> Generated %n translation(s) (%1 finished and %2 unfinished)
</source>
- <translation type="unfinished">
- <numerusform></numerusform>
+ <translation>
+ <numerusform> %n 件の訳語 (%1 件が完了、 %2 件が未完了) を生成しました
+</numerusform>
</translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source> Ignored %n untranslated source text(s)
</source>
- <translation type="unfinished">
- <numerusform></numerusform>
+ <translation>
+ <numerusform> %n 件の未翻訳のソーステキストを無視しました
+</numerusform>
</translation>
</message>
</context>
@@ -413,12 +416,12 @@ Will assume a single universal form.</source>
<message>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>About Qt</source>
- <translation>Qt について(&amp;Q)</translation>
+ <translation>Qt について</translation>
</message>
<message>
<location/>
<source>About Qt Linguist</source>
- <translation>Qt Linguist について(&amp;A)</translation>
+ <translation>Qt Linguist について</translation>
</message>
<message>
<location/>
@@ -476,7 +479,7 @@ Will assume a single universal form.</source>
<message>
<location/>
<source>Create a new phrase book.</source>
- <translation>新しいフレーズブックを作成</translation>
+ <translation>新しいフレーズブックを作成します。</translation>
</message>
<message>
<location/>
@@ -545,12 +548,12 @@ Will assume a single universal form.</source>
<message>
<location/>
<source>Open Read-O&amp;nly...</source>
- <translation type="unfinished"></translation>
+ <translation>読取専用で開く(&amp;N)...</translation>
</message>
<message>
<location/>
<source>&amp;Save All</source>
- <translation type="unfinished"></translation>
+ <translation>全て保存(&amp;S)</translation>
</message>
<message>
<location/>
@@ -584,7 +587,7 @@ Will assume a single universal form.</source>
<message>
<location/>
<source>Recently Opened &amp;Files</source>
- <translation type="unfinished"></translation>
+ <translation>最近使ったファイル(&amp;F)</translation>
</message>
<message>
<location/>
@@ -625,7 +628,7 @@ Will assume a single universal form.</source>
<message>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>&amp;Edit Phrase Book</source>
- <translation>フレーズブックを編集(&amp;E)...</translation>
+ <translation>フレーズブックを編集(&amp;E)</translation>
</message>
<message>
<location/>
@@ -696,7 +699,7 @@ Will assume a single universal form.</source>
<message>
<location/>
<source>MainWindow</source>
- <translation>メインウィンドウ</translation>
+ <translation>MainWindow</translation>
</message>
<message>
<location/>
@@ -753,7 +756,7 @@ Will assume a single universal form.</source>
<message>
<location/>
<source>Open a Qt translation source file (TS file) for editing</source>
- <translation>Qt 翻訳ソースファイル (TS ファイル) を編集用に開きます。</translation>
+ <translation>Qt 翻訳ソースファイル (TS ファイル) を編集用に開きます</translation>
</message>
<message>
<source>&amp;Open Phrase Book</source>
@@ -810,7 +813,7 @@ Will assume a single universal form.</source>
<message>
<location/>
<source>&amp;Print Phrase Book</source>
- <translation>フレーズブックを印刷(&amp;P)...</translation>
+ <translation>フレーズブックを印刷(&amp;P)</translation>
</message>
<message>
<source>Re&amp;cently opened files</source>
@@ -856,172 +859,176 @@ Will assume a single universal form.</source>
<message>
<location line="+195"/>
<source>Source text</source>
- <translation type="unfinished">ソーステキスト</translation>
+ <translation>ソーステキスト</translation>
</message>
<message>
<location line="+1"/>
<location line="+25"/>
<source>Index</source>
- <translation type="unfinished"></translation>
+ <translation>インデックス</translation>
</message>
<message>
<location line="-2"/>
<location line="+61"/>
<source>Context</source>
- <translation type="unfinished">コンテキスト</translation>
+ <translation>コンテキスト</translation>
</message>
<message>
<location line="-60"/>
<source>Items</source>
- <translation type="unfinished">項目数</translation>
+ <translation>項目数</translation>
</message>
<message>
<location line="+77"/>
<source>This panel lists the source contexts.</source>
- <translation type="unfinished">このパネルではソースのコンテキストを一覧表示しています。</translation>
+ <translation>このパネルではソースのコンテキストを一覧表示しています。</translation>
</message>
<message>
<location line="+15"/>
<source>Strings</source>
- <translation type="unfinished"></translation>
+ <translation>文字列</translation>
</message>
<message>
<location line="+39"/>
<source>Phrases and guesses</source>
- <translation type="unfinished"></translation>
+ <translation>フレーズと推測</translation>
</message>
<message>
<location line="+10"/>
<source>Sources and Forms</source>
- <translation type="unfinished"></translation>
+ <translation>ソースとフォーム</translation>
</message>
<message>
<location line="+15"/>
<source>Warnings</source>
- <translation type="unfinished"></translation>
+ <translation>警告</translation>
</message>
<message>
<location line="+59"/>
<source> MOD </source>
<comment>status bar: file(s) modified</comment>
- <translation type="unfinished"></translation>
+ <translation> MOD </translation>
</message>
<message>
<location line="+125"/>
<source>Loading...</source>
- <translation type="unfinished">ロードしています...</translation>
+ <translation>ロードしています...</translation>
</message>
<message>
<location line="+32"/>
<location line="+22"/>
<source>Loading File - Qt Linguist</source>
- <translation type="unfinished"></translation>
+ <translation>ロードしています - Qt Linguist</translation>
</message>
<message>
<location line="-21"/>
<source>The file &apos;%1&apos; does not seem to be related to the currently open file(s) &apos;%2&apos;.
Close the open file(s) first?</source>
- <translation type="unfinished"></translation>
+ <translation>ファイル &apos;%1&apos; は、既に開いているファイル &apos;%2&apos; とは関連していないようです。
+
+先に開いたファイルを閉じますか?</translation>
</message>
<message>
<location line="+22"/>
<source>The file &apos;%1&apos; does not seem to be related to the file &apos;%2&apos; which is being loaded as well.
Skip loading the first named file?</source>
- <translation type="unfinished"></translation>
+ <translation>ファイル &apos;%1&apos; は、既にロードされているファイル &apos;%2&apos; とは関連していないようです。
+
+ファイルのロードをスキップしますか?</translation>
</message>
<message numerus="yes">
<location line="+61"/>
<source>%n translation unit(s) loaded.</source>
- <translation type="unfinished">
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%n 件の翻訳項目をロードしました。</numerusform>
</translation>
</message>
<message>
<location line="+93"/>
<source>Related files (%1);;</source>
- <translation type="unfinished"></translation>
+ <translation>%1 に関連したファイル;;</translation>
</message>
<message>
<location line="+4"/>
<source>Open Translation Files</source>
- <translation type="unfinished"></translation>
+ <translation>翻訳ファイルを開く</translation>
</message>
<message>
<location line="+10"/>
<location line="+31"/>
<source>File saved.</source>
- <translation type="unfinished">ファイルが保存されました。</translation>
+ <translation>ファイルが保存されました。</translation>
</message>
<message>
<location line="+15"/>
<location line="+1164"/>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>Release</source>
- <translation type="unfinished">リリース</translation>
+ <translation>リリース</translation>
</message>
<message>
<location line="-1163"/>
<source>Qt message files for released applications (*.qm)
All files (*)</source>
- <translation type="unfinished">リリースされたアプリケーション用の Qt メッセージファイル (*.qm)
+ <translation>リリースされたアプリケーション用の Qt メッセージファイル (*.qm)
すべてのファイル (*)</translation>
</message>
<message>
<location line="+3"/>
<location line="+12"/>
<source>File created.</source>
- <translation type="unfinished">ファイルが作成されました。</translation>
+ <translation>ファイルが作成されました。</translation>
</message>
<message>
<location line="+27"/>
<location line="+355"/>
<source>Printing...</source>
- <translation type="unfinished">印刷中...</translation>
+ <translation>印刷中...</translation>
</message>
<message>
<location line="-347"/>
<source>Context: %1</source>
- <translation type="unfinished">コンテキスト: %1</translation>
+ <translation>コンテキスト: %1</translation>
</message>
<message>
<location line="+32"/>
<source>finished</source>
- <translation type="unfinished">完了</translation>
+ <translation>完了</translation>
</message>
<message>
<location line="+3"/>
<source>unresolved</source>
- <translation type="unfinished">未解決</translation>
+ <translation>未解決</translation>
</message>
<message>
<location line="+3"/>
<source>obsolete</source>
- <translation type="unfinished">このバージョンでは使われていない</translation>
+ <translation>このバージョンでは使われていない</translation>
</message>
<message>
<location line="+15"/>
<location line="+307"/>
<source>Printing... (page %1)</source>
- <translation type="unfinished">印刷中... (%1 ページ)</translation>
+ <translation>印刷中... (%1 ページ)</translation>
</message>
<message>
<location line="-300"/>
<location line="+307"/>
<source>Printing completed</source>
- <translation type="unfinished">印刷完了</translation>
+ <translation>印刷完了</translation>
</message>
<message>
<location line="-305"/>
<location line="+307"/>
<source>Printing aborted</source>
- <translation type="unfinished">印刷中止</translation>
+ <translation>印刷中止</translation>
</message>
<message>
<location line="-232"/>
<source>Search wrapped.</source>
- <translation type="unfinished">検索が一通り終わりました。</translation>
+ <translation>検索が一通り終わりました。</translation>
</message>
<message>
<location line="+17"/>
@@ -1035,13 +1042,13 @@ All files (*)</source>
<location line="+40"/>
<location line="+10"/>
<source>Qt Linguist</source>
- <translation type="unfinished">Qt Linguist</translation>
+ <translation>Qt Linguist</translation>
</message>
<message>
<location line="-1204"/>
<location line="+102"/>
<source>Cannot find the string &apos;%1&apos;.</source>
- <translation type="unfinished">文字列 &apos;%1&apos; が見つかりません。</translation>
+ <translation>文字列 &apos;%1&apos; が見つかりません。</translation>
</message>
<message>
<source>Translate</source>
@@ -1056,58 +1063,58 @@ All files (*)</source>
<message>
<location line="-82"/>
<source>Search And Translate in &apos;%1&apos; - Qt Linguist</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; 内で検索して翻訳 - Qt Linguist</translation>
</message>
<message>
<location line="+34"/>
<location line="+23"/>
<location line="+24"/>
<source>Translate - Qt Linguist</source>
- <translation type="unfinished"></translation>
+ <translation>翻訳 - Qt Linguist</translation>
</message>
<message numerus="yes">
<location line="-46"/>
<source>Translated %n entry(s)</source>
- <translation type="unfinished">
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%n 項目が翻訳済みです</numerusform>
</translation>
</message>
<message>
<location line="+23"/>
<source>No more occurrences of &apos;%1&apos;. Start over?</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; は、これ以上見つかりません。先頭に戻りますか?</translation>
</message>
<message>
<location line="+30"/>
<source>Create New Phrase Book</source>
- <translation type="unfinished">新しいフレーズブックを作成</translation>
+ <translation>新しいフレーズブックを作成</translation>
</message>
<message>
<location line="+1"/>
<source>Qt phrase books (*.qph)
All files (*)</source>
- <translation type="unfinished">Qt フレーズブック (*.qph)
-すべてのファイル (*)</translation>
+ <translation>Qt フレーズブック (*.qph)
+全てのファイル (*)</translation>
</message>
<message>
<location line="+11"/>
<source>Phrase book created.</source>
- <translation type="unfinished">フレーズブックが作成されました。</translation>
+ <translation>フレーズブックが作成されました。</translation>
</message>
<message>
<location line="+17"/>
<source>Open Phrase Book</source>
- <translation type="unfinished">フレーズブックを開く</translation>
+ <translation>フレーズブックを開く</translation>
</message>
<message>
<location line="+1"/>
<source>Qt phrase books (*.qph);;All files (*)</source>
- <translation type="unfinished"></translation>
+ <translation>Qt フレーズブック (*.qph);;すべてのファイル (*)</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>%n phrase(s) loaded.</source>
- <translation type="unfinished">
+ <translation>
<numerusform>%n 項目のフレーズがロードされました。</numerusform>
</translation>
</message>
@@ -1116,32 +1123,32 @@ All files (*)</source>
<location line="+3"/>
<location line="+7"/>
<source>Add to phrase book</source>
- <translation type="unfinished"></translation>
+ <translation>フレーズブックに追加</translation>
</message>
<message>
<location line="-9"/>
<source>No appropriate phrasebook found.</source>
- <translation type="unfinished"></translation>
+ <translation>適切なフレーズブックが見つかりません。</translation>
</message>
<message>
<location line="+3"/>
<source>Adding entry to phrasebook %1</source>
- <translation type="unfinished"></translation>
+ <translation>フレーズブック %1 に項目を追加</translation>
</message>
<message>
<location line="+7"/>
<source>Select phrase book to add to</source>
- <translation type="unfinished"></translation>
+ <translation>追加先のフレーズブックを選択してください</translation>
</message>
<message>
<location line="+29"/>
<source>Unable to launch Qt Assistant (%1)</source>
- <translation type="unfinished"></translation>
+ <translation>Qt Assistant (%1) を起動できません</translation>
</message>
<message>
<location line="+17"/>
<source>Version %1</source>
- <translation type="unfinished">バージョン %1</translation>
+ <translation>バージョン %1</translation>
</message>
<message>
<source> Open Source Edition</source>
@@ -1158,83 +1165,83 @@ All files (*)</source>
<message>
<location line="+6"/>
<source>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist is a tool for adding translations to Qt applications.&lt;/p&gt;&lt;p&gt;%2&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</source>
- <translation type="unfinished">&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist は、Qt アプリケーションの翻訳を行うツールです。&lt;/p&gt;&lt;p&gt;%2&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 全ての権利は保護されています。&lt;/p&gt;&lt;p&gt;このプログラムは、「設計」、「市場性」および「特定の目的への適合性」も含む、あらゆる種類の「保証がなく」、「そのままで」提供されます。&lt;/p&gt;</translation>
+ <translation>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist は、Qt アプリケーションの翻訳を行うツールです。&lt;/p&gt;&lt;p&gt;%2&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 全ての権利は保護されています。&lt;/p&gt;&lt;p&gt;このプログラムは、「設計」、「市場性」および「特定の目的への適合性」も含む、あらゆる種類の「保証がなく」、「そのままで」提供されます。&lt;/p&gt;</translation>
</message>
<message>
<location line="+41"/>
<source>Do you want to save the modified files?</source>
- <translation type="unfinished"></translation>
+ <translation>変更されたファイルを保存しますか?</translation>
</message>
<message>
<location line="+22"/>
<source>Do you want to save &apos;%1&apos;?</source>
- <translation type="unfinished">&apos;%1&apos; を保存しますか?</translation>
+ <translation>&apos;%1&apos; を保存しますか?</translation>
</message>
<message>
<location line="+43"/>
<source>Qt Linguist[*]</source>
- <translation type="unfinished"></translation>
+ <translation>Qt Linguist[*]</translation>
</message>
<message>
<location line="+2"/>
<source>%1[*] - Qt Linguist</source>
- <translation type="unfinished"></translation>
+ <translation>%1[*] - Qt Linguist</translation>
</message>
<message>
<location line="+267"/>
<location line="+12"/>
<source>No untranslated translation units left.</source>
- <translation type="unfinished"></translation>
+ <translation>未訳項目は残っていません。</translation>
</message>
<message>
<location line="+176"/>
<source>&amp;Window</source>
- <translation type="unfinished">ウィンドウ(&amp;W)</translation>
+ <translation>ウィンドウ(&amp;W)</translation>
</message>
<message>
<location line="+2"/>
<source>Minimize</source>
- <translation type="unfinished">最小化</translation>
+ <translation>最小化</translation>
</message>
<message>
<location line="+1"/>
<source>Ctrl+M</source>
- <translation type="unfinished">Ctrl+M</translation>
+ <translation>Ctrl+M</translation>
</message>
<message>
<location line="+12"/>
<source>Display the manual for %1.</source>
- <translation type="unfinished">%1 のマニュアルを表示します。</translation>
+ <translation>%1 のマニュアルを表示します。</translation>
</message>
<message>
<location line="+1"/>
<source>Display information about %1.</source>
- <translation type="unfinished">%1 についての情報を表示します。</translation>
+ <translation>%1 についての情報を表示します。</translation>
</message>
<message>
<location line="+70"/>
<source>&amp;Save &apos;%1&apos;</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; を保存する(&amp;S)</translation>
</message>
<message>
<location line="+1"/>
<source>Save &apos;%1&apos; &amp;As...</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; を名前を付けて保存(&amp;A)...</translation>
</message>
<message>
<location line="+1"/>
<source>Release &apos;%1&apos;</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; をリリース</translation>
</message>
<message>
<location line="+1"/>
<source>Release &apos;%1&apos; As...</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; を名前を付けてリリース...</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Close &apos;%1&apos;</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; を閉じる(&amp;C)</translation>
</message>
<message>
<location line="+2"/>
@@ -1253,78 +1260,78 @@ All files (*)</source>
<location line="-8"/>
<location line="+13"/>
<source>&amp;Close</source>
- <translation type="unfinished">閉じる(&amp;C)</translation>
+ <translation>閉じる(&amp;C)</translation>
</message>
<message>
<location line="-10"/>
<source>Save All</source>
- <translation type="unfinished"></translation>
+ <translation>全て保存</translation>
</message>
<message>
<location line="+1"/>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>&amp;Release All</source>
- <translation type="unfinished"></translation>
+ <translation>全てリリース(&amp;R)</translation>
</message>
<message>
<location line="+1"/>
<source>Close All</source>
- <translation type="unfinished">すべて閉じる</translation>
+ <translation>すべて閉じる</translation>
</message>
<message>
<location line="+23"/>
<source>Translation File &amp;Settings for &apos;%1&apos;...</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; の翻訳ファイルの設定(&amp;S)...</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Batch Translation of &apos;%1&apos;...</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; の一括翻訳(&amp;B)...</translation>
</message>
<message>
<location line="+1"/>
<source>Search And &amp;Translate in &apos;%1&apos;...</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; 内を検索して翻訳(&amp;T)...</translation>
</message>
<message>
<location line="+4"/>
<source>Search And &amp;Translate...</source>
- <translation type="unfinished"></translation>
+ <translation>検索して訳語を置換(&amp;T)...</translation>
</message>
<message>
<location line="+161"/>
<source>Cannot read from phrase book &apos;%1&apos;.</source>
- <translation type="unfinished">フレーズブック &apos;%1&apos; から読み出せません。</translation>
+ <translation>フレーズブック &apos;%1&apos; から読み出せません。</translation>
</message>
<message>
<location line="+15"/>
<source>Close this phrase book.</source>
- <translation type="unfinished">このフレーズブックを閉じます。</translation>
+ <translation>このフレーズブックを閉じます。</translation>
</message>
<message>
<location line="+4"/>
<source>Enables you to add, modify, or delete entries in this phrase book.</source>
- <translation type="unfinished"></translation>
+ <translation>このフレーズブックで項目の追加、変更、削除ができます。</translation>
</message>
<message>
<location line="+5"/>
<source>Print the entries in this phrase book.</source>
- <translation type="unfinished"></translation>
+ <translation>このフレーズブックの項目を印刷します。</translation>
</message>
<message>
<location line="+16"/>
<source>Cannot create phrase book &apos;%1&apos;.</source>
- <translation type="unfinished">フレーズブック &apos;%1&apos; を作成できません。</translation>
+ <translation>フレーズブック &apos;%1&apos; を作成できません。</translation>
</message>
<message>
<location line="+10"/>
<source>Do you want to save phrase book &apos;%1&apos;?</source>
- <translation type="unfinished"></translation>
+ <translation>フレーズブック &apos;%1&apos; を保存しますか?</translation>
</message>
<message>
<location line="+314"/>
<source>All</source>
- <translation type="unfinished"></translation>
+ <translation>すべて</translation>
</message>
<message>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
@@ -1468,194 +1475,194 @@ All files (*)</source>
<message>
<location/>
<source>&amp;Open...</source>
- <translation type="unfinished"></translation>
+ <translation>開く(&amp;O)...</translation>
</message>
<message>
<location/>
<source>Save</source>
- <translation type="unfinished"></translation>
+ <translation>保存</translation>
</message>
<message>
<location/>
<source>&amp;Print...</source>
- <translation type="unfinished"></translation>
+ <translation>印刷(&amp;P)...</translation>
</message>
<message>
<location/>
<source>Print a list of all the translation units in the current translation source file.</source>
- <translation type="unfinished"></translation>
+ <translation>現在の Qt 翻訳ソースファイルの全ての訳語の一覧を印刷します。</translation>
</message>
<message>
<location/>
<source>Undo the last editing operation performed on the current translation.</source>
- <translation type="unfinished"></translation>
+ <translation>現在の翻訳ファイルで最後に行った編集操作を取り消します。</translation>
</message>
<message>
<location/>
<source>&amp;Find...</source>
- <translation type="unfinished"></translation>
+ <translation>検索(&amp;F)...</translation>
</message>
<message>
<location/>
<source>Previous unfinished item.</source>
- <translation type="unfinished"></translation>
+ <translation>前の未訳の項目へ移動します。</translation>
</message>
<message>
<location/>
<source>Move to the previous unfinished item.</source>
- <translation type="unfinished"></translation>
+ <translation>前の未完了の項目へ移動します。</translation>
</message>
<message>
<location/>
<source>Next unfinished item.</source>
- <translation type="unfinished"></translation>
+ <translation>次の未訳の項目へ移動します。</translation>
</message>
<message>
<location/>
<source>Move to the next unfinished item.</source>
- <translation type="unfinished"></translation>
+ <translation>次の未完了の項目へ移動します。</translation>
</message>
<message>
<location/>
<source>Move to previous item.</source>
- <translation type="unfinished"></translation>
+ <translation>前の項目へ移動します。</translation>
</message>
<message>
<location/>
<source>Move to the previous item.</source>
- <translation type="unfinished"></translation>
+ <translation>前の項目へ移動します。</translation>
</message>
<message>
<location/>
<source>Next item.</source>
- <translation type="unfinished"></translation>
+ <translation>次の項目へ移動します。</translation>
</message>
<message>
<location/>
<source>Move to the next item.</source>
- <translation type="unfinished"></translation>
+ <translation>次の項目へ移動します。</translation>
</message>
<message>
<location/>
<source>Mark item as done and move to the next unfinished item.</source>
- <translation type="unfinished"></translation>
+ <translation>この項目に完了のマークをつけ、次の未完了の項目へ移動します。</translation>
</message>
<message>
<location/>
<source>Mark this item as done and move to the next unfinished item.</source>
- <translation type="unfinished"></translation>
+ <translation>この項目に完了のマークをつけ、次の未完了の項目へ移動します。</translation>
</message>
<message>
<location/>
<source>Copy from source text</source>
- <translation type="unfinished"></translation>
+ <translation>ソーステキストからコピー</translation>
</message>
<message>
<location/>
<source>Toggle the validity check of accelerators.</source>
- <translation type="unfinished"></translation>
+ <translation>アクセラレータのチェックを有効にするかどうかを切り替えます。</translation>
</message>
<message>
<location/>
<source>Toggle the validity check of accelerators, i.e. whether the number of ampersands in the source and translation text is the same. If the check fails, a message is shown in the warnings window.</source>
- <translation type="unfinished"></translation>
+ <translation>ソーステキストと訳語のアクセラレータの個数が同じか否かのチェックを有効にするかどうかを切り替えます。チェックが無効になっていても、警告ウィンドウにメッセージは表示されます。</translation>
</message>
<message>
<location/>
<source>Toggle the validity check of ending punctuation.</source>
- <translation type="unfinished"></translation>
+ <translation>末尾の句読点のチェックを有効にするかどうかを切り替えます。</translation>
</message>
<message>
<location/>
<source>Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window.</source>
- <translation type="unfinished"></translation>
+ <translation>末尾の句読点のチェックを有効にするかどうかを切り替えます。チェックが無効になっていても、警告ウィンドウにメッセージが表示されます。</translation>
</message>
<message>
<location/>
<source>Toggle checking that phrase suggestions are used. If the check fails, a message is shown in the warnings window.</source>
- <translation type="unfinished"></translation>
+ <translation>フレーズの示唆を使うかどうかのチェックを切り替えます。チェックが無効になっていても、警告ウィンドウにメッセージが表示されます。</translation>
</message>
<message>
<location/>
<source>Toggle the validity check of place markers.</source>
- <translation type="unfinished"></translation>
+ <translation>&quot;%&quot; の数や番号のチェックを行うかどうかを切り替えます。</translation>
</message>
<message>
<location/>
<source>Toggle the validity check of place markers, i.e. whether %1, %2, ... are used consistently in the source text and translation text. If the check fails, a message is shown in the warnings window.</source>
- <translation type="unfinished"></translation>
+ <translation>ソーステキストと訳語の&quot;%1&quot;や&quot;%2&quot;等のプレースマーカーの整合が取れているか否かのチェックを行うかどうかを切り替えます。チェックが無効になっていても、警告ウィンドウにメッセージは表示されます。</translation>
</message>
<message>
<location/>
<source>&amp;New Phrase Book...</source>
- <translation type="unfinished"></translation>
+ <translation>新しいフレーズブック(&amp;N)...</translation>
</message>
<message>
<location/>
<source>&amp;Open Phrase Book...</source>
- <translation type="unfinished"></translation>
+ <translation>フレーズブックを開く(&amp;O)...</translation>
</message>
<message>
<location/>
<source>&amp;Reset Sorting</source>
- <translation type="unfinished"></translation>
+ <translation>ソート順序をリセット(&amp;R)</translation>
</message>
<message>
<location/>
<source>Display translation statistics.</source>
- <translation type="unfinished"></translation>
+ <translation>翻訳の統計を表示します。</translation>
</message>
<message>
<location/>
<source>&amp;Search And Translate...</source>
- <translation type="unfinished"></translation>
+ <translation>検索して訳語を置換(&amp;S)...</translation>
</message>
<message>
<location/>
<source>Close</source>
- <translation type="unfinished">閉じる</translation>
+ <translation>閉じる</translation>
</message>
<message>
<location/>
<source>&amp;Close All</source>
- <translation type="unfinished"></translation>
+ <translation>全て閉じる(&amp;C)</translation>
</message>
<message>
<location/>
<source>Ctrl+W</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl+W</translation>
</message>
<message>
<location filename="../tools/linguist/linguist/mainwindow.cpp" line="-71"/>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>&amp;Batch Translation...</source>
- <translation type="unfinished"></translation>
+ <translation>一括翻訳(&amp;B)...</translation>
</message>
<message>
<location line="-1"/>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>Translation File &amp;Settings...</source>
- <translation type="unfinished"></translation>
+ <translation>翻訳ファイルの設定(&amp;S)...</translation>
</message>
<message>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>&amp;Add to Phrase Book</source>
- <translation type="unfinished"></translation>
+ <translation>フレーズブックに追加(&amp;A)</translation>
</message>
<message>
<location/>
<source>Ctrl+T</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl+T</translation>
</message>
<message>
<location/>
<source>Ctrl+J</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl+J</translation>
</message>
<message>
<location/>
<source>Ctrl+Shift+J</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl+Shift+J</translation>
</message>
</context>
<context>
@@ -1707,82 +1714,82 @@ All files (*)</source>
<message>
<location filename="../tools/linguist/linguist/messageeditor.cpp" line="+72"/>
<source>German</source>
- <translation type="unfinished"></translation>
+ <translation>German</translation>
</message>
<message>
<location line="+1"/>
<source>Japanese</source>
- <translation type="unfinished"></translation>
+ <translation>Japanese</translation>
</message>
<message>
<location line="+1"/>
<source>French</source>
- <translation type="unfinished"></translation>
+ <translation>French</translation>
</message>
<message>
<location line="+1"/>
<source>Polish</source>
- <translation type="unfinished"></translation>
+ <translation>Polish</translation>
</message>
<message>
<location line="+1"/>
<source>Chinese</source>
- <translation type="unfinished"></translation>
+ <translation>Chinese</translation>
</message>
<message>
<location line="+75"/>
<source>Source text</source>
- <translation type="unfinished">ソーステキスト</translation>
+ <translation>ソーステキスト</translation>
</message>
<message>
<location line="+5"/>
<source>Source text (Plural)</source>
- <translation type="unfinished"></translation>
+ <translation>ソーステキスト(複数)</translation>
</message>
<message>
<location line="+2"/>
<source>This area shows the plural form of the source text.</source>
- <translation type="unfinished"></translation>
+ <translation>この領域は複数のソーステキストを表示します。</translation>
</message>
<message>
<location line="+3"/>
<source>Developer comments</source>
- <translation type="unfinished"></translation>
+ <translation>開発者のコメント</translation>
</message>
<message>
<location line="+3"/>
<source>This area shows a comment that may guide you, and the context in which the text occurs.</source>
- <translation type="unfinished">この領域は、手助けとなるコメントと、テキストが出てくるコンテキストを表示します。</translation>
+ <translation>この領域は、手助けとなるコメントと、テキストが出てくるコンテキストを表示します。</translation>
</message>
<message>
<location line="+59"/>
<source>Here you can enter comments for your own use. They have no effect on the translated applications.</source>
- <translation type="unfinished"></translation>
+ <translation>ここはあなたが自分自身の為にコメントを入力できます。翻訳されたアプリケーションには何の影響も与えません。</translation>
</message>
<message>
<location line="+205"/>
<source>%1 translation (%2)</source>
- <translation type="unfinished"></translation>
+ <translation>%1 翻訳 (%2)</translation>
</message>
<message>
<location line="+19"/>
<source>This is where you can enter or modify the translation of the above source text.</source>
- <translation type="unfinished"></translation>
+ <translation>ソーステキストの訳を入力したり変更したりできるところです。</translation>
</message>
<message>
<location line="+5"/>
<source>%1 translation</source>
- <translation type="unfinished"></translation>
+ <translation>%1 訳</translation>
</message>
<message>
<location line="+1"/>
<source>%1 translator comments</source>
- <translation type="unfinished"></translation>
+ <translation>%1 翻訳者のコメント</translation>
</message>
<message>
<location line="-300"/>
<source>This area shows the source text.</source>
- <translation type="unfinished">この領域はソーステキストを表示します。</translation>
+ <translation>この領域はソーステキストを表示します。</translation>
</message>
<message>
<source>This is where you can enter or modify the translation of some source text.</source>
@@ -1801,7 +1808,8 @@ All files (*)</source>
<location line="+465"/>
<source>&apos;%1&apos;
Line: %2</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos;
+行番号: %2</translation>
</message>
</context>
<context>
@@ -1821,22 +1829,22 @@ Line: %2</source>
<message>
<location filename="../tools/linguist/linguist/messagemodel.cpp" line="+832"/>
<source>Completion status for %1</source>
- <translation type="unfinished"></translation>
+ <translation>%1 の翻訳完了状況</translation>
</message>
<message>
<location line="+15"/>
<source>&lt;file header&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;ファイル ヘッダー&gt;</translation>
</message>
<message>
<location line="+2"/>
<source>&lt;context comment&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;コンテキスト コメント&gt;</translation>
</message>
<message>
<location line="+71"/>
<source>&lt;unnamed context&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;無名のコンテキスト&gt;</translation>
</message>
</context>
<context>
@@ -1871,7 +1879,7 @@ Line: %2</source>
<message>
<location filename="../tools/linguist/linguist/phrasebookbox.cpp" line="+8"/>
<source>%1[*] - Qt Linguist</source>
- <translation type="unfinished"></translation>
+ <translation>%1[*] - Qt Linguist</translation>
</message>
<message>
<location line="+91"/>
@@ -1886,27 +1894,27 @@ Line: %2</source>
<message>
<location/>
<source>&amp;New Entry</source>
- <translation type="unfinished"></translation>
+ <translation>新しい項目(&amp;N)</translation>
</message>
<message>
<location/>
<source>Click here to remove the entry from the phrase book.</source>
- <translation type="unfinished"></translation>
+ <translation>フレーズブックからフレーズを消去するにはここをクリックしてください。</translation>
</message>
<message>
<location/>
<source>&amp;Remove Entry</source>
- <translation type="unfinished"></translation>
+ <translation>項目を削除(&amp;R)</translation>
</message>
<message>
<location/>
<source>Settin&amp;gs...</source>
- <translation type="unfinished"></translation>
+ <translation>設定(&amp;G)...</translation>
</message>
<message>
<location/>
<source>Click here to close this window.</source>
- <translation>このウィンドウを閉じるにはここをクリックしてください。</translation>
+ <translation>このウィンドウを閉じるにはここをクリックします。</translation>
</message>
<message>
<source>Click here to remove the phrase from the phrase book.</source>
@@ -1958,7 +1966,7 @@ Line: %2</source>
<message>
<location/>
<source>This window allows you to add, modify, or delete entries in a phrase book.</source>
- <translation type="unfinished"></translation>
+ <translation>このウィンドウでフレーズブックにフレーズを追加、変更、削除できます。</translation>
</message>
<message>
<location/>
@@ -2006,7 +2014,7 @@ Line: %2</source>
<message>
<location line="+2"/>
<source>Translation</source>
- <translation>訳</translation>
+ <translation>翻訳</translation>
</message>
</context>
<context>
@@ -2014,22 +2022,22 @@ Line: %2</source>
<message>
<location filename="../tools/linguist/linguist/phraseview.cpp" line="+121"/>
<source>Insert</source>
- <translation type="unfinished"></translation>
+ <translation>挿入</translation>
</message>
<message>
<location line="+3"/>
<source>Edit</source>
- <translation type="unfinished">編集</translation>
+ <translation>編集</translation>
</message>
<message>
<location line="+113"/>
<source>Guess (%1)</source>
- <translation type="unfinished">推測(%1)</translation>
+ <translation>推測(%1)</translation>
</message>
<message>
<location line="+2"/>
<source>Guess</source>
- <translation type="unfinished">推測</translation>
+ <translation>推測</translation>
</message>
</context>
<context>
@@ -2037,17 +2045,17 @@ Line: %2</source>
<message>
<location filename="../tools/linguist/shared/qm.cpp" line="+12"/>
<source>Compiled Qt translations</source>
- <translation type="unfinished"></translation>
+ <translation>コンパイル済み Qt 翻訳ファイル</translation>
</message>
<message>
<location filename="../tools/linguist/linguist/mainwindow.cpp" line="-1279"/>
<source>Translation files (%1);;</source>
- <translation type="unfinished"></translation>
+ <translation>翻訳ファイル (%1);;</translation>
</message>
<message>
<location line="+5"/>
<source>All files (*)</source>
- <translation type="unfinished"></translation>
+ <translation>すべてのファイル (*)</translation>
</message>
<message>
<location filename="../tools/linguist/linguist/messagemodel.cpp" line="-1118"/>
@@ -2063,57 +2071,57 @@ Line: %2</source>
<message>
<location filename="../tools/linguist/shared/cpp.cpp" line="+1072"/>
<source>C++ source files</source>
- <translation type="unfinished"></translation>
+ <translation>C++ ソースファイル</translation>
</message>
<message>
<location filename="../tools/linguist/shared/java.cpp" line="+646"/>
<source>Java source files</source>
- <translation type="unfinished"></translation>
+ <translation>Java ソースファイル</translation>
</message>
<message>
<location filename="../tools/linguist/shared/po.cpp" line="+651"/>
<source>GNU Gettext localization files</source>
- <translation type="unfinished"></translation>
+ <translation>GNU Gettext 日本語化ファイル</translation>
</message>
<message>
<location filename="../tools/linguist/shared/qscript.cpp" line="+2399"/>
<source>Qt Script source files</source>
- <translation type="unfinished"></translation>
+ <translation>Qt スクリプト ソースファイル</translation>
</message>
<message>
<location filename="../tools/linguist/shared/ts.cpp" line="+752"/>
<source>Qt translation sources (format 1.1)</source>
- <translation type="unfinished"></translation>
+ <translation>Qt 翻訳ソース (1.1形式)</translation>
</message>
<message>
<location line="+8"/>
<source>Qt translation sources (format 2.0)</source>
- <translation type="unfinished"></translation>
+ <translation>Qt 翻訳ソース (2.0形式)</translation>
</message>
<message>
<location line="+9"/>
<source>Qt translation sources (latest format)</source>
- <translation type="unfinished"></translation>
+ <translation>Qt 翻訳ソース (最新の形式)</translation>
</message>
<message>
<location filename="../tools/linguist/shared/ui.cpp" line="+213"/>
<source>Qt Designer form files</source>
- <translation type="unfinished"></translation>
+ <translation>Qt デザイナ フォームファイル</translation>
</message>
<message>
<location line="+9"/>
<source>Qt Jambi form files</source>
- <translation type="unfinished"></translation>
+ <translation>Qt Jambi フォームファイル</translation>
</message>
<message>
<location filename="../tools/linguist/shared/xliff.cpp" line="+817"/>
<source>XLIFF localization files</source>
- <translation type="unfinished"></translation>
+ <translation>XLIFF 日本語化ファイル</translation>
</message>
<message>
<location filename="../tools/linguist/shared/qph.cpp" line="+192"/>
<source>Qt Linguist &apos;Phrase Book&apos;</source>
- <translation type="unfinished"></translation>
+ <translation>Qt Linguist &apos;フレーズ ブック&apos;</translation>
</message>
</context>
<context>
@@ -2147,17 +2155,17 @@ Line: %2</source>
<message>
<location filename="../tools/linguist/linguist/sourcecodeview.cpp" line="+70"/>
<source>&lt;i&gt;Source code not available&lt;/i&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;i&gt;ソース コードは使用できません&lt;/i&gt;</translation>
</message>
<message>
<location line="+33"/>
<source>&lt;i&gt;File %1 not available&lt;/i&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;i&gt;ファイル %1 が使用できません&lt;/i&gt;</translation>
</message>
<message>
<location line="+5"/>
<source>&lt;i&gt;File %1 not readable&lt;/i&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;i&gt;ファイル %1 が読み込めません&lt;/i&gt;</translation>
</message>
</context>
<context>
@@ -2213,7 +2221,7 @@ Line: %2</source>
<message>
<location/>
<source>Translation</source>
- <translation>訳</translation>
+ <translation>翻訳</translation>
</message>
<message>
<location/>
@@ -2223,7 +2231,7 @@ Line: %2</source>
<message>
<location/>
<source>Close</source>
- <translation type="unfinished">閉じる</translation>
+ <translation>閉じる</translation>
</message>
</context>
<context>
@@ -2656,7 +2664,7 @@ All files (*)</source>
<message>
<location/>
<source>Texts such as &apos;TeX&apos; and &apos;tex&apos; are considered as different when checked.</source>
- <translation>これを選択すると、たとえば &apos;TeX&apos; と &apos;tex&apos; は異なるものと見なされます。</translation>
+ <translation>選択すると、たとえば &apos;TeX&apos; と &apos;tex&apos; は異なるものと見なされます。</translation>
</message>
<message>
<location/>
@@ -2714,27 +2722,27 @@ All files (*)</source>
<location line="+11"/>
<location line="+8"/>
<source>Settings for &apos;%1&apos; - Qt Linguist</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; の設定 - Qt Linguist</translation>
</message>
<message>
<location filename="../tools/linguist/linguist/translationsettings.ui"/>
<source>Source language</source>
- <translation type="unfinished"></translation>
+ <translation>翻訳元の言語</translation>
</message>
<message>
<location/>
<source>Language</source>
- <translation type="unfinished">言語</translation>
+ <translation>言語</translation>
</message>
<message>
<location/>
<source>Country/Region</source>
- <translation type="unfinished"></translation>
+ <translation>国/地域</translation>
</message>
<message>
<location/>
<source>Target language</source>
- <translation type="unfinished">翻訳先の言語</translation>
+ <translation>翻訳先の言語</translation>
</message>
</context>
<context>
diff --git a/translations/qt_da.ts b/translations/qt_da.ts
new file mode 100644
index 0000000..105b572
--- /dev/null
+++ b/translations/qt_da.ts
@@ -0,0 +1,7745 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="da_DK">
+<context>
+ <name>AudioOutput</name>
+ <message>
+ <location filename="../src/3rdparty/phonon/phonon/audiooutput.cpp" line="+375"/>
+ <source>&lt;html&gt;The audio playback device &lt;b&gt;%1&lt;/b&gt; does not work.&lt;br/&gt;Falling back to &lt;b&gt;%2&lt;/b&gt;.&lt;/html&gt;</source>
+ <translation>&lt;html&gt;Audio-playback-enheden&lt;b&gt;%1&lt;/b&gt; virker ikke.&lt;br/&gt;Falder tilbage til &lt;b&gt;%2&lt;/b&gt;.&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>&lt;html&gt;Switching to the audio playback device &lt;b&gt;%1&lt;/b&gt;&lt;br/&gt;which just became available and has higher preference.&lt;/html&gt;</source>
+ <translation>&lt;html&gt;Skifter til audio-playback-enheden, &lt;b&gt;%1&lt;/b&gt;&lt;br/&gt;der lige er blevet tilgængelig og har en højere præference.&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Revert back to device &apos;%1&apos;</source>
+ <translation>Gå tilbage til enheden &apos;%1&apos;</translation>
+ </message>
+</context>
+<context>
+ <name>CloseButton</name>
+ <message>
+ <location filename="../src/gui/widgets/qtabbar.cpp" line="+2252"/>
+ <source>Close Tab</source>
+ <translation>Luk fane</translation>
+ </message>
+</context>
+<context>
+ <name>Phonon::</name>
+ <message>
+ <location filename="../src/3rdparty/phonon/phonon/phononnamespace.cpp" line="+55"/>
+ <source>Notifications</source>
+ <translation>Meddelelser</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Music</source>
+ <translation>Musik</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Video</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Communication</source>
+ <translation>Kommunikation</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Games</source>
+ <translation>Spil</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Accessibility</source>
+ <translation>Tilgængelighed</translation>
+ </message>
+</context>
+<context>
+ <name>Phonon::Gstreamer::Backend</name>
+ <message>
+ <location filename="../src/3rdparty/phonon/gstreamer/backend.cpp" line="+171"/>
+ <source>Warning: You do not seem to have the package gstreamer0.10-plugins-good installed.
+ Some video features have been disabled.</source>
+ <translation>Advarsel: Det ser ikke ud til, at gstreamer0.10-plugins-good pakken er installeret.
+ Nogle videofunktioner er deaktiveret.</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Warning: You do not seem to have the base GStreamer plugins installed.
+ All audio and video support has been disabled</source>
+ <translation>Advarsel: Det ser ikke ud til, at base GStreamer plugins er installeret.
+ Al audio- og videosupport er deaktiveret</translation>
+ </message>
+</context>
+<context>
+ <name>Phonon::Gstreamer::MediaObject</name>
+ <message>
+ <location filename="../src/3rdparty/phonon/gstreamer/mediaobject.cpp" line="+90"/>
+ <source>Cannot start playback.
+
+Check your Gstreamer installation and make sure you
+have libgstreamer-plugins-base installed.</source>
+ <translation>Kan ikke starte playback.
+
+Tjek Gstreamer-installationen og kontrollér, at
+libgstreamer-plugins-base er installeret.</translation>
+ </message>
+ <message>
+ <location line="+113"/>
+ <source>A required codec is missing. You need to install the following codec(s) to play this content: %0</source>
+ <translation>Der mangler et codec. Følgende codecs skal installeres for at afspille dette indhold: %0</translation>
+ </message>
+ <message>
+ <location line="+676"/>
+ <location line="+8"/>
+ <location line="+15"/>
+ <location line="+9"/>
+ <location line="+6"/>
+ <location line="+19"/>
+ <location line="+335"/>
+ <location line="+24"/>
+ <source>Could not open media source.</source>
+ <translation>Kunne ikke åbne mediekilden.</translation>
+ </message>
+ <message>
+ <location line="-403"/>
+ <source>Invalid source type.</source>
+ <translation>Ugyldig kilde.</translation>
+ </message>
+ <message>
+ <location line="+377"/>
+ <source>Could not locate media source.</source>
+ <translation>Kunne ikke lokalisere mediekilden.</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>Could not open audio device. The device is already in use.</source>
+ <translation>Kunne ikke åbne lydenheden. Enheden er allerede i brug.</translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>Could not decode media source.</source>
+ <translation>Kunne ikke afkode mediekilden.</translation>
+ </message>
+</context>
+<context>
+ <name>Phonon::VolumeSlider</name>
+ <message>
+ <location filename="../src/3rdparty/phonon/phonon/volumeslider.cpp" line="+42"/>
+ <location line="+18"/>
+ <source>Volume: %1%</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-15"/>
+ <location line="+18"/>
+ <location line="+54"/>
+ <source>Use this slider to adjust the volume. The leftmost position is 0%, the rightmost is %1%</source>
+ <translation>Anvend denne skyder til at indstille lydstyrken. Længst til venstre er 0% og længst til højre er %1%</translation>
+ </message>
+</context>
+<context>
+ <name>Q3Accel</name>
+ <message>
+ <location filename="../src/qt3support/other/q3accel.cpp" line="+481"/>
+ <source>%1, %2 not defined</source>
+ <translation>%1, %2 ikke definerede</translation>
+ </message>
+ <message>
+ <location line="+36"/>
+ <source>Ambiguous %1 not handled</source>
+ <translation>Tvetydig %1 ikke behandlet</translation>
+ </message>
+</context>
+<context>
+ <name>Q3DataTable</name>
+ <message>
+ <location filename="../src/qt3support/sql/q3datatable.cpp" line="+285"/>
+ <source>True</source>
+ <translation>Sandt</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>False</source>
+ <translation>Falsk</translation>
+ </message>
+ <message>
+ <location line="+505"/>
+ <source>Insert</source>
+ <translation>Indsæt</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Update</source>
+ <translation>Opdater</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Delete</source>
+ <translation>Slet</translation>
+ </message>
+</context>
+<context>
+ <name>Q3FileDialog</name>
+ <message>
+ <location filename="../src/qt3support/dialogs/q3filedialog.cpp" line="+865"/>
+ <source>Copy or Move a File</source>
+ <translation>Kopiér eller flyt en fil</translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>Read: %1</source>
+ <translation>Læs: %1</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <location line="+30"/>
+ <source>Write: %1</source>
+ <translation>Skriv: %1</translation>
+ </message>
+ <message>
+ <location line="-22"/>
+ <location line="+1579"/>
+ <source>Cancel</source>
+ <translation>Annuller</translation>
+ </message>
+ <message>
+ <location line="-157"/>
+ <location line="+49"/>
+ <location line="+2153"/>
+ <location filename="../src/qt3support/dialogs/q3filedialog_mac.cpp" line="+110"/>
+ <source>All Files (*)</source>
+ <translation>Alle filer (*)</translation>
+ </message>
+ <message>
+ <location line="-2089"/>
+ <source>Name</source>
+ <translation>Navn</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Size</source>
+ <translation>Størrelse</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Type</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Date</source>
+ <translation>Dato</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Attributes</source>
+ <translation>Attributter</translation>
+ </message>
+ <message>
+ <location line="+35"/>
+ <location line="+2031"/>
+ <source>&amp;OK</source>
+ <translation>&amp;OK</translation>
+ </message>
+ <message>
+ <location line="-1991"/>
+ <source>Look &amp;in:</source>
+ <translation>Kig &amp;i:</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <location line="+1981"/>
+ <location line="+16"/>
+ <source>File &amp;name:</source>
+ <translation>Fil&amp;navn:</translation>
+ </message>
+ <message>
+ <location line="-1996"/>
+ <source>File &amp;type:</source>
+ <translation>Fil&amp;type:</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Back</source>
+ <translation>Tilbage</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>One directory up</source>
+ <translation>En mappe op</translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>Create New Folder</source>
+ <translation>Opret ny folder</translation>
+ </message>
+ <message>
+ <location line="+18"/>
+ <source>List View</source>
+ <translation>Listevisning</translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>Detail View</source>
+ <translation>Detaljevisning</translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>Preview File Info</source>
+ <translation>Vis filinformation</translation>
+ </message>
+ <message>
+ <location line="+23"/>
+ <source>Preview File Contents</source>
+ <translation>Vis filindhold</translation>
+ </message>
+ <message>
+ <location line="+88"/>
+ <source>Read-write</source>
+ <translation>Læs-skriv</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Read-only</source>
+ <translation>Skrivebeskyttet</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Write-only</source>
+ <translation>Write-only</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Inaccessible</source>
+ <translation>Utilgængelig</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Symlink to File</source>
+ <translation>Symlink til Fil</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Symlink to Directory</source>
+ <translation>Symlink til katalog</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Symlink to Special</source>
+ <translation>Symlink til Speciel</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>File</source>
+ <translation>Fil</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Dir</source>
+ <translation>Katalog</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Special</source>
+ <translation>Speciel</translation>
+ </message>
+ <message>
+ <location line="+704"/>
+ <location line="+2100"/>
+ <location filename="../src/qt3support/dialogs/q3filedialog_win.cpp" line="+337"/>
+ <source>Open</source>
+ <translation>Åbn</translation>
+ </message>
+ <message>
+ <location line="-1990"/>
+ <location filename="../src/qt3support/dialogs/q3filedialog_win.cpp" line="+84"/>
+ <source>Save As</source>
+ <translation>Gem som</translation>
+ </message>
+ <message>
+ <location line="+642"/>
+ <location line="+5"/>
+ <location line="+355"/>
+ <source>&amp;Open</source>
+ <translation>&amp;Åbn</translation>
+ </message>
+ <message>
+ <location line="-357"/>
+ <location line="+341"/>
+ <source>&amp;Save</source>
+ <translation>&amp;Gem</translation>
+ </message>
+ <message>
+ <location line="-334"/>
+ <source>&amp;Rename</source>
+ <translation>&amp;Omdøb</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Delete</source>
+ <translation>&amp;Slet</translation>
+ </message>
+ <message>
+ <location line="+20"/>
+ <source>R&amp;eload</source>
+ <translation>Gen&amp;indlæs</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Sort by &amp;Name</source>
+ <translation>Sortér efter n&amp;avn</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Sort by &amp;Size</source>
+ <translation>Sortér efter s&amp;tørrelse</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Sort by &amp;Date</source>
+ <translation>Sortér efter &amp;dato</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>&amp;Unsorted</source>
+ <translation>&amp;Usorteret</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Sort</source>
+ <translation>Sortér</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Show &amp;hidden files</source>
+ <translation>Vis s&amp;kjulte filer</translation>
+ </message>
+ <message>
+ <location line="+31"/>
+ <source>the file</source>
+ <translation>filen</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>the directory</source>
+ <translation>kataloget</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>the symlink</source>
+ <translation>symlinket</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Delete %1</source>
+ <translation>Slet %1</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&lt;qt&gt;Are you sure you wish to delete %1 &quot;%2&quot;?&lt;/qt&gt;</source>
+ <translation>&lt;qt&gt;Er du sikker på, at du vil slette %1 &quot;%2&quot;?&lt;/qt&gt;</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>&amp;Yes</source>
+ <translation>&amp;Ja</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>&amp;No</source>
+ <translation>&amp;Nej</translation>
+ </message>
+ <message>
+ <location line="+36"/>
+ <source>New Folder 1</source>
+ <translation>Ny folder 1</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>New Folder</source>
+ <translation>Ny folder</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>New Folder %1</source>
+ <translation>Ny folder %1</translation>
+ </message>
+ <message>
+ <location line="+98"/>
+ <source>Find Directory</source>
+ <translation>Find katalog</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <location line="+108"/>
+ <source>Directories</source>
+ <translation>Kataloger</translation>
+ </message>
+ <message>
+ <location line="-2"/>
+ <source>Directory:</source>
+ <translation>Katalog:</translation>
+ </message>
+ <message>
+ <location line="+40"/>
+ <location line="+1110"/>
+ <source>Error</source>
+ <translation>Fejl</translation>
+ </message>
+ <message>
+ <location line="-1109"/>
+ <source>%1
+File not found.
+Check path and filename.</source>
+ <translation>%1
+Filen blev ikke fundet.
+Kontrollér sti og filnavn.</translation>
+ </message>
+ <message>
+ <location filename="../src/qt3support/dialogs/q3filedialog_win.cpp" line="-289"/>
+ <source>All Files (*.*)</source>
+ <translation>Alle filer (*.*)</translation>
+ </message>
+ <message>
+ <location line="+375"/>
+ <source>Open </source>
+ <translation>Åbn</translation>
+ </message>
+ <message>
+ <location line="+155"/>
+ <source>Select a Directory</source>
+ <translation>Vælg et katalog</translation>
+ </message>
+</context>
+<context>
+ <name>Q3LocalFs</name>
+ <message>
+ <location filename="../src/qt3support/network/q3localfs.cpp" line="+130"/>
+ <location line="+10"/>
+ <source>Could not read directory
+%1</source>
+ <translation>Kunne ikke læse katalog
+%1</translation>
+ </message>
+ <message>
+ <location line="+45"/>
+ <source>Could not create directory
+%1</source>
+ <translation>Kunne ikke oprette katalog
+%1</translation>
+ </message>
+ <message>
+ <location line="+34"/>
+ <source>Could not remove file or directory
+%1</source>
+ <translation>Kunne ikke fjerne fil eller katalog
+%1</translation>
+ </message>
+ <message>
+ <location line="+27"/>
+ <source>Could not rename
+%1
+to
+%2</source>
+ <translation>Kunne ikke omdøbe
+%1
+to
+%2</translation>
+ </message>
+ <message>
+ <location line="+25"/>
+ <source>Could not open
+%1</source>
+ <translation>Kunne ikke åbne
+%1</translation>
+ </message>
+ <message>
+ <location line="+68"/>
+ <source>Could not write
+%1</source>
+ <translation>Kunne ikke skrive
+%1</translation>
+ </message>
+</context>
+<context>
+ <name>Q3MainWindow</name>
+ <message>
+ <location filename="../src/qt3support/widgets/q3mainwindow.cpp" line="+2051"/>
+ <source>Line up</source>
+ <translation>Linie op</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Customize...</source>
+ <translation>Tilpas...</translation>
+ </message>
+</context>
+<context>
+ <name>Q3NetworkProtocol</name>
+ <message>
+ <location filename="../src/qt3support/network/q3networkprotocol.cpp" line="+854"/>
+ <source>Operation stopped by the user</source>
+ <translation>Brugeren stoppede handlingen</translation>
+ </message>
+</context>
+<context>
+ <name>Q3ProgressDialog</name>
+ <message>
+ <location filename="../src/qt3support/dialogs/q3progressdialog.cpp" line="+224"/>
+ <location line="+61"/>
+ <source>Cancel</source>
+ <translation>Annuller</translation>
+ </message>
+</context>
+<context>
+ <name>Q3TabDialog</name>
+ <message>
+ <location filename="../src/qt3support/dialogs/q3tabdialog.cpp" line="+189"/>
+ <location line="+814"/>
+ <source>OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-356"/>
+ <source>Apply</source>
+ <translation>Udfør</translation>
+ </message>
+ <message>
+ <location line="+43"/>
+ <source>Help</source>
+ <translation>Hjælp</translation>
+ </message>
+ <message>
+ <location line="+45"/>
+ <source>Defaults</source>
+ <translation>Standarder</translation>
+ </message>
+ <message>
+ <location line="+50"/>
+ <source>Cancel</source>
+ <translation>Annuller</translation>
+ </message>
+</context>
+<context>
+ <name>Q3TextEdit</name>
+ <message>
+ <location filename="../src/qt3support/text/q3textedit.cpp" line="+5429"/>
+ <source>&amp;Undo</source>
+ <translation>&amp;Fortryd</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Redo</source>
+ <translation>&amp;Gendan</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Cu&amp;t</source>
+ <translation>&amp;Klip</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Copy</source>
+ <translation>K&amp;opiér</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>&amp;Paste</source>
+ <translation>&amp;Sæt ind</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Clear</source>
+ <translation>Ryd</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location line="+2"/>
+ <source>Select All</source>
+ <translation>Markér alt</translation>
+ </message>
+</context>
+<context>
+ <name>Q3TitleBar</name>
+ <message>
+ <location filename="../src/plugins/accessible/compat/q3complexwidgets.cpp" line="+246"/>
+ <source>System</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Restore up</source>
+ <translation>Gendan op</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Minimize</source>
+ <translation>Minimer</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Restore down</source>
+ <translation>Gendan ned</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Maximize</source>
+ <translation>Maksimér</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Close</source>
+ <translation>Luk</translation>
+ </message>
+ <message>
+ <location line="+18"/>
+ <source>Contains commands to manipulate the window</source>
+ <translation>Indeholder kommandoer til indstilling af vinduet</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Puts a minimized back to normal</source>
+ <translation>Sætter et minimeret vindue til normal størrelse</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Moves the window out of the way</source>
+ <translation>Flytter vinduet væk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Puts a maximized window back to normal</source>
+ <translation>Sætter et maksimeret vindue til normal størrelse</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Makes the window full screen</source>
+ <translation>Gør vinduet til fuld skærm</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Closes the window</source>
+ <translation>Lukker vinduet</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Displays the name of the window and contains controls to manipulate it</source>
+ <translation>Viser vinduets navn og indeholder kontroller til indstilling af vinduet</translation>
+ </message>
+</context>
+<context>
+ <name>Q3ToolBar</name>
+ <message>
+ <location filename="../src/qt3support/widgets/q3toolbar.cpp" line="+692"/>
+ <source>More...</source>
+ <translation>Mere...</translation>
+ </message>
+</context>
+<context>
+ <name>Q3UrlOperator</name>
+ <message>
+ <location filename="../src/qt3support/network/q3urloperator.cpp" line="+386"/>
+ <location line="+260"/>
+ <location line="+4"/>
+ <source>The protocol `%1&apos; is not supported</source>
+ <translation>Protokollen &apos;%1&apos; understøttes ikke</translation>
+ </message>
+ <message>
+ <location line="-260"/>
+ <source>The protocol `%1&apos; does not support listing directories</source>
+ <translation>Protokollen &apos;%1&apos; understøtter ikke opremsning af kataloger</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>The protocol `%1&apos; does not support creating new directories</source>
+ <translation>Protokollen &apos;%1&apos; understøtter ikke oprettelse af nye kataloger</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>The protocol `%1&apos; does not support removing files or directories</source>
+ <translation>Protokollen &apos;%1&apos; understøtter ikke, at filer eller kataloger fjernes</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>The protocol `%1&apos; does not support renaming files or directories</source>
+ <translation>Protokollen &apos;%1&apos; understøtter ikke, at filer eller kataloger omdøbes</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>The protocol `%1&apos; does not support getting files</source>
+ <translation>Protokollen &apos;%1&apos; understøtter ikke hentning af filer</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>The protocol `%1&apos; does not support putting files</source>
+ <translation>Protokollen &apos;%1&apos; understøtter ikke upload af filer</translation>
+ </message>
+ <message>
+ <location line="+243"/>
+ <location line="+4"/>
+ <source>The protocol `%1&apos; does not support copying or moving files or directories</source>
+ <translation>Protokollen &apos;%1&apos; understøtter ikke kopiering eller flytning af filer eller kataloger</translation>
+ </message>
+ <message>
+ <location line="+237"/>
+ <location line="+1"/>
+ <source>(unknown)</source>
+ <translation>(ukendt)</translation>
+ </message>
+</context>
+<context>
+ <name>Q3Wizard</name>
+ <message>
+ <location filename="../src/qt3support/dialogs/q3wizard.cpp" line="+177"/>
+ <source>&amp;Cancel</source>
+ <translation>&amp;Annuller</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&lt; &amp;Back</source>
+ <translation>&lt; &amp;Tilbage</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Next &gt;</source>
+ <translation>&amp;Næste &gt;</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Finish</source>
+ <translation>&amp;Udfør</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Help</source>
+ <translation>&amp;Hjælp</translation>
+ </message>
+</context>
+<context>
+ <name>QAbstractSocket</name>
+ <message>
+ <location filename="../src/network/socket/qabstractsocket.cpp" line="+868"/>
+ <location filename="../src/network/socket/qhttpsocketengine.cpp" line="+615"/>
+ <location filename="../src/network/socket/qsocks5socketengine.cpp" line="+657"/>
+ <location line="+26"/>
+ <source>Host not found</source>
+ <translation>Host blev ikke fundet</translation>
+ </message>
+ <message>
+ <location line="+50"/>
+ <location filename="../src/network/socket/qhttpsocketengine.cpp" line="+3"/>
+ <location filename="../src/network/socket/qsocks5socketengine.cpp" line="+4"/>
+ <source>Connection refused</source>
+ <translation>Forbindelse afvist</translation>
+ </message>
+ <message>
+ <location line="+141"/>
+ <source>Connection timed out</source>
+ <translation>Forbindelsen timed out</translation>
+ </message>
+ <message>
+ <location line="-547"/>
+ <location line="+787"/>
+ <location line="+208"/>
+ <source>Operation on socket is not supported</source>
+ <translation>Socket-operation ikke understøttet</translation>
+ </message>
+ <message>
+ <location line="+137"/>
+ <source>Socket operation timed out</source>
+ <translation>Socket-operation timed out</translation>
+ </message>
+ <message>
+ <location line="+380"/>
+ <source>Socket is not connected</source>
+ <translation>Socket ikke forbundet</translation>
+ </message>
+ <message>
+ <location filename="../src/network/socket/qsocks5socketengine.cpp" line="-8"/>
+ <source>Network unreachable</source>
+ <translation>Netværket er ikke tilgængeligt</translation>
+ </message>
+</context>
+<context>
+ <name>QAbstractSpinBox</name>
+ <message>
+ <location filename="../src/gui/widgets/qabstractspinbox.cpp" line="+1199"/>
+ <source>&amp;Step up</source>
+ <translation>&amp;Trin op</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Step &amp;down</source>
+ <translation>Trin &amp;ned</translation>
+ </message>
+ <message>
+ <location line="-8"/>
+ <source>&amp;Select All</source>
+ <translation>&amp;Vælg alle</translation>
+ </message>
+</context>
+<context>
+ <name>QApplication</name>
+ <message>
+ <location filename="../src/gui/accessible/qaccessibleobject.cpp" line="+376"/>
+ <source>Activate</source>
+ <translation>Aktivér</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qmessagebox.h" line="+352"/>
+ <source>Executable &apos;%1&apos; requires Qt %2, found Qt %3.</source>
+ <translation>Eksekverbar &apos;%1&apos; kræver Qt %2, ikke fundet Qt %3.</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Incompatible Qt Library Error</source>
+ <translation>Inkompatibel Qt Library fejl</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2247"/>
+ <source>QT_LAYOUT_DIRECTION</source>
+ <comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout.</comment>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="../src/gui/accessible/qaccessibleobject.cpp" line="+2"/>
+ <source>Activates the program&apos;s main window</source>
+ <translation>Aktiverer programmets hovedvindue</translation>
+ </message>
+</context>
+<context>
+ <name>QAxSelect</name>
+ <message>
+ <location filename="../src/activeqt/container/qaxselect.ui"/>
+ <source>Select ActiveX Control</source>
+ <translation>Vælg ActiveX-kontrol</translation>
+ </message>
+ <message>
+ <location/>
+ <source>OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location/>
+ <source>&amp;Cancel</source>
+ <translation>&amp;Annuller</translation>
+ </message>
+ <message>
+ <location/>
+ <source>COM &amp;Object:</source>
+ <translation>COM &amp;Objekt:</translation>
+ </message>
+</context>
+<context>
+ <name>QCheckBox</name>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/simplewidgets.cpp" line="+114"/>
+ <source>Uncheck</source>
+ <translation>Fjern markering</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Check</source>
+ <translation>Kryds af</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Toggle</source>
+ <translation>Slå til/fra</translation>
+ </message>
+</context>
+<context>
+ <name>QColorDialog</name>
+ <message>
+ <location filename="../src/gui/dialogs/qcolordialog.cpp" line="+1253"/>
+ <source>Hu&amp;e:</source>
+ <translation>Ton&amp;e:</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Sat:</source>
+ <translation>&amp;Mæt:</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Val:</source>
+ <translation>&amp;Vær:</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Red:</source>
+ <translation>&amp;Rød:</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Green:</source>
+ <translation>&amp;Grøn:</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Bl&amp;ue:</source>
+ <translation>Bl&amp;å:</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A&amp;lpha channel:</source>
+ <translation>Al&amp;fa-kanal:</translation>
+ </message>
+ <message>
+ <location line="+101"/>
+ <source>Select Color</source>
+ <translation>Vælg farve</translation>
+ </message>
+ <message>
+ <location line="+137"/>
+ <source>&amp;Basic colors</source>
+ <translation>&amp;Basisfarver</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Custom colors</source>
+ <translation>&amp;Egne farver</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Add to Custom Colors</source>
+ <translation>&amp;Føj til egne farver</translation>
+ </message>
+</context>
+<context>
+ <name>QComboBox</name>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="+1771"/>
+ <location line="+65"/>
+ <source>Open</source>
+ <translation>Åbn</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/itemviews/qitemeditorfactory.cpp" line="+544"/>
+ <source>False</source>
+ <translation>Falsk</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>True</source>
+ <translation>Sandt</translation>
+ </message>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="+0"/>
+ <source>Close</source>
+ <translation>Luk</translation>
+ </message>
+</context>
+<context>
+ <name>QCoreApplication</name>
+ <message>
+ <location filename="../src/corelib/kernel/qsystemsemaphore_unix.cpp" line="+119"/>
+ <source>%1: key is empty</source>
+ <comment>QSystemSemaphore</comment>
+ <translation>%1: nøgle er tom</translation>
+ </message>
+ <message>
+ <location line="+12"/>
+ <source>%1: unable to make key</source>
+ <comment>QSystemSemaphore</comment>
+ <translation>%1: kunne ikke lave nøgle</translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>%1: ftok failed</source>
+ <comment>QSystemSemaphore</comment>
+ <translation>%1: ftok mislykkedes</translation>
+ </message>
+</context>
+<context>
+ <name>QDB2Driver</name>
+ <message>
+ <location filename="../src/sql/drivers/db2/qsql_db2.cpp" line="+1276"/>
+ <source>Unable to connect</source>
+ <translation>Kunne ikke skabe forbindelse</translation>
+ </message>
+ <message>
+ <location line="+303"/>
+ <source>Unable to commit transaction</source>
+ <translation>Kunne ikke gennemføre transaktion</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Unable to rollback transaction</source>
+ <translation>Kunne ikke tilbagetrække transaktion</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Unable to set autocommit</source>
+ <translation>Kunne ikke aktivere autocommit</translation>
+ </message>
+</context>
+<context>
+ <name>QDB2Result</name>
+ <message>
+ <location line="-1043"/>
+ <location line="+243"/>
+ <source>Unable to execute statement</source>
+ <translation>Kunne ikke udføre statement</translation>
+ </message>
+ <message>
+ <location line="-206"/>
+ <source>Unable to prepare statement</source>
+ <translation>Kunne ikke forberede udsagn</translation>
+ </message>
+ <message>
+ <location line="+196"/>
+ <source>Unable to bind variable</source>
+ <translation>Kunne ikke binde variabel</translation>
+ </message>
+ <message>
+ <location line="+92"/>
+ <source>Unable to fetch record %1</source>
+ <translation>Kunne ikke hente post %1</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Unable to fetch next</source>
+ <translation>Kunne ikke hente næste</translation>
+ </message>
+ <message>
+ <location line="+20"/>
+ <source>Unable to fetch first</source>
+ <translation>Kunne ikke hente første</translation>
+ </message>
+</context>
+<context>
+ <name>QDateTimeEdit</name>
+ <message>
+ <location filename="../src/gui/widgets/qdatetimeedit.cpp" line="+2295"/>
+ <source>AM</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>am</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>PM</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>pm</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>QDial</name>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="+951"/>
+ <source>QDial</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>SpeedoMeter</source>
+ <translation>Speedometer</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>SliderHandle</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>QDialog</name>
+ <message>
+ <location filename="../src/gui/dialogs/qdialog.cpp" line="+597"/>
+ <source>What&apos;s This?</source>
+ <translation>Hvad er dette?</translation>
+ </message>
+ <message>
+ <location line="-115"/>
+ <source>Done</source>
+ <translation>Udført</translation>
+ </message>
+</context>
+<context>
+ <name>QDialogButtonBox</name>
+ <message>
+ <location filename="../src/gui/dialogs/qmessagebox.cpp" line="+1869"/>
+ <location line="+464"/>
+ <location filename="../src/gui/widgets/qdialogbuttonbox.cpp" line="+561"/>
+ <source>OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="../src/gui/widgets/qdialogbuttonbox.cpp" line="+0"/>
+ <source>&amp;OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>&amp;Save</source>
+ <translation>&amp;Gem</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Save</source>
+ <translation>Gem</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Open</source>
+ <translation>Åbn</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>&amp;Cancel</source>
+ <translation>&amp;Annuller</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Cancel</source>
+ <translation>Annuller</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>&amp;Close</source>
+ <translation>&amp;Luk</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Close</source>
+ <translation>Luk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Apply</source>
+ <translation>Udfør</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Reset</source>
+ <translation>Nulstil</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Help</source>
+ <translation>Hjælp</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Don&apos;t Save</source>
+ <translation>Gem ikke</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Discard</source>
+ <translation>Kassér</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>&amp;Yes</source>
+ <translation>&amp;Ja</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Yes to &amp;All</source>
+ <translation>Ja til &amp;alle</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>&amp;No</source>
+ <translation>&amp;Nej</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>N&amp;o to All</source>
+ <translation>Ne&amp;j til alle</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Save All</source>
+ <translation>Gem alle</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Abort</source>
+ <translation>Afbryd</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Retry</source>
+ <translation>Prøv igen</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Ignore</source>
+ <translation>Ignorer</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Restore Defaults</source>
+ <translation>Gendan standardværdier</translation>
+ </message>
+ <message>
+ <location line="-29"/>
+ <source>Close without Saving</source>
+ <translation>Luk uden at gemme</translation>
+ </message>
+</context>
+<context>
+ <name>QDirModel</name>
+ <message>
+ <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+453"/>
+ <source>Name</source>
+ <translation>Navn</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Size</source>
+ <translation>Størrelse</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Kind</source>
+ <comment>Match OS X Finder</comment>
+ <translation>Type</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Type</source>
+ <comment>All other platforms</comment>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Date Modified</source>
+ <translation>Ændringsdato</translation>
+ </message>
+</context>
+<context>
+ <name>QDockWidget</name>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/qaccessiblewidgets.cpp" line="+1239"/>
+ <source>Close</source>
+ <translation>Luk</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Dock</source>
+ <translation>Låst</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Float</source>
+ <translation>Flydende</translation>
+ </message>
+</context>
+<context>
+ <name>QDoubleSpinBox</name>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="-537"/>
+ <source>More</source>
+ <translation>Mere</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Less</source>
+ <translation>Mindre</translation>
+ </message>
+</context>
+<context>
+ <name>QErrorMessage</name>
+ <message>
+ <location filename="../src/gui/dialogs/qerrormessage.cpp" line="+192"/>
+ <source>Debug Message:</source>
+ <translation>Debug-besked:</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Warning:</source>
+ <translation>Advarsel:</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Fatal Error:</source>
+ <translation>Fatal fejl:</translation>
+ </message>
+ <message>
+ <location line="+193"/>
+ <source>&amp;Show this message again</source>
+ <translation>&amp;Vis denne besked igen</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;OK</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>QFile</name>
+ <message>
+ <location filename="../src/corelib/io/qfile.cpp" line="+708"/>
+ <location line="+141"/>
+ <source>Destination file exists</source>
+ <translation>Destinationsfil findes</translation>
+ </message>
+ <message>
+ <location line="-108"/>
+ <source>Cannot remove source file</source>
+ <translation>Kan ikke fjerne kildefil</translation>
+ </message>
+ <message>
+ <location line="+120"/>
+ <source>Cannot open %1 for input</source>
+ <translation>Kan ikke åbne %1 til input</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Cannot open for output</source>
+ <translation>Kan ikke åbne til output</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>Failure to write block</source>
+ <translation>Kunne ikke skrive blok</translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>Cannot create %1 for output</source>
+ <translation>Kunne ikke oprette %1 til output</translation>
+ </message>
+</context>
+<context>
+ <name>QFileDialog</name>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="+514"/>
+ <location line="+447"/>
+ <source>All Files (*)</source>
+ <translation>Alle filer (*)</translation>
+ </message>
+ <message>
+ <location line="+222"/>
+ <source>Directories</source>
+ <translation>Kataloger</translation>
+ </message>
+ <message>
+ <location line="-3"/>
+ <location line="+50"/>
+ <location line="+1467"/>
+ <location line="+75"/>
+ <source>&amp;Open</source>
+ <translation>&amp;Åbn</translation>
+ </message>
+ <message>
+ <location line="-1592"/>
+ <location line="+50"/>
+ <source>&amp;Save</source>
+ <translation>&amp;Gem</translation>
+ </message>
+ <message>
+ <location line="-733"/>
+ <source>Open</source>
+ <translation>Åbn</translation>
+ </message>
+ <message>
+ <location line="+1515"/>
+ <source>%1 already exists.
+Do you want to replace it?</source>
+ <translation>%1 findes allerede.
+Ønsker du at erstatte den?</translation>
+ </message>
+ <message>
+ <location line="+20"/>
+ <source>%1
+File not found.
+Please verify the correct file name was given.</source>
+ <translation>%1
+Filen kunne ikke findes.
+Kontrollér, at det rigtige filnavn er indtastet.</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+402"/>
+ <source>My Computer</source>
+ <translation>Min computer</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-1504"/>
+ <source>&amp;Rename</source>
+ <translation>&amp;Omdøb</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Delete</source>
+ <translation>&amp;Slet</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show &amp;hidden files</source>
+ <translation>Vis s&amp;kjulte filer</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.ui"/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
+ <source>Back</source>
+ <translation>Tilbage</translation>
+ </message>
+ <message>
+ <location/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
+ <source>Parent Directory</source>
+ <translation>Ovenliggende katalog</translation>
+ </message>
+ <message>
+ <location/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
+ <source>List View</source>
+ <translation>Listevisning</translation>
+ </message>
+ <message>
+ <location/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
+ <source>Detail View</source>
+ <translation>Detaljevisning</translation>
+ </message>
+ <message>
+ <location/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
+ <source>Files of type:</source>
+ <translation>Filer af typen:</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="+6"/>
+ <location line="+651"/>
+ <source>Directory:</source>
+ <translation>Katalog:</translation>
+ </message>
+ <message>
+ <location line="+791"/>
+ <location line="+861"/>
+ <source>%1
+Directory not found.
+Please verify the correct directory name was given.</source>
+ <translation>%1
+Katalog kunne ikke findes.
+Kontrollér, at det rigtige katalognavn er indtastet.</translation>
+ </message>
+ <message>
+ <location line="-218"/>
+ <source>&apos;%1&apos; is write protected.
+Do you want to delete it anyway?</source>
+ <translation>&apos;%1&apos; er skrivebeskyttet.
+Ønsker du alligevel at slette?</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Are sure you want to delete &apos;%1&apos;?</source>
+ <translation>Er du sikker på, at &apos;%1&apos; skal slettes?</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Could not delete directory.</source>
+ <translation>Kunne ikke slette kataloget.</translation>
+ </message>
+ <message>
+ <location line="+407"/>
+ <source>Recent Places</source>
+ <translation>Aktuelle steder</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog_win.cpp" line="+160"/>
+ <source>All Files (*.*)</source>
+ <translation>Alle filer (*.*)</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-2549"/>
+ <source>Save As</source>
+ <translation>Gem som</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/itemviews/qfileiconprovider.cpp" line="+411"/>
+ <source>Drive</source>
+ <translation>Drev</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <location line="+1"/>
+ <source>File</source>
+ <translation>Fil</translation>
+ </message>
+ <message>
+ <location line="+29"/>
+ <source>Unknown</source>
+ <translation>Ukendt</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-4"/>
+ <source>Find Directory</source>
+ <translation>Find katalog</translation>
+ </message>
+ <message>
+ <location line="+29"/>
+ <source>Show </source>
+ <translation>Vis</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.ui"/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
+ <source>Forward</source>
+ <translation>Frem</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="+1969"/>
+ <source>New Folder</source>
+ <translation>Ny folder</translation>
+ </message>
+ <message>
+ <location line="-1962"/>
+ <source>&amp;New Folder</source>
+ <translation>&amp;Ny folder</translation>
+ </message>
+ <message>
+ <location line="+659"/>
+ <location line="+38"/>
+ <source>&amp;Choose</source>
+ <translation>&amp;Vælg</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qsidebar.cpp" line="+437"/>
+ <source>Remove</source>
+ <translation>Fjern</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-690"/>
+ <location line="+655"/>
+ <source>File &amp;name:</source>
+ <translation>&amp;Filnavn:</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.ui"/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
+ <source>Look in:</source>
+ <translation>Søg i:</translation>
+ </message>
+ <message>
+ <location/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
+ <source>Create New Folder</source>
+ <translation>Opret ny folder</translation>
+ </message>
+</context>
+<context>
+ <name>QFileSystemModel</name>
+ <message>
+ <location filename="../src/gui/dialogs/qfilesystemmodel.cpp" line="+828"/>
+ <source>Invalid filename</source>
+ <translation>Ugyldigt filnavn</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&lt;b&gt;The name &quot;%1&quot; can not be used.&lt;/b&gt;&lt;p&gt;Try using another name, with fewer characters or no punctuations marks.</source>
+ <translation>&lt;b&gt;Navnet, %1, kan ikke benyttes.&lt;/b&gt;&lt;p&gt;Brug et andet navn med færre tegn og ingen kommatering.</translation>
+ </message>
+ <message>
+ <location line="+63"/>
+ <source>Name</source>
+ <translation>Navn</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Size</source>
+ <translation>Størrelse</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Kind</source>
+ <comment>Match OS X Finder</comment>
+ <translation>Type</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Type</source>
+ <comment>All other platforms</comment>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Date Modified</source>
+ <translation>Ændringsdato</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfilesystemmodel_p.h" line="+242"/>
+ <source>My Computer</source>
+ <translation>Min computer</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Computer</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfilesystemmodel.cpp" line="-163"/>
+ <source>%1 TB</source>
+ <translation>%1 TB</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>%1 GB</source>
+ <translation>%1 GB</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>%1 MB</source>
+ <translation>%1 MB</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>%1 KB</source>
+ <translation>%1 KB&apos;</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>%1 bytes</source>
+ <translation>%1 bytes</translation>
+ </message>
+</context>
+<context>
+ <name>QFontDatabase</name>
+ <message>
+ <location filename="../src/gui/text/qfontdatabase.cpp" line="+90"/>
+ <location line="+1176"/>
+ <source>Normal</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-1173"/>
+ <location line="+12"/>
+ <location line="+1149"/>
+ <source>Bold</source>
+ <translation>Fed</translation>
+ </message>
+ <message>
+ <location line="-1158"/>
+ <location line="+1160"/>
+ <source>Demi Bold</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-1157"/>
+ <location line="+18"/>
+ <location line="+1135"/>
+ <source>Black</source>
+ <translation>Sort</translation>
+ </message>
+ <message>
+ <location line="-1145"/>
+ <source>Demi</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <location line="+1145"/>
+ <source>Light</source>
+ <translation>Lys</translation>
+ </message>
+ <message>
+ <location line="-1004"/>
+ <location line="+1007"/>
+ <source>Italic</source>
+ <translation>Kursiv</translation>
+ </message>
+ <message>
+ <location line="-1004"/>
+ <location line="+1006"/>
+ <source>Oblique</source>
+ <translation>Skråt</translation>
+ </message>
+ <message>
+ <location line="+705"/>
+ <source>Any</source>
+ <translation>Alle</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Latin</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Greek</source>
+ <translation>Græsk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Cyrillic</source>
+ <translation>Kyrillisk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Armenian</source>
+ <translation>Armensk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Hebrew</source>
+ <translation>Hebræisk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Arabic</source>
+ <translation>Arabisk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Syriac</source>
+ <translation>Syrisk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Thaana</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Devanagari</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Bengali</source>
+ <translation>Bengalsk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Gurmukhi</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Gujarati</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Oriya</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Tamil</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Telugu</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Kannada</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Malayalam</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Sinhala</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Thai</source>
+ <translation>Thailandsk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Lao</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Tibetan</source>
+ <translation>Tibetansk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Myanmar</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Georgian</source>
+ <translation>georgisk </translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Khmer</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Simplified Chinese</source>
+ <translation>Forenklet kinesisk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Traditional Chinese</source>
+ <translation>Traditionelt kinesisk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Japanese</source>
+ <translation>Japansk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Korean</source>
+ <translation>Koreansk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Vietnamese</source>
+ <translation>Vietnamesisk</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Symbol</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Ogham</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Runic</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>QFontDialog</name>
+ <message>
+ <location filename="../src/gui/dialogs/qfontdialog.cpp" line="+772"/>
+ <source>&amp;Font</source>
+ <translation>S&amp;krifttype</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Font st&amp;yle</source>
+ <translation>S&amp;til</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Size</source>
+ <translation>&amp;Størrelse</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Effects</source>
+ <translation>Effekter</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Stri&amp;keout</source>
+ <translation>&amp;Overstreget</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Underline</source>
+ <translation>&amp;Understreg</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Sample</source>
+ <translation>Eksempel</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Wr&amp;iting System</source>
+ <translation>Skr&amp;ivesystem</translation>
+ </message>
+ <message>
+ <location line="-604"/>
+ <location line="+247"/>
+ <source>Select Font</source>
+ <translation>Vælg skrifttype</translation>
+ </message>
+</context>
+<context>
+ <name>QFtp</name>
+ <message>
+ <location filename="../src/network/access/qftp.cpp" line="+826"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+683"/>
+ <source>Not connected</source>
+ <translation>Ingen forbindelse</translation>
+ </message>
+ <message>
+ <location line="+65"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+65"/>
+ <source>Host %1 not found</source>
+ <translation>Vært %1 ikke fundet</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+4"/>
+ <source>Connection refused to host %1</source>
+ <translation>Forbindelse til vært %1 afvist</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Connection timed out to host %1</source>
+ <translation>Forbindelsen timed out til host %1</translation>
+ </message>
+ <message>
+ <location line="+104"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+102"/>
+ <location line="+1451"/>
+ <source>Connected to host %1</source>
+ <translation>Tilsluttet vært %1</translation>
+ </message>
+ <message>
+ <location line="+219"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="-1290"/>
+ <source>Connection refused for data connection</source>
+ <translation>Dataforbindelse afvist</translation>
+ </message>
+ <message>
+ <location line="+178"/>
+ <location line="+29"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+195"/>
+ <location line="+728"/>
+ <source>Unknown error</source>
+ <translation>Ukendt fejl</translation>
+ </message>
+ <message>
+ <location line="+889"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+77"/>
+ <source>Connecting to host failed:
+%1</source>
+ <translation>Forbindelse til vært mislykkedes:
+%1</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
+ <source>Login failed:
+%1</source>
+ <translation>Login mislykkedes:
+%1</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
+ <source>Listing directory failed:
+%1</source>
+ <translation>Opremsning af katalogindhold mislykkedes:
+%1</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
+ <source>Changing directory failed:
+%1</source>
+ <translation>Ændring af katalog mislykkedes:
+%1</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
+ <source>Downloading file failed:
+%1</source>
+ <translation>Downloading af fil mislykkedes:
+%1</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
+ <source>Uploading file failed:
+%1</source>
+ <translation>Uploading af fil mislykkedes:
+%1</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
+ <source>Removing file failed:
+%1</source>
+ <translation>Det mislykkedes at fjerne fil:
+%1</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
+ <source>Creating directory failed:
+%1</source>
+ <translation>Oprettelse af katalog mislykkedes:
+%1</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
+ <source>Removing directory failed:
+%1</source>
+ <translation>Det mislykkedes at fjerne katalog:
+%1</translation>
+ </message>
+ <message>
+ <location line="+28"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+25"/>
+ <location line="+250"/>
+ <source>Connection closed</source>
+ <translation>Forbindelse lukket</translation>
+ </message>
+ <message>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="-11"/>
+ <source>Host %1 found</source>
+ <translation>Vært %1 fundet</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Connection to %1 closed</source>
+ <translation>Forbindelse til %1 lukket</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Host found</source>
+ <translation>Vært fundet</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Connected to host</source>
+ <translation>Tilsluttet vært</translation>
+ </message>
+</context>
+<context>
+ <name>QHostInfo</name>
+ <message>
+ <location filename="../src/network/kernel/qhostinfo_p.h" line="+183"/>
+ <source>Unknown error</source>
+ <translation>Ukendt fejl</translation>
+ </message>
+</context>
+<context>
+ <name>QHostInfoAgent</name>
+ <message>
+ <location filename="../src/network/kernel/qhostinfo_unix.cpp" line="+178"/>
+ <location line="+9"/>
+ <location line="+64"/>
+ <location line="+31"/>
+ <location filename="../src/network/kernel/qhostinfo_win.cpp" line="+180"/>
+ <location line="+9"/>
+ <location line="+40"/>
+ <location line="+27"/>
+ <source>Host not found</source>
+ <translation>Vært ikke fundet</translation>
+ </message>
+ <message>
+ <location line="-44"/>
+ <location line="+39"/>
+ <location filename="../src/network/kernel/qhostinfo_win.cpp" line="-34"/>
+ <location line="+29"/>
+ <source>Unknown address type</source>
+ <translation>Ukendt adressetype</translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <location filename="../src/network/kernel/qhostinfo_win.cpp" line="-19"/>
+ <location line="+27"/>
+ <source>Unknown error</source>
+ <translation>Ukendt fejl</translation>
+ </message>
+</context>
+<context>
+ <name>QHttp</name>
+ <message>
+ <location filename="../src/network/access/qhttp.cpp" line="+1574"/>
+ <location line="+820"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+1160"/>
+ <location line="+567"/>
+ <source>Unknown error</source>
+ <translation>Ukendt fejl</translation>
+ </message>
+ <message>
+ <location line="-568"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="-370"/>
+ <source>Request aborted</source>
+ <translation>Forespørgsel blev annulleret</translation>
+ </message>
+ <message>
+ <location line="+579"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+381"/>
+ <source>No server set to connect to</source>
+ <translation>Ingen server at forbinde til</translation>
+ </message>
+ <message>
+ <location line="+164"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+56"/>
+ <source>Wrong content length</source>
+ <translation>Forkert indholdslængde</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+4"/>
+ <source>Server closed connection unexpectedly</source>
+ <translation>Serveren afsluttede uventet forbindelsen</translation>
+ </message>
+ <message>
+ <location line="+179"/>
+ <source>Unknown authentication method</source>
+ <translation>Ukendt autentifikationsmetode</translation>
+ </message>
+ <message>
+ <location line="+183"/>
+ <source>Error writing response to device</source>
+ <translation>Skrivefejl mens der blev skrevet til enheden</translation>
+ </message>
+ <message>
+ <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+901"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+38"/>
+ <source>Connection refused</source>
+ <translation>Forbindelse afvist</translation>
+ </message>
+ <message>
+ <location filename="../src/network/access/qhttp.cpp" line="-304"/>
+ <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="-4"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+3"/>
+ <source>Host %1 not found</source>
+ <translation>Vært %1 ikke fundet</translation>
+ </message>
+ <message>
+ <location line="+20"/>
+ <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+10"/>
+ <location line="+19"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+3"/>
+ <source>HTTP request failed</source>
+ <translation>HTTP anmodning mislykkedes</translation>
+ </message>
+ <message>
+ <location line="+73"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+69"/>
+ <source>Invalid HTTP response header</source>
+ <translation>Ugyldig HTTP-svar-header</translation>
+ </message>
+ <message>
+ <location line="+125"/>
+ <location line="+48"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+40"/>
+ <location line="+47"/>
+ <source>Invalid HTTP chunked body</source>
+ <translation>Ugyldig HTTP chunked body</translation>
+ </message>
+ <message>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+294"/>
+ <source>Host %1 found</source>
+ <translation>Vært %1 fundet</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Connected to host %1</source>
+ <translation>Tilsluttet vært %1</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Connection to %1 closed</source>
+ <translation>Forbindelse til %1 lukket</translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>Host found</source>
+ <translation>Vært fundet</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Connected to host</source>
+ <translation>Tilsluttet vært</translation>
+ </message>
+ <message>
+ <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="-22"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+3"/>
+ <source>Connection closed</source>
+ <translation>Forbindelse lukket</translation>
+ </message>
+ <message>
+ <location filename="../src/network/access/qhttp.cpp" line="-135"/>
+ <source>Proxy authentication required</source>
+ <translation>Kræver proxy-autentificering</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Authentication required</source>
+ <translation>Autentificering påkrævet</translation>
+ </message>
+ <message>
+ <location line="-138"/>
+ <source>Connection refused (or timed out)</source>
+ <translation>Forbindelse blev afvist (eller tid udløb)</translation>
+ </message>
+ <message>
+ <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+6"/>
+ <source>Proxy requires authentication</source>
+ <translation>Proxy kræver autentificering</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Host requires authentication</source>
+ <translation>Vært kræver autentificering</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Data corrupted</source>
+ <translation>Data er ødelagt</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Unknown protocol specified</source>
+ <translation>En ukendt protokol blev angivet</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>SSL handshake failed</source>
+ <translation>SSL handshake mislykkedes</translation>
+ </message>
+ <message>
+ <location filename="../src/network/access/qhttp.cpp" line="-2263"/>
+ <source>HTTPS connection requested but SSL support not compiled in</source>
+ <translation>Der blevet anmodet om en HTTPS-forbindelse, men SSL understøttelse er ikke kompileret ind</translation>
+ </message>
+</context>
+<context>
+ <name>QHttpSocketEngine</name>
+ <message>
+ <location filename="../src/network/socket/qhttpsocketengine.cpp" line="-89"/>
+ <source>Did not receive HTTP response from proxy</source>
+ <translation>Modtog ikke HTTP-svar fra proxy</translation>
+ </message>
+ <message>
+ <location line="+25"/>
+ <source>Error parsing authentication request from proxy</source>
+ <translation>Fejl under fortolking af autentificeringsanmodning fra proxy</translation>
+ </message>
+ <message>
+ <location line="+31"/>
+ <source>Authentication required</source>
+ <translation>Autentificering påkrævet</translation>
+ </message>
+ <message>
+ <location line="+27"/>
+ <source>Proxy denied connection</source>
+ <translation>Proxy nægtede forbindelse</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>Error communicating with HTTP proxy</source>
+ <translation>Fejl under kommunikation med HTTP-proxy</translation>
+ </message>
+ <message>
+ <location line="+23"/>
+ <source>Proxy server not found</source>
+ <translation>Proxy-server kunne ikke findes</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Proxy connection refused</source>
+ <translation>Proxy-forbindelse nægtede</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Proxy server connection timed out</source>
+ <translation>Proxy-serverforbindelse timed out</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Proxy connection closed prematurely</source>
+ <translation>Proxy-forbindelse afsluttede i utide</translation>
+ </message>
+</context>
+<context>
+ <name>QIBaseDriver</name>
+ <message>
+ <location filename="../src/sql/drivers/ibase/qsql_ibase.cpp" line="+1435"/>
+ <source>Error opening database</source>
+ <translation>Der opstod fejl ved åbning af database</translation>
+ </message>
+ <message>
+ <location line="+54"/>
+ <source>Could not start transaction</source>
+ <translation>Kunne ikke påbegynde transaktionen</translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>Unable to commit transaction</source>
+ <translation>Kunne ikke gennemføre transaktionen</translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>Unable to rollback transaction</source>
+ <translation>Kunne ikke tilbagetrække transaktionen</translation>
+ </message>
+</context>
+<context>
+ <name>QIBaseResult</name>
+ <message>
+ <location line="-1097"/>
+ <source>Unable to create BLOB</source>
+ <translation>Kunne ikke oprette BLOB</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Unable to write BLOB</source>
+ <translation>Kunne ikke skrive BLOB</translation>
+ </message>
+ <message>
+ <location line="+14"/>
+ <source>Unable to open BLOB</source>
+ <translation>Kunne ikke åbne BLOB</translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>Unable to read BLOB</source>
+ <translation>Kunne ikke læse BLOB</translation>
+ </message>
+ <message>
+ <location line="+125"/>
+ <location line="+189"/>
+ <source>Could not find array</source>
+ <translation>Kunne ikke finde array</translation>
+ </message>
+ <message>
+ <location line="-157"/>
+ <source>Could not get array data</source>
+ <translation>Kunne ikke hente arraydata</translation>
+ </message>
+ <message>
+ <location line="+212"/>
+ <source>Could not get query info</source>
+ <translation>Kunne ikke hente forespørgselsinfo</translation>
+ </message>
+ <message>
+ <location line="+20"/>
+ <source>Could not start transaction</source>
+ <translation>Kunne ikke påbegynde transaktionen</translation>
+ </message>
+ <message>
+ <location line="+19"/>
+ <source>Unable to commit transaction</source>
+ <translation>Kunne ikke gennemføre transaktionen</translation>
+ </message>
+ <message>
+ <location line="+33"/>
+ <source>Could not allocate statement</source>
+ <translation>Kunne ikke allokere statement</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Could not prepare statement</source>
+ <translation>Kunne ikke forberede udsagn</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <location line="+7"/>
+ <source>Could not describe input statement</source>
+ <translation>Kunne ikke beskrive input-statement</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>Could not describe statement</source>
+ <translation>Kunne ikke beskrive statement</translation>
+ </message>
+ <message>
+ <location line="+115"/>
+ <source>Unable to close statement</source>
+ <translation>Kunne ikke lukke udsagn</translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>Unable to execute query</source>
+ <translation>Kunne ikke udføre forespørgsel</translation>
+ </message>
+ <message>
+ <location line="+46"/>
+ <source>Could not fetch next item</source>
+ <translation>Kunne ikke hente næste element</translation>
+ </message>
+ <message>
+ <location line="+160"/>
+ <source>Could not get statement info</source>
+ <translation>Kunne ikke hente udsagnsinformation</translation>
+ </message>
+</context>
+<context>
+ <name>QIODevice</name>
+ <message>
+ <location filename="../src/corelib/global/qglobal.cpp" line="+1869"/>
+ <source>Permission denied</source>
+ <translation>Tilladelse nægtet</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Too many open files</source>
+ <translation>Der er for mange åbne filer</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>No such file or directory</source>
+ <translation>Fil eller katalog findes ikke</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>No space left on device</source>
+ <translation>Ingen plads tilbage på enheden</translation>
+ </message>
+ <message>
+ <location filename="../src/corelib/io/qiodevice.cpp" line="+1536"/>
+ <source>Unknown error</source>
+ <translation>Ukendt fejl</translation>
+ </message>
+</context>
+<context>
+ <name>QInputContext</name>
+ <message>
+ <location filename="../src/gui/inputmethod/qinputcontextfactory.cpp" line="+242"/>
+ <source>XIM</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+23"/>
+ <source>XIM input method</source>
+ <translation>XIM input-metode</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Windows input method</source>
+ <translation>Windows input-metode</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Mac OS X input method</source>
+ <translation>Mac OS X input-metode</translation>
+ </message>
+</context>
+<context>
+ <name>QInputDialog</name>
+ <message>
+ <location filename="../src/gui/dialogs/qinputdialog.cpp" line="+223"/>
+ <source>Enter a value:</source>
+ <translation>Indtast en værdi:</translation>
+ </message>
+</context>
+<context>
+ <name>QLibrary</name>
+ <message>
+ <location filename="../src/corelib/plugin/qlibrary.cpp" line="+378"/>
+ <source>Could not mmap &apos;%1&apos;: %2</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+22"/>
+ <source>Plugin verification data mismatch in &apos;%1&apos;</source>
+ <translation>Plugin-verifikationsdata er sat forkert sammen i &apos;%1&apos;</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Could not unmap &apos;%1&apos;: %2</source>
+ <translation>Der var ikke muligt at lave unmap på &apos;%1&apos;: %2 </translation>
+ </message>
+ <message>
+ <location line="+302"/>
+ <source>The plugin &apos;%1&apos; uses incompatible Qt library. (%2.%3.%4) [%5]</source>
+ <translation>Plugin &apos;%1&apos; bruger inkompatibelt Qt-bibliotek. (%2.%3.%4) [%5]</translation>
+ </message>
+ <message>
+ <location line="+20"/>
+ <source>The plugin &apos;%1&apos; uses incompatible Qt library. Expected build key &quot;%2&quot;, got &quot;%3&quot;</source>
+ <translation>Plugin &apos;%1&apos; bruger inkompatibelt Qt-bibliotek. Forventet build key &quot;%2&quot;, hentede &quot;%3&quot;&apos;</translation>
+ </message>
+ <message>
+ <location line="+340"/>
+ <source>Unknown error</source>
+ <translation>Ukendt fejl&apos;</translation>
+ </message>
+ <message>
+ <location line="-377"/>
+ <location filename="../src/corelib/plugin/qpluginloader.cpp" line="+280"/>
+ <source>The shared library was not found.</source>
+ <translation>DSO blev ikke fundet.</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>The file &apos;%1&apos; is not a valid Qt plugin.</source>
+ <translation>Filen &apos;%1&apos; er ikke et gyldigt Qt-plugin.</translation>
+ </message>
+ <message>
+ <location line="+43"/>
+ <source>The plugin &apos;%1&apos; uses incompatible Qt library. (Cannot mix debug and release libraries.)</source>
+ <translation>Plugin &apos;%1&apos; bruger inkompatibelt Qt-bibliotek. (Ikke muligt at mikse debug og release-biblioteker)</translation>
+ </message>
+ <message>
+ <location filename="../src/corelib/plugin/qlibrary_unix.cpp" line="+209"/>
+ <location filename="../src/corelib/plugin/qlibrary_win.cpp" line="+99"/>
+ <source>Cannot load library %1: %2</source>
+ <translation>Kan ikke indlæse bibliotek %1: %2</translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <location filename="../src/corelib/plugin/qlibrary_win.cpp" line="+26"/>
+ <source>Cannot unload library %1: %2</source>
+ <translation>Kan ikke afregistrere bibliotek %1: %2</translation>
+ </message>
+ <message>
+ <location line="+31"/>
+ <location filename="../src/corelib/plugin/qlibrary_win.cpp" line="+15"/>
+ <source>Cannot resolve symbol &quot;%1&quot; in %2: %3</source>
+ <translation>Kan ikke løse symbol &quot;%1&quot; i %2: %3</translation>
+ </message>
+</context>
+<context>
+ <name>QLineEdit</name>
+ <message>
+ <location filename="../src/gui/widgets/qlineedit.cpp" line="+2680"/>
+ <source>&amp;Undo</source>
+ <translation>&amp;Fortryd</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>&amp;Redo</source>
+ <translation>&amp;Gendan</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Cu&amp;t</source>
+ <translation>K&amp;lip</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>&amp;Copy</source>
+ <translation>&amp;Kopiér</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>&amp;Paste</source>
+ <translation>&amp;Sæt ind</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Delete</source>
+ <translation>Slet</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Select All</source>
+ <translation>Markér alt</translation>
+ </message>
+</context>
+<context>
+ <name>QLocalServer</name>
+ <message>
+ <location filename="../src/network/socket/qlocalserver.cpp" line="+226"/>
+ <location filename="../src/network/socket/qlocalserver_unix.cpp" line="+233"/>
+ <source>%1: Name error</source>
+ <translation>%1: Navnefejl</translation>
+ </message>
+ <message>
+ <location filename="../src/network/socket/qlocalserver_unix.cpp" line="-8"/>
+ <source>%1: Permission denied</source>
+ <translation>%1: Tilladelse nægtet</translation>
+ </message>
+ <message>
+ <location line="+12"/>
+ <source>%1: Address in use</source>
+ <translation>%1: Adresse i brug</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <location filename="../src/network/socket/qlocalserver_win.cpp" line="+158"/>
+ <source>%1: Unknown error %2</source>
+ <translation>%1: Ukendt fejl %2</translation>
+ </message>
+</context>
+<context>
+ <name>QLocalSocket</name>
+ <message>
+ <location filename="../src/network/socket/qlocalsocket_tcp.cpp" line="+132"/>
+ <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+134"/>
+ <source>%1: Connection refused</source>
+ <translation>%1: Forbindelse afvist</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
+ <source>%1: Remote closed</source>
+ <translation>%1: Den anden ende lukkede</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
+ <location filename="../src/network/socket/qlocalsocket_win.cpp" line="+80"/>
+ <location line="+43"/>
+ <source>%1: Invalid name</source>
+ <translation>%1: Ugyldigt navn</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
+ <source>%1: Socket access error</source>
+ <translation>%1: Fejl i socket-adgang</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
+ <source>%1: Socket resource error</source>
+ <translation>%1: Fejl i socket-ressource</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
+ <source>%1: Socket operation timed out</source>
+ <translation>%1: Socket-handling timed out</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
+ <source>%1: Datagram too large</source>
+ <translation>%1: Datagram er for stort</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
+ <location filename="../src/network/socket/qlocalsocket_win.cpp" line="-48"/>
+ <source>%1: Connection error</source>
+ <translation>%1: Forbindelsesfejl</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
+ <source>%1: The socket operation is not supported</source>
+ <translation>%1: Socket-handlingen understøttes ikke</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>%1: Unknown error</source>
+ <translation>%1: Ukendt fejl</translation>
+ </message>
+ <message>
+ <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+4"/>
+ <location filename="../src/network/socket/qlocalsocket_win.cpp" line="+10"/>
+ <source>%1: Unknown error %2</source>
+ <translation>%1: Ukendt fejl %2</translation>
+ </message>
+</context>
+<context>
+ <name>QMYSQLDriver</name>
+ <message>
+ <location filename="../src/sql/drivers/mysql/qsql_mysql.cpp" line="+1252"/>
+ <source>Unable to open database &apos;</source>
+ <translation>Kunne ikke åbne databasen &apos;</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Unable to connect</source>
+ <translation>Kunne ikke forbinde</translation>
+ </message>
+ <message>
+ <location line="+127"/>
+ <source>Unable to begin transaction</source>
+ <translation>Kunne ikke påbegynde transaktionen</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Unable to commit transaction</source>
+ <translation>Kunne ikke gennemføre transaktionen</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Unable to rollback transaction</source>
+ <translation>Kunne ikke tilbagetrække transaktionen</translation>
+ </message>
+</context>
+<context>
+ <name>QMYSQLResult</name>
+ <message>
+ <location line="-935"/>
+ <source>Unable to fetch data</source>
+ <translation>Kunne ikke hente data</translation>
+ </message>
+ <message>
+ <location line="+183"/>
+ <source>Unable to execute query</source>
+ <translation>Kunne ikke udføre forespørgsel</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Unable to store result</source>
+ <translation>Kunne ikke gemme resultatet</translation>
+ </message>
+ <message>
+ <location line="+194"/>
+ <location line="+8"/>
+ <source>Unable to prepare statement</source>
+ <translation>Kunne ikke forberede udsagn</translation>
+ </message>
+ <message>
+ <location line="+36"/>
+ <source>Unable to reset statement</source>
+ <translation>Kunne ikke nulstille udsagn</translation>
+ </message>
+ <message>
+ <location line="+87"/>
+ <source>Unable to bind value</source>
+ <translation>Kunne ikke tildele værdi</translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>Unable to execute statement</source>
+ <translation>Kunne ikke udføre udsagn</translation>
+ </message>
+ <message>
+ <location line="+14"/>
+ <location line="+21"/>
+ <source>Unable to bind outvalues</source>
+ <translation>Kunne ikke binde udværdier</translation>
+ </message>
+ <message>
+ <location line="-12"/>
+ <source>Unable to store statement results</source>
+ <translation>Kunne ikke gemme udsagnsresultater</translation>
+ </message>
+ <message>
+ <location line="-257"/>
+ <source>Unable to execute next query</source>
+ <translation>Kunne ikke udføre næste forespørgsel</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>Unable to store next result</source>
+ <translation>Kunne ikke gemme næste resultat</translation>
+ </message>
+</context>
+<context>
+ <name>QMdiArea</name>
+ <message>
+ <location filename="../src/gui/widgets/qmdiarea.cpp" line="+290"/>
+ <source>(Untitled)</source>
+ <translation>(Uden titel)</translation>
+ </message>
+</context>
+<context>
+ <name>QMdiSubWindow</name>
+ <message>
+ <location filename="../src/gui/widgets/qmdisubwindow.cpp" line="+280"/>
+ <source>%1 - [%2]</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+72"/>
+ <source>Close</source>
+ <translation>Luk</translation>
+ </message>
+ <message>
+ <location line="-18"/>
+ <source>Minimize</source>
+ <translation>Minimér</translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>Restore Down</source>
+ <translation>Gendan Ned</translation>
+ </message>
+ <message>
+ <location line="+707"/>
+ <source>&amp;Restore</source>
+ <translation>&amp;Gendan</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>&amp;Move</source>
+ <translation>&amp;Flyt</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Size</source>
+ <translation>&amp;Størrelse</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Mi&amp;nimize</source>
+ <translation>Mi&amp;nimér</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Ma&amp;ximize</source>
+ <translation>Ma&amp;ksimér</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Stay on &amp;Top</source>
+ <translation>Bliv &amp;oppe</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>&amp;Close</source>
+ <translation>&amp;Luk</translation>
+ </message>
+ <message>
+ <location line="-787"/>
+ <source>- [%1]</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+58"/>
+ <source>Maximize</source>
+ <translation>Maksimér</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Unshade</source>
+ <translation>Fjern skygge</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Shade</source>
+ <translation>Skygge</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Restore</source>
+ <translation>Gendan</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Help</source>
+ <translation>Hjælp</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Menu</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>QMenu</name>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/qaccessiblemenu.cpp" line="+157"/>
+ <location line="+225"/>
+ <source>Close</source>
+ <translation>Luk</translation>
+ </message>
+ <message>
+ <location line="-224"/>
+ <location line="+225"/>
+ <source>Open</source>
+ <translation>Åbn</translation>
+ </message>
+ <message>
+ <location line="-223"/>
+ <location line="+225"/>
+ <location line="+51"/>
+ <source>Execute</source>
+ <translation>Udfør</translation>
+ </message>
+</context>
+<context>
+ <name>QMessageBox</name>
+ <message>
+ <location filename="../src/gui/dialogs/qmessagebox.cpp" line="-1111"/>
+ <source>Help</source>
+ <translation>Hjælp</translation>
+ </message>
+ <message>
+ <location line="-853"/>
+ <location line="+852"/>
+ <location filename="../src/gui/dialogs/qmessagebox.h" line="-52"/>
+ <location line="+8"/>
+ <source>OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+475"/>
+ <source>&lt;h3&gt;About Qt&lt;/h3&gt;&lt;p&gt;This program uses Qt version %1.&lt;/p&gt;&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://www.qtsoftware.com/products/licensing&quot;&gt;www.qtsoftware.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://www.qtsoftware.com/qt/&quot;&gt;www.qtsoftware.com/qt&lt;/a&gt; for more information.&lt;/p&gt;</source>
+ <translation>&lt;h3&gt;Om Qt&lt;/h3&gt;&lt;p&gt;Dette program anvender Qt version %1.&lt;/p&gt;&lt;p&gt;Qt er et C++ toolkit til cross-platform applikationsudvikling.&lt;/p&gt;&lt;p&gt;Qt tilbyder single-source portabilitet til MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, og alle større kommercielle Unix-varianter. Qt er også tilgængeligt til indlejrede systemer som Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;Qt er tilgængeligt under tre forskellige licenser skabt med henblik på at imødekomme forskellige brugeres behov.&lt;/p&gt;&lt;p&gt;Qt licenseret under vores kommercielle licensaftale er passende for udvikling af proprietær/kommerciel software, hvor du ikke ønsker at dele sourcekode med tredie part, eller på anden vis ikke kan tiltræde vilkårerne i GNU LGPL version 2.1 eller GNU GPL version 3.0&lt;/p&gt;&lt;p&gt;Qt licenseret under GLU General Public License version 3.0 er passende for udvikling af Qt applikationer, hvor du ønsker at bruge softwaren i kombination med software under vilkårerne i GNU GPL version 3.0, eller hvor du ellers er villig til at overholde vilkårerne i GNU GPL version 3.0&lt;/p&gt;&lt;p&gt;See venligst &lt;a href=&quot;http://www.qtsoftware.com/products/licensing&quot;&gt;www.qtsoftware.com/products/licensing&lt;/a&gt; for et overblik over Qt licensforhold.&lt;/p&gt;&lt;p&gt;Qt er et Nokia produkt. Se &lt;a href=&quot;http://qtsoftware.com/qt/&quot;&gt;qtsoftware.com/qt/&lt;/a&gt; for yderligere information.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <location line="+34"/>
+ <source>About Qt</source>
+ <translation>Om Qt</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;This program uses Qt version %1.&lt;/p&gt;</source>
+ <translation type="obsolete">&lt;p&gt;Dette program bruger Qt-version %1.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <location line="-1608"/>
+ <source>Show Details...</source>
+ <translation>Vis detaljer...</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Details...</source>
+ <translation>Skjul detaljer...</translation>
+ </message>
+ <message>
+ <source>&lt;h3&gt;About Qt&lt;/h3&gt;%1&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qtsoftware.com/qt/&quot;&gt;qtsoftware.com/qt/&lt;/a&gt; for more information.&lt;/p&gt;</source>
+ <translation type="obsolete">&lt;h3&gt;Om Qt&lt;/h3&gt;%1&lt;p&gt;Qt er et C++ toolkit til cross-platform applikationsudvikling.&lt;/p&gt;&lt;p&gt;Qt tilbyder single-source portabilitet til MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, og alle større kommercielle Unix-varianter. Qt er også tilgængeligt til indlejrede systemer som Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt er et Nokia produkt. Se &lt;a href=&quot;http://qtsoftware.com/qt/&quot;&gt;qtsoftware.com/qt/&lt;/a&gt; for yderligere information.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;This program uses Qt Open Source Edition version %1.&lt;/p&gt;&lt;p&gt;Qt Open Source Edition is intended for the development of Open Source applications. You need a commercial Qt license for development of proprietary (closed source) applications.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qtsoftware.com/company/model/&quot;&gt;qtsoftware.com/company/model/&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;</source>
+ <translation type="obsolete">&lt;p&gt;Dette program bruger Qt Open Source Edition version %1.&lt;/p&gt;&lt;p&gt;Qt Open Source Edition er beregnet til udvikling af Open Source applikationer. En kommerciel Qt licens er nødvendig til udvikling af proprietære (lukket sourcekode) applikationer.&lt;/p&gt;&lt;p&gt;Se venligst &lt;a href=&quot;http://qtsoftware.com/company/model/&quot;&gt;qtsoftware.com/company/model/&lt;/a&gt; for et overblik over Qt licensforhold.&lt;/p&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>QMultiInputContext</name>
+ <message>
+ <location filename="../src/plugins/inputmethods/imsw-multi/qmultiinputcontext.cpp" line="+88"/>
+ <source>Select IM</source>
+ <translation>Markér IM</translation>
+ </message>
+</context>
+<context>
+ <name>QMultiInputContextPlugin</name>
+ <message>
+ <location filename="../src/plugins/inputmethods/imsw-multi/qmultiinputcontextplugin.cpp" line="+95"/>
+ <source>Multiple input method switcher</source>
+ <translation>Multiple input metode-switcher</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Multiple input method switcher that uses the context menu of the text widgets</source>
+ <translation>Multiple input metode-switcher, der benytter tekstkontrollernes kontekstmenuer</translation>
+ </message>
+</context>
+<context>
+ <name>QNativeSocketEngine</name>
+ <message>
+ <location filename="../src/network/socket/qnativesocketengine.cpp" line="+206"/>
+ <source>The remote host closed the connection</source>
+ <translation>Fjern-hosten lukkede forbindelsen</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Network operation timed out</source>
+ <translation>Netværksoperationen timed out</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Out of resources</source>
+ <translation>Ikke flere ressourcer</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Unsupported socket operation</source>
+ <translation>Socket-operation ikke understøttet</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Protocol type not supported</source>
+ <translation>Protokoltypen understøttes ikke</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Invalid socket descriptor</source>
+ <translation>Ugyldig socket-deskriptor</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Network unreachable</source>
+ <translation>Netværket er ikke tilgængeligt</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Permission denied</source>
+ <translation>Tilladelse nægtet</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Connection timed out</source>
+ <translation>Forbindelsen timed out</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Connection refused</source>
+ <translation>Forbindelse afvist</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>The bound address is already in use</source>
+ <translation>Den bundne adresse er allerede i brug</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>The address is not available</source>
+ <translation>Adressen er ikke tilgængelig</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>The address is protected</source>
+ <translation>Adressen er beskyttet</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Unable to send a message</source>
+ <translation>Kunne ikke sende en besked</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Unable to receive a message</source>
+ <translation>Kunne ikke modtage en besked</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Unable to write</source>
+ <translation>Kunne ikke skrive</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Network error</source>
+ <translation>Netværksfejl</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Another socket is already listening on the same port</source>
+ <translation>En anden socket lytter allerede på samme port</translation>
+ </message>
+ <message>
+ <location line="-66"/>
+ <source>Unable to initialize non-blocking socket</source>
+ <translation>Kunne ikke initialisere non-blocking socket</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Unable to initialize broadcast socket</source>
+ <translation>Kunne ikke initialisere broadcast-socket</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Attempt to use IPv6 socket on a platform with no IPv6 support</source>
+ <translation>Forsøg på at bruge IPv6-socket på en platform uden IPv6-support</translation>
+ </message>
+ <message>
+ <location line="+21"/>
+ <source>Host unreachable</source>
+ <translation>Vært er ikke tilgængelig</translation>
+ </message>
+ <message>
+ <location line="+24"/>
+ <source>Datagram was too large to send</source>
+ <translation>Datagrammet var for stort til at blive sendt</translation>
+ </message>
+ <message>
+ <location line="+18"/>
+ <source>Operation on non-socket</source>
+ <translation>Handling på non-socket</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Unknown error</source>
+ <translation>Ukendt fejl</translation>
+ </message>
+ <message>
+ <location line="-3"/>
+ <source>The proxy type is invalid for this operation</source>
+ <translation>Proxytypen er ugyldig til denne handling</translation>
+ </message>
+</context>
+<context>
+ <name>QNetworkAccessCacheBackend</name>
+ <message>
+ <location filename="../src/network/access/qnetworkaccesscachebackend.cpp" line="+65"/>
+ <source>Error opening %1</source>
+ <translation>Der opstod fejl i at åbne %1</translation>
+ </message>
+</context>
+<context>
+ <name>QNetworkAccessFileBackend</name>
+ <message>
+ <location filename="../src/network/access/qnetworkaccessfilebackend.cpp" line="+99"/>
+ <source>Request for opening non-local file %1</source>
+ <translation>Anmodning om at åbne ikke-lokal fil %1</translation>
+ </message>
+ <message>
+ <location line="+42"/>
+ <source>Error opening %1: %2</source>
+ <translation>Der opstod fejl i at åbne %1: %2</translation>
+ </message>
+ <message>
+ <location line="+56"/>
+ <source>Write error writing to %1: %2</source>
+ <translation>Skrivefejl mens der blev skrevet til %1: %2</translation>
+ </message>
+ <message>
+ <location line="+33"/>
+ <source>Cannot open %1: Path is a directory</source>
+ <translation>Kan ikke åbne %1: Stien er et katalog</translation>
+ </message>
+ <message>
+ <location line="+21"/>
+ <source>Read error reading from %1: %2</source>
+ <translation>Læsefejl mens der blev læst fra %1: %2</translation>
+ </message>
+</context>
+<context>
+ <name>QNetworkAccessFtpBackend</name>
+ <message>
+ <location filename="../src/network/access/qnetworkaccessftpbackend.cpp" line="+165"/>
+ <source>No suitable proxy found</source>
+ <translation>Ingen passende proxy blev fundet</translation>
+ </message>
+ <message>
+ <location line="+14"/>
+ <source>Cannot open %1: is a directory</source>
+ <translation>Kan ikke åbne %1: Er et katalog</translation>
+ </message>
+ <message>
+ <location line="+130"/>
+ <source>Logging in to %1 failed: authentication required</source>
+ <translation>Der opstod fejl i at logge på %1: Autentificering kræves</translation>
+ </message>
+ <message>
+ <location line="+39"/>
+ <source>Error while downloading %1: %2</source>
+ <translation>Der opstod fejl i at downloade %1: %2</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Error while uploading %1: %2</source>
+ <translation>Der opstod fejl i at uploade %1: %2</translation>
+ </message>
+</context>
+<context>
+ <name>QNetworkAccessHttpBackend</name>
+ <message>
+ <location filename="../src/network/access/qnetworkaccesshttpbackend.cpp" line="+597"/>
+ <source>No suitable proxy found</source>
+ <translation>Ingen passende proxy blev fundet</translation>
+ </message>
+</context>
+<context>
+ <name>QNetworkReply</name>
+ <message>
+ <location line="+128"/>
+ <source>Error downloading %1 - server replied: %2</source>
+ <translation>Der opstod fejl i at downloade %1 - serveren svarede: %2</translation>
+ </message>
+ <message>
+ <location filename="../src/network/access/qnetworkreplyimpl.cpp" line="+68"/>
+ <source>Protocol &quot;%1&quot; is unknown</source>
+ <translation>Protokollen &quot;%1&quot; er ukendt</translation>
+ </message>
+</context>
+<context>
+ <name>QNetworkReplyImpl</name>
+ <message>
+ <location line="+432"/>
+ <location line="+22"/>
+ <source>Operation canceled</source>
+ <translation>Handling blev annulleret</translation>
+ </message>
+</context>
+<context>
+ <name>QOCIDriver</name>
+ <message>
+ <location filename="../src/sql/drivers/oci/qsql_oci.cpp" line="+2069"/>
+ <source>Unable to logon</source>
+ <translation>Kunne ikke logge på</translation>
+ </message>
+ <message>
+ <location line="-144"/>
+ <source>Unable to initialize</source>
+ <comment>QOCIDriver</comment>
+ <translation>Kunne ikke initialisere</translation>
+ </message>
+ <message>
+ <location line="+215"/>
+ <source>Unable to begin transaction</source>
+ <translation>Kunne ikke påbegynde transaktionen</translation>
+ </message>
+ <message>
+ <location line="+19"/>
+ <source>Unable to commit transaction</source>
+ <translation>Kunne ikke gennemføre transaktionen</translation>
+ </message>
+ <message>
+ <location line="+19"/>
+ <source>Unable to rollback transaction</source>
+ <translation>Kunne ikke tilbagetrække transaktionen</translation>
+ </message>
+</context>
+<context>
+ <name>QOCIResult</name>
+ <message>
+ <location line="-963"/>
+ <location line="+161"/>
+ <location line="+15"/>
+ <source>Unable to bind column for batch execute</source>
+ <translation>Kunne ikke tildele kolonne til batch-udførsel</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Unable to execute batch statement</source>
+ <translation>Kunne ikke udføre batch-udsagn</translation>
+ </message>
+ <message>
+ <location line="+302"/>
+ <source>Unable to goto next</source>
+ <translation>Kunne ikke gå til den næste</translation>
+ </message>
+ <message>
+ <location line="+59"/>
+ <source>Unable to alloc statement</source>
+ <translation>Kunne ikke allokere udsagn</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Unable to prepare statement</source>
+ <translation>Kunne ikke forberede udsagn</translation>
+ </message>
+ <message>
+ <location line="+36"/>
+ <source>Unable to bind value</source>
+ <translation>Kunne ikke tildele værdi</translation>
+ </message>
+ <message>
+ <source>Unable to execute select statement</source>
+ <translation type="obsolete">Kunne ikke udføre det valgte udsagn</translation>
+ </message>
+ <message>
+ <location line="+19"/>
+ <source>Unable to execute statement</source>
+ <translation>Kunne ikke udføre udsagn</translation>
+ </message>
+</context>
+<context>
+ <name>QODBCDriver</name>
+ <message>
+ <location filename="../src/sql/drivers/odbc/qsql_odbc.cpp" line="+1781"/>
+ <source>Unable to connect</source>
+ <translation>Kunne ikke forbinde</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Unable to connect - Driver doesn&apos;t support all needed functionality</source>
+ <translation>Kunne ikke forbinde. Driveren understøtter ikke alle de nødvendige funktionaliteter</translation>
+ </message>
+ <message>
+ <location line="+242"/>
+ <source>Unable to disable autocommit</source>
+ <translation>Kunne ikke slå auto-udfør fra</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Unable to commit transaction</source>
+ <translation>Kunne ikke gennemføre transaktionen</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Unable to rollback transaction</source>
+ <translation>Kunne ikke tilbagetrække transaktionen</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Unable to enable autocommit</source>
+ <translation>Kunne ikke slå auto-udfør til</translation>
+ </message>
+</context>
+<context>
+ <name>QODBCResult</name>
+ <message>
+ <location line="-1218"/>
+ <location line="+349"/>
+ <source>QODBCResult::reset: Unable to set &apos;SQL_CURSOR_STATIC&apos; as statement attribute. Please check your ODBC driver configuration</source>
+ <translation>QODBCResult::reset: Kunne ikke indstille &apos;SQL_CURSOR_STATIC&apos; til udsagnsattribut. Kontrollér ODBC-driver-konfigurationen</translation>
+ </message>
+ <message>
+ <location line="-332"/>
+ <location line="+626"/>
+ <source>Unable to execute statement</source>
+ <translation>Kunne ikke udføre udsagn</translation>
+ </message>
+ <message>
+ <location line="-555"/>
+ <source>Unable to fetch next</source>
+ <translation>Kunne ikke hente den næste</translation>
+ </message>
+ <message>
+ <location line="+279"/>
+ <source>Unable to prepare statement</source>
+ <translation>Kunne ikke forberede udsagn</translation>
+ </message>
+ <message>
+ <location line="+268"/>
+ <source>Unable to bind variable</source>
+ <translation>Kunne ikke tildele variabel</translation>
+ </message>
+ <message>
+ <location filename="../src/sql/drivers/db2/qsql_db2.cpp" line="+194"/>
+ <location filename="../src/sql/drivers/odbc/qsql_odbc.cpp" line="-475"/>
+ <location line="+578"/>
+ <source>Unable to fetch last</source>
+ <translation>Kunne ikke hente den sidste</translation>
+ </message>
+ <message>
+ <location filename="../src/sql/drivers/odbc/qsql_odbc.cpp" line="-672"/>
+ <source>Unable to fetch</source>
+ <translation>Kunne ikke hente</translation>
+ </message>
+ <message>
+ <location line="+44"/>
+ <source>Unable to fetch first</source>
+ <translation>Kunne ikke hente den første</translation>
+ </message>
+ <message>
+ <location line="+19"/>
+ <source>Unable to fetch previous</source>
+ <translation>Kunne ikke hente den forrige</translation>
+ </message>
+</context>
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="../src/gui/util/qdesktopservices_mac.cpp" line="+165"/>
+ <source>Home</source>
+ <translation>Hjem</translation>
+ </message>
+ <message>
+ <location filename="../src/network/access/qnetworkaccessdatabackend.cpp" line="+74"/>
+ <source>Operation not supported on %1</source>
+ <translation>Handling blev ikke understøttet på %1</translation>
+ </message>
+ <message>
+ <location line="+53"/>
+ <source>Invalid URI: %1</source>
+ <translation>Ugyldig URI: %1</translation>
+ </message>
+ <message>
+ <location filename="../src/network/access/qnetworkaccessdebugpipebackend.cpp" line="+175"/>
+ <source>Write error writing to %1: %2</source>
+ <translation>Skrivefejl mens der blev skrevet til %1: %2</translation>
+ </message>
+ <message>
+ <location line="+57"/>
+ <source>Read error reading from %1: %2</source>
+ <translation>Læsefejl mens der blev læst fra %1: %2</translation>
+ </message>
+ <message>
+ <location line="+31"/>
+ <source>Socket error on %1: %2</source>
+ <translation>Socket-fejl på %1: %2</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Remote host closed the connection prematurely on %1</source>
+ <translation>Fjern-host lukkede forbindelsen for tidligt på %1</translation>
+ </message>
+ <message>
+ <location line="+53"/>
+ <source>Protocol error: packet of size 0 received</source>
+ <translation>Protokolfejl: Pakke på størrelsen 0 modtaget</translation>
+ </message>
+ <message>
+ <location filename="../src/network/kernel/qhostinfo.cpp" line="+177"/>
+ <location line="+57"/>
+ <source>No host name given</source>
+ <translation>Hostnavn mangler</translation>
+ </message>
+</context>
+<context>
+ <name>QPPDOptionsModel</name>
+ <message>
+ <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="+1197"/>
+ <source>Name</source>
+ <translation>Navn</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Value</source>
+ <translation>Værdi</translation>
+ </message>
+</context>
+<context>
+ <name>QPSQLDriver</name>
+ <message>
+ <location filename="../src/sql/drivers/psql/qsql_psql.cpp" line="+763"/>
+ <source>Unable to connect</source>
+ <translation>Kunne ikke skabe forbindelse</translation>
+ </message>
+ <message>
+ <location line="+49"/>
+ <source>Could not begin transaction</source>
+ <translation>Kunne ikke påbegynde transaktion</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Could not commit transaction</source>
+ <translation>Kunne ikke gennemføre transaktion</translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>Could not rollback transaction</source>
+ <translation>Kunne ikke tilbagetrække transaktion</translation>
+ </message>
+ <message>
+ <location line="+358"/>
+ <source>Unable to subscribe</source>
+ <translation>Kunne ikke tilmelde</translation>
+ </message>
+ <message>
+ <location line="+32"/>
+ <source>Unable to unsubscribe</source>
+ <translation>Kunne ikke afmelde</translation>
+ </message>
+</context>
+<context>
+ <name>QPSQLResult</name>
+ <message>
+ <location line="-1058"/>
+ <source>Unable to create query</source>
+ <translation>Kunne ikke oprette forespørgsel</translation>
+ </message>
+ <message>
+ <location line="+374"/>
+ <source>Unable to prepare statement</source>
+ <translation>Kunne ikke forberede udsagn</translation>
+ </message>
+</context>
+<context>
+ <name>QPageSetupWidget</name>
+ <message>
+ <location filename="../src/gui/dialogs/qpagesetupdialog_unix.cpp" line="+304"/>
+ <source>Centimeters (cm)</source>
+ <translation>Centimeter (cm)</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Millimeters (mm)</source>
+ <translation>Millimeter (mm)</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Inches (in)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Points (pt)</source>
+ <translation>Point (pt)</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qpagesetupwidget.ui"/>
+ <source>Form</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location/>
+ <source>Paper</source>
+ <translation>Papir</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Page size:</source>
+ <translation>Sidestørrelse:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Width:</source>
+ <translation>Vidde:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Height:</source>
+ <translation>Højde:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Paper source:</source>
+ <translation>Papirkilde:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Orientation</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location/>
+ <source>Portrait</source>
+ <translation>Portræt</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Landscape</source>
+ <translation>Landskab</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Reverse landscape</source>
+ <translation>Omvendt landskab</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Reverse portrait</source>
+ <translation>Omvendt portræt</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Margins</source>
+ <translation>Margener</translation>
+ </message>
+ <message>
+ <location/>
+ <source>top margin</source>
+ <translation>Margen - øverst</translation>
+ </message>
+ <message>
+ <location/>
+ <source>left margin</source>
+ <translation>Margen - venstre</translation>
+ </message>
+ <message>
+ <location/>
+ <source>right margin</source>
+ <translation>Margen - højre</translation>
+ </message>
+ <message>
+ <location/>
+ <source>bottom margin</source>
+ <translation>Margen - bund</translation>
+ </message>
+</context>
+<context>
+ <name>QPluginLoader</name>
+ <message>
+ <location filename="../src/corelib/plugin/qpluginloader.cpp" line="+24"/>
+ <source>Unknown error</source>
+ <translation>Ukendt fejl</translation>
+ </message>
+ <message>
+ <location line="-68"/>
+ <source>The plugin was not loaded.</source>
+ <translation>Plugin blev ikke indlæst.</translation>
+ </message>
+</context>
+<context>
+ <name>QPrintDialog</name>
+ <message>
+ <location filename="../src/gui/painting/qprinterinfo_unix.cpp" line="+98"/>
+ <source>locally connected</source>
+ <translation>lokalt forbundet</translation>
+ </message>
+ <message>
+ <location line="+23"/>
+ <location line="+225"/>
+ <source>Aliases: %1</source>
+ <translation>Aliasser: %1</translation>
+ </message>
+ <message>
+ <location line="+223"/>
+ <location line="+199"/>
+ <source>unknown</source>
+ <translation>Ukendt</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qprintdialog_qws.cpp" line="+329"/>
+ <source>A0 (841 x 1189 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A1 (594 x 841 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A2 (420 x 594 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A3 (297 x 420 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A4 (210 x 297 mm, 8.26 x 11.7 inches)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A5 (148 x 210 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A6 (105 x 148 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A7 (74 x 105 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A8 (52 x 74 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A9 (37 x 52 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B0 (1000 x 1414 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B1 (707 x 1000 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B2 (500 x 707 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B3 (353 x 500 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B4 (250 x 353 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B5 (176 x 250 mm, 6.93 x 9.84 inches)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B6 (125 x 176 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B7 (88 x 125 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B8 (62 x 88 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B9 (44 x 62 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B10 (31 x 44 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>C5E (163 x 229 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>DLE (110 x 220 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Executive (7.5 x 10 inches, 191 x 254 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Folio (210 x 330 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Ledger (432 x 279 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Legal (8.5 x 14 inches, 216 x 356 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Letter (8.5 x 11 inches, 216 x 279 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Tabloid (279 x 432 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>US Common #10 Envelope (105 x 241 mm)</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qprintdialog_win.cpp" line="+268"/>
+ <source>OK</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qabstractprintdialog.cpp" line="+110"/>
+ <location line="+13"/>
+ <location filename="../src/gui/dialogs/qprintdialog_win.cpp" line="-2"/>
+ <source>Print</source>
+ <translation>Udskriv</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="-357"/>
+ <source>Print To File ...</source>
+ <translation>Udskriv til fil...</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qprintdialog_qws.cpp" line="+19"/>
+ <source>Print range</source>
+ <translation>Udskriftsområde</translation>
+ </message>
+ <message>
+ <location line="-2"/>
+ <source>Print all</source>
+ <translation>Udskriv alle</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="+80"/>
+ <source>File %1 is not writable.
+Please choose a different file name.</source>
+ <translation>Filen %1 kan ikke skrives.
+Vælg et andet filnavn.</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>%1 already exists.
+Do you want to overwrite it?</source>
+ <translation>%1 findes allerede.
+Ønsker du at overskrive?</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qprintdialog_qws.cpp" line="-227"/>
+ <source>File exists</source>
+ <translation>Fil findes</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&lt;qt&gt;Do you want to overwrite it?&lt;/qt&gt;</source>
+ <translation>&lt;qt&gt;Ønsker du at overskrive?&lt;/qt&gt;</translation>
+ </message>
+ <message>
+ <location line="+227"/>
+ <source>Print selection</source>
+ <translation>Udskriv markerede</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="-8"/>
+ <source>%1 is a directory.
+Please choose a different file name.</source>
+ <translation>%1 er et katalog.
+Vælg et andet filnavn.</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qpagesetupdialog_unix.cpp" line="-232"/>
+ <source>A0</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A1</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A2</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A3</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A4</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A5</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A6</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A7</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A8</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A9</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B0</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B1</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B2</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B3</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B4</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B5</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B6</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B7</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B8</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B9</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>B10</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>C5E</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>DLE</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Executive</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Folio</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Ledger</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Legal</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Letter</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Tabloid</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>US Common #10 Envelope</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Custom</source>
+ <translation>Brugerdefineret</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="-524"/>
+ <location line="+68"/>
+ <source>&amp;Options &gt;&gt;</source>
+ <translation>&amp;Indstillinger&gt;&gt;</translation>
+ </message>
+ <message>
+ <location line="-63"/>
+ <source>&amp;Print</source>
+ <translation>&amp;Udskriv</translation>
+ </message>
+ <message>
+ <location line="+67"/>
+ <source>&amp;Options &lt;&lt;</source>
+ <translation>&amp;Indstillinger&lt;&lt;</translation>
+ </message>
+ <message>
+ <location line="+253"/>
+ <source>Print to File (PDF)</source>
+ <translation>Udskriv til fil (PDF)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Print to File (Postscript)</source>
+ <translation>Udskriv til fil (Postscript)</translation>
+ </message>
+ <message>
+ <location line="+47"/>
+ <source>Local file</source>
+ <translation>Lokal fil</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Write %1 file</source>
+ <translation>Skriv %1 fil</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qprintdialog_win.cpp" line="+1"/>
+ <source>The &apos;From&apos; value cannot be greater than the &apos;To&apos; value.</source>
+ <translation>&apos;Fra&apos;-værdien kan ikke være større end &apos;til&apos;-værdien.</translation>
+ </message>
+</context>
+<context>
+ <name>QPrintPreviewDialog</name>
+ <message>
+ <location filename="../src/gui/dialogs/qabstractpagesetupdialog.cpp" line="+68"/>
+ <location line="+12"/>
+ <source>Page Setup</source>
+ <translation>Sideopsætning</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qprintpreviewdialog.cpp" line="+252"/>
+ <source>%1%</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+79"/>
+ <source>Print Preview</source>
+ <translation>Vis udskrift</translation>
+ </message>
+ <message>
+ <location line="+29"/>
+ <source>Next page</source>
+ <translation>Næste side</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Previous page</source>
+ <translation>Forrige side</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>First page</source>
+ <translation>Første side</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Last page</source>
+ <translation>Sidste side</translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>Fit width</source>
+ <translation>Tilpas bredde</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Fit page</source>
+ <translation>Tilpas siden</translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>Zoom in</source>
+ <translation>Zoom ind</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Zoom out</source>
+ <translation>Zoom ud</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Portrait</source>
+ <translation>Portræt</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Landscape</source>
+ <translation>Landskab</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>Show single page</source>
+ <translation>Vis enkelt side</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show facing pages</source>
+ <translation>Vis sideopslag</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show overview of all pages</source>
+ <translation>Vis oversigt af alle sider</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Print</source>
+ <translation>Udskriv</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Page setup</source>
+ <translation>Sideopsætning</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Close</source>
+ <translation>Luk</translation>
+ </message>
+ <message>
+ <location line="+151"/>
+ <source>Export to PDF</source>
+ <translation>Eksportér til PDF</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Export to PostScript</source>
+ <translation>Eksportér til PostScript</translation>
+ </message>
+</context>
+<context>
+ <name>QPrintPropertiesWidget</name>
+ <message>
+ <location filename="../src/gui/dialogs/qprintpropertieswidget.ui"/>
+ <source>Form</source>
+ <translation>Form</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Page</source>
+ <translation>Side</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Advanced</source>
+ <translation>Avanceret</translation>
+ </message>
+</context>
+<context>
+ <name>QPrintSettingsOutput</name>
+ <message>
+ <location filename="../src/gui/dialogs/qprintsettingsoutput.ui"/>
+ <source>Form</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location/>
+ <source>Copies</source>
+ <translation>Kopier</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Print range</source>
+ <translation>Udskriv sider</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Print all</source>
+ <translation>Udskriv alle</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Pages from</source>
+ <translation>Sider fra</translation>
+ </message>
+ <message>
+ <location/>
+ <source>to</source>
+ <translation>til</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Selection</source>
+ <translation>Valg</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Output Settings</source>
+ <translation>Udskriftsindstillinger</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Copies:</source>
+ <translation>Kopier:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Collate</source>
+ <translation>Samordne</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Reverse</source>
+ <translation>Omvendt</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Options</source>
+ <translation>Valgmuligheder</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Color Mode</source>
+ <translation>Farvetilstand</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Color</source>
+ <translation>Farve</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Grayscale</source>
+ <translation>Gråskala</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Duplex Printing</source>
+ <translation>Dobbelsidet</translation>
+ </message>
+ <message>
+ <location/>
+ <source>None</source>
+ <translation>Ingen</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Long side</source>
+ <translation>Bog</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Short side</source>
+ <translation>Tavle</translation>
+ </message>
+</context>
+<context>
+ <name>QPrintWidget</name>
+ <message>
+ <location filename="../src/gui/dialogs/qprintwidget.ui"/>
+ <source>Form</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location/>
+ <source>Printer</source>
+ <translation>&apos;</translation>
+ </message>
+ <message>
+ <location/>
+ <source>&amp;Name:</source>
+ <translation>&amp;Navn:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>P&amp;roperties</source>
+ <translation>&amp;Egenskaber</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Location:</source>
+ <translation>Placering:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Preview</source>
+ <translation>Vis udskrift</translation>
+ </message>
+ <message>
+ <location/>
+ <source>Type:</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location/>
+ <source>Output &amp;file:</source>
+ <translation>Udskrifts&amp;fil:</translation>
+ </message>
+ <message>
+ <location/>
+ <source>...</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>QProcess</name>
+ <message>
+ <location filename="../src/corelib/io/qprocess_unix.cpp" line="+475"/>
+ <location filename="../src/corelib/io/qprocess_win.cpp" line="+147"/>
+ <source>Could not open input redirection for reading</source>
+ <translation>Kunne ikke åbne input redirection for læsning</translation>
+ </message>
+ <message>
+ <location line="+12"/>
+ <location filename="../src/corelib/io/qprocess_win.cpp" line="+36"/>
+ <source>Could not open output redirection for writing</source>
+ <translation>Kunne ikke åbne output redirection for skrivning</translation>
+ </message>
+ <message>
+ <location line="+235"/>
+ <source>Resource error (fork failure): %1</source>
+ <translation>Ressource fejl (fork fejl): %1</translation>
+ </message>
+ <message>
+ <location line="+259"/>
+ <location line="+53"/>
+ <location line="+74"/>
+ <location line="+67"/>
+ <location filename="../src/corelib/io/qprocess_win.cpp" line="+422"/>
+ <location line="+50"/>
+ <location line="+75"/>
+ <location line="+42"/>
+ <location line="+54"/>
+ <source>Process operation timed out</source>
+ <translation>Proces-operation time out</translation>
+ </message>
+ <message>
+ <location filename="../src/corelib/io/qprocess.cpp" line="+533"/>
+ <location line="+52"/>
+ <location filename="../src/corelib/io/qprocess_win.cpp" line="-211"/>
+ <location line="+50"/>
+ <source>Error reading from process</source>
+ <translation>Fejl ved læsning fra proces</translation>
+ </message>
+ <message>
+ <location line="+47"/>
+ <location line="+779"/>
+ <location filename="../src/corelib/io/qprocess_win.cpp" line="+140"/>
+ <source>Error writing to process</source>
+ <translation>Fejl ved skrivning til proces</translation>
+ </message>
+ <message>
+ <location line="-709"/>
+ <source>Process crashed</source>
+ <translation>Proces crashede</translation>
+ </message>
+ <message>
+ <location line="+912"/>
+ <source>No program defined</source>
+ <translation>Intet program defineret</translation>
+ </message>
+ <message>
+ <location filename="../src/corelib/io/qprocess_win.cpp" line="-341"/>
+ <source>Process failed to start</source>
+ <translation>Processen kunne ikke starte</translation>
+ </message>
+</context>
+<context>
+ <name>QProgressDialog</name>
+ <message>
+ <location filename="../src/gui/dialogs/qprogressdialog.cpp" line="+182"/>
+ <source>Cancel</source>
+ <translation>Annuller</translation>
+ </message>
+</context>
+<context>
+ <name>QPushButton</name>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/simplewidgets.cpp" line="-8"/>
+ <source>Open</source>
+ <translation>Åbn</translation>
+ </message>
+</context>
+<context>
+ <name>QRadioButton</name>
+ <message>
+ <location line="+12"/>
+ <source>Check</source>
+ <translation>Kontrollér</translation>
+ </message>
+</context>
+<context>
+ <name>QRegExp</name>
+ <message>
+ <location filename="../src/corelib/tools/qregexp.cpp" line="+64"/>
+ <source>no error occurred</source>
+ <translation>der opstod ingen fejl</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>disabled feature used</source>
+ <translation>deaktiveret funktion blev brugt</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>bad char class syntax</source>
+ <translation>dårlig char class syntaks</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>bad lookahead syntax</source>
+ <translation>dårlig lookahead syntaks</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>bad repetition syntax</source>
+ <translation>dårlig gentagelsessyntaks</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>invalid octal value</source>
+ <translation>ugyldigt oktal-tal</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>missing left delim</source>
+ <translation>Manglende venstre delimiter</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>unexpected end</source>
+ <translation>uventet afslutning</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>met internal limit</source>
+ <translation>nåede interne grænse</translation>
+ </message>
+</context>
+<context>
+ <name>QSQLite2Driver</name>
+ <message>
+ <location filename="../src/sql/drivers/sqlite2/qsql_sqlite2.cpp" line="+396"/>
+ <source>Error to open database</source>
+ <translation>Der opstod fejl ved åbning af database</translation>
+ </message>
+ <message>
+ <location line="+41"/>
+ <source>Unable to begin transaction</source>
+ <translation>Kunne ikke påbegynde transaktionen</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Unable to commit transaction</source>
+ <translation>Kunne ikke gennemføre transaktionen</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Unable to rollback Transaction</source>
+ <translation>Kunne ikke tilbagetrække transaktion</translation>
+ </message>
+</context>
+<context>
+ <name>QSQLite2Result</name>
+ <message>
+ <location line="-323"/>
+ <source>Unable to fetch results</source>
+ <translation>Kunne ikke hente resultater</translation>
+ </message>
+ <message>
+ <location line="+147"/>
+ <source>Unable to execute statement</source>
+ <translation>Kunne ikke udføre statement</translation>
+ </message>
+</context>
+<context>
+ <name>QSQLiteDriver</name>
+ <message>
+ <location filename="../src/sql/drivers/sqlite/qsql_sqlite.cpp" line="+528"/>
+ <source>Error opening database</source>
+ <translation>Der opstod fejl ved åbning af database</translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>Error closing database</source>
+ <translation>Der opstod fejl ved lukning af database</translation>
+ </message>
+ <message>
+ <location line="+20"/>
+ <source>Unable to begin transaction</source>
+ <translation>Kunne ikke påbegynde transaktionen</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Unable to commit transaction</source>
+ <translation>Kunne ikke gennemføre transaktion</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Unable to rollback transaction</source>
+ <translation>Kunne ikke tilbagetrække transaktion</translation>
+ </message>
+</context>
+<context>
+ <name>QSQLiteResult</name>
+ <message>
+ <location line="-400"/>
+ <location line="+66"/>
+ <location line="+8"/>
+ <source>Unable to fetch row</source>
+ <translation>Kunne ikke hente række</translation>
+ </message>
+ <message>
+ <location line="+63"/>
+ <source>Unable to execute statement</source>
+ <translation>Kunne ikke udføre udsagn</translation>
+ </message>
+ <message>
+ <location line="+20"/>
+ <source>Unable to reset statement</source>
+ <translation>Kunne ikke nulstille udsagn</translation>
+ </message>
+ <message>
+ <location line="+45"/>
+ <source>Unable to bind parameters</source>
+ <translation>Unable to bind parameters</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Parameter count mismatch</source>
+ <translation>Misforhold i parametertælling</translation>
+ </message>
+ <message>
+ <location line="-208"/>
+ <source>No query</source>
+ <translation>Ingen forespørgesel</translation>
+ </message>
+</context>
+<context>
+ <name>QScrollBar</name>
+ <message>
+ <location filename="../src/gui/widgets/qscrollbar.cpp" line="+448"/>
+ <source>Scroll here</source>
+ <translation>Scroll her</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Left edge</source>
+ <translation>Venstre kant</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Top</source>
+ <translation>Øverst</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Right edge</source>
+ <translation>Højre kant</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Bottom</source>
+ <translation>Bund</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Page left</source>
+ <translation>Side venstre</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="+143"/>
+ <source>Page up</source>
+ <translation>Side øverst</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Page right</source>
+ <translation>Side højre</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="+4"/>
+ <source>Page down</source>
+ <translation>Side ned</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Scroll left</source>
+ <translation>Scroll til venstre</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Scroll up</source>
+ <translation>Scroll op</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Scroll right</source>
+ <translation>Scroll til højre</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Scroll down</source>
+ <translation>Scroll ned</translation>
+ </message>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="-6"/>
+ <source>Line up</source>
+ <translation>Linie op</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Position</source>
+ <translation>Placering</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Line down</source>
+ <translation>Linie ned</translation>
+ </message>
+</context>
+<context>
+ <name>QSharedMemory</name>
+ <message>
+ <location filename="../src/corelib/kernel/qsharedmemory.cpp" line="+207"/>
+ <source>%1: unable to set key on lock</source>
+ <translation>%1: Kunne ikke oprette nøgle</translation>
+ </message>
+ <message>
+ <location line="+81"/>
+ <source>%1: create size is less then 0</source>
+ <translation>%1: create size is less then 0</translation>
+ </message>
+ <message>
+ <location line="+168"/>
+ <location filename="../src/corelib/kernel/qsharedmemory_p.h" line="+148"/>
+ <source>%1: unable to lock</source>
+ <translation>%1: Kunne ikke låse</translation>
+ </message>
+ <message>
+ <location line="+22"/>
+ <source>%1: unable to unlock</source>
+ <translation>%1: Kunne ikke oprette nøgle</translation>
+ </message>
+ <message>
+ <location filename="../src/corelib/kernel/qsharedmemory_unix.cpp" line="+78"/>
+ <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+87"/>
+ <source>%1: permission denied</source>
+ <translation>%1: Tilladelse nægtet</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="-22"/>
+ <source>%1: already exists</source>
+ <translation>%1: Findes allerede</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+9"/>
+ <source>%1: doesn&apos;t exists</source>
+ <translation>%1: Findes ikke</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+9"/>
+ <source>%1: out of resources</source>
+ <translation>%1: Ikke flere ressourcer</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+7"/>
+ <source>%1: unknown error %2</source>
+ <translation>%1: ukendt fejl %2</translation>
+ </message>
+ <message>
+ <location line="+21"/>
+ <source>%1: key is empty</source>
+ <translation>%1: nøgle er tom</translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>%1: unix key file doesn&apos;t exists</source>
+ <translation>%1: Kunne ikke oprette nøgle</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>%1: ftok failed</source>
+ <translation>%1: ftok mislykkedes</translation>
+ </message>
+ <message>
+ <location line="+51"/>
+ <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+15"/>
+ <source>%1: unable to make key</source>
+ <translation>%1: Kunne ikke oprette nøgle</translation>
+ </message>
+ <message>
+ <location line="+20"/>
+ <source>%1: system-imposed size restrictions</source>
+ <translation>%1: System-pålagte størrelsesrestriktioner</translation>
+ </message>
+ <message>
+ <location line="+53"/>
+ <source>%1: not attached</source>
+ <translation>%1: Ikke vedhæftet</translation>
+ </message>
+ <message>
+ <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="-27"/>
+ <source>%1: invalid size</source>
+ <translation>%1: Ugyldig størrelse</translation>
+ </message>
+ <message>
+ <location line="+68"/>
+ <source>%1: key error</source>
+ <translation>%1: Nøglefejl</translation>
+ </message>
+ <message>
+ <location line="+38"/>
+ <source>%1: size query failed</source>
+ <translation>%1: Størrelsesforespørgsel mislykkedes</translation>
+ </message>
+</context>
+<context>
+ <name>QShortcut</name>
+ <message>
+ <location filename="../src/gui/kernel/qkeysequence.cpp" line="+373"/>
+ <source>Space</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Esc</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Tab</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Backtab</source>
+ <translation>Tilbage-tabulator</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Backspace</source>
+ <translation>Tilbage</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Return</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Enter</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Ins</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Del</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Pause</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Print</source>
+ <translation>Udskriv</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>SysReq</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Home</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>End</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Left</source>
+ <translation>Venstre</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Up</source>
+ <translation>Op</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Right</source>
+ <translation>Højre</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Down</source>
+ <translation>Ned</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>PgUp</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>PgDown</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>CapsLock</source>
+ <translation>&apos;</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>NumLock</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>ScrollLock</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Menu</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Help</source>
+ <translation>Hjælp</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Back</source>
+ <translation>Tilbage</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Forward</source>
+ <translation>Frem</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Stop</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Refresh</source>
+ <translation>Opdater</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Volume Down</source>
+ <translation>Lydstyrke ned</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Volume Mute</source>
+ <translation>Lydstyrke mute</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Volume Up</source>
+ <translation>Lydstyrke op</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Bass Boost</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Bass Up</source>
+ <translation>Bass op</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Bass Down</source>
+ <translation>Bass ned</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Treble Up</source>
+ <translation>Diskant op</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Treble Down</source>
+ <translation>Diskant ned</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Media Play</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Media Stop</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Media Previous</source>
+ <translation>Media forrige</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Media Next</source>
+ <translation>Media næste</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Media Record</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Favorites</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Search</source>
+ <translation>Søg</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Standby</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Open URL</source>
+ <translation>Åbn URL</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch Mail</source>
+ <translation>Start mail</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch Media</source>
+ <translation>Start Media</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (0)</source>
+ <translation>Start (0)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (1)</source>
+ <translation>Start (1)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (2)</source>
+ <translation>Start (2)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (3)</source>
+ <translation>Start (3)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (4)</source>
+ <translation>Start (4)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (5)</source>
+ <translation>Start (5)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (6)</source>
+ <translation>Start (6)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (7)</source>
+ <translation>Start (7)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (8)</source>
+ <translation>Start (8)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (9)</source>
+ <translation>Start (9)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (A)</source>
+ <translation>Start (A)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (B)</source>
+ <translation>Start (B)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (C)</source>
+ <translation>Start (C)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (D)</source>
+ <translation>Start (D)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (E)</source>
+ <translation>Start (E)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Launch (F)</source>
+ <translation>Start (F)</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Print Screen</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Page Up</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Page Down</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Caps Lock</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Num Lock</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Number Lock</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Scroll Lock</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Insert</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Delete</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Escape</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>System Request</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Select</source>
+ <translation>Væg</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Yes</source>
+ <translation>Ja</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>No</source>
+ <translation>Nej</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Context1</source>
+ <translation>Kontekst1</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Context2</source>
+ <translation>Kontekst2</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Context3</source>
+ <translation>Kontekst3</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Context4</source>
+ <translation>Kontekst4</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Call</source>
+ <translation>Ring til</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hangup</source>
+ <translation>Læg på</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Flip</source>
+ <translation>Vend</translation>
+ </message>
+ <message>
+ <location line="+527"/>
+ <location line="+122"/>
+ <source>Ctrl</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-121"/>
+ <location line="+125"/>
+ <source>Shift</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-124"/>
+ <location line="+122"/>
+ <source>Alt</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-121"/>
+ <location line="+117"/>
+ <source>Meta</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-25"/>
+ <source>+</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+46"/>
+ <source>F%1</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-720"/>
+ <source>Home Page</source>
+ <translation>Startside</translation>
+ </message>
+</context>
+<context>
+ <name>QSlider</name>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="+151"/>
+ <source>Page left</source>
+ <translation>Side venstre</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Page up</source>
+ <translation>Side op</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Position</source>
+ <translation>Placering</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Page right</source>
+ <translation>Side højre</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Page down</source>
+ <translation>Side ned</translation>
+ </message>
+</context>
+<context>
+ <name>QSocks5SocketEngine</name>
+ <message>
+ <location filename="../src/network/socket/qsocks5socketengine.cpp" line="-67"/>
+ <source>Connection to proxy refused</source>
+ <translation>Proxy-forbindelse nægtede</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Connection to proxy closed prematurely</source>
+ <translation>Proxy-forbindelse afsluttede i utide</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Proxy host not found</source>
+ <translation>Proxy-host kunne ikke findes</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Connection to proxy timed out</source>
+ <translation>Proxy-serverforbindelse timed out</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Proxy authentication failed</source>
+ <translation>Proxy autentificering mislykkedes</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Proxy authentication failed: %1</source>
+ <translation>Proxy autentificering mislykkedes: %1</translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>SOCKS version 5 protocol error</source>
+ <translation>SOCKS version 5 protokolfejl</translation>
+ </message>
+ <message>
+ <location line="+19"/>
+ <source>General SOCKSv5 server failure</source>
+ <translation>General SOCKSv5 serverfejl</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Connection not allowed by SOCKSv5 server</source>
+ <translation>Forbindelse ikke tilladt a SOCKSv5-server</translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>TTL expired</source>
+ <translation>TTL udløbet</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>SOCKSv5 command not supported</source>
+ <translation>SOCKSv5-kommando ikke understøttet</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Address type not supported</source>
+ <translation>Adressetype understøttes ikke</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Unknown SOCKSv5 proxy error code 0x%1</source>
+ <translation>Ukendt SOCKSv5 proxy fejlkode 0x%1</translation>
+ </message>
+ <message>
+ <location line="+685"/>
+ <source>Network operation timed out</source>
+ <translation>Netværksoperationen timed out</translation>
+ </message>
+</context>
+<context>
+ <name>QSpinBox</name>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="-574"/>
+ <source>More</source>
+ <translation>Mere</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Less</source>
+ <translation>Mindre</translation>
+ </message>
+</context>
+<context>
+ <name>QSql</name>
+ <message>
+ <location filename="../src/qt3support/sql/q3sqlmanager_p.cpp" line="+890"/>
+ <source>Delete</source>
+ <translation>Slet</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Delete this record?</source>
+ <translation>Slet denne post?</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <location line="+16"/>
+ <location line="+36"/>
+ <source>Yes</source>
+ <translation>Ja</translation>
+ </message>
+ <message>
+ <location line="-51"/>
+ <location line="+16"/>
+ <location line="+36"/>
+ <source>No</source>
+ <translation>Nej</translation>
+ </message>
+ <message>
+ <location line="-44"/>
+ <source>Insert</source>
+ <translation>Indsæt</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Update</source>
+ <translation>Opdater</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Save edits?</source>
+ <translation>Gem ændringer?</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Cancel</source>
+ <translation>Annuller</translation>
+ </message>
+ <message>
+ <location line="+32"/>
+ <source>Confirm</source>
+ <translation>Bekræft</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Cancel your edits?</source>
+ <translation>Skal dine ændringer annulleres?</translation>
+ </message>
+</context>
+<context>
+ <name>QSslSocket</name>
+ <message>
+ <location filename="../src/network/ssl/qsslsocket_openssl.cpp" line="+569"/>
+ <source>Unable to write data: %1</source>
+ <translation>Kunne ikke skrive data: %1</translation>
+ </message>
+ <message>
+ <location line="+119"/>
+ <source>Error while reading: %1</source>
+ <translation>Der opstod en fejl under læsning af: %1</translation>
+ </message>
+ <message>
+ <location line="+96"/>
+ <source>Error during SSL handshake: %1</source>
+ <translation>Der opstod en fejl under SSL handshake: %1</translation>
+ </message>
+ <message>
+ <location line="-524"/>
+ <source>Error creating SSL context (%1)</source>
+ <translation>Der opstod fejl under oprettelse af SSL-kontekst (%1)</translation>
+ </message>
+ <message>
+ <location line="+25"/>
+ <source>Invalid or empty cipher list (%1)</source>
+ <translation>Ugyldig eller tom chifferliste (%1)</translation>
+ </message>
+ <message>
+ <location line="+62"/>
+ <source>Error creating SSL session, %1</source>
+ <translation>Der opstod fejl under oprettelse af SSL-session, %1</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Error creating SSL session: %1</source>
+ <translation>Der opstod fejl under oprettelse af SSL-session, %1</translation>
+ </message>
+ <message>
+ <location line="-61"/>
+ <source>Cannot provide a certificate with no key, %1</source>
+ <translation>Kan ikke give et certifikat uden nøgle, %1</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Error loading local certificate, %1</source>
+ <translation>Der opstod fejl under indlæsning af lokalt certifikat, %1</translation>
+ </message>
+ <message>
+ <location line="+12"/>
+ <source>Error loading private key, %1</source>
+ <translation>Der opstod fejl under indlæsning af privat nøgle, %1</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Private key does not certificate public key, %1</source>
+ <translation>Privat-nøgle autoriserer ikke offentlig-nøgle, %1</translation>
+ </message>
+</context>
+<context>
+ <name>QSystemSemaphore</name>
+ <message>
+ <location filename="../src/corelib/kernel/qsystemsemaphore_unix.cpp" line="-41"/>
+ <location filename="../src/corelib/kernel/qsystemsemaphore_win.cpp" line="+66"/>
+ <source>%1: out of resources</source>
+ <translation>%1: Ikke flere ressourcer</translation>
+ </message>
+ <message>
+ <location line="-13"/>
+ <location filename="../src/corelib/kernel/qsystemsemaphore_win.cpp" line="+4"/>
+ <source>%1: permission denied</source>
+ <translation>%1: Tilladelse nægtet</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>%1: already exists</source>
+ <translation>%1: Findes allerede</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>%1: does not exist</source>
+ <translation>%1: Findes ikke</translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <location filename="../src/corelib/kernel/qsystemsemaphore_win.cpp" line="+3"/>
+ <source>%1: unknown error %2</source>
+ <translation>%1: Ukendt fejl %2</translation>
+ </message>
+</context>
+<context>
+ <name>QTDSDriver</name>
+ <message>
+ <location filename="../src/sql/drivers/tds/qsql_tds.cpp" line="+584"/>
+ <source>Unable to open connection</source>
+ <translation>Kunne ikke etablere forbindelsen</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Unable to use database</source>
+ <translation>Kunne ikke bruge databasen</translation>
+ </message>
+</context>
+<context>
+ <name>QTabBar</name>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="-326"/>
+ <source>Scroll Left</source>
+ <translation>Scroll til venstre</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Scroll Right</source>
+ <translation>Scroll til højre</translation>
+ </message>
+</context>
+<context>
+ <name>QTcpServer</name>
+ <message>
+ <location filename="../src/network/socket/qtcpserver.cpp" line="+282"/>
+ <source>Operation on socket is not supported</source>
+ <translation>Socket-operation ikke understøttet</translation>
+ </message>
+</context>
+<context>
+ <name>QTextControl</name>
+ <message>
+ <location filename="../src/gui/text/qtextcontrol.cpp" line="+1973"/>
+ <source>&amp;Undo</source>
+ <translation>&amp;Fortryd</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>&amp;Redo</source>
+ <translation>&amp;Gendan</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Cu&amp;t</source>
+ <translation>K&amp;lip</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>&amp;Copy</source>
+ <translation>&amp;Kopiér</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Copy &amp;Link Location</source>
+ <translation>Kopiér l&amp;ink</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>&amp;Paste</source>
+ <translation>&amp;Sæt ind</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Delete</source>
+ <translation>Slet</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Select All</source>
+ <translation>Markér alt</translation>
+ </message>
+</context>
+<context>
+ <name>QToolButton</name>
+ <message>
+ <location filename="../src/plugins/accessible/widgets/simplewidgets.cpp" line="+254"/>
+ <location line="+6"/>
+ <source>Press</source>
+ <translation>Tryk på</translation>
+ </message>
+ <message>
+ <location line="-4"/>
+ <location line="+8"/>
+ <source>Open</source>
+ <translation>Åbn</translation>
+ </message>
+</context>
+<context>
+ <name>QUdpSocket</name>
+ <message>
+ <location filename="../src/network/socket/qudpsocket.cpp" line="+169"/>
+ <source>This platform does not support IPv6</source>
+ <translation>Denne platform understøtter ikke IPv6</translation>
+ </message>
+</context>
+<context>
+ <name>QUndoGroup</name>
+ <message>
+ <location filename="../src/gui/util/qundogroup.cpp" line="+386"/>
+ <source>Undo</source>
+ <translation>Fortryd</translation>
+ </message>
+ <message>
+ <location line="+28"/>
+ <source>Redo</source>
+ <translation>Gendan</translation>
+ </message>
+</context>
+<context>
+ <name>QUndoModel</name>
+ <message>
+ <location filename="../src/gui/util/qundoview.cpp" line="+101"/>
+ <source>&lt;empty&gt;</source>
+ <translation>&lt;tom&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>QUndoStack</name>
+ <message>
+ <location filename="../src/gui/util/qundostack.cpp" line="+834"/>
+ <source>Undo</source>
+ <translation>Fortryd</translation>
+ </message>
+ <message>
+ <location line="+27"/>
+ <source>Redo</source>
+ <translation>Gendan</translation>
+ </message>
+</context>
+<context>
+ <name>QUnicodeControlCharacterMenu</name>
+ <message>
+ <location filename="../src/gui/text/qtextcontrol.cpp" line="+884"/>
+ <source>LRM Left-to-right mark</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>RLM Right-to-left mark</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>ZWJ Zero width joiner</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>ZWNJ Zero width non-joiner</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>ZWSP Zero width space</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>LRE Start of left-to-right embedding</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>RLE Start of right-to-left embedding</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>LRO Start of left-to-right override</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>RLO Start of right-to-left override</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>PDF Pop directional formatting</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Insert Unicode control character</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>QWebFrame</name>
+ <message>
+ <location filename="../src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp" line="+692"/>
+ <source>Request cancelled</source>
+ <translation>Anmodning annulleret</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Request blocked</source>
+ <translation>Anmodning blokeret</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Cannot show URL</source>
+ <translation>Kan ikke vise URL</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Frame load interruped by policy change</source>
+ <translation>Billedindlæsning afbrudt af ændringer i retningslinier</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Cannot show mimetype</source>
+ <translation>Kan ikke vise MIME-type</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>File does not exist</source>
+ <translation>Filen findes ikke</translation>
+ </message>
+</context>
+<context>
+ <name>QWebPage</name>
+ <message>
+ <location filename="../src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp" line="+384"/>
+ <source>Bad HTTP request</source>
+ <translation>Dårlig HTTP-anmodning</translation>
+ </message>
+ <message>
+ <location filename="../src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp" line="+42"/>
+ <source>Submit</source>
+ <comment>default label for Submit buttons in forms on web pages</comment>
+ <translation>Send</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Submit</source>
+ <comment>Submit (input element) alt text for &lt;input&gt; elements with no alt, title, or value</comment>
+ <translation>Send</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Reset</source>
+ <comment>default label for Reset buttons in forms on web pages</comment>
+ <translation>Nulstil</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>This is a searchable index. Enter search keywords: </source>
+ <comment>text that appears at the start of nearly-obsolete web pages in the form of a &apos;searchable index&apos;</comment>
+ <translation>Dette er et søgeindeks. Indtast søgeord:</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Choose File</source>
+ <comment>title for file button used in HTML forms</comment>
+ <translation>Vælg fil</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>No file selected</source>
+ <comment>text to display in file button used in HTML forms when no file is selected</comment>
+ <translation>Der er ikke valgt en fil</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Open in New Window</source>
+ <comment>Open in New Window context menu item</comment>
+ <translation>Åbn i nyt vindue</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Save Link...</source>
+ <comment>Download Linked File context menu item</comment>
+ <translation>Gem link...</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Copy Link</source>
+ <comment>Copy Link context menu item</comment>
+ <translation>Kopiér link</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Open Image</source>
+ <comment>Open Image in New Window context menu item</comment>
+ <translation>Åbn billede</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Save Image</source>
+ <comment>Download Image context menu item</comment>
+ <translation>Gem billede</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Copy Image</source>
+ <comment>Copy Link context menu item</comment>
+ <translation>Kopiér billede</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Open Frame</source>
+ <comment>Open Frame in New Window context menu item</comment>
+ <translation>Åbn faneblad</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Copy</source>
+ <comment>Copy context menu item</comment>
+ <translation>Kopiér</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Go Back</source>
+ <comment>Back context menu item</comment>
+ <translation>Gå tilbage</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Go Forward</source>
+ <comment>Forward context menu item</comment>
+ <translation>Gå frem</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Stop</source>
+ <comment>Stop context menu item</comment>
+ <translation>Stop</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Reload</source>
+ <comment>Reload context menu item</comment>
+ <translation>Genindlæs</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Cut</source>
+ <comment>Cut context menu item</comment>
+ <translation>Klip</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Paste</source>
+ <comment>Paste context menu item</comment>
+ <translation>Sæt ind</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>No Guesses Found</source>
+ <comment>No Guesses Found context menu item</comment>
+ <translation>Der er ikke fundet nogen gæt</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Ignore</source>
+ <comment>Ignore Spelling context menu item</comment>
+ <translation>Ignorér</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Add To Dictionary</source>
+ <comment>Learn Spelling context menu item</comment>
+ <translation>Tilføj til ordbog</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Search The Web</source>
+ <comment>Search The Web context menu item</comment>
+ <translation>Søg på nettet</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Look Up In Dictionary</source>
+ <comment>Look Up in Dictionary context menu item</comment>
+ <translation>Slå op i ordbog</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Open Link</source>
+ <comment>Open Link context menu item</comment>
+ <translation>Åbn link</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Ignore</source>
+ <comment>Ignore Grammar context menu item</comment>
+ <translation>Ignorér</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Spelling</source>
+ <comment>Spelling and Grammar context sub-menu item</comment>
+ <translation>Stavekontrol</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Show Spelling and Grammar</source>
+ <comment>menu item title</comment>
+ <translation>Vis stave- og grammatikkontrol</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Spelling and Grammar</source>
+ <comment>menu item title</comment>
+ <translation>Skjul stave- og grammatikkontrol</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Check Spelling</source>
+ <comment>Check spelling context menu item</comment>
+ <translation>Kør stavekontrol</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Check Spelling While Typing</source>
+ <comment>Check spelling while typing context menu item</comment>
+ <translation>Kør stavekontrol mens der tastes</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Check Grammar With Spelling</source>
+ <comment>Check grammar with spelling context menu item</comment>
+ <translation>Kør grammatikkontrol sammen med stavekontrol</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Fonts</source>
+ <comment>Font context sub-menu item</comment>
+ <translation>Skrifttyper</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Bold</source>
+ <comment>Bold context menu item</comment>
+ <translation>Fed</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Italic</source>
+ <comment>Italic context menu item</comment>
+ <translation>Kursiv</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Underline</source>
+ <comment>Underline context menu item</comment>
+ <translation>Understreget</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Outline</source>
+ <comment>Outline context menu item</comment>
+ <translation>Kontur</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Direction</source>
+ <comment>Writing direction context sub-menu item</comment>
+ <translation>Retning</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Text Direction</source>
+ <comment>Text direction context sub-menu item</comment>
+ <translation>Tekstretning</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Default</source>
+ <comment>Default writing direction context menu item</comment>
+ <translation>Standard</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>LTR</source>
+ <comment>Left to Right context menu item</comment>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>RTL</source>
+ <comment>Right to Left context menu item</comment>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Inspect</source>
+ <comment>Inspect Element context menu item</comment>
+ <translation>Inspicér</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>No recent searches</source>
+ <comment>Label for only item in menu that appears when clicking on the search field image, when no searches have been performed</comment>
+ <translation>Ingen aktuelle søgninger</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Recent searches</source>
+ <comment>label for first item in the menu that appears when clicking on the search field image, used as embedded menu title</comment>
+ <translation>Aktuelle søgninger</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Clear recent searches</source>
+ <comment>menu item in Recent Searches menu that empties menu&apos;s contents</comment>
+ <translation>Ryd aktuelle søgninger</translation>
+ </message>
+ <message>
+ <location line="+75"/>
+ <source>Unknown</source>
+ <comment>Unknown filesize FTP directory listing item</comment>
+ <translation>Ukendt</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>%1 (%2x%3 pixels)</source>
+ <comment>Title string for images</comment>
+ <translation>%1 (%2x%3 pixels)</translation>
+ </message>
+ <message>
+ <location filename="../src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp" line="+185"/>
+ <source>Web Inspector - %2</source>
+ <translation>Web-inspektør - %2</translation>
+ </message>
+ <message>
+ <location filename="../src/3rdparty/webkit/WebCore/platform/qt/ScrollbarQt.cpp" line="+58"/>
+ <source>Scroll here</source>
+ <translation>Scroll her</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Left edge</source>
+ <translation>Venstre kant</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Top</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Right edge</source>
+ <translation>Højre kant</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Bottom</source>
+ <translation>Bund</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Page left</source>
+ <translation>Side venstre</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Page up</source>
+ <translation>Side øverst</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Page right</source>
+ <translation>Side højre</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Page down</source>
+ <translation>Side ned</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Scroll left</source>
+ <translation>Scroll til venstre</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Scroll up</source>
+ <translation>Scroll op</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Scroll right</source>
+ <translation>Scroll til højre</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Scroll down</source>
+ <translation>Scroll ned</translation>
+ </message>
+ <message numerus="yes">
+ <location filename="../src/3rdparty/webkit/WebCore/platform/qt/FileChooserQt.cpp" line="+45"/>
+ <source>%n file(s)</source>
+ <comment>number of chosen file</comment>
+ <translation>
+ <numerusform>%n fil</numerusform>
+ <numerusform>%n filer</numerusform>
+ </translation>
+ </message>
+ <message>
+ <location filename="../src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp" line="+1322"/>
+ <source>JavaScript Alert - %1</source>
+ <translation>JavaScript alert - %1</translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>JavaScript Confirm - %1</source>
+ <translation>JavaScript Bekræft - %1</translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>JavaScript Prompt - %1</source>
+ <translation>JavaScript Prompt - %1</translation>
+ </message>
+ <message>
+ <location line="+340"/>
+ <source>Move the cursor to the next character</source>
+ <translation>Flyt markør til næste tegn</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Move the cursor to the previous character</source>
+ <translation>Flyt markør til forrige tegn</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Move the cursor to the next word</source>
+ <translation>Flyt markør til næste ord</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Move the cursor to the previous word</source>
+ <translation>Flyt markør til forrige ord</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Move the cursor to the next line</source>
+ <translation>Flyt markør til næste linie</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Move the cursor to the previous line</source>
+ <translation>Flyt markør til forrige linie</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Move the cursor to the start of the line</source>
+ <translation>Flyt markør til starten af linien</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Move the cursor to the end of the line</source>
+ <translation>Flyt markør til slutningen af linien</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Move the cursor to the start of the block</source>
+ <translation>Flyt markør til starten af sektionen</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Move the cursor to the end of the block</source>
+ <translation>Flyt markør til slutningen af sektionen</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Move the cursor to the start of the document</source>
+ <translation>Flyt markør til starten af dokumentet</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Move the cursor to the end of the document</source>
+ <translation>Flyt markør til slutningen af dokumentet</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select all</source>
+ <translation>Markér alt</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select to the next character</source>
+ <translation>Vælg til næste tegn</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select to the previous character</source>
+ <translation>Vælg til forrige tegn</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select to the next word</source>
+ <translation>Vælg til næste ord</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select to the previous word</source>
+ <translation>Vælg til forrige ord</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select to the next line</source>
+ <translation>Vælg til næste linie</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select to the previous line</source>
+ <translation>Vælg til forrige linie</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select to the start of the line</source>
+ <translation>Vælg til starten af linien</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select to the end of the line</source>
+ <translation>Vælg til slutningen af linien</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select to the start of the block</source>
+ <translation>Vælg til starten af sektionen</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select to the end of the block</source>
+ <translation>Vælg til slutningen af sektionen</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select to the start of the document</source>
+ <translation>Vælg til starten af dokumentet</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Select to the end of the document</source>
+ <translation>Vælg til slutningen af dokumentet</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Delete to the start of the word</source>
+ <translation>Slet til starten af ordet</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Delete to the end of the word</source>
+ <translation>Slet til slutningen af ordet</translation>
+ </message>
+ <message>
+ <location line="+33"/>
+ <source>Insert a new paragraph</source>
+ <translation>Indsæt et nyt afsnit</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Insert a new line</source>
+ <translation>Insert ny linie</translation>
+ </message>
+</context>
+<context>
+ <name>QWhatsThisAction</name>
+ <message>
+ <location filename="../src/gui/kernel/qwhatsthis.cpp" line="+522"/>
+ <source>What&apos;s This?</source>
+ <translation>Hvad er dette?</translation>
+ </message>
+</context>
+<context>
+ <name>QWidget</name>
+ <message>
+ <location filename="../src/gui/kernel/qwidget.cpp" line="+5340"/>
+ <source>*</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>QWizard</name>
+ <message>
+ <location filename="../src/gui/dialogs/qwizard.cpp" line="+637"/>
+ <source>Go Back</source>
+ <translation>Gå tilbage</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Continue</source>
+ <translation>Fortsæt</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Commit</source>
+ <translation>Udfør</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Done</source>
+ <translation>Færdig</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Help</source>
+ <translation>Hjælp</translation>
+ </message>
+ <message>
+ <location line="-14"/>
+ <source>&lt; &amp;Back</source>
+ <translation>&lt; &amp;Tilbage</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>&amp;Finish</source>
+ <translation>&amp;Afslut</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Cancel</source>
+ <translation>Annuller</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>&amp;Help</source>
+ <translation>&amp;Hjælp</translation>
+ </message>
+ <message>
+ <location line="-8"/>
+ <source>&amp;Next</source>
+ <translation>&amp;Næste</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>&amp;Next &gt;</source>
+ <translation>&amp;Næste &gt;</translation>
+ </message>
+</context>
+<context>
+ <name>QWorkspace</name>
+ <message>
+ <location filename="../src/gui/widgets/qworkspace.cpp" line="+1094"/>
+ <source>&amp;Restore</source>
+ <translation>&amp;Gendan</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Move</source>
+ <translation>&amp;Flyt</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;Size</source>
+ <translation>&amp;Størrelse</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Mi&amp;nimize</source>
+ <translation>Mi&amp;nimér</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Ma&amp;ximize</source>
+ <translation>Ma&amp;ksimér</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>&amp;Close</source>
+ <translation>&amp;Luk</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Stay on &amp;Top</source>
+ <translation>Bliv på &amp;toppen</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <location line="+1059"/>
+ <source>Sh&amp;ade</source>
+ <translation>Sk&amp;ygge</translation>
+ </message>
+ <message>
+ <location line="-278"/>
+ <location line="+60"/>
+ <source>%1 - [%2]</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="-1837"/>
+ <source>Minimize</source>
+ <translation>Minimer</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Restore Down</source>
+ <translation>Gendan ned</translation>
+ </message>
+ <message>
+ <location line="-4"/>
+ <source>Close</source>
+ <translation>Luk</translation>
+ </message>
+ <message>
+ <location line="+2053"/>
+ <source>&amp;Unshade</source>
+ <translation>&amp;Fjern skygge</translation>
+ </message>
+</context>
+<context>
+ <name>QXml</name>
+ <message>
+ <location filename="../src/xml/sax/qxml.cpp" line="+58"/>
+ <source>no error occurred</source>
+ <translation>der opstod ingen fejl</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>error triggered by consumer</source>
+ <translation>Fejltilstand rejst af datamodtager</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>unexpected end of file</source>
+ <translation>uventet afslutning på fil</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>more than one document type definition</source>
+ <translation>mere end én definition på dokumenttype</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>error occurred while parsing element</source>
+ <translation>der opstod fejl under fortolking af element</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>tag mismatch</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>error occurred while parsing content</source>
+ <translation>der opstod fejl under fortolking af indhold</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>unexpected character</source>
+ <translation>uventet tegn</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>invalid name for processing instruction</source>
+ <translation>Ugyldigt navn for processing instruction</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>version expected while reading the XML declaration</source>
+ <translation>version forventet under læsning af XML-deklaration</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>wrong value for standalone declaration</source>
+ <translation>Forkert værdi for fri deklaration</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>encoding declaration or standalone declaration expected while reading the XML declaration</source>
+ <translation>Enkodningsdeklaration eller fri deklaration forventet ved læsning af XML-deklaration</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>standalone declaration expected while reading the XML declaration</source>
+ <translation>fri deklaration forventet ved læsning af XML-deklaration</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>error occurred while parsing document type definition</source>
+ <translation>der opstod fejl under fortolking af dokumenttypedefinition</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>letter is expected</source>
+ <translation>bogstav forventet</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>error occurred while parsing comment</source>
+ <translation>der opstod fejl under fortolking af kommentar</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>error occurred while parsing reference</source>
+ <translation>der opstod fejl under fortolking af reference</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>internal general entity reference not allowed in DTD</source>
+ <translation>intern generel entitetsreference ikke tilladt i DTD</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>external parsed general entity reference not allowed in attribute value</source>
+ <translation>Eksternt parset generel entitetsreference ikke tilladt i attributværdi</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>external parsed general entity reference not allowed in DTD</source>
+ <translation>Eksternt parset generel entitetsreference ikke tilladt i DTD</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>unparsed entity reference in wrong context</source>
+ <translation>ufortolket enhedsreference i forkert kontekst</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>recursive entities</source>
+ <translation>rekursive entiteter</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>error in the text declaration of an external entity</source>
+ <translation>fejl i tekstdeklaration på en ekstern enhed</translation>
+ </message>
+</context>
+<context>
+ <name>QXmlStream</name>
+ <message>
+ <location filename="../src/corelib/xml/qxmlstream.cpp" line="+592"/>
+ <location filename="../src/corelib/xml/qxmlstream_p.h" line="+1769"/>
+ <source>Extra content at end of document.</source>
+ <translation>Ekstra indhold sidst i dokumentet.</translation>
+ </message>
+ <message>
+ <location line="+222"/>
+ <source>Invalid entity value.</source>
+ <translation>Ugyldig enhedsværdi.</translation>
+ </message>
+ <message>
+ <location line="+107"/>
+ <source>Invalid XML character.</source>
+ <translation>Ugyldigt XML-tegn.</translation>
+ </message>
+ <message>
+ <location line="+259"/>
+ <source>Sequence &apos;]]&gt;&apos; not allowed in content.</source>
+ <translation>Sekvens &apos;]]&gt;&apos; ikke tilladt i indhold.</translation>
+ </message>
+ <message>
+ <location line="+309"/>
+ <source>Namespace prefix &apos;%1&apos; not declared</source>
+ <translation>Navnerumspræfiks &apos;%1&apos; ikke deklareret</translation>
+ </message>
+ <message>
+ <location line="+78"/>
+ <source>Attribute redefined.</source>
+ <translation>Attribut redefineret.</translation>
+ </message>
+ <message>
+ <location line="+115"/>
+ <source>Unexpected character &apos;%1&apos; in public id literal.</source>
+ <translation>Uventet tegn &apos;%1&apos; i public id værdi.</translation>
+ </message>
+ <message>
+ <location line="+28"/>
+ <source>Invalid XML version string.</source>
+ <translation>Ugyldigt XML-versionsstreng.</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Unsupported XML version.</source>
+ <translation>XML-version understøttes ikke.</translation>
+ </message>
+ <message>
+ <location line="+23"/>
+ <source>%1 is an invalid encoding name.</source>
+ <translation>%1 er et ugyldigt enkodningsnavn.</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Encoding %1 is unsupported</source>
+ <translation>Enkodning %1 er ikke understøttet</translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>Standalone accepts only yes or no.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Invalid attribute in XML declaration.</source>
+ <translation>Ugyldig attribut i XML-deklaration.</translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>Premature end of document.</source>
+ <translation>Dokument sluttede for tidligt.</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Invalid document.</source>
+ <translation>Ugyldigt dokument.</translation>
+ </message>
+ <message>
+ <location line="+40"/>
+ <source>Expected </source>
+ <translation>Forventet</translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>, but got &apos;</source>
+ <translation>, men fik &apos;</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Unexpected &apos;</source>
+ <translation>Uventet &apos;</translation>
+ </message>
+ <message>
+ <location line="+210"/>
+ <source>Expected character data.</source>
+ <translation>Forventet tegndata.</translation>
+ </message>
+ <message>
+ <location filename="../src/corelib/xml/qxmlstream_p.h" line="-995"/>
+ <source>Recursive entity detected.</source>
+ <translation>Rekursiv entitet opdaget.</translation>
+ </message>
+ <message>
+ <location line="+516"/>
+ <source>Start tag expected.</source>
+ <translation>Start-tag forventet.</translation>
+ </message>
+ <message>
+ <location line="+222"/>
+ <source>XML declaration not at start of document.</source>
+ <translation>XML-deklaration ikke i starten af dokumentet.</translation>
+ </message>
+ <message>
+ <location line="-31"/>
+ <source>NDATA in parameter entity declaration.</source>
+ <translation>NDATA i parameterentitetsdeklaration.</translation>
+ </message>
+ <message>
+ <location line="+34"/>
+ <source>%1 is an invalid processing instruction name.</source>
+ <translation>%1 er et ugyldigt processing-instruction-navn.</translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>Invalid processing instruction name.</source>
+ <translation>Ugyldigt processing-instruction-navn.</translation>
+ </message>
+ <message>
+ <location filename="../src/corelib/xml/qxmlstream.cpp" line="-521"/>
+ <location line="+12"/>
+ <location filename="../src/corelib/xml/qxmlstream_p.h" line="+164"/>
+ <location line="+53"/>
+ <source>Illegal namespace declaration.</source>
+ <translation>Ulovligt navnerumsdeklaration.</translation>
+ </message>
+ <message>
+ <location filename="../src/corelib/xml/qxmlstream_p.h" line="+15"/>
+ <source>Invalid XML name.</source>
+ <translation>Ugyldigt XML-navn.</translation>
+ </message>
+ <message>
+ <location line="+23"/>
+ <source>Opening and ending tag mismatch.</source>
+ <translation>Åbner og afslutter tag-mismatch.</translation>
+ </message>
+ <message>
+ <location line="+18"/>
+ <source>Reference to unparsed entity &apos;%1&apos;.</source>
+ <translation>Reference to ufortolket enhed &apos;%1&apos;.</translation>
+ </message>
+ <message>
+ <location line="-13"/>
+ <location line="+61"/>
+ <location line="+40"/>
+ <source>Entity &apos;%1&apos; not declared.</source>
+ <translation>Enheden &apos;%1&apos; ikke deklareret.</translation>
+ </message>
+ <message>
+ <location line="-26"/>
+ <source>Reference to external entity &apos;%1&apos; in attribute value.</source>
+ <translation>Reference til ekstern enhed &apos;%1&apos; i attributværdi.</translation>
+ </message>
+ <message>
+ <location line="+40"/>
+ <source>Invalid character reference.</source>
+ <translation>Ugyldig tegnreference.</translation>
+ </message>
+ <message>
+ <location filename="../src/corelib/xml/qxmlstream.cpp" line="-75"/>
+ <location filename="../src/corelib/xml/qxmlstream_p.h" line="-823"/>
+ <source>Encountered incorrectly encoded content.</source>
+ <translation>Indhold med forkert enkodning læst.</translation>
+ </message>
+ <message>
+ <location line="+274"/>
+ <source>The standalone pseudo attribute must appear after the encoding.</source>
+ <translation>Den frie pseudo-attribut skal optræde efter enkodningen.</translation>
+ </message>
+ <message>
+ <location filename="../src/corelib/xml/qxmlstream_p.h" line="+562"/>
+ <source>%1 is an invalid PUBLIC identifier.</source>
+ <translation>%1 er en ugyldig PUBLIC identifier.</translation>
+ </message>
+</context>
+<context>
+ <name>QtXmlPatterns</name>
+ <message>
+ <location filename="../src/xmlpatterns/acceltree/qacceltreebuilder.cpp" line="+205"/>
+ <source>An %1-attribute with value %2 has already been declared.</source>
+ <translation>En %1-attribut med værdi %2 er allerede erklæret.</translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>An %1-attribute must have a valid %2 as value, which %3 isn&apos;t.</source>
+ <translation>En %1-attribut skal have en gyldig %2 som værdi, hvilket %3 ikke er.</translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/api/qiodevicedelegate.cpp" line="+84"/>
+ <source>Network timeout.</source>
+ <translation>Netværk timeout.</translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/api/qxmlserializer.cpp" line="+320"/>
+ <source>Element %1 can&apos;t be serialized because it appears outside the document element.</source>
+ <translation>Element %1 kan ikke serialiseres fordi det optræder udenfor dokument-elementet.</translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/data/qabstractdatetime.cpp" line="+80"/>
+ <source>Year %1 is invalid because it begins with %2.</source>
+ <translation>År %1 er ugyldigt da det begynder med %2.</translation>
+ </message>
+ <message>
+ <location line="+19"/>
+ <source>Day %1 is outside the range %2..%3.</source>
+ <translation>Dag %1 er udenfor intervallet %2..%3.</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Month %1 is outside the range %2..%3.</source>
+ <translation>Måned %1 er udenfor intervallet %2..%3.</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>Overflow: Can&apos;t represent date %1.</source>
+ <translation>Overflow: Kan ikke repræsentere dato %1.</translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>Day %1 is invalid for month %2.</source>
+ <translation>Dag %1 er ugyldig for månet %2.</translation>
+ </message>
+ <message>
+ <location line="+49"/>
+ <source>Time 24:%1:%2.%3 is invalid. Hour is 24, but minutes, seconds, and milliseconds are not all 0; </source>
+ <translation>Tidspunkt 24:%1:%2.%3 er ugyldigt. Timetal er 24, men minutter, sekunder og millisekunder er ikke alle 0; </translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>Time %1:%2:%3.%4 is invalid.</source>
+ <translation>Tidspunkt %1:%2:%3.%4 er ugyldigt.</translation>
+ </message>
+ <message>
+ <location line="+115"/>
+ <source>Overflow: Date can&apos;t be represented.</source>
+ <translation>Overflow: Dato kan ikke repræsenteres.</translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/data/qabstractduration.cpp" line="+99"/>
+ <location line="+15"/>
+ <source>At least one component must be present.</source>
+ <translation>Mindst en komponent skal være tilstede.</translation>
+ </message>
+ <message>
+ <location line="-7"/>
+ <source>At least one time component must appear after the %1-delimiter.</source>
+ <translation>Mindst en tidskomponent skal optræde efter %1-skillemærket.</translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/data/qabstractfloatmathematician.cpp" line="+64"/>
+ <source>No operand in an integer division, %1, can be %2.</source>
+ <translation>Ingen operand i en heltalsdivision, %1, kan være %2.</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>The first operand in an integer division, %1, cannot be infinity (%2).</source>
+ <translation>Den første operand i en heltalsdivision, %1, kan ikke være uendeligt (%2).</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>The second operand in a division, %1, cannot be zero (%2).</source>
+ <translation>Den anden operand i en division, %1, kan ikke være nul (%2).</translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/data/qanyuri_p.h" line="+132"/>
+ <source>%1 is not a valid value of type %2.</source>
+ <translation>%1 er ikke en gyldig værdi af typen %2.</translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/data/qatomiccasters_p.h" line="+223"/>
+ <source>When casting to %1 from %2, the source value cannot be %3.</source>
+ <translation>Ved cast til %1 fra %2, kan kildeværdien ikke være %3.</translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/data/qatomicmathematicians.cpp" line="+65"/>
+ <source>Integer division (%1) by zero (%2) is undefined.</source>
+ <translation>Heltalsdivision (%1) med nul (%2) er udefineret.</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Division (%1) by zero (%2) is undefined.</source>
+ <translation>Division (%1) med nul (%2) er udefineret.</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Modulus division (%1) by zero (%2) is undefined.</source>
+ <translation>Modulusdivision (%1) med nul (%2) er udefineret.</translation>
+ </message>
+ <message>
+ <location line="+122"/>
+ <location line="+32"/>
+ <source>Dividing a value of type %1 by %2 (not-a-number) is not allowed.</source>
+ <translation>Division af værdi af typen %1 med %2 (ikke et tal) er ikke tilladt.</translation>
+ </message>
+ <message>
+ <location line="-20"/>
+ <source>Dividing a value of type %1 by %2 or %3 (plus or minus zero) is not allowed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+32"/>
+ <source>Multiplication of a value of type %1 by %2 or %3 (plus or minus infinity) is not allowed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/data/qatomicvalue.cpp" line="+79"/>
+ <source>A value of type %1 cannot have an Effective Boolean Value.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/data/qboolean.cpp" line="+78"/>
+ <source>Effective Boolean Value cannot be calculated for a sequence containing two or more atomic values.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/data/qderivedinteger_p.h" line="+402"/>
+ <source>Value %1 of type %2 exceeds maximum (%3).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>Value %1 of type %2 is below minimum (%3).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/data/qhexbinary.cpp" line="+91"/>
+ <source>A value of type %1 must contain an even number of digits. The value %2 does not.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+19"/>
+ <source>%1 is not valid as a value of type %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qarithmeticexpression.cpp" line="+207"/>
+ <source>Operator %1 cannot be used on type %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Operator %1 cannot be used on atomic values of type %2 and %3.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qattributenamevalidator.cpp" line="+66"/>
+ <source>The namespace URI in the name for a computed attribute cannot be %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>The name for a computed attribute cannot have the namespace URI %1 with the local name %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qcastas.cpp" line="+88"/>
+ <source>Type error in cast, expected %1, received %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+29"/>
+ <source>When casting to %1 or types derived from it, the source value must be of the same type, or it must be a string literal. Type %2 is not allowed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qcastingplatform.cpp" line="+134"/>
+ <source>No casting is possible with %1 as the target type.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>It is not possible to cast from %1 to %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+27"/>
+ <source>Casting to %1 is not possible because it is an abstract type, and can therefore never be instantiated.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+23"/>
+ <source>It&apos;s not possible to cast the value %1 of type %2 to %3</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>Failure when casting from %1 to %2: %3</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qcommentconstructor.cpp" line="+67"/>
+ <source>A comment cannot contain %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>A comment cannot end with a %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qcomparisonplatform.cpp" line="+167"/>
+ <source>No comparisons can be done involving the type %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+14"/>
+ <source>Operator %1 is not available between atomic values of type %2 and %3.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qdocumentcontentvalidator.cpp" line="+86"/>
+ <source>An attribute node cannot be a child of a document node. Therefore, the attribute %1 is out of place.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qexpressionfactory.cpp" line="+169"/>
+ <source>A library module cannot be evaluated directly. It must be imported from a main module.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+40"/>
+ <source>No template by name %1 exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qgenericpredicate.cpp" line="+106"/>
+ <source>A value of type %1 cannot be a predicate. A predicate must have either a numeric type or an Effective Boolean Value type.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+32"/>
+ <source>A positional predicate must evaluate to a single numeric value.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qncnameconstructor_p.h" line="+113"/>
+ <source>The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, is %2 invalid.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+24"/>
+ <source>%1 is not a valid target name in a processing instruction. It must be a %2 value, e.g. %3.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qpath.cpp" line="+109"/>
+ <source>The last step in a path must contain either nodes or atomic values. It cannot be a mixture between the two.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qprocessinginstructionconstructor.cpp" line="+84"/>
+ <source>The data of a processing instruction cannot contain the string %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qqnameconstructor.cpp" line="+82"/>
+ <source>No namespace binding exists for the prefix %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qqnameconstructor_p.h" line="+156"/>
+ <source>No namespace binding exists for the prefix %1 in %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+12"/>
+ <location filename="../src/xmlpatterns/functions/qqnamefns.cpp" line="+69"/>
+ <source>%1 is an invalid %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message numerus="yes">
+ <location filename="../src/xmlpatterns/functions/qabstractfunctionfactory.cpp" line="+77"/>
+ <source>%1 takes at most %n argument(s). %2 is therefore invalid.</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <location line="+11"/>
+ <source>%1 requires at least %n argument(s). %2 is therefore invalid.</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qaggregatefns.cpp" line="+120"/>
+ <source>The first argument to %1 cannot be of type %2. It must be a numeric type, xs:yearMonthDuration or xs:dayTimeDuration.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+74"/>
+ <source>The first argument to %1 cannot be of type %2. It must be of type %3, %4, or %5.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+91"/>
+ <source>The second argument to %1 cannot be of type %2. It must be of type %3, %4, or %5.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qassemblestringfns.cpp" line="+88"/>
+ <source>%1 is not a valid XML 1.0 character.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qcomparingaggregator.cpp" line="+197"/>
+ <source>The first argument to %1 cannot be of type %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qdatetimefn.cpp" line="+86"/>
+ <source>If both values have zone offsets, they must have the same zone offset. %1 and %2 are not the same.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qerrorfn.cpp" line="+61"/>
+ <source>%1 was called.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qpatternmatchingfns.cpp" line="+94"/>
+ <source>%1 must be followed by %2 or %3, not at the end of the replacement string.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+39"/>
+ <source>In the replacement string, %1 must be followed by at least one digit when not escaped.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+26"/>
+ <source>In the replacement string, %1 can only be used to escape itself or %2, not %3</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qpatternplatform.cpp" line="+92"/>
+ <source>%1 matches newline characters</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>%1 and %2 match the start and end of a line.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Matches are case insensitive</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Whitespace characters are removed, except when they appear in character classes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+99"/>
+ <source>%1 is an invalid regular expression pattern: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+30"/>
+ <source>%1 is an invalid flag for regular expressions. Valid flags are:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qqnamefns.cpp" line="+17"/>
+ <source>If the first argument is the empty sequence or a zero-length string (no namespace), a prefix cannot be specified. Prefix %1 was specified.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qsequencefns.cpp" line="+346"/>
+ <source>It will not be possible to retrieve %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qcontextnodechecker.cpp" line="+54"/>
+ <source>The root node of the second argument to function %1 must be a document node. %2 is not a document node.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qsequencegeneratingfns.cpp" line="+279"/>
+ <source>The default collection is undefined</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>%1 cannot be retrieved</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qstringvaluefns.cpp" line="+252"/>
+ <source>The normalization form %1 is unsupported. The supported forms are %2, %3, %4, and %5, and none, i.e. the empty string (no normalization).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qtimezonefns.cpp" line="+87"/>
+ <source>A zone offset must be in the range %1..%2 inclusive. %3 is out of range.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+12"/>
+ <source>%1 is not a whole number of minutes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/janitors/qcardinalityverifier.cpp" line="+58"/>
+ <source>Required cardinality is %1; got cardinality %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/janitors/qitemverifier.cpp" line="+67"/>
+ <source>The item %1 did not match the required type %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/parser/qquerytransformparser.cpp" line="+379"/>
+ <location line="+7253"/>
+ <source>%1 is an unknown schema type.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="-6971"/>
+ <source>Only one %1 declaration can occur in the query prolog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+188"/>
+ <source>The initialization of variable %1 depends on itself</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+63"/>
+ <source>No variable by name %1 exists</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/parser/qparsercontext.cpp" line="+93"/>
+ <source>The variable %1 is unused</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/parser/qquerytransformparser.cpp" line="+2841"/>
+ <source>Version %1 is not supported. The supported XQuery version is 1.0.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>The encoding %1 is invalid. It must contain Latin characters only, must not contain whitespace, and must match the regular expression %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+55"/>
+ <source>No function with signature %1 is available</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+72"/>
+ <location line="+10"/>
+ <source>A default namespace declaration must occur before function, variable, and option declarations.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>Namespace declarations must occur before function, variable, and option declarations.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>Module imports must occur before function, variable, and option declarations.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+200"/>
+ <source>It is not possible to redeclare prefix %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+18"/>
+ <source>Prefix %1 is already declared in the prolog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+95"/>
+ <source>The name of an option must have a prefix. There is no default namespace for options.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+171"/>
+ <source>The Schema Import feature is not supported, and therefore %1 declarations cannot occur.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>The target namespace of a %1 cannot be empty.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>The module import feature is not supported</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+52"/>
+ <source>No value is available for the external variable by name %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="-4154"/>
+ <source>A construct was encountered which only is allowed in XQuery.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+118"/>
+ <source>A template by name %1 has already been declared.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+3581"/>
+ <source>The keyword %1 cannot occur with any other mode name.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+29"/>
+ <source>The value of attribute %1 must of type %2, which %3 isn&apos;t.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+75"/>
+ <source>The prefix %1 can not be bound. By default, it is already bound to the namespace %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+312"/>
+ <source>A variable by name %1 has already been declared.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+135"/>
+ <source>A stylesheet function must have a prefixed name.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>The namespace for a user defined function cannot be empty (try the predefined prefix %1 which exists for cases like this)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>The namespace %1 is reserved; therefore user defined functions may not use it. Try the predefined prefix %2, which exists for these cases.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+12"/>
+ <source>The namespace of a user defined function in a library module must be equivalent to the module namespace. In other words, it should be %1 instead of %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+34"/>
+ <source>A function already exists with the signature %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+23"/>
+ <source>No external functions are supported. All supported functions can be used directly, without first declaring them as external</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+37"/>
+ <source>An argument by name %1 has already been declared. Every argument name must be unique.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+179"/>
+ <source>When function %1 is used for matching inside a pattern, the argument must be a variable reference or a string literal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>In an XSL-T pattern, the first argument to function %1 must be a string literal, when used for matching.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+14"/>
+ <source>In an XSL-T pattern, the first argument to function %1 must be a literal or a variable reference, when used for matching.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>In an XSL-T pattern, function %1 cannot have a third argument.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>In an XSL-T pattern, only function %1 and %2, not %3, can be used for matching.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+63"/>
+ <source>In an XSL-T pattern, axis %1 cannot be used, only axis %2 or %3 can.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+126"/>
+ <source>%1 is an invalid template mode name.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+44"/>
+ <source>The name of a variable bound in a for-expression must be different from the positional variable. Hence, the two variables named %1 collide.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+758"/>
+ <source>The Schema Validation Feature is not supported. Hence, %1-expressions may not be used.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+39"/>
+ <source>None of the pragma expressions are supported. Therefore, a fallback expression must be present</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+267"/>
+ <source>Each name of a template parameter must be unique; %1 is duplicated.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+129"/>
+ <source>The %1-axis is unsupported in XQuery</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1150"/>
+ <source>%1 is not a valid name for a processing-instruction.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="-7029"/>
+ <source>%1 is not a valid numeric literal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+6165"/>
+ <source>No function by name %1 is available.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+102"/>
+ <source>The namespace URI cannot be the empty string when binding to a prefix, %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>%1 is an invalid namespace URI.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>It is not possible to bind to the prefix %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Namespace %1 can only be bound to %2 (and it is, in either case, pre-declared).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>Prefix %1 can only be bound to %2 (and it is, in either case, pre-declared).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>Two namespace declaration attributes have the same name: %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+89"/>
+ <source>The namespace URI must be a constant and cannot use enclosed expressions.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>An attribute by name %1 has already appeared on this element.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+61"/>
+ <source>A direct element constructor is not well-formed. %1 is ended with %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+458"/>
+ <source>The name %1 does not refer to any schema type.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>%1 is an complex type. Casting to complex types is not possible. However, casting to atomic types such as %2 works.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>%1 is not an atomic type. Casting is only possible to atomic types.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+145"/>
+ <location line="+71"/>
+ <source>%1 is not in the in-scope attribute declarations. Note that the schema import feature is not supported.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+48"/>
+ <source>The name of an extension expression must be in a namespace.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/type/qcardinality.cpp" line="+55"/>
+ <source>empty</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>zero or one</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>exactly one</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>one or more</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>zero or more</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/type/qtypechecker.cpp" line="+63"/>
+ <source>Required type is %1, but %2 was found.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+44"/>
+ <source>Promoting %1 to %2 may cause loss of precision.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+49"/>
+ <source>The focus is undefined.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/utils/qoutputvalidator.cpp" line="+86"/>
+ <source>It&apos;s not possible to add attributes after any other kind of node.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>An attribute by name %1 has already been created.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/utils/qxpathhelper_p.h" line="+120"/>
+ <source>Only the Unicode Codepoint Collation is supported(%1). %2 is unsupported.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/api/qxmlserializer.cpp" line="+60"/>
+ <source>Attribute %1 can&apos;t be serialized because it appears at the top level.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp" line="+314"/>
+ <source>%1 is an unsupported encoding.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>%1 contains octets which are disallowed in the requested encoding %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+18"/>
+ <source>The codepoint %1, occurring in %2 using encoding %3, is an invalid XML character.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qapplytemplate.cpp" line="+119"/>
+ <source>Ambiguous rule match.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qcomputednamespaceconstructor.cpp" line="+69"/>
+ <source>In a namespace constructor, the value for a namespace cannot be an empty string.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>The prefix must be a valid %1, which %2 is not.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+14"/>
+ <source>The prefix %1 cannot be bound.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>Only the prefix %1 can be bound to %2 and vice versa.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qevaluationcache.cpp" line="+117"/>
+ <source>Circularity detected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/expr/qtemplate.cpp" line="+145"/>
+ <source>The parameter %1 is required, but no corresponding %2 is supplied.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="-71"/>
+ <source>The parameter %1 is passed, but no corresponding %2 exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/functions/qunparsedtextfn.cpp" line="+65"/>
+ <source>The URI cannot have a fragment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/parser/qxslttokenizer.cpp" line="+519"/>
+ <source>Element %1 is not allowed at this location.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>Text nodes are not allowed at this location.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+20"/>
+ <source>Parse error: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+62"/>
+ <source>The value of the XSL-T version attribute must be a value of type %1, which %2 isn&apos;t.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+20"/>
+ <source>Running an XSL-T 1.0 stylesheet with a 2.0 processor.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+108"/>
+ <source>Unknown XSL-T attribute %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+23"/>
+ <source>Attribute %1 and %2 are mutually exclusive.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+166"/>
+ <source>In a simplified stylesheet module, attribute %1 must be present.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+72"/>
+ <source>If element %1 has no attribute %2, it cannot have attribute %3 or %4.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>Element %1 must have at least one of the attributes %2 or %3.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+28"/>
+ <source>At least one mode must be specified in the %1-attribute on element %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/parser/qmaintainingreader.cpp" line="+183"/>
+ <source>Attribute %1 cannot appear on the element %2. Only the standard attributes can appear.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Attribute %1 cannot appear on the element %2. Only %3 is allowed, and the standard attributes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>Attribute %1 cannot appear on the element %2. Allowed is %3, %4, and the standard attributes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>Attribute %1 cannot appear on the element %2. Allowed is %3, and the standard attributes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>XSL-T attributes on XSL-T elements must be in the null namespace, not in the XSL-T namespace which %1 is.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+12"/>
+ <source>The attribute %1 must appear on element %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>The element with local name %1 does not exist in XSL-T.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/xmlpatterns/parser/qxslttokenizer.cpp" line="+123"/>
+ <source>Element %1 must come last.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+24"/>
+ <source>At least one %1-element must occur before %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Only one %1-element can appear.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+31"/>
+ <source>At least one %1-element must occur inside %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+58"/>
+ <source>When attribute %1 is present on %2, a sequence constructor cannot be used.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>Element %1 must have either a %2-attribute or a sequence constructor.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+125"/>
+ <source>When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+270"/>
+ <source>Element %1 cannot have children.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+434"/>
+ <source>Element %1 cannot have a sequence constructor.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+86"/>
+ <location line="+9"/>
+ <source>The attribute %1 cannot appear on %2, when it is a child of %3.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+15"/>
+ <source>A parameter in a function cannot be declared to be a tunnel.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+149"/>
+ <source>This processor is not Schema-aware and therefore %1 cannot be used.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+57"/>
+ <source>Top level stylesheet elements must be in a non-null namespace, which %1 isn&apos;t.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+48"/>
+ <source>The value for attribute %1 on element %2 must either be %3 or %4, not %5.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+20"/>
+ <source>Attribute %1 cannot have the value %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+58"/>
+ <source>The attribute %1 can only appear on the first %2 element.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+99"/>
+ <source>At least one %1 element must appear as child of %2.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>VolumeSlider</name>
+ <message>
+ <location filename="../src/3rdparty/phonon/phonon/volumeslider.cpp" line="+67"/>
+ <source>Muted</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <location line="+15"/>
+ <source>Volume: %1%</source>
+ <translation>Lydstyrke: %1%</translation>
+ </message>
+</context>
+</TS>
diff --git a/translations/qt_de.ts b/translations/qt_de.ts
index 33f9ea8..f623925 100644
--- a/translations/qt_de.ts
+++ b/translations/qt_de.ts
@@ -66,15 +66,15 @@
<location filename="../src/3rdparty/phonon/gstreamer/backend.cpp" line="+171"/>
<source>Warning: You do not seem to have the package gstreamer0.10-plugins-good installed.
Some video features have been disabled.</source>
- <translation>Warnung: Das Paket gstreamer0.10-plugins-good ist nicht installiert.
-Einige Video-Funktionen stehen nicht zur Verfügung.</translation>
+ <translation>Achtung: Das Paket gstreamer0.10-plugins-good ist nicht installiert.
+Einige Video-Funktionen stehen nicht zur Verfügung.</translation>
</message>
<message>
<location line="+5"/>
<source>Warning: You do not seem to have the base GStreamer plugins installed.
All audio and video support has been disabled</source>
- <translation>Warnung: Die grundlegenden GStreamer-plugins sind nicht installiert.
-Die Audio- und Video-Unterstützung wurde abgeschaltet</translation>
+ <translation>Achtung: Die grundlegenden GStreamer-Plugins sind nicht installiert.
+Die Audio- und Video-Unterstützung steht nicht zur Verfügung.</translation>
</message>
</context>
<context>
@@ -85,7 +85,7 @@ Die Audio- und Video-Unterstützung wurde abgeschaltet</translation>
Check your Gstreamer installation and make sure you
have libgstreamer-plugins-base installed.</source>
- <translation>Das Abspielen konnte nicht gestartet werden.
+ <translation>Die Wiedergabe kann nicht gestartet werden.
Bitte prüfen Sie die Gstreamer-Installation und stellen Sie sicher, dass das Paket libgstreamer-plugins-base installiert ist.</translation>
</message>
<message>
@@ -139,7 +139,7 @@ Bitte prüfen Sie die Gstreamer-Installation und stellen Sie sicher, dass das Pa
<location line="+18"/>
<location line="+54"/>
<source>Use this slider to adjust the volume. The leftmost position is 0%, the rightmost is %1%</source>
- <translation>Die Regler wird zur Einstellung der Lautstärke benutzt. Die Position links entspricht 0%; die Position rechts entspricht %1%</translation>
+ <translation>Mit diesem Regler stellen Sie die Lautstärke ein. Die Position links entspricht 0%; die Position rechts entspricht %1%</translation>
</message>
</context>
<context>
@@ -291,12 +291,12 @@ Bitte prüfen Sie die Gstreamer-Installation und stellen Sie sicher, dass das Pa
<message>
<location line="+9"/>
<source>Preview File Info</source>
- <translation>Voransicht der Datei-Information</translation>
+ <translation>Vorschau der Datei-Informationen</translation>
</message>
<message>
<location line="+23"/>
<source>Preview File Contents</source>
- <translation>Voransicht des Datei-Inhalts</translation>
+ <translation>Vorschau des Datei-Inhalts</translation>
</message>
<message>
<location line="+88"/>
@@ -392,7 +392,7 @@ Bitte prüfen Sie die Gstreamer-Installation und stellen Sie sicher, dass das Pa
<message>
<location line="+4"/>
<source>Sort by &amp;Name</source>
- <translation>Nach &amp;Name sortieren</translation>
+ <translation>Nach &amp;Namen sortieren</translation>
</message>
<message>
<location line="+2"/>
@@ -497,7 +497,7 @@ Bitte prüfen Sie die Gstreamer-Installation und stellen Sie sicher, dass das Pa
File not found.
Check path and filename.</source>
<translation>%1
-Datei konnte nicht gefunden werden.
+Datei kann nicht gefunden werden.
Überprüfen Sie Pfad und Dateinamen.</translation>
</message>
<message>
@@ -617,7 +617,7 @@ nach
<message>
<location line="+45"/>
<source>Defaults</source>
- <translation>Defaults</translation>
+ <translation>Voreinstellungen</translation>
</message>
<message>
<location line="+50"/>
@@ -699,7 +699,7 @@ nach
<message>
<location line="+18"/>
<source>Contains commands to manipulate the window</source>
- <translation>Enthält Befehle zum Ändern der Fenstergröße </translation>
+ <translation>Enthält Befehle zum Ändern der Fenstergröße</translation>
</message>
<message>
<location line="+3"/>
@@ -772,18 +772,18 @@ nach
<message>
<location line="+3"/>
<source>The protocol `%1&apos; does not support getting files</source>
- <translation>Das Protokoll `%1&apos; unterstützt nicht das Laden von Files</translation>
+ <translation>Das Protokoll `%1&apos; unterstützt nicht das Laden von Dateien</translation>
</message>
<message>
<location line="+3"/>
<source>The protocol `%1&apos; does not support putting files</source>
- <translation>Das Protokoll `%1&apos; unterstützt nicht das Speichern von Files</translation>
+ <translation>Das Protokoll `%1&apos; unterstützt nicht das Speichern von Dateien</translation>
</message>
<message>
<location line="+243"/>
<location line="+4"/>
<source>The protocol `%1&apos; does not support copying or moving files or directories</source>
- <translation> Das Protokoll `%1&apos; unterstützt nicht das Kopieren oder Verschieben von Dateien oder Verzeichnissen</translation>
+ <translation>Das Protokoll `%1&apos; unterstützt nicht das Kopieren oder Verschieben von Dateien oder Verzeichnissen</translation>
</message>
<message>
<location line="+237"/>
@@ -847,7 +847,7 @@ nach
<location line="+787"/>
<location line="+208"/>
<source>Operation on socket is not supported</source>
- <translation>Diese Socketoperation wird nicht unterstützt</translation>
+ <translation>Diese Socket-Operation wird nicht unterstützt</translation>
</message>
<message>
<location line="+137"/>
@@ -899,7 +899,7 @@ nach
<message>
<location line="+2"/>
<source>Incompatible Qt Library Error</source>
- <translation>Qt Bibliothek ist inkompatibel</translation>
+ <translation>Die Qt-Bibliothek ist inkompatibel</translation>
</message>
<message>
<location filename="../src/gui/accessible/qaccessibleobject.cpp" line="+376"/>
@@ -909,7 +909,7 @@ nach
<message>
<location line="+2"/>
<source>Activates the program&apos;s main window</source>
- <translation>Aktiviert das Programmhauptfenster</translation>
+ <translation>Aktiviert das Hauptfenster der Anwendung</translation>
</message>
</context>
<context>
@@ -1066,17 +1066,17 @@ nach
<message>
<location line="+303"/>
<source>Unable to commit transaction</source>
- <translation>Die Transaktion konnte nicht durchgeführt werden (Operation &apos;commit&apos; fehlgeschlagen)</translation>
+ <translation>Die Transaktion kann nicht durchgeführt werden (Operation &apos;commit&apos; fehlgeschlagen)</translation>
</message>
<message>
<location line="+17"/>
<source>Unable to rollback transaction</source>
- <translation>Die Transaktion konnte nicht rückgängig gemacht werden (Operation &apos;rollback&apos; fehlgeschlagen)</translation>
+ <translation>Die Transaktion kann nicht rückgängig gemacht werden (Operation &apos;rollback&apos; fehlgeschlagen)</translation>
</message>
<message>
<location line="+15"/>
<source>Unable to set autocommit</source>
- <translation>&apos;autocommit&apos; konnte nicht aktiviert werden</translation>
+ <translation>&apos;autocommit&apos; kann nicht aktiviert werden</translation>
</message>
</context>
<context>
@@ -1085,32 +1085,32 @@ nach
<location line="-1043"/>
<location line="+243"/>
<source>Unable to execute statement</source>
- <translation>Der Befehl konnte nicht ausgeführt werden</translation>
+ <translation>Der Befehl kann nicht ausgeführt werden</translation>
</message>
<message>
<location line="-206"/>
<source>Unable to prepare statement</source>
- <translation>Der Befehl konnte nicht initialisiert werden</translation>
+ <translation>Der Befehl kann nicht initialisiert werden</translation>
</message>
<message>
<location line="+196"/>
<source>Unable to bind variable</source>
- <translation>Die Variable konnte nicht gebunden werden</translation>
+ <translation>Die Variable kann nicht gebunden werden</translation>
</message>
<message>
<location line="+92"/>
<source>Unable to fetch record %1</source>
- <translation>Der Datensatz %1 konnte nicht abgeholt werden</translation>
+ <translation>Der Datensatz %1 kann nicht abgeholt werden</translation>
</message>
<message>
<location line="+17"/>
<source>Unable to fetch next</source>
- <translation>Der nächste Datensatz konnte nicht abgeholt werden</translation>
+ <translation>Der nächste Datensatz kann nicht abgeholt werden</translation>
</message>
<message>
<location line="+20"/>
<source>Unable to fetch first</source>
- <translation>Der erste Datensatz konnte nicht abgeholt werden</translation>
+ <translation>Der erste Datensatz kann nicht abgeholt werden</translation>
</message>
</context>
<context>
@@ -1358,7 +1358,7 @@ nach
<message>
<location filename="../src/gui/dialogs/qerrormessage.cpp" line="+391"/>
<source>&amp;Show this message again</source>
- <translation>Diese Meldung noch einmal an&amp;zeigen</translation>
+ <translation>Diese Meldung wieder an&amp;zeigen</translation>
</message>
<message>
<location line="+1"/>
@@ -1373,7 +1373,7 @@ nach
<message>
<location line="+3"/>
<source>Warning:</source>
- <translation>Warnung:</translation>
+ <translation>Achtung:</translation>
</message>
<message>
<location line="+3"/>
@@ -1397,12 +1397,12 @@ nach
<message>
<location line="+120"/>
<source>Cannot open %1 for input</source>
- <translation>%1 konnte nicht zum Lesen geöffnet werden</translation>
+ <translation>%1 kann nicht zum Lesen geöffnet werden</translation>
</message>
<message>
<location line="+17"/>
<source>Cannot open for output</source>
- <translation>Das Öffnen zum Schreiben schlug fehl</translation>
+ <translation>Das Öffnen zum Schreiben ist fehlgeschlagen</translation>
</message>
<message>
<location line="+10"/>
@@ -1565,12 +1565,12 @@ Stellen Sie sicher, dass der Verzeichnisname richtig ist.</translation>
<source>&apos;%1&apos; is write protected.
Do you want to delete it anyway?</source>
<translation>&apos;%1&apos; ist schreibgeschützt.
-Möchten sie die Datei trotzdem löschen?</translation>
+Möchten Sie die Datei trotzdem löschen?</translation>
</message>
<message>
<location line="+5"/>
<source>Are sure you want to delete &apos;%1&apos;?</source>
- <translation>Sind Sie sicher, dass Sie %1 löschen möchten?</translation>
+ <translation>Sind Sie sicher, dass Sie &apos;%1&apos; löschen möchten?</translation>
</message>
<message>
<location line="+15"/>
@@ -1624,7 +1624,7 @@ Möchten sie die Datei trotzdem löschen?</translation>
<location filename="../src/gui/dialogs/qfiledialog.ui"/>
<location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
<source>Look in:</source>
- <translation>Suche in:</translation>
+ <translation>Suchen in:</translation>
</message>
<message>
<location/>
@@ -1658,7 +1658,7 @@ Möchten sie die Datei trotzdem löschen?</translation>
<message>
<location line="+1"/>
<source>%1 bytes</source>
- <translation>%1 byte</translation>
+ <translation>%1 Byte</translation>
</message>
<message>
<location line="+77"/>
@@ -1887,12 +1887,12 @@ Möchten sie die Datei trotzdem löschen?</translation>
<message>
<location line="+3"/>
<source>Simplified Chinese</source>
- <translation>Vereinfachtes Chinesisch</translation>
+ <translation>Chinesisch (Kurzzeichen)</translation>
</message>
<message>
<location line="+3"/>
<source>Traditional Chinese</source>
- <translation>Traditionelles Chinesisch</translation>
+ <translation>Chinesisch (Langzeichen)</translation>
</message>
<message>
<location line="+3"/>
@@ -2296,7 +2296,7 @@ Möchten sie die Datei trotzdem löschen?</translation>
<message>
<location line="+6"/>
<source>SSL handshake failed</source>
- <translation>Es trat ein Fehler im Ablauf des SSL-Protokolls auf.</translation>
+ <translation>Im Ablauf des SSL-Protokolls ist ein Fehler aufgetreten.</translation>
</message>
<message>
<location line="-3"/>
@@ -2580,7 +2580,7 @@ Möchten sie die Datei trotzdem löschen?</translation>
<message>
<location line="+43"/>
<source>The plugin &apos;%1&apos; uses incompatible Qt library. (Cannot mix debug and release libraries.)</source>
- <translation>Das Plugin &apos;%1&apos; verwendet eine inkompatible Qt-Bibliothek. (Im Debug- und Release-Modus erstellte Bibliotheken können nicht zusammen verwendet werden.)</translation>
+ <translation>Das Plugin &apos;%1&apos; verwendet eine inkompatible Qt-Bibliothek. (Im Debug- bzw. Release-Modus erstellte Bibliotheken können nicht zusammen verwendet werden.)</translation>
</message>
<message>
<location filename="../src/corelib/plugin/qlibrary_unix.cpp" line="+209"/>
@@ -2670,7 +2670,7 @@ Möchten sie die Datei trotzdem löschen?</translation>
<location filename="../src/network/socket/qlocalsocket_tcp.cpp" line="+132"/>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+134"/>
<source>%1: Connection refused</source>
- <translation>%1: Der Aufbau einer Verbindung wurde verweigert</translation>
+ <translation>%1: Der Verbindungsaufbau wurde verweigert</translation>
</message>
<message>
<location line="+3"/>
@@ -2696,13 +2696,13 @@ Möchten sie die Datei trotzdem löschen?</translation>
<location line="+3"/>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
<source>%1: Socket resource error</source>
- <translation>%1: Socketfehler (Ressourcenproblem)</translation>
+ <translation>%1: Socket-Fehler (Ressourcenproblem)</translation>
</message>
<message>
<location line="+3"/>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
<source>%1: Socket operation timed out</source>
- <translation>%1: Zeitüberschreitung bei Socketoperation</translation>
+ <translation>%1: Zeitüberschreitung bei Socket-Operation</translation>
</message>
<message>
<location line="+3"/>
@@ -2721,7 +2721,7 @@ Möchten sie die Datei trotzdem löschen?</translation>
<location line="+3"/>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
<source>%1: The socket operation is not supported</source>
- <translation>%1: Diese Socketoperation wird nicht unterstützt</translation>
+ <translation>%1: Diese Socket-Operation wird nicht unterstützt</translation>
</message>
<message>
<location line="+4"/>
@@ -2740,7 +2740,7 @@ Möchten sie die Datei trotzdem löschen?</translation>
<message>
<location filename="../src/sql/drivers/mysql/qsql_mysql.cpp" line="+1252"/>
<source>Unable to open database &apos;</source>
- <translation>Die Datenbankverbindung konnte nicht geöffnet werden &apos;</translation>
+ <translation>Die Datenbankverbindung kann nicht geöffnet werden &apos;</translation>
</message>
<message>
<location line="+7"/>
@@ -2750,17 +2750,17 @@ Möchten sie die Datei trotzdem löschen?</translation>
<message>
<location line="+127"/>
<source>Unable to begin transaction</source>
- <translation>Es konnte keine Transaktion gestartet werden</translation>
+ <translation>Es kann keine Transaktion gestartet werden</translation>
</message>
<message>
<location line="+17"/>
<source>Unable to commit transaction</source>
- <translation>Die Transaktion konnte nicht durchgeführt werden (Operation &apos;commit&apos; fehlgeschlagen)</translation>
+ <translation>Die Transaktion kann nicht durchgeführt werden (Operation &apos;commit&apos; fehlgeschlagen)</translation>
</message>
<message>
<location line="+17"/>
<source>Unable to rollback transaction</source>
- <translation>Die Transaktion konnte nicht rückgängig gemacht werden (Operation &apos;rollback&apos; fehlgeschlagen)</translation>
+ <translation>Die Transaktion kann nicht rückgängig gemacht werden (Operation &apos;rollback&apos; fehlgeschlagen)</translation>
</message>
</context>
<context>
@@ -3422,7 +3422,7 @@ Möchten sie die Datei trotzdem löschen?</translation>
<message>
<location line="+31"/>
<source>Socket error on %1: %2</source>
- <translation>Socketfehler bei %1: %2</translation>
+ <translation>Socket-Fehler bei %1: %2</translation>
</message>
<message>
<location line="+15"/>
@@ -3815,7 +3815,7 @@ Möchten sie die Datei trotzdem löschen?</translation>
<message>
<location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="-357"/>
<source>Print To File ...</source>
- <translation>In Datei drucken</translation>
+ <translation>In Datei drucken ...</translation>
</message>
<message>
<location line="+80"/>
@@ -4022,12 +4022,12 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
<message>
<location line="+253"/>
<source>Print to File (PDF)</source>
- <translation>Druck in PDF-Datei</translation>
+ <translation>In PDF-Datei drucken</translation>
</message>
<message>
<location line="+1"/>
<source>Print to File (Postscript)</source>
- <translation>Druck in Postscript-Datei</translation>
+ <translation>In Postscript-Datei drucken</translation>
</message>
<message>
<location line="+47"/>
@@ -4967,97 +4967,97 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
<message>
<location line="+1"/>
<source>Open URL</source>
- <translation>Öffne URL</translation>
+ <translation>URL öffnen</translation>
</message>
<message>
<location line="+1"/>
<source>Launch Mail</source>
- <translation>Start Mail</translation>
+ <translation>Mail starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch Media</source>
- <translation>Start Media Player</translation>
+ <translation>Medienspieler starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (0)</source>
- <translation>Start (0)</translation>
+ <translation>(0) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (1)</source>
- <translation>Start (1)</translation>
+ <translation>(1) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (2)</source>
- <translation>Start (2)</translation>
+ <translation>(2) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (3)</source>
- <translation>Start (3)</translation>
+ <translation>(3) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (4)</source>
- <translation>Start (4)</translation>
+ <translation>(4) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (5)</source>
- <translation>Start (5)</translation>
+ <translation>(5) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (6)</source>
- <translation>Start (6)</translation>
+ <translation>(6) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (7)</source>
- <translation>Start (7)</translation>
+ <translation>(7) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (8)</source>
- <translation>Start (8)</translation>
+ <translation>(8) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (9)</source>
- <translation>Start (9)</translation>
+ <translation>(9) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (A)</source>
- <translation>Start (A)</translation>
+ <translation>(A) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (B)</source>
- <translation>Start (B)</translation>
+ <translation>(B) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (C)</source>
- <translation>Start (C)</translation>
+ <translation>(C) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (D)</source>
- <translation>Start (D)</translation>
+ <translation>(D) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (E)</source>
- <translation>Start (E)</translation>
+ <translation>(E) starten</translation>
</message>
<message>
<location line="+1"/>
<source>Launch (F)</source>
- <translation>Start (F)</translation>
+ <translation>(F) starten</translation>
</message>
<message>
<location line="+4"/>
@@ -5385,12 +5385,12 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
<message>
<location line="+119"/>
<source>Error while reading: %1</source>
- <translation>Beim Lesen trat ein Fehler auf: %1</translation>
+ <translation>Beim Lesen ist ein Fehler aufgetreten: %1</translation>
</message>
<message>
<location line="+96"/>
<source>Error during SSL handshake: %1</source>
- <translation>Es trat ein Fehler im Ablauf des SSL-Protokolls auf: %1</translation>
+ <translation>Im Ablauf des SSL-Protokolls ist ein Fehler aufgetreten: %1</translation>
</message>
<message>
<location line="-524"/>
@@ -5455,7 +5455,7 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
<message>
<location line="+4"/>
<source>%1: already exists</source>
- <translation>%1: existiert bereits</translation>
+ <translation>%1: Existiert bereits</translation>
</message>
<message>
<location line="+13"/>
@@ -5469,7 +5469,7 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
<message>
<location filename="../src/sql/drivers/tds/qsql_tds.cpp" line="+584"/>
<source>Unable to open connection</source>
- <translation>Die Datenbankverbindung konnte nicht geöffnet werden</translation>
+ <translation>Die Datenbankverbindung kann nicht geöffnet werden</translation>
</message>
<message>
<location line="+5"/>
@@ -5495,7 +5495,7 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
<message>
<location filename="../src/network/socket/qtcpserver.cpp" line="+282"/>
<source>Operation on socket is not supported</source>
- <translation>Diese Socketoperation wird nicht unterstützt</translation>
+ <translation>Diese Socket-Operation wird nicht unterstützt</translation>
</message>
</context>
<context>
@@ -7342,7 +7342,7 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
<message>
<location line="+9"/>
<source>%1 is not an atomic type. Casting is only possible to atomic types.</source>
- <translation>%1 ist kein atomarer Typ. Es können nur &quot;cast&quot;-Operation zu atomaren Typen durchgeführt werden.</translation>
+ <translation>%1 ist kein atomarer Typ. &quot;cast&quot;-Operation können nur zu atomaren Typen durchgeführt werden.</translation>
</message>
<message>
<location line="+76"/>
@@ -7397,17 +7397,17 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
<message>
<location filename="../src/xmlpatterns/data/qatomicmathematicians.cpp" line="-180"/>
<source>Integer division (%1) by zero (%2) is undefined.</source>
- <translation>Die Ganzzahldivision (%1) durch Null (%2) ist nicht definiert.</translation>
+ <translation>Die Ganzzahldivision (%1) durch Null (%2) ist nicht definiert.</translation>
</message>
<message>
<location line="+7"/>
<source>Division (%1) by zero (%2) is undefined.</source>
- <translation>Die Division (%1) durch Null (%2) ist nicht definiert.</translation>
+ <translation>Die Division (%1) durch Null (%2) ist nicht definiert.</translation>
</message>
<message>
<location line="+7"/>
<source>Modulus division (%1) by zero (%2) is undefined.</source>
- <translation>Die Modulo-Division (%1) durch Null (%2) ist nicht definiert.</translation>
+ <translation>Die Modulo-Division (%1) durch Null (%2) ist nicht definiert.</translation>
</message>
<message>
<location filename="../src/xmlpatterns/expr/qcastingplatform.cpp" line="-73"/>
@@ -7443,13 +7443,13 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
<message>
<location filename="../src/xmlpatterns/parser/qquerytransformparser.cpp" line="-3102"/>
<source>The namespace for a user defined function cannot be empty (try the predefined prefix %1 which exists for cases like this)</source>
- <translation>Der Namensraum einer nutzerdefinierten Funktion darf nicht leer sein (für diesen Zweck gibt es den vordefinierten Präfix %1)</translation>
+ <translation>Der Namensraum einer benutzerdefinierten Funktion darf nicht leer sein (für diesen Zweck gibt es den vordefinierten Präfix %1)</translation>
</message>
<message>
<location line="-693"/>
<location line="+10"/>
<source>A default namespace declaration must occur before function, variable, and option declarations.</source>
- <translation>Die Deklaration des Default-Namensraums muss vor Funktions- Variablen- oder Optionsdeklaration erfolgen.</translation>
+ <translation>Die Deklaration des Default-Namensraums muss vor Funktions-, Variablen- oder Optionsdeklaration erfolgen.</translation>
</message>
<message>
<location line="-3576"/>
diff --git a/translations/qt_help_da.ts b/translations/qt_help_da.ts
new file mode 100644
index 0000000..73609a1
--- /dev/null
+++ b/translations/qt_help_da.ts
@@ -0,0 +1,387 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="he">
+<context>
+ <name>QCLuceneResultWidget</name>
+ <message>
+ <location filename="../tools/assistant/lib/qhelpsearchresultwidget.cpp" line="+110"/>
+ <source>Search Results</source>
+ <translation>Søgeresultater</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Note:</source>
+ <translation>Bemærk:</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>The search results may not be complete since the documentation is still being indexed!</source>
+ <translation>Søgeresultaterne kan være ufuldstændige, fordi dokumentationen stadig indekseres!</translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>Your search did not match any documents.</source>
+ <translation>Søgningen matchede ikke nogen dokumenter.</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>(The reason for this might be that the documentation is still being indexed.)</source>
+ <translation>(Årsagen kan være, at dokumentationen stadig indekseres.)</translation>
+ </message>
+</context>
+<context>
+ <name>QHelpCollectionHandler</name>
+ <message>
+ <location filename="../tools/assistant/lib/qhelpcollectionhandler.cpp" line="+79"/>
+ <source>The collection file is not set up yet!</source>
+ <translation>Hjælpesamlingen er ikke konfigureret endnu!</translation>
+ </message>
+ <message>
+ <location line="+22"/>
+ <source>Cannot load sqlite database driver!</source>
+ <translation>Kan ikke indlæse sqlite database-driver!</translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <location line="+48"/>
+ <source>Cannot open collection file: %1</source>
+ <translation>Kan ikke åbne hjælpesamlingen: %1</translation>
+ </message>
+ <message>
+ <location line="-39"/>
+ <source>Cannot create tables in file %1!</source>
+ <translation>Kan ikke oprette tabler i filen %1!</translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>The specified collection file already exists!</source>
+ <translation>Den angivne hjælpesamling findes allerede!</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Cannot create directory: %1</source>
+ <translation>Kan ikke oprette kataloget: %1</translation>
+ </message>
+ <message>
+ <location line="+23"/>
+ <source>Cannot copy collection file: %1</source>
+ <translation>Kan ikke kopiere hjælpesamling: %1</translation>
+ </message>
+ <message>
+ <location line="+119"/>
+ <source>Unknown filter!</source>
+ <translation>Ukendt filter!</translation>
+ </message>
+ <message>
+ <location line="+55"/>
+ <source>Cannot register filter %1!</source>
+ <translation>Kan ikke registrere filteret %1!</translation>
+ </message>
+ <message>
+ <location line="+44"/>
+ <source>Cannot open documentation file %1!</source>
+ <translation>Kan ikke åbne dokumentationsfilen %1!</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Invalid documentation file!</source>
+ <translation>Ugyldig dokumentationsfil!</translation>
+ </message>
+ <message>
+ <location line="+34"/>
+ <source>The namespace %1 was not registered!</source>
+ <translation>Navnerummet %1 blev ikke registreret!</translation>
+ </message>
+ <message>
+ <location line="+120"/>
+ <source>Namespace %1 already exists!</source>
+ <translation>Navnerummet %1 findes allerede!</translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>Cannot register namespace!</source>
+ <translation>Kan ikke registrere navnerummet!</translation>
+ </message>
+ <message>
+ <location line="+24"/>
+ <source>Cannot open database to optimize!</source>
+ <translation>Kan ikke åbne den database, der skal optimeres!</translation>
+ </message>
+</context>
+<context>
+ <name>QHelpDBReader</name>
+ <message>
+ <source>Cannot open DB!</source>
+ <translation type="obsolete">Kan ikke åbne DB!</translation>
+ </message>
+ <message>
+ <location filename="../tools/assistant/lib/qhelpdbreader.cpp" line="+95"/>
+ <source>Cannot open database &apos;%1&apos; &apos;%2&apos;: %3</source>
+ <translation>Kan ikke åbne database &apos;%1&apos; &apos;%2&apos;: %3</translation>
+ </message>
+</context>
+<context>
+ <name>QHelpEngineCore</name>
+ <message>
+ <location filename="../tools/assistant/lib/qhelpenginecore.cpp" line="+516"/>
+ <source>The specified namespace does not exist!</source>
+ <translation>Det angivne navnerum findes ikke!</translation>
+ </message>
+</context>
+<context>
+ <name>QHelpEngineCorePrivate</name>
+ <message>
+ <location line="-394"/>
+ <source>Cannot open documentation file %1: %2!</source>
+ <translation>Kan ikke åbne dokumentationsfil %1: %2!</translation>
+ </message>
+ <message>
+ <source>Cannot open collection file %1!</source>
+ <translation type="obsolete">Kan ikke åbne hjælpesamlingen %1!</translation>
+ </message>
+ <message>
+ <source>Cannot open documentation file %1!</source>
+ <translation type="obsolete">Kan ikke åbne dokumentationsfilen %1!</translation>
+ </message>
+</context>
+<context>
+ <name>QHelpGenerator</name>
+ <message>
+ <location filename="../tools/assistant/lib/qhelpgenerator.cpp" line="+157"/>
+ <source>Invalid help data!</source>
+ <translation>Ugyldigt hjælpedata!</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>No output file name specified!</source>
+ <translation>Der er ikke anført et output-filnavn!</translation>
+ </message>
+ <message>
+ <source>The file %1 already exists!</source>
+ <translation type="obsolete">Filen %1 findes allerede!</translation>
+ </message>
+ <message>
+ <location line="+14"/>
+ <source>Building up file structure...</source>
+ <translation>Bygger filstruktur...</translation>
+ </message>
+ <message>
+ <source>Cannot open DB!</source>
+ <translation type="obsolete">Kan ikke åbne DB!</translation>
+ </message>
+ <message>
+ <location line="-7"/>
+ <source>The file %1 cannot be overwritten!</source>
+ <translation>Filen %1 kan ikke overskrives!</translation>
+ </message>
+ <message>
+ <location line="+18"/>
+ <source>Cannot open data base file %1!</source>
+ <translation>Kan ikke åbne databasefil %1!</translation>
+ </message>
+ <message>
+ <location line="+11"/>
+ <source>Cannot register namespace %1!</source>
+ <translation>Kan ikke registrere navnerummet %1!</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Insert custom filters...</source>
+ <translation>Indsæt brugerdefinerede filtre...</translation>
+ </message>
+ <message>
+ <location line="+12"/>
+ <source>Insert help data for filter section (%1 of %2)...</source>
+ <translation>Indsæt hjælpedata til filtersektion (%1 af %2)...</translation>
+ </message>
+ <message>
+ <location line="+18"/>
+ <source>Documentation successfully generated.</source>
+ <translation>Dokumentationen blev genereret.</translation>
+ </message>
+ <message>
+ <location line="+76"/>
+ <source>Some tables already exist!</source>
+ <translation>Nogle af tabellerne findes allerede!</translation>
+ </message>
+ <message>
+ <location line="+61"/>
+ <source>Cannot create tables!</source>
+ <translation>Kan ikke oprette tabeller!</translation>
+ </message>
+ <message>
+ <location line="+86"/>
+ <source>Cannot register virtual folder!</source>
+ <translation>Kan ikke registrere virtuel mappe!</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>Insert files...</source>
+ <translation>Indsæt filer...</translation>
+ </message>
+ <message>
+ <location line="+41"/>
+ <source>The file %1 does not exist! Skipping it.</source>
+ <translation>Filen %1 findes ikke, og den springes over.</translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Cannot open file %1! Skipping it.</source>
+ <translation>Kan ikke åbne filen %1, og den springes over.</translation>
+ </message>
+ <message>
+ <source>Cannot insert file data into database!</source>
+ <translation type="obsolete">Kan ikke indsætte fildata i databasen!</translation>
+ </message>
+ <message>
+ <location line="+134"/>
+ <source>The filter %1 is already registered!</source>
+ <translation>Filtret %1 er allerede registreret!</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Cannot register filter %1!</source>
+ <translation>Kan ikke registrere filtret %1!</translation>
+ </message>
+ <message>
+ <location line="+24"/>
+ <source>Insert indices...</source>
+ <translation>Indsæt indeks...</translation>
+ </message>
+ <message>
+ <location line="+80"/>
+ <source>Insert contents...</source>
+ <translation>Indsæt indhold...</translation>
+ </message>
+ <message>
+ <location line="+8"/>
+ <source>Cannot insert contents!</source>
+ <translation>Kan ikke indsætte indhold!</translation>
+ </message>
+ <message>
+ <location line="+12"/>
+ <source>Cannot register contents!</source>
+ <translation>Kan ikke registrere indhold!</translation>
+ </message>
+</context>
+<context>
+ <name>QHelpSearchQueryWidget</name>
+ <message>
+ <location filename="../tools/assistant/lib/qhelpsearchquerywidget.cpp" line="+200"/>
+ <source>Search for:</source>
+ <translation>Søg efter:</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Search</source>
+ <translation>Søg</translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>Advanced search</source>
+ <translation>Avanceret søgning</translation>
+ </message>
+ <message>
+ <location line="+18"/>
+ <source>words &lt;B&gt;similar&lt;/B&gt; to:</source>
+ <translation>ord &lt;B&gt;tilsvarende&lt;/B&gt;:</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>&lt;B&gt;without&lt;/B&gt; the words:</source>
+ <translation>&lt;B&gt;uden&lt;/B&gt; ordene:</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>with &lt;B&gt;exact phrase&lt;/B&gt;:</source>
+ <translation>med den &lt;B&gt;eksakte sætning&lt;/B&gt;:</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>with &lt;B&gt;all&lt;/B&gt; of the words:</source>
+ <translation>med &lt;B&gt;alle&lt;/B&gt; ordene:</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>with &lt;B&gt;at least one&lt;/B&gt; of the words:</source>
+ <translation>med &lt;B&gt;mindst ét&lt;/B&gt; af ordene:</translation>
+ </message>
+</context>
+<context>
+ <name>QHelpSearchResultWidget</name>
+ <message>
+ <location filename="../tools/assistant/lib/qhelpsearchresultwidget.cpp" line="+235"/>
+ <source>0 - 0 of 0 Hits</source>
+ <translation>0 - 0 af 0 Hits</translation>
+ </message>
+</context>
+<context>
+ <name>QHelpSearchResultWidgetPrivate</name>
+ <message>
+ <location line="-61"/>
+ <source>%1 - %2 of %3 Hits</source>
+ <translation>%1 - %2 af %3 Hits</translation>
+ </message>
+</context>
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="../tools/assistant/lib/qhelp_global.h" line="+83"/>
+ <source>Untitled</source>
+ <translation>Ingen titel</translation>
+ </message>
+ <message>
+ <source>Unknown token at line %1.</source>
+ <translation type="obsolete">Ukendt symbol på linie %1.</translation>
+ </message>
+ <message>
+ <source>Unknown token at line %1. Expected &quot;QtHelpProject&quot;!</source>
+ <translation type="obsolete">Ukendt symbol på linie %1. Forventet &quot;QtHelpProject&quot;!</translation>
+ </message>
+ <message>
+ <location filename="../tools/assistant/lib/qhelpprojectdata.cpp" line="+80"/>
+ <source>Unknown token.</source>
+ <translation>Ukendt token.</translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>Unknown token. Expected &quot;QtHelpProject&quot;!</source>
+ <translation>Ukendt token. Forventede &quot;QtHelpProject&quot;!</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>Error in line %1: %2</source>
+ <translation>Fejl i linie %1: %2</translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>A virtual folder must not contain a &apos;/&apos; character!</source>
+ <translation>En virtuel mappe må ikke indholde tegnet &apos;/&apos;!</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>A namespace must not contain a &apos;/&apos; character!</source>
+ <translation>Et navnerum må ikke indeholde tegnet &apos;/&apos;!</translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>Missing namespace in QtHelpProject.</source>
+ <translation>Navnerum i +++ mangler.</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Missing virtual folder in QtHelpProject</source>
+ <translation>Virtuel mappe i QtHelpProject mangler</translation>
+ </message>
+ <message>
+ <location line="+88"/>
+ <source>Missing attribute in keyword at line %1.</source>
+ <translation>Attribut i nøgleord på linie %1 mangler.</translation>
+ </message>
+ <message>
+ <location line="+83"/>
+ <source>The input file %1 could not be opened!</source>
+ <translation>Input-filen %1 kunne ikke åbnes!</translation>
+ </message>
+</context>
+</TS>
diff --git a/translations/qt_ru.qm b/translations/qt_ru.qm
index 63b7b8b..6467629 100644
--- a/translations/qt_ru.qm
+++ b/translations/qt_ru.qm
Binary files differ
diff --git a/translations/qt_ru.ts b/translations/qt_ru.ts
index 28e786b..a27b8c4 100644
--- a/translations/qt_ru.ts
+++ b/translations/qt_ru.ts
@@ -1,37 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.0">
+<TS version="2.0" language="ru_RU">
<context>
<name>AudioOutput</name>
<message>
<location filename="../src/3rdparty/phonon/phonon/audiooutput.cpp" line="+375"/>
<source>&lt;html&gt;The audio playback device &lt;b&gt;%1&lt;/b&gt; does not work.&lt;br/&gt;Falling back to &lt;b&gt;%2&lt;/b&gt;.&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;html&gt;Звуковое устройство &lt;b&gt;%1&lt;/b&gt; не работает.&lt;br/&gt;Будет использоваться &lt;b&gt;%2&lt;/b&gt;.&lt;/html&gt;</translation>
</message>
<message>
<location line="+13"/>
<source>&lt;html&gt;Switching to the audio playback device &lt;b&gt;%1&lt;/b&gt;&lt;br/&gt;which just became available and has higher preference.&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;html&gt;Переключение на звуковое устройство &lt;b&gt;%1&lt;/b&gt;&lt;br/&gt;, которое доступно и имеет высший приоритет.&lt;/html&gt;</translation>
</message>
<message>
<location line="+3"/>
<source>Revert back to device &apos;%1&apos;</source>
- <translation type="unfinished"></translation>
+ <translation>Возвращение к устройству &apos;%1&apos;</translation>
</message>
</context>
<context>
<name>CloseButton</name>
<message>
- <location filename="../src/gui/widgets/qtabbar.cpp" line="+2251"/>
+ <location filename="../src/gui/widgets/qtabbar.cpp" line="+2253"/>
<source>Close Tab</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>PPDOptionsModel</name>
- <message>
- <source>Name</source>
- <translation type="obsolete">Имя</translation>
+ <translation>Закрыть вкладку</translation>
</message>
</context>
<context>
@@ -39,32 +32,32 @@
<message>
<location filename="../src/3rdparty/phonon/phonon/phononnamespace.cpp" line="+55"/>
<source>Notifications</source>
- <translation type="unfinished"></translation>
+ <translation>Уведомления</translation>
</message>
<message>
<location line="+2"/>
<source>Music</source>
- <translation type="unfinished"></translation>
+ <translation>Музыка</translation>
</message>
<message>
<location line="+2"/>
<source>Video</source>
- <translation type="unfinished"></translation>
+ <translation>Видео</translation>
</message>
<message>
<location line="+2"/>
<source>Communication</source>
- <translation type="unfinished"></translation>
+ <translation>Общение</translation>
</message>
<message>
<location line="+2"/>
<source>Games</source>
- <translation type="unfinished"></translation>
+ <translation>Игры</translation>
</message>
<message>
<location line="+2"/>
<source>Accessibility</source>
- <translation type="unfinished"></translation>
+ <translation>Средства для людей с ограниченными возможностями</translation>
</message>
</context>
<context>
@@ -73,13 +66,15 @@
<location filename="../src/3rdparty/phonon/gstreamer/backend.cpp" line="+171"/>
<source>Warning: You do not seem to have the package gstreamer0.10-plugins-good installed.
Some video features have been disabled.</source>
- <translation type="unfinished"></translation>
+ <translation>Внимание: Похоже, пакет gstreamer0.10-plugins-good не установлен.
+ Некоторые возможности воспроизведения видео недоступны.</translation>
</message>
<message>
<location line="+5"/>
<source>Warning: You do not seem to have the base GStreamer plugins installed.
All audio and video support has been disabled</source>
- <translation type="unfinished"></translation>
+ <translation>Внимание: Похоже, основной модуль GStreamer не установлен.
+ Поддержка видео и аудио невозможна</translation>
</message>
</context>
<context>
@@ -90,12 +85,15 @@
Check your Gstreamer installation and make sure you
have libgstreamer-plugins-base installed.</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно начать воспроизведение.
+
+Проверьте установку Gstreamer и убедитесь,
+что пакет libgstreamer-plugins-base установлен.</translation>
</message>
<message>
<location line="+113"/>
<source>A required codec is missing. You need to install the following codec(s) to play this content: %0</source>
- <translation type="unfinished"></translation>
+ <translation>Отсутствует необходимый кодек. Вам нужно установить следующие кодеки для воспроизведения данного содержимого: %0</translation>
</message>
<message>
<location line="+676"/>
@@ -107,27 +105,27 @@ have libgstreamer-plugins-base installed.</source>
<location line="+335"/>
<location line="+24"/>
<source>Could not open media source.</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось открыть источник медиа-данных.</translation>
</message>
<message>
<location line="-403"/>
<source>Invalid source type.</source>
- <translation type="unfinished"></translation>
+ <translation>Неверный тип источника медиа-данных.</translation>
</message>
<message>
<location line="+377"/>
<source>Could not locate media source.</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось найти источник медиа-данных.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not open audio device. The device is already in use.</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось открыть звуковое устройство. Устройство уже используется.</translation>
</message>
<message>
<location line="+13"/>
<source>Could not decode media source.</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось декодировать источник медиа-данных.</translation>
</message>
</context>
<context>
@@ -136,14 +134,14 @@ have libgstreamer-plugins-base installed.</source>
<location filename="../src/3rdparty/phonon/phonon/volumeslider.cpp" line="+42"/>
<location line="+18"/>
<source>Volume: %1%</source>
- <translation type="unfinished"></translation>
+ <translation>Громкость: %1%</translation>
</message>
<message>
<location line="-15"/>
<location line="+18"/>
<location line="+54"/>
<source>Use this slider to adjust the volume. The leftmost position is 0%, the rightmost is %1%</source>
- <translation type="unfinished"></translation>
+ <translation>Используйте ползунок для настройки громкости. Крайняя левая позиция соответствует 0%, самая правая - %1%</translation>
</message>
</context>
<context>
@@ -151,7 +149,7 @@ have libgstreamer-plugins-base installed.</source>
<message>
<location filename="../src/qt3support/other/q3accel.cpp" line="+481"/>
<source>%1, %2 not defined</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">%1, %2 не определен</translation>
</message>
<message>
<location line="+36"/>
@@ -164,52 +162,52 @@ have libgstreamer-plugins-base installed.</source>
<message>
<location filename="../src/qt3support/sql/q3datatable.cpp" line="+285"/>
<source>True</source>
- <translation type="unfinished">True</translation>
+ <translation>Да</translation>
</message>
<message>
<location line="+1"/>
<source>False</source>
- <translation type="unfinished">False</translation>
+ <translation>Нет</translation>
</message>
<message>
<location line="+505"/>
<source>Insert</source>
- <translation type="unfinished">Вставить</translation>
+ <translation>Вставить</translation>
</message>
<message>
<location line="+1"/>
<source>Update</source>
- <translation type="unfinished">Обновить</translation>
+ <translation>Обновить</translation>
</message>
<message>
<location line="+1"/>
<source>Delete</source>
- <translation type="unfinished">Удалить</translation>
+ <translation>Удалить</translation>
</message>
</context>
<context>
<name>Q3FileDialog</name>
<message>
- <location filename="../src/qt3support/dialogs/q3filedialog.cpp" line="+864"/>
+ <location filename="../src/qt3support/dialogs/q3filedialog.cpp" line="+865"/>
<source>Copy or Move a File</source>
- <translation type="unfinished">Копировать или переместить файл</translation>
+ <translation>Копировать или переместить файл</translation>
</message>
<message>
<location line="+8"/>
<source>Read: %1</source>
- <translation type="unfinished">Открытие: %1</translation>
+ <translation>Чтение: %1</translation>
</message>
<message>
<location line="+6"/>
<location line="+30"/>
<source>Write: %1</source>
- <translation type="unfinished">Запись: %1</translation>
+ <translation>Запись: %1</translation>
</message>
<message>
<location line="-22"/>
- <location line="+1575"/>
+ <location line="+1579"/>
<source>Cancel</source>
- <translation type="unfinished">Отмена</translation>
+ <translation>Отмена</translation>
</message>
<message>
<location line="-157"/>
@@ -217,307 +215,307 @@ have libgstreamer-plugins-base installed.</source>
<location line="+2153"/>
<location filename="../src/qt3support/dialogs/q3filedialog_mac.cpp" line="+110"/>
<source>All Files (*)</source>
- <translation type="unfinished">Все файлы (*)</translation>
+ <translation>Все файлы (*)</translation>
</message>
<message>
<location line="-2089"/>
<source>Name</source>
- <translation type="unfinished">Имя</translation>
+ <translation>Имя</translation>
</message>
<message>
<location line="+1"/>
<source>Size</source>
- <translation type="unfinished">Размер</translation>
+ <translation>Размер</translation>
</message>
<message>
<location line="+2"/>
<source>Type</source>
- <translation type="unfinished">Тип</translation>
+ <translation>Тип</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
- <translation type="unfinished">Дата</translation>
+ <translation>Дата</translation>
</message>
<message>
<location line="+1"/>
<source>Attributes</source>
- <translation type="unfinished">Атрибуты</translation>
+ <translation>Атрибуты</translation>
</message>
<message>
<location line="+35"/>
<location line="+2031"/>
<source>&amp;OK</source>
- <translation type="unfinished">&amp;OK</translation>
+ <translation>&amp;Готово</translation>
</message>
<message>
<location line="-1991"/>
<source>Look &amp;in:</source>
- <translation type="unfinished">&amp;Смотреть в:</translation>
+ <translation>&amp;Папка:</translation>
</message>
<message>
<location line="+1"/>
<location line="+1981"/>
<location line="+16"/>
<source>File &amp;name:</source>
- <translation type="unfinished">&amp;Имя файла:</translation>
+ <translation>&amp;Имя файла:</translation>
</message>
<message>
<location line="-1996"/>
<source>File &amp;type:</source>
- <translation type="unfinished">&amp;Тип файла:</translation>
+ <translation>&amp;Тип файла:</translation>
</message>
<message>
<location line="+7"/>
<source>Back</source>
- <translation type="unfinished">Назад</translation>
+ <translation>Назад</translation>
</message>
<message>
<location line="+7"/>
<source>One directory up</source>
- <translation type="unfinished">Вверх на один уровень</translation>
+ <translation>На один уровень вверх</translation>
</message>
<message>
<location line="+9"/>
<source>Create New Folder</source>
- <translation type="unfinished">Создать новый каталог</translation>
+ <translation>Создать каталог</translation>
</message>
<message>
<location line="+18"/>
<source>List View</source>
- <translation type="unfinished">Список</translation>
+ <translation>Список</translation>
</message>
<message>
<location line="+8"/>
<source>Detail View</source>
- <translation type="unfinished">Детальный вид</translation>
+ <translation>Подробный вид</translation>
</message>
<message>
<location line="+9"/>
<source>Preview File Info</source>
- <translation type="unfinished">Предпросмотр информации о файле</translation>
+ <translation>Предпросмотр информации о файле</translation>
</message>
<message>
<location line="+23"/>
<source>Preview File Contents</source>
- <translation type="unfinished">Предпросмотр содержимого файла</translation>
+ <translation>Предпросмотр содержимого файла</translation>
</message>
<message>
<location line="+88"/>
<source>Read-write</source>
- <translation type="unfinished">Чтение-запись</translation>
+ <translation>Чтение и запись</translation>
</message>
<message>
<location line="+1"/>
<source>Read-only</source>
- <translation type="unfinished">Только чтение</translation>
+ <translation>Только чтение</translation>
</message>
<message>
<location line="+1"/>
<source>Write-only</source>
- <translation type="unfinished">Только запись</translation>
+ <translation>Только запись</translation>
</message>
<message>
<location line="+1"/>
<source>Inaccessible</source>
- <translation type="unfinished">Нет доступа</translation>
+ <translation>Нет доступа</translation>
</message>
<message>
<location line="+2"/>
<source>Symlink to File</source>
- <translation type="unfinished">Ссылка на файл</translation>
+ <translation>Ссылка на файл</translation>
</message>
<message>
<location line="+1"/>
<source>Symlink to Directory</source>
- <translation type="unfinished">Ссылка на каталог</translation>
+ <translation>Ссылка на каталог</translation>
</message>
<message>
<location line="+1"/>
<source>Symlink to Special</source>
- <translation type="unfinished">Ссылка на спецфайл</translation>
+ <translation>Ссылка на спецфайл</translation>
</message>
<message>
<location line="+1"/>
<source>File</source>
- <translation type="unfinished">Файл</translation>
+ <translation>Файл</translation>
</message>
<message>
<location line="+1"/>
<source>Dir</source>
- <translation type="unfinished">Каталог</translation>
+ <translation>Каталог</translation>
</message>
<message>
<location line="+1"/>
<source>Special</source>
- <translation type="unfinished">Спецфайл</translation>
+ <translation>Спецфайл</translation>
</message>
<message>
<location line="+704"/>
<location line="+2100"/>
<location filename="../src/qt3support/dialogs/q3filedialog_win.cpp" line="+337"/>
<source>Open</source>
- <translation type="unfinished">Открыть</translation>
+ <translation>Открыть</translation>
</message>
<message>
<location line="-1990"/>
<location filename="../src/qt3support/dialogs/q3filedialog_win.cpp" line="+84"/>
<source>Save As</source>
- <translation type="unfinished">Сохранить как</translation>
+ <translation>Сохранить как</translation>
</message>
<message>
<location line="+642"/>
<location line="+5"/>
<location line="+355"/>
<source>&amp;Open</source>
- <translation type="unfinished">&amp;Открыть</translation>
+ <translation>&amp;Открыть</translation>
</message>
<message>
<location line="-357"/>
<location line="+341"/>
<source>&amp;Save</source>
- <translation type="unfinished">&amp;Сохранить</translation>
+ <translation>&amp;Сохранить</translation>
</message>
<message>
<location line="-334"/>
<source>&amp;Rename</source>
- <translation type="unfinished">&amp;Переименовать</translation>
+ <translation>&amp;Переименовать</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Delete</source>
- <translation type="unfinished">&amp;Удалить</translation>
+ <translation>&amp;Удалить</translation>
</message>
<message>
<location line="+20"/>
<source>R&amp;eload</source>
- <translation type="unfinished">О&amp;бновить</translation>
+ <translation>О&amp;бновить</translation>
</message>
<message>
<location line="+4"/>
<source>Sort by &amp;Name</source>
- <translation type="unfinished">По &amp;имени</translation>
+ <translation>По &amp;имени</translation>
</message>
<message>
<location line="+2"/>
<source>Sort by &amp;Size</source>
- <translation type="unfinished">По &amp;размеру</translation>
+ <translation>По &amp;размеру</translation>
</message>
<message>
<location line="+1"/>
<source>Sort by &amp;Date</source>
- <translation type="unfinished">По &amp;дате</translation>
+ <translation>По &amp;дате</translation>
</message>
<message>
<location line="+2"/>
<source>&amp;Unsorted</source>
- <translation type="unfinished">&amp;Не упорядочивать</translation>
+ <translation>&amp;Не упорядочивать</translation>
</message>
<message>
<location line="+15"/>
<source>Sort</source>
- <translation type="unfinished">Упорядочить</translation>
+ <translation>Упорядочить</translation>
</message>
<message>
<location line="+4"/>
<source>Show &amp;hidden files</source>
- <translation type="unfinished">Показать &amp;скрытые файлы</translation>
+ <translation>Показать скр&amp;ытые файлы</translation>
</message>
<message>
<location line="+31"/>
<source>the file</source>
- <translation type="unfinished">файл</translation>
+ <translation>файл</translation>
</message>
<message>
<location line="+2"/>
<source>the directory</source>
- <translation type="unfinished">каталог</translation>
+ <translation>каталог</translation>
</message>
<message>
<location line="+2"/>
<source>the symlink</source>
- <translation type="unfinished">ссылку</translation>
+ <translation>ссылку</translation>
</message>
<message>
<location line="+3"/>
<source>Delete %1</source>
- <translation type="unfinished">Удалить %1</translation>
+ <translation>Удалить %1</translation>
</message>
<message>
<location line="+1"/>
<source>&lt;qt&gt;Are you sure you wish to delete %1 &quot;%2&quot;?&lt;/qt&gt;</source>
- <translation type="unfinished">&lt;qt&gt;Вы действительно хотите удалить %1 &quot;%2&quot;?&lt;/qt&gt;</translation>
+ <translation>&lt;qt&gt;Вы действительно хотите удалить %1 &quot;%2&quot;?&lt;/qt&gt;</translation>
</message>
<message>
<location line="+2"/>
<source>&amp;Yes</source>
- <translation type="unfinished">&amp;Да</translation>
+ <translation>&amp;Да</translation>
</message>
<message>
<location line="+0"/>
<source>&amp;No</source>
- <translation type="unfinished">&amp;Нет</translation>
+ <translation>&amp;Нет</translation>
</message>
<message>
<location line="+36"/>
<source>New Folder 1</source>
- <translation type="unfinished">Новый каталог 1</translation>
+ <translation>Новый каталог 1</translation>
</message>
<message>
<location line="+5"/>
<source>New Folder</source>
- <translation type="unfinished">Новый каталог</translation>
+ <translation>Новый каталог</translation>
</message>
<message>
<location line="+5"/>
<source>New Folder %1</source>
- <translation type="unfinished">Новый каталог %1</translation>
+ <translation>Новый каталог %1</translation>
</message>
<message>
<location line="+98"/>
<source>Find Directory</source>
- <translation type="unfinished">Найти каталог</translation>
+ <translation>Найти каталог</translation>
</message>
<message>
<location line="+5"/>
<location line="+108"/>
<source>Directories</source>
- <translation type="unfinished">Каталоги</translation>
+ <translation>Каталоги</translation>
</message>
<message>
<location line="-2"/>
<source>Directory:</source>
- <translation type="unfinished">Каталог:</translation>
+ <translation>каталог:</translation>
</message>
<message>
<location line="+40"/>
<location line="+1110"/>
<source>Error</source>
- <translation type="unfinished">Ошибка</translation>
+ <translation>Ошибка</translation>
</message>
<message>
<location line="-1109"/>
<source>%1
File not found.
Check path and filename.</source>
- <translation type="unfinished">%1
+ <translation>%1
Файл не найден.
Проверьте правильность пути и имени файла.</translation>
</message>
<message>
<location filename="../src/qt3support/dialogs/q3filedialog_win.cpp" line="-289"/>
<source>All Files (*.*)</source>
- <translation type="unfinished">Все файлы (*.*)</translation>
+ <translation>Все файлы (*.*)</translation>
</message>
<message>
<location line="+375"/>
<source>Open </source>
- <translation type="unfinished">Открыть</translation>
+ <translation>Открыть </translation>
</message>
<message>
<location line="+155"/>
<source>Select a Directory</source>
- <translation type="unfinished">Выбрать каталог</translation>
+ <translation>Выбрать каталог</translation>
</message>
</context>
<context>
@@ -527,21 +525,21 @@ Check path and filename.</source>
<location line="+10"/>
<source>Could not read directory
%1</source>
- <translation type="unfinished">Невозможно просмотреть каталог
+ <translation>Не удалось прочитать каталог
%1</translation>
</message>
<message>
<location line="+45"/>
<source>Could not create directory
%1</source>
- <translation type="unfinished">Невозможно создать каталог
+ <translation>Не удалось создать каталог
%1</translation>
</message>
<message>
<location line="+34"/>
<source>Could not remove file or directory
%1</source>
- <translation type="unfinished">Невозможно удалить файл или каталог
+ <translation>Не удалось удалить файл или каталог
%1</translation>
</message>
<message>
@@ -550,7 +548,7 @@ Check path and filename.</source>
%1
to
%2</source>
- <translation type="unfinished">Невозможно переименовать
+ <translation>Не удалось переименовать
%1
в
%2</translation>
@@ -559,14 +557,14 @@ to
<location line="+25"/>
<source>Could not open
%1</source>
- <translation type="unfinished">Невозможно открыть
+ <translation>Не удалось открыть
%1</translation>
</message>
<message>
<location line="+68"/>
<source>Could not write
%1</source>
- <translation type="unfinished">Невозможно записать
+ <translation>Не удалось записать
%1</translation>
</message>
</context>
@@ -575,12 +573,12 @@ to
<message>
<location filename="../src/qt3support/widgets/q3mainwindow.cpp" line="+2051"/>
<source>Line up</source>
- <translation type="unfinished">Выровнять</translation>
+ <translation>Выровнять</translation>
</message>
<message>
<location line="+2"/>
<source>Customize...</source>
- <translation type="unfinished">Настроить...</translation>
+ <translation>Настроить...</translation>
</message>
</context>
<context>
@@ -588,7 +586,7 @@ to
<message>
<location filename="../src/qt3support/network/q3networkprotocol.cpp" line="+854"/>
<source>Operation stopped by the user</source>
- <translation type="unfinished">Операция прервана пользователем</translation>
+ <translation>Операция прервана пользователем</translation>
</message>
</context>
<context>
@@ -597,36 +595,36 @@ to
<location filename="../src/qt3support/dialogs/q3progressdialog.cpp" line="+224"/>
<location line="+61"/>
<source>Cancel</source>
- <translation type="unfinished">Отмена</translation>
+ <translation>Отмена</translation>
</message>
</context>
<context>
<name>Q3TabDialog</name>
<message>
- <location filename="../src/qt3support/dialogs/q3tabdialog.cpp" line="+189"/>
- <location line="+814"/>
+ <location filename="../src/qt3support/dialogs/q3tabdialog.cpp" line="+190"/>
+ <location line="+824"/>
<source>OK</source>
- <translation type="unfinished">OK</translation>
+ <translation>Готово</translation>
</message>
<message>
- <location line="-356"/>
+ <location line="-366"/>
<source>Apply</source>
- <translation type="unfinished">Применить</translation>
+ <translation>Применить</translation>
</message>
<message>
<location line="+43"/>
<source>Help</source>
- <translation type="unfinished">Справка</translation>
+ <translation>Справка</translation>
</message>
<message>
<location line="+45"/>
<source>Defaults</source>
- <translation type="unfinished">По умолчанию</translation>
+ <translation>По умолчанию</translation>
</message>
<message>
<location line="+50"/>
<source>Cancel</source>
- <translation type="unfinished">Отмена</translation>
+ <translation>Отмена</translation>
</message>
</context>
<context>
@@ -634,38 +632,38 @@ to
<message>
<location filename="../src/qt3support/text/q3textedit.cpp" line="+5429"/>
<source>&amp;Undo</source>
- <translation type="unfinished">&amp;Отменить</translation>
+ <translation>&amp;Отменить действие</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Redo</source>
- <translation type="unfinished">&amp;Повторить</translation>
+ <translation>&amp;Повторить действие</translation>
</message>
<message>
<location line="+5"/>
<source>Cu&amp;t</source>
- <translation type="unfinished">&amp;Вырезать</translation>
+ <translation>&amp;Вырезать</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Copy</source>
- <translation type="unfinished">&amp;Копировать</translation>
+ <translation>&amp;Копировать</translation>
</message>
<message>
<location line="+2"/>
<source>&amp;Paste</source>
- <translation type="unfinished">&amp;Вставить</translation>
+ <translation>В&amp;ставить</translation>
</message>
<message>
<location line="+3"/>
<source>Clear</source>
- <translation type="unfinished">Очистить</translation>
+ <translation>Очистить</translation>
</message>
<message>
<location line="+4"/>
<location line="+2"/>
<source>Select All</source>
- <translation type="unfinished">Выделить все</translation>
+ <translation>Выделить все</translation>
</message>
</context>
<context>
@@ -673,67 +671,67 @@ to
<message>
<location filename="../src/plugins/accessible/compat/q3complexwidgets.cpp" line="+246"/>
<source>System</source>
- <translation type="unfinished"></translation>
+ <translation>Системное меню</translation>
</message>
<message>
<location line="+3"/>
<source>Restore up</source>
- <translation type="unfinished"></translation>
+ <translation>Восстановить</translation>
</message>
<message>
<location line="+1"/>
<source>Minimize</source>
- <translation type="unfinished">Свернуть</translation>
+ <translation>Минимизировать</translation>
</message>
<message>
<location line="+3"/>
<source>Restore down</source>
- <translation type="unfinished"></translation>
+ <translation>Восстановить</translation>
</message>
<message>
<location line="+1"/>
<source>Maximize</source>
- <translation type="unfinished">Развернуть</translation>
+ <translation>Распахнуть</translation>
</message>
<message>
<location line="+2"/>
<source>Close</source>
- <translation type="unfinished">Закрыть</translation>
+ <translation>Закрыть</translation>
</message>
<message>
<location line="+18"/>
<source>Contains commands to manipulate the window</source>
- <translation type="unfinished"></translation>
+ <translation>Содержит команды управления окном</translation>
</message>
<message>
<location line="+3"/>
<source>Puts a minimized back to normal</source>
- <translation type="unfinished"></translation>
+ <translation>Возвращает минимизированное окно в нормальное состояние</translation>
</message>
<message>
<location line="+1"/>
<source>Moves the window out of the way</source>
- <translation type="unfinished"></translation>
+ <translation>Сворачивает окно</translation>
</message>
<message>
<location line="+3"/>
<source>Puts a maximized window back to normal</source>
- <translation type="unfinished"></translation>
+ <translation>Возвращает распахнутое окно в нормальное состояние</translation>
</message>
<message>
<location line="+1"/>
<source>Makes the window full screen</source>
- <translation type="unfinished"></translation>
+ <translation>Разворачивает окно на весь экран</translation>
</message>
<message>
<location line="+2"/>
<source>Closes the window</source>
- <translation type="unfinished"></translation>
+ <translation>Зыкрывает окно</translation>
</message>
<message>
<location line="+2"/>
<source>Displays the name of the window and contains controls to manipulate it</source>
- <translation type="unfinished"></translation>
+ <translation>Отображает название окна и содержит команды управления им</translation>
</message>
</context>
<context>
@@ -741,7 +739,7 @@ to
<message>
<location filename="../src/qt3support/widgets/q3toolbar.cpp" line="+692"/>
<source>More...</source>
- <translation type="unfinished">Больше...</translation>
+ <translation>Больше...</translation>
</message>
</context>
<context>
@@ -751,49 +749,49 @@ to
<location line="+260"/>
<location line="+4"/>
<source>The protocol `%1&apos; is not supported</source>
- <translation type="unfinished">Протокол `%1&apos; не поддерживается</translation>
+ <translation>Протокол `%1&apos; не поддерживается</translation>
</message>
<message>
<location line="-260"/>
<source>The protocol `%1&apos; does not support listing directories</source>
- <translation type="unfinished">Протокол `%1&apos; не поддерживает просмотр каталогов</translation>
+ <translation>Протокол `%1&apos; не поддерживает просмотр каталогов</translation>
</message>
<message>
<location line="+3"/>
<source>The protocol `%1&apos; does not support creating new directories</source>
- <translation type="unfinished">Протокол `%1&apos; не поддерживает создание новых каталогов</translation>
+ <translation>Протокол `%1&apos; не поддерживает создание каталогов</translation>
</message>
<message>
<location line="+3"/>
<source>The protocol `%1&apos; does not support removing files or directories</source>
- <translation type="unfinished">Протокол `%1&apos; не поддерживает удаление файлов или каталогов</translation>
+ <translation>Протокол `%1&apos; не поддерживает удаление файлов или каталогов</translation>
</message>
<message>
<location line="+3"/>
<source>The protocol `%1&apos; does not support renaming files or directories</source>
- <translation type="unfinished">Протокол `%1&apos; не поддерживает переименование файлов или каталогов</translation>
+ <translation>Протокол `%1&apos; не поддерживает переименование файлов или каталогов</translation>
</message>
<message>
<location line="+3"/>
<source>The protocol `%1&apos; does not support getting files</source>
- <translation type="unfinished">Протокол `%1&apos; не поддерживает доставку файлов</translation>
+ <translation>Протокол `%1&apos; не поддерживает доставку файлов</translation>
</message>
<message>
<location line="+3"/>
<source>The protocol `%1&apos; does not support putting files</source>
- <translation type="unfinished">Протокол `%1&apos; не поддерживает отправку файлов</translation>
+ <translation>Протокол `%1&apos; не поддерживает отправку файлов</translation>
</message>
<message>
<location line="+243"/>
<location line="+4"/>
<source>The protocol `%1&apos; does not support copying or moving files or directories</source>
- <translation type="unfinished">Протокол `%1&apos; не поддерживает копирование или перемещение файлов и каталогов</translation>
+ <translation>Протокол `%1&apos; не поддерживает копирование или перемещение файлов или каталогов</translation>
</message>
<message>
<location line="+237"/>
<location line="+1"/>
<source>(unknown)</source>
- <translation type="unfinished">(неизвестно)</translation>
+ <translation>(неизвестно)</translation>
</message>
</context>
<context>
@@ -801,27 +799,27 @@ to
<message>
<location filename="../src/qt3support/dialogs/q3wizard.cpp" line="+177"/>
<source>&amp;Cancel</source>
- <translation type="unfinished">&amp;Отмена</translation>
+ <translation>&amp;Отмена</translation>
</message>
<message>
<location line="+1"/>
<source>&lt; &amp;Back</source>
- <translation type="unfinished">&lt; &amp;Назад</translation>
+ <translation>&lt; &amp;Назад</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Next &gt;</source>
- <translation type="unfinished">&amp;Вперед &gt;</translation>
+ <translation>&amp;Вперед &gt;</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Finish</source>
- <translation type="unfinished">&amp;Финиш</translation>
+ <translation>&amp;Закончить</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Help</source>
- <translation type="unfinished">&amp;Справка</translation>
+ <translation>&amp;Справка</translation>
</message>
</context>
<context>
@@ -832,68 +830,67 @@ to
<location filename="../src/network/socket/qsocks5socketengine.cpp" line="+657"/>
<location line="+26"/>
<source>Host not found</source>
- <translation type="unfinished"></translation>
+ <translation>Узел не найден</translation>
</message>
<message>
<location line="+50"/>
<location filename="../src/network/socket/qhttpsocketengine.cpp" line="+3"/>
<location filename="../src/network/socket/qsocks5socketengine.cpp" line="+4"/>
<source>Connection refused</source>
- <translation type="unfinished">Отказано в соединении</translation>
+ <translation>Отказано в соединении</translation>
</message>
<message>
<location line="+141"/>
<source>Connection timed out</source>
- <translation type="unfinished"></translation>
+ <translation>Время на соединение истекло</translation>
</message>
<message>
<location line="-547"/>
<location line="+787"/>
<location line="+208"/>
<source>Operation on socket is not supported</source>
- <translation type="unfinished"></translation>
+ <translation>Операция с сокетом не поддерживается</translation>
</message>
<message>
<location line="+137"/>
<source>Socket operation timed out</source>
- <translation type="unfinished"></translation>
+ <translation>Время на операцию с сокетом истекло</translation>
</message>
<message>
<location line="+380"/>
<source>Socket is not connected</source>
- <translation type="unfinished"></translation>
+ <translation>Сокет не подключён</translation>
</message>
<message>
<location filename="../src/network/socket/qsocks5socketengine.cpp" line="-8"/>
<source>Network unreachable</source>
- <translation type="unfinished"></translation>
+ <translation>Сеть недоступна</translation>
</message>
</context>
<context>
<name>QAbstractSpinBox</name>
<message>
- <location filename="../src/gui/widgets/qabstractspinbox.cpp" line="+1199"/>
+ <location filename="../src/gui/widgets/qabstractspinbox.cpp" line="+1200"/>
<source>&amp;Step up</source>
- <translation type="unfinished"></translation>
+ <translation>Шаг вв&amp;ерх</translation>
</message>
<message>
<location line="+2"/>
<source>Step &amp;down</source>
- <translation type="unfinished"></translation>
+ <translation>Шаг вн&amp;из</translation>
</message>
<message>
<location line="-8"/>
<source>&amp;Select All</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Выделить все</translation>
</message>
</context>
<context>
<name>QApplication</name>
<message>
- <location filename="../src/gui/kernel/qapplication.cpp" line="+2248"/>
- <source>QT_LAYOUT_DIRECTION</source>
- <comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout.</comment>
- <translation>LTR</translation>
+ <location filename="../src/gui/accessible/qaccessibleobject.cpp" line="+376"/>
+ <source>Activate</source>
+ <translation>Активировать</translation>
</message>
<message>
<location filename="../src/gui/dialogs/qmessagebox.h" line="+352"/>
@@ -906,37 +903,38 @@ to
<translation>Ошибка совместимости библиотеки Qt</translation>
</message>
<message>
- <location filename="../src/gui/accessible/qaccessibleobject.cpp" line="+376"/>
- <source>Activate</source>
- <translation type="unfinished"></translation>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2244"/>
+ <source>QT_LAYOUT_DIRECTION</source>
+ <comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout.</comment>
+ <translation>LTR</translation>
</message>
<message>
- <location line="+2"/>
+ <location filename="../src/gui/accessible/qaccessibleobject.cpp" line="+2"/>
<source>Activates the program&apos;s main window</source>
- <translation type="unfinished"></translation>
+ <translation>Активирует главное окно программы</translation>
</message>
</context>
<context>
<name>QAxSelect</name>
<message>
- <location filename="../src/activeqt/container/qaxselect.ui"/>
+ <location filename="../src/activeqt/container/qaxselect.ui" line="+54"/>
<source>Select ActiveX Control</source>
- <translation type="unfinished"></translation>
+ <translation>Выберите компоненту ActiveX</translation>
</message>
<message>
- <location/>
+ <location line="+32"/>
<source>OK</source>
- <translation type="unfinished">OK</translation>
+ <translation>Готово</translation>
</message>
<message>
- <location/>
+ <location line="+16"/>
<source>&amp;Cancel</source>
- <translation type="unfinished">&amp;Отмена</translation>
+ <translation>&amp;Отмена</translation>
</message>
<message>
- <location/>
+ <location line="+49"/>
<source>COM &amp;Object:</source>
- <translation type="unfinished"></translation>
+ <translation>COM &amp;Объект:</translation>
</message>
</context>
<context>
@@ -944,17 +942,17 @@ to
<message>
<location filename="../src/plugins/accessible/widgets/simplewidgets.cpp" line="+114"/>
<source>Uncheck</source>
- <translation type="unfinished"></translation>
+ <translation>Снять отметку</translation>
</message>
<message>
<location line="+3"/>
<source>Check</source>
- <translation type="unfinished"></translation>
+ <translation>Отметить</translation>
</message>
<message>
<location line="+1"/>
<source>Toggle</source>
- <translation type="unfinished"></translation>
+ <translation>Переключить</translation>
</message>
</context>
<context>
@@ -977,17 +975,17 @@ to
<message>
<location line="+1"/>
<source>&amp;Red:</source>
- <translation>&amp;Крас:</translation>
+ <translation>&amp;Красный:</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Green:</source>
- <translation>&amp;Зел:</translation>
+ <translation>&amp;Зелёный:</translation>
</message>
<message>
<location line="+1"/>
<source>Bl&amp;ue:</source>
- <translation>С&amp;ин:</translation>
+ <translation>С&amp;иний:</translation>
</message>
<message>
<location line="+1"/>
@@ -997,7 +995,7 @@ to
<message>
<location line="+101"/>
<source>Select Color</source>
- <translation type="unfinished"></translation>
+ <translation>Выберите цвет</translation>
</message>
<message>
<location line="+137"/>
@@ -1007,28 +1005,12 @@ to
<message>
<location line="+1"/>
<source>&amp;Custom colors</source>
- <translation>&amp;Собственные цвета</translation>
- </message>
- <message>
- <source>&amp;Define Custom Colors &gt;&gt;</source>
- <translation type="obsolete">&amp;Выбрать собственные цвета &gt;&gt;</translation>
- </message>
- <message>
- <source>OK</source>
- <translation type="obsolete">OK</translation>
- </message>
- <message>
- <source>Cancel</source>
- <translation type="obsolete">Отмена</translation>
+ <translation>&amp;Произвольные цвета</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Add to Custom Colors</source>
- <translation>&amp;Добавить к собственным цветам</translation>
- </message>
- <message>
- <source>Select color</source>
- <translation type="obsolete">Выбрать цвет</translation>
+ <translation>&amp;Добавить к произвольным цветам</translation>
</message>
</context>
<context>
@@ -1037,22 +1019,22 @@ to
<location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="+1771"/>
<location line="+65"/>
<source>Open</source>
- <translation type="unfinished">Открыть</translation>
+ <translation>Открыть</translation>
</message>
<message>
<location filename="../src/gui/itemviews/qitemeditorfactory.cpp" line="+544"/>
<source>False</source>
- <translation type="unfinished">False</translation>
+ <translation>Нет</translation>
</message>
<message>
<location line="+1"/>
<source>True</source>
- <translation type="unfinished">True</translation>
+ <translation>Да</translation>
</message>
<message>
<location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="+0"/>
<source>Close</source>
- <translation type="unfinished">Закрыть</translation>
+ <translation>Закрыть</translation>
</message>
</context>
<context>
@@ -1061,19 +1043,19 @@ to
<location filename="../src/corelib/kernel/qsystemsemaphore_unix.cpp" line="+119"/>
<source>%1: key is empty</source>
<comment>QSystemSemaphore</comment>
- <translation type="unfinished"></translation>
+ <translation>%1: пустой ключ</translation>
</message>
<message>
<location line="+12"/>
<source>%1: unable to make key</source>
<comment>QSystemSemaphore</comment>
- <translation type="unfinished"></translation>
+ <translation>%1: невозможно создать ключ</translation>
</message>
<message>
<location line="+9"/>
<source>%1: ftok failed</source>
<comment>QSystemSemaphore</comment>
- <translation type="unfinished"></translation>
+ <translation>%1: ошибка ftok</translation>
</message>
</context>
<context>
@@ -1081,22 +1063,22 @@ to
<message>
<location filename="../src/sql/drivers/db2/qsql_db2.cpp" line="+1276"/>
<source>Unable to connect</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно соединиться</translation>
</message>
<message>
<location line="+303"/>
<source>Unable to commit transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить транзакцию</translation>
</message>
<message>
<location line="+17"/>
<source>Unable to rollback transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно откатить транзакцию</translation>
</message>
<message>
<location line="+15"/>
<source>Unable to set autocommit</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно установить автовыполнение транзакции</translation>
</message>
</context>
<context>
@@ -1105,32 +1087,32 @@ to
<location line="-1043"/>
<location line="+243"/>
<source>Unable to execute statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить выражение</translation>
</message>
<message>
<location line="-206"/>
<source>Unable to prepare statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно подготовить выражение</translation>
</message>
<message>
<location line="+196"/>
<source>Unable to bind variable</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно привязать значение</translation>
</message>
<message>
<location line="+92"/>
<source>Unable to fetch record %1</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно получить запись %1</translation>
</message>
<message>
<location line="+17"/>
<source>Unable to fetch next</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно получить следующую строку</translation>
</message>
<message>
<location line="+20"/>
<source>Unable to fetch first</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно получить первую строку</translation>
</message>
</context>
<context>
@@ -1184,162 +1166,162 @@ to
<message>
<location line="-115"/>
<source>Done</source>
- <translation type="unfinished"></translation>
+ <translation>Готово</translation>
</message>
</context>
<context>
<name>QDialogButtonBox</name>
<message>
- <location filename="../src/gui/dialogs/qmessagebox.cpp" line="+1866"/>
+ <location filename="../src/gui/dialogs/qmessagebox.cpp" line="+1861"/>
<location line="+464"/>
<location filename="../src/gui/widgets/qdialogbuttonbox.cpp" line="+561"/>
<source>OK</source>
- <translation type="unfinished">OK</translation>
+ <translation>Готово</translation>
</message>
<message>
- <location filename="../src/gui/widgets/qdialogbuttonbox.cpp" line="+3"/>
- <source>Save</source>
- <translation type="unfinished">Сохранить</translation>
+ <location filename="../src/gui/widgets/qdialogbuttonbox.cpp" line="+0"/>
+ <source>&amp;OK</source>
+ <translation>&amp;Готово</translation>
</message>
<message>
- <location line="+0"/>
+ <location line="+3"/>
<source>&amp;Save</source>
- <translation type="unfinished">&amp;Сохранить</translation>
+ <translation>&amp;Сохранить</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>Save</source>
+ <translation>Сохранить</translation>
</message>
<message>
<location line="+3"/>
<source>Open</source>
- <translation type="unfinished">Открыть</translation>
+ <translation>Открыть</translation>
</message>
<message>
<location line="+3"/>
- <source>Cancel</source>
- <translation type="unfinished">Отмена</translation>
+ <source>&amp;Cancel</source>
+ <translation>&amp;Отмена</translation>
</message>
<message>
<location line="+0"/>
- <source>&amp;Cancel</source>
- <translation type="unfinished">&amp;Отмена</translation>
+ <source>Cancel</source>
+ <translation>Отмена</translation>
</message>
<message>
<location line="+3"/>
- <source>Close</source>
- <translation type="unfinished">Закрыть</translation>
+ <source>&amp;Close</source>
+ <translation>&amp;Закрыть</translation>
</message>
<message>
<location line="+0"/>
- <source>&amp;Close</source>
- <translation type="unfinished">&amp;Закрыть</translation>
+ <source>Close</source>
+ <translation>Закрыть</translation>
</message>
<message>
<location line="+3"/>
<source>Apply</source>
- <translation type="unfinished">Применить</translation>
+ <translation>Применить</translation>
</message>
<message>
<location line="+3"/>
<source>Reset</source>
- <translation type="unfinished"></translation>
+ <translation>Сбросить</translation>
</message>
<message>
<location line="+3"/>
<source>Help</source>
- <translation type="unfinished">Справка</translation>
+ <translation>Справка</translation>
</message>
<message>
<location line="+4"/>
<source>Don&apos;t Save</source>
- <translation type="unfinished"></translation>
+ <translation>Не сохранять</translation>
</message>
<message>
<location line="+4"/>
<source>Discard</source>
- <translation type="unfinished"></translation>
+ <translation>Не применять</translation>
</message>
<message>
<location line="+3"/>
<source>&amp;Yes</source>
- <translation type="unfinished">&amp;Да</translation>
+ <translation>Д&amp;а</translation>
</message>
<message>
<location line="+3"/>
<source>Yes to &amp;All</source>
- <translation type="unfinished"></translation>
+ <translation>Да для &amp;всех</translation>
</message>
<message>
<location line="+3"/>
<source>&amp;No</source>
- <translation type="unfinished">&amp;Нет</translation>
+ <translation>&amp;Нет</translation>
</message>
<message>
<location line="+3"/>
<source>N&amp;o to All</source>
- <translation type="unfinished"></translation>
+ <translation>Н&amp;ет для всех</translation>
</message>
<message>
<location line="+3"/>
<source>Save All</source>
- <translation type="unfinished"></translation>
+ <translation>Сохранить все</translation>
</message>
<message>
<location line="+3"/>
<source>Abort</source>
- <translation type="unfinished"></translation>
+ <translation>Прервать</translation>
</message>
<message>
<location line="+3"/>
<source>Retry</source>
- <translation type="unfinished"></translation>
+ <translation>Попробовать ещё</translation>
</message>
<message>
<location line="+3"/>
<source>Ignore</source>
- <translation type="unfinished"></translation>
+ <translation>Игнорировать</translation>
</message>
<message>
<location line="+3"/>
<source>Restore Defaults</source>
- <translation type="unfinished"></translation>
+ <translation>Восстановить значения по умолчанию</translation>
</message>
<message>
<location line="-29"/>
<source>Close without Saving</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location line="-27"/>
- <source>&amp;OK</source>
- <translation type="unfinished">&amp;OK</translation>
+ <translation>Закрыть без сохранения</translation>
</message>
</context>
<context>
<name>QDirModel</name>
<message>
- <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+453"/>
+ <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+454"/>
<source>Name</source>
- <translation type="unfinished">Имя</translation>
+ <translation>Имя</translation>
</message>
<message>
<location line="+1"/>
<source>Size</source>
- <translation type="unfinished">Размер</translation>
+ <translation>Размер</translation>
</message>
<message>
<location line="+3"/>
<source>Kind</source>
<comment>Match OS X Finder</comment>
- <translation type="unfinished"></translation>
+ <translation>Вид</translation>
</message>
<message>
<location line="+2"/>
<source>Type</source>
<comment>All other platforms</comment>
- <translation type="unfinished">Тип</translation>
+ <translation>Тип</translation>
</message>
<message>
<location line="+6"/>
<source>Date Modified</source>
- <translation type="unfinished"></translation>
+ <translation>Дата изменения</translation>
</message>
</context>
<context>
@@ -1347,7 +1329,7 @@ to
<message>
<location filename="../src/plugins/accessible/widgets/qaccessiblewidgets.cpp" line="+1239"/>
<source>Close</source>
- <translation type="unfinished">Закрыть</translation>
+ <translation>Закрыть</translation>
</message>
<message>
<location line="+2"/>
@@ -1365,28 +1347,18 @@ to
<message>
<location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="-537"/>
<source>More</source>
- <translation type="unfinished"></translation>
+ <translation>Больше</translation>
</message>
<message>
<location line="+2"/>
<source>Less</source>
- <translation type="unfinished"></translation>
+ <translation>Меньше</translation>
</message>
</context>
<context>
<name>QErrorMessage</name>
<message>
- <location filename="../src/gui/dialogs/qerrormessage.cpp" line="+391"/>
- <source>&amp;Show this message again</source>
- <translation>&amp;Показывать это сообщение в дальнейшем</translation>
- </message>
- <message>
- <location line="+1"/>
- <source>&amp;OK</source>
- <translation>&amp;OK</translation>
- </message>
- <message>
- <location line="-200"/>
+ <location filename="../src/gui/dialogs/qerrormessage.cpp" line="+192"/>
<source>Debug Message:</source>
<translation>Отладочное сообщение:</translation>
</message>
@@ -1400,326 +1372,376 @@ to
<source>Fatal Error:</source>
<translation>Критическая ошибка:</translation>
</message>
+ <message>
+ <location line="+193"/>
+ <source>&amp;Show this message again</source>
+ <translation>&amp;Показывать это сообщение в дальнейшем</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>&amp;OK</source>
+ <translation>&amp;Готово</translation>
+ </message>
</context>
<context>
<name>QFile</name>
<message>
<location filename="../src/corelib/io/qfile.cpp" line="+708"/>
- <location line="+141"/>
+ <location line="+151"/>
<source>Destination file exists</source>
- <translation type="unfinished"></translation>
+ <translation>Файл существует</translation>
+ </message>
+ <message>
+ <location line="-136"/>
+ <source>Will not rename sequential file using block copy</source>
+ <translation>Не будет переименовывать последовательный файл, используя копирование блока</translation>
</message>
<message>
- <location line="-108"/>
+ <location line="+23"/>
<source>Cannot remove source file</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно удалить исходный файл</translation>
</message>
<message>
- <location line="+120"/>
+ <location line="+126"/>
<source>Cannot open %1 for input</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно открыть %1 для ввода</translation>
</message>
<message>
<location line="+17"/>
<source>Cannot open for output</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно открыть для вывода</translation>
</message>
<message>
<location line="+10"/>
<source>Failure to write block</source>
- <translation type="unfinished"></translation>
+ <translation>Сбой записи блока</translation>
</message>
<message>
<location line="+13"/>
<source>Cannot create %1 for output</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно создать %1 для вывода</translation>
</message>
</context>
<context>
<name>QFileDialog</name>
<message>
- <location filename="../src/gui/dialogs/qfiledialog.cpp" line="+515"/>
- <location line="+444"/>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="+514"/>
+ <location line="+447"/>
<source>All Files (*)</source>
<translation>Все файлы (*)</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qfiledialog.ui"/>
- <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
- <source>Back</source>
- <translation type="unfinished">Назад</translation>
- </message>
- <message>
- <location/>
- <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
- <source>List View</source>
- <translation type="unfinished">Список</translation>
- </message>
- <message>
- <location/>
- <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
- <source>Detail View</source>
- <translation type="unfinished">Детальный вид</translation>
- </message>
- <message>
- <location filename="../src/gui/itemviews/qfileiconprovider.cpp" line="+414"/>
- <location line="+1"/>
- <source>File</source>
- <translation type="unfinished">Файл</translation>
- </message>
- <message>
- <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-461"/>
- <source>Open</source>
- <translation>Открыть</translation>
- </message>
- <message>
- <location line="+2"/>
- <source>Save As</source>
- <translation type="unfinished">Сохранить как</translation>
+ <location line="+222"/>
+ <source>Directories</source>
+ <translation>Каталоги</translation>
</message>
<message>
- <location line="+678"/>
+ <location line="-3"/>
<location line="+50"/>
- <location line="+1471"/>
+ <location line="+1467"/>
<location line="+75"/>
<source>&amp;Open</source>
<translation>&amp;Открыть</translation>
</message>
<message>
- <location line="-1596"/>
+ <location line="-1592"/>
<location line="+50"/>
<source>&amp;Save</source>
<translation>&amp;Сохранить</translation>
</message>
<message>
- <location line="+1822"/>
- <source>Recent Places</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location line="-2521"/>
- <source>&amp;Rename</source>
- <translation type="unfinished">&amp;Переименовать</translation>
+ <location line="-733"/>
+ <source>Open</source>
+ <translation>Открыть</translation>
</message>
<message>
- <location line="+1"/>
- <source>&amp;Delete</source>
- <translation type="unfinished">&amp;Удалить</translation>
+ <location line="+1515"/>
+ <source>%1 already exists.
+Do you want to replace it?</source>
+ <translation>%1 уже существует.
+Хотите заменить его?</translation>
</message>
<message>
- <location line="+1"/>
- <source>Show &amp;hidden files</source>
- <translation type="unfinished">Показать &amp;скрытые файлы</translation>
+ <location line="+20"/>
+ <source>%1
+File not found.
+Please verify the correct file name was given.</source>
+ <translation>%1
+Файл не найден.
+Проверьте правильность заданного имени файла.</translation>
</message>
<message>
- <location line="+1964"/>
- <source>New Folder</source>
- <translation type="unfinished">Новый каталог</translation>
+ <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+402"/>
+ <source>My Computer</source>
+ <translation>Мой компьютер</translation>
</message>
<message>
- <location line="-1999"/>
- <source>Find Directory</source>
- <translation type="unfinished">Найти каталог</translation>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-1504"/>
+ <source>&amp;Rename</source>
+ <translation>&amp;Переименовать</translation>
</message>
<message>
- <location line="+685"/>
- <source>Directories</source>
- <translation>Каталоги</translation>
+ <location line="+1"/>
+ <source>&amp;Delete</source>
+ <translation>&amp;Удалить</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qfiledialog_win.cpp" line="+160"/>
- <source>All Files (*.*)</source>
- <translation type="unfinished">Все файлы (*.*)</translation>
+ <location line="+1"/>
+ <source>Show &amp;hidden files</source>
+ <translation>Показать скр&amp;ытые файлы</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-644"/>
- <location line="+648"/>
- <source>Directory:</source>
- <translation type="unfinished">Каталог:</translation>
+ <location filename="../src/gui/dialogs/qfiledialog.ui" line="+84"/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui" line="+73"/>
+ <source>Back</source>
+ <translation>Назад</translation>
</message>
<message>
- <location line="+828"/>
- <source>%1 already exists.
-Do you want to replace it?</source>
- <translation type="unfinished"></translation>
+ <location line="+14"/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui" line="+14"/>
+ <source>Parent Directory</source>
+ <translation>Родительский каталог</translation>
</message>
<message>
- <location line="+20"/>
- <source>%1
-File not found.
-Please verify the correct file name was given.</source>
- <translation type="unfinished"></translation>
+ <location line="+14"/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui" line="+14"/>
+ <source>List View</source>
+ <translation>Список</translation>
</message>
<message>
- <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+402"/>
- <source>My Computer</source>
- <translation type="unfinished"></translation>
+ <location line="+7"/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui" line="+7"/>
+ <source>Detail View</source>
+ <translation>Подробный вид</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qfiledialog.ui"/>
- <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
- <source>Parent Directory</source>
- <translation type="unfinished"></translation>
+ <location line="+141"/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui" line="+162"/>
+ <source>Files of type:</source>
+ <translation>Типы файлов:</translation>
</message>
<message>
- <location/>
- <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
- <source>Files of type:</source>
- <translation type="unfinished"></translation>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="+6"/>
+ <location line="+651"/>
+ <source>Directory:</source>
+ <translation>Каталог:</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-54"/>
- <location line="+862"/>
+ <location line="+791"/>
+ <location line="+861"/>
<source>%1
Directory not found.
Please verify the correct directory name was given.</source>
- <translation type="unfinished"></translation>
+ <translation>%1
+Каталог не найден.
+Проверьте правильность заданного имени каталога.</translation>
</message>
<message>
<location line="-218"/>
<source>&apos;%1&apos; is write protected.
Do you want to delete it anyway?</source>
- <translation type="unfinished"></translation>
+ <translation>&apos;%1&apos; защищён от записи.
+Всё-равно хотите удалить?</translation>
</message>
<message>
<location line="+5"/>
<source>Are sure you want to delete &apos;%1&apos;?</source>
- <translation type="unfinished"></translation>
+ <translation>Вы уверены, что хотите удалить &apos;%1&apos;?</translation>
</message>
<message>
<location line="+15"/>
<source>Could not delete directory.</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось удалить каталог.</translation>
+ </message>
+ <message>
+ <location line="+407"/>
+ <source>Recent Places</source>
+ <translation>Недавние документы</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog_win.cpp" line="+160"/>
+ <source>All Files (*.*)</source>
+ <translation>Все файлы (*.*)</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-2549"/>
+ <source>Save As</source>
+ <translation>Сохранить как</translation>
</message>
<message>
- <location filename="../src/gui/itemviews/qfileiconprovider.cpp" line="-4"/>
+ <location filename="../src/gui/itemviews/qfileiconprovider.cpp" line="+411"/>
<source>Drive</source>
- <translation type="unfinished"></translation>
+ <translation>Диск</translation>
</message>
<message>
- <location line="+33"/>
+ <location line="+3"/>
+ <location line="+1"/>
+ <source>File</source>
+ <translation>Файл</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>File Folder</source>
+ <comment>Match Windows Explorer</comment>
+ <translation>Каталог с файлами</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Folder</source>
+ <comment>All other platforms</comment>
+ <translation>Каталог</translation>
+ </message>
+ <message>
+ <location line="+9"/>
+ <source>Alias</source>
+ <comment>Mac OS X Finder</comment>
+ <translation>Псевдоним</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Shortcut</source>
+ <comment>All other platforms</comment>
+ <translation>Ярлык</translation>
+ </message>
+ <message>
+ <location line="+7"/>
<source>Unknown</source>
- <translation type="unfinished"></translation>
+ <translation>Неизвестно</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-4"/>
+ <source>Find Directory</source>
+ <translation>Найти каталог</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-2118"/>
+ <location line="+29"/>
<source>Show </source>
- <translation type="unfinished"></translation>
+ <translation>Показать </translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qfiledialog.ui"/>
- <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
+ <location filename="../src/gui/dialogs/qfiledialog.ui" line="-169"/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui" line="-190"/>
<source>Forward</source>
- <translation type="unfinished">Вперед</translation>
+ <translation>Вперед</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="+1969"/>
+ <source>New Folder</source>
+ <translation>Новый каталог</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qfiledialog.cpp" line="+7"/>
+ <location line="-1962"/>
<source>&amp;New Folder</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Новый каталог</translation>
</message>
<message>
- <location line="+656"/>
+ <location line="+659"/>
<location line="+38"/>
<source>&amp;Choose</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Выбрать</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qsidebar.cpp" line="+418"/>
+ <location filename="../src/gui/dialogs/qsidebar.cpp" line="+437"/>
<source>Remove</source>
- <translation type="unfinished"></translation>
+ <translation>Удалить</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-687"/>
- <location line="+652"/>
+ <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-690"/>
+ <location line="+655"/>
<source>File &amp;name:</source>
- <translation type="unfinished">&amp;Имя файла:</translation>
+ <translation>&amp;Имя файла:</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qfiledialog.ui"/>
- <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
+ <location filename="../src/gui/dialogs/qfiledialog.ui" line="-32"/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui" line="+212"/>
<source>Look in:</source>
- <translation type="unfinished"></translation>
+ <translation>Перейти к:</translation>
</message>
<message>
- <location/>
- <location filename="../src/gui/dialogs/qfiledialog_wince.ui"/>
+ <location line="+46"/>
+ <location filename="../src/gui/dialogs/qfiledialog_wince.ui" line="-198"/>
<source>Create New Folder</source>
- <translation type="unfinished">Создать новый каталог</translation>
+ <translation>Создать каталог</translation>
</message>
</context>
<context>
<name>QFileSystemModel</name>
<message>
- <location filename="../src/gui/dialogs/qfilesystemmodel.cpp" line="+744"/>
- <source>%1 TB</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location line="+2"/>
- <source>%1 GB</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location line="+2"/>
- <source>%1 MB</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location line="+2"/>
- <source>%1 KB</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location line="+1"/>
- <source>%1 bytes</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location line="+77"/>
+ <location filename="../src/gui/dialogs/qfilesystemmodel.cpp" line="+828"/>
<source>Invalid filename</source>
- <translation type="unfinished"></translation>
+ <translation>Некорректное имя файла</translation>
</message>
<message>
<location line="+1"/>
<source>&lt;b&gt;The name &quot;%1&quot; can not be used.&lt;/b&gt;&lt;p&gt;Try using another name, with fewer characters or no punctuations marks.</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;b&gt;Имя &quot;%1&quot; не может быть использовано.&lt;/b&gt;&lt;p&gt;Попробуйте использовать имя меньшей длины и/или без символов пунктуации.</translation>
</message>
<message>
<location line="+63"/>
<source>Name</source>
- <translation type="unfinished">Имя</translation>
+ <translation>Имя</translation>
</message>
<message>
<location line="+2"/>
<source>Size</source>
- <translation type="unfinished">Размер</translation>
+ <translation>Размер</translation>
</message>
<message>
<location line="+4"/>
<source>Kind</source>
<comment>Match OS X Finder</comment>
- <translation type="unfinished"></translation>
+ <translation>Вид</translation>
</message>
<message>
<location line="+2"/>
<source>Type</source>
<comment>All other platforms</comment>
- <translation type="unfinished">Тип</translation>
+ <translation>Тип</translation>
</message>
<message>
<location line="+7"/>
<source>Date Modified</source>
- <translation type="unfinished"></translation>
+ <translation>Дата изменения</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qfilesystemmodel_p.h" line="+234"/>
+ <location filename="../src/gui/dialogs/qfilesystemmodel_p.h" line="+248"/>
<source>My Computer</source>
- <translation type="unfinished"></translation>
+ <translation>Мой компьютер</translation>
</message>
<message>
<location line="+2"/>
<source>Computer</source>
- <translation type="unfinished"></translation>
+ <translation>Компьютер</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qfilesystemmodel.cpp" line="-163"/>
+ <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+471"/>
+ <source>%1 TB</source>
+ <translation>%1 Тб</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+2"/>
+ <source>%1 GB</source>
+ <translation>%1 Гб</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+2"/>
+ <source>%1 MB</source>
+ <translation>%1 Мб</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+2"/>
+ <source>%1 KB</source>
+ <translation>%1 Кб</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+1"/>
+ <source>%1 bytes</source>
+ <translation>%1 байт</translation>
</message>
</context>
<context>
@@ -1728,70 +1750,70 @@ Do you want to delete it anyway?</source>
<location filename="../src/gui/text/qfontdatabase.cpp" line="+90"/>
<location line="+1176"/>
<source>Normal</source>
- <translation type="unfinished"></translation>
+ <translation>Обычный</translation>
</message>
<message>
<location line="-1173"/>
<location line="+12"/>
<location line="+1149"/>
<source>Bold</source>
- <translation type="unfinished"></translation>
+ <translation>Жирный</translation>
</message>
<message>
<location line="-1158"/>
<location line="+1160"/>
<source>Demi Bold</source>
- <translation type="unfinished"></translation>
+ <translation>Срендней жирности</translation>
</message>
<message>
<location line="-1157"/>
<location line="+18"/>
<location line="+1135"/>
<source>Black</source>
- <translation type="unfinished"></translation>
+ <translation>Чёрный</translation>
</message>
<message>
<location line="-1145"/>
<source>Demi</source>
- <translation type="unfinished"></translation>
+ <translation>Средний</translation>
</message>
<message>
<location line="+6"/>
<location line="+1145"/>
<source>Light</source>
- <translation type="unfinished"></translation>
+ <translation>Лёгкий</translation>
</message>
<message>
<location line="-1004"/>
<location line="+1007"/>
<source>Italic</source>
- <translation type="unfinished"></translation>
+ <translation>Курсив</translation>
</message>
<message>
<location line="-1004"/>
<location line="+1006"/>
<source>Oblique</source>
- <translation type="unfinished"></translation>
+ <translation>Наклонный</translation>
</message>
<message>
<location line="+705"/>
<source>Any</source>
- <translation type="unfinished"></translation>
+ <translation>Любая</translation>
</message>
<message>
<location line="+3"/>
<source>Latin</source>
- <translation type="unfinished"></translation>
+ <translation>Латиница</translation>
</message>
<message>
<location line="+3"/>
<source>Greek</source>
- <translation type="unfinished"></translation>
+ <translation>Греческий</translation>
</message>
<message>
<location line="+3"/>
<source>Cyrillic</source>
- <translation type="unfinished"></translation>
+ <translation>Кириллица</translation>
</message>
<message>
<location line="+3"/>
@@ -1949,7 +1971,7 @@ Do you want to delete it anyway?</source>
<message>
<location line="+1"/>
<source>Font st&amp;yle</source>
- <translation>&amp;Стиль шрифта</translation>
+ <translation>Ст&amp;иль шрифта</translation>
</message>
<message>
<location line="+1"/>
@@ -1964,12 +1986,12 @@ Do you want to delete it anyway?</source>
<message>
<location line="+1"/>
<source>Stri&amp;keout</source>
- <translation>&amp;Перечеркивать</translation>
+ <translation>Зачёр&amp;кнутый</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Underline</source>
- <translation>П&amp;одчеркивать</translation>
+ <translation>П&amp;одчёркнутый</translation>
</message>
<message>
<location line="+1"/>
@@ -1977,74 +1999,59 @@ Do you want to delete it anyway?</source>
<translation>Пример</translation>
</message>
<message>
- <location line="-603"/>
- <location line="+247"/>
- <source>Select Font</source>
- <translation>Выбрать шрифт</translation>
+ <location line="+1"/>
+ <source>Wr&amp;iting System</source>
+ <translation>&amp;Система письма</translation>
</message>
<message>
- <location line="+357"/>
- <source>Wr&amp;iting System</source>
- <translation type="unfinished"></translation>
+ <location line="-604"/>
+ <location line="+247"/>
+ <source>Select Font</source>
+ <translation>Выберите шрифт</translation>
</message>
</context>
<context>
<name>QFtp</name>
<message>
- <location filename="../src/qt3support/network/q3ftp.cpp" line="+2303"/>
- <source>Host %1 found</source>
- <translation type="unfinished">Обнаружен узел %1</translation>
- </message>
- <message>
- <location line="+7"/>
- <source>Host found</source>
- <translation type="unfinished">Узел обнаружен</translation>
- </message>
- <message>
- <location filename="../src/network/access/qftp.cpp" line="+1003"/>
- <location filename="../src/qt3support/network/q3ftp.cpp" line="-1456"/>
- <location line="+1451"/>
- <source>Connected to host %1</source>
- <translation>Установлено соединение с узлом %1</translation>
- </message>
- <message>
- <location filename="../src/qt3support/network/q3ftp.cpp" line="+7"/>
- <source>Connected to host</source>
- <translation type="unfinished">Соединение с узлом установлено</translation>
- </message>
- <message>
- <location line="-5"/>
- <source>Connection to %1 closed</source>
- <translation type="unfinished">Соединение с узлом %1 разорвано</translation>
- </message>
- <message>
- <location filename="../src/network/access/qftp.cpp" line="+1375"/>
- <location filename="../src/qt3support/network/q3ftp.cpp" line="-243"/>
- <location line="+250"/>
- <source>Connection closed</source>
- <translation>Соединение разорвано</translation>
+ <location filename="../src/network/access/qftp.cpp" line="+826"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+683"/>
+ <source>Not connected</source>
+ <translation>Соединение не установлено</translation>
</message>
<message>
- <location line="-1487"/>
- <location filename="../src/qt3support/network/q3ftp.cpp" line="-1566"/>
+ <location line="+65"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+65"/>
<source>Host %1 not found</source>
- <translation>Узел %1 не обнаружен</translation>
+ <translation>Узел %1 не найден</translation>
</message>
<message>
<location line="+4"/>
<location filename="../src/qt3support/network/q3ftp.cpp" line="+4"/>
<source>Connection refused to host %1</source>
- <translation>Отказано в соединении с узлом %1</translation>
+ <translation>В соединении с узлом %1 отказано</translation>
</message>
<message>
<location line="+4"/>
<source>Connection timed out to host %1</source>
- <translation type="unfinished"></translation>
+ <translation>Время на соединение с узлом %1 истекло</translation>
</message>
<message>
- <location line="+501"/>
+ <location line="+104"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+102"/>
+ <location line="+1451"/>
+ <source>Connected to host %1</source>
+ <translation>Установлено соединение с узлом %1</translation>
+ </message>
+ <message>
+ <location line="+219"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="-1290"/>
+ <source>Connection refused for data connection</source>
+ <translation>Отказ в соединении для передачи данных</translation>
+ </message>
+ <message>
+ <location line="+178"/>
<location line="+29"/>
- <location filename="../src/qt3support/network/q3ftp.cpp" line="+458"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+195"/>
<location line="+728"/>
<source>Unknown error</source>
<translation>Неизвестная ошибка</translation>
@@ -2054,7 +2061,7 @@ Do you want to delete it anyway?</source>
<location filename="../src/qt3support/network/q3ftp.cpp" line="+77"/>
<source>Connecting to host failed:
%1</source>
- <translation>Ошибка соединения с узлом:
+ <translation>Не удалось соединиться с узлом:
%1</translation>
</message>
<message>
@@ -2062,7 +2069,7 @@ Do you want to delete it anyway?</source>
<location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
<source>Login failed:
%1</source>
- <translation>Ошибка входа в систему:
+ <translation>Не удалось авторизоваться:
%1</translation>
</message>
<message>
@@ -2070,7 +2077,7 @@ Do you want to delete it anyway?</source>
<location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
<source>Listing directory failed:
%1</source>
- <translation>Ошибка просмотра каталога:
+ <translation>Не удалось прочитать каталог:
%1</translation>
</message>
<message>
@@ -2078,7 +2085,7 @@ Do you want to delete it anyway?</source>
<location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
<source>Changing directory failed:
%1</source>
- <translation>Ошибка смены каталога:
+ <translation>Не удалось сменить каталог:
%1</translation>
</message>
<message>
@@ -2086,7 +2093,7 @@ Do you want to delete it anyway?</source>
<location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
<source>Downloading file failed:
%1</source>
- <translation>Ошибка загрузки файла:
+ <translation>Не удалось загрузить файл:
%1</translation>
</message>
<message>
@@ -2094,7 +2101,7 @@ Do you want to delete it anyway?</source>
<location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
<source>Uploading file failed:
%1</source>
- <translation>Ошибка отправки файла:
+ <translation>Не удалось отгрузить файл:
%1</translation>
</message>
<message>
@@ -2102,7 +2109,7 @@ Do you want to delete it anyway?</source>
<location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
<source>Removing file failed:
%1</source>
- <translation>Ошибка удаления файла:
+ <translation>Не удалось удалить файл:
%1</translation>
</message>
<message>
@@ -2110,7 +2117,7 @@ Do you want to delete it anyway?</source>
<location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
<source>Creating directory failed:
%1</source>
- <translation>Ошибка создания каталога:
+ <translation>Не удалось создать каталог:
%1</translation>
</message>
<message>
@@ -2118,20 +2125,35 @@ Do you want to delete it anyway?</source>
<location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/>
<source>Removing directory failed:
%1</source>
- <translation>Ошибка удаления каталога:
+ <translation>Не удалось удалить каталог:
%1</translation>
</message>
<message>
- <location line="-1524"/>
- <location filename="../src/qt3support/network/q3ftp.cpp" line="-1356"/>
- <source>Not connected</source>
- <translation>Нет соединения</translation>
+ <location line="+28"/>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="+25"/>
+ <location line="+250"/>
+ <source>Connection closed</source>
+ <translation>Соединение закрыто</translation>
</message>
<message>
- <location line="+396"/>
- <location filename="../src/qt3support/network/q3ftp.cpp" line="+332"/>
- <source>Connection refused for data connection</source>
- <translation>Отказано в соединении передачи данных</translation>
+ <location filename="../src/qt3support/network/q3ftp.cpp" line="-11"/>
+ <source>Host %1 found</source>
+ <translation>Узел %1 найден</translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Connection to %1 closed</source>
+ <translation>Соединение с %1 закрыто</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Host found</source>
+ <translation>Узел найден</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Connected to host</source>
+ <translation>Соединение с узлом</translation>
</message>
</context>
<context>
@@ -2139,7 +2161,7 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/network/kernel/qhostinfo_p.h" line="+183"/>
<source>Unknown error</source>
- <translation type="unfinished">Неизвестная ошибка</translation>
+ <translation>Неизвестная ошибка</translation>
</message>
</context>
<context>
@@ -2149,12 +2171,12 @@ Do you want to delete it anyway?</source>
<location line="+9"/>
<location line="+64"/>
<location line="+31"/>
- <location filename="../src/network/kernel/qhostinfo_win.cpp" line="+180"/>
+ <location filename="../src/network/kernel/qhostinfo_win.cpp" line="+165"/>
<location line="+9"/>
<location line="+40"/>
<location line="+27"/>
<source>Host not found</source>
- <translation type="unfinished"></translation>
+ <translation>Узел не найден</translation>
</message>
<message>
<location line="-44"/>
@@ -2162,331 +2184,331 @@ Do you want to delete it anyway?</source>
<location filename="../src/network/kernel/qhostinfo_win.cpp" line="-34"/>
<location line="+29"/>
<source>Unknown address type</source>
- <translation type="unfinished"></translation>
+ <translation>Неизвестный тип адреса</translation>
</message>
<message>
<location line="+8"/>
<location filename="../src/network/kernel/qhostinfo_win.cpp" line="-19"/>
<location line="+27"/>
<source>Unknown error</source>
- <translation type="unfinished">Неизвестная ошибка</translation>
+ <translation>Неизвестная ошибка</translation>
</message>
</context>
<context>
<name>QHttp</name>
<message>
- <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+876"/>
- <location filename="../src/qt3support/network/q3http.cpp" line="+1836"/>
- <source>Connection refused</source>
- <translation>Отказано в соединении</translation>
- </message>
- <message>
- <location filename="../src/network/access/qhttp.cpp" line="+2631"/>
- <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="-4"/>
- <location filename="../src/qt3support/network/q3http.cpp" line="+3"/>
- <source>Host %1 not found</source>
- <translation>Узел %1 не обнаружен</translation>
+ <location filename="../src/network/access/qhttp.cpp" line="+1574"/>
+ <location line="+820"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+1160"/>
+ <location line="+567"/>
+ <source>Unknown error</source>
+ <translation>Неизвестная ошибка</translation>
</message>
<message>
- <location line="-62"/>
- <location filename="../src/qt3support/network/q3http.cpp" line="-45"/>
- <source>Wrong content length</source>
- <translation>Неверная длина данных</translation>
+ <location line="-568"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="-370"/>
+ <source>Request aborted</source>
+ <translation>Запрос прерван</translation>
</message>
<message>
- <location line="-2204"/>
- <source>HTTPS connection requested but SSL support not compiled in</source>
- <translation type="unfinished"></translation>
+ <location line="+579"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+381"/>
+ <source>No server set to connect to</source>
+ <translation>Не указан сервер для подключения</translation>
</message>
<message>
- <location line="+2286"/>
- <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+10"/>
- <location line="+19"/>
- <location filename="../src/qt3support/network/q3http.cpp" line="+48"/>
- <source>HTTP request failed</source>
- <translation>Ошибка HTTP-запроса</translation>
+ <location line="+164"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+56"/>
+ <source>Wrong content length</source>
+ <translation>Неверная длина содержимого</translation>
</message>
<message>
- <location filename="../src/qt3support/network/q3http.cpp" line="+450"/>
- <source>Host %1 found</source>
- <translation type="unfinished">Обнаружен узел %1</translation>
+ <location line="+4"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+4"/>
+ <source>Server closed connection unexpectedly</source>
+ <translation>Сервер неожиданно разорвал соединение</translation>
</message>
<message>
- <location line="+14"/>
- <source>Host found</source>
- <translation type="unfinished">Узел обнаружен</translation>
+ <location line="+179"/>
+ <source>Unknown authentication method</source>
+ <translation>Неизвестный метод авторизации</translation>
</message>
<message>
- <location line="-11"/>
- <source>Connected to host %1</source>
- <translation type="unfinished">Установлено соединение с узлом %1</translation>
+ <location line="+183"/>
+ <source>Error writing response to device</source>
+ <translation>Ошибка записи ответа на устройство</translation>
</message>
<message>
- <location line="+14"/>
- <source>Connected to host</source>
- <translation type="unfinished">Соединение с узлом установлено</translation>
+ <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+977"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+38"/>
+ <source>Connection refused</source>
+ <translation>Отказано в соединении</translation>
</message>
<message>
- <location line="-11"/>
- <source>Connection to %1 closed</source>
- <translation type="unfinished">Соединение с узлом %1 разорвано</translation>
+ <location filename="../src/network/access/qhttp.cpp" line="-304"/>
+ <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="-4"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+3"/>
+ <source>Host %1 not found</source>
+ <translation>Узел %1 не найден</translation>
</message>
<message>
- <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="-22"/>
- <location filename="../src/qt3support/network/q3http.cpp" line="+14"/>
- <source>Connection closed</source>
- <translation type="unfinished">Соединение разорвано</translation>
+ <location line="+20"/>
+ <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+10"/>
+ <location line="+19"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+3"/>
+ <source>HTTP request failed</source>
+ <translation>HTTP-запрос не удался</translation>
</message>
<message>
- <location filename="../src/network/access/qhttp.cpp" line="-1077"/>
- <location line="+820"/>
- <location filename="../src/qt3support/network/q3http.cpp" line="-1152"/>
- <location line="+567"/>
- <source>Unknown error</source>
- <translation>Неизвестная ошибка</translation>
+ <location line="+73"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+69"/>
+ <source>Invalid HTTP response header</source>
+ <translation>Некорректный HTTP-заголовок ответа</translation>
</message>
<message>
- <location line="-568"/>
- <location filename="../src/qt3support/network/q3http.cpp" line="-370"/>
- <source>Request aborted</source>
- <translation>Запрос отменен</translation>
+ <location line="+125"/>
+ <location line="+48"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+40"/>
+ <location line="+47"/>
+ <source>Invalid HTTP chunked body</source>
+ <translation>Некорректное HTTP-фрагментирование данных</translation>
</message>
<message>
- <location line="+579"/>
- <location filename="../src/qt3support/network/q3http.cpp" line="+381"/>
- <source>No server set to connect to</source>
- <translation>Не выбран сервер для подключения</translation>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+294"/>
+ <source>Host %1 found</source>
+ <translation>Узел %1 найден</translation>
</message>
<message>
- <location line="+168"/>
- <location filename="../src/qt3support/network/q3http.cpp" line="+60"/>
- <source>Server closed connection unexpectedly</source>
- <translation>Неожиданный разрыв соединения сервером</translation>
+ <location line="+3"/>
+ <source>Connected to host %1</source>
+ <translation>Установлено соединение с узлом %1</translation>
</message>
<message>
- <location line="+151"/>
- <location filename="../src/qt3support/network/q3http.cpp" line="+113"/>
- <source>Invalid HTTP response header</source>
- <translation>Получен некорректный HTTP-заголовок</translation>
+ <location line="+3"/>
+ <source>Connection to %1 closed</source>
+ <translation>Соединение с узлом %1 закрыто</translation>
</message>
<message>
- <location line="+28"/>
- <source>Unknown authentication method</source>
- <translation type="unfinished"></translation>
+ <location line="+8"/>
+ <source>Host found</source>
+ <translation>Узел найден</translation>
</message>
<message>
- <location line="+97"/>
- <location line="+48"/>
- <location filename="../src/qt3support/network/q3http.cpp" line="+40"/>
- <location line="+47"/>
- <source>Invalid HTTP chunked body</source>
- <translation>Некорректный HTTP-ответ</translation>
+ <location line="+3"/>
+ <source>Connected to host</source>
+ <translation>Соединение с узлом установлено</translation>
</message>
<message>
- <location line="+38"/>
- <source>Error writing response to device</source>
- <translation type="unfinished"></translation>
+ <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="-22"/>
+ <location filename="../src/qt3support/network/q3http.cpp" line="+3"/>
+ <source>Connection closed</source>
+ <translation>Соединение закрыто</translation>
</message>
<message>
- <location line="-173"/>
+ <location filename="../src/network/access/qhttp.cpp" line="-135"/>
<source>Proxy authentication required</source>
- <translation type="unfinished"></translation>
+ <translation>Требуется авторизация на прокси-сервере</translation>
</message>
<message>
<location line="+4"/>
<source>Authentication required</source>
- <translation type="unfinished"></translation>
+ <translation>Требуется авторизация</translation>
</message>
<message>
<location line="-138"/>
<source>Connection refused (or timed out)</source>
- <translation type="unfinished"></translation>
+ <translation>В соединении отказано (или время ожидания истекло)</translation>
</message>
<message>
<location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+6"/>
<source>Proxy requires authentication</source>
- <translation type="unfinished"></translation>
+ <translation>Прокси-сервер требует авторизацию</translation>
</message>
<message>
<location line="+3"/>
<source>Host requires authentication</source>
- <translation type="unfinished"></translation>
+ <translation>Узел требует авторизацию</translation>
</message>
<message>
<location line="+3"/>
<source>Data corrupted</source>
- <translation type="unfinished"></translation>
+ <translation>Данные повреждены</translation>
</message>
<message>
<location line="+3"/>
<source>Unknown protocol specified</source>
- <translation type="unfinished"></translation>
+ <translation>Указан неизвестный протокол</translation>
</message>
<message>
<location line="+3"/>
<source>SSL handshake failed</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <location filename="../src/network/access/qhttp.cpp" line="-2263"/>
+ <source>HTTPS connection requested but SSL support not compiled in</source>
+ <translation>Запрошено соединение по протоколу HTTPS, но поддержка SSL не скомпилирована</translation>
+ </message>
</context>
<context>
<name>QHttpSocketEngine</name>
<message>
<location filename="../src/network/socket/qhttpsocketengine.cpp" line="-89"/>
<source>Did not receive HTTP response from proxy</source>
- <translation type="unfinished"></translation>
+ <translation>Не получен HTTP-ответ от прокси-сервера</translation>
</message>
<message>
<location line="+25"/>
<source>Error parsing authentication request from proxy</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка разбора запроса авторизации от прокси-сервера</translation>
</message>
<message>
<location line="+31"/>
<source>Authentication required</source>
- <translation type="unfinished"></translation>
+ <translation>Требуется авторизация</translation>
</message>
<message>
<location line="+27"/>
<source>Proxy denied connection</source>
- <translation type="unfinished"></translation>
+ <translation>Прокси-сервер запретил соединение</translation>
</message>
<message>
<location line="+10"/>
<source>Error communicating with HTTP proxy</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка обмена данными с прокси-сервером HTTP</translation>
</message>
<message>
<location line="+23"/>
<source>Proxy server not found</source>
- <translation type="unfinished"></translation>
+ <translation>Прокси-сервер не найден</translation>
</message>
<message>
<location line="+2"/>
<source>Proxy connection refused</source>
- <translation type="unfinished"></translation>
+ <translation>В соединении прокси-сервером отказано</translation>
</message>
<message>
<location line="+2"/>
<source>Proxy server connection timed out</source>
- <translation type="unfinished"></translation>
+ <translation>Время на соединение с прокси-сервером истекло</translation>
</message>
<message>
<location line="+2"/>
<source>Proxy connection closed prematurely</source>
- <translation type="unfinished"></translation>
+ <translation>Соединение с прокси-сервером неожиданно закрыто</translation>
</message>
</context>
<context>
<name>QIBaseDriver</name>
<message>
- <location filename="../src/sql/drivers/ibase/qsql_ibase.cpp" line="+1428"/>
+ <location filename="../src/sql/drivers/ibase/qsql_ibase.cpp" line="+1434"/>
<source>Error opening database</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно открыть базу данных</translation>
</message>
<message>
<location line="+54"/>
<source>Could not start transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось начать транзакцию</translation>
</message>
<message>
<location line="+13"/>
<source>Unable to commit transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить транзакцию</translation>
</message>
<message>
<location line="+13"/>
<source>Unable to rollback transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно откатить транзакцию</translation>
</message>
</context>
<context>
<name>QIBaseResult</name>
<message>
- <location line="-1097"/>
+ <location line="-1095"/>
<source>Unable to create BLOB</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно создать BLOB</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to write BLOB</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно записать BLOB</translation>
</message>
<message>
<location line="+14"/>
<source>Unable to open BLOB</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно открыть BLOB</translation>
</message>
<message>
<location line="+16"/>
<source>Unable to read BLOB</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно прочитать BLOB</translation>
</message>
<message>
<location line="+125"/>
- <location line="+189"/>
+ <location line="+187"/>
<source>Could not find array</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось найти массив</translation>
</message>
<message>
- <location line="-157"/>
+ <location line="-155"/>
<source>Could not get array data</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось найти данные массива</translation>
</message>
<message>
- <location line="+212"/>
+ <location line="+210"/>
<source>Could not get query info</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось найти информацию о запросе</translation>
</message>
<message>
<location line="+20"/>
<source>Could not start transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось начать транзакцию</translation>
</message>
<message>
<location line="+19"/>
<source>Unable to commit transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить транзакцию</translation>
</message>
<message>
<location line="+33"/>
<source>Could not allocate statement</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось получить ресурсы для создания выражения</translation>
</message>
<message>
<location line="+5"/>
<source>Could not prepare statement</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось подготовить выражение</translation>
</message>
<message>
<location line="+5"/>
<location line="+7"/>
<source>Could not describe input statement</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось описать входящее выражение</translation>
</message>
<message>
<location line="+10"/>
<source>Could not describe statement</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось описать выражение</translation>
</message>
<message>
<location line="+115"/>
<source>Unable to close statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно закрыть выражение</translation>
</message>
<message>
<location line="+8"/>
<source>Unable to execute query</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить запрос</translation>
</message>
<message>
<location line="+46"/>
<source>Could not fetch next item</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось получить следующий элемент</translation>
</message>
<message>
<location line="+160"/>
<source>Could not get statement info</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось найти информацию о выражении</translation>
</message>
</context>
<context>
@@ -2494,27 +2516,27 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/corelib/global/qglobal.cpp" line="+1869"/>
<source>Permission denied</source>
- <translation type="unfinished"></translation>
+ <translation>Доступ запрещён</translation>
</message>
<message>
<location line="+3"/>
<source>Too many open files</source>
- <translation type="unfinished"></translation>
+ <translation>Слишком много открытых файлов</translation>
</message>
<message>
<location line="+3"/>
<source>No such file or directory</source>
- <translation type="unfinished"></translation>
+ <translation>Файл или каталог не существует</translation>
</message>
<message>
<location line="+3"/>
<source>No space left on device</source>
- <translation type="unfinished"></translation>
+ <translation>Нет свободного места на устройстве</translation>
</message>
<message>
- <location filename="../src/corelib/io/qiodevice.cpp" line="+1536"/>
+ <location filename="../src/corelib/io/qiodevice.cpp" line="+1541"/>
<source>Unknown error</source>
- <translation type="unfinished">Неизвестная ошибка</translation>
+ <translation>Неизвестная ошибка</translation>
</message>
</context>
<context>
@@ -2545,7 +2567,7 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/gui/dialogs/qinputdialog.cpp" line="+223"/>
<source>Enter a value:</source>
- <translation type="unfinished"></translation>
+ <translation>Укажите значение:</translation>
</message>
</context>
<context>
@@ -2553,66 +2575,66 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/corelib/plugin/qlibrary.cpp" line="+378"/>
<source>Could not mmap &apos;%1&apos;: %2</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось выполнить mmap &apos;%1&apos;: %2</translation>
</message>
<message>
<location line="+22"/>
<source>Plugin verification data mismatch in &apos;%1&apos;</source>
- <translation type="unfinished"></translation>
+ <translation>Проверочная информация для модуля &apos;%1&apos; не совпадает</translation>
</message>
<message>
<location line="+6"/>
<source>Could not unmap &apos;%1&apos;: %2</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось выполнить unmap &apos;%1&apos;: %2</translation>
</message>
<message>
<location line="+302"/>
<source>The plugin &apos;%1&apos; uses incompatible Qt library. (%2.%3.%4) [%5]</source>
- <translation type="unfinished"></translation>
+ <translation>Модуль &apos;%1&apos; использует несоместимую библиотеку Qt. (%2.%3.%4) [%5]</translation>
</message>
<message>
<location line="+20"/>
<source>The plugin &apos;%1&apos; uses incompatible Qt library. Expected build key &quot;%2&quot;, got &quot;%3&quot;</source>
- <translation type="unfinished"></translation>
+ <translation>Плагин &apos;%1&apos; использует несоместимую библиотеку Qt. Ожидается ключ &quot;%2&quot;, но получен ключ &quot;%3&quot;</translation>
</message>
<message>
<location line="+340"/>
<source>Unknown error</source>
- <translation type="unfinished">Неизвестная ошибка</translation>
+ <translation>Неизвестная ошибка</translation>
</message>
<message>
<location line="-377"/>
<location filename="../src/corelib/plugin/qpluginloader.cpp" line="+280"/>
<source>The shared library was not found.</source>
- <translation type="unfinished"></translation>
+ <translation>Динамическая библиотека не найдена.</translation>
</message>
<message>
<location line="+2"/>
<source>The file &apos;%1&apos; is not a valid Qt plugin.</source>
- <translation type="unfinished"></translation>
+ <translation>Файл &apos;%1&apos; - не может быть корректным модулем Qt.</translation>
</message>
<message>
<location line="+43"/>
<source>The plugin &apos;%1&apos; uses incompatible Qt library. (Cannot mix debug and release libraries.)</source>
- <translation type="unfinished"></translation>
+ <translation>Плагин &apos;%1&apos; использует несоместимую библиотеку Qt. (Нельзя совмещать релизные и отладочные библиотеки.)</translation>
</message>
<message>
<location filename="../src/corelib/plugin/qlibrary_unix.cpp" line="+209"/>
<location filename="../src/corelib/plugin/qlibrary_win.cpp" line="+99"/>
<source>Cannot load library %1: %2</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно загрузить библиотеку %1: %2</translation>
</message>
<message>
<location line="+16"/>
<location filename="../src/corelib/plugin/qlibrary_win.cpp" line="+26"/>
<source>Cannot unload library %1: %2</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выгрузить библиотеку %1: %2</translation>
</message>
<message>
<location line="+31"/>
<location filename="../src/corelib/plugin/qlibrary_win.cpp" line="+15"/>
<source>Cannot resolve symbol &quot;%1&quot; in %2: %3</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно разрешить символ &quot;%1&quot; в %2: %3</translation>
</message>
</context>
<context>
@@ -2620,62 +2642,61 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/gui/widgets/qlineedit.cpp" line="+2680"/>
<source>&amp;Undo</source>
- <translation type="unfinished">&amp;Отменить</translation>
+ <translation>&amp;Отменить действие</translation>
</message>
<message>
<location line="+4"/>
<source>&amp;Redo</source>
- <translation type="unfinished">&amp;Повторить</translation>
+ <translation>&amp;Повторить действие</translation>
</message>
<message>
<location line="+7"/>
<source>Cu&amp;t</source>
- <translation type="unfinished">&amp;Вырезать</translation>
+ <translation>&amp;Вырезать</translation>
</message>
<message>
<location line="+4"/>
<source>&amp;Copy</source>
- <translation type="unfinished">&amp;Копировать</translation>
+ <translation>&amp;Копировать</translation>
</message>
<message>
<location line="+4"/>
<source>&amp;Paste</source>
- <translation type="unfinished">В&amp;ставить</translation>
+ <translation>В&amp;ставить</translation>
</message>
<message>
- <location line="+11"/>
- <source>Select All</source>
- <translation type="unfinished">Выделить все</translation>
+ <location line="+5"/>
+ <source>Delete</source>
+ <translation>Удалить</translation>
</message>
<message>
- <location line="-6"/>
- <source>Delete</source>
- <translation type="unfinished">Удалить</translation>
+ <location line="+6"/>
+ <source>Select All</source>
+ <translation>Выделить все</translation>
</message>
</context>
<context>
<name>QLocalServer</name>
<message>
<location filename="../src/network/socket/qlocalserver.cpp" line="+226"/>
- <location filename="../src/network/socket/qlocalserver_unix.cpp" line="+231"/>
+ <location filename="../src/network/socket/qlocalserver_unix.cpp" line="+233"/>
<source>%1: Name error</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Некорректное имя</translation>
</message>
<message>
<location filename="../src/network/socket/qlocalserver_unix.cpp" line="-8"/>
<source>%1: Permission denied</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Доступ запрещён</translation>
</message>
<message>
<location line="+12"/>
<source>%1: Address in use</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Адрес используется</translation>
</message>
<message>
<location line="+5"/>
- <location filename="../src/network/socket/qlocalserver_win.cpp" line="+158"/>
<source>%1: Unknown error %2</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Неизвестная ошибка %2</translation>
</message>
</context>
<context>
@@ -2684,13 +2705,13 @@ Do you want to delete it anyway?</source>
<location filename="../src/network/socket/qlocalsocket_tcp.cpp" line="+132"/>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+134"/>
<source>%1: Connection refused</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Отказано в соединении</translation>
</message>
<message>
<location line="+3"/>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
<source>%1: Remote closed</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Удалённое закрытие</translation>
</message>
<message>
<location line="+3"/>
@@ -2698,143 +2719,143 @@ Do you want to delete it anyway?</source>
<location filename="../src/network/socket/qlocalsocket_win.cpp" line="+80"/>
<location line="+43"/>
<source>%1: Invalid name</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Некорректное имя</translation>
</message>
<message>
<location line="+3"/>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
<source>%1: Socket access error</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Ошибка обращения к сокету</translation>
</message>
<message>
<location line="+3"/>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
<source>%1: Socket resource error</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Ошибка выделения ресурсов сокета</translation>
</message>
<message>
<location line="+3"/>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
<source>%1: Socket operation timed out</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Время на операцию с сокетом истекло</translation>
</message>
<message>
<location line="+3"/>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
<source>%1: Datagram too large</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Датаграмма слишком большая</translation>
</message>
<message>
<location line="+3"/>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
<location filename="../src/network/socket/qlocalsocket_win.cpp" line="-48"/>
<source>%1: Connection error</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Ошибка соединения</translation>
</message>
<message>
<location line="+3"/>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/>
<source>%1: The socket operation is not supported</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Операция с сокетом не поддерживается</translation>
</message>
<message>
<location line="+4"/>
<source>%1: Unknown error</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Неизвестная ошибка</translation>
</message>
<message>
<location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+4"/>
<location filename="../src/network/socket/qlocalsocket_win.cpp" line="+10"/>
<source>%1: Unknown error %2</source>
- <translation type="unfinished"></translation>
+ <translation>%1: Неизвестная ошибка %2</translation>
</message>
</context>
<context>
<name>QMYSQLDriver</name>
<message>
- <location filename="../src/sql/drivers/mysql/qsql_mysql.cpp" line="+1231"/>
+ <location filename="../src/sql/drivers/mysql/qsql_mysql.cpp" line="+1251"/>
<source>Unable to open database &apos;</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно открыть базу данных &apos;</translation>
</message>
<message>
<location line="+7"/>
<source>Unable to connect</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно соединиться</translation>
</message>
<message>
- <location line="+127"/>
+ <location line="+135"/>
<source>Unable to begin transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно начать транзакцию</translation>
</message>
<message>
<location line="+17"/>
<source>Unable to commit transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить транзакцию</translation>
</message>
<message>
<location line="+17"/>
<source>Unable to rollback transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно откатить транзакцию</translation>
</message>
</context>
<context>
<name>QMYSQLResult</name>
<message>
- <location line="-922"/>
+ <location line="-942"/>
<source>Unable to fetch data</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно получить данные</translation>
</message>
<message>
- <location line="+176"/>
+ <location line="+183"/>
<source>Unable to execute query</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить запрос</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to store result</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно сохранить результат</translation>
</message>
<message>
- <location line="+190"/>
+ <location line="+194"/>
<location line="+8"/>
<source>Unable to prepare statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно подготовить выражение</translation>
</message>
<message>
- <location line="+34"/>
+ <location line="+36"/>
<source>Unable to reset statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно сбросить выражение</translation>
</message>
<message>
- <location line="+87"/>
+ <location line="+86"/>
<source>Unable to bind value</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно привязать значение</translation>
</message>
<message>
<location line="+11"/>
<source>Unable to execute statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить выражение</translation>
</message>
<message>
<location line="+14"/>
<location line="+21"/>
<source>Unable to bind outvalues</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно привязать результирующие значения</translation>
</message>
<message>
<location line="-12"/>
<source>Unable to store statement results</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно сохранить результат выполнения выражения</translation>
</message>
<message>
- <location line="-253"/>
+ <location line="-256"/>
<source>Unable to execute next query</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить следующий запрос</translation>
</message>
<message>
<location line="+10"/>
<source>Unable to store next result</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно сохранить следующий результат</translation>
</message>
</context>
<context>
@@ -2842,7 +2863,7 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/gui/widgets/qmdiarea.cpp" line="+290"/>
<source>(Untitled)</source>
- <translation type="unfinished"></translation>
+ <translation>(Неозаглавлено)</translation>
</message>
</context>
<context>
@@ -2850,92 +2871,92 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/gui/widgets/qmdisubwindow.cpp" line="+280"/>
<source>%1 - [%2]</source>
- <translation type="unfinished">%1 - [%2]</translation>
+ <translation>%1 - [%2]</translation>
</message>
<message>
<location line="+72"/>
<source>Close</source>
- <translation type="unfinished">Закрыть</translation>
+ <translation>Закрыть</translation>
</message>
<message>
<location line="-18"/>
<source>Minimize</source>
- <translation type="unfinished">Свернуть</translation>
+ <translation>Минимизировать</translation>
</message>
<message>
<location line="+13"/>
<source>Restore Down</source>
- <translation type="unfinished">Восстановить</translation>
+ <translation>Восстановить</translation>
</message>
<message>
<location line="+707"/>
<source>&amp;Restore</source>
- <translation type="unfinished">&amp;Восстановить</translation>
+ <translation>&amp;Восстановить</translation>
</message>
<message>
<location line="+3"/>
<source>&amp;Move</source>
- <translation type="unfinished">&amp;Переместить</translation>
+ <translation>&amp;Переместить</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Size</source>
- <translation type="unfinished">&amp;Размер</translation>
+ <translation>&amp;Размер</translation>
</message>
<message>
<location line="+1"/>
<source>Mi&amp;nimize</source>
- <translation type="unfinished">&amp;Свернуть</translation>
+ <translation>&amp;Минимизировать</translation>
</message>
<message>
<location line="+2"/>
<source>Ma&amp;ximize</source>
- <translation type="unfinished">Р&amp;азвернуть</translation>
+ <translation>Р&amp;аспахнуть</translation>
</message>
<message>
<location line="+2"/>
<source>Stay on &amp;Top</source>
- <translation type="unfinished">Всегда &amp;наверху</translation>
+ <translation>Оставаться &amp;сверху</translation>
</message>
<message>
<location line="+3"/>
<source>&amp;Close</source>
- <translation type="unfinished">&amp;Закрыть</translation>
+ <translation>&amp;Закрыть</translation>
</message>
<message>
<location line="-787"/>
<source>- [%1]</source>
- <translation type="unfinished"></translation>
+ <translation>- [%1]</translation>
</message>
<message>
<location line="+58"/>
<source>Maximize</source>
- <translation type="unfinished">Развернуть</translation>
+ <translation>Распахнуть</translation>
</message>
<message>
<location line="+3"/>
<source>Unshade</source>
- <translation type="unfinished"></translation>
+ <translation>Восстановить из заголовка</translation>
</message>
<message>
<location line="+3"/>
<source>Shade</source>
- <translation type="unfinished"></translation>
+ <translation>Свернуть в заголовок</translation>
</message>
<message>
<location line="+6"/>
<source>Restore</source>
- <translation type="unfinished"></translation>
+ <translation>Восстановить</translation>
</message>
<message>
<location line="+6"/>
<source>Help</source>
- <translation type="unfinished">Справка</translation>
+ <translation>Справка</translation>
</message>
<message>
<location line="+3"/>
<source>Menu</source>
- <translation type="unfinished">Меню</translation>
+ <translation>Меню</translation>
</message>
</context>
<context>
@@ -2944,91 +2965,68 @@ Do you want to delete it anyway?</source>
<location filename="../src/plugins/accessible/widgets/qaccessiblemenu.cpp" line="+157"/>
<location line="+225"/>
<source>Close</source>
- <translation type="unfinished">Закрыть</translation>
+ <translation>Закрыть</translation>
</message>
<message>
<location line="-224"/>
<location line="+225"/>
<source>Open</source>
- <translation type="unfinished">Открыть</translation>
+ <translation>Открыть</translation>
</message>
<message>
<location line="-223"/>
<location line="+225"/>
<location line="+51"/>
<source>Execute</source>
- <translation type="unfinished"></translation>
+ <translation>Выполнить</translation>
</message>
</context>
<context>
- <name>QMenuBar</name>
- <message>
- <source>About</source>
- <translation type="obsolete">О программе</translation>
- </message>
- <message>
- <source>Config</source>
- <translation type="obsolete">Конфигурация</translation>
- </message>
- <message>
- <source>Preference</source>
- <translation type="obsolete">Настройки</translation>
- </message>
- <message>
- <source>Options</source>
- <translation type="obsolete">Параметры</translation>
- </message>
- <message>
- <source>Setting</source>
- <translation type="obsolete">Настройки</translation>
- </message>
- <message>
- <source>Setup</source>
- <translation type="obsolete">Настройки</translation>
- </message>
- <message>
- <source>Quit</source>
- <translation type="obsolete">Выход</translation>
- </message>
+ <name>QMessageBox</name>
<message>
- <source>Exit</source>
- <translation type="obsolete">Выход</translation>
+ <location filename="../src/gui/dialogs/qmessagebox.cpp" line="-1111"/>
+ <source>Help</source>
+ <translation>Справка</translation>
</message>
-</context>
-<context>
- <name>QMessageBox</name>
<message>
- <location filename="../src/gui/dialogs/qmessagebox.cpp" line="-1964"/>
- <location line="+852"/>
+ <location line="-848"/>
+ <location line="+847"/>
<location filename="../src/gui/dialogs/qmessagebox.h" line="-52"/>
<location line="+8"/>
<source>OK</source>
- <translation>OK</translation>
+ <translation>Готово</translation>
</message>
<message>
- <location line="+509"/>
+ <location line="+475"/>
+ <source>&lt;h3&gt;About Qt&lt;/h3&gt;&lt;p&gt;This program uses Qt version %1.&lt;/p&gt;&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://www.qtsoftware.com/products/licensing&quot;&gt;www.qtsoftware.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://www.qtsoftware.com/qt/&quot;&gt;www.qtsoftware.com/qt&lt;/a&gt; for more information.&lt;/p&gt;</source>
+ <translation type="unfinished">&lt;h3&gt;О Qt&lt;/h3&gt;&lt;p&gt;Данная программа использует Qt версии %1.&lt;/p&gt;&lt;p&gt;Qt - это инструмент для разработки крссплатформенных приложений на C++.&lt;/p&gt;&lt;p&gt;Qt предоставляет переносимость между MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux и всеми популярными вариантами коммерческой Unix. Также Qt доступна для встраиваемых устройств в виде Qt для Embedded Linux и Qt для Windows CE.&lt;/p&gt;&lt;p&gt;Qt доступна под тремя различными лицензиями, разработанными для удовлетворения требований различных пользователей.&lt;/p&gt;Qt, лицензированая нашей коммерческой лицензией, предназначена для развития проприетарного/коммерческого программного обеспечения, когда Вы не желаете предоставлять исходные коды третьим сторонам; коммерческая лицензия не соответствует условиям лицензий GNU LGPL версии 2.1 или GNU GPL версии 3.0.&lt;/p&gt;&lt;p&gt;Qt под лицензией GNU LGPL версии 2.1 предназначена для разработки программного обеспечения с открытым исходным кодом или коммерческого программного обеспечения при соблюдении сроков и условий лицензии GNU LGPL версии 2.1.&lt;/p&gt;&lt;p&gt;Qt под лицензией GNU General Public License версии 3.0 предназначена для разработки программных приложений в тех случаях, когда Вы хотели бы использовать такие приложения в сочетании с программным обеспечением на условиях лицензии GNU GPL с версии 3.0 или если Вы готовы соблюдать условия лицензии GNU GPL версии 3.0.&lt;/p&gt;&lt;p&gt;Обратитесь к &lt;a href=&quot;http://www.qtsoftware.com/products/licensing&quot;&gt;www.qtsoftware.com/products/licensing&lt;/a&gt; для обзора лицензий Qt.&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Корпорация Nokia и/или её дочерние подразделения.&lt;/p&gt;&lt;p&gt;Qt - продукт Nokia. Обратитесь к &lt;a href=&quot;http://www.qtsoftware.com/qt/&quot;&gt;www.qtsoftware.com/qt&lt;/a&gt; для получения дополнительной информации.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <location line="+34"/>
<source>About Qt</source>
- <translation type="unfinished"></translation>
+ <translation>О Qt</translation>
</message>
<message>
- <location line="-508"/>
- <source>Help</source>
- <translation type="unfinished">Справка</translation>
+ <source>&lt;p&gt;This program uses Qt version %1.&lt;/p&gt;</source>
+ <translation type="obsolete">&lt;p&gt;Данная программа использует Qt версии %1.&lt;/p&gt;</translation>
</message>
<message>
- <location line="-1097"/>
+ <location line="-1600"/>
<source>Show Details...</source>
- <translation type="unfinished"></translation>
+ <translation>Показать подробности...</translation>
</message>
<message>
<location line="+1"/>
<source>Hide Details...</source>
- <translation type="unfinished"></translation>
+ <translation>Скрыть подробности...</translation>
</message>
<message>
- <location line="+1570"/>
- <source>&lt;h3&gt;About Qt&lt;/h3&gt;&lt;p&gt;This program uses Qt version %1.&lt;/p&gt;&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://www.qtsoftware.com/products/licensing&quot;&gt;www.qtsoftware.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://www.qtsoftware.com/qt/&quot;&gt;www.qtsoftware.com/qt&lt;/a&gt; for more information.&lt;/p&gt;</source>
- <translation type="unfinished"></translation>
+ <source>&lt;h3&gt;About Qt&lt;/h3&gt;%1&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qtsoftware.com/qt/&quot;&gt;qtsoftware.com/qt/&lt;/a&gt; for more information.&lt;/p&gt;</source>
+ <translation type="obsolete">&lt;h3&gt;О Qt&lt;/h3&gt;%1&lt;p&gt;Qt - это инструмент для разработчки крссплатформенных приложений на C++.&lt;/p&gt;&lt;p&gt;Qt предоставляет переносимость между MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux и всеми популярными вариантами коммерческой Unix. Также Qt доступна для встраиваемых устройств в виде Qt for Embedded Linux и Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt - продукт Nokia. Обратитесь к &lt;a href=&quot;http://qtsoftware.com/qt/&quot;&gt;qtsoftware.com/qt/&lt;/a&gt; для получения дополнительной информации.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;This program uses Qt Open Source Edition version %1.&lt;/p&gt;&lt;p&gt;Qt Open Source Edition is intended for the development of Open Source applications. You need a commercial Qt license for development of proprietary (closed source) applications.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qtsoftware.com/company/model/&quot;&gt;qtsoftware.com/company/model/&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;</source>
+ <translation type="obsolete">&lt;p&gt;Данная программа использует Qt Open Source Edition версии %1.&lt;/p&gt;&lt;p&gt;Qt Open Source Edition предназначена для разработки Open Source приложений. Для разработки проприетарных (с закрытым исходным кодом) приложений необходима коммерческая лицензия Qt.&lt;/p&gt;&lt;p&gt;Обратитесь к официальносй странице &lt;a href=&quot;http://qtsoftware.com/company/model/&quot;&gt;qtsoftware.com/company/model/&lt;/a&gt; для ознакомления с моделями лицензирования Qt.&lt;/p&gt;</translation>
</message>
</context>
<context>
@@ -3057,132 +3055,132 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/network/socket/qnativesocketengine.cpp" line="+206"/>
<source>The remote host closed the connection</source>
- <translation type="unfinished"></translation>
+ <translation>Удалённый узел закрыл соединение</translation>
</message>
<message>
<location line="+3"/>
<source>Network operation timed out</source>
- <translation type="unfinished"></translation>
+ <translation>Время на сетевую операцию истекло</translation>
</message>
<message>
<location line="+3"/>
<source>Out of resources</source>
- <translation type="unfinished"></translation>
+ <translation>Недостаточно ресурсов</translation>
</message>
<message>
<location line="+3"/>
<source>Unsupported socket operation</source>
- <translation type="unfinished"></translation>
+ <translation>Операция с сокетом не поддерживается</translation>
</message>
<message>
<location line="+3"/>
<source>Protocol type not supported</source>
- <translation type="unfinished"></translation>
+ <translation>Протокол не поддерживается</translation>
</message>
<message>
<location line="+3"/>
<source>Invalid socket descriptor</source>
- <translation type="unfinished"></translation>
+ <translation>Некорректный дескриптор сокета</translation>
</message>
<message>
<location line="+6"/>
<source>Network unreachable</source>
- <translation type="unfinished"></translation>
+ <translation>Сеть недоступна</translation>
</message>
<message>
<location line="+3"/>
<source>Permission denied</source>
- <translation type="unfinished"></translation>
+ <translation>Доступ запрещён</translation>
</message>
<message>
<location line="+3"/>
<source>Connection timed out</source>
- <translation type="unfinished"></translation>
+ <translation>Время на соединение истекло</translation>
</message>
<message>
<location line="+3"/>
<source>Connection refused</source>
- <translation type="unfinished">Отказано в соединении</translation>
+ <translation>Отказано в соединении</translation>
</message>
<message>
<location line="+3"/>
<source>The bound address is already in use</source>
- <translation type="unfinished"></translation>
+ <translation>Адрес уже используется</translation>
</message>
<message>
<location line="+3"/>
<source>The address is not available</source>
- <translation type="unfinished"></translation>
+ <translation>Адрес недоступен</translation>
</message>
<message>
<location line="+3"/>
<source>The address is protected</source>
- <translation type="unfinished"></translation>
+ <translation>Адрес защищён</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to send a message</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно отправить сообщение</translation>
</message>
<message>
<location line="+3"/>
<source>Unable to receive a message</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно получить сообщение</translation>
</message>
<message>
<location line="+3"/>
<source>Unable to write</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно записать</translation>
</message>
<message>
<location line="+3"/>
<source>Network error</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка сети</translation>
</message>
<message>
<location line="+3"/>
<source>Another socket is already listening on the same port</source>
- <translation type="unfinished"></translation>
+ <translation>Другой сокет уже прослушивает этот порт</translation>
</message>
<message>
<location line="-66"/>
<source>Unable to initialize non-blocking socket</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно инициализировать не-блочный сокет</translation>
</message>
<message>
<location line="+3"/>
<source>Unable to initialize broadcast socket</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно инициализировать широковещательный сокет</translation>
</message>
<message>
<location line="+3"/>
<source>Attempt to use IPv6 socket on a platform with no IPv6 support</source>
- <translation type="unfinished"></translation>
+ <translation>Попытка использовать IPv6 на платформе, не поддерживающей IPv6</translation>
</message>
<message>
<location line="+21"/>
<source>Host unreachable</source>
- <translation type="unfinished"></translation>
+ <translation>Узел недоступен</translation>
</message>
<message>
<location line="+24"/>
<source>Datagram was too large to send</source>
- <translation type="unfinished"></translation>
+ <translation>Датаграмма слишком большая для отправки</translation>
</message>
<message>
<location line="+18"/>
<source>Operation on non-socket</source>
- <translation type="unfinished"></translation>
+ <translation>Операция с не-сокетом</translation>
</message>
<message>
<location line="+6"/>
<source>Unknown error</source>
- <translation type="unfinished">Неизвестная ошибка</translation>
+ <translation>Неизвестная ошибка</translation>
</message>
<message>
<location line="-3"/>
<source>The proxy type is invalid for this operation</source>
- <translation type="unfinished"></translation>
+ <translation>Некорректный тип прокси-сервера для данной операции</translation>
</message>
</context>
<context>
@@ -3190,195 +3188,212 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/network/access/qnetworkaccesscachebackend.cpp" line="+65"/>
<source>Error opening %1</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка открытия %1</translation>
+ </message>
+</context>
+<context>
+ <name>QNetworkAccessDebugPipeBackend</name>
+ <message>
+ <location filename="../src/network/access/qnetworkaccessdebugpipebackend.cpp" line="+191"/>
+ <source>Write error writing to %1: %2</source>
+ <translation type="unfinished">Ошибка записи в %1: %2</translation>
</message>
</context>
<context>
<name>QNetworkAccessFileBackend</name>
<message>
- <location filename="../src/network/access/qnetworkaccessfilebackend.cpp" line="+99"/>
+ <location filename="../src/network/access/qnetworkaccessfilebackend.cpp" line="+100"/>
<source>Request for opening non-local file %1</source>
- <translation type="unfinished"></translation>
+ <translation>Запрос на открытие файла вне файловой системы %1</translation>
</message>
<message>
- <location line="+42"/>
+ <location line="+45"/>
<source>Error opening %1: %2</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка открытия %1: %2</translation>
</message>
<message>
- <location line="+56"/>
+ <location line="+38"/>
<source>Write error writing to %1: %2</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка записи в %1: %2</translation>
</message>
<message>
- <location line="+33"/>
+ <location line="+48"/>
<source>Cannot open %1: Path is a directory</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно открыть %1: Указан путь к каталогу</translation>
</message>
<message>
<location line="+21"/>
<source>Read error reading from %1: %2</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка чтения из %1: %2</translation>
</message>
</context>
<context>
<name>QNetworkAccessFtpBackend</name>
<message>
- <location filename="../src/network/access/qnetworkaccessftpbackend.cpp" line="+165"/>
+ <location filename="../src/network/access/qnetworkaccessftpbackend.cpp" line="+131"/>
<source>No suitable proxy found</source>
- <translation type="unfinished"></translation>
+ <translation>Подходящий прокси-сервер не найден</translation>
</message>
<message>
<location line="+14"/>
<source>Cannot open %1: is a directory</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно открыть %1: Указан путь к каталогу</translation>
</message>
<message>
- <location line="+130"/>
+ <location line="+112"/>
<source>Logging in to %1 failed: authentication required</source>
- <translation type="unfinished"></translation>
+ <translation>Соединение с %1 не удалось: требуется авторизация</translation>
</message>
<message>
<location line="+39"/>
<source>Error while downloading %1: %2</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка в процессе загрузки %1: %2</translation>
</message>
<message>
<location line="+2"/>
<source>Error while uploading %1: %2</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка в процессе отгрузки %1: %2</translation>
</message>
</context>
<context>
<name>QNetworkAccessHttpBackend</name>
<message>
- <location filename="../src/network/access/qnetworkaccesshttpbackend.cpp" line="+597"/>
+ <location filename="../src/network/access/qnetworkaccesshttpbackend.cpp" line="+567"/>
<source>No suitable proxy found</source>
- <translation type="unfinished"></translation>
+ <translation>Подходящий прокси-сервер не найден</translation>
</message>
</context>
<context>
<name>QNetworkReply</name>
<message>
- <location line="+128"/>
+ <location line="+88"/>
<source>Error downloading %1 - server replied: %2</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка загрузки %1 - ответ сервера: %2</translation>
</message>
<message>
- <location filename="../src/network/access/qnetworkreplyimpl.cpp" line="+68"/>
+ <location filename="../src/network/access/qnetworkreplyimpl.cpp" line="+75"/>
<source>Protocol &quot;%1&quot; is unknown</source>
- <translation type="unfinished"></translation>
+ <translation>Неизвестный протокол &quot;%1&quot;</translation>
</message>
</context>
<context>
<name>QNetworkReplyImpl</name>
<message>
- <location line="+432"/>
+ <location line="+459"/>
<location line="+22"/>
<source>Operation canceled</source>
- <translation type="unfinished"></translation>
+ <translation>Операция отменена</translation>
</message>
</context>
<context>
<name>QOCIDriver</name>
<message>
- <location filename="../src/sql/drivers/oci/qsql_oci.cpp" line="+2069"/>
+ <location filename="../src/sql/drivers/oci/qsql_oci.cpp" line="+2079"/>
<source>Unable to logon</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно авторизоваться</translation>
</message>
<message>
<location line="-144"/>
<source>Unable to initialize</source>
<comment>QOCIDriver</comment>
- <translation type="unfinished"></translation>
+ <translation>Невозможно инициализировать</translation>
</message>
<message>
<location line="+215"/>
<source>Unable to begin transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно начать транзакцию</translation>
</message>
<message>
<location line="+19"/>
<source>Unable to commit transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить транзакцию</translation>
</message>
<message>
<location line="+19"/>
<source>Unable to rollback transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно откатить транзакцию</translation>
</message>
</context>
<context>
<name>QOCIResult</name>
<message>
- <location line="-963"/>
+ <location line="-973"/>
<location line="+161"/>
<location line="+15"/>
<source>Unable to bind column for batch execute</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно привязать столбец для пакетного выполнения</translation>
</message>
<message>
<location line="+15"/>
<source>Unable to execute batch statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить пакетное выражение</translation>
</message>
<message>
<location line="+302"/>
<source>Unable to goto next</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно перейти к следующей строке</translation>
</message>
<message>
<location line="+59"/>
<source>Unable to alloc statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно создать выражение</translation>
</message>
<message>
<location line="+15"/>
<source>Unable to prepare statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно подготовить выражение</translation>
</message>
<message>
- <location line="+36"/>
+ <location line="+26"/>
+ <source>Unable to get statement type</source>
+ <translation>Невозможно определить тип выражения</translation>
+ </message>
+ <message>
+ <location line="+20"/>
<source>Unable to bind value</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно привязать результирующие значения</translation>
+ </message>
+ <message>
+ <source>Unable to execute select statement</source>
+ <translation type="obsolete">Невозможно выполнить утверждение SELECT</translation>
</message>
<message>
<location line="+19"/>
<source>Unable to execute statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить выражение</translation>
</message>
</context>
<context>
<name>QODBCDriver</name>
<message>
- <location filename="../src/sql/drivers/odbc/qsql_odbc.cpp" line="+1785"/>
+ <location filename="../src/sql/drivers/odbc/qsql_odbc.cpp" line="+1781"/>
<source>Unable to connect</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно соединиться</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to connect - Driver doesn&apos;t support all needed functionality</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно соединиться - Драйвер не поддерживает требуемый функционал</translation>
</message>
<message>
<location line="+242"/>
<source>Unable to disable autocommit</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно отключить автовыполнение транзакции</translation>
</message>
<message>
<location line="+17"/>
<source>Unable to commit transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить транзакцию</translation>
</message>
<message>
<location line="+17"/>
<source>Unable to rollback transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно откатить транзакцию</translation>
</message>
<message>
<location line="+15"/>
<source>Unable to enable autocommit</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно установить автовыполнение транзакции</translation>
</message>
</context>
<context>
@@ -3387,50 +3402,50 @@ Do you want to delete it anyway?</source>
<location line="-1218"/>
<location line="+349"/>
<source>QODBCResult::reset: Unable to set &apos;SQL_CURSOR_STATIC&apos; as statement attribute. Please check your ODBC driver configuration</source>
- <translation type="unfinished"></translation>
+ <translation>QODBCResult::reset: Невозможно установить &apos;SQL_CURSOR_STATIC&apos; атрибутом выражение. Проверьте настройки драйвера ODBC</translation>
</message>
<message>
<location line="-332"/>
<location line="+626"/>
<source>Unable to execute statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить выражение</translation>
</message>
<message>
<location line="-555"/>
<source>Unable to fetch next</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно получить следующую строку</translation>
</message>
<message>
<location line="+279"/>
<source>Unable to prepare statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно подготовить выражение</translation>
</message>
<message>
<location line="+268"/>
<source>Unable to bind variable</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно привязать значение</translation>
</message>
<message>
<location filename="../src/sql/drivers/db2/qsql_db2.cpp" line="+194"/>
<location filename="../src/sql/drivers/odbc/qsql_odbc.cpp" line="-475"/>
<location line="+578"/>
<source>Unable to fetch last</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно получить последнюю строку</translation>
</message>
<message>
<location filename="../src/sql/drivers/odbc/qsql_odbc.cpp" line="-672"/>
<source>Unable to fetch</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно получить данные</translation>
</message>
<message>
<location line="+44"/>
<source>Unable to fetch first</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно получить первую строку</translation>
</message>
<message>
<location line="+19"/>
<source>Unable to fetch previous</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно получить предыдущую строку</translation>
</message>
</context>
<context>
@@ -3438,61 +3453,58 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/gui/util/qdesktopservices_mac.cpp" line="+165"/>
<source>Home</source>
- <translation type="unfinished">Home</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/access/qnetworkaccessdatabackend.cpp" line="+74"/>
<source>Operation not supported on %1</source>
- <translation type="unfinished"></translation>
+ <translation>Операция не поддерживается для %1</translation>
</message>
<message>
<location line="+53"/>
<source>Invalid URI: %1</source>
- <translation type="unfinished"></translation>
+ <translation>Некорректный URI: %1</translation>
</message>
<message>
- <location filename="../src/network/access/qnetworkaccessdebugpipebackend.cpp" line="+175"/>
<source>Write error writing to %1: %2</source>
- <translation type="unfinished"></translation>
+ <translation type="obsolete">Ошибка записи в %1: %2</translation>
</message>
<message>
- <location line="+57"/>
<source>Read error reading from %1: %2</source>
- <translation type="unfinished"></translation>
+ <translation type="obsolete">Ошибка чтения из %1: %2</translation>
</message>
<message>
- <location line="+31"/>
+ <location filename="../src/network/access/qnetworkaccessdebugpipebackend.cpp" line="+60"/>
<source>Socket error on %1: %2</source>
- <translation type="unfinished"></translation>
+ <translation>Ошика сокета для %1: %2</translation>
</message>
<message>
<location line="+15"/>
<source>Remote host closed the connection prematurely on %1</source>
- <translation type="unfinished"></translation>
+ <translation>Удалённый узел неожиданно прервал соединение для %1</translation>
</message>
<message>
- <location line="+53"/>
<source>Protocol error: packet of size 0 received</source>
- <translation type="unfinished"></translation>
+ <translation type="obsolete">Ошибка протокола: получен пакет нулевого размера</translation>
</message>
<message>
<location filename="../src/network/kernel/qhostinfo.cpp" line="+177"/>
<location line="+57"/>
<source>No host name given</source>
- <translation type="unfinished"></translation>
+ <translation>Имя узла не задано</translation>
</message>
</context>
<context>
<name>QPPDOptionsModel</name>
<message>
- <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="+1195"/>
+ <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="+1197"/>
<source>Name</source>
- <translation type="unfinished">Имя</translation>
+ <translation>Имя</translation>
</message>
<message>
<location line="+2"/>
<source>Value</source>
- <translation type="unfinished"></translation>
+ <translation>Значение</translation>
</message>
</context>
<context>
@@ -3500,32 +3512,32 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/sql/drivers/psql/qsql_psql.cpp" line="+763"/>
<source>Unable to connect</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно соединиться</translation>
</message>
<message>
<location line="+49"/>
<source>Could not begin transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось начать транзакцию</translation>
</message>
<message>
<location line="+17"/>
<source>Could not commit transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось выполнить транзакцию</translation>
</message>
<message>
<location line="+16"/>
<source>Could not rollback transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось откатить транзакцию</translation>
</message>
<message>
<location line="+358"/>
<source>Unable to subscribe</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно подписаться</translation>
</message>
<message>
<location line="+32"/>
<source>Unable to unsubscribe</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно отписаться</translation>
</message>
</context>
<context>
@@ -3533,12 +3545,12 @@ Do you want to delete it anyway?</source>
<message>
<location line="-1058"/>
<source>Unable to create query</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно создать запрос</translation>
</message>
<message>
<location line="+374"/>
<source>Unable to prepare statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно подготовить выражение</translation>
</message>
</context>
<context>
@@ -3546,102 +3558,106 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/gui/dialogs/qpagesetupdialog_unix.cpp" line="+304"/>
<source>Centimeters (cm)</source>
- <translation type="unfinished"></translation>
+ <translation>Сантиметры (cm)</translation>
</message>
<message>
<location line="+0"/>
<source>Millimeters (mm)</source>
- <translation type="unfinished"></translation>
+ <translation>Миллиметры (mm)</translation>
</message>
<message>
<location line="+0"/>
<source>Inches (in)</source>
- <translation type="unfinished"></translation>
+ <translation>Дюймы (in)</translation>
</message>
<message>
<location line="+0"/>
<source>Points (pt)</source>
- <translation type="unfinished"></translation>
+ <translation>Точки (pt)</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qpagesetupwidget.ui"/>
+ <location filename="../src/gui/dialogs/qpagesetupwidget.ui" line="+13"/>
<source>Form</source>
- <translation type="unfinished"></translation>
+ <translation>Форма</translation>
</message>
<message>
- <location/>
+ <location line="+29"/>
<source>Paper</source>
- <translation type="unfinished"></translation>
+ <translation>Бумага</translation>
</message>
<message>
- <location/>
+ <location line="+6"/>
<source>Page size:</source>
- <translation type="unfinished"></translation>
+ <translation>Размер страницы:</translation>
</message>
<message>
- <location/>
+ <location line="+13"/>
<source>Width:</source>
- <translation type="unfinished"></translation>
+ <translation>Ширина:</translation>
</message>
<message>
- <location/>
+ <location line="+19"/>
<source>Height:</source>
- <translation type="unfinished"></translation>
+ <translation>Высота:</translation>
</message>
<message>
- <location/>
+ <location line="+19"/>
<source>Paper source:</source>
- <translation type="unfinished"></translation>
+ <translation>Источник бумаги:</translation>
</message>
<message>
- <location/>
+ <location line="+29"/>
<source>Orientation</source>
- <translation type="unfinished"></translation>
+ <translation>Ориентация страницы</translation>
</message>
<message>
- <location/>
+ <location line="+6"/>
<source>Portrait</source>
- <translation type="unfinished">Портрет</translation>
+ <translation>Книжная</translation>
</message>
<message>
- <location/>
+ <location line="+10"/>
<source>Landscape</source>
- <translation type="unfinished">Альбом</translation>
+ <translation>Альбомная</translation>
</message>
<message>
- <location/>
+ <location line="+7"/>
<source>Reverse landscape</source>
- <translation type="unfinished"></translation>
+ <translation>Перевёрнутая альбомная</translation>
</message>
<message>
- <location/>
+ <location line="+7"/>
<source>Reverse portrait</source>
- <translation type="unfinished"></translation>
+ <translation>Перевёрнутая книжная</translation>
</message>
<message>
- <location/>
+ <location line="+26"/>
<source>Margins</source>
- <translation type="unfinished"></translation>
+ <translation>Поля</translation>
</message>
<message>
- <location/>
+ <location line="+8"/>
+ <location line="+3"/>
<source>top margin</source>
- <translation type="unfinished"></translation>
+ <translation>верхнее поле</translation>
</message>
<message>
- <location/>
+ <location line="+28"/>
+ <location line="+3"/>
<source>left margin</source>
- <translation type="unfinished"></translation>
+ <translation>Левое поле</translation>
</message>
<message>
- <location/>
+ <location line="+29"/>
+ <location line="+3"/>
<source>right margin</source>
- <translation type="unfinished"></translation>
+ <translation>правое поле</translation>
</message>
<message>
- <location/>
+ <location line="+28"/>
+ <location line="+3"/>
<source>bottom margin</source>
- <translation type="unfinished"></translation>
+ <translation>Нижнее поле</translation>
</message>
</context>
<context>
@@ -3649,12 +3665,12 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/corelib/plugin/qpluginloader.cpp" line="+24"/>
<source>Unknown error</source>
- <translation type="unfinished">Неизвестная ошибка</translation>
+ <translation>Неизвестная ошибка</translation>
</message>
<message>
<location line="-68"/>
<source>The plugin was not loaded.</source>
- <translation type="unfinished"></translation>
+ <translation>Модуль не был загружен.</translation>
</message>
</context>
<context>
@@ -3662,13 +3678,13 @@ Do you want to delete it anyway?</source>
<message>
<location filename="../src/gui/painting/qprinterinfo_unix.cpp" line="+98"/>
<source>locally connected</source>
- <translation>локальный</translation>
+ <translation>соединено локально</translation>
</message>
<message>
<location line="+23"/>
<location line="+225"/>
<source>Aliases: %1</source>
- <translation>Алиасы: %1</translation>
+ <translation>Псевдонимы: %1</translation>
</message>
<message>
<location line="+223"/>
@@ -3677,54 +3693,7 @@ Do you want to delete it anyway?</source>
<translation>неизвестно</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qprintdialog_win.cpp" line="+268"/>
- <source>OK</source>
- <translation type="unfinished">OK</translation>
- </message>
- <message>
- <source>Cancel</source>
- <translation type="obsolete">Отмена</translation>
- </message>
- <message>
- <source>Print in color if available</source>
- <translation type="obsolete">Цветная печать</translation>
- </message>
- <message>
- <source>Printer</source>
- <translation type="obsolete">Принтер</translation>
- </message>
- <message>
- <location filename="../src/gui/dialogs/qprintdialog_qws.cpp" line="+375"/>
- <source>Print all</source>
- <translation type="unfinished">Печатать все</translation>
- </message>
- <message>
- <location line="+2"/>
- <source>Print range</source>
- <translation type="unfinished">Печатать диапазон</translation>
- </message>
- <message>
- <source>Print last page first</source>
- <translation type="obsolete">Начать с последней страницы</translation>
- </message>
- <message>
- <source>Number of copies:</source>
- <translation type="obsolete">Число копий:</translation>
- </message>
- <message>
- <source>Paper format</source>
- <translation type="obsolete">Формат бумаги</translation>
- </message>
- <message>
- <source>Portrait</source>
- <translation type="obsolete">Портрет</translation>
- </message>
- <message>
- <source>Landscape</source>
- <translation type="obsolete">Альбом</translation>
- </message>
- <message>
- <location line="-48"/>
+ <location filename="../src/gui/dialogs/qprintdialog_qws.cpp" line="+329"/>
<source>A0 (841 x 1189 mm)</source>
<translation>A0 (841 x 1189 мм)</translation>
</message>
@@ -3744,7 +3713,12 @@ Do you want to delete it anyway?</source>
<translation>A3 (297 x 420 мм)</translation>
</message>
<message>
- <location line="+2"/>
+ <location line="+1"/>
+ <source>A4 (210 x 297 mm, 8.26 x 11.7 inches)</source>
+ <translation>A4 (210 x 297 мм, 8.26 x 11.7 дюймов)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
<source>A5 (148 x 210 mm)</source>
<translation>A5 (148 x 210 мм)</translation>
</message>
@@ -3794,7 +3768,12 @@ Do you want to delete it anyway?</source>
<translation>B4 (250 x 353 мм)</translation>
</message>
<message>
- <location line="+2"/>
+ <location line="+1"/>
+ <source>B5 (176 x 250 mm, 6.93 x 9.84 inches)</source>
+ <translation>B5 (176 x 250 мм, 6.93 x 9.84 дюймов)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
<source>B6 (125 x 176 mm)</source>
<translation>B6 (125 x 176 мм)</translation>
</message>
@@ -3829,7 +3808,12 @@ Do you want to delete it anyway?</source>
<translation>DLE (110 x 220 мм)</translation>
</message>
<message>
- <location line="+2"/>
+ <location line="+1"/>
+ <source>Executive (7.5 x 10 inches, 191 x 254 mm)</source>
+ <translation>Executive (191 x 254 мм, 7.5 x 10 дюймов)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
<source>Folio (210 x 330 mm)</source>
<translation>Folio (210 x 330 мм)</translation>
</message>
@@ -3839,88 +3823,87 @@ Do you want to delete it anyway?</source>
<translation>Ledger (432 x 279 мм)</translation>
</message>
<message>
- <location line="+3"/>
- <source>Tabloid (279 x 432 mm)</source>
- <translation>Tabloid (279 x 432 мм)</translation>
- </message>
- <message>
<location line="+1"/>
- <source>US Common #10 Envelope (105 x 241 mm)</source>
- <translation>Конверт US #10 (105x241 мм)</translation>
- </message>
- <message>
- <location line="-25"/>
- <source>A4 (210 x 297 mm, 8.26 x 11.7 inches)</source>
- <translation type="unfinished"></translation>
+ <source>Legal (8.5 x 14 inches, 216 x 356 mm)</source>
+ <translation>Legal (216 x 356 мм, 8.5 x 14 дюймов)</translation>
</message>
<message>
- <location line="+11"/>
- <source>B5 (176 x 250 mm, 6.93 x 9.84 inches)</source>
- <translation type="unfinished"></translation>
+ <location line="+1"/>
+ <source>Letter (8.5 x 11 inches, 216 x 279 mm)</source>
+ <translation>Letter (216 x 279 мм, 8.5 x 11 дюймов)</translation>
</message>
<message>
- <location line="+8"/>
- <source>Executive (7.5 x 10 inches, 191 x 254 mm)</source>
- <translation type="unfinished"></translation>
+ <location line="+1"/>
+ <source>Tabloid (279 x 432 mm)</source>
+ <translation>Tabloid (279 x 432 мм)</translation>
</message>
<message>
- <location line="+3"/>
- <source>Legal (8.5 x 14 inches, 216 x 356 mm)</source>
- <translation type="unfinished"></translation>
+ <location line="+1"/>
+ <source>US Common #10 Envelope (105 x 241 mm)</source>
+ <translation>Конверт US #10 (105x241 мм)</translation>
</message>
<message>
- <location line="+1"/>
- <source>Letter (8.5 x 11 inches, 216 x 279 mm)</source>
- <translation type="unfinished"></translation>
+ <location filename="../src/gui/dialogs/qprintdialog_win.cpp" line="+268"/>
+ <source>OK</source>
+ <translation>Готово</translation>
</message>
<message>
<location filename="../src/gui/dialogs/qabstractprintdialog.cpp" line="+110"/>
<location line="+13"/>
<location filename="../src/gui/dialogs/qprintdialog_win.cpp" line="-2"/>
<source>Print</source>
- <translation type="unfinished">Print</translation>
- </message>
- <message>
- <source>File</source>
- <translation type="obsolete">Файл</translation>
+ <translation>Печатать</translation>
</message>
<message>
<location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="-357"/>
<source>Print To File ...</source>
- <translation type="unfinished"></translation>
+ <translation>Печатать в файл ...</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qprintdialog_qws.cpp" line="+19"/>
+ <source>Print range</source>
+ <translation>Печатать диапазон</translation>
</message>
<message>
- <location line="+80"/>
+ <location line="-2"/>
+ <source>Print all</source>
+ <translation>Печатать все</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="+80"/>
<source>File %1 is not writable.
Please choose a different file name.</source>
- <translation type="unfinished"></translation>
+ <translation>%1 недоступен для записи.
+Выберите другое имя файла.</translation>
</message>
<message>
<location line="+4"/>
<source>%1 already exists.
Do you want to overwrite it?</source>
- <translation type="unfinished"></translation>
+ <translation>%1 уже существует.
+Хотите заменить его?</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qprintdialog_qws.cpp" line="-208"/>
+ <location filename="../src/gui/dialogs/qprintdialog_qws.cpp" line="-227"/>
<source>File exists</source>
- <translation type="unfinished"></translation>
+ <translation>Файл существует</translation>
</message>
<message>
<location line="+1"/>
<source>&lt;qt&gt;Do you want to overwrite it?&lt;/qt&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;qt&gt;Хотите заменить?&lt;/qt&gt;</translation>
</message>
<message>
<location line="+227"/>
<source>Print selection</source>
- <translation type="unfinished"></translation>
+ <translation>Печатать выделенное</translation>
</message>
<message>
<location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="-8"/>
<source>%1 is a directory.
Please choose a different file name.</source>
- <translation type="unfinished"></translation>
+ <translation>%1 - это каталог.
+Выберите другое имя файла.</translation>
</message>
<message>
<location filename="../src/gui/dialogs/qpagesetupdialog_unix.cpp" line="-232"/>
@@ -4075,48 +4058,48 @@ Please choose a different file name.</source>
<message>
<location line="+1"/>
<source>Custom</source>
- <translation type="unfinished"></translation>
+ <translation>Произвольный</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="-522"/>
+ <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="-524"/>
<location line="+68"/>
<source>&amp;Options &gt;&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Параметры &gt;&gt;</translation>
</message>
<message>
<location line="-63"/>
<source>&amp;Print</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Печатать</translation>
</message>
<message>
<location line="+67"/>
<source>&amp;Options &lt;&lt;</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Параметры &lt;&lt;</translation>
</message>
<message>
<location line="+253"/>
<source>Print to File (PDF)</source>
- <translation type="unfinished"></translation>
+ <translation>Печатать в файл (PDF)</translation>
</message>
<message>
<location line="+1"/>
<source>Print to File (Postscript)</source>
- <translation type="unfinished"></translation>
+ <translation>Печатать в файл (Postscript)</translation>
</message>
<message>
- <location line="+45"/>
+ <location line="+47"/>
<source>Local file</source>
- <translation type="unfinished"></translation>
+ <translation>Локальный файл</translation>
</message>
<message>
<location line="+1"/>
<source>Write %1 file</source>
- <translation type="unfinished"></translation>
+ <translation>Запись %1 файл</translation>
</message>
<message>
<location filename="../src/gui/dialogs/qprintdialog_win.cpp" line="+1"/>
<source>The &apos;From&apos; value cannot be greater than the &apos;To&apos; value.</source>
- <translation type="unfinished"></translation>
+ <translation>Значение &apos;от&apos; не может быть больше значения &apos;до&apos;.</translation>
</message>
</context>
<context>
@@ -4125,345 +4108,333 @@ Please choose a different file name.</source>
<location filename="../src/gui/dialogs/qabstractpagesetupdialog.cpp" line="+68"/>
<location line="+12"/>
<source>Page Setup</source>
- <translation type="unfinished"></translation>
+ <translation>Свойства страницы</translation>
</message>
<message>
- <location filename="../src/gui/dialogs/qprintpreviewdialog.cpp" line="+252"/>
+ <location filename="../src/gui/dialogs/qprintpreviewdialog.cpp" line="+246"/>
<source>%1%</source>
- <translation type="unfinished"></translation>
+ <translation>%1%</translation>
</message>
<message>
- <location line="+79"/>
+ <location line="+68"/>
<source>Print Preview</source>
- <translation type="unfinished"></translation>
+ <translation>Просмотр печати</translation>
</message>
<message>
- <location line="+29"/>
+ <location line="+30"/>
<source>Next page</source>
- <translation type="unfinished"></translation>
+ <translation>Следующая страница</translation>
</message>
<message>
<location line="+1"/>
<source>Previous page</source>
- <translation type="unfinished"></translation>
+ <translation>Предыдущая страница</translation>
</message>
<message>
<location line="+1"/>
<source>First page</source>
- <translation type="unfinished"></translation>
+ <translation>Первая страница</translation>
</message>
<message>
<location line="+1"/>
<source>Last page</source>
- <translation type="unfinished"></translation>
+ <translation>Последняя страница</translation>
</message>
<message>
<location line="+9"/>
<source>Fit width</source>
- <translation type="unfinished"></translation>
+ <translation>По ширине</translation>
</message>
<message>
<location line="+1"/>
<source>Fit page</source>
- <translation type="unfinished"></translation>
+ <translation>На всю страницу</translation>
</message>
<message>
<location line="+11"/>
<source>Zoom in</source>
- <translation type="unfinished"></translation>
+ <translation>Увеличить</translation>
</message>
<message>
<location line="+1"/>
<source>Zoom out</source>
- <translation type="unfinished"></translation>
+ <translation>Уменьшить</translation>
</message>
<message>
<location line="+6"/>
<source>Portrait</source>
- <translation type="unfinished">Портрет</translation>
+ <translation>Книжная</translation>
</message>
<message>
<location line="+1"/>
<source>Landscape</source>
- <translation type="unfinished">Альбом</translation>
+ <translation>Альбомная</translation>
</message>
<message>
<location line="+10"/>
<source>Show single page</source>
- <translation type="unfinished"></translation>
+ <translation>Показать одну страницу</translation>
</message>
<message>
<location line="+1"/>
<source>Show facing pages</source>
- <translation type="unfinished"></translation>
+ <translation>Показать титульные страницы</translation>
</message>
<message>
<location line="+1"/>
<source>Show overview of all pages</source>
- <translation type="unfinished"></translation>
+ <translation>Показать обзор всех страниц</translation>
</message>
<message>
<location line="+15"/>
<source>Print</source>
- <translation type="unfinished">Print</translation>
+ <translation>Печатать</translation>
</message>
<message>
<location line="+1"/>
<source>Page setup</source>
- <translation type="unfinished"></translation>
+ <translation>Свойства страницы</translation>
</message>
<message>
- <location line="+1"/>
<source>Close</source>
- <translation type="unfinished">Закрыть</translation>
+ <translation type="obsolete">Закрыть</translation>
</message>
<message>
- <location line="+151"/>
+ <location line="+150"/>
<source>Export to PDF</source>
- <translation type="unfinished"></translation>
+ <translation>Экспорт в PDF</translation>
</message>
<message>
<location line="+3"/>
<source>Export to PostScript</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>QPrintPropertiesDialog</name>
- <message>
- <source>Save</source>
- <translation type="obsolete">Сохранить</translation>
- </message>
- <message>
- <source>OK</source>
- <translation type="obsolete">OK</translation>
+ <translation>Экспорт в Postscript</translation>
</message>
</context>
<context>
<name>QPrintPropertiesWidget</name>
<message>
- <location filename="../src/gui/dialogs/qprintpropertieswidget.ui"/>
+ <location filename="../src/gui/dialogs/qprintpropertieswidget.ui" line="+13"/>
<source>Form</source>
- <translation type="unfinished"></translation>
+ <translation>Форма</translation>
</message>
<message>
- <location/>
+ <location line="+21"/>
<source>Page</source>
- <translation type="unfinished"></translation>
+ <translation>Страница</translation>
</message>
<message>
- <location/>
+ <location line="+10"/>
<source>Advanced</source>
- <translation type="unfinished"></translation>
+ <translation>Дополнительно</translation>
</message>
</context>
<context>
<name>QPrintSettingsOutput</name>
<message>
- <location filename="../src/gui/dialogs/qprintsettingsoutput.ui"/>
+ <location filename="../src/gui/dialogs/qprintsettingsoutput.ui" line="+13"/>
<source>Form</source>
- <translation type="unfinished"></translation>
+ <translation>Форма</translation>
</message>
<message>
- <location/>
+ <location line="+21"/>
<source>Copies</source>
- <translation type="unfinished"></translation>
+ <translation>Копии</translation>
</message>
<message>
- <location/>
+ <location line="+12"/>
<source>Print range</source>
- <translation type="unfinished">Печатать диапазон</translation>
+ <translation>Печатать диапазон</translation>
</message>
<message>
- <location/>
+ <location line="+12"/>
<source>Print all</source>
- <translation type="unfinished">Печатать все</translation>
+ <translation>Печатать все</translation>
</message>
<message>
- <location/>
+ <location line="+18"/>
<source>Pages from</source>
- <translation type="unfinished"></translation>
+ <translation>Страницы от</translation>
</message>
<message>
- <location/>
+ <location line="+20"/>
<source>to</source>
- <translation type="unfinished"></translation>
+ <translation>до</translation>
</message>
<message>
- <location/>
+ <location line="+35"/>
<source>Selection</source>
- <translation type="unfinished"></translation>
+ <translation>Выделенные</translation>
</message>
<message>
- <location/>
+ <location line="+23"/>
<source>Output Settings</source>
- <translation type="unfinished"></translation>
+ <translation>Настройки вывода</translation>
</message>
<message>
- <location/>
+ <location line="+6"/>
<source>Copies:</source>
- <translation type="unfinished"></translation>
+ <translation>Количество копий:</translation>
</message>
<message>
- <location/>
+ <location line="+33"/>
<source>Collate</source>
- <translation type="unfinished"></translation>
+ <translation>Разобрать про копиям</translation>
</message>
<message>
- <location/>
+ <location line="+17"/>
<source>Reverse</source>
- <translation type="unfinished"></translation>
+ <translation>Обратный порядок</translation>
</message>
<message>
- <location/>
+ <location line="+32"/>
<source>Options</source>
- <translation type="unfinished">Параметры</translation>
+ <translation>Параметры</translation>
</message>
<message>
- <location/>
+ <location line="+6"/>
<source>Color Mode</source>
- <translation type="unfinished"></translation>
+ <translation>Режим цвета</translation>
</message>
<message>
- <location/>
+ <location line="+19"/>
<source>Color</source>
- <translation type="unfinished"></translation>
+ <translation>Цвет</translation>
</message>
<message>
- <location/>
+ <location line="+10"/>
<source>Grayscale</source>
- <translation type="unfinished"></translation>
+ <translation>Оттенки серого</translation>
</message>
<message>
- <location/>
+ <location line="+10"/>
<source>Duplex Printing</source>
- <translation type="unfinished"></translation>
+ <translation>Двусторонняя печать</translation>
</message>
<message>
- <location/>
+ <location line="+6"/>
<source>None</source>
- <translation type="unfinished"></translation>
+ <translation>Нет</translation>
</message>
<message>
- <location/>
+ <location line="+10"/>
<source>Long side</source>
- <translation type="unfinished"></translation>
+ <translation>По длинной стороне</translation>
</message>
<message>
- <location/>
+ <location line="+7"/>
<source>Short side</source>
- <translation type="unfinished"></translation>
+ <translation>По короткой стороне</translation>
</message>
</context>
<context>
<name>QPrintWidget</name>
<message>
- <location filename="../src/gui/dialogs/qprintwidget.ui"/>
+ <location filename="../src/gui/dialogs/qprintwidget.ui" line="+13"/>
<source>Form</source>
- <translation type="unfinished"></translation>
+ <translation>Форма</translation>
</message>
<message>
- <location/>
+ <location line="+9"/>
<source>Printer</source>
- <translation type="unfinished">Принтер</translation>
+ <translation>Принтер</translation>
</message>
<message>
- <location/>
+ <location line="+6"/>
<source>&amp;Name:</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Имя:</translation>
</message>
<message>
- <location/>
+ <location line="+26"/>
<source>P&amp;roperties</source>
- <translation type="unfinished"></translation>
+ <translation>С&amp;войства</translation>
</message>
<message>
- <location/>
+ <location line="+7"/>
<source>Location:</source>
- <translation type="unfinished"></translation>
+ <translation>Положение:</translation>
</message>
<message>
- <location/>
+ <location line="+10"/>
<source>Preview</source>
- <translation type="unfinished"></translation>
+ <translation>Предпросмотр</translation>
</message>
<message>
- <location/>
+ <location line="+7"/>
<source>Type:</source>
- <translation type="unfinished"></translation>
+ <translation>Тип:</translation>
</message>
<message>
- <location/>
+ <location line="+10"/>
<source>Output &amp;file:</source>
- <translation type="unfinished"></translation>
+ <translation>Выходной &amp;файл:</translation>
</message>
<message>
- <location/>
+ <location line="+15"/>
<source>...</source>
- <translation type="unfinished"></translation>
+ <translation>...</translation>
</message>
</context>
<context>
<name>QProcess</name>
<message>
- <location filename="../src/corelib/io/qprocess_unix.cpp" line="+475"/>
+ <location filename="../src/corelib/io/qprocess_unix.cpp" line="+459"/>
<location filename="../src/corelib/io/qprocess_win.cpp" line="+147"/>
<source>Could not open input redirection for reading</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось открыть перенаправление ввода для чтения</translation>
</message>
<message>
<location line="+12"/>
<location filename="../src/corelib/io/qprocess_win.cpp" line="+36"/>
<source>Could not open output redirection for writing</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось открыть перенаправление вывода для записи</translation>
</message>
<message>
- <location line="+235"/>
+ <location line="+239"/>
<source>Resource error (fork failure): %1</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка выделения ресурсов (fork не удался): %1</translation>
</message>
<message>
<location line="+259"/>
<location line="+53"/>
<location line="+74"/>
<location line="+67"/>
- <location filename="../src/corelib/io/qprocess_win.cpp" line="+422"/>
+ <location filename="../src/corelib/io/qprocess_win.cpp" line="+447"/>
<location line="+50"/>
<location line="+75"/>
<location line="+42"/>
<location line="+54"/>
<source>Process operation timed out</source>
- <translation type="unfinished"></translation>
+ <translation>Время на операцию с процессом истекло</translation>
</message>
<message>
- <location filename="../src/corelib/io/qprocess.cpp" line="+533"/>
+ <location filename="../src/corelib/io/qprocess.cpp" line="+558"/>
<location line="+52"/>
<location filename="../src/corelib/io/qprocess_win.cpp" line="-211"/>
<location line="+50"/>
<source>Error reading from process</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка получения данных от процесса</translation>
</message>
<message>
<location line="+47"/>
- <location line="+779"/>
+ <location line="+833"/>
<location filename="../src/corelib/io/qprocess_win.cpp" line="+140"/>
<source>Error writing to process</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка отправки данных процессу</translation>
</message>
<message>
- <location line="-709"/>
+ <location line="-763"/>
<source>Process crashed</source>
- <translation type="unfinished"></translation>
+ <translation>Процесс завершился с ошибкой</translation>
</message>
<message>
- <location line="+912"/>
+ <location line="+966"/>
<source>No program defined</source>
- <translation type="unfinished"></translation>
+ <translation>Программа не указана</translation>
</message>
<message>
<location filename="../src/corelib/io/qprocess_win.cpp" line="-341"/>
<source>Process failed to start</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось запустить процесс</translation>
</message>
</context>
<context>
@@ -4479,7 +4450,7 @@ Please choose a different file name.</source>
<message>
<location filename="../src/plugins/accessible/widgets/simplewidgets.cpp" line="-8"/>
<source>Open</source>
- <translation type="unfinished">Открыть</translation>
+ <translation>Открыть</translation>
</message>
</context>
<context>
@@ -4487,7 +4458,7 @@ Please choose a different file name.</source>
<message>
<location line="+12"/>
<source>Check</source>
- <translation type="unfinished"></translation>
+ <translation>Отметить</translation>
</message>
</context>
<context>
@@ -4500,22 +4471,22 @@ Please choose a different file name.</source>
<message>
<location line="+1"/>
<source>disabled feature used</source>
- <translation>использовались отключенные возможности</translation>
+ <translation>использование отключённых возможностей</translation>
</message>
<message>
<location line="+1"/>
<source>bad char class syntax</source>
- <translation>bad char class syntax</translation>
+ <translation>неправильный синтаксис класса символов</translation>
</message>
<message>
<location line="+1"/>
<source>bad lookahead syntax</source>
- <translation>bad lookahead syntax</translation>
+ <translation>неправильный предварительный синтаксис</translation>
</message>
<message>
<location line="+1"/>
<source>bad repetition syntax</source>
- <translation>bad repetition syntax</translation>
+ <translation>неправильный синтаксис повторения</translation>
</message>
<message>
<location line="+1"/>
@@ -4543,22 +4514,22 @@ Please choose a different file name.</source>
<message>
<location filename="../src/sql/drivers/sqlite2/qsql_sqlite2.cpp" line="+396"/>
<source>Error to open database</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно открыть базу данных</translation>
</message>
<message>
<location line="+41"/>
<source>Unable to begin transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно начать транзакцию</translation>
</message>
<message>
<location line="+17"/>
<source>Unable to commit transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить транзакцию</translation>
</message>
<message>
<location line="+17"/>
<source>Unable to rollback Transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно откатить транзакцию</translation>
</message>
</context>
<context>
@@ -4566,12 +4537,12 @@ Please choose a different file name.</source>
<message>
<location line="-323"/>
<source>Unable to fetch results</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно получить результат</translation>
</message>
<message>
<location line="+147"/>
<source>Unable to execute statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить выражение</translation>
</message>
</context>
<context>
@@ -4579,27 +4550,27 @@ Please choose a different file name.</source>
<message>
<location filename="../src/sql/drivers/sqlite/qsql_sqlite.cpp" line="+528"/>
<source>Error opening database</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно открыть базу данных</translation>
</message>
<message>
<location line="+11"/>
<source>Error closing database</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно закрыть базу данных</translation>
</message>
<message>
<location line="+20"/>
<source>Unable to begin transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно начать транзакцию</translation>
</message>
<message>
<location line="+15"/>
<source>Unable to commit transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить транзакцию</translation>
</message>
<message>
<location line="+15"/>
<source>Unable to rollback transaction</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно откатить транзакцию</translation>
</message>
</context>
<context>
@@ -4609,32 +4580,32 @@ Please choose a different file name.</source>
<location line="+66"/>
<location line="+8"/>
<source>Unable to fetch row</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно получить строку</translation>
</message>
<message>
<location line="+63"/>
<source>Unable to execute statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно выполнить выражение</translation>
</message>
<message>
<location line="+20"/>
<source>Unable to reset statement</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно сбросить выражение</translation>
</message>
<message>
<location line="+45"/>
<source>Unable to bind parameters</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно привязать параметр</translation>
</message>
<message>
<location line="+7"/>
<source>Parameter count mismatch</source>
- <translation type="unfinished"></translation>
+ <translation>Количество параметров не совпадает</translation>
</message>
<message>
<location line="-208"/>
<source>No query</source>
- <translation type="unfinished"></translation>
+ <translation>Отсутствует запрос</translation>
</message>
</context>
<context>
@@ -4642,302 +4613,302 @@ Please choose a different file name.</source>
<message>
<location filename="../src/gui/widgets/qscrollbar.cpp" line="+448"/>
<source>Scroll here</source>
- <translation type="unfinished"></translation>
+ <translation>Прокрутить сюда</translation>
</message>
<message>
<location line="+2"/>
<source>Left edge</source>
- <translation type="unfinished"></translation>
+ <translation>К левой границе</translation>
</message>
<message>
<location line="+0"/>
<source>Top</source>
- <translation type="unfinished"></translation>
+ <translation>Вверх</translation>
</message>
<message>
<location line="+1"/>
<source>Right edge</source>
- <translation type="unfinished"></translation>
+ <translation>К правой границе</translation>
</message>
<message>
<location line="+0"/>
<source>Bottom</source>
- <translation type="unfinished"></translation>
+ <translation>Вниз</translation>
</message>
<message>
<location line="+2"/>
<source>Page left</source>
- <translation type="unfinished"></translation>
+ <translation>На страницу влево</translation>
</message>
<message>
<location line="+0"/>
<location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="+143"/>
<source>Page up</source>
- <translation type="unfinished"></translation>
+ <translation>На страницу вверх</translation>
</message>
<message>
<location line="+1"/>
<source>Page right</source>
- <translation type="unfinished"></translation>
+ <translation>На страницу вправо</translation>
</message>
<message>
<location line="+0"/>
<location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="+4"/>
<source>Page down</source>
- <translation type="unfinished"></translation>
+ <translation>На страницу вниз</translation>
</message>
<message>
<location line="+2"/>
<source>Scroll left</source>
- <translation type="unfinished"></translation>
+ <translation>Прокрутить влево</translation>
</message>
<message>
<location line="+0"/>
<source>Scroll up</source>
- <translation type="unfinished"></translation>
+ <translation>Прокрутить вверх</translation>
</message>
<message>
<location line="+1"/>
<source>Scroll right</source>
- <translation type="unfinished"></translation>
+ <translation>Прокрутить вправо</translation>
</message>
<message>
<location line="+0"/>
<source>Scroll down</source>
- <translation type="unfinished"></translation>
+ <translation>Прокрутить вниз</translation>
</message>
<message>
<location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="-6"/>
<source>Line up</source>
- <translation type="unfinished">Выровнять</translation>
+ <translation>На строку вверх</translation>
</message>
<message>
<location line="+4"/>
<source>Position</source>
- <translation type="unfinished"></translation>
+ <translation>Позиция</translation>
</message>
<message>
<location line="+4"/>
<source>Line down</source>
- <translation type="unfinished"></translation>
+ <translation>На строку вниз</translation>
</message>
</context>
<context>
<name>QSharedMemory</name>
<message>
- <location filename="../src/corelib/kernel/qsharedmemory.cpp" line="+207"/>
+ <location filename="../src/corelib/kernel/qsharedmemory.cpp" line="+211"/>
<source>%1: unable to set key on lock</source>
- <translation type="unfinished"></translation>
+ <translation>%1: невозможно установить ключ на блокировку</translation>
</message>
<message>
<location line="+81"/>
<source>%1: create size is less then 0</source>
- <translation type="unfinished"></translation>
+ <translation>%1: размер меньше нуля</translation>
</message>
<message>
<location line="+168"/>
<location filename="../src/corelib/kernel/qsharedmemory_p.h" line="+148"/>
<source>%1: unable to lock</source>
- <translation type="unfinished"></translation>
+ <translation>%1: невозможно заблокировать</translation>
</message>
<message>
<location line="+22"/>
<source>%1: unable to unlock</source>
- <translation type="unfinished"></translation>
+ <translation>%1: невозможно разблокировать</translation>
</message>
<message>
- <location filename="../src/corelib/kernel/qsharedmemory_unix.cpp" line="+78"/>
+ <location filename="../src/corelib/kernel/qsharedmemory_unix.cpp" line="+80"/>
<location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+87"/>
<source>%1: permission denied</source>
- <translation type="unfinished"></translation>
+ <translation>%1: доступ запрещён</translation>
</message>
<message>
<location line="+4"/>
<location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="-22"/>
<source>%1: already exists</source>
- <translation type="unfinished"></translation>
+ <translation>%1: уже существует</translation>
</message>
<message>
<location line="+4"/>
<location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+9"/>
<source>%1: doesn&apos;t exists</source>
- <translation type="unfinished"></translation>
+ <translation>%1: не существует</translation>
</message>
<message>
<location line="+6"/>
<location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+9"/>
<source>%1: out of resources</source>
- <translation type="unfinished"></translation>
+ <translation>%1: недостаточно ресурсов</translation>
</message>
<message>
<location line="+4"/>
<location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+7"/>
<source>%1: unknown error %2</source>
- <translation type="unfinished"></translation>
+ <translation>%1: неизвестная ошибка %2</translation>
</message>
<message>
<location line="+21"/>
<source>%1: key is empty</source>
- <translation type="unfinished"></translation>
+ <translation>%1: пустой ключ</translation>
</message>
<message>
<location line="+8"/>
<source>%1: unix key file doesn&apos;t exists</source>
- <translation type="unfinished"></translation>
+ <translation>%1: специфический ключ unix не существует</translation>
</message>
<message>
<location line="+7"/>
<source>%1: ftok failed</source>
- <translation type="unfinished"></translation>
+ <translation>%1: ошибка ftok</translation>
</message>
<message>
<location line="+51"/>
<location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+15"/>
<source>%1: unable to make key</source>
- <translation type="unfinished"></translation>
+ <translation>%1: невозможно создать ключ</translation>
</message>
<message>
<location line="+20"/>
<source>%1: system-imposed size restrictions</source>
- <translation type="unfinished"></translation>
+ <translation>%1: системой наложены ограничения на размер</translation>
</message>
<message>
<location line="+53"/>
<source>%1: not attached</source>
- <translation type="unfinished"></translation>
+ <translation>%1: не приложенный</translation>
</message>
<message>
<location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="-27"/>
<source>%1: invalid size</source>
- <translation type="unfinished"></translation>
+ <translation>%1: некорректный размер</translation>
</message>
<message>
<location line="+68"/>
<source>%1: key error</source>
- <translation type="unfinished"></translation>
+ <translation>%1: некорректный ключ</translation>
</message>
<message>
<location line="+38"/>
<source>%1: size query failed</source>
- <translation type="unfinished"></translation>
+ <translation>%1: не удалось запросить размер</translation>
</message>
</context>
<context>
<name>QShortcut</name>
<message>
- <location filename="../src/gui/kernel/qkeysequence.cpp" line="+373"/>
+ <location filename="../src/gui/kernel/qkeysequence.cpp" line="+394"/>
<source>Space</source>
- <translation type="unfinished">Space</translation>
+ <translation type="unfinished">Пробел</translation>
</message>
<message>
<location line="+1"/>
<source>Esc</source>
- <translation type="unfinished">Esc</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Tab</source>
- <translation type="unfinished">Tab</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Backtab</source>
- <translation type="unfinished">Backtab</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Backspace</source>
- <translation type="unfinished">Backspace</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Return</source>
- <translation type="unfinished">Return</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Enter</source>
- <translation type="unfinished">Enter</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Ins</source>
- <translation type="unfinished">Ins</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Del</source>
- <translation type="unfinished">Del</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Pause</source>
- <translation type="unfinished">Pause</translation>
+ <translation type="unfinished">Пауза</translation>
</message>
<message>
<location line="+1"/>
<source>Print</source>
- <translation type="unfinished">Print</translation>
+ <translation type="unfinished">Печатать</translation>
</message>
<message>
<location line="+1"/>
<source>SysReq</source>
- <translation type="unfinished">SysReq</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Home</source>
- <translation type="unfinished">Home</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>End</source>
- <translation type="unfinished">End</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Left</source>
- <translation type="unfinished">Left</translation>
+ <translation type="unfinished">Влево</translation>
</message>
<message>
<location line="+1"/>
<source>Up</source>
- <translation type="unfinished">Up</translation>
+ <translation type="unfinished">Вверх</translation>
</message>
<message>
<location line="+1"/>
<source>Right</source>
- <translation type="unfinished">Right</translation>
+ <translation type="unfinished">Вправо</translation>
</message>
<message>
<location line="+1"/>
<source>Down</source>
- <translation type="unfinished">Down</translation>
+ <translation type="unfinished">Вниз</translation>
</message>
<message>
<location line="+1"/>
<source>PgUp</source>
- <translation type="unfinished">PgUp</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>PgDown</source>
- <translation type="unfinished">PgDown</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>CapsLock</source>
- <translation type="unfinished">CapsLock</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>NumLock</source>
- <translation type="unfinished">NumLock</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>ScrollLock</source>
- <translation type="unfinished">ScrollLock</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
@@ -4962,7 +4933,7 @@ Please choose a different file name.</source>
<message>
<location line="+1"/>
<source>Stop</source>
- <translation type="unfinished">Стоп</translation>
+ <translation type="unfinished">Остановить</translation>
</message>
<message>
<location line="+1"/>
@@ -4972,72 +4943,72 @@ Please choose a different file name.</source>
<message>
<location line="+1"/>
<source>Volume Down</source>
- <translation type="unfinished">Тише</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Volume Mute</source>
- <translation type="unfinished">Выключить звук</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Volume Up</source>
- <translation type="unfinished">Громче</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Bass Boost</source>
- <translation type="unfinished">Bass Boost</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Bass Up</source>
- <translation type="unfinished">Bass Up</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Bass Down</source>
- <translation type="unfinished">Bass Down</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Treble Up</source>
- <translation type="unfinished">Treble Up</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Treble Down</source>
- <translation type="unfinished">Treble Down</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Media Play</source>
- <translation type="unfinished">Воспроизведение</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Media Stop</source>
- <translation type="unfinished">Остановить воспроизведение</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Media Previous</source>
- <translation type="unfinished">Воспроизвести предыдущее</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Media Next</source>
- <translation type="unfinished">Воспроизвести следующее</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Media Record</source>
- <translation type="unfinished">Запись</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Favorites</source>
- <translation type="unfinished">Избранное</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
@@ -5047,102 +5018,102 @@ Please choose a different file name.</source>
<message>
<location line="+1"/>
<source>Standby</source>
- <translation type="unfinished">Дежурный режим</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Open URL</source>
- <translation type="unfinished">Открыть URL</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch Mail</source>
- <translation type="unfinished">Почта</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch Media</source>
- <translation type="unfinished">Проигрыватель</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (0)</source>
- <translation type="unfinished">Запустить (0)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (1)</source>
- <translation type="unfinished">Запустить (1)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (2)</source>
- <translation type="unfinished">Запустить (2)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (3)</source>
- <translation type="unfinished">Запустить (3)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (4)</source>
- <translation type="unfinished">Запустить (4)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (5)</source>
- <translation type="unfinished">Запустить (5)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (6)</source>
- <translation type="unfinished">Запустить (6)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (7)</source>
- <translation type="unfinished">Запустить (7)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (8)</source>
- <translation type="unfinished">Запустить (8)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (9)</source>
- <translation type="unfinished">Запустить (9)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (A)</source>
- <translation type="unfinished">Запустить (A)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (B)</source>
- <translation type="unfinished">Запустить (B)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (C)</source>
- <translation type="unfinished">Запустить (C)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (D)</source>
- <translation type="unfinished">Запустить (D)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (E)</source>
- <translation type="unfinished">Запустить (E)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Launch (F)</source>
- <translation type="unfinished">Запустить (F)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
@@ -5182,12 +5153,12 @@ Please choose a different file name.</source>
<message>
<location line="+1"/>
<source>Insert</source>
- <translation type="unfinished">Вставить</translation>
+ <translation type="unfinished">Вставка</translation>
</message>
<message>
<location line="+1"/>
<source>Delete</source>
- <translation type="unfinished">Удалить</translation>
+ <translation type="unfinished">Удаление</translation>
</message>
<message>
<location line="+1"/>
@@ -5250,41 +5221,41 @@ Please choose a different file name.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+527"/>
- <location line="+122"/>
+ <location line="+559"/>
+ <location line="+135"/>
<source>Ctrl</source>
- <translation type="unfinished">Ctrl</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location line="-121"/>
- <location line="+125"/>
+ <location line="-134"/>
+ <location line="+138"/>
<source>Shift</source>
- <translation type="unfinished">Shift</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location line="-124"/>
- <location line="+122"/>
+ <location line="-137"/>
+ <location line="+135"/>
<source>Alt</source>
- <translation type="unfinished">Alt</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location line="-121"/>
- <location line="+117"/>
+ <location line="-134"/>
+ <location line="+130"/>
<source>Meta</source>
- <translation type="unfinished">Meta</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location line="-25"/>
+ <location line="-40"/>
<source>+</source>
- <translation type="unfinished">+</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location line="+46"/>
+ <location line="+61"/>
<source>F%1</source>
- <translation type="unfinished">F%1</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location line="-720"/>
+ <location line="-765"/>
<source>Home Page</source>
<translation type="unfinished"></translation>
</message>
@@ -5294,27 +5265,27 @@ Please choose a different file name.</source>
<message>
<location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="+151"/>
<source>Page left</source>
- <translation type="unfinished"></translation>
+ <translation>Страница влево</translation>
</message>
<message>
<location line="+0"/>
<source>Page up</source>
- <translation type="unfinished"></translation>
+ <translation>Страница вверх</translation>
</message>
<message>
<location line="+2"/>
<source>Position</source>
- <translation type="unfinished"></translation>
+ <translation>Позиция</translation>
</message>
<message>
<location line="+3"/>
<source>Page right</source>
- <translation type="unfinished"></translation>
+ <translation>Страница вправо</translation>
</message>
<message>
<location line="+0"/>
<source>Page down</source>
- <translation type="unfinished"></translation>
+ <translation>Страница вниз</translation>
</message>
</context>
<context>
@@ -5322,72 +5293,72 @@ Please choose a different file name.</source>
<message>
<location filename="../src/network/socket/qsocks5socketengine.cpp" line="-67"/>
<source>Connection to proxy refused</source>
- <translation type="unfinished"></translation>
+ <translation>В соединении прокси-сервером отказано</translation>
</message>
<message>
<location line="+4"/>
<source>Connection to proxy closed prematurely</source>
- <translation type="unfinished"></translation>
+ <translation>Соединение с прокси-сервером неожиданно закрыто</translation>
</message>
<message>
<location line="+4"/>
<source>Proxy host not found</source>
- <translation type="unfinished"></translation>
+ <translation>Прокси-сервер не найден</translation>
</message>
<message>
<location line="+5"/>
<source>Connection to proxy timed out</source>
- <translation type="unfinished"></translation>
+ <translation>Время на соединение с прокси-сервером истекло</translation>
</message>
<message>
<location line="+17"/>
<source>Proxy authentication failed</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось авторизоваться на прокси-сервере</translation>
</message>
<message>
<location line="+1"/>
<source>Proxy authentication failed: %1</source>
- <translation type="unfinished"></translation>
+ <translation>Не удалось авторизоваться на прокси-сервере: %1</translation>
</message>
<message>
<location line="+9"/>
<source>SOCKS version 5 protocol error</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка протокола SOCKSv5</translation>
</message>
<message>
<location line="+19"/>
<source>General SOCKSv5 server failure</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка сервере SOCKSv5</translation>
</message>
<message>
<location line="+4"/>
<source>Connection not allowed by SOCKSv5 server</source>
- <translation type="unfinished"></translation>
+ <translation>Соединение не разрешено сервером SOCKSv5</translation>
</message>
<message>
<location line="+16"/>
<source>TTL expired</source>
- <translation type="unfinished"></translation>
+ <translation>TTL истекло</translation>
</message>
<message>
<location line="+4"/>
<source>SOCKSv5 command not supported</source>
- <translation type="unfinished"></translation>
+ <translation>Команда SOCKSv5 не поддерживается</translation>
</message>
<message>
<location line="+4"/>
<source>Address type not supported</source>
- <translation type="unfinished"></translation>
+ <translation>Тип адреса не поддерживается</translation>
</message>
<message>
<location line="+5"/>
<source>Unknown SOCKSv5 proxy error code 0x%1</source>
- <translation type="unfinished"></translation>
+ <translation>Неизвестная ошибка SOCKSv5 прокси (код 0x%1)</translation>
</message>
<message>
<location line="+685"/>
<source>Network operation timed out</source>
- <translation type="unfinished"></translation>
+ <translation>Время на сетевую операцию истекло</translation>
</message>
</context>
<context>
@@ -5395,12 +5366,12 @@ Please choose a different file name.</source>
<message>
<location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="-574"/>
<source>More</source>
- <translation type="unfinished"></translation>
+ <translation>Больше</translation>
</message>
<message>
<location line="+2"/>
<source>Less</source>
- <translation type="unfinished"></translation>
+ <translation>Меньше</translation>
</message>
</context>
<context>
@@ -5413,7 +5384,7 @@ Please choose a different file name.</source>
<message>
<location line="+1"/>
<source>Delete this record?</source>
- <translation>Удалить эту запись?</translation>
+ <translation>Удалить данную запись?</translation>
</message>
<message>
<location line="+1"/>
@@ -5452,7 +5423,7 @@ Please choose a different file name.</source>
<message>
<location line="+32"/>
<source>Confirm</source>
- <translation>Подтвердить</translation>
+ <translation>Подтверждение</translation>
</message>
<message>
<location line="+1"/>
@@ -5465,12 +5436,12 @@ Please choose a different file name.</source>
<message>
<location filename="../src/network/ssl/qsslsocket_openssl.cpp" line="+569"/>
<source>Unable to write data: %1</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно записать данные: %1</translation>
</message>
<message>
<location line="+119"/>
<source>Error while reading: %1</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка чтения: %1</translation>
</message>
<message>
<location line="+96"/>
@@ -5490,12 +5461,12 @@ Please choose a different file name.</source>
<message>
<location line="+62"/>
<source>Error creating SSL session, %1</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка создания SSL-сессии, %1</translation>
</message>
<message>
<location line="+15"/>
<source>Error creating SSL session: %1</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка создания SSL-сессии: %1</translation>
</message>
<message>
<location line="-61"/>
@@ -5505,12 +5476,12 @@ Please choose a different file name.</source>
<message>
<location line="+7"/>
<source>Error loading local certificate, %1</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка загрузки локального сертификата, %1</translation>
</message>
<message>
<location line="+12"/>
<source>Error loading private key, %1</source>
- <translation type="unfinished"></translation>
+ <translation>Ошибка загрузки приватного ключа, %1</translation>
</message>
<message>
<location line="+7"/>
@@ -5519,34 +5490,57 @@ Please choose a different file name.</source>
</message>
</context>
<context>
+ <name>QStateMachine</name>
+ <message>
+ <location filename="../src/corelib/statemachine/qstatemachine.cpp" line="+1003"/>
+ <source>Missing initial state in compound state &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Missing default state in history state &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>No common ancestor for targets and source of transition from state &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>Unknown error</source>
+ <translation type="unfinished">Неизвестная ошибка</translation>
+ </message>
+</context>
+<context>
<name>QSystemSemaphore</name>
<message>
<location filename="../src/corelib/kernel/qsystemsemaphore_unix.cpp" line="-41"/>
<location filename="../src/corelib/kernel/qsystemsemaphore_win.cpp" line="+66"/>
<source>%1: out of resources</source>
- <translation type="unfinished"></translation>
+ <translation>%1: недостаточно ресурсов</translation>
</message>
<message>
<location line="-13"/>
<location filename="../src/corelib/kernel/qsystemsemaphore_win.cpp" line="+4"/>
<source>%1: permission denied</source>
- <translation type="unfinished"></translation>
+ <translation>%1: доступ запрещён</translation>
</message>
<message>
<location line="+4"/>
<source>%1: already exists</source>
- <translation type="unfinished"></translation>
+ <translation>%1: уже существует</translation>
</message>
<message>
<location line="+4"/>
<source>%1: does not exist</source>
- <translation type="unfinished"></translation>
+ <translation>%1: не существует</translation>
</message>
<message>
<location line="+9"/>
<location filename="../src/corelib/kernel/qsystemsemaphore_win.cpp" line="+3"/>
<source>%1: unknown error %2</source>
- <translation type="unfinished"></translation>
+ <translation>%1: неизвестная ошибка %2</translation>
</message>
</context>
<context>
@@ -5554,12 +5548,12 @@ Please choose a different file name.</source>
<message>
<location filename="../src/sql/drivers/tds/qsql_tds.cpp" line="+584"/>
<source>Unable to open connection</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно открыть соединение</translation>
</message>
<message>
<location line="+5"/>
<source>Unable to use database</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно использовать базу данных</translation>
</message>
</context>
<context>
@@ -5567,12 +5561,12 @@ Please choose a different file name.</source>
<message>
<location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="-326"/>
<source>Scroll Left</source>
- <translation type="unfinished"></translation>
+ <translation>Прокрутить влево</translation>
</message>
<message>
<location line="+0"/>
<source>Scroll Right</source>
- <translation type="unfinished"></translation>
+ <translation>Прокрутить вправо</translation>
</message>
</context>
<context>
@@ -5580,7 +5574,7 @@ Please choose a different file name.</source>
<message>
<location filename="../src/network/socket/qtcpserver.cpp" line="+282"/>
<source>Operation on socket is not supported</source>
- <translation type="unfinished"></translation>
+ <translation>Операция с сокетом не поддерживается</translation>
</message>
</context>
<context>
@@ -5588,42 +5582,42 @@ Please choose a different file name.</source>
<message>
<location filename="../src/gui/text/qtextcontrol.cpp" line="+1973"/>
<source>&amp;Undo</source>
- <translation type="unfinished">&amp;Отменить</translation>
+ <translation>&amp;Отменить действие</translation>
</message>
<message>
<location line="+2"/>
<source>&amp;Redo</source>
- <translation type="unfinished">&amp;Повторить</translation>
+ <translation>&amp;Повторить действие</translation>
</message>
<message>
<location line="+4"/>
<source>Cu&amp;t</source>
- <translation type="unfinished">&amp;Вырезать</translation>
+ <translation>&amp;Вырезать</translation>
</message>
<message>
<location line="+5"/>
<source>&amp;Copy</source>
- <translation type="unfinished">&amp;Копировать</translation>
+ <translation>&amp;Копировать</translation>
</message>
<message>
<location line="+7"/>
<source>Copy &amp;Link Location</source>
- <translation type="unfinished"></translation>
+ <translation>Скопировать &amp;адрес ссылки</translation>
</message>
<message>
<location line="+6"/>
<source>&amp;Paste</source>
- <translation type="unfinished">&amp;Вставить</translation>
+ <translation>В&amp;ставить</translation>
</message>
<message>
<location line="+3"/>
<source>Delete</source>
- <translation type="unfinished">Удалить</translation>
+ <translation>Удалить</translation>
</message>
<message>
<location line="+7"/>
<source>Select All</source>
- <translation type="unfinished">Выделить все</translation>
+ <translation>Выделить все</translation>
</message>
</context>
<context>
@@ -5632,13 +5626,13 @@ Please choose a different file name.</source>
<location filename="../src/plugins/accessible/widgets/simplewidgets.cpp" line="+254"/>
<location line="+6"/>
<source>Press</source>
- <translation type="unfinished"></translation>
+ <translation>Нажать</translation>
</message>
<message>
<location line="-4"/>
<location line="+8"/>
<source>Open</source>
- <translation type="unfinished">Открыть</translation>
+ <translation>Открыть</translation>
</message>
</context>
<context>
@@ -5646,7 +5640,7 @@ Please choose a different file name.</source>
<message>
<location filename="../src/network/socket/qudpsocket.cpp" line="+169"/>
<source>This platform does not support IPv6</source>
- <translation type="unfinished"></translation>
+ <translation>Данная платформа не поддерживает IPv6</translation>
</message>
</context>
<context>
@@ -5654,12 +5648,12 @@ Please choose a different file name.</source>
<message>
<location filename="../src/gui/util/qundogroup.cpp" line="+386"/>
<source>Undo</source>
- <translation type="unfinished">Отменить</translation>
+ <translation>Отменить действие</translation>
</message>
<message>
<location line="+28"/>
<source>Redo</source>
- <translation type="unfinished">Повторить</translation>
+ <translation>Повторить действие</translation>
</message>
</context>
<context>
@@ -5667,7 +5661,7 @@ Please choose a different file name.</source>
<message>
<location filename="../src/gui/util/qundoview.cpp" line="+101"/>
<source>&lt;empty&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;пусто&gt;</translation>
</message>
</context>
<context>
@@ -5675,12 +5669,12 @@ Please choose a different file name.</source>
<message>
<location filename="../src/gui/util/qundostack.cpp" line="+834"/>
<source>Undo</source>
- <translation type="unfinished">Отменить</translation>
+ <translation>Отменить действие</translation>
</message>
<message>
<location line="+27"/>
<source>Redo</source>
- <translation type="unfinished">Повторить</translation>
+ <translation>Повторить действие</translation>
</message>
</context>
<context>
@@ -5746,160 +5740,160 @@ Please choose a different file name.</source>
<message>
<location filename="../src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp" line="+692"/>
<source>Request cancelled</source>
- <translation type="unfinished"></translation>
+ <translation>Запрос отменён</translation>
</message>
<message>
<location line="+17"/>
<source>Request blocked</source>
- <translation type="unfinished"></translation>
+ <translation>Запрос блокирован</translation>
</message>
<message>
<location line="+7"/>
<source>Cannot show URL</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно отобразить URL</translation>
</message>
<message>
<location line="+6"/>
<source>Frame load interruped by policy change</source>
- <translation type="unfinished"></translation>
+ <translation>Загрузка фрэйма прервана изменением политики</translation>
</message>
<message>
<location line="+6"/>
<source>Cannot show mimetype</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно отобразить тип MIME</translation>
</message>
<message>
<location line="+6"/>
<source>File does not exist</source>
- <translation type="unfinished"></translation>
+ <translation>Файл не существует</translation>
</message>
</context>
<context>
<name>QWebPage</name>
<message>
- <location filename="../src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp" line="+382"/>
+ <location filename="../src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp" line="+385"/>
<source>Bad HTTP request</source>
- <translation type="unfinished"></translation>
+ <translation>Некорректный HTTP-запрос</translation>
</message>
<message>
<location filename="../src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp" line="+42"/>
<source>Submit</source>
<comment>default label for Submit buttons in forms on web pages</comment>
- <translation type="unfinished"></translation>
+ <translation>Отправить</translation>
</message>
<message>
<location line="+5"/>
<source>Submit</source>
<comment>Submit (input element) alt text for &lt;input&gt; elements with no alt, title, or value</comment>
- <translation type="unfinished"></translation>
+ <translation>Отправить</translation>
</message>
<message>
<location line="+5"/>
<source>Reset</source>
<comment>default label for Reset buttons in forms on web pages</comment>
- <translation type="unfinished"></translation>
+ <translation>Сбросить</translation>
</message>
<message>
<location line="+10"/>
<source>This is a searchable index. Enter search keywords: </source>
<comment>text that appears at the start of nearly-obsolete web pages in the form of a &apos;searchable index&apos;</comment>
- <translation type="unfinished"></translation>
+ <translation>Индекс поиска. Введите ключевые слова для поиска: </translation>
</message>
<message>
<location line="+5"/>
<source>Choose File</source>
<comment>title for file button used in HTML forms</comment>
- <translation type="unfinished"></translation>
+ <translation>Обзор...</translation>
</message>
<message>
<location line="+5"/>
<source>No file selected</source>
<comment>text to display in file button used in HTML forms when no file is selected</comment>
- <translation type="unfinished"></translation>
+ <translation>Файл не указан</translation>
</message>
<message>
<location line="+5"/>
<source>Open in New Window</source>
<comment>Open in New Window context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Открыть в новом окне</translation>
</message>
<message>
<location line="+5"/>
<source>Save Link...</source>
<comment>Download Linked File context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Сохранить по ссылке как...</translation>
</message>
<message>
<location line="+5"/>
<source>Copy Link</source>
<comment>Copy Link context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Копировать адрес ссылки</translation>
</message>
<message>
<location line="+5"/>
<source>Open Image</source>
<comment>Open Image in New Window context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Открыть изображение</translation>
</message>
<message>
<location line="+5"/>
<source>Save Image</source>
<comment>Download Image context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Сохранить изображение</translation>
</message>
<message>
<location line="+5"/>
<source>Copy Image</source>
<comment>Copy Link context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Копировать изображение в буффер обмена</translation>
</message>
<message>
<location line="+5"/>
<source>Open Frame</source>
<comment>Open Frame in New Window context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Открыть фрэйм</translation>
</message>
<message>
<location line="+5"/>
<source>Copy</source>
<comment>Copy context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Копировать</translation>
</message>
<message>
<location line="+5"/>
<source>Go Back</source>
<comment>Back context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Назад</translation>
</message>
<message>
<location line="+5"/>
<source>Go Forward</source>
<comment>Forward context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Вперед</translation>
</message>
<message>
<location line="+5"/>
<source>Stop</source>
<comment>Stop context menu item</comment>
- <translation type="unfinished">Стоп</translation>
+ <translation>Остановить</translation>
</message>
<message>
<location line="+5"/>
<source>Reload</source>
<comment>Reload context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Обновить</translation>
</message>
<message>
<location line="+5"/>
<source>Cut</source>
<comment>Cut context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Вырезать</translation>
</message>
<message>
<location line="+5"/>
<source>Paste</source>
<comment>Paste context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Вставить</translation>
</message>
<message>
<location line="+5"/>
@@ -5911,7 +5905,7 @@ Please choose a different file name.</source>
<location line="+5"/>
<source>Ignore</source>
<comment>Ignore Spelling context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Игнорировать</translation>
</message>
<message>
<location line="+5"/>
@@ -5935,13 +5929,13 @@ Please choose a different file name.</source>
<location line="+5"/>
<source>Open Link</source>
<comment>Open Link context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Открыть ссылку</translation>
</message>
<message>
<location line="+5"/>
<source>Ignore</source>
<comment>Ignore Grammar context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Игнорировать</translation>
</message>
<message>
<location line="+5"/>
@@ -5983,97 +5977,97 @@ Please choose a different file name.</source>
<location line="+5"/>
<source>Fonts</source>
<comment>Font context sub-menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Шрифты</translation>
</message>
<message>
<location line="+5"/>
<source>Bold</source>
<comment>Bold context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Жирный</translation>
</message>
<message>
<location line="+5"/>
<source>Italic</source>
<comment>Italic context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Курсив</translation>
</message>
<message>
<location line="+5"/>
<source>Underline</source>
<comment>Underline context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Подчёркнутый</translation>
</message>
<message>
<location line="+5"/>
<source>Outline</source>
<comment>Outline context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Перечёркнутый</translation>
</message>
<message>
<location line="+5"/>
<source>Direction</source>
<comment>Writing direction context sub-menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Направление</translation>
</message>
<message>
<location line="+5"/>
<source>Text Direction</source>
<comment>Text direction context sub-menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Направление текста</translation>
</message>
<message>
<location line="+5"/>
<source>Default</source>
<comment>Default writing direction context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>По умолчанию</translation>
</message>
<message>
<location line="+5"/>
<source>LTR</source>
<comment>Left to Right context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Слева направо</translation>
</message>
<message>
<location line="+5"/>
<source>RTL</source>
<comment>Right to Left context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Справа налево</translation>
</message>
<message>
<location line="+5"/>
<source>Inspect</source>
<comment>Inspect Element context menu item</comment>
- <translation type="unfinished"></translation>
+ <translation>Проверить</translation>
</message>
<message>
<location line="+5"/>
<source>No recent searches</source>
<comment>Label for only item in menu that appears when clicking on the search field image, when no searches have been performed</comment>
- <translation type="unfinished"></translation>
+ <translation>История поиска пуста</translation>
</message>
<message>
<location line="+5"/>
<source>Recent searches</source>
<comment>label for first item in the menu that appears when clicking on the search field image, used as embedded menu title</comment>
- <translation type="unfinished"></translation>
+ <translation>История поиска</translation>
</message>
<message>
<location line="+5"/>
<source>Clear recent searches</source>
<comment>menu item in Recent Searches menu that empties menu&apos;s contents</comment>
- <translation type="unfinished"></translation>
+ <translation>Очистить историю поиска</translation>
</message>
<message>
<location line="+75"/>
<source>Unknown</source>
<comment>Unknown filesize FTP directory listing item</comment>
- <translation type="unfinished"></translation>
+ <translation>Неизвестно</translation>
</message>
<message>
<location line="+5"/>
<source>%1 (%2x%3 pixels)</source>
<comment>Title string for images</comment>
- <translation type="unfinished"></translation>
+ <translation>%1 (%2x%3 px)</translation>
</message>
<message>
<location filename="../src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp" line="+185"/>
@@ -6083,74 +6077,76 @@ Please choose a different file name.</source>
<message>
<location filename="../src/3rdparty/webkit/WebCore/platform/qt/ScrollbarQt.cpp" line="+58"/>
<source>Scroll here</source>
- <translation type="unfinished"></translation>
+ <translation>Прокрутить сюда</translation>
</message>
<message>
<location line="+3"/>
<source>Left edge</source>
- <translation type="unfinished"></translation>
+ <translation>К левой границе</translation>
</message>
<message>
<location line="+0"/>
<source>Top</source>
- <translation type="unfinished"></translation>
+ <translation>Вверх</translation>
</message>
<message>
<location line="+1"/>
<source>Right edge</source>
- <translation type="unfinished"></translation>
+ <translation>К правой границе</translation>
</message>
<message>
<location line="+0"/>
<source>Bottom</source>
- <translation type="unfinished"></translation>
+ <translation>Вниз</translation>
</message>
<message>
<location line="+3"/>
<source>Page left</source>
- <translation type="unfinished"></translation>
+ <translation>На страницу влево</translation>
</message>
<message>
<location line="+0"/>
<source>Page up</source>
- <translation type="unfinished"></translation>
+ <translation>На страницу вверх</translation>
</message>
<message>
<location line="+1"/>
<source>Page right</source>
- <translation type="unfinished"></translation>
+ <translation>На страницу вправо</translation>
</message>
<message>
<location line="+0"/>
<source>Page down</source>
- <translation type="unfinished"></translation>
+ <translation>На страницу вниз</translation>
</message>
<message>
<location line="+3"/>
<source>Scroll left</source>
- <translation type="unfinished"></translation>
+ <translation>Прокрутить влево</translation>
</message>
<message>
<location line="+0"/>
<source>Scroll up</source>
- <translation type="unfinished"></translation>
+ <translation>Прокрутить вверх</translation>
</message>
<message>
<location line="+1"/>
<source>Scroll right</source>
- <translation type="unfinished"></translation>
+ <translation>Прокрутить вправо</translation>
</message>
<message>
<location line="+0"/>
<source>Scroll down</source>
- <translation type="unfinished"></translation>
+ <translation>Прокрутить вниз</translation>
</message>
<message numerus="yes">
<location filename="../src/3rdparty/webkit/WebCore/platform/qt/FileChooserQt.cpp" line="+45"/>
<source>%n file(s)</source>
<comment>number of chosen file</comment>
- <translation type="unfinished">
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%n файл(а)</numerusform>
+ <numerusform>%n файла</numerusform>
+ <numerusform>%n файлов</numerusform>
</translation>
</message>
<message>
@@ -6169,149 +6165,149 @@ Please choose a different file name.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+333"/>
+ <location line="+340"/>
<source>Move the cursor to the next character</source>
- <translation type="unfinished"></translation>
+ <translation>Переместить указатель к следующему символу</translation>
</message>
<message>
<location line="+3"/>
<source>Move the cursor to the previous character</source>
- <translation type="unfinished"></translation>
+ <translation>Переместить указатель к предыдущему символу</translation>
</message>
<message>
<location line="+3"/>
<source>Move the cursor to the next word</source>
- <translation type="unfinished"></translation>
+ <translation>Переместить указатель к следующему слову</translation>
</message>
<message>
<location line="+3"/>
<source>Move the cursor to the previous word</source>
- <translation type="unfinished"></translation>
+ <translation>Переместить указатель к предыдущему слову</translation>
</message>
<message>
<location line="+3"/>
<source>Move the cursor to the next line</source>
- <translation type="unfinished"></translation>
+ <translation>Переместить указатель на следующую строку</translation>
</message>
<message>
<location line="+3"/>
<source>Move the cursor to the previous line</source>
- <translation type="unfinished"></translation>
+ <translation>Переместить указатель на предыдущую строку</translation>
</message>
<message>
<location line="+3"/>
<source>Move the cursor to the start of the line</source>
- <translation type="unfinished"></translation>
+ <translation>Переместить указатель в начало строки</translation>
</message>
<message>
<location line="+3"/>
<source>Move the cursor to the end of the line</source>
- <translation type="unfinished"></translation>
+ <translation>Переместить указатель в конец строки</translation>
</message>
<message>
<location line="+3"/>
<source>Move the cursor to the start of the block</source>
- <translation type="unfinished"></translation>
+ <translation>Переместить указатель в начало блока</translation>
</message>
<message>
<location line="+3"/>
<source>Move the cursor to the end of the block</source>
- <translation type="unfinished"></translation>
+ <translation>Переместить указатель в конец блока</translation>
</message>
<message>
<location line="+3"/>
<source>Move the cursor to the start of the document</source>
- <translation type="unfinished"></translation>
+ <translation>Переместить указатель в начало документа</translation>
</message>
<message>
<location line="+3"/>
<source>Move the cursor to the end of the document</source>
- <translation type="unfinished"></translation>
+ <translation>Переместить указатель в конец документа</translation>
</message>
<message>
<location line="+3"/>
<source>Select all</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить всё</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the next character</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить до следующего символа</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the previous character</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить до предыдущего символа</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the next word</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить до следующего слова</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the previous word</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить до предыдущего слова</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the next line</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить до следующей строки</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the previous line</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить до предыдущей строки</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the start of the line</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить до начала строки</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the end of the line</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить до конца строки</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the start of the block</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить до начала блока</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the end of the block</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить до конца блока</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the start of the document</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить до начала документа</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the end of the document</source>
- <translation type="unfinished"></translation>
+ <translation>Выделить до конца документа</translation>
</message>
<message>
<location line="+3"/>
<source>Delete to the start of the word</source>
- <translation type="unfinished"></translation>
+ <translation>Удалить до начала слова</translation>
</message>
<message>
<location line="+3"/>
<source>Delete to the end of the word</source>
- <translation type="unfinished"></translation>
+ <translation>Удалить до конца слова</translation>
</message>
<message>
<location line="+33"/>
<source>Insert a new paragraph</source>
- <translation type="unfinished"></translation>
+ <translation>Вставить новый параграф</translation>
</message>
<message>
<location line="+3"/>
<source>Insert a new line</source>
- <translation type="unfinished"></translation>
+ <translation>Вставить новую строку</translation>
</message>
</context>
<context>
@@ -6319,77 +6315,73 @@ Please choose a different file name.</source>
<message>
<location filename="../src/gui/kernel/qwhatsthis.cpp" line="+522"/>
<source>What&apos;s This?</source>
- <translation type="unfinished">Что это?</translation>
+ <translation>Что это?</translation>
</message>
</context>
<context>
<name>QWidget</name>
<message>
- <location filename="../src/gui/kernel/qwidget.cpp" line="+5326"/>
+ <location filename="../src/gui/kernel/qwidget.cpp" line="+5301"/>
<source>*</source>
- <translation type="unfinished"></translation>
+ <translation>*</translation>
</message>
</context>
<context>
<name>QWizard</name>
<message>
<location filename="../src/gui/dialogs/qwizard.cpp" line="+637"/>
- <source>&lt; &amp;Back</source>
- <translation type="unfinished">&lt; &amp;Назад</translation>
- </message>
- <message>
- <location line="+10"/>
- <source>&amp;Finish</source>
- <translation type="unfinished">&amp;Финиш</translation>
- </message>
- <message>
- <location line="+4"/>
- <source>&amp;Help</source>
- <translation type="unfinished">&amp;Справка</translation>
- </message>
- <message>
- <location line="-14"/>
<source>Go Back</source>
- <translation type="unfinished"></translation>
+ <translation>Назад</translation>
</message>
<message>
<location line="+3"/>
<source>Continue</source>
- <translation type="unfinished"></translation>
+ <translation>Продолжить</translation>
</message>
<message>
<location line="+5"/>
<source>Commit</source>
- <translation type="unfinished"></translation>
+ <translation>Отправить</translation>
</message>
<message>
<location line="+2"/>
<source>Done</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Quit</source>
- <translation type="obsolete">Выход</translation>
+ <translation>Готово</translation>
</message>
<message>
<location line="+4"/>
<source>Help</source>
- <translation type="unfinished">Справка</translation>
+ <translation>Справка</translation>
</message>
<message>
- <location line="-2"/>
+ <location line="-14"/>
+ <source>&lt; &amp;Back</source>
+ <translation>&lt; &amp;Назад</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>&amp;Finish</source>
+ <translation>&amp;Закончить</translation>
+ </message>
+ <message>
+ <location line="+2"/>
<source>Cancel</source>
- <translation type="unfinished">Отмена</translation>
+ <translation>Отмена</translation>
</message>
<message>
- <location line="-6"/>
+ <location line="+2"/>
+ <source>&amp;Help</source>
+ <translation>&amp;Справка</translation>
+ </message>
+ <message>
+ <location line="-8"/>
<source>&amp;Next</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Вперед</translation>
</message>
<message>
<location line="+0"/>
<source>&amp;Next &gt;</source>
- <translation type="unfinished">&amp;Вперед &gt;</translation>
+ <translation>&amp;Вперед &gt;</translation>
</message>
</context>
<context>
@@ -6397,43 +6389,43 @@ Please choose a different file name.</source>
<message>
<location filename="../src/gui/widgets/qworkspace.cpp" line="+1094"/>
<source>&amp;Restore</source>
- <translation type="unfinished">&amp;Восстановить</translation>
+ <translation>&amp;Восстановить</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Move</source>
- <translation type="unfinished">&amp;Переместить</translation>
+ <translation>&amp;Переместить</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Size</source>
- <translation type="unfinished">&amp;Размер</translation>
+ <translation>&amp;Размер</translation>
</message>
<message>
<location line="+2"/>
<source>Mi&amp;nimize</source>
- <translation type="unfinished">&amp;Свернуть</translation>
+ <translation>&amp;Минимизировать</translation>
</message>
<message>
<location line="+2"/>
<source>Ma&amp;ximize</source>
- <translation type="unfinished">Р&amp;азвернуть</translation>
+ <translation>Р&amp;аспахнуть</translation>
</message>
<message>
<location line="+2"/>
<source>&amp;Close</source>
- <translation type="unfinished">&amp;Закрыть</translation>
+ <translation>&amp;Закрыть</translation>
</message>
<message>
<location line="+6"/>
<source>Stay on &amp;Top</source>
- <translation type="unfinished">Всегда &amp;наверху</translation>
+ <translation>Оставаться &amp;сверху</translation>
</message>
<message>
<location line="+3"/>
<location line="+1059"/>
<source>Sh&amp;ade</source>
- <translation type="unfinished">Свернуть в за&amp;головок</translation>
+ <translation>Св&amp;ернуть в заголовок</translation>
</message>
<message>
<location line="-278"/>
@@ -6444,22 +6436,22 @@ Please choose a different file name.</source>
<message>
<location line="-1837"/>
<source>Minimize</source>
- <translation type="unfinished">Свернуть</translation>
+ <translation>Минимизировать</translation>
</message>
<message>
<location line="+2"/>
<source>Restore Down</source>
- <translation type="unfinished">Восстановить</translation>
+ <translation>Восстановить</translation>
</message>
<message>
<location line="-4"/>
<source>Close</source>
- <translation type="unfinished">Закрыть</translation>
+ <translation>Закрыть</translation>
</message>
<message>
<location line="+2053"/>
<source>&amp;Unshade</source>
- <translation type="unfinished">Восстановить из за&amp;головка</translation>
+ <translation>В&amp;осстановить из заголовка</translation>
</message>
</context>
<context>
@@ -6472,7 +6464,7 @@ Please choose a different file name.</source>
<message>
<location line="+1"/>
<source>error triggered by consumer</source>
- <translation>ошибка инициирована пользователем</translation>
+ <translation>ошибка вызвана пользователем</translation>
</message>
<message>
<location line="+1"/>
@@ -6482,22 +6474,22 @@ Please choose a different file name.</source>
<message>
<location line="+1"/>
<source>more than one document type definition</source>
- <translation>определен более, чем один тип документов</translation>
+ <translation>указано более одного типа документа</translation>
</message>
<message>
<location line="+1"/>
<source>error occurred while parsing element</source>
- <translation>в процессе грамматического разбора элемента произошла ошибка</translation>
+ <translation>ошибка разбора элемента</translation>
</message>
<message>
<location line="+1"/>
<source>tag mismatch</source>
- <translation>отсутствует тег</translation>
+ <translation>тэг не совпадает</translation>
</message>
<message>
<location line="+1"/>
<source>error occurred while parsing content</source>
- <translation>в процессе грамматического разбора произошла ошибка</translation>
+ <translation>ошибка разбора документа</translation>
</message>
<message>
<location line="+1"/>
@@ -6507,101 +6499,101 @@ Please choose a different file name.</source>
<message>
<location line="+1"/>
<source>invalid name for processing instruction</source>
- <translation>некорректное имя директивы</translation>
+ <translation>некорректное имя директивы разбора</translation>
</message>
<message>
<location line="+1"/>
<source>version expected while reading the XML declaration</source>
- <translation>при чтении XML-тега ожидался параметр version</translation>
+ <translation>в объявлении XML ожидается объявление параметра version</translation>
</message>
<message>
<location line="+1"/>
<source>wrong value for standalone declaration</source>
- <translation>некорректное значение параметра standalone</translation>
+ <translation>некорректное значение объявления standalone</translation>
</message>
<message>
<location line="+1"/>
<source>encoding declaration or standalone declaration expected while reading the XML declaration</source>
- <translation>при чтении XML-тега ожидался параметр encoding или параметр standalone</translation>
+ <translation>в объявлении XML ожидается объявление параметра encoding или standalone</translation>
</message>
<message>
<location line="+1"/>
<source>standalone declaration expected while reading the XML declaration</source>
- <translation>при чтении XML-тега ожидался параметр standalone</translation>
+ <translation>в объявлении XML ожидается объявление параметра standalone</translation>
</message>
<message>
<location line="+1"/>
<source>error occurred while parsing document type definition</source>
- <translation>в процессе грамматического разбора типа документа произошла ошибка</translation>
+ <translation>ошибка разбора объявления типа документа</translation>
</message>
<message>
<location line="+1"/>
<source>letter is expected</source>
- <translation>ожидался символ</translation>
+ <translation>ожидалась буква</translation>
</message>
<message>
<location line="+1"/>
<source>error occurred while parsing comment</source>
- <translation>в процессе грамматического разбора комментария произошла ошибка</translation>
+ <translation>ошибка разбора комментария</translation>
</message>
<message>
<location line="+1"/>
<source>error occurred while parsing reference</source>
- <translation>в процессе грамматического разбора ссылки произошла ошибка</translation>
+ <translation>ошибка разбора ссылки</translation>
</message>
<message>
<location line="+1"/>
<source>internal general entity reference not allowed in DTD</source>
- <translation>internal general entity reference not allowed in DTD</translation>
+ <translation>внутренняя ссылка на общий объкт недопустима в DTD</translation>
</message>
<message>
<location line="+1"/>
<source>external parsed general entity reference not allowed in attribute value</source>
- <translation>external parsed general entity reference not allowed in attribute value</translation>
+ <translation>внешняя ссылка на общий объект недопустима в значении атрибута</translation>
</message>
<message>
<location line="+1"/>
<source>external parsed general entity reference not allowed in DTD</source>
- <translation>external parsed general entity reference not allowed in DTD</translation>
+ <translation>внешняя ссылка на общий объект недопустима в DTD</translation>
</message>
<message>
<location line="+1"/>
<source>unparsed entity reference in wrong context</source>
- <translation>unparsed entity reference in wrong context</translation>
+ <translation>неразобранная ссылка на объект в неправильном контексте</translation>
</message>
<message>
<location line="+1"/>
<source>recursive entities</source>
- <translation>рекурсивные объекты</translation>
+ <translation>рекурсия объектов</translation>
</message>
<message>
<location line="+1"/>
<source>error in the text declaration of an external entity</source>
- <translation>error in the text declaration of an external entity</translation>
+ <translation>ошибка в объявлении внешнего объекта</translation>
</message>
</context>
<context>
<name>QXmlStream</name>
<message>
<location filename="../src/corelib/xml/qxmlstream.cpp" line="+592"/>
- <location filename="../src/corelib/xml/qxmlstream_p.h" line="+1769"/>
+ <location filename="../src/corelib/xml/qxmlstream_p.h" line="+1770"/>
<source>Extra content at end of document.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+222"/>
<source>Invalid entity value.</source>
- <translation type="unfinished"></translation>
+ <translation>Некорректное значение объекта.</translation>
</message>
<message>
<location line="+107"/>
<source>Invalid XML character.</source>
- <translation type="unfinished"></translation>
+ <translation>Некорректный символ XML.</translation>
</message>
<message>
<location line="+259"/>
<source>Sequence &apos;]]&gt;&apos; not allowed in content.</source>
- <translation type="unfinished"></translation>
+ <translation>Последовательность &apos;]]&gt;&apos; не допускается в содержимом.</translation>
</message>
<message>
<location line="+309"/>
@@ -6626,7 +6618,7 @@ Please choose a different file name.</source>
<message>
<location line="+2"/>
<source>Unsupported XML version.</source>
- <translation type="unfinished"></translation>
+ <translation>Неподдерживаемая версия XML.</translation>
</message>
<message>
<location line="+23"/>
@@ -6641,37 +6633,37 @@ Please choose a different file name.</source>
<message>
<location line="+16"/>
<source>Standalone accepts only yes or no.</source>
- <translation type="unfinished"></translation>
+ <translation>Псевдоатрибут &apos;standalone&apos; может принимать только значение yes или no.</translation>
</message>
<message>
<location line="+2"/>
<source>Invalid attribute in XML declaration.</source>
- <translation type="unfinished"></translation>
+ <translation>Некорректный атрибут в объявлении XML.</translation>
</message>
<message>
<location line="+16"/>
<source>Premature end of document.</source>
- <translation type="unfinished"></translation>
+ <translation>Неожиданный конец документа.</translation>
</message>
<message>
<location line="+2"/>
<source>Invalid document.</source>
- <translation type="unfinished"></translation>
+ <translation>Некорректный документ.</translation>
</message>
<message>
<location line="+40"/>
<source>Expected </source>
- <translation type="unfinished"></translation>
+ <translation>Ожидалось </translation>
</message>
<message>
<location line="+11"/>
<source>, but got &apos;</source>
- <translation type="unfinished"></translation>
+ <translation>, получили &apos;</translation>
</message>
<message>
<location line="+4"/>
<source>Unexpected &apos;</source>
- <translation type="unfinished"></translation>
+ <translation>Неожиданное &apos;</translation>
</message>
<message>
<location line="+210"/>
@@ -6686,7 +6678,7 @@ Please choose a different file name.</source>
<message>
<location line="+516"/>
<source>Start tag expected.</source>
- <translation type="unfinished"></translation>
+ <translation>Ожидается начало тэга.</translation>
</message>
<message>
<location line="+222"/>
@@ -6719,12 +6711,12 @@ Please choose a different file name.</source>
<message>
<location filename="../src/corelib/xml/qxmlstream_p.h" line="+15"/>
<source>Invalid XML name.</source>
- <translation type="unfinished"></translation>
+ <translation>Некорректное имя XML.</translation>
</message>
<message>
<location line="+23"/>
<source>Opening and ending tag mismatch.</source>
- <translation type="unfinished"></translation>
+ <translation>Открывающий тэг не совпадает с закрывающим.</translation>
</message>
<message>
<location line="+18"/>
@@ -6757,7 +6749,7 @@ Please choose a different file name.</source>
<message>
<location line="+274"/>
<source>The standalone pseudo attribute must appear after the encoding.</source>
- <translation type="unfinished"></translation>
+ <translation>Псевдоатрибут &apos;standalone&apos; должен находиться после указания кодировки.</translation>
</message>
<message>
<location filename="../src/corelib/xml/qxmlstream_p.h" line="+562"/>
@@ -6788,11 +6780,6 @@ Please choose a different file name.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+60"/>
- <source>Attribute %1 can&apos;t be serialized because it appears at the top level.</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<location filename="../src/xmlpatterns/data/qabstractdatetime.cpp" line="+80"/>
<source>Year %1 is invalid because it begins with %2.</source>
<translation type="unfinished"></translation>
@@ -7070,6 +7057,8 @@ Please choose a different file name.</source>
<source>%1 takes at most %n argument(s). %2 is therefore invalid.</source>
<translation type="unfinished">
<numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
@@ -7077,6 +7066,8 @@ Please choose a different file name.</source>
<source>%1 requires at least %n argument(s). %2 is therefore invalid.</source>
<translation type="unfinished">
<numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -7165,7 +7156,7 @@ Please choose a different file name.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../src/xmlpatterns/functions/qsequencefns.cpp" line="+347"/>
+ <location filename="../src/xmlpatterns/functions/qsequencefns.cpp" line="+346"/>
<source>It will not be possible to retrieve %1.</source>
<translation type="unfinished"></translation>
</message>
@@ -7568,6 +7559,11 @@ Please choose a different file name.</source>
<translation type="unfinished"></translation>
</message>
<message>
+ <location filename="../src/xmlpatterns/api/qxmlserializer.cpp" line="+60"/>
+ <source>Attribute %1 can&apos;t be serialized because it appears at the top level.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<location filename="../src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp" line="+314"/>
<source>%1 is an unsupported encoding.</source>
<translation type="unfinished"></translation>
@@ -7809,13 +7805,13 @@ Please choose a different file name.</source>
<message>
<location filename="../src/3rdparty/phonon/phonon/volumeslider.cpp" line="+67"/>
<source>Muted</source>
- <translation type="unfinished"></translation>
+ <translation>Без звука</translation>
</message>
<message>
<location line="+5"/>
<location line="+15"/>
<source>Volume: %1%</source>
- <translation type="unfinished"></translation>
+ <translation>Громкость: %1%</translation>
</message>
</context>
</TS>
diff --git a/translations/translations.pri b/translations/translations.pri
index 20d4467..480849f 100644
--- a/translations/translations.pri
+++ b/translations/translations.pri
@@ -21,7 +21,7 @@ LRELEASE = $$fixPath($$QT_BUILD_TREE/bin/lrelease)
###### Qt Libraries
-QT_TS = de fr zh_CN untranslated ar es iw ja_JP pl pt ru sk sv uk zh_TW
+QT_TS = de fr zh_CN untranslated ar es iw ja_JP pl pt ru sk sv uk zh_TW da
ts-qt.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-I../include -I../include/Qt \
diff --git a/util/normalize/main.cpp b/util/normalize/main.cpp
index 905c1ec..b16335e 100644
--- a/util/normalize/main.cpp
+++ b/util/normalize/main.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
#include <qcoreapplication.h>
-#include <qdir.h>
+#include <qdiriterator.h>
#include <qfile.h>
#include <qmetaobject.h>
#include <qstring.h>
@@ -140,18 +140,14 @@ void check(const QString &fileName)
void traverse(const QString &path)
{
- QDir dir(path);
- dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoSymLinks);
-
- const QFileInfoList list = dir.entryInfoList();
- for (int i = 0; i < list.count(); ++i) {
- const QFileInfo fi = list.at(i);
- if (fi.fileName() == QLatin1String(".") || fi.fileName() == QLatin1String(".."))
- continue;
- if (fi.fileName().endsWith(".cpp"))
- check(path + fi.fileName());
- if (fi.isDir())
- traverse(path + fi.fileName() + "/"); // recurse
+ QDirIterator dirIterator(path, QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files | QDir::NoSymLinks);
+
+ while (dirIterator.hasNext()) {
+ QString filePath = dirIterator.next();
+ if (filePath.endsWith(".cpp"))
+ check(filePath);
+ else if (QFileInfo(filePath).isDir())
+ traverse(filePath); // recurse
}
}