summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/build_release_package.pl205
-rw-r--r--bin/createpackage.bat63
-rw-r--r--bin/patch_capabilities.pl2
-rwxr-xr-xconfigure30
-rwxr-xr-xconfigure.exebin535040 -> 868352 bytes
-rw-r--r--confqt.bat1
-rw-r--r--confsbsv2.bat1
-rw-r--r--demos/boxes/glextensions.h7
-rw-r--r--demos/embedded/desktopservices/contenttab.cpp50
-rw-r--r--demos/embedded/desktopservices/contenttab.h35
-rw-r--r--demos/embedded/desktopservices/desktopwidget.cpp42
-rw-r--r--demos/embedded/desktopservices/desktopwidget.h32
-rw-r--r--demos/embedded/desktopservices/linktab.cpp41
-rw-r--r--demos/embedded/desktopservices/linktab.h33
-rw-r--r--demos/embedded/desktopservices/main.cpp32
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.pro4
-rw-r--r--demos/embedded/fluidlauncher/screenshots/drilldown.pngbin0 -> 102922 bytes
-rw-r--r--demos/mediaplayer/mediaplayer.pro2
-rw-r--r--demos/qtdemo/colors.cpp2
-rw-r--r--demos/qtdemo/mainwindow.cpp13
-rw-r--r--demos/spreadsheet/spreadsheetdelegate.cpp6
-rw-r--r--dist/changes-4.5.2237
-rw-r--r--dist/changes-4.5.2-tower290
-rw-r--r--doc/src/3rdparty.qdoc136
-rw-r--r--doc/src/accessible.qdoc2
-rw-r--r--doc/src/credits.qdoc2
-rw-r--r--doc/src/deployment.qdoc2
-rw-r--r--doc/src/designer-manual.qdoc151
-rw-r--r--doc/src/emb-fonts.qdoc2
-rw-r--r--doc/src/emb-install.qdoc4
-rw-r--r--doc/src/emb-makeqpf.qdoc9
-rw-r--r--doc/src/examples/codeeditor.qdoc2
-rw-r--r--doc/src/examples/containerextension.qdoc2
-rw-r--r--doc/src/examples/fortuneserver.qdoc2
-rw-r--r--doc/src/examples/ftp.qdoc4
-rw-r--r--doc/src/examples/htmlinfo.qdoc32
-rw-r--r--doc/src/examples/icons.qdoc2
-rw-r--r--doc/src/examples/musicplayerexample.qdoc2
-rw-r--r--doc/src/examples/qobjectxmlmodel.qdoc2
-rw-r--r--doc/src/examples/tabdialog.qdoc2
-rw-r--r--doc/src/examples/tooltips.qdoc2
-rw-r--r--doc/src/examples/trafficinfo.qdoc2
-rw-r--r--doc/src/examples/transformations.qdoc2
-rw-r--r--doc/src/examples/trollprint.qdoc2
-rw-r--r--doc/src/exceptionsafety.qdoc144
-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-no-toplevel-layout.pngbin0 -> 1343 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/index.qdoc7
-rw-r--r--doc/src/installation.qdoc150
-rw-r--r--doc/src/licenses.qdoc2
-rw-r--r--doc/src/mac-differences.qdoc2
-rw-r--r--doc/src/model-view-programming.qdoc2
-rw-r--r--doc/src/phonon-api.qdoc2
-rw-r--r--doc/src/platform-notes.qdoc13
-rw-r--r--doc/src/porting4-overview.qdoc6
-rw-r--r--doc/src/q3valuelist.qdoc2
-rw-r--r--doc/src/qalgorithms.qdoc2
-rw-r--r--doc/src/qmake-manual.qdoc9
-rw-r--r--doc/src/qnamespace.qdoc7
-rw-r--r--doc/src/qset.qdoc9
-rw-r--r--doc/src/qstyles.qdoc261
-rw-r--r--doc/src/qtdesigner.qdoc2
-rw-r--r--doc/src/qtscriptdebugger-manual.qdoc2
-rw-r--r--doc/src/s60-introduction.qdoc51
-rw-r--r--doc/src/snippets/code/doc_src_installation.qdoc29
-rw-r--r--doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp64
-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/stylesheet.qdoc16
-rw-r--r--doc/src/symbian-exceptionsafety.qdoc183
-rw-r--r--doc/src/tech-preview/known-issues.html2
-rw-r--r--doc/src/timers.qdoc4
-rw-r--r--doc/src/tools-list.qdoc6
-rw-r--r--doc/src/topics.qdoc13
-rw-r--r--doc/src/tutorials/addressbook.qdoc31
-rw-r--r--doc/src/xquery-introduction.qdoc2
-rw-r--r--examples/dialogs/sipdialog/dialog.cpp13
-rw-r--r--examples/dialogs/sipdialog/main.cpp2
-rw-r--r--examples/draganddrop/delayedencoding/delayedencoding.pro2
-rw-r--r--examples/draganddrop/draggableicons/draggableicons.pro2
-rw-r--r--examples/draganddrop/draggabletext/draggabletext.pro2
-rw-r--r--examples/draganddrop/puzzle/puzzle.pro1
-rw-r--r--examples/itemviews/puzzle/puzzle.pro5
-rw-r--r--examples/mainwindows/menus/menus.pro2
-rw-r--r--examples/network/ftp/ftp.pro4
-rw-r--r--examples/network/ftp/main.cpp23
-rw-r--r--examples/network/googlesuggest/googlesuggest.pro4
-rw-r--r--examples/network/http/httpwindow.cpp4
-rw-r--r--examples/network/securesocketclient/securesocketclient.pro2
-rw-r--r--examples/network/securesocketclient/sslclient.cpp2
-rw-r--r--examples/painting/svggenerator/svggenerator.pro2
-rw-r--r--examples/phonon/capabilities/capabilities.pro2
-rw-r--r--examples/phonon/musicplayer/musicplayer.pro1
-rw-r--r--examples/qtconcurrent/imagescaling/imagescaling.pro2
-rw-r--r--examples/qtconcurrent/qtconcurrent.pro5
-rw-r--r--examples/richtext/textobject/textobject.pro4
-rw-r--r--examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro3
-rw-r--r--examples/widgets/movie/movie.pro8
-rw-r--r--examples/widgets/softkeys/main.cpp51
-rw-r--r--examples/widgets/softkeys/softkeys.cpp151
-rw-r--r--examples/widgets/softkeys/softkeys.h85
-rw-r--r--examples/widgets/softkeys/softkeys.pro14
-rw-r--r--examples/widgets/widgets.pro3
-rw-r--r--examples/xml/htmlinfo/main.cpp32
-rw-r--r--examples/xml/saxbookmarks/frankf.xbel230
-rw-r--r--examples/xml/saxbookmarks/jenniferf.xbel93
-rw-r--r--examples/xmlpatterns/trafficinfo/main.cpp2
-rw-r--r--examples/xmlpatterns/trafficinfo/mainwindow.cpp2
-rw-r--r--examples/xmlpatterns/trafficinfo/mainwindow.h2
-rw-r--r--examples/xmlpatterns/trafficinfo/stationdialog.cpp2
-rw-r--r--examples/xmlpatterns/trafficinfo/stationdialog.h2
-rw-r--r--examples/xmlpatterns/trafficinfo/stationquery.cpp2
-rw-r--r--examples/xmlpatterns/trafficinfo/stationquery.h2
-rw-r--r--examples/xmlpatterns/trafficinfo/timequery.cpp2
-rw-r--r--examples/xmlpatterns/trafficinfo/timequery.h2
-rw-r--r--mkspecs/common/symbian/fixed_stdlib.h32
-rw-r--r--mkspecs/common/symbian/qplatformdefs.h32
-rw-r--r--mkspecs/common/symbian/symbian.conf8
-rw-r--r--mkspecs/common/wince.conf7
-rw-r--r--mkspecs/features/symbian/platform_paths.prf52
-rw-r--r--mkspecs/features/symbian/stl.prf26
-rw-r--r--mkspecs/features/win32/embed_manifest_dll.prf8
-rw-r--r--mkspecs/features/win32/embed_manifest_exe.prf8
-rw-r--r--mkspecs/win32-mwc/qplatformdefs.h32
-rw-r--r--qmake/Makefile.win322
-rw-r--r--qmake/generators/makefile.cpp101
-rw-r--r--qmake/generators/makefile.h3
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.cpp32
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.h32
-rw-r--r--qmake/generators/symbian/symmake.cpp40
-rw-r--r--qmake/generators/symbian/symmake.h33
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp44
-rw-r--r--qmake/generators/symbian/symmake_abld.h32
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp44
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.h32
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp2
-rw-r--r--qmake/generators/win32/winmakefile.cpp2
-rw-r--r--qmake/qmake.pri7
-rw-r--r--qmake/qmake_pch.h2
-rw-r--r--qmake/qpopen.cpp32
-rw-r--r--qmake/qpopen.h32
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp8
-rw-r--r--src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp1
-rw-r--r--src/3rdparty/phonon/ds9/videowidget.cpp2
-rw-r--r--src/3rdparty/phonon/phonon/abstractmediastream.cpp1
-rw-r--r--src/3rdparty/phonon/phonon/abstractmediastream.h2
-rw-r--r--src/3rdparty/phonon/phonon/abstractmediastream_p.h2
-rw-r--r--src/3rdparty/phonon/phonon/effectwidget.cpp3
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog140
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp27
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp12
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp19
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp13
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.h3
-rw-r--r--src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp1
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp11
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog25
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp8
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp39
-rw-r--r--src/corelib/arch/qatomic_symbian.h32
-rw-r--r--src/corelib/arch/qatomic_windows.h14
-rw-r--r--src/corelib/arch/symbian/qatomic_symbian.cpp32
-rw-r--r--src/corelib/codecs/qisciicodec.cpp1
-rw-r--r--src/corelib/codecs/qtextcodec.cpp21
-rw-r--r--src/corelib/codecs/qutfcodec.cpp2
-rw-r--r--src/corelib/concurrent/qthreadpool.cpp6
-rw-r--r--src/corelib/global/qglobal.cpp311
-rw-r--r--src/corelib/global/qglobal.h103
-rw-r--r--src/corelib/global/qlibraryinfo.cpp28
-rw-r--r--src/corelib/global/qnamespace.h26
-rw-r--r--src/corelib/io/qabstractfileengine.cpp3
-rw-r--r--src/corelib/io/qabstractfileengine.h4
-rw-r--r--src/corelib/io/qdatastream.cpp92
-rw-r--r--src/corelib/io/qdebug.h7
-rw-r--r--src/corelib/io/qdir.cpp3
-rw-r--r--src/corelib/io/qdir.h3
-rw-r--r--src/corelib/io/qdiriterator.cpp4
-rw-r--r--src/corelib/io/qfile.cpp31
-rw-r--r--src/corelib/io/qfileinfo.cpp2
-rw-r--r--src/corelib/io/qfileinfo.h3
-rw-r--r--src/corelib/io/qfilesystemwatcher_symbian.cpp40
-rw-r--r--src/corelib/io/qfilesystemwatcher_symbian_p.h32
-rw-r--r--src/corelib/io/qfsfileengine.cpp122
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp33
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp83
-rw-r--r--src/corelib/io/qiodevice.cpp11
-rw-r--r--src/corelib/io/qiodevice.h3
-rw-r--r--src/corelib/io/qprocess_symbian.cpp33
-rw-r--r--src/corelib/io/qprocess_unix.cpp23
-rw-r--r--src/corelib/io/qresource.cpp3
-rw-r--r--src/corelib/io/qresource.h2
-rw-r--r--src/corelib/io/qsettings.cpp83
-rw-r--r--src/corelib/io/qsettings.h2
-rw-r--r--src/corelib/io/qsettings_p.h2
-rw-r--r--src/corelib/io/qtemporaryfile.cpp96
-rw-r--r--src/corelib/io/qtextstream.cpp3
-rw-r--r--src/corelib/io/qtextstream.h3
-rw-r--r--src/corelib/io/qurl.cpp6
-rw-r--r--src/corelib/kernel/qcore_symbian_p.cpp51
-rw-r--r--src/corelib/kernel/qcore_symbian_p.h36
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp96
-rw-r--r--src/corelib/kernel/qcoreapplication.h2
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h2
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp233
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h35
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp59
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix_p.h1
-rw-r--r--src/corelib/kernel/qobject.cpp79
-rw-r--r--src/corelib/kernel/qobject.h3
-rw-r--r--src/corelib/kernel/qobject_p.h1
-rw-r--r--src/corelib/kernel/qsharedmemory.cpp4
-rw-r--r--src/corelib/kernel/qsharedmemory_symbian.cpp46
-rw-r--r--src/corelib/kernel/qsharedmemory_unix.cpp4
-rw-r--r--src/corelib/kernel/qsystemsemaphore.cpp3
-rw-r--r--src/corelib/kernel/qsystemsemaphore.h3
-rw-r--r--src/corelib/kernel/qsystemsemaphore_p.h4
-rw-r--r--src/corelib/kernel/qsystemsemaphore_symbian.cpp39
-rw-r--r--src/corelib/kernel/qtimer.cpp2
-rw-r--r--src/corelib/kernel/qtranslator.cpp7
-rw-r--r--src/corelib/kernel/qtranslator_p.h1
-rw-r--r--src/corelib/plugin/qlibrary.cpp7
-rw-r--r--src/corelib/plugin/qpluginloader.cpp19
-rw-r--r--src/corelib/thread/qthread.cpp15
-rw-r--r--src/corelib/thread/qthread_unix.cpp9
-rw-r--r--src/corelib/thread/qthread_win.cpp9
-rw-r--r--src/corelib/thread/qthreadstorage.cpp14
-rw-r--r--src/corelib/tools/qbitarray.cpp2
-rw-r--r--src/corelib/tools/qbytearray.cpp55
-rw-r--r--src/corelib/tools/qbytearraymatcher.h2
-rw-r--r--src/corelib/tools/qcryptographichash.cpp2
-rw-r--r--src/corelib/tools/qdatetime.cpp14
-rw-r--r--src/corelib/tools/qdatetime.h3
-rw-r--r--src/corelib/tools/qharfbuzz.cpp1
-rw-r--r--src/corelib/tools/qhash.cpp78
-rw-r--r--src/corelib/tools/qhash.h44
-rw-r--r--src/corelib/tools/qlinkedlist.h44
-rw-r--r--src/corelib/tools/qlist.h108
-rw-r--r--src/corelib/tools/qlistdata.cpp28
-rw-r--r--src/corelib/tools/qlocale.cpp804
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp878
-rw-r--r--src/corelib/tools/qmap.cpp41
-rw-r--r--src/corelib/tools/qmap.h35
-rw-r--r--src/corelib/tools/qpodlist_p.h192
-rw-r--r--src/corelib/tools/qrect.cpp2
-rw-r--r--src/corelib/tools/qregexp.cpp25
-rw-r--r--src/corelib/tools/qringbuffer_p.h3
-rw-r--r--src/corelib/tools/qscopedpointer.cpp177
-rw-r--r--src/corelib/tools/qscopedpointer.h199
-rw-r--r--src/corelib/tools/qshareddata.cpp2
-rw-r--r--src/corelib/tools/qsharedpointer.cpp9
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h21
-rw-r--r--src/corelib/tools/qsize.cpp2
-rw-r--r--src/corelib/tools/qstring.cpp138
-rw-r--r--src/corelib/tools/qstringlist.cpp4
-rw-r--r--src/corelib/tools/qtextboundaryfinder.cpp10
-rw-r--r--src/corelib/tools/qvarlengtharray.h80
-rw-r--r--src/corelib/tools/qvector.cpp1
-rw-r--r--src/corelib/tools/qvector.h98
-rw-r--r--src/corelib/tools/tools.pri4
-rw-r--r--src/corelib/xml/qxmlstream.cpp5
-rw-r--r--src/corelib/xml/qxmlstream.h5
-rw-r--r--src/dbus/qdbusabstractadaptor.cpp2
-rw-r--r--src/dbus/qdbuscontext.h2
-rw-r--r--src/dbus/qdbusmessage.cpp1
-rw-r--r--src/gui/dialogs/dialogs.pri1
-rw-r--r--src/gui/dialogs/qcolordialog.cpp2
-rw-r--r--src/gui/dialogs/qdialog.cpp10
-rw-r--r--src/gui/dialogs/qfiledialog.cpp71
-rw-r--r--src/gui/dialogs/qfiledialog_p.h55
-rw-r--r--src/gui/dialogs/qfileinfogatherer.cpp28
-rw-r--r--src/gui/dialogs/qfilesystemmodel.cpp11
-rw-r--r--src/gui/dialogs/qfilesystemmodel_p.h25
-rw-r--r--src/gui/dialogs/qfontdialog.cpp10
-rw-r--r--src/gui/dialogs/qfontdialog_mac.mm40
-rw-r--r--src/gui/dialogs/qfscompleter_p.h81
-rw-r--r--src/gui/dialogs/qinputdialog.cpp12
-rw-r--r--src/gui/dialogs/qmessagebox.cpp15
-rw-r--r--src/gui/dialogs/qpagesetupdialog.cpp6
-rw-r--r--src/gui/dialogs/qpagesetupdialog_mac.mm3
-rw-r--r--src/gui/dialogs/qpagesetupdialog_win.cpp2
-rw-r--r--src/gui/dialogs/qprintdialog_unix.cpp4
-rw-r--r--src/gui/dialogs/qprintpreviewdialog.cpp13
-rw-r--r--src/gui/dialogs/qprintpreviewdialog.h2
-rw-r--r--src/gui/dialogs/qwizard.cpp4
-rw-r--r--src/gui/dialogs/qwizard_win.cpp5
-rw-r--r--src/gui/dialogs/qwizard_win_p.h2
-rw-r--r--src/gui/embedded/qkbdtty_qws.cpp4
-rw-r--r--src/gui/embedded/qscreen_qws.cpp2
-rw-r--r--src/gui/embedded/qsoundqss_qws.cpp36
-rw-r--r--src/gui/embedded/qwindowsystem_qws.cpp44
-rw-r--r--src/gui/embedded/qwscursor_qws.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp139
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h3
-rw-r--r--src/gui/graphicsview/qgraphicslayoutitem.cpp3
-rw-r--r--src/gui/graphicsview/qgraphicslayoutitem.h3
-rw-r--r--src/gui/graphicsview/qgraphicsproxywidget.h2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp10
-rw-r--r--src/gui/graphicsview/qgraphicssceneevent.cpp15
-rw-r--r--src/gui/graphicsview/qgraphicssceneevent.h3
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp17
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp8
-rw-r--r--src/gui/graphicsview/qgraphicswidget.h2
-rw-r--r--src/gui/gui.pro5
-rw-r--r--src/gui/image/qicon.cpp11
-rw-r--r--src/gui/image/qimage.cpp19
-rw-r--r--src/gui/image/qimageiohandler.cpp1
-rw-r--r--src/gui/image/qimageiohandler.h3
-rw-r--r--src/gui/image/qpicture.cpp17
-rw-r--r--src/gui/image/qpicture.h4
-rw-r--r--src/gui/image/qpicture_p.h2
-rw-r--r--src/gui/image/qpixmap.cpp97
-rw-r--r--src/gui/image/qpixmap.h9
-rw-r--r--src/gui/image/qpixmap_qws.cpp14
-rw-r--r--src/gui/image/qpixmap_s60.cpp173
-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.cpp7
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h34
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp125
-rw-r--r--src/gui/inputmethod/qwininputcontext_win.cpp7
-rw-r--r--src/gui/inputmethod/qximinputcontext_x11.cpp2
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp17
-rw-r--r--src/gui/itemviews/qabstractitemview_p.h2
-rw-r--r--src/gui/itemviews/qfileiconprovider.cpp1
-rw-r--r--src/gui/itemviews/qfileiconprovider.h5
-rw-r--r--src/gui/itemviews/qheaderview.cpp4
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp5
-rw-r--r--src/gui/itemviews/qlistwidget.cpp2
-rw-r--r--src/gui/itemviews/qsortfilterproxymodel.cpp3
-rw-r--r--src/gui/itemviews/qstandarditemmodel.cpp2
-rw-r--r--src/gui/itemviews/qstandarditemmodel.h2
-rw-r--r--src/gui/itemviews/qstyleditemdelegate.cpp3
-rw-r--r--src/gui/itemviews/qtreeview.cpp8
-rw-r--r--src/gui/itemviews/qtreewidget.cpp2
-rw-r--r--src/gui/itemviews/qtreewidgetitemiterator.cpp3
-rw-r--r--src/gui/itemviews/qtreewidgetitemiterator.h3
-rw-r--r--src/gui/kernel/qaction.cpp29
-rw-r--r--src/gui/kernel/qaction.h10
-rw-r--r--src/gui/kernel/qaction_p.h1
-rw-r--r--src/gui/kernel/qapplication.cpp14
-rw-r--r--src/gui/kernel/qapplication.h3
-rw-r--r--src/gui/kernel/qapplication_p.h2
-rw-r--r--src/gui/kernel/qapplication_qws.cpp27
-rw-r--r--src/gui/kernel/qapplication_s60.cpp151
-rw-r--r--src/gui/kernel/qapplication_win.cpp29
-rw-r--r--src/gui/kernel/qapplication_x11.cpp8
-rw-r--r--src/gui/kernel/qclipboard.cpp2
-rw-r--r--src/gui/kernel/qclipboard_s60.cpp32
-rw-r--r--src/gui/kernel/qcocoaapplicationdelegate_mac.mm2
-rw-r--r--src/gui/kernel/qcocoapanel_mac.mm11
-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/qcocoawindow_mac.mm13
-rw-r--r--src/gui/kernel/qcursor.cpp4
-rw-r--r--src/gui/kernel/qcursor_qws.cpp6
-rw-r--r--src/gui/kernel/qcursor_s60.cpp32
-rw-r--r--src/gui/kernel/qdesktopwidget_s60.cpp95
-rw-r--r--src/gui/kernel/qdnd_s60.cpp32
-rw-r--r--src/gui/kernel/qevent.cpp11
-rw-r--r--src/gui/kernel/qevent.h3
-rw-r--r--src/gui/kernel/qeventdispatcher_s60.cpp56
-rw-r--r--src/gui/kernel/qeventdispatcher_s60_p.h32
-rw-r--r--src/gui/kernel/qkeymapper_s60.cpp32
-rw-r--r--src/gui/kernel/qkeysequence.cpp2
-rw-r--r--src/gui/kernel/qshortcutmap.cpp5
-rw-r--r--src/gui/kernel/qshortcutmap_p.h3
-rw-r--r--src/gui/kernel/qsound_s60.cpp39
-rw-r--r--src/gui/kernel/qt_s60_p.h98
-rw-r--r--src/gui/kernel/qwidget.cpp196
-rw-r--r--src/gui/kernel/qwidget.h4
-rw-r--r--src/gui/kernel/qwidget_mac.mm10
-rw-r--r--src/gui/kernel/qwidget_p.h5
-rw-r--r--src/gui/kernel/qwidget_qws.cpp3
-rw-r--r--src/gui/kernel/qwidget_s60.cpp94
-rw-r--r--src/gui/kernel/qwidget_x11.cpp3
-rw-r--r--src/gui/painting/painting.pri3
-rw-r--r--src/gui/painting/qbrush.cpp113
-rw-r--r--src/gui/painting/qbrush.h6
-rw-r--r--src/gui/painting/qcolor.cpp8
-rw-r--r--src/gui/painting/qcolormap_s60.cpp108
-rw-r--r--src/gui/painting/qcolormap_x11.cpp4
-rw-r--r--src/gui/painting/qdrawhelper.cpp4
-rw-r--r--src/gui/painting/qpaintdevice_s60.cpp32
-rw-r--r--src/gui/painting/qpaintengine.cpp1
-rw-r--r--src/gui/painting/qpaintengine.h3
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp187
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp17
-rw-r--r--src/gui/painting/qpainter.cpp61
-rw-r--r--src/gui/painting/qpainter.h5
-rw-r--r--src/gui/painting/qpainterpath.cpp49
-rw-r--r--src/gui/painting/qpainterpath.h9
-rw-r--r--src/gui/painting/qprinter.cpp33
-rw-r--r--src/gui/painting/qprinter.h5
-rw-r--r--src/gui/painting/qprinterinfo.h3
-rw-r--r--src/gui/painting/qprinterinfo_mac.cpp32
-rw-r--r--src/gui/painting/qprinterinfo_unix.cpp33
-rw-r--r--src/gui/painting/qprinterinfo_win.cpp30
-rw-r--r--src/gui/painting/qrasterizer.cpp7
-rw-r--r--src/gui/painting/qregion.cpp160
-rw-r--r--src/gui/painting/qregion_s60.cpp32
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp8
-rw-r--r--src/gui/painting/qwindowsurface_raster.cpp4
-rw-r--r--src/gui/painting/qwindowsurface_raster_p.h2
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp32
-rw-r--r--src/gui/painting/qwindowsurface_s60_p.h32
-rw-r--r--src/gui/styles/gtksymbols.cpp27
-rw-r--r--src/gui/styles/qcommonstyle.cpp2
-rw-r--r--src/gui/styles/qgtkstyle.cpp78
-rw-r--r--src/gui/styles/qmacstyle_mac.mm161
-rw-r--r--src/gui/styles/qmotifstyle.cpp5
-rw-r--r--src/gui/styles/qs60style.cpp1725
-rw-r--r--src/gui/styles/qs60style.h40
-rw-r--r--src/gui/styles/qs60style_p.h122
-rw-r--r--src/gui/styles/qs60style_s60.cpp (renamed from src/gui/styles/qs60style_symbian.cpp)840
-rw-r--r--src/gui/styles/qs60style_simulated.cpp221
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp9
-rw-r--r--src/gui/styles/styles.pri3
-rw-r--r--src/gui/text/qcssparser.cpp19
-rw-r--r--src/gui/text/qfont.cpp83
-rw-r--r--src/gui/text/qfont.h3
-rw-r--r--src/gui/text/qfont_s60.cpp32
-rw-r--r--src/gui/text/qfont_x11.cpp11
-rw-r--r--src/gui/text/qfontdatabase.cpp43
-rw-r--r--src/gui/text/qfontdatabase_mac.cpp9
-rw-r--r--src/gui/text/qfontdatabase_qws.cpp81
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp76
-rw-r--r--src/gui/text/qfontdatabase_x11.cpp2
-rw-r--r--src/gui/text/qfontengine.cpp22
-rw-r--r--src/gui/text/qfontengine_ft.cpp84
-rw-r--r--src/gui/text/qfontengine_ft_p.h1
-rw-r--r--src/gui/text/qfontengine_mac.mm4
-rw-r--r--src/gui/text/qfontengine_qpf.cpp31
-rw-r--r--src/gui/text/qfontengine_qpf_p.h1
-rw-r--r--src/gui/text/qfontengine_s60.cpp59
-rw-r--r--src/gui/text/qfontengine_s60_p.h32
-rw-r--r--src/gui/text/qfontengine_win.cpp30
-rw-r--r--src/gui/text/qfontengine_win_p.h3
-rw-r--r--src/gui/text/qfontmetrics.cpp20
-rw-r--r--src/gui/text/qfragmentmap_p.h8
-rw-r--r--src/gui/text/qtextcontrol.cpp32
-rw-r--r--src/gui/text/qtextengine.cpp50
-rw-r--r--src/gui/text/qtextformat.cpp2
-rw-r--r--src/gui/text/qtextlayout.cpp2
-rw-r--r--src/gui/text/qtextoption.cpp10
-rw-r--r--src/gui/text/qtexttable.cpp15
-rw-r--r--src/gui/text/qzip.cpp10
-rw-r--r--src/gui/util/qdesktopservices_s60.cpp133
-rw-r--r--src/gui/util/qundostack.cpp2
-rw-r--r--src/gui/util/util.pri5
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp23
-rw-r--r--src/gui/widgets/qabstractscrollarea_p.h2
-rw-r--r--src/gui/widgets/qabstractspinbox.cpp13
-rw-r--r--src/gui/widgets/qabstractspinbox.h2
-rw-r--r--src/gui/widgets/qactiontokeyeventmapper.cpp103
-rw-r--r--src/gui/widgets/qactiontokeyeventmapper_p.h81
-rw-r--r--src/gui/widgets/qcalendarwidget.cpp2
-rw-r--r--src/gui/widgets/qcombobox.cpp30
-rw-r--r--src/gui/widgets/qcombobox_p.h6
-rw-r--r--src/gui/widgets/qdatetimeedit.cpp1
-rw-r--r--src/gui/widgets/qlcdnumber.cpp2
-rw-r--r--src/gui/widgets/qlineedit.cpp51
-rw-r--r--src/gui/widgets/qmacnativewidget_mac.h2
-rw-r--r--src/gui/widgets/qmainwindow.cpp5
-rw-r--r--src/gui/widgets/qmdiarea.cpp2
-rw-r--r--src/gui/widgets/qmenu.cpp14
-rw-r--r--src/gui/widgets/qmenu.h3
-rw-r--r--src/gui/widgets/qmenu_mac.mm52
-rw-r--r--src/gui/widgets/qmenu_p.h3
-rw-r--r--src/gui/widgets/qmenu_symbian.cpp151
-rw-r--r--src/gui/widgets/qmenubar.cpp2
-rw-r--r--src/gui/widgets/qmenubar.h4
-rw-r--r--src/gui/widgets/qmenubar_p.h3
-rw-r--r--src/gui/widgets/qmenudata.h2
-rw-r--r--src/gui/widgets/qplaintextedit.cpp20
-rw-r--r--src/gui/widgets/qplaintextedit_p.h6
-rw-r--r--src/gui/widgets/qprintpreviewwidget.cpp13
-rw-r--r--src/gui/widgets/qprintpreviewwidget.h2
-rw-r--r--src/gui/widgets/qprogressbar.cpp2
-rw-r--r--src/gui/widgets/qscrollarea.cpp2
-rw-r--r--src/gui/widgets/qspinbox.cpp9
-rw-r--r--src/gui/widgets/qsplitter.cpp2
-rw-r--r--src/gui/widgets/qtabbar.cpp11
-rw-r--r--src/gui/widgets/qtabwidget.cpp2
-rw-r--r--src/gui/widgets/qtextedit.cpp17
-rw-r--r--src/gui/widgets/qtextedit_p.h1
-rw-r--r--src/gui/widgets/qtoolbox.cpp2
-rw-r--r--src/gui/widgets/widgets.pri8
-rw-r--r--src/network/access/qftp.cpp12
-rw-r--r--src/network/access/qhttp.cpp7
-rw-r--r--src/network/access/qhttp.h3
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp6
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h4
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp12
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp2
-rw-r--r--src/network/access/qnetworkdiskcache.cpp48
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp3
-rw-r--r--src/network/access/qnetworkrequest.cpp3
-rw-r--r--src/network/kernel/qhostaddress.cpp5
-rw-r--r--src/network/kernel/qhostaddress.h3
-rw-r--r--src/network/kernel/qhostinfo.cpp20
-rw-r--r--src/network/kernel/qhostinfo.h3
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp2
-rw-r--r--src/network/kernel/qhostinfo_win.cpp15
-rw-r--r--src/network/kernel/qnetworkinterface.cpp7
-rw-r--r--src/network/kernel/qnetworkinterface.h3
-rw-r--r--src/network/kernel/qnetworkinterface_symbian.cpp32
-rw-r--r--src/network/kernel/qnetworkinterface_win.cpp11
-rw-r--r--src/network/kernel/qnetworkproxy.cpp4
-rw-r--r--src/network/kernel/qurlinfo.cpp4
-rw-r--r--src/network/socket/qabstractsocket.cpp30
-rw-r--r--src/network/socket/qhttpsocketengine.cpp4
-rw-r--r--src/network/socket/qlocalserver.cpp4
-rw-r--r--src/network/socket/qlocalsocket_unix.cpp5
-rw-r--r--src/network/socket/qlocalsocket_win.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.cpp40
-rw-r--r--src/network/socket/qsocks5socketengine.cpp4
-rw-r--r--src/network/socket/qtcpserver.cpp7
-rw-r--r--src/network/ssl/qsslcertificate.cpp15
-rw-r--r--src/network/ssl/qsslcertificate.h2
-rw-r--r--src/network/ssl/qsslcipher.cpp5
-rw-r--r--src/network/ssl/qsslcipher.h3
-rw-r--r--src/network/ssl/qsslerror.cpp5
-rw-r--r--src/network/ssl/qsslerror.h2
-rw-r--r--src/network/ssl/qsslkey.cpp17
-rw-r--r--src/network/ssl/qsslkey.h3
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp25
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp145
-rw-r--r--src/network/ssl/ssl.pri6
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp3
-rw-r--r--src/opengl/qgl.cpp55
-rw-r--r--src/opengl/qgl.h3
-rw-r--r--src/opengl/qgl_win.cpp16
-rw-r--r--src/opengl/qgl_wince.cpp3
-rw-r--r--src/opengl/qgl_x11.cpp30
-rw-r--r--src/opengl/qglframebufferobject.cpp1
-rw-r--r--src/opengl/qglframebufferobject.h2
-rw-r--r--src/opengl/qglpaintdevice_qws.cpp2
-rw-r--r--src/opengl/qglpaintdevice_qws_p.h3
-rw-r--r--src/opengl/qglpixelbuffer.cpp1
-rw-r--r--src/opengl/qglpixelbuffer.h2
-rw-r--r--src/opengl/qpaintengine_opengl.cpp2
-rw-r--r--src/phonon/phonon.pro17
-rw-r--r--src/plugins/accessible/widgets/rangecontrols.h2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h4
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp193
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp30
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp15
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp42
-rw-r--r--src/plugins/imageformats/mng/qmnghandler.cpp2
-rw-r--r--src/plugins/imageformats/mng/qmnghandler.h3
-rw-r--r--src/plugins/s60/src/qdesktopservices_3_1.cpp32
-rw-r--r--src/plugins/s60/src/qdesktopservices_3_2.cpp36
-rw-r--r--src/plugins/s60/src/qlocale_3_1.cpp32
-rw-r--r--src/plugins/s60/src/qlocale_3_2.cpp34
-rw-r--r--src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro4
-rw-r--r--src/qt3support/itemviews/q3table.cpp1
-rw-r--r--src/qt3support/network/q3http.cpp2
-rw-r--r--src/qt3support/network/q3urloperator.cpp2
-rw-r--r--src/qt3support/other/q3accel.cpp2
-rw-r--r--src/qt3support/painting/q3painter.h2
-rw-r--r--src/qt3support/widgets/q3action.cpp2
-rw-r--r--src/qt3support/widgets/q3groupbox.cpp4
-rw-r--r--src/qt3support/widgets/q3popupmenu.cpp2
-rw-r--r--src/qt3support/widgets/q3progressbar.cpp2
-rw-r--r--src/qt3support/widgets/q3scrollview.cpp2
-rw-r--r--src/s60installs/qt_libs.pro2
-rw-r--r--src/s60main/qts60main.cpp33
-rw-r--r--src/s60main/qts60main_mcrt0.cpp42
-rw-r--r--src/s60main/qts60mainapplication.cpp33
-rw-r--r--src/s60main/qts60mainapplication.h32
-rw-r--r--src/s60main/qts60mainappui.cpp58
-rw-r--r--src/s60main/qts60mainappui.h39
-rw-r--r--src/s60main/qts60maindocument.cpp33
-rw-r--r--src/s60main/qts60maindocument.h32
-rw-r--r--src/s60main/s60main.rss32
-rw-r--r--src/script/qscriptable.cpp2
-rw-r--r--src/script/qscriptable.h4
-rw-r--r--src/script/qscriptclass.cpp2
-rw-r--r--src/script/qscriptclass.h3
-rw-r--r--src/script/qscriptclasspropertyiterator.cpp2
-rw-r--r--src/script/qscriptclasspropertyiterator.h3
-rw-r--r--src/script/qscriptcontext.cpp2
-rw-r--r--src/script/qscriptcontext.h3
-rw-r--r--src/script/qscriptcontextinfo.cpp23
-rw-r--r--src/script/qscriptcontextinfo.h3
-rw-r--r--src/script/qscriptengine.cpp20
-rw-r--r--src/script/qscriptengine.h5
-rw-r--r--src/script/qscriptengineagent.cpp2
-rw-r--r--src/script/qscriptengineagent.h3
-rw-r--r--src/script/qscriptstring.cpp48
-rw-r--r--src/script/qscriptstring.h5
-rw-r--r--src/script/qscriptvalue.cpp76
-rw-r--r--src/script/qscriptvalue.h8
-rw-r--r--src/script/qscriptvalue_p.h2
-rw-r--r--src/script/qscriptvalueiterator.cpp18
-rw-r--r--src/script/qscriptvalueiterator.h4
-rw-r--r--src/scripttools/debugging/qscriptbreakpointdata.cpp5
-rw-r--r--src/scripttools/debugging/qscriptbreakpointdata_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerbackend.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerbackend_p.h2
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommand.cpp5
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommand_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h3
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsole.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsole_p.h3
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp14
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerevent.cpp5
-rw-r--r--src/scripttools/debugging/qscriptdebuggerevent_p.h3
-rw-r--r--src/scripttools/debugging/qscriptdebuggerfrontend.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerfrontend_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerjob.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerjob_p.h3
-rw-r--r--src/scripttools/debugging/qscriptdebuggerresponse.cpp5
-rw-r--r--src/scripttools/debugging/qscriptdebuggerresponse_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalue.cpp16
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalue_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalueproperty.cpp14
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalueproperty_p.h3
-rw-r--r--src/scripttools/debugging/qscriptenginedebugger.cpp13
-rw-r--r--src/scripttools/debugging/qscriptscriptdata.cpp20
-rw-r--r--src/scripttools/debugging/qscriptscriptdata_p.h4
-rw-r--r--src/scripttools/debugging/qscriptstdmessagehandler.cpp1
-rw-r--r--src/scripttools/debugging/qscriptstdmessagehandler_p.h4
-rw-r--r--src/scripttools/debugging/qscriptvalueproperty.cpp14
-rw-r--r--src/scripttools/debugging/qscriptvalueproperty_p.h3
-rw-r--r--src/scripttools/scripttools.pro2
-rw-r--r--src/sql/drivers/ibase/qsql_ibase.cpp7
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.cpp11
-rw-r--r--src/sql/drivers/oci/qsql_oci.cpp12
-rw-r--r--src/sql/kernel/qsqlquery.cpp2
-rw-r--r--src/src.pro5
-rw-r--r--src/svg/qgraphicssvgitem.h6
-rw-r--r--src/svg/qsvggenerator.cpp3
-rw-r--r--src/svg/qsvggenerator.h3
-rw-r--r--src/testlib/3rdparty/cycle_p.h2
-rw-r--r--src/testlib/qtest.h7
-rw-r--r--src/testlib/qtestcase.cpp17
-rw-r--r--src/xml/dom/qdom.cpp88
-rw-r--r--src/xml/sax/qxml.cpp83
-rw-r--r--src/xml/sax/qxml.h5
-rw-r--r--src/xmlpatterns/api/qabstractxmlnodemodel.cpp1
-rw-r--r--src/xmlpatterns/api/qabstractxmlnodemodel.h3
-rw-r--r--src/xmlpatterns/api/qabstractxmlreceiver.cpp1
-rw-r--r--src/xmlpatterns/api/qabstractxmlreceiver.h3
-rw-r--r--src/xmlpatterns/api/qxmlresultitems.cpp1
-rw-r--r--src/xmlpatterns/api/qxmlresultitems.h3
-rw-r--r--src/xmlpatterns/expr/qpath.cpp2
-rw-r--r--tests/auto/_Categories/QtCore.txt9
-rw-r--r--tests/auto/_Categories/QtGui.txt1
-rw-r--r--tests/auto/_Categories/QtNetwork.txt2
-rw-r--r--tests/auto/_Categories/QtSql.txt1
-rw-r--r--tests/auto/_networkselftest/_networkselftest.pro6
-rw-r--r--tests/auto/_networkselftest/tst_networkselftest.cpp612
-rw-r--r--tests/auto/auto.pro4
-rw-r--r--tests/auto/collections/tst_collections.cpp6
-rw-r--r--tests/auto/exceptionsafety/tst_exceptionsafety.cpp628
-rw-r--r--tests/auto/macgui/tst_gui.cpp7
-rw-r--r--tests/auto/network-settings.h73
-rw-r--r--tests/auto/q3socketdevice/tst_q3socketdevice.cpp7
-rw-r--r--tests/auto/qbitarray/tst_qbitarray.cpp27
-rw-r--r--tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp53
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp32
-rw-r--r--tests/auto/qcssparser/tst_cssparser.cpp13
-rw-r--r--tests/auto/qdatastream/tst_qdatastream.cpp8
-rw-r--r--tests/auto/qdate/tst_qdate.cpp26
-rw-r--r--tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp25
-rw-r--r--tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp25
-rw-r--r--tests/auto/qeventloop/tst_qeventloop.cpp2
-rw-r--r--tests/auto/qfile/copy-fallback.qrc5
-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.cpp42
-rw-r--r--tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp65
-rw-r--r--tests/auto/qfontdatabase/tst_qfontdatabase.cpp2
-rw-r--r--tests/auto/qfuture/tst_qfuture.cpp2
-rw-r--r--tests/auto/qglobal/tst_qglobal.cpp62
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp38
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp4
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp16
-rw-r--r--tests/auto/qhostinfo/tst_qhostinfo.cpp1
-rw-r--r--tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp3
-rw-r--r--tests/auto/qicon/tst_qicon.cpp43
-rw-r--r--tests/auto/qimage/tst_qimage.cpp6
-rw-r--r--tests/auto/qinputcontext/tst_qinputcontext.cpp45
-rw-r--r--tests/auto/qiodevice/tst_qiodevice.cpp2
-rw-r--r--tests/auto/qitemdelegate/tst_qitemdelegate.cpp81
-rw-r--r--tests/auto/qitemmodel/tst_qitemmodel.cpp2
-rw-r--r--tests/auto/qitemview/tst_qitemview.cpp2
-rw-r--r--tests/auto/qlibrary/lib2/lib2.pro7
-rw-r--r--tests/auto/qlibrary/qlibrary.pro13
-rw-r--r--tests/auto/qlocale/test/test.pro9
-rw-r--r--tests/auto/qlocalsocket/lackey/lackey.pro2
-rw-r--r--tests/auto/qlocalsocket/test/test.pro15
-rw-r--r--tests/auto/qlocalsocket/tst_qlocalsocket.cpp26
-rw-r--r--tests/auto/qmake/testcompiler.cpp6
-rw-r--r--tests/auto/qmake/tst_qmake.cpp16
-rw-r--r--tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp10
-rw-r--r--tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp7
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp27
-rw-r--r--tests/auto/qobjectrace/tst_qobjectrace.cpp89
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp26
-rw-r--r--tests/auto/qpen/tst_qpen.cpp12
-rw-r--r--tests/auto/qpixmap/qpixmap.pro19
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp101
-rw-r--r--tests/auto/qplaintextedit/tst_qplaintextedit.cpp2
-rw-r--r--tests/auto/qpluginloader/tst_qpluginloader.cpp52
-rw-r--r--tests/auto/qprinter/tst_qprinter.cpp5
-rw-r--r--tests/auto/qprocess/tst_qprocess.cpp10
-rw-r--r--tests/auto/qprogressbar/tst_qprogressbar.cpp20
-rw-r--r--tests/auto/qresourceengine/qresourceengine.pro6
-rw-r--r--tests/auto/qscopedpointer/.gitignore1
-rw-r--r--tests/auto/qscopedpointer/qscopedpointer.pro3
-rw-r--r--tests/auto/qscopedpointer/tst_qscopedpointer.cpp282
-rw-r--r--tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro4
-rw-r--r--tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp5
-rw-r--r--tests/auto/qsharedpointer/tst_qsharedpointer.cpp137
-rw-r--r--tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp13
-rw-r--r--tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp10
-rw-r--r--tests/auto/qsplitter/tst_qsplitter.cpp5
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp1
-rw-r--r--tests/auto/qsslsocket/qsslsocket.pro20
-rw-r--r--tests/auto/qsslsocket/tst_qsslsocket.cpp76
-rw-r--r--tests/auto/qstylesheetstyle/qstylesheetstyle.pro12
-rw-r--r--tests/auto/qtablewidget/qtablewidget.pro12
-rw-r--r--tests/auto/qtcpsocket/tst_qtcpsocket.cpp24
-rw-r--r--tests/auto/qtemporaryfile/qtemporaryfile.pro9
-rw-r--r--tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp42
-rw-r--r--tests/auto/qtessellator/testtessellator.cpp2
-rw-r--r--tests/auto/qtessellator/tst_tessellator.cpp8
-rw-r--r--tests/auto/qtessellator/utils.cpp2
-rw-r--r--tests/auto/qtextcodec/tst_qtextcodec.cpp15
-rw-r--r--tests/auto/qthreadonce/tst_qthreadonce.cpp2
-rw-r--r--tests/auto/qtimer/tst_qtimer.cpp36
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp29
-rw-r--r--tests/auto/qtwidgets/tst_qtwidgets.cpp13
-rw-r--r--tests/auto/qudpsocket/tst_qudpsocket.cpp2
-rw-r--r--tests/auto/qvariant/tst_qvariant.cpp26
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp1
-rw-r--r--tests/auto/selftests/expected_skip.txt2
-rw-r--r--tests/auto/selftests/skip/tst_skip.cpp6
-rw-r--r--tests/auto/selftests/tst_selftests.cpp5
-rw-r--r--tests/auto/symbian/orientationchange/orientationchange.pro7
-rw-r--r--tests/auto/symbian/orientationchange/tst_orientationchange.cpp165
-rw-r--r--tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp214
-rw-r--r--tests/auto/symbian/qsymbiantests.pro2
-rw-r--r--tests/auto/utf8/tst_utf8.cpp2
-rw-r--r--tools/assistant/lib/fulltextsearch/qclucene_global_p.h16
-rw-r--r--tools/assistant/lib/qhelpdbreader.cpp3
-rw-r--r--tools/assistant/tools/assistant/bookmarkmanager.cpp77
-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/contentwindow.cpp9
-rw-r--r--tools/assistant/tools/assistant/indexwindow.cpp9
-rw-r--r--tools/assistant/tools/assistant/mainwindow.cpp30
-rw-r--r--tools/assistant/translations/qt_help.pro3
-rw-r--r--tools/assistant/translations/translations.pro3
-rw-r--r--tools/configure/configureapp.cpp56
-rw-r--r--tools/designer/src/components/formeditor/brushmanagerproxy.cpp4
-rw-r--r--tools/designer/src/components/formeditor/brushmanagerproxy.h2
-rw-r--r--tools/designer/src/components/formeditor/qdesigner_resource.cpp34
-rw-r--r--tools/designer/src/components/formeditor/qtbrushmanager.cpp5
-rw-r--r--tools/designer/src/components/formeditor/qtbrushmanager.h2
-rw-r--r--tools/designer/src/lib/shared/iconselector.cpp5
-rw-r--r--tools/designer/src/lib/shared/iconselector_p.h4
-rw-r--r--tools/designer/src/lib/shared/qtresourceeditordialog.cpp5
-rw-r--r--tools/designer/src/lib/shared/qtresourceeditordialog_p.h3
-rw-r--r--tools/designer/src/lib/shared/qtresourcemodel.cpp2
-rw-r--r--tools/designer/src/lib/shared/qtresourcemodel_p.h5
-rw-r--r--tools/designer/src/lib/shared/qtresourceview.cpp4
-rw-r--r--tools/designer/src/lib/shared/qtresourceview_p.h4
-rw-r--r--tools/designer/src/uitools/quiloader.cpp1
-rw-r--r--tools/designer/src/uitools/quiloader.h3
-rw-r--r--tools/linguist/shared/cpp.cpp25
-rw-r--r--tools/linguist/shared/java.cpp16
-rw-r--r--tools/linguist/shared/numerus.cpp46
-rw-r--r--tools/qdoc3/doc.cpp4
-rw-r--r--tools/qdoc3/main.cpp4
-rw-r--r--tools/qdoc3/test/classic.css8
-rw-r--r--tools/shared/qtgradienteditor/qtcolorbutton.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtcolorbutton.h2
-rw-r--r--tools/shared/qtgradienteditor/qtcolorline.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtcolorline.h2
-rw-r--r--tools/shared/qtgradienteditor/qtgradientdialog.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtgradientdialog.h2
-rw-r--r--tools/shared/qtgradienteditor/qtgradienteditor.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtgradienteditor.h2
-rw-r--r--tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtgradientstopscontroller.h2
-rw-r--r--tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp7
-rw-r--r--tools/shared/qtgradienteditor/qtgradientstopsmodel.h4
-rw-r--r--tools/shared/qtgradienteditor/qtgradientstopswidget.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtgradientstopswidget.h2
-rw-r--r--tools/shared/qtgradienteditor/qtgradientwidget.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtgradientwidget.h2
-rw-r--r--tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp4
-rw-r--r--tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.h2
-rw-r--r--tools/shared/qtpropertybrowser/qteditorfactory.cpp54
-rw-r--r--tools/shared/qtpropertybrowser/qteditorfactory.h30
-rw-r--r--tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp4
-rw-r--r--tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.h2
-rw-r--r--tools/shared/qtpropertybrowser/qtpropertybrowser.cpp14
-rw-r--r--tools/shared/qtpropertybrowser/qtpropertybrowser.h8
-rw-r--r--tools/shared/qtpropertybrowser/qtpropertymanager.cpp128
-rw-r--r--tools/shared/qtpropertybrowser/qtpropertymanager.h44
-rw-r--r--tools/shared/qtpropertybrowser/qttreepropertybrowser.cpp4
-rw-r--r--tools/shared/qtpropertybrowser/qttreepropertybrowser.h2
-rw-r--r--tools/shared/qtpropertybrowser/qtvariantproperty.cpp12
-rw-r--r--tools/shared/qtpropertybrowser/qtvariantproperty.h6
-rw-r--r--tools/shared/qttoolbardialog/qttoolbardialog.cpp14
-rw-r--r--tools/shared/qttoolbardialog/qttoolbardialog.h4
-rw-r--r--translations/assistant_da.ts1166
-rw-r--r--translations/assistant_ja.ts395
-rw-r--r--translations/qt_da.ts7745
-rw-r--r--translations/qt_help_da.ts387
-rw-r--r--translations/translations.pri2
-rw-r--r--util/s60theme/README31
-rw-r--r--util/s60theme/main.cpp78
-rw-r--r--util/s60theme/s60theme.pro12
-rw-r--r--util/s60theme/s60themeconvert.cpp301
-rw-r--r--util/s60theme/s60themeconvert.h54
-rwxr-xr-xutil/webkit/mkdist-webkit2
844 files changed, 27257 insertions, 7646 deletions
diff --git a/bin/build_release_package.pl b/bin/build_release_package.pl
deleted file mode 100644
index 0a35062..0000000
--- a/bin/build_release_package.pl
+++ /dev/null
@@ -1,205 +0,0 @@
-#######################################################################
-#
-# A script for creating binary release package
-#
-# Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
-# Contact: Qt Software Information (qt-info@nokia.com)
-#
-#######################################################################
-
-use Cwd;
-
-if (@ARGV)
-{
- my $platform = shift(@ARGV);
- my $build = shift(@ARGV);
- my $cert = shift(@ARGV);
- my $certKey = shift(@ARGV);
- my $releaseDir = shift(@ARGV);
- my $epocroot = shift(@ARGV);
-
- if ($build eq "")
- {
- print("HW build parameter required!\n");
- exit;
- }
-
- if ($cert eq "")
- {
- print("Signing certificate parameter required!\n");
- exit;
- }
-
- if ($certKey eq "")
- {
- print("Signing certificate key parameter required!\n");
- exit;
- }
-
- if ($releaseDir eq "")
- {
- print("Release directory parameter required!\n");
- exit;
- }
-
- if ($epocroot eq "")
- {
- $epocroot = "\\";
- }
-
- if ($epocroot =~ m/.*[^\\]$/)
- {
- $epocroot = "${epocroot}\\";
- }
-
- $epocroot =~ s/.://;
-
- my $releaseDirQt = "${releaseDir}\\qt";
- my $releaseDirEpocroot = "${releaseDir}\\epocroot";
- my $releaseDirSis = "${releaseDir}\\sis";
-
- my $qtRootDir = cwd();
- $qtRootDir =~ s/\//\\/g; # Fix dir separators
-
- my $qtRootDirForMatch = $qtRootDir; # Double backslashes so that variable can be used in matching
- $qtRootDirForMatch =~ s/\\/\\\\/;
-
- my $pkgFileName = "src\\s60installs\\qt_libs_${platform}_${build}.pkg";
-
- my $hwBuildDir = "${epocroot}epoc32\\release\\$platform\\$build";
- my $armDbgDir = "epoc32\\release\\armv5\\udeb";
- my $armRelDir = "epoc32\\release\\armv5\\urel";
- my $gcceDbgDir = "epoc32\\release\\gcce\\udeb";
- my $gcceRelDir = "epoc32\\release\\gcce\\urel";
- my $armLibDir = "epoc32\\release\\armv5\\lib";
- my $winscwDbgDir = "epoc32\\release\\winscw\\udeb";
-
- # clean up old stuff
- system("rd /S /Q ${releaseDir} 2> NUL");
- system("rd /S /Q ${epocroot}epoc32\\build 2> NUL"); # Just in case env is not clean
-
- # Copy the whole thing over to the release dir before it gets polluted
- print("Copying clean tree...\n");
- my $tempExcludeFile = "${releaseDir}\\__temp_exclude.txt";
- system("mkdir ${releaseDir} 2>NUL");
- runSystemCmd("echo \\.git\\ > ${tempExcludeFile}");
- runSystemCmd("xcopy ${qtRootDir} ${releaseDirQt} /E /I /H /Q /EXCLUDE:${tempExcludeFile}");
- system("del /F /Q ${tempExcludeFile} 2> NUL");
-
- # Clear archive flag from all items in \epoc32\release\armv5\urel and \epoc32\release\armv5\lib
- # as those will have the binaries used for all platforms and builds.
- runSystemCmd("attrib -A ${hwBuildDir}\\*");
- runSystemCmd("attrib -A ${epocroot}${armLibDir}\\*");
- runSystemCmd("attrib -A ${epocroot}${winscwDbgDir}\\*");
-
- # Build Qt
- runSystemCmd("configure -platform win32-mwc -xplatform symbian-abld -openssl-linked -qt-sql-sqlite -system-sqlite -nokia-developer");
- chdir("src");
- runSystemCmd("qmake");
- runSystemCmd("bldmake bldfiles");
- runSystemCmd("abld build ${platform} ${build}");
- runSystemCmd("abld build winscw udeb");
- chdir($qtRootDir);
-
- # Copy misc stuff
- runSystemCmd("xcopy ${qtRootDir}\\bin\\* ${releaseDirQt}\\bin /F /R /Y /I /D");
- runSystemCmd("xcopy ${qtRootDir}\\lib\\*.prl ${releaseDirQt}\\lib /F /R /Y /I /D /E");
- runSystemCmd("xcopy ${qtRootDir}\\mkspecs\\* ${releaseDirQt}\\mkspecs /F /R /Y /I /D /E");
- print("Copying includes...\n");
- runSystemCmd("xcopy ${qtRootDir}\\include\\* ${releaseDirQt}\\include /F /R /Y /I /D /E /Q");
- runSystemCmd("copy src\\corelib\\global\\qconfig.h ${releaseDirQt}\\src\\corelib\\global\\qconfig.h");
- runSystemCmd("copy .qmake.cache ${releaseDirQt}\\.qmake.cache");
-
- # Copy stuff indicated by pkg file for emulator
- open (PKG, "<".$pkgFileName);
- while (<PKG>)
- {
- my $line = $_;
- chomp ($line);
-
- # If the line specifies a file, parse the source and destination locations.
- if ($line =~ m/\"([^\"]+)\"\s*\-\s*\"([^\"]+)\"/)
- {
- my $sourcePath = $1;
- my $pkgDestinationPath = $2;
- $sourcePath =~ s/\//\\/g;
-
- # Copy stuff required for creating deployment package
- my $destinationPath = $sourcePath;
-
- if($destinationPath =~ m/($qtRootDirForMatch)/i)
- {
- $destinationPath =~ s/($qtRootDirForMatch)//i;
- $destinationPath = $releaseDirQt.$destinationPath;
- }
- else
- {
- $destinationPath =~ s/.://;
- if ($epocroot !~ m/\\/)
- {
- $destinationPath =~ s/($epocroot)//i;
- }
- $destinationPath = $releaseDirEpocroot.$destinationPath;
- }
-
- runSystemCmd("echo f|xcopy ${sourcePath} ${destinationPath} /F /R /Y /I /D");
-
- if ($sourcePath !~ m/\\epoc32\\release\\([^\\]+)\\(udeb|urel)\\(\w+(\.dll|\.exe))/i)
- {
- # Copy non-binaries also over for emulator to use
- $pkgDestinationPath =~ s/!:/${releaseDirEpocroot}\\epoc32\\winscw\\c/g;
- runSystemCmd("echo f|xcopy ${sourcePath} ${pkgDestinationPath} /F /R /Y /I /D");
- }
- else
- {
- # For binaries, copy also winscw versions (needed for deployed binaries that are not actually built)
- $sourcePath =~ s/epoc32\\release\\${platform}\\${build}/epoc32\\release\\winscw\\udeb/;
- $destinationPath =~ s/epoc32\\release\\${platform}\\${build}/epoc32\\release\\winscw\\udeb/;
- runSystemCmd("echo f|xcopy ${sourcePath} ${destinationPath} /F /R /Y /I /D");
- }
-
- }
- }
- close (PKG);
-
- # Copy any other binaries and related files built not included in pkg
- runSystemCmd("xcopy ${hwBuildDir}\\* ${releaseDirEpocroot}\\${armDbgDir} /A /F /R /Y /I /D ");
- runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${armRelDir} /F /R /Y /I /D");
- system("del /F /Q ${releaseDirEpocroot}\\${armRelDir}\\*.sym 2> NUL");
- runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${gcceDbgDir} /F /R /Y /I /D");
- runSystemCmd("xcopy ${releaseDirEpocroot}\\${armRelDir}\\* ${releaseDirEpocroot}\\${gcceRelDir} /F /R /Y /I /D");
- runSystemCmd("xcopy ${epocroot}${armLibDir}\\* ${releaseDirEpocroot}\\${armLibDir} /A /F /R /Y /I /D");
- runSystemCmd("xcopy ${epocroot}${winscwDbgDir}\\* ${releaseDirEpocroot}\\${winscwDbgDir} /A /F /R /Y /I /D");
-
- # Create unsigned sis and Rnd signed sisx
- my @pkgPathElements = split(/\\/, $pkgFileName);
- my $pathlessPkgFile = pop(@pkgPathElements);
- my @pkgSuffixElements = split(/\./, $pathlessPkgFile);
- pop(@pkgSuffixElements);
- my $sisFileName = join("", @pkgSuffixElements).".sis";
- system("mkdir ${releaseDirSis}");
- runSystemCmd("makesis ${pkgFileName} ${releaseDirSis}\\${sisFileName}");
- runSystemCmd("signsis ${releaseDirSis}\\${sisFileName} ${releaseDirSis}\\${sisFileName}x ${cert} ${certKey}");
-}
-else
-{
- print("Usage:\n");
- print("build_release_package.pl <hw platform> <hw build> <signing cert> <signing cert key> <release directory> [EPOCROOT]\n");
- print("EPOCROOT is optional, defaults to '\\'\n");
- print("1) Clean up the env. (abld reallyclean & delete \\my\\epoc\\root\\build folder)\n");
- print("2) Run \"build_release_package.pl armv5 udeb \\rd.cer \\rd-key.pem \\my_release_dir [\\my\\epoc\\root\\]>\"\n");
- print(" to build Qt and create the release package structure and sis file.\n");
- print(" Note: Run in the Qt root directory.\n");
- print("3) Optional: Get the sis signed with commercial certificate\n");
- print("4) Zip up the release directory contents\n");
-}
-
-sub runSystemCmd
-{
- my $error_code = system($_[0]);
- if ($error_code != 0)
- {
- print("'$_[0]' call failed: error code == $error_code\n");
- exit;
- }
-}
diff --git a/bin/createpackage.bat b/bin/createpackage.bat
index 1c6e94d..116d52b 100644
--- a/bin/createpackage.bat
+++ b/bin/createpackage.bat
@@ -1,5 +1,16 @@
@echo off
+set installsigned_old=%installsigned%
+set pkgfile_old=%pkgfile%
+set basename_old=%basename%
+set signsis1_old=%signsis1%
+set signsis2_old=%signsis2%
+set signsis3_old=%signsis3%
+set unsigned_sis_name_old=%unsigned_sis_name%
+set signed_sis_name_old=%signed_sis_name%
+set scriptpath_old=%scriptpath%
+set certificate_old=%certificate%
+
rem Help text
if "%1"=="" (
echo Convenience script for creating signed packages you can install on your phone.
@@ -13,14 +24,14 @@ if "%1"=="" (
)
if "%1"=="-i" (
- set installsisx=true
+ set installsigned=true
set pkgfile=%2
set basename=%~n2
set signsis1=%3
set signsis2=%4
set signsis3=%5
) else (
- set installsisx=false
+ set installsigned=false
set pkgfile=%1
set basename=%~n1
set signsis1=%2
@@ -28,34 +39,37 @@ if "%1"=="-i" (
set signsis3=%4
)
+set unsigned_sis_name=%basename%_unsigned.sis
+set signed_sis_name=%basename%.sis
+
+rem Get absolute path to this script
+set scriptpath=%~dp0
+
rem Check the .pkg actually exists.
if not exist %pkgfile% (
echo Error: Package description file '%pkgfile%' does not exist.
goto done
)
-rem Get absolute path to this script
-set scriptpath=%~dp0
-
-rem Remove any existing .sis or .sisx packages
-if exist %basename%.sis del %basename%.sis
-if exist %basename%.sisx del %basename%.sisx
+rem Remove any existing .sis packages
+if exist %signed_sis_name% del %signed_sis_name%
+if exist %unsigned_sis_name% del %unsigned_sis_name%
rem Create .sis package
-makesis %pkgfile%
+makesis %pkgfile% %unsigned_sis_name%
rem If no certificate is given, check default options
if x%signsis1% == x (
rem If RnD certificate is not found, sign with self signed certificate
if not exist %scriptpath%..\rd.cer (
set certificate=Self signed
- signsis %basename%.sis %basename%.sisx %scriptpath%..\selfsigned.cer %scriptpath%..\selfsigned.key
+ signsis %unsigned_sis_name% %signed_sis_name% %scriptpath%..\selfsigned.cer %scriptpath%..\selfsigned.key
goto install
)
rem Sign with RnD certificate
set certificate=RnD
- signsis %basename%.sis %basename%.sisx %scriptpath%..\rd.cer %scriptpath%..\rd-key.pem
+ signsis %unsigned_sis_name% %signed_sis_name% %scriptpath%..\rd.cer %scriptpath%..\rd-key.pem
) else (
if x%signsis2% == x (
echo Custom certificate key file parameter missing.
@@ -63,19 +77,30 @@ if x%signsis1% == x (
)
set certificate=%signsis1%
- signsis %basename%.sis %basename%.sisx %signsis1% %signsis2% %signsis3%
+ signsis %unsigned_sis_name% %signed_sis_name% %signsis1% %signsis2% %signsis3%
)
:install
-if exist %basename%.sisx (
- echo Successfully created %basename%.sisx using certificate %certificate%
- if "%installsisx%" == "true" (
- echo Installing %basename%.sisx...
- call %basename%.sisx
+if exist %signed_sis_name% (
+ echo Successfully created %signed_sis_name% using certificate %certificate%
+ if "%installsigned%" == "true" (
+ echo Installing %signed_sis_name%...
+ call %signed_sis_name%
)
)
:cleanup
-if exist %basename%.sis del %basename%.sis
+if exist %unsigned_sis_name% del %unsigned_sis_name%
+
+:done
-:done \ No newline at end of file
+set installsigned=%installsigned_old%
+set pkgfile=%pkgfile_old%
+set basename=%basename_old%
+set signsis1=%signsis1_old%
+set signsis2=%signsis2_old%
+set signsis3=%signsis3_old%
+set unsigned_sis_name=%unsigned_sis_name_old%
+set signed_sis_name=%signed_sis_name_old%
+set scriptpath=%scriptpath_old%
+set certificate=%certificate_old%
diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl
index d75605b..f18aaba 100644
--- a/bin/patch_capabilities.pl
+++ b/bin/patch_capabilities.pl
@@ -59,7 +59,7 @@ if (@ARGV)
print ("\n");
- my $baseCommandToExecute = "elftran -capability \"";
+ my $baseCommandToExecute = "elftran -vid 0x0 -capability \"";
if (@capabilitiesToSet)
{
$baseCommandToExecute .= join(" ", @capabilitiesToSet);
diff --git a/configure b/configure
index bd77174..4cf7499 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
@@ -2703,22 +2703,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}"
- 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
@@ -4128,14 +4130,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"
diff --git a/configure.exe b/configure.exe
index 30383d8..c90e029 100755
--- a/configure.exe
+++ b/configure.exe
Binary files differ
diff --git a/confqt.bat b/confqt.bat
deleted file mode 100644
index 5da9592..0000000
--- a/confqt.bat
+++ /dev/null
@@ -1 +0,0 @@
-configure -platform win32-mwc -xplatform symbian-abld -openssl-linked -qt-sql-sqlite -system-sqlite -nokia-developer %*
diff --git a/confsbsv2.bat b/confsbsv2.bat
deleted file mode 100644
index 6c9bc1a..0000000
--- a/confsbsv2.bat
+++ /dev/null
@@ -1 +0,0 @@
-configure -platform win32-mwc -xplatform symbian-sbsv2 -openssl-linked -qt-sql-sqlite -system-sqlite -nokia-developer %*
diff --git a/demos/boxes/glextensions.h b/demos/boxes/glextensions.h
index 74617d6..7ba3b32 100644
--- a/demos/boxes/glextensions.h
+++ b/demos/boxes/glextensions.h
@@ -120,8 +120,11 @@ glUnmapBuffer
//#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
#endif
+#ifndef GL_ARB_vertex_buffer_object
+typedef ptrdiff_t GLsizeiptrARB;
+#endif
+
#ifndef GL_VERSION_1_5
-typedef ptrdiff_t GLsizeiptr;
#define GL_ARRAY_BUFFER 0x8892
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GL_READ_WRITE 0x88BA
@@ -185,7 +188,7 @@ typedef void (APIENTRY *_glTexImage3D) (GLenum, GLint, GLenum, GLsizei, GLsizei,
typedef void (APIENTRY *_glGenBuffers) (GLsizei, GLuint *);
typedef void (APIENTRY *_glBindBuffer) (GLenum, GLuint);
-typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptr, const GLvoid *, GLenum);
+typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
typedef void (APIENTRY *_glDeleteBuffers) (GLsizei, const GLuint *);
typedef void *(APIENTRY *_glMapBuffer) (GLenum, GLenum);
typedef GLboolean (APIENTRY *_glUnmapBuffer) (GLenum);
diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp
index 1abb051..bdc5e03 100644
--- a/demos/embedded/desktopservices/contenttab.cpp
+++ b/demos/embedded/desktopservices/contenttab.cpp
@@ -5,12 +5,43 @@
**
** This file is part of the $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$
**
****************************************************************************/
// EXTERNAL INCLUDES
#include <QKeyEvent>
+#include <QMessageBox>
#include <QListWidget>
#include <QVBoxLayout>
#include <QFileInfoList>
@@ -36,9 +67,13 @@ ContentTab::~ContentTab()
// NEW PUBLIC METHODS
void ContentTab::init(const QDesktopServices::StandardLocation &location,
+ const QString &filter,
const QString &icon)
{
setContentDir(location);
+ QStringList filterList;
+ filterList = filter.split(";");
+ m_ContentDir.setNameFilters(filterList);
setIcon(icon);
connect(this, SIGNAL(itemClicked(QListWidgetItem *)),
@@ -60,7 +95,7 @@ void ContentTab::setIcon(const QString &icon)
void ContentTab::populateListWidget()
{
- QFileInfoList fileList = m_ContentDir.entryInfoList(QStringList(), QDir::Files, QDir::Time);
+ QFileInfoList fileList = m_ContentDir.entryInfoList(QDir::Files, QDir::Time);
foreach(QFileInfo item, fileList) {
new QListWidgetItem(m_Icon, itemName(item), this);
}
@@ -101,10 +136,19 @@ void ContentTab::keyPressEvent(QKeyEvent *event)
}
}
+void ContentTab::handleErrorInOpen(QListWidgetItem *item)
+{
+ Q_UNUSED(item);
+ QMessageBox::warning( this, tr("Operation Failed"), tr("Unkown error!"), QMessageBox::Close);
+}
+
// NEW SLOTS
void ContentTab::openItem(QListWidgetItem *item)
{
- QDesktopServices::openUrl(itemUrl(item));
+ bool ret = QDesktopServices::openUrl(itemUrl(item));
+ if(!ret)
+ handleErrorInOpen(item);
}
+
// End of File
diff --git a/demos/embedded/desktopservices/contenttab.h b/demos/embedded/desktopservices/contenttab.h
index 60fabc8..8d37209 100644
--- a/demos/embedded/desktopservices/contenttab.h
+++ b/demos/embedded/desktopservices/contenttab.h
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -44,6 +74,7 @@ public: // Constructors & Destructors
public: // New Methods
virtual void init(const QDesktopServices::StandardLocation &location,
+ const QString &filter,
const QString &icon);
protected: // New Methods
@@ -52,7 +83,7 @@ protected: // New Methods
virtual void populateListWidget();
virtual QString itemName(const QFileInfo &item);
virtual QUrl itemUrl(QListWidgetItem *item);
-
+ virtual void handleErrorInOpen(QListWidgetItem *item);
protected:
void keyPressEvent(QKeyEvent *event);
diff --git a/demos/embedded/desktopservices/desktopwidget.cpp b/demos/embedded/desktopservices/desktopwidget.cpp
index 17243cf..3abe591 100644
--- a/demos/embedded/desktopservices/desktopwidget.cpp
+++ b/demos/embedded/desktopservices/desktopwidget.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -29,18 +59,22 @@ DesktopWidget::DesktopWidget(QWidget *parent) : QWidget(parent)
// Images
ContentTab* imageTab = new ContentTab(tabWidget);
- imageTab->init(QDesktopServices::PicturesLocation, ":/resources/photo.png");
+ imageTab->init(QDesktopServices::PicturesLocation,
+ "*.png;*.jpg;*.jpeg;*.bmp;*.gif",
+ ":/resources/photo.png");
tabWidget->addTab(imageTab, tr("Images"));
// Music
ContentTab* musicTab = new ContentTab(tabWidget);
- musicTab->init(QDesktopServices::MusicLocation, ":/resources/music.png");
+ musicTab->init(QDesktopServices::MusicLocation,
+ "*.wav;*.mp3;*.mp4",
+ ":/resources/music.png");
tabWidget->addTab(musicTab, tr("Music"));
// Links
LinkTab* othersTab = new LinkTab(tabWidget);;
// Given icon file will be overriden by LinkTab
- othersTab->init(QDesktopServices::PicturesLocation, "");
+ othersTab->init(QDesktopServices::PicturesLocation, "", "");
tabWidget->addTab(othersTab, tr("Links"));
// Layout
diff --git a/demos/embedded/desktopservices/desktopwidget.h b/demos/embedded/desktopservices/desktopwidget.h
index a947e80..246ab18 100644
--- a/demos/embedded/desktopservices/desktopwidget.h
+++ b/demos/embedded/desktopservices/desktopwidget.h
@@ -5,7 +5,37 @@
**
** This file is part of the $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/demos/embedded/desktopservices/linktab.cpp b/demos/embedded/desktopservices/linktab.cpp
index 0d5bea7..58d1cc6 100644
--- a/demos/embedded/desktopservices/linktab.cpp
+++ b/demos/embedded/desktopservices/linktab.cpp
@@ -5,12 +5,43 @@
**
** This file is part of the $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$
**
****************************************************************************/
// EXTERNAL INCLUDES
#include <QUrl>
+#include <QMessageBox>
#include <QListWidgetItem>
// INTERNAL INCLUDES
@@ -45,5 +76,13 @@ QUrl LinkTab::itemUrl(QListWidgetItem *item)
return QUrl();
}
}
+void LinkTab::handleErrorInOpen(QListWidgetItem *item)
+{
+ if(m_MailToItem == item) {
+ QMessageBox::warning( this, tr("Operation Failed"), tr("Please check that you have\ne-mail accunt defined"), QMessageBox::Close);
+ } else {
+ ContentTab::handleErrorInOpen(item);
+ }
+}
// End of file
diff --git a/demos/embedded/desktopservices/linktab.h b/demos/embedded/desktopservices/linktab.h
index f88c334..a9c9868 100644
--- a/demos/embedded/desktopservices/linktab.h
+++ b/demos/embedded/desktopservices/linktab.h
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -41,6 +71,7 @@ public: // Constructors & Destructors
protected: // Derived Methods
virtual void populateListWidget();
virtual QUrl itemUrl(QListWidgetItem *item);
+ virtual void handleErrorInOpen(QListWidgetItem *item);
private: // Used variables
QListWidgetItem *m_WebItem;
diff --git a/demos/embedded/desktopservices/main.cpp b/demos/embedded/desktopservices/main.cpp
index 32e22ae..ebbcf63 100644
--- a/demos/embedded/desktopservices/main.cpp
+++ b/demos/embedded/desktopservices/main.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro
index ed2530c..9c08801 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.pro
+++ b/demos/embedded/fluidlauncher/fluidlauncher.pro
@@ -127,8 +127,8 @@ symbian {
desktopservices_images.sources = $$PWD/../desktopservices/data/*.png
desktopservices_images.path = /data/images
- saxbookmarks.sources = $$PWD/../../../examples/xml/saxbookmarks/frankf.xbel
- saxbookmarks.sources += $$PWD/../../../examples/xml/saxbookmarks/jenniferf.xbel
+ saxbookmarks.sources = $$PWD/../../../examples/xml/saxbookmarks/frank.xbel
+ saxbookmarks.sources += $$PWD/../../../examples/xml/saxbookmarks/jennifer.xbel
saxbookmarks.path = /data/qt/saxbookmarks
DEPLOYMENT += config files executables viewerimages saxbookmarks reg_resource resource \
diff --git a/demos/embedded/fluidlauncher/screenshots/drilldown.png b/demos/embedded/fluidlauncher/screenshots/drilldown.png
new file mode 100644
index 0000000..413d713
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/drilldown.png
Binary files differ
diff --git a/demos/mediaplayer/mediaplayer.pro b/demos/mediaplayer/mediaplayer.pro
index 001989d..ef07a3f 100644
--- a/demos/mediaplayer/mediaplayer.pro
+++ b/demos/mediaplayer/mediaplayer.pro
@@ -26,3 +26,5 @@ DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
}
include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian:TARGET.UID3 = 0xA000C613 \ No newline at end of file
diff --git a/demos/qtdemo/colors.cpp b/demos/qtdemo/colors.cpp
index 41bbfb3..883b0fb 100644
--- a/demos/qtdemo/colors.cpp
+++ b/demos/qtdemo/colors.cpp
@@ -97,7 +97,7 @@ bool Colors::noTickerMorph = false;
bool Colors::adapted = false;
bool Colors::verbose = false;
bool Colors::pause = true;
-int Colors::fps = 100;
+int Colors::fps = 60;
int Colors::menuCount = 18;
float Colors::animSpeed = 1.0;
float Colors::animSpeedButtons = 1.0;
diff --git a/demos/qtdemo/mainwindow.cpp b/demos/qtdemo/mainwindow.cpp
index 8723823..16ca95f 100644
--- a/demos/qtdemo/mainwindow.cpp
+++ b/demos/qtdemo/mainwindow.cpp
@@ -190,7 +190,6 @@ void MainWindow::switchTimerOnOff(bool on)
if (on && !Colors::noTimerUpdate){
this->useTimer = true;
- this->setViewportUpdateMode(QGraphicsView::NoViewportUpdate);
this->fpsTime = QTime::currentTime();
this->updateTimer.start(int(1000 / Colors::fps));
}
@@ -262,10 +261,6 @@ void MainWindow::tick()
if (MenuManager::instance()->ticker)
MenuManager::instance()->ticker->tick();
- this->viewport()->update();
- if (Colors::softwareRendering)
- QApplication::syncX();
-
if (this->useTimer)
this->updateTimer.start(int(1000 / Colors::fps));
}
@@ -435,9 +430,7 @@ void MainWindow::focusInEvent(QFocusEvent *)
if (MenuManager::instance()->ticker)
MenuManager::instance()->ticker->pause(false);
- int code = MenuManager::instance()->currentMenuCode;
- if (code == MenuManager::ROOT || code == MenuManager::MENU1)
- this->switchTimerOnOff(true);
+ this->switchTimerOnOff(true);
this->pausedLabel->setRecursiveVisible(false);
}
@@ -450,9 +443,7 @@ void MainWindow::focusOutEvent(QFocusEvent *)
if (MenuManager::instance()->ticker)
MenuManager::instance()->ticker->pause(true);
- int code = MenuManager::instance()->currentMenuCode;
- if (code == MenuManager::ROOT || code == MenuManager::MENU1)
- this->switchTimerOnOff(false);
+ this->switchTimerOnOff(false);
this->pausedLabel->setRecursiveVisible(true);
}
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 3180b7c..39082f6 100644
--- a/dist/changes-4.5.2
+++ b/dist/changes-4.5.2
@@ -24,6 +24,8 @@ General Improvements
--------------------
- Documentation and Examples
+ * Added a new example (fancy browser) which shows how to use jQuery
+ in QtWebKit.
Third party components
----------------------
@@ -33,6 +35,183 @@ Third party components
* Library *
****************************************************************************
+- QtWebKit
+ * Backported fixes for critical bugs, memory leaks, and crashes from
+ WebKit trunk (with revision numbers) related to:
+ Canvas (r40546, r41221 r41355, r42996, r43645)
+ Memory (r41527, r43764, r43828, r43830)
+ JavaScript (r39882, r40086, r40131, r40133)
+ Rendering (r41285, r41296, r41659, r42887)
+ Network (r41664, r42516, r42747)
+ Plugins (r41346, r43550, r43915, r43917, r43923)
+ Clipboard (r41360)
+
+- QtDBus
+ * [236955] Fixed an issue that would cause QtDBus to crash when
+ relaying a signal emitted from a class under certain conditions
+
+- QAbstractItemView
+ * [250754] Changing the font of the view would not update the size of the
+ items if there is an application stylesheet.
+ * [252532] Pressing enter in a QPlainTextEdit embedded on a itemview now
+ insert a newline
+
+- QAbstractNetworkCache
+ * Only cache responses to HTTP GET by default, not HTTP PUT or POST
+
+- QApplication
+ * [249589] Fixed bug that prevented any part of the application to receive
+ focus when Graphics View was disabled using QT_NO_GRAPHICSVIEW.
+
+- QComboBox
+ * [253944] Changing the style doesn't reset custom item delegate anymore.
+ * [254589] Fixed the frame appearing if setting a stylesheet with a border
+ on the embedded itemview while there is a stylesheet on the application
+
+- QDir
+ * Fix reentrency (listing directories in different threads)
+
+- QFileSystemModel
+ * [254701] QFileSystemModel doesn't sort subfolders when using it in a QTreeView
+ * [251295] Windows path names incorrectly constructed in calls to updateIcon()
+
+- QFileDialog
+ * [251341] It is not possible to remove a directory of the sidebar if the directory does not exist
+ * [251321] Hidden path in QFileDialog's sidebar cannot be opened
+ * [226483] setSidebarUrls() handles the urls case sensitive so that adding the same directory twice is possible - Windows
+ * [252068] QFileDialog with QSortFilterProxyModel crashes
+ * [254490] QFileDialog selectFile doesn't clear the selection if we call it several times.
+
+- QMacStyle
+ * [253339] Don't draw arrows on toolbuttons that have a menu and text only.
+ * [252301] Ensure that small and mini spin boxes are drawn correctly.
+
+- QMotifStyle
+ * Fix crash when changing style and destroying progressbar.
+
+- QFontDialog
+ * [252000] Ensure that QFontDialog::getFont() works on Mac OS X.
+
+- QGraphicsWidget
+ * Fixed a bug with Qt::WidgetWithChildren shortcut context.
+
+- QLocalSocket
+ * [247144] correctly handle remote disconnects
+
+- QNetworkCookie
+ * [251959] fix parsing of multiple cookies separated by a newline
+
+- QNetworkCookieJar
+ * [251467] do not allow cookies for domains like ".com"
+ * [228974] allow cookies whose domain attribute is missing a leading dot
+
+- QNetworkAccessManager
+ * [248838] Make QNetworkAccessManager reject invalid HTTP input
+ earlier
+
+- QWidget
+ * [250668] Don't send extra wheel events when using the scroll wheel in Cocoa.
+ * [253448] Prevent a crash when using the Qt::WA_MacBrushedMetal attribute
+ in conjunction with style sheets.
+
+- QWizard
+ * [252662] Fixed crash that could happen when compiling on Windows XP and
+ running on older Windows versions like 98 and 2000.
+
+- QObject
+ * Fixed possible race condition if two QObject connected together with
+ signals and slot are destroyed in different threads
+
+- QPainter
+ * [253783] Fixed text shaping bugs when using ligatures and different
+ scripts in a single text item.
+ * Fixed various inconsistencies for image drawing on non-integer
+ coordinates.
+ * Fixed bug with 0-opacity causing images to be drawn fully opaque.
+ * Fixed crash when drawing on a null pixmap.
+ * [251534] Fixed issue where text with non-opaque color from widget
+ palette would be blitted instead of blended.
+ * [253663] Fixed an issue with implicitly closed poly lines when using
+ perspective transforms.
+
+- QProgressBar
+ * [252283] Fixed busy indicator for a QProgressBar with a style sheet applied to it.
+
+- QSelectionModel
+ * [252069] fix QSelectionModel::rowIntersectsSelection or QSelectionModel::columnsIntersectsSelection not reporting right result if some items are disabled.
+
+- QSortFilterProxyModel
+ * [250023] Fixes QSortFilterProxyModel not reporting child if the model
+ need to fetchMore
+ * [251296] In dynamic filter model, childs of temporarly filtered items
+ where not correctly updated.
+ * [252507] Show a warning instead of crashing if invalid indexes are passed.
+ * [254234] Fixed setDynamicSortFilter not working when setting the model initially
+
+- QString
+ * Fixed reentrency of QString::squeeze()
+
+- QTabBar
+ * [252472] Fixed problem with the current tab not being visible after calling
+ setTabButton() on a scrolled tab bar.
+
+- QTransform
+ * Fixed issue in QTransform::type() causing a projective transform to be
+ treated as a scaling transform.
+
+- QVector
+ * Fixed reentrency of QVector::reserve()
+
+- QtOpenGL
+ * [247083] Re-enabled antialiasing for large font sizes in OpenGL paint
+ engine.
+ * [251485] Fixed crash that could occur with projective transforms and
+ high quality antialiasing.
+ * [253468] Fixed a crash in the GL 2 paint engine that could occur
+ when drawing text.
+
+- QCssParser
+ * [252311] "font-family:" now handle fallback font specified with a comas
+ separated list.
+
+- QFile and QTemporaryFile
+ * Fixed a leak of file descriptors in QTemporaryFile::rename, introduced in 4.5.1
+ * [165920] QFile::copy leaves the source file open after the file has been copied
+ * [191467] & [252293] QFile::copy of resource files to the filesystem fails on Windows
+ * [197857] QFile::copy of resource files leaves temporary files on filesystem
+ * [248223] QTemporaryFile: Access denied error when (re-)opening through QFile interface
+ * [252659] QTemporaryFile::rename may leave source file behind
+
+- QByteArrayMatcher
+ * [251958] Assignment operator and copy constructor miss data
+
+- QCompleter
+ * [253125] QCompleter doesn't expand entries with UnfilteredPopupCompletion
+
+- QPrintDialog
+ * [253135] Crash in QPrintDialog when editing output filename
+ * [252873] Fixed an issue that could cause QPrintDialog to invalidate
+ a valid QPrinter object.
+ * [224728] Fixed an issue under X11 where QPrintDialog didn't update
+ the print-to-file state, if it was passed a QPrinter set up to
+ print PDF or PostScript.
+
+- QPrinter
+ * [252873] Fixed an issue with QPrinter::NativeFormat printers not
+ being valid.
+ * [248881] Fixed an issue under Windows where QPrinter::pageRect() returned
+ the wrong rect when QPrinter::fullPage() was set.
+ * [199271] Fixed an issue with QPrinter::setPrinterName()/printerName()
+ on Mac.
+
+- QSvg
+ * [253614] Fixed an issue with parsing the 'stroke-dasharray' SVG attribute.
+
+- QSvgIconEngine
+ * [251106] Fixed an issue that would cause QIcon::actualSize() to reparse
+ the SVG file for each acutalSize() call, until QIcon::pixmap() was called.
+ * [248848] Fixed an issue that would cause QIcon::pixmap() to reparse the
+ SVG file, even though there was a cached pixmap for that size available.
****************************************************************************
* Database Drivers *
@@ -45,14 +224,44 @@ Third party components
Qt for Linux/X11
----------------
-
+[253186] Fixed compile error in qfontengine_ft.cpp on 64-bit platforms with
+legacy freetype headers.
+[241361] Prevented asynchronous access to non-thread safe libfontconfig API.
+[244362] Worked around X server crash when calling XFillPolygon with more than
+ 200000 points by falling back to raster paint engine.
+[250326] Titlebar wasn't shown on X11 with Qt::CustomizeWindowHint for
+ fixed-size windows.
+[251925] Improved showing QMessageBox on small screens.
+[252042] Fixed the loading of the OpenSSL libraries on OpenBSD.
+[255311] Fixed an issue with '-graphicssystem raster' on 8 and 16 bit X servers.
+[252328] Fixed an issue when rendering old XLFD fonts on X11 with Xrender and
+ fontconfig enabled.
+[248720] Fixed an issue with using '-graphicssystem raster' on X servers with
+ BGR color layout.
+[196152] Fixed a problem with QPixmap::toImage() on big endian systems that
+ would cause the R and B channels to be swapped for 32 bit pixmaps.
Qt for Windows
--------------
+Fixed an issue with text rendering in 16 bit mode.
+
+[246196] Fixed an issue with clipped glyphs when rendering text with
+ certain fonts.
+[251259] Switching to another app left text cursor in line edits with
+ QtMfc framework.
+[253367] Fixed a memory leak when loading system icons on Windows.
+
Qt for Mac OS X
---------------
+[252795] Ensure that we send Apple Events in the Cocoa port even when Cocoa isn't ready.
+[252176] Fix regression in drawing parts of pixmaps on Panther.
+[253402] Fix a crash when a Cocoa window that used to be a QWidget would get events
+ after the QWidget was destroyed.
+[249178] Fixed an issue with drawing text to QImages on Mac/Cocoa.
+[250066] Fixed an issue that caused reparenting of QGLWidgets to output warnings
+ on Mac/Cocoa.
Qt for Embedded Linux
@@ -61,6 +270,9 @@ Qt for Embedded Linux
Qt for Windows CE
-----------------
+[248846] Handle the back soft key on Windows mobile.
+[252319] Fix regression in native menu integration.
+[242484] Fixed crash if Qt::WindowCancelButtonHint is used for a QDialog
****************************************************************************
@@ -73,6 +285,7 @@ Qt for Windows CE
****************************************************************************
- Build System
+ * [253053] Linker in macx-g++42 spec is gcc instead of gcc-4.2
- Assistant
@@ -89,6 +302,8 @@ Qt for Windows CE
of 'Fixed' on the main cointainer.
* [253278] Made it possible to set QString-type properties using
QDesignerFormWindowCursor::setProperty().
+ * [253539] Prevent crash in Designer with the Cocoa port when when using a scroll
+ wheel to change a property.
- Linguist
- Linguist GUI
@@ -127,6 +342,26 @@ Qt for Windows CE
* Plugins *
****************************************************************************
+- directfb
+ * Make sure we pick an approriate format for pixmaps. E.g. use the same as
+ the primary surface for opaque pixmaps and pick an appropriate one for
+ transparent pixmaps if the primary surface format is not transparent.
+ * Properly fall back to the raster engine for pens that aren't solidcolor
+ * Properly fall back to raster engine with "mirrored" scales
+ * Make sure window surfaces are the approriate pixel format and created in
+ video memory if supported
+ * Fix clipping bug that would cause painting errors
+ * Fix various crash bugs
+ * Fix bugs when transforming/copying pixmaps with alpha channel
+ * Fix various bugs with regards to painting with alpha channel/porter duff
+ * Optimize a coupld of internal functions to slightly speed up drawing
+ * Optimize raster fall backs
+ * Allow more customization for Flipping options
+ * Fix drawing with opacity != 1.0
+ * Support for better logging when trying to debug performance problems.
+ * Fix bug in keyboard handling that caused modifiers not to work
+ * Get rid of some compiler warnings
+
****************************************************************************
* Important Behavior Changes *
diff --git a/dist/changes-4.5.2-tower b/dist/changes-4.5.2-tower
new file mode 100644
index 0000000..41dc8c8
--- /dev/null
+++ b/dist/changes-4.5.2-tower
@@ -0,0 +1,290 @@
+Qt 4.5.2-tower
+---------------
+
+The Qt for S60 "Tower" release is the fifth pre-release from the Qt for
+S60 porting project. "Tower" is based on the Qt 4.5 codebase.
+
+Up to and including SHA: not yet started :D
+
+Lists just S60 fixes, for general 4.5.0 changes go to:
+
+ http://www.qtsoftware.com/developer/changes/changes-4.5.0
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Task Tracker:
+
+ http://qtsoftware.com/developer/task-tracker
+
+Each of these identifiers can be entered in the task tracker to obtain
+more information about a particular change. Sometimes the task is internal
+and cannot be viewed by the public, a lot of them are non-public for Qt for
+S60 at the moment.
+
+****************************************************************************
+* New features *
+****************************************************************************
+
+New modules
+-----------
+
+- QtSql
+ * Implemented QtSql module with sqlite3 backend. For now backend is
+ provided only in binary format.
+- QtWebkit
+ * Experimental webkit build for s60. Can be enabled by passing -webkit to configure.
+- Phonon
+ * The Phonon library is now part of Qt, but it comes without a backend.
+ This means that applications can build and run against the Phonon
+ library, but there is currently no S60 backend plugin providing actual
+ multimedia playback. Possible alternatives such as Helix and MMF are
+ being investigated.
+
+New classes
+------------
+
+- todo
+ * todo
+
+Ported classes
+--------------
+
+- QSound
+ * Implemented CMdaAudioPlayerUtility based Symbian backend for QSound.
+- QLocalSocket and QLocalServer
+ * Added support for QLocalSocket and QLocalServer on Symbian
+
+Features
+--------
+- QApplication
+ * Implemented QApplication::beep() for Symbian
+
+- QSslSocket
+ * Added support for -openssl option i.e. runtime resolving of OpenSSL
+ symbols
+- todo
+ * todo
+
+Optimizations
+-------------
+
+- qdrawhelper
+ * Optimized drawing operations for RVCT builds, particulary for ARMV6.
+
+- qwidget_s60.cpp
+ * Avoid unnecessary calls to FocusChanged in Symbian
+
+****************************************************************************
+* Code clean-up *
+****************************************************************************
+
+- Cleanup qeventdispatcher_unix.cpp
+ * 247268: All qeventdispatcher_unix.cpp changes were reverted since,
+ this file is not anymore used in Symbian OS branch.
+- Cleanup QtNetwork workarounds implemented earlier due to Open C bugs.
+ * 247287: Removed getaddrinfo workaround
+ * 247288: Removed waitForConnected workaround
+ * 247289: Removed qt_socket_accept workaround
+ * 247290: Removed qt_socket_connect workaround
+ * 247290: Removed E32IONREAD workaround
+ * 247293: Removed nativeHasPendingDatagrams workaround
+ * 247295: Removed QNativeSocketEnginePrivate::nativeRead EPIPE
+ workaround
+- Other code clean-ups
+ * 247278: Removed unnecessary includes from qbackingstore.cpp.
+ * Fixed Q_OS_SYMBIAN ifdef usage in qfiledialog_p.h
+ * 247272: Removed qtestnetworkservers.h dependency, used
+ network-settings.h
+ * Revert "Work around compiler bug on Nokia Metrowerks compiler."
+ * Remove UI highlights being inverted colors based on highlight text colors.
+
+
+****************************************************************************
+* Build issues *
+****************************************************************************
+
+- QTest
+ * Fixed testlib export macros for RVCT builds.
+- namespaces
+ * Now builds when -qtnamespace option is defined
+
+****************************************************************************
+* Changes to existing classes *
+****************************************************************************
+
+- QDesktopServices
+ * Fixed forwardslash/backslash usage as an path separator
+
+- QPluginLoader
+ * QPluginLoader will look for plugin stubs from the same folder on other
+ drives if it can't find them from the indicated drive.
+
+- QEventDispatcher
+ * Lowered the timeout for reprioritizing the process to 100ms
+
+- QNetworkInterface
+ * Fixed R-handle leak in Symbian version of qnetworkinterface_unix.cpp
+ * Introduced a new qnetworkinterface_symbian.cpp, because there wasn't
+ really anything common to UNIX equivalent
+
+- QHostInfo
+ * Added support for host lookups with multiple ipv4 addresses.
+
+- QUdpSocket
+ * Updated BindFlag documentation to reflect behaviour on Symbian OS
+
+- QLocale
+ * Removed workaround for missing tzname symbol, fixes QLocal timeZone
+ implementation for Symbian.
+
+- QTemporaryFile
+ * Fixed temporary file rename in Symbian OS.
+
+- QThread
+ * Fix for thread termination in Symbian OS.
+
+- QIoDevice
+ * Fixed compilation error when QIODEVICE_DEBUG is defined.
+
+- QS60Style
+ * Added subElementRect implementation for SE_ItemViewItemCheckIndicator.
+ * Added support for E90 layouts.
+ * Added support for QScrollArea, QTextEditor, QGroupBox, QTreeView, QToolBar and QDial styling.
+ * Better support for theme and layout changes.
+ * Better support for themed palettes and themed text colors.
+ * Better support for multiselection in item views.
+ * Better theming for QTable and QPanel.
+ * Better support of highlight graphics and texts for QLists, QTreeViews, QCalendarWidgets and QComboBoxes.
+ * Support polishing fonts. Fonts are no longer changed within the drawing code.
+ * Draw spinbox arrowbuttons side-by-side, instead one on top of the other.
+ * Harmonize widget drawing so that widgets are of similar height.
+ * Support check states for QLists and QPushButtons.
+ * Support flat QPushButtons.
+ * Support busy indicator.
+ * Support QScrollBar pressed state.
+ * Support QPushButton disabled theme graphics.
+ * Separate theme background for QDialogs.
+ * Clarify QToolButton pressed state.
+ * Removed linedrawing of panels and groupboxes.
+ * Fix palette-polution for a style that is activated from an application after S60Style has been in use.
+ * Fix for frame masks with color depth other than EGrey2.
+ * Fix for squeezed QTabBars.
+ * Fix memory leak when color skinning graphics.
+
+- QDesktopServices
+ * Switched QDesktopServices mail-to URL handling to RSendAs in Symbian,
+ due to the fact that CSendUi requires extensive capabilities to work
+ correctly. Currently e-mail sending with qdesktopservices::openUrl
+ works in Symbian only if e-mail account already exists.
+
+- QCoeFepInputContext (non-public)
+ * Fixes FEP crash when changing the focused Qt widget to NULL.
+
+- QApplication
+ * 252798: Fixed layout when orientation changed via
+ AknAppUi::SetOrientationL.
+ * Generating MouseEvents has gone through several changes
+
+- QUdpSocket
+ * Wrote hack for QUdpSocket::writeDatagram return value in Symbian OS.
+
+- QNativeSocketEnginePrivate (non-public)
+ * Changed select to listen also expectfds in Symbain OS for given
+ sockets (Workaround to Open C bug).
+ * Fix to Open C bug: Socket connect failure is indicated exception set.
+
+- QEventDispatcherSymbian (non-public)
+ * Fixed ASSERT panic in Symbian event dispatcher
+ * 246600: Fix problem in eventdispatcher destructor / AO canceling
+ * Fixed active scheduler removal when calling QThread::terminate
+ * Fix to Open C bug: select sometimes returns -1 and errno is
+ ECONNREFUSED
+
+****************************************************************************
+* Examples and demos *
+****************************************************************************
+- Drilldown
+ * Added to demonstrate QtSql usage in Symbian OS
+
+- Deform, Pathstroke, and Wiggly
+ * Removed Symbian specific animation timer fixes since more generic
+ fix was made to event dispatcher.
+
+- Ftp
+ * Enabled default iap setting for FTP example
+
+- DesktopServices
+ * Implemented content filters for desktopservices example.
+ * Added error handling to qdesktopservices example when openUrl fails.
+
+- SecureSocketClient
+ * Fixed build issue caused by lack of cursor.
+
+- Fluidlauncher
+ * Removed ugly workaround to make emulator deployment work correctly,
+ since the issue has been fixed in qmake.
+ * Included drilldown to demonstrate QtSql usage
+ * Updated screenshots to S60 style
+
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
+- qmake
+ * Support for generating Symbian "test" targets: CONFIG += symbian_test.
+ * Support for Symbian Build System, version 2 (aka Raptor) via
+ symbian-sbsv2 mkspec.
+ * PAGED keyword is added to all MMP files by default, except in S60 3.1
+ builds.
+ * Read-only flag is no longer preserved when deploying files into
+ emulator environment.
+ * Changed the timestamp to ISO format in all files generated
+ by qmake for symbian-* mkspecs.
+ * Qt's VERSION variable will now generate VERSION keyword in mmp files.
+ * Made Open C include paths handling bit more robust.
+
+- configure
+ * -cetest is no longer a supported switch for configure.
+ * -stl option is enabled by default for Symbian OS
+ * -openssl option is enabled by default for Symbian OS.
+ * -fpu option enables vfpu type selection for ARM targets.
+
+- Release package creation
+ * Removed the obsolete script to create release package.
+
+- Createpackage script
+ * Now creates packages with .sis suffix.
+
+- Patch_capabilities script
+ * Will now patch also vendor id.
+
+****************************************************************************
+* Documnetation *
+****************************************************************************
+- qmake-manual
+ * 250370: Added documentation for ICON keyword
+
+****************************************************************************
+* Plugins *
+****************************************************************************
+
+- S60 version specific plugins
+ * Isolated S60 version dependent functionality to S60 version specific
+ plugins (qts60plugin_x_y.dll) to make it possible for single build to
+ run on any supported device, even if with reduced functionality on
+ some.
+
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+- Qt libs
+ * Qt libs are now built with "All -Tcb" capabilities always. It is now
+ always necessary to run patch_capabilities.pl script if self-signing
+ of Qt libs is desired.
+ * QtCore and QtSql made UNPAGED as workaround for an obscure crash
+ when they are paged.
+
+- todo
+ * todo
diff --git a/doc/src/3rdparty.qdoc b/doc/src/3rdparty.qdoc
index a87878e..23dfb12 100644
--- a/doc/src/3rdparty.qdoc
+++ b/doc/src/3rdparty.qdoc
@@ -61,6 +61,15 @@
\tableofcontents
+ \section1 DES (\c des.cpp)
+
+ \e{Implementation of DES encryption for NTLM\br
+ Copyright 1997-2005 Simon Tatham.\br
+ This software is released under the MIT license.}
+
+ See \c src/3rdparty/des/des.cpp for more information about the terms and
+ conditions under which the code is supplied.
+
\section1 FreeType 2 (\c freetype) version 2.3.6
\e{The FreeType project is a team of volunteers who develop free, portable
@@ -108,18 +117,6 @@
See \c src/3rdparty/harfbuzz/COPYING.FTL and src/3rdparty/harfbuzz/COPYING.GPL
for license details.
- \section1 MD5 (\c md5.cpp and \c md5.h)
-
- \e{This code implements the MD5 message-digest algorithm.
- The algorithm is due to Ron Rivest. This code was
- written by Colin Plumb in 1993, no copyright is claimed.
- This code is in the public domain; do with it what you wish.} -- quoted from
- \c src/3rdparty/md5/md5.h
-
- See \c src/3rdparty/md5/md5.cpp and \c src/3rdparty/md5/md5.h for more
- information about the terms and conditions under which the code is
- supplied.
-
\section1 The Independent JPEG Group's JPEG Software (\c libjpeg) version 6b
\e{This package contains C software to implement JPEG image compression and
@@ -132,6 +129,29 @@
See \c src/3rdparty/libjpeg/README for license details.
+ \section1 MD4 (\c md4.cpp and \c md4.h)
+
+ \e{MD4 (RFC-1320) message digest.\br
+ Modified from MD5 code by Andrey Panin <pazke@donpac.ru>\br\br
+ Written by Solar Designer <solar@openwall.com> in 2001, and placed in\br
+ the public domain. There's absolutely no warranty.}
+
+ See \c src/3rdparty/md4/md4.cpp and \c src/3rdparty/md4/md4.h for more
+ information about the terms and conditions under which the code is
+ supplied.
+
+ \section1 MD5 (\c md5.cpp and \c md5.h)
+
+ \e{This code implements the MD5 message-digest algorithm.
+ The algorithm is due to Ron Rivest. This code was
+ written by Colin Plumb in 1993, no copyright is claimed.
+ This code is in the public domain; do with it what you wish.} -- quoted from
+ \c src/3rdparty/md5/md5.h
+
+ See \c src/3rdparty/md5/md5.cpp and \c src/3rdparty/md5/md5.h for more
+ information about the terms and conditions under which the code is
+ supplied.
+
\section1 MNG Library (\c libmng) version 1.0.10
\e{The libmng library supports decoding, displaying, encoding, and various
@@ -152,6 +172,56 @@
See \c src/3rdparty/libpng/LICENSE for license details.
+ \section1 The ptmalloc memory allocator (\c ptmalloc3) version 1.8
+
+ \e ptmcalloc3 is a scalable concurrent memory allocator suitable
+ for use in multi-threaded programs.
+
+ \hr
+
+ Copyright (c) 2001-2006 Wolfram Gloger
+
+ Permission to use, copy, modify, distribute, and sell this software
+ and its documentation for any purpose is hereby granted without fee,
+ provided that (i) the above copyright notices and this permission
+ notice appear in all copies of the software and related documentation,
+ and (ii) the name of Wolfram Gloger may not be used in any advertising
+ or publicity relating to the software.
+
+ THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+ IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL,
+ INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
+ DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY
+ OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ PERFORMANCE OF THIS SOFTWARE.
+
+ \hr
+
+ See \c src/3rdparty/ptmalloc/COPYRIGHT for license details.
+
+ \section1 SHA-1 (\c sha1.cpp)
+
+ \e{Based on the public domain implementation of the SHA-1 algorithm\br
+ Copyright (C) Dominik Reichl <dominik.reichl@t-online.de>}
+
+ See \c src/3rdparty/sha1/sha1.cpp for more information about the terms and
+ conditions under which the code is supplied.
+
+ \section1 SQLite (\c sqlite) version 3.5.9
+
+ \e{SQLite is a small C library that implements a
+ self-contained, embeddable, zero-configuration SQL database engine.}
+ -- quoted from \l{http://www.sqlite.org/}{www.sqlite.org}.
+
+ According to the comments in the source files, the code is in the public
+ domain. See the
+ \l{http://www.sqlite.org/copyright.html}{SQLite Copyright} page on the
+ SQLite web site for further information.
+
\section1 TIFF Software Distribution (\c libtiff) version 3.8.2
\e {libtiff is a set of C functions (a library) that support the
@@ -212,17 +282,6 @@
See \c src/3rdparty/libtiff/COPYRIGHT for license details.
- \section1 SQLite (\c sqlite) version 3.5.9
-
- \e{SQLite is a small C library that implements a
- self-contained, embeddable, zero-configuration SQL database engine.}
- -- quoted from \l{http://www.sqlite.org/}{www.sqlite.org}.
-
- According to the comments in the source files, the code is in the public
- domain. See the
- \l{http://www.sqlite.org/copyright.html}{SQLite Copyright} page on the
- SQLite web site for further information.
-
\section1 Wintab API (\c wintab)
Wintab is a de facto API for pointing devices on Windows. The
@@ -238,35 +297,4 @@
src/3rdparty/zlib/README.
See \c src/3rdparty/zlib/README for license details.
-
- \section1 The ptmalloc memory allocator (\c ptmalloc3) version 1.8
-
- \e ptmcalloc3 is a scalable concurrent memory allocator suitable
- for use in multi-threaded programs.
-
- \hr
-
- Copyright (c) 2001-2006 Wolfram Gloger
-
- Permission to use, copy, modify, distribute, and sell this software
- and its documentation for any purpose is hereby granted without fee,
- provided that (i) the above copyright notices and this permission
- notice appear in all copies of the software and related documentation,
- and (ii) the name of Wolfram Gloger may not be used in any advertising
- or publicity relating to the software.
-
- THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
- EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
- WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
- IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL,
- INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
- DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY
- OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-
- \hr
-
- See \c src/3rdparty/ptmalloc/COPYRIGHT for license details.
*/
diff --git a/doc/src/accessible.qdoc b/doc/src/accessible.qdoc
index 090da86..ad9f4f1 100644
--- a/doc/src/accessible.qdoc
+++ b/doc/src/accessible.qdoc
@@ -527,7 +527,7 @@
on plugins, consult the plugins \l{How to Create Qt
Plugins}{overview document}.
- You can omit the the first macro unless you want the plugin
+ You can omit the first macro unless you want the plugin
to be statically linked with the application.
\section2 Implementing Interface Factories
diff --git a/doc/src/credits.qdoc b/doc/src/credits.qdoc
index 114e28d..6b48514 100644
--- a/doc/src/credits.qdoc
+++ b/doc/src/credits.qdoc
@@ -188,7 +188,7 @@
Jesper K. Pedersen <blackie atklaralvdalens-datakonsult.se>\br
Jim Lauchlan <jim.lauchlan at gecm.com>\br
Joachim Backes <backes at rhrk.uni-kl.de>\br
- Jochen R&ouml;mmler <jochen at concept.de>\br
+ Jochen R\ouml\c{}mmler <jochen at concept.de>\br
Jochen Scharrlach <jscharrl at BA-Stuttgart.De>\br
Joe Croft <jcroft at swbell.net>\br
Joel Lindholm <wizball at kewl.campus.luth.se>\br
diff --git a/doc/src/deployment.qdoc b/doc/src/deployment.qdoc
index bcfa93d..446c91b 100644
--- a/doc/src/deployment.qdoc
+++ b/doc/src/deployment.qdoc
@@ -1247,7 +1247,7 @@
\snippet doc/src/snippets/code/doc_src_deployment.qdoc 48
Then we update the source code in \c tools/plugandpaint/main.cpp
- to look for the the new plugins. After constructing the
+ to look for the new plugins. After constructing the
QApplication, we add the following code:
\snippet doc/src/snippets/code/doc_src_deployment.qdoc 49
diff --git a/doc/src/designer-manual.qdoc b/doc/src/designer-manual.qdoc
index 03b74e6..fc3adcf 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,64 +437,64 @@
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
- on your form will not resize when your form is resized. To set the main
- 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.
+ The main layout is the top level widget's (in this case, the QWidget)
+ layout. It is important that your top level widget has a layout; otherwise,
+ the widgets on your window will not resize when your window is resized. To
+ set the 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 (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.
+ accordingly. Alternatively, you can take a look at \QD's
+ \gui{Object Inspector}. If your top level widget does not have a layout,
+ you will see the broken layout icon next to it,
+ \inlineimage rgbController-no-toplevel-layout.png
+ .
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 +504,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 +524,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 +534,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 +783,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 +799,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 +906,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 +1133,7 @@
spacers just provide spacing hints to layouts, so they cannot be connected
to other objects.
-
+
\target HighlightedObjects
\table
\row
@@ -1177,7 +1172,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 +1715,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 +1742,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
@@ -2563,7 +2558,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.
@@ -2664,7 +2659,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-install.qdoc b/doc/src/emb-install.qdoc
index 11b3f03..eb75697 100644
--- a/doc/src/emb-install.qdoc
+++ b/doc/src/emb-install.qdoc
@@ -42,10 +42,10 @@
/*!
\page qt-embedded-install.html
- \title Installing Qt for Embedded Linux
+ \title Installing Qt on Embedded Linux
\ingroup qt-embedded-linux
\ingroup installation
- \brief How to install Qt for Embedded Linux.
+ \brief How to install Qt on Embedded Linux.
This document describes how to install \l{Qt for Embedded Linux} in your
development environment:
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/codeeditor.qdoc b/doc/src/examples/codeeditor.qdoc
index 669ab45..d218d0d 100644
--- a/doc/src/examples/codeeditor.qdoc
+++ b/doc/src/examples/codeeditor.qdoc
@@ -67,7 +67,7 @@
QTextEdit because it is optimized for handling plain text. See
the QPlainTextEdit class description for details.
- QPlainTextEdit lets us add selections in addition to the the
+ QPlainTextEdit lets us add selections in addition to the
selection the user can make with the mouse or keyboard. We use
this functionality to highlight the current line. More on this
later.
diff --git a/doc/src/examples/containerextension.qdoc b/doc/src/examples/containerextension.qdoc
index a4fbcea..6d29cf6 100644
--- a/doc/src/examples/containerextension.qdoc
+++ b/doc/src/examples/containerextension.qdoc
@@ -305,7 +305,7 @@
MultiPageWidget class \l
{designer/containerextension/multipagewidget.cpp}{implementation}).
Finally, we implicitly force an update of the page's property
- sheet by calling the the
+ sheet by calling the
QDesignerPropertySheetExtension::setChanged() function.
\snippet examples/designer/containerextension/multipagewidgetplugin.cpp 4
diff --git a/doc/src/examples/fortuneserver.qdoc b/doc/src/examples/fortuneserver.qdoc
index e6a7f85..848a3a3 100644
--- a/doc/src/examples/fortuneserver.qdoc
+++ b/doc/src/examples/fortuneserver.qdoc
@@ -45,7 +45,7 @@
The Fortune Server example shows how to create a server for a simple
network service. It is intended to be run alongside the
- \l{network/fortuneclient}{Fortune Client} example or the the
+ \l{network/fortuneclient}{Fortune Client} example or the
\l{network/blockingfortuneclient}{Blocking Fortune Client} example.
\image fortuneserver-example.png Screenshot of the Fortune Server example
diff --git a/doc/src/examples/ftp.qdoc b/doc/src/examples/ftp.qdoc
index 9cc9cd1..7a74a37 100644
--- a/doc/src/examples/ftp.qdoc
+++ b/doc/src/examples/ftp.qdoc
@@ -172,7 +172,7 @@
no entries were found (in which case our \c addToList() function
would not have been called).
- Let's continue with the the \c addToList() slot:
+ Let's continue with the \c addToList() slot:
\snippet examples/network/ftp/ftpwindow.cpp 10
@@ -190,7 +190,7 @@
\snippet examples/network/ftp/ftpwindow.cpp 12
- \c cdToParent() is invoked when the the user requests to go to the
+ \c cdToParent() is invoked when the user requests to go to the
parent directory of the one displayed in the file list. After
changing the directory, we QFtp::List its contents.
diff --git a/doc/src/examples/htmlinfo.qdoc b/doc/src/examples/htmlinfo.qdoc
index bf95486..af236e1 100644
--- a/doc/src/examples/htmlinfo.qdoc
+++ b/doc/src/examples/htmlinfo.qdoc
@@ -5,7 +5,37 @@
**
** This file is part of the $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/doc/src/examples/icons.qdoc b/doc/src/examples/icons.qdoc
index 750ef2e..a81ddb9 100644
--- a/doc/src/examples/icons.qdoc
+++ b/doc/src/examples/icons.qdoc
@@ -479,7 +479,7 @@
QTableWidget::openPersistentEditor() function to create
comboboxes for the mode and state columns of the items.
- Due to the the connection between the table widget's \l
+ Due to the connection between the table widget's \l
{QTableWidget::itemChanged()}{itemChanged()} signal and the \c
changeIcon() slot, the new image is automatically converted into a
pixmap and made part of the set of pixmaps available to the icon
diff --git a/doc/src/examples/musicplayerexample.qdoc b/doc/src/examples/musicplayerexample.qdoc
index d23c1f1..9f04bf6 100644
--- a/doc/src/examples/musicplayerexample.qdoc
+++ b/doc/src/examples/musicplayerexample.qdoc
@@ -154,7 +154,7 @@
\snippet examples/phonon/musicplayer/mainwindow.cpp 5
- We move on to the the slots of \c MainWindow, starting with \c
+ We move on to the slots of \c MainWindow, starting with \c
addFiles():
\snippet examples/phonon/musicplayer/mainwindow.cpp 6
diff --git a/doc/src/examples/qobjectxmlmodel.qdoc b/doc/src/examples/qobjectxmlmodel.qdoc
index ce1dab6..37c66bc 100644
--- a/doc/src/examples/qobjectxmlmodel.qdoc
+++ b/doc/src/examples/qobjectxmlmodel.qdoc
@@ -71,7 +71,7 @@
The query engine can only traverse two dimensional trees, because an
XML document is always a two dimensional tree. If we want to add the
QMetaObject tree to the node model, we have to somehow flatten it
- into the the same plane as the QObject tree. This requires that the
+ into the same plane as the QObject tree. This requires that the
node model class must build an auxiliary data structure and make it
part of the two dimensional QObject node model. How to do this is
explained in \l{Including The QMetaObject Tree}.
diff --git a/doc/src/examples/tabdialog.qdoc b/doc/src/examples/tabdialog.qdoc
index c9500af..5394b82 100644
--- a/doc/src/examples/tabdialog.qdoc
+++ b/doc/src/examples/tabdialog.qdoc
@@ -91,7 +91,7 @@
\snippet examples/dialogs/tabdialog/tabdialog.cpp 1
\snippet examples/dialogs/tabdialog/tabdialog.cpp 3
- We arrange the the tab widget above the buttons in the dialog:
+ We arrange the tab widget above the buttons in the dialog:
\snippet examples/dialogs/tabdialog/tabdialog.cpp 4
diff --git a/doc/src/examples/tooltips.qdoc b/doc/src/examples/tooltips.qdoc
index 5daa2b2..78b350b 100644
--- a/doc/src/examples/tooltips.qdoc
+++ b/doc/src/examples/tooltips.qdoc
@@ -353,7 +353,7 @@
Whenever the user creates a new shape item, we want the new item
to appear at a random position, and we use the \c
randomItemPosition() function to calculate such a position. We
- make sure that the item appears within the the visible area of the
+ make sure that the item appears within the visible area of the
\c SortingBox widget, using the widget's current width and heigth
when calculating the random coordinates.
diff --git a/doc/src/examples/trafficinfo.qdoc b/doc/src/examples/trafficinfo.qdoc
index c9b6890..13181cd 100644
--- a/doc/src/examples/trafficinfo.qdoc
+++ b/doc/src/examples/trafficinfo.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** 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.
diff --git a/doc/src/examples/transformations.qdoc b/doc/src/examples/transformations.qdoc
index eabb803..58c8b80 100644
--- a/doc/src/examples/transformations.qdoc
+++ b/doc/src/examples/transformations.qdoc
@@ -208,7 +208,7 @@
After transforming the coordinate system, we draw the \c
RenderArea's shape, and then we restore the painter state using
- the the QPainter::restore() function (i.e. popping the saved state off
+ the QPainter::restore() function (i.e. popping the saved state off
the stack).
\snippet examples/painting/transformations/renderarea.cpp 7
diff --git a/doc/src/examples/trollprint.qdoc b/doc/src/examples/trollprint.qdoc
index 38251ee..489012e 100644
--- a/doc/src/examples/trollprint.qdoc
+++ b/doc/src/examples/trollprint.qdoc
@@ -142,7 +142,7 @@
We can easily determine which file must be changed because the
translator's "context" is in fact the class name for the class where
the texts that must be changed appears. In this case the file is \c
- printpanel.cpp, where the there are four lines to change. Add the
+ printpanel.cpp, where there are four lines to change. Add the
second argument "two-sided" in the appropriate \c tr() calls to the
first pair of radio buttons:
diff --git a/doc/src/exceptionsafety.qdoc b/doc/src/exceptionsafety.qdoc
new file mode 100644
index 0000000..4e3e89e
--- /dev/null
+++ b/doc/src/exceptionsafety.qdoc
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+/*!
+ \page exceptionsafety.html
+ \title Exception Safety
+ \ingroup architecture
+ \brief A guide to exception safety in Qt.
+
+ \bold {Preliminary warning}: Exception safety is not feature complete!
+ Common cases should work, but classes might still leak or even crash.
+
+ Qt itself will not throw exceptions. Instead, error codes are used.
+ In addition, some classes have user visible error messages, for example
+ \l QIODevice::errorString() or \l QSqlQuery::lastError().
+ This has historical and practical reasons - turning on exceptions
+ can increase the library size by over 20%.
+
+ The following sections describe Qt's behavior if exception support is
+ enabled at compile time.
+
+ \tableofcontents
+
+ \section1 Exception safe modules
+
+ \section2 Containers
+
+ Qt's \l{container classes} are generally exception neutral. They pass any
+ exception that happens within their contained type \c T to the user
+ while keeping their internal state valid.
+
+ Example:
+
+ \code
+ QList<QString> list;
+ ...
+ try {
+ list.append("hello");
+ } catch (...) {
+ }
+ // list is safe to use - the exception did not affect it.
+ \endcode
+
+ Exceptions to that rule are containers for types that can throw during assignment
+ or copy constructions. For those types, functions that modify the container as well as
+ returning a value, are unsafe to use:
+
+ \code
+ MyType s = list.takeAt(2);
+ \endcode
+
+ If an exception occurs during the assignment of \c s, the value at index 2 is already
+ removed from the container, but hasn't been assigned to \c s yet. It is lost
+ without chance of recovery.
+
+ The correct way to write it:
+
+ \code
+ MyType s = list.at(2);
+ list.removeAt(2);
+ \endcode
+
+ If the assignment throws, the container still contains the value, no data loss occured.
+
+ Note that implicitly shared Qt classes will not throw in their assignment
+ operators or copy constructors, so the limitation above does not apply.
+
+ \section1 Out of memory handling
+
+ Most desktop operating systems overcommit memory. This means that \c malloc()
+ or \c{operator new} return a valid pointer, even though there is not enough
+ memory available at allocation time. On such systems, no exception of type
+ \c std::bad_alloc is thrown.
+
+ On all other operating systems, Qt will throw an exception of type std::bad_alloc
+ if any allocation fails. Allocations can fail if the system runs out of memory or
+ doesn't have enough continuous memory to allocate the requested size.
+
+ Exceptions to that rule are documented. As an example, \l QImage::create()
+ returns false if not enough memory exists instead of throwing an exception.
+
+ \section1 Recovering from exceptions
+
+ Currently, the only supported use case for recovering from exceptions thrown
+ within Qt (for example due to out of memory) is to exit the event loop and do
+ some cleanup before exiting the application.
+
+ Typical use case:
+
+ \code
+ QApplication app(argc, argv);
+ ...
+ try {
+ app.exec();
+ } catch (const std::bad_alloc &) {
+ // clean up here, e.g. save the session
+ // and close all config files.
+
+ return 0; // exit the application
+ }
+ \endcode
+
+ After an exception is thrown, the connection to the windowing server
+ might already be closed. It is not safe to call a GUI related function
+ after catching an exception.
+*/
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-no-toplevel-layout.png b/doc/src/images/rgbController-no-toplevel-layout.png
new file mode 100644
index 0000000..0a9bc29
--- /dev/null
+++ b/doc/src/images/rgbController-no-toplevel-layout.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/index.qdoc b/doc/src/index.qdoc
index 4ead9e4..23e8623 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">
@@ -207,10 +208,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 85ea20c..13af50c 100644
--- a/doc/src/installation.qdoc
+++ b/doc/src/installation.qdoc
@@ -499,32 +499,66 @@ in the \l{Qt for Windows CE Requirements} document.
We hope you will enjoy using Qt. Good luck!
*/
-/*! \page install-S60.html
+/*! \page install-S60-installer.html
-\title Installing Qt on S60
-\ingroup installation
+\title Installing Qt on S60 using binary package
\ingroup qts60
-\brief How to install Qt on S60.
+\brief How to install Qt on S60 using the binary package.
+
+\note Qt for S60 has some requirements that are given in more detail
+in the \l{Qt for S60 Requirements} document.
\list 1
- \o Install needed IDE and SDKs
- Make sure you have the following installed:
- \list
- \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher}
- \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/S60SDK/}{S60 Platform SDK 3rd Edition FP1 or higher}
- \o \l{http://www.forum.nokia.com/main/resources/technologies/openc_cpp/}{Open C/C++ for S60 3rd Edition} (automatically included in 3.2 and higher)
- \endlist
+ \o Install Qt
- These instructions assume the above tools are installed and
- that the enviroment variables for your compiler are set correctly.
+ Run \c{qt-s60-%VERSION%.exe} and follow the instructions.
- \note Users of \bold{S60 Platform SDK 3rd Edition FP1} also need special updates. The update can be found
- \l{http://pepper.troll.no/s60prereleases/patches/}{here}.
+ \note Qt must be installed on the same drive as the S60 SDK you are
+ using, and the install path must not contain any spaces.
- \note The wsini.ini provided with the \bold{S60 Platform SDK 5th Edition v0.9}
- needs to be updated for correct font rendering in the emulator. The update can be found
- \l{http://pepper.troll.no/s60prereleases/patches/}{here}.
+ \o Running Qt demos
+
+ We've included a subset of the Qt demos in this package for you
+ to try out. An excellent starting point is the "fluidlauncher"
+ demo. To run the demo on a real device, you first have to install
+ \c{qt_libs.sis} and \c{fluidlauncher.sis} found in the Qt installation
+ directory. In Windows Explorer right click on the \c{.sis} files and select
+ "Install with Nokia Application Installer" and follow the instructions.
+
+ To run the demos and examples on the emulator, you need to build them first.
+ Open the "Qt for S60 Command Prompt" from the Start menu and type:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 25
+
+ To run the demos on the emulator simply navigate to the directory of the demo
+ you want to see and run:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 27
+
+ For more information about building and running Qt programs on S60,
+ see \l{S60 - Introduction to using Qt}.
+
+ We hope you will enjoy using Qt.
+
+\endlist
+
+*/
+/*! \page install-S60.html
+
+\title Installing Qt on S60
+\ingroup installation
+\ingroup qts60
+\brief How to install Qt on S60
+
+\note Qt for S60 has some requirements that are given in more detail
+in the \l{Qt for S60 Requirements} document.
+
+\note This document describes how to install Qt for S60 from the source package.
+Go \l{Installing Qt on S60 using binary package}{here} for instructions on how to install
+Qt using binary package.
+
+\list 1
\o Install Qt
@@ -561,11 +595,9 @@ in the \l{Qt for Windows CE Requirements} document.
\o Build Qt
- The Qt libraries comes pre-built for real devices.
- If you are using a 3.x S60 SDK, install \c{qts60binaries\3.x\qtlibs-%VERSION%.exe}
- into the S60 SDK root directory. For example: \c{C:\Symbian\9.2\S60_3rd_FP1_2\}
- If you are using a 5.0 S60 SDK, install \c{qts60binaries\5.0\qtlibs-%VERSION%.exe}
- into the S60 SDK root directory. For example: \c{C:\S60\devices\S60_5th_Edition_SDK_v0.9\}
+ To build Qt for the device, type:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 28
To build Qt for the emulator, type:
@@ -576,33 +608,29 @@ in the \l{Qt for Windows CE Requirements} document.
\o Running Qt demos
We've included a subset of the Qt demos in this package for you
- to try out. An excellent starting point is the "fluidlauncher"
- demo. To run the demo on a real device, you first have to install
- the Qt libraries on the device.
- For 3.x devices install \c{qts60binaries\3.x\qt_libs_armv5_udeb.sisx}
- For 5.0 devices install \c{qts60binaries\5.0\qt_libs_armv5_udeb.sisx}
- included in this package to the device. Then type:
+ to try out. An excellent starting point is the "fluidlauncher"
+ demo. To run the demo on a real device, you first have to install
+ the Qt libraries on the device:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 29
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 25
+ \note You will need to supply certificate that allows installation
+ of binaries with "All -Tcb" capability to your device.
- This will create a self-signed \c fluidlauncher_gcce_udeb.sisx and
- install it to your device.
-
- \note You can specify your own certificate and key files as additional parameters to
- \c createpackage if default ones are not suitable.
-
- To run the demos on the emulator simply run:
+ Similarly, install fluidlauncher to the device:
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 27
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 30
- Or, if you need to supply arguments to the program, navigate to
- \c{%EPOCROOT%\Epoc32\release\winscw\udeb\} and start any of the
- Qt demos located there, for example:
+ This will create a self-signed \c fluidlauncher_armv5_urel.sis and
+ install it to your device.
+
+ To run the demos on the emulator simply navigate to the directory of the demo
+ you want to see and run:
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 26
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 27
- For more information about building and running Qt programs on S60,
- see \l{S60 - Introduction to using Qt}.
+ For more information about building and running Qt programs on S60,
+ see \l{S60 - Introduction to using Qt}.
We hope you will enjoy using Qt.
@@ -632,6 +660,7 @@ in the \l{Qt for Windows CE Requirements} document.
\list
\o \l{Qt for Embedded Linux Requirements}
\o \l{Qt for Mac OS X Requirements}
+ \o \l{Qt for S60 Requirements}
\o \l{Qt for Windows CE Requirements}
\o \l{Qt for Windows Requirements}
\o \l{Qt for X11 Requirements}
@@ -848,8 +877,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
@@ -867,3 +894,34 @@ in the \l{Qt for Windows CE Requirements} document.
enables the use of the Record extension to the X protocol to be used in
applications.
*/
+
+/*!
+ \page requirements-s60.html
+ \title Qt for S60 Requirements
+ \ingroup installation
+ \brief Setting up the S60 environment for Qt.
+ \previouspage General Qt Requirements
+
+ Qt for S60 requires the following software installed on your development PC:
+ \list
+ \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher}
+ \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/S60SDK/}{S60 Platform SDK 3rd Edition FP1 or higher}
+ \o \l{http://www.forum.nokia.com/main/resources/technologies/openc_cpp/}{Open C/C++ v1.6.0 or higher}.
+ Install this to all S60 SDKs you plan to use Qt with.
+ \o Building Qt libraries requires \l{http://www.arm.com/products/DevTools/RVCT.html}{RVCT} 2.2 [build 616] or later,
+ which is not available free of charge.
+ \endlist
+
+ Running Qt on real device requires the following packages to be installed on your device.
+ The packages can be found in the S60 SDK where you installed Open C/C++:
+ \list
+ \o \c{nokia_plugin\openc\s60opencsis\pips_s60_<version>.sis}
+ \o \c{nokia_plugin\openc\s60opencsis\openc_ssl_s60_<version>.sis}
+ \o \c{nokia_plugin\opencpp\s60opencppsis\stdcpp_s60_<version>.sis}
+ \endlist
+
+ \note Users of \bold{S60 Platform SDK 3rd Edition FP1} also need special updates. The update can be found
+ \l{http://pepper.troll.no/s60prereleases/patches/}{here}.
+
+ \sa {Known Issues in %VERSION%}
+*/
diff --git a/doc/src/licenses.qdoc b/doc/src/licenses.qdoc
index 1c3f6d2..a11c071 100644
--- a/doc/src/licenses.qdoc
+++ b/doc/src/licenses.qdoc
@@ -45,7 +45,7 @@
\ingroup licensing
\brief Information about other licenses used for Qt components and third-party code.
- Qt contains some code that is not provided under the the
+ Qt contains some code that is not provided under the
\l{GNU General Public License (GPL)},
\l{GNU Lesser General Public License (LGPL)} or the
\l{Qt Commercial Editions}{Qt Commercial License Agreement}, but rather under
diff --git a/doc/src/mac-differences.qdoc b/doc/src/mac-differences.qdoc
index 573e62d..5849850 100644
--- a/doc/src/mac-differences.qdoc
+++ b/doc/src/mac-differences.qdoc
@@ -128,7 +128,7 @@
If you want to build a new dynamic library combining the Qt 4
dynamic libraries, you need to introduce the \c{ld -r} flag. Then
- relocation information is stored in the the output file, so that
+ relocation information is stored in the output file, so that
this file could be the subject of another \c ld run. This is done
by setting the \c -r flag in the \c .pro file, and the \c LFLAGS
settings.
diff --git a/doc/src/model-view-programming.qdoc b/doc/src/model-view-programming.qdoc
index bf0c1c8..8874cfa 100644
--- a/doc/src/model-view-programming.qdoc
+++ b/doc/src/model-view-programming.qdoc
@@ -249,7 +249,7 @@
provide an API that allows you to sort your model data
programmatically. In addition, you can enable interactive sorting
(i.e. allowing the users to sort the data by clicking the view's
- headers), by connecting the QHeaderView::sectionClicked() signal
+ headers), by connecting the QHeaderView::sortIndicatorChanged() signal
to the QTableView::sortByColumn() slot or the
QTreeView::sortByColumn() slot, respectively.
diff --git a/doc/src/phonon-api.qdoc b/doc/src/phonon-api.qdoc
index 501b5a5..dd37fe2 100644
--- a/doc/src/phonon-api.qdoc
+++ b/doc/src/phonon-api.qdoc
@@ -2973,7 +2973,7 @@
\value ToggledHint
If this hint is set it means that
- the the control has only two states: zero and non-zero
+ the control has only two states: zero and non-zero
(see isToggleControl()).
\value LogarithmicHint
diff --git a/doc/src/platform-notes.qdoc b/doc/src/platform-notes.qdoc
index c8046c4..53db855 100644
--- a/doc/src/platform-notes.qdoc
+++ b/doc/src/platform-notes.qdoc
@@ -512,6 +512,19 @@
*/
/*!
+ \page platform-notes-symbian.html
+ \title Platform Notes - Symbian
+ \contentspage Platform Notes
+
+ This page contains information about the Symbian platforms Qt is currently known
+ to run on. More information about the combinations of platforms and compilers
+ supported by Qt can be found on the \l{Supported Platforms} page.
+
+ For information about mixing exceptions with symbian leaves,
+ see \l{Exception Safety with Symbian}
+*/
+
+/*!
\page platform-notes-embedded-linux.html
\title Platform Notes - Embedded Linux
\contentspage Platform Notes
diff --git a/doc/src/porting4-overview.qdoc b/doc/src/porting4-overview.qdoc
index b0146a6..462f849 100644
--- a/doc/src/porting4-overview.qdoc
+++ b/doc/src/porting4-overview.qdoc
@@ -364,4 +364,10 @@
In Qt 4.2 and later, \l{Qt Style Sheets} can be used to
implement many common modifications to existing styles, and
this may be sufficient for Qt 3 applications.
+
+ \section2 Events
+ In Qt 3, QCloseEvents were not accepted by default. In Qt 4,
+ the event handler QWidget::closeEvent() receives QCloseEvents,
+ and accepts them by default closing the application. To avoid
+ this, please reimplement QWidget::closeEvent().
*/
diff --git a/doc/src/q3valuelist.qdoc b/doc/src/q3valuelist.qdoc
index be315c2..e3681af 100644
--- a/doc/src/q3valuelist.qdoc
+++ b/doc/src/q3valuelist.qdoc
@@ -108,7 +108,7 @@
pointing to the removed member become invalid. Inserting into the
list does not invalidate any iterator. For convenience, the
function last() returns a reference to the last item in the list,
- and first() returns a reference to the the first item. If the
+ and first() returns a reference to the first item. If the
list is empty(), both last() and first() have undefined behavior
(your application will crash or do unpredictable things). Use
last() and first() with caution, for example:
diff --git a/doc/src/qalgorithms.qdoc b/doc/src/qalgorithms.qdoc
index b33c250..90289f9 100644
--- a/doc/src/qalgorithms.qdoc
+++ b/doc/src/qalgorithms.qdoc
@@ -59,7 +59,7 @@
If STL is available on all your target platforms, you can use the
STL algorithms instead of their Qt counterparts. One reason why
- you might want to use the the STL algorithms is that STL provides
+ you might want to use the STL algorithms is that STL provides
dozens and dozens of algorithms, whereas Qt only provides the most
important ones, making no attempt to duplicate functionality that
is already provided by the C++ standard.
diff --git a/doc/src/qmake-manual.qdoc b/doc/src/qmake-manual.qdoc
index ff56dad..c26d5f2 100644
--- a/doc/src/qmake-manual.qdoc
+++ b/doc/src/qmake-manual.qdoc
@@ -1474,7 +1474,14 @@
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 34
See also \l{#SOURCES}{SOURCES}.
-
+
+ \target ICON
+ \section1 ICON
+
+ This variable is used only in MAC and S60 to set the application icon.
+ Please see \l{Setting the Application Icon}{the application icon documentation}
+ for more information.
+
\target INCLUDEPATH
\section1 INCLUDEPATH
diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc
index 84b3a01..c063670 100644
--- a/doc/src/qnamespace.qdoc
+++ b/doc/src/qnamespace.qdoc
@@ -2412,6 +2412,8 @@
\value ImhNoPredictiveText Do not use predictive text (i.e. dictionary lookup) while typing.
\value ImhDialableCharactersOnly Only characters suitable for phone dialling are allowed.
+ \value ImhExclusiveInputMask A mask to test for the presence of any flags ending with \c Only.
+
\note If several flags ending with \c Only are ORed together, the resulting character set will
consist of the union of the specified sets. For instance specifying \c ImhNumbersOnly and
\c ImhUppercaseOnly would yield a set consisting of numbers and uppercase letters.
@@ -2426,12 +2428,11 @@
\value ImMicroFocus The rectangle covering the area of the input cursor in widget coordinates.
\value ImFont The currently used font for text input.
- \value ImCursorPosition The logical position of the cursor within the text surrounding the input area (see ImSurroundingText).
- If any text is selected, the position returned will be at the logical end of the
- selection, even if the real cursor is located at the logical start.
+ \value ImCursorPosition The logical position of the cursor within the text surrounding the input area (see \c ImSurroundingText).
\value ImSurroundingText The plain text around the input area, for example the current paragraph.
\value ImCurrentSelection The currently selected text.
\value ImMaximumTextLength The maximum number of characters that the widget can hold. If there is no limit, QVariant() is returned.
+ \value ImAnchorPosition The position of the selection anchor. This may be less or greater than \c ImCursorPosition, depending on which side of selection the cursor is. If there is no selection, it returns the same as \c ImCursorPosition.
*/
/*!
diff --git a/doc/src/qset.qdoc b/doc/src/qset.qdoc
index afbedc3..6326219 100644
--- a/doc/src/qset.qdoc
+++ b/doc/src/qset.qdoc
@@ -685,11 +685,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/qstyles.qdoc b/doc/src/qstyles.qdoc
new file mode 100644
index 0000000..e17097a
--- /dev/null
+++ b/doc/src/qstyles.qdoc
@@ -0,0 +1,261 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+
+/*!
+ \class QMacStyle
+ \brief The QMacStyle class provides a Mac OS X style using the Apple Appearance Manager.
+
+ \ingroup appearance
+
+ This class is implemented as a wrapper to the HITheme
+ APIs, allowing applications to be styled according to the current
+ theme in use on Mac OS X. This is done by having primitives
+ in QStyle implemented in terms of what Mac OS X would normally theme.
+
+ \warning This style is only available on Mac OS X because it relies on the
+ HITheme APIs.
+
+ There are additional issues that should be taken
+ into consideration to make an application compatible with the
+ \link http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html
+ Apple Human Interface Guidelines \endlink. Some of these issues are outlined
+ below.
+
+ \list
+
+ \i Layout - The restrictions on window layout are such that some
+ aspects of layout that are style-dependent cannot be achieved
+ using QLayout. Changes are being considered (and feedback would be
+ appreciated) to make layouts QStyle-able. Some of the restrictions
+ involve horizontal and vertical widget alignment and widget size
+ (covered below).
+
+ \i Widget size - Mac OS X allows widgets to have specific fixed sizes. Qt
+ does not fully implement this behavior so as to maintain cross-platform
+ compatibility. As a result some widgets sizes may be inappropriate (and
+ subsequently not rendered correctly by the HITheme APIs).The
+ QWidget::sizeHint() will return the appropriate size for many
+ managed widgets (widgets enumerated in \l QStyle::ContentsType).
+
+ \i Effects - QMacStyle uses HITheme for performing most of the drawing, but
+ also uses emulation in a few cases where HITheme does not provide the
+ required functionality (for example, tab bars on Panther, the toolbar
+ separator, etc). We tried to make the emulation as close to the original as
+ possible. Please report any issues you see in effects or non-standard
+ widgets.
+
+ \endlist
+
+ There are other issues that need to be considered in the feel of
+ your application (including the general color scheme to match the
+ Aqua colors). The Guidelines mentioned above will remain current
+ with new advances and design suggestions for Mac OS X.
+
+ Note that the functions provided by QMacStyle are
+ reimplementations of QStyle functions; see QStyle for their
+ documentation.
+
+ \img qmacstyle.png
+ \sa QWindowsXPStyle, QWindowsStyle, QPlastiqueStyle, QCDEStyle, QMotifStyle
+*/
+
+
+/*!
+ \enum QMacStyle::WidgetSizePolicy
+
+ \value SizeSmall
+ \value SizeLarge
+ \value SizeMini
+ \value SizeDefault
+ \omitvalue SizeNone
+*/
+
+/*! \fn QMacStyle::QMacStyle()
+ Constructs a QMacStyle object.
+*/
+
+/*! \fn QMacStyle::~QMacStyle()
+ Destructs a QMacStyle object.
+*/
+
+/*! \fn void QMacStyle::polish(QPalette &pal)
+ \reimp
+*/
+
+/*! \fn void QMacStyle::polish(QApplication *)
+ \reimp
+*/
+
+/*! \fn void QMacStyle::unpolish(QApplication *)
+ \reimp
+*/
+
+/*! \fn void QMacStyle::polish(QWidget* w)
+ \reimp
+*/
+
+/*! \fn void QMacStyle::unpolish(QWidget* w)
+ \reimp
+*/
+
+/*! \fn int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QWidget *widget) const
+ \reimp
+*/
+
+/*! \fn QPalette QMacStyle::standardPalette() const
+ \reimp
+*/
+
+/*! \fn int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w, QStyleHintReturn *hret) const
+ \reimp
+*/
+
+/*! \fn QPixmap QMacStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
+ \reimp
+*/
+
+/*! \fn QPixmap QMacStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const
+ \reimp
+*/
+
+/*!
+ \enum QMacStyle::FocusRectPolicy
+
+ This type is used to signify a widget's focus rectangle policy.
+
+ \value FocusEnabled show a focus rectangle when the widget has focus.
+ \value FocusDisabled never show a focus rectangle for the widget.
+ \value FocusDefault show a focus rectangle when the widget has
+ focus and the widget is a QSpinWidget, QDateTimeEdit, QLineEdit,
+ QListBox, QListView, editable QTextEdit, or one of their
+ subclasses.
+*/
+
+/*! \fn void QMacStyle::setFocusRectPolicy(QWidget *w, FocusRectPolicy policy)
+ \obsolete
+ Sets the focus rectangle policy of \a w. The \a policy can be one of
+ \l{QMacStyle::FocusRectPolicy}.
+
+ This is now simply an interface to the Qt::WA_MacShowFocusRect attribute and the
+ FocusDefault value does nothing anymore. If you want to set a widget back
+ to its default value, you must save the old value of the attribute before
+ you change it.
+
+ \sa focusRectPolicy() QWidget::setAttribute()
+*/
+
+/*! \fn QMacStyle::FocusRectPolicy QMacStyle::focusRectPolicy(const QWidget *w)
+ \obsolete
+ Returns the focus rectangle policy for the widget \a w.
+
+ The focus rectangle policy can be one of \l{QMacStyle::FocusRectPolicy}.
+
+ In 4.3 and up this function will simply test for the
+ Qt::WA_MacShowFocusRect attribute and will never return
+ QMacStyle::FocusDefault.
+
+ \sa setFocusRectPolicy(), QWidget::testAttribute()
+*/
+
+/*! \fn void QMacStyle::setWidgetSizePolicy(const QWidget *widget, WidgetSizePolicy policy)
+
+ \obsolete
+
+ Call QWidget::setAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize,
+ or Qt::WA_MacNormalSize instead.
+*/
+
+/*! \fn QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget)
+ \obsolete
+
+ Call QWidget::testAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize,
+ or Qt::WA_MacNormalSize instead.
+*/
+
+/*! \fn void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const
+
+ \reimp
+*/
+
+/*! \fn void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w) const
+
+ \reimp
+*/
+
+/*! \fn QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *widget) const
+
+ \reimp
+*/
+
+/*! \fn void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget) const
+ \reimp
+*/
+
+/*! \fn QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget) const
+ \reimp
+*/
+
+/*! \fn QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const
+ \reimp
+*/
+
+/*! \fn QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &csz, const QWidget *widget) const
+ \reimp
+*/
+
+/*! \fn void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole) const
+ \reimp
+*/
+
+/*! \fn bool QMacStyle::event(QEvent *e)
+ \reimp
+*/
+
+/*! \fn QIcon QMacStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt, const QWidget *widget) const
+ \internal
+*/
+
+/*! \fn int QMacStyle::layoutSpacingImplementation(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option, const QWidget *widget) const
+
+ \internal
+*/
+
diff --git a/doc/src/qtdesigner.qdoc b/doc/src/qtdesigner.qdoc
index 7e3b619..9699c5b 100644
--- a/doc/src/qtdesigner.qdoc
+++ b/doc/src/qtdesigner.qdoc
@@ -632,7 +632,7 @@
/*!
\fn void QDesignerContainerExtension::setCurrentIndex(int index)
- Sets the the currently selected page in the container to be the
+ Sets the currently selected page in the container to be the
page at the given \a index in the extension's list of pages.
\sa currentIndex()
diff --git a/doc/src/qtscriptdebugger-manual.qdoc b/doc/src/qtscriptdebugger-manual.qdoc
index 3dfe879..75d87f8 100644
--- a/doc/src/qtscriptdebugger-manual.qdoc
+++ b/doc/src/qtscriptdebugger-manual.qdoc
@@ -367,7 +367,7 @@
\section3 continue
Continues execution normally, i.e, gives the execution control over
- the script back the the QScriptEngine.
+ the script back to the QScriptEngine.
\section3 eval <program>
diff --git a/doc/src/s60-introduction.qdoc b/doc/src/s60-introduction.qdoc
index a574355..537b37d 100644
--- a/doc/src/s60-introduction.qdoc
+++ b/doc/src/s60-introduction.qdoc
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -20,18 +50,21 @@
\tableofcontents
\section1 Required tools
+
+ See \l{Qt for S60 Requirements} to see what tools are required to use Qt for S60.
- In order to use Qt for S60 you need to have a typical S60 development
- setup. See \l{Qt for S60 Requirements} for the details.
-
- \section1 Installing Qt
+ \section1 Installing Qt and running demos
+
+ Follow the instructions found in \l{Installing Qt on S60 using binary package} to learn how
+ to install Qt using binary package and how to build and run Qt demos.
- Follow the instructions found in \l{Installing Qt on S60}.
+ Follow the instructions found in \l{Installing Qt on S60} to learn how to install Qt using
+ using source package and how to build and run the Qt demos.
\section1 Building your own applications
- If you are new to Qt development, have a look at \l{How to Learn Qt}
- and \l{Qt Tutorial}. In general, the difference between developing a
+ If you are new to Qt development, have a look at \l{How to Learn Qt}.
+ In general, the difference between developing a
Qt application on S60 compared to any of the other platforms supported
by Qt is not that big.
@@ -71,7 +104,7 @@
To install your own applications on hardware, Qt comes with a tool called
\c createpackage. When used on the \c .pkg files created by qmake, it
- will produce a \c .sisx file that can be installed to the device. For
+ will produce a signed \c .sis file that can be installed to the device. For
example:
\snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 2
diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc
index 2930317..489016d 100644
--- a/doc/src/snippets/code/doc_src_installation.qdoc
+++ b/doc/src/snippets/code/doc_src_installation.qdoc
@@ -137,22 +137,29 @@ configure -platform win32-mwc -xplatform symbian-abld
make debug-winscw
//! [24]
-
//! [25]
cd examples
-make debug-gcce
+qmake
+make
cd ..\demos
-
-make debug-gcce
-cd embedded\fluidlauncher
-createpackage -i fluidlauncher_gcce_udeb.pkg
+qmake
+make
//! [25]
-
-//! [26]
-wiggly.exe -small-screen
-//! [26]
-
//! [27]
make run
//! [27]
+
+//! [28]
+make release-armv5
+//! [28]
+
+//! [29]
+cd src\s60installs
+createpackage -i qt_libs_armv5_urel.pkg <certificate file> <certificate key file>
+//! [29]
+
+//! [30]
+cd embedded\fluidlauncher
+createpackage -i fluidlauncher_armv5_urel.pkg
+//! [30]
diff --git a/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp b/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp
new file mode 100644
index 0000000..05377dd
--- /dev/null
+++ b/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp
@@ -0,0 +1,64 @@
+//! [0]
+void myFunction(bool useSubClass)
+{
+ MyClass *p = useSubClass ? new MyClass() : new MySubClass;
+ QIODevice *device = handsOverOwnership();
+ QIODevi
+
+ if (m_value > 3) {
+ delete p;
+ delete device;
+ return;
+ }
+
+ try {
+ process(device);
+ }
+ catch (...) {
+ delete p;
+ delete device;
+ throw;
+ }
+
+ delete p;
+ delete device;
+}
+//! [0]
+
+//! [1]
+void myFunction(bool useSubClass)
+{
+ QScopedPointer<MyClass> p(useSubClass ? new MyClass() : new MySubClass);
+ QScopedPointer<QIODevice> device(handsOverOwnership());
+
+ if (m_value > 3)
+ return;
+
+ process(device);
+}
+//! [1]
+
+//! [2]
+ const QWidget *const p = new QWidget();
+ // is equivalent to:
+ const QScopedPointer<const QWidget> p(new QWidget());
+
+ QWidget *const p = new QWidget();
+ // is equivalent to:
+ const QScopedPointer<QWidget> p(new QWidget());
+
+ QWidget *const p = new QWidget();
+ // is equivalent to:
+ const QScopedPointer<QWidget> p(new QWidget());
+
+ const QWidget *p = new QWidget();
+ // is equivalent to:
+ QScopedPointer<const QWidget> p(new QWidget());
+
+//! [2]
+
+//! [3]
+if (scopedPointer) {
+ ...
+}
+//! [3]
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/stylesheet.qdoc b/doc/src/stylesheet.qdoc
index c0d13da..4060f33 100644
--- a/doc/src/stylesheet.qdoc
+++ b/doc/src/stylesheet.qdoc
@@ -332,7 +332,7 @@
respect to the reference element.
Once positioned, they are treated the same as widgets and can be styled
- using the the \l{box model}.
+ using the \l{box model}.
See the \l{List of Sub-Controls} below for a list of supported
sub-controls, and \l{Customizing the QPushButton's Menu Indicator
@@ -398,7 +398,7 @@
(usually) refers to a single object, not to all instances of a
class.
- Similarly, selectors with pseudo-states are more specific that
+ Similarly, selectors with pseudo-states are more specific than
ones that do not specify pseudo-states. Thus, the following style
sheet specifies that a \l{QPushButton} should have white text
when the mouse is hovering over it, otherwise red text:
@@ -653,7 +653,7 @@
\target sub controls
\section1 Sub-controls
- A widget is considered as a heirarchy (tree) of subcontrols drawn on top
+ A widget is considered as a hierarchy (tree) of subcontrols drawn on top
of each other. For example, the QComboBox draws the drop-down sub-control
followed by the down-arrow sub-control. A QComboBox is thus rendered as
follows:
@@ -671,7 +671,7 @@
\l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin}
properties.
- Once positioned, sub-controls can be styled using the the \l{box model}.
+ Once positioned, sub-controls can be styled using the \l{box model}.
\note With complex widgets such as QComboBox and QScrollBar, if one
property or sub-control is customized, \bold{all} the other properties or
@@ -1154,7 +1154,7 @@
\l{#pane-sub}{::pane} subcontrol. The left and right
corners are styled using the \l{#left-corner-sub}{::left-corner}
and \l{#right-corner-sub}{::right-corner} respectively.
- The position of the the tab bar is controlled using the
+ The position of the tab bar is controlled using the
\l{#tab-bar-sub}{::tab-bar} subcontrol.
By default, the subcontrols have positions of a QTabWidget in
@@ -1254,7 +1254,7 @@
the \l{#menu-button-sub}{::menu-button} subcontrol is used to draw the
menu button. \l{#menu-arrow-sub}{::menu-arrow} subcontrol is used to
draw the menu arrow inside the menu-button. By default, it is
- positioned in the center of the Contents rectangle of the the
+ positioned in the center of the Contents rectangle of the
menu-button subcontrol.
When the QToolButton displays arrows, the \l{#up-arrow-sub}{::up-arrow},
@@ -1872,10 +1872,6 @@
\snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 54
- \note If you specify more than one parameter in \c font-family,
- e.g., \c{font-family: Verdana, Arial}, Qt will only use the first
- font. If it cannot be found, Qt uses the system fallbacks instead.
-
\row
\o \c font-size
\o \l{#Font Size}{Font Size}
diff --git a/doc/src/symbian-exceptionsafety.qdoc b/doc/src/symbian-exceptionsafety.qdoc
new file mode 100644
index 0000000..e42ecd1
--- /dev/null
+++ b/doc/src/symbian-exceptionsafety.qdoc
@@ -0,0 +1,183 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+/*!
+ \page symbianexceptionsafety.html
+ \title Exception Safety with Symbian
+ \ingroup qts60
+ \brief A guide to integrating exception safety in Qt with Symbian.
+
+ The following sections describe how Qt code can interoperate with Symbian's
+ exception safety system.
+
+ \tableofcontents
+
+ \section1 What the problem is
+
+ Qt and Symbian have different exception systems. Qt works with standard C++
+ exceptions, whereas Symbian has its TRAP/Leave/CleanupStack system. So, what would
+ happen if
+ you mix the two systems? It could go wrong in a number of ways.
+
+ Cleanup ordering would be different between the two. When Symbian code
+ leaves, the cleanup stack is cleaned up before anything else happens. After
+ that, the objects on the call stack would be cleaned up as with a normal
+ exception. So if there are any dependencies between stack based and cleanup stack
+ owned objects, there could be problems due to this ordering.
+
+ Symbian's \c XLeaveException, which is used when Symbian implements leaves as
+ exceptions, is not derived from \c std::exception, so would not be caught in
+ Qt catch statements designed to catch \c std::exception.
+
+ Qt's and standard C++'s \c std::exception derived exceptions result in program
+ termination if they fall back to a Symbian TRAP.
+
+ These problems can be solved with barrier macros and helper functions that
+ will translate between the two exception systems. Use them, in Qt code,
+ whenever calling into or being called from Symbian code.
+
+ \section1 Qt calls to Symbian
+
+ When calling Symbian leaving functions from Qt code, we want to translate
+ Symbian leaves to standard C++ exceptions. The following help is provided:
+
+ \list
+ \o \l qt_translateSymbianErrorToException() takes a Symbian
+ error code and throws an appropriate exception to represent it.
+ This will do nothing if the error code is not in fact an error. The
+ function is equivalent to Symbian's \c User::LeaveIfError.
+ \o \l QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION() takes a Symbian leaving
+ code fragment f and runs it under a trap harness converting any resulting
+ error into an exception.
+ \o \c TRAP and \c TRAPD from the Symbian libraries can be used to convert
+ leaves to error codes.
+ \endlist
+
+ \code
+ HBufC* buf=0;
+ // this will throw a std::bad_alloc because we've asked for too much memory
+ QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(buf = HBufC::NewL(100000000));
+
+ _LIT(KStr,"abc");
+ TInt pos = KStr().Locate('c');
+ // pos is a good value, >= 0, so no exception is thrown
+ qt_translateSymbianErrorToException(pos);
+
+ pos = KStr().Locate('d');
+ // pos == KErrNotFound, so this throws an exception
+ qt_translateSymbianErrorToException(pos);
+ \endcode
+
+ \section1 Qt called from Symbian
+
+ When Qt code is called from Symbian, we want to translate standard C++
+ exceptions to Symbian leaves or error codes. The following help is
+ provided:
+
+ \list
+ \o \l qt_translateExceptionToSymbianError() -
+ this takes a standard exception and gives an appropriate Symbian
+ error code. If no mapping is known for the exception type,
+ \c KErrGeneral is returned.
+ \o \l qt_translateExceptionToSymbianErrorL() -
+ this takes a standard exception and generates an appropriate Symbian
+ leave.
+ \o \l QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR() - this macro
+ takes the standard C++ code fragment \c f, catches any std::exceptions
+ thrown from it, and sets err to the corresponding Symbian error code.
+ err is set to \c KErrNone otherwise.
+ \o \l QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE() - this macro takes the
+ standard C++ code fragment \c f, catches any std::exceptions thrown from
+ it, and throws a corresponding Symbian leave.
+ \endlist
+
+ \code
+ TInt DoTickL() // called from an active object RunL, ie Symbian leaves expected
+ {
+ // without the translation to Symbian Leave, we get a USER:0 panic
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE({
+ int* x = new int[100000000]; // compiled as Qt code, will throw std::bad_alloc
+ delete [] x;
+ });
+ return 0;
+ }
+ \endcode
+
+ \section1 Common sense things
+
+ Try to minimise the interleaving of Symbian and Qt code, every switch
+ requires a barrier. Grouping the code styles in different blocks will
+ minimise the problems. For instance, examine the following code.
+
+ \code
+ 1. TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this);
+ 2. QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath();
+ 3. filepath = QDir::toNativeSeparators(filepath);
+ 4. m_playUtility->OpenFileL(qt_QString2TPtrC(filepath)));
+ \endcode
+
+ Line 1 starts a Symbian leave handling block, which is good because it
+ also uses a Symbian leave generating function.
+
+ Line 2 creates a \l QString, uses \l QFileInfo and various member functions.
+ These could all throw exceptions, which is not good inside a \c TRAP block.
+
+ Line 3 is unclear as to whether it might throw an exception, but since
+ it's dealing with strings it probably does, again bad.
+
+ Line 4 is tricky, it calls a leaving function which is ok within a \c TRAP,
+ but it also uses a helper function to convert string types. In this case
+ the helper function may cause an unwelcome exception.
+
+ We could rewrite this with nested exception translations, but it's much
+ easier to refactor it.
+
+ \code
+ QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath();
+ filepath = QDir::toNativeSeparators(filepath);
+ TPtrC filepathPtr(qt_QString2TPtrC(filepath));
+ TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this);
+ m_playUtility->OpenFileL(filepathPtr));
+ \endcode
+
+ Now the exception generating functions are separated from the leaving
+ functions.
+*/
diff --git a/doc/src/tech-preview/known-issues.html b/doc/src/tech-preview/known-issues.html
index 05df69e..885104e 100644
--- a/doc/src/tech-preview/known-issues.html
+++ b/doc/src/tech-preview/known-issues.html
@@ -16,7 +16,7 @@
<td align="right" valign="middle"></td></tr></table>
<h1>Known Issues: Qt 4.0.0 Technology Preview 1</h1>
<p>
- This is the list of known and reported issues for the the Qt 4.0.0
+ This is the list of known and reported issues for the Qt 4.0.0
Technology Preview 1. This list is updated daily.
</p>
<br><br>
diff --git a/doc/src/timers.qdoc b/doc/src/timers.qdoc
index 4f54343..1b48d7d 100644
--- a/doc/src/timers.qdoc
+++ b/doc/src/timers.qdoc
@@ -62,7 +62,7 @@
In multithreaded applications, you can use the timer mechanism in
any thread that has an event loop. To start an event loop from a
- non-GUI thread, use QThread::exec(). Qt uses the the object's
+ non-GUI thread, use QThread::exec(). Qt uses the object's
\l{QObject::thread()}{thread affinity} to determine which thread
will deliver the QTimerEvent. Because of this, you must start and
stop all timers in the object's thread; it is not possible to
@@ -105,7 +105,7 @@
In multithreaded applications, you can use QTimer in any thread
that has an event loop. To start an event loop from a non-GUI
- thread, use QThread::exec(). Qt uses the the timer's
+ thread, use QThread::exec(). Qt uses the timer's
\l{QObject::thread()}{thread affinity} to determine which thread
will emit the \l{QTimer::}{timeout()} signal. Because of this, you
must start and stop the timer in its thread; it is not possible to
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 301f0d4..09a86bd 100644
--- a/doc/src/topics.qdoc
+++ b/doc/src/topics.qdoc
@@ -286,11 +286,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
@@ -302,3 +300,14 @@ including ARM, Intel x86, MIPS and SH-4.
\endlist
\endtable
*/
+
+/*!
+\group qts60
+\title Qt for S60
+\ingroup topics
+\brief Documents related to Qt for S60
+
+\list
+ \o \l {Exception Safety with Symbian}
+\endlist
+*/
diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc
index 3b0d2bc..9a1af85 100644
--- a/doc/src/tutorials/addressbook.qdoc
+++ b/doc/src/tutorials/addressbook.qdoc
@@ -296,14 +296,14 @@
We also declare two private QString objects, \c oldName and \c oldAddress.
These objects are needed to hold the name and address of the contact that
- was last displayed, before the user clicked "Add". So, when the user clicks
- "Cancel", we can revert to displaying the details of the last contact.
+ was last displayed, before the user clicked \gui Add. So, when the user clicks
+ \gui Cancel, we can revert to displaying the details of the last contact.
\section1 Implementing the AddressBook Class
Within the constructor of \c AddressBook, we set the \c nameLine and
\c addressText to read-only, so that we can only display but not edit
- existing cotact details.
+ existing contact details.
\dots
\snippet tutorials/addressbook/part2/addressbook.cpp setting readonly 1
@@ -318,7 +318,7 @@
The \c addButton is displayed by invoking the \l{QPushButton::show()}
{show()} function, while the \c submitButton and \c cancelButton are
hidden by invoking \l{QPushButton::hide()}{hide()}. These two push
- buttons will only be displayed when the user clicks "Add" and this is
+ buttons will only be displayed when the user clicks \gui Add and this is
handled by the \c addContact() function discussed below.
\snippet tutorials/addressbook/part2/addressbook.cpp connecting signals and slots
@@ -362,7 +362,7 @@
\list 1
\o We extract the contact's details from \c nameLine and \c addressText
and store them in QString objects. We also validate to make sure that the
- user did not click "Submit" with empty input fields; otherwise, a
+ user did not click \gui Submit with empty input fields; otherwise, a
QMessageBox is displayed to remind the user for a name and address.
\snippet tutorials/addressbook/part2/addressbook.cpp submitContact part1
@@ -374,8 +374,8 @@
\snippet tutorials/addressbook/part2/addressbook.cpp submitContact part2
If the contact already exists, again, we display a QMessageBox to inform
- the user about this, to prevent the user from adding duplicate contacts.
- Our \c contacts object is based on key-value pairs of name and addresses,
+ the user about this, preventing the user from adding duplicate contacts.
+ Our \c contacts object is based on key-value pairs of name and address,
hence, we want to ensure that \e key is unique.
\o Once we have handled both cases mentioned above, we restore the push
@@ -396,9 +396,9 @@
\snippet tutorials/addressbook/part2/addressbook.cpp cancel
- The general idea to add a contact is to give the user the flexibility to
- click "Submit" or "Cancel" at any time. The flowchart below further
- explains this concept:
+ The general idea behind adding a contact is to give the user the
+ flexibility to click \gui Submit or \gui Cancel at any time. The flowchart below
+ further explains this concept:
\image addressbook-tutorial-part2-add-flowchart.png
*/
@@ -454,7 +454,7 @@
\snippet tutorials/addressbook/part3/addressbook.cpp connecting navigation signals
The image below is our expected graphical user interface. Notice that it
- is getting closer to our expected final output.
+ is getting closer to our final application.
\image addressbook-tutorial-part3-screenshot.png
@@ -510,7 +510,7 @@
\list
\o If the iterator is at the end of \c contacts, we clear the
display and return.
- \o If the iterator is the beginning of \c contacts, we move it to
+ \o If the iterator is at the beginning of \c contacts, we move it to
the end.
\o We then decrement the iterator by one.
\endlist
@@ -529,7 +529,7 @@
\example tutorials/addressbook/part4
\title Address Book 4 - Editing and Removing Addresses
- In this chapter, we look at ways to modify the contents of contact stored
+ In this chapter, we look at ways to modify the contents of contacts stored
in the address book application.
\image addressbook-tutorial-screenshot.png
@@ -539,7 +539,7 @@
edit and remove functions so that a contact's details can be changed
when needed. However, this requires a little improvement, in the form of
enums. In our previous chapters, we had two modes: \c{AddingMode} and
- \c{NavigationMode} - but they weren't defined as enums. Instead, we
+ \c{NavigationMode} - but they were not defined as enums. Instead, we
enabled and disabled the corresponding buttons manually, resulting in
multiple lines of repeated code.
@@ -573,8 +573,7 @@
\dots
\snippet tutorials/addressbook/part4/addressbook.h mode declaration
- Lastly, we declare \c currentMode to keep track of the current mode of the
- enum.
+ Lastly, we declare \c currentMode to keep track of the enum's current mode.
\section1 Implementing the AddressBook Class
diff --git a/doc/src/xquery-introduction.qdoc b/doc/src/xquery-introduction.qdoc
index 37a45ac..fe541e2 100644
--- a/doc/src/xquery-introduction.qdoc
+++ b/doc/src/xquery-introduction.qdoc
@@ -347,7 +347,7 @@ has a more detailed section on the shorthand form, which it calls the
\l{http://www.w3.org/TR/xquery/#abbrev} {abbreviated syntax}. More
examples of path expressions written in the shorthand form are found
there. There is also a section listing examples of path expressions
-written in the the \l{http://www.w3.org/TR/xquery/#unabbrev} {longhand
+written in the \l{http://www.w3.org/TR/xquery/#unabbrev} {longhand
form}.
\target Name Tests
diff --git a/examples/dialogs/sipdialog/dialog.cpp b/examples/dialogs/sipdialog/dialog.cpp
index 9f1b9ad..653b518 100644
--- a/examples/dialogs/sipdialog/dialog.cpp
+++ b/examples/dialogs/sipdialog/dialog.cpp
@@ -90,7 +90,7 @@ Dialog::Dialog()
//! [Dialog constructor part4]
//! [Dialog constructor part5]
- connect(button, SIGNAL(pressed()),
+ connect(button, SIGNAL(clicked()),
qApp, SLOT(closeAllWindows()));
connect(QApplication::desktop(), SIGNAL(workAreaResized(int)),
this, SLOT(desktopResized(int)));
@@ -111,14 +111,13 @@ void Dialog::reactToSIP()
{
QRect availableGeometry = QApplication::desktop()->availableGeometry(0);
- if (desktopGeometry.width() == availableGeometry.width()) {
- if (desktopGeometry.height() > availableGeometry.height()) {
+ if (desktopGeometry != availableGeometry) {
+ if (windowState() | Qt::WindowMaximized)
setWindowState(windowState() & ~Qt::WindowMaximized);
- setGeometry(availableGeometry);
- } else {
- setWindowState(windowState() | Qt::WindowMaximized);
- }
+
+ setGeometry(availableGeometry);
}
+
desktopGeometry = availableGeometry;
}
//! [reactToSIP() function]
diff --git a/examples/dialogs/sipdialog/main.cpp b/examples/dialogs/sipdialog/main.cpp
index 5fcbfd8..fec6de2 100644
--- a/examples/dialogs/sipdialog/main.cpp
+++ b/examples/dialogs/sipdialog/main.cpp
@@ -48,6 +48,6 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog dialog;
- dialog.exec();
+ return dialog.exec();
}
//! [main() function]
diff --git a/examples/draganddrop/delayedencoding/delayedencoding.pro b/examples/draganddrop/delayedencoding/delayedencoding.pro
index c7b95b6..7315ac5 100644
--- a/examples/draganddrop/delayedencoding/delayedencoding.pro
+++ b/examples/draganddrop/delayedencoding/delayedencoding.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/delayedencoding
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/delayedencoding
INSTALLS += target sources
+
+symbian:TARGET.UID3 = 0xA000C614 \ No newline at end of file
diff --git a/examples/draganddrop/draggableicons/draggableicons.pro b/examples/draganddrop/draggableicons/draggableicons.pro
index 5212abc..6d53baa 100644
--- a/examples/draganddrop/draggableicons/draggableicons.pro
+++ b/examples/draganddrop/draggableicons/draggableicons.pro
@@ -10,3 +10,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggableicons
INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C615 \ No newline at end of file
diff --git a/examples/draganddrop/draggabletext/draggabletext.pro b/examples/draganddrop/draggabletext/draggabletext.pro
index 109be5d..15d909d 100644
--- a/examples/draganddrop/draggabletext/draggabletext.pro
+++ b/examples/draganddrop/draggabletext/draggabletext.pro
@@ -12,3 +12,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggabletext
INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF64 \ No newline at end of file
diff --git a/examples/draganddrop/puzzle/puzzle.pro b/examples/draganddrop/puzzle/puzzle.pro
index e51eb78..ecaf706 100644
--- a/examples/draganddrop/puzzle/puzzle.pro
+++ b/examples/draganddrop/puzzle/puzzle.pro
@@ -19,6 +19,7 @@ symbian:{
addFile.sources = example.jpg
addFile.path = .
DEPLOYMENT += addFile
+ TARGET.UID3 = 0xA000CF65
}
wince*: {
addFile.sources = example.jpg
diff --git a/examples/itemviews/puzzle/puzzle.pro b/examples/itemviews/puzzle/puzzle.pro
index e5ee3dd..de17a69 100644
--- a/examples/itemviews/puzzle/puzzle.pro
+++ b/examples/itemviews/puzzle/puzzle.pro
@@ -14,3 +14,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/puzzle
INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+wince* {
+ DEPLOYMENT_PLUGIN += qjpeg qgif qtiff
+}
+
diff --git a/examples/mainwindows/menus/menus.pro b/examples/mainwindows/menus/menus.pro
index 448e779..8cf60bf 100644
--- a/examples/mainwindows/menus/menus.pro
+++ b/examples/mainwindows/menus/menus.pro
@@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/menus
INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF66 \ No newline at end of file
diff --git a/examples/network/ftp/ftp.pro b/examples/network/ftp/ftp.pro
index 90594f5..b958f6a 100644
--- a/examples/network/ftp/ftp.pro
+++ b/examples/network/ftp/ftp.pro
@@ -13,9 +13,7 @@ INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
symbian {
- #Enable this macro if you have latest Open C and you want to get rid of IAP queries
- #DEFINES += SETDEFAULTIF_AVAILABLE
TARGET.CAPABILITY="NetworkServices"
TARGET.UID3 = 0xA000A648
- contains( DEFINES, SETDEFAULTIF_AVAILABLE ):LIBS+=-lesock
+ LIBS+=-lesock # For IAP selection
} \ No newline at end of file
diff --git a/examples/network/ftp/main.cpp b/examples/network/ftp/main.cpp
index a472fd7..a92a8b2 100644
--- a/examples/network/ftp/main.cpp
+++ b/examples/network/ftp/main.cpp
@@ -40,13 +40,12 @@
****************************************************************************/
#include <QApplication>
+#include "ftpwindow.h"
+
#ifdef Q_OS_SYMBIAN
#include <QDir>
#include <QDesktopWidget>
-#endif
-#include "ftpwindow.h"
-#if defined Q_OS_SYMBIAN && defined SETDEFAULTIF_AVAILABLE
#include <es_sock.h>
#include <sys/socket.h>
#include <net/if.h>
@@ -66,13 +65,15 @@ static void setDefaultIapL()
_LIT(KIapNameSetting, "IAP\\Name");
TBuf8<50> iapName;
User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iapName));
+ iapName.ZeroTerminate();
+
+ conn.Stop();
+ CleanupStack::PopAndDestroy(&conn);
+ CleanupStack::PopAndDestroy(&serv);
- struct ifreq ifReq;
+ struct ifreq ifReq;
strcpy( ifReq.ifr_name, (char*)iapName.Ptr());
User::LeaveIfError(setdefaultif( &ifReq ));
-
- CleanupStack::PopAndDestroy(&conn);
- CleanupStack::PopAndDestroy(&serv);
}
static int setDefaultIap()
@@ -80,7 +81,6 @@ static int setDefaultIap()
TRAPD(err, setDefaultIapL());
return err;
}
-
#endif
int main(int argc, char *argv[])
@@ -88,9 +88,7 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(ftp);
#ifdef Q_OS_SYMBIAN
-#ifdef SETDEFAULTIF_AVAILABLE
- setDefaultIap();
-#endif
+ setDefaultIap();
// Change current directory from default private to c:\data
// in order that user can access the downloaded content
QDir::setCurrent( "c:\\data" );
@@ -100,7 +98,8 @@ int main(int argc, char *argv[])
#ifdef Q_OS_SYMBIAN
// Make application better looking and more usable on small screen
ftpWin.showMaximized();
-#endif
+#else
ftpWin.show();
+#endif
return ftpWin.exec();
}
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/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp
index ebde770..7aded07 100644
--- a/examples/network/http/httpwindow.cpp
+++ b/examples/network/http/httpwindow.cpp
@@ -116,8 +116,8 @@ void HttpWindow::downloadFile()
if (QMessageBox::question(this, tr("HTTP"),
tr("There already exists a file called %1 in "
"the current directory. Overwrite?").arg(fileName),
- QMessageBox::Ok|QMessageBox::Cancel, QMessageBox::Cancel)
- == QMessageBox::Cancel)
+ QMessageBox::Yes|QMessageBox::No, QMessageBox::No)
+ == QMessageBox::No)
return;
QFile::remove(fileName);
}
diff --git a/examples/network/securesocketclient/securesocketclient.pro b/examples/network/securesocketclient/securesocketclient.pro
index 166d7ad..2e9141d 100644
--- a/examples/network/securesocketclient/securesocketclient.pro
+++ b/examples/network/securesocketclient/securesocketclient.pro
@@ -16,3 +16,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/network/securesocketclient
INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF67 \ No newline at end of file
diff --git a/examples/network/securesocketclient/sslclient.cpp b/examples/network/securesocketclient/sslclient.cpp
index bf8443d..b2f3dd4 100644
--- a/examples/network/securesocketclient/sslclient.cpp
+++ b/examples/network/securesocketclient/sslclient.cpp
@@ -145,7 +145,9 @@ void SslClient::socketEncrypted()
if (!padLock) {
padLock = new QToolButton;
padLock->setIcon(QIcon(":/encrypted.png"));
+#ifndef QT_NO_CURSOR
padLock->setCursor(Qt::ArrowCursor);
+#endif
padLock->setToolTip(tr("Display encryption details."));
int extent = form->hostNameEdit->height() - 2;
diff --git a/examples/painting/svggenerator/svggenerator.pro b/examples/painting/svggenerator/svggenerator.pro
index 4d08ba4..1134619 100644
--- a/examples/painting/svggenerator/svggenerator.pro
+++ b/examples/painting/svggenerator/svggenerator.pro
@@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting/svggenerator
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS svggenerator.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/svggenerator
INSTALLS += target sources
+
+symbian:TARGET.UID3 = 0xA000CF68 \ No newline at end of file
diff --git a/examples/phonon/capabilities/capabilities.pro b/examples/phonon/capabilities/capabilities.pro
index 29d7501..7f1ca76 100644
--- a/examples/phonon/capabilities/capabilities.pro
+++ b/examples/phonon/capabilities/capabilities.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/phonon/capabilities
sources.files = $$SOURCES $$HEADERS capabilities.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/phonon/capabilities
INSTALLS += target sources
+
+symbian:TARGET.UID3 = 0xA000CF69 \ No newline at end of file
diff --git a/examples/phonon/musicplayer/musicplayer.pro b/examples/phonon/musicplayer/musicplayer.pro
index 0a93dc2..e17d29c 100644
--- a/examples/phonon/musicplayer/musicplayer.pro
+++ b/examples/phonon/musicplayer/musicplayer.pro
@@ -14,3 +14,4 @@ wince*{
DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
}
+symbian:TARGET.UID3 = 0xA000CF6A \ No newline at end of file
diff --git a/examples/qtconcurrent/imagescaling/imagescaling.pro b/examples/qtconcurrent/imagescaling/imagescaling.pro
index 2040e7c..180571c 100644
--- a/examples/qtconcurrent/imagescaling/imagescaling.pro
+++ b/examples/qtconcurrent/imagescaling/imagescaling.pro
@@ -13,3 +13,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/imagescaling
INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+wince*: DEPLOYMENT_PLUGIN += qgif qjpeg qtiff
diff --git a/examples/qtconcurrent/qtconcurrent.pro b/examples/qtconcurrent/qtconcurrent.pro
index b21cb17..a30c0bd 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/richtext/textobject/textobject.pro b/examples/richtext/textobject/textobject.pro
index fbb809c..4fa9cb0 100644
--- a/examples/richtext/textobject/textobject.pro
+++ b/examples/richtext/textobject/textobject.pro
@@ -12,3 +12,7 @@ sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/textobject
INSTALLS += target sources
+filesToDeploy.sources = files/*.svg
+filesToDeploy.path = files
+DEPLOYMENT += filesToDeploy
+
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/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro
index f5c94d3..fe011d2 100644
--- a/examples/widgets/movie/movie.pro
+++ b/examples/widgets/movie/movie.pro
@@ -9,3 +9,11 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/movie
INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+wince*: {
+ addFiles.sources += *.mng
+ addFiles.path = .
+ DEPLOYMENT += addFiles
+ DEPLOYMENT_PLUGIN += qmng
+}
+
diff --git a/examples/widgets/softkeys/main.cpp b/examples/widgets/softkeys/main.cpp
new file mode 100644
index 0000000..a544b28
--- /dev/null
+++ b/examples/widgets/softkeys/main.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** 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 <QtGui>
+#include "softkeys.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ MainWindow mw;
+ mw.showMaximized();
+ return app.exec();
+}
diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp
new file mode 100644
index 0000000..9672aee
--- /dev/null
+++ b/examples/widgets/softkeys/softkeys.cpp
@@ -0,0 +1,151 @@
+/****************************************************************************
+**
+** 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 "softkeys.h"
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
+{
+ central = new QWidget(this);
+ central->setContextMenuPolicy(Qt::NoContextMenu); // explicitly forbid usage of context menu so actions item is not shown menu
+ setCentralWidget(central);
+
+ // Create text editor and set softkeys to it
+ textEditor= new QTextEdit(tr("Choose items from menu or navigate around with tab+selection to see what softkeys can do"), this);
+ QAction* fill = new QAction(tr("Fill"), this);
+ fill->setSoftKeyRole(QAction::OkSoftKey);
+ QAction* clear = new QAction(tr("Clear"), this);
+ clear->setSoftKeyRole(QAction::CancelSoftKey);
+
+ QList<QAction*> textEditorSoftKeys;
+ textEditorSoftKeys.append(fill);
+ textEditorSoftKeys.append(clear);
+ textEditor->setSoftKeys(textEditorSoftKeys);
+
+ infoLabel = new QLabel(tr(""), this);
+ infoLabel->setContextMenuPolicy(Qt::NoContextMenu);
+
+ pushButton = new QPushButton(tr("Open File Dialog"), this);
+ pushButton->setContextMenuPolicy(Qt::NoContextMenu);
+
+ QComboBox* comboBox = new QComboBox(this);
+ comboBox->setContextMenuPolicy(Qt::NoContextMenu);
+ comboBox->insertItems(0, QStringList()
+ << QApplication::translate("MainWindow", "Selection1", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "Selection2", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "Selection3", 0, QApplication::UnicodeUTF8)
+ );
+
+ layout = new QVBoxLayout;
+ layout->addWidget(textEditor);
+ layout->addWidget(infoLabel);
+ layout->addWidget(pushButton);
+ layout->addWidget(comboBox);
+ central->setLayout(layout);
+
+ fileMenu = menuBar()->addMenu(tr("&File"));
+ addSoftKeysAct = new QAction(tr("&Add Softkeys"), this);
+ fileMenu->addAction(addSoftKeysAct);
+ exit = new QAction(tr("&Exit"), this);
+ fileMenu->addAction(exit);
+
+ connect(fill, SIGNAL(triggered()), this, SLOT(fillTextEditor()));
+ connect(clear, SIGNAL(triggered()), this, SLOT(clearTextEditor()));
+ connect(pushButton, SIGNAL(clicked()), this, SLOT(openDialog()));
+ connect(addSoftKeysAct, SIGNAL(triggered()), this, SLOT(addSoftKeys()));
+ connect(exit, SIGNAL(triggered()), this, SLOT(exitApplication()));
+ pushButton->setFocus();
+}
+
+MainWindow::~MainWindow()
+{
+}
+
+void MainWindow::fillTextEditor()
+{
+ textEditor->setText(tr("The fill softkey was pressed and here is some text to fill the editor"));
+}
+
+void MainWindow::clearTextEditor()
+{
+ textEditor->setText(tr(""));
+}
+
+void MainWindow::openDialog()
+{
+ QFileDialog::getOpenFileName(this);
+}
+
+void MainWindow::addSoftKeys()
+{
+ ok = new QAction(tr("Ok"), this);
+ ok->setSoftKeyRole(QAction::OkSoftKey);
+ connect(ok, SIGNAL(triggered()), this, SLOT(okPressed()));
+
+ cancel = new QAction(tr("Cancel"), this);
+ cancel->setSoftKeyRole(QAction::OkSoftKey);
+ connect(cancel, SIGNAL(triggered()), this, SLOT(cancelPressed()));
+
+ QList<QAction*> softkeys;
+ softkeys.append(ok);
+ softkeys.append(cancel);
+ pushButton->setSoftKeys(softkeys);
+}
+
+void MainWindow::exitApplication()
+{
+ qApp->exit();
+}
+
+void MainWindow::okPressed()
+{
+ infoLabel->setText(tr("OK pressed"));
+ pushButton->setSoftKey(0);
+}
+
+void MainWindow::cancelPressed()
+{
+ infoLabel->setText(tr("Cancel pressed"));
+ pushButton->setSoftKey(0);
+}
+
+
+
diff --git a/examples/widgets/softkeys/softkeys.h b/examples/widgets/softkeys/softkeys.h
new file mode 100644
index 0000000..bd75473
--- /dev/null
+++ b/examples/widgets/softkeys/softkeys.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** 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 SOFTKEYS_H
+#define SOFTKEYS_H
+
+#include <QtGui>
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+public:
+
+private slots:
+ void fillTextEditor();
+ void clearTextEditor();
+ void openDialog();
+ void addSoftKeys();
+ void exitApplication();
+ void okPressed();
+ void cancelPressed();
+public:
+ MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+private:
+ QVBoxLayout *layout;
+ QWidget *central;
+ QTextEdit* textEditor;
+ QLabel *infoLabel;
+ QPushButton* pushButton;
+ QMenu* fileMenu;
+ QAction* addSoftKeysAct;
+ QAction* exit;
+ QAction* ok;
+ QAction* cancel;
+};
+
+//! [0]
+class SoftKey : public QWidget
+{
+ Q_OBJECT
+public:
+ SoftKey(QWidget *parent = 0);
+};
+//! [0]
+
+#endif
diff --git a/examples/widgets/softkeys/softkeys.pro b/examples/widgets/softkeys/softkeys.pro
new file mode 100644
index 0000000..9a0feea
--- /dev/null
+++ b/examples/widgets/softkeys/softkeys.pro
@@ -0,0 +1,14 @@
+HEADERS = softkeys.h
+SOURCES += \
+ main.cpp \
+ softkeys.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/widgets/softkeys
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS softkeys.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/softkeys
+INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF6B
diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro
index 018cc0c..399a3ac 100644
--- a/examples/widgets/widgets.pro
+++ b/examples/widgets/widgets.pro
@@ -29,7 +29,8 @@ symbian: SUBDIRS = \
lineedits \
shapedclock \
tetrix \
- wiggly
+ wiggly \
+ softkeys
contains(styles, motif): SUBDIRS += styles
diff --git a/examples/xml/htmlinfo/main.cpp b/examples/xml/htmlinfo/main.cpp
index fcf480b..72aef81 100644
--- a/examples/xml/htmlinfo/main.cpp
+++ b/examples/xml/htmlinfo/main.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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/examples/xml/saxbookmarks/frankf.xbel b/examples/xml/saxbookmarks/frankf.xbel
deleted file mode 100644
index 07a9463..0000000
--- a/examples/xml/saxbookmarks/frankf.xbel
+++ /dev/null
@@ -1,230 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE xbel>
-<xbel version="1.0">
- <folder folded="yes">
- <title>Literate Programming</title>
- <bookmark href="http://www.vivtek.com/litprog.html">
- <title>Synopsis of Literate Programming</title>
- </bookmark>
- <bookmark href="http://vasc.ri.cmu.edu/old_help/Programming/Literate/literate.html">
- <title>Literate Programming: Propaganda and Tools</title>
- </bookmark>
- <bookmark href="http://www.isy.liu.se/%7Eturbell/litprog/">
- <title>Literate Programming by Henrik Turbell</title>
- </bookmark>
- <bookmark href="http://www.desy.de/user/projects/LitProg.html">
- <title>Literate Programming Library</title>
- </bookmark>
- <bookmark href="http://www.loria.fr/services/tex/english/litte.html">
- <title>Literate Programming Basics</title>
- </bookmark>
- <bookmark href="http://ei.cs.vt.edu/%7Ecs5014/courseNotes/4.LiterateProgramming/literate_prog.html">
- <title>Literate Programming Overview</title>
- </bookmark>
- <bookmark href="http://www.perl.com/pub/a/tchrist/litprog.html">
- <title>POD is not Literate Programming</title>
- </bookmark>
- <bookmark href="http://www.cornellcollege.edu/%7Eltabak/publications/articles/swsafety.html">
- <title>Computers That We Can Count On</title>
- </bookmark>
- <bookmark href="http://www.cs.auc.dk/%7Enormark/litpro/issues-and-problems.html">
- <title>Literate Programming - Issues and Problems</title>
- </bookmark>
- <bookmark href="http://c2.com/cgi/wiki?LiterateProgramming">
- <title>Literate Programming - Wiki Pages</title>
- </bookmark>
- <bookmark href="http://developers.slashdot.org/developers/02/05/19/2216233.shtml">
- <title>What is well-commented code?</title>
- </bookmark>
- <bookmark href="http://liinwww.ira.uka.de/bibliography/SE/litprog.html">
- <title>Bibliography on literate programming - A searchable bibliography</title>
- </bookmark>
- <bookmark href="http://www2.umassd.edu/SWPI/ProcessBibliography/bib-codereading.html">
- <title>Program comprehension and code reading bibliography</title>
- </bookmark>
- <bookmark href="http://www.cs.auc.dk/%7Enormark/elucidative-programming/">
- <title>Elucidative Programming</title>
- </bookmark>
- <bookmark href="http://www.msu.edu/%7Epfaffben/avl/index.html">
- <title>AVL Trees (TexiWeb)</title>
- </bookmark>
- <bookmark href="http://literate-programming.wikiverse.org/">
- <title>Literate Programming on Wikiverse</title>
- </bookmark>
- <bookmark href="http://www.pbrt.org/">
- <title>Physically Based Rendering: From Theory to Implementation</title>
- </bookmark>
- </folder>
- <folder folded="no">
- <title>Useful C++ Links</title>
- <folder folded="no">
- <title>STL</title>
- <bookmark href="http://www.sgi.com/tech/stl/table_of_contents.html">
- <title>STL Reference Documentation</title>
- </bookmark>
- <bookmark href="http://www.yrl.co.uk/~phil/stl/stl.htmlx">
- <title>STL Tutorial</title>
- </bookmark>
- <bookmark href="http://www.cppreference.com/cpp_stl.html">
- <title>STL Reference</title>
- </bookmark>
- </folder>
- <folder folded="no">
- <title>Qt</title>
- <bookmark href="http://doc.trolltech.com/2.3/">
- <title>Qt 2.3 Reference</title>
- </bookmark>
- <bookmark href="http://doc.trolltech.com/3.3/">
- <title>Qt 3.3 Reference</title>
- </bookmark>
- <bookmark href="http://doc.trolltech.com/4.0/">
- <title>Qt 4.0 Reference</title>
- </bookmark>
- <bookmark href="http://www.trolltech.com/">
- <title>Trolltech Home Page</title>
- </bookmark>
- </folder>
- <folder folded="yes">
- <title>IOStreams</title>
- <bookmark href="http://www.cplusplus.com/ref/iostream/index.html">
- <title>IO Stream Library</title>
- </bookmark>
- <bookmark href="http://courses.cs.vt.edu/~cs2604/fall01/binio.html">
- <title>Binary I/O</title>
- </bookmark>
- <bookmark href="http://www.parashift.com/c++-faq-lite/input-output.html">
- <title>I/O Stream FAQ</title>
- </bookmark>
- </folder>
- <folder folded="yes">
- <title>gdb</title>
- <bookmark href="http://www.cs.princeton.edu/~benjasik/gdb/gdbtut.html">
- <title>GDB Tutorial</title>
- </bookmark>
- <bookmark href="http://www.gnu.org/manual/gdb-4.17/html_mono/gdb.html">
- <title>Debugging with GDB</title>
- </bookmark>
- <bookmark href="http://www.cs.washington.edu/orgs/acm/tutorials/dev-in-unix/gdb-refcard.pdf">
- <title>GDB Quick Reference Page (PDF) (Handy)</title>
- </bookmark>
- </folder>
- <folder folded="yes">
- <title>Classes and Constructors</title>
- <bookmark href="http://www.parashift.com/c++-faq-lite/ctors.html">
- <title>Constructor FAQ</title>
- </bookmark>
- <bookmark href="http://www.juicystudio.com/tutorial/cpp/index.html">
- <title>Organizing Classes</title>
- </bookmark>
- </folder>
- </folder>
- <folder folded="yes">
- <title>Software Documentation or System Documentation</title>
- <bookmark href="http://www.martinfowler.com/distributedComputing/thud.html">
- <title>The Almighty Thud</title>
- </bookmark>
- <bookmark href="http://msdn.microsoft.com/library/techart/cfr.htm">
- <title>Microsoft Coding Techniques and Programming Practices</title>
- </bookmark>
- <bookmark href="http://www.bearcave.com/software/prog_docs.html">
- <title>Software and Documentation</title>
- </bookmark>
- <bookmark href="http://c2.com/cgi/wiki?TheSourceCodeIsTheDesign">
- <title>The Source Code is the Design</title>
- </bookmark>
- <bookmark href="http://www.bleading-edge.com/Publications/C++Journal/Cpjour2.htm">
- <title>What is Software Design?</title>
- </bookmark>
- <bookmark href="http://www.mindprod.com/unmain.html">
- <title>How To Write Unmaintainable Code</title>
- </bookmark>
- <bookmark href="http://www.idinews.com/selfDoc.html">
- <title>Self Documenting Program Code Remains a Distant Goal</title>
- </bookmark>
- <bookmark href="http://www.sdmagazine.com/documents/s=730/sdm0106m/0106m.htm">
- <title>Place Tab A in Slot B</title>
- </bookmark>
- <bookmark href="http://www.holub.com/class/uml/uml.html">
- <title>UML Reference Card</title>
- </bookmark>
- </folder>
- <folder folded="yes">
- <title>TeX Resources</title>
- <bookmark href="http://www.tug.org/">
- <title>The TeX User's Group</title>
- </bookmark>
- <bookmark href="http://www.miktex.org/">
- <title>MikTeX website</title>
- </bookmark>
- <bookmark href="http://cm.bell-labs.com/who/hobby/MetaPost.html">
- <title>MetaPost website</title>
- </bookmark>
- <bookmark href="http://pauillac.inria.fr/%7Emaranget/hevea/">
- <title>HEVEA is a quite complete and fast LATEX to HTML translator</title>
- </bookmark>
- </folder>
- <folder folded="no">
- <title>Portable Document Format (PDF)</title>
- <bookmark href="http://www.adobe.com/">
- <title>Adobe - The postscript and PDF standards</title>
- </bookmark>
- <bookmark href="http://partners.adobe.com/asn/developer/technotes/acrobatpdf.html">
- <title>Reference Manual Portable Document Format</title>
- </bookmark>
- <bookmark href="http://partners.adobe.com/asn/developer/acrosdk/main.html">
- <title>Adobe Acrobat Software Development Kit</title>
- </bookmark>
- </folder>
- <folder folded="yes">
- <title>Literature Sites</title>
- <bookmark href="http://www.cc.columbia.edu/cu/libraries/subjects/speccol.html">
- <title>Guide to Special Collections (Columbia University)</title>
- </bookmark>
- <bookmark href="http://www.ipl.org/ref/litcrit/">
- <title>Literary Criticism on the Web from the Internet Public Library</title>
- </bookmark>
- <bookmark href="http://www.victorianweb.org/">
- <title>Victorian Web.</title>
- </bookmark>
- <bookmark href="http://vos.ucsb.edu/">
- <title>Voice of the Shuttle.</title>
- </bookmark>
- <bookmark href="http://www.modjourn.brown.edu/">
- <title>Modernist Journals Project</title>
- </bookmark>
- <bookmark href="http://www.poetspath.com">
- <title>Museum of American Poetics</title>
- </bookmark>
- <bookmark href="http://www.english.uiuc.edu/maps/">
- <title>Modern American Poetry</title>
- </bookmark>
- <bookmark href="http://www.findarticles.com/">
- <title>FindArticles.com</title>
- </bookmark>
- <bookmark href="http://www.literaryhistory.com">
- <title>Literary History</title>
- </bookmark>
- <bookmark href="http://www.litencyc.com/LitEncycFrame.htm">
- <title>Literary Encyclopedia</title>
- </bookmark>
- <separator/>
- <bookmark href="http://texts.cdlib.org/ucpress/">
- <title>The University of California Press</title>
- </bookmark>
- <bookmark href="http://www.letrs.indiana.edu/web/w/wright2/">
- <title>Wright American Fiction, 1851-1875</title>
- </bookmark>
- <bookmark href="http://docsouth.unc.edu/">
- <title>Documenting the American South: Beginnings to 1920</title>
- </bookmark>
- <bookmark href="http://etext.lib.virginia.edu/eng-on.html">
- <title>Electronic Text Center at the University of Virginia</title>
- </bookmark>
- <bookmark href="http://digital.nypl.org/schomburg/writers_aa19/">
- <title>The Schomburg Center for Research in Black Culture</title>
- </bookmark>
- <bookmark href="http://www.infomotions.com/alex2/">
- <title>Alex Catalogue of Electronic Texts.</title>
- </bookmark>
- </folder>
-</xbel>
diff --git a/examples/xml/saxbookmarks/jenniferf.xbel b/examples/xml/saxbookmarks/jenniferf.xbel
deleted file mode 100644
index 1f7810b..0000000
--- a/examples/xml/saxbookmarks/jenniferf.xbel
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE xbel>
-<xbel version="1.0">
- <folder folded="no">
- <title>Qt Resources</title>
- <folder folded="yes">
- <title>Trolltech Partners</title>
- <bookmark href="http://partners.trolltech.com/partners/training.html">
- <title>Training Partners</title>
- </bookmark>
- <bookmark href="http://partners.trolltech.com/partners/service.html">
- <title>Consultants and System Integrators</title>
- </bookmark>
- <bookmark href="http://partners.trolltech.com/partners/tech.html">
- <title>Technology Partners</title>
- </bookmark>
- <bookmark href="http://partners.trolltech.com/partners/resellers.html">
- <title>Value Added Resellers (VARs)</title>
- </bookmark>
- </folder>
- <folder folded="yes">
- <title>Community Resources</title>
- <bookmark href="http://www.qtforum.org/">
- <title>QtForum.org</title>
- </bookmark>
- <bookmark href="http://www.digitalfanatics.org/projects/qt_tutorial/">
- <title>The Independent Qt Tutorial</title>
- </bookmark>
- <bookmark href="http://prog.qt.free.fr/">
- <title>French PROG.Qt</title>
- </bookmark>
- <bookmark href="http://www.qtforum.de/">
- <title>German Qt Forum</title>
- </bookmark>
- <bookmark href="http://www.korone.net/">
- <title>Korean Qt Community Site</title>
- </bookmark>
- <bookmark href="http://prog.org.ru/forum/forum_14.html">
- <title>Russian Qt Forum</title>
- </bookmark>
- <bookmark href="http://qt4.digitalfanatics.org/">
- <title>Digitalfanatics: The QT 4 Resource Center</title>
- </bookmark>
- <bookmark href="http://www.qtquestions.org/">
- <title>QtQuestions</title>
- </bookmark>
- </folder>
- <bookmark href="http://doc.trolltech.com/qq/">
- <title>Qt Quarterly</title>
- </bookmark>
- <bookmark href="http://www.trolltech.com/">
- <title>Trolltech's home page</title>
- </bookmark>
- <bookmark href="http://doc.trolltech.com/4.0/">
- <title>Qt 4.0 documentation</title>
- </bookmark>
- <bookmark href="http://www.trolltech.com/developer/faqs/">
- <title>Frequently Asked Questions</title>
- </bookmark>
- </folder>
- <folder folded="no">
- <title>Online Dictionaries</title>
- <bookmark href="http://www.dictionary.com/">
- <title>Dictionary.com</title>
- </bookmark>
- <bookmark href="http://www.m-w.com/">
- <title>Merriam-Webster Online</title>
- </bookmark>
- <bookmark href="http://dictionary.cambridge.org/">
- <title>Cambridge Dictionaries Online</title>
- </bookmark>
- <bookmark href="http://www.onelook.com/">
- <title>OneLook Dictionary Search</title>
- </bookmark>
- <separator/>
- <bookmark href="www.iee.et.tu-dresden.de/">
- <title>The New English-German Dictionary</title>
- </bookmark>
- <bookmark href="http://dict.tu-chemnitz.de/">
- <title>TU Chemnitz German-English Dictionary</title>
- </bookmark>
- <separator/>
- <bookmark href="http://atilf.atilf.fr/tlf.htm">
- <title>Trésor de la Langue Française informatisé</title>
- </bookmark>
- <bookmark href="http://dictionnaires.atilf.fr/dictionnaires/ACADEMIE/">
- <title>Dictionnaire de l'Académie Française</title>
- </bookmark>
- <bookmark href="http://elsap1.unicaen.fr/cgi-bin/cherches.cgi">
- <title>Dictionnaire des synonymes</title>
- </bookmark>
- </folder>
-</xbel>
diff --git a/examples/xmlpatterns/trafficinfo/main.cpp b/examples/xmlpatterns/trafficinfo/main.cpp
index 97b2bf7..544260d 100644
--- a/examples/xmlpatterns/trafficinfo/main.cpp
+++ b/examples/xmlpatterns/trafficinfo/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** 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.
diff --git a/examples/xmlpatterns/trafficinfo/mainwindow.cpp b/examples/xmlpatterns/trafficinfo/mainwindow.cpp
index 1f754d5..47c51c9 100644
--- a/examples/xmlpatterns/trafficinfo/mainwindow.cpp
+++ b/examples/xmlpatterns/trafficinfo/mainwindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** 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.
diff --git a/examples/xmlpatterns/trafficinfo/mainwindow.h b/examples/xmlpatterns/trafficinfo/mainwindow.h
index d48109d..5362bcd 100644
--- a/examples/xmlpatterns/trafficinfo/mainwindow.h
+++ b/examples/xmlpatterns/trafficinfo/mainwindow.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** 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.
diff --git a/examples/xmlpatterns/trafficinfo/stationdialog.cpp b/examples/xmlpatterns/trafficinfo/stationdialog.cpp
index 9876bdb..54ed904 100644
--- a/examples/xmlpatterns/trafficinfo/stationdialog.cpp
+++ b/examples/xmlpatterns/trafficinfo/stationdialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** 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.
diff --git a/examples/xmlpatterns/trafficinfo/stationdialog.h b/examples/xmlpatterns/trafficinfo/stationdialog.h
index 5ac1635..0e87f61 100644
--- a/examples/xmlpatterns/trafficinfo/stationdialog.h
+++ b/examples/xmlpatterns/trafficinfo/stationdialog.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** 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.
diff --git a/examples/xmlpatterns/trafficinfo/stationquery.cpp b/examples/xmlpatterns/trafficinfo/stationquery.cpp
index ab42ad9..3db0fdb 100644
--- a/examples/xmlpatterns/trafficinfo/stationquery.cpp
+++ b/examples/xmlpatterns/trafficinfo/stationquery.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** 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.
diff --git a/examples/xmlpatterns/trafficinfo/stationquery.h b/examples/xmlpatterns/trafficinfo/stationquery.h
index 5cbf28a..d1e4d2f 100644
--- a/examples/xmlpatterns/trafficinfo/stationquery.h
+++ b/examples/xmlpatterns/trafficinfo/stationquery.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** 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.
diff --git a/examples/xmlpatterns/trafficinfo/timequery.cpp b/examples/xmlpatterns/trafficinfo/timequery.cpp
index bd63560..d6bf695 100644
--- a/examples/xmlpatterns/trafficinfo/timequery.cpp
+++ b/examples/xmlpatterns/trafficinfo/timequery.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** 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.
diff --git a/examples/xmlpatterns/trafficinfo/timequery.h b/examples/xmlpatterns/trafficinfo/timequery.h
index f88e62c..2435c71 100644
--- a/examples/xmlpatterns/trafficinfo/timequery.h
+++ b/examples/xmlpatterns/trafficinfo/timequery.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** 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.
diff --git a/mkspecs/common/symbian/fixed_stdlib.h b/mkspecs/common/symbian/fixed_stdlib.h
index 2346afe..7fd73d6 100644
--- a/mkspecs/common/symbian/fixed_stdlib.h
+++ b/mkspecs/common/symbian/fixed_stdlib.h
@@ -5,7 +5,37 @@
**
** This file is part of the $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/mkspecs/common/symbian/qplatformdefs.h b/mkspecs/common/symbian/qplatformdefs.h
index 90d3f41..ebcd295 100644
--- a/mkspecs/common/symbian/qplatformdefs.h
+++ b/mkspecs/common/symbian/qplatformdefs.h
@@ -5,7 +5,37 @@
**
** This file is part of the qmake spec 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/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
index 2fe93d2..663a1df 100644
--- a/mkspecs/common/symbian/symbian.conf
+++ b/mkspecs/common/symbian/symbian.conf
@@ -29,7 +29,7 @@ QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
QMAKE_CXX = g++
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
QMAKE_CXXFLAGS.CW =
-QMAKE_CXXFLAGS.ARMCC = --visibility_inlines_hidden
+QMAKE_CXXFLAGS.ARMCC = --no_hide_all
QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
@@ -62,7 +62,7 @@ QMAKE_LFLAGS_DLL = -shared
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT= object_script
-QMAKE_DESKTOPSERVICES_LIBS = -lsendui -lplatformenv -lcommonui -letext -lapmime
+QMAKE_DESKTOPSERVICES_LIBS = -lsendas2 -lplatformenv -lcommonui -letext -lapmime
QMAKE_STATUSPANE_LIBS = -lavkon -leikcoctl
QMAKE_LIBS = -llibc -llibm -leuser -llibdl
@@ -115,10 +115,7 @@ INCLUDEPATH = \
$$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off \
$$[QT_INSTALL_PREFIX]/mkspecs/common/symbian \
$${EPOCROOT}epoc32/include \
- $${EPOCROOT}epoc32/include/stdapis \
- $${EPOCROOT}epoc32/include/stdapis/sys \
$$OS_LAYER_LIBC_SYSTEMINCLUDE \
- $${OS_LAYER_LIBC_SYSTEMINCLUDE}/sys \
$$INCLUDEPATH
# Supports S60 3.0, 3.1, 3.2 and 5.0 by default
@@ -137,5 +134,6 @@ exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/Series60v5.0.sis
S60_VERSION = 3.2
} else {
S60_VERSION = 3.1
+ MMP_RULES -= PAGED
}
}
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/symbian/platform_paths.prf b/mkspecs/features/symbian/platform_paths.prf
index 31ba09e..419982d 100644
--- a/mkspecs/features/symbian/platform_paths.prf
+++ b/mkspecs/features/symbian/platform_paths.prf
@@ -205,17 +205,22 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) {
# part of stdapis. Append to INCLUDEPATH in pro-file.
# ---------------------------------------
- OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis)
+ OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/sys)
OS_LAYER_GLIB_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0) \
$$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/glib) \
$$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/gObject)
-
OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl)
- OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport)
-
+ # stlportv5 is preferred over stlport as it has the throwing version of operator new
+ exists($${EPOCROOT}$$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)) {
+ OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
+ } else {
+ OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport)
+ }
+
OS_LAYER_BOOST_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/boost)
OS_LAYER_DBUS_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0) \
@@ -404,23 +409,40 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) {
# part of stdapis. Append to INCLUDEPATH in pro-file.
# ---------------------------------------
- OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis)
+ OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/sys) \
+ /epoc32/include/stdapis \
+ /epoc32/include/stdapis/sys
OS_LAYER_GLIB_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0) \
$$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/glib) \
- $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/gObject)
-
-
- OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl)
-
- OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport)
-
- OS_LAYER_BOOST_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/boost)
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/gObject) \
+ /epoc32/include/stdapis/glib-2.0 \
+ /epoc32/include/stdapis/glib-2.0/glib \
+ /epoc32/include/stdapis/glib-2.0/gObject
+
+ OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl) \
+ /epoc32/include/stdapis/openssl
+
+ # stlportv5 is preferred over stlport as it has the throwing version of operator new
+ exists($${EPOCROOT}$$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5))|exists($${EPOCROOT}epoc32/include/stdapis/stlportv5) {
+ OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) \
+ /epoc32/include/stdapis/stlportv5
+ } else {
+ OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport) \
+ /epoc32/include/stdapis/stlport
+ }
+
+ OS_LAYER_BOOST_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/boost) \
+ /epoc32/include/stdapis/boost
OS_LAYER_DBUS_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0) \
- $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0/dbus)
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0/dbus) \
+ /epoc32/include/stdapis/dbus-1.0 \
+ /epoc32/include/stdapis/dbus-1.0/dbus
- OS_LAYER_LIBUTILITY_SYSTEMINCLUDE = $$OS_LAYER_PLATFORM_EXPORT_PATH(stdapis/utility)
+ OS_LAYER_LIBUTILITY_SYSTEMINCLUDE = $$OS_LAYER_PLATFORM_EXPORT_PATH(stdapis/utility) \
+ /epoc32/include/stdapis/utility
# ---------------------------------------
# Definitions to export IBY files to different folders where they will be taken
diff --git a/mkspecs/features/symbian/stl.prf b/mkspecs/features/symbian/stl.prf
index b91d783..9eb6b86 100644
--- a/mkspecs/features/symbian/stl.prf
+++ b/mkspecs/features/symbian/stl.prf
@@ -9,11 +9,29 @@ DEFINES *= $$STLLIB_USAGE_DEFINES
# Legacy support requires some hardcoded stdapis paths.
# Note: Also the new header is used from STL when it is enabled
-INCLUDEPATH += \
- $${EPOCROOT}epoc32/include/stdapis/stlport \
- $$OS_LAYER_STDCPP_SYSTEMINCLUDE
-LIBS *= -llibstdcpp.dll
+INCLUDEPATH += $$OS_LAYER_STDCPP_SYSTEMINCLUDE
# Remove mkspecs/common/symbian/stl-off from beginning of includepath
# in order to use new and delete operators from STL
INCLUDEPATH -= $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off
+
+# libstdcppv5 is preferred over libstdcpp as it has/uses the throwing version of operator new
+exists($${EPOCROOT}epoc32/release/armv5/urel/libstdcppv5.dll ) {
+ LIBS *= -llibstdcppv5.dll
+
+ # STDCPP turns on standard C++ new behaviour in SBSv2
+ MMP_RULES += "STDCPP"
+
+ # defining __SYMBIAN_STDCPP_SUPPORT__ turns on standard C++ new behaviour pre SBSv2
+ DEFINES += "__SYMBIAN_STDCPP_SUPPORT__"
+
+ # operator new is actually supplied in stdnew.lib for hardware builds
+ eabiStdNewLibBlock = \
+ "$${LITERAL_HASH}ifdef EABI" \
+ "LIBRARY stdnew.lib" \
+ "$${LITERAL_HASH}endif"
+
+ MMP_RULES += eabiStdNewLibBlock
+} else {
+ LIBS *= -llibstdcpp.dll
+}
diff --git a/mkspecs/features/win32/embed_manifest_dll.prf b/mkspecs/features/win32/embed_manifest_dll.prf
index 90d9a2b..76a8ed1 100644
--- a/mkspecs/features/win32/embed_manifest_dll.prf
+++ b/mkspecs/features/win32/embed_manifest_dll.prf
@@ -1,11 +1,13 @@
+MANIFEST_DIR = $$OBJECTS_DIR
+isEmpty(MANIFEST_DIR):MANIFEST_DIR = .
!if(plugin:no_plugin_manifest):if(win32-msvc2005|win32-msvc2008):!static:!equals(TEMPLATE_PREFIX, "vc"):equals(TEMPLATE, "lib") {
NOPATH_TARGET = $$TARGET
NOPATH_TARGET ~= s,\\ , ,q # Remove space escaping (NOPATH_TARGET is quoted)
NOPATH_TARGET ~= s,\\,/,g # Change to single type separators
NOPATH_TARGET ~= s,^(.*/)+,, # Remove all paths
- QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${OBJECTS_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\")
+ QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\")
QMAKE_PREV_POST_LINK = $$QMAKE_POST_LINK
- QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2$$escape_expand(\n\t))
+ QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2$$escape_expand(\n\t))
QMAKE_POST_LINK += $$QMAKE_PREV_POST_LINK
- QMAKE_CLEAN += \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\"
+ QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\"
}
diff --git a/mkspecs/features/win32/embed_manifest_exe.prf b/mkspecs/features/win32/embed_manifest_exe.prf
index e1747f1..d2800a1 100644
--- a/mkspecs/features/win32/embed_manifest_exe.prf
+++ b/mkspecs/features/win32/embed_manifest_exe.prf
@@ -1,11 +1,13 @@
+MANIFEST_DIR = $$OBJECTS_DIR
+isEmpty(MANIFEST_DIR):MANIFEST_DIR = .
if(win32-msvc2005|win32-msvc2008):!equals(TEMPLATE_PREFIX, "vc"):equals(TEMPLATE, "app") {
NOPATH_TARGET = $$TARGET
NOPATH_TARGET ~= s,\\ , ,q # Remove space escaping (NOPATH_TARGET is quoted)
NOPATH_TARGET ~= s,\\,/,g # Change to single type separators
NOPATH_TARGET ~= s,^(.*/)+,, # Remove all paths
- QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${OBJECTS_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\")
+ QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\")
QMAKE_PREV_POST_LINK = $$QMAKE_POST_LINK
- QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1$$escape_expand(\n\t))
+ QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1$$escape_expand(\n\t))
QMAKE_POST_LINK += $$QMAKE_PREV_POST_LINK
- QMAKE_CLEAN += \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\"
+ QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\"
}
diff --git a/mkspecs/win32-mwc/qplatformdefs.h b/mkspecs/win32-mwc/qplatformdefs.h
index 5eee746..0ce3ac6 100644
--- a/mkspecs/win32-mwc/qplatformdefs.h
+++ b/mkspecs/win32-mwc/qplatformdefs.h
@@ -5,7 +5,37 @@
**
** This file is part of the qmake spec 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/qmake/Makefile.win32 b/qmake/Makefile.win32
index d8b4056..54c2872 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -42,7 +42,7 @@ CFLAGS = -c -Fo$@ \
CXXFLAGS = $(CFLAGS)
LFLAGS =
LIBS = ole32.lib advapi32.lib
-LINKQMAKE = $(LINK) $(LFLAGS) -DEBUG -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS)
+LINKQMAKE = $(LINK) $(LFLAGS) -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS)
ADDCLEAN = vc60.pdb vc70.pdb qmake.pdb qmake.ilk
!ELSE
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 82703c5..5f38bc7 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -2234,8 +2234,8 @@ MakefileGenerator::writeHeader(QTextStream &t)
t << endl;
}
-void
-MakefileGenerator::writeSubDirs(QTextStream &t)
+QList<MakefileGenerator::SubTarget*>
+MakefileGenerator::findSubDirsSubTargets() const
{
QList<SubTarget*> targets;
{
@@ -2332,6 +2332,13 @@ MakefileGenerator::writeSubDirs(QTextStream &t)
}
}
}
+ return targets;
+}
+
+void
+MakefileGenerator::writeSubDirs(QTextStream &t)
+{
+ QList<SubTarget*> targets = findSubDirsSubTargets();
t << "first: make_default" << endl;
int flags = SubTargetInstalls;
if(project->isActiveConfig("ordered"))
@@ -2348,39 +2355,43 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
for(QStringList::Iterator qeui_it = qeui.begin(); qeui_it != qeui.end(); ++qeui_it)
t << "include " << (*qeui_it) << endl;
- QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
- if(ofile.lastIndexOf(Option::dir_sep) != -1)
- ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
- t << "MAKEFILE = " << ofile << endl;
- /* Calling Option::fixPathToTargetOS() is necessary for MinGW/MSYS, which requires
- * back-slashes to be turned into slashes. */
- t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
- t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
- t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
- t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
- t << "COPY = " << var("QMAKE_COPY") << endl;
- t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl;
- t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl;
- t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
- t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
- t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
- t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
- t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl;
- t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
- t << "MOVE = " << var("QMAKE_MOVE") << endl;
- t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
- t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
+ if (!(flags & SubTargetSkipDefaultVariables)) {
+ QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
+ if(ofile.lastIndexOf(Option::dir_sep) != -1)
+ ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
+ t << "MAKEFILE = " << ofile << endl;
+ /* Calling Option::fixPathToTargetOS() is necessary for MinGW/MSYS, which requires
+ * back-slashes to be turned into slashes. */
+ t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
+ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
+ t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
+ t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
+ t << "COPY = " << var("QMAKE_COPY") << endl;
+ t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl;
+ t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl;
+ t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
+ t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
+ t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
+ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
+ t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl;
+ t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
+ t << "MOVE = " << var("QMAKE_MOVE") << endl;
+ t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
+ t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
+ t << "SUBTARGETS = "; // subtargets are sub-directory
+ for(int target = 0; target < targets.size(); ++target)
+ t << " \\\n\t\t" << targets.at(target)->target;
+ t << endl << endl;
+ }
writeExtraVariables(t);
- t << "SUBTARGETS = "; // subtargets are sub-directory
- for(int target = 0; target < targets.size(); ++target)
- t << " \\\n\t\t" << targets.at(target)->target;
- t << endl << endl;
QStringList targetSuffixes;
const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH");
- targetSuffixes << "make_default" << "make_first" << "all" << "clean" << "distclean"
- << QString((flags & SubTargetInstalls) ? "install_subtargets" : "install")
- << QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall");
+ if (!(flags & SubTargetSkipDefaultTargets)) {
+ targetSuffixes << "make_default" << "make_first" << "all" << "clean" << "distclean"
+ << QString((flags & SubTargetInstalls) ? "install_subtargets" : "install")
+ << QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall");
+ }
// generate target rules
for(int target = 0; target < targets.size(); ++target) {
@@ -2500,23 +2511,25 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
}
t << endl;
- if(project->values("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1)
- project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all");
+ if (!(flags & SubTargetSkipDefaultTargets)) {
+ if(project->values("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1)
+ project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all");
- writeMakeQmake(t);
+ writeMakeQmake(t);
- t << "qmake_all:";
- if(!targets.isEmpty()) {
- for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it) {
- if(!(*it)->profile.isEmpty())
- t << " " << (*it)->target << "-" << "qmake_all";
+ t << "qmake_all:";
+ if(!targets.isEmpty()) {
+ for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it) {
+ if(!(*it)->profile.isEmpty())
+ t << " " << (*it)->target << "-" << "qmake_all";
+ }
}
+ if(project->isEmpty("QMAKE_NOFORCE"))
+ t << " FORCE";
+ if(project->isActiveConfig("no_empty_targets"))
+ t << "\n\t" << "@cd .";
+ t << endl << endl;
}
- if(project->isEmpty("QMAKE_NOFORCE"))
- t << " FORCE";
- if(project->isActiveConfig("no_empty_targets"))
- t << "\n\t" << "@cd .";
- t << endl << endl;
for(int s = 0; s < targetSuffixes.size(); ++s) {
QString suffix = targetSuffixes.at(s);
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 9896c1d..a6eec52 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -121,9 +121,12 @@ protected:
enum SubTargetFlags {
SubTargetInstalls=0x01,
SubTargetOrdered=0x02,
+ SubTargetSkipDefaultVariables=0x04,
+ SubTargetSkipDefaultTargets=0x08,
SubTargetsNoFlags=0x00
};
+ QList<MakefileGenerator::SubTarget*> findSubDirsSubTargets() const;
void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags);
//extra compiler interface
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
index 23b2c50..0325264 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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/qmake/generators/symbian/initprojectdeploy_symbian.h b/qmake/generators/symbian/initprojectdeploy_symbian.h
index c4adde4..0aad431 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.h
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.h
@@ -5,7 +5,37 @@
**
** This file is part of the $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/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index 5c9ec13..f1e9165 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -116,9 +146,6 @@ QString SymbianMakefileGenerator::canonizePath(const QString& origPath)
SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator() { }
SymbianMakefileGenerator::~SymbianMakefileGenerator() { }
-// check this out
-bool SymbianMakefileGenerator::writeStubMakefile(QTextStream &t) { t; return false; }
-
void SymbianMakefileGenerator::writeHeader(QTextStream &t) {
t << "// ============================================================================" << endl;
t << "// * Makefile for building: " << escapeFilePath(var("TARGET")) << endl;
@@ -808,8 +835,9 @@ bool SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringL
t << "SOURCEPATH\t\t\t. " << endl;
t << "START RESOURCE\t\t" << regTarget << endl;
- t << "DEPENDS " << target << ".rsg" << endl;
- t << "\tTARGETPATH\t\t" REGISTRATION_RESOURCE_DIRECTORY_HW << endl;
+ if (isForSymbianSbsv2())
+ t << "DEPENDS " << target << ".rsg" << endl;
+ t << "TARGETPATH\t\t" REGISTRATION_RESOURCE_DIRECTORY_HW << endl;
t << "END" << endl << endl;
}
return true;
diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h
index 06732b5..037faff 100644
--- a/qmake/generators/symbian/symmake.h
+++ b/qmake/generators/symbian/symmake.h
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -52,7 +82,6 @@ protected:
QString fixPathForMmp(const QString& origPath, const QDir& parentDir);
QString canonizePath(const QString& origPath);
- virtual bool writeStubMakefile(QTextStream &t);
virtual bool writeMakefile(QTextStream &t);
bool generatePkgFile(const QString &compiler, const QString &config, const QString &iconFile);
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
index aee9745..8501224 100644
--- a/qmake/generators/symbian/symmake_abld.cpp
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -154,6 +184,10 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
t << "#" << endl;
t << "# ==============================================================================" << "\n" << endl;
t << endl;
+ QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
+ if(ofile.lastIndexOf(Option::dir_sep) != -1)
+ ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
+ t << "MAKEFILE = " << ofile << endl;
t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
@@ -243,8 +277,6 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
}
- writeExtraTargets(t);
-
// pre_targetdeps target depends on:
// - all targets specified in PRE_TARGETDEPS
// - the GENERATED_SOURCES sources (so that they get generated)
@@ -255,6 +287,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
// so supporting generating sources is the best we can do. This is enough for mocs.
if (!isSubdirs) {
+ writeExtraTargets(t);
writeExtraCompilerTargets(t);
t << CREATE_TEMPS_TARGET ":" << endl;
@@ -315,6 +348,11 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
}
t << endl;
}
+ else {
+ QList<MakefileGenerator::SubTarget*> subtargets = findSubDirsSubTargets();
+ writeSubTargets(t, subtargets, SubTargetSkipDefaultVariables|SubTargetSkipDefaultTargets);
+ qDeleteAll(subtargets);
+ }
writeDeploymentTargets(t);
diff --git a/qmake/generators/symbian/symmake_abld.h b/qmake/generators/symbian/symmake_abld.h
index 18cbb9e..d323813 100644
--- a/qmake/generators/symbian/symmake_abld.h
+++ b/qmake/generators/symbian/symmake_abld.h
@@ -5,7 +5,37 @@
**
** This file is part of the $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/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index 5afa83d..7b739c7 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -94,6 +124,10 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
t << "#" << endl;
t << "# ==============================================================================" << "\n" << endl;
t << endl;
+ QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
+ if(ofile.lastIndexOf(Option::dir_sep) != -1)
+ ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
+ t << "MAKEFILE = " << ofile << endl;
t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
@@ -176,11 +210,15 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
// Add all extra targets including extra compiler targest also to wrapper makefile,
// even though many of them may have already been added to bld.inf as FLMs.
// This is to enable use of targets like 'mocables', which call targets generated by extra compilers.
- t << extraTargetsCache;
-
if (!isSubdirs) {
+ t << extraTargetsCache;
t << extraCompilersCache;
}
+ else {
+ QList<MakefileGenerator::SubTarget*> subtargets = findSubDirsSubTargets();
+ writeSubTargets(t, subtargets, SubTargetSkipDefaultVariables|SubTargetSkipDefaultTargets);
+ qDeleteAll(subtargets);
+ }
t << "dodistclean:" << endl;
foreach(QString item, project->values("SUBDIRS")) {
diff --git a/qmake/generators/symbian/symmake_sbsv2.h b/qmake/generators/symbian/symmake_sbsv2.h
index 8f6183a..e55d177 100644
--- a/qmake/generators/symbian/symmake_sbsv2.h
+++ b/qmake/generators/symbian/symmake_sbsv2.h
@@ -5,7 +5,37 @@
**
** This file is part of the $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/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index bbbb027..76c17ef 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -574,7 +574,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
}
// We assume project filename is [QMAKE_ORIG_TARGET].vcproj
- QString vcproj = unescapeFilePath(fixFilename(tmp_vcproj.project->first("QMAKE_ORIG_TARGET")) + project->first("VCPROJ_EXTENSION"));
+ QString vcproj = unescapeFilePath(tmp_vcproj.project->first("QMAKE_ORIG_TARGET") + project->first("VCPROJ_EXTENSION"));
QString vcprojDir = qmake_getpwd();
// If file doesn't exsist, then maybe the users configuration
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/qmake/qmake.pri b/qmake/qmake.pri
index b51db32..4e58732 100644
--- a/qmake/qmake.pri
+++ b/qmake/qmake.pri
@@ -9,7 +9,6 @@ DEFINES += QT_NO_TEXTCODEC QT_NO_LIBRARY QT_NO_STL QT_NO_COMPRESS QT_NO_UNICODET
SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \
generators/unix/unixmake2.cpp generators/unix/unixmake.cpp meta.cpp \
option.cpp generators/win32/winmakefile.cpp generators/win32/mingw_make.cpp \
- qpopen.cpp \
generators/makefiledeps.cpp generators/metamakefile.cpp generators/mac/pbuilder_pbx.cpp \
generators/xmloutput.cpp generators/win32/borland_bmake.cpp \
generators/win32/msvc_nmake.cpp generators/projectgenerator.cpp \
@@ -19,6 +18,12 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \
generators/symbian/symmake_abld.cpp \
generators/symbian/symmake_sbsv2.cpp \
generators/symbian/initprojectdeploy_symbian.cpp
+
+# MWC does not provide an implementation of popen() so fake it.
+win32-mwc {
+ SOURCES += qpopen.cpp \
+}
+
HEADERS += project.h property.h generators/makefile.h \
generators/unix/unixmake.h meta.h option.h cachekeys.h \
diff --git a/qmake/qmake_pch.h b/qmake/qmake_pch.h
index 1fec856..676c806 100644
--- a/qmake/qmake_pch.h
+++ b/qmake/qmake_pch.h
@@ -53,7 +53,7 @@
//#include "meta.h"
#include <qfile.h>
//#include "winmakefile.h"
-#include <qtextstream.h>
+//#include <qtextstream.h>
//#include "project.h"
#include <qstring.h>
#include <qstringlist.h>
diff --git a/qmake/qpopen.cpp b/qmake/qpopen.cpp
index 3b0e2da..ebde035 100644
--- a/qmake/qpopen.cpp
+++ b/qmake/qpopen.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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/qmake/qpopen.h b/qmake/qpopen.h
index c739e92..e15830d 100644
--- a/qmake/qpopen.h
+++ b/qmake/qpopen.h
@@ -5,7 +5,37 @@
**
** This file is part of the $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/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
index 36b9282..2e3ef38 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
@@ -935,7 +935,13 @@ static HB_Stream getTableStream(void *font, HB_GetFontTableFunc tableFunc, HB_Ta
if (error)
return 0;
stream = (HB_Stream)malloc(sizeof(HB_StreamRec));
+ if (!stream)
+ return 0;
stream->base = (HB_Byte*)malloc(length);
+ if (!stream->base) {
+ free(stream);
+ return 0;
+ }
error = tableFunc(font, tag, stream->base, &length);
if (error) {
_hb_close_stream(stream);
@@ -950,6 +956,8 @@ static HB_Stream getTableStream(void *font, HB_GetFontTableFunc tableFunc, HB_Ta
HB_Face HB_NewFace(void *font, HB_GetFontTableFunc tableFunc)
{
HB_Face face = (HB_Face )malloc(sizeof(HB_FaceRec));
+ if (!face)
+ return 0;
face->isSymbolFont = false;
face->gdef = 0;
diff --git a/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp b/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp
index 298e9fa..81ebb8b 100644
--- a/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp
+++ b/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp
@@ -169,6 +169,7 @@ namespace Phonon
Q_ASSERT(SUCCEEDED(hr));
ComPointer<IVMRWindowlessControl9> windowlessControl(m_filter, IID_IVMRWindowlessControl9);
windowlessControl->SetVideoClippingWindow(reinterpret_cast<HWND>(target->winId()));
+ windowlessControl->SetAspectRatioMode(VMR9ARMode_None); //we're in control of the size
}
QImage VideoRendererVMR9::snapshot() const
diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp
index de7ce5f..0ef653f 100644
--- a/src/3rdparty/phonon/ds9/videowidget.cpp
+++ b/src/3rdparty/phonon/ds9/videowidget.cpp
@@ -261,6 +261,7 @@ namespace Phonon
{
m_aspectRatio = aspectRatio;
updateVideoSize();
+ m_widget->update();
}
Phonon::VideoWidget::ScaleMode VideoWidget::scaleMode() const
@@ -279,6 +280,7 @@ namespace Phonon
{
m_scaleMode = scaleMode;
updateVideoSize();
+ m_widget->update();
}
void VideoWidget::setBrightness(qreal b)
diff --git a/src/3rdparty/phonon/phonon/abstractmediastream.cpp b/src/3rdparty/phonon/phonon/abstractmediastream.cpp
index a661702..5b860f3 100644
--- a/src/3rdparty/phonon/phonon/abstractmediastream.cpp
+++ b/src/3rdparty/phonon/phonon/abstractmediastream.cpp
@@ -49,7 +49,6 @@ AbstractMediaStream::AbstractMediaStream(AbstractMediaStreamPrivate &dd, QObject
AbstractMediaStream::~AbstractMediaStream()
{
- delete d_ptr;
}
qint64 AbstractMediaStream::streamSize() const
diff --git a/src/3rdparty/phonon/phonon/abstractmediastream.h b/src/3rdparty/phonon/phonon/abstractmediastream.h
index 0daa92a..c4cde85 100644
--- a/src/3rdparty/phonon/phonon/abstractmediastream.h
+++ b/src/3rdparty/phonon/phonon/abstractmediastream.h
@@ -214,7 +214,7 @@ class PHONON_EXPORT AbstractMediaStream : public QObject
virtual void seekStream(qint64 offset);
AbstractMediaStream(AbstractMediaStreamPrivate &dd, QObject *parent);
- AbstractMediaStreamPrivate *d_ptr;
+ QScopedPointer<AbstractMediaStreamPrivate> d_ptr;
};
} // namespace Phonon
diff --git a/src/3rdparty/phonon/phonon/abstractmediastream_p.h b/src/3rdparty/phonon/phonon/abstractmediastream_p.h
index a9d6489..0e87c4d 100644
--- a/src/3rdparty/phonon/phonon/abstractmediastream_p.h
+++ b/src/3rdparty/phonon/phonon/abstractmediastream_p.h
@@ -45,6 +45,7 @@ class PHONON_EXPORT AbstractMediaStreamPrivate : private MediaNodeDestructionHan
public:
void setStreamInterface(StreamInterface *);
void setMediaObjectPrivate(MediaObjectPrivate *);
+ ~AbstractMediaStreamPrivate();
protected:
AbstractMediaStreamPrivate()
@@ -56,7 +57,6 @@ class PHONON_EXPORT AbstractMediaStreamPrivate : private MediaNodeDestructionHan
errorType(NoError)
{
}
- ~AbstractMediaStreamPrivate();
virtual void setStreamSize(qint64 newSize);
virtual void setStreamSeekable(bool s);
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 26ce489..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
- a6ebe3865025e2bb4d767a79435af4daf5a9b4db
+ 4ee8af9348b3f57d3c0f3575ae0a58336cf07a92
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 00bd427..072beee 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,143 @@
+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.
+
+ Change Qt port to match the mac and windows ports, and unregister plugins when plugins are stopped.
+ Not doing that can cause assersion failure.
+ https://bugs.webkit.org/show_bug.cgi?id=25702
+
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::PluginView::stop):
+
+2009-05-18 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Done together with Balazs Kelemen <kelemen.balazs@stud.u-szeged.hu>.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24551
+
+ [Qt] Reuse FontPlatformData for the same FontDescription.
+ This effectively prevents growing heap usage for loading every web page.
+
+ * platform/graphics/qt/FontCacheQt.cpp:
+ (WebCore::qHash): Necessary for FontPlatformDataCache.
+ (WebCore::FontCache::getCachedFontPlatformData): Reuse the instance if
+ it exists, otherwise create a new one and insert it in the cache.
+
+2009-05-18 Balazs Kelemen <kelemen.balazs@stud.u-szeged.hu>
+
+ Reviewed by Ariya Hidayat.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24551
+
+ [Qt] Fix the leak in FontFallbackList::fontDataAt() function.
+ When creating a new instance of SimpleFontData, put it in the font list
+ so that it can deleted later on.
+
+ * platform/graphics/qt/FontFallbackListQt.cpp:
+ (WebCore::FontFallbackList::invalidate):
+ (WebCore::FontFallbackList::releaseFontData):
+ (WebCore::FontFallbackList::fontDataAt):
+
+2009-05-15 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] In the image decoder, remove the raw image data represented as QImage
+ once the image is converted to QPixmap and inserted in the pixmap cache.
+ This effectively reduces the heap usage when running on graphics system
+ other than raster (i.e the case where QImage != QPixmap).
+
+ * platform/graphics/qt/ImageDecoderQt.cpp:
+ (WebCore::ImageDecoderQt::imageAtIndex): Nullified the image on purpose.
+ * platform/graphics/qt/ImageDecoderQt.h: Made m_imageList mutable.
+
+2009-05-15 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] Refactor alpha channel detection the image decoder.
+ Sets the boolean flag as soon as the image is being read.
+
+ * platform/graphics/qt/ImageDecoderQt.cpp:
+ (WebCore::ImageDecoderQt::ImageDecoderQt): Initialized m_hasAlphaChannel.
+ (WebCore::ImageDecoderQt::setData): Set the flag when appropriate.
+ (WebCore::ImageDecoderQt::supportsAlpha): Simplified.
+ (WebCore::ImageDecoderQt::reset): Resetted the flag.
+ * platform/graphics/qt/ImageDecoderQt.h: Added m_hasAlphaChannel.
+
+2009-05-13 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Reviewed by Sam Weinig.
+
+ [Qt] Fix "lighther" composition mode.
+ QPainter::CompositionMode_Plus is the right match.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::toQtCompositionMode):
+
+2009-04-29 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Reviewed by Simon Fraser.
+
+ [Qt] Initialize GraphicsContext's and ImageBuffer's QPainter to match
+ the default values of canvas attributes.
+
+ * platform/graphics/qt/ImageBufferQt.cpp:
+ (WebCore::ImageBufferData::ImageBufferData):
+
+2009-04-27 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ https://bugs.webkit.org/show_bug.cgi?id=18475
+
+ [Qt] Widget painting should follow the layout direction (LTR, RTL)
+ of the element style, not the application layout direction.
+
+ * platform/qt/RenderThemeQt.cpp:
+ (WebCore::RenderThemeQt::applyTheme):
+
2009-03-13 Adam Bergkvist <adam.bergkvist@ericsson.com>
Reviewed by Alexey Proskuryakov.
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp
index 8a31861..5d1f147 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp
@@ -26,6 +26,9 @@
#include "FontDescription.h"
#include "FontPlatformData.h"
#include "Font.h"
+#include "StringHash.h"
+
+#include <QHash>
namespace WebCore {
@@ -33,9 +36,31 @@ void FontCache::getTraitsInFamily(const AtomicString& familyName, Vector<unsigne
{
}
+typedef QHash<FontDescription, FontPlatformData*> FontPlatformDataCache;
+
+// using Q_GLOBAL_STATIC leads to crash. TODO investigate the way to fix this.
+static FontPlatformDataCache* gFontPlatformDataCache;
+
+uint qHash(const FontDescription& key)
+{
+ uint value = CaseFoldingHash::hash(key.family().family());
+ value ^= key.computedPixelSize();
+ value ^= static_cast<int>(key.weight());
+ return value;
+}
+
FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& description, const AtomicString& family, bool checkingAlternateName)
{
- return new FontPlatformData(description);
+ if (!gFontPlatformDataCache)
+ gFontPlatformDataCache = new FontPlatformDataCache;
+
+ FontPlatformData* fontData = gFontPlatformDataCache->value(description, 0);
+ if (!fontData) {
+ fontData = new FontPlatformData(description);
+ gFontPlatformDataCache->insert(description, fontData);
+ }
+
+ return fontData;
}
SimpleFontData* FontCache::getCachedFontData(const FontPlatformData*)
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp
index 22ae205..50627b7 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp
@@ -42,8 +42,6 @@ FontFallbackList::FontFallbackList()
void FontFallbackList::invalidate(WTF::PassRefPtr<WebCore::FontSelector> fontSelector)
{
- releaseFontData();
- m_fontList.clear();
m_familyIndex = 0;
m_pitch = UnknownPitch;
m_loadingCustomFonts = false;
@@ -53,6 +51,9 @@ void FontFallbackList::invalidate(WTF::PassRefPtr<WebCore::FontSelector> fontSel
void FontFallbackList::releaseFontData()
{
+ if (m_fontList.size())
+ delete m_fontList[0].first;
+ m_fontList.clear();
}
void FontFallbackList::determinePitch(const WebCore::Font* font) const
@@ -90,7 +91,12 @@ const FontData* FontFallbackList::fontDataAt(const WebCore::Font* _font, unsigne
family = family->next();
}
- return new SimpleFontData(FontPlatformData(description), _font->wordSpacing(), _font->letterSpacing());
+ if (m_fontList.size())
+ return m_fontList[0].first;
+
+ const FontData* result = new SimpleFontData(FontPlatformData(description), _font->wordSpacing(), _font->letterSpacing());
+ m_fontList.append(pair<const FontData*, bool>(result, result->isCustomFont()));
+ return result;
}
const FontData* FontFallbackList::fontDataForCharacters(const WebCore::Font* font, const UChar*, int) const
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 6c90ea3..490b54b 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -98,7 +98,7 @@ static inline QPainter::CompositionMode toQtCompositionMode(CompositeOperator op
case CompositeHighlight:
return QPainter::CompositionMode_SourceOver;
case CompositePlusLighter:
- return QPainter::CompositionMode_SourceOver;
+ return QPainter::CompositionMode_Plus;
}
return QPainter::CompositionMode_SourceOver;
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index 29a02d4..333269e 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -47,7 +47,24 @@ ImageBufferData::ImageBufferData(const IntSize& size)
: m_pixmap(size)
{
m_pixmap.fill(QColor(Qt::transparent));
- m_painter.set(new QPainter(&m_pixmap));
+
+ QPainter* painter = new QPainter(&m_pixmap);
+ m_painter.set(painter);
+
+ // Since ImageBuffer is used mainly for Canvas, explicitly initialize
+ // its painter's pen and brush with the corresponding canvas defaults
+ // NOTE: keep in sync with CanvasRenderingContext2D::State
+ QPen pen = painter->pen();
+ pen.setColor(Qt::black);
+ pen.setWidth(1);
+ pen.setCapStyle(Qt::FlatCap);
+ pen.setJoinStyle(Qt::MiterJoin);
+ pen.setMiterLimit(10);
+ painter->setPen(pen);
+ QBrush brush = painter->brush();
+ brush.setColor(Qt::black);
+ painter->setBrush(brush);
+ painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
}
ImageBuffer::ImageBuffer(const IntSize& size, bool grayScale, bool& success)
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
index 394c7a7..cd32428 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
@@ -197,7 +197,8 @@ ImageDecoderQt* ImageDecoderQt::create(const SharedBuffer& data)
}
ImageDecoderQt::ImageDecoderQt(const QString &imageFormat)
- : m_imageFormat(imageFormat)
+ : m_hasAlphaChannel(false)
+ , m_imageFormat(imageFormat)
{
}
@@ -212,6 +213,7 @@ bool ImageDecoderQt::hasFirstImageHeader() const
void ImageDecoderQt::reset()
{
+ m_hasAlphaChannel = false;
m_failed = false;
m_imageList.clear();
m_pixmapCache.clear();
@@ -230,6 +232,9 @@ void ImageDecoderQt::setData(const IncomingData &data, bool allDataReceived)
const ReadContext::ReadResult readResult = readContext.read(allDataReceived);
+ if (hasFirstImageHeader())
+ m_hasAlphaChannel = m_imageList[0].m_image.hasAlphaChannel();
+
if (debugImageDecoderQt)
qDebug() << " read returns " << readResult;
@@ -280,7 +285,7 @@ int ImageDecoderQt::repetitionCount() const
bool ImageDecoderQt::supportsAlpha() const
{
- return hasFirstImageHeader() && m_imageList[0].m_image.hasAlphaChannel();
+ return m_hasAlphaChannel;
}
int ImageDecoderQt::duration(size_t index) const
@@ -314,6 +319,10 @@ QPixmap* ImageDecoderQt::imageAtIndex(size_t index) const
if (!m_pixmapCache.contains(index)) {
m_pixmapCache.insert(index,
QPixmap::fromImage(m_imageList[index].m_image));
+
+ // store null image since the converted pixmap is already in pixmap cache
+ Q_ASSERT(m_imageList[index].m_imageState == ImageComplete);
+ m_imageList[index].m_image = QImage();
}
return &m_pixmapCache[index];
}
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.h b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.h
index a2eb6aa..b8c3edd 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.h
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.h
@@ -81,8 +81,9 @@ private:
int m_duration;
};
+ bool m_hasAlphaChannel;
typedef QList<ImageData> ImageList;
- ImageList m_imageList;
+ mutable ImageList m_imageList;
mutable QHash<int, QPixmap> m_pixmapCache;
int m_loopCount;
QString m_imageFormat;
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/platform/qt/RenderThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
index a9da76b..02d17ed 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
@@ -737,6 +737,10 @@ ControlPart RenderThemeQt::applyTheme(QStyleOption& option, RenderObject* o) con
if (isHovered(o))
option.state |= QStyle::State_MouseOver;
+ option.direction = Qt::LeftToRight;
+ if (o->style() && o->style()->direction() == WebCore::RTL)
+ option.direction = Qt::RightToLeft;
+
ControlPart result = o->style()->appearance();
switch (result) {
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 c8dd0e5..e856f92 100644
--- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp
@@ -58,6 +58,7 @@
#include "MouseEvent.h"
#include "Page.h"
#include "PlatformMouseEvent.h"
+#include "PluginMainThreadScheduler.h"
#include "RenderLayer.h"
#include "Settings.h"
@@ -112,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()
@@ -122,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)
@@ -225,6 +230,8 @@ void PluginView::stop()
JSC::JSLock::DropAllLocks dropAllLocks(false);
+ PluginMainThreadScheduler::scheduler().unregisterPlugin(m_instance);
+
// Clear the window
m_npWindow.window = 0;
if (m_plugin->pluginFuncs()->setwindow && !m_plugin->quirks().contains(PluginQuirkDontSetNullWindowHandleOnDestroy)) {
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 c3bd633..d9f925a 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,28 @@
+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.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24746
+
+ Improved selection tests.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::textSelection):
+
2009-04-24 Simon Hausmann <simon.hausmann@nokia.com>
Rubber-stamped by Ariya Hidayat.
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/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index fe74fac..620aa31 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -872,14 +872,6 @@ void tst_QWebPage::textSelection()
"<p>May the source<br/>be with you!</p></body></html>");
page->mainFrame()->setHtml(content);
- // this will select the first paragraph
- QString script = "var range = document.createRange(); " \
- "var node = document.getElementById(\"one\"); " \
- "range.selectNode(node); " \
- "getSelection().addRange(range);";
- page->mainFrame()->evaluateJavaScript(script);
- QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));
-
// these actions must exist
QVERIFY(page->action(QWebPage::SelectAll) != 0);
QVERIFY(page->action(QWebPage::SelectNextChar) != 0);
@@ -895,7 +887,8 @@ void tst_QWebPage::textSelection()
QVERIFY(page->action(QWebPage::SelectStartOfDocument) != 0);
QVERIFY(page->action(QWebPage::SelectEndOfDocument) != 0);
- // right now they are disabled because contentEditable is false
+ // right now they are disabled because contentEditable is false and
+ // there isn't an existing selection to modify
QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), false);
QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), false);
QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), false);
@@ -912,11 +905,37 @@ void tst_QWebPage::textSelection()
// ..but SelectAll is awalys enabled
QCOMPARE(page->action(QWebPage::SelectAll)->isEnabled(), true);
+ // this will select the first paragraph
+ QString selectScript = "var range = document.createRange(); " \
+ "var node = document.getElementById(\"one\"); " \
+ "range.selectNode(node); " \
+ "getSelection().addRange(range);";
+ page->mainFrame()->evaluateJavaScript(selectScript);
+ QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));
+
+ // here the actions are enabled after a selection has been created
+ QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectPreviousWord)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectNextLine)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectPreviousLine)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectStartOfLine)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectEndOfLine)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectStartOfBlock)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectEndOfBlock)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectStartOfDocument)->isEnabled(), true);
+ QCOMPARE(page->action(QWebPage::SelectEndOfDocument)->isEnabled(), true);
+
// make it editable before navigating the cursor
page->setContentEditable(true);
+ // cursor will be before the word "The", this makes sure there is a charet
+ page->triggerAction(QWebPage::MoveToStartOfDocument);
+ QVERIFY(page->isSelectionCollapsed());
+ QCOMPARE(page->selectionStartOffset(), 0);
+
// here the actions are enabled after contentEditable is true
- QCOMPARE(page->action(QWebPage::SelectAll)->isEnabled(), true);
QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), true);
QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), true);
QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), true);
diff --git a/src/corelib/arch/qatomic_symbian.h b/src/corelib/arch/qatomic_symbian.h
index 902b320..9b8b341 100644
--- a/src/corelib/arch/qatomic_symbian.h
+++ b/src/corelib/arch/qatomic_symbian.h
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/corelib/arch/qatomic_windows.h b/src/corelib/arch/qatomic_windows.h
index c795ea6..a1a5a7d 100644
--- a/src/corelib/arch/qatomic_windows.h
+++ b/src/corelib/arch/qatomic_windows.h
@@ -220,6 +220,9 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueTo
#if !defined(Q_OS_WINCE) && !defined(Q_CC_MWERKS)
// use compiler intrinsics for all atomic functions
+//those functions need to be define in the global namespace
+QT_END_NAMESPACE
+
extern "C" {
long __cdecl _InterlockedIncrement(volatile long *);
long __cdecl _InterlockedDecrement(volatile long *);
@@ -252,6 +255,9 @@ extern "C" {
# define _InterlockedExchangeAddPointer(a,b) \
_InterlockedExchangeAdd(reinterpret_cast<volatile long *>(a), long(b))
# endif
+
+QT_BEGIN_NAMESPACE
+
inline bool QBasicAtomicInt::ref()
{
return _InterlockedIncrement(reinterpret_cast<volatile long *>(&_q_value)) != 0;
@@ -334,6 +340,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueTo
#define Q_ARGUMENT_TYPE
#endif
+QT_END_NAMESPACE
+
extern "C" {
long __cdecl InterlockedIncrement(long Q_ARGUMENT_TYPE * lpAddend);
long __cdecl InterlockedDecrement(long Q_ARGUMENT_TYPE * lpAddend);
@@ -350,6 +358,8 @@ long __cdecl InterlockedExchangeAdd(long Q_ARGUMENT_TYPE * Addend, long Value);
# pragma intrinsic (_InterlockedExchangeAdd)
#endif
+QT_BEGIN_NAMESPACE
+
#endif
@@ -408,6 +418,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueTo
// MinGW's definition, such that we pick up variations in the headers.
#ifndef __INTERLOCKED_DECLARED
#define __INTERLOCKED_DECLARED
+QT_END_NAMESPACE
+
extern "C" {
__declspec(dllimport) long __stdcall InterlockedCompareExchange(long *, long, long);
__declspec(dllimport) long __stdcall InterlockedIncrement(long *);
@@ -415,6 +427,8 @@ extern "C" {
__declspec(dllimport) long __stdcall InterlockedExchange(long *, long);
__declspec(dllimport) long __stdcall InterlockedExchangeAdd(long *, long);
}
+
+QT_BEGIN_NAMESPACE
#endif
inline bool QBasicAtomicInt::ref()
diff --git a/src/corelib/arch/symbian/qatomic_symbian.cpp b/src/corelib/arch/symbian/qatomic_symbian.cpp
index bcb0bd4..170b737 100644
--- a/src/corelib/arch/symbian/qatomic_symbian.cpp
+++ b/src/corelib/arch/symbian/qatomic_symbian.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/corelib/codecs/qisciicodec.cpp b/src/corelib/codecs/qisciicodec.cpp
index dd2bc8d..5619580 100644
--- a/src/corelib/codecs/qisciicodec.cpp
+++ b/src/corelib/codecs/qisciicodec.cpp
@@ -38,7 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
#include "qisciicodec_p.h"
#include "qlist.h"
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 6e8ffa1..cfb62c7 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -92,6 +92,11 @@
# define QT_NO_SETLOCALE
#endif
+#if 0 // ### TODO - remove me!
+// enabling this is not exception safe!
+#define Q_DEBUG_TEXTCODEC
+#endif
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_TEXTCODECPLUGIN
@@ -165,7 +170,9 @@ static QTextCodec *createForMib(int mib)
}
static QList<QTextCodec*> *all = 0;
+#ifdef Q_DEBUG_TEXTCODEC
static bool destroying_is_ok = false;
+#endif
static QTextCodec *localeMapper = 0;
QTextCodec *QTextCodec::cftr = 0;
@@ -187,15 +194,21 @@ QTextCodecCleanup::~QTextCodecCleanup()
if (!all)
return;
+#ifdef Q_DEBUG_TEXTCODEC
destroying_is_ok = true;
+#endif
- while (all->size())
- delete all->takeFirst();
+ for (QList<QTextCodec *>::const_iterator it = all->constBegin()
+ ; it != all->constEnd(); ++it) {
+ delete *it;
+ }
delete all;
all = 0;
localeMapper = 0;
+#ifdef Q_DEBUG_TEXTCODEC
destroying_is_ok = false;
+#endif
}
Q_GLOBAL_STATIC(QTextCodecCleanup, createQTextCodecCleanup)
@@ -659,8 +672,10 @@ static void setup()
if (all)
return;
+#ifdef Q_DEBUG_TEXTCODEC
if (destroying_is_ok)
qWarning("QTextCodec: Creating new codec during codec cleanup");
+#endif
all = new QList<QTextCodec*>;
// create the cleanup object to cleanup all codecs on exit
(void) createQTextCodecCleanup();
@@ -915,8 +930,10 @@ QTextCodec::QTextCodec()
*/
QTextCodec::~QTextCodec()
{
+#ifdef Q_DEBUG_TEXTCODEC
if (!destroying_is_ok)
qWarning("QTextCodec::~QTextCodec: Called by application");
+#endif
if (all)
all->removeAll(this);
}
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
index 1ac592e..d9defe1 100644
--- a/src/corelib/codecs/qutfcodec.cpp
+++ b/src/corelib/codecs/qutfcodec.cpp
@@ -478,7 +478,7 @@ QByteArray QUtf32Codec::convertFromUnicode(const QChar *uc, int len, ConverterSt
data[2] = 0;
data[3] = 0;
}
- data += 2;
+ data += 4;
}
if (endian == BE) {
for (int i = 0; i < len; ++i) {
diff --git a/src/corelib/concurrent/qthreadpool.cpp b/src/corelib/concurrent/qthreadpool.cpp
index 30edfd4..8913b56 100644
--- a/src/corelib/concurrent/qthreadpool.cpp
+++ b/src/corelib/concurrent/qthreadpool.cpp
@@ -246,14 +246,14 @@ bool QThreadPoolPrivate::tooManyThreadsActive() const
*/
void QThreadPoolPrivate::startThread(QRunnable *runnable)
{
- QThreadPoolThread *thread = new QThreadPoolThread(this);
- allThreads.insert(thread);
+ QScopedPointer <QThreadPoolThread> thread(new QThreadPoolThread(this));
+ allThreads.insert(thread.data());
++activeThreads;
if (runnable->autoDelete())
++runnable->ref;
thread->runnable = runnable;
- thread->start();
+ thread.take()->start();
}
/*! \internal
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index dd1dbd2..e53fd2d 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -69,6 +69,7 @@
#endif
#if defined(Q_OS_SYMBIAN)
+#include <e32def.h>
#include <e32debug.h>
#endif
@@ -131,7 +132,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
@@ -448,14 +450,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
@@ -700,7 +706,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
@@ -711,7 +719,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
@@ -740,7 +750,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
*/
@@ -748,7 +762,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
*/
@@ -756,7 +772,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
*/
@@ -764,7 +782,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
@@ -774,7 +794,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
@@ -785,7 +807,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
@@ -931,7 +955,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
@@ -1903,6 +1929,15 @@ void qt_check_pointer(const char *n, int l)
qWarning("In file %s, line %d: Out of memory", n, l);
}
+/* \internal
+ Allows you to throw an exception without including <new>
+ Called internally from Q_CHECK_PTR on certain OS combinations
+*/
+void qBadAlloc()
+{
+ QT_THROW(std::bad_alloc());
+}
+
/*
The Q_ASSERT macro calls this function when the test fails.
*/
@@ -2150,7 +2185,12 @@ void qt_message_output(QtMsgType msgType, const char *buf)
#endif
#if defined(Q_OS_SYMBIAN)
- User::Invariant(); // Panic the current thread
+ __DEBUGGER(); // on the emulator, get the debugger to kick in if there's one around
+ TBuf<256> tmp;
+ TPtrC8 ptr(reinterpret_cast<const TUint8*>(buf));
+ TInt len = Min(tmp.MaxLength(), ptr.Length());
+ tmp.Copy(ptr.Left(len));
+ User::Panic(tmp, 0); // Panic the current thread
#elif (defined(Q_OS_UNIX) || defined(Q_CC_MINGW))
abort(); // trap; generates core dump
#else
@@ -2159,6 +2199,48 @@ void qt_message_output(QtMsgType msgType, const char *buf)
}
}
+#if !defined(QT_NO_EXCEPTIONS)
+/*!
+ \internal
+ Uses a local buffer to output the message. Not locale safe + cuts off
+ everything after character 1023, but will work in out of memory situations.
+*/
+static void qEmergencyOut(QtMsgType msgType, const char *msg, va_list ap)
+{
+ char emergency_buf[256] = { '\0' };
+ emergency_buf[255] = '\0';
+ if (msg)
+ qvsnprintf(emergency_buf, 255, msg, ap);
+ qt_message_output(msgType, emergency_buf);
+}
+#endif
+
+/*!
+ \internal
+*/
+static void qt_message(QtMsgType msgType, const char *msg, va_list ap)
+{
+#if !defined(QT_NO_EXCEPTIONS)
+ if (std::uncaught_exception()) {
+ qEmergencyOut(msgType, msg, ap);
+ return;
+ }
+#endif
+ QByteArray buf;
+ if (msg) {
+ QT_TRY {
+ buf = QString().vsprintf(msg, ap).toLocal8Bit();
+ } QT_CATCH(const std::bad_alloc &) {
+#if !defined(QT_NO_EXCEPTIONS)
+ qEmergencyOut(msgType, msg, ap);
+ // don't rethrow - we use qWarning and friends in destructors.
+ return;
+#endif
+ }
+ }
+ qt_message_output(msgType, buf.constData());
+}
+
#undef qDebug
/*!
\relates <QtGlobal>
@@ -2196,14 +2278,10 @@ void qt_message_output(QtMsgType msgType, const char *buf)
*/
void qDebug(const char *msg, ...)
{
- QString buf;
va_list ap;
- va_start(ap, msg); // use variable arg list
- if (msg)
- buf.vsprintf(msg, ap);
+ va_start(ap, msg); // use variable arg list
+ qt_message(QtDebugMsg, msg, ap);
va_end(ap);
-
- qt_message_output(QtDebugMsg, buf.toLocal8Bit().constData());
}
#undef qWarning
@@ -2240,14 +2318,10 @@ void qDebug(const char *msg, ...)
*/
void qWarning(const char *msg, ...)
{
- QString buf;
va_list ap;
va_start(ap, msg); // use variable arg list
- if (msg)
- buf.vsprintf(msg, ap);
+ qt_message(QtWarningMsg, msg, ap);
va_end(ap);
-
- qt_message_output(QtWarningMsg, buf.toLocal8Bit().constData());
}
/*!
@@ -2280,15 +2354,12 @@ void qWarning(const char *msg, ...)
*/
void qCritical(const char *msg, ...)
{
- QString buf;
va_list ap;
va_start(ap, msg); // use variable arg list
- if (msg)
- buf.vsprintf(msg, ap);
+ qt_message(QtCriticalMsg, msg, ap);
va_end(ap);
-
- qt_message_output(QtCriticalMsg, buf.toLocal8Bit().constData());
}
+
#ifdef QT3_SUPPORT
void qSystemWarning(const char *msg, int code)
{ qCritical("%s (%s)", msg, qt_error_string(code).toLocal8Bit().constData()); }
@@ -2296,6 +2367,8 @@ void qSystemWarning(const char *msg, int code)
void qErrnoWarning(const char *msg, ...)
{
+ // qt_error_string() will allocate anyway, so we don't have
+ // to be careful here (like we do in plain qWarning())
QString buf;
va_list ap;
va_start(ap, msg);
@@ -2308,6 +2381,8 @@ void qErrnoWarning(const char *msg, ...)
void qErrnoWarning(int code, const char *msg, ...)
{
+ // qt_error_string() will allocate anyway, so we don't have
+ // to be careful here (like we do in plain qWarning())
QString buf;
va_list ap;
va_start(ap, msg);
@@ -2344,14 +2419,10 @@ void qErrnoWarning(int code, const char *msg, ...)
*/
void qFatal(const char *msg, ...)
{
- QString buf;
va_list ap;
va_start(ap, msg); // use variable arg list
- if (msg)
- buf.vsprintf(msg, ap);
+ qt_message(QtFatalMsg, msg, ap);
va_end(ap);
-
- qt_message_output(QtFatalMsg, buf.toLocal8Bit().constData());
}
// getenv is declared as deprecated in VS2005. This function
@@ -3139,4 +3210,176 @@ bool QInternal::callFunction(InternalFunction func, void **args)
\sa Q_DECL_EXPORT
*/
+#if defined(Q_OS_SYMBIAN)
+
+#include <typeinfo>
+
+/*! \macro QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(function)
+ \relates <QtGlobal>
+ \ingroup qts60
+
+ TRAP leaves from Symbian \a function and throws an appropriate
+ standard C++ exception instead.
+ This must be used when calling Symbian OS leaving functions
+ from inside Qt or standard C++ code, so that the code can respond
+ correctly to the exception.
+
+ \warning This macro is only available on Symbian.
+
+ Example:
+
+ \code
+ // A Symbian leaving function is being called within a Qt function.
+ // Any leave must be converted to an exception
+ CAknTitlePane* titlePane = S60->titlePane();
+ if (titlePane) {
+ TPtrC captionPtr(qt_QString2TPtrC(caption));
+ QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(titlePane->SetTextL(captionPtr));
+ }
+ \endcode
+
+ \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE()
+*/
+
+/*! \macro QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(error, function)
+ \relates <QtGlobal>
+ \ingroup qts60
+
+ Catch standard C++ exceptions from a \a function and convert them to a Symbian OS
+ \a error code, or \c KErrNone if there is no exception.
+ This must be used inside Qt or standard C++ code when using exception throwing
+ code (practically anything) and returning an error code to Symbian OS.
+
+ \warning This macro is only available on Symbian.
+
+ Example:
+
+ \code
+ // An exception might be thrown in this Symbian TInt error returning function.
+ // It is caught and translated to an error code
+ TInt QServerApp::Connect(const QString &serverName)
+ {
+ TPtrC name;
+ TInt err;
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, name.Set(qt_QString2TPtrC(serverName)));
+ if (err != KErrNone)
+ return err;
+ return iServer.Connect(name);
+ }
+ \endcode
+}
+
+ \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(), QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION()
+*/
+
+/*! \macro QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(function)
+ \relates <QtGlobal>
+ \ingroup qts60
+
+ Catch standard C++ exceptions from \a function and convert them to Symbian OS
+ leaves. This must be used inside Qt or standard C++ code when using exception
+ throwing code (practically anything) and returning to Symbian OS from a leaving function.
+ For example inside a Symbian active object's \c RunL function implemented with Qt code.
+
+ \warning This macro is only available on Symbian.
+
+ Example:
+
+ \code
+ // This active object signals Qt code
+ // Exceptions from the Qt code must be converted to Symbian OS leaves for the active scheduler
+ void QWakeUpActiveObject::RunL()
+ {
+ iStatus = KRequestPending;
+ SetActive();
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->wakeUpWasCalled());
+ }
+ \endcode
+
+ \sa QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR()
+*/
+
+#include <stdexcept>
+
+class QSymbianLeaveException : public std::exception
+{
+public:
+ inline QSymbianLeaveException(int err) : error(err) {}
+ inline const char* what() const throw() { return "Symbian leave exception"; }
+
+public:
+ int error;
+};
+
+/*! \relates <QtGlobal>
+ \ingroup qts60
+
+ Throws an exception if the \a error parameter is a symbian error code.
+ This is the exception throwing equivalent of Symbian's User::LeaveIfError.
+
+ \warning This function is only available on Symbian.
+
+ \sa qt_translateExceptionToSymbianErrorL(), qt_translateExceptionToSymbianError()
+*/
+void qt_translateSymbianErrorToException(int error)
+{
+ if (error >= KErrNone)
+ return; // do nothing - not an exception
+ switch (error) {
+ case KErrNoMemory:
+ throw std::bad_alloc();
+ default:
+ throw QSymbianLeaveException(error);
+ }
+}
+
+/*! \relates <QtGlobal>
+ \ingroup qts60
+
+ Convert a caught standard C++ exception \a aThrow to a Symbian leave
+
+ \warning This function is only available on Symbian.
+
+ \sa qt_translateSymbianErrorToException(), qt_translateExceptionToSymbianError()
+*/
+void qt_translateExceptionToSymbianErrorL(const std::exception& aThrow)
+{
+ User::Leave(qt_translateExceptionToSymbianError(aThrow));
+}
+
+/*! \relates <QtGlobal>
+ \ingroup qts60
+
+ Convert a caught standard C++ exception \a aThrow to a Symbian error code
+
+ \warning This function is only available on Symbian.
+
+ \sa qt_translateSymbianErrorToException(), qt_translateExceptionToSymbianErrorL()
+*/
+int qt_translateExceptionToSymbianError(const std::exception& aThrow)
+{
+ const std::type_info& atype = typeid(aThrow);
+ int err = KErrGeneral;
+
+ if(atype == typeid (std::bad_alloc))
+ err = KErrNoMemory;
+ else if(atype == typeid(QSymbianLeaveException))
+ err = static_cast<const QSymbianLeaveException&>(aThrow).error;
+ else if(atype == typeid(std::invalid_argument))
+ err = KErrArgument;
+ else if(atype == typeid(std::out_of_range))
+ // std::out_of_range is of type logic_error which by definition means that it is
+ // "presumably detectable before the program executes".
+ // std::out_of_range is used to report an argument is not within the expected range.
+ // The description of KErrArgument says an argument is out of range. Hence the mapping.
+ err = KErrArgument;
+ else if(atype == typeid(std::overflow_error))
+ err = KErrOverflow;
+ else if(atype == typeid(std::underflow_error))
+ err = KErrUnderflow;
+
+ return err;
+}
+#endif
+
QT_END_NAMESPACE
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 15b2d53..825b7e8 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1055,8 +1055,13 @@ inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
inline int qRound(qreal d)
{ return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); }
+#if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
+inline qint64 qRound64(double d)
+{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); }
+#else
inline qint64 qRound64(qreal d)
{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); }
+#endif
template <typename T>
inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; }
@@ -1118,7 +1123,7 @@ class QDataStream;
#ifndef Q_DECL_EXPORT
# ifdef Q_OS_WIN
# define Q_DECL_EXPORT __declspec(dllexport)
-# elif defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT)
+# elif defined(Q_CC_NOKIAX86)
# define Q_DECL_EXPORT __declspec(dllexport)
# elif defined(QT_VISIBILITY_AVAILABLE)
# define Q_DECL_EXPORT __attribute__((visibility("default")))
@@ -1130,7 +1135,7 @@ class QDataStream;
#ifndef Q_DECL_IMPORT
# if defined(Q_OS_WIN)
# define Q_DECL_IMPORT __declspec(dllimport)
-# elif defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT)
+# elif defined(Q_CC_NOKIAX86)
# define Q_DECL_IMPORT __declspec(dllimport)
# else
# define Q_DECL_IMPORT
@@ -1296,6 +1301,32 @@ class QDataStream;
# define Q_AUTOTEST_EXPORT
#endif
+inline void qt_noop() {}
+
+/* These wrap try/catch so we can switch off exceptions later.
+
+ Beware - do not use more than one QT_CATCH per QT_TRY, and do not use
+ the exception instance in the catch block.
+ If you can't live with those constraints, don't use these macros.
+ Use the QT_NO_EXCEPTIONS macro to protect your code instead.
+*/
+
+#ifdef QT_BOOTSTRAPPED
+# define QT_NO_EXCEPTIONS
+#endif
+
+#ifdef QT_NO_EXCEPTIONS
+# define QT_TRY if (true)
+# define QT_CATCH(A) else
+# define QT_THROW(A) qt_noop()
+# define QT_RETHROW qt_noop()
+#else
+# define QT_TRY try
+# define QT_CATCH(A) catch (A)
+# define QT_THROW(A) throw A
+# define QT_RETHROW throw
+#endif
+
/*
System information
*/
@@ -1549,8 +1580,6 @@ inline QNoDebug qDebug();
#endif
-inline void qt_noop() {}
-
Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line);
#if !defined(Q_ASSERT)
@@ -1576,11 +1605,16 @@ Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *
#endif
Q_CORE_EXPORT void qt_check_pointer(const char *, int);
+Q_CORE_EXPORT void qBadAlloc();
-#ifndef QT_NO_DEBUG
-# define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0)
+#ifdef QT_NO_EXCEPTIONS
+# if defined(QT_NO_DEBUG)
+# define Q_CHECK_PTR(p) qt_noop();
+# else
+# define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0)
+# endif
#else
-# define Q_CHECK_PTR(p)
+# define Q_CHECK_PTR(p) do { if (!(p)) qBadAlloc(); } while (0)
#endif
#if (defined(Q_CC_GNU) && !defined(Q_OS_SOLARIS)) || defined(Q_CC_HPACC)
@@ -1729,12 +1763,12 @@ public:
static TYPE *NAME() \
{ \
if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
- TYPE *x = new TYPE; \
+ QScopedPointer<TYPE > x(new TYPE); \
INITIALIZER; \
- if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \
- delete x; \
- else \
+ if (this_##NAME.pointer.testAndSetOrdered(0, x.data())) { \
static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
+ x.take(); \
+ } \
} \
return this_##NAME.pointer; \
}
@@ -2188,8 +2222,8 @@ inline const QForeachContainer<T> *qForeachContainer(const QForeachContainerBase
#endif
#define Q_DECLARE_PRIVATE(Class) \
- inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(d_ptr); } \
- inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(d_ptr); } \
+ inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(d_ptr.data()); } \
+ inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(d_ptr.data()); } \
friend class Class##Private;
#define Q_DECLARE_PRIVATE_D(Dptr, Class) \
@@ -2237,7 +2271,9 @@ inline const QForeachContainer<T> *qForeachContainer(const QForeachContainerBase
Class(const Class &); \
Class &operator=(const Class &);
#else
-# define Q_DISABLE_COPY(Class)
+# define Q_DISABLE_COPY(Class) \
+ Class(const Class &); \
+ Class &operator=(const Class &);
#endif
class QByteArray;
@@ -2274,6 +2310,42 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathTranslations();
QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
#endif
+#if defined(Q_OS_SYMBIAN)
+
+// forward declare std::exception
+namespace std { class exception; }
+
+Q_CORE_EXPORT void qt_translateSymbianErrorToException(int error);
+Q_CORE_EXPORT void qt_translateExceptionToSymbianErrorL(const std::exception& ex);
+Q_CORE_EXPORT int qt_translateExceptionToSymbianError(const std::exception& ex);
+
+#define QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(f) \
+ { \
+ TInt error; \
+ TRAP(error, f); \
+ if (error) \
+ qt_translateSymbianErrorToException(error); \
+ }
+
+#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \
+ { \
+ err = KErrNone; \
+ try { \
+ f; \
+ } catch (const std::exception &ex) { \
+ err = qt_translateExceptionToSymbianError(ex); \
+ } \
+ }
+
+#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(f) \
+ { \
+ TInt err; \
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \
+ User::LeaveIfError(err); \
+ }
+#endif
+
+
/*
This gives us the possibility to check which modules the user can
use. These are purely compile time checks and will generate no code.
@@ -2347,6 +2419,9 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
#define QT_LICENSED_MODULE(x) \
enum QtValidLicenseFor##x##Module { Licensed##x = true };
+/* qdoc is really unhappy with the following block of preprocessor checks,
+ making it difficult to document classes properly after this point. */
+
#if (QT_EDITION & QT_MODULE_CORE)
QT_LICENSED_MODULE(Core)
#endif
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 29e356e..5e4b9bd 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -40,11 +40,11 @@
****************************************************************************/
#include "qdir.h"
-#include "qfile.h"
+#include "qfile.h"
#include "qconfig.h"
#include "qsettings.h"
#include "qlibraryinfo.h"
-#include "qpointer.h"
+#include "qscopedpointer.h"
#ifdef QT_BUILD_QMAKE
QT_BEGIN_NAMESPACE
@@ -67,8 +67,7 @@ QT_BEGIN_NAMESPACE
struct QLibrarySettings
{
QLibrarySettings();
- ~QLibrarySettings() { delete static_cast<QSettings *>(settings); }
- QSettings *settings;
+ QScopedPointer<QSettings> settings;
};
Q_GLOBAL_STATIC(QLibrarySettings, qt_library_settings)
@@ -79,32 +78,19 @@ public:
static void cleanup()
{
QLibrarySettings *ls = qt_library_settings();
- if (ls) {
- delete static_cast<QSettings *>(ls->settings);
- ls->settings = 0;
- }
+ if (ls)
+ ls->settings.reset(0);
}
static QSettings *configuration()
{
-#ifdef QT_NO_THREAD
- // This recursion guard should be a temporary solution; the recursive
- // dependency should be found and removed.
- static bool initializing = false;
- if (initializing)
- return 0;
- initializing = true;
-#endif
QLibrarySettings *ls = qt_library_settings();
-#ifdef QT_NO_THREAD
- initializing = false;
-#endif
- return ls ? static_cast<QSettings *>(qt_library_settings()->settings) : (QSettings*)0;
+ return ls ? ls->settings.data() : 0;
}
};
QLibrarySettings::QLibrarySettings()
+ : settings(QLibraryInfoPrivate::findConfiguration())
{
- settings = QLibraryInfoPrivate::findConfiguration();
#ifndef QT_BUILD_QMAKE
qAddPostRoutine(QLibraryInfoPrivate::cleanup);
#endif
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index e0ca27c..43740ed 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1395,22 +1395,26 @@ public:
ImCursorPosition,
ImSurroundingText,
ImCurrentSelection,
- ImMaximumTextLength
+ ImMaximumTextLength,
+ ImAnchorPosition
};
enum InputMethodHint {
ImhNone = 0x0,
ImhHiddenText = 0x1,
- ImhDigitsOnly = 0x2,
- ImhFormattedNumbersOnly = 0x4,
- ImhUppercaseOnly = 0x8,
- ImhLowercaseOnly = 0x10,
- ImhNoAutoUppercase = 0x20,
- ImhPreferNumbers = 0x40,
- ImhPreferUppercase = 0x80,
- ImhPreferLowercase = 0x100,
- ImhNoPredictiveText = 0x200,
- ImhDialableCharactersOnly = 0x400
+ ImhNoAutoUppercase = 0x2,
+ ImhPreferNumbers = 0x4,
+ ImhPreferUppercase = 0x8,
+ ImhPreferLowercase = 0x10,
+ ImhNoPredictiveText = 0x20,
+
+ ImhDigitsOnly = 0x10000,
+ ImhFormattedNumbersOnly = 0x20000,
+ ImhUppercaseOnly = 0x40000,
+ ImhLowercaseOnly = 0x80000,
+ ImhDialableCharactersOnly = 0x100000,
+
+ ImhExclusiveInputMask = 0xffff0000
};
Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint)
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index bedc121..63d4944 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -352,8 +352,6 @@ QAbstractFileEngine::QAbstractFileEngine(QAbstractFileEnginePrivate &dd) : d_ptr
*/
QAbstractFileEngine::~QAbstractFileEngine()
{
- delete d_ptr;
- d_ptr = 0;
}
/*!
@@ -881,7 +879,6 @@ QAbstractFileEngineIterator::QAbstractFileEngineIterator(QDir::Filters filters,
*/
QAbstractFileEngineIterator::~QAbstractFileEngineIterator()
{
- delete d;
}
/*!
diff --git a/src/corelib/io/qabstractfileengine.h b/src/corelib/io/qabstractfileengine.h
index d742467..5b75343 100644
--- a/src/corelib/io/qabstractfileengine.h
+++ b/src/corelib/io/qabstractfileengine.h
@@ -193,7 +193,7 @@ protected:
QAbstractFileEngine();
QAbstractFileEngine(QAbstractFileEnginePrivate &);
- QAbstractFileEnginePrivate *d_ptr;
+ QScopedPointer<QAbstractFileEnginePrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QAbstractFileEngine)
Q_DISABLE_COPY(QAbstractFileEngine)
@@ -237,7 +237,7 @@ private:
friend class QDirIterator;
friend class QDirIteratorPrivate;
void setPath(const QString &path);
- QAbstractFileEngineIteratorPrivate *d;
+ QScopedPointer<QAbstractFileEngineIteratorPrivate> d;
};
QT_END_NAMESPACE
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 8334146..60dc688 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -79,8 +79,11 @@ public:
inline QDebug &operator=(const QDebug &other);
inline ~QDebug() {
if (!--stream->ref) {
- if(stream->message_output)
- qt_message_output(stream->type, stream->buffer.toLocal8Bit().data());
+ if(stream->message_output) {
+ QT_TRY {
+ qt_message_output(stream->type, stream->buffer.toLocal8Bit().data());
+ } QT_CATCH(std::bad_alloc) { /* We're out of memory - give up. */ }
+ }
delete stream;
}
}
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 901641c..e1cc7ac 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -83,6 +83,7 @@ class QDirPrivate
QDir *q_ptr;
Q_DECLARE_PUBLIC(QDir)
+ friend class QScopedPointer<QDirPrivate>;
protected:
QDirPrivate(QDir*, const QDir *copy=0);
~QDirPrivate();
@@ -573,8 +574,6 @@ QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(this, &dir))
QDir::~QDir()
{
- delete d_ptr;
- d_ptr = 0;
}
/*!
diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h
index c4f6b1a..ac80094 100644
--- a/src/corelib/io/qdir.h
+++ b/src/corelib/io/qdir.h
@@ -45,6 +45,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qstringlist.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -57,7 +58,7 @@ class QDirPrivate;
class Q_CORE_EXPORT QDir
{
protected:
- QDirPrivate *d_ptr;
+ QScopedPointer<QDirPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QDir)
public:
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index b14f436..81bfb27 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -201,8 +201,8 @@ void QDirIteratorPrivate::advance()
QString subDir = it->currentFilePath();
#ifdef Q_OS_WIN
- if (currentFileInfo.isSymLink())
- subDir = currentFileInfo.canonicalFilePath();
+ if (nextFileInfo.isSymLink())
+ subDir = nextFileInfo.canonicalFilePath();
#endif
pushSubDirectory(subDir, it->nameFilters(), it->filters());
}
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 4a20c97..1e3d5a3 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -109,6 +109,7 @@ QFilePrivate::openExternalFile(int flags, int fd)
return false;
#else
delete fileEngine;
+ fileEngine = 0;
QFSFileEngine *fe = new QFSFileEngine;
fe->setFileName(fileName);
fileEngine = fe;
@@ -125,6 +126,7 @@ QFilePrivate::openExternalFile(int flags, FILE *fh)
return false;
#else
delete fileEngine;
+ fileEngine = 0;
QFSFileEngine *fe = new QFSFileEngine;
fe->setFileName(fileName);
fileEngine = fe;
@@ -410,9 +412,6 @@ QFile::QFile(QFilePrivate &dd, QObject *parent)
QFile::~QFile()
{
close();
-#ifdef QT_NO_QOBJECT
- delete d_ptr;
-#endif
}
/*!
@@ -718,26 +717,29 @@ 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) {
- in.close();
if (!remove()) {
d->setError(QFile::RenameError, tr("Cannot remove source file"));
error = true;
@@ -747,12 +749,16 @@ QFile::rename(const QString &newName)
out.remove();
} else {
fileEngine()->setFileName(newName);
+ 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;
}
@@ -914,6 +920,7 @@ QFile::copy(const QString &newName)
out.setAutoRemove(false);
#endif
}
+ close();
}
if(!error) {
QFile::setPermissions(newName, permissions());
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 96e0f82..b36fb69 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -439,8 +439,6 @@ QFileInfo::QFileInfo(const QFileInfo &fileinfo) : d_ptr(new QFileInfoPrivate(&fi
QFileInfo::~QFileInfo()
{
- delete d_ptr;
- d_ptr = 0;
}
/*!
diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h
index 97997a3..6c01f63 100644
--- a/src/corelib/io/qfileinfo.h
+++ b/src/corelib/io/qfileinfo.h
@@ -44,6 +44,7 @@
#include <QtCore/qfile.h>
#include <QtCore/qlist.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -165,7 +166,7 @@ public:
#endif
protected:
- QFileInfoPrivate *d_ptr;
+ QScopedPointer<QFileInfoPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QFileInfo)
};
diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp
index 883b70f..aeb19db 100644
--- a/src/corelib/io/qfilesystemwatcher_symbian.cpp
+++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -50,7 +80,7 @@ void CNotifyChangeEvent::RunL()
if (iStatus.Int() == KErrNone){
fsSession.NotifyChange(ENotifyAll, iStatus, watchedPath);
SetActive();
- engine->emitPathChanged(this);
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(engine->emitPathChanged(this));
} else {
qWarning("CNotifyChangeEvent::RunL() - Failed to order change notifications: %d", iStatus.Int());
}
@@ -232,9 +262,9 @@ void QSymbianFileSystemWatcherEngine::run()
void QSymbianFileSystemWatcherEngine::addNativeListener(const QString &directoryPath)
{
QMutexLocker locker(&mutex);
- HBufC* buffer = qt_QString2HBufCNewL(QDir::toNativeSeparators(directoryPath));
- currentEvent = CNotifyChangeEvent::New(fsSession, *buffer, this);
- delete buffer;
+ QString nativeDir(QDir::toNativeSeparators(directoryPath));
+ TPtrC ptr(qt_QString2TPtrC(nativeDir));
+ currentEvent = CNotifyChangeEvent::New(fsSession, ptr, this);
syncCondition.wakeOne();
}
diff --git a/src/corelib/io/qfilesystemwatcher_symbian_p.h b/src/corelib/io/qfilesystemwatcher_symbian_p.h
index b34418a..9919114 100644
--- a/src/corelib/io/qfilesystemwatcher_symbian_p.h
+++ b/src/corelib/io/qfilesystemwatcher_symbian_p.h
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/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 72ea065..45e547f 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -293,9 +293,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;
@@ -313,8 +312,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 {
@@ -331,8 +329,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
@@ -407,23 +404,21 @@ bool QFSFileEngine::copy(const QString &newName)
TInt err = rfs.Connect();
if (err == KErrNone) {
CFileMan* fm = NULL;
- HBufC* oldBuf = NULL;
- HBufC* newBuf = NULL;
+ QString oldNative(QDir::toNativeSeparators(d->filePath));
+ TPtrC oldPtr(qt_QString2TPtrC(oldNative));
+ QFileInfo fi(newName);
+ QString absoluteNewName = fi.absolutePath() + QDir::separator() + fi.fileName();
+ QString newNative(QDir::toNativeSeparators(absoluteNewName));
+ TPtrC newPtr(qt_QString2TPtrC(newNative));
TRAP (err,
fm = CFileMan::NewL(rfs);
- oldBuf = qt_QString2HBufCNewL(QDir::toNativeSeparators(d->filePath));
RFile rfile;
- err = rfile.Open(rfs, *oldBuf, EFileShareReadersOrWriters);
+ err = rfile.Open(rfs, oldPtr, EFileShareReadersOrWriters);
if (err == KErrNone) {
- QFileInfo fi(newName);
- QString absoluteNewName = fi.absolutePath() + QDir::separator() + fi.fileName();
- newBuf = qt_QString2HBufCNewL(QDir::toNativeSeparators(absoluteNewName));
- err = fm->Copy(rfile, *newBuf);
+ err = fm->Copy(rfile, newPtr);
rfile.Close();
}
) // End TRAP
- delete oldBuf;
- delete newBuf;
delete fm;
rfs.Close();
}
@@ -678,10 +673,10 @@ static bool _q_isSymbianHidden(const QString &path, bool isDir)
if (isDir && absPath.at(absPath.size()-1) != QChar('/')) {
absPath += QChar('/');
}
- HBufC* buffer = qt_QString2HBufCNewL(QDir::toNativeSeparators(absPath));
+ QString native(QDir::toNativeSeparators(absPath));
+ TPtrC ptr(qt_QString2TPtrC(native));
TUint attributes;
- err = rfs.Att(*buffer, attributes);
- delete buffer;
+ err = rfs.Att(ptr, attributes);
rfs.Close();
if (err == KErrNone && (attributes & KEntryAttHidden)) {
retval = true;
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 2df13f0..6ae13e9 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -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)
@@ -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;
@@ -1556,9 +1497,6 @@ QString QFSFileEnginePrivate::getLink() const
return readLink(filePath);
}
-/*!
- \reimp
-*/
bool QFSFileEngine::link(const QString &newName)
{
#if !defined(Q_OS_WINCE)
@@ -1816,9 +1754,6 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(QAbstractFileEngine::Fil
return ret;
}
-/*!
- \reimp
-*/
QString QFSFileEngine::fileName(FileName file) const
{
Q_D(const QFSFileEngine);
@@ -1912,9 +1847,6 @@ QString QFSFileEngine::fileName(FileName file) const
return d->filePath;
}
-/*!
- \reimp
-*/
bool QFSFileEngine::isRelativePath() const
{
Q_D(const QFSFileEngine);
@@ -1924,18 +1856,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)
@@ -1974,9 +1900,6 @@ QString QFSFileEngine::owner(FileOwner own) const
return QString(QLatin1String(""));
}
-/*!
- \reimp
-*/
bool QFSFileEngine::setPermissions(uint perms)
{
Q_D(QFSFileEngine);
@@ -2003,9 +1926,6 @@ bool QFSFileEngine::setPermissions(uint perms)
return ret;
}
-/*!
- \reimp
-*/
bool QFSFileEngine::setSize(qint64 size)
{
Q_D(QFSFileEngine);
@@ -2075,9 +1995,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 fe3ceff..765bf40 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -362,7 +362,7 @@ QIODevice::QIODevice()
{
#if defined QIODEVICE_DEBUG
QFile *file = qobject_cast<QFile *>(this);
- printf("%p QIODevice::QIODevice(\"%s\") %s\n", this, className(),
+ printf("%p QIODevice::QIODevice(\"%s\") %s\n", this, metaObject()->className(),
qPrintable(file ? file->fileName() : QString()));
#endif
}
@@ -375,7 +375,7 @@ QIODevice::QIODevice(QObject *parent)
: QObject(*new QIODevicePrivate, parent)
{
#if defined QIODEVICE_DEBUG
- printf("%p QIODevice::QIODevice(%p \"%s\")\n", this, parent, className());
+ printf("%p QIODevice::QIODevice(%p \"%s\")\n", this, parent, metaObject()->className());
#endif
}
@@ -945,9 +945,9 @@ QByteArray QIODevice::readAll()
QByteArray tmp;
if (d->isSequential() || size() == 0) {
- // Read it in chunks, bytesAvailable() is unreliable for sequential
- // devices.
- const int chunkSize = 4096;
+ // Read it in chunks. Use bytesAvailable() as an unreliable hint for
+ // sequential devices, but try to read 4K as a minimum.
+ int chunkSize = qMax(qint64(4096), bytesAvailable());
qint64 totalRead = 0;
forever {
tmp.resize(tmp.size() + chunkSize);
@@ -956,6 +956,7 @@ QByteArray QIODevice::readAll()
if (readBytes <= 0)
return tmp;
totalRead += readBytes;
+ chunkSize = qMax(qint64(4096), bytesAvailable());
}
} else {
// Read it all in one go.
diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h
index 76d47ca..ad87125 100644
--- a/src/corelib/io/qiodevice.h
+++ b/src/corelib/io/qiodevice.h
@@ -46,6 +46,7 @@
#include <QtCore/qobject.h>
#else
#include <QtCore/qobjectdefs.h>
+#include <QtCore/qscopedpointer.h>
#endif
#include <QtCore/qstring.h>
@@ -160,7 +161,7 @@ protected:
void setErrorString(const QString &errorString);
#ifdef QT_NO_QOBJECT
- QIODevicePrivate *d_ptr;
+ QScopedPointer<QIODevicePrivate> d_ptr;
#endif
private:
diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp
index ae7f51a..26e7cdc 100644
--- a/src/corelib/io/qprocess_symbian.cpp
+++ b/src/corelib/io/qprocess_symbian.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -26,6 +56,7 @@
User::Panic(KQProcessPanic, panicReason); \
}
+#include <exception>
#include <e32base.h>
#include <e32std.h>
#include <stdio.h>
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 33d4a47..1fedd55 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);
}
}
@@ -900,7 +891,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);
}
}
@@ -1270,7 +1261,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();
@@ -1316,7 +1307,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';
@@ -1327,7 +1318,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/qresource.cpp b/src/corelib/io/qresource.cpp
index a1f921e..0cbcc41 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -334,7 +334,6 @@ QResource::QResource(const QString &file, const QLocale &locale) : d_ptr(new QRe
*/
QResource::~QResource()
{
- delete d_ptr;
}
/*!
@@ -406,7 +405,7 @@ QString QResource::absoluteFilePath() const
}
/*!
- Returns true if the resource really exists in the resource heirarchy,
+ Returns true if the resource really exists in the resource hierarchy,
false otherwise.
*/
diff --git a/src/corelib/io/qresource.h b/src/corelib/io/qresource.h
index 1e9b2d5..f260b68 100644
--- a/src/corelib/io/qresource.h
+++ b/src/corelib/io/qresource.h
@@ -91,7 +91,7 @@ protected:
QStringList children() const;
protected:
- QResourcePrivate *d_ptr;
+ QScopedPointer<QResourcePrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QResource)
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 484e79a..afaaf28 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -1106,10 +1106,10 @@ static QString getPath(QSettings::Format format, QSettings::Scope scope)
QString homePath = QDir::homePath();
QString systemPath;
- globalMutex()->lock();
+ QMutexLocker locker(globalMutex());
PathHash *pathHash = pathHashFunc();
bool loadSystemPath = pathHash->isEmpty();
- globalMutex()->unlock();
+ locker.unlock();
if (loadSystemPath) {
/*
@@ -1121,7 +1121,7 @@ static QString getPath(QSettings::Format format, QSettings::Scope scope)
systemPath += QLatin1Char('/');
}
- QMutexLocker locker(globalMutex());
+ locker.relock();
if (pathHash->isEmpty()) {
/*
Lazy initialization of pathHash. We initialize the
@@ -1181,9 +1181,6 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format,
int i;
initFormat();
- for (i = 0; i < NumConfFiles; ++i)
- confFiles[i] = 0;
-
QString org = organization;
if (org.isEmpty()) {
setStatus(QSettings::AccessError);
@@ -1196,14 +1193,14 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format,
if (scope == QSettings::UserScope) {
QString userPath = getPath(format, QSettings::UserScope);
if (!application.isEmpty())
- confFiles[F_User | F_Application] = QConfFile::fromName(userPath + appFile, true);
- confFiles[F_User | F_Organization] = QConfFile::fromName(userPath + orgFile, true);
+ confFiles[F_User | F_Application].reset(QConfFile::fromName(userPath + appFile, true));
+ confFiles[F_User | F_Organization].reset(QConfFile::fromName(userPath + orgFile, true));
}
QString systemPath = getPath(format, QSettings::SystemScope);
if (!application.isEmpty())
- confFiles[F_System | F_Application] = QConfFile::fromName(systemPath + appFile, false);
- confFiles[F_System | F_Organization] = QConfFile::fromName(systemPath + orgFile, false);
+ confFiles[F_System | F_Application].reset(QConfFile::fromName(systemPath + appFile, false));
+ confFiles[F_System | F_Organization].reset(QConfFile::fromName(systemPath + orgFile, false));
for (i = 0; i < NumConfFiles; ++i) {
if (confFiles[i]) {
@@ -1222,9 +1219,7 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(const QString &fileName,
{
initFormat();
- confFiles[0] = QConfFile::fromName(fileName, true);
- for (int i = 1; i < NumConfFiles; ++i)
- confFiles[i] = 0;
+ confFiles[0].reset(QConfFile::fromName(fileName, true));
initAccess();
}
@@ -1241,19 +1236,27 @@ QConfFileSettingsPrivate::~QConfFileSettingsPrivate()
usedHash->remove(confFiles[i]->name);
if (confFiles[i]->size == 0) {
- delete confFiles[i];
+ delete confFiles[i].take();
} else if (unusedCache) {
- // compute a better size?
- unusedCache->insert(confFiles[i]->name, confFiles[i],
+ QT_TRY {
+ // compute a better size?
+ unusedCache->insert(confFiles[i]->name, confFiles[i].data(),
10 + (confFiles[i]->originalKeys.size() / 4));
+ confFiles[i].take();
+ } QT_CATCH(...) {
+ // out of memory. Do not cache the file.
+ delete confFiles[i].take();
+ }
}
}
+ // prevent the ScopedPointer to deref it again.
+ confFiles[i].take();
}
}
void QConfFileSettingsPrivate::remove(const QString &key)
{
- QConfFile *confFile = confFiles[spec];
+ QConfFile *confFile = confFiles[spec].data();
if (!confFile)
return;
@@ -1280,7 +1283,7 @@ void QConfFileSettingsPrivate::remove(const QString &key)
void QConfFileSettingsPrivate::set(const QString &key, const QVariant &value)
{
- QConfFile *confFile = confFiles[spec];
+ QConfFile *confFile = confFiles[spec].data();
if (!confFile)
return;
@@ -1297,7 +1300,7 @@ bool QConfFileSettingsPrivate::get(const QString &key, QVariant *value) const
bool found = false;
for (int i = 0; i < NumConfFiles; ++i) {
- if (QConfFile *confFile = confFiles[i]) {
+ if (QConfFile *confFile = confFiles[i].data()) {
QMutexLocker locker(&confFile->mutex);
if (!confFile->addedKeys.isEmpty()) {
@@ -1332,7 +1335,7 @@ QStringList QConfFileSettingsPrivate::children(const QString &prefix, ChildSpec
int startPos = prefix.size();
for (int i = 0; i < NumConfFiles; ++i) {
- if (QConfFile *confFile = confFiles[i]) {
+ if (QConfFile *confFile = confFiles[i].data()) {
QMutexLocker locker(&confFile->mutex);
if (thePrefix.isEmpty()) {
@@ -1365,7 +1368,7 @@ QStringList QConfFileSettingsPrivate::children(const QString &prefix, ChildSpec
void QConfFileSettingsPrivate::clear()
{
- QConfFile *confFile = confFiles[spec];
+ QConfFile *confFile = confFiles[spec].data();
if (!confFile)
return;
@@ -1381,7 +1384,7 @@ void QConfFileSettingsPrivate::sync()
// error we just try to go on and make the best of it
for (int i = 0; i < NumConfFiles; ++i) {
- QConfFile *confFile = confFiles[i];
+ QConfFile *confFile = confFiles[i].data();
if (confFile) {
QMutexLocker locker(&confFile->mutex);
syncConfFile(i);
@@ -1396,7 +1399,7 @@ void QConfFileSettingsPrivate::flush()
QString QConfFileSettingsPrivate::fileName() const
{
- QConfFile *confFile = confFiles[spec];
+ QConfFile *confFile = confFiles[spec].data();
if (!confFile)
return QString();
return confFile->name;
@@ -1407,7 +1410,7 @@ bool QConfFileSettingsPrivate::isWritable() const
if (format > QSettings::IniFormat && !writeFunc)
return false;
- QConfFile *confFile = confFiles[spec];
+ QConfFile *confFile = confFiles[spec].data();
if (!confFile)
return false;
@@ -1416,7 +1419,7 @@ bool QConfFileSettingsPrivate::isWritable() const
void QConfFileSettingsPrivate::syncConfFile(int confFileNo)
{
- QConfFile *confFile = confFiles[confFileNo];
+ QConfFile *confFile = confFiles[confFileNo].data();
bool readOnly = confFile->addedKeys.isEmpty() && confFile->removedKeys.isEmpty();
bool ok;
@@ -2295,7 +2298,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
As mentioned in the \l{Fallback Mechanism} section, QSettings
stores settings for an application in up to four locations,
depending on whether the settings are user-specific or
- system-wide and whether the the settings are application-specific
+ system-wide and whether the settings are application-specific
or organization-wide. For simplicity, we're assuming the
organization is called MySoft and the application is called Star
Runner.
@@ -2759,11 +2762,13 @@ QSettings::QSettings(const QString &fileName, Format format)
QSettings::~QSettings()
{
Q_D(QSettings);
- if (d->pendingChanges)
- d->flush();
-#ifdef QT_NO_QOBJECT
- delete d;
-#endif
+ if (d->pendingChanges) {
+ QT_TRY {
+ d->flush();
+ } QT_CATCH(...) {
+ ; // ok. then don't flush but at least don't throw in the destructor
+ }
+ }
}
/*!
@@ -3468,7 +3473,7 @@ void QSettings::setPath(Format format, Scope scope, const QString &path)
\typedef QSettings::SettingsMap
Typedef for QMap<QString, QVariant>.
-
+
\sa registerFormat()
*/
@@ -3479,6 +3484,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 +3499,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 +3518,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).
@@ -3557,8 +3571,7 @@ void QSettings::setPath_helper(Scope scope, const QString &organization, const Q
QSettingsPrivate *oldPriv = d;
QSettingsPrivate *newPriv = QSettingsPrivate::create(oldPriv->format, scope, organization, application);
static_cast<QObjectPrivate &>(*newPriv) = static_cast<QObjectPrivate &>(*oldPriv); // copy the QObject stuff over (hack)
- delete oldPriv;
- d_ptr = newPriv;
+ d_ptr.reset(newPriv);
}
/*! \fn bool QSettings::writeEntry(const QString &key, bool value)
diff --git a/src/corelib/io/qsettings.h b/src/corelib/io/qsettings.h
index cbb24ba..41bce89 100644
--- a/src/corelib/io/qsettings.h
+++ b/src/corelib/io/qsettings.h
@@ -78,7 +78,7 @@ class Q_CORE_EXPORT QSettings
#ifndef QT_NO_QOBJECT
Q_OBJECT
#else
- QSettingsPrivate *d_ptr;
+ QScopedPointer<QSettingsPrivate> d_ptr;
#endif
Q_DECLARE_PRIVATE(QSettings)
diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h
index dd72fd9..1bdbf2c 100644
--- a/src/corelib/io/qsettings_p.h
+++ b/src/corelib/io/qsettings_p.h
@@ -300,7 +300,7 @@ private:
void ensureAllSectionsParsed(QConfFile *confFile) const;
void ensureSectionParsed(QConfFile *confFile, const QSettingsKey &key) const;
- QConfFile *confFiles[NumConfFiles];
+ QScopedSharedPointer<QConfFile> confFiles[NumConfFiles];
QSettings::ReadFunc readFunc;
QSettings::WriteFunc writeFunc;
QString extension;
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index e120f28..45a03e3 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -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
@@ -605,7 +641,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);
}
@@ -699,8 +736,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;
}
@@ -715,10 +756,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;
@@ -726,6 +770,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 1167671..9382fae 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -1112,9 +1112,6 @@ QTextStream::~QTextStream()
#endif
if (!d->writeBuffer.isEmpty())
d->flushWriteBuffer();
-
- delete d;
- d_ptr = 0;
}
/*!
diff --git a/src/corelib/io/qtextstream.h b/src/corelib/io/qtextstream.h
index 6302d34..cfacec6 100644
--- a/src/corelib/io/qtextstream.h
+++ b/src/corelib/io/qtextstream.h
@@ -46,6 +46,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qchar.h>
#include <QtCore/qlocale.h>
+#include <QtCore/qscopedpointer.h>
#ifndef QT_NO_TEXTCODEC
# ifdef QT3_SUPPORT
@@ -256,7 +257,7 @@ private:
Q_DISABLE_COPY(QTextStream)
- QTextStreamPrivate *d_ptr;
+ QScopedPointer<QTextStreamPrivate> d_ptr;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QTextStream::NumberFlags)
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 9ce9a2e..d1a5cdd 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -4759,6 +4759,12 @@ void QUrl::setEncodedQueryItems(const QList<QPair<QByteArray, QByteArray> > &que
Inserts the pair \a key = \a value into the query string of the
URL.
+ The key/value pair is encoded before it is added to the query. The
+ pair is converted into separate strings internally. The \a key and
+ \a value is first encoded into UTF-8 and then delimited by the
+ character returned by valueDelimiter(). Each key/value pair is
+ delimited by the character returned by pairDelimiter().
+
\sa addEncodedQueryItem()
*/
void QUrl::addQueryItem(const QString &key, const QString &value)
diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp
index 19c1510..101ed44 100644
--- a/src/corelib/kernel/qcore_symbian_p.cpp
+++ b/src/corelib/kernel/qcore_symbian_p.cpp
@@ -5,13 +5,45 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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 <exception>
#include <e32base.h>
#include <e32uid.h>
#include "qcore_symbian_p.h"
+#include <string>
QT_BEGIN_NAMESPACE
@@ -21,18 +53,17 @@ QT_BEGIN_NAMESPACE
must be deleted by the caller.
*/
-Q_CORE_EXPORT HBufC* qt_QString2HBufCNewL(const QString& aString)
+Q_CORE_EXPORT HBufC* qt_QString2HBufC(const QString& aString)
{
HBufC *buffer;
#ifdef QT_NO_UNICODE
TPtrC8 ptr(reinterpret_cast<const TUint8*>(aString.toLocal8Bit().constData()));
- buffer = HBufC8::NewL(ptr.Length());
- buffer->Des().Copy(ptr);
#else
- TPtrC16 ptr(reinterpret_cast<const TUint16*>(aString.utf16()));
- buffer = HBufC16::NewL(ptr.Length());
- buffer->Des().Copy(ptr);
+ TPtrC16 ptr(qt_QString2TPtrC(aString));
#endif
+ buffer = HBufC::New(ptr.Length());
+ Q_CHECK_PTR(buffer);
+ buffer->Des().Copy(ptr);
return buffer;
}
@@ -52,7 +83,8 @@ QHBufC::QHBufC()
QHBufC::QHBufC(const QHBufC &src)
{
- m_hBufC = src.m_hBufC->AllocL();
+ m_hBufC = src.m_hBufC->Alloc();
+ Q_CHECK_PTR(m_hBufC);
}
/*!
@@ -67,7 +99,7 @@ QHBufC::QHBufC(HBufC *src)
QHBufC::QHBufC(const QString &src)
{
- m_hBufC = qt_QString2HBufCNewL(src);
+ m_hBufC = qt_QString2HBufC(src);
}
QHBufC::~QHBufC()
@@ -142,4 +174,5 @@ Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal)
return qt_s60_plugin_resolver()->resolve(ordinal);
}
+
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h
index a7d2ce4..bd8f304 100644
--- a/src/corelib/kernel/qcore_symbian_p.h
+++ b/src/corelib/kernel/qcore_symbian_p.h
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -33,7 +63,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-Q_CORE_EXPORT HBufC* qt_QString2HBufCNewL(const QString& aString);
+Q_CORE_EXPORT HBufC* qt_QString2HBufC(const QString& aString);
Q_CORE_EXPORT QString qt_TDesC2QStringL(const TDesC& aDescriptor);
inline QString qt_TDes2QStringL(const TDes& aDescriptor) { return qt_TDesC2QStringL(aDescriptor); }
@@ -61,7 +91,7 @@ static inline TRect qt_QRect2TRect(const QRect& qr)
// Returned TPtrC is valid as long as the given parameter is valid and unmodified
static inline TPtrC qt_QString2TPtrC( const QString& string )
{
- return reinterpret_cast<const TUint16*>(string.utf16());
+ return TPtrC16(static_cast<const TUint16*>(string.utf16()), string.length());
}
class Q_CORE_EXPORT QHBufC
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 7d8a77a..5c3fd76 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -63,8 +63,10 @@
#include <private/qfactoryloader_p.h>
#ifdef Q_OS_SYMBIAN
+# include <exception>
# include <f32file.h>
# include "qeventdispatcher_symbian_p.h"
+# include "private/qcore_symbian_p.h"
#elif defined(Q_OS_UNIX)
# if !defined(QT_NO_GLIB)
# include "qeventdispatcher_glib_p.h"
@@ -88,6 +90,21 @@
QT_BEGIN_NAMESPACE
+class QLockedMutexUnlocker
+{
+public:
+ inline explicit QLockedMutexUnlocker(QMutex *m)
+ : mtx(m)
+ { }
+ inline ~QLockedMutexUnlocker() { unlock(); }
+ inline void unlock() { if (mtx) mtx->unlock(); mtx = 0; }
+
+private:
+ Q_DISABLE_COPY(QLockedMutexUnlocker)
+
+ QMutex *mtx;
+};
+
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
extern QString qAppFileName();
#endif
@@ -159,7 +176,14 @@ void qRemovePostRoutine(QtCleanUpFunction p)
void Q_CORE_EXPORT qt_call_post_routines()
{
- QVFuncList *list = postRList();
+ QVFuncList *list = 0;
+ QT_TRY {
+ list = postRList();
+ } QT_CATCH(const std::bad_alloc &) {
+ // ignore - if we can't allocate a post routine list,
+ // there's a high probability that there's no post
+ // routine to be executed :)
+ }
if (!list)
return;
while (!list->isEmpty())
@@ -248,24 +272,26 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv)
QCoreApplicationPrivate::~QCoreApplicationPrivate()
{
+ if (threadData) {
#ifndef QT_NO_THREAD
- void *data = &threadData->tls;
- QThreadStorageData::finish((void **)data);
+ void *data = &threadData->tls;
+ QThreadStorageData::finish((void **)data);
#endif
- // need to clear the state of the mainData, just in case a new QCoreApplication comes along.
- QMutexLocker locker(&threadData->postEventList.mutex);
- for (int i = 0; i < threadData->postEventList.size(); ++i) {
- const QPostEvent &pe = threadData->postEventList.at(i);
- if (pe.event) {
- --pe.receiver->d_func()->postedEvents;
- pe.event->posted = false;
- delete pe.event;
+ // need to clear the state of the mainData, just in case a new QCoreApplication comes along.
+ QMutexLocker locker(&threadData->postEventList.mutex);
+ for (int i = 0; i < threadData->postEventList.size(); ++i) {
+ const QPostEvent &pe = threadData->postEventList.at(i);
+ if (pe.event) {
+ --pe.receiver->d_func()->postedEvents;
+ pe.event->posted = false;
+ delete pe.event;
+ }
}
+ threadData->postEventList.clear();
+ threadData->postEventList.recursion = 0;
+ threadData->quitNow = false;
}
- threadData->postEventList.clear();
- threadData->postEventList.recursion = 0;
- threadData->quitNow = false;
}
void QCoreApplicationPrivate::createEventDispatcher()
@@ -311,6 +337,11 @@ void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver)
Q_UNUSED(currentThread);
Q_UNUSED(thr);
}
+#elif defined(Q_OS_SYMBIAN) && defined (QT_NO_DEBUG)
+// no implementation in release builds, but keep the symbol present
+void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver)
+{
+}
#endif
void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths()
@@ -539,7 +570,14 @@ QCoreApplication::~QCoreApplication()
#if !defined(QT_NO_THREAD)
#if !defined(QT_NO_CONCURRENT)
// Synchronize and stop the global thread pool threads.
- QThreadPool::globalInstance()->waitForDone();
+ QThreadPool *globalThreadPool = 0;
+ QT_TRY {
+ globalThreadPool = QThreadPool::globalInstance();
+ } QT_CATCH (...) {
+ // swallow the exception, since destructors shouldn't throw
+ }
+ if (globalThreadPool)
+ globalThreadPool->waitForDone();
#endif
QThread::cleanup();
#endif
@@ -621,26 +659,13 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
d->inEventHandler = true;
#endif
-#if defined(Q_OS_SYMBIAN)
-// __UHEAP_MARK;
- TInt error;
- bool returnValue = false;
- TRAP(error, returnValue = notify(receiver, event));
- if (error != KErrNone) {
- qWarning(QString("Symbian OS error: %1").arg(error).toAscii().constData());
- }
-// __UHEAP_MARKEND;
-#elif defined(QT_NO_EXCEPTIONS)
- bool returnValue = notify(receiver, event);
-#else
bool returnValue;
- try {
+ QT_TRY {
returnValue = notify(receiver, event);
- } catch(...) {
+ } QT_CATCH (...) {
--threadData->loopLevel;
- throw;
+ QT_RETHROW;
}
-#endif
#ifdef QT_JAMBI_BUILD
// Restore the previous state if the object was not deleted..
@@ -1061,15 +1086,14 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority)
data->postEventList.mutex.lock();
}
+ QLockedMutexUnlocker locker(&data->postEventList.mutex);
+
// if this is one of the compressible events, do compression
if (receiver->d_func()->postedEvents
&& self && self->compressEvent(event, receiver, &data->postEventList)) {
- data->postEventList.mutex.unlock();
return;
}
- event->posted = true;
- ++receiver->d_func()->postedEvents;
if (event->type() == QEvent::DeferredDelete && data == QThreadData::current()) {
// remember the current running eventloop for DeferredDelete
// events posted in the receiver's thread
@@ -1090,8 +1114,10 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority)
QPostEventList::iterator at = qUpperBound(begin, end, priority);
data->postEventList.insert(at, QPostEvent(receiver, event, priority));
}
+ event->posted = true;
+ ++receiver->d_func()->postedEvents;
data->canWait = false;
- data->postEventList.mutex.unlock();
+ locker.unlock();
if (data->eventDispatcher)
data->eventDispatcher->wakeUp();
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 65733ac..095d501 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -195,6 +195,8 @@ private:
void init();
static QCoreApplication *self;
+
+ Q_DISABLE_COPY(QCoreApplication)
friend class QEventDispatcherUNIXPrivate;
friend class QApplication;
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index 9490ad7..c1118d1 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -92,7 +92,7 @@ public:
static void sendPostedEvents(QObject *receiver, int event_type, QThreadData *data);
static void removePostedEvents_unlocked(QObject *receiver, int type, QThreadData *data);
-#if !defined (QT_NO_DEBUG) || defined (QT_MAC_FRAMEWORK_BUILD)
+#if !defined (QT_NO_DEBUG) || defined (QT_MAC_FRAMEWORK_BUILD) || defined (Q_OS_SYMBIAN)
void checkReceiverThread(QObject *receiver);
#endif
int &argc;
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index d745406..423fbaa 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -163,7 +193,7 @@ void QWakeUpActiveObject::RunL()
{
iStatus = KRequestPending;
SetActive();
- m_dispatcher->wakeUpWasCalled();
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->wakeUpWasCalled());
}
QTimerActiveObject::QTimerActiveObject(QEventDispatcherSymbian *dispatcher, SymbianTimerInfo *timerInfo)
@@ -192,9 +222,15 @@ void QTimerActiveObject::DoCancel()
void QTimerActiveObject::RunL()
{
- if (!okToRun())
- return;
+ int error;
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(error, Run());
+ if (error < 0) {
+ CActiveScheduler::Current()->Error(error); // stop and report here, as this timer will be deleted on scope exit
+ }
+}
+void QTimerActiveObject::Run()
+{
if (m_timerInfo->interval > 0) {
// Start a new timer immediately so that we don't lose time.
iStatus = KRequestPending;
@@ -210,7 +246,7 @@ void QTimerActiveObject::RunL()
SymbianTimerInfoPtr timerInfoPtr(m_timerInfo);
m_timerInfo->dispatcher->timerFired(m_timerInfo->timerId);
-
+
iStatus = KRequestPending;
SetActive();
TRequestStatus *status = &iStatus;
@@ -274,7 +310,7 @@ void QCompleteDeferredAOs::RunL()
iStatus = KRequestPending;
SetActive();
- m_dispatcher->reactivateDeferredActiveObjects();
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->reactivateDeferredActiveObjects());
}
QSelectThread::QSelectThread()
@@ -424,8 +460,8 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
}
QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
-
- Q_ASSERT(!m_AOStatuses.contains(notifier));
+
+ Q_ASSERT(!m_AOStatuses.contains(notifier));
m_AOStatuses.insert(notifier, status);
@@ -547,7 +583,7 @@ void QSocketActiveObject::RunL()
if (!okToRun())
return;
- m_dispatcher->socketFired(this);
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->socketFired(this));
}
void QSocketActiveObject::deleteLater()
@@ -603,101 +639,108 @@ void QEventDispatcherSymbian::closingDown()
bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags flags )
{
- Q_D(QAbstractEventDispatcher);
+ bool handledAnyEvent = false;
+ QT_TRY {
+ Q_D(QAbstractEventDispatcher);
+
// It is safe if this counter overflows. The main importance is that each
// iteration count is different from the last.
m_iterationCount++;
- RThread &thread = d->threadData->symbian_thread_handle;
-
- bool block;
- if (flags & QEventLoop::WaitForMoreEvents) {
- block = true;
- emit aboutToBlock();
- } else {
- block = false;
- }
-
- bool handledAnyEvent = false;
-
- bool oldNoSocketEventsValue = m_noSocketEvents;
- if (flags & QEventLoop::ExcludeSocketNotifiers) {
- m_noSocketEvents = true;
- } else {
- m_noSocketEvents = false;
- handledAnyEvent = sendDeferredSocketEvents();
- }
-
- bool handledSymbianEvent = false;
- m_interrupt = false;
-
- /*
- * This QTime variable is used to measure the time it takes to finish
- * the event loop. If we take too long in the loop, other processes
- * may be starved and killed. After the first event has completed, we
- * take the current time, and if the remaining events take longer than
- * a preset time, we temporarily lower the priority to force a context
- * switch. For applications that do not take unecessarily long in the
- * event loop, the priority will not be altered.
- */
- QTime time;
- enum {
- FirstRun,
- SubsequentRun,
- TimeStarted
- } timeState = FirstRun;
-
- TProcessPriority priority;
-
- while (1) {
- if (block) {
- // This is where Qt will spend most of its time.
- CActiveScheduler::Current()->WaitForAnyRequest();
+ RThread &thread = d->threadData->symbian_thread_handle;
+
+ bool block;
+ if (flags & QEventLoop::WaitForMoreEvents) {
+ block = true;
+ emit aboutToBlock();
} else {
- if (thread.RequestCount() == 0) {
- break;
- }
- // This one should return without delay.
- CActiveScheduler::Current()->WaitForAnyRequest();
- }
-
- if (timeState == SubsequentRun) {
- time.start();
- timeState = TimeStarted;
+ block = false;
}
-
- TInt error;
- handledSymbianEvent = CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle);
- if (error) {
- qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error);
- CActiveScheduler::Current()->Error(error);
- }
- if (!handledSymbianEvent) {
- qFatal("QEventDispatcherSymbian::processEvents(): Caught Symbian stray signal");
- }
- handledAnyEvent = true;
- if (m_interrupt) {
- break;
+
+ bool oldNoSocketEventsValue = m_noSocketEvents;
+ if (flags & QEventLoop::ExcludeSocketNotifiers) {
+ m_noSocketEvents = true;
+ } else {
+ m_noSocketEvents = false;
+ handledAnyEvent = sendDeferredSocketEvents();
}
- block = false;
- if (timeState == TimeStarted && time.elapsed() > 500) {
- priority = m_processHandle.Priority();
- m_processHandle.SetPriority(EPriorityLow);
- time.start();
- // Slight chance of race condition in the next lines, but nothing fatal
- // will happen, just wrong priority.
- if (m_processHandle.Priority() == EPriorityLow) {
- m_processHandle.SetPriority(priority);
+
+ bool handledSymbianEvent = false;
+ m_interrupt = false;
+
+ /*
+ * This QTime variable is used to measure the time it takes to finish
+ * the event loop. If we take too long in the loop, other processes
+ * may be starved and killed. After the first event has completed, we
+ * take the current time, and if the remaining events take longer than
+ * a preset time, we temporarily lower the priority to force a context
+ * switch. For applications that do not take unecessarily long in the
+ * event loop, the priority will not be altered.
+ */
+ QTime time;
+ enum {
+ FirstRun,
+ SubsequentRun,
+ TimeStarted
+ } timeState = FirstRun;
+
+ TProcessPriority priority;
+
+ while (1) {
+ if (block) {
+ // This is where Qt will spend most of its time.
+ CActiveScheduler::Current()->WaitForAnyRequest();
+ } else {
+ if (thread.RequestCount() == 0) {
+ break;
+ }
+ // This one should return without delay.
+ CActiveScheduler::Current()->WaitForAnyRequest();
}
- }
- if (timeState == FirstRun)
- timeState = SubsequentRun;
- };
-
- emit awake();
-
- m_noSocketEvents = oldNoSocketEventsValue;
+
+ if (timeState == SubsequentRun) {
+ time.start();
+ timeState = TimeStarted;
+ }
+
+ TInt error;
+ handledSymbianEvent = CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle);
+ if (error) {
+ qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error);
+ CActiveScheduler::Current()->Error(error);
+ }
+
+ if (!handledSymbianEvent) {
+ qFatal("QEventDispatcherSymbian::processEvents(): Caught Symbian stray signal");
+ }
+ handledAnyEvent = true;
+ if (m_interrupt) {
+ break;
+ }
+ block = false;
+ if (timeState == TimeStarted && time.elapsed() > 100) {
+ priority = m_processHandle.Priority();
+ m_processHandle.SetPriority(EPriorityLow);
+ time.start();
+ // Slight chance of race condition in the next lines, but nothing fatal
+ // will happen, just wrong priority.
+ if (m_processHandle.Priority() == EPriorityLow) {
+ m_processHandle.SetPriority(priority);
+ }
+ }
+ if (timeState == FirstRun)
+ timeState = SubsequentRun;
+ };
+
+ emit awake();
+
+ m_noSocketEvents = oldNoSocketEventsValue;
+ } QT_CATCH (const std::exception& ex) {
+#ifndef QT_NO_EXCEPTIONS
+ CActiveScheduler::Current()->Error(qt_translateExceptionToSymbianError(ex));
+#endif
+ }
return handledAnyEvent;
}
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index 393749f..3593055 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -106,6 +136,9 @@ public:
protected:
void DoCancel();
void RunL();
+
+private:
+ void Run();
private:
SymbianTimerInfo *m_timerInfo;
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index ce38b73..ea8299c 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -54,7 +54,7 @@
#include <stdio.h>
#include <stdlib.h>
-#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED) && !defined(Q_OS_SYMBIAN)
+#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED)
# include <sys/times.h>
#endif
@@ -65,7 +65,7 @@ Q_CORE_EXPORT bool qt_disable_lowpriority_timers=false;
/*****************************************************************************
UNIX signal handling
*****************************************************************************/
-#if !defined(Q_OS_SYMBIAN)
+
static sig_atomic_t signal_received;
static sig_atomic_t signals_fired[NSIG];
@@ -74,7 +74,7 @@ static void signalHandler(int sig)
signals_fired[sig] = 1;
signal_received = 1;
}
-#endif
+
static void initThreadPipeFD(int fd)
{
@@ -134,7 +134,6 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
int nsel;
do {
-#if !defined(Q_OS_SYMBIAN)
if (mainThread) {
while (signal_received) {
signal_received = 0;
@@ -146,7 +145,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
}
}
}
-#endif
+
// Process timers and socket notifiers - the common UNIX stuff
int highest = 0;
if (! (flags & QEventLoop::ExcludeSocketNotifiers) && (sn_highest >= 0)) {
@@ -185,7 +184,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
continue;
for (int i = 0; i < list.size(); ++i) {
- QSockNot *sn = list.at(i);
+ QSockNot *sn = list[i];
FD_ZERO(&fdset);
FD_SET(sn->fd, &fdset);
@@ -242,7 +241,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
for (int i=0; i<3; i++) {
QSockNotType::List &list = sn_vec[i].list;
for (int j = 0; j < list.size(); ++j) {
- QSockNot *sn = list.at(j);
+ QSockNot *sn = list[j];
if (FD_ISSET(sn->fd, &sn_vec[i].select_fds))
q->setSocketNotifierPending(sn->obj);
}
@@ -258,7 +257,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
QTimerInfoList::QTimerInfoList()
{
-#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_SYMBIAN)
+#if (_POSIX_MONOTONIC_CLOCK-0 <= 0)
useMonotonicTimers = false;
# if (_POSIX_MONOTONIC_CLOCK == 0)
@@ -299,7 +298,7 @@ timeval QTimerInfoList::updateCurrentTime()
return currentTime;
}
-#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED)) && !defined(Q_OS_SYMBIAN)
+#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED)
/*
Returns true if the real time clock has changed by more than 10%
@@ -375,11 +374,7 @@ void QTimerInfoList::repairTimersIfNeeded()
void QTimerInfoList::getTime(timeval &t)
{
timespec ts;
-#if !defined(Q_OS_SYMBIAN)
clock_gettime(CLOCK_MONOTONIC, &ts);
-#else
- clock_gettime(CLOCK_REALTIME, &ts);
-#endif
t.tv_sec = ts.tv_sec;
t.tv_usec = ts.tv_nsec / 1000;
}
@@ -425,10 +420,18 @@ bool QTimerInfoList::timerWait(timeval &tm)
timeval currentTime = updateCurrentTime();
repairTimersIfNeeded();
- if (isEmpty())
- return false;
+ // Find first waiting timer not already active
+ QTimerInfo *t = 0;
+ for (QTimerInfoList::const_iterator it = constBegin(); it != constEnd(); ++it) {
+ if (!(*it)->inTimerEvent) {
+ t = *it;
+ break;
+ }
+ }
+
+ if (!t)
+ return false;
- QTimerInfo *t = first(); // first waiting timer
if (currentTime < t->timeout) {
// time to wait
tm = t->timeout - currentTime;
@@ -596,7 +599,10 @@ QEventDispatcherUNIX::QEventDispatcherUNIX(QEventDispatcherUNIXPrivate &dd, QObj
{ }
QEventDispatcherUNIX::~QEventDispatcherUNIX()
-{ }
+{
+ Q_D(QEventDispatcherUNIX);
+ d->threadData->eventDispatcher = 0;
+}
int QEventDispatcherUNIX::select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
timeval *timeout)
@@ -703,8 +709,8 @@ QSockNotType::QSockNotType()
QSockNotType::~QSockNotType()
{
- while (!list.isEmpty())
- delete list.takeFirst();
+ for (int i = 0; i < list.size(); ++i)
+ delete list[i];
}
/*****************************************************************************
@@ -740,7 +746,7 @@ void QEventDispatcherUNIX::registerSocketNotifier(QSocketNotifier *notifier)
int i;
for (i = 0; i < list.size(); ++i) {
- QSockNot *p = list.at(i);
+ QSockNot *p = list[i];
if (p->fd < sockfd)
break;
if (p->fd == sockfd) {
@@ -778,7 +784,7 @@ void QEventDispatcherUNIX::unregisterSocketNotifier(QSocketNotifier *notifier)
QSockNot *sn = 0;
int i;
for (i = 0; i < list.size(); ++i) {
- sn = list.at(i);
+ sn = list[i];
if(sn->obj == notifier && sn->fd == sockfd)
break;
}
@@ -796,7 +802,7 @@ void QEventDispatcherUNIX::unregisterSocketNotifier(QSocketNotifier *notifier)
for (int i=0; i<3; i++) {
if (!d->sn_vec[i].list.isEmpty())
d->sn_highest = qMax(d->sn_highest, // list is fd-sorted
- d->sn_vec[i].list.first()->fd);
+ d->sn_vec[i].list[0]->fd);
}
}
}
@@ -820,7 +826,7 @@ void QEventDispatcherUNIX::setSocketNotifierPending(QSocketNotifier *notifier)
QSockNot *sn = 0;
int i;
for (i = 0; i < list.size(); ++i) {
- sn = list.at(i);
+ sn = list[i];
if(sn->obj == notifier && sn->fd == sockfd)
break;
}
@@ -944,7 +950,7 @@ void QEventDispatcherUNIX::flush()
-#if !defined(Q_OS_SYMBIAN)
+
void QCoreApplication::watchUnixSignal(int sig, bool watch)
{
if (sig < NSIG) {
@@ -958,10 +964,5 @@ void QCoreApplication::watchUnixSignal(int sig, bool watch)
sigaction(sig, &sa, 0);
}
}
-#else
-void QCoreApplication::watchUnixSignal(int, bool)
-{
-}
-#endif
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h
index 41329cf..816add5 100644
--- a/src/corelib/kernel/qeventdispatcher_unix_p.h
+++ b/src/corelib/kernel/qeventdispatcher_unix_p.h
@@ -57,6 +57,7 @@
#include "QtCore/qlist.h"
#include "private/qabstracteventdispatcher_p.h"
#include "private/qpodlist_p.h"
+#include "QtCore/qvarlengtharray.h"
#include <sys/types.h>
#include <sys/time.h>
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index f5d3f78..ac505e1 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -345,18 +345,6 @@ void QObjectPrivate::derefSender(QObject *sender, int signal)
// Q_ASSERT_X(false, "QObjectPrivate::derefSender", "sender not found");
}
-void QObjectPrivate::removeSender(QObject *sender, int signal)
-{
- for (int i = 0; i < senders.count(); ++i) {
- Sender &s = senders[i];
- if (s.sender == sender && s.signal == signal) {
- senders.removeAt(i);
- return;
- }
- }
- // Q_ASSERT_X(false, "QObjectPrivate::removeSender", "sender not found");
-}
-
QObjectPrivate::Sender *QObjectPrivate::setCurrentSender(QObject *receiver,
Sender *sender)
{
@@ -404,7 +392,9 @@ void QMetaObject::removeGuard(QObject **ptr)
if (!*ptr)
return;
GuardHash *hash = guardHash();
- if (!hash)
+ /* check that the hash is empty - otherwise we might detach
+ the shared_null hash, which will alloc, which is not nice */
+ if (!hash || hash->isEmpty())
return;
QMutexLocker locker(guardHashLock());
GuardHash::iterator it = hash->find(*ptr);
@@ -446,9 +436,19 @@ void QMetaObject::changeGuard(QObject **ptr, QObject *o)
*/
void QObjectPrivate::clearGuards(QObject *object)
{
- GuardHash *hash = guardHash();
- if (hash) {
- QMutexLocker locker(guardHashLock());
+ GuardHash *hash = 0;
+ QMutex *mutex = 0;
+ QT_TRY {
+ hash = guardHash();
+ mutex = guardHashLock();
+ } QT_CATCH(const std::bad_alloc &) {
+ // do nothing in case of OOM - code below is safe
+ }
+
+ /* check that the hash is empty - otherwise we might detach
+ the shared_null hash, which will alloc, which is not nice */
+ if (hash && !hash->isEmpty()) {
+ QMutexLocker locker(mutex);
GuardHash::iterator it = hash->find(object);
const GuardHash::iterator end = hash->end();
while (it.key() == object && it != end) {
@@ -766,7 +766,14 @@ QObject::~QObject()
QObjectPrivate::clearGuards(this);
}
- emit destroyed(this);
+ QT_TRY {
+ emit destroyed(this);
+ } QT_CATCH(...) {
+ // all the signal/slots connections are still in place - if we don't
+ // quit now, we will crash pretty soon.
+ qWarning("Detected an unexpected exception in ~QObject while emitting destroyed().");
+ QT_RETHROW;
+ }
{
QMutexLocker locker(&d->threadData->mutex);
@@ -790,7 +797,7 @@ QObject::~QObject()
bool needToUnlock = QOrderedMutexLocker::relock(locker.mutex(), m);
c = &connectionList[i];
if (c->receiver)
- c->receiver->d_func()->removeSender(this, signal);
+ c->receiver->d_func()->derefSender(this, signal);
if (needToUnlock)
m->unlock();
@@ -811,18 +818,22 @@ QObject::~QObject()
}
// disconnect all senders
- for (int i = 0; i < d->senders.count(); ++i) {
+ for (int i = 0; i < d->senders.count(); ) {
QObjectPrivate::Sender *s = &d->senders[i];
- if (!s->sender)
- continue;
QMutex *m = &s->sender->d_func()->threadData->mutex;
bool needToUnlock = QOrderedMutexLocker::relock(locker.mutex(), m);
- s = &d->senders[i];
- if (s->sender)
- s->sender->d_func()->removeReceiver(s->signal, this);
+ if (m < locker.mutex()) {
+ if (i >= d->senders.count() || s != &d->senders[i]) {
+ if (needToUnlock)
+ m->unlock();
+ continue;
+ }
+ }
+ s->sender->d_func()->removeReceiver(s->signal, this);
if (needToUnlock)
m->unlock();
+ ++i;
}
d->senders.clear();
@@ -861,9 +872,6 @@ QObject::~QObject()
objectName().isNull() ? "unnamed" : qPrintable(objectName()));
}
#endif
-
- delete d;
- d_ptr = 0;
}
@@ -920,7 +928,8 @@ QObject::~QObject()
\relates QObject
Returns the given \a object cast to type T if the object is of type
- T (or of a subclass); otherwise returns 0.
+ T (or of a subclass); otherwise returns 0. If \a object is 0 then
+ it will also return 0.
The class T must inherit (directly or indirectly) QObject and be
declared with the \l Q_OBJECT macro.
@@ -1105,11 +1114,11 @@ bool QObject::event(QEvent *e)
#if defined(QT_NO_EXCEPTIONS)
mce->placeMetaCall(this);
#else
- try {
+ QT_TRY {
mce->placeMetaCall(this);
- } catch (...) {
+ } QT_CATCH(...) {
QObjectPrivate::resetCurrentSender(this, &currentSender, previousSender);
- throw;
+ QT_RETHROW;
}
#endif
QObjectPrivate::resetCurrentSender(this, &currentSender, previousSender);
@@ -2076,7 +2085,7 @@ void QObject::deleteLater()
or
- \tt{/*: ... \starslash}
+ \tt{\begincomment: ... \endcomment}
Examples:
@@ -3109,9 +3118,9 @@ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal
#if defined(QT_NO_EXCEPTIONS)
receiver->qt_metacall(QMetaObject::InvokeMetaMethod, method, argv ? argv : empty_argv);
#else
- try {
+ QT_TRY {
receiver->qt_metacall(QMetaObject::InvokeMetaMethod, method, argv ? argv : empty_argv);
- } catch (...) {
+ } QT_CATCH(...) {
locker.relock();
QObjectPrivate::resetCurrentSender(receiver, &currentSender, previousSender);
@@ -3120,7 +3129,7 @@ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal
Q_ASSERT(connectionLists->inUse >= 0);
if (connectionLists->orphaned && !connectionLists->inUse)
delete connectionLists;
- throw;
+ QT_RETHROW;
}
#endif
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index dbec0a6..8d5c4e3 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -51,6 +51,7 @@
#ifdef QT_INCLUDE_COMPAT
#include <QtCore/qcoreevent.h>
#endif
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -286,7 +287,7 @@ protected:
QObject(QObjectPrivate &dd, QObject *parent = 0);
protected:
- QObjectData *d_ptr;
+ QScopedPointer<QObjectData> d_ptr;
static const QMetaObject staticQtMetaObject;
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index b324334..0eed938 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -163,7 +163,6 @@ public:
QList<Sender> senders;
void refSender(QObject *sender, int signal);
void derefSender(QObject *sender, int signal);
- void removeSender(QObject *sender, int signal);
static Sender *setCurrentSender(QObject *receiver,
Sender *sender);
diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp
index 2b0e0af..dc9cabf 100644
--- a/src/corelib/kernel/qsharedmemory.cpp
+++ b/src/corelib/kernel/qsharedmemory.cpp
@@ -142,6 +142,10 @@ QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
detached from the segment, and no references to the segment
remain. Do not mix using QtSharedMemory and QSharedMemory. Port
everything to QSharedMemory.
+
+ \warning QSharedMemory changes the key in a Qt-specific way.
+ It is therefore currently not possible to use the shared memory of
+ non-Qt applications with QSharedMemory.
*/
/*!
diff --git a/src/corelib/kernel/qsharedmemory_symbian.cpp b/src/corelib/kernel/qsharedmemory_symbian.cpp
index afb161c..d05f9f3 100644
--- a/src/corelib/kernel/qsharedmemory_symbian.cpp
+++ b/src/corelib/kernel/qsharedmemory_symbian.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -86,11 +116,9 @@ bool QSharedMemoryPrivate::create(int size)
return false;
}
- HBufC* buffer = qt_QString2HBufCNewL(safeKey);
+ TPtrC ptr(qt_QString2TPtrC(safeKey));
- TInt err = chunk.CreateGlobal(*buffer, size, size);
-
- delete buffer;
+ TInt err = chunk.CreateGlobal(ptr, size, size);
setErrorString(function, err);
@@ -117,15 +145,11 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
return false;
}
- HBufC* buffer = qt_QString2HBufCNewL(safeKey);
+ TPtrC ptr(qt_QString2TPtrC(safeKey));
TInt err = KErrNoMemory;
- if (buffer) {
- err = chunk.OpenGlobal(*buffer, false);
- }
-
- delete buffer;
+ err = chunk.OpenGlobal(ptr, false);
if (err != KErrNone) {
setErrorString(function, err);
diff --git a/src/corelib/kernel/qsharedmemory_unix.cpp b/src/corelib/kernel/qsharedmemory_unix.cpp
index c4395d9..b664093 100644
--- a/src/corelib/kernel/qsharedmemory_unix.cpp
+++ b/src/corelib/kernel/qsharedmemory_unix.cpp
@@ -56,10 +56,10 @@
#include <fcntl.h>
#include <unistd.h>
-QT_BEGIN_NAMESPACE
-
#ifndef QT_NO_SHAREDMEMORY
+QT_BEGIN_NAMESPACE
+
QSharedMemoryPrivate::QSharedMemoryPrivate()
: QObjectPrivate(), memory(0), size(0), error(QSharedMemory::NoError),
#ifndef QT_NO_SYSTEMSEMAPHORE
diff --git a/src/corelib/kernel/qsystemsemaphore.cpp b/src/corelib/kernel/qsystemsemaphore.cpp
index 7e09a6e..fb9385a 100644
--- a/src/corelib/kernel/qsystemsemaphore.cpp
+++ b/src/corelib/kernel/qsystemsemaphore.cpp
@@ -170,8 +170,8 @@ QT_BEGIN_NAMESPACE
\sa acquire(), key()
*/
QSystemSemaphore::QSystemSemaphore(const QString &key, int initialValue, AccessMode mode)
+ : d(new QSystemSemaphorePrivate)
{
- d = new QSystemSemaphorePrivate;
setKey(key, initialValue, mode);
}
@@ -193,7 +193,6 @@ QSystemSemaphore::QSystemSemaphore(const QString &key, int initialValue, AccessM
QSystemSemaphore::~QSystemSemaphore()
{
d->cleanHandle();
- delete d;
}
/*!
diff --git a/src/corelib/kernel/qsystemsemaphore.h b/src/corelib/kernel/qsystemsemaphore.h
index 5a02072..3cafebf 100644
--- a/src/corelib/kernel/qsystemsemaphore.h
+++ b/src/corelib/kernel/qsystemsemaphore.h
@@ -43,6 +43,7 @@
#define QSYSTEMSEMAPHORE_H
#include <QtCore/qstring.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -89,7 +90,7 @@ public:
private:
Q_DISABLE_COPY(QSystemSemaphore)
- QSystemSemaphorePrivate *d;
+ QScopedPointer<QSystemSemaphorePrivate> d;
};
#endif // QT_NO_SYSTEMSEMAPHORE
diff --git a/src/corelib/kernel/qsystemsemaphore_p.h b/src/corelib/kernel/qsystemsemaphore_p.h
index 05a9347..0e6def3 100644
--- a/src/corelib/kernel/qsystemsemaphore_p.h
+++ b/src/corelib/kernel/qsystemsemaphore_p.h
@@ -110,9 +110,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/qsystemsemaphore_symbian.cpp b/src/corelib/kernel/qsystemsemaphore_symbian.cpp
index 0c138c4..8179046 100644
--- a/src/corelib/kernel/qsystemsemaphore_symbian.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_symbian.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -60,13 +90,12 @@ int QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode)
if (key.isEmpty())
return 0;
QString safeName = makeKeyFileName();
- HBufC* name = qt_QString2HBufCNewL(safeName);
+ TPtrC name(qt_QString2TPtrC(safeName));
int err;
- err = semaphore.OpenGlobal(*name,EOwnerProcess);
+ err = semaphore.OpenGlobal(name,EOwnerProcess);
if (err == KErrNotFound){
- err = semaphore.CreateGlobal(*name,initialValue, EOwnerProcess);
+ err = semaphore.CreateGlobal(name,initialValue, EOwnerProcess);
}
- delete name;
if (err){
setErrorString(QLatin1String("QSystemSemaphore::handle"),err);
return 0;
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 01e81ab..4b3feb0 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -77,7 +77,7 @@ QT_BEGIN_NAMESPACE
In multithreaded applications, you can use QTimer in any thread
that has an event loop. To start an event loop from a non-GUI
- thread, use QThread::exec(). Qt uses the the timer's
+ thread, use QThread::exec(). Qt uses the timer's
\l{QObject::thread()}{thread affinity} to determine which thread
will emit the \l{QTimer::}{timeout()} signal. Because of this, you
must start and stop the timer in its thread; it is not possible to
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index 77d6599..df904a6 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -149,6 +149,9 @@ static int numerusHelper(int n, const uchar *rules, int rulesSize)
leftOperand %= 10;
} else if (opcode & Q_MOD_100) {
leftOperand %= 100;
+ } else if (opcode & Q_LEAD_1000) {
+ while (leftOperand >= 1000)
+ leftOperand /= 1000;
}
int op = opcode & Q_OP_MASK;
@@ -819,6 +822,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/kernel/qtranslator_p.h b/src/corelib/kernel/qtranslator_p.h
index 77ec8f5..a7d58c5 100644
--- a/src/corelib/kernel/qtranslator_p.h
+++ b/src/corelib/kernel/qtranslator_p.h
@@ -62,6 +62,7 @@ enum {
Q_NOT = 0x08,
Q_MOD_10 = 0x10,
Q_MOD_100 = 0x20,
+ Q_LEAD_1000 = 0x40,
Q_AND = 0xFD,
Q_OR = 0xFE,
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 420dd1d..0ca0169 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -611,10 +611,10 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
.arg(fileName);
QStringList reg;
#ifndef QT_NO_SETTINGS
- bool madeSettings = false;
+ QScopedPointer<QSettings> madeSettings;
if (!settings) {
settings = new QSettings(QSettings::UserScope, QLatin1String("Trolltech"));
- madeSettings = true;
+ madeSettings.reset(settings);
}
reg = settings->value(regkey).toStringList();
#endif
@@ -708,8 +708,7 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
#endif
}
#ifndef QT_NO_SETTINGS
- if (madeSettings)
- delete settings;
+ madeSettings.reset();
#endif
if (!success) {
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index a911f1d..8d1c0f7 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -46,6 +46,7 @@
#include <qfileinfo.h>
#include "qlibrary_p.h"
#include "qdebug.h"
+#include "qdir.h"
#ifndef QT_NO_LIBRARY
@@ -301,6 +302,24 @@ void QPluginLoader::setFileName(const QString &fileName)
}
QString fn = fi.canonicalFilePath();
+ // If not found directly, check also all the available drives
+ if (!fn.length()) {
+ QString stubPath(fi.fileName().length() ? fi.absoluteFilePath() : QString());
+ if (stubPath.length() > 1) {
+ if (stubPath.at(1).toAscii() == ':')
+ stubPath.remove(0,2);
+ QFileInfoList driveList(QDir::drives());
+ foreach(const QFileInfo& drive, driveList) {
+ QString testFilePath(drive.absolutePath() + stubPath);
+ testFilePath = QDir::cleanPath(testFilePath);
+ if (QFile::exists(testFilePath)) {
+ fn = testFilePath;
+ break;
+ }
+ }
+ }
+ }
+
#else
QString fn = QFileInfo(fileName).canonicalFilePath();
#endif
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index cb44a25..f1bdc64 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -163,9 +163,9 @@ QAdoptedThread::~QAdoptedThread()
QThread *QAdoptedThread::createThreadForAdoption()
{
- QThread *t = new QAdoptedThread(0);
- t->moveToThread(t);
- return t;
+ QScopedPointer<QThread> t(new QAdoptedThread(0));
+ t->moveToThread(t.data());
+ return t.take();
}
void QAdoptedThread::run()
@@ -483,10 +483,10 @@ uint QThread::stackSize() const
int QThread::exec()
{
Q_D(QThread);
- d->mutex.lock();
+ QMutexLocker locker(&d->mutex);
d->data->quitNow = false;
QEventLoop eventLoop;
- d->mutex.unlock();
+ locker.unlock();
int returnCode = eventLoop.exec();
return returnCode;
}
@@ -734,8 +734,9 @@ QThreadData* QThreadData::current()
{
static QThreadData *data = 0; // reinterpret_cast<QThreadData *>(pthread_getspecific(current_thread_data_key));
if (!data) {
- data = new QThreadData;
- data->thread = new QAdoptedThread(data);
+ QScopedPointer<QThreadData> newdata(new QThreadData);
+ newdata->thread = new QAdoptedThread(newdata.data());
+ data = newdata.take();
data->deref();
}
return data;
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 567c936..d2a824a 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -124,7 +124,14 @@ QThreadData *QThreadData::current()
} else {
data = new QThreadData;
pthread_setspecific(current_thread_data_key, data);
- data->thread = new QAdoptedThread(data);
+ QT_TRY {
+ data->thread = new QAdoptedThread(data);
+ } QT_CATCH(...) {
+ pthread_setspecific(current_thread_data_key, 0);
+ data->deref();
+ data = 0;
+ QT_RETHROW;
+ }
data->deref();
}
if (!QCoreApplicationPrivate::theMainThread)
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index 7094e3d..76e551e 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -112,7 +112,14 @@ QThreadData *QThreadData::current()
// This needs to be called prior to new AdoptedThread() to
// avoid recursion.
TlsSetValue(qt_current_thread_data_tls_index, threadData);
- threadData->thread = new QAdoptedThread(threadData);
+ QT_TRY {
+ threadData->thread = new QAdoptedThread(threadData);
+ } QT_CATCH(...) {
+ TlsSetValue(qt_current_thread_data_tls_index, 0);
+ threadData->deref();
+ threadData = 0;
+ QT_RETHROW;
+ }
threadData->deref();
}
diff --git a/src/corelib/thread/qthreadstorage.cpp b/src/corelib/thread/qthreadstorage.cpp
index 35c55c1..4657009 100644
--- a/src/corelib/thread/qthreadstorage.cpp
+++ b/src/corelib/thread/qthreadstorage.cpp
@@ -101,12 +101,14 @@ void **QThreadStorageData::get() const
qWarning("QThreadStorage::get: QThreadStorage can only be used with threads started with QThread");
return 0;
}
- QMap<int, void *>::iterator it = data->tls.find(id);
+ QMap<int, void *>::const_iterator it = data->tls.constFind(id);
DEBUG_MSG("QThreadStorageData: Returning storage %d, data %p, for thread %p",
id,
it != data->tls.end() ? it.value() : 0,
data->thread);
- return it != data->tls.end() && it.value() != 0 ? &it.value() : 0;
+ // const_cast below is a bit evil - but we have to make sure not to detach here
+ // otherwise we'll go bonkers in oom situations
+ return it != data->tls.constEnd() && it.value() != 0 ? const_cast<void **>(&it.value()) : 0;
}
void **QThreadStorageData::set(void *p)
@@ -129,9 +131,9 @@ void **QThreadStorageData::set(void *p)
void *q = it.value();
it.value() = 0;
- mutex()->lock();
+ QMutexLocker locker(mutex());
void (*destructor)(void *) = destructors()->value(id);
- mutex()->unlock();
+ locker.unlock();
destructor(q);
}
@@ -167,9 +169,9 @@ void QThreadStorageData::finish(void **p)
continue;
}
- mutex()->lock();
+ QMutexLocker locker(mutex());
void (*destructor)(void *) = destructors()->value(id);
- mutex()->unlock();
+ locker.unlock();
if (!destructor) {
if (QThread::currentThread())
diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp
index a947ab5..7168a9a 100644
--- a/src/corelib/tools/qbitarray.cpp
+++ b/src/corelib/tools/qbitarray.cpp
@@ -209,6 +209,8 @@ void QBitArray::resize(int size)
uchar* c = reinterpret_cast<uchar*>(d.data());
if (size > (s << 3))
memset(c + s, 0, d.size() - s);
+ else if ( size % 8)
+ *(c+1+size/8) &= (1 << (size%8)) - 1;
*c = d.size()*8 - size;
}
}
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 6aa35f3..ae6561f 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -1233,14 +1233,11 @@ QByteArray::QByteArray(const char *str)
} else {
int len = qstrlen(str);
d = static_cast<Data *>(qMalloc(sizeof(Data)+len));
- if (!d) {
- d = &shared_null;
- } else {
- d->ref = 0;;
- d->alloc = d->size = len;
- d->data = d->array;
- memcpy(d->array, str, len+1); // include null terminator
- }
+ Q_CHECK_PTR(d);
+ d->ref = 0;;
+ d->alloc = d->size = len;
+ d->data = d->array;
+ memcpy(d->array, str, len+1); // include null terminator
}
d->ref.ref();
}
@@ -1264,15 +1261,12 @@ QByteArray::QByteArray(const char *data, int size)
d = &shared_empty;
} else {
d = static_cast<Data *>(qMalloc(sizeof(Data) + size));
- if (!d) {
- d = &shared_null;
- } else {
- d->ref = 0;
- d->alloc = d->size = size;
- d->data = d->array;
- memcpy(d->array, data, size);
- d->array[size] = '\0';
- }
+ Q_CHECK_PTR(d);
+ d->ref = 0;
+ d->alloc = d->size = size;
+ d->data = d->array;
+ memcpy(d->array, data, size);
+ d->array[size] = '\0';
}
d->ref.ref();
}
@@ -1290,15 +1284,12 @@ QByteArray::QByteArray(int size, char ch)
d = &shared_null;
} else {
d = static_cast<Data *>(qMalloc(sizeof(Data)+size));
- if (!d) {
- d = &shared_null;
- } else {
- d->ref = 0;
- d->alloc = d->size = size;
- d->data = d->array;
- d->array[size] = '\0';
- memset(d->array, ch, size);
- }
+ Q_CHECK_PTR(d);
+ d->ref = 0;
+ d->alloc = d->size = size;
+ d->data = d->array;
+ d->array[size] = '\0';
+ memset(d->array, ch, size);
}
d->ref.ref();
}
@@ -1334,8 +1325,7 @@ void QByteArray::resize(int size)
// QByteArray a(sz);
//
Data *x = static_cast<Data *>(qMalloc(sizeof(Data)+size));
- if (!x)
- return;
+ Q_CHECK_PTR(x);
x->ref = 1;
x->alloc = x->size = size;
x->data = x->array;
@@ -1377,8 +1367,7 @@ void QByteArray::realloc(int alloc)
{
if (d->ref != 1 || d->data != d->array) {
Data *x = static_cast<Data *>(qMalloc(sizeof(Data) + alloc));
- if (!x)
- return;
+ Q_CHECK_PTR(x);
x->size = qMin(alloc, d->size);
::memcpy(x->array, d->data, x->size);
x->array[x->size] = '\0';
@@ -1390,8 +1379,7 @@ void QByteArray::realloc(int alloc)
d = x;
} else {
Data *x = static_cast<Data *>(qRealloc(d, sizeof(Data) + alloc));
- if (!x)
- return;
+ Q_CHECK_PTR(x);
x->alloc = alloc;
x->data = x->array;
d = x;
@@ -1812,11 +1800,13 @@ QByteArray &QByteArray::replace(const char *before, int bsize, const char *after
const char *b = before;
if (after >= d->data && after < d->data + d->size) {
char *copy = (char *)malloc(asize);
+ Q_CHECK_PTR(copy);
memcpy(copy, after, asize);
a = copy;
}
if (before >= d->data && before < d->data + d->size) {
char *copy = (char *)malloc(bsize);
+ Q_CHECK_PTR(copy);
memcpy(copy, before, bsize);
b = copy;
}
@@ -3738,6 +3728,7 @@ QByteArray QByteArray::number(double n, char f, int prec)
QByteArray QByteArray::fromRawData(const char *data, int size)
{
Data *x = static_cast<Data *>(qMalloc(sizeof(Data)));
+ Q_CHECK_PTR(x);
if (data) {
x->data = const_cast<char *>(data);
} else {
diff --git a/src/corelib/tools/qbytearraymatcher.h b/src/corelib/tools/qbytearraymatcher.h
index 633e92c..970cbcc 100644
--- a/src/corelib/tools/qbytearraymatcher.h
+++ b/src/corelib/tools/qbytearraymatcher.h
@@ -70,7 +70,7 @@ public:
inline QByteArray pattern() const
{
if (q_pattern.isNull())
- return QByteArray((const char*)p.p, p.l);
+ return QByteArray(reinterpret_cast<const char*>(p.p), p.l);
return q_pattern;
}
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 9063ae4..917679c 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -78,7 +78,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..b43891c 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -2200,8 +2200,8 @@ int QTime::elapsed() const
\sa isValid()
*/
QDateTime::QDateTime()
+ : d(new QDateTimePrivate)
{
- d = new QDateTimePrivate;
}
@@ -2211,8 +2211,8 @@ QDateTime::QDateTime()
*/
QDateTime::QDateTime(const QDate &date)
+ : d(new QDateTimePrivate)
{
- d = new QDateTimePrivate;
d->date = date;
d->time = QTime(0, 0, 0);
}
@@ -2225,8 +2225,8 @@ QDateTime::QDateTime(const QDate &date)
*/
QDateTime::QDateTime(const QDate &date, const QTime &time, Qt::TimeSpec spec)
+ : d(new QDateTimePrivate)
{
- d = new QDateTimePrivate;
d->date = date;
d->time = date.isValid() && !time.isValid() ? QTime(0, 0, 0) : time;
d->spec = (spec == Qt::UTC) ? QDateTimePrivate::UTC : QDateTimePrivate::LocalUnknown;
@@ -2237,8 +2237,8 @@ QDateTime::QDateTime(const QDate &date, const QTime &time, Qt::TimeSpec spec)
*/
QDateTime::QDateTime(const QDateTime &other)
+ : d(other.d.data())
{
- d = other.d;
d->ref.ref();
}
@@ -2247,8 +2247,6 @@ QDateTime::QDateTime(const QDateTime &other)
*/
QDateTime::~QDateTime()
{
- if (!d->ref.deref())
- delete d;
}
/*!
@@ -2258,7 +2256,7 @@ QDateTime::~QDateTime()
QDateTime &QDateTime::operator=(const QDateTime &other)
{
- qAtomicAssign(d, other.d);
+ d.assign(other.d.data());
return *this;
}
@@ -3298,7 +3296,7 @@ QDateTime QDateTime::fromString(const QString &string, const QString &format)
*/
void QDateTime::detach()
{
- qAtomicDetach(d);
+ d.detach();
}
/*****************************************************************************
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index 3278297..cf4246d 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -44,6 +44,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qnamespace.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -284,7 +285,7 @@ public:
private:
friend class QDateTimePrivate;
void detach();
- QDateTimePrivate *d;
+ QScopedSharedPointer<QDateTimePrivate> d;
#ifndef QT_NO_DATASTREAM
friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDateTime &);
diff --git a/src/corelib/tools/qharfbuzz.cpp b/src/corelib/tools/qharfbuzz.cpp
index 1940209..923eda4 100644
--- a/src/corelib/tools/qharfbuzz.cpp
+++ b/src/corelib/tools/qharfbuzz.cpp
@@ -126,6 +126,7 @@ char *HB_TextCodec_ConvertFromUnicode(void *codec, const HB_UChar16 *unicode, hb
QByteArray data = reinterpret_cast<QTextCodec *>(codec)->fromUnicode((const QChar *)unicode, length);
// ### suboptimal
char *output = (char *)malloc(data.length() + 1);
+ Q_CHECK_PTR(output);
memcpy(output, data.constData(), data.length() + 1);
if (outputLength)
*outputLength = data.length();
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 2313e0e..a703621 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -171,7 +171,9 @@ QHashData QHashData::shared_null = {
void *QHashData::allocateNode()
{
- return qMalloc(nodeSize);
+ void *ptr = qMalloc(nodeSize);
+ Q_CHECK_PTR(ptr);
+ return ptr;
}
void QHashData::freeNode(void *node)
@@ -181,6 +183,13 @@ void QHashData::freeNode(void *node)
QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize)
{
+ return detach_helper( node_duplicate, 0, nodeSize );
+}
+
+QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *),
+ void (*node_delete)(Node *),
+ int nodeSize)
+{
union {
QHashData *d;
Node *e;
@@ -197,18 +206,43 @@ QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), int
d->sharable = true;
if (numBuckets) {
- d->buckets = new Node *[numBuckets];
+ QT_TRY {
+ d->buckets = new Node *[numBuckets];
+ } QT_CATCH(...) {
+ // restore a consistent state for d
+ d->numBuckets = 0;
+ // roll back
+ d->free_helper(node_delete);
+ QT_RETHROW;
+ }
+
Node *this_e = reinterpret_cast<Node *>(this);
for (int i = 0; i < numBuckets; ++i) {
Node **nextNode = &d->buckets[i];
Node *oldNode = buckets[i];
while (oldNode != this_e) {
- Node *dup = static_cast<Node *>(allocateNode());
- node_duplicate(oldNode, dup);
- dup->h = oldNode->h;
- *nextNode = dup;
- nextNode = &dup->next;
- oldNode = oldNode->next;
+ QT_TRY {
+ Node *dup = static_cast<Node *>(allocateNode());
+
+ QT_TRY {
+ node_duplicate(oldNode, dup);
+ } QT_CATCH(...) {
+ freeNode( dup );
+ QT_RETHROW;
+ }
+
+ dup->h = oldNode->h;
+ *nextNode = dup;
+ nextNode = &dup->next;
+ oldNode = oldNode->next;
+ } QT_CATCH(...) {
+ // restore a consistent state for d
+ *nextNode = e;
+ d->numBuckets = i+1;
+ // roll back
+ d->free_helper(node_delete);
+ QT_RETHROW;
+ }
}
*nextNode = e;
}
@@ -216,6 +250,26 @@ QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), int
return d;
}
+void QHashData::free_helper(void (*node_delete)(Node *))
+{
+ if (node_delete) {
+ Node *this_e = reinterpret_cast<Node *>(this);
+ Node **bucket = reinterpret_cast<Node **>(this->buckets);
+
+ int n = numBuckets;
+ while (n--) {
+ Node *cur = *bucket++;
+ while (cur != this_e) {
+ Node *next = cur->next;
+ node_delete(cur);
+ cur = next;
+ }
+ }
+ }
+ delete [] buckets;
+ delete this;
+}
+
QHashData::Node *QHashData::nextNode(Node *node)
{
union {
@@ -298,9 +352,10 @@ void QHashData::rehash(int hint)
Node **oldBuckets = buckets;
int oldNumBuckets = numBuckets;
+ int nb = primeForNumBits(hint);
+ buckets = new Node *[nb];
numBits = hint;
- numBuckets = primeForNumBits(hint);
- buckets = new Node *[numBuckets];
+ numBuckets = nb;
for (int i = 0; i < numBuckets; ++i)
buckets[i] = e;
@@ -327,8 +382,7 @@ void QHashData::rehash(int hint)
void QHashData::destroyAndFree()
{
- delete [] buckets;
- delete this;
+ free_helper(0);
}
#ifdef QT_QHASH_DEBUG
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index 3328716..b3f82e9 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -97,10 +97,7 @@ Q_CORE_EXPORT uint qHash(const QBitArray &key);
#endif
template <class T> inline uint qHash(const T *key)
{
- if (sizeof(const T *) > sizeof(uint))
- return qHash(reinterpret_cast<quint64>(key));
- else
- return uint(reinterpret_cast<ulong>(key));
+ return qHash(reinterpret_cast<quintptr>(key));
}
#if defined(Q_CC_MSVC)
#pragma warning( pop )
@@ -132,12 +129,15 @@ struct Q_CORE_EXPORT QHashData
void *allocateNode();
void freeNode(void *node);
- QHashData *detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize);
+ QHashData *detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize); // ### Qt5 remove me
+ QHashData *detach_helper(void (*node_duplicate)(Node *, void *), void (*node_delete)(Node *),
+ int nodeSize);
void mightGrow();
bool willGrow();
void hasShrunk();
void rehash(int hint);
- void destroyAndFree();
+ void free_helper(void (*node_delete)(Node *));
+ void destroyAndFree(); // ### Qt5 remove me
Node *firstNode();
#ifdef QT_QHASH_DEBUG
void dump();
@@ -479,21 +479,30 @@ private:
Node **findNode(const Key &key, uint *hp = 0) const;
Node *createNode(uint h, const Key &key, const T &value, Node **nextNode);
void deleteNode(Node *node);
+ static void deleteNode(QHashData::Node *node);
static void duplicateNode(QHashData::Node *originalNode, void *newNode);
};
+
template <class Key, class T>
Q_INLINE_TEMPLATE void QHash<Key, T>::deleteNode(Node *node)
{
+ deleteNode(reinterpret_cast<QHashData::Node*>(node));
+}
+
+
+template <class Key, class T>
+Q_INLINE_TEMPLATE void QHash<Key, T>::deleteNode(QHashData::Node *node)
+{
#ifdef Q_CC_BOR
- node->~QHashNode<Key, T>();
+ concrete(node)->~QHashNode<Key, T>();
#elif defined(QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION)
- node->~QHashNode();
+ concrete(node)->~QHashNode();
#else
- node->~Node();
+ concrete(node)->~Node();
#endif
- d->freeNode(node);
+ qFree(node);
}
template <class Key, class T>
@@ -541,18 +550,7 @@ Q_INLINE_TEMPLATE QHash<Key, T> &QHash<Key, T>::unite(const QHash<Key, T> &other
template <class Key, class T>
Q_OUTOFLINE_TEMPLATE void QHash<Key, T>::freeData(QHashData *x)
{
- Node *e_for_x = reinterpret_cast<Node *>(x);
- Node **bucket = reinterpret_cast<Node **>(x->buckets);
- int n = x->numBuckets;
- while (n--) {
- Node *cur = *bucket++;
- while (cur != e_for_x) {
- Node *next = cur->next;
- deleteNode(cur);
- cur = next;
- }
- }
- x->destroyAndFree();
+ x->free_helper(deleteNode);
}
template <class Key, class T>
@@ -564,7 +562,7 @@ Q_INLINE_TEMPLATE void QHash<Key, T>::clear()
template <class Key, class T>
Q_OUTOFLINE_TEMPLATE void QHash<Key, T>::detach_helper()
{
- QHashData *x = d->detach_helper(duplicateNode,
+ QHashData *x = d->detach_helper(duplicateNode, deleteNode,
QTypeInfo<T>::isDummy ? sizeof(DummyNode) : sizeof(Node));
if (!d->ref.deref())
freeData(d);
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index 6a85386..79311bc 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -265,15 +265,22 @@ void QLinkedList<T>::detach_helper()
x.d->ref = 1;
x.d->size = d->size;
x.d->sharable = true;
- Node *i = e->n, *j = x.e;
- while (i != e) {
- j->n = new Node(i->t);
- j->n->p = j;
- i = i->n;
- j = j->n;
+ Node *original = e->n;
+ Node *copy = x.e;
+ while (original != e) {
+ QT_TRY {
+ copy->n = new Node(original->t);
+ copy->n->p = copy;
+ original = original->n;
+ copy = copy->n;
+ } QT_CATCH(...) {
+ copy->n = x.e;
+ free(x.d);
+ QT_RETHROW;
+ }
}
- j->n = x.e;
- x.e->p = j;
+ copy->n = x.e;
+ x.e->p = copy;
if (!d->ref.deref())
free(d);
d = x.d;
@@ -474,14 +481,21 @@ QLinkedList<T> &QLinkedList<T>::operator+=(const QLinkedList<T> &l)
detach();
int n = l.d->size;
d->size += n;
- Node *o = l.e->n;
+ Node *original = l.e->n;
while (n--) {
- Node *i = new Node(o->t);
- o = o->n;
- i->n = e;
- i->p = e->p;
- i->p->n = i;
- e->p = i;
+ QT_TRY {
+ Node *copy = new Node(original->t);
+ original = original->n;
+ copy->n = e;
+ copy->p = e->p;
+ copy->p->n = copy;
+ e->p = copy;
+ } QT_CATCH(...) {
+ // restore the original list
+ while (n++<d->size)
+ removeLast();
+ QT_RETHROW;
+ }
}
return *this;
}
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 3c21ec1..7540035 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -117,6 +117,14 @@ public:
inline int size() const { return p.size(); }
inline void detach() { if (d->ref != 1) detach_helper(); }
+
+ inline void detachShared()
+ {
+ // The "this->" qualification is needed for GCCE.
+ if (d->ref != 1 && this->d != &QListData::shared_null)
+ detach_helper();
+ }
+
inline bool isDetached() const { return d->ref == 1; }
inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
@@ -352,12 +360,27 @@ Q_INLINE_TEMPLATE void QList<T>::node_destruct(Node *n)
template <typename T>
Q_INLINE_TEMPLATE void QList<T>::node_copy(Node *from, Node *to, Node *src)
{
- if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic)
- while(from != to)
- (from++)->v = new T(*reinterpret_cast<T*>((src++)->v));
- else if (QTypeInfo<T>::isComplex)
- while(from != to)
- new (from++) T(*reinterpret_cast<T*>(src++));
+ Node *current = from;
+ if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
+ QT_TRY {
+ while(current != to)
+ (current++)->v = new T(*reinterpret_cast<T*>((src++)->v));
+ } QT_CATCH(...) {
+ while (current != from)
+ delete reinterpret_cast<T*>(current--);
+ QT_RETHROW;
+ }
+ }
+ else if (QTypeInfo<T>::isComplex) {
+ QT_TRY {
+ while(current != to)
+ new (current++) T(*reinterpret_cast<T*>(src++));
+ } QT_CATCH(...) {
+ while (current != from)
+ (reinterpret_cast<T*>(current--))->~T();
+ QT_RETHROW;
+ }
+ }
}
template <typename T>
@@ -384,8 +407,16 @@ Q_INLINE_TEMPLATE QList<T> &QList<T>::operator=(const QList<T> &l)
}
template <typename T>
inline typename QList<T>::iterator QList<T>::insert(iterator before, const T &t)
-{ Node *n = reinterpret_cast<Node *>(p.insert(before.i-reinterpret_cast<Node *>(p.begin())));
- node_construct(n,t); return n; }
+{
+ Node *n = reinterpret_cast<Node *>(p.insert(before.i - reinterpret_cast<Node *>(p.begin())));
+ QT_TRY {
+ node_construct(n, t);
+ } QT_CATCH(...) {
+ p.remove(before.i - reinterpret_cast<Node *>(p.begin()));
+ QT_RETHROW;
+ }
+ return n;
+}
template <typename T>
inline typename QList<T>::iterator QList<T>::erase(iterator it)
{ node_destruct(it.i);
@@ -423,10 +454,22 @@ Q_OUTOFLINE_TEMPLATE void QList<T>::append(const T &t)
{
detach();
if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
- node_construct(reinterpret_cast<Node *>(p.append()), t);
+ Node *n = reinterpret_cast<Node *>(p.append());
+ QT_TRY {
+ node_construct(n, t);
+ } QT_CATCH(...) {
+ --d->end;
+ QT_RETHROW;
+ }
} else {
const T cpy(t);
- node_construct(reinterpret_cast<Node *>(p.append()), cpy);
+ Node *n = reinterpret_cast<Node *>(p.append());
+ QT_TRY {
+ node_construct(n, cpy);
+ } QT_CATCH(...) {
+ --d->end;
+ QT_RETHROW;
+ }
}
}
@@ -435,10 +478,22 @@ inline void QList<T>::prepend(const T &t)
{
detach();
if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
- node_construct(reinterpret_cast<Node *>(p.prepend()), t);
+ Node *n = reinterpret_cast<Node *>(p.prepend());
+ QT_TRY {
+ node_construct(n, t);
+ } QT_CATCH(...) {
+ ++d->begin;
+ QT_RETHROW;
+ }
} else {
const T cpy(t);
- node_construct(reinterpret_cast<Node *>(p.prepend()), cpy);
+ Node *n = reinterpret_cast<Node *>(p.prepend());
+ QT_TRY {
+ node_construct(n, cpy);
+ } QT_CATCH(...) {
+ ++d->begin;
+ QT_RETHROW;
+ }
}
}
@@ -447,10 +502,22 @@ inline void QList<T>::insert(int i, const T &t)
{
detach();
if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
- node_construct(reinterpret_cast<Node *>(p.insert(i)), t);
+ Node *n = reinterpret_cast<Node *>(p.insert(i));
+ QT_TRY {
+ node_construct(n, t);
+ } QT_CATCH(...) {
+ p.remove(i);
+ QT_RETHROW;
+ }
} else {
const T cpy(t);
- node_construct(reinterpret_cast<Node *>(p.insert(i)), cpy);
+ Node *n = reinterpret_cast<Node *>(p.insert(i));
+ QT_TRY {
+ node_construct(n, cpy);
+ } QT_CATCH(...) {
+ p.remove(i);
+ QT_RETHROW;
+ }
}
}
@@ -522,7 +589,14 @@ Q_OUTOFLINE_TEMPLATE void QList<T>::detach_helper()
{
Node *n = reinterpret_cast<Node *>(p.begin());
QListData::Data *x = p.detach2();
- node_copy(reinterpret_cast<Node *>(p.begin()), reinterpret_cast<Node *>(p.end()), n);
+ QT_TRY {
+ node_copy(reinterpret_cast<Node *>(p.begin()), reinterpret_cast<Node *>(p.end()), n);
+ } QT_CATCH(...) {
+ qFree(d);
+ d = x;
+ QT_RETHROW;
+ }
+
if (!x->ref.deref())
free(x);
}
@@ -572,7 +646,7 @@ Q_OUTOFLINE_TEMPLATE void QList<T>::clear()
template <typename T>
Q_OUTOFLINE_TEMPLATE int QList<T>::removeAll(const T &_t)
{
- detach();
+ detachShared();
const T t = _t;
int removedCount=0, i=0;
Node *n;
@@ -590,7 +664,7 @@ Q_OUTOFLINE_TEMPLATE int QList<T>::removeAll(const T &_t)
template <typename T>
Q_OUTOFLINE_TEMPLATE bool QList<T>::removeOne(const T &_t)
{
- detach();
+ detachShared();
int index = indexOf(_t);
if (index != -1) {
removeAt(index);
diff --git a/src/corelib/tools/qlistdata.cpp b/src/corelib/tools/qlistdata.cpp
index d40b6b6..efdde64 100644
--- a/src/corelib/tools/qlistdata.cpp
+++ b/src/corelib/tools/qlistdata.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#include <new>
#include "qlist.h"
#include "qtools_p.h"
#include <string.h>
@@ -71,8 +72,7 @@ static int grow(int size)
QListData::Data *QListData::detach()
{
Data *x = static_cast<Data *>(qMalloc(DataHeaderSize + d->alloc * sizeof(void *)));
- if (!x)
- qFatal("QList: Out of memory");
+ Q_CHECK_PTR(x);
::memcpy(x, d, DataHeaderSize + d->alloc * sizeof(void *));
x->alloc = d->alloc;
@@ -91,10 +91,10 @@ QListData::Data *QListData::detach()
QListData::Data *QListData::detach2()
{
Data *x = d;
- d = static_cast<Data *>(qMalloc(DataHeaderSize + x->alloc * sizeof(void *)));
- if (!d)
- qFatal("QList: Out of memory");
+ Data* t = static_cast<Data *>(qMalloc(DataHeaderSize + x->alloc * sizeof(void *)));
+ Q_CHECK_PTR(t);
+ d = t;
::memcpy(d, x, DataHeaderSize + x->alloc * sizeof(void *));
d->alloc = x->alloc;
d->ref = 1;
@@ -109,8 +109,7 @@ void QListData::realloc(int alloc)
{
Q_ASSERT(d->ref == 1);
Data *x = static_cast<Data *>(qRealloc(d, DataHeaderSize + alloc * sizeof(void *)));
- if (!x)
- qFatal("QList: Out of memory");
+ Q_CHECK_PTR(x);
d = x;
d->alloc = alloc;
@@ -514,6 +513,15 @@ void **QListData::erase(void **xi)
\internal
*/
+/*! \fn void QList::detachShared()
+
+ \internal
+
+ like detach(), but does nothing if we're shared_null.
+ This prevents needless mallocs, and makes QList more exception safe
+ in case of cleanup work done in destructors on empty lists.
+*/
+
/*! \fn bool QList::isDetached() const
\internal
@@ -1173,7 +1181,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 +1441,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 4267562..4317933 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -78,11 +78,6 @@ QT_END_NAMESPACE
#include <qdebug.h>
#include <time.h>
-#if defined(Q_OS_SYMBIAN)
-#include <e32std.h>
-#include "private/qcore_symbian_p.h"
-#endif
-
#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
# include <fenv.h>
#endif
@@ -303,7 +298,7 @@ static bool splitLocaleName(const QString &name, QChar *lang_begin, QChar *cntry
return lang_len == 2 || lang_len == 3;
}
-static void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry)
+void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry)
{
lang = QLocale::C;
cntry = QLocale::AnyCountry;
@@ -1282,794 +1277,8 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
}
return QVariant();
}
-#elif defined(Q_OS_SYMBIAN)
-
-static TExtendedLocale _s60Locale;
-
-// Type definitions for runtime resolved function pointers
-typedef void (*FormatFunc)(TTime&, TDes&, const TDesC&, const TLocale&);
-typedef TPtrC (*FormatSpecFunc)(TExtendedLocale&);
-
-// Runtime resolved functions
-static FormatFunc ptrTimeFormatL = NULL;
-static FormatSpecFunc ptrGetTimeFormatSpec = NULL;
-static FormatSpecFunc ptrGetLongDateFormatSpec = NULL;
-static FormatSpecFunc ptrGetShortDateFormatSpec = NULL;
-
-// Default functions if functions cannot be resolved
-static void defaultTimeFormatL(TTime&, TDes& des, const TDesC&, const TLocale&)
-{
- des.Zero();
-}
-
-static TPtrC defaultFormatSpec(TExtendedLocale&)
-{
- return TPtrC(KNullDesC);
-}
-
-/*!
- Definition of struct for mapping Symbian to ISO locale
-*/
-struct symbianToISO {
- int symbian_language;
- char iso_name[8];
-};
-
-/*!
- Mapping from Symbian to ISO locale
-*/
-static const symbianToISO symbian_to_iso_list[] = {
- { ELangEnglish, "en_GB" },
- { ELangFrench, "fr_FR" },
- { ELangGerman, "de_DE" },
- { ELangSpanish, "es_ES" },
- { ELangItalian, "it_IT" },
- { ELangSwedish, "sv_SE" },
- { ELangDanish, "da_DK" },
- { ELangNorwegian, "no_NO" },
- { ELangFinnish, "fi_FI" },
- { ELangAmerican, "en_US" },
- { ELangPortuguese, "pt_PT" },
- { ELangTurkish, "tr_TR" },
- { ELangIcelandic, "is_IS" },
- { ELangRussian, "ru_RU" },
- { ELangHungarian, "hu_HU" },
- { ELangDutch, "nl_NL" },
- { ELangBelgianFlemish, "nl_BE" },
- { ELangCzech, "cs_CZ" },
- { ELangSlovak, "sk_SK" },
- { ELangPolish, "pl_PL" },
- { ELangSlovenian, "sl_SI" },
- { ELangTaiwanChinese, "zh_TW" },
- { ELangHongKongChinese, "zh_HK" },
- { ELangPrcChinese, "zh_CN" },
- { ELangJapanese, "ja_JP" },
- { ELangThai, "th_TH" },
- { ELangArabic, "ar_AE" },
- { ELangTagalog, "tl_PH" },
- { ELangBulgarian, "bg_BG" },
- { ELangCatalan, "ca_ES" },
- { ELangCroatian, "hr_HR" },
- { ELangEstonian, "et_EE" },
- { ELangFarsi, "fa_IR" },
- { ELangCanadianFrench, "fr_CA" },
- { ELangGreek, "el_GR" },
- { ELangHebrew, "he_IL" },
- { ELangHindi, "hi_IN" },
- { ELangIndonesian, "id_ID" },
- { ELangLatvian, "lv_LV" },
- { ELangLithuanian, "lt_LT" },
- { ELangMalay, "ms_MY" },
- { ELangBrazilianPortuguese, "pt_BR" },
- { ELangRomanian, "ro_RO" },
- { ELangSerbian, "sr_YU" },
- { ELangLatinAmericanSpanish, "es" },
- { ELangUkrainian, "uk_UA" },
- { ELangUrdu, "ur_PK" }, // India/Pakistan
- { ELangVietnamese, "vi_VN" },
-#ifdef __E32LANG_H__
-// 5.0
- { ELangBasque, "eu_ES" },
- { ELangGalician, "gl_ES" },
-#endif
-#if !defined(__SERIES60_31__)
- { ELangEnglish_Apac, "en" },
- { ELangEnglish_Taiwan, "en_TW" },
- { ELangEnglish_HongKong, "en_HK" },
- { ELangEnglish_Prc, "en_CN" },
- { ELangEnglish_Japan, "en_JP"},
- { ELangEnglish_Thailand, "en_TH" },
- { ELangMalay_Apac, "ms" }
-#endif
-};
-
-/*!
- Returns ISO name corresponding to the Symbian locale code \a sys_fmt.
-*/
-static QByteArray symbianLocaleName(int code)
-{
- //Number of Symbian to ISO locale mappings
- static const int symbian_to_iso_count
- = sizeof(symbian_to_iso_list)/sizeof(symbianToISO);
-
- int cmp = code - symbian_to_iso_list[0].symbian_language;
- if (cmp < 0)
- return 0;
-
- if (cmp == 0)
- return symbian_to_iso_list[0].iso_name;
-
- int begin = 0;
- int end = symbian_to_iso_count;
-
- while (end - begin > 1) {
- uint mid = (begin + end)/2;
-
- const symbianToISO *elt = symbian_to_iso_list + mid;
- int cmp = code - elt->symbian_language;
- if (cmp < 0)
- end = mid;
- else if (cmp > 0)
- begin = mid;
- else
- return elt->iso_name;
- }
-
- return 0;
-}
-
-
-// order is: normal, abbr, nmode, nmode+abbr
-static const char *us_locale_dep[] = {
- "MM", "dd", "yyyy", "MM", "dd",
- "M", "d", "yy", "M", "d",
- "MMMM", "dd", "yyyy", "MMMM", "dd",
- "MMM", "d", "yy", "MMM", "d" };
-
-static const char *eu_locale_dep[] = {
- "dd", "MM", "yyyy", "dd", "MM",
- "d", "M", "yy", "d", "M",
- "dd", "MMMM", "yyyy", "dd", "MMMM",
- "d", "MMM", "yy", "d", "MMM" };
-
-static const char *jp_locale_dep[] = {
- "yyyy", "MM", "dd", "MM", "dd",
- "yy", "M", "d", "M", "d",
- "yyyy", "MMMM", "dd", "MMMM", "dd",
- "yy", "MMM", "d", "MMM", "d" };
-
-/*!
- Returns a Qt version of the given \a sys_fmt Symbian locale format string.
-*/
-static QString s60ToQtFormat(const QString &sys_fmt)
-{
- TLocale *locale = _s60Locale.GetLocale();
-
- QString result;
- QString other;
- QString qtformatchars = QString::fromLatin1("adhmsyzAHM");
-
- QChar c;
- int i = 0;
- bool open_escape = false;
- bool abbrev_next = false;
- bool locale_indep_ordering = false;
- bool minus_mode = false;
- bool plus_mode = false;
- bool n_mode = false;
- TTimeFormat tf = locale->TimeFormat();
-
- while (i < sys_fmt.size()) {
-
- c = sys_fmt.at(i);
-
- // let formatting thru
- if (c.unicode() == '%') {
- // if we have gathered string, concat it
- if (!other.isEmpty()) {
- result += other;
- other.clear();
- }
- // if we have open escape, end it
- if (open_escape) {
- result += QLatin1Char('\'');
- open_escape = false;
- }
-
- ++i;
- if (i >= sys_fmt.size())
- break;
-
- c = sys_fmt.at(i);
-
- // process specials
- abbrev_next = c.unicode() == '*';
- plus_mode = c.unicode() == '+';
- minus_mode = c.unicode() == '-';
-
- if (abbrev_next || plus_mode || minus_mode) {
- ++i;
- if (i >= sys_fmt.size())
- break;
-
- c = sys_fmt.at(i);
-
- if (plus_mode || minus_mode) {
- // break on undefined plus/minus mode
- if (c.unicode() != 'A' && c.unicode() != 'B')
- break;
- }
- }
-
- switch (c.unicode()) {
- case 'F':
- // locale indep mode on
- locale_indep_ordering = true;
- break;
-
- case '/':
- // date sep 0-3
- ++i;
- if (i >= sys_fmt.size())
- break;
-
- c = sys_fmt.at(i);
- if (c.isDigit() && c.digitValue() <= 3) {
- TChar s = locale->DateSeparator(c.digitValue());
- TUint val = s;
- // some indexes return zero for empty
- if (val > 0)
- result += QChar(val);
- }
- break;
-
- case 'D':
- if (!locale_indep_ordering)
- break;
-
- if (!abbrev_next)
- result += QLatin1String("dd");
- else
- result += QLatin1Char('d');
-
- break;
-
- case 'M':
- if (!locale_indep_ordering)
- break;
-
- if (!n_mode) {
- if (!abbrev_next)
- result += QLatin1String("MM");
- else
- result += QLatin1String("M");
- } else {
- if (!abbrev_next)
- result += QLatin1String("MMMM");
- else
- result += QLatin1String("MMM");
- }
-
- break;
-
- case 'N':
- n_mode = true;
-
- if (!locale_indep_ordering)
- break;
-
- if (!abbrev_next)
- result += QLatin1String("MMMM");
- else
- result += QLatin1String("MMM");
-
- break;
-
- case 'Y':
- if (!locale_indep_ordering)
- break;
-
- if (!abbrev_next)
- result += QLatin1String("yyyy");
- else
- result += QLatin1String("yy");
-
- break;
-
- case 'E':
- if (!abbrev_next)
- result += QLatin1String("dddd");
- else
- result += QLatin1String("ddd");
-
- break;
-
- case ':':
- // timesep 0-3
- ++i;
- if (i >= sys_fmt.size())
- break;
-
- c = sys_fmt.at(i);
- if (c.isDigit() && c.digitValue() <= 3) {
- TChar s = locale->TimeSeparator(c.digitValue());
- TUint val = s;
- // some indexes return zero for empty
- if (val > 0)
- result += QChar(val);
- }
-
- break;
-
- case 'J':
- if (tf == ETime24 && !abbrev_next)
- result += QLatin1String("hh");
- else
- result += QLatin1Char('h');
-
- break;
-
- case 'H':
- if (!abbrev_next)
- result += QLatin1String("hh");
- else
- result += QLatin1Char('h');
-
- break;
-
- case 'I':
- result += QLatin1Char('h');
- break;
-
- case 'T':
- if (!abbrev_next)
- result += QLatin1String("mm");
- else
- result += QLatin1Char('m');
-
- break;
-
- case 'S':
- if (!abbrev_next)
- result += QLatin1String("ss");
- else
- result += QLatin1Char('s');
-
- break;
-
- case 'B':
- // only done for 12h clock
- if (tf == ETime24)
- break;
-
- // fallthru to A
- case 'A': {
- // quickie to get capitalization, can't use s60 string as is because Qt 'hh' format's am/pm logic
- TAmPmName ampm = TAmPmName();
- TChar first(ampm[0]);
- QString qtampm = QString::fromLatin1(first.IsUpper() ? "AP" : "ap");
-
- int pos = locale->AmPmSymbolPosition();
-
- if ((minus_mode && pos != ELocaleBefore) ||
- (plus_mode && pos != ELocaleAfter))
- break;
-
- if (!abbrev_next && locale->AmPmSpaceBetween()) {
- if (pos == ELocaleBefore)
- qtampm.append(QLatin1Char(' '));
- else
- qtampm.prepend(QLatin1Char(' '));
- }
-
- result += qtampm;
- }
- break;
-
- case '.': {
- // decimal sep
- TChar s = locale->DecimalSeparator();
- TUint val = s;
- if (val > 0)
- result += QChar(val);
- }
- break;
-
- case 'C':
- // six digits in s60, three digits in qt
- if (!abbrev_next) {
- result += QLatin1String("zzz");
- } else {
- // next char is number from 0-6, how many digits to display
- ++i;
- if (i >= sys_fmt.size())
- break;
-
- c = sys_fmt.at(i);
-
- if (c.isDigit()) {
- // try to match wanted digits
- QChar val(c.digitValue());
-
- if (val >= 3) {
- result += QLatin1String("zzz");
- } else if (val > 0) {
- result += QLatin1Char('z');
- }
- }
- }
- break;
-
- // these cases fallthru
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
-
- // shouldn't parse these with %F
- if (locale_indep_ordering)
- break;
-
- TDateFormat df = locale->DateFormat();
-
- const char **locale_dep;
- switch (df) {
- default: // fallthru to american
- case EDateAmerican:
- locale_dep = us_locale_dep;
- break;
- case EDateEuropean:
- locale_dep = eu_locale_dep;
- break;
- case EDateJapanese:
- locale_dep = jp_locale_dep;
- break;
- }
- int offset = 0;
- if (abbrev_next)
- offset += 5;
- if (n_mode)
- offset += 10;
-
- result += QLatin1String(locale_dep[offset + (c.digitValue()-1)]);
- break;
-
- case '%': // fallthru percent
- // any junk gets copied as is
- default:
- result += c;
- break;
-
- case 'Z': // Qt doesn't support these :(
- case 'X':
- case 'W':
- break;
- }
- } else {
- // double any single quotes, don't begin escape
- if (c.unicode() == '\'') {
- // end open escape
- if (open_escape) {
- result += other;
- other.clear();
- result += QLatin1Char('\'');
- open_escape = false;
- }
-
- other += c;
- }
-
- // gather chars and escape them in one go if any format chars are found
- if (!open_escape && qtformatchars.indexOf(c) != -1) {
- result += QLatin1Char('\'');
- open_escape = true;
- }
- other += c;
- }
-
- ++i;
- }
-
- if (!other.isEmpty())
- result += other;
- if (open_escape)
- result += QLatin1Char('\'');
-
- return result;
-}
-
-/*!
- Retrieves Symbian locale decimal separator.
-*/
-static QString symbianDecimalPoint()
-{
- TLocale *locale = _s60Locale.GetLocale();
-
- TChar decPoint = locale->DecimalSeparator();
- int val = decPoint;
- return QChar(val);
-}
-
-/*!
- Retrieves Symbian locale group separator.
-*/
-static QString symbianGroupSeparator()
-{
- TLocale *locale = _s60Locale.GetLocale();
-
- TChar grpSep = locale->ThousandsSeparator();
- int val = grpSep;
- return QChar(val);
-}
-
-/*!
- Retrieves Symbian locale zero digit.
-*/
-static QString symbianZeroDigit()
-{
- TLocale *locale = _s60Locale.GetLocale();
-
- // TDigitType enumeration value returned by TLocale
- // will always correspond to zero digit unicode value.
- TDigitType digit = locale->DigitType();
- return QChar(digit);
-}
-
-/*!
- Retrieves a day name from Symbian locale. The \a day is an integer
- from 1 to 7. When \a short_format is true the method returns
- the day in short format. Otherwise it returns the day in a long format.
-*/
-static QString symbianDayName(int day, bool short_format)
-{
- day -= 1;
-
- if (day < 0 || day > 6)
- return QString();
-
- if (short_format) {
- return qt_TDes2QStringL(TDayNameAbb(TDay(day)));
- } else {
- return qt_TDes2QStringL(TDayName(TDay(day)));
- }
-}
-
-/*!
- Retrieves a month name from Symbian locale. The \a month is an integer
- from 1 to 12. When \a short_format is true the method returns
- the month in short format. Otherwise it returns the month in a long format.
-*/
-static QString symbianMonthName(int month, bool short_format)
-{
- month -= 1;
- if (month < 0 || month > 11)
- return QString();
-
- if (short_format) {
- return qt_TDes2QStringL(TMonthNameAbb(TMonth(month)));
- } else {
- return qt_TDes2QStringL(TMonthName(TMonth(month)));
- }
-}
-
-/*!
- Retrieves date format from Symbian locale and
- transforms it to Qt format.
-
- When \a short_format is true the method returns
- short date format. Otherwise it returns the long format.
-*/
-static QString symbianDateFormat(bool short_format)
-{
- TPtrC dateFormat;
-
- if (short_format) {
- dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale));
- } else {
- dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale));
- }
-
- return s60ToQtFormat(qt_TDesC2QStringL(dateFormat));
-}
-
-/*!
- Retrieves time format from Symbian locale and
- transforms it to Qt format.
-*/
-static QString symbianTimeFormat()
-{
- return s60ToQtFormat(qt_TDesC2QStringL(ptrGetTimeFormatSpec(_s60Locale)));
-}
-
-/*!
- Returns localized string representation of given \a date
- formatted with Symbian locale date format.
-
- If \a short_format is true the format will be a short version.
- Otherwise it uses a longer version.
-*/
-static QString symbianDateToString(const QDate &date, bool short_format)
-{
- int month = date.month() - 1;
- int day = date.day() - 1;
- int year = date.year();
-
- TDateTime dateTime;
- dateTime.Set(year, TMonth(month), day, 0, 0, 0, 0);
-
- TTime timeStr(dateTime);
- TBuf<KMaxLongDateFormatSpec*2> buffer;
-
- TPtrC dateFormat;
- if (short_format) {
- dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale));
- } else {
- dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale));
- }
-
- TRAPD(err, ptrTimeFormatL(timeStr, buffer, dateFormat, *_s60Locale.GetLocale());)
-
- if (err == KErrNone)
- return qt_TDes2QStringL(buffer);
- else
- return QString();
-}
-
-/*!
- Returns localized string representation of given \a time
- formatted with Symbian locale time format.
-*/
-static QString symbianTimeToString(const QTime &time)
-{
- int hour = time.hour();
- int minute = time.minute();
- int second = time.second();
- int milliseconds = 0;
-
- TDateTime dateTime;
- dateTime.Set(0, TMonth(0), 0, hour, minute, second, milliseconds);
-
- TTime timeStr(dateTime);
- TBuf<KMaxTimeFormatSpec*2> buffer;
-
- TRAPD(err, ptrTimeFormatL(
- timeStr,
- buffer,
- ptrGetTimeFormatSpec(_s60Locale),
- *_s60Locale.GetLocale());
- )
-
- if (err == KErrNone)
- return qt_TDes2QStringL(buffer);
- else
- return QString();
-}
-
-/*!
- Returns the measurement system stored in Symbian locale
-
- \sa QLocale::MeasurementSystem
-*/
-static QLocale::MeasurementSystem symbianMeasurementSystem()
-{
- TLocale *locale = _s60Locale.GetLocale();
-
- TUnitsFormat unitFormat = locale->UnitsGeneral();
- if (unitFormat == EUnitsImperial)
- return QLocale::ImperialSystem;
- else
- return QLocale::MetricSystem;
-}
-
-QLocale QSystemLocale::fallbackLocale() const
-{
- // load system data before query calls
- static bool initDone = false;
- if (!initDone) {
- _s60Locale.LoadSystemSettings();
-
- // Initialize platform version dependent function pointers
- ptrTimeFormatL = reinterpret_cast<FormatFunc>
- (qt_resolveS60PluginFunc(S60Plugin_TimeFormatL));
- ptrGetTimeFormatSpec = reinterpret_cast<FormatSpecFunc>
- (qt_resolveS60PluginFunc(S60Plugin_GetTimeFormatSpec));
- ptrGetLongDateFormatSpec = reinterpret_cast<FormatSpecFunc>
- (qt_resolveS60PluginFunc(S60Plugin_GetLongDateFormatSpec));
- ptrGetShortDateFormatSpec = reinterpret_cast<FormatSpecFunc>
- (qt_resolveS60PluginFunc(S60Plugin_GetShortDateFormatSpec));
- if (!ptrTimeFormatL)
- ptrTimeFormatL = &defaultTimeFormatL;
- if (!ptrGetTimeFormatSpec)
- ptrGetTimeFormatSpec = &defaultFormatSpec;
- if (!ptrGetLongDateFormatSpec)
- ptrGetLongDateFormatSpec = &defaultFormatSpec;
- if (!ptrGetShortDateFormatSpec)
- ptrGetShortDateFormatSpec = &defaultFormatSpec;
- }
-
- TLanguage lang = User::Language();
- QString locale = symbianLocaleName(lang);
- return QLocale(locale);
-}
-
-/*!
- Generic query method for locale data. Provides indirection.
- Denotes the \a type of the query
- with \a in as input data depending on the query.
-
- \sa QSystemLocale::QueryType
-*/
-QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
-{
- switch(type) {
- case DecimalPoint:
- return symbianDecimalPoint();
- case GroupSeparator:
- return symbianGroupSeparator();
-
- case ZeroDigit:
- return symbianZeroDigit();
-
- case DayNameLong:
- case DayNameShort:
- return symbianDayName(in.toInt(), (type == DayNameShort) );
-
- case MonthNameLong:
- case MonthNameShort:
- return symbianMonthName(in.toInt(), (type == MonthNameShort) );
-
- case DateFormatLong:
- case DateFormatShort:
- return symbianDateFormat( (type == DateFormatShort) );
- case TimeFormatLong:
- case TimeFormatShort:
- return symbianTimeFormat();
- case DateTimeFormatLong:
- case DateTimeFormatShort:
- return symbianDateFormat( (type == DateTimeFormatShort) ) + QLatin1Char(' ') + symbianTimeFormat();
- case DateToStringShort:
- case DateToStringLong:
- return symbianDateToString(in.toDate(), (type == DateToStringShort) );
- case TimeToStringShort:
- case TimeToStringLong:
- return symbianTimeToString(in.toTime());
- case DateTimeToStringShort:
- case DateTimeToStringLong: {
- const QDateTime dt = in.toDateTime();
- return symbianDateToString(dt.date(), (type == DateTimeToStringShort) )
- + QLatin1Char(' ') + symbianTimeToString(dt.time());
- }
- case MeasurementSystem:
- return static_cast<int>(symbianMeasurementSystem());
- case LanguageId:
- case CountryId: {
- TLanguage language = User::Language();
- QString locale = symbianLocaleName(language);
- QLocale::Language lang;
- QLocale::Country cntry;
- getLangAndCountry(locale, lang, cntry);
- if (type == LanguageId)
- return lang;
- // few iso codes have no country and will use this
- if (cntry == QLocale::AnyCountry)
- return fallbackLocale().country();
-
- return cntry;
- }
- case NegativeSign:
- case PositiveSign:
- case AMText:
- case PMText:
- break;
- default:
- break;
- }
- return QVariant();
-}
-
-#elif defined(Q_OS_UNIX)
+#elif defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
static uint unixGetSystemMeasurementSystem()
{
@@ -2113,7 +1322,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant /* in */) const
}
}
-#else
+#elif !defined(Q_OS_SYMBIAN)
/*!
Returns a fallback locale, that will get used for everything that
@@ -2387,7 +1596,7 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l)
defaults to the default locale (see setDefault()).
\endlist
- The "C" locale is identical to \l{English}/\l{UnitedStates}.
+ The "C" locale is identical in behavior to \l{English}/\l{UnitedStates}.
Use language() and country() to determine the actual language and
country values used.
@@ -2430,7 +1639,7 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l)
This enumerated type is used to specify a language.
- \value C The "C" locale is English/UnitedStates.
+ \value C The "C" locale is identical in behavior to English/UnitedStates.
\value Abkhazian
\value Afan
\value Afar
@@ -5915,6 +5124,7 @@ static Bigint *Balloc(int k)
x = 1 << k;
rv = static_cast<Bigint *>(MALLOC(sizeof(Bigint) + (x-1)*sizeof(Long)));
+ Q_CHECK_PTR(rv);
rv->k = k;
rv->maxwds = x;
rv->sign = rv->wds = 0;
@@ -7579,6 +6789,7 @@ static char *_qdtoa( NEEDS_VOLATILE double d, int mode, int ndigits, int *decpt,
i = 1;
}
*resultp = static_cast<char *>(malloc(i + 1));
+ Q_CHECK_PTR(resultp);
s = s0 = *resultp;
if (ilim >= 0 && ilim <= Quick_max && try_quick) {
@@ -8000,6 +7211,7 @@ Q_CORE_EXPORT char *qdtoa( double d, int mode, int ndigits, int *decpt, int *sig
n = i + 1;
}
*resultp = static_cast<char*>(malloc(n + 1));
+ Q_CHECK_PTR(resultp);
qstrncpy(*resultp, res, n + 1);
return *resultp;
}
diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp
new file mode 100644
index 0000000..c11a7b9
--- /dev/null
+++ b/src/corelib/tools/qlocale_symbian.cpp
@@ -0,0 +1,878 @@
+/****************************************************************************
+**
+** 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 <QDate>
+#include <QLocale>
+#include <QTime>
+#include <QVariant>
+
+#include <e32std.h>
+#include "private/qcore_symbian_p.h"
+
+// Located in qlocale.cpp
+extern void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry);
+
+QT_BEGIN_NAMESPACE
+
+static TExtendedLocale _s60Locale;
+
+// Type definitions for runtime resolved function pointers
+typedef void (*FormatFunc)(TTime&, TDes&, const TDesC&, const TLocale&);
+typedef TPtrC (*FormatSpecFunc)(TExtendedLocale&);
+
+// Runtime resolved functions
+static FormatFunc ptrTimeFormatL = NULL;
+static FormatSpecFunc ptrGetTimeFormatSpec = NULL;
+static FormatSpecFunc ptrGetLongDateFormatSpec = NULL;
+static FormatSpecFunc ptrGetShortDateFormatSpec = NULL;
+
+// Default functions if functions cannot be resolved
+static void defaultTimeFormatL(TTime&, TDes& des, const TDesC&, const TLocale&)
+{
+ des.Zero();
+}
+
+static TPtrC defaultFormatSpec(TExtendedLocale&)
+{
+ return TPtrC(KNullDesC);
+}
+
+/*!
+ Definition of struct for mapping Symbian to ISO locale
+*/
+struct symbianToISO {
+ int symbian_language;
+ char iso_name[8];
+};
+
+
+/*!
+ Mapping from Symbian to ISO locale
+*/
+static const symbianToISO symbian_to_iso_list[] = {
+ { ELangEnglish, "en_GB" },
+ { ELangFrench, "fr_FR" },
+ { ELangGerman, "de_DE" },
+ { ELangSpanish, "es_ES" },
+ { ELangItalian, "it_IT" },
+ { ELangSwedish, "sv_SE" },
+ { ELangDanish, "da_DK" },
+ { ELangNorwegian, "no_NO" },
+ { ELangFinnish, "fi_FI" },
+ { ELangAmerican, "en_US" },
+ { ELangPortuguese, "pt_PT" },
+ { ELangTurkish, "tr_TR" },
+ { ELangIcelandic, "is_IS" },
+ { ELangRussian, "ru_RU" },
+ { ELangHungarian, "hu_HU" },
+ { ELangDutch, "nl_NL" },
+ { ELangBelgianFlemish, "nl_BE" },
+ { ELangCzech, "cs_CZ" },
+ { ELangSlovak, "sk_SK" },
+ { ELangPolish, "pl_PL" },
+ { ELangSlovenian, "sl_SI" },
+ { ELangTaiwanChinese, "zh_TW" },
+ { ELangHongKongChinese, "zh_HK" },
+ { ELangPrcChinese, "zh_CN" },
+ { ELangJapanese, "ja_JP" },
+ { ELangThai, "th_TH" },
+ { ELangArabic, "ar_AE" },
+ { ELangTagalog, "tl_PH" },
+ { ELangBulgarian, "bg_BG" },
+ { ELangCatalan, "ca_ES" },
+ { ELangCroatian, "hr_HR" },
+ { ELangEstonian, "et_EE" },
+ { ELangFarsi, "fa_IR" },
+ { ELangCanadianFrench, "fr_CA" },
+ { ELangGreek, "el_GR" },
+ { ELangHebrew, "he_IL" },
+ { ELangHindi, "hi_IN" },
+ { ELangIndonesian, "id_ID" },
+ { ELangLatvian, "lv_LV" },
+ { ELangLithuanian, "lt_LT" },
+ { ELangMalay, "ms_MY" },
+ { ELangBrazilianPortuguese, "pt_BR" },
+ { ELangRomanian, "ro_RO" },
+ { ELangSerbian, "sr_YU" },
+ { ELangLatinAmericanSpanish, "es" },
+ { ELangUkrainian, "uk_UA" },
+ { ELangUrdu, "ur_PK" }, // India/Pakistan
+ { ELangVietnamese, "vi_VN" },
+#ifdef __E32LANG_H__
+// 5.0
+ { ELangBasque, "eu_ES" },
+ { ELangGalician, "gl_ES" },
+#endif
+#if !defined(__SERIES60_31__)
+ { ELangEnglish_Apac, "en" },
+ { ELangEnglish_Taiwan, "en_TW" },
+ { ELangEnglish_HongKong, "en_HK" },
+ { ELangEnglish_Prc, "en_CN" },
+ { ELangEnglish_Japan, "en_JP"},
+ { ELangEnglish_Thailand, "en_TH" },
+ { ELangMalay_Apac, "ms" }
+#endif
+};
+
+/*!
+ Returns ISO name corresponding to the Symbian locale code \a sys_fmt.
+*/
+static QByteArray symbianLocaleName(int code)
+{
+ //Number of Symbian to ISO locale mappings
+ static const int symbian_to_iso_count
+ = sizeof(symbian_to_iso_list)/sizeof(symbianToISO);
+
+ int cmp = code - symbian_to_iso_list[0].symbian_language;
+ if (cmp < 0)
+ return 0;
+
+ if (cmp == 0)
+ return symbian_to_iso_list[0].iso_name;
+
+ int begin = 0;
+ int end = symbian_to_iso_count;
+
+ while (end - begin > 1) {
+ uint mid = (begin + end)/2;
+
+ const symbianToISO *elt = symbian_to_iso_list + mid;
+ int cmp = code - elt->symbian_language;
+ if (cmp < 0)
+ end = mid;
+ else if (cmp > 0)
+ begin = mid;
+ else
+ return elt->iso_name;
+ }
+
+ return 0;
+}
+
+
+// order is: normal, abbr, nmode, nmode+abbr
+static const char *us_locale_dep[] = {
+ "MM", "dd", "yyyy", "MM", "dd",
+ "M", "d", "yy", "M", "d",
+ "MMMM", "dd", "yyyy", "MMMM", "dd",
+ "MMM", "d", "yy", "MMM", "d" };
+
+static const char *eu_locale_dep[] = {
+ "dd", "MM", "yyyy", "dd", "MM",
+ "d", "M", "yy", "d", "M",
+ "dd", "MMMM", "yyyy", "dd", "MMMM",
+ "d", "MMM", "yy", "d", "MMM" };
+
+static const char *jp_locale_dep[] = {
+ "yyyy", "MM", "dd", "MM", "dd",
+ "yy", "M", "d", "M", "d",
+ "yyyy", "MMMM", "dd", "MMMM", "dd",
+ "yy", "MMM", "d", "MMM", "d" };
+
+/*!
+ Returns a Qt version of the given \a sys_fmt Symbian locale format string.
+*/
+static QString s60ToQtFormat(const QString &sys_fmt)
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ QString result;
+ QString other;
+ QString qtformatchars = QString::fromLatin1("adhmsyzAHM");
+
+ QChar c;
+ int i = 0;
+ bool open_escape = false;
+ bool abbrev_next = false;
+ bool locale_indep_ordering = false;
+ bool minus_mode = false;
+ bool plus_mode = false;
+ bool n_mode = false;
+ TTimeFormat tf = locale->TimeFormat();
+
+ while (i < sys_fmt.size()) {
+
+ c = sys_fmt.at(i);
+
+ // let formatting thru
+ if (c.unicode() == '%') {
+ // if we have gathered string, concat it
+ if (!other.isEmpty()) {
+ result += other;
+ other.clear();
+ }
+ // if we have open escape, end it
+ if (open_escape) {
+ result += QLatin1Char('\'');
+ open_escape = false;
+ }
+
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+
+ // process specials
+ abbrev_next = c.unicode() == '*';
+ plus_mode = c.unicode() == '+';
+ minus_mode = c.unicode() == '-';
+
+ if (abbrev_next || plus_mode || minus_mode) {
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+
+ if (plus_mode || minus_mode) {
+ // break on undefined plus/minus mode
+ if (c.unicode() != 'A' && c.unicode() != 'B')
+ break;
+ }
+ }
+
+ switch (c.unicode()) {
+ case 'F':
+ {
+ // locale indep mode on
+ locale_indep_ordering = true;
+ break;
+ }
+
+ case '/':
+ {
+ // date sep 0-3
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+ if (c.isDigit() && c.digitValue() <= 3) {
+ TChar s = locale->DateSeparator(c.digitValue());
+ TUint val = s;
+ // some indexes return zero for empty
+ if (val > 0)
+ result += QChar(val);
+ }
+ break;
+ }
+
+ case 'D':
+ {
+ if (!locale_indep_ordering)
+ break;
+
+ if (!abbrev_next)
+ result += QLatin1String("dd");
+ else
+ result += QLatin1Char('d');
+
+ break;
+ }
+
+ case 'M':
+ {
+ if (!locale_indep_ordering)
+ break;
+
+ if (!n_mode) {
+ if (!abbrev_next)
+ result += QLatin1String("MM");
+ else
+ result += QLatin1String("M");
+ } else {
+ if (!abbrev_next)
+ result += QLatin1String("MMMM");
+ else
+ result += QLatin1String("MMM");
+ }
+
+ break;
+ }
+
+ case 'N':
+ {
+ n_mode = true;
+
+ if (!locale_indep_ordering)
+ break;
+
+ if (!abbrev_next)
+ result += QLatin1String("MMMM");
+ else
+ result += QLatin1String("MMM");
+
+ break;
+ }
+
+ case 'Y':
+ {
+ if (!locale_indep_ordering)
+ break;
+
+ if (!abbrev_next)
+ result += QLatin1String("yyyy");
+ else
+ result += QLatin1String("yy");
+
+ break;
+ }
+
+ case 'E':
+ {
+ if (!abbrev_next)
+ result += QLatin1String("dddd");
+ else
+ result += QLatin1String("ddd");
+
+ break;
+ }
+
+ case ':':
+ {
+ // timesep 0-3
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+ if (c.isDigit() && c.digitValue() <= 3) {
+ TChar s = locale->TimeSeparator(c.digitValue());
+ TUint val = s;
+ // some indexes return zero for empty
+ if (val > 0)
+ result += QChar(val);
+ }
+
+ break;
+ }
+
+ case 'J':
+ {
+ if (tf == ETime24 && !abbrev_next)
+ result += QLatin1String("hh");
+ else
+ result += QLatin1Char('h');
+
+ break;
+ }
+
+ case 'H':
+ {
+ if (!abbrev_next)
+ result += QLatin1String("hh");
+ else
+ result += QLatin1Char('h');
+
+ break;
+ }
+
+ case 'I':
+ {
+ result += QLatin1Char('h');
+ break;
+ }
+
+ case 'T':
+ {
+ if (!abbrev_next)
+ result += QLatin1String("mm");
+ else
+ result += QLatin1Char('m');
+
+ break;
+ }
+
+ case 'S':
+ {
+ if (!abbrev_next)
+ result += QLatin1String("ss");
+ else
+ result += QLatin1Char('s');
+
+ break;
+ }
+
+ case 'B':
+ {
+ // only done for 12h clock
+ if (tf == ETime24)
+ break;
+ }
+
+ // fallthru to A
+ case 'A': {
+ // quickie to get capitalization, can't use s60 string as is because Qt 'hh' format's am/pm logic
+ TAmPmName ampm = TAmPmName();
+ TChar first(ampm[0]);
+ QString qtampm = QString::fromLatin1(first.IsUpper() ? "AP" : "ap");
+
+ int pos = locale->AmPmSymbolPosition();
+
+ if ((minus_mode && pos != ELocaleBefore) ||
+ (plus_mode && pos != ELocaleAfter))
+ break;
+
+ if (!abbrev_next && locale->AmPmSpaceBetween()) {
+ if (pos == ELocaleBefore)
+ qtampm.append(QLatin1Char(' '));
+ else
+ qtampm.prepend(QLatin1Char(' '));
+ }
+
+ result += qtampm;
+ }
+ break;
+
+ case '.': {
+ // decimal sep
+ TChar s = locale->DecimalSeparator();
+ TUint val = s;
+ if (val > 0)
+ result += QChar(val);
+ }
+ break;
+
+ case 'C':
+ {
+ // six digits in s60, three digits in qt
+ if (!abbrev_next) {
+ result += QLatin1String("zzz");
+ } else {
+ // next char is number from 0-6, how many digits to display
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+
+ if (c.isDigit()) {
+ // try to match wanted digits
+ QChar val(c.digitValue());
+
+ if (val >= 3) {
+ result += QLatin1String("zzz");
+ } else if (val > 0) {
+ result += QLatin1Char('z');
+ }
+ }
+ }
+ break;
+ }
+
+ // these cases fallthru
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ {
+
+ // shouldn't parse these with %F
+ if (locale_indep_ordering)
+ break;
+
+ TDateFormat df = locale->DateFormat();
+
+ const char **locale_dep;
+ switch (df) {
+ default: // fallthru to american
+ case EDateAmerican:
+ locale_dep = us_locale_dep;
+ break;
+ case EDateEuropean:
+ locale_dep = eu_locale_dep;
+ break;
+ case EDateJapanese:
+ locale_dep = jp_locale_dep;
+ break;
+ }
+ int offset = 0;
+ if (abbrev_next)
+ offset += 5;
+ if (n_mode)
+ offset += 10;
+
+ result += QLatin1String(locale_dep[offset + (c.digitValue()-1)]);
+ break;
+ }
+
+ case '%': // fallthru percent
+ {
+ // any junk gets copied as is
+ }
+ default:
+ {
+ result += c;
+ break;
+ }
+
+ case 'Z': // Qt doesn't support these :(
+ case 'X':
+ case 'W':
+ {
+ break;
+ }
+ }
+ } else {
+ // double any single quotes, don't begin escape
+ if (c.unicode() == '\'') {
+ // end open escape
+ if (open_escape) {
+ result += other;
+ other.clear();
+ result += QLatin1Char('\'');
+ open_escape = false;
+ }
+
+ other += c;
+ }
+
+ // gather chars and escape them in one go if any format chars are found
+ if (!open_escape && qtformatchars.indexOf(c) != -1) {
+ result += QLatin1Char('\'');
+ open_escape = true;
+ }
+ other += c;
+ }
+
+ ++i;
+ }
+
+ if (!other.isEmpty())
+ result += other;
+ if (open_escape)
+ result += QLatin1Char('\'');
+
+ return result;
+}
+
+/*!
+ Retrieves Symbian locale decimal separator.
+*/
+static QString symbianDecimalPoint()
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ TChar decPoint = locale->DecimalSeparator();
+ int val = decPoint;
+ return QChar(val);
+}
+
+/*!
+ Retrieves Symbian locale group separator.
+*/
+static QString symbianGroupSeparator()
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ TChar grpSep = locale->ThousandsSeparator();
+ int val = grpSep;
+ return QChar(val);
+}
+
+/*!
+ Retrieves Symbian locale zero digit.
+*/
+static QString symbianZeroDigit()
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ // TDigitType enumeration value returned by TLocale
+ // will always correspond to zero digit unicode value.
+ TDigitType digit = locale->DigitType();
+ return QChar(digit);
+}
+
+/*!
+ Retrieves a day name from Symbian locale. The \a day is an integer
+ from 1 to 7. When \a short_format is true the method returns
+ the day in short format. Otherwise it returns the day in a long format.
+*/
+static QString symbianDayName(int day, bool short_format)
+{
+ day -= 1;
+
+ if (day < 0 || day > 6)
+ return QString();
+
+ if (short_format) {
+ return qt_TDes2QStringL(TDayNameAbb(TDay(day)));
+ } else {
+ return qt_TDes2QStringL(TDayName(TDay(day)));
+ }
+}
+
+/*!
+ Retrieves a month name from Symbian locale. The \a month is an integer
+ from 1 to 12. When \a short_format is true the method returns
+ the month in short format. Otherwise it returns the month in a long format.
+*/
+static QString symbianMonthName(int month, bool short_format)
+{
+ month -= 1;
+ if (month < 0 || month > 11)
+ return QString();
+
+ if (short_format) {
+ return qt_TDes2QStringL(TMonthNameAbb(TMonth(month)));
+ } else {
+ return qt_TDes2QStringL(TMonthName(TMonth(month)));
+ }
+}
+
+/*!
+ Retrieves date format from Symbian locale and
+ transforms it to Qt format.
+
+ When \a short_format is true the method returns
+ short date format. Otherwise it returns the long format.
+*/
+static QString symbianDateFormat(bool short_format)
+{
+ TPtrC dateFormat;
+
+ if (short_format) {
+ dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale));
+ } else {
+ dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale));
+ }
+
+ return s60ToQtFormat(qt_TDesC2QStringL(dateFormat));
+}
+
+/*!
+ Retrieves time format from Symbian locale and
+ transforms it to Qt format.
+*/
+static QString symbianTimeFormat()
+{
+ return s60ToQtFormat(qt_TDesC2QStringL(ptrGetTimeFormatSpec(_s60Locale)));
+}
+
+/*!
+ Returns localized string representation of given \a date
+ formatted with Symbian locale date format.
+
+ If \a short_format is true the format will be a short version.
+ Otherwise it uses a longer version.
+*/
+static QString symbianDateToString(const QDate &date, bool short_format)
+{
+ int month = date.month() - 1;
+ int day = date.day() - 1;
+ int year = date.year();
+
+ TDateTime dateTime;
+ dateTime.Set(year, TMonth(month), day, 0, 0, 0, 0);
+
+ TTime timeStr(dateTime);
+ TBuf<KMaxLongDateFormatSpec*2> buffer;
+
+ TPtrC dateFormat;
+ if (short_format) {
+ dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale));
+ } else {
+ dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale));
+ }
+
+ TRAPD(err, ptrTimeFormatL(timeStr, buffer, dateFormat, *_s60Locale.GetLocale());)
+
+ if (err == KErrNone)
+ return qt_TDes2QStringL(buffer);
+ else
+ return QString();
+}
+
+/*!
+ Returns localized string representation of given \a time
+ formatted with Symbian locale time format.
+*/
+static QString symbianTimeToString(const QTime &time)
+{
+ int hour = time.hour();
+ int minute = time.minute();
+ int second = time.second();
+ int milliseconds = 0;
+
+ TDateTime dateTime;
+ dateTime.Set(0, TMonth(0), 0, hour, minute, second, milliseconds);
+
+ TTime timeStr(dateTime);
+ TBuf<KMaxTimeFormatSpec*2> buffer;
+
+ TRAPD(err, ptrTimeFormatL(
+ timeStr,
+ buffer,
+ ptrGetTimeFormatSpec(_s60Locale),
+ *_s60Locale.GetLocale());
+ )
+
+ if (err == KErrNone)
+ return qt_TDes2QStringL(buffer);
+ else
+ return QString();
+}
+
+/*!
+ Returns the measurement system stored in Symbian locale
+
+ \sa QLocale::MeasurementSystem
+*/
+static QLocale::MeasurementSystem symbianMeasurementSystem()
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ TUnitsFormat unitFormat = locale->UnitsGeneral();
+ if (unitFormat == EUnitsImperial)
+ return QLocale::ImperialSystem;
+ else
+ return QLocale::MetricSystem;
+}
+
+QLocale QSystemLocale::fallbackLocale() const
+{
+ // load system data before query calls
+ static bool initDone = false;
+ if (!initDone) {
+ _s60Locale.LoadSystemSettings();
+
+ // Initialize platform version dependent function pointers
+ ptrTimeFormatL = reinterpret_cast<FormatFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_TimeFormatL));
+ ptrGetTimeFormatSpec = reinterpret_cast<FormatSpecFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_GetTimeFormatSpec));
+ ptrGetLongDateFormatSpec = reinterpret_cast<FormatSpecFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_GetLongDateFormatSpec));
+ ptrGetShortDateFormatSpec = reinterpret_cast<FormatSpecFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_GetShortDateFormatSpec));
+ if (!ptrTimeFormatL)
+ ptrTimeFormatL = &defaultTimeFormatL;
+ if (!ptrGetTimeFormatSpec)
+ ptrGetTimeFormatSpec = &defaultFormatSpec;
+ if (!ptrGetLongDateFormatSpec)
+ ptrGetLongDateFormatSpec = &defaultFormatSpec;
+ if (!ptrGetShortDateFormatSpec)
+ ptrGetShortDateFormatSpec = &defaultFormatSpec;
+ }
+
+ TLanguage lang = User::Language();
+ QString locale = symbianLocaleName(lang);
+ return QLocale(locale);
+}
+
+/*!
+ Generic query method for locale data. Provides indirection.
+ Denotes the \a type of the query
+ with \a in as input data depending on the query.
+
+ \sa QSystemLocale::QueryType
+*/
+QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
+{
+ switch(type) {
+ case DecimalPoint:
+ return symbianDecimalPoint();
+ case GroupSeparator:
+ return symbianGroupSeparator();
+
+ case ZeroDigit:
+ return symbianZeroDigit();
+
+ case DayNameLong:
+ case DayNameShort:
+ return symbianDayName(in.toInt(), (type == DayNameShort) );
+
+ case MonthNameLong:
+ case MonthNameShort:
+ return symbianMonthName(in.toInt(), (type == MonthNameShort) );
+
+ case DateFormatLong:
+ case DateFormatShort:
+ return symbianDateFormat( (type == DateFormatShort) );
+ case TimeFormatLong:
+ case TimeFormatShort:
+ return symbianTimeFormat();
+ case DateTimeFormatLong:
+ case DateTimeFormatShort:
+ return symbianDateFormat( (type == DateTimeFormatShort) ) + QLatin1Char(' ') + symbianTimeFormat();
+ case DateToStringShort:
+ case DateToStringLong:
+ return symbianDateToString(in.toDate(), (type == DateToStringShort) );
+ case TimeToStringShort:
+ case TimeToStringLong:
+ return symbianTimeToString(in.toTime());
+ case DateTimeToStringShort:
+ case DateTimeToStringLong: {
+ const QDateTime dt = in.toDateTime();
+ return symbianDateToString(dt.date(), (type == DateTimeToStringShort) )
+ + QLatin1Char(' ') + symbianTimeToString(dt.time());
+ }
+ case MeasurementSystem:
+ return static_cast<int>(symbianMeasurementSystem());
+ case LanguageId:
+ case CountryId: {
+ TLanguage language = User::Language();
+ QString locale = symbianLocaleName(language);
+ QLocale::Language lang;
+ QLocale::Country cntry;
+ getLangAndCountry(locale, lang, cntry);
+ if (type == LanguageId)
+ return lang;
+ // few iso codes have no country and will use this
+ if (cntry == QLocale::AnyCountry)
+ return fallbackLocale().country();
+
+ return cntry;
+ }
+ case NegativeSign:
+ case PositiveSign:
+ case AMText:
+ case PMText:
+ break;
+ default:
+ break;
+ }
+ return QVariant();
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index 0699400..ceaf370 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -59,6 +59,7 @@ QMapData QMapData::shared_null = {
QMapData *QMapData::createData()
{
QMapData *d = new QMapData;
+ Q_CHECK_PTR(d);
Node *e = reinterpret_cast<Node *>(d);
e->backward = e;
e->forward[0] = e;
@@ -84,6 +85,15 @@ void QMapData::continueFreeData(int offset)
delete this;
}
+/*!
+ Creates a new node inside the data structure.
+
+ \a update is an array with pointers to the node after which the new node
+ should be inserted. Because of the strange skip list data structure there
+ could be several pointers to this node on different levels.
+ \a offset is an amount of bytes that needs to reserved just before the
+ QMapData::Node structure.
+*/
QMapData::Node *QMapData::node_create(Node *update[], int offset)
{
int level = 0;
@@ -94,10 +104,6 @@ QMapData::Node *QMapData::node_create(Node *update[], int offset)
mask <<= Sparseness;
}
- ++randomBits;
- if (level == 3 && !insertInOrder)
- randomBits = qrand();
-
if (level > topLevel) {
Node *e = reinterpret_cast<Node *>(this);
level = ++topLevel;
@@ -105,7 +111,13 @@ QMapData::Node *QMapData::node_create(Node *update[], int offset)
update[level] = e;
}
+ ++randomBits;
+ if (level == 3 && !insertInOrder)
+ randomBits = qrand();
+
void *concreteNode = qMalloc(offset + sizeof(Node) + level * sizeof(Node *));
+ Q_CHECK_PTR(concreteNode);
+
Node *abstractNode = reinterpret_cast<Node *>(reinterpret_cast<char *>(concreteNode) + offset);
abstractNode->backward = update[0];
@@ -116,6 +128,7 @@ QMapData::Node *QMapData::node_create(Node *update[], int offset)
update[i]->forward[i] = abstractNode;
update[i] = abstractNode;
}
+ // update[level+1]=reinterpret_cast<Node *>(this);
++size;
return abstractNode;
}
@@ -146,7 +159,7 @@ uint QMapData::adjust_ptr(Node *node)
void QMapData::dump()
{
- qDebug("Map data (ref = %d, size = %d, randomBits = %#.8x)", ref.atomic, size, randomBits);
+ qDebug("Map data (ref = %d, size = %d, randomBits = %#.8x)", int(ref), size, randomBits);
QString preOutput;
QVector<QString> output(topLevel + 1);
@@ -158,12 +171,12 @@ void QMapData::dump()
Node *update[LastLevel + 1];
for (int i = 0; i <= topLevel; ++i) {
- str.sprintf("%d: [%.8x] -", i, adjust_ptr(forward[i]));
+ str.sprintf("%d: [%.8x] -", i, adjust_ptr(reinterpret_cast<Node *>(forward[i])));
output[i] += str;
- update[i] = forward[i];
+ update[i] = reinterpret_cast<Node *>(forward[i]);
}
- Node *node = forward[0];
+ Node *node = reinterpret_cast<Node *>(forward[0]);
while (node != e) {
int level = 0;
while (level < topLevel && update[level + 1] == node)
@@ -178,13 +191,13 @@ void QMapData::dump()
update[i] = node->forward[i];
}
for (int j = level + 1; j <= topLevel; ++j)
- output[j] += "---------------";
+ output[j] += QString("---------------");
node = node->forward[0];
}
- qDebug(preOutput.ascii());
+ qDebug("%s", preOutput.ascii());
for (int i = 0; i <= topLevel; ++i)
- qDebug(output[i].ascii());
+ qDebug("%s", output[i].ascii());
}
#endif
@@ -902,7 +915,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 +1137,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/qmap.h b/src/corelib/tools/qmap.h
index 0215a78..bd9ba74 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -416,9 +416,29 @@ Q_INLINE_TEMPLATE typename QMapData::Node *
QMap<Key, T>::node_create(QMapData *adt, QMapData::Node *aupdate[], const Key &akey, const T &avalue)
{
QMapData::Node *abstractNode = adt->node_create(aupdate, payload());
- Node *concreteNode = concrete(abstractNode);
- new (&concreteNode->key) Key(akey);
- new (&concreteNode->value) T(avalue);
+ QT_TRY {
+ Node *concreteNode = concrete(abstractNode);
+ new (&concreteNode->key) Key(akey);
+ QT_TRY {
+ new (&concreteNode->value) T(avalue);
+ } QT_CATCH(...) {
+ concreteNode->key.~Key();
+ QT_RETHROW;
+ }
+ } QT_CATCH(...) {
+ adt->node_delete(aupdate, payload(), abstractNode);
+ QT_RETHROW;
+ }
+
+ // clean up the update array for further insertions
+ /*
+ for (int i = 0; i <= d->topLevel; ++i) {
+ if ( aupdate[i]==reinterpret_cast<QMapData::Node *>(adt) || aupdate[i]->forward[i] != abstractNode)
+ break;
+ aupdate[i] = abstractNode;
+ }
+*/
+
return abstractNode;
}
@@ -704,8 +724,13 @@ Q_OUTOFLINE_TEMPLATE void QMap<Key, T>::detach_helper()
QMapData::Node *cur = e->forward[0];
update[0] = x.e;
while (cur != e) {
- Node *concreteNode = concrete(cur);
- node_create(x.d, update, concreteNode->key, concreteNode->value);
+ QT_TRY {
+ Node *concreteNode = concrete(cur);
+ node_create(x.d, update, concreteNode->key, concreteNode->value);
+ } QT_CATCH(...) {
+ freeData(x.d);
+ QT_RETHROW;
+ }
cur = cur->forward[0];
}
x.d->insertInOrder = false;
diff --git a/src/corelib/tools/qpodlist_p.h b/src/corelib/tools/qpodlist_p.h
index 9708f8d..9e6d19b 100644
--- a/src/corelib/tools/qpodlist_p.h
+++ b/src/corelib/tools/qpodlist_p.h
@@ -53,9 +53,7 @@
// We mean it.
//
-#include <QtCore/qcontainerfwd.h>
-#include <QtCore/qglobal.h>
-#include <new>
+#include <QtCore/qvarlengtharray.h>
QT_BEGIN_HEADER
@@ -63,87 +61,29 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Core)
-template<class T, int Prealloc>
-class QPodList
+template <typename T, int Prealloc>
+class QPodList : public QVarLengthArray<T, Prealloc>
{
+ using QVarLengthArray<T, Prealloc>::s;
+ using QVarLengthArray<T, Prealloc>::a;
+ using QVarLengthArray<T, Prealloc>::ptr;
+ using QVarLengthArray<T, Prealloc>::realloc;
public:
- inline explicit QPodList(int size = 0);
+ inline explicit QPodList(int size = 0)
+ : QVarLengthArray<T, Prealloc>(size)
+ {}
- inline QPodList(const QPodList<T, Prealloc> &other)
- : a(Prealloc), s(0), ptr(reinterpret_cast<T *>(array))
+ inline void insert(int idx, const T &t)
{
- append(other.constData(), other.size());
- }
-
- inline ~QPodList() {
- if (ptr != reinterpret_cast<T *>(array))
- qFree(ptr);
- }
- inline QPodList<T, Prealloc> &operator=(const QPodList<T, Prealloc> &other)
- {
- if (this != &other) {
- clear();
- append(other.constData(), other.size());
- }
- return *this;
- }
-
- inline int size() const { return s; }
- inline int count() const { return s; }
- inline bool isEmpty() const { return (s == 0); }
- inline void resize(int size);
- inline void clear() { resize(0); }
-
- inline int capacity() const { return a; }
- inline void reserve(int size);
-
- inline T &operator[](int idx) {
- Q_ASSERT(idx >= 0 && idx < s);
- return ptr[idx];
- }
- inline const T &operator[](int idx) const {
- Q_ASSERT(idx >= 0 && idx < s);
- return ptr[idx];
- }
-
- inline const T &at(int idx) const {
- Q_ASSERT(idx >= 0 && idx < s);
- return ptr[idx];
- }
-
- inline const T &first() const {
- return at(0);
- }
-
- inline T& append() {
- const int idx = s++;
- if (s == a)
- realloc(s, s<<1);
- return ptr[idx];
- }
- inline void append(const T &t) {
- append() = t;
- }
-
- inline T& insert(int idx) {
- Q_ASSERT(idx >= 0 && idx <= s);
const int sz = s++;
if (s == a)
- realloc(s, s<<1);
+ realloc(s, s << 1);
::memmove(ptr + idx + 1, ptr + idx, (sz - idx) * sizeof(T));
- return ptr[idx];
- }
- inline void insert(int idx, const T &t) {
- insert(idx) = t;
+ ptr[idx] = t;
}
- inline void removeAt(int idx) {
- Q_ASSERT(idx >= 0 && idx < s);
- ::memmove(ptr + idx, ptr + idx + 1, (s - idx - 1) * sizeof(T));
- --s;
- }
-
- inline void removeAll(const T &t) {
+ inline void removeAll(const T &t)
+ {
int i = 0;
for (int j = 0; j < s; ++j) {
if (ptr[j] != t)
@@ -152,110 +92,22 @@ public:
s = i;
}
- inline int indexOf(const T &t, int from = 0) const {
- if (from < 0)
- from = qMax(from + s, 0);
- if (from < s) {
- const T *n = ptr + from - 1;
- const T *e = ptr + s;
- while (++n != e)
- if (*n == t)
- return n - ptr;
- }
- return -1;
- }
-
- inline bool contains(const T &t) const {
- return indexOf(t) >= 0;
+ inline void removeAt(int idx)
+ {
+ Q_ASSERT(idx >= 0 && idx < s);
+ ::memmove(ptr + idx, ptr + idx + 1, (s - idx - 1) * sizeof(T));
+ --s;
}
- inline T takeFirst() {
+ inline T takeFirst()
+ {
Q_ASSERT(s > 0);
T tmp = ptr[0];
removeAt(0);
return tmp;
}
-
- inline T *data() { return ptr; }
- inline const T *data() const { return ptr; }
- inline const T * constData() const { return ptr; }
-
-private:
- void append(const T *buf, int size);
- void realloc(int size, int alloc);
-
- int a;
- int s;
- T *ptr;
- union {
- // ### Qt 5: Use 'Prealloc * sizeof(T)' as array size
- char array[sizeof(qint64) * (((Prealloc * sizeof(T)) / sizeof(qint64)) + 1)];
- qint64 q_for_alignment_1;
- double q_for_alignment_2;
- };
};
-template <class T, int Prealloc>
-Q_INLINE_TEMPLATE QPodList<T, Prealloc>::QPodList(int asize)
- : s(asize) {
- if (s > Prealloc) {
- ptr = reinterpret_cast<T *>(qMalloc(s * sizeof(T)));
- a = s;
- } else {
- ptr = reinterpret_cast<T *>(array);
- a = Prealloc;
- }
-}
-
-template <class T, int Prealloc>
-Q_INLINE_TEMPLATE void QPodList<T, Prealloc>::resize(int asize)
-{ realloc(asize, qMax(asize, a)); }
-
-template <class T, int Prealloc>
-Q_INLINE_TEMPLATE void QPodList<T, Prealloc>::reserve(int asize)
-{ if (asize > a) realloc(s, asize); }
-
-template <class T, int Prealloc>
-Q_OUTOFLINE_TEMPLATE void QPodList<T, Prealloc>::append(const T *abuf, int asize)
-{
- Q_ASSERT(abuf);
- if (asize <= 0)
- return;
-
- const int idx = s;
- const int news = s + asize;
- if (news >= a)
- realloc(news, news<<1);
- else
- s = news;
-
- qMemCopy(&ptr[idx], abuf, asize * sizeof(T));
-}
-
-template <class T, int Prealloc>
-Q_OUTOFLINE_TEMPLATE void QPodList<T, Prealloc>::realloc(int asize, int aalloc)
-{
- Q_ASSERT(aalloc >= asize);
- T *oldPtr = ptr;
- int osize = s;
- s = asize;
-
- if (aalloc != a) {
- ptr = reinterpret_cast<T *>(qMalloc(aalloc * sizeof(T)));
- if (ptr) {
- a = aalloc;
- qMemCopy(ptr, oldPtr, osize * sizeof(T));
- } else {
- ptr = oldPtr;
- s = 0;
- asize = 0;
- }
- }
-
- if (oldPtr != reinterpret_cast<T *>(array) && oldPtr != ptr)
- qFree(oldPtr);
-}
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/tools/qrect.cpp b/src/corelib/tools/qrect.cpp
index 3930a0d..5602170 100644
--- a/src/corelib/tools/qrect.cpp
+++ b/src/corelib/tools/qrect.cpp
@@ -901,7 +901,7 @@ void QRect::moveCenter(const QPoint &p)
/*!
\fn bool QRect::contains(const QPoint &point, bool proper) const
- Returns true if the the given \a point is inside or on the edge of
+ Returns true if the given \a point is inside or on the edge of
the rectangle, otherwise returns false. If \a proper is true, this
function only returns true if the given \a point is \e inside the
rectangle (i.e., not on the edge).
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index e1c3921..f357956 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -1297,14 +1297,20 @@ void QRegExpMatchState::prepareForMatch(QRegExpEngine *eng)
int ns = eng->s.size(); // number of states
int ncap = eng->ncap;
#ifndef QT_NO_REGEXP_OPTIM
- slideTabSize = qMax(eng->minl + 1, 16);
+ int newSlideTabSize = qMax(eng->minl + 1, 16);
#else
- slideTabSize = 0;
+ int newSlideTabSize = 0;
#endif
int numCaptures = eng->numCaptures();
- capturedSize = 2 + 2 * numCaptures;
- bigArray = (int *)realloc(bigArray, ((3 + 4 * ncap) * ns + 4 * ncap + slideTabSize + capturedSize)*sizeof(int));
+ int newCapturedSize = 2 + 2 * numCaptures;
+ bigArray = (int *)realloc(bigArray, ((3 + 4 * ncap) * ns + 4 * ncap + newSlideTabSize + newCapturedSize)*sizeof(int));
+ Q_CHECK_PTR(bigArray);
+ // set all internal variables only _after_ bigArray is realloc'ed
+ // to prevent a broken regexp in oom case
+
+ slideTabSize = newSlideTabSize;
+ capturedSize = newCapturedSize;
inNextStack = bigArray;
memset(inNextStack, -1, ns * sizeof(int));
curStack = inNextStack + ns;
@@ -3281,10 +3287,15 @@ static void derefEngine(QRegExpEngine *eng, const QRegExpEngineKey &key)
#if !defined(QT_NO_REGEXP_OPTIM)
if (globalEngineCache()) {
QMutexLocker locker(mutex());
- globalEngineCache()->insert(key, eng, 4 + key.pattern.length() / 4);
- }
- else
+ QT_TRY {
+ globalEngineCache()->insert(key, eng, 4 + key.pattern.length() / 4);
+ } QT_CATCH(const std::bad_alloc &) {
+ // in case of an exception (e.g. oom), just delete the engine
+ delete eng;
+ }
+ } else {
delete eng;
+ }
#else
Q_UNUSED(key);
delete eng;
diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h
index 99c89f8..d4d0af7 100644
--- a/src/corelib/tools/qringbuffer_p.h
+++ b/src/corelib/tools/qringbuffer_p.h
@@ -208,6 +208,9 @@ public:
QByteArray tmp = buffers[0];
buffers.clear();
buffers << tmp;
+ //TODO merge this optimization ?
+ //buffers.erase(buffers.begin() + 1, buffers.end());
+ //>>>>>>> 08ae7ee1fb930e7d4b4039e2294cba69f9380964:src/corelib/tools/qringbuffer_p.h
if (buffers.at(0).size() != basicBlockSize)
buffers[0].resize(basicBlockSize);
}
diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp
new file mode 100644
index 0000000..6a1ffb6
--- /dev/null
+++ b/src/corelib/tools/qscopedpointer.cpp
@@ -0,0 +1,177 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+/*!
+ \class QScopedPointer
+ \brief The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon destruction.
+ \since 4.6
+ \reentrant
+ \ingroup misc
+
+ Managing heap allocated objects manually is hard and error prone, with the
+ common result that code leaks memory and is hard to maintain.
+ QScopedPointer is a small utility class that heavily simplifies this by
+ assigning stack-based memory ownership to heap allocations, more generally
+ called resource acquisition is initialization(RAII).
+
+ QScopedPointer guarantees that the object pointed to will get deleted when
+ the current scope dissapears, and it also has no way of releasing
+ ownership, hence clearly communicating the lifetime and ownership of the
+ object. These guarantees are convenient when reading the code.
+
+ Consider this function which does heap allocations, and have various exit points:
+
+ \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 0
+
+ It's encumbered by the manual delete calls. With QScopedPointer, the code
+ can be simplified to:
+
+ \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 1
+
+ The code the compiler generates for QScopedPointer is the same as when
+ writing it manually. Code that makes use of \a delete are candidates for
+ QScopedPointer usage(and if not, possibly another type of smart pointer
+ such as QSharedPointer). QScopedPointer intentionally has no copy
+ constructor or assignment operator, such that ownership and lifetime is
+ clearly communicated.
+
+ The const qualification on a regular C++ pointer can also be expressed with
+ a QScopedPointer:
+
+ \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 2
+
+ \note QScopedPointer does not work with arrays.
+
+ \sa QSharedPointer
+*/
+
+/*!
+ \fn QScopedPointer::QScopedPointer(T *p = 0)
+
+ Constructs this QScopedPointer instance and sets its pointer to \a p.
+*/
+
+/*!
+ \fn QScopedPointer::~QScopedPointer()
+
+ Destroys this QScopedPointer object. Delete the object its pointer points
+ to.
+*/
+
+/*!
+ \fn T *QScopedPointer::data() const
+
+ Returns the value of the pointer referenced by this object. QScopedPointer
+ still owns the object pointed to.
+*/
+
+/*!
+ \fn T &QScopedPointer::operator*() const
+
+ Provides access to the scoped pointer's object.
+
+ If the contained pointer is \c null, behavior is undefined.
+ \sa isNull()
+*/
+
+/*!
+ \fn T *QScopedPointer::operator->() const
+
+ Provides access to the scoped pointer's object.
+
+ If the contained pointer is \c null, behavior is undefined.
+
+ \sa isNull()
+*/
+
+/*!
+ \fn QScopedPointer::operator bool() const
+
+ Returns \c true if this object is not \c null. This function is suitable
+ for use in \tt if-constructs, like:
+
+ \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 3
+
+ \sa isNull()
+*/
+
+/*!
+ \fn bool QScopedPointer::operator==(const QScopedPointer<T> &other) const
+
+ Equality operator. Returns true if the scoped pointer \a other
+ is pointing to the same object as this pointer, otherwise returns false.
+*/
+
+
+/*!
+ \fn bool QScopedPointer::operator!=(const QScopedPointer<T> *other) const
+
+ Inequality operator. Returns true if the scoped pointer \a other
+ is not pointing to the same object as this pointer, otherwise returns false.
+*/
+
+/*!
+ \fn bool QScopedPointer::isNull() const
+
+ Returns \c true if this object is holding a pointer that is \c null.
+*/
+
+/*!
+ \fn void QScopedPointer::reset(T *other = 0)
+
+ Deletes the existing object it is pointing to if any, and sets its pointer to
+ \a other. QScopedPointer now owns \a other and will delete it in its
+ destructor.
+
+ If \a other is equal to the value returned by data(), behavior is
+ undefined.
+*/
+
+/*!
+ \fn T *QScopedPointer::take()
+
+ Returns the value of the pointer referenced by this object. The pointer of this
+ QScopedPointer object will be reset to \c null.
+*/
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h
new file mode 100644
index 0000000..fc8f9e2
--- /dev/null
+++ b/src/corelib/tools/qscopedpointer.h
@@ -0,0 +1,199 @@
+/****************************************************************************
+**
+** 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 QSCOPEDPOINTER_H
+#define QSCOPEDPOINTER_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+QT_MODULE(Core)
+
+template <typename T>
+class QScopedPointer
+{
+public:
+ explicit inline QScopedPointer(T *p = 0) : d(p)
+ {
+ }
+
+ inline ~QScopedPointer()
+ {
+ delete d;
+ }
+
+ inline T &operator*() const
+ {
+ return *d;
+ }
+
+ inline T *operator->() const
+ {
+ return d;
+ }
+
+ inline bool operator==(const QScopedPointer<T> &other) const
+ {
+ return d == other.d;
+ }
+
+ inline bool operator!=(const QScopedPointer<T> &other) const
+ {
+ return d != other.d;
+ }
+
+ inline operator bool() const
+ {
+ return d;
+ }
+
+ inline T *data() const
+ {
+ return d;
+ }
+
+ inline bool isNull() const
+ {
+ return !d;
+ }
+
+ inline void reset(T *other = 0)
+ {
+ T *oldD = d;
+ d = other;
+ delete oldD;
+ }
+
+ inline T *take()
+ {
+ T *oldD = d;
+ d = 0;
+ return oldD;
+ }
+
+protected:
+ T *d;
+
+private:
+ Q_DISABLE_COPY(QScopedPointer)
+};
+
+/* internal class - allows special handling for resetting and cleaning the pointer */
+template <typename T, typename CustomHandler>
+class QScopedCustomPointer : public QScopedPointer<T>
+{
+public:
+ inline QScopedCustomPointer(T *p = 0)
+ : QScopedPointer<T>(p)
+ {
+ }
+
+ inline ~QScopedCustomPointer()
+ {
+ T *oldD = this->d;
+ this->d = 0;
+ CustomHandler::cleanup(oldD);
+ }
+
+ inline void reset(T *other = 0)
+ {
+ CustomHandler::reset(this->d, other);
+ }
+
+ inline T *&data_ptr()
+ {
+ return this->d;
+ }
+};
+
+/* Internal helper class - a handler for QShared* classes, to be used in QScopedCustomPointer */
+template <typename T>
+class QScopedSharedPointerHandler
+{
+public:
+ static inline void cleanup(T *d)
+ {
+ if (d && !d->ref.deref())
+ delete d;
+ }
+
+ static inline void reset(T *&d, T *other)
+ {
+ T *oldD = d;
+ d = other;
+ cleanup(oldD);
+ }
+};
+
+/* Internal. This should really have been a typedef, but you can't have a templated typedef :)
+ This class is basically a scoped pointer pointing to a ref-counted object
+ */
+template <typename T>
+class QScopedSharedPointer : public QScopedCustomPointer<T, QScopedSharedPointerHandler<T> >
+{
+public:
+ inline QScopedSharedPointer(T *p = 0)
+ : QScopedCustomPointer<T, QScopedSharedPointerHandler<T> >(p)
+ {
+ }
+
+ inline void detach()
+ {
+ qAtomicDetach(this->d);
+ }
+
+ inline void assign(T *other)
+ {
+ if (this->d == other)
+ return;
+ if (other)
+ other->ref.ref();
+ T *oldD = this->d;
+ this->d = other;
+ QScopedSharedPointerHandler<T>::cleanup(oldD);
+ }
+};
+
+QT_END_NAMESPACE
+QT_END_HEADER
+
+#endif // QSCOPEDPOINTER_H
diff --git a/src/corelib/tools/qshareddata.cpp b/src/corelib/tools/qshareddata.cpp
index 2b879ea..03bc964 100644
--- a/src/corelib/tools/qshareddata.cpp
+++ b/src/corelib/tools/qshareddata.cpp
@@ -231,7 +231,7 @@ QT_BEGIN_NAMESPACE
In the member function documentation, \e{d pointer} always refers
to the internal pointer to the shared data object.
- \sa QSharedData, QExplicitlySharedDataPointer
+ \sa QSharedData, QExplicitlySharedDataPointer, QScopedPointer, QSharedPointer
*/
/*! \fn T& QSharedDataPointer::operator*()
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index c3a989e..dee06f0 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -102,13 +102,18 @@
except that it only detaches if
QExplicitlySharedDataPointer::detach() is explicitly called.
+ QScopedPointer simply holds a pointer to a heap allocated object and
+ deletes it in its destructor. This class is useful when an object needs to
+ be heap allocated and deleted, but no more. QScopedPointer is lightweight,
+ it makes no use of additional structure or reference counting.
+
Finally, QPointer holds a pointer to a QObject-derived object, but
it does so weakly. QPointer is similar, in that behaviour, to
QWeakPointer: it does not allow you to prevent the object from
being destroyed. All you can do is query whether it has been
destroyed or not.
- \sa QSharedDataPointer, QWeakPointer
+ \sa QSharedDataPointer, QWeakPointer, QScopedPointer
*/
/*!
@@ -130,7 +135,7 @@
must first create a QSharedPointer object and verify if the pointer
is null or not.
- \sa QSharedPointer
+ \sa QSharedPointer, QScopedPointer
*/
/*!
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index b8c3f3d..88b8b8c 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -244,6 +244,7 @@ namespace QtSharedPointer {
template <class X> friend class ExternalRefCount;
template <class X> friend class QWeakPointer;
template <class X, class Y> friend QSharedPointer<X> qSharedPointerCastHelper(const QSharedPointer<Y> &src, X *);
+ template <class X, class Y> friend QSharedPointer<X> qSharedPointerDynamicCastHelper(const QSharedPointer<Y> &src, X *);
template <class X, class Y> friend QSharedPointer<X> qSharedPointerConstCastHelper(const QSharedPointer<Y> &src, X *);
template <class X, class Y> friend QSharedPointer<X> QtSharedPointer::qStrongRefFromWeakHelper(const QWeakPointer<Y> &src, X *);
#endif
@@ -521,6 +522,14 @@ namespace QtSharedPointer {
return result;
}
template <class X, class T>
+ Q_INLINE_TEMPLATE QSharedPointer<X> qSharedPointerDynamicCastHelper(const QSharedPointer<T> &src, X *)
+ {
+ QSharedPointer<X> result;
+ register T *ptr = src.data();
+ result.internalSet(src.d, dynamic_cast<X *>(ptr));
+ return result;
+ }
+ template <class X, class T>
Q_INLINE_TEMPLATE QSharedPointer<X> qSharedPointerConstCastHelper(const QSharedPointer<T> &src, X *)
{
QSharedPointer<X> result;
@@ -556,9 +565,7 @@ template <class X, class T>
Q_INLINE_TEMPLATE QSharedPointer<X> qSharedPointerDynamicCast(const QSharedPointer<T> &src)
{
X *x = 0;
- if (QtSharedPointer::qVerifyDynamicCast(src.data(), x))
- return QtSharedPointer::qSharedPointerCastHelper(src, x);
- return QSharedPointer<X>();
+ return QtSharedPointer::qSharedPointerDynamicCastHelper(src, x);
}
template <class X, class T>
Q_INLINE_TEMPLATE QSharedPointer<X> qSharedPointerDynamicCast(const QWeakPointer<T> &src)
@@ -570,17 +577,13 @@ template <class X, class T>
Q_INLINE_TEMPLATE QSharedPointer<X> qSharedPointerConstCast(const QSharedPointer<T> &src)
{
X *x = 0;
- if (QtSharedPointer::qVerifyConstCast(src.data(), x))
- return QtSharedPointer::qSharedPointerConstCastHelper(src, x);
- return QSharedPointer<X>();
+ return QtSharedPointer::qSharedPointerConstCastHelper(src, x);
}
template <class X, class T>
Q_INLINE_TEMPLATE QSharedPointer<X> qSharedPointerConstCast(const QWeakPointer<T> &src)
{
X *x = 0;
- if (QtSharedPointer::qVerifyConstCast(src.data(), x))
- return QtSharedPointer::qSharedPointerCastHelper(src, x);
- return QSharedPointer<X>();
+ return QtSharedPointer::qSharedPointerConstCastHelper(src, x);
}
template <class X, class T>
diff --git a/src/corelib/tools/qsize.cpp b/src/corelib/tools/qsize.cpp
index 76a5484..bbf6c2a 100644
--- a/src/corelib/tools/qsize.cpp
+++ b/src/corelib/tools/qsize.cpp
@@ -781,7 +781,7 @@ void QSizeF::scale(const QSizeF &s, Qt::AspectRatioMode mode)
\fn QDataStream &operator<<(QDataStream &stream, const QSizeF &size)
\relates QSizeF
- Writes the the given \a size to the given \a stream and returns a
+ Writes the given \a size to the given \a stream and returns a
reference to the stream.
\sa {Format of the QDataStream Operators}
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index c3649e3..e61a568 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -846,6 +846,7 @@ QString::QString(const QChar *unicode, int size)
d->ref.ref();
} else {
d = (Data*) qMalloc(sizeof(Data)+size*sizeof(QChar));
+ Q_CHECK_PTR(d);
d->ref = 1;
d->alloc = d->size = size;
d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
@@ -869,6 +870,7 @@ QString::QString(int size, QChar ch)
d->ref.ref();
} else {
d = (Data*) qMalloc(sizeof(Data)+size*sizeof(QChar));
+ Q_CHECK_PTR(d);
d->ref = 1;
d->alloc = d->size = size;
d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
@@ -894,7 +896,9 @@ QString::QString(int size, QChar ch)
*/
QString::QString(QChar ch)
{
- d = (Data *)qMalloc(sizeof(Data) + sizeof(QChar));
+ void *buf = qMalloc(sizeof(Data) + sizeof(QChar));
+ Q_CHECK_PTR(buf);
+ d = reinterpret_cast<Data *>(buf);
d->ref = 1;
d->alloc = d->size = 1;
d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
@@ -1064,8 +1068,7 @@ void QString::realloc(int alloc)
{
if (d->ref != 1 || d->data != d->array) {
Data *x = static_cast<Data *>(qMalloc(sizeof(Data) + alloc * sizeof(QChar)));
- if (!x)
- return;
+ Q_CHECK_PTR(x);
x->size = qMin(alloc, d->size);
::memcpy(x->array, d->data, x->size * sizeof(QChar));
x->array[x->size] = 0;
@@ -1088,8 +1091,7 @@ void QString::realloc(int alloc)
}
#endif
Data *x = static_cast<Data *>(qRealloc(d, sizeof(Data) + alloc * sizeof(QChar)));
- if (!x)
- return;
+ Q_CHECK_PTR(x);
x->alloc = alloc;
x->data = x->array;
d = x;
@@ -1246,6 +1248,7 @@ QString& QString::insert(int i, const QChar *unicode, int size)
if (s >= d->data && s < d->data + d->alloc) {
// Part of me - take a copy
ushort *tmp = static_cast<ushort *>(qMalloc(size * sizeof(QChar)));
+ Q_CHECK_PTR(tmp);
memcpy(tmp, s, size * sizeof(QChar));
insert(i, reinterpret_cast<const QChar *>(tmp), size);
qFree(tmp);
@@ -1600,51 +1603,69 @@ QString &QString::replace(const QString &before, const QString &after, Qt::CaseS
*/
void QString::replace_helper(uint *indices, int nIndices, int blen, const QChar *after, int alen)
{
- if (blen == alen) {
- detach();
- for (int i = 0; i < nIndices; ++i)
- memcpy(d->data + indices[i], after, alen * sizeof(QChar));
- } else if (alen < blen) {
+ // copy *after in case it lies inside our own d->data area
+ // (which we could possibly invalidate via a realloc or corrupt via memcpy operations.)
+ QChar *afterBuffer = const_cast<QChar *>(after);
+ if (after >= reinterpret_cast<QChar *>(d->data) && after < reinterpret_cast<QChar *>(d->data) + d->size) {
+ afterBuffer = static_cast<QChar *>(qMalloc(alen*sizeof(QChar)));
+ Q_CHECK_PTR(afterBuffer);
+ ::memcpy(afterBuffer, after, alen*sizeof(QChar));
+ }
+
+ QT_TRY {
detach();
- uint to = indices[0];
- if (alen)
- memcpy(d->data+to, after, alen*sizeof(QChar));
- to += alen;
- uint movestart = indices[0] + blen;
- for (int i = 1; i < nIndices; ++i) {
- int msize = indices[i] - movestart;
- if (msize > 0) {
- memmove(d->data + to, d->data + movestart, msize * sizeof(QChar));
- to += msize;
+ if (blen == alen) {
+ // replace in place
+ for (int i = 0; i < nIndices; ++i)
+ memcpy(d->data + indices[i], afterBuffer, alen * sizeof(QChar));
+ } else if (alen < blen) {
+ // replace from front
+ uint to = indices[0];
+ if (alen)
+ memcpy(d->data+to, after, alen*sizeof(QChar));
+ to += alen;
+ uint movestart = indices[0] + blen;
+ for (int i = 1; i < nIndices; ++i) {
+ int msize = indices[i] - movestart;
+ if (msize > 0) {
+ memmove(d->data + to, d->data + movestart, msize * sizeof(QChar));
+ to += msize;
+ }
+ if (alen) {
+ memcpy(d->data + to, afterBuffer, alen*sizeof(QChar));
+ to += alen;
+ }
+ movestart = indices[i] + blen;
}
- if (alen) {
- memcpy(d->data + to, after, alen*sizeof(QChar));
- to += alen;
+ int msize = d->size - movestart;
+ if (msize > 0)
+ memmove(d->data + to, d->data + movestart, msize * sizeof(QChar));
+ resize(d->size - nIndices*(blen-alen));
+ } else {
+ // replace from back
+ int adjust = nIndices*(alen-blen);
+ int newLen = d->size + adjust;
+ int moveend = d->size;
+ resize(newLen);
+
+ while (nIndices) {
+ --nIndices;
+ int movestart = indices[nIndices] + blen;
+ int insertstart = indices[nIndices] + nIndices*(alen-blen);
+ int moveto = insertstart + alen;
+ memmove(d->data + moveto, d->data + movestart,
+ (moveend - movestart)*sizeof(QChar));
+ memcpy(d->data + insertstart, afterBuffer, alen*sizeof(QChar));
+ moveend = movestart-blen;
}
- movestart = indices[i] + blen;
- }
- int msize = d->size - movestart;
- if (msize > 0)
- memmove(d->data + to, d->data + movestart, msize * sizeof(QChar));
- resize(d->size - nIndices*(blen-alen));
- } else {
- // we have a table of replacement positions, use them for fast replacing
- int adjust = nIndices*(alen-blen);
- int newLen = d->size + adjust;
- int moveend = d->size;
- resize(newLen);
-
- while (nIndices) {
- --nIndices;
- int movestart = indices[nIndices] + blen;
- int insertstart = indices[nIndices] + nIndices*(alen-blen);
- int moveto = insertstart + alen;
- memmove(d->data + moveto, d->data + movestart,
- (moveend - movestart)*sizeof(QChar));
- memcpy(d->data + insertstart, after, alen*sizeof(QChar));
- moveend = movestart-blen;
}
+ } QT_CATCH(const std::bad_alloc &) {
+ if (afterBuffer != after)
+ qFree(afterBuffer);
+ QT_RETHROW;
}
+ if (afterBuffer != after)
+ qFree(afterBuffer);
}
/*!
@@ -1672,21 +1693,7 @@ QString &QString::replace(const QChar *before, int blen,
if (alen == 0 && blen == 0)
return *this;
- // protect against before or after being part of this
- const QChar *a = after;
- const QChar *b = before;
- if (after >= (const QChar *)d->data && after < (const QChar *)d->data + d->size) {
- QChar *copy = (QChar *)malloc(alen*sizeof(QChar));
- memcpy(copy, after, alen*sizeof(QChar));
- a = copy;
- }
- if (before >= (const QChar *)d->data && before < (const QChar *)d->data + d->size) {
- QChar *copy = (QChar *)malloc(blen*sizeof(QChar));
- memcpy(copy, before, blen*sizeof(QChar));
- b = copy;
- }
-
- QStringMatcher matcher(b, blen, cs);
+ QStringMatcher matcher(before, blen, cs);
int index = 0;
while (1) {
@@ -1705,7 +1712,7 @@ QString &QString::replace(const QChar *before, int blen,
if (!pos)
break;
- replace_helper(indices, pos, blen, a, alen);
+ replace_helper(indices, pos, blen, after, alen);
if (index == -1)
break;
@@ -1713,11 +1720,6 @@ QString &QString::replace(const QChar *before, int blen,
index += pos*(alen-blen);
}
- if (a != after)
- ::free((QChar *)a);
- if (b != before)
- ::free((QChar *)b);
-
return *this;
}
@@ -3450,6 +3452,7 @@ QString::Data *QString::fromLatin1_helper(const char *str, int size)
if (size < 0)
size = qstrlen(str);
d = static_cast<Data *>(qMalloc(sizeof(Data) + size * sizeof(QChar)));
+ Q_CHECK_PTR(d);
d->ref = 1;
d->alloc = d->size = size;
d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
@@ -3457,7 +3460,7 @@ QString::Data *QString::fromLatin1_helper(const char *str, int size)
ushort *i = d->data;
d->array[size] = '\0';
while (size--)
- *i++ = (uchar)*str++;
+ *i++ = (uchar)*str++;
}
return d;
}
@@ -6867,6 +6870,7 @@ void QString::updateProperties() const
QString QString::fromRawData(const QChar *unicode, int size)
{
Data *x = static_cast<Data *>(qMalloc(sizeof(Data)));
+ Q_CHECK_PTR(x);
if (unicode) {
x->data = (ushort *)unicode;
} else {
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index 386321f1..cf1bff8 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -397,7 +397,7 @@ void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QRegExp &r
\fn QString QStringList::join(const QString &separator) const
Joins all the string list's strings into a single string with each
- element separated by the the given \a separator (which can be an
+ element separated by the given \a separator (which can be an
empty string).
\sa QString::split()
@@ -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/qtextboundaryfinder.cpp b/src/corelib/tools/qtextboundaryfinder.cpp
index 8a8e95b..5ca6a11 100644
--- a/src/corelib/tools/qtextboundaryfinder.cpp
+++ b/src/corelib/tools/qtextboundaryfinder.cpp
@@ -176,6 +176,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(const QTextBoundaryFinder &other)
, freePrivate(true)
{
d = (QTextBoundaryFinderPrivate *) malloc(length*sizeof(HB_CharAttributes));
+ Q_CHECK_PTR(d);
memcpy(d, other.d, length*sizeof(HB_CharAttributes));
}
@@ -193,8 +194,11 @@ QTextBoundaryFinder &QTextBoundaryFinder::operator=(const QTextBoundaryFinder &o
length = other.length;
pos = other.pos;
freePrivate = true;
-
- d = (QTextBoundaryFinderPrivate *) realloc(d, length*sizeof(HB_CharAttributes));
+
+ QTextBoundaryFinderPrivate *newD = (QTextBoundaryFinderPrivate *)
+ realloc(d, length*sizeof(HB_CharAttributes));
+ Q_CHECK_PTR(newD);
+ d = newD;
memcpy(d, other.d, length*sizeof(HB_CharAttributes));
return *this;
@@ -221,6 +225,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(BoundaryType type, const QString &strin
, freePrivate(true)
{
d = (QTextBoundaryFinderPrivate *) malloc(length*sizeof(HB_CharAttributes));
+ Q_CHECK_PTR(d);
init(t, chars, length, d->attributes);
}
@@ -248,6 +253,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(BoundaryType type, const QChar *chars,
freePrivate = false;
} else {
d = (QTextBoundaryFinderPrivate *) malloc(length*sizeof(HB_CharAttributes));
+ Q_CHECK_PTR(d);
freePrivate = true;
}
init(t, chars, length, d->attributes);
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index e2f60ed..b41240e 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -52,6 +52,9 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Core)
+template<class T, int Prealloc>
+class QPodList;
+
// Prealloc = 256 by default, specified in qcontainerfwd.h
template<class T, int Prealloc>
class QVarLengthArray
@@ -122,6 +125,7 @@ public:
inline const T * constData() const { return ptr; }
private:
+ friend class QPodList<T, Prealloc>;
void realloc(int size, int alloc);
int a;
@@ -140,6 +144,7 @@ Q_INLINE_TEMPLATE QVarLengthArray<T, Prealloc>::QVarLengthArray(int asize)
: s(asize) {
if (s > Prealloc) {
ptr = reinterpret_cast<T *>(qMalloc(s * sizeof(T)));
+ Q_CHECK_PTR(ptr);
a = s;
} else {
ptr = reinterpret_cast<T *>(array);
@@ -161,25 +166,24 @@ Q_INLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::reserve(int asize)
{ if (asize > a) realloc(s, asize); }
template <class T, int Prealloc>
-Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::append(const T *abuf, int asize)
+Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::append(const T *abuf, int increment)
{
Q_ASSERT(abuf);
- if (asize <= 0)
+ if (increment <= 0)
return;
- const int idx = s;
- const int news = s + asize;
- if (news >= a)
- realloc(s, qMax(s<<1, news));
- s = news;
+ const int asize = s + increment;
+
+ if (asize >= a)
+ realloc(s, qMax(s*2, asize));
if (QTypeInfo<T>::isComplex) {
- T *i = ptr + idx;
- T *j = i + asize;
- while (i < j)
- new (i++) T(*abuf++);
+ // call constructor for new objects (which can throw)
+ while (s < asize)
+ new (ptr+(s++)) T(*abuf++);
} else {
- qMemCopy(&ptr[idx], abuf, asize * sizeof(T));
+ qMemCopy(&ptr[s], abuf, increment * sizeof(T));
+ s = asize;
}
}
@@ -189,46 +193,58 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
Q_ASSERT(aalloc >= asize);
T *oldPtr = ptr;
int osize = s;
- s = asize;
+ // s = asize;
if (aalloc != a) {
ptr = reinterpret_cast<T *>(qMalloc(aalloc * sizeof(T)));
+ Q_CHECK_PTR(ptr);
if (ptr) {
+ s = 0;
a = aalloc;
if (QTypeInfo<T>::isStatic) {
- T *i = ptr + osize;
- T *j = oldPtr + osize;
- while (i != ptr) {
- new (--i) T(*--j);
- j->~T();
+ QT_TRY {
+ while (s < asize) {
+ new (ptr+s) T(*(oldPtr+s));
+ (oldPtr+s)->~T();
+ s++;
+ }
+ } QT_CATCH(...) {
+ // clean up all the old objects and then free the old ptr
+ int sClean = s;
+ while (sClean < osize)
+ (oldPtr+(sClean++))->~T();
+ if (oldPtr != reinterpret_cast<T *>(array) && oldPtr != ptr)
+ qFree(oldPtr);
+ QT_RETHROW;
}
} else {
- qMemCopy(ptr, oldPtr, osize * sizeof(T));
+ qMemCopy(ptr, oldPtr, qMin(asize, osize) * sizeof(T));
+ s = asize;
}
} else {
ptr = oldPtr;
- s = 0;
- asize = 0;
+ return;
}
}
if (QTypeInfo<T>::isComplex) {
- if (asize < osize) {
- T *i = oldPtr + osize;
- T *j = oldPtr + asize;
- while (i-- != j)
- i->~T();
- } else {
- T *i = ptr + asize;
- T *j = ptr + osize;
- while (i != j)
- new (--i) T;
- }
+ while (osize > asize)
+ (oldPtr+(--osize))->~T();
+ if( oldPtr == ptr )
+ s = osize;
}
if (oldPtr != reinterpret_cast<T *>(array) && oldPtr != ptr)
qFree(oldPtr);
+
+ if (QTypeInfo<T>::isComplex) {
+ // call default constructor for new objects (which can throw)
+ while (s < asize)
+ new (ptr+(s++)) T;
+ } else {
+ s = asize;
+ }
}
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp
index 6b26b2e..04e9ace 100644
--- a/src/corelib/tools/qvector.cpp
+++ b/src/corelib/tools/qvector.cpp
@@ -50,6 +50,7 @@ QVectorData QVectorData::shared_null = { Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, tr
QVectorData *QVectorData::malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init)
{
QVectorData* p = (QVectorData *)qMalloc(sizeofTypedData + (size - 1) * sizeofT);
+ Q_CHECK_PTR(p);
::memcpy(p, init, sizeofTypedData + (qMin(size, init->alloc) - 1) * sizeofT);
return p;
}
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 1f047b8..610b8e7 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -77,6 +77,7 @@ struct Q_CORE_EXPORT QVectorData
static QVectorData shared_null;
// ### Qt 5: rename to 'allocate()'. The current name causes problems for
// some debugges when the QVector is member of a class within an unnamed namespace.
+ // ### Qt 5: can be removed completely. (Ralf)
static QVectorData *malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init);
static int grow(int sizeofTypedData, int size, int sizeofT, bool excessive);
};
@@ -379,7 +380,9 @@ QVector<T> &QVector<T>::operator=(const QVector<T> &v)
template <typename T>
inline QVectorData *QVector<T>::malloc(int aalloc)
{
- return static_cast<QVectorData *>(qMalloc(sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
+ QVectorData *data = static_cast<QVectorData *>(qMalloc(sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
+ Q_CHECK_PTR(data);
+ return data;
}
template <typename T>
@@ -428,74 +431,79 @@ void QVector<T>::free(Data *x)
template <typename T>
void QVector<T>::realloc(int asize, int aalloc)
{
- T *j, *i, *b;
+ T *pOld;
+ T *pNew;
union { QVectorData *p; Data *d; } x;
x.d = d;
- if (QTypeInfo<T>::isComplex && aalloc == d->alloc && d->ref == 1) {
- // pure resize
- i = d->array + d->size;
- j = d->array + asize;
- if (i > j) {
- while (i-- != j)
- i->~T();
- } else {
- while (j-- != i)
- new (j) T;
+ if (QTypeInfo<T>::isComplex && asize < d->size && d->ref == 1 ) {
+ // call the destructor on all objects that need to be
+ // destroyed when shrinking
+ pOld = d->array + d->size;
+ pNew = d->array + asize;
+ while (asize < d->size) {
+ (--pOld)->~T();
+ d->size--;
}
- d->size = asize;
- return;
}
if (aalloc != d->alloc || d->ref != 1) {
// (re)allocate memory
if (QTypeInfo<T>::isStatic) {
x.p = malloc(aalloc);
+ Q_CHECK_PTR(x.p);
+ x.d->size = 0;
} else if (d->ref != 1) {
- x.p = QVectorData::malloc(sizeOfTypedData(), aalloc, sizeof(T), p);
- } else {
+ x.p = malloc(aalloc);
+ Q_CHECK_PTR(x.p);
if (QTypeInfo<T>::isComplex) {
- // call the destructor on all objects that need to be
- // destroyed when shrinking
- if (asize < d->size) {
- j = d->array + asize;
- i = d->array + d->size;
- while (i-- != j)
- i->~T();
- i = d->array + asize;
- }
+ x.d->size = 0;
+ } else {
+ ::memcpy(x.p, p, sizeOfTypedData() + (qMin(aalloc, p->alloc) - 1) * sizeof(T));
+ x.d->size = d->size;
+ }
+ } else {
+ QT_TRY {
+ QVectorData *mem = static_cast<QVectorData *>(qRealloc(p, sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
+ Q_CHECK_PTR(mem);
+ x.p = p = mem;
+ x.d->size = d->size;
+ } QT_CATCH (const std::bad_alloc &) {
+ if (aalloc > d->alloc) // ignore the error in case we are just shrinking.
+ QT_RETHROW;
}
- x.p = p = static_cast<QVectorData *>(qRealloc(p, sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
}
x.d->ref = 1;
+ x.d->alloc = aalloc;
x.d->sharable = true;
x.d->capacity = d->capacity;
-
}
+
if (QTypeInfo<T>::isComplex) {
- if (asize < d->size) {
- j = d->array + asize;
- i = x.d->array + asize;
- } else {
- // construct all new objects when growing
- i = x.d->array + asize;
- j = x.d->array + d->size;
- while (i != j)
- new (--i) T;
- j = d->array + d->size;
- }
- if (i != j) {
+ QT_TRY {
+ pOld = d->array + x.d->size;
+ pNew = x.d->array + x.d->size;
// copy objects from the old array into the new array
- b = x.d->array;
- while (i != b)
- new (--i) T(*--j);
+ while (x.d->size < qMin(asize, d->size)) {
+ new (pNew++) T(*pOld++);
+ x.d->size++;
+ }
+ // construct all new objects when growing
+ while (x.d->size < asize) {
+ new (pNew++) T;
+ x.d->size++;
+ }
+ } QT_CATCH (...) {
+ free(x.d);
+ QT_RETHROW;
}
- } else if (asize > d->size) {
+
+ } else if (asize > x.d->size) {
// initialize newly allocated memory to 0
- qMemSet(x.d->array + d->size, 0, (asize - d->size) * sizeof(T));
+ qMemSet(x.d->array + x.d->size, 0, (asize - x.d->size) * sizeof(T));
}
x.d->size = asize;
- x.d->alloc = aalloc;
+
if (d != x.d) {
if (!d->ref.deref())
free(d);
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 45e92bf..8d27100 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -36,7 +36,8 @@ HEADERS += \
tools/qtimeline.h \
tools/qunicodetables_p.h \
tools/qvarlengtharray.h \
- tools/qvector.h
+ tools/qvector.h \
+ tools/qscopedpointer.h
SOURCES += \
@@ -65,6 +66,7 @@ SOURCES += \
tools/qvector.cpp \
tools/qvsnprintf.cpp
+symbian:SOURCES+=tools/qlocale_symbian.cpp
#zlib support
contains(QT_CONFIG, zlib) {
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index ff1a01f..6fe6ebf 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -429,7 +429,6 @@ QXmlStreamReader::~QXmlStreamReader()
Q_D(QXmlStreamReader);
if (d->deleteDevice)
delete d->device;
- delete d;
}
/*! \fn bool QXmlStreamReader::hasError() const
@@ -819,7 +818,9 @@ inline void QXmlStreamReaderPrivate::reallocateStack()
{
stack_size <<= 1;
sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
+ Q_CHECK_PTR(sym_stack);
state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
+ Q_CHECK_PTR(sym_stack);
}
@@ -3131,8 +3132,6 @@ QXmlStreamWriter::QXmlStreamWriter(QString *string)
*/
QXmlStreamWriter::~QXmlStreamWriter()
{
- Q_D(QXmlStreamWriter);
- delete d;
}
diff --git a/src/corelib/xml/qxmlstream.h b/src/corelib/xml/qxmlstream.h
index 2ba7972..6903d56 100644
--- a/src/corelib/xml/qxmlstream.h
+++ b/src/corelib/xml/qxmlstream.h
@@ -48,6 +48,7 @@
#include <QtCore/QString>
#include <QtCore/QVector>
+#include <QtCore/QScopedPointer>
QT_BEGIN_HEADER
@@ -392,7 +393,7 @@ public:
private:
Q_DISABLE_COPY(QXmlStreamReader)
Q_DECLARE_PRIVATE(QXmlStreamReader)
- QXmlStreamReaderPrivate *d_ptr;
+ QScopedPointer<QXmlStreamReaderPrivate> d_ptr;
};
#endif // QT_NO_XMLSTREAMREADER
@@ -465,7 +466,7 @@ public:
private:
Q_DISABLE_COPY(QXmlStreamWriter)
Q_DECLARE_PRIVATE(QXmlStreamWriter)
- QXmlStreamWriterPrivate *d_ptr;
+ QScopedPointer<QXmlStreamWriterPrivate> d_ptr;
};
#endif // QT_NO_XMLSTREAMWRITER
diff --git a/src/dbus/qdbusabstractadaptor.cpp b/src/dbus/qdbusabstractadaptor.cpp
index 883aabf..350f1aa 100644
--- a/src/dbus/qdbusabstractadaptor.cpp
+++ b/src/dbus/qdbusabstractadaptor.cpp
@@ -264,7 +264,7 @@ void QDBusAdaptorConnector::polish()
void QDBusAdaptorConnector::relaySlot(void **argv)
{
- QObjectPrivate *d = static_cast<QObjectPrivate *>(d_ptr);
+ QObjectPrivate *d = static_cast<QObjectPrivate *>(d_ptr.data());
relay(d->currentSender->sender, d->currentSender->signal, argv);
}
diff --git a/src/dbus/qdbuscontext.h b/src/dbus/qdbuscontext.h
index 3d043cf..6ece5b6 100644
--- a/src/dbus/qdbuscontext.h
+++ b/src/dbus/qdbuscontext.h
@@ -74,7 +74,7 @@ public:
private:
QDBusContextPrivate *d_ptr;
- Q_DECLARE_PRIVATE(QDBusContext)
+ friend class QDBusContextPrivate;
};
QT_END_NAMESPACE
diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp
index 19f0b04..96dcd3b 100644
--- a/src/dbus/qdbusmessage.cpp
+++ b/src/dbus/qdbusmessage.cpp
@@ -161,7 +161,6 @@ DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message)
// not ok;
q_dbus_message_unref(msg);
- Q_ASSERT(false);
return 0;
}
diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri
index 92347a7..b9fad41 100644
--- a/src/gui/dialogs/dialogs.pri
+++ b/src/gui/dialogs/dialogs.pri
@@ -7,6 +7,7 @@ HEADERS += \
dialogs/qabstractpagesetupdialog_p.h \
dialogs/qcolordialog.h \
dialogs/qcolordialog_p.h \
+ dialogs/qfscompleter_p.h \
dialogs/qdialog.h \
dialogs/qdialog_p.h \
dialogs/qerrormessage.h \
diff --git a/src/gui/dialogs/qcolordialog.cpp b/src/gui/dialogs/qcolordialog.cpp
index 3aa04f6..4702d14 100644
--- a/src/gui/dialogs/qcolordialog.cpp
+++ b/src/gui/dialogs/qcolordialog.cpp
@@ -1749,7 +1749,7 @@ void QColorDialog::setVisible(bool visible)
\overload
\since 4.5
- Opens the dialog and connects its accepted() signal to the slot specified
+ Opens the dialog and connects its colorSelected() signal to the slot specified
by \a receiver and \a member.
The signal will be disconnected from the slot when the dialog is closed.
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index ef562f4..cecbb87 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -296,9 +296,13 @@ QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f)
QDialog::~QDialog()
{
- // Need to hide() here, as our (to-be) overridden hide()
- // will not be called in ~QWidget.
- hide();
+ QT_TRY {
+ // Need to hide() here, as our (to-be) overridden hide()
+ // will not be called in ~QWidget.
+ hide();
+ } QT_CATCH(...) {
+ // we're in the destructor - just swallow the exception
+ }
}
/*!
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index 789b364..9768162 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -356,7 +356,6 @@ QFileDialog::~QFileDialog()
settings.beginGroup(QLatin1String("Qt"));
settings.setValue(QLatin1String("filedialog"), saveState());
#endif
- delete d->qFileDialogUi;
d->deleteNativeDialog_sys();
}
@@ -488,6 +487,38 @@ void QFileDialog::changeEvent(QEvent *e)
QDialog::changeEvent(e);
}
+QFileDialogPrivate::QFileDialogPrivate()
+ :
+#ifndef QT_NO_PROXYMODEL
+ proxyModel(0),
+#endif
+ model(0),
+ fileMode(QFileDialog::AnyFile),
+ acceptMode(QFileDialog::AcceptOpen),
+ currentHistoryLocation(-1),
+ renameAction(0),
+ deleteAction(0),
+ showHiddenAction(0),
+ useDefaultCaption(true),
+ defaultFileTypes(true),
+ fileNameLabelExplicitlySat(false),
+ nativeDialogInUse(false),
+#ifdef Q_WS_MAC
+ mDelegate(0),
+#ifndef QT_MAC_USE_COCOA
+ mDialog(0),
+ mDialogStarted(false),
+ mDialogClosed(true),
+#endif
+#endif
+ qFileDialogUi(0)
+{
+}
+
+QFileDialogPrivate::~QFileDialogPrivate()
+{
+}
+
void QFileDialogPrivate::retranslateWindowTitle()
{
Q_Q(QFileDialog);
@@ -568,8 +599,9 @@ bool QFileDialogPrivate::canBeNativeDialog()
}
/*!
- Sets the given \a option to be enabled if \a on is true;
- otherwise, clears the given \a option.
+ \since 4.5
+ Sets the given \a option to be enabled if \a on is true; otherwise,
+ clears the given \a option.
\sa options, testOption()
*/
@@ -640,8 +672,9 @@ QFileDialog::Options QFileDialog::options() const
\since 4.5
- Opens the dialog and connects its accepted() signal to the slot specified
- by \a receiver and \a member.
+ This function connects one of its signals to the slot specified by \a receiver
+ and \a member. The specific signal depends is filesSelected() if fileMode is
+ ExistingFiles and fileSelected() if fileMode is anything else.
The signal will be disconnected from the slot when the dialog is closed.
*/
@@ -779,6 +812,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;
@@ -793,13 +827,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);
}
/**
@@ -2110,6 +2144,7 @@ void QFileDialogPrivate::createWidgets()
#else
model->setNameFilterDisables(false);
#endif
+ model->d_func()->disableRecursiveSort = true;
QFileDialog::connect(model, SIGNAL(fileRenamed(const QString &, const QString &, const QString &)), q, SLOT(_q_fileRenamed(const QString &, const QString &, const QString &)));
QFileDialog::connect(model, SIGNAL(rootPathChanged(const QString &)),
q, SLOT(_q_pathChanged(const QString &)));
@@ -2117,7 +2152,7 @@ void QFileDialogPrivate::createWidgets()
q, SLOT(_q_rowsInserted(const QModelIndex &)));
model->setReadOnly(false);
- qFileDialogUi = new Ui_QFileDialog();
+ qFileDialogUi.reset(new Ui_QFileDialog());
qFileDialogUi->setupUi(q);
QList<QUrl> initialBookmarks;
@@ -2143,7 +2178,7 @@ void QFileDialogPrivate::createWidgets()
qFileDialogUi->fileNameLabel->setBuddy(qFileDialogUi->fileNameEdit);
#endif
#ifndef QT_NO_COMPLETER
- completer = new QFSCompletor(model, q);
+ completer = new QFSCompleter(model, q);
qFileDialogUi->fileNameEdit->setCompleter(completer);
QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)),
q, SLOT(_q_autoCompleteFileName(QString)));
@@ -2201,9 +2236,9 @@ void QFileDialogPrivate::createWidgets()
treeHeader->addAction(showHeader);
}
- QItemSelectionModel *selModel = qFileDialogUi->treeView->selectionModel();
+ QScopedPointer<QItemSelectionModel> selModel(qFileDialogUi->treeView->selectionModel());
qFileDialogUi->treeView->setSelectionModel(qFileDialogUi->listView->selectionModel());
- delete selModel;
+
QObject::connect(qFileDialogUi->treeView, SIGNAL(activated(QModelIndex)),
q, SLOT(_q_enterDirectory(QModelIndex)));
QObject::connect(qFileDialogUi->treeView, SIGNAL(customContextMenuRequested(QPoint)),
@@ -2285,9 +2320,9 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel)
connect(d->model, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
this, SLOT(_q_rowsInserted(const QModelIndex &)));
}
- QItemSelectionModel *selModel = d->qFileDialogUi->treeView->selectionModel();
+ QScopedPointer<QItemSelectionModel> selModel(d->qFileDialogUi->treeView->selectionModel());
d->qFileDialogUi->treeView->setSelectionModel(d->qFileDialogUi->listView->selectionModel());
- delete selModel;
+
d->setRootIndex(idx);
// reconnect selection
@@ -3168,7 +3203,7 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e)
#ifndef QT_NO_COMPLETER
-QString QFSCompletor::pathFromIndex(const QModelIndex &index) const
+QString QFSCompleter::pathFromIndex(const QModelIndex &index) const
{
const QFileSystemModel *dirModel;
if (proxyModel)
@@ -3183,7 +3218,7 @@ QString QFSCompletor::pathFromIndex(const QModelIndex &index) const
return index.data(QFileSystemModel::FilePathRole).toString();
}
-QStringList QFSCompletor::splitPath(const QString &path) const
+QStringList QFSCompleter::splitPath(const QString &path) const
{
if (path.isEmpty())
return QStringList(completionPrefix());
diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h
index de7e332..3195583 100644
--- a/src/gui/dialogs/qfiledialog_p.h
+++ b/src/gui/dialogs/qfiledialog_p.h
@@ -76,6 +76,7 @@
#include <qtimeline.h>
#include <qdebug.h>
#include "qsidebar_p.h"
+#include "qfscompleter_p.h"
#if defined (Q_OS_UNIX)
#include <unistd.h>
@@ -91,25 +92,6 @@ class QCompleter;
class QHBoxLayout;
class Ui_QFileDialog;
-#ifndef QT_NO_COMPLETER
-/*!
- QCompleter that can deal with QFileSystemModel
- */
-class QFSCompletor : public QCompleter {
-public:
- QFSCompletor(QFileSystemModel *model, QObject *parent = 0) : QCompleter(model, parent), proxyModel(0), sourceModel(model)
- {
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
- setCaseSensitivity(Qt::CaseInsensitive);
-#endif
- }
- QString pathFromIndex(const QModelIndex &index) const;
- QStringList splitPath(const QString& path) const;
-
- QAbstractProxyModel *proxyModel;
- QFileSystemModel *sourceModel;
-};
-#endif // QT_NO_COMPLETER
struct QFileDialogArgs
{
@@ -131,31 +113,7 @@ class Q_AUTOTEST_EXPORT QFileDialogPrivate : public QDialogPrivate
Q_DECLARE_PUBLIC(QFileDialog)
public:
- QFileDialogPrivate() :
-#ifndef QT_NO_PROXYMODEL
- proxyModel(0),
-#endif
- model(0),
- fileMode(QFileDialog::AnyFile),
- acceptMode(QFileDialog::AcceptOpen),
- currentHistoryLocation(-1),
- renameAction(0),
- deleteAction(0),
- showHiddenAction(0),
- useDefaultCaption(true),
- defaultFileTypes(true),
- fileNameLabelExplicitlySat(false),
- nativeDialogInUse(false),
-#ifdef Q_WS_MAC
- mDelegate(0),
-#ifndef QT_MAC_USE_COCOA
- mDialog(0),
- mDialogStarted(false),
- mDialogClosed(true),
-#endif
-#endif
- qFileDialogUi(0)
- {}
+ QFileDialogPrivate();
void createToolButtons();
void createMenuActions();
@@ -275,7 +233,7 @@ public:
// data
QStringList watching;
QFileSystemModel *model;
- QFSCompletor *completer;
+ QFSCompleter *completer;
QFileDialog::FileMode fileMode;
QFileDialog::AcceptMode acceptMode;
@@ -357,7 +315,7 @@ public:
void mac_nativeDialogModalHelp();
#endif
- Ui_QFileDialog *qFileDialogUi;
+ QScopedPointer<Ui_QFileDialog> qFileDialogUi;
QString acceptLabel;
@@ -366,6 +324,11 @@ public:
QByteArray signalToDisconnectOnClose;
QFileDialog::Options opts;
+
+ ~QFileDialogPrivate();
+
+private:
+ Q_DISABLE_COPY(QFileDialogPrivate)
};
class QFileDialogLineEdit : public QLineEdit
diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp
index a2abe54..119164d 100644
--- a/src/gui/dialogs/qfileinfogatherer.cpp
+++ b/src/gui/dialogs/qfileinfogatherer.cpp
@@ -83,10 +83,10 @@ QFileInfoGatherer::QFileInfoGatherer(QObject *parent)
*/
QFileInfoGatherer::~QFileInfoGatherer()
{
- mutex.lock();
+ QMutexLocker locker(&mutex);
abort = true;
condition.wakeOne();
- mutex.unlock();
+ locker.unlock();
wait();
}
@@ -94,9 +94,8 @@ void QFileInfoGatherer::setResolveSymlinks(bool enable)
{
Q_UNUSED(enable);
#ifdef Q_OS_WIN
- mutex.lock();
+ QMutexLocker locker(&mutex);
m_resolveSymlinks = enable;
- mutex.unlock();
#endif
}
@@ -107,9 +106,8 @@ bool QFileInfoGatherer::resolveSymlinks() const
void QFileInfoGatherer::setIconProvider(QFileIconProvider *provider)
{
- mutex.lock();
+ QMutexLocker locker(&mutex);
m_iconProvider = provider;
- mutex.unlock();
}
QFileIconProvider *QFileInfoGatherer::iconProvider() const
@@ -124,12 +122,11 @@ QFileIconProvider *QFileInfoGatherer::iconProvider() const
*/
void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStringList &files)
{
- mutex.lock();
+ QMutexLocker locker(&mutex);
// See if we already have this dir/file in our que
int loc = this->path.lastIndexOf(path);
while (loc > 0) {
if (this->files.at(loc) == files) {
- mutex.unlock();
return;
}
loc = this->path.lastIndexOf(path, loc - 1);
@@ -137,7 +134,6 @@ void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStr
this->path.push(path);
this->files.push(files);
condition.wakeAll();
- mutex.unlock();
}
/*!
@@ -160,10 +156,9 @@ void QFileInfoGatherer::updateFile(const QString &filePath)
void QFileInfoGatherer::clear()
{
#ifndef QT_NO_FILESYSTEMWATCHER
- mutex.lock();
+ QMutexLocker locker(&mutex);
watcher->removePaths(watcher->files());
watcher->removePaths(watcher->directories());
- mutex.unlock();
#endif
}
@@ -175,9 +170,8 @@ void QFileInfoGatherer::clear()
void QFileInfoGatherer::removePath(const QString &path)
{
#ifndef QT_NO_FILESYSTEMWATCHER
- mutex.lock();
+ QMutexLocker locker(&mutex);
watcher->removePath(path);
- mutex.unlock();
#endif
}
@@ -198,9 +192,8 @@ void QFileInfoGatherer::run()
{
forever {
bool updateFiles = false;
- mutex.lock();
+ QMutexLocker locker(&mutex);
if (abort) {
- mutex.unlock();
return;
}
if (this->path.isEmpty())
@@ -214,8 +207,9 @@ void QFileInfoGatherer::run()
this->files.pop_front();
updateFiles = true;
}
- mutex.unlock();
- if (updateFiles) getFileInfos(path, list);
+ locker.unlock();
+ if (updateFiles)
+ getFileInfos(path, list);
}
}
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp
index 49a3f2e..44adc75 100644
--- a/src/gui/dialogs/qfilesystemmodel.cpp
+++ b/src/gui/dialogs/qfilesystemmodel.cpp
@@ -1095,6 +1095,7 @@ private:
*/
void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent)
{
+ Q_Q(QFileSystemModel);
QFileSystemModelPrivate::QFileSystemNode *indexNode = node(parent);
if (indexNode->children.count() == 0)
return;
@@ -1118,6 +1119,16 @@ void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent
indexNode->visibleChildren.append(values.at(i).first->fileName);
values.at(i).first->isVisible = true;
}
+
+ if (!disableRecursiveSort) {
+ for (int i = 0; i < q->rowCount(parent); ++i) {
+ const QModelIndex childIndex = q->index(i, 0, parent);
+ QFileSystemModelPrivate::QFileSystemNode *indexNode = node(childIndex);
+ //Only do a recursive sort on visible nodes
+ if (indexNode->isVisible)
+ sortChildren(column, childIndex);
+ }
+ }
}
/*!
diff --git a/src/gui/dialogs/qfilesystemmodel_p.h b/src/gui/dialogs/qfilesystemmodel_p.h
index 0a1265a..af4fada 100644
--- a/src/gui/dialogs/qfilesystemmodel_p.h
+++ b/src/gui/dialogs/qfilesystemmodel_p.h
@@ -164,9 +164,12 @@ public:
QHash<QString, QFileSystemNode *>::const_iterator iterator;
for(iterator = children.constBegin() ; iterator != children.constEnd() ; ++iterator) {
//On windows the root (My computer) has no path so we don't want to add a / for nothing (e.g. /C:/)
- if (!path.isEmpty())
- iterator.value()->updateIcon(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
- else
+ if (!path.isEmpty()) {
+ if (path.endsWith(QLatin1Char('/')))
+ iterator.value()->updateIcon(iconProvider, path + iterator.value()->fileName);
+ else
+ iterator.value()->updateIcon(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
+ } else
iterator.value()->updateIcon(iconProvider, iterator.value()->fileName);
}
}
@@ -177,9 +180,12 @@ public:
QHash<QString, QFileSystemNode *>::const_iterator iterator;
for(iterator = children.constBegin() ; iterator != children.constEnd() ; ++iterator) {
//On windows the root (My computer) has no path so we don't want to add a / for nothing (e.g. /C:/)
- if (!path.isEmpty())
- iterator.value()->retranslateStrings(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
- else
+ if (!path.isEmpty()) {
+ if (path.endsWith(QLatin1Char('/')))
+ iterator.value()->retranslateStrings(iconProvider, path + iterator.value()->fileName);
+ else
+ iterator.value()->retranslateStrings(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
+ } else
iterator.value()->retranslateStrings(iconProvider, iterator.value()->fileName);
}
}
@@ -202,7 +208,8 @@ public:
readOnly(true),
setRootPath(false),
filters(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs),
- nameFilterDisables(true) // false on windows, true on mac and unix
+ nameFilterDisables(true), // false on windows, true on mac and unix
+ disableRecursiveSort(false)
{
delayedSortTimer.setSingleShot(true);
}
@@ -288,6 +295,10 @@ public:
QDir::Filters filters;
QHash<const QFileSystemNode*, bool> bypassFilters;
bool nameFilterDisables;
+ //This flag is an optimization for the QFileDialog
+ //It enable a sort which is not recursive, it means
+ //we sort only what we see.
+ bool disableRecursiveSort;
#ifndef QT_NO_REGEXP
QList<QRegExp> nameFilters;
#endif
diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp
index 4c5bf4f..9ea06ac 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
}
/*!
@@ -932,7 +940,7 @@ bool QFontDialogPrivate::sharedFontPanelAvailable = true;
\since 4.5
\overload
- Opens the dialog and connects its accepted() signal to the slot specified
+ Opens the dialog and connects its fontSelected() signal to the slot specified
by \a receiver and \a member.
The signal will be disconnected from the slot when the dialog is closed.
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/qfscompleter_p.h b/src/gui/dialogs/qfscompleter_p.h
new file mode 100644
index 0000000..37d9c74
--- /dev/null
+++ b/src/gui/dialogs/qfscompleter_p.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the 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 QCOMPLETOR_P_H
+#define QCOMPLETOR_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.
+//
+
+#include "qcompleter.h"
+#include <QtGui/qfilesystemmodel.h>
+
+#ifndef QT_NO_COMPLETER
+/*!
+ QCompleter that can deal with QFileSystemModel
+ */
+class QFSCompleter : public QCompleter {
+public:
+ QFSCompleter(QFileSystemModel *model, QObject *parent = 0)
+ : QCompleter(model, parent), proxyModel(0), sourceModel(model)
+ {
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+ setCaseSensitivity(Qt::CaseInsensitive);
+#endif
+ }
+ QString pathFromIndex(const QModelIndex &index) const;
+ QStringList splitPath(const QString& path) const;
+
+ QAbstractProxyModel *proxyModel;
+ QFileSystemModel *sourceModel;
+};
+#endif // QT_NO_COMPLETER
+
+#endif // QCOMPLETOR_P_H
+
diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp
index 78d99e3..8754324 100644
--- a/src/gui/dialogs/qinputdialog.cpp
+++ b/src/gui/dialogs/qinputdialog.cpp
@@ -1020,8 +1020,16 @@ QString QInputDialog::cancelButtonText() const
\since 4.5
\overload
- Opens the dialog and connects its accepted() signal to the slot specified
- by \a receiver and \a member.
+ This function connects one of its signals to the slot specified by \a receiver
+ and \a member. The specific signal depends on the arguments that are specified
+ in \a member. These are:
+
+ \list
+ \o textValueSelected() if \a member has a QString for its first argument.
+ \o intValueSelected() if \a member has an int for its first argument.
+ \o doubleValueSelected() if \a member has a double for its first argument.
+ \o accepted() if \a member has NO arguments.
+ \endlist
The signal will be disconnected from the slot when the dialog is closed.
*/
diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp
index 15a99af..00baf01 100644
--- a/src/gui/dialogs/qmessagebox.cpp
+++ b/src/gui/dialogs/qmessagebox.cpp
@@ -706,15 +706,10 @@ void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button)
Constructs a message box with no text and no buttons. \a parent is
passed to the QDialog constructor.
- If \a parent is 0, the message box is an \l{Qt::ApplicationModal}
- {application modal} dialog box. If \a parent is a widget, the
- message box is \l{Qt::WindowModal} {window modal} relative to \a
- parent.
-
- On Mac OS X, if \a parent is not 0 and you want your message box
- to appear as a Qt::Sheet of that parent, set the message box's
- \l{setWindowModality()} {window modality} to Qt::WindowModal
- (default). Otherwise, the message box will be a standard dialog.
+ On Mac OS X, if you want your message box to appear
+ as a Qt::Sheet of its \a parent, set the message box's
+ \l{setWindowModality()} {window modality} to Qt::WindowModal or use open().
+ Otherwise, the message box will be a standard dialog.
*/
QMessageBox::QMessageBox(QWidget *parent)
@@ -1728,7 +1723,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
QMessageBox *msgBox = new QMessageBox(parent);
msgBox->setAttribute(Qt::WA_DeleteOnClose);
msgBox->setWindowTitle(title.isEmpty() ? tr("About Qt") : title);
- msgBox->setText(translatedTextAboutQt);
+ msgBox->setInformativeText(translatedTextAboutQt);
QPixmap pm(QLatin1String(":/trolltech/qmessagebox/images/qtlogo-64.png"));
if (!pm.isNull())
diff --git a/src/gui/dialogs/qpagesetupdialog.cpp b/src/gui/dialogs/qpagesetupdialog.cpp
index 63775d2..682071a 100644
--- a/src/gui/dialogs/qpagesetupdialog.cpp
+++ b/src/gui/dialogs/qpagesetupdialog.cpp
@@ -180,6 +180,12 @@ void QPageSetupDialog::open(QObject *receiver, const char *member)
QDialog::open();
}
+#if defined(Q_WS_MAC) || defined(Q_OS_WIN)
+/*! \fn void QPageSetupDialog::setVisible(bool visible)
+ \reimp
+*/
+#endif
+
QT_END_NAMESPACE
#endif
diff --git a/src/gui/dialogs/qpagesetupdialog_mac.mm b/src/gui/dialogs/qpagesetupdialog_mac.mm
index 401d95f..24aef34 100644
--- a/src/gui/dialogs/qpagesetupdialog_mac.mm
+++ b/src/gui/dialogs/qpagesetupdialog_mac.mm
@@ -251,9 +251,6 @@ QPageSetupDialog::QPageSetupDialog(QWidget *parent)
d->ep = static_cast<QMacPrintEngine *>(d->printer->paintEngine())->d_func();
}
-/*!
- \reimp
-*/
void QPageSetupDialog::setVisible(bool visible)
{
Q_D(QPageSetupDialog);
diff --git a/src/gui/dialogs/qpagesetupdialog_win.cpp b/src/gui/dialogs/qpagesetupdialog_win.cpp
index 4bb571c..bdce8ab 100644
--- a/src/gui/dialogs/qpagesetupdialog_win.cpp
+++ b/src/gui/dialogs/qpagesetupdialog_win.cpp
@@ -71,7 +71,7 @@ int QPageSetupDialog::exec()
return Rejected;
QWin32PrintEngine *engine = static_cast<QWin32PrintEngine*>(d->printer->paintEngine());
- QWin32PrintEnginePrivate *ep = static_cast<QWin32PrintEnginePrivate *>(engine->d_ptr);
+ QWin32PrintEnginePrivate *ep = static_cast<QWin32PrintEnginePrivate *>(engine->d_ptr.data());
PAGESETUPDLG psd;
memset(&psd, 0, sizeof(PAGESETUPDLG));
diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp
index 87a4e65..17d0047 100644
--- a/src/gui/dialogs/qprintdialog_unix.cpp
+++ b/src/gui/dialogs/qprintdialog_unix.cpp
@@ -44,7 +44,6 @@
#ifndef QT_NO_PRINTDIALOG
#include "private/qabstractprintdialog_p.h"
-#include "qfiledialog_p.h"
#include <QtGui/qmessagebox.h>
#include "qprintdialog.h"
#include "qfiledialog.h"
@@ -55,6 +54,7 @@
#include <QtGui/qdialogbuttonbox.h>
+#include "qfscompleter_p.h"
#include "ui_qprintpropertieswidget.h"
#include "ui_qprintsettingsoutput.h"
#include "ui_qprintwidget.h"
@@ -696,7 +696,7 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p)
QFileSystemModel *fsm = new QFileSystemModel(widget.filename);
fsm->setRootPath(QDir::homePath());
#if !defined(QT_NO_COMPLETER) && !defined(QT_NO_FILEDIALOG)
- widget.filename->setCompleter(new QFSCompletor(fsm, widget.filename));
+ widget.filename->setCompleter(new QFSCompleter(fsm, widget.filename));
#endif
#endif
_q_printerChanged(currentPrinterIndex);
diff --git a/src/gui/dialogs/qprintpreviewdialog.cpp b/src/gui/dialogs/qprintpreviewdialog.cpp
index c00bd14..61949d8 100644
--- a/src/gui/dialogs/qprintpreviewdialog.cpp
+++ b/src/gui/dialogs/qprintpreviewdialog.cpp
@@ -42,6 +42,7 @@
#include "qprintpreviewdialog.h"
#include "qprintpreviewwidget.h"
#include <private/qprinter_p.h>
+#include "private/qdialog_p.h"
#include <QtGui/qaction.h>
#include <QtGui/qboxlayout.h>
@@ -128,12 +129,12 @@ private:
};
} // anonymous namespace
-class QPrintPreviewDialogPrivate
+class QPrintPreviewDialogPrivate : public QDialogPrivate
{
Q_DECLARE_PUBLIC(QPrintPreviewDialog)
public:
- QPrintPreviewDialogPrivate(QPrintPreviewDialog *q)
- : q_ptr(q), printDialog(0), ownPrinter(false),
+ QPrintPreviewDialogPrivate()
+ : printDialog(0), ownPrinter(false),
initialized(false) {}
// private slots
@@ -158,7 +159,6 @@ public:
void updatePageNumLabel();
void updateZoomFactor();
- QPrintPreviewDialog *q_ptr;
QPrintDialog *printDialog;
QPrintPreviewWidget *preview;
QPrinter *printer;
@@ -680,7 +680,7 @@ void QPrintPreviewDialogPrivate::_q_zoomFactorChanged()
\sa QWidget::setWindowFlags()
*/
QPrintPreviewDialog::QPrintPreviewDialog(QPrinter* printer, QWidget *parent, Qt::WindowFlags flags)
- : QDialog(parent, flags), d_ptr(new QPrintPreviewDialogPrivate(this))
+ : QDialog(*new QPrintPreviewDialogPrivate, parent, flags)
{
Q_D(QPrintPreviewDialog);
d->init(printer);
@@ -694,7 +694,7 @@ QPrintPreviewDialog::QPrintPreviewDialog(QPrinter* printer, QWidget *parent, Qt:
system default printer.
*/
QPrintPreviewDialog::QPrintPreviewDialog(QWidget *parent, Qt::WindowFlags f)
- : QDialog(parent, f), d_ptr(new QPrintPreviewDialogPrivate(this))
+ : QDialog(*new QPrintPreviewDialogPrivate, parent, f)
{
Q_D(QPrintPreviewDialog);
d->init();
@@ -709,7 +709,6 @@ QPrintPreviewDialog::~QPrintPreviewDialog()
if (d->ownPrinter)
delete d->printer;
delete d->printDialog;
- delete d_ptr;
}
/*!
diff --git a/src/gui/dialogs/qprintpreviewdialog.h b/src/gui/dialogs/qprintpreviewdialog.h
index c3a4d57..49262db 100644
--- a/src/gui/dialogs/qprintpreviewdialog.h
+++ b/src/gui/dialogs/qprintpreviewdialog.h
@@ -94,7 +94,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_previewChanged())
Q_PRIVATE_SLOT(d_func(), void _q_zoomFactorChanged())
- QPrintPreviewDialogPrivate *d_ptr;
+ void *dummy; // ### Qt 5 - remove me
};
diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp
index 32395c4..298f23f 100644
--- a/src/gui/dialogs/qwizard.cpp
+++ b/src/gui/dialogs/qwizard.cpp
@@ -1465,7 +1465,7 @@ void QWizardPrivate::handleAeroStyleChange()
return; // prevent recursion
inHandleAeroStyleChange = true;
- vistaHelper->backButton()->disconnect();
+ vistaHelper->disconnectBackButton();
q->removeEventFilter(vistaHelper);
if (isVistaThemeEnabled()) {
@@ -1491,7 +1491,7 @@ void QWizardPrivate::handleAeroStyleChange()
q->setMouseTracking(true); // ### original value possibly different
q->unsetCursor(); // ### ditto
antiFlickerWidget->move(0, 0);
- vistaHelper->backButton()->hide();
+ vistaHelper->hideBackButton();
vistaHelper->setTitleBarIconAndCaptionVisible(true);
}
diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp
index 64696de..8aad4af 100644
--- a/src/gui/dialogs/qwizard_win.cpp
+++ b/src/gui/dialogs/qwizard_win.cpp
@@ -239,9 +239,11 @@ void QVistaBackButton::paintEvent(QPaintEvent *)
QVistaHelper::QVistaHelper(QWizard *wizard)
: pressed(false)
, wizard(wizard)
+ , backButton_(0)
{
is_vista = resolveSymbols();
- backButton_ = new QVistaBackButton(wizard);
+ if (is_vista)
+ backButton_ = new QVistaBackButton(wizard);
}
QVistaHelper::~QVistaHelper()
@@ -310,6 +312,7 @@ void QVistaHelper::drawTitleBar(QPainter *painter)
QRect(0, 0, wizard->width(), titleBarSize() + topOffset()),
painter->paintEngine()->getDC());
+ Q_ASSERT(backButton_);
const int btnTop = backButton_->mapToParent(QPoint()).y();
const int btnHeight = backButton_->size().height();
const int verticalCenter = (btnTop + btnHeight / 2);
diff --git a/src/gui/dialogs/qwizard_win_p.h b/src/gui/dialogs/qwizard_win_p.h
index cbb3b17..148be26 100644
--- a/src/gui/dialogs/qwizard_win_p.h
+++ b/src/gui/dialogs/qwizard_win_p.h
@@ -94,6 +94,8 @@ public:
void resizeEvent(QResizeEvent *event);
void paintEvent(QPaintEvent *event);
QVistaBackButton *backButton() const { return backButton_; }
+ void disconnectBackButton() { if (backButton_) backButton_->disconnect(); }
+ void hideBackButton() { if (backButton_) backButton_->hide(); }
void setWindowPosHack();
QColor basicWindowFrameColor();
enum VistaState { VistaAero, VistaBasic, Classic, Dirty };
diff --git a/src/gui/embedded/qkbdtty_qws.cpp b/src/gui/embedded/qkbdtty_qws.cpp
index b588e55..7c162bc 100644
--- a/src/gui/embedded/qkbdtty_qws.cpp
+++ b/src/gui/embedded/qkbdtty_qws.cpp
@@ -97,6 +97,7 @@ private slots:
private:
QWSPC101KeyboardHandler *handler;
struct termios origTermData;
+ int originalKbdMode;
};
QWSTtyKeyboardHandler::QWSTtyKeyboardHandler(const QString &device)
@@ -156,6 +157,7 @@ QWSTtyKbPrivate::QWSTtyKbPrivate(QWSPC101KeyboardHandler *h, const QString &devi
tcgetattr(kbdFD, &termdata);
#if defined(Q_OS_LINUX)
+ ioctl(kbdFD, KDGKBMODE, &originalKbdMode);
# ifdef QT_QWS_USE_KEYCODES
ioctl(kbdFD, KDSKBMODE, K_MEDIUMRAW);
# else
@@ -202,7 +204,7 @@ QWSTtyKbPrivate::~QWSTtyKbPrivate()
{
if (kbdFD >= 0) {
#if defined(Q_OS_LINUX)
- ioctl(kbdFD, KDSKBMODE, K_XLATE);
+ ioctl(kbdFD, KDSKBMODE, originalKbdMode);
#endif
tcsetattr(kbdFD, TCSANOW, &origTermData);
::close(kbdFD);
diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp
index 6741f2c..39a74d5 100644
--- a/src/gui/embedded/qscreen_qws.cpp
+++ b/src/gui/embedded/qscreen_qws.cpp
@@ -1394,7 +1394,7 @@ QImage::Format QScreenPrivate::preferredImageFormat() const
altered. Note that the default implementations of these functions
do nothing.
- Reimplement the the mapFromDevice() and mapToDevice() functions to
+ Reimplement the mapFromDevice() and mapToDevice() functions to
map objects from the framebuffer coordinate system to the
coordinate space used by the application, and vice versa. Be aware
that the default implementations simply return the given objects
diff --git a/src/gui/embedded/qsoundqss_qws.cpp b/src/gui/embedded/qsoundqss_qws.cpp
index 283bbd3..ed988ca 100644
--- a/src/gui/embedded/qsoundqss_qws.cpp
+++ b/src/gui/embedded/qsoundqss_qws.cpp
@@ -1036,24 +1036,28 @@ void QWSSoundServerPrivate::stopFile(int wid, int sid)
void QWSSoundServerPrivate::stopAll(int wid)
{
QWSSoundServerProvider *bucket;
- QList<QWSSoundServerProvider*>::Iterator it = active.begin();
- while (it != active.end()) {
- bucket = *it;
- if (bucket->groupId() == wid) {
- it = active.erase(it);
- delete bucket;
- } else {
- ++it;
+ if (!active.isEmpty()) {
+ QList<QWSSoundServerProvider*>::Iterator it = active.begin();
+ while (it != active.end()) {
+ bucket = *it;
+ if (bucket->groupId() == wid) {
+ it = active.erase(it);
+ delete bucket;
+ } else {
+ ++it;
+ }
}
}
- it = inactive.begin();
- while (it != inactive.end()) {
- bucket = *it;
- if (bucket->groupId() == wid) {
- it = inactive.erase(it);
- delete bucket;
- } else {
- ++it;
+ if (!inactive.isEmpty()) {
+ QList<QWSSoundServerProvider*>::Iterator it = inactive.begin();
+ while (it != inactive.end()) {
+ bucket = *it;
+ if (bucket->groupId() == wid) {
+ it = inactive.erase(it);
+ delete bucket;
+ } else {
+ ++it;
+ }
}
}
}
diff --git a/src/gui/embedded/qwindowsystem_qws.cpp b/src/gui/embedded/qwindowsystem_qws.cpp
index fdcd193..e3d56ad 100644
--- a/src/gui/embedded/qwindowsystem_qws.cpp
+++ b/src/gui/embedded/qwindowsystem_qws.cpp
@@ -1304,7 +1304,13 @@ QWSServer::QWSServer(int flags, QObject *parent) :
QObject(*new QWSServerPrivate, parent)
{
Q_D(QWSServer);
- d->initServer(flags);
+ QT_TRY {
+ d->initServer(flags);
+ } QT_CATCH(...) {
+ qwsServer = 0;
+ qwsServerPrivate = 0;
+ QT_RETHROW;
+ }
}
#ifdef QT3_SUPPORT
@@ -1750,21 +1756,23 @@ void QWSServerPrivate::cleanupFonts(bool force)
#if defined(QWS_DEBUG_FONTCLEANUP)
qDebug() << "cleanupFonts()";
#endif
- QMap<QByteArray, int>::Iterator it = fontReferenceCount.begin();
- while (it != fontReferenceCount.end()) {
- if (it.value() && !force) {
- ++it;
- continue;
- }
+ if (!fontReferenceCount.isEmpty()) {
+ QMap<QByteArray, int>::Iterator it = fontReferenceCount.begin();
+ while (it != fontReferenceCount.end()) {
+ if (it.value() && !force) {
+ ++it;
+ continue;
+ }
- const QByteArray &fontName = it.key();
+ const QByteArray &fontName = it.key();
#if defined(QWS_DEBUG_FONTCLEANUP)
- qDebug() << "removing unused font file" << fontName;
+ qDebug() << "removing unused font file" << fontName;
#endif
- QFile::remove(QFile::decodeName(fontName));
- sendFontRemovedEvent(fontName);
+ QFile::remove(QFile::decodeName(fontName));
+ sendFontRemovedEvent(fontName);
- it = fontReferenceCount.erase(it);
+ it = fontReferenceCount.erase(it);
+ }
}
if (crashedClientIds.isEmpty())
@@ -3966,7 +3974,8 @@ void QWSServerPrivate::openDisplay()
void QWSServerPrivate::closeDisplay()
{
- qt_screen->shutdownDevice();
+ if (qt_screen)
+ qt_screen->shutdownDevice();
}
/*!
@@ -4065,9 +4074,14 @@ void QWSServer::startup(int flags)
void QWSServer::closedown()
{
- unlink(qws_qtePipeFilename().toLatin1().constData());
- delete qwsServer;
+ QScopedPointer<QWSServer> server(qwsServer);
qwsServer = 0;
+ QT_TRY {
+ unlink(qws_qtePipeFilename().toLatin1().constData());
+ } QT_CATCH(const std::bad_alloc &) {
+ // ### TODO - what to do when we run out of memory
+ // when calling toLatin1?
+ }
}
void QWSServerPrivate::emergency_cleanup()
diff --git a/src/gui/embedded/qwscursor_qws.cpp b/src/gui/embedded/qwscursor_qws.cpp
index 3a5bd2c..b25e9b1 100644
--- a/src/gui/embedded/qwscursor_qws.cpp
+++ b/src/gui/embedded/qwscursor_qws.cpp
@@ -531,7 +531,7 @@ void QWSCursor::set(const uchar *data, const uchar *mask,
cursor = QImage(width,height, QImage::Format_Indexed8);
- if (!width || !height || !data || !mask)
+ if (!width || !height || !data || !mask || cursor.isNull())
return;
cursor.setNumColors(3);
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 4908296..596326b 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -515,6 +515,7 @@
#include <QtGui/qpixmapcache.h>
#include <QtGui/qstyleoption.h>
#include <QtGui/qevent.h>
+#include <QInputContext>
#include <private/qgraphicsitem_p.h>
#include <private/qgraphicswidget_p.h>
@@ -874,8 +875,6 @@ QGraphicsItem::~QGraphicsItem()
if (d_ptr->scene)
d_ptr->scene->d_func()->_q_removeItemLater(this);
- delete d_ptr;
-
qt_dataStore()->data.remove(this);
}
@@ -1522,6 +1521,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)));
@@ -2727,7 +2730,7 @@ QTransform QGraphicsItem::itemTransform(const QGraphicsItem *other, bool *ok) co
QTransform x;
const QGraphicsItem *p = child;
do {
- const QGraphicsItemPrivate *pd = p->d_ptr;
+ const QGraphicsItemPrivate *pd = p->d_ptr.data();
if (pd->hasTransform)
x *= p->transform();
if (!pd->pos.isNull())
@@ -3065,7 +3068,7 @@ QRectF QGraphicsItem::sceneBoundingRect() const
const QGraphicsItem *parentItem = this;
const QGraphicsItemPrivate *itemd;
do {
- itemd = parentItem->d_ptr;
+ itemd = parentItem->d_ptr.data();
if (itemd->hasTransform)
break;
offset += itemd->pos;
@@ -7605,7 +7608,7 @@ class QGraphicsTextItemPrivate
{
public:
QGraphicsTextItemPrivate()
- : control(0), pageNumber(0), useDefaultImpl(false), tabChangesFocus(false)
+ : control(0), pageNumber(0), useDefaultImpl(false), tabChangesFocus(false), clickCausedFocus(0)
{ }
mutable QTextControl *control;
@@ -7626,6 +7629,8 @@ public:
bool useDefaultImpl;
bool tabChangesFocus;
+ uint clickCausedFocus : 1;
+
QGraphicsTextItem *qq;
};
@@ -7952,7 +7957,13 @@ void QGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
dd->useDefaultImpl = false;
return;
}
+
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -7964,7 +7975,13 @@ void QGraphicsTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QGraphicsItem::mouseMoveEvent(event);
return;
}
+
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -7984,7 +8001,23 @@ void QGraphicsTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
return;
}
+
+ if (event->button() == Qt::LeftButton && qApp->autoSipEnabled()
+ && (!dd->clickCausedFocus || qApp->autoSipOnMouseFocus())) {
+ QEvent _event(QEvent::RequestSoftwareInputPanel);
+ QApplication::sendEvent(event->widget(), &_event);
+ } else {
+ QGraphicsItem::mouseReleaseEvent(event);
+ }
+ dd->clickCausedFocus = 0;
+
dd->sendControlEvent(event);
+
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8003,6 +8036,11 @@ void QGraphicsTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
}
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8011,6 +8049,11 @@ void QGraphicsTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
void QGraphicsTextItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8019,6 +8062,18 @@ void QGraphicsTextItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
void QGraphicsTextItem::keyPressEvent(QKeyEvent *event)
{
dd->sendControlEvent(event);
+ QList<QGraphicsView *> views = scene()->views();
+ for (int i = 0; i < views.size(); ++i) {
+ QGraphicsView *view = views.at(i);
+ Q_ASSERT(view->viewport());
+ if(view->viewport()->hasFocus()) {
+ QInputContext *qic = view->viewport()->inputContext();
+ if(qic){
+ qic->update();
+ }
+ break;
+ }
+ }
}
/*!
@@ -8027,6 +8082,18 @@ void QGraphicsTextItem::keyPressEvent(QKeyEvent *event)
void QGraphicsTextItem::keyReleaseEvent(QKeyEvent *event)
{
dd->sendControlEvent(event);
+ QList<QGraphicsView *> views = scene()->views();
+ for (int i = 0; i < views.size(); ++i) {
+ QGraphicsView *view = views.at(i);
+ Q_ASSERT(view->viewport());
+ if(view->viewport()->hasFocus()) {
+ QInputContext *qic = view->viewport()->inputContext();
+ if(qic){
+ qic->update();
+ }
+ break;
+ }
+ }
}
/*!
@@ -8035,7 +8102,22 @@ void QGraphicsTextItem::keyReleaseEvent(QKeyEvent *event)
void QGraphicsTextItem::focusInEvent(QFocusEvent *event)
{
dd->sendControlEvent(event);
+ if (event->reason() == Qt::MouseFocusReason) {
+ dd->clickCausedFocus = 1;
+ }
update();
+ QList<QGraphicsView *> views = scene()->views();
+ for (int i = 0; i < views.size(); ++i) {
+ QGraphicsView *view = views.at(i);
+ Q_ASSERT(view->viewport());
+ if(view->viewport()->hasFocus()) {
+ QInputContext *qic = view->viewport()->inputContext();
+ if(qic){
+ qic->reset();
+ }
+ break;
+ }
+ }
}
/*!
@@ -8045,6 +8127,18 @@ void QGraphicsTextItem::focusOutEvent(QFocusEvent *event)
{
dd->sendControlEvent(event);
update();
+ QList<QGraphicsView *> views = scene()->views();
+ for (int i = 0; i < views.size(); ++i) {
+ QGraphicsView *view = views.at(i);
+ Q_ASSERT(view->viewport());
+ if(view->viewport()->hasFocus()) {
+ QInputContext *qic = view->viewport()->inputContext();
+ if(qic){
+ qic->reset();
+ }
+ break;
+ }
+ }
}
/*!
@@ -8053,6 +8147,11 @@ void QGraphicsTextItem::focusOutEvent(QFocusEvent *event)
void QGraphicsTextItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8061,6 +8160,11 @@ void QGraphicsTextItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
void QGraphicsTextItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8069,6 +8173,11 @@ void QGraphicsTextItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
void QGraphicsTextItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8077,6 +8186,11 @@ void QGraphicsTextItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
void QGraphicsTextItem::dropEvent(QGraphicsSceneDragDropEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8093,6 +8207,11 @@ void QGraphicsTextItem::inputMethodEvent(QInputMethodEvent *event)
void QGraphicsTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8101,6 +8220,11 @@ void QGraphicsTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
void QGraphicsTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8109,6 +8233,11 @@ void QGraphicsTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
void QGraphicsTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index b98882d..25678a6 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -46,6 +46,7 @@
#include <QtCore/qobject.h>
#include <QtCore/qvariant.h>
#include <QtCore/qrect.h>
+#include <QtCore/qscopedpointer.h>
#include <QtGui/qpainterpath.h>
#include <QtGui/qpixmap.h>
@@ -380,7 +381,7 @@ protected:
protected:
QGraphicsItem(QGraphicsItemPrivate &dd,
QGraphicsItem *parent, QGraphicsScene *scene);
- QGraphicsItemPrivate *d_ptr;
+ QScopedPointer<QGraphicsItemPrivate> d_ptr;
void addToIndex();
void removeFromIndex();
diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp
index eaa97ff..c291763 100644
--- a/src/gui/graphicsview/qgraphicslayoutitem.cpp
+++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp
@@ -255,7 +255,7 @@ QGraphicsItem *QGraphicsLayoutItemPrivate::parentItem() const
passing a QGraphicsLayoutItem pointer to QGraphicsLayoutItem's
protected constructor, or by calling setParentLayoutItem(). The
parentLayoutItem() function returns a pointer to the item's layoutItem
- parent. If the item's parent is 0 or if the the parent does not inherit
+ parent. If the item's parent is 0 or if the parent does not inherit
from QGraphicsItem, the parentLayoutItem() function then returns 0.
isLayout() returns true if the QGraphicsLayoutItem subclass is itself a
layout, or false otherwise.
@@ -307,7 +307,6 @@ QGraphicsLayoutItem::~QGraphicsLayoutItem()
}
}
}
- delete d_ptr;
}
/*!
diff --git a/src/gui/graphicsview/qgraphicslayoutitem.h b/src/gui/graphicsview/qgraphicslayoutitem.h
index 31f5d90..d667c4f 100644
--- a/src/gui/graphicsview/qgraphicslayoutitem.h
+++ b/src/gui/graphicsview/qgraphicslayoutitem.h
@@ -42,6 +42,7 @@
#ifndef QGRAPHICSLAYOUTITEM_H
#define QGRAPHICSLAYOUTITEM_H
+#include <QtCore/qscopedpointer.h>
#include <QtGui/qsizepolicy.h>
#include <QtGui/qevent.h>
@@ -112,7 +113,7 @@ protected:
QGraphicsLayoutItem(QGraphicsLayoutItemPrivate &dd);
virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const = 0;
- QGraphicsLayoutItemPrivate *d_ptr;
+ QScopedPointer<QGraphicsLayoutItemPrivate> d_ptr;
private:
QSizeF *effectiveSizeHints(const QSizeF &constraint) const;
diff --git a/src/gui/graphicsview/qgraphicsproxywidget.h b/src/gui/graphicsview/qgraphicsproxywidget.h
index b2c3c8f..f006319 100644
--- a/src/gui/graphicsview/qgraphicsproxywidget.h
+++ b/src/gui/graphicsview/qgraphicsproxywidget.h
@@ -127,7 +127,7 @@ protected Q_SLOTS:
private:
Q_DISABLE_COPY(QGraphicsProxyWidget)
- Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr, QGraphicsProxyWidget)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QGraphicsProxyWidget)
Q_PRIVATE_SLOT(d_func(), void _q_removeWidgetSlot())
friend class QWidget;
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index b89e352..5114351 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -1824,8 +1824,8 @@ void QGraphicsScenePrivate::invalidateSortCache()
inline bool qt_closestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
{
// Return true if sibling item1 is on top of item2.
- const QGraphicsItemPrivate *d1 = item1->d_ptr;
- const QGraphicsItemPrivate *d2 = item2->d_ptr;
+ const QGraphicsItemPrivate *d1 = item1->d_ptr.data();
+ const QGraphicsItemPrivate *d2 = item2->d_ptr.data();
bool f1 = d1->flags & QGraphicsItem::ItemStacksBehindParent;
bool f2 = d2->flags & QGraphicsItem::ItemStacksBehindParent;
if (f1 != f2) return f2;
@@ -1852,8 +1852,8 @@ inline bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem
bool QGraphicsScenePrivate::closestItemFirst_withoutCache(const QGraphicsItem *item1, const QGraphicsItem *item2)
{
// Siblings? Just check their z-values.
- const QGraphicsItemPrivate *d1 = item1->d_ptr;
- const QGraphicsItemPrivate *d2 = item2->d_ptr;
+ const QGraphicsItemPrivate *d1 = item1->d_ptr.data();
+ const QGraphicsItemPrivate *d2 = item2->d_ptr.data();
if (d1->parent == d2->parent)
return qt_closestLeaf(item1, item2);
@@ -4687,7 +4687,7 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte
const QStyleOptionGraphicsItem *option, QWidget *widget,
bool painterStateProtection)
{
- QGraphicsItemPrivate *itemd = item->d_ptr;
+ QGraphicsItemPrivate *itemd = item->d_ptr.data();
QGraphicsItem::CacheMode cacheMode = QGraphicsItem::CacheMode(itemd->cacheMode);
// Render directly, using no cache.
diff --git a/src/gui/graphicsview/qgraphicssceneevent.cpp b/src/gui/graphicsview/qgraphicssceneevent.cpp
index b819c2c..ad57aac 100644
--- a/src/gui/graphicsview/qgraphicssceneevent.cpp
+++ b/src/gui/graphicsview/qgraphicssceneevent.cpp
@@ -313,7 +313,6 @@ QGraphicsSceneEvent::QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type ty
*/
QGraphicsSceneEvent::~QGraphicsSceneEvent()
{
- delete d_ptr;
}
/*!
@@ -844,7 +843,7 @@ QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent()
/*!
Returns the position of the mouse cursor in item coordinates at the moment
- the the context menu was requested.
+ the context menu was requested.
\sa scenePos(), screenPos()
*/
@@ -992,7 +991,7 @@ QGraphicsSceneHoverEvent::~QGraphicsSceneHoverEvent()
/*!
Returns the position of the mouse cursor in item coordinates at the moment
- the the hover event was sent.
+ the hover event was sent.
\sa scenePos(), screenPos()
*/
@@ -1017,7 +1016,7 @@ void QGraphicsSceneHoverEvent::setPos(const QPointF &pos)
/*!
Returns the position of the mouse cursor in scene coordinates at the
- moment the the hover event was sent.
+ moment the hover event was sent.
\sa pos(), screenPos()
*/
@@ -1042,7 +1041,7 @@ void QGraphicsSceneHoverEvent::setScenePos(const QPointF &pos)
/*!
Returns the position of the mouse cursor in screen coordinates at the
- moment the the hover event was sent.
+ moment the hover event was sent.
\sa pos(), scenePos()
*/
@@ -1138,7 +1137,7 @@ void QGraphicsSceneHoverEvent::setLastScreenPos(const QPoint &pos)
/*!
\since 4.4
- Returns the keyboard modifiers at the moment the the hover event was sent.
+ Returns the keyboard modifiers at the moment the hover event was sent.
*/
Qt::KeyboardModifiers QGraphicsSceneHoverEvent::modifiers() const
{
@@ -1184,7 +1183,7 @@ QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent()
/*!
Returns the position of the mouse cursor in scene coordinates at the
- moment the the help event was sent.
+ moment the help event was sent.
\sa screenPos()
*/
@@ -1209,7 +1208,7 @@ void QGraphicsSceneHelpEvent::setScenePos(const QPointF &pos)
/*!
Returns the position of the mouse cursor in screen coordinates at the
- moment the the help event was sent.
+ moment the help event was sent.
\sa scenePos()
*/
diff --git a/src/gui/graphicsview/qgraphicssceneevent.h b/src/gui/graphicsview/qgraphicssceneevent.h
index be50e96..4ebe3df 100644
--- a/src/gui/graphicsview/qgraphicssceneevent.h
+++ b/src/gui/graphicsview/qgraphicssceneevent.h
@@ -44,6 +44,7 @@
#include <QtCore/qcoreevent.h>
#include <QtCore/qpoint.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -70,7 +71,7 @@ public:
protected:
QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type type = None);
- QGraphicsSceneEventPrivate *d_ptr;
+ QScopedPointer<QGraphicsSceneEventPrivate> d_ptr;
Q_DECLARE_PRIVATE(QGraphicsSceneEvent)
};
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index a795fb4..96e9a96 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -753,7 +753,7 @@ QRect QGraphicsViewPrivate::mapToViewRect(const QGraphicsItem *item, const QRect
const QGraphicsItem *parentItem = item;
const QGraphicsItemPrivate *itemd;
do {
- itemd = parentItem->d_ptr;
+ itemd = parentItem->d_ptr.data();
if (itemd->hasTransform)
break;
offset += itemd->pos;
@@ -1195,6 +1195,11 @@ QGraphicsView::QGraphicsView(QWidget *parent)
// using a simple reference count. The same goes for acceptDrops and mouse
// tracking.
setAttribute(Qt::WA_InputMethodEnabled);
+
+ // viewport part of the graphics view has to be enabled
+ // as well, because when events come this widget is asked
+ // for input context and so on
+ viewport()->setAttribute(Qt::WA_InputMethodEnabled);
}
/*!
@@ -1209,6 +1214,11 @@ QGraphicsView::QGraphicsView(QGraphicsScene *scene, QWidget *parent)
setAcceptDrops(true);
setBackgroundRole(QPalette::Base);
setAttribute(Qt::WA_InputMethodEnabled);
+
+ // viewport part of the graphics view has to be enabled
+ // as well, because when events come this widget is asked
+ // for input context and so on
+ viewport()->setAttribute(Qt::WA_InputMethodEnabled);
}
/*!
@@ -1221,6 +1231,11 @@ QGraphicsView::QGraphicsView(QGraphicsViewPrivate &dd, QWidget *parent)
setAcceptDrops(true);
setBackgroundRole(QPalette::Base);
setAttribute(Qt::WA_InputMethodEnabled);
+
+ // viewport part of the graphics view has to be enabled
+ // as well, because when events come this widget is asked
+ // for input context and so on
+ viewport()->setAttribute(Qt::WA_InputMethodEnabled);
}
/*!
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 7f02fb9..aa2b9bf 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -366,7 +366,7 @@ void QGraphicsWidget::resize(const QSizeF &size)
void QGraphicsWidget::setGeometry(const QRectF &rect)
{
QGraphicsWidgetPrivate *wd = QGraphicsWidget::d_func();
- QGraphicsLayoutItemPrivate *d = QGraphicsLayoutItem::d_ptr;
+ QGraphicsLayoutItemPrivate *d = QGraphicsLayoutItem::d_ptr.data();
QRectF newGeom;
QPointF oldPos = d->geom.topLeft();
if (!wd->inSetPos) {
@@ -1887,8 +1887,10 @@ void QGraphicsWidget::insertAction(QAction *before, QAction *action)
}
d->actions.insert(pos, action);
- QActionPrivate *apriv = action->d_func();
- apriv->graphicsWidgets.append(this);
+ if (index == -1) {
+ QActionPrivate *apriv = action->d_func();
+ apriv->graphicsWidgets.append(this);
+ }
QActionEvent e(QEvent::ActionAdded, action, before);
QApplication::sendEvent(this, &e);
diff --git a/src/gui/graphicsview/qgraphicswidget.h b/src/gui/graphicsview/qgraphicswidget.h
index 34f1c5f..49de542 100644
--- a/src/gui/graphicsview/qgraphicswidget.h
+++ b/src/gui/graphicsview/qgraphicswidget.h
@@ -225,7 +225,7 @@ protected:
private:
Q_DISABLE_COPY(QGraphicsWidget)
- Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr, QGraphicsWidget)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QGraphicsWidget)
friend class QGraphicsScene;
friend class QGraphicsScenePrivate;
friend class QGraphicsView;
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index d3b7388..30aaa51 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -42,4 +42,7 @@ QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist
DEFINES += Q_INTERNAL_QAPP_SRC
-symbian:TARGET.UID3=0x2001B2DD \ No newline at end of file
+symbian:TARGET.UID3=0x2001B2DD
+
+# ro-section in gui can exceed default allocated space, so more rw-section little further
+symbian-sbsv2: MMP_RULES += "LINKEROPTION armcc --rw-base 0x800000" \ No newline at end of file
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index 53430ab..0799ea7 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -428,10 +428,13 @@ bool QPixmapIconEngine::read(QDataStream &in)
in >> sz;
in >> mode;
in >> state;
- if (pm.isNull())
+ if (pm.isNull()) {
addFile(fileName, sz, QIcon::Mode(mode), QIcon::State(state));
- else
- addPixmap(pm, QIcon::Mode(mode), QIcon::State(state));
+ } else {
+ QPixmapIconEngineEntry pe(fileName, sz, QIcon::Mode(mode), QIcon::State(state));
+ pe.pixmap = pm;
+ pixmaps += pe;
+ }
}
return true;
}
@@ -922,7 +925,7 @@ QList<QSize> QIcon::availableSizes(Mode mode, State state) const
\relates QIcon
\since 4.2
- Writes the given \a icon to the the given \a stream as a PNG
+ Writes the given \a icon to the given \a stream as a PNG
image. If the icon contains more than one image, all images will
be written to the stream. Note that writing the stream to a file
will not produce a valid image file.
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index c7a20db..34ad99c 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -185,6 +185,13 @@ static int depthForFormat(QImage::Format format)
return depth;
}
+/*! \fn QImageData * QImageData::create(const QSize &size, QImage::Format format, int numColors)
+
+ \internal
+
+ Creates a new image data.
+ Returns 0 if invalid parameters are give or anything else failed.
+*/
QImageData * QImageData::create(const QSize &size, QImage::Format format, int numColors)
{
if (!size.isValid() || numColors < 0 || format == QImage::Format_Invalid)
@@ -223,7 +230,7 @@ QImageData * QImageData::create(const QSize &size, QImage::Format format, int nu
|| INT_MAX/sizeof(uchar *) < uint(height))
return 0;
- QImageData *d = new QImageData;
+ QScopedPointer<QImageData> d(new QImageData);
d->colortable.resize(numColors);
if (depth == 1) {
d->colortable[0] = QColor(Qt::black).rgba();
@@ -246,12 +253,11 @@ QImageData * QImageData::create(const QSize &size, QImage::Format format, int nu
d->data = (uchar *)malloc(d->nbytes);
if (!d->data) {
- delete d;
return 0;
}
d->ref.ref();
- return d;
+ return d.take();
}
@@ -1621,6 +1627,7 @@ int QImage::numColors() const
/*!
Returns a pointer to the scanline pointer table. This is the
beginning of the data block for the image.
+ Returns 0 in case of an error.
Use the bits() or scanLine() function instead.
*/
@@ -1636,6 +1643,8 @@ uchar **QImage::jumpTable()
if (!d->jumptable) {
d->jumptable = (uchar **)malloc(d->height*sizeof(uchar *));
+ if (!d->jumptable)
+ return 0;
uchar *data = d->data;
int height = d->height;
uchar **p = d->jumptable;
@@ -1656,6 +1665,8 @@ const uchar * const *QImage::jumpTable() const
return 0;
if (!d->jumptable) {
d->jumptable = (uchar **)malloc(d->height*sizeof(uchar *));
+ if (!d->jumptable)
+ return 0;
uchar *data = d->data;
int height = d->height;
uchar **p = d->jumptable;
@@ -4996,7 +5007,7 @@ QPoint QImage::offset() const
/*!
\fn void QImage::setOffset(const QPoint& offset)
- Sets the the number of pixels by which the image is intended to be
+ Sets the number of pixels by which the image is intended to be
offset by when positioning relative to other images, to \a offset.
\sa offset(), {QImage#Image Information}{Image Information}
diff --git a/src/gui/image/qimageiohandler.cpp b/src/gui/image/qimageiohandler.cpp
index a47c69e..f432f87 100644
--- a/src/gui/image/qimageiohandler.cpp
+++ b/src/gui/image/qimageiohandler.cpp
@@ -272,7 +272,6 @@ QImageIOHandler::QImageIOHandler(QImageIOHandlerPrivate &dd)
*/
QImageIOHandler::~QImageIOHandler()
{
- delete d_ptr;
}
/*!
diff --git a/src/gui/image/qimageiohandler.h b/src/gui/image/qimageiohandler.h
index 3b654f3..34de715 100644
--- a/src/gui/image/qimageiohandler.h
+++ b/src/gui/image/qimageiohandler.h
@@ -44,6 +44,7 @@
#include <QtCore/qplugin.h>
#include <QtCore/qfactoryinterface.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -109,7 +110,7 @@ public:
protected:
QImageIOHandler(QImageIOHandlerPrivate &dd);
- QImageIOHandlerPrivate *d_ptr;
+ QScopedPointer<QImageIOHandlerPrivate> d_ptr;
private:
Q_DISABLE_COPY(QImageIOHandler)
};
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index 92023e0..8528173 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -132,7 +132,6 @@ QPicture::QPicture(int formatVersion)
{
Q_D(QPicture);
d_ptr->q_ptr = this;
- d->paintEngine = 0;
if (formatVersion == 0)
qWarning("QPicture: invalid format version 0");
@@ -155,7 +154,7 @@ QPicture::QPicture(int formatVersion)
*/
QPicture::QPicture(const QPicture &pic)
- : QPaintDevice(), d_ptr(pic.d_ptr)
+ : QPaintDevice(), d_ptr(pic.d_ptr.data())
{
d_func()->ref.ref();
}
@@ -173,10 +172,6 @@ QPicture::QPicture(QPicturePrivate &dptr)
*/
QPicture::~QPicture()
{
- if (!d_func()->ref.deref()) {
- delete d_func()->paintEngine;
- delete d_func();
- }
}
/*!
@@ -1030,9 +1025,7 @@ void QPicture::detach_helper()
x->formatMinor = d->formatMinor;
x->brect = d->brect;
x->override_rect = d->override_rect;
- if (!d->ref.deref())
- delete d;
- d_ptr = x;
+ d_ptr.reset(x);
}
/*!
@@ -1041,7 +1034,7 @@ void QPicture::detach_helper()
*/
QPicture& QPicture::operator=(const QPicture &p)
{
- qAtomicAssign<QPicturePrivate>(d_ptr, p.d_ptr);
+ d_ptr.assign(p.d_ptr.data());
return *this;
}
@@ -1135,8 +1128,8 @@ bool QPicturePrivate::checkFormat()
QPaintEngine *QPicture::paintEngine() const
{
if (!d_func()->paintEngine)
- const_cast<QPicture*>(this)->d_func()->paintEngine = new QPicturePaintEngine;
- return d_func()->paintEngine;
+ const_cast<QPicture*>(this)->d_func()->paintEngine.reset(new QPicturePaintEngine);
+ return d_func()->paintEngine.data();
}
/*****************************************************************************
diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h
index fe86e8d..7de1f79 100644
--- a/src/gui/image/qpicture.h
+++ b/src/gui/image/qpicture.h
@@ -106,7 +106,7 @@ private:
bool exec(QPainter *p, QDataStream &ds, int i);
void detach_helper();
- QPicturePrivate *d_ptr;
+ QScopedSharedPointer<QPicturePrivate> d_ptr;
friend class QPicturePaintEngine;
friend class Q3Picture;
friend class QAlphaPaintEngine;
@@ -114,7 +114,7 @@ private:
public:
typedef QPicturePrivate* DataPtr;
- inline DataPtr &data_ptr() { return d_ptr; }
+ inline DataPtr &data_ptr() { return d_ptr.data_ptr(); }
};
Q_DECLARE_SHARED(QPicture)
diff --git a/src/gui/image/qpicture_p.h b/src/gui/image/qpicture_p.h
index a3fd34f..e0c3117 100644
--- a/src/gui/image/qpicture_p.h
+++ b/src/gui/image/qpicture_p.h
@@ -156,7 +156,7 @@ public:
int formatMinor;
QRect brect;
QRect override_rect;
- QPaintEngine *paintEngine;
+ QScopedPointer<QPaintEngine> paintEngine;
bool in_memory_only;
QList<QImage> image_list;
QList<QPixmap> pixmap_list;
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 82be1b9..f85e21a 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -1236,7 +1236,7 @@ bool QPixmap::convertFromImage(const QImage &image, ColorMode mode)
/*!
\relates QPixmap
- Writes the given \a pixmap to the the given \a stream as a PNG
+ Writes the given \a pixmap to the given \a stream as a PNG
image. Note that writing the stream to a file will not produce a
valid image file.
@@ -2021,4 +2021,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.h b/src/gui/image/qpixmap.h
index 1863273..9ef5347 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -62,6 +62,10 @@ class QX11Info;
class QPixmapData;
+#if defined(Q_OS_SYMBIAN)
+class CFbsBitmap;
+#endif
+
class Q_GUI_EXPORT QPixmap : public QPaintDevice
{
public:
@@ -152,6 +156,11 @@ public:
static QPixmap fromMacCGImageRef(CGImageRef image);
#endif
+#if defined(Q_OS_SYMBIAN)
+ CFbsBitmap *toSymbianCFbsBitmap() const;
+ static QPixmap fromSymbianCFbsBitmap(CFbsBitmap *bitmap);
+#endif
+
inline QPixmap copy(int x, int y, int width, int height) const;
QPixmap copy(const QRect &rect = QRect()) const;
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_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index 625988a..132e26e 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -5,9 +5,40 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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 <exception>
#include <w32std.h>
#include <fbs.h>
@@ -61,14 +92,142 @@ QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h )
return QPixmap();
}
- QImage::Format format = qt_TDisplayMode2Format( displayMode );
- int bytesPerLine = CFbsBitmap::ScanLineLength(temporary->SizeInPixels().iWidth,displayMode);
- temporary->LockHeap();
- QImage image = QImage((uchar*)temporary->DataAddress(), srcRect.Width(), srcRect.Height(), bytesPerLine, format);
- QPixmap pixmap = QPixmap::fromImage(image.copy());
- temporary->UnlockHeap();
+ QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(temporary);
CBase::Delete(temporary);
return pixmap;
+}
+
+/*!
+\since 4.6
+
+Returns a \c CFbsBitmap that is equivalent to the QPixmap by copying the data.
+
+It is the caller's responsibility to delete the \c CFbsBitmap after use.
+
+\warning This function is only available on Symbian OS.
+
+\sa fromSymbianCFbsBitmap()
+*/
+
+CFbsBitmap *QPixmap::toSymbianCFbsBitmap() const
+{
+ if (isNull())
+ return 0;
+
+ TDisplayMode mode;
+ const QImage img = toImage();
+ QImage::Format destFormat = img.format();
+ switch (img.format()) {
+ case QImage::Format_Mono:
+ destFormat = QImage::Format_MonoLSB;
+ // Fall through intended
+ case QImage::Format_MonoLSB:
+ mode = EGray2;
+ break;
+ case QImage::Format_Indexed8:
+ if (img.isGrayscale())
+ mode = EGray256;
+ else
+ mode = EColor256;
+ break;
+ case QImage::Format_RGB32:
+ mode = EColor16MU;
+ break;
+ case QImage::Format_ARGB6666_Premultiplied:
+ case QImage::Format_ARGB8565_Premultiplied:
+ case QImage::Format_ARGB8555_Premultiplied:
+ destFormat = QImage::Format_ARGB32_Premultiplied;
+ // Fall through intended
+ case QImage::Format_ARGB32_Premultiplied:
+#if !defined(__SERIES60_31__) && !defined(__S60_32__)
+ // ### TODO: Add runtime detection as well?
+ mode = EColor16MAP;
+ break;
+#endif
+ destFormat = QImage::Format_ARGB32;
+ // Fall through intended
+ case QImage::Format_ARGB32:
+ mode = EColor16MA;
+ break;
+ case QImage::Format_RGB555:
+ destFormat = QImage::Format_RGB16;
+ // Fall through intended
+ case QImage::Format_RGB16:
+ mode = EColor64K;
+ break;
+ case QImage::Format_RGB666:
+ destFormat = QImage::Format_RGB888;
+ // Fall through intended
+ case QImage::Format_RGB888:
+ mode = EColor16M;
+ break;
+ case QImage::Format_RGB444:
+ mode = EColor4K;
+ break;
+ case QImage::Format_Invalid:
+ return 0;
+ default:
+ qWarning("Image format not supported: %d", img.format());
+ return 0;
+ }
+
+ CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
+ TSize size(width(), height());
+ if (bitmap->Create(size, mode) != KErrNone) {
+ CBase::Delete(bitmap);
+ return 0;
+ }
+
+ const QImage converted = img.convertToFormat(destFormat);
+
+ bitmap->LockHeap();
+ const uchar *sptr = converted.bits();
+ uchar *dptr = (uchar*)bitmap->DataAddress();
+ Mem::Copy(dptr, sptr, converted.numBytes());
+ bitmap->UnlockHeap();
+ return bitmap;
+}
+
+/*!
+\since 4.6
+
+Returns a QPixmap that is equivalent to the \c CFbsBitmap by copying the data.
+If the CFbsBitmap is not valid or is compressed in memory, this function will
+return a null QPixmap.
+
+\warning This function is only available on Symbian OS.
+
+\sa toSymbianCFbsBitmap(), {QPixmap#Pixmap Conversion}{Pixmap Conversion}
+*/
+QPixmap QPixmap::fromSymbianCFbsBitmap(CFbsBitmap *bitmap)
+{
+ int width = bitmap->SizeInPixels().iWidth;
+ int height = bitmap->SizeInPixels().iHeight;
+
+ if (!bitmap || width <= 0 || height <= 0 || bitmap->IsCompressedInRAM())
+ return QPixmap();
+
+ TDisplayMode displayMode = bitmap->DisplayMode();
+ QImage::Format format = qt_TDisplayMode2Format(displayMode);
+ int bytesPerLine = CFbsBitmap::ScanLineLength(width, displayMode);
+ bitmap->LockHeap();
+ QImage image = QImage((const uchar*)bitmap->DataAddress(), width, height, bytesPerLine, format);
+ if (displayMode == EGray2) {
+ image.setNumColors(2);
+ image.setColor(0, QColor(Qt::color0).rgba());
+ image.setColor(1, QColor(Qt::color1).rgba());
+ } else if (displayMode == EGray256) {
+ for (int i=0; i < 256; ++i)
+ image.setColor(i, qRgb(i, i, i));
+ }else if (displayMode == EColor256) {
+ const TColor256Util *palette = TColor256Util::Default();
+ for (int i=0; i < 256; ++i)
+ image.setColor(i, (QRgb)(palette->Color256(i).Value()));
+ }
+ QPixmap pixmap = QPixmap::fromImage(image.copy());
+ bitmap->UnlockHeap();
+ return pixmap;
}
+
QT_END_NAMESPACE
diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp
index cbe9004..6a8b38a 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 38916c7..d2e8d84 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 c9973d0..4f71e09 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -323,7 +323,12 @@ void QPixmapCache::remove(const QString &key)
void QPixmapCache::clear()
{
- pm_cache()->clear();
+ QT_TRY {
+ pm_cache()->clear();
+ } QT_CATCH(const std::bad_alloc &) {
+ // if we ran out of memory during pm_cache(), it's no leak,
+ // so just ignore it.
+ }
}
QT_END_NAMESPACE
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index 50f8a12..b33489e 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -62,7 +92,7 @@ public:
TCoeInputCapabilities inputCapabilities();
private:
- void commitCurrentString();
+ void commitCurrentString(bool triggeredBySymbian);
void updateHints();
void applyHints(Qt::InputMethodHints hints);
void applyFormat(QList<QInputMethodEvent::Attribute> *attributes);
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 8612e55..7d79422 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -58,10 +88,9 @@ QCoeFepInputContext::~QCoeFepInputContext()
// This is to make sure that the FEP manager "forgets" about us,
// otherwise we may get callbacks even after we're destroyed.
- // The call is asynchronous though, so we must spin the event loop
- // to make sure it gets detected.
- CCoeEnv::Static()->InputCapabilitiesChanged();
- QApplication::processEvents();
+ // The call below is essentially equivalent to InputCapabilitiesChanged(),
+ // but is synchronous, rather than asynchronous.
+ CCoeEnv::Static()->SyncNotifyFocusObserversOfChangeInFocus();
if (m_fepState)
delete m_fepState;
@@ -89,9 +118,7 @@ void QCoeFepInputContext::update()
void QCoeFepInputContext::setFocusWidget(QWidget *w)
{
- commitCurrentString();
-
- CCoeEnv::Static()->Fep()->CancelTransaction();
+ commitCurrentString(false);
QInputContext::setFocusWidget(w);
@@ -258,56 +285,17 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event)
{
Q_ASSERT(m_isEditing);
+ Q_ASSERT(focusWidget());
- if (!m_pointerHandler) {
- QInputContext::mouseHandler(x, event);
- }
-
- TPointerEvent::TType type;
- TUint modifiers = 0;
-
- if (event->type() == QEvent::MouseButtonPress) {
- if (event->button() == Qt::LeftButton) {
- type = TPointerEvent::EButton1Down;
- } else if (event->button() == Qt::RightButton) {
- type = TPointerEvent::EButton3Down;
- } else if (event->button() == Qt::MidButton) {
- type = TPointerEvent::EButton2Down;
- } else {
- return;
- }
- } else if (event->type() == QEvent::MouseButtonRelease) {
- if (event->button() == Qt::LeftButton) {
- type = TPointerEvent::EButton1Up;
- } else if (event->button() == Qt::RightButton) {
- type = TPointerEvent::EButton3Up;
- } else if (event->button() == Qt::MidButton) {
- type = TPointerEvent::EButton2Up;
- } else {
- return;
- }
- } else if (event->type() == QEvent::MouseMove) {
- type = TPointerEvent::EMove;
- } else if (event->type() == QEvent::DragMove) {
- type = TPointerEvent::EDrag;
- } else {
- return;
- }
+ if (event->type() == QEvent::MouseButtonPress && event->button() == Qt::LeftButton) {
+ commitCurrentString(false);
+ int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
- if (event->modifiers() & Qt::ShiftModifier) {
- modifiers |= EModifierShift;
- }
- if (event->modifiers() & Qt::AltModifier) {
- modifiers |= EModifierAlt;
- }
- if (event->modifiers() & Qt::ControlModifier) {
- modifiers |= EModifierCtrl;
- }
- if (event->modifiers() & Qt::KeypadModifier) {
- modifiers |= EModifierKeypad;
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos + x, 0, QVariant());
+ QInputMethodEvent event("", attributes);
+ sendEvent(event);
}
-
- m_pointerHandler->HandlePointerEventInInlineTextL(type, modifiers, x);
}
TCoeInputCapabilities QCoeFepInputContext::inputCapabilities()
@@ -341,6 +329,8 @@ void QCoeFepInputContext::updateHints()
m_lastImHints = hints;
applyHints(hints);
}
+ } else {
+ CCoeEnv::Static()->InputCapabilitiesChanged();
}
}
@@ -606,13 +596,13 @@ void QCoeFepInputContext::SetCursorSelectionForFepL(const TCursorSelection& aCur
if (!w)
return;
- int pos = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + aCursorSelection.iCursorPos + 1;
+ int pos = aCursorSelection.iAnchorPos;
+ int length = aCursorSelection.iCursorPos - pos;
QList<QInputMethodEvent::Attribute> attributes;
- attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, pos, 1, QVariant());
+ attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos, length, QVariant());
QInputMethodEvent event(m_preeditString, attributes);
- // ### FIXME Sets preeditcursor and not cursor. Probably needs new API.
- //sendEvent(event);
+ sendEvent(event);
}
void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const
@@ -621,9 +611,8 @@ void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSele
if (!w)
return;
- QVariant cursorVar = w->inputMethodQuery(Qt::ImCursorPosition);
- int cursor = cursorVar.toInt() + m_preeditString.size();
- int anchor = cursor - w->inputMethodQuery(Qt::ImCurrentSelection).toString().size();
+ int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + m_preeditString.size();
+ int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt() + m_preeditString.size();
aCursorSelection.iAnchorPos = anchor;
aCursorSelection.iCursorPos = cursor;
}
@@ -679,12 +668,10 @@ void QCoeFepInputContext::GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLin
void QCoeFepInputContext::DoCommitFepInlineEditL()
{
- commitCurrentString();
-
- m_isEditing = false;
+ commitCurrentString(true);
}
-void QCoeFepInputContext::commitCurrentString()
+void QCoeFepInputContext::commitCurrentString(bool triggeredBySymbian)
{
if (m_preeditString.size() == 0) {
return;
@@ -695,6 +682,12 @@ void QCoeFepInputContext::commitCurrentString()
event.setCommitString(m_preeditString, 0, 0);//m_preeditString.size());
m_preeditString.clear();
sendEvent(event);
+
+ m_isEditing = false;
+
+ if (!triggeredBySymbian) {
+ CCoeEnv::Static()->Fep()->CancelTransaction();
+ }
}
MCoeFepAwareTextEditor_Extension1* QCoeFepInputContext::Extension1(TBool& aSetToTrue)
diff --git a/src/gui/inputmethod/qwininputcontext_win.cpp b/src/gui/inputmethod/qwininputcontext_win.cpp
index e3e8aa4..d670f5a 100644
--- a/src/gui/inputmethod/qwininputcontext_win.cpp
+++ b/src/gui/inputmethod/qwininputcontext_win.cpp
@@ -759,7 +759,12 @@ void QInputContextPrivate::updateImeStatus(QWidget *w, bool hasFocus)
{
if (!w)
return;
- bool e = w->testAttribute(Qt::WA_InputMethodEnabled) && w->isEnabled();
+ // It's always the proxy that carries the hints.
+ QWidget *focusProxyWidget = w->focusProxy();
+ if (!focusProxyWidget)
+ focusProxyWidget = w;
+ bool e = w->testAttribute(Qt::WA_InputMethodEnabled) && w->isEnabled()
+ && !(focusProxyWidget->inputMethodHints() & Qt::ImhExclusiveInputMask);
bool hasIme = e && hasFocus;
#ifdef Q_IME_DEBUG
qDebug("%s HasFocus = %d hasIme = %d e = %d ", w->className(), hasFocus, hasIme, e);
diff --git a/src/gui/inputmethod/qximinputcontext_x11.cpp b/src/gui/inputmethod/qximinputcontext_x11.cpp
index c320fb4..60ea15b 100644
--- a/src/gui/inputmethod/qximinputcontext_x11.cpp
+++ b/src/gui/inputmethod/qximinputcontext_x11.cpp
@@ -610,7 +610,7 @@ void QXIMInputContext::setFocusWidget(QWidget *w)
QInputContext::setFocusWidget(w);
- if (!w)
+ if (!w || w->inputMethodHints() & Qt::ImhExclusiveInputMask)
return;
ICData *data = ximData.value(w->effectiveWinId());
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index d1f3791..2576724 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -61,6 +61,7 @@
#ifndef QT_NO_ACCESSIBILITY
#include <qaccessible.h>
#endif
+#include <private/qactiontokeyeventmapper_p.h>
QT_BEGIN_NAMESPACE
@@ -1338,7 +1339,7 @@ QSize QAbstractItemView::iconSize() const
/*!
\property QAbstractItemView::textElideMode
- \brief the the position of the "..." in elided text.
+ \brief the position of the "..." in elided text.
The default value for all item views is Qt::ElideRight.
*/
@@ -2003,16 +2004,18 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
if (QApplication::keypadNavigationEnabled()) {
if (!hasEditFocus()) {
setEditFocus(true);
+ QActionToKeyEventMapper::addSoftKey(QAction::BackSoftKey, Qt::Key_Back, this);
return;
}
}
break;
case Qt::Key_Back:
- case Qt::Key_Context2: // TODO: aportale, remove KEYPAD_NAVIGATION_HACK when softkey support is there
- if (QApplication::keypadNavigationEnabled() && hasEditFocus())
+ if (QApplication::keypadNavigationEnabled() && hasEditFocus()) {
+ QActionToKeyEventMapper::removeSoftkey(this);
setEditFocus(false);
- else
+ } else {
event->ignore();
+ }
return;
default:
if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
@@ -3221,9 +3224,9 @@ QStyleOptionViewItem QAbstractItemView::viewOptions() const
option.state &= ~QStyle::State_MouseOver;
option.font = font();
-#ifdef Q_WS_WIN
- // Note this is currently required on Windows
- // do give non-focused item views inactive appearance
+#ifndef Q_WS_MAC
+ // On mac the focus appearance follows window activation
+ // not widget activation
if (!hasFocus())
option.state &= ~QStyle::State_Active;
#endif
diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h
index 16bd1ab..c4bf4db 100644
--- a/src/gui/itemviews/qabstractitemview_p.h
+++ b/src/gui/itemviews/qabstractitemview_p.h
@@ -304,7 +304,7 @@ public:
*/
inline bool isPersistent(const QModelIndex &index) const
{
- return static_cast<QAbstractItemModelPrivate *>(model->d_ptr)->persistent.indexes.contains(index);
+ return static_cast<QAbstractItemModelPrivate *>(model->d_ptr.data())->persistent.indexes.contains(index);
}
QModelIndexList selectedDraggableIndexes() const;
diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp
index ac62551..af4d42a 100644
--- a/src/gui/itemviews/qfileiconprovider.cpp
+++ b/src/gui/itemviews/qfileiconprovider.cpp
@@ -180,7 +180,6 @@ QFileIconProvider::QFileIconProvider()
QFileIconProvider::~QFileIconProvider()
{
- delete d_ptr;
}
/*!
diff --git a/src/gui/itemviews/qfileiconprovider.h b/src/gui/itemviews/qfileiconprovider.h
index 7928552..a6152ea 100644
--- a/src/gui/itemviews/qfileiconprovider.h
+++ b/src/gui/itemviews/qfileiconprovider.h
@@ -42,8 +42,9 @@
#ifndef QFILEICONPROVIDER_H
#define QFILEICONPROVIDER_H
-#include <QtGui/qicon.h>
#include <QtCore/qfileinfo.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtGui/qicon.h>
QT_BEGIN_HEADER
@@ -67,7 +68,7 @@ public:
private:
Q_DECLARE_PRIVATE(QFileIconProvider)
- QFileIconProviderPrivate *d_ptr;
+ QScopedPointer<QFileIconProviderPrivate> d_ptr;
Q_DISABLE_COPY(QFileIconProvider)
};
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index d373163..f888f5f 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 147f523..fda6255 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>
@@ -218,7 +219,7 @@ QSizeF QItemDelegatePrivate::doTextLayout(int lineWidth) const
editor widget, which is a widget that is placed on top of the view
while editing takes place. Editors are created with a
QItemEditorFactory; a default static instance provided by
- QItemEditorFactory is installed on all item delagates. You can set
+ QItemEditorFactory is installed on all item delegates. You can set
a custom factory using setItemEditorFactory() or set a new default
factory with QItemEditorFactory::setDefaultFactory(). It is the
data stored in the item model with the Qt::EditRole that is edited.
@@ -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/qlistwidget.cpp b/src/gui/itemviews/qlistwidget.cpp
index 7a366d1..bf3b43c 100644
--- a/src/gui/itemviews/qlistwidget.cpp
+++ b/src/gui/itemviews/qlistwidget.cpp
@@ -1158,7 +1158,7 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
/*!
\fn void QListWidget::addItem(QListWidgetItem *item)
- Inserts the \a item at the the end of the list widget.
+ Inserts the \a item at the end of the list widget.
\warning A QListWidgetItem can only be added to a
QListWidget once. Adding the same QListWidgetItem multiple
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp
index 43feda8..92dfd19 100644
--- a/src/gui/itemviews/qsortfilterproxymodel.cpp
+++ b/src/gui/itemviews/qsortfilterproxymodel.cpp
@@ -1518,7 +1518,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/qstandarditemmodel.cpp b/src/gui/itemviews/qstandarditemmodel.cpp
index 61e410d..4ec00bb 100644
--- a/src/gui/itemviews/qstandarditemmodel.cpp
+++ b/src/gui/itemviews/qstandarditemmodel.cpp
@@ -778,8 +778,6 @@ QStandardItem &QStandardItem::operator=(const QStandardItem &other)
*/
QStandardItem::~QStandardItem()
{
- Q_D(QStandardItem);
- delete d;
}
/*!
diff --git a/src/gui/itemviews/qstandarditemmodel.h b/src/gui/itemviews/qstandarditemmodel.h
index f24f0ab..66d7576 100644
--- a/src/gui/itemviews/qstandarditemmodel.h
+++ b/src/gui/itemviews/qstandarditemmodel.h
@@ -240,7 +240,7 @@ protected:
QStandardItem(const QStandardItem &other);
QStandardItem(QStandardItemPrivate &dd);
QStandardItem &operator=(const QStandardItem &other);
- QStandardItemPrivate *d_ptr;
+ QScopedPointer<QStandardItemPrivate> d_ptr;
void emitDataChanged();
diff --git a/src/gui/itemviews/qstyleditemdelegate.cpp b/src/gui/itemviews/qstyleditemdelegate.cpp
index 4dc54a1..b75f151 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/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index 62c1277..1070648 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());
}
/*!
@@ -846,17 +846,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) {
+ //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)));
- sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder());
} 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/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp
index 6103225..0f2a27c 100644
--- a/src/gui/itemviews/qtreewidget.cpp
+++ b/src/gui/itemviews/qtreewidget.cpp
@@ -853,7 +853,7 @@ void QTreeModel::sortItems(QList<QTreeWidgetItem*> *items, int column, Qt::SortO
items->replace(r, item);
for (int c = 0; c < colCount; ++c) {
QModelIndex from = createIndex(oldRow, c, item);
- if (static_cast<QAbstractItemModelPrivate *>(d_ptr)->persistent.indexes.contains(from)) {
+ if (static_cast<QAbstractItemModelPrivate *>(d_ptr.data())->persistent.indexes.contains(from)) {
QModelIndex to = createIndex(r, c, item);
fromList << from;
toList << to;
diff --git a/src/gui/itemviews/qtreewidgetitemiterator.cpp b/src/gui/itemviews/qtreewidgetitemiterator.cpp
index 3e30e03..7e167b9 100644
--- a/src/gui/itemviews/qtreewidgetitemiterator.cpp
+++ b/src/gui/itemviews/qtreewidgetitemiterator.cpp
@@ -97,7 +97,7 @@ QTreeWidgetItemIterator::QTreeWidgetItemIterator(QTreeWidget *widget, IteratorFl
Q_ASSERT(widget);
QTreeModel *model = qobject_cast<QTreeModel*>(widget->model());
Q_ASSERT(model);
- d_ptr = new QTreeWidgetItemIteratorPrivate(this, model);
+ d_ptr.reset(new QTreeWidgetItemIteratorPrivate(this, model));
model->iterators.append(this);
if (!model->rootItem->children.isEmpty()) current = model->rootItem->children.first();
if (current && !matchesFlags(current))
@@ -150,7 +150,6 @@ QTreeWidgetItemIterator::QTreeWidgetItemIterator(QTreeWidgetItem *item, Iterator
QTreeWidgetItemIterator::~QTreeWidgetItemIterator()
{
d_func()->m_model->iterators.removeAll(this);
- delete d_ptr;
}
/*!
diff --git a/src/gui/itemviews/qtreewidgetitemiterator.h b/src/gui/itemviews/qtreewidgetitemiterator.h
index 8a76c69..535339d 100644
--- a/src/gui/itemviews/qtreewidgetitemiterator.h
+++ b/src/gui/itemviews/qtreewidgetitemiterator.h
@@ -43,6 +43,7 @@
#define QTREEWIDGETITEMITERATOR_H
#include <QtCore/qglobal.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -105,7 +106,7 @@ public:
private:
bool matchesFlags(const QTreeWidgetItem *item) const;
- QTreeWidgetItemIteratorPrivate *d_ptr;
+ QScopedPointer<QTreeWidgetItemIteratorPrivate> d_ptr;
QTreeWidgetItem *current;
IteratorFlags flags;
Q_DECLARE_PRIVATE(QTreeWidgetItemIterator)
diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp
index abb17d7..b1db8d6 100644
--- a/src/gui/kernel/qaction.cpp
+++ b/src/gui/kernel/qaction.cpp
@@ -81,7 +81,8 @@ static QString qt_strippedText(QString s)
QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0),
visible(1), forceInvisible(0), checkable(0), checked(0), separator(0), fontSet(false),
- menuRole(QAction::TextHeuristicRole), iconVisibleInMenu(-1)
+ menuRole(QAction::TextHeuristicRole), softKeyRole(QAction::OptionsSoftKey),
+ iconVisibleInMenu(-1)
{
#ifdef QT3_SUPPORT
static int qt_static_action_id = -1;
@@ -1348,6 +1349,32 @@ QAction::MenuRole QAction::menuRole() const
}
/*!
+ \property QAction::softKeyRole
+ \brief the action's softkey role
+ \since 4.6
+
+ This indicates what softkey action this action is. Usually used on mobile
+ platforms to map QActions to hardware keys.
+
+ The softkey role can be changed any time.
+*/
+void QAction::setSoftKeyRole(SoftKeyRole softKeyRole)
+{
+ Q_D(QAction);
+ if (d->softKeyRole == softKeyRole)
+ return;
+
+ d->softKeyRole = softKeyRole;
+ d->sendDataChanged();
+}
+
+QAction::SoftKeyRole QAction::softKeyRole() const
+{
+ Q_D(const QAction);
+ return d->softKeyRole;
+}
+
+/*!
\property QAction::iconVisibleInMenu
\brief Whether or not an action should show an icon in a menu
\since 4.4
diff --git a/src/gui/kernel/qaction.h b/src/gui/kernel/qaction.h
index d7bf8c3..dfa4933 100644
--- a/src/gui/kernel/qaction.h
+++ b/src/gui/kernel/qaction.h
@@ -67,6 +67,7 @@ class Q_GUI_EXPORT QAction : public QObject
Q_DECLARE_PRIVATE(QAction)
Q_ENUMS(MenuRole)
+ Q_ENUMS(SoftKeyRole)
Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable)
Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE isCheckable NOTIFY toggled)
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled)
@@ -84,11 +85,17 @@ class Q_GUI_EXPORT QAction : public QObject
#endif
Q_PROPERTY(bool visible READ isVisible WRITE setVisible)
Q_PROPERTY(MenuRole menuRole READ menuRole WRITE setMenuRole)
+ Q_PROPERTY(SoftKeyRole softKeyRole READ softKeyRole WRITE setSoftKeyRole)
Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu)
public:
enum MenuRole { NoRole, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole,
AboutRole, PreferencesRole, QuitRole };
+ enum SoftKeyRole { OptionsSoftKey, SelectSoftKey, BackSoftKey, NextSoftKey, PreviousSoftKey,
+ OkSoftKey, CancelSoftKey, EditSoftKey, ViewSoftKey, BackSpaceSoftKey,
+ EndEditSoftKey, RevertEditSoftKey, DeselectSoftKey, FinishSoftKey,
+ MenuSoftKey, ContextMenuSoftKey, ExitSoftKey, Key1SoftKey, Key2SoftKey,
+ Key3SoftKey, Key4SoftKey, CustomSoftKey };
explicit QAction(QObject* parent);
QAction(const QString &text, QObject* parent);
QAction(const QIcon &icon, const QString &text, QObject* parent);
@@ -168,6 +175,9 @@ public:
void setMenuRole(MenuRole menuRole);
MenuRole menuRole() const;
+ void setSoftKeyRole(SoftKeyRole softKeyRole);
+ SoftKeyRole softKeyRole() const;
+
void setIconVisibleInMenu(bool visible);
bool isIconVisibleInMenu() const;
diff --git a/src/gui/kernel/qaction_p.h b/src/gui/kernel/qaction_p.h
index 0617ef5..6051d9a 100644
--- a/src/gui/kernel/qaction_p.h
+++ b/src/gui/kernel/qaction_p.h
@@ -102,6 +102,7 @@ public:
uint separator : 1;
uint fontSet : 1;
QAction::MenuRole menuRole;
+ QAction::SoftKeyRole softKeyRole;
int iconVisibleInMenu : 3; // Only has values -1, 0, and 1
QList<QWidget *> widgets;
#ifndef QT_NO_GRAPHICSVIEW
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index fb002a3..aa6d21e 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -1006,7 +1006,8 @@ QApplication::~QApplication()
if (QWidgetPrivate::mapper) {
QWidgetMapper * myMapper = QWidgetPrivate::mapper;
QWidgetPrivate::mapper = 0;
- for (QWidgetMapper::Iterator it = myMapper->begin(); it != myMapper->end(); ++it) {
+ for (QWidgetMapper::ConstIterator it = myMapper->constBegin();
+ it != myMapper->constEnd(); ++it) {
register QWidget *w = *it;
if (!w->parent()) // window
w->destroy(true, true);
@@ -1018,7 +1019,7 @@ QApplication::~QApplication()
if (QWidgetPrivate::uncreatedWidgets) {
QWidgetSet *mySet = QWidgetPrivate::uncreatedWidgets;
QWidgetPrivate::uncreatedWidgets = 0;
- for (QWidgetSet::Iterator it = mySet->begin(); it != mySet->end(); ++it) {
+ for (QWidgetSet::ConstIterator it = mySet->constBegin(); it != mySet->constEnd(); ++it) {
register QWidget *w = *it;
if (!w->parent()) // window
w->destroy(true, true);
@@ -4764,7 +4765,7 @@ void QApplicationPrivate::emitLastWindowClosed()
If \a enable is true, Qt::Key_Up and Qt::Key_Down are used to change focus.
- This feature is available in Qt for Embedded Linux only.
+ This feature is available in Qt for Embedded Linux and Symbian only.
\sa keypadNavigationEnabled()
*/
@@ -4775,9 +4776,9 @@ void QApplication::setKeypadNavigationEnabled(bool enable)
/*!
Returns true if Qt is set to use keypad navigation; otherwise returns
- false. The default is false.
+ false. The default value is true on Symbian, but false on other platforms.
- This feature is available in Qt for Embedded Linux only.
+ This feature is available in Qt for Embedded Linux and Symbian only.
\sa setKeypadNavigationEnabled()
*/
@@ -4993,8 +4994,7 @@ void QApplication::setInputContext(QInputContext *inputContext)
qWarning("QApplication::setInputContext: called with 0 input context");
return;
}
- if (d->inputContext)
- delete d->inputContext;
+ delete d->inputContext;
d->inputContext = inputContext;
}
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h
index ca0eb98..e1b8b26 100644
--- a/src/gui/kernel/qapplication.h
+++ b/src/gui/kernel/qapplication.h
@@ -233,7 +233,8 @@ public:
#if defined(Q_WS_S60)
int s60ProcessEvent(TWsEvent *event);
virtual bool s60EventFilter(TWsEvent *aEvent);
- void s60HandleCommandL(int command);
+ void symbianHandleCommand(int command);
+ void symbianResourceChange(int type);
#endif
#if defined(Q_WS_QWS)
virtual bool qwsEventFilter(QWSEvent *);
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index a6fc602..35a532a 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -100,6 +100,7 @@ extern QSysInfo::MacVersion qt_macver;
#if defined(Q_WS_QWS)
class QWSManager;
class QDirectPainter;
+struct QWSServerCleaner { ~QWSServerCleaner(); };
#endif
#ifndef QT_NO_TABLET
@@ -382,6 +383,7 @@ public:
#ifdef Q_WS_QWS
QPointer<QWSManager> last_manager;
+ QWSServerCleaner qwsServerCleaner;
# ifndef QT_NO_DIRECTPAINTER
QMap<WId, QDirectPainter *> *directPainters;
# endif
diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp
index 018440f..aeebde4 100644
--- a/src/gui/kernel/qapplication_qws.cpp
+++ b/src/gui/kernel/qapplication_qws.cpp
@@ -159,6 +159,8 @@ bool qws_overrideCursor = false;
#ifndef QT_NO_QWS_MANAGER
#include "qdecorationfactory_qws.h"
+extern Q_GUI_EXPORT QWSServer *qwsServer;
+
QT_BEGIN_NAMESPACE
QT_USE_NAMESPACE
@@ -485,8 +487,13 @@ QList<QWSCommand*> *qt_get_server_queue()
void qt_server_enqueue(const QWSCommand *command)
{
QWSCommand *copy = QWSCommand::factory(command->type);
- copy->copyFrom(command);
- outgoing.append(copy);
+ QT_TRY {
+ copy->copyFrom(command);
+ outgoing.append(copy);
+ } QT_CATCH(...) {
+ delete copy;
+ QT_RETHROW;
+ }
}
QWSDisplay::Data::Data(QObject* parent, bool singleProcess)
@@ -2295,7 +2302,7 @@ void qt_init(QApplicationPrivate *priv, int type)
qws_decoration = QApplication::qwsSetDecoration(decoration);
#endif // QT_NO_QWS_MANAGER
#ifndef QT_NO_QWS_INPUTMETHODS
- qApp->setInputContext(new QWSInputContext);
+ qApp->setInputContext(new QWSInputContext(qApp));
#endif
}
@@ -3542,10 +3549,10 @@ bool QETWidget::translateKeyEvent(const QWSKeyEvent *event, bool grab) /* grab i
#if defined QT3_SUPPORT && !defined(QT_NO_SHORTCUT)
if (type == QEvent::KeyPress && !grab
- && static_cast<QApplicationPrivate*>(qApp->d_ptr)->use_compat()) {
+ && static_cast<QApplicationPrivate*>(qApp->d_ptr.data())->use_compat()) {
// send accel events if the keyboard is not grabbed
QKeyEvent a(type, code, state, text, autor, int(text.length()));
- if (static_cast<QApplicationPrivate*>(qApp->d_ptr)->qt_tryAccelEvent(this, &a))
+ if (static_cast<QApplicationPrivate*>(qApp->d_ptr.data())->qt_tryAccelEvent(this, &a))
return true;
}
#else
@@ -3745,4 +3752,14 @@ void QApplication::setArgs(int c, char **v)
d->argv = v;
}
+/* \internal
+ This is used to clean up the qws server
+ in case the QApplication constructor threw an exception
+ */
+QWSServerCleaner::~QWSServerCleaner()
+{
+ if (qwsServer && qws_single_process)
+ QWSServer::closedown();
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index dd51fcd..4c008fb 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -14,6 +44,7 @@
#include "qevent.h"
#include "qeventdispatcher_s60_p.h"
#include "qwidget.h"
+#include "qdesktopwidget.h"
#include "private/qbackingstore_p.h"
#include "qt_s60_p.h"
#include "private/qevent_p.h"
@@ -27,7 +58,7 @@
#endif
#include "private/qwindowsurface_s60_p.h"
#include "qpaintengine.h"
-#include "qmenubar.h"
+#include "private/qmenubar_p.h"
#include "apgwgnam.h" // For CApaWindowGroupName
#include <MdaAudioTonePlayer.h> // For CMdaAudioToneUtility
@@ -49,6 +80,8 @@ static bool appNoGrab = false; // Grabbing enabled
Q_GUI_EXPORT QS60Data *qt_s60Data = 0;
extern bool qt_sendSpontaneousEvent(QObject*,QEvent*);
+extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp
+
QWidget *qt_button_down = 0; // widget got last button-down
bool qt_nograb() // application no-grab option
@@ -201,7 +234,7 @@ static void mapS60MouseEventTypeToQt(QEvent::Type *type, Qt::MouseButton *button
*type = QEvent::MouseButtonDblClick;
}
- if (*type == QEvent::MouseButtonPress)
+ if (*type == QEvent::MouseButtonPress || *type == QEvent::MouseButtonDblClick)
QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons | (*button);
else if (*type == QEvent::MouseButtonRelease)
QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons &(~(*button));
@@ -310,7 +343,7 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons
QMouseEvent mEvent(QEvent::MouseButtonPress, alienWidget->mapFrom(qwidget, widgetPos), globalPos,
Qt::RightButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier);
sendMouseEvent(alienWidget, &mEvent);
- m_previousEventLongTap = true;
+ m_previousEventLongTap = false;
}
void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent)
@@ -339,7 +372,7 @@ void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent)
TPoint controlScreenPos = PositionRelativeToScreen();
QPoint globalPos = QPoint(controlScreenPos.iX, controlScreenPos.iY) + widgetPos;
- if (type == QEvent::MouseButtonPress)
+ if (type == QEvent::MouseButtonPress || type == QEvent::MouseButtonDblClick)
{
// get the button press target
alienWidget = qwidget->childAt(widgetPos);
@@ -359,7 +392,7 @@ void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent)
alienWidget = S60->mousePressTarget;
if (alienWidget != S60->lastPointerEventTarget)
- if (type == QEvent::MouseButtonPress || type == QEvent::MouseMove)
+ if (type == QEvent::MouseButtonPress || type == QEvent::MouseButtonDblClick || type == QEvent::MouseMove)
{
//moved to another widget, create enter and leave events
if (S60->lastPointerEventTarget)
@@ -408,6 +441,13 @@ void QSymbianControl::sendMouseEvent(QWidget *widget, QMouseEvent *mEvent)
TKeyResponse QSymbianControl::OfferKeyEventL(const TKeyEvent& keyEvent, TEventCode type)
{
+ TKeyResponse r = EKeyWasNotConsumed;
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(r = OfferKeyEvent(keyEvent, type));
+ return r;
+}
+
+TKeyResponse QSymbianControl::OfferKeyEvent(const TKeyEvent& keyEvent, TEventCode type)
+{
switch (type) {
//case EEventKeyDown: // <-- Intentionally left out. See below.
case EEventKeyUp:
@@ -521,7 +561,14 @@ TKeyResponse QSymbianControl::sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent)
#ifndef QT_NO_IM
TCoeInputCapabilities QSymbianControl::InputCapabilities() const
{
- QWidget *w = qwidget->focusWidget();
+ QWidget *w = 0;
+
+ if(qwidget->hasFocus()) {
+ w = qwidget;
+ } else {
+ w = qwidget->focusWidget();
+ }
+
QCoeFepInputContext *ic;
if (w && w->isEnabled() && w->testAttribute(Qt::WA_InputMethodEnabled)
&& (ic = qobject_cast<QCoeFepInputContext *>(w->inputContext()))) {
@@ -639,21 +686,7 @@ void QSymbianControl::HandleResourceChange(int resourceType)
// font change event
break;
case KEikDynamicLayoutVariantSwitch:
- {
-#ifndef QT_NO_STYLE_S60
- QS60Style *s60Style = 0;
-
-#ifndef QT_NO_STYLE_STYLESHEET
- QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle*>(QApplication::style());
- if (proxy)
- s60Style = qobject_cast<QS60Style*>(proxy->baseStyle());
- else
-#endif
- s60Style = qobject_cast<QS60Style*>(QApplication::style());
-
- if (s60Style)
- s60Style->handleDynamicLayoutVariantSwitch();
-#endif
+ {
if (qwidget->isFullScreen()) {
SetExtentToWholeScreen();
} else if (qwidget->isMaximized()) {
@@ -662,12 +695,6 @@ void QSymbianControl::HandleResourceChange(int resourceType)
}
break;
}
-#ifndef QT_NO_STYLE_S60
- case KAknsMessageSkinChange:
- if (QS60Style *s60Style = qobject_cast<QS60Style*>(QApplication::style()))
- s60Style->handleSkinChange();
- break;
-#endif
default:
break;
}
@@ -988,6 +1015,13 @@ int QApplication::s60ProcessEvent(TWsEvent *event)
case EEventScreenDeviceChanged:
if (S60)
S60->updateScreenSize();
+ if (qt_desktopWidget) {
+ QSize oldSize = qt_desktopWidget->size();
+ qt_desktopWidget->data->crect.setWidth(S60->screenWidthInPixels);
+ qt_desktopWidget->data->crect.setHeight(S60->screenHeightInPixels);
+ QResizeEvent e(qt_desktopWidget->size(), oldSize);
+ QApplication::sendEvent(qt_desktopWidget, &e);
+ }
return 0; // Propagate to CONE
case EEventWindowVisibilityChanged:
if (controlInMap) {
@@ -1001,6 +1035,7 @@ int QApplication::s60ProcessEvent(TWsEvent *event)
} else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible)
&& !w->d_func()->maybeBackingStore()) {
w->d_func()->topData()->backingStore = new QWidgetBackingStore(w);
+ w->update();
}
return 1;
}
@@ -1020,17 +1055,67 @@ bool QApplication::s60EventFilter(TWsEvent *aEvent)
return false;
}
-void QApplication::s60HandleCommandL(int command)
+/*!
+ Handles commands which are typically handled by CAknAppUi::HandleCommandL()
+ Qts Ui integration into Symbian is partially achieved by deriving from CAknAppUi.
+ Currently, exit, menu and softkey commands are handled
+
+ \sa s60EventFilter(), s60ProcessEvent()
+*/
+void QApplication::symbianHandleCommand(int command)
{
switch (command) {
case EEikCmdExit:
- case EAknSoftkeyBack:
case EAknSoftkeyExit:
- qApp->exit();
+ exit();
+ break;
+ default:
+ if (command >= SOFTKEYSTART && command <= SOFTKEYEND) {
+ int index= command-SOFTKEYSTART;
+ QWidget* focused = QApplication::focusWidget();
+ const QList<QAction*>& softKeys = focused->softKeys();
+ Q_ASSERT(index<softKeys.count());
+ softKeys.at(index)->activate(QAction::Trigger);
+ }
+ else
+ QMenuBarPrivate::symbianCommands(command);
+ break;
+ }
+}
+
+void QApplication::symbianResourceChange(int type)
+{
+ switch (type) {
+ case KEikDynamicLayoutVariantSwitch:
+ {
+ if (S60)
+ S60->updateScreenSize();
+
+#ifndef QT_NO_STYLE_S60
+ QS60Style *s60Style = 0;
+
+#ifndef QT_NO_STYLE_STYLESHEET
+ QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle*>(QApplication::style());
+ if (proxy)
+ s60Style = qobject_cast<QS60Style*>(proxy->baseStyle());
+ else
+#endif
+ s60Style = qobject_cast<QS60Style*>(QApplication::style());
+
+ if (s60Style)
+ s60Style->handleDynamicLayoutVariantSwitch();
+#endif
+ }
break;
+
+#ifndef QT_NO_STYLE_S60
+ case KAknsMessageSkinChange:
+ if (QS60Style *s60Style = qobject_cast<QS60Style*>(QApplication::style()))
+ s60Style->handleSkinChange();
+ break;
+#endif
+
default:
- // For now assume all unknown menu items are Qt menu items
- QMenuBar::symbianCommands(command);
break;
}
}
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index f14ad6f..239ee14 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -1675,20 +1675,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/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index a3c9406..12155f0 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -2955,10 +2955,10 @@ QWidget *QApplication::topLevelAt(const QPoint &p)
Window wid = widget->internalWinId();
while (ctarget && !w) {
X11->ignoreBadwindow();
- XTranslateCoordinates(X11->display,
- QX11Info::appRootWindow(screen),
- ctarget, x, y, &unused, &unused, &ctarget);
- if (X11->badwindow())
+ if (!XTranslateCoordinates(X11->display,
+ QX11Info::appRootWindow(screen),
+ ctarget, x, y, &unused, &unused, &ctarget)
+ || X11->badwindow())
break;
if (ctarget == wid) {
// Found!
diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp
index 917b5d5..bab3449 100644
--- a/src/gui/kernel/qclipboard.cpp
+++ b/src/gui/kernel/qclipboard.cpp
@@ -466,7 +466,7 @@ void QClipboard::setPixmap(const QPixmap &pixmap, Mode mode)
The \a mode argument is used to control which part of the system
clipboard is used. If \a mode is QClipboard::Clipboard, this
- function clears the the global clipboard contents. If \a mode is
+ function clears the global clipboard contents. If \a mode is
QClipboard::Selection, this function clears the global mouse
selection contents. If \a mode is QClipboard::FindBuffer, this
function clears the search string buffer.
diff --git a/src/gui/kernel/qclipboard_s60.cpp b/src/gui/kernel/qclipboard_s60.cpp
index ec595b5..f89f3e5 100644
--- a/src/gui/kernel/qclipboard_s60.cpp
+++ b/src/gui/kernel/qclipboard_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/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/qcocoapanel_mac.mm b/src/gui/kernel/qcocoapanel_mac.mm
index c69826f..b2941fe 100644
--- a/src/gui/kernel/qcocoapanel_mac.mm
+++ b/src/gui/kernel/qcocoapanel_mac.mm
@@ -107,9 +107,16 @@ QT_USE_NAMESPACE
- (void)sendEvent:(NSEvent *)event
{
- [self retain];
-
QWidget *widget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self];
+
+ // Cocoa can hold onto the window after we've disavowed its knowledge. So,
+ // if we get sent an event afterwards just have it go through the super's
+ // version and don't do any stuff with Qt.
+ if (!widget) {
+ [super sendEvent:event];
+ return;
+ }
+ [self retain];
QT_MANGLE_NAMESPACE(QCocoaView) *view = static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(qt_mac_nativeview_for(widget));
Qt::MouseButton mouseButton = cocoaButton2QtButton([event buttonNumber]);
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 4ceae3f..f1a7f39 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -789,10 +789,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]));
@@ -800,10 +812,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);
@@ -813,10 +825,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);
@@ -828,10 +840,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 983c762..527b1a6 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/qcocoawindow_mac.mm b/src/gui/kernel/qcocoawindow_mac.mm
index 89f481f..8e62f02 100644
--- a/src/gui/kernel/qcocoawindow_mac.mm
+++ b/src/gui/kernel/qcocoawindow_mac.mm
@@ -128,12 +128,19 @@ QT_USE_NAMESPACE
- (void)sendEvent:(NSEvent *)event
{
- [self retain];
-
QWidget *widget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self];
+
+ // Cocoa can hold onto the window after we've disavowed its knowledge. So,
+ // if we get sent an event afterwards just have it go through the super's
+ // version and don't do any stuff with Qt.
+ if (!widget) {
+ [super sendEvent:event];
+ return;
+ }
+
+ [self retain];
QT_MANGLE_NAMESPACE(QCocoaView) *view = static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(qt_mac_nativeview_for(widget));
Qt::MouseButton mouseButton = cocoaButton2QtButton([event buttonNumber]);
-
// sometimes need to redirect mouse events to the popup.
QWidget *popup = qAppInstance()->activePopupWidget();
if (popup && popup != widget) {
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index c24abc4..21a4287 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/qcursor_qws.cpp b/src/gui/kernel/qcursor_qws.cpp
index 097b982..99800a8 100644
--- a/src/gui/kernel/qcursor_qws.cpp
+++ b/src/gui/kernel/qcursor_qws.cpp
@@ -66,7 +66,11 @@ QCursorData::~QCursorData()
{
delete bm;
delete bmm;
- QPaintDevice::qwsDisplay()->destroyCursor(id);
+ QT_TRY {
+ QPaintDevice::qwsDisplay()->destroyCursor(id);
+ } QT_CATCH(const std::bad_alloc &) {
+ // do nothing.
+ }
}
diff --git a/src/gui/kernel/qcursor_s60.cpp b/src/gui/kernel/qcursor_s60.cpp
index 4d3f067..a281130 100644
--- a/src/gui/kernel/qcursor_s60.cpp
+++ b/src/gui/kernel/qcursor_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp
index 029892e..eefd0ef 100644
--- a/src/gui/kernel/qdesktopwidget_s60.cpp
+++ b/src/gui/kernel/qdesktopwidget_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -32,34 +62,58 @@ public:
static int screenCount;
static int primaryScreen;
+
+ static QVector<QRect> *rects;
+ static QVector<QRect> *workrects;
+
+ static int refcount;
};
int QDesktopWidgetPrivate::screenCount = 1;
int QDesktopWidgetPrivate::primaryScreen = 0;
+QVector<QRect> *QDesktopWidgetPrivate::rects = 0;
+QVector<QRect> *QDesktopWidgetPrivate::workrects = 0;
+int QDesktopWidgetPrivate::refcount = 0;
QDesktopWidgetPrivate::QDesktopWidgetPrivate()
{
+ ++refcount;
}
QDesktopWidgetPrivate::~QDesktopWidgetPrivate()
{
+ if (!--refcount)
+ cleanup();
}
void QDesktopWidgetPrivate::init(QDesktopWidget *that)
{
- TInt screenCount=0;
- TInt result=0;
+ int screenCount=0;
+
+ if (HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount) == KErrNone)
+ QDesktopWidgetPrivate::screenCount = screenCount;
+ else
+ QDesktopWidgetPrivate::screenCount = 0;
+
+ rects = new QVector<QRect>();
+ workrects = new QVector<QRect>();
- result = HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount);
- QDesktopWidgetPrivate::screenCount = screenCount;
- if( result != KErrNone)
- {
- // ### What to do if no screens found?
- }
+ rects->resize(QDesktopWidgetPrivate::screenCount);
+ workrects->resize(QDesktopWidgetPrivate::screenCount);
+
+ // ### TODO: Implement proper multi-display support
+ rects->resize(1);
+ rects->replace(0, that->rect());
+ workrects->resize(1);
+ workrects->replace(0, that->rect());
}
void QDesktopWidgetPrivate::cleanup()
{
+ delete rects;
+ rects = 0;
+ delete workrects;
+ workrects = 0;
}
@@ -120,6 +174,29 @@ int QDesktopWidget::screenNumber(const QPoint &point) const
void QDesktopWidget::resizeEvent(QResizeEvent *)
{
+ Q_D(QDesktopWidget);
+ QVector<QRect> oldrects;
+ oldrects = *d->rects;
+ QVector<QRect> oldworkrects;
+ oldworkrects = *d->workrects;
+ int oldscreencount = d->screenCount;
+
+ QDesktopWidgetPrivate::cleanup();
+ QDesktopWidgetPrivate::init(this);
+
+ for (int i = 0; i < qMin(oldscreencount, d->screenCount); ++i) {
+ QRect oldrect = oldrects[i];
+ QRect newrect = d->rects->at(i);
+ if (oldrect != newrect)
+ emit resized(i);
+ }
+
+ for (int j = 0; j < qMin(oldscreencount, d->screenCount); ++j) {
+ QRect oldrect = oldworkrects[j];
+ QRect newrect = d->workrects->at(j);
+ if (oldrect != newrect)
+ emit workAreaResized(j);
+ }
}
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qdnd_s60.cpp b/src/gui/kernel/qdnd_s60.cpp
index 09605be..c459f8f 100644
--- a/src/gui/kernel/qdnd_s60.cpp
+++ b/src/gui/kernel/qdnd_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 2aed287..ba85eea 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -1665,6 +1665,17 @@ Qt::ButtonState QContextMenuEvent::state() const
several are specified for any character in the string the behaviour
is undefined.
+ \value Selection
+ If set, the edit cursor should be moved to the specified position
+ in the editor text contents. In contrast with \c Cursor, this
+ attribute does not work on the preedit text, but on the surrounding
+ text. The cursor will be moved after the commit string has been
+ committed, and the preedit string will be located at the new edit
+ position.
+ The start position specifies the new position and the length
+ variable can be used to set a selection starting from that point.
+ The value is unused.
+
\sa Attribute
*/
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 2724315..7696d05 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -424,7 +424,8 @@ public:
TextFormat,
Cursor,
Language,
- Ruby
+ Ruby,
+ Selection
};
class Attribute {
public:
diff --git a/src/gui/kernel/qeventdispatcher_s60.cpp b/src/gui/kernel/qeventdispatcher_s60.cpp
index 862f4ef..fcf572e 100644
--- a/src/gui/kernel/qeventdispatcher_s60.cpp
+++ b/src/gui/kernel/qeventdispatcher_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -32,18 +62,22 @@ bool QEventDispatcherS60::processEvents ( QEventLoop::ProcessEventsFlags flags )
{
bool ret = false;
- bool oldNoInputEventsValue = m_noInputEvents;
- if (flags & QEventLoop::ExcludeUserInputEvents) {
- m_noInputEvents = true;
- } else {
- m_noInputEvents = false;
- ret = sendDeferredInputEvents() || ret;
+ QT_TRY {
+ bool oldNoInputEventsValue = m_noInputEvents;
+ if (flags & QEventLoop::ExcludeUserInputEvents) {
+ m_noInputEvents = true;
+ } else {
+ m_noInputEvents = false;
+ ret = sendDeferredInputEvents() || ret;
+ }
+
+ ret = QEventDispatcherSymbian::processEvents(flags) || ret;
+
+ m_noInputEvents = oldNoInputEventsValue;
+ } QT_CATCH (const std::exception& ex) {
+ CActiveScheduler::Current()->Error(qt_translateExceptionToSymbianError(ex));
}
- ret = QEventDispatcherSymbian::processEvents(flags) || ret;
-
- m_noInputEvents = oldNoInputEventsValue;
-
return ret;
}
diff --git a/src/gui/kernel/qeventdispatcher_s60_p.h b/src/gui/kernel/qeventdispatcher_s60_p.h
index fec8773..e42af95 100644
--- a/src/gui/kernel/qeventdispatcher_s60_p.h
+++ b/src/gui/kernel/qeventdispatcher_s60_p.h
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/kernel/qkeymapper_s60.cpp b/src/gui/kernel/qkeymapper_s60.cpp
index 2919551..bb074c1 100644
--- a/src/gui/kernel/qkeymapper_s60.cpp
+++ b/src/gui/kernel/qkeymapper_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 352d26a..3bcf9e3 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -629,8 +629,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/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp
index 86894b4..7a19252 100644
--- a/src/gui/kernel/qshortcutmap.cpp
+++ b/src/gui/kernel/qshortcutmap.cpp
@@ -148,9 +148,8 @@ public:
QShortcutMap constructor.
*/
QShortcutMap::QShortcutMap()
+ : d_ptr(new QShortcutMapPrivate(this))
{
- d_ptr = new QShortcutMapPrivate(this);
- Q_ASSERT(d_ptr != 0);
resetState();
}
@@ -159,8 +158,6 @@ QShortcutMap::QShortcutMap()
*/
QShortcutMap::~QShortcutMap()
{
- delete d_ptr;
- d_ptr = 0;
}
/*! \internal
diff --git a/src/gui/kernel/qshortcutmap_p.h b/src/gui/kernel/qshortcutmap_p.h
index 3fe9546..28ee1f0 100644
--- a/src/gui/kernel/qshortcutmap_p.h
+++ b/src/gui/kernel/qshortcutmap_p.h
@@ -55,6 +55,7 @@
#include "QtGui/qkeysequence.h"
#include "QtCore/qvector.h"
+#include "QtCore/qscopedpointer.h"
QT_BEGIN_NAMESPACE
@@ -104,7 +105,7 @@ private:
#ifndef QT_NO_ACTION
bool correctContext(Qt::ShortcutContext context,QAction *a, QWidget *active_window) const;
#endif
- QShortcutMapPrivate *d_ptr;
+ QScopedPointer<QShortcutMapPrivate> d_ptr;
QKeySequence::SequenceMatch find(QKeyEvent *e);
QKeySequence::SequenceMatch matches(const QKeySequence &seq1, const QKeySequence &seq2) const;
diff --git a/src/gui/kernel/qsound_s60.cpp b/src/gui/kernel/qsound_s60.cpp
index 2ac7e26..00fc2fe 100644
--- a/src/gui/kernel/qsound_s60.cpp
+++ b/src/gui/kernel/qsound_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -116,10 +146,11 @@ QAuServer* qt_new_audio_server()
QAuBucketS60::QAuBucketS60( QAuServerS60 *server, QSound *sound )
: m_sound( sound ), m_server( server ), m_prepared(false), m_playCalled(false)
{
+ QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath();
+ filepath = QDir::toNativeSeparators(filepath);
+ TPtrC filepathPtr(qt_QString2TPtrC(filepath));
TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this);
- QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath();
- filepath = QDir::toNativeSeparators(filepath);
- m_playUtility->OpenFileL(qt_QString2TPtrC(filepath)));
+ m_playUtility->OpenFileL(filepathPtr));
if(err){
m_server->playCompleted(this, err);
}
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 4eac35e..2d47a14 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -117,6 +147,7 @@ protected:
void FocusChanged(TDrawNow aDrawNow);
private:
+ TKeyResponse OfferKeyEvent(const TKeyEvent& aKeyEvent,TEventCode aType);
TKeyResponse sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent);
void sendMouseEvent(QWidget *widget, QMouseEvent *mEvent);
void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation );
@@ -212,37 +243,40 @@ static inline QFont qt_TFontSpec2QFontL(const TFontSpec &fontSpec)
static inline QImage::Format qt_TDisplayMode2Format(TDisplayMode mode)
{
- QImage::Format format;
- switch(mode) {
- case EColor256:
- // TODO: is the correct?
- format = QImage::Format_Indexed8;
- break;
- case EColor4K:
- format = QImage::Format_RGB444;
- break;
- case EColor64K:
- format = QImage::Format_RGB16;
- break;
- case EColor16M:
- format = QImage::Format_RGB666;
- break;
- case EColor16MU:
- format = QImage::Format_RGB32;
- break;
- case EColor16MA:
- format = QImage::Format_ARGB32;
- break;
-#ifdef __S60_50__
- case EColor16MAP:
- format = QImage::Format_ARGB32_Premultiplied;
- break;
-#endif
- default:
- qFatal("Screen format not supported");
- break;
- }
- return format;
+ QImage::Format format;
+ switch(mode) {
+ case EGray2:
+ format = QImage::Format_MonoLSB;
+ break;
+ case EColor256:
+ case EGray256:
+ format = QImage::Format_Indexed8;
+ break;
+ case EColor4K:
+ format = QImage::Format_RGB444;
+ break;
+ case EColor64K:
+ format = QImage::Format_RGB16;
+ break;
+ case EColor16M:
+ format = QImage::Format_RGB666;
+ break;
+ case EColor16MU:
+ format = QImage::Format_RGB32;
+ break;
+ case EColor16MA:
+ format = QImage::Format_ARGB32;
+ break;
+#if !defined(__SERIES60_31__) && !defined(__S60_32__)
+ case EColor16MAP:
+ format = QImage::Format_ARGB32_Premultiplied;
+ break;
+#endif
+ default:
+ format = QImage::Format_Invalid;
+ break;
+ }
+ return format;
}
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 06f618d..a83a79f 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -172,7 +172,8 @@ extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); // qapplication.cpp
extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp
QWidgetPrivate::QWidgetPrivate(int version) :
- QObjectPrivate(version), extra(0), focus_child(0)
+ QObjectPrivate(version), extra(0),
+ focus_next(0), focus_prev(0), focus_child(0)
,layout(0), widgetItem(0)
,leftmargin(0), topmargin(0), rightmargin(0), bottommargin(0)
,leftLayoutItemMargin(0), topLayoutItemMargin(0), rightLayoutItemMargin(0)
@@ -884,6 +885,30 @@ void QWidget::setAutoFillBackground(bool enabled)
\endlist
\sa QEvent, QPainter, QGridLayout, QBoxLayout
+
+ \section1 SoftKeys
+ \since 4.6
+ \preliminary
+
+ Softkeys API is a platform independent way of mapping actions to (hardware)keys
+ and toolbars provided by the underlying platform.
+
+ There are three major use cases supported. First one is a mobile device
+ with keypad navigation and no touch ui. Second use case is a mobile
+ device with touch ui. Third use case is desktop. For now the softkey API is
+ only implemented for Series60.
+
+ QActions are set to widget(s) via softkey API. Actions in focused widget are
+ mapped to native toolbar or hardware keys. Even though the API allows to set
+ any amount of widgets there might be physical restrictions to amount of
+ softkeys that can be used by the device.
+
+ \o Series60: For series60 menu button is automatically mapped to left
+ soft key if there is QMainWindow with QMenuBar in widgets parent hierarchy.
+
+ \sa softKeys()
+ \sa setSoftKey()
+
*/
QWidgetMapper *QWidgetPrivate::mapper = 0; // widget with wid
@@ -927,6 +952,23 @@ QRegion qt_dirtyRegion(QWidget *widget)
\endlist
*/
+struct QWidgetExceptionCleaner
+{
+ /* this cleans up when the constructor throws an exception */
+ static inline void cleanup(QWidget *that, QWidgetPrivate *d)
+ {
+#ifndef QT_NO_EXCEPTIONS
+ QWidgetPrivate::uncreatedWidgets->remove(that);
+ if (d->focus_next != that) {
+ if (d->focus_next)
+ d->focus_next->d_func()->focus_prev = d->focus_prev;
+ if (d->focus_prev)
+ d->focus_prev->d_func()->focus_next = d->focus_next;
+ }
+#endif
+ }
+};
+
/*!
Constructs a widget which is a child of \a parent, with widget
flags set to \a f.
@@ -956,7 +998,12 @@ QRegion qt_dirtyRegion(QWidget *widget)
QWidget::QWidget(QWidget *parent, Qt::WindowFlags f)
: QObject(*new QWidgetPrivate, 0), QPaintDevice()
{
- d_func()->init(parent, f);
+ QT_TRY {
+ d_func()->init(parent, f);
+ } QT_CATCH(...) {
+ QWidgetExceptionCleaner::cleanup(this, d_func());
+ QT_RETHROW;
+ }
}
#ifdef QT3_SUPPORT
@@ -967,8 +1014,13 @@ QWidget::QWidget(QWidget *parent, Qt::WindowFlags f)
QWidget::QWidget(QWidget *parent, const char *name, Qt::WindowFlags f)
: QObject(*new QWidgetPrivate, 0), QPaintDevice()
{
- d_func()->init(parent , f);
- setObjectName(QString::fromAscii(name));
+ QT_TRY {
+ d_func()->init(parent , f);
+ setObjectName(QString::fromAscii(name));
+ } QT_CATCH(...) {
+ QWidgetExceptionCleaner::cleanup(this, d_func());
+ QT_RETHROW;
+ }
}
#endif
@@ -977,7 +1029,13 @@ QWidget::QWidget(QWidget *parent, const char *name, Qt::WindowFlags f)
QWidget::QWidget(QWidgetPrivate &dd, QWidget* parent, Qt::WindowFlags f)
: QObject(dd, 0), QPaintDevice()
{
- d_func()->init(parent, f);
+ Q_D(QWidget);
+ QT_TRY {
+ d->init(parent, f);
+ } QT_CATCH(...) {
+ QWidgetExceptionCleaner::cleanup(this, d_func());
+ QT_RETHROW;
+ }
}
/*!
@@ -2046,17 +2104,20 @@ static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QPoin
// Defined in qmacstyle_mac.cpp
extern void qt_mac_fill_background(QPainter *painter, const QRegion &rgn, const QPoint &offset, const QBrush &brush);
qt_mac_fill_background(painter, rgn, offset, brush);
-#elif defined(Q_WS_S60)
- // Defined in qs60style_symbian.cpp
- extern void qt_s60_fill_background(QPainter *painter, const QRegion &rgn,
- const QPoint &offset, const QBrush &brush);
- qt_s60_fill_background(painter, rgn, offset, brush);
#else
- const QRegion translated = rgn.translated(offset);
- const QRect rect(translated.boundingRect());
- painter->setClipRegion(translated);
- painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft());
-#endif
+#if !defined(QT_NO_STYLE_S60)
+ // Defined in qs60style.cpp
+ extern bool qt_s60_fill_background(QPainter *painter, const QRegion &rgn,
+ const QPoint &offset, const QBrush &brush);
+ if (!qt_s60_fill_background(painter, rgn, offset, brush))
+#endif // !defined(QT_NO_STYLE_S60)
+ {
+ const QRegion translated = rgn.translated(offset);
+ const QRect rect(translated.boundingRect());
+ painter->setClipRegion(translated);
+ painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft());
+ }
+#endif // Q_WS_MAC
} else {
const QVector<QRect> &rects = rgn.rects();
for (int i = 0; i < rects.size(); ++i)
@@ -2361,13 +2422,26 @@ void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool
)
{
Q_Q(QWidget);
- createExtra();
-
QStyle *oldStyle = q->style();
#ifndef QT_NO_STYLE_STYLESHEET
- QStyle *origStyle = extra->style;
+ QStyle *origStyle = 0;
+#endif
+
+#ifdef Q_WS_MAC
+ // the metalhack boolean allows Qt/Mac to do a proper re-polish depending
+ // on how the Qt::WA_MacBrushedMetal attribute is set. It is only ever
+ // set when changing that attribute and passes the widget's CURRENT style.
+ // therefore no need to do a reassignment.
+ if (!metalHack)
+#endif
+ {
+ createExtra();
+
+#ifndef QT_NO_STYLE_STYLESHEET
+ origStyle = extra->style;
#endif
- extra->style = newStyle;
+ extra->style = newStyle;
+ }
// repolish
if (q->windowType() != Qt::Desktop) {
@@ -4864,6 +4938,13 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
d->extra->inRenderWithPainter = false;
}
+#if !defined(Q_WS_S60)
+void QWidgetPrivate::setSoftKeys_sys(const QList<QAction*> &softkeys)
+{
+ Q_UNUSED(softkeys)
+}
+#endif // !defined(Q_WS_S60)
+
bool QWidgetPrivate::isAboutToShow() const
{
if (data.in_show)
@@ -5052,7 +5133,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
#ifndef QT_NO_SCROLLAREA
QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(q->parent());
if (scrollArea && scrollArea->viewport() == q) {
- QObjectData *scrollPrivate = static_cast<QWidget *>(scrollArea)->d_ptr;
+ QObjectData *scrollPrivate = static_cast<QWidget *>(scrollArea)->d_ptr.data();
QAbstractScrollAreaPrivate *priv = static_cast<QAbstractScrollAreaPrivate *>(scrollPrivate);
scrollAreaOffset = priv->contentsOffset();
p.translate(-scrollAreaOffset);
@@ -5699,9 +5780,12 @@ bool QWidget::hasFocus() const
void QWidget::setFocus(Qt::FocusReason reason)
{
+ Q_D(QWidget);
+ d->setSoftKeys_sys(softKeys());
+
if (!isEnabled())
return;
-
+
QWidget *f = this;
while (f->d_func()->extra && f->d_func()->extra->focus_proxy)
f = f->d_func()->extra->focus_proxy;
@@ -5809,8 +5893,9 @@ void QWidget::setFocus(Qt::FocusReason reason)
void QWidget::clearFocus()
{
QWidget *w = this;
- while (w && w->d_func()->focus_child == this) {
- w->d_func()->focus_child = 0;
+ while (w) {
+ if (w->d_func()->focus_child == this)
+ w->d_func()->focus_child = 0;
w = w->parentWidget();
}
#ifndef QT_NO_GRAPHICSVIEW
@@ -6287,7 +6372,7 @@ QByteArray QWidget::saveGeometry() const
returns false.
If the restored geometry is off-screen, it will be modified to be
- inside the the available screen geometry.
+ inside the available screen geometry.
To restore geometry saved using QSettings, you can use code like
this:
@@ -8484,6 +8569,9 @@ QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const
return QRect(width()/2, 0, 1, height());
case Qt::ImFont:
return font();
+ case Qt::ImAnchorPosition:
+ // Fallback.
+ return inputMethodQuery(Qt::ImCursorPosition);
default:
return QVariant();
}
@@ -11490,6 +11578,66 @@ void QWidget::clearMask()
setMask(QRegion());
}
+/*!
+ \preliminary
+ \since 4.6
+
+ Returns the (possibly empty) list of this widget's softkeys.
+ Returned list cannot be changed. Softkeys should be added
+ and removed via method called setSoftKeys
+
+ \sa setSoftKey(), setSoftKeys()
+*/
+const QList<QAction*>& QWidget::softKeys() const
+{
+ Q_D(const QWidget);
+ if( d->softKeys.count() > 0)
+ return d->softKeys;
+ if (isWindow() || !parentWidget())
+ return d->softKeys;
+
+ return parentWidget()->softKeys();
+}
+
+/*!
+ \preliminary
+ \since 4.6
+
+ Sets the softkey \a softkey to this widget's list of softkeys,
+ Setting 0 as softkey will clear all the existing softkeys set
+ to the widget
+ A QWidget can have 0 or more softkeys
+
+ \sa softKeys(), setSoftKeys()
+*/
+void QWidget::setSoftKey(QAction *softKey)
+{
+ Q_D(QWidget);
+ qDeleteAll(d->softKeys);
+ d->softKeys.clear();
+ if (softKey)
+ d->softKeys.append(softKey);
+ if (QApplication::focusWidget() == this)
+ d->setSoftKeys_sys(this->softKeys());
+}
+
+/*!
+ Sets the list of softkeys \a softkeys to this widget's list of softkeys,
+ A QWidget can have 0 or more softkeys
+
+ \sa softKeys(), setSoftKey()
+*/
+void QWidget::setSoftKeys(const QList<QAction*> &softKeys)
+{
+ Q_D(QWidget);
+ qDeleteAll(d->softKeys);
+ d->softKeys.clear();
+ d->softKeys = softKeys;
+
+ if ((QApplication::focusWidget() == this) || (QApplication::focusWidget()==0))
+ d->setSoftKeys_sys(this->softKeys());
+}
+
/*! \fn const QX11Info &QWidget::x11Info() const
Returns information about the configuration of the X display used to display
the widget.
diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h
index 0dd470d..1edd466 100644
--- a/src/gui/kernel/qwidget.h
+++ b/src/gui/kernel/qwidget.h
@@ -554,6 +554,9 @@ public:
void removeAction(QAction *action);
QList<QAction*> actions() const;
#endif
+ const QList<QAction*>& softKeys() const;
+ void setSoftKey(QAction *softKey);
+ void setSoftKeys(const QList<QAction*> &softKeys);
QWidget *parentWidget() const;
@@ -728,6 +731,7 @@ private:
friend class QGraphicsProxyWidget;
friend class QGraphicsProxyWidgetPrivate;
friend class QStyleSheetStyle;
+ friend struct QWidgetExceptionCleaner;
#ifdef Q_WS_MAC
friend class QCoreGraphicsPaintEnginePrivate;
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index f863428..e2197c6 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -1215,7 +1215,7 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event,
QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(widget->parent());
QPoint scrollAreaOffset;
if (scrollArea && scrollArea->viewport() == widget) {
- QAbstractScrollAreaPrivate *priv = static_cast<QAbstractScrollAreaPrivate *>(static_cast<QWidget *>(scrollArea)->d_ptr);
+ QAbstractScrollAreaPrivate *priv = static_cast<QAbstractScrollAreaPrivate *>(static_cast<QWidget *>(scrollArea)->d_ptr.data());
scrollAreaOffset = priv->contentsOffset();
p.translate(-scrollAreaOffset);
}
@@ -3600,11 +3600,15 @@ void QWidgetPrivate::raise_sys()
}
} else {
// Cocoa doesn't really have an idea of Z-ordering, but you can
- // fake it by changing the order of it.
+ // fake it by changing the order of it. But beware, removing an
+ // NSView will also remove it as the first responder. So we re-set
+ // the first responder just in case:
NSView *view = qt_mac_nativeview_for(q);
NSView *parentView = [view superview];
+ NSResponder *firstResponder = [[view window] firstResponder];
[view removeFromSuperview];
[parentView addSubview:view];
+ [[view window] makeFirstResponder:firstResponder];
}
#else
if(q->isWindow()) {
@@ -3642,6 +3646,7 @@ void QWidgetPrivate::lower_sys()
NSArray *tmpViews = [parentView subviews];
NSMutableArray *subviews = [[NSMutableArray alloc] initWithCapacity:[tmpViews count]];
[subviews addObjectsFromArray:tmpViews];
+ NSResponder *firstResponder = [[myview window] firstResponder];
// Implicit assumption that myViewIndex is included in subviews, that's why I'm not checking
// myViewIndex.
NSUInteger index = 0;
@@ -3661,6 +3666,7 @@ void QWidgetPrivate::lower_sys()
for (NSView *subview in subviews)
[parentView addSubview:subview];
[subviews release];
+ [[myview window] makeFirstResponder:firstResponder];
}
#else
if(q->isWindow()) {
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index d5f1b98..084439c 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -84,6 +84,9 @@ class RDrawableWindow;
class CCoeControl;
class CAknTitlePane;
class CAknContextPane;
+// The following 2 defines may only be needed for s60. To be seen.
+const int SOFTKEYSTART=5000;
+const int SOFTKEYEND=5004;
#endif
QT_BEGIN_NAMESPACE
@@ -224,6 +227,7 @@ public:
explicit QWidgetPrivate(int version = QObjectPrivateVersion);
~QWidgetPrivate();
+ void setSoftKeys_sys(const QList<QAction*> &softkeys);
QWExtra *extraData() const;
QTLWExtra *topData() const;
QTLWExtra *maybeTopData() const;
@@ -511,6 +515,7 @@ public:
#ifndef QT_NO_ACTION
QList<QAction*> actions;
#endif
+ QList<QAction*> softKeys;
QLayout *layout;
QWidgetItemV2 *widgetItem;
#if !defined(QT_NO_IM)
diff --git a/src/gui/kernel/qwidget_qws.cpp b/src/gui/kernel/qwidget_qws.cpp
index 1445f57..0073d3f 100644
--- a/src/gui/kernel/qwidget_qws.cpp
+++ b/src/gui/kernel/qwidget_qws.cpp
@@ -652,7 +652,8 @@ void QWidgetPrivate::hide_sys()
q->releaseMouse();
// requestWindowRegion(QRegion());
- extra->topextra->backingStore->releaseBuffer();
+ if (extra->topextra->backingStore)
+ extra->topextra->backingStore->releaseBuffer();
QWidget::qwsDisplay()->requestFocus(data.winid,false);
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 5c3055d..bc69d6d 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -22,6 +52,8 @@
#include <qinputcontext.h>
+#include <aknappui.h>
+
QT_BEGIN_NAMESPACE
extern bool qt_nograb();
@@ -29,6 +61,56 @@ extern bool qt_nograb();
QWidget *QWidgetPrivate::mouseGrabber = 0;
QWidget *QWidgetPrivate::keyboardGrabber = 0;
+static bool isEqual(const QList<QAction*>& a, const QList<QAction*>& b)
+{
+ if ( a.count() != b.count())
+ return false;
+ int index=0;
+ while (index<a.count()) {
+ if (a.at(index)->softKeyRole() != b.at(index)->softKeyRole())
+ return false;
+ if (a.at(index)->text().compare(b.at(index)->text())!=0)
+ return false;
+ index++;
+ }
+ return true;
+}
+
+
+void QWidgetPrivate::setSoftKeys_sys(const QList<QAction*> &softkeys)
+{
+ Q_Q(QWidget);
+ if (QApplication::focusWidget() && q!=QApplication::focusWidget()) {
+ QList<QAction *> old = QApplication::focusWidget()->softKeys();
+ if (isEqual(old, softkeys ))
+ return;
+ }
+ CCoeAppUi* appui = CEikonEnv::Static()->AppUi();
+ CAknAppUi* aknAppUi = static_cast <CAknAppUi*>(appui);
+ CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba();
+ nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
+
+ int placeInScreen=0;
+ for (int index = 0; index < softkeys.count(); index++) {
+ const QAction* softKeyAction = softkeys.at(index);
+ if (softKeyAction->softKeyRole() != QAction::ContextMenuSoftKey) {
+
+ HBufC* text = qt_QString2HBufC(softKeyAction->text());
+ CleanupStack::PushL(text);
+ if (softKeyAction->softKeyRole() == QAction::MenuSoftKey) {
+ nativeContainer->SetCommandL(placeInScreen, EAknSoftkeyOptions, *text);
+ } else {
+ nativeContainer->SetCommandL(placeInScreen, SOFTKEYSTART + index, *text);
+ }
+ CleanupStack::PopAndDestroy();
+ placeInScreen++;
+ }
+ if (placeInScreen==1)
+ placeInScreen=2;
+ }
+ nativeContainer->DrawDeferred(); // 3.1 needs an extra invitation
+}
+
void QWidgetPrivate::setWSGeometry(bool dontShow)
{
@@ -289,7 +371,8 @@ void QWidgetPrivate::hide_sys()
deactivateWidgetCleanup();
WId id = q->internalWinId();
if (q->isWindow() && id) {
- id->SetFocus(false);
+ if(id->IsFocused()) // Avoid unnecessry calls to FocusChanged()
+ id->SetFocus(false);
id->MakeVisible(false);
id->ControlEnv()->AppUi()->RemoveFromStack(id);
if (QWidgetBackingStore *bs = maybeBackingStore())
@@ -305,7 +388,8 @@ void QWidgetPrivate::setFocus_sys()
{
Q_Q(QWidget);
if (q->testAttribute(Qt::WA_WState_Created) && q->window()->windowType() != Qt::Popup)
- q->effectiveWinId()->SetFocus(true);
+ if(!q->effectiveWinId()->IsFocused()) // Avoid unnecessry calls to FocusChanged()
+ q->effectiveWinId()->SetFocus(true);
}
void QWidgetPrivate::raise_sys()
@@ -892,7 +976,8 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
releaseKeyboard();
if (destroyWindow && !(windowType() == Qt::Desktop) && internalWinId()) {
WId id = internalWinId();
- id->SetFocus(false);
+ if(id->IsFocused()) // Avoid unnecessry calls to FocusChanged()
+ id->SetFocus(false);
id->ControlEnv()->AppUi()->RemoveFromStack(id);
CBase::Delete(id);
@@ -973,5 +1058,4 @@ void QWidget::activateWindow()
rw->SetOrdinalPosition(0);
}
}
-
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 6202b35..6250fb77 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -1509,7 +1509,6 @@ QWidget *QWidget::keyboardGrabber()
void QWidget::activateWindow()
{
- Q_D(QWidget);
QWidget *tlw = window();
if (tlw->isVisible() && !tlw->d_func()->topData()->embedded && !X11->deferred_map.contains(tlw)) {
if (X11->userTime == 0)
@@ -2487,6 +2486,8 @@ void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r)
QRect sr = valid_rect ? r : clipRect();
if (just_update)
q->update();
+ else if (!valid_rect)
+ dirty.translate(dx, dy);
int x1, y1, x2, y2, w = sr.width(), h = sr.height();
if (dx > 0) {
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 33d53e4..693e506 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -190,7 +190,8 @@ embedded {
symbian {
SOURCES += \
painting/qpaintdevice_s60.cpp \
- painting/qregion_s60.cpp
+ painting/qregion_s60.cpp \
+ painting/qcolormap_s60.cpp
}
x11|embedded {
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index 854d0aa..c22791a 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -221,7 +221,7 @@ bool qHasPixmapTexture(const QBrush& brush)
{
if (brush.style() != Qt::TexturePattern)
return false;
- QTexturedBrushData *tx_data = static_cast<QTexturedBrushData *>(brush.d);
+ QTexturedBrushData *tx_data = static_cast<QTexturedBrushData *>(brush.d.data());
return tx_data->m_has_pixmap_texture;
}
@@ -230,6 +230,37 @@ struct QGradientBrushData : public QBrushData
QGradient gradient;
};
+struct QBrushDataPointerHandler
+{
+ static inline void deleteData(QBrushData *d)
+ {
+ switch (d->style) {
+ case Qt::TexturePattern:
+ delete static_cast<QTexturedBrushData*>(d);
+ break;
+ case Qt::LinearGradientPattern:
+ case Qt::RadialGradientPattern:
+ case Qt::ConicalGradientPattern:
+ delete static_cast<QGradientBrushData*>(d);
+ break;
+ default:
+ delete d;
+ }
+ }
+
+ static inline void cleanup(QBrushData *d)
+ {
+ if (d && !d->ref.deref()) {
+ deleteData(d);
+ }
+ }
+
+ static inline void reset(QBrushData *&d, QBrushData *other)
+ {
+ cleanup(d);
+ d = other;
+ }
+};
/*!
\class QBrush
@@ -364,20 +395,20 @@ void QBrush::init(const QColor &color, Qt::BrushStyle style)
{
switch(style) {
case Qt::NoBrush:
- d = nullBrushInstance();
+ d.data_ptr() = nullBrushInstance();
d->ref.ref();
if (d->color != color) setColor(color);
return;
case Qt::TexturePattern:
- d = new QTexturedBrushData;
+ d.data_ptr() = new QTexturedBrushData;
break;
case Qt::LinearGradientPattern:
case Qt::RadialGradientPattern:
case Qt::ConicalGradientPattern:
- d = new QGradientBrushData;
+ d.data_ptr() = new QGradientBrushData;
break;
default:
- d = new QBrushData;
+ d.data_ptr() = new QBrushData;
break;
}
d->ref = 1;
@@ -391,8 +422,8 @@ void QBrush::init(const QColor &color, Qt::BrushStyle style)
*/
QBrush::QBrush()
+ : d(nullBrushInstance())
{
- d = nullBrushInstance();
Q_ASSERT(d);
d->ref.ref();
}
@@ -435,7 +466,7 @@ QBrush::QBrush(Qt::BrushStyle style)
if (qbrush_check_type(style))
init(Qt::black, style);
else {
- d = nullBrushInstance();
+ d.data_ptr() = nullBrushInstance();
d->ref.ref();
}
}
@@ -451,7 +482,7 @@ QBrush::QBrush(const QColor &color, Qt::BrushStyle style)
if (qbrush_check_type(style))
init(color, style);
else {
- d = nullBrushInstance();
+ d.data_ptr() = nullBrushInstance();
d->ref.ref();
}
}
@@ -468,7 +499,7 @@ QBrush::QBrush(Qt::GlobalColor color, Qt::BrushStyle style)
if (qbrush_check_type(style))
init(color, style);
else {
- d = nullBrushInstance();
+ d.data_ptr() = nullBrushInstance();
d->ref.ref();
}
}
@@ -510,8 +541,8 @@ QBrush::QBrush(Qt::GlobalColor color, const QPixmap &pixmap)
*/
QBrush::QBrush(const QBrush &other)
+ : d(other.d.data())
{
- d = other.d;
d->ref.ref();
}
@@ -535,7 +566,7 @@ QBrush::QBrush(const QGradient &gradient)
};
init(QColor(), enum_table[gradient.type()]);
- QGradientBrushData *grad = static_cast<QGradientBrushData *>(d);
+ QGradientBrushData *grad = static_cast<QGradientBrushData *>(d.data());
grad->gradient = gradient;
}
@@ -545,24 +576,11 @@ QBrush::QBrush(const QGradient &gradient)
QBrush::~QBrush()
{
- if (!d->ref.deref())
- cleanUp(d);
}
void QBrush::cleanUp(QBrushData *x)
{
- switch (x->style) {
- case Qt::TexturePattern:
- delete static_cast<QTexturedBrushData*>(x);
- break;
- case Qt::LinearGradientPattern:
- case Qt::RadialGradientPattern:
- case Qt::ConicalGradientPattern:
- delete static_cast<QGradientBrushData*>(x);
- break;
- default:
- delete x;
- }
+ QBrushDataPointerHandler::deleteData(x);
}
@@ -571,38 +589,36 @@ void QBrush::detach(Qt::BrushStyle newStyle)
if (newStyle == d->style && d->ref == 1)
return;
- QBrushData *x;
+ QScopedPointer<QBrushData> x;
switch(newStyle) {
case Qt::TexturePattern: {
QTexturedBrushData *tbd = new QTexturedBrushData;
if (d->style == Qt::TexturePattern) {
- QTexturedBrushData *data = static_cast<QTexturedBrushData *>(d);
+ QTexturedBrushData *data = static_cast<QTexturedBrushData *>(d.data());
if (data->m_has_pixmap_texture)
tbd->setPixmap(data->pixmap());
else
tbd->setImage(data->image());
}
- x = tbd;
+ x.reset(tbd);
break;
}
case Qt::LinearGradientPattern:
case Qt::RadialGradientPattern:
case Qt::ConicalGradientPattern:
- x = new QGradientBrushData;
- static_cast<QGradientBrushData *>(x)->gradient =
- static_cast<QGradientBrushData *>(d)->gradient;
+ x.reset(new QGradientBrushData);
+ static_cast<QGradientBrushData *>(x.data())->gradient =
+ static_cast<QGradientBrushData *>(d.data())->gradient;
break;
default:
- x = new QBrushData;
+ x.reset(new QBrushData);
break;
}
x->ref = 1;
x->style = newStyle;
x->color = d->color;
x->transform = d->transform;
- if (!d->ref.deref())
- cleanUp(d);
- d = x;
+ d.reset(x.take());
}
@@ -615,10 +631,11 @@ void QBrush::detach(Qt::BrushStyle newStyle)
QBrush &QBrush::operator=(const QBrush &b)
{
+ if (this == &b)
+ return *this;
+
b.d->ref.ref();
- if (!d->ref.deref())
- cleanUp(d);
- d = b.d;
+ d.reset(b.d.data());
return *this;
}
@@ -713,7 +730,7 @@ QPixmap *QBrush::pixmap() const
{
if (d->style != Qt::TexturePattern)
return 0;
- QTexturedBrushData *data = static_cast<QTexturedBrushData*>(d);
+ QTexturedBrushData *data = static_cast<QTexturedBrushData*>(d.data());
QPixmap &pixmap = data->pixmap();
return pixmap.isNull() ? 0 : &pixmap;
}
@@ -730,7 +747,7 @@ QPixmap *QBrush::pixmap() const
QPixmap QBrush::texture() const
{
return d->style == Qt::TexturePattern
- ? ((QTexturedBrushData*) d)->pixmap()
+ ? (static_cast<QTexturedBrushData *>(d.data()))->pixmap()
: QPixmap();
}
@@ -748,7 +765,7 @@ void QBrush::setTexture(const QPixmap &pixmap)
{
if (!pixmap.isNull()) {
detach(Qt::TexturePattern);
- QTexturedBrushData *data = static_cast<QTexturedBrushData *>(d);
+ QTexturedBrushData *data = static_cast<QTexturedBrushData *>(d.data());
data->setPixmap(pixmap);
} else {
detach(Qt::NoBrush);
@@ -771,7 +788,7 @@ void QBrush::setTexture(const QPixmap &pixmap)
QImage QBrush::textureImage() const
{
return d->style == Qt::TexturePattern
- ? ((QTexturedBrushData *) d)->image()
+ ? (static_cast<QTexturedBrushData *>(d.data()))->image()
: QImage();
}
@@ -796,7 +813,7 @@ void QBrush::setTextureImage(const QImage &image)
{
if (!image.isNull()) {
detach(Qt::TexturePattern);
- QTexturedBrushData *data = static_cast<QTexturedBrushData *>(d);
+ QTexturedBrushData *data = static_cast<QTexturedBrushData *>(d.data());
data->setImage(image);
} else {
detach(Qt::NoBrush);
@@ -812,7 +829,7 @@ const QGradient *QBrush::gradient() const
if (d->style == Qt::LinearGradientPattern
|| d->style == Qt::RadialGradientPattern
|| d->style == Qt::ConicalGradientPattern) {
- return &static_cast<const QGradientBrushData *>(d)->gradient;
+ return &static_cast<const QGradientBrushData *>(d.data())->gradient;
}
return 0;
}
@@ -923,16 +940,16 @@ bool QBrush::operator==(const QBrush &b) const
if (b.d->style == d->style && b.d->color == d->color) {
switch (d->style) {
case Qt::TexturePattern: {
- QPixmap &us = ((QTexturedBrushData *) d)->pixmap();
- QPixmap &them = ((QTexturedBrushData *) b.d)->pixmap();
+ QPixmap &us = (static_cast<QTexturedBrushData *>(d.data()))->pixmap();
+ QPixmap &them = (static_cast<QTexturedBrushData *>(b.d.data()))->pixmap();
return ((us.isNull() && them.isNull()) || us.cacheKey() == them.cacheKey());
}
case Qt::LinearGradientPattern:
case Qt::RadialGradientPattern:
case Qt::ConicalGradientPattern:
{
- QGradientBrushData *d1 = static_cast<QGradientBrushData *>(d);
- QGradientBrushData *d2 = static_cast<QGradientBrushData *>(b.d);
+ QGradientBrushData *d1 = static_cast<QGradientBrushData *>(d.data());
+ QGradientBrushData *d2 = static_cast<QGradientBrushData *>(b.d.data());
return d1->gradient == d2->gradient;
}
default:
diff --git a/src/gui/painting/qbrush.h b/src/gui/painting/qbrush.h
index d6d0da3..b3aa04d 100644
--- a/src/gui/painting/qbrush.h
+++ b/src/gui/painting/qbrush.h
@@ -45,6 +45,7 @@
#include <QtCore/qpair.h>
#include <QtCore/qpoint.h>
#include <QtCore/qvector.h>
+#include <QtCore/qscopedpointer.h>
#include <QtGui/qcolor.h>
#include <QtGui/qmatrix.h>
#include <QtGui/qtransform.h>
@@ -61,6 +62,7 @@ struct QBrushData;
class QPixmap;
class QGradient;
class QVariant;
+struct QBrushDataPointerHandler;
class Q_GUI_EXPORT QBrush
{
@@ -126,13 +128,13 @@ private:
friend bool qHasPixmapTexture(const QBrush& brush);
void detach(Qt::BrushStyle newStyle);
void init(const QColor &color, Qt::BrushStyle bs);
- QBrushData *d;
+ QScopedCustomPointer<QBrushData, QBrushDataPointerHandler> d;
void cleanUp(QBrushData *x);
public:
inline bool isDetached() const;
typedef QBrushData * DataPtr;
- inline DataPtr &data_ptr() { return d; }
+ inline DataPtr &data_ptr() { return d.data_ptr(); }
};
inline void QBrush::setColor(Qt::GlobalColor acolor)
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 1723a19..c50004e 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -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_s60.cpp b/src/gui/painting/qcolormap_s60.cpp
new file mode 100644
index 0000000..1b58598
--- /dev/null
+++ b/src/gui/painting/qcolormap_s60.cpp
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the 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 "qcolormap.h"
+#include "qcolor.h"
+
+QT_BEGIN_NAMESPACE
+
+class QColormapPrivate
+{
+public:
+ inline QColormapPrivate()
+ : ref(1)
+ { }
+
+ QAtomicInt ref;
+};
+
+void QColormap::initialize()
+{
+}
+
+void QColormap::cleanup()
+{
+}
+
+QColormap QColormap::instance(int)
+{
+ return QColormap();
+}
+
+QColormap::QColormap() : d(new QColormapPrivate)
+{}
+
+QColormap::QColormap(const QColormap &colormap) :d (colormap.d)
+{ d->ref.ref(); }
+
+QColormap::~QColormap()
+{
+ if (!d->ref.deref())
+ delete d;
+}
+
+QColormap::Mode QColormap::mode() const
+{ return QColormap::Direct; }
+
+int QColormap::depth() const
+{
+ return 32;
+}
+
+int QColormap::size() const
+{
+ return -1;
+}
+
+uint QColormap::pixel(const QColor &color) const
+{ return color.rgba(); }
+
+const QColor QColormap::colorAt(uint pixel) const
+{ return QColor(pixel); }
+
+const QVector<QColor> QColormap::colormap() const
+{ return QVector<QColor>(); }
+
+QColormap &QColormap::operator=(const QColormap &colormap)
+{ qAtomicAssign(d, colormap.d); return *this; }
+
+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.cpp b/src/gui/painting/qdrawhelper.cpp
index ed4dd57..0b5e5bb 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -7426,8 +7426,8 @@ void qt_build_pow_tables() {
}
#else
for (int i=0; i<256; ++i) {
- qt_pow_rgb_gamma[i] = uchar(qRound(pow(i / 255.0, smoothing) * 255));
- qt_pow_rgb_invgamma[i] = uchar(qRound(pow(i / 255.0, 1 / smoothing) * 255));
+ qt_pow_rgb_gamma[i] = uchar(qRound(pow(i / qreal(255), smoothing) * 255));
+ qt_pow_rgb_invgamma[i] = uchar(qRound(pow(i / qreal(255), 1 / smoothing) * 255));
}
#endif
diff --git a/src/gui/painting/qpaintdevice_s60.cpp b/src/gui/painting/qpaintdevice_s60.cpp
index ec1b765..a2c4499 100644
--- a/src/gui/painting/qpaintdevice_s60.cpp
+++ b/src/gui/painting/qpaintdevice_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp
index 7de1ec4..c5be802 100644
--- a/src/gui/painting/qpaintengine.cpp
+++ b/src/gui/painting/qpaintengine.cpp
@@ -713,7 +713,6 @@ QPaintEngine::QPaintEngine(QPaintEnginePrivate &dptr, PaintEngineFeatures caps)
*/
QPaintEngine::~QPaintEngine()
{
- delete d_ptr;
}
/*!
diff --git a/src/gui/painting/qpaintengine.h b/src/gui/painting/qpaintengine.h
index 520f71f..6f56adb 100644
--- a/src/gui/painting/qpaintengine.h
+++ b/src/gui/painting/qpaintengine.h
@@ -44,6 +44,7 @@
#include <QtCore/qnamespace.h>
#include <QtCore/qobjectdefs.h>
+#include <QtCore/qscopedpointer.h>
#include <QtGui/qpainter.h>
QT_BEGIN_HEADER
@@ -239,7 +240,7 @@ protected:
uint selfDestruct : 1;
uint extended : 1;
- QPaintEnginePrivate *d_ptr;
+ QScopedPointer<QPaintEnginePrivate> d_ptr;
private:
void setAutoDestruct(bool autoDestr) { selfDestruct = autoDestr; }
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 1192a58..ada3ebf 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -349,6 +349,7 @@ void QRasterPaintEngine::init()
#else
(unsigned char *) malloc(d->rasterPoolSize);
#endif
+ Q_CHECK_PTR(d->rasterPoolBase);
// The antialiasing raster.
d->grayRaster = new QT_FT_Raster;
@@ -1055,7 +1056,7 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt,
int d = x + iw - cx2;
iw -= d;
}
- if (iw < 0)
+ if (iw <= 0)
return;
// adapt the y paremeters...
@@ -1072,7 +1073,7 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt,
int d = y + ih - cy2;
ih -= d;
}
- if (ih < 0)
+ if (ih <= 0)
return;
// call the blend function...
@@ -3878,11 +3879,7 @@ static void qt_merge_clip(const QClipData *c1, const QClipData *c2, QClipData *r
{
Q_ASSERT(c1->clipSpanHeight == c2->clipSpanHeight && c1->clipSpanHeight == result->clipSpanHeight);
- // ### buffer overflow possible
- const int BUFFER_SIZE = 4096;
- int buffer[BUFFER_SIZE];
- int *b = buffer;
- int bsize = BUFFER_SIZE;
+ QVarLengthArray<short, 4096> buffer;
QClipData::ClipLine *c1ClipLines = const_cast<QClipData *>(c1)->clipLines();
QClipData::ClipLine *c2ClipLines = const_cast<QClipData *>(c2)->clipLines();
@@ -3908,12 +3905,9 @@ static void qt_merge_clip(const QClipData *c1, const QClipData *c2, QClipData *r
// find required length
int max = qMax(c1_spans[c1_count - 1].x + c1_spans[c1_count - 1].len,
- c2_spans[c2_count - 1].x + c2_spans[c2_count - 1].len);
- if (max > bsize) {
- b = (int *)realloc(bsize == BUFFER_SIZE ? 0 : b, max*sizeof(int));
- bsize = max;
- }
- memset(buffer, 0, BUFFER_SIZE * sizeof(int));
+ c2_spans[c2_count - 1].x + c2_spans[c2_count - 1].len);
+ buffer.resize(max);
+ memset(buffer.data(), 0, buffer.size() * sizeof(short));
// Fill with old spans.
for (int i = 0; i < c1_count; ++i) {
@@ -3949,8 +3943,6 @@ static void qt_merge_clip(const QClipData *c1, const QClipData *c2, QClipData *r
result->appendSpan(sx, x - sx, y, coverage);
}
}
- if (b != buffer)
- free(b);
}
void QRasterPaintEnginePrivate::initializeRasterizer(QSpanData *data)
@@ -3967,7 +3959,7 @@ void QRasterPaintEnginePrivate::initializeRasterizer(QSpanData *data)
const QClipData *c = clip();
if (c) {
const QRect r(QPoint(c->xmin, c->ymin),
- QPoint(c->xmax, c->ymax));
+ QPoint(c->xmax, c->ymax));
clipRect = clipRect.intersected(r);
blend = data->blend;
} else {
@@ -4075,6 +4067,7 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
#else
(unsigned char *) malloc(rasterPoolSize);
#endif
+ Q_CHECK_PTR(rasterPoolBase); // note: we just freed the old rasterPoolBase. I hope it's not fatal.
qt_ft_grays_raster.raster_done(*grayRaster);
qt_ft_grays_raster.raster_new(0, grayRaster);
@@ -4310,93 +4303,107 @@ void QClipData::initialize()
return;
m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight);
- m_spans = (QSpan *)malloc(clipSpanHeight*sizeof(QSpan));
+ Q_CHECK_PTR(m_clipLines);
+ QT_TRY {
+ m_spans = (QSpan *)malloc(clipSpanHeight*sizeof(QSpan));
+ Q_CHECK_PTR(m_spans);
+
+ QT_TRY {
+ if (hasRectClip) {
+ int y = 0;
+ while (y < ymin) {
+ m_clipLines[y].spans = 0;
+ m_clipLines[y].count = 0;
+ ++y;
+ }
- if (hasRectClip) {
- int y = 0;
- while (y < ymin) {
- m_clipLines[y].spans = 0;
- m_clipLines[y].count = 0;
- ++y;
- }
+ const int len = clipRect.width();
+ count = 0;
+ while (y < ymax) {
+ QSpan *span = m_spans + count;
+ span->x = xmin;
+ span->len = len;
+ span->y = y;
+ span->coverage = 255;
+ ++count;
- const int len = clipRect.width();
- count = 0;
- while (y < ymax) {
- QSpan *span = m_spans + count;
- span->x = xmin;
- span->len = len;
- span->y = y;
- span->coverage = 255;
- ++count;
-
- m_clipLines[y].spans = span;
- m_clipLines[y].count = 1;
- ++y;
- }
+ m_clipLines[y].spans = span;
+ m_clipLines[y].count = 1;
+ ++y;
+ }
- while (y < clipSpanHeight) {
- m_clipLines[y].spans = 0;
- m_clipLines[y].count = 0;
- ++y;
- }
- } else if (hasRegionClip) {
+ while (y < clipSpanHeight) {
+ m_clipLines[y].spans = 0;
+ m_clipLines[y].count = 0;
+ ++y;
+ }
+ } else if (hasRegionClip) {
+
+ const QVector<QRect> rects = clipRegion.rects();
+ const int numRects = rects.size();
+
+ { // resize
+ const int maxSpans = (ymax - ymin) * numRects;
+ if (maxSpans > allocated) {
+ QSpan *newSpans = (QSpan *)realloc(m_spans, maxSpans * sizeof(QSpan));
+ Q_CHECK_PTR(newSpans);
+ m_spans = newSpans;
+ allocated = maxSpans;
+ }
+ }
- const QVector<QRect> rects = clipRegion.rects();
- const int numRects = rects.size();
+ int y = 0;
+ int firstInBand = 0;
+ while (firstInBand < numRects) {
+ const int currMinY = rects.at(firstInBand).y();
+ const int currMaxY = currMinY + rects.at(firstInBand).height();
- { // resize
- const int maxSpans = (ymax - ymin) * numRects;
- if (maxSpans > allocated) {
- m_spans = (QSpan *)realloc(m_spans, maxSpans * sizeof(QSpan));
- allocated = maxSpans;
- }
- }
+ while (y < currMinY) {
+ m_clipLines[y].spans = 0;
+ m_clipLines[y].count = 0;
+ ++y;
+ }
- int y = 0;
- int firstInBand = 0;
- while (firstInBand < numRects) {
- const int currMinY = rects.at(firstInBand).y();
- const int currMaxY = currMinY + rects.at(firstInBand).height();
+ int lastInBand = firstInBand;
+ while (lastInBand + 1 < numRects && rects.at(lastInBand+1).top() == y)
+ ++lastInBand;
- while (y < currMinY) {
- m_clipLines[y].spans = 0;
- m_clipLines[y].count = 0;
- ++y;
- }
+ while (y < currMaxY) {
- int lastInBand = firstInBand;
- while (lastInBand + 1 < numRects && rects.at(lastInBand+1).top() == y)
- ++lastInBand;
+ m_clipLines[y].spans = m_spans + count;
+ m_clipLines[y].count = lastInBand - firstInBand + 1;
- while (y < currMaxY) {
-
- m_clipLines[y].spans = m_spans + count;
- m_clipLines[y].count = lastInBand - firstInBand + 1;
+ for (int r = firstInBand; r <= lastInBand; ++r) {
+ const QRect &currRect = rects.at(r);
+ QSpan *span = m_spans + count;
+ span->x = currRect.x();
+ span->len = currRect.width();
+ span->y = y;
+ span->coverage = 255;
+ ++count;
+ }
+ ++y;
+ }
- for (int r = firstInBand; r <= lastInBand; ++r) {
- const QRect &currRect = rects.at(r);
- QSpan *span = m_spans + count;
- span->x = currRect.x();
- span->len = currRect.width();
- span->y = y;
- span->coverage = 255;
- ++count;
+ firstInBand = lastInBand + 1;
}
- ++y;
- }
- firstInBand = lastInBand + 1;
- }
+ Q_ASSERT(count <= allocated);
- Q_ASSERT(count <= allocated);
+ while (y < clipSpanHeight) {
+ m_clipLines[y].spans = 0;
+ m_clipLines[y].count = 0;
+ ++y;
+ }
- while (y < clipSpanHeight) {
- m_clipLines[y].spans = 0;
- m_clipLines[y].count = 0;
- ++y;
+ }
+ } QT_CATCH(...) {
+ free(m_spans);
+ QT_RETHROW;
}
-
+ } QT_CATCH(...) {
+ free(m_clipLines);
+ QT_RETHROW;
}
}
@@ -4773,8 +4780,10 @@ static void qt_span_clip(int count, const QSpan *spans, void *userData)
&newspans, newClip->allocated - newClip->count);
newClip->count = newspans - newClip->m_spans;
if (spans < end) {
+ QSpan *newSpan = (QSpan *)realloc(newClip->m_spans, newClip->allocated*2*sizeof(QSpan));
+ Q_CHECK_PTR(newSpan);
+ newClip->m_spans = newSpan;
newClip->allocated *= 2;
- newClip->m_spans = (QSpan *)realloc(newClip->m_spans, newClip->allocated*sizeof(QSpan));
}
}
}
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index 9cc9683..2e6d593 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -1826,9 +1826,10 @@ Q_GUI_EXPORT void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const Q
const int h = rect.height();
QImage im;
- if ((QSysInfo::ByteOrder == QSysInfo::BigEndian
- && ((ImageByteOrder(X11->display) == LSBFirst) || bgr_layout))
- || (ImageByteOrder(X11->display) == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian))
+ int image_byte_order = ImageByteOrder(X11->display);
+ if ((QSysInfo::ByteOrder == QSysInfo::BigEndian && ((image_byte_order == LSBFirst) || bgr_layout))
+ || (image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)
+ || (image_byte_order == LSBFirst && bgr_layout))
{
im = image.copy(rect);
const int iw = im.bytesPerLine() / 4;
@@ -1836,19 +1837,21 @@ Q_GUI_EXPORT void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const Q
for (int i=0; i < h; i++) {
uint *p = data;
uint *end = p + w;
- if (bgr_layout && ImageByteOrder(X11->display) == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian) {
+ if (bgr_layout && image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian) {
while (p < end) {
*p = ((*p << 8) & 0xffffff00) | ((*p >> 24) & 0x000000ff);
p++;
}
- } else if ((ImageByteOrder(X11->display) == LSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian)
- || (ImageByteOrder(X11->display) == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)) {
+ } else if ((image_byte_order == LSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian)
+ || (image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)) {
while (p < end) {
*p = ((*p << 24) & 0xff000000) | ((*p << 8) & 0x00ff0000)
| ((*p >> 8) & 0x0000ff00) | ((*p >> 24) & 0x000000ff);
p++;
}
- } else if (ImageByteOrder(X11->display) == MSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ } else if ((image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian)
+ || (image_byte_order == LSBFirst && bgr_layout))
+ {
while (p < end) {
*p = ((*p << 16) & 0x00ff0000) | ((*p >> 16) & 0x000000ff)
| ((*p ) & 0xff00ff00);
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index cc48d24..0caf13b 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -83,6 +83,21 @@ static const qreal aliasedCoordinateDelta = 0.5 - 0.015625;
bool qt_show_painter_debug_output = true;
#endif
+class QPainterPrivateCleaner
+{
+public:
+ static inline void cleanup(QPainterPrivate *d)
+ {
+ delete d;
+ }
+
+ static inline void reset(QPainterPrivate *&d, QPainterPrivate *other)
+ {
+ delete d;
+ d = other;
+ }
+};
+
extern QPixmap qt_pixmapForBrush(int style, bool invert);
void qt_format_text(const QFont &font,
@@ -259,14 +274,17 @@ bool QPainterPrivate::attachPainterPrivate(QPainter *q, QPaintDevice *pdev)
// in 99% of all cases). E.g: A renders B which renders C which renders D.
sp->d_ptr->d_ptrs_size = 4;
sp->d_ptr->d_ptrs = (QPainterPrivate **)malloc(4 * sizeof(QPainterPrivate *));
+ Q_CHECK_PTR(sp->d_ptr->d_ptrs);
} else if (sp->d_ptr->refcount - 1 == sp->d_ptr->d_ptrs_size) {
// However, to support corner cases we grow the array dynamically if needed.
sp->d_ptr->d_ptrs_size <<= 1;
const int newSize = sp->d_ptr->d_ptrs_size * sizeof(QPainterPrivate *);
- sp->d_ptr->d_ptrs = (QPainterPrivate **)realloc(sp->d_ptr->d_ptrs, newSize);
+ QPainterPrivate ** newPointers = (QPainterPrivate **)realloc(sp->d_ptr->d_ptrs, newSize);
+ Q_CHECK_PTR(newPointers);
+ sp->d_ptr->d_ptrs = newPointers;
}
- sp->d_ptr->d_ptrs[++sp->d_ptr->refcount - 2] = q->d_ptr;
- q->d_ptr = sp->d_ptr;
+ sp->d_ptr->d_ptrs[++sp->d_ptr->refcount - 2] = q->d_ptr.data();
+ q->d_ptr.data_ptr() = sp->d_ptr.data();
Q_ASSERT(q->d_ptr->state);
@@ -315,7 +333,7 @@ void QPainterPrivate::detachPainterPrivate(QPainter *q)
d_ptrs[refcount - 1] = 0;
q->restore();
- q->d_ptr = original;
+ q->d_ptr.data_ptr() = original;
if (emulationEngine) {
extended = emulationEngine->real_engine;
@@ -1374,8 +1392,8 @@ void QPainterPrivate::updateState(QPainterState *newState)
*/
QPainter::QPainter()
+ : d_ptr(new QPainterPrivate(this))
{
- d_ptr = new QPainterPrivate(this);
}
/*!
@@ -1407,7 +1425,7 @@ QPainter::QPainter(QPaintDevice *pd)
{
Q_ASSERT(pd != 0);
if (!QPainterPrivate::attachPainterPrivate(this, pd)) {
- d_ptr = new QPainterPrivate(this);
+ d_ptr.reset(new QPainterPrivate(this));
begin(pd);
}
Q_ASSERT(d_ptr);
@@ -1419,11 +1437,14 @@ QPainter::QPainter(QPaintDevice *pd)
QPainter::~QPainter()
{
d_ptr->inDestructor = true;
- if (isActive())
- end();
- else if (d_ptr->refcount > 1)
- d_ptr->detachPainterPrivate(this);
-
+ QT_TRY {
+ if (isActive())
+ end();
+ else if (d_ptr->refcount > 1)
+ d_ptr->detachPainterPrivate(this);
+ } QT_CATCH(...) {
+ // don't throw anything in the destructor.
+ }
if (d_ptr) {
// Make sure we haven't messed things up.
Q_ASSERT(d_ptr->inDestructor);
@@ -1431,7 +1452,6 @@ QPainter::~QPainter()
Q_ASSERT(d_ptr->refcount == 1);
if (d_ptr->d_ptrs)
free(d_ptr->d_ptrs);
- delete d_ptr;
}
}
@@ -7417,8 +7437,21 @@ QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset)
void qt_painter_removePaintDevice(QPaintDevice *dev)
{
- QMutexLocker locker(globalRedirectionsMutex());
- if(QPaintDeviceRedirectionList *redirections = globalRedirections()) {
+ QMutex *mutex = 0;
+ QT_TRY {
+ mutex = globalRedirectionsMutex();
+ } QT_CATCH(...) {
+ // ignore the missing mutex, since we could be called from
+ // a destructor, and destructors shall not throw
+ }
+ QMutexLocker locker(mutex);
+ QPaintDeviceRedirectionList *redirections = 0;
+ QT_TRY {
+ redirections = globalRedirections();
+ } QT_CATCH(...) {
+ // do nothing - code below is safe with redirections being 0.
+ }
+ if (redirections) {
for (int i = 0; i < redirections->size(); ) {
if(redirections->at(i) == dev || redirections->at(i).replacement == dev)
redirections->removeAt(i);
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index f3df7a3..d8c6980 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -45,6 +45,7 @@
#include <QtCore/qnamespace.h>
#include <QtCore/qrect.h>
#include <QtCore/qpoint.h>
+#include <QtCore/qscopedpointer.h>
#include <QtGui/qpixmap.h>
#include <QtGui/qimage.h>
#include <QtGui/qtextoption.h>
@@ -78,6 +79,8 @@ class QTextItem;
class QMatrix;
class QTransform;
+class QPainterPrivateCleaner;
+
class Q_GUI_EXPORT QPainter
{
Q_DECLARE_PRIVATE(QPainter)
@@ -497,7 +500,7 @@ private:
Q_DISABLE_COPY(QPainter)
friend class Q3Painter;
- QPainterPrivate *d_ptr;
+ QScopedCustomPointer<QPainterPrivate, QPainterPrivateCleaner> d_ptr;
friend class QFontEngine;
friend class QFontEngineBox;
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index e1f5eea..635218e 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -73,6 +73,24 @@
QT_BEGIN_NAMESPACE
+struct QPainterPathPrivateHandler
+{
+ static inline void cleanup(QPainterPathPrivate *d)
+ {
+ // note - we must up-cast to QPainterPathData since QPainterPathPrivate
+ // has a non-virtual destructor!
+ if (d && !d->ref.deref())
+ delete static_cast<QPainterPathData *>(d);
+ }
+
+ static inline void reset(QPainterPathPrivate *&d, QPainterPathPrivate *other)
+ {
+ QPainterPathPrivate *oldD = d;
+ d = other;
+ cleanup(oldD);
+ }
+};
+
// This value is used to determine the length of control point vectors
// when approximating arc segments as curves. The factor is multiplied
// with the radius of the circle.
@@ -506,10 +524,10 @@ QPainterPath::QPainterPath()
\sa operator=()
*/
QPainterPath::QPainterPath(const QPainterPath &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
- if (d_func())
- d_func()->ref.ref();
+ if (d_ptr)
+ d_ptr->ref.ref();
}
/*!
@@ -530,9 +548,7 @@ QPainterPath::QPainterPath(const QPointF &startPoint)
void QPainterPath::detach_helper()
{
QPainterPathPrivate *data = new QPainterPathData(*d_func());
- if (d_ptr && !d_ptr->ref.deref())
- delete d_ptr;
- d_ptr = data;
+ d_ptr.reset(data);
}
/*!
@@ -544,9 +560,7 @@ void QPainterPath::ensureData_helper()
data->elements.reserve(16);
QPainterPath::Element e = { 0, 0, QPainterPath::MoveToElement };
data->elements << e;
- if (d_ptr && !d_ptr->ref.deref())
- delete d_ptr;
- d_ptr = data;
+ d_ptr.reset(data);
Q_ASSERT(d_ptr != 0);
}
@@ -563,9 +577,7 @@ QPainterPath &QPainterPath::operator=(const QPainterPath &other)
QPainterPathPrivate *data = other.d_func();
if (data)
data->ref.ref();
- if (d_ptr && !d_ptr->ref.deref())
- delete d_ptr;
- d_ptr = data;
+ d_ptr.reset(data);
}
return *this;
}
@@ -575,8 +587,6 @@ QPainterPath &QPainterPath::operator=(const QPainterPath &other)
*/
QPainterPath::~QPainterPath()
{
- if (d_func() && !d_func()->ref.deref())
- delete d_func();
}
/*!
@@ -1006,7 +1016,7 @@ void QPainterPath::addPolygon(const QPolygonF &polygon)
/*!
\fn void QPainterPath::addEllipse(const QRectF &boundingRectangle)
- Creates an ellipse within the the specified \a boundingRectangle
+ Creates an ellipse within the specified \a boundingRectangle
and adds it to the painter path as a closed subpath.
The ellipse is composed of a clockwise curve, starting and
@@ -2408,7 +2418,6 @@ QPainterPathStroker::QPainterPathStroker()
*/
QPainterPathStroker::~QPainterPathStroker()
{
- delete d_ptr;
}
@@ -2695,7 +2704,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.
@@ -2812,7 +2821,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.
@@ -2843,7 +2852,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.
@@ -2875,7 +2884,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.
diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h
index 6cd2af8..e12194e 100644
--- a/src/gui/painting/qpainterpath.h
+++ b/src/gui/painting/qpainterpath.h
@@ -47,6 +47,7 @@
#include <QtCore/qrect.h>
#include <QtCore/qline.h>
#include <QtCore/qvector.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -56,6 +57,7 @@ QT_MODULE(Gui)
class QFont;
class QPainterPathPrivate;
+struct QPainterPathPrivateHandler;
class QPainterPathData;
class QPainterPathStrokerPrivate;
class QPolygonF;
@@ -195,7 +197,7 @@ public:
QPainterPath &operator-=(const QPainterPath &other);
private:
- QPainterPathPrivate *d_ptr;
+ QScopedCustomPointer<QPainterPathPrivate, QPainterPathPrivateHandler> d_ptr;
inline void ensureData() { if (!d_ptr) ensureData_helper(); }
void ensureData_helper();
@@ -205,7 +207,7 @@ private:
void computeBoundingRect() const;
void computeControlPointRect() const;
- QPainterPathData *d_func() const { return reinterpret_cast<QPainterPathData *>(d_ptr); }
+ QPainterPathData *d_func() const { return reinterpret_cast<QPainterPathData *>(d_ptr.data()); }
friend class QPainterPathData;
friend class QPainterPathStroker;
@@ -229,6 +231,7 @@ public:
friend class QPainterPathStrokerPrivate;
friend class QMatrix;
friend class QTransform;
+ friend struct QPainterPathPrivateHandler;
#ifndef QT_NO_DATASTREAM
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPainterPath &);
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &);
@@ -279,7 +282,7 @@ public:
private:
friend class QX11PaintEngine;
- QPainterPathStrokerPrivate *d_ptr;
+ QScopedPointer<QPainterPathStrokerPrivate> d_ptr;
};
inline void QPainterPath::moveTo(qreal x, qreal y)
diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp
index 5090b3a..ba6baa6 100644
--- a/src/gui/painting/qprinter.cpp
+++ b/src/gui/painting/qprinter.cpp
@@ -480,26 +480,26 @@ void QPrinterPrivate::addToManualSetList(QPrintEngine::PrintEnginePropertyKey ke
\value A7 74 x 105 mm
\value A8 52 x 74 mm
\value A9 37 x 52 mm
- \value B0 1030 x 1456 mm
- \value B1 728 x 1030 mm
- \value B10 32 x 45 mm
- \value B2 515 x 728 mm
- \value B3 364 x 515 mm
- \value B4 257 x 364 mm
- \value B5 182 x 257 mm, 7.17 x 10.13 inches
- \value B6 128 x 182 mm
- \value B7 91 x 128 mm
- \value B8 64 x 91 mm
- \value B9 45 x 64 mm
+ \value B0 1000 x 1414 mm
+ \value B1 707 x 1000 mm
+ \value B2 500 x 707 mm
+ \value B3 353 x 500 mm
+ \value B4 250 x 353 mm
+ \value B5 176 x 250 mm, 6.93 x 9.84 inches
+ \value B6 125 x 176 mm
+ \value B7 88 x 125 mm
+ \value B8 62 x 88 mm
+ \value B9 33 x 62 mm
+ \value B10 31 x 44 mm
\value C5E 163 x 229 mm
\value Comm10E 105 x 241 mm, U.S. Common 10 Envelope
\value DLE 110 x 220 mm
- \value Executive 7.5 x 10 inches, 191 x 254 mm
+ \value Executive 7.5 x 10 inches, 190.5 x 254 mm
\value Folio 210 x 330 mm
- \value Ledger 432 x 279 mm
- \value Legal 8.5 x 14 inches, 216 x 356 mm
- \value Letter 8.5 x 11 inches, 216 x 279 mm
- \value Tabloid 279 x 432 mm
+ \value Ledger 431.8 x 279.4 mm
+ \value Legal 8.5 x 14 inches, 215.9 x 355.6 mm
+ \value Letter 8.5 x 11 inches, 215.9 x 279.4 mm
+ \value Tabloid 279.4 x 431.8 mm
\value Custom Unknown, or a user defined size.
With setFullPage(false) (the default), the metrics will be a bit
@@ -712,7 +712,6 @@ QPrinter::~QPrinter()
#ifndef QT_NO_PRINTPREVIEWWIDGET
delete d->previewEngine;
#endif
- delete d;
}
/*!
diff --git a/src/gui/painting/qprinter.h b/src/gui/painting/qprinter.h
index 949c8f9..24e867b 100644
--- a/src/gui/painting/qprinter.h
+++ b/src/gui/painting/qprinter.h
@@ -42,8 +42,9 @@
#ifndef QPRINTER_H
#define QPRINTER_H
-#include <QtGui/qpaintdevice.h>
#include <QtCore/qstring.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtGui/qpaintdevice.h>
QT_BEGIN_HEADER
@@ -288,7 +289,7 @@ private:
Q_DISABLE_COPY(QPrinter)
- QPrinterPrivate *d_ptr;
+ QScopedPointer<QPrinterPrivate> d_ptr;
friend class QPrintDialogPrivate;
friend class QAbstractPrintDialog;
diff --git a/src/gui/painting/qprinterinfo.h b/src/gui/painting/qprinterinfo.h
index b826306..d188d73 100644
--- a/src/gui/painting/qprinterinfo.h
+++ b/src/gui/painting/qprinterinfo.h
@@ -53,6 +53,7 @@ QT_MODULE(Gui)
#ifndef QT_NO_PRINTER
class QPrinterInfoPrivate;
+class QPrinterInfoPrivateCleanup;
class Q_GUI_EXPORT QPrinterInfo
{
Q_DECLARE_PRIVATE(QPrinterInfo)
@@ -76,7 +77,7 @@ public:
private:
QPrinterInfo(const QString& name);
- QPrinterInfoPrivate* d_ptr;
+ QScopedCustomPointer<QPrinterInfoPrivate, QPrinterInfoPrivateCleanup> d_ptr;
};
#endif // QT_NO_PRINTER
diff --git a/src/gui/painting/qprinterinfo_mac.cpp b/src/gui/painting/qprinterinfo_mac.cpp
index ecd4b5b..ae689f4 100644
--- a/src/gui/painting/qprinterinfo_mac.cpp
+++ b/src/gui/painting/qprinterinfo_mac.cpp
@@ -65,6 +65,22 @@ private:
static QPrinterInfoPrivate nullQPrinterInfoPrivate;
+class QPrinterInfoPrivateCleanup
+{
+public:
+ static inline void cleanup(QPrinterInfoPrivate *d)
+ {
+ if (d != &nullQPrinterInfoPrivate)
+ delete d;
+ }
+
+ static inline void reset(QPrinterInfoPrivate *&d, QPrinterInfoPrivate *other)
+ {
+ cleanup(d);
+ d = other;
+ }
+};
+
extern QPrinter::PaperSize qSizeFTopaperSize(const QSizeF& size);
/////////////////////////////////////////////////////////////////////////////
@@ -106,8 +122,8 @@ QPrinterInfo QPrinterInfo::defaultPrinter(){
/////////////////////////////////////////////////////////////////////////////
QPrinterInfo::QPrinterInfo(const QPrinter& prn)
+ : d_ptr(&nullQPrinterInfoPrivate)
{
- d_ptr = &nullQPrinterInfoPrivate;
QList<QPrinterInfo> list = availablePrinters();
for (int c = 0; c < list.size(); ++c) {
if (prn.printerName() == list[c].printerName()) {
@@ -115,39 +131,33 @@ QPrinterInfo::QPrinterInfo(const QPrinter& prn)
return;
}
}
-
- *this = QPrinterInfo();
}
QPrinterInfo::~QPrinterInfo()
{
- if (d_ptr != &nullQPrinterInfoPrivate)
- delete d_ptr;
}
QPrinterInfo::QPrinterInfo()
+ : d_ptr(&nullQPrinterInfoPrivate)
{
- d_ptr = &nullQPrinterInfoPrivate;
}
QPrinterInfo::QPrinterInfo(const QString& name)
+ : d_ptr(new QPrinterInfoPrivate(name))
{
- d_ptr = new QPrinterInfoPrivate(name);
d_ptr->q_ptr = this;
}
QPrinterInfo::QPrinterInfo(const QPrinterInfo& src)
+ : d_ptr(&nullQPrinterInfoPrivate)
{
- d_ptr = &nullQPrinterInfoPrivate;
*this = src;
}
QPrinterInfo& QPrinterInfo::operator=(const QPrinterInfo& src)
{
Q_ASSERT(d_ptr);
- if (d_ptr != &nullQPrinterInfoPrivate)
- delete d_ptr;
- d_ptr = new QPrinterInfoPrivate(*src.d_ptr);
+ d_ptr.reset(new QPrinterInfoPrivate(*src.d_ptr));
d_ptr->q_ptr = this;
return *this;
}
diff --git a/src/gui/painting/qprinterinfo_unix.cpp b/src/gui/painting/qprinterinfo_unix.cpp
index 0f33ea7..55e3226 100644
--- a/src/gui/painting/qprinterinfo_unix.cpp
+++ b/src/gui/painting/qprinterinfo_unix.cpp
@@ -82,6 +82,22 @@ private:
static QPrinterInfoPrivate nullQPrinterInfoPrivate;
+class QPrinterInfoPrivateCleanup
+{
+public:
+ static inline void cleanup(QPrinterInfoPrivate *d)
+ {
+ if (d != &nullQPrinterInfoPrivate)
+ delete d;
+ }
+
+ static inline void reset(QPrinterInfoPrivate *&d, QPrinterInfoPrivate *other)
+ {
+ cleanup(d);
+ d = other;
+ }
+};
+
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
@@ -867,19 +883,19 @@ QPrinterInfo QPrinterInfo::defaultPrinter()
}
QPrinterInfo::QPrinterInfo()
+ : d_ptr(&nullQPrinterInfoPrivate)
{
- d_ptr = &nullQPrinterInfoPrivate;
}
QPrinterInfo::QPrinterInfo(const QPrinterInfo& src)
+ : d_ptr(&nullQPrinterInfoPrivate)
{
- d_ptr = &nullQPrinterInfoPrivate;
*this = src;
}
QPrinterInfo::QPrinterInfo(const QPrinter& printer)
+ : d_ptr(new QPrinterInfoPrivate(printer.printerName()))
{
- d_ptr = new QPrinterInfoPrivate(printer.printerName());
Q_D(QPrinterInfo);
d->q_ptr = this;
@@ -929,28 +945,23 @@ QPrinterInfo::QPrinterInfo(const QPrinter& printer)
#endif
// Printer not found.
- delete d;
- d_ptr = &nullQPrinterInfoPrivate;
+ d_ptr.reset(&nullQPrinterInfoPrivate);
}
QPrinterInfo::QPrinterInfo(const QString& name)
+ : d_ptr(new QPrinterInfoPrivate(name))
{
- d_ptr = new QPrinterInfoPrivate(name);
d_ptr->q_ptr = this;
}
QPrinterInfo::~QPrinterInfo()
{
- if (d_ptr != &nullQPrinterInfoPrivate)
- delete d_ptr;
}
QPrinterInfo& QPrinterInfo::operator=(const QPrinterInfo& src)
{
Q_ASSERT(d_ptr);
- if (d_ptr != &nullQPrinterInfoPrivate)
- delete d_ptr;
- d_ptr = new QPrinterInfoPrivate(*src.d_ptr);
+ d_ptr.reset(new QPrinterInfoPrivate(*src.d_ptr));
d_ptr->q_ptr = this;
return *this;
}
diff --git a/src/gui/painting/qprinterinfo_win.cpp b/src/gui/painting/qprinterinfo_win.cpp
index 7cd3cf3..7607391 100644
--- a/src/gui/painting/qprinterinfo_win.cpp
+++ b/src/gui/painting/qprinterinfo_win.cpp
@@ -69,6 +69,22 @@ private:
static QPrinterInfoPrivate nullQPrinterInfoPrivate;
+class QPrinterInfoPrivateCleanup
+{
+public:
+ static inline void cleanup(QPrinterInfoPrivate *d)
+ {
+ if (d != &nullQPrinterInfoPrivate)
+ delete d;
+ }
+
+ static inline void reset(QPrinterInfoPrivate *&d, QPrinterInfoPrivate *other)
+ {
+ cleanup(d);
+ d = other;
+ }
+};
+
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
@@ -155,25 +171,25 @@ QPrinterInfo QPrinterInfo::defaultPrinter()
/////////////////////////////////////////////////////////////////////////////
QPrinterInfo::QPrinterInfo()
+ : d_ptr(&nullQPrinterInfoPrivate)
{
- d_ptr = &nullQPrinterInfoPrivate;
}
QPrinterInfo::QPrinterInfo(const QString& name)
+ : d_ptr(new QPrinterInfoPrivate(name))
{
- d_ptr = new QPrinterInfoPrivate(name);
d_ptr->q_ptr = this;
}
QPrinterInfo::QPrinterInfo(const QPrinterInfo& src)
+ : d_ptr(&nullQPrinterInfoPrivate)
{
- d_ptr = &nullQPrinterInfoPrivate;
*this = src;
}
QPrinterInfo::QPrinterInfo(const QPrinter& prn)
+ : d_ptr(&nullQPrinterInfoPrivate)
{
- d_ptr = &nullQPrinterInfoPrivate;
QList<QPrinterInfo> list = availablePrinters();
for (int c = 0; c < list.size(); ++c) {
if (prn.printerName() == list[c].printerName()) {
@@ -187,16 +203,12 @@ QPrinterInfo::QPrinterInfo(const QPrinter& prn)
QPrinterInfo::~QPrinterInfo()
{
- if (d_ptr != &nullQPrinterInfoPrivate)
- delete d_ptr;
}
QPrinterInfo& QPrinterInfo::operator=(const QPrinterInfo& src)
{
Q_ASSERT(d_ptr);
- if (d_ptr != &nullQPrinterInfoPrivate)
- delete d_ptr;
- d_ptr = new QPrinterInfoPrivate(*src.d_ptr);
+ d_ptr.reset(new QPrinterInfoPrivate(*src.d_ptr));
d_ptr->q_ptr = this;
return *this;
}
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index 583885c..3c06bb4 100644
--- a/src/gui/painting/qrasterizer.cpp
+++ b/src/gui/painting/qrasterizer.cpp
@@ -436,8 +436,11 @@ void QScanConverter::end()
inline void QScanConverter::allocate(int size)
{
if (m_alloc < size) {
- m_alloc = qMax(size, 2 * m_alloc);
- m_intersections = (Intersection *)realloc(m_intersections, m_alloc * sizeof(Intersection));
+ int newAlloc = qMax(size, 2 * m_alloc);
+ Intersection *newIntersections = (Intersection *)realloc(m_intersections, newAlloc * sizeof(Intersection));
+ Q_CHECK_PTR(newIntersections);
+ m_alloc = newAlloc;
+ m_intersections = newIntersections;
}
}
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index c88af7c..65964de 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -3167,6 +3167,7 @@ static void InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
{
tmpSLLBlock =
(ScanLineListBlock *)malloc(sizeof(ScanLineListBlock));
+ Q_CHECK_PTR(tmpSLLBlock);
(*SLLBlock)->next = tmpSLLBlock;
tmpSLLBlock->next = (ScanLineListBlock *)NULL;
*SLLBlock = tmpSLLBlock;
@@ -3553,6 +3554,8 @@ static void PtsToRegion(register int numFullPtBlocks, register int iCurPtBlock,
* Scan converts a polygon by returning a run-length
* encoding of the resultant bitmap -- the run-length
* encoding is in the form of an array of rectangles.
+ *
+ * Can return 0 in case of errors.
*/
static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule)
//Point *Pts; /* the pts */
@@ -3624,75 +3627,28 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule)
}
- if (rule == EvenOddRule) {
- /*
- * for each scanline
- */
- for (y = ET.ymin; y < ET.ymax; ++y) {
-
- /*
- * Add a new edge to the active edge table when we
- * get to the next edge.
- */
- if (pSLL && y == pSLL->scanline) {
- loadAET(&AET, pSLL->edgelist);
- pSLL = pSLL->next;
- }
- pPrevAET = &AET;
- pAET = AET.next;
-
+ QT_TRY {
+ if (rule == EvenOddRule) {
/*
- * for each active edge
+ * for each scanline
*/
- while (pAET) {
- pts->setX(pAET->bres.minor_axis);
- pts->setY(y);
- ++pts;
- ++iPts;
+ for (y = ET.ymin; y < ET.ymax; ++y) {
/*
- * send out the buffer
+ * Add a new edge to the active edge table when we
+ * get to the next edge.
*/
- if (iPts == NUMPTSTOBUFFER) {
- tmpPtBlock = (POINTBLOCK *)malloc(sizeof(POINTBLOCK));
- tmpPtBlock->pts = reinterpret_cast<QPoint *>(tmpPtBlock->data);
- curPtBlock->next = tmpPtBlock;
- curPtBlock = tmpPtBlock;
- pts = curPtBlock->pts;
- ++numFullPtBlocks;
- iPts = 0;
+ if (pSLL && y == pSLL->scanline) {
+ loadAET(&AET, pSLL->edgelist);
+ pSLL = pSLL->next;
}
- EVALUATEEDGEEVENODD(pAET, pPrevAET, y)
- }
- InsertionSort(&AET);
- }
- } else {
- /*
- * for each scanline
- */
- for (y = ET.ymin; y < ET.ymax; ++y) {
- /*
- * Add a new edge to the active edge table when we
- * get to the next edge.
- */
- if (pSLL && y == pSLL->scanline) {
- loadAET(&AET, pSLL->edgelist);
- computeWAET(&AET);
- pSLL = pSLL->next;
- }
- pPrevAET = &AET;
- pAET = AET.next;
- pWETE = pAET;
+ pPrevAET = &AET;
+ pAET = AET.next;
- /*
- * for each active edge
- */
- while (pAET) {
/*
- * add to the buffer only those edges that
- * are in the Winding active edge table.
+ * for each active edge
*/
- if (pWETE == pAET) {
+ while (pAET) {
pts->setX(pAET->bres.minor_axis);
pts->setY(y);
++pts;
@@ -3702,7 +3658,8 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule)
* send out the buffer
*/
if (iPts == NUMPTSTOBUFFER) {
- tmpPtBlock = static_cast<POINTBLOCK *>(malloc(sizeof(POINTBLOCK)));
+ tmpPtBlock = (POINTBLOCK *)malloc(sizeof(POINTBLOCK));
+ Q_CHECK_PTR(tmpPtBlock);
tmpPtBlock->pts = reinterpret_cast<QPoint *>(tmpPtBlock->data);
curPtBlock->next = tmpPtBlock;
curPtBlock = tmpPtBlock;
@@ -3710,21 +3667,81 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule)
++numFullPtBlocks;
iPts = 0;
}
- pWETE = pWETE->nextWETE;
+ EVALUATEEDGEEVENODD(pAET, pPrevAET, y)
}
- EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET)
+ InsertionSort(&AET);
}
-
+ } else {
/*
- * recompute the winding active edge table if
- * we just resorted or have exited an edge.
+ * for each scanline
*/
- if (InsertionSort(&AET) || fixWAET) {
- computeWAET(&AET);
- fixWAET = false;
+ for (y = ET.ymin; y < ET.ymax; ++y) {
+ /*
+ * Add a new edge to the active edge table when we
+ * get to the next edge.
+ */
+ if (pSLL && y == pSLL->scanline) {
+ loadAET(&AET, pSLL->edgelist);
+ computeWAET(&AET);
+ pSLL = pSLL->next;
+ }
+ pPrevAET = &AET;
+ pAET = AET.next;
+ pWETE = pAET;
+
+ /*
+ * for each active edge
+ */
+ while (pAET) {
+ /*
+ * add to the buffer only those edges that
+ * are in the Winding active edge table.
+ */
+ if (pWETE == pAET) {
+ pts->setX(pAET->bres.minor_axis);
+ pts->setY(y);
+ ++pts;
+ ++iPts;
+
+ /*
+ * send out the buffer
+ */
+ if (iPts == NUMPTSTOBUFFER) {
+ tmpPtBlock = static_cast<POINTBLOCK *>(malloc(sizeof(POINTBLOCK)));
+ tmpPtBlock->pts = reinterpret_cast<QPoint *>(tmpPtBlock->data);
+ curPtBlock->next = tmpPtBlock;
+ curPtBlock = tmpPtBlock;
+ pts = curPtBlock->pts;
+ ++numFullPtBlocks;
+ iPts = 0;
+ }
+ pWETE = pWETE->nextWETE;
+ }
+ EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET)
+ }
+
+ /*
+ * recompute the winding active edge table if
+ * we just resorted or have exited an edge.
+ */
+ if (InsertionSort(&AET) || fixWAET) {
+ computeWAET(&AET);
+ fixWAET = false;
+ }
}
}
+ } QT_CATCH(...) {
+ FreeStorage(SLLBlock.next);
+ PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region);
+ for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) {
+ tmpPtBlock = curPtBlock->next;
+ free(curPtBlock);
+ curPtBlock = tmpPtBlock;
+ }
+ free(pETEs);
+ return 0; // this function returns 0 in case of an error
}
+
FreeStorage(SLLBlock.next);
PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region);
for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) {
@@ -3923,11 +3940,10 @@ QRegion &QRegion::operator=(const QRegion &r)
/*!
\internal
*/
-
QRegion QRegion::copy() const
{
QRegion r;
- QRegionData *x = new QRegionData;
+ QScopedPointer<QRegionData> x(new QRegionData);
x->ref = 1;
#if defined(Q_WS_X11)
x->rgn = 0;
@@ -3941,7 +3957,7 @@ QRegion QRegion::copy() const
x->qt_rgn = new QRegionPrivate;
if (!r.d->ref.deref())
cleanUp(r.d);
- r.d = x;
+ r.d = x.take();
return r;
}
diff --git a/src/gui/painting/qregion_s60.cpp b/src/gui/painting/qregion_s60.cpp
index 4504118..4d96910 100644
--- a/src/gui/painting/qregion_s60.cpp
+++ b/src/gui/painting/qregion_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/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/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp
index 110ba2f..97178a6 100644
--- a/src/gui/painting/qwindowsurface_raster.cpp
+++ b/src/gui/painting/qwindowsurface_raster.cpp
@@ -115,8 +115,6 @@ QRasterWindowSurface::~QRasterWindowSurface()
#endif
if (d_ptr->image)
delete d_ptr->image;
-
- delete d_ptr;
}
@@ -229,7 +227,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi
{
const QImage &src = d->image->image;
br = br.intersected(src.rect());
- if (src.format() != QImage::Format_RGB32) {
+ if (src.format() != QImage::Format_RGB32 || widget->x11Info().depth() < 24) {
QX11PixmapData *data = new QX11PixmapData(QPixmapData::PixmapType);
data->xinfo = widget->x11Info();
data->fromImage(src, Qt::AutoColor);
diff --git a/src/gui/painting/qwindowsurface_raster_p.h b/src/gui/painting/qwindowsurface_raster_p.h
index 2a3535f..c10bec3 100644
--- a/src/gui/painting/qwindowsurface_raster_p.h
+++ b/src/gui/painting/qwindowsurface_raster_p.h
@@ -112,7 +112,7 @@ public:
private:
void prepareBuffer(QImage::Format format, QWidget *widget);
Q_DECLARE_PRIVATE(QRasterWindowSurface)
- QRasterWindowSurfacePrivate *d_ptr;
+ QScopedPointer<QRasterWindowSurfacePrivate> d_ptr;
};
QT_END_NAMESPACE
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index 2618ce2..2a20b44 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/painting/qwindowsurface_s60_p.h b/src/gui/painting/qwindowsurface_s60_p.h
index 7b70fd5..40a866d 100644
--- a/src/gui/painting/qwindowsurface_s60_p.h
+++ b/src/gui/painting/qwindowsurface_s60_p.h
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp
index 0842ec7..d8a67c2 100644
--- a/src/gui/styles/gtksymbols.cpp
+++ b/src/gui/styles/gtksymbols.cpp
@@ -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"
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index 3cae08a..f3d1537 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -1693,7 +1693,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..0e54af8 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,12 @@ 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)
+ if (option->state & State_HasFocus) {
key = QLS("f");
+ GTK_WIDGET_SET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
+ }
uint resolve_mask = option->palette.resolve();
@@ -1815,6 +1812,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 +2343,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/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 7a870fe..1be3d6e 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -39,6 +39,11 @@
**
****************************************************************************/
+/*
+ Note: The qdoc comments for QMacStyle are contained in
+ .../doc/src/qstyles.qdoc.
+*/
+
#include "qmacstyle_mac.h"
#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
@@ -1988,87 +1993,12 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
p->drawPixmap(int(macRect.origin.x), int(macRect.origin.y) + finalyoff, width, height, pm);
}
-/*!
- \class QMacStyle
- \brief The QMacStyle class provides a Mac OS X style using the Apple Appearance Manager.
-
- \ingroup appearance
-
- This class is implemented as a wrapper to the HITheme
- APIs, allowing applications to be styled according to the current
- theme in use on Mac OS X. This is done by having primitives
- in QStyle implemented in terms of what Mac OS X would normally theme.
-
- \warning This style is only available on Mac OS X because it relies on the
- HITheme APIs.
-
- There are additional issues that should be taken
- into consideration to make an application compatible with the
- \link http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html
- Apple Human Interface Guidelines \endlink. Some of these issues are outlined
- below.
-
- \list
-
- \i Layout - The restrictions on window layout are such that some
- aspects of layout that are style-dependent cannot be achieved
- using QLayout. Changes are being considered (and feedback would be
- appreciated) to make layouts QStyle-able. Some of the restrictions
- involve horizontal and vertical widget alignment and widget size
- (covered below).
-
- \i Widget size - Mac OS X allows widgets to have specific fixed sizes. Qt
- does not fully implement this behavior so as to maintain cross-platform
- compatibility. As a result some widgets sizes may be inappropriate (and
- subsequently not rendered correctly by the HITheme APIs).The
- QWidget::sizeHint() will return the appropriate size for many
- managed widgets (widgets enumerated in \l QStyle::ContentsType).
-
- \i Effects - QMacStyle uses HITheme for performing most of the drawing, but
- also uses emulation in a few cases where HITheme does not provide the
- required functionality (for example, tab bars on Panther, the toolbar
- separator, etc). We tried to make the emulation as close to the original as
- possible. Please report any issues you see in effects or non-standard
- widgets.
-
- \endlist
-
- There are other issues that need to be considered in the feel of
- your application (including the general color scheme to match the
- Aqua colors). The Guidelines mentioned above will remain current
- with new advances and design suggestions for Mac OS X.
-
- Note that the functions provided by QMacStyle are
- reimplementations of QStyle functions; see QStyle for their
- documentation.
-
- \img qmacstyle.png
- \sa QWindowsXPStyle, QWindowsStyle, QPlastiqueStyle, QCDEStyle, QMotifStyle
-*/
-
-
-/*!
- \enum QMacStyle::WidgetSizePolicy
-
- \value SizeSmall
- \value SizeLarge
- \value SizeMini
- \value SizeDefault
- \omitvalue SizeNone
-*/
-
-/*!
- Constructs a QMacStyle object.
-*/
QMacStyle::QMacStyle()
: QWindowsStyle()
{
d = new QMacStylePrivate(this);
}
-/*!
- Destructs a QMacStyle object.
-*/
QMacStyle::~QMacStyle()
{
delete qt_mac_backgroundPattern;
@@ -2142,7 +2072,6 @@ void qt_mac_fill_background(QPainter *painter, const QRegion &rgn, const QPoint
}
}
-/*! \reimp */
void QMacStyle::polish(QPalette &pal)
{
if (!qt_mac_backgroundPattern) {
@@ -2166,17 +2095,14 @@ void QMacStyle::polish(QPalette &pal)
}
}
-/*! \reimp */
void QMacStyle::polish(QApplication *)
{
}
-/*! \reimp */
void QMacStyle::unpolish(QApplication *)
{
}
-/*! \reimp */
void QMacStyle::polish(QWidget* w)
{
d->addWidget(w);
@@ -2240,7 +2166,6 @@ void QMacStyle::polish(QWidget* w)
}
}
-/*! \reimp */
void QMacStyle::unpolish(QWidget* w)
{
d->removeWidget(w);
@@ -2271,7 +2196,6 @@ void QMacStyle::unpolish(QWidget* w)
QWindowsStyle::unpolish(w);
}
-/*! \reimp */
int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QWidget *widget) const
{
int controlSize = getControlSize(opt, widget);
@@ -2650,7 +2574,6 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
return ret;
}
-/*! \reimp */
QPalette QMacStyle::standardPalette() const
{
QPalette pal = QWindowsStyle::standardPalette();
@@ -2660,7 +2583,6 @@ QPalette QMacStyle::standardPalette() const
return pal;
}
-/*! \reimp */
int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w,
QStyleHintReturn *hret) const
{
@@ -2955,7 +2877,6 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
return ret;
}
-/*! \reimp */
QPixmap QMacStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
const QStyleOption *opt) const
{
@@ -2981,7 +2902,6 @@ QPixmap QMacStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixm
}
-/*! \reimp */
QPixmap QMacStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt,
const QWidget *widget) const
{
@@ -3012,31 +2932,7 @@ QPixmap QMacStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOpt
}
return icon.pixmap(size, size);
}
-/*!
- \enum QMacStyle::FocusRectPolicy
-
- This type is used to signify a widget's focus rectangle policy.
-
- \value FocusEnabled show a focus rectangle when the widget has focus.
- \value FocusDisabled never show a focus rectangle for the widget.
- \value FocusDefault show a focus rectangle when the widget has
- focus and the widget is a QSpinWidget, QDateTimeEdit, QLineEdit,
- QListBox, QListView, editable QTextEdit, or one of their
- subclasses.
-*/
-
-/*!
- \obsolete
- Sets the focus rectangle policy of \a w. The \a policy can be one of
- \l{QMacStyle::FocusRectPolicy}.
-
- This is now simply an interface to the Qt::WA_MacShowFocusRect attribute and the
- FocusDefault value does nothing anymore. If you want to set a widget back
- to its default value, you must save the old value of the attribute before
- you change it.
- \sa focusRectPolicy() QWidget::setAttribute()
-*/
void QMacStyle::setFocusRectPolicy(QWidget *w, FocusRectPolicy policy)
{
switch (policy) {
@@ -3049,29 +2945,11 @@ void QMacStyle::setFocusRectPolicy(QWidget *w, FocusRectPolicy policy)
}
}
-/*!
- \obsolete
- Returns the focus rectangle policy for the widget \a w.
-
- The focus rectangle policy can be one of \l{QMacStyle::FocusRectPolicy}.
-
- In 4.3 and up this function will simply test for the
- Qt::WA_MacShowFocusRect attribute and will never return
- QMacStyle::FocusDefault.
-
- \sa setFocusRectPolicy(), QWidget::testAttribute()
-*/
QMacStyle::FocusRectPolicy QMacStyle::focusRectPolicy(const QWidget *w)
{
return w->testAttribute(Qt::WA_MacShowFocusRect) ? FocusEnabled : FocusDisabled;
}
-/*!
- \obsolete
-
- Call QWidget::setAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize,
- or Qt::WA_MacNormalSize instead.
-*/
void QMacStyle::setWidgetSizePolicy(const QWidget *widget, WidgetSizePolicy policy)
{
QWidget *wadget = const_cast<QWidget *>(widget);
@@ -3080,12 +2958,6 @@ void QMacStyle::setWidgetSizePolicy(const QWidget *widget, WidgetSizePolicy poli
wadget->setAttribute(Qt::WA_MacMiniSize, policy == SizeMini);
}
-/*!
- \obsolete
-
- Call QWidget::testAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize,
- or Qt::WA_MacNormalSize instead.
-*/
QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget)
{
while (widget) {
@@ -3101,7 +2973,6 @@ QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget)
return SizeDefault;
}
-/*! \reimp */
void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
const QWidget *w) const
{
@@ -3534,7 +3405,6 @@ static inline QPixmap darkenPixmap(const QPixmap &pixmap)
-/*! \reimp */
void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p,
const QWidget *w) const
{
@@ -4558,7 +4428,7 @@ static void setLayoutItemMargins(int left, int top, int right, int bottom, QRect
rect->adjust(left, top, right, bottom);
}
}
-/*! \reimp */
+
QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
const QWidget *widget) const
{
@@ -4852,7 +4722,6 @@ static inline void drawToolbarButtonArrow(const QRect &toolButtonRect, ThemeDraw
HIThemeDrawPopupArrow(&hirect, &padi, cg, kHIThemeOrientationNormal);
}
-/*! \reimp */
void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
const QWidget *widget) const
{
@@ -5235,7 +5104,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
arrowOpt.state = tb->state;
arrowOpt.palette = tb->palette;
drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget);
- } else if (tb->features & QStyleOptionToolButton::HasMenu) {
+ } else if ((tb->features & QStyleOptionToolButton::HasMenu)
+ && (tb->toolButtonStyle != Qt::ToolButtonTextOnly && !tb->icon.isNull())) {
drawToolbarButtonArrow(tb->rect, tds, cg);
}
if (tb->state & State_On) {
@@ -5349,7 +5219,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
}
}
-/*! \reimp */
QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc,
const QStyleOptionComplex *opt,
const QPoint &pt, const QWidget *widget) const
@@ -5480,7 +5349,6 @@ QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc,
return sc;
}
-/*! \reimp */
QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc,
const QWidget *widget) const
{
@@ -5820,7 +5688,6 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
return ret;
}
-/*! \reimp */
QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
const QSize &csz, const QWidget *widget) const
{
@@ -6107,9 +5974,6 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
return sz;
}
-/*!
- \reimp
-*/
void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPalette &pal,
bool enabled, const QString &text, QPalette::ColorRole textRole) const
{
@@ -6118,9 +5982,6 @@ void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPale
QWindowsStyle::drawItemText(p, r, flags, pal, enabled, text, textRole);
}
-/*!
- \reimp
-*/
bool QMacStyle::event(QEvent *e)
{
if(e->type() == QEvent::FocusIn) {
@@ -6195,9 +6056,6 @@ void qt_mac_constructQIconFromIconRef(const IconRef icon, const IconRef overlayI
}
}
-/*!
- \internal
-*/
QIcon QMacStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt,
const QWidget *widget) const
{
@@ -6311,9 +6169,6 @@ QIcon QMacStyle::standardIconImplementation(StandardPixmap standardIcon, const Q
return QWindowsStyle::standardIconImplementation(standardIcon, opt, widget);
}
-/*!
- \internal
-*/
int QMacStyle::layoutSpacingImplementation(QSizePolicy::ControlType control1,
QSizePolicy::ControlType control2,
Qt::Orientation orientation,
diff --git a/src/gui/styles/qmotifstyle.cpp b/src/gui/styles/qmotifstyle.cpp
index 7d4fab8..d19750f 100644
--- a/src/gui/styles/qmotifstyle.cpp
+++ b/src/gui/styles/qmotifstyle.cpp
@@ -298,8 +298,11 @@ void QMotifStyle::unpolish(QWidget* widget)
{
QCommonStyle::unpolish(widget);
#ifndef QT_NO_PROGRESSBAR
- if (qobject_cast<QProgressBar *>(widget))
+ if (qobject_cast<QProgressBar *>(widget)) {
+ Q_D(QMotifStyle);
widget->removeEventFilter(this);
+ d->bars.removeAll(static_cast<QProgressBar*>(widget));
+ }
#endif
}
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index bf73494..c6118d6 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -14,13 +44,12 @@
#include "qapplication.h"
#include "qpainter.h"
#include "qstyleoption.h"
-#include "qresizeevent"
-#include "qpixmapcache"
+#include "qevent.h"
+#include "qpixmapcache.h"
#include "qcalendarwidget.h"
#include "qdial.h"
#include "qdialog.h"
-#include "qerrormessage.h"
#include "qgroupbox.h"
#include "qheaderview.h"
#include "qlist.h"
@@ -28,12 +57,13 @@
#include "qlistview.h"
#include "qmenu.h"
#include "qmenubar.h"
-#include "qmessagebox.h"
#include "qpushbutton.h"
+#include "qscrollarea.h"
#include "qscrollbar.h"
#include "qtabbar.h"
#include "qtablewidget.h"
#include "qtableview.h"
+#include "qtextedit.h"
#include "qtoolbar.h"
#include "qtoolbutton.h"
#include "qtreeview.h"
@@ -41,6 +71,7 @@
#include "private/qtoolbarextension_p.h"
#include "private/qcombobox_p.h"
#include "private/qwidget_p.h"
+#include "private/qapplication_p.h"
#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN)
@@ -55,7 +86,6 @@ const QS60StylePrivate::SkinElementFlags QS60StylePrivate::KDefaultSkinElementFl
static const QByteArray propertyKeyLayouts = "layouts";
static const QByteArray propertyKeyCurrentlayout = "currentlayout";
-#if defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
const layoutHeader QS60StylePrivate::m_layoutHeaders[] = {
// *** generated layout data ***
{240,320,1,14,true,QLatin1String("QVGA Landscape Mirrored")},
@@ -85,15 +115,16 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = {
{7,0,-909,0,0,2,0,0,-1,20,52,28,19,19,9,258,-909,-909,-909,29,19,6,0,0,32,-909,60,-909,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,98,35,98,5,5,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,2,-909,-909,-909,-909,7,7,3,1},
{7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,-909,32,-909,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,5,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,8,6,5,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1},
{7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,-909,32,-909,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1}
-
-
// *** End of generated data ***
};
const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0];
-#endif // defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
-bool QS60StylePrivate::m_backgroundValid = false;
+// theme background texture
+QPixmap *QS60StylePrivate::m_background = 0;
+
+// theme palette
+QPalette *QS60StylePrivate::m_themePalette = 0;
const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameElementsData[] = {
{SE_ButtonNormal, QS60StyleEnums::SP_QsnFrButtonTbCenter},
@@ -109,111 +140,20 @@ const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameEleme
{SE_ToolBarButton, QS60StyleEnums::SP_QsnFrSctrlButtonCenter},
{SE_ToolBarButtonPressed, QS60StyleEnums::SP_QsnFrSctrlButtonCenterPressed},
{SE_PanelBackground, QS60StyleEnums::SP_QsnFrSetOptCenter},
+ {SE_ButtonInactive, QS60StyleEnums::SP_QsnFrButtonCenterInactive},
+ {SE_Editor, QS60StyleEnums::SP_QsnFrNotepadCenter},
};
+
static const int frameElementsCount =
int(sizeof(QS60StylePrivate::m_frameElementsData)/sizeof(QS60StylePrivate::m_frameElementsData[0]));
-const int KNotFound = -1;
+const int KNotFound = -909;
+const double KTabFontMul = 0.72;
-void QS60StylePrivate::drawPart(QS60StyleEnums::SkinParts skinPart,
- QPainter *painter, const QRect &rect, SkinElementFlags flags)
+QS60StylePrivate::~QS60StylePrivate()
{
- static const bool doCache =
-#if defined(Q_WS_S60)
- // Freezes on 3.1. Anyways, caching is only really needed on touch UI
- !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2);
-#else
- true;
-#endif
- const QPixmap skinPartPixMap((doCache ? cachedPart : part)(skinPart, rect.size(), flags));
- if (!skinPartPixMap.isNull())
- painter->drawPixmap(rect.topLeft(), skinPartPixMap);
-}
-
-void QS60StylePrivate::drawFrame(SkinFrameElements frameElement, QPainter *painter, const QRect &rect, SkinElementFlags flags)
-{
- static const bool doCache =
-#if defined(Q_WS_S60)
- // Freezes on 3.1. Anyways, caching is only really needed on touch UI
- !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2);
-#else
- true;
-#endif
- const QPixmap frameElementPixMap((doCache ? cachedFrame : frame)(frameElement, rect.size(), flags));
- if (!frameElementPixMap.isNull())
- painter->drawPixmap(rect.topLeft(), frameElementPixMap);
-}
-
-void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start,
- QS60StyleEnums::SkinParts middle, QS60StyleEnums::SkinParts end,
- Qt::Orientation orientation, QPainter *painter, const QRect &rect,
- SkinElementFlags flags)
-{
- QSize startEndSize(partSize(start, flags));
- startEndSize.scale(rect.size(), Qt::KeepAspectRatio);
-
- QRect startRect = QRect(rect.topLeft(), startEndSize);
- QRect middleRect = rect;
- QRect endRect;
-
- if (orientation == Qt::Horizontal) {
- startRect.setWidth(qMin(rect.width() / 2 - 1, startRect.width()));
- endRect = startRect.translated(rect.width() - startRect.width(), 0);
- middleRect.adjust(startRect.width(), 0, -startRect.width(), 0);
- } else {
- startRect.setHeight(qMin(rect.height() / 2 - 1, startRect.height()));
- endRect = startRect.translated(0, rect.height() - startRect.height());
- middleRect.adjust(0, startRect.height(), 0, -startRect.height());
- }
-
-#if 0
- painter->save();
- painter->setOpacity(.3);
- painter->fillRect(startRect, Qt::red);
- painter->fillRect(middleRect, Qt::green);
- painter->fillRect(endRect, Qt::blue);
- painter->restore();
-#else
- drawPart(start, painter, startRect, flags);
- if (middleRect.isValid())
- drawPart(middle, painter, middleRect, flags);
- drawPart(end, painter, endRect, flags);
-#endif
-}
-
-QPixmap QS60StylePrivate::cachedPart(QS60StyleEnums::SkinParts part,
- const QSize &size, SkinElementFlags flags)
-{
- QPixmap result;
- const QString cacheKey =
- QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinElementFlags=%4")
- .arg((int)part).arg(size.width()).arg(size.height()).arg((int)flags);
- if (!QPixmapCache::find(cacheKey, result)) {
- result = QS60StylePrivate::part(part, size, flags);
- QPixmapCache::insert(cacheKey, result);
- }
- return result;
-}
-
-QPixmap QS60StylePrivate::cachedFrame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags)
-{
- QPixmap result;
- const QString cacheKey =
- QString::fromLatin1("S60Style: SkinFrameElements=%1 QSize=%2|%3 SkinElementFlags=%4")
- .arg((int)frame).arg(size.width()).arg(size.height()).arg((int)flags);
- if (!QPixmapCache::find(cacheKey, result)) {
- result = QS60StylePrivate::frame(frame, size, flags);
- QPixmapCache::insert(cacheKey, result);
- }
- return result;
-}
-
-void QS60StylePrivate::refreshUI()
-{
- foreach (QWidget *topLevelWidget, QApplication::allWidgets()) {
- topLevelWidget->updateGeometry();
- QCoreApplication::postEvent(topLevelWidget, new QResizeEvent(topLevelWidget->size(), topLevelWidget->size()));
- }
+ clearCaches(); //deletes also background image
+ deleteThemePalette();
}
void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter,
@@ -335,88 +275,33 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter,
drawRow(QS60StyleEnums::SP_QsnCpScrollHandleTopPressed, QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed,
QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed, Qt::Vertical, painter, rect, flags | SF_PointNorth);
break;
+ case SE_ButtonInactive:
+ drawFrame(SF_ButtonInactive, painter, rect, flags | SF_PointNorth);
+ break;
+ case SE_Editor:
+ drawFrame(SF_Editor, painter, rect, flags | SF_PointNorth);
+ break;
default:
break;
}
}
-QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags)
-{
- QSize result(20, 20);
- switch (part)
- {
- case QS60StyleEnums::SP_QgnGrafBarProgress:
- result.setWidth(pixelMetric(QStyle::PM_ProgressBarChunkWidth));
- break;
- case QS60StyleEnums::SP_QgnGrafTabActiveM:
- case QS60StyleEnums::SP_QgnGrafTabPassiveM:
- case QS60StyleEnums::SP_QgnGrafTabActiveR:
- case QS60StyleEnums::SP_QgnGrafTabPassiveR:
- case QS60StyleEnums::SP_QgnGrafTabPassiveL:
- case QS60StyleEnums::SP_QgnGrafTabActiveL:
- break;
- case QS60StyleEnums::SP_QgnIndiSliderEdit:
- result.scale(pixelMetric(QStyle::PM_SliderLength),
- pixelMetric(QStyle::PM_SliderControlThickness), Qt::IgnoreAspectRatio);
- break;
-
- case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed:
- case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed:
- case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed:
- case QS60StyleEnums::SP_QsnCpScrollBgBottom:
- case QS60StyleEnums::SP_QsnCpScrollBgMiddle:
- case QS60StyleEnums::SP_QsnCpScrollBgTop:
- case QS60StyleEnums::SP_QsnCpScrollHandleBottom:
- case QS60StyleEnums::SP_QsnCpScrollHandleMiddle:
- case QS60StyleEnums::SP_QsnCpScrollHandleTop:
- result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent));
- result.setWidth(pixelMetric(QStyle::PM_ScrollBarExtent));
- break;
- default:
- // Generic frame part size gathering.
- for (int i = 0; i < frameElementsCount; ++i)
- {
- switch (m_frameElementsData[i].center - part) {
- case 8: /* CornerTl */
- case 7: /* CornerTr */
- case 6: /* CornerBl */
- case 5: /* CornerBr */
- result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
- // Falltrough intended...
- case 4: /* SideT */
- case 3: /* SideB */
- result.setHeight(pixelMetric(PM_Custom_FrameCornerHeight));
- break;
- case 2: /* SideL */
- case 1: /* SideR */
- result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
- break;
- case 0: /* center */
- default:
- break;
- }
- }
- break;
- }
- if (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)) {
- const int temp = result.width();
- result.setWidth(result.height());
- result.setHeight(temp);
- }
- return result;
-}
-
-
void QS60StylePrivate::drawSkinPart(QS60StyleEnums::SkinParts part,
QPainter *painter, const QRect &rect, SkinElementFlags flags)
{
drawPart(part, painter, rect, flags);
}
+short QS60StylePrivate::pixelMetric(int metric)
+{
+ Q_ASSERT(metric < MAX_PIXELMETRICS);
+ const short returnValue = m_pmPointer[metric];
+ return returnValue;
+}
+
void QS60StylePrivate::setStyleProperty(const char *name, const QVariant &value)
{
if (name == propertyKeyCurrentlayout) {
-#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
static const QStringList layouts = styleProperty(propertyKeyLayouts).toStringList();
const QString layout = value.toString();
Q_ASSERT(layouts.contains(layout));
@@ -425,23 +310,118 @@ void QS60StylePrivate::setStyleProperty(const char *name, const QVariant &value)
QApplication::setLayoutDirection(m_layoutHeaders[layoutIndex].mirroring ? Qt::RightToLeft : Qt::LeftToRight);
clearCaches();
refreshUI();
- return;
-#else
- qFatal("Cannot set static layout. Dynamic layouts are used!");
-#endif
+ }
+}
+
+QVariant QS60StylePrivate::styleProperty(const char *name) const
+{
+ if (name == propertyKeyLayouts) {
+ static QStringList layouts;
+ if (layouts.isEmpty())
+ for (int i = 0; i < m_numberOfLayouts; i++)
+ layouts.append(m_layoutHeaders[i].layoutName);
+ return layouts;
+ }
+ return QVariant();
+}
+
+QColor QS60StylePrivate::stateColor(const QColor &color, const QStyleOption *option)
+{
+ QColor retColor (color);
+ if (option && !(option->state & QStyle::State_Enabled)) {
+ QColor hsvColor = retColor.toHsv();
+ int colorSat = hsvColor.saturation();
+ int colorVal = hsvColor.value();
+ colorSat = (colorSat!=0) ? (colorSat>>1) : 128;
+ colorVal = (colorVal!=0) ? (colorVal>>1) : 128;
+ hsvColor.setHsv(hsvColor.hue(), colorSat, colorVal);
+ retColor = hsvColor.toRgb();
+ }
+ return retColor;
+}
+
+QColor QS60StylePrivate::lighterColor(const QColor &baseColor)
+{
+ QColor result(baseColor);
+ bool modifyColor = false;
+ if (result.saturation() == 0) {
+ result.setHsv(result.hue(), 128, result.value());
+ modifyColor = true;
+ }
+ if (result.value() == 0) {
+ result.setHsv(result.hue(), result.saturation(), 128);
+ modifyColor = true;
+ }
+ if (modifyColor)
+ result = result.lighter(175);
+ else
+ result = result.lighter(225);
+ return result;
+}
+
+bool QS60StylePrivate::drawsOwnThemeBackground(const QWidget *widget)
+{
+ return qobject_cast<const QDialog *> (widget);
+}
+
+QFont QS60StylePrivate::s60Font(
+ QS60StyleEnums::FontCategories fontCategory, int pointSize) const
+{
+ QFont result;
+ int actualPointSize = pointSize;
+ if (actualPointSize <= 0) {
+ const QFont appFont = QApplication::font();
+ actualPointSize = appFont.pointSize();
+ if (actualPointSize <= 0)
+ actualPointSize = appFont.pixelSize() * 72 / qt_defaultDpiY();
+ }
+ Q_ASSERT(actualPointSize > 0);
+ const QPair<QS60StyleEnums::FontCategories, int> key(fontCategory, actualPointSize);
+ if (!m_mappedFontsCache.contains(key)) {
+ result = s60Font_specific(fontCategory, actualPointSize);
+ m_mappedFontsCache.insert(key, result);
+ } else {
+ result = m_mappedFontsCache.value(key);
+ if (result.pointSize() != actualPointSize)
+ result.setPointSize(actualPointSize);
+ }
+ return result;
+}
+
+void QS60StylePrivate::clearCaches(CacheClearReason reason)
+{
+ switch(reason){
+ case CC_LayoutChange:
+ // when layout changes, the colors remain in cache, but graphics and fonts can change
+ m_mappedFontsCache.clear();
+ deleteBackground();
+ QPixmapCache::clear();
+ break;
+ case CC_ThemeChange:
+ m_colorCache.clear();
+ QPixmapCache::clear();
+ deleteBackground();
+ break;
+ case CC_UndefinedChange:
+ default:
+ m_colorCache.clear();
+ m_mappedFontsCache.clear();
+ QPixmapCache::clear();
+ deleteBackground();
+ break;
}
}
// Since S60Style has 'button' and 'tooltip' as a graphic, we don't have any native color which to use
-// for QPalette::Button and QPalette::ToolTipBase. Therefore we need to guesstimate
-// this by calculating average rgb values for button pixels.
+// for QPalette::Button and QPalette::ToolTipBase. Therefore S60Style needs to guesstimate
+// palette colors by calculating average rgb values for button pixels.
// Returns Qt::black if there is an issue with the graphics (image is NULL, or no bits() found).
-QColor QS60StylePrivate::colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const
+QColor QS60StylePrivate::colorFromFrameGraphics(SkinFrameElements frame) const
{
const bool cachedColorExists = m_colorCache.contains(frame);
if (!cachedColorExists) {
- const int frameCornerWidth = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth);
- const int frameCornerHeight = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight);
+ const int frameCornerWidth = pixelMetric(PM_Custom_FrameCornerWidth);
+ const int frameCornerHeight = pixelMetric(PM_Custom_FrameCornerHeight);
Q_ASSERT(2*frameCornerWidth<32);
Q_ASSERT(2*frameCornerHeight<32);
@@ -453,7 +433,6 @@ QColor QS60StylePrivate::colorFromFrameGraphics(QS60StylePrivate::SkinFrameEleme
const int pixels = frameImage.numBytes()/sizeof(QRgb);
const int bytesPerLine = frameImage.bytesPerLine();
Q_ASSERT(bytesPerLine);
- const int rows = frameImage.numBytes()/(sizeof(QRgb)*bytesPerLine);
int estimatedRed = 0;
int estimatedGreen = 0;
@@ -494,284 +473,400 @@ QColor QS60StylePrivate::colorFromFrameGraphics(QS60StylePrivate::SkinFrameEleme
}
-int QS60StylePrivate::focusRectPenWidth()
+void QS60StylePrivate::setThemePalette(QApplication *app) const
{
- return pixelMetric(QS60Style::PM_DefaultFrameWidth);
+ Q_UNUSED(app)
+ QPalette widgetPalette = QPalette(Qt::white);
+ setThemePalette(&widgetPalette);
+ QApplication::setPalette(widgetPalette);
}
-void QS60StylePrivate::setThemePalette(QApplication *app) const
+void QS60StylePrivate::setThemePalette(QStyleOption *option) const
{
- if (!app)
- return;
-
- QPalette widgetPalette = QPalette(Qt::white);
+ setThemePalette(&option->palette);
+}
- // basic colors
- widgetPalette.setColor(QPalette::WindowText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
- widgetPalette.setColor(QPalette::ButtonText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
- widgetPalette.setColor(QPalette::Text,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
- widgetPalette.setColor(QPalette::ToolTipText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 55, 0));
- widgetPalette.setColor(QPalette::BrightText, widgetPalette.color(QPalette::WindowText).lighter());
- widgetPalette.setColor(QPalette::HighlightedText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0));
- widgetPalette.setColor(QPalette::Link,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnHighlightColors, 3, 0));
- widgetPalette.setColor(QPalette::LinkVisited, widgetPalette.color(QPalette::Link).darker());
- widgetPalette.setColor(QPalette::Highlight,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnHighlightColors, 2, 0));
- // set these as transparent so that styled full screen theme background is visible
- widgetPalette.setColor(QPalette::AlternateBase, Qt::transparent);
- widgetPalette.setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture());
- widgetPalette.setColor(QPalette::Base, Qt::transparent);
- // set button and tooltipbase based on pixel colors
- const QColor buttonColor = colorFromFrameGraphics(QS60StylePrivate::SF_ButtonNormal);
- widgetPalette.setColor(QPalette::Button, buttonColor );
- widgetPalette.setColor(QPalette::Light, widgetPalette.color(QPalette::Button).lighter());
- widgetPalette.setColor(QPalette::Dark, widgetPalette.color(QPalette::Button).darker());
- widgetPalette.setColor(QPalette::Midlight, widgetPalette.color(QPalette::Button).lighter(125));
- widgetPalette.setColor(QPalette::Mid, widgetPalette.color(QPalette::Button).darker(150));
- widgetPalette.setColor(QPalette::Shadow, Qt::black);
- QColor toolTipColor = colorFromFrameGraphics(QS60StylePrivate::SF_ToolTip);
- widgetPalette.setColor(QPalette::ToolTipBase, toolTipColor );
-
- app->setPalette(widgetPalette);
+QPalette* QS60StylePrivate::themePalette()
+{
+ return m_themePalette;
}
void QS60StylePrivate::setBackgroundTexture(QApplication *app) const
{
- if (!app)
- return;
- QPalette applicationPalette = app->palette();
- applicationPalette.setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture());
- app->setPalette(applicationPalette);
+ Q_UNUSED(app)
+ QPalette applicationPalette = QApplication::palette();
+ applicationPalette.setBrush(QPalette::Window, backgroundTexture());
+ QApplication::setPalette(applicationPalette);
}
-void QS60Style::polish(QApplication *application)
+void QS60StylePrivate::deleteBackground()
{
- Q_D(const QS60Style);
- originalPalette = application->palette();
- d->setThemePalette(application);
+ if (m_background) {
+ delete m_background;
+ m_background = 0;
+ }
}
-void QS60Style::polish(QWidget *widget)
+int QS60StylePrivate::focusRectPenWidth()
{
- Q_D(const QS60Style);
- QCommonStyle::polish(widget);
+ return pixelMetric(QS60Style::PM_DefaultFrameWidth);
+}
- if (!widget)
- return;
+void QS60StylePrivate::setCurrentLayout(int index)
+{
+ m_pmPointer = data[index];
+}
- if (QS60StylePrivate::isSkinnableDialog(widget)) {
- widget->setAttribute(Qt::WA_StyledBackground);
- } else if (false
-#ifndef QT_NO_MENU
- || qobject_cast<const QMenu *> (widget)
-#endif // QT_NO_MENU
- ) {
- widget->setAttribute(Qt::WA_StyledBackground);
- } else if (false
-#ifndef QT_NO_COMBOBOX
- || qobject_cast<const QComboBoxListView *>(widget)
-#endif //QT_NO_COMBOBOX
- ) {
- widget->setAttribute(Qt::WA_StyledBackground);
- }
+void QS60StylePrivate::drawPart(QS60StyleEnums::SkinParts skinPart,
+ QPainter *painter, const QRect &rect, SkinElementFlags flags)
+{
+ static const bool doCache =
+#if defined(Q_WS_S60)
+ // Freezes on 3.1. Anyways, caching is only really needed on touch UI
+ !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2);
+#else
+ true;
+#endif
+ const QPixmap skinPartPixMap((doCache ? cachedPart : part)(skinPart, rect.size(), flags));
+ if (!skinPartPixMap.isNull())
+ painter->drawPixmap(rect.topLeft(), skinPartPixMap);
+}
- QPalette widgetPalette = widget->palette();
+void QS60StylePrivate::drawFrame(SkinFrameElements frameElement, QPainter *painter, const QRect &rect, SkinElementFlags flags)
+{
+ static const bool doCache =
+#if defined(Q_WS_S60)
+ // Freezes on 3.1. Anyways, caching is only really needed on touch UI
+ !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2);
+#else
+ true;
+#endif
+ const QPixmap frameElementPixMap((doCache ? cachedFrame : frame)(frameElement, rect.size(), flags));
+ if (!frameElementPixMap.isNull())
+ painter->drawPixmap(rect.topLeft(), frameElementPixMap);
+}
- // widget specific colors and fonts
- if (qobject_cast<QSlider *>(widget)){
- widgetPalette.setColor(QPalette::All, QPalette::WindowText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 8, 0));
- QApplication::setPalette(widgetPalette, "QSlider");
- } else if (qobject_cast<QPushButton *>(widget)){
- const QFont suggestedFont = d->s60Font(
- QS60StyleEnums::FC_Primary, widget->font().pointSizeF());
- widget->setFont(suggestedFont);
- widgetPalette.setColor(QPalette::Active, QPalette::ButtonText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
- widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
- QApplication::setPalette(widgetPalette, "QPushButton");
- } else if (qobject_cast<QToolButton *>(widget)){
- const QFont suggestedFont = d->s60Font(
- QS60StyleEnums::FC_Primary, widget->font().pointSizeF());
- widget->setFont(suggestedFont);
- widgetPalette.setColor(QPalette::Active, QPalette::ButtonText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
- widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
- QApplication::setPalette(widgetPalette, "QToolButton");
- } else if (qobject_cast<QHeaderView *>(widget)){
- const QFont suggestedFont = d->s60Font(
- QS60StyleEnums::FC_Secondary, widget->font().pointSizeF());
- widget->setFont(suggestedFont);
- widgetPalette.setColor(QPalette::Active, QPalette::ButtonText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 23, 0));
- QHeaderView* header = qobject_cast<QHeaderView *>(widget);
- widgetPalette.setColor(QPalette::Button, Qt::transparent );
- if ( header->viewport() )
- header->viewport()->setPalette(widgetPalette);
- QApplication::setPalette(widgetPalette, "QHeaderView");
- } else if (qobject_cast<QMenuBar *>(widget)){
- widgetPalette.setColor(QPalette::All, QPalette::ButtonText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 8, 0));
- QApplication::setPalette(widgetPalette, "QMenuBar");
- } else if (qobject_cast<QTabBar *>(widget)){
- widgetPalette.setColor(QPalette::Active, QPalette::WindowText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 4, 0));
- QApplication::setPalette(widgetPalette, "QTabBar");
- } else if (qobject_cast<QTableView *>(widget)){
- widgetPalette.setColor(QPalette::All, QPalette::Text,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0));
- QApplication::setPalette(widgetPalette, "QTableView");
- } else if (qobject_cast<QGroupBox *>(widget)){
- const QFont suggestedFont = d->s60Font(
- QS60StyleEnums::FC_Title, widget->font().pointSizeF());
- widget->setFont(suggestedFont);
- } else if (qobject_cast<QLineEdit *>(widget)) {
- widgetPalette.setColor(QPalette::All, QPalette::HighlightedText,
- QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
- QApplication::setPalette(widgetPalette, "QLineEdit");
- } else if (qobject_cast<QDial *> (widget)) {
- const QColor color(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
- widgetPalette.setColor(QPalette::WindowText, color);
- widgetPalette.setColor(QPalette::Button, QApplication::palette().color(QPalette::Button));
- widgetPalette.setColor(QPalette::Dark, color.darker());
- widgetPalette.setColor(QPalette::Light, color.lighter());
- QApplication::setPalette(widgetPalette, "QDial");
+void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start,
+ QS60StyleEnums::SkinParts middle, QS60StyleEnums::SkinParts end,
+ Qt::Orientation orientation, QPainter *painter, const QRect &rect,
+ SkinElementFlags flags)
+{
+ QSize startEndSize(partSize(start, flags));
+ startEndSize.scale(rect.size(), Qt::KeepAspectRatio);
+
+ QRect startRect = QRect(rect.topLeft(), startEndSize);
+ QRect middleRect = rect;
+ QRect endRect;
+
+ if (orientation == Qt::Horizontal) {
+ startRect.setWidth(qMin(rect.width() >>1 - 1, startRect.width()));
+ endRect = startRect.translated(rect.width() - startRect.width(), 0);
+ middleRect.adjust(startRect.width(), 0, -startRect.width(), 0);
+ if (startRect.bottomRight().x() > endRect.topLeft().x()) {
+ const int overlap = (startRect.bottomRight().x() - endRect.topLeft().x())>>1;
+ startRect.setWidth(startRect.width()-overlap);
+ endRect.adjust(overlap,0,0,0);
+ }
+ } else {
+ startRect.setHeight(qMin(rect.height() >>1 - 1, startRect.height()));
+ endRect = startRect.translated(0, rect.height() - startRect.height());
+ middleRect.adjust(0, startRect.height(), 0, -startRect.height());
+ if (startRect.topRight().y() > endRect.bottomLeft().y()) {
+ const int overlap = (startRect.topRight().y() - endRect.bottomLeft().y())>>1;
+ startRect.setHeight(startRect.height()-overlap);
+ endRect.adjust(0,overlap,0,0);
+ }
}
+
+#if 0
+ painter->save();
+ painter->setOpacity(.3);
+ painter->fillRect(startRect, Qt::red);
+ painter->fillRect(middleRect, Qt::green);
+ painter->fillRect(endRect, Qt::blue);
+ painter->restore();
+#else
+ drawPart(start, painter, startRect, flags);
+ if (middleRect.isValid())
+ drawPart(middle, painter, middleRect, flags);
+ drawPart(end, painter, endRect, flags);
+#endif
}
-void QS60Style::unpolish(QApplication *application)
+QPixmap QS60StylePrivate::cachedPart(QS60StyleEnums::SkinParts part,
+ const QSize &size, SkinElementFlags flags)
{
- application->setPalette(originalPalette);
+ QPixmap result;
+ const QString cacheKey =
+ QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinPartFlags=%4")
+ .arg((int)part).arg(size.width()).arg(size.height()).arg((int)flags);
+ if (!QPixmapCache::find(cacheKey, result)) {
+ result = QS60StylePrivate::part(part, size, flags);
+ QPixmapCache::insert(cacheKey, result);
+ }
+ return result;
}
-void QS60Style::unpolish(QWidget *widget)
+QPixmap QS60StylePrivate::cachedFrame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags)
{
- if (QS60StylePrivate::isSkinnableDialog(widget)) {
- widget->setAttribute(Qt::WA_StyledBackground, false);
- } else if (false
-#ifndef QT_NO_MENU
- || qobject_cast<const QMenu *> (widget)
-#endif // QT_NO_MENU
- ) {
- widget->setAttribute(Qt::WA_StyledBackground, false);
- } else if (false
-#ifndef QT_NO_COMBOBOX
- || qobject_cast<const QComboBoxListView *>(widget)
-#endif //QT_NO_COMBOBOX
- ) {
- widget->setAttribute(Qt::WA_StyledBackground, false);
+ QPixmap result;
+ const QString cacheKey =
+ QString::fromLatin1("S60Style: SkinFrameElements=%1 QSize=%2|%3 SkinElementFlags=%4")
+ .arg((int)frame).arg(size.width()).arg(size.height()).arg((int)flags);
+ if (!QPixmapCache::find(cacheKey, result)) {
+ result = QS60StylePrivate::frame(frame, size, flags);
+ QPixmapCache::insert(cacheKey, result);
}
+ return result;
+}
- if (widget) {
- widget->setPalette(QPalette());
- }
+void QS60StylePrivate::refreshUI()
+{
+ QList<QWidget *> widgets = QApplication::allWidgets();
- QCommonStyle::unpolish(widget);
+ for (int i = 0; i < widgets.size(); ++i) {
+ QWidget *widget = widgets.at(i);
+ if (widget == 0)
+ continue;
+
+ if (widget->style()) {
+ widget->style()->polish(widget);
+ QEvent event(QEvent::StyleChange);
+ qApp->sendEvent(widget, &event);
+ }
+ widget->update();
+ widget->updateGeometry();
+ }
}
-QVariant QS60StylePrivate::styleProperty(const char *name) const
+void QS60StylePrivate::setFont(QWidget *widget) const
{
- if (name == propertyKeyLayouts) {
-#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
- static QStringList layouts;
- if (layouts.isEmpty())
- for (int i = 0; i < QS60StylePrivate::m_numberOfLayouts; i++)
- layouts.append(QS60StylePrivate::m_layoutHeaders[i].layoutName);
- return layouts;
-#else
- qFatal("Cannot return list of 'canned' static layouts. Dynamic layouts are used!");
-#endif
+ QS60StyleEnums::FontCategories fontCategory = QS60StyleEnums::FC_Undefined;
+ if (!widget)
+ return;
+ if (qobject_cast<QPushButton *>(widget)){
+ fontCategory = QS60StyleEnums::FC_Primary;
+ } else if (qobject_cast<QToolButton *>(widget)){
+ fontCategory = QS60StyleEnums::FC_Primary;
+ } else if (qobject_cast<QHeaderView *>(widget)){
+ fontCategory = QS60StyleEnums::FC_Secondary;
+ } else if (qobject_cast<QGroupBox *>(widget)){
+ fontCategory = QS60StyleEnums::FC_Title;
+ }
+ if (fontCategory != QS60StyleEnums::FC_Undefined) {
+ const QFont suggestedFont =
+ s60Font(fontCategory, widget->font().pointSizeF());
+ widget->setFont(suggestedFont);
}
- return QVariant();
}
-QFont QS60StylePrivate::s60Font(
- QS60StyleEnums::FontCategories fontCategory, int pointSize) const
+void QS60StylePrivate::setThemePalette(QWidget *widget) const
{
- QFont result;
- int actualPointSize = pointSize;
- if (actualPointSize <= 0) {
- const QFont appFont = QApplication::font();
- actualPointSize = appFont.pointSize();
- if (actualPointSize <= 0)
- actualPointSize = appFont.pixelSize() * 72 / qt_defaultDpiY();
- }
- Q_ASSERT(actualPointSize > 0);
- const QPair<QS60StyleEnums::FontCategories, int> key(fontCategory, actualPointSize);
- if (!m_mappedFontsCache.contains(key)) {
- result = s60Font_specific(fontCategory, actualPointSize);
- m_mappedFontsCache.insert(key, result);
- } else {
- result = m_mappedFontsCache.value(key);
- if (result.pointSize() != actualPointSize)
- result.setPointSize(actualPointSize);
+ if(!widget)
+ return;
+ QPalette widgetPalette = widget->palette();
+
+ //header view and its viewport need to be set 100% transparent button color, since drawing code will
+ //draw transparent theme graphics to table column and row headers.
+ if (qobject_cast<QHeaderView *>(widget)){
+ widgetPalette.setColor(QPalette::Active, QPalette::ButtonText,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 23, 0));
+ QHeaderView* header = qobject_cast<QHeaderView *>(widget);
+ widgetPalette.setColor(QPalette::Button, Qt::transparent );
+ if ( header->viewport() )
+ header->viewport()->setPalette(widgetPalette);
+ QApplication::setPalette(widgetPalette, "QHeaderView");
}
- return result;
}
-//todo: you could pass a reason to clear cache here, so that we could
-// deduce whether or not the specific cache needs to be cleared
-void QS60StylePrivate::clearCaches()
+void QS60StylePrivate::setThemePalette(QPalette *palette) const
{
- m_colorCache.clear();
- m_mappedFontsCache.clear();
- QPixmapCache::clear();
- m_backgroundValid = false;
+ if (!palette)
+ return;
+
+ // basic colors
+ palette->setColor(QPalette::WindowText,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
+ palette->setColor(QPalette::ButtonText,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
+ palette->setColor(QPalette::Text,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0));
+ palette->setColor(QPalette::ToolTipText,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 55, 0));
+ palette->setColor(QPalette::BrightText, palette->color(QPalette::WindowText).lighter());
+ palette->setColor(QPalette::HighlightedText,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0));
+ palette->setColor(QPalette::Link,
+ s60Color(QS60StyleEnums::CL_QsnHighlightColors, 3, 0));
+ palette->setColor(QPalette::LinkVisited, palette->color(QPalette::Link).darker());
+ palette->setColor(QPalette::Highlight,
+ s60Color(QS60StyleEnums::CL_QsnHighlightColors, 2, 0));
+ // set background image as a texture brush
+ palette->setBrush(QPalette::Window, backgroundTexture());
+ // set these as transparent so that styled full screen theme background is visible
+ palette->setColor(QPalette::AlternateBase, Qt::transparent);
+ palette->setBrush(QPalette::Base, Qt::transparent);
+ // set button and tooltipbase based on pixel colors
+ const QColor buttonColor = this->colorFromFrameGraphics(SF_ButtonNormal);
+ palette->setColor(QPalette::Button, buttonColor );
+ const QColor toolTipColor = this->colorFromFrameGraphics(SF_ToolTip);
+ palette->setColor(QPalette::ToolTipBase, toolTipColor );
+ palette->setColor(QPalette::Light, palette->color(QPalette::Button).lighter());
+ palette->setColor(QPalette::Dark, palette->color(QPalette::Button).darker());
+ palette->setColor(QPalette::Midlight, palette->color(QPalette::Button).lighter(125));
+ palette->setColor(QPalette::Mid, palette->color(QPalette::Button).darker(150));
+ palette->setColor(QPalette::Shadow, Qt::black);
+
+ setThemePaletteHash(palette);
+ storeThemePalette(palette);
}
-QColor QS60StylePrivate::lighterColor(const QColor &baseColor)
+void QS60StylePrivate::deleteThemePalette()
{
- QColor result(baseColor);
- bool modifyColor = false;
- if (result.saturation() == 0) {
- result.setHsv(result.hue(), 128, result.value());
- modifyColor = true;
- }
- if (result.value() == 0) {
- result.setHsv(result.hue(), result.saturation(), 128);
- modifyColor = true;
+ if (m_themePalette) {
+ delete m_themePalette;
+ m_themePalette = 0;
}
- if (modifyColor)
- result = result.lighter(175);
- else
- result = result.lighter(225);
- return result;
}
-bool QS60StylePrivate::isSkinnableDialog(const QWidget *widget)
+void QS60StylePrivate::storeThemePalette(QPalette *palette)
{
- return (qobject_cast<const QMessageBox *> (widget) ||
- qobject_cast<const QErrorMessage *> (widget));
+ deleteThemePalette();
+ //store specified palette for latter use.
+ m_themePalette = new QPalette(*palette);
}
-#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
-void QS60StylePrivate::setCurrentLayout(int index)
+// set widget specific palettes
+void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const
{
- m_pmPointer = data[index];
+ if (!palette)
+ return;
+
+ //store the original palette
+ QPalette widgetPalette = *palette;
+ const QColor mainAreaTextColor =
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0);
+
+ widgetPalette.setColor(QPalette::All, QPalette::WindowText,
+ s60Color(QS60StyleEnums::CL_QsnLineColors, 8, 0));
+ QApplication::setPalette(widgetPalette, "QSlider");
+ // return to original palette after each widget
+ widgetPalette = *palette;
+
+ widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, mainAreaTextColor);
+ widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText, mainAreaTextColor);
+ const QStyleOption opt;
+ widgetPalette.setColor(QPalette::Disabled, QPalette::ButtonText,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 6, &opt));
+ QApplication::setPalette(widgetPalette, "QPushButton");
+ widgetPalette = *palette;
+
+ widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, mainAreaTextColor);
+ widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText, mainAreaTextColor);
+ QApplication::setPalette(widgetPalette, "QToolButton");
+ widgetPalette = *palette;
+
+ widgetPalette.setColor(QPalette::Active, QPalette::ButtonText,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 23, 0));
+ QApplication::setPalette(widgetPalette, "QHeaderView");
+ widgetPalette = *palette;
+
+ widgetPalette.setColor(QPalette::All, QPalette::ButtonText,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 8, 0));
+ QApplication::setPalette(widgetPalette, "QMenuBar");
+ widgetPalette = *palette;
+
+ widgetPalette.setColor(QPalette::Active, QPalette::WindowText,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 4, 0));
+ QApplication::setPalette(widgetPalette, "QTabBar");
+ widgetPalette = *palette;
+
+ widgetPalette.setColor(QPalette::All, QPalette::Text,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0));
+ QApplication::setPalette(widgetPalette, "QTableView");
+ widgetPalette = *palette;
+
+ widgetPalette.setColor(QPalette::All, QPalette::HighlightedText,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
+ QApplication::setPalette(widgetPalette, "QLineEdit");
+ widgetPalette = *palette;
+
+ widgetPalette.setColor(QPalette::WindowText, mainAreaTextColor);
+ widgetPalette.setColor(QPalette::Button, QApplication::palette().color(QPalette::Button));
+ widgetPalette.setColor(QPalette::Dark, mainAreaTextColor.darker());
+ widgetPalette.setColor(QPalette::Light, mainAreaTextColor.lighter());
+ QApplication::setPalette(widgetPalette, "QDial");
+ widgetPalette = *palette;
+
+ widgetPalette.setBrush(QPalette::Window, QBrush());
+ QApplication::setPalette(widgetPalette, "QScrollArea");
+ widgetPalette = *palette;
}
-#endif
-QColor QS60StylePrivate::stateColor(const QColor& color, const QStyleOption *option)
+QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags)
{
- QColor retColor (color);
- if (option && !(option->state & QStyle::State_Enabled)) {
- QColor hsvColor = retColor.toHsv();
- int colorSat = hsvColor.saturation();
- int colorVal = hsvColor.value();
- colorSat = (colorSat!=0) ? (colorSat>>1) : 128;
- colorVal = (colorVal!=0) ? (colorVal>>1) : 128;
- hsvColor.setHsv(hsvColor.hue(), colorSat, colorVal);
- retColor = hsvColor.toRgb();
+ QSize result(20, 20);
+ switch (part)
+ {
+ case QS60StyleEnums::SP_QgnGrafBarProgress:
+ result.setWidth(pixelMetric(QStyle::PM_ProgressBarChunkWidth));
+ break;
+ case QS60StyleEnums::SP_QgnGrafTabActiveM:
+ case QS60StyleEnums::SP_QgnGrafTabPassiveM:
+ case QS60StyleEnums::SP_QgnGrafTabActiveR:
+ case QS60StyleEnums::SP_QgnGrafTabPassiveR:
+ case QS60StyleEnums::SP_QgnGrafTabPassiveL:
+ case QS60StyleEnums::SP_QgnGrafTabActiveL:
+ break;
+ case QS60StyleEnums::SP_QgnIndiSliderEdit:
+ result.scale(pixelMetric(QStyle::PM_SliderLength),
+ pixelMetric(QStyle::PM_SliderControlThickness), Qt::IgnoreAspectRatio);
+ break;
+
+ case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed:
+ case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed:
+ case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed:
+ case QS60StyleEnums::SP_QsnCpScrollBgBottom:
+ case QS60StyleEnums::SP_QsnCpScrollBgMiddle:
+ case QS60StyleEnums::SP_QsnCpScrollBgTop:
+ case QS60StyleEnums::SP_QsnCpScrollHandleBottom:
+ case QS60StyleEnums::SP_QsnCpScrollHandleMiddle:
+ case QS60StyleEnums::SP_QsnCpScrollHandleTop:
+ result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent));
+ result.setWidth(pixelMetric(QStyle::PM_ScrollBarExtent));
+ break;
+ default:
+ // Generic frame part size gathering.
+ for (int i = 0; i < frameElementsCount; ++i)
+ {
+ switch (m_frameElementsData[i].center - part) {
+ case 8: /* CornerTl */
+ case 7: /* CornerTr */
+ case 6: /* CornerBl */
+ case 5: /* CornerBr */
+ result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
+ // Falltrough intended...
+ case 4: /* SideT */
+ case 3: /* SideB */
+ result.setHeight(pixelMetric(PM_Custom_FrameCornerHeight));
+ break;
+ case 2: /* SideL */
+ case 1: /* SideR */
+ result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
+ break;
+ case 0: /* center */
+ default:
+ break;
+ }
+ }
+ break;
}
- return retColor;
+ if (flags & (SF_PointEast | SF_PointWest)) {
+ const int temp = result.width();
+ result.setWidth(result.height());
+ result.setHeight(temp);
+ }
+ return result;
}
/*!
@@ -783,14 +878,6 @@ QColor QS60StylePrivate::stateColor(const QColor& color, const QStyleOption *opt
\sa QMacStyle, QWindowsStyle, QWindowsXPStyle, QWindowsVistaStyle, QPlastiqueStyle, QCleanlooksStyle, QMotifStyle
*/
-/*!
- Constructs a QS60Style object.
-*/
-QS60Style::QS60Style()
- : QCommonStyle(*new QS60StylePrivate)
-{
-}
-
QS60Style::~QS60Style()
{
}
@@ -803,8 +890,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
const QS60StylePrivate::SkinElementFlags flags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled;
SubControls sub = option->subControls;
- Q_D(const QS60Style);
-
switch (control) {
#ifndef QT_NO_SCROLLBAR
case CC_ScrollBar:
@@ -817,18 +902,18 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
const QS60StylePrivate::SkinElements grooveElement =
horizontal ? QS60StylePrivate::SE_ScrollBarGrooveHorizontal : QS60StylePrivate::SE_ScrollBarGrooveVertical;
QS60StylePrivate::drawSkinElement(grooveElement, painter, grooveRect, flags);
-
- QStyle::SubControls subControls = optionSlider->subControls;
-
+
+ const QStyle::SubControls subControls = optionSlider->subControls;
+
// select correct slider (horizontal/vertical/pressed)
const bool sliderPressed = ((optionSlider->state & QStyle::State_Sunken) && (subControls & SC_ScrollBarSlider));
const QS60StylePrivate::SkinElements handleElement =
- horizontal ?
- ( sliderPressed ?
- QS60StylePrivate::SE_ScrollBarHandlePressedHorizontal :
- QS60StylePrivate::SE_ScrollBarHandleHorizontal ) :
- ( sliderPressed ?
- QS60StylePrivate::SE_ScrollBarHandlePressedVertical :
+ horizontal ?
+ ( sliderPressed ?
+ QS60StylePrivate::SE_ScrollBarHandlePressedHorizontal :
+ QS60StylePrivate::SE_ScrollBarHandleHorizontal ) :
+ ( sliderPressed ?
+ QS60StylePrivate::SE_ScrollBarHandlePressedVertical :
QS60StylePrivate::SE_ScrollBarHandleVertical);
QS60StylePrivate::drawSkinElement(handleElement, painter, scrollBarSlider, flags);
}
@@ -870,11 +955,9 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
const QRect cmbxEditField = subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget);
const QRect cmbxFrame = subControlRect(CC_ComboBox, option, SC_ComboBoxFrame, widget);
-
const bool direction = cmb->direction == Qt::LeftToRight;
// Button frame
- //todo: why calc rect here for button? Is there no suitable SE_xxx for that?
QStyleOptionFrame buttonOption;
buttonOption.QStyleOption::operator=(*cmb);
const int maxHeight = cmbxFrame.height();
@@ -884,15 +967,15 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
buttonOption.rect = buttonRect;
buttonOption.state = cmb->state & (State_Enabled | State_MouseOver);
drawPrimitive(PE_PanelButtonCommand, &buttonOption, painter, widget);
- // todo: we could draw qgn_prop_set_button skin item here
// draw label background - label itself is drawn separately
const QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_FrameLineEdit;
QS60StylePrivate::drawSkinElement(skinElement, painter, cmbxEditField, flags);
+ // Draw the combobox arrow
if (sub & SC_ComboBoxArrow) {
- // Draw the little arrow
- buttonOption.rect.adjust(1, 1, -1, -1);
+ // Make rect slightly smaller
+ buttonOption.rect.adjust(1, 1, -1, -1);
painter->save();
painter->setPen(option->palette.buttonText().color());
drawPrimitive(PE_IndicatorSpinDown, &buttonOption, painter, widget);
@@ -1032,14 +1115,13 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
if (spinBox->subControls & SC_SpinBoxUp) {
copy.subControls = SC_SpinBoxUp;
- QPalette pal2 = spinBox->palette;
+ QPalette spinBoxPal = spinBox->palette;
if (!(spinBox->stepEnabled & QAbstractSpinBox::StepUpEnabled)) {
- pal2.setCurrentColorGroup(QPalette::Disabled);
+ spinBoxPal.setCurrentColorGroup(QPalette::Disabled);
copy.state &= ~State_Enabled;
+ copy.palette = spinBoxPal;
}
- copy.palette = pal2;
-
if (spinBox->activeSubControls == SC_SpinBoxUp && (spinBox->state & State_Sunken)) {
copy.state |= State_On;
copy.state |= State_Sunken;
@@ -1047,8 +1129,9 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
copy.state |= State_Raised;
copy.state &= ~State_Sunken;
}
- pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinPlus
- : PE_IndicatorSpinUp);
+ pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ?
+ PE_IndicatorSpinPlus :
+ PE_IndicatorSpinUp;
copy.rect = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxUp, widget);
drawPrimitive(PE_PanelButtonBevel, &copy, painter, widget);
@@ -1059,12 +1142,12 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
if (spinBox->subControls & SC_SpinBoxDown) {
copy.subControls = SC_SpinBoxDown;
copy.state = spinBox->state;
- QPalette pal2 = spinBox->palette;
+ QPalette spinBoxPal = spinBox->palette;
if (!(spinBox->stepEnabled & QAbstractSpinBox::StepDownEnabled)) {
- pal2.setCurrentColorGroup(QPalette::Disabled);
+ spinBoxPal.setCurrentColorGroup(QPalette::Disabled);
copy.state &= ~State_Enabled;
+ copy.palette = spinBoxPal;
}
- copy.palette = pal2;
if (spinBox->activeSubControls == SC_SpinBoxDown && (spinBox->state & State_Sunken)) {
copy.state |= State_On;
@@ -1073,8 +1156,9 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
copy.state |= State_Raised;
copy.state &= ~State_Sunken;
}
- pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinMinus
- : PE_IndicatorSpinDown);
+ pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ?
+ PE_IndicatorSpinMinus :
+ PE_IndicatorSpinDown;
copy.rect = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxDown, widget);
drawPrimitive(PE_PanelButtonBevel, &copy, painter, widget);
@@ -1134,23 +1218,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
}
break;
#endif //QT_NO_GROUPBOX
-#ifndef QT_NO_DIAL
- case CC_Dial:
- if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
- QStyleOptionSlider optionSlider = *slider;
- QCommonStyle::drawComplexControl(control, &optionSlider, painter, widget);
- }
- break;
-#endif //QT_NO_DIAL
-
- //todo: remove non-used complex widgets in final version
- case CC_TitleBar:
-#ifdef QT3_SUPPORT
- case CC_Q3ListView:
-#endif //QT3_SUPPORT
-#ifndef QT_NO_WORKSPACE
- case CC_MdiControls:
-#endif //QT_NO_WORKSPACE
default:
QCommonStyle::drawComplexControl(control, option, painter, widget);
}
@@ -1171,21 +1238,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QStyleOptionButton subopt = *btn;
subopt.rect = subElementRect(SE_PushButtonContents, btn, widget);
- if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget))) {
- if (buttonWidget->isCheckable()) {
- QStyleOptionButton checkopt = subopt;
-
- const int indicatorHeight(pixelMetric(PM_IndicatorHeight));
- const int verticalAdjust = (option->rect.height() - indicatorHeight) >> 1;
-
- checkopt.rect.adjust(pixelMetric(PM_ButtonMargin), verticalAdjust, 0, 0);
- checkopt.rect.setWidth(pixelMetric(PM_IndicatorWidth));
- checkopt.rect.setHeight(indicatorHeight);
-
- drawPrimitive(PE_IndicatorCheckBox, &checkopt, painter, widget);
- }
- }
-
drawControl(CE_PushButtonLabel, &subopt, painter, widget);
if (btn->state & State_HasFocus) {
QStyleOptionFocusRect fropt;
@@ -1197,55 +1249,43 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
break;
case CE_PushButtonBevel:
if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) {
- const bool isPressed = option->state & QStyle::State_Sunken;
- if (button->features & QStyleOptionButton::Flat) {
- const QS60StyleEnums::SkinParts skinPart =
- isPressed ? QS60StyleEnums::SP_QsnFrButtonTbCenterPressed : QS60StyleEnums::SP_QsnFrButtonTbCenter;
- QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags);
+ const bool isDisabled = !(option->state & QStyle::State_Enabled);
+ const bool isFlat = button->features & QStyleOptionButton::Flat;
+ QS60StyleEnums::SkinParts skinPart;
+ QS60StylePrivate::SkinElements skinElement;
+ if (!isDisabled) {
+ const bool isPressed = (option->state & QStyle::State_Sunken) ||
+ (option->state & QStyle::State_On);
+ if (isFlat) {
+ skinPart =
+ isPressed ? QS60StyleEnums::SP_QsnFrButtonTbCenterPressed : QS60StyleEnums::SP_QsnFrButtonTbCenter;
+ } else {
+ skinElement =
+ isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
+ }
} else {
- const QS60StylePrivate::SkinElements skinElement =
- isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
- QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags);
+ if (isFlat)
+ skinPart =QS60StyleEnums::SP_QsnFrButtonCenterInactive;
+ else
+ skinElement = QS60StylePrivate::SE_ButtonInactive;
}
- }
- break;
- case CE_PushButtonLabel:
- if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) {
- QStyleOptionButton optionButton = *button;
-
- if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget))) {
- if (buttonWidget->isCheckable()) {
- // space for check box.
- optionButton.rect.adjust(pixelMetric(PM_IndicatorWidth)
- + pixelMetric(PM_ButtonMargin) + pixelMetric(PM_CheckBoxLabelSpacing), 0, 0, 0);
- }
+ if (isFlat)
+ QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags);
+ else
+ QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags);
}
- QCommonStyle::drawControl(element, &optionButton, painter, widget);
- }
- break;
- case CE_CheckBoxLabel:
- if (const QStyleOptionButton *checkBox = qstyleoption_cast<const QStyleOptionButton *>(option)) {
- QStyleOptionButton optionCheckBox = *checkBox;
- QCommonStyle::drawControl(element, &optionCheckBox, painter, widget);
- }
- break;
- case CE_RadioButtonLabel:
- if (const QStyleOptionButton *radioButton = qstyleoption_cast<const QStyleOptionButton *>(option)) {
- QStyleOptionButton optionRadioButton = *radioButton;
- QCommonStyle::drawControl(element, &optionRadioButton, painter, widget);
- }
break;
#ifndef QT_NO_TOOLBUTTON
case CE_ToolButtonLabel:
if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
QStyleOptionToolButton optionToolButton = *toolBtn;
-
- if (!optionToolButton.icon.isNull() && (optionToolButton.state & QStyle::State_Sunken)
+
+ if (!optionToolButton.icon.isNull() && (optionToolButton.state & QStyle::State_Sunken)
&& (optionToolButton.state & State_Enabled)) {
-
+
const QIcon::State state = optionToolButton.state & State_On ? QIcon::On : QIcon::Off;
const QPixmap pm(optionToolButton.icon.pixmap(optionToolButton.rect.size().boundedTo(optionToolButton.iconSize),
- QIcon::Normal, state));
+ QIcon::Normal, state));
optionToolButton.icon = generatedIconPixmap(QIcon::Selected, pm, &optionToolButton);
}
@@ -1253,12 +1293,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
}
break;
#endif //QT_NO_TOOLBUTTON
- case CE_HeaderLabel:
- if (const QStyleOptionHeader *headerLabel = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
- QStyleOptionHeader optionHeaderLabel = *headerLabel;
- QCommonStyle::drawControl(element, &optionHeaderLabel, painter, widget);
- }
- break;
#ifndef QT_NO_COMBOBOX
case CE_ComboBoxLabel:
if (const QStyleOptionComboBox *comboBox = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
@@ -1330,28 +1364,30 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
const QRect iconRect = subElementRect(SE_ItemViewItemDecoration, &voptAdj, widget);
QRect textRect = subElementRect(SE_ItemViewItemText, &voptAdj, widget);
- // draw the background
- const QStyleOptionViewItemV4 *tableOption = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option);
- const QTableView *table = qobject_cast<const QTableView *>(widget);
- if (table && tableOption) {
- const QModelIndex index = tableOption->index;
- //todo: Draw cell background only once - for the first cell.
- QStyleOptionViewItemV4 voptAdj2 = voptAdj2;
- const QModelIndex indexFirst = table->model()->index(0,0);
- const QModelIndex indexLast = table->model()->index(
- table->model()->rowCount()-1,table->model()->columnCount()-1);
- if (table->viewport())
- voptAdj2.rect = QRect( table->visualRect(indexFirst).topLeft(),
- table->visualRect(indexLast).bottomRight()).intersect(table->viewport()->rect());
- drawPrimitive(PE_PanelItemViewItem, &voptAdj2, painter, widget);
- }
+ // draw themed background for table unless background brush has been defined.
+ if (vopt->backgroundBrush == Qt::NoBrush) {
+ const QStyleOptionViewItemV4 *tableOption = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option);
+ const QTableView *table = qobject_cast<const QTableView *>(widget);
+ if (table && tableOption) {
+ const QModelIndex index = tableOption->index;
+ //todo: Draw cell background only once - for the first cell.
+ QStyleOptionViewItemV4 voptAdj2 = voptAdj;
+ const QModelIndex indexFirst = table->model()->index(0,0);
+ const QModelIndex indexLast = table->model()->index(
+ table->model()->rowCount()-1,table->model()->columnCount()-1);
+ if (table->viewport())
+ voptAdj2.rect = QRect( table->visualRect(indexFirst).topLeft(),
+ table->visualRect(indexLast).bottomRight()).intersect(table->viewport()->rect());
+ drawPrimitive(PE_PanelItemViewItem, &voptAdj2, painter, widget);
+ }
+ } else { QCommonStyle::drawPrimitive(PE_PanelItemViewItem, option, painter, widget);}
// draw the focus rect
if (isSelected)
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags);
// draw the icon
- const QIcon::Mode mode = !(voptAdj.state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled;
+ const QIcon::Mode mode = (voptAdj.state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled;
const QIcon::State state = voptAdj.state & QStyle::State_Open ? QIcon::On : QIcon::Off;
voptAdj.icon.paint(painter, iconRect, voptAdj.decorationAlignment, mode, state);
@@ -1361,17 +1397,15 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
listView &&
(listView->selectionMode() == QAbstractItemView::SingleSelection ||
listView->selectionMode() == QAbstractItemView::NoSelection);
- QRect selectionRect = subElementRect(SE_ItemViewItemCheckIndicator, &voptAdj, widget);
- if (voptAdj.state & QStyle::State_Selected &&
- !singleSelection) {
+ const QRect selectionRect = subElementRect(SE_ItemViewItemCheckIndicator, &voptAdj, widget);
+ if (voptAdj.state & QStyle::State_Selected && !singleSelection) {
QStyleOptionViewItemV4 option(voptAdj);
option.rect = selectionRect;
// Draw selection mark.
drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &option, painter, widget);
if ( textRect.right() > selectionRect.left() )
textRect.setRight(selectionRect.left());
- }
- else if (singleSelection &&
+ } else if (singleSelection &&
voptAdj.features & QStyleOptionViewItemV2::HasCheckIndicator) {
// draw the check mark
if (selectionRect.isValid()) {
@@ -1400,9 +1434,11 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
const QStyleOptionViewItemV4 *tableOption = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option);
if (isSelected) {
if (qobject_cast<const QTableView *>(widget) && tableOption)
- voptAdj.palette.setColor(QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0));
+ voptAdj.palette.setColor(
+ QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0));
else
- voptAdj.palette.setColor(QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0));
+ voptAdj.palette.setColor(
+ QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0));
}
painter->setPen(voptAdj.palette.text().color());
d->viewItemDrawText(painter, &voptAdj, textRect);
@@ -1454,7 +1490,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
const int tabOverlap =
QS60StylePrivate::pixelMetric(QStyle::PM_TabBarTabOverlap) - borderThickness;
//todo: draw navi wipe behind tabbar - must be drawn with first draw
- //QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, windowRect, flags);
if (skinElement==QS60StylePrivate::SE_TabBarTabEastInactive||
skinElement==QS60StylePrivate::SE_TabBarTabEastActive||
@@ -1501,7 +1536,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
}
painter->save();
QFont f = painter->font();
- f.setPointSizeF(f.pointSizeF() * 0.72);
+ f.setPointSizeF(f.pointSizeF() * KTabFontMul);
painter->setFont(f);
if (option->state & QStyle::State_Selected){
@@ -1509,27 +1544,27 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 3, option));
}
- bool verticalTabs = optionTab.shape == QTabBar::RoundedEast
+ const bool verticalTabs = optionTab.shape == QTabBar::RoundedEast
|| optionTab.shape == QTabBar::RoundedWest
|| optionTab.shape == QTabBar::TriangularEast
|| optionTab.shape == QTabBar::TriangularWest;
- bool selected = optionTab.state & State_Selected;
+ const bool selected = optionTab.state & State_Selected;
if (verticalTabs) {
painter->save();
- int newX, newY, newRot;
+ int newX, newY, newRotation;
if (optionTab.shape == QTabBar::RoundedEast || optionTab.shape == QTabBar::TriangularEast) {
newX = tr.width();
newY = tr.y();
- newRot = 90;
+ newRotation = 90;
} else {
newX = 0;
newY = tr.y() + tr.height();
- newRot = -90;
+ newRotation = -90;
}
tr.setRect(0, 0, tr.height(), tr.width());
QTransform m;
m.translate(newX, newY);
- m.rotate(newRot);
+ m.rotate(newRotation);
painter->setTransform(m, true);
}
tr.adjust(0, 0, pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget),
@@ -1551,9 +1586,13 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QPixmap tabIcon = optionTab.icon.pixmap(iconSize,
(optionTab.state & State_Enabled) ? QIcon::Normal : QIcon::Disabled);
if (tab->text.isEmpty())
- painter->drawPixmap(tr.center().x() - (tabIcon.height() >>1), tr.center().y() - (tabIcon.height() >>1), tabIcon);
+ painter->drawPixmap(tr.center().x() - (tabIcon.height() >>1),
+ tr.center().y() - (tabIcon.height() >>1),
+ tabIcon);
else
- painter->drawPixmap(tr.left() + tabOverlap, tr.center().y() - (tabIcon.height() >>1), tabIcon);
+ painter->drawPixmap(tr.left() + tabOverlap,
+ tr.center().y() - (tabIcon.height() >>1),
+ tabIcon);
tr.setLeft(tr.left() + iconSize.width() + 4);
}
@@ -1563,13 +1602,13 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
if (optionTab.state & State_HasFocus) {
const int OFFSET = 1 + pixelMetric(PM_DefaultFrameWidth);
- const int x1 = optionTab.rect.left();
- const int x2 = optionTab.rect.right() - 1;
+ const int leftBorder = optionTab.rect.left();
+ const int rightBorder = optionTab.rect.right() - 1;
QStyleOptionFocusRect fropt;
fropt.QStyleOption::operator=(*tab);
- fropt.rect.setRect(x1 + 1 + OFFSET, optionTab.rect.y() + OFFSET,
- x2 - x1 - 2*OFFSET, optionTab.rect.height() - 2*OFFSET);
+ fropt.rect.setRect(leftBorder + 1 + OFFSET, optionTab.rect.y() + OFFSET,
+ rightBorder - leftBorder - 2*OFFSET, optionTab.rect.height() - 2*OFFSET);
drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
}
@@ -1619,31 +1658,12 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
}
break;
#endif // QT_NO_PROGRESSBAR
-#ifndef QT_NO_MENUBAR
- case CE_MenuBarItem:
- if (const QStyleOptionMenuItem *menuBarItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
- QStyleOptionMenuItem optionMenuBarItem = *menuBarItem;
- QCommonStyle::drawControl(element, &optionMenuBarItem, painter, widget);
- }
- break;
-#endif //QT_NO_MENUBAR
#ifndef QT_NO_MENU
case CE_MenuItem:
if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
QStyleOptionMenuItem optionMenuItem = *menuItem;
- const bool enabled = optionMenuItem.state & State_Enabled;
- const bool checkable = optionMenuItem.checkType != QStyleOptionMenuItem::NotCheckable;
-
- uint text_flags = Qt::AlignLeading | Qt::TextShowMnemonic | Qt::TextDontClip
- | Qt::TextSingleLine | Qt::AlignVCenter;
- if (!styleHint(SH_UnderlineShortcut, menuItem, widget))
- text_flags |= Qt::TextHideMnemonic;
-
- QRect iconRect =
- subElementRect(SE_ItemViewItemDecoration, &optionMenuItem, widget);
- QRect textRect = subElementRect(SE_ItemViewItemText, &optionMenuItem, widget);
+
bool drawSubMenuIndicator = false;
-
switch(menuItem->menuItemType) {
case QStyleOptionMenuItem::Scroller:
case QStyleOptionMenuItem::Separator:
@@ -1654,20 +1674,29 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
default:
break;
}
+ const bool enabled = optionMenuItem.state & State_Enabled;
+ const bool checkable = optionMenuItem.checkType != QStyleOptionMenuItem::NotCheckable;
+
+ uint text_flags = Qt::AlignLeading | Qt::TextShowMnemonic | Qt::TextDontClip
+ | Qt::TextSingleLine | Qt::AlignVCenter;
+ if (!styleHint(SH_UnderlineShortcut, menuItem, widget))
+ text_flags |= Qt::TextHideMnemonic;
+
+ QRect iconRect =
+ subElementRect(SE_ItemViewItemDecoration, &optionMenuItem, widget);
+ QRect textRect = subElementRect(SE_ItemViewItemText, &optionMenuItem, widget);
if ((option->state & State_Selected) && (option->state & State_Enabled))
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags);
//todo: move the vertical spacing stuff into subElementRect
const int vSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutVerticalSpacing);
- QStyleOptionMenuItem optionCheckBox;
if (checkable){
- QRect checkBoxRect = optionMenuItem.rect;
- checkBoxRect.setWidth(pixelMetric(PM_IndicatorWidth));
- checkBoxRect.setHeight(pixelMetric(PM_IndicatorHeight));
+ QStyleOptionMenuItem optionCheckBox;
optionCheckBox.QStyleOption::operator=(*menuItem);
- optionCheckBox.rect = checkBoxRect;
- const int moveByX = checkBoxRect.width()+vSpacing;
+ optionCheckBox.rect.setWidth(pixelMetric(PM_IndicatorWidth));
+ optionCheckBox.rect.setHeight(pixelMetric(PM_IndicatorHeight));
+ const int moveByX = optionCheckBox.rect.width()+vSpacing;
if (optionMenuItem.direction == Qt::LeftToRight) {
textRect.translate(moveByX,0);
iconRect.translate(moveByX, 0);
@@ -1718,21 +1747,18 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
optionMenuItem.palette.color(QPalette::Disabled, QPalette::Text)));
painter->save();
painter->setOpacity(0.5);
- QCommonStyle::drawItemText(painter, textRect, text_flags,
+ }
+ QCommonStyle::drawItemText(painter, textRect, text_flags,
optionMenuItem.palette, enabled,
optionMenuItem.text, QPalette::Text);
+ if (!enabled)
painter->restore();
- } else {
- QCommonStyle::drawItemText(painter, textRect, text_flags,
- optionMenuItem.palette, enabled,
- optionMenuItem.text, QPalette::Text);
- }
}
break;
+ case CE_MenuEmptyArea:
+ break;
#endif //QT_NO_MENU
- //todo: remove non-used widgets in final version
- case CE_MenuEmptyArea:
#ifndef QT_NO_MENUBAR
case CE_MenuBarEmptyArea:
break;
@@ -1762,19 +1788,20 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
case CE_HeaderEmptyArea:
{
QS60StylePrivate::SkinElementFlags adjFlags = flags;
- QRect mtyRect = option->rect;
+ QRect emptyAreaRect = option->rect;
+ const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
if (option->state & QStyle::State_Horizontal) {
- mtyRect.adjust(-2,-2,2,-2);
+ emptyAreaRect.adjust(-frameWidth,-frameWidth,frameWidth,-frameWidth);
} else {
if ( option->direction == Qt::LeftToRight ) {
- mtyRect.adjust(-2,-2,0,2);
+ emptyAreaRect.adjust(-frameWidth,-frameWidth,0,frameWidth);
adjFlags |= QS60StylePrivate::SF_PointWest;
} else {
- mtyRect.adjust(2,2,0,-2);
+ emptyAreaRect.adjust(frameWidth,frameWidth,0,-frameWidth);
adjFlags |= QS60StylePrivate::SF_PointEast;
}
}
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, mtyRect, adjFlags);
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, emptyAreaRect, adjFlags);
}
break;
case CE_Header:
@@ -1782,19 +1809,32 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QS60StylePrivate::SkinElementFlags adjFlags = flags;
QRect mtyRect = header->rect;
QRect parentRect = widget->parentWidget()->rect();
+ const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
if (header->orientation == Qt::Horizontal) {
- mtyRect.adjust(-2,-2,2,-2);
+ mtyRect.adjust(-frameWidth,-frameWidth,frameWidth,-frameWidth);
} else {
if ( header->direction == Qt::LeftToRight ) {
- mtyRect.adjust(-2,-2,0,2);
+ mtyRect.adjust(-frameWidth,-frameWidth,0,frameWidth);
adjFlags |= QS60StylePrivate::SF_PointWest;
} else {
- mtyRect.adjust(2,2,0,-2);
+ mtyRect.adjust(frameWidth,frameWidth,0,-frameWidth);
adjFlags |= QS60StylePrivate::SF_PointEast;
}
}
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, mtyRect, adjFlags);
- QCommonStyle::drawControl(element, header, painter, widget);
+
+ QRegion clipRegion = painter->clipRegion();
+ painter->setClipRect(option->rect);
+ drawControl(CE_HeaderSection, header, painter, widget);
+ QStyleOptionHeader subopt = *header;
+ subopt.rect = subElementRect(SE_HeaderLabel, header, widget);
+ if (subopt.rect.isValid())
+ drawControl(CE_HeaderLabel, &subopt, painter, widget);
+ if (header->sortIndicator != QStyleOptionHeader::None) {
+ subopt.rect = subElementRect(SE_HeaderArrow, option, widget);
+ drawPrimitive(PE_IndicatorHeaderArrow, &subopt, painter, widget);
+ }
+ painter->setClipRegion(clipRegion);
}
break;
#ifndef QT_NO_TOOLBAR
@@ -1802,6 +1842,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
if (const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(option)) {
const QToolBar *tbWidget = qobject_cast<const QToolBar *>(widget);
+ //toolbar within a toolbar, skip
if (!tbWidget || (widget && qobject_cast<QToolBar *>(widget->parentWidget())))
break;
@@ -1839,48 +1880,12 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
}
break;
#endif //QT_NO_TOOLBAR
-
case CE_ShapedFrame:
- case CE_MenuVMargin:
- case CE_MenuHMargin:
-#ifndef QT_NO_MENU
- case CE_MenuScroller:
- case CE_MenuTearoff:
-#endif //QT_NO_MENU
-
- case CE_CheckBox:
- case CE_RadioButton:
-#ifndef QT_NO_TABBAR
- case CE_TabBarTab:
-#endif //QT_NO_TABBAR
-#ifndef QT_NO_PROGRESSBAR
- case CE_ProgressBar:
-#endif // QT_NO_PROGRESSBAR
- case CE_Q3DockWindowEmptyArea:
-#ifndef QT_NO_SIZEGRIP
- case CE_SizeGrip:
-#endif //QT_NO_SIZEGRIP
- case CE_Splitter:
-#ifndef QT_NO_RUBBERBAND
- case CE_RubberBand:
-#endif //QT_NO_RUBBERBAND
-#ifndef QT_NO_DOCKWIDGET
- case CE_DockWidgetTitle:
-#endif //QT_NO_DOCKWIDGET
- case CE_ScrollBarAddLine:
- case CE_ScrollBarSubLine:
- case CE_ScrollBarAddPage:
- case CE_ScrollBarSubPage:
- case CE_ScrollBarSlider:
- case CE_ScrollBarFirst:
- case CE_ScrollBarLast:
- case CE_FocusFrame:
-#ifndef QT_NO_TOOLBOX
- case CE_ToolBoxTab:
- case CE_ToolBoxTabShape:
- case CE_ToolBoxTabLabel:
-#endif //QT_NO_TOOLBOX
- case CE_ColumnViewGrip:
+ if (qobject_cast<const QTextEdit *>(widget))
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags);
+ if (option->state & State_HasFocus)
+ drawPrimitive(PE_FrameFocusRect, option, painter, widget);
+ break;
default:
QCommonStyle::drawControl(element, option, painter, widget);
}
@@ -1919,6 +1924,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
}
break;
case PE_IndicatorViewItemCheck:
+#ifndef QT_NO_ITEMVIEWS
if (const QListView *listItem = (qobject_cast<const QListView *>(widget))) {
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
const bool checkBoxVisible = vopt->features & QStyleOptionViewItemV2::HasCheckIndicator;
@@ -1931,7 +1937,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
} else if (option->state & QStyle::State_Selected) {
QRect tickRect = option->rect;
const int frameBorderWidth = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth);
- // adjust tickmark rect to exclude frame border
+ // adjust tickmark rect to exclude frame border
tickRect.adjust(0,-frameBorderWidth,0,-frameBorderWidth);
QS60StyleEnums::SkinParts skinPart = QS60StyleEnums::SP_QgnIndiMarkedAdd;
QS60StylePrivate::drawSkinPart(skinPart, painter, tickRect,
@@ -1939,9 +1945,9 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
}
}
}
+#endif //QT_NO_ITEMVIEWS
break;
- case PE_IndicatorRadioButton:
- {
+ case PE_IndicatorRadioButton: {
QRect buttonRect = option->rect;
//there is empty (a. 33%) space in svg graphics for radiobutton
const qreal reduceWidth = (qreal)buttonRect.width()/3.0;
@@ -1964,8 +1970,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
case PE_PanelButtonCommand:
case PE_PanelButtonTool:
case PE_PanelButtonBevel:
- case PE_FrameButtonBevel:
- {
+ case PE_FrameButtonBevel: {
const bool isPressed = option->state & QStyle::State_Sunken;
const QS60StylePrivate::SkinElements skinElement =
isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
@@ -1976,8 +1981,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
case PE_IndicatorArrowDown:
case PE_IndicatorArrowLeft:
case PE_IndicatorArrowRight:
- case PE_IndicatorArrowUp:
- {
+ case PE_IndicatorArrowUp: {
QS60StyleEnums::SkinParts skinPart;
if (element==PE_IndicatorArrowDown)
skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowDown;
@@ -1987,7 +1991,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowRight;
else if (element==PE_IndicatorArrowUp)
skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowUp;
-
+
QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags);
}
break;
@@ -1997,11 +2001,11 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
case PE_IndicatorSpinUp:
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
QStyleOptionSpinBox optionSpinBox = *spinBox;
- const QS60StyleEnums::SkinParts part = (element == PE_IndicatorSpinUp) ?
- QS60StyleEnums::SP_QgnGrafScrollArrowUp :
+ const QS60StyleEnums::SkinParts part = (element == PE_IndicatorSpinUp) ?
+ QS60StyleEnums::SP_QgnGrafScrollArrowUp :
QS60StyleEnums::SP_QgnGrafScrollArrowDown;
const int adjustment = qMin(optionSpinBox.rect.width(), optionSpinBox.rect.height())/6;
- optionSpinBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment );
+ optionSpinBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment );
QS60StylePrivate::drawSkinPart(part, painter, optionSpinBox.rect,flags);
}
#ifndef QT_NO_COMBOBOX
@@ -2010,11 +2014,11 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
const QS60StyleEnums::SkinParts part = QS60StyleEnums::SP_QgnGrafScrollArrowDown;
QStyleOptionFrame comboBox = *cmb;
const int adjustment = qMin(comboBox.rect.width(), comboBox.rect.height())/6;
- comboBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment );
+ comboBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment );
QS60StylePrivate::drawSkinPart(part, painter, comboBox.rect,flags);
}
#endif //QT_NO_COMBOBOX
- break;
+ break;
case PE_IndicatorSpinMinus:
case PE_IndicatorSpinPlus:
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
@@ -2025,15 +2029,27 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
else if (const QStyleOptionFrame *cmb = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
// We want to draw down arrow here for comboboxes as well.
QStyleOptionFrame comboBox = *cmb;
- comboBox.rect.adjust(0,2,0,-2);
+ const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
+ comboBox.rect.adjust(0,frameWidth,0,-frameWidth);
QCommonStyle::drawPrimitive(element, &comboBox, painter, widget);
}
#endif //QT_NO_COMBOBOX
break;
#endif //QT_NO_SPINBOX
case PE_FrameFocusRect:
- if (!(widget && qobject_cast<const QCalendarWidget *>(widget->parent())) ||
- qobject_cast<const QComboBoxListView *>(widget)) {
+// Calendar widget and combox both do not use styled itemDelegate
+ if ( widget && (
+#ifndef QT_NO_CALENDARWIDGET
+ (qobject_cast<const QCalendarWidget *>(widget->parent()))
+#else
+ false
+#endif //QT_NO_CALENDARWIDGET
+#ifndef QT_NO_COMBOBOX
+ || (qobject_cast<const QComboBoxListView *>(widget))
+#else
+ || false
+#endif //QT_NO_COMBOBOX
+ )) {
// no focus selection for touch
if (option->state & State_HasFocus && !QS60StylePrivate::isTouchSupported()) {
painter->save();
@@ -2062,11 +2078,16 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
}
break;
case PE_Widget:
- if (QS60StylePrivate::isSkinnableDialog(widget) ||
- qobject_cast<const QComboBoxListView *>(widget) ||
- qobject_cast<const QMenu *> (widget)) {
- QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_OptionsMenu;
- QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags);
+ if (QS60StylePrivate::drawsOwnThemeBackground(widget)
+#ifndef QT_NO_COMBOBOX
+ || qobject_cast<const QComboBoxListView *>(widget)
+#endif //QT_NO_COMBOBOX
+#ifndef QT_NO_MENU
+ || qobject_cast<const QMenu *> (widget)
+#endif //QT_NO_MENU
+ ) {
+ QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_OptionsMenu;
+ QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags);
}
break;
case PE_FrameWindow:
@@ -2132,8 +2153,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
break; //disable frame in menu
case PE_IndicatorBranch:
- {
#if defined(Q_WS_S60)
+ // 3.1 AVKON UI does not have tree view component, use common style for drawing there
if (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1) {
#else
if (true) {
@@ -2157,29 +2178,26 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
drawSkinPart = true;
}
- if ( drawSkinPart ) {
- QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect,
- (flags | QS60StylePrivate::SF_ColorSkinned));
- }
-
+ if ( drawSkinPart )
+ QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags);
+
if (option->state & State_Children) {
- QS60StyleEnums::SkinParts skinPart =
- (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper;
+ QS60StyleEnums::SkinParts skinPart =
+ (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper;
int minDimension = qMin(option->rect.width(), option->rect.height());
const int resizeValue = minDimension >> 1;
minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon.
QRect iconRect(option->rect.topLeft(), QSize(minDimension, minDimension));
int verticalMagic(0);
// magic values for positioning svg icon.
- if (option->rect.width() <= option->rect.height())
- verticalMagic = 3;
+ if (option->rect.width() <= option->rect.height())
+ verticalMagic = 3;
iconRect.translate(3, verticalMagic - resizeValue);
- QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags);
- }
+ QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags);
+ }
}
- }
- break;
-
+ break;
+
// todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases
case PE_FrameLineEdit:
case PE_IndicatorButtonDropDown:
@@ -2210,18 +2228,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
}
}
-/*!
- \reimp - sets the default colors
-*/
-void QS60Style::drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette & palette, bool enabled, const QString &text, QPalette::ColorRole textRole) const
-{
- QPalette override = palette;
- QCommonStyle::drawItemText(painter, rectangle, alignment, override, enabled, text, textRole);
-}
-
-/*!
- \reimp
-*/
+/*! \reimp */
int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
{
int metricValue = QS60StylePrivate::pixelMetric(metric);
@@ -2229,7 +2236,6 @@ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const
metricValue = QCommonStyle::pixelMetric(metric, option, widget);
if (metric == PM_SubMenuOverlap && widget){
- const int widgetWidth = widget->width();
const QMenu *menu = qobject_cast<const QMenu *>(widget);
if (menu && menu->activeAction() && menu->activeAction()->menu()) {
const int menuWidth = menu->activeAction()->menu()->sizeHint().width();
@@ -2238,6 +2244,7 @@ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const
}
return metricValue;
}
+
/*! \reimp */
QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
const QSize &csz, const QWidget *widget) const
@@ -2247,7 +2254,7 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
case CT_PushButton:
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget)))
- if (buttonWidget->isCheckable())
+ if (buttonWidget->isCheckable())
sz += QSize(pixelMetric(PM_IndicatorWidth) + pixelMetric(PM_CheckBoxLabelSpacing), 0);
break;
case CT_LineEdit:
@@ -2260,22 +2267,19 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
}
return sz;
}
+
/*! \reimp */
int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *widget,
QStyleHintReturn *hret) const
{
int retValue = -1;
switch (sh) {
- case SH_Table_GridLineColor: {
- QColor lineColor = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors,2,0);
- retValue = lineColor.rgb();
- }
- break;
- case SH_GroupBox_TextLabelColor: {
- QColor groupBoxTxtColor = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors,6,0);
- retValue = groupBoxTxtColor.rgb();
- }
- break;
+ case SH_Table_GridLineColor:
+ retValue = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors,2,0).rgb();
+ break;
+ case SH_GroupBox_TextLabelColor:
+ retValue = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors,6,0).rgb();
+ break;
case SH_ScrollBar_ScrollWhenPointerLeavesControl:
retValue = true;
break;
@@ -2289,10 +2293,39 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
retValue = '*';
break;
case SH_ComboBox_PopupFrameStyle:
- retValue = QFrame::NoFrame;
+ retValue = QFrame::NoFrame | QFrame::Plain;
break;
case SH_Dial_BackgroundRole:
retValue = QPalette::Base;
+ break;
+ case SH_ItemView_ActivateItemOnSingleClick:
+ retValue = true;
+ break;
+ case SH_ProgressDialog_TextLabelAlignment:
+ retValue = (QApplication::layoutDirection() == Qt::LeftToRight) ?
+ Qt::AlignLeft :
+ Qt::AlignRight;
+ break;
+ case SH_Menu_SubMenuPopupDelay:
+ retValue = 300;
+ break;
+ case SH_Menu_Scrollable:
+ retValue = true;
+ break;
+ case SH_Menu_SelectionWrap:
+ retValue = true;
+ break;
+ case SH_ItemView_ShowDecorationSelected:
+ retValue = true;
+ break;
+ case SH_ToolBar_Movable:
+ retValue = false;
+ break;
+ case SH_BlinkCursorWhenTextSelected:
+ retValue = true;
+ break;
+ case SH_UnderlineShortcut:
+ retValue = 0;
default:
break;
}
@@ -2301,10 +2334,7 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
return retValue;
}
-
-/*!
- \reimp
-*/
+/*! \reimp */
QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl scontrol, const QWidget *widget) const
{
QRect ret;
@@ -2324,6 +2354,11 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
sliderlen = (qint64(scrollbarOption->pageStep) * maxlen) / (range + scrollbarOption->pageStep);
int slidermin = pixelMetric(PM_ScrollBarSliderMin, scrollbarOption, widget);
+ if (isHorizontal && slidermin < scrollBarRect.height())
+ slidermin = scrollBarRect.height();
+ else if (!isHorizontal && slidermin < scrollBarRect.width())
+ slidermin = scrollBarRect.width();
+
if (sliderlen < slidermin || range > (INT_MAX>>1))
sliderlen = slidermin;
if (sliderlen > maxlen)
@@ -2339,35 +2374,33 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
scrollbarOption->upsideDown);
switch (scontrol) {
- case SC_ScrollBarSubLine: // top/left button
- case SC_ScrollBarAddLine: // bottom/right button
- break;
- case SC_ScrollBarSubPage: // between top/left button and slider
- if (isHorizontal)
- ret.setRect(0, 0, sliderstart, scrollBarRect.height());
- else
- ret.setRect(0, 0, scrollBarRect.width(), sliderstart);
- break;
- case SC_ScrollBarAddPage: // between bottom/right button and slider
- {
+ case SC_ScrollBarSubPage: // between top/left button and slider
+ if (isHorizontal)
+ ret.setRect(0, 0, sliderstart, scrollBarRect.height());
+ else
+ ret.setRect(0, 0, scrollBarRect.width(), sliderstart);
+ break;
+ case SC_ScrollBarAddPage: { // between bottom/right button and slider
const int addPageLength = sliderstart + sliderlen;
if (isHorizontal)
ret = scrollBarRect.adjusted(addPageLength, 0, 0, 0);
else
ret = scrollBarRect.adjusted(0, addPageLength, 0, 0);
- }
- break;
- case SC_ScrollBarGroove:
- ret = scrollBarRect;
- break;
- case SC_ScrollBarSlider:
- if (scrollbarOption->orientation == Qt::Horizontal)
- ret.setRect(sliderstart, 0, sliderlen, scrollBarRect.height());
- else
- ret.setRect(0, sliderstart, scrollBarRect.width(), sliderlen);
- break;
- default:
- break;
+ }
+ break;
+ case SC_ScrollBarGroove:
+ ret = scrollBarRect;
+ break;
+ case SC_ScrollBarSlider:
+ if (scrollbarOption->orientation == Qt::Horizontal)
+ ret.setRect(sliderstart, 0, sliderlen, scrollBarRect.height());
+ else
+ ret.setRect(0, sliderstart, scrollBarRect.width(), sliderlen);
+ break;
+ case SC_ScrollBarSubLine: // top/left button
+ case SC_ScrollBarAddLine: // bottom/right button
+ default:
+ break;
}
ret = visualRect(scrollbarOption->direction, scrollBarRect, ret);
}
@@ -2387,35 +2420,35 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
const int x = spinbox->rect.x() + spinbox->rect.width() - frameThickness - 2*buttonSize.width();
switch (scontrol) {
- case SC_SpinBoxUp:
- if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons)
- return QRect();
- ret = QRect(x, y, buttonWidth, buttonSize.height());
- break;
- case SC_SpinBoxDown:
- if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons)
- return QRect();
- ret = QRect(x+buttonSize.width(), y, buttonWidth, buttonSize.height());
- break;
- case SC_SpinBoxEditField:
- if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons)
- ret = QRect(
- frameThickness,
- frameThickness,
- spinbox->rect.width() - 2*frameThickness,
- spinbox->rect.height() - 2*frameThickness);
- else
- ret = QRect(
- frameThickness,
- frameThickness,
- x - frameThickness,
- spinbox->rect.height() - 2*frameThickness);
- break;
- case SC_SpinBoxFrame:
- ret = spinbox->rect;
- break;
- default:
- break;
+ case SC_SpinBoxUp:
+ if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons)
+ return QRect();
+ ret = QRect(x, y, buttonWidth, buttonSize.height());
+ break;
+ case SC_SpinBoxDown:
+ if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons)
+ return QRect();
+ ret = QRect(x+buttonSize.width(), y, buttonWidth, buttonSize.height());
+ break;
+ case SC_SpinBoxEditField:
+ if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons)
+ ret = QRect(
+ frameThickness,
+ frameThickness,
+ spinbox->rect.width() - 2*frameThickness,
+ spinbox->rect.height() - 2*frameThickness);
+ else
+ ret = QRect(
+ frameThickness,
+ frameThickness,
+ x - frameThickness,
+ spinbox->rect.height() - 2*frameThickness);
+ break;
+ case SC_SpinBoxFrame:
+ ret = spinbox->rect;
+ break;
+ default:
+ break;
}
ret = visualRect(spinbox->direction, spinbox->rect, ret);
}
@@ -2429,7 +2462,7 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
// lets use spinbox frame here as well, as no combobox specific value available.
const int frameThickness = cmb->frame ? pixelMetric(PM_SpinBoxFrameWidth, cmb, widget) : 0;
const int buttonWidth = QS60StylePrivate::pixelMetric(QStyle::PM_ButtonIconSize);
- int xposMod = (cmb->rect.x()) + width - buttonMargin - buttonWidth;
+ const int xposMod = (cmb->rect.x()) + width - buttonMargin - buttonWidth;
const int ypos = cmb->rect.y();
QSize buttonSize;
@@ -2458,26 +2491,26 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option)) {
ret = QCommonStyle::subControlRect(control, option, scontrol, widget);
switch (scontrol) {
- case SC_GroupBoxCheckBox: //fallthrough
- case SC_GroupBoxLabel:
- //slightly indent text and boxes, so that dialog border does not mess with them.
- const int horizontalSpacing =
- QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
- const int bottomMargin = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutBottomMargin);
- ret.adjust(2,horizontalSpacing-3,0,0);
- break;
- case SC_GroupBoxFrame: {
- const QRect textBox = subControlRect(control, option, SC_GroupBoxLabel, widget);
- const int tbHeight = textBox.height();
- ret.translate(0, -ret.y());
- // include title to within the groupBox frame
- ret.setHeight(ret.height()+tbHeight);
- if (widget && ret.bottom() > widget->rect().bottom())
- ret.setBottom(widget->rect().bottom());
- }
- break;
- default:
- break;
+ case SC_GroupBoxCheckBox: //fallthrough
+ case SC_GroupBoxLabel: {
+ //slightly indent text and boxes, so that dialog border does not mess with them.
+ const int horizontalSpacing =
+ QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
+ ret.adjust(2,horizontalSpacing-3,0,0);
+ }
+ break;
+ case SC_GroupBoxFrame: {
+ const QRect textBox = subControlRect(control, option, SC_GroupBoxLabel, widget);
+ const int tbHeight = textBox.height();
+ ret.translate(0, -ret.y());
+ // include title to within the groupBox frame
+ ret.setHeight(ret.height()+tbHeight);
+ if (widget && ret.bottom() > widget->rect().bottom())
+ ret.setBottom(widget->rect().bottom());
+ }
+ break;
+ default:
+ break;
}
}
break;
@@ -2494,9 +2527,8 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
case SE_LineEditContents: {
// in S60 the input text box doesn't start from line Edit's TL, but
// a bit indented.
- // todo: Should we NOT do this for combo boxes and spin boxes?
QRect lineEditRect = opt->rect;
- int adjustment = opt->rect.height()>>2;
+ const int adjustment = opt->rect.height()>>2;
lineEditRect.adjust(adjustment,0,0,0);
ret = lineEditRect;
}
@@ -2568,13 +2600,10 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
}
} else if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
const bool checkable = menuItem->checkType != QStyleOptionMenuItem::NotCheckable;
- const bool subMenu = menuItem->menuItemType == QStyleOptionMenuItem::SubMenu;
- int indicatorWidth = checkable ?
+ const int indicatorWidth = checkable ?
pixelMetric(PM_ListViewIconSize, opt, widget) :
pixelMetric(PM_SmallIconSize, opt, widget);
ret = menuItem->rect;
- const int verticalSpacing =
- QS60StylePrivate::pixelMetric(QStyle::PM_LayoutVerticalSpacing);
if (element == SE_ItemViewItemDecoration) {
if (menuItem->direction == Qt::RightToLeft)
@@ -2591,11 +2620,10 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
// Make room for submenu indicator
if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu){
// submenu indicator is very small, so lets halve the rect
- indicatorWidth = indicatorWidth >> 1;
if (menuItem->direction == Qt::LeftToRight)
- ret.adjust(0,0,-indicatorWidth,0);
+ ret.adjust(0,0,-(indicatorWidth >> 1),0);
else
- ret.adjust(indicatorWidth,0,0,0);
+ ret.adjust((indicatorWidth >> 1),0,0,0);
}
}
}
@@ -2624,11 +2652,15 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
// Move rect and make it slightly smaller, so that
// a) highlight border does not cross the rect
// b) in s60 list checkbox is smaller than normal checkbox
- ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset, indicatorWidth-3, indicatorHeight-3);
+ //todo; magic three
+ ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset,
+ indicatorWidth-3, indicatorHeight-3);
} else {
ret.setRect(opt->rect.right() - indicatorWidth - spacing, opt->rect.top() + heightOffset,
indicatorWidth, indicatorHeight);
}
+ } else {
+ ret = QCommonStyle::subElementRect(element, opt, widget);
}
break;
case SE_HeaderLabel:
@@ -2658,6 +2690,88 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
return ret;
}
+void QS60Style::polish(QWidget *widget)
+{
+ Q_D(const QS60Style);
+ QCommonStyle::polish(widget);
+
+ if (!widget)
+ return;
+
+ if (false
+#ifndef QT_NO_SCROLLBAR
+ || qobject_cast<QScrollBar *>(widget)
+#endif
+ ) {
+ widget->setAttribute(Qt::WA_OpaquePaintEvent, false);
+ }
+
+ if (QS60StylePrivate::drawsOwnThemeBackground(widget)) {
+ widget->setAttribute(Qt::WA_StyledBackground);
+ } else if (false
+#ifndef QT_NO_MENU
+ || qobject_cast<const QMenu *> (widget)
+#endif // QT_NO_MENU
+ ) {
+ widget->setAttribute(Qt::WA_StyledBackground);
+ } else if (false
+#ifndef QT_NO_COMBOBOX
+ || qobject_cast<const QComboBoxListView *>(widget)
+#endif //QT_NO_COMBOBOX
+ ) {
+ widget->setAttribute(Qt::WA_StyledBackground);
+ }
+ d->setThemePalette(widget);
+ d->setFont(widget);
+}
+
+void QS60Style::unpolish(QWidget *widget)
+{
+ if (false
+ #ifndef QT_NO_SCROLLBAR
+ || qobject_cast<QScrollBar *>(widget)
+ #endif
+ )
+ widget->setAttribute(Qt::WA_OpaquePaintEvent);
+
+ if (QS60StylePrivate::drawsOwnThemeBackground(widget)) {
+ widget->setAttribute(Qt::WA_StyledBackground, false);
+ } else if (false
+#ifndef QT_NO_MENU
+ || qobject_cast<const QMenu *> (widget)
+#endif // QT_NO_MENU
+ ) {
+ widget->setAttribute(Qt::WA_StyledBackground, false);
+ } else if (false
+#ifndef QT_NO_COMBOBOX
+ || qobject_cast<const QComboBoxListView *>(widget)
+#endif //QT_NO_COMBOBOX
+ ) {
+ widget->setAttribute(Qt::WA_StyledBackground, false);
+ }
+
+ if (widget)
+ widget->setPalette(QPalette());
+
+ QCommonStyle::unpolish(widget);
+}
+
+void QS60Style::polish(QApplication *application)
+{
+ Q_D(QS60Style);
+ d->m_originalPalette = application->palette();
+ d->setThemePalette(application);
+}
+
+void QS60Style::unpolish(QApplication *application)
+{
+ Q_UNUSED(application)
+ Q_D(QS60Style);
+ const QPalette newPalette = QApplication::style()->standardPalette();
+ QApplication::setPalette(newPalette);
+ QApplicationPrivate::setSystemPalette(d->m_originalPalette);
+}
+
void QS60Style::setStyleProperty(const char *name, const QVariant &value)
{
Q_D(QS60Style);
@@ -2678,7 +2792,9 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon,
QS60StyleEnums::SkinParts part;
QS60StylePrivate::SkinElementFlags adjustedFlags;
if (option)
- adjustedFlags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled;
+ adjustedFlags = (option->state & State_Enabled) ?
+ QS60StylePrivate::SF_StateEnabled :
+ QS60StylePrivate::SF_StateDisabled;
switch(standardIcon) {
case QStyle::SP_MessageBoxWarning:
@@ -2755,6 +2871,29 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon,
QCommonStyle::standardIconImplementation(standardIcon, option, widget) : QIcon(cachedPixMap);
}
+extern QPoint qt_s60_fill_background_offset(const QWidget *targetWidget);
+
+bool qt_s60_fill_background(QPainter *painter, const QRegion &rgn, const QPoint &offset,
+ const QBrush &brush)
+{
+ const QPixmap backgroundTexture(QS60StylePrivate::backgroundTexture());
+ if (backgroundTexture.cacheKey() != brush.texture().cacheKey())
+ return false;
+
+ const QPaintDevice *target = painter->device();
+ if (target->devType() == QInternal::Widget) {
+ const QWidget *widget = static_cast<const QWidget *>(target);
+ const QRegion translated = rgn.translated(offset);
+ const QVector<QRect> &rects = translated.rects();
+ for (int i = 0; i < rects.size(); ++i) {
+ const QRect rect(rects.at(i));
+ painter->drawPixmap(rect.topLeft(), backgroundTexture,
+ rect.translated(qt_s60_fill_background_offset(widget)));
+ }
+ }
+ return true;
+}
+
QT_END_NAMESPACE
#endif // QT_NO_STYLE_S60 || QT_PLUGIN
diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h
index 945e182..d8e9a40 100644
--- a/src/gui/styles/qs60style.h
+++ b/src/gui/styles/qs60style.h
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -36,7 +66,6 @@ public:
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const;
void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
- void drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette, bool enabled, const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const;
int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const;
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w = 0) const;
int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0,
@@ -56,22 +85,23 @@ public:
static QStringList colorListKeys();
void setS60Theme(const QHash<QString, QPicture> &parts,
const QHash<QPair<QString , int>, QColor> &colors);
+ bool loadS60ThemeFromBlob(const QString &blobFile);
+ bool saveS60ThemeToBlob(const QString &blobFile) const;
#endif // !Q_WS_S60
#ifdef Q_WS_S60
-public slots:
+public Q_SLOTS:
void handleDynamicLayoutVariantSwitch();
void handleSkinChange();
#endif // Q_WS_S60
-protected slots:
+protected Q_SLOTS:
QIcon standardIconImplementation(
StandardPixmap standardIcon, const QStyleOption * option = 0, const QWidget * widget = 0 ) const;
private:
Q_DISABLE_COPY(QS60Style)
friend class QStyleFactory;
- QPalette originalPalette;
};
#endif // QT_NO_STYLE_S60
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index da34efb..7240978 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -113,7 +143,7 @@ public:
SP_QgnPropFolderCurrent,
SP_QgnPropFolderSmall,
SP_QgnPropFolderSmallNew,
- SP_QgnPropPhoneMemcLarge,
+ SP_QgnPropPhoneMemcLarge,
SP_QsnCpScrollHandleBottomPressed, //ScrollBar handle, pressed state
SP_QsnCpScrollHandleMiddlePressed,
SP_QsnCpScrollHandleTopPressed,
@@ -231,7 +261,25 @@ public:
SP_QsnFrSctrlButtonSideBPressed,
SP_QsnFrSctrlButtonSideLPressed,
SP_QsnFrSctrlButtonSideRPressed,
- SP_QsnFrSctrlButtonCenterPressed
+ SP_QsnFrSctrlButtonCenterPressed,
+ SP_QsnFrButtonCornerTlInactive, // Inactive button
+ SP_QsnFrButtonCornerTrInactive,
+ SP_QsnFrButtonCornerBlInactive,
+ SP_QsnFrButtonCornerBrInactive,
+ SP_QsnFrButtonSideTInactive,
+ SP_QsnFrButtonSideBInactive,
+ SP_QsnFrButtonSideLInactive,
+ SP_QsnFrButtonSideRInactive,
+ SP_QsnFrButtonCenterInactive,
+ SP_QsnFrNotepadCornerTl,
+ SP_QsnFrNotepadCornerTr,
+ SP_QsnFrNotepadCornerBl,
+ SP_QsnFrNotepadCornerBr,
+ SP_QsnFrNotepadSideT,
+ SP_QsnFrNotepadSideB,
+ SP_QsnFrNotepadSideL,
+ SP_QsnFrNotepadSideR,
+ SP_QsnFrNotepadCenter
};
enum ColorLists {
@@ -292,6 +340,8 @@ public:
SE_PanelBackground,
SE_ScrollBarHandlePressedHorizontal, //only for 5.0+
SE_ScrollBarHandlePressedVertical,
+ SE_ButtonInactive,
+ SE_Editor,
};
enum SkinFrameElements {
@@ -307,7 +357,9 @@ public:
SF_ToolBar,
SF_ToolBarButton,
SF_ToolBarButtonPressed,
- SF_PanelBackground
+ SF_PanelBackground,
+ SF_ButtonInactive,
+ SF_Editor,
};
enum SkinElementFlag {
@@ -320,6 +372,13 @@ public:
SF_StateDisabled = 0x0020,
SF_ColorSkinned = 0x0040,
};
+
+ enum CacheClearReason {
+ CC_UndefinedChange = 0,
+ CC_LayoutChange,
+ CC_ThemeChange
+ };
+
Q_DECLARE_FLAGS(SkinElementFlags, SkinElementFlag)
// draws skin element
@@ -344,27 +403,35 @@ public:
int index, const QStyleOption *option);
// gets state specific color
static QColor stateColor(const QColor &color, const QStyleOption *option);
+ // gets lighter color than base color
static QColor lighterColor(const QColor &baseColor);
- static bool isSkinnableDialog(const QWidget *widget);
- // gets layout
- static const QHash<QStyle::PixelMetric, int> &s60StyleLayout();
+ //deduces if the given widget should have separately themeable background
+ static bool drawsOwnThemeBackground(const QWidget *widget);
QFont s60Font(QS60StyleEnums::FontCategories fontCategory,
int pointSize = -1) const;
- void clearCaches();
- static QPixmap backgroundTexture();
+ // clears all style caches (fonts, colors, pixmaps)
+ void clearCaches(CacheClearReason reason = CC_UndefinedChange);
+
+ // themed main background oprations
+ void setBackgroundTexture(QApplication *application) const;
+ static void deleteBackground();
static bool isTouchSupported();
static bool isToolBarBackground();
// calculates average color based on button skin graphics (minus borders).
- QColor colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const;
+ QColor colorFromFrameGraphics(SkinFrameElements frame) const;
+
+ //set theme palette for application
void setThemePalette(QApplication *application) const;
- void setBackgroundTexture(QApplication *application) const;
+ //set theme palette for style option
+ void setThemePalette(QStyleOption *option) const;
+ //access to theme palette
+ static QPalette* themePalette();
static int focusRectPenWidth();
-#if defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
static const layoutHeader m_layoutHeaders[];
static const short data[][MAX_PIXELMETRICS];
@@ -374,10 +441,9 @@ public:
static short const *m_pmPointer;
// number of layouts supported by the style
static const int m_numberOfLayouts;
-#endif // defined(QT_S60STYLE_LAYOUTDATA_SIMULATED)
mutable QHash<QPair<QS60StyleEnums::FontCategories , int>, QFont> m_mappedFontsCache;
- mutable QHash<QS60StylePrivate::SkinFrameElements, QColor> m_colorCache;
+ mutable QHash<SkinFrameElements, QColor> m_colorCache;
// Has one entry per SkinFrameElements
static const struct frameElementCenter {
@@ -387,6 +453,7 @@ public:
static QPixmap frame(SkinFrameElements frame, const QSize &size,
SkinElementFlags flags = KDefaultSkinElementFlags);
+ static QPixmap backgroundTexture();
private:
static void drawPart(QS60StyleEnums::SkinParts part, QPainter *painter,
@@ -397,23 +464,36 @@ private:
static void drawFrame(SkinFrameElements frame, QPainter *painter,
const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
- static QSize partSize(QS60StyleEnums::SkinParts part,
- SkinElementFlags flags = KDefaultSkinElementFlags);
- static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size,
- SkinElementFlags flags = KDefaultSkinElementFlags);
static QPixmap cachedPart(QS60StyleEnums::SkinParts part, const QSize &size,
SkinElementFlags flags = KDefaultSkinElementFlags);
static QPixmap cachedFrame(SkinFrameElements frame, const QSize &size,
SkinElementFlags flags = KDefaultSkinElementFlags);
- static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize);
-
static void refreshUI();
+ // set S60 font for widget
+ void setFont(QWidget *widget) const;
+ void setThemePalette(QWidget *widget) const;
+ void setThemePalette(QPalette *palette) const;
+ void setThemePaletteHash(QPalette *palette) const;
+ static void storeThemePalette(QPalette *palette);
+ static void deleteThemePalette();
+
+ static QSize partSize(QS60StyleEnums::SkinParts part,
+ SkinElementFlags flags = KDefaultSkinElementFlags);
+ static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size,
+ SkinElementFlags flags = KDefaultSkinElementFlags);
+
+ static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize);
+
static QSize screenSize();
- static bool m_backgroundValid;
+ // Contains background texture.
+ static QPixmap *m_background;
const static SkinElementFlags KDefaultSkinElementFlags;
+ // defined theme palette
+ static QPalette *m_themePalette;
+ QPalette m_originalPalette;
};
QT_END_NAMESPACE
diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_s60.cpp
index 35dfe13..1f02efa 100644
--- a/src/gui/styles/qs60style_symbian.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -47,8 +77,10 @@ enum TSupportRelease {
ES60_3_1 = 0x0001,
ES60_3_2 = 0x0002,
ES60_5_0 = 0x0004,
+ ES60_5_1 = 0x0008,
+ ES60_5_2 = 0x0010,
// Add all new releases here
- ES60_AllReleases = ES60_3_1 | ES60_3_2 | ES60_5_0
+ ES60_AllReleases = ES60_3_1 | ES60_3_2 | ES60_5_0 | ES60_5_1 | ES60_5_2
};
typedef struct {
@@ -59,17 +91,6 @@ typedef struct {
int newMinorSkinId;
} partMapEntry;
-enum TFallbackMbmFile {
- EAvkonMbm = 0,
- ELastMbm
-};
-
-typedef struct {
- const QS60StyleEnums::SkinParts partID;
- TFallbackMbmFile fallbackFileID; //to avoid putting large char strings to table, lets only have a mapping value
- int fallbackGraphicID;
-} fallbackMapEntry;
-
class QS60StyleModeSpecifics
{
public:
@@ -80,6 +101,8 @@ public:
const QSize &size, QS60StylePrivate::SkinElementFlags flags);
static QColor colorValue(const TAknsItemID &colorGroup, int colorIndex);
static QPixmap fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask, QS60StylePrivate::SkinElementFlags flags, QImage::Format format);
+ static bool disabledPartGraphic(QS60StyleEnums::SkinParts &part);
+ static bool disabledFrameGraphic(QS60StylePrivate::SkinFrameElements &frame);
static QPixmap generateMissingThemeGraphic(QS60StyleEnums::SkinParts &part, const QSize &size, QS60StylePrivate::SkinElementFlags flags);
private:
@@ -103,187 +126,209 @@ private:
};
const partMapEntry QS60StyleModeSpecifics::m_partMap[] = {
- /* SP_QgnGrafBarWait */ {KAknsIIDQgnGrafBarWaitAnim, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafBarFrameCenter */ {KAknsIIDQgnGrafBarFrameCenter, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafScrollArrowDown */ {KAknsIIDQgnGrafScrollArrowDown, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafScrollArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafScrollArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafScrollArrowUp */ {KAknsIIDQgnGrafScrollArrowUp, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafTabActiveL */ {KAknsIIDQgnGrafTabActiveL, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafTabActiveM */ {KAknsIIDQgnGrafTabActiveM, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafTabActiveR */ {KAknsIIDQgnGrafTabActiveR, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafTabPassiveL */ {KAknsIIDQgnGrafTabPassiveL, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafTabPassiveM */ {KAknsIIDQgnGrafTabPassiveM, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnGrafTabPassiveR */ {KAknsIIDQgnGrafTabPassiveR, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnIndiCheckboxOff */ {KAknsIIDQgnIndiCheckboxOff, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnIndiCheckboxOn */ {KAknsIIDQgnIndiCheckboxOn, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafBarWait */ {KAknsIIDQgnGrafBarWaitAnim, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafBarFrameCenter */ {KAknsIIDQgnGrafBarFrameCenter, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafScrollArrowDown */ {KAknsIIDQgnGrafScrollArrowDown, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafScrollArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafScrollArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafScrollArrowUp */ {KAknsIIDQgnGrafScrollArrowUp, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafTabActiveL */ {KAknsIIDQgnGrafTabActiveL, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafTabActiveM */ {KAknsIIDQgnGrafTabActiveM, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafTabActiveR */ {KAknsIIDQgnGrafTabActiveR, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafTabPassiveL */ {KAknsIIDQgnGrafTabPassiveL, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafTabPassiveM */ {KAknsIIDQgnGrafTabPassiveM, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnGrafTabPassiveR */ {KAknsIIDQgnGrafTabPassiveR, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiCheckboxOff */ {KAknsIIDQgnIndiCheckboxOff, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiCheckboxOn */ {KAknsIIDQgnIndiCheckboxOn, EDrawIcon, ES60_AllReleases, -1,-1},
// Following 5 items (SP_QgnIndiHlColSuper - SP_QgnIndiHlLineStraight) are available starting from S60 release 3.2.
// In 3.1 CommonStyle drawing is used for these QTreeView elements, since no similar icons in AVKON UI.
- /* SP_QgnIndiHlColSuper */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d5 /* KAknsIIDQgnIndiHlColSuper */},
- /* SP_QgnIndiHlExpSuper */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d6 /* KAknsIIDQgnIndiHlExpSuper */},
- /* SP_QgnIndiHlLineBranch */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d7 /* KAknsIIDQgnIndiHlLineBranch */},
- /* SP_QgnIndiHlLineEnd */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d8 /* KAknsIIDQgnIndiHlLineEnd */},
- /* SP_QgnIndiHlLineStraight */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d9 /* KAknsIIDQgnIndiHlLineStraight */},
- /* SP_QgnIndiMarkedAdd */ {KAknsIIDQgnIndiMarkedAdd, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnIndiNaviArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnIndiNaviArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnIndiRadiobuttOff */ {KAknsIIDQgnIndiRadiobuttOff, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnIndiRadiobuttOn */ {KAknsIIDQgnIndiRadiobuttOn, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnIndiSliderEdit */ {KAknsIIDQgnIndiSliderEdit, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnIndiSubMenu */ {KAknsIIDQgnIndiSubmenu, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnNoteErased */ {KAknsIIDQgnNoteErased, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnNoteError */ {KAknsIIDQgnNoteError, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnNoteInfo */ {KAknsIIDQgnNoteInfo, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnNoteOk */ {KAknsIIDQgnNoteOk, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnNoteQuery */ {KAknsIIDQgnNoteQuery, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnNoteWarning */ {KAknsIIDQgnNoteWarning, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnPropFileSmall */ {KAknsIIDQgnPropFileSmall, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnPropFolderCurrent */ {KAknsIIDQgnPropFolderCurrent, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnPropFolderSmall */ {KAknsIIDQgnPropFolderSmall, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnPropFolderSmallNew */ {KAknsIIDQgnPropFolderSmallNew, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QgnPropPhoneMemcLarge */ {KAknsIIDQgnPropPhoneMemcLarge, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiHlColSuper */ {KAknsIIDNone, EDrawIcon, ES60_3_1, EAknsMajorGeneric, 0x17d5 /* KAknsIIDQgnIndiHlColSuper */},
+ /* SP_QgnIndiHlExpSuper */ {KAknsIIDNone, EDrawIcon, ES60_3_1, EAknsMajorGeneric, 0x17d6 /* KAknsIIDQgnIndiHlExpSuper */},
+ /* SP_QgnIndiHlLineBranch */ {KAknsIIDNone, EDrawIcon, ES60_3_1, EAknsMajorGeneric, 0x17d7 /* KAknsIIDQgnIndiHlLineBranch */},
+ /* SP_QgnIndiHlLineEnd */ {KAknsIIDNone, EDrawIcon, ES60_3_1, EAknsMajorGeneric, 0x17d8 /* KAknsIIDQgnIndiHlLineEnd */},
+ /* SP_QgnIndiHlLineStraight */ {KAknsIIDNone, EDrawIcon, ES60_3_1, EAknsMajorGeneric, 0x17d9 /* KAknsIIDQgnIndiHlLineStraight */},
+ /* SP_QgnIndiMarkedAdd */ {KAknsIIDQgnIndiMarkedAdd, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiNaviArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiNaviArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiRadiobuttOff */ {KAknsIIDQgnIndiRadiobuttOff, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiRadiobuttOn */ {KAknsIIDQgnIndiRadiobuttOn, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiSliderEdit */ {KAknsIIDQgnIndiSliderEdit, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnIndiSubMenu */ {KAknsIIDQgnIndiSubmenu, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnNoteErased */ {KAknsIIDQgnNoteErased, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnNoteError */ {KAknsIIDQgnNoteError, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnNoteInfo */ {KAknsIIDQgnNoteInfo, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnNoteOk */ {KAknsIIDQgnNoteOk, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnNoteQuery */ {KAknsIIDQgnNoteQuery, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnNoteWarning */ {KAknsIIDQgnNoteWarning, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnPropFileSmall */ {KAknsIIDQgnPropFileSmall, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnPropFolderCurrent */ {KAknsIIDQgnPropFolderCurrent, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnPropFolderSmall */ {KAknsIIDQgnPropFolderSmall, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnPropFolderSmallNew */ {KAknsIIDQgnPropFolderSmallNew, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QgnPropPhoneMemcLarge */ {KAknsIIDQgnPropPhoneMemcLarge, EDrawIcon, ES60_AllReleases, -1,-1},
// 3.1 & 3.2 do not have pressed state for scrollbar, so use normal scrollbar graphics instead.
- /* SP_QsnCpScrollHandleBottomPressed*/ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f8}, /*KAknsIIDQsnCpScrollHandleBottomPressed*/
- /* SP_QsnCpScrollHandleMiddlePressed*/ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f9}, /*KAknsIIDQsnCpScrollHandleMiddlePressed*/
- /* SP_QsnCpScrollHandleTopPressed*/ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20fa}, /*KAknsIIDQsnCpScrollHandleTopPressed*/
-
- /* SP_QsnBgScreen */ {KAknsIIDQsnBgScreen, EDrawBackground, ES60_AllReleases, -1,-1},
-
- /* SP_QsnCpScrollBgBottom */ {KAknsIIDQsnCpScrollBgBottom, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QsnCpScrollBgMiddle */ {KAknsIIDQsnCpScrollBgMiddle, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QsnCpScrollBgTop */ {KAknsIIDQsnCpScrollBgTop, EDrawIcon, ES60_AllReleases, -1,-1},
-
- /* SP_QsnCpScrollHandleBottom */ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QsnCpScrollHandleMiddle */ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_AllReleases, -1,-1},
- /* SP_QsnCpScrollHandleTop */ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_AllReleases, -1,-1},
-
- /* SP_QsnFrButtonTbCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbCenter */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_AllReleases, -1,-1},
-
- /* SP_QsnFrButtonTbCornerTlPressed */{KAknsIIDQsnFrButtonTbCornerTlPressed, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbCornerTrPressed */{KAknsIIDQsnFrButtonTbCornerTrPressed, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbCornerBlPressed */{KAknsIIDQsnFrButtonTbCornerBlPressed, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbCornerBrPressed */{KAknsIIDQsnFrButtonTbCornerBrPressed, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbSideTPressed */ {KAknsIIDQsnFrButtonTbSideTPressed, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbSideBPressed */ {KAknsIIDQsnFrButtonTbSideBPressed, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbSideLPressed */ {KAknsIIDQsnFrButtonTbSideLPressed, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbSideRPressed */ {KAknsIIDQsnFrButtonTbSideRPressed, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrButtonTbCenterPressed */ {KAknsIIDQsnFrButtonTbCenterPressed, EDrawIcon, ES60_AllReleases, -1,-1},
-
- /* SP_QsnFrCaleCornerTl */ {KAknsIIDQsnFrCaleCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleCornerTr */ {KAknsIIDQsnFrCaleCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleCornerBl */ {KAknsIIDQsnFrCaleCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleCornerBr */ {KAknsIIDQsnFrCaleCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleGSideT */ {KAknsIIDQsnFrCaleSideT, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleGSideB */ {KAknsIIDQsnFrCaleSideB, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleGSideL */ {KAknsIIDQsnFrCaleSideL, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleGSideR */ {KAknsIIDQsnFrCaleSideR, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleCenter */ {KAknsIIDQsnFrCaleCenter, ENoDraw, ES60_AllReleases, -1,-1},
-
- /* SP_QsnFrCaleHeadingCornerTl */ {KAknsIIDQsnFrCaleHeadingCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleHeadingCornerTr */ {KAknsIIDQsnFrCaleHeadingCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleHeadingCornerBl */ {KAknsIIDQsnFrCaleHeadingCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleHeadingCornerBr */ {KAknsIIDQsnFrCaleHeadingCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleHeadingSideT */ {KAknsIIDQsnFrCaleHeadingSideT, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleHeadingSideB */ {KAknsIIDQsnFrCaleHeadingSideB, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleHeadingSideL */ {KAknsIIDQsnFrCaleHeadingSideL, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleHeadingSideR */ {KAknsIIDQsnFrCaleHeadingSideR, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrCaleHeadingCenter */ {KAknsIIDQsnFrCaleHeadingCenter, ENoDraw, ES60_AllReleases, -1,-1},
-
- /* SP_QsnFrInputCornerTl */ {KAknsIIDQsnFrInputCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrInputCornerTr */ {KAknsIIDQsnFrInputCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrInputCornerBl */ {KAknsIIDQsnFrInputCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrInputCornerBr */ {KAknsIIDQsnFrInputCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrInputSideT */ {KAknsIIDQsnFrInputSideT, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrInputSideB */ {KAknsIIDQsnFrInputSideB, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrInputSideL */ {KAknsIIDQsnFrInputSideL, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrInputSideR */ {KAknsIIDQsnFrInputSideR, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrInputCenter */ {KAknsIIDQsnFrInputCenter, ENoDraw, ES60_AllReleases, -1,-1},
-
- /* SP_QsnFrListCornerTl */ {KAknsIIDQsnFrListCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrListCornerTr */ {KAknsIIDQsnFrListCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrListCornerBl */ {KAknsIIDQsnFrListCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrListCornerBr */ {KAknsIIDQsnFrListCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrListSideT */ {KAknsIIDQsnFrListSideT, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrListSideB */ {KAknsIIDQsnFrListSideB, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrListSideL */ {KAknsIIDQsnFrListSideL, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrListSideR */ {KAknsIIDQsnFrListSideR, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrListCenter */ {KAknsIIDQsnFrListCenter, ENoDraw, ES60_AllReleases, -1,-1},
-
- /* SP_QsnFrPopupCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrPopupCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrPopupCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrPopupCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrPopupSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrPopupSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrPopupSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrPopupSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnCpScrollHandleBottomPressed*/ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f8}, /*KAknsIIDQsnCpScrollHandleBottomPressed*/
+ /* SP_QsnCpScrollHandleMiddlePressed*/ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f9}, /*KAknsIIDQsnCpScrollHandleMiddlePressed*/
+ /* SP_QsnCpScrollHandleTopPressed*/ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20fa}, /*KAknsIIDQsnCpScrollHandleTopPressed*/
+
+ /* SP_QsnBgScreen */ {KAknsIIDQsnBgScreen, EDrawBackground, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnCpScrollBgBottom */ {KAknsIIDQsnCpScrollBgBottom, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QsnCpScrollBgMiddle */ {KAknsIIDQsnCpScrollBgMiddle, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QsnCpScrollBgTop */ {KAknsIIDQsnCpScrollBgTop, EDrawIcon, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnCpScrollHandleBottom */ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QsnCpScrollHandleMiddle */ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_AllReleases, -1,-1},
+ /* SP_QsnCpScrollHandleTop */ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrButtonTbCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, //todo: use "normal button" from 5.0 onwards
+ /* SP_QsnFrButtonTbCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCenter */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrButtonTbCornerTlPressed */{KAknsIIDQsnFrButtonTbCornerTlPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCornerTrPressed */{KAknsIIDQsnFrButtonTbCornerTrPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCornerBlPressed */{KAknsIIDQsnFrButtonTbCornerBlPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCornerBrPressed */{KAknsIIDQsnFrButtonTbCornerBrPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideTPressed */ {KAknsIIDQsnFrButtonTbSideTPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideBPressed */ {KAknsIIDQsnFrButtonTbSideBPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideLPressed */ {KAknsIIDQsnFrButtonTbSideLPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbSideRPressed */ {KAknsIIDQsnFrButtonTbSideRPressed, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrButtonTbCenterPressed */ {KAknsIIDQsnFrButtonTbCenterPressed, EDrawIcon, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrCaleCornerTl */ {KAknsIIDQsnFrCaleCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleCornerTr */ {KAknsIIDQsnFrCaleCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleCornerBl */ {KAknsIIDQsnFrCaleCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleCornerBr */ {KAknsIIDQsnFrCaleCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleGSideT */ {KAknsIIDQsnFrCaleSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleGSideB */ {KAknsIIDQsnFrCaleSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleGSideL */ {KAknsIIDQsnFrCaleSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleGSideR */ {KAknsIIDQsnFrCaleSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleCenter */ {KAknsIIDQsnFrCaleCenter, ENoDraw, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrCaleHeadingCornerTl */ {KAknsIIDQsnFrCaleHeadingCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingCornerTr */ {KAknsIIDQsnFrCaleHeadingCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingCornerBl */ {KAknsIIDQsnFrCaleHeadingCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingCornerBr */ {KAknsIIDQsnFrCaleHeadingCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingSideT */ {KAknsIIDQsnFrCaleHeadingSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingSideB */ {KAknsIIDQsnFrCaleHeadingSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingSideL */ {KAknsIIDQsnFrCaleHeadingSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingSideR */ {KAknsIIDQsnFrCaleHeadingSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrCaleHeadingCenter */ {KAknsIIDQsnFrCaleHeadingCenter, ENoDraw, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrInputCornerTl */ {KAknsIIDQsnFrInputCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputCornerTr */ {KAknsIIDQsnFrInputCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputCornerBl */ {KAknsIIDQsnFrInputCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputCornerBr */ {KAknsIIDQsnFrInputCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputSideT */ {KAknsIIDQsnFrInputSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputSideB */ {KAknsIIDQsnFrInputSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputSideL */ {KAknsIIDQsnFrInputSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputSideR */ {KAknsIIDQsnFrInputSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrInputCenter */ {KAknsIIDQsnFrInputCenter, ENoDraw, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrListCornerTl */ {KAknsIIDQsnFrListCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListCornerTr */ {KAknsIIDQsnFrListCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListCornerBl */ {KAknsIIDQsnFrListCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListCornerBr */ {KAknsIIDQsnFrListCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListSideT */ {KAknsIIDQsnFrListSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListSideB */ {KAknsIIDQsnFrListSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListSideL */ {KAknsIIDQsnFrListSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListSideR */ {KAknsIIDQsnFrListSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrListCenter */ {KAknsIIDQsnFrListCenter, ENoDraw, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrPopupCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_AllReleases, -1,-1},
// ToolTip graphics different in 3.1 vs. 3.2+.
- /* SP_QsnFrPopupPreviewCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c5}, /* KAknsIIDQsnFrPopupPreviewCornerTl */
- /* SP_QsnFrPopupPreviewCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c6},
- /* SP_QsnFrPopupPreviewCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c3},
- /* SP_QsnFrPopupPreviewCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c4},
- /* SP_QsnFrPopupPreviewSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19ca},
- /* SP_QsnFrPopupPreviewSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c7},
- /* SP_QsnFrPopupPreviewSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c8},
- /* SP_QsnFrPopupPreviewSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c9},
- /* SP_QsnFrPopupPreviewCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c2},
-
- /* SP_QsnFrSetOptCornerTl */ {KAknsIIDQsnFrSetOptCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrSetOptCornerTr */ {KAknsIIDQsnFrSetOptCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrSetOptCornerBl */ {KAknsIIDQsnFrSetOptCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrSetOptCornerBr */ {KAknsIIDQsnFrSetOptCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrSetOptSideT */ {KAknsIIDQsnFrSetOptSideT, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrSetOptSideB */ {KAknsIIDQsnFrSetOptSideB, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrSetOptSideL */ {KAknsIIDQsnFrSetOptSideL, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrSetOptSideR */ {KAknsIIDQsnFrSetOptSideR, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrSetOptCenter */ {KAknsIIDQsnFrSetOptCenter, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrPopupPreviewCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c5}, /* KAknsIIDQsnFrPopupPreviewCornerTl */
+ /* SP_QsnFrPopupPreviewCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c6},
+ /* SP_QsnFrPopupPreviewCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c3},
+ /* SP_QsnFrPopupPreviewCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c4},
+ /* SP_QsnFrPopupPreviewSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19ca},
+ /* SP_QsnFrPopupPreviewSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c7},
+ /* SP_QsnFrPopupPreviewSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c8},
+ /* SP_QsnFrPopupPreviewSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c9},
+ /* SP_QsnFrPopupPreviewCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c2},
+
+ /* SP_QsnFrSetOptCornerTl */ {KAknsIIDQsnFrSetOptCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptCornerTr */ {KAknsIIDQsnFrSetOptCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptCornerBl */ {KAknsIIDQsnFrSetOptCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptCornerBr */ {KAknsIIDQsnFrSetOptCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptSideT */ {KAknsIIDQsnFrSetOptSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptSideB */ {KAknsIIDQsnFrSetOptSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptSideL */ {KAknsIIDQsnFrSetOptSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptSideR */ {KAknsIIDQsnFrSetOptSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrSetOptCenter */ {KAknsIIDQsnFrSetOptCenter, ENoDraw, ES60_AllReleases, -1,-1},
// No toolbar frame for 5.0+ releases.
- /* SP_QsnFrPopupSubCornerTl */ {KAknsIIDQsnFrPopupSubCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
- /* SP_QsnFrPopupSubCornerTr */ {KAknsIIDQsnFrPopupSubCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
- /* SP_QsnFrPopupSubCornerBl */ {KAknsIIDQsnFrPopupSubCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
- /* SP_QsnFrPopupSubCornerBr */ {KAknsIIDQsnFrPopupSubCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
- /* SP_QsnFrPopupSubSideT */ {KAknsIIDQsnFrPopupSubSideT, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
- /* SP_QsnFrPopupSubSideB */ {KAknsIIDQsnFrPopupSubSideB, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
- /* SP_QsnFrPopupSubSideL */ {KAknsIIDQsnFrPopupSubSideL, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
- /* SP_QsnFrPopupSubSideR */ {KAknsIIDQsnFrPopupSubSideR, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
- /* SP_QsnFrPopupSubCenter */ {KAknsIIDQsnFrPopupCenterSubmenu, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubCornerTl */ {KAknsIIDQsnFrPopupSubCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubCornerTr */ {KAknsIIDQsnFrPopupSubCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubCornerBl */ {KAknsIIDQsnFrPopupSubCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubCornerBr */ {KAknsIIDQsnFrPopupSubCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubSideT */ {KAknsIIDQsnFrPopupSubSideT, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubSideB */ {KAknsIIDQsnFrPopupSubSideB, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubSideL */ {KAknsIIDQsnFrPopupSubSideL, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubSideR */ {KAknsIIDQsnFrPopupSubSideR, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
+ /* SP_QsnFrPopupSubCenter */ {KAknsIIDQsnFrPopupCenterSubmenu, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1},
// Toolbar graphics is different in 3.1/3.2 vs. 5.0
- /* SP_QsnFrSctrlButtonCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2301}, /* KAknsIIDQgnFrSctrlButtonCornerTl*/
- /* SP_QsnFrSctrlButtonCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2302},
- /* SP_QsnFrSctrlButtonCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2303},
- /* SP_QsnFrSctrlButtonCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2304},
- /* SP_QsnFrSctrlButtonSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2305},
- /* SP_QsnFrSctrlButtonSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2306},
- /* SP_QsnFrSctrlButtonSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2307},
- /* SP_QsnFrSctrlButtonSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2308},
- /* SP_QsnFrSctrlButtonCenter */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2309}, /*KAknsIIDQgnFrSctrlButtonCenter*/
+ /* SP_QsnFrSctrlButtonCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2301}, /* KAknsIIDQgnFrSctrlButtonCornerTl*/
+ /* SP_QsnFrSctrlButtonCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2302},
+ /* SP_QsnFrSctrlButtonCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2303},
+ /* SP_QsnFrSctrlButtonCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2304},
+ /* SP_QsnFrSctrlButtonSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2305},
+ /* SP_QsnFrSctrlButtonSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2306},
+ /* SP_QsnFrSctrlButtonSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2307},
+ /* SP_QsnFrSctrlButtonSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2308},
+ /* SP_QsnFrSctrlButtonCenter */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2309}, /*KAknsIIDQgnFrSctrlButtonCenter*/
// No pressed state for toolbar button in 3.1/3.2.
- /* SP_QsnFrSctrlButtonCornerTlPressed */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2621}, /*KAknsIIDQsnFrSctrlButtonCornerTlPressed*/
- /* SP_QsnFrSctrlButtonCornerTrPressed */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2622},
- /* SP_QsnFrSctrlButtonCornerBlPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2623},
- /* SP_QsnFrSctrlButtonCornerBrPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2624},
- /* SP_QsnFrSctrlButtonSideTPressed */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2625},
- /* SP_QsnFrSctrlButtonSideBPressed */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2626},
- /* SP_QsnFrSctrlButtonSideLPressed */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2627},
- /* SP_QsnFrSctrlButtonSideRPressed */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2628},
- /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2629}
+ /* SP_QsnFrSctrlButtonCornerTlPressed */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2621}, /*KAknsIIDQsnFrSctrlButtonCornerTlPressed*/
+ /* SP_QsnFrSctrlButtonCornerTrPressed */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2622},
+ /* SP_QsnFrSctrlButtonCornerBlPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2623},
+ /* SP_QsnFrSctrlButtonCornerBrPressed */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2624},
+ /* SP_QsnFrSctrlButtonSideTPressed */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2625},
+ /* SP_QsnFrSctrlButtonSideBPressed */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2626},
+ /* SP_QsnFrSctrlButtonSideLPressed */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2627},
+ /* SP_QsnFrSctrlButtonSideRPressed */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2628},
+ /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2629},
+
+ // No inactive button graphics in 3.1/3.2
+ /* SP_QsnFrButtonCornerTlInactive */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b1}, /*KAknsIIDQsnFrButtonCornerTlInactive*/
+ /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b2},
+ /* SP_QsnFrButtonCornerBlInactive */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b3},
+ /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b4},
+ /* SP_QsnFrButtonSideTInactive */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b5},
+ /* SP_QsnFrButtonSideBInactive */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b6},
+ /* SP_QsnFrButtonSideLInactive */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b7},
+ /* SP_QsnFrButtonSideRInactive */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b8},
+ /* SP_QsnFrButtonCenterInactive */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b9},
+
+ /*SP_QsnFrNotepadCornerTl */ {KAknsIIDQsnFrNotepadCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrNotepadCornerTr */ {KAknsIIDQsnFrNotepadCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrNotepadCornerBl */ {KAknsIIDQsnFrNotepadCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrNotepadCornerBr */ {KAknsIIDQsnFrNotepadCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrNotepadSideT */ {KAknsIIDQsnFrNotepadSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrNotepadSideB */ {KAknsIIDQsnFrNotepadSideB, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrNotepadSideL */ {KAknsIIDQsnFrNotepadSideL, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrNotepadSideR */ {KAknsIIDQsnFrNotepadSideR, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrNotepadCenter */ {KAknsIIDQsnFrNotepadCenter, EDrawIcon, ES60_AllReleases, -1,-1}
+
};
QPixmap QS60StyleModeSpecifics::skinnedGraphics(
@@ -323,7 +368,7 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphics(
}
void QS60StyleModeSpecifics::fallbackInfo(const QS60StyleEnums::SkinParts &stylepart, TDes& fallbackFileName, TInt& fallbackIndex)
-{
+{
switch(stylepart) {
case QS60StyleEnums::SP_QgnGrafBarWait:
fallbackFileName = KAvkonBitmapFile();
@@ -377,19 +422,19 @@ void QS60StyleModeSpecifics::fallbackInfo(const QS60StyleEnums::SkinParts &style
fallbackFileName = KAvkonBitmapFile();
fallbackIndex = EMbmAvkonQgn_indi_checkbox_on;
break;
- case QS60StyleEnums::SP_QgnIndiHlColSuper:
+ case QS60StyleEnums::SP_QgnIndiHlColSuper:
fallbackFileName = KAvkonBitmapFile();
fallbackIndex = 0x4456; /* EMbmAvkonQgn_indi_hl_col_super */
break;
- case QS60StyleEnums::SP_QgnIndiHlExpSuper:
+ case QS60StyleEnums::SP_QgnIndiHlExpSuper:
fallbackFileName = KAvkonBitmapFile();
fallbackIndex = 0x4458; /* EMbmAvkonQgn_indi_hl_exp_super */
break;
- case QS60StyleEnums::SP_QgnIndiHlLineBranch:
+ case QS60StyleEnums::SP_QgnIndiHlLineBranch:
fallbackFileName = KAvkonBitmapFile();
fallbackIndex = 0x445A; /* EMbmAvkonQgn_indi_hl_line_branch */
break;
- case QS60StyleEnums::SP_QgnIndiHlLineEnd:
+ case QS60StyleEnums::SP_QgnIndiHlLineEnd:
fallbackFileName = KAvkonBitmapFile();
fallbackIndex = 0x445C; /* EMbmAvkonQgn_indi_hl_line_end */
break;
@@ -486,8 +531,8 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphicsL(
TInt fallbackGraphicID = -1;
HBufC* iconFile = HBufC::NewLC( KMaxFileName );
TPtr fileNamePtr = iconFile->Des();
- fallbackInfo(stylepart, fileNamePtr, fallbackGraphicID);
-
+ fallbackInfo(stylepart, fileNamePtr, fallbackGraphicID);
+
TAknsItemID colorGroup = KAknsIIDQsnIconColors;
int colorIndex = 0;
colorGroupAndIndex(stylepart, colorGroup, colorIndex);
@@ -569,26 +614,6 @@ QPixmap QS60StyleModeSpecifics::fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask
return QPixmap::fromImage(iconImage);
}
-QPixmap QS60StylePrivate::backgroundTexture()
-{
- static QPixmap result;
- // Poor mans caching. + Making sure that there is always only one background image in memory at a time
-
-/*
- TODO: 1) Hold the background QPixmap as pointer in a static class member.
- Also add a deleteBackground() function and call that in ~QS60StylePrivate()
- 2) Don't cache the background at all as soon as we have native pixmap support
-*/
-
- if (!m_backgroundValid) {
- result = QPixmap();
- result = part(QS60StyleEnums::SP_QsnBgScreen,
- QSize(S60->screenWidthInPixels, S60->screenHeightInPixels), SkinElementFlags());
- m_backgroundValid = true;
- }
- return result;
-}
-
bool QS60StylePrivate::isTouchSupported()
{
return bool(AknLayoutUtils::PenEnabled());
@@ -599,30 +624,11 @@ bool QS60StylePrivate::isToolBarBackground()
return (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2);
}
-void qt_s60_fill_background(QPainter *painter, const QRegion &rgn, const QPoint &offset,
- const QBrush &brush)
+QPoint qt_s60_fill_background_offset(const QWidget *targetWidget)
{
- const QPixmap backgroundTexture(QS60StylePrivate::backgroundTexture());
- if (backgroundTexture.cacheKey() == brush.texture().cacheKey()) {
- const QPaintDevice *target = painter->device();
- if (target->devType() == QInternal::Widget) {
- const QWidget *widget = static_cast<const QWidget *>(target);
- CCoeControl *control = widget->effectiveWinId();
- TPoint globalPos = control ? control->PositionRelativeToScreen() : TPoint(0,0);
- const QRegion translated = rgn.translated(offset);
- const QVector<QRect> &rects = translated.rects();
- for (int i = 0; i < rects.size(); ++i) {
- const QRect rect(rects.at(i));
- painter->drawPixmap(rect.topLeft(), backgroundTexture,
- rect.translated(globalPos.iX, globalPos.iY));
- }
- }
- } else {
- const QRegion translated = rgn.translated(offset);
- const QRect rect(translated.boundingRect());
- painter->setClipRegion(translated);
- painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft());
- }
+ CCoeControl *control = targetWidget->effectiveWinId();
+ TPoint globalPos = control ? control->PositionRelativeToScreen() : TPoint(0,0);
+ return QPoint(globalPos.iX, globalPos.iY);
}
QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(
@@ -639,7 +645,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(
Q_ASSERT(drawType != ENoDraw);
const bool rotatedBy90or270 =
(flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest));
- TSize targetSize =
+ const TSize targetSize =
rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size);
MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
@@ -647,65 +653,63 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(
QPixmap result;
switch (drawType) {
- case EDrawIcon:
- {
- TInt fallbackGraphicID = -1;
- HBufC* iconFile = HBufC::NewLC( KMaxFileName );
- TPtr fileNamePtr = iconFile->Des();
- fallbackInfo(part, fileNamePtr, fallbackGraphicID);
-
- CFbsBitmap *icon = 0;
- CFbsBitmap *iconMask = 0;
- const TInt fallbackGraphicsMaskID =
- fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files
-// QS60WindowSurface::unlockBitmapHeap();
- AknsUtils::CreateIconLC(skinInstance, skinId, icon, iconMask, fileNamePtr, fallbackGraphicID , fallbackGraphicsMaskID);
- User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved));
- User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved));
- result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode()));
- CleanupStack::PopAndDestroy(3); // iconMask, icon, iconFile
-// QS60WindowSurface::lockBitmapHeap();
- break;
- }
- case EDrawBackground:
- {
-// QS60WindowSurface::unlockBitmapHeap();
- CFbsBitmap *background = new (ELeave) CFbsBitmap(); //offscreen
- CleanupStack::PushL(background);
- User::LeaveIfError(background->Create(targetSize, EColor16MA));
-
- // todo: push background into CleanupStack
- CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(background);
- CleanupStack::PushL(dev);
- CFbsBitGc* gc = NULL;
- User::LeaveIfError(dev->CreateContext(gc));
- CleanupStack::PushL(gc);
-
- CAknsBasicBackgroundControlContext* bgContext = CAknsBasicBackgroundControlContext::NewL(
- skinId,
- targetSize,
- EFalse);
- CleanupStack::PushL(bgContext);
-
- const TBool drawn = AknsDrawUtils::DrawBackground(
- skinInstance,
- bgContext,
- NULL,
- *gc,
- TPoint(),
- targetSize,
- KAknsDrawParamDefault | KAknsDrawParamRGBOnly);
-
- if (drawn)
- result = fromFbsBitmap(background, NULL, flags, QImage::Format_RGB32);
-
- CleanupStack::PopAndDestroy(4, background); //background, dev, gc, bgContext
-// QS60WindowSurface::lockBitmapHeap();
- break;
- }
+ case EDrawIcon: {
+ TInt fallbackGraphicID = -1;
+ HBufC* iconFile = HBufC::NewLC( KMaxFileName );
+ TPtr fileNamePtr = iconFile->Des();
+ fallbackInfo(part, fileNamePtr, fallbackGraphicID);
+ // todo: could we instead use AknIconUtils::AvkonIconFileName(); to avoid allocating each time?
+
+ CFbsBitmap *icon = 0;
+ CFbsBitmap *iconMask = 0;
+ const TInt fallbackGraphicsMaskID =
+ fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files
+ // QS60WindowSurface::unlockBitmapHeap();
+ AknsUtils::CreateIconLC(skinInstance, skinId, icon, iconMask, fileNamePtr, fallbackGraphicID , fallbackGraphicsMaskID);
+ User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved));
+ User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved));
+ result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode()));
+ CleanupStack::PopAndDestroy(3); // iconMask, icon, iconFile
+ // QS60WindowSurface::lockBitmapHeap();
+ break;
+ }
+ case EDrawBackground: {
+ // QS60WindowSurface::unlockBitmapHeap();
+ CFbsBitmap *background = new (ELeave) CFbsBitmap(); //offscreen
+ CleanupStack::PushL(background);
+ User::LeaveIfError(background->Create(targetSize, EColor16MA));
+
+ CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(background);
+ CleanupStack::PushL(dev);
+ CFbsBitGc* gc = NULL;
+ User::LeaveIfError(dev->CreateContext(gc));
+ CleanupStack::PushL(gc);
+
+ CAknsBasicBackgroundControlContext* bgContext = CAknsBasicBackgroundControlContext::NewL(
+ skinId,
+ targetSize,
+ EFalse);
+ CleanupStack::PushL(bgContext);
+
+ const TBool drawn = AknsDrawUtils::DrawBackground(
+ skinInstance,
+ bgContext,
+ NULL,
+ *gc,
+ TPoint(),
+ targetSize,
+ KAknsDrawParamDefault | KAknsDrawParamRGBOnly);
+
+ if (drawn)
+ result = fromFbsBitmap(background, NULL, flags, QImage::Format_RGB32);
+
+ CleanupStack::PopAndDestroy(4, background); //background, dev, gc, bgContext
+ // QS60WindowSurface::lockBitmapHeap();
+ break;
+ }
}
- return result; // TODO: Let fromFbsBitmap return a QPixmap
+ return result;
}
QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFrameElements frameElement,
@@ -716,11 +720,10 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFra
const bool rotatedBy90or270 =
(flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest));
- TSize targetSize =
+ const TSize targetSize =
rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size);
MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
-
QPixmap result;
// QS60WindowSurface::unlockBitmapHeap();
@@ -764,7 +767,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFra
skinInstance->GetCachedItemData(frameSkinID,EAknsITMaskedBitmap));
if (skinMaskedBmp && skinMaskedBmp->Mask())
maskDepth = skinMaskedBmp->Mask()->DisplayMode();
- }
+ }
if (maskDepth != ENone) {
CFbsBitmap *frameMask = new (ELeave) CFbsBitmap(); //offscreen
CleanupStack::PushL(frameMask);
@@ -792,11 +795,10 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFra
result = fromFbsBitmap(frame, frameMask, flags, QImage::Format_ARGB32);
}
CleanupStack::PopAndDestroy(3, frameMask);
- }
}
+ }
CleanupStack::PopAndDestroy(3, frame); //frame, bitmapDev, bitmapGc
-
- return result; // TODO: Let fromFbsBitmap return a QPixmap
+ return result;
}
void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameElements frameElement, TAknsItemID &frameId, TAknsItemID &centerId)
@@ -807,7 +809,7 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme
switch(frameElement) {
case QS60StylePrivate::SF_ToolTip:
- if (QSysInfo::s60Version()==QSysInfo::SV_S60_5_0 || QSysInfo::s60Version()==QSysInfo::SV_S60_3_2) {
+ if (QSysInfo::s60Version()!=QSysInfo::SV_S60_3_1) {
centerId.Set(EAknsMajorGeneric, 0x19c2);
frameId.Set(EAknsMajorSkin, 0x5300);
} else {
@@ -835,17 +837,19 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme
TRect QS60StyleModeSpecifics::innerRectFromElement(QS60StylePrivate::SkinFrameElements frameElement, const TRect &outerRect)
{
- TInt widthShrink = 0;
- TInt heightShrink = 0;
+ TInt widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth);
+ TInt heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight);
switch(frameElement) {
case QS60StylePrivate::SF_PanelBackground:
// panel should have slightly slimmer border to enable thin line of background graphics between closest component
- widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth)-2;
- heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight)-2;
+ widthShrink = widthShrink-2;
+ heightShrink = heightShrink-2;
+ break;
+ case QS60StylePrivate::SF_ToolTip:
+ widthShrink = widthShrink>>1;
+ heightShrink = heightShrink>>1;
break;
default:
- widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth);
- heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight);
break;
}
TRect innerRect(outerRect);
@@ -898,7 +902,7 @@ void QS60StyleModeSpecifics::checkAndUnCompressBitmapL(CFbsBitmap*& aOriginalBit
QFont QS60StylePrivate::s60Font_specific(
QS60StyleEnums::FontCategories fontCategory, int pointSize)
{
- enum TAknFontCategory aknFontCategory = EAknFontCategoryUndefined;
+ TAknFontCategory aknFontCategory = EAknFontCategoryUndefined;
switch (fontCategory) {
case QS60StyleEnums::FC_Primary:
aknFontCategory = EAknFontCategoryPrimary;
@@ -943,12 +947,10 @@ QFont QS60StylePrivate::s60Font_specific(
return result;
}
-#ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED
void QS60StylePrivate::setActiveLayout()
{
- //todo: how to find layouts that are of same size (QVGA1 vs. QVGA2)
const QSize activeScreenSize(screenSize());
- int activeLayoutIndex = 0;
+ int activeLayoutIndex = -1;
const bool mirrored = !QApplication::isLeftToRight();
const short screenHeight = (short)activeScreenSize.height();
const short screenWidth = (short)activeScreenSize.width();
@@ -960,35 +962,112 @@ void QS60StylePrivate::setActiveLayout()
break;
}
}
+
+ //not found, lets try without mirroring info
+ if (activeLayoutIndex==-1){
+ for (int i=0; i<m_numberOfLayouts; i++) {
+ if (screenHeight==m_layoutHeaders[i].height &&
+ screenWidth==m_layoutHeaders[i].width) {
+ activeLayoutIndex = i;
+ break;
+ }
+ }
+ }
+
+ //not found, lets try with either of dimensions
+ if (activeLayoutIndex==-1){
+ const QSysInfo::S60Version currentRelease = QSysInfo::s60Version();
+ const bool landscape = screenHeight < screenWidth;
+
+ activeLayoutIndex = (currentRelease == QSysInfo::SV_S60_3_1 || currentRelease == QSysInfo::SV_S60_3_2) ? 0 : 4;
+ activeLayoutIndex += (!landscape) ? 2 : 0;
+ activeLayoutIndex += (!mirrored) ? 1 : 0;
+ }
+
m_pmPointer = data[activeLayoutIndex];
}
-#endif // QT_S60STYLE_LAYOUTDATA_SIMULATED
QS60StylePrivate::QS60StylePrivate()
{
-#ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED
// No need to set active layout, if dynamic metrics API is available
setActiveLayout();
-#endif // QT_S60STYLE_LAYOUTDATA_SIMULATED
}
-QS60StylePrivate::~QS60StylePrivate()
+void QS60StylePrivate::setStyleProperty_specific(const char *name, const QVariant &value)
{
- m_backgroundValid = false;
+ if (name == QLatin1String("foo")) {
+ // BaR
+ } else {
+ setStyleProperty(name, value);
+ }
}
-short QS60StylePrivate::pixelMetric(int metric)
+QVariant QS60StylePrivate::styleProperty_specific(const char *name) const
{
-#ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED
- Q_ASSERT(metric < MAX_PIXELMETRICS);
- const short returnValue = m_pmPointer[metric];
- if (returnValue==-909)
- return -1;
- return returnValue;
-#else
- //todo - call the pixelmetrics API directly
- return 0;
-#endif // QT_S60STYLE_LAYOUTDATA_SIMULATED
+ if (name == QLatin1String("foo"))
+ return QLatin1String("Bar");
+ else
+ return styleProperty(name);
+}
+
+QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list,
+ int index, const QStyleOption *option)
+{
+ static const TAknsItemID *idMap[] = {
+ &KAknsIIDQsnHighlightColors,
+ &KAknsIIDQsnIconColors,
+ &KAknsIIDQsnLineColors,
+ &KAknsIIDQsnOtherColors,
+ &KAknsIIDQsnParentColors,
+ &KAknsIIDQsnTextColors
+ };
+ Q_ASSERT((int)list <= (int)sizeof(idMap)/sizeof(idMap[0]));
+ const QColor color = QS60StyleModeSpecifics::colorValue(*idMap[(int) list], index - 1);
+ return option ? QS60StylePrivate::stateColor(color, option) : color;
+}
+
+// In some cases, the AVKON UI themegraphic is already in 'disabled state'.
+// If so, return true for these parts.
+bool QS60StyleModeSpecifics::disabledPartGraphic(QS60StyleEnums::SkinParts &part)
+{
+ bool disabledGraphic = false;
+ switch(part){
+ // inactive button graphics are available from 5.0 onwards
+ case QS60StyleEnums::SP_QsnFrButtonCornerTlInactive:
+ case QS60StyleEnums::SP_QsnFrButtonCornerTrInactive:
+ case QS60StyleEnums::SP_QsnFrButtonCornerBlInactive:
+ case QS60StyleEnums::SP_QsnFrButtonCornerBrInactive:
+ case QS60StyleEnums::SP_QsnFrButtonSideTInactive:
+ case QS60StyleEnums::SP_QsnFrButtonSideBInactive:
+ case QS60StyleEnums::SP_QsnFrButtonSideLInactive:
+ case QS60StyleEnums::SP_QsnFrButtonSideRInactive:
+ case QS60StyleEnums::SP_QsnFrButtonCenterInactive:
+ if (!(QSysInfo::s60Version()==QSysInfo::SV_S60_3_1 ||
+ QSysInfo::s60Version()==QSysInfo::SV_S60_3_2))
+ disabledGraphic = true;
+ break;
+ default:
+ break;
+ }
+ return disabledGraphic;
+}
+
+// In some cases, the AVKON UI themegraphic is already in 'disabled state'.
+// If so, return true for these frames.
+bool QS60StyleModeSpecifics::disabledFrameGraphic(QS60StylePrivate::SkinFrameElements &frame)
+{
+ bool disabledGraphic = false;
+ switch(frame){
+ // inactive button graphics are available from 5.0 onwards
+ case QS60StylePrivate::SF_ButtonInactive:
+ if (!(QSysInfo::s60Version()==QSysInfo::SV_S60_3_1 ||
+ QSysInfo::s60Version()==QSysInfo::SV_S60_3_2))
+ disabledGraphic = true;
+ break;
+ default:
+ break;
+ }
+ return disabledGraphic;
}
QPixmap QS60StyleModeSpecifics::generateMissingThemeGraphic(QS60StyleEnums::SkinParts &part,
@@ -1002,8 +1081,8 @@ QPixmap QS60StyleModeSpecifics::generateMissingThemeGraphic(QS60StyleEnums::Skin
// AVKON UI has a abnormal handling for scrollbar graphics. It is possible that the root
// skin does not contain mandatory graphics for scrollbar pressed states. Therefore, AVKON UI
// creates dynamically these graphics by modifying the normal state scrollbar graphics slightly.
- // S60Style needs to work similarly. Therefore if skingraphics call provides to be a miss
- // (i.e. result is not valid), style needs to draw normal graphics instead and apply some
+ // S60Style needs to work similarly. Therefore if skingraphics call provides to be a miss
+ // (i.e. result is not valid), style needs to draw normal graphics instead and apply some
// modifications (similar to generatedIconPixmap()) to the result.
case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed:
updatedPart = QS60StyleEnums::SP_QsnCpScrollHandleBottom;
@@ -1021,10 +1100,11 @@ QPixmap QS60StyleModeSpecifics::generateMissingThemeGraphic(QS60StyleEnums::Skin
return QPixmap();
} else {
QPixmap result = skinnedGraphics(updatedPart, size, flags);
- // TODO: fix this
QStyleOption opt;
- // opt.palette = q->standardPalette();
-
+ QPalette *themePalette = QS60StylePrivate::themePalette();
+ if (themePalette)
+ opt.palette = *themePalette;
+
// For now, always generate new icon based on "selected". In the future possibly, expand
// this to consist other possibilities as well.
result = QApplication::style()->generatedIconPixmap(QIcon::Selected, result, &opt);
@@ -1041,16 +1121,17 @@ QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part,
: QS60StyleModeSpecifics::skinnedGraphics(part, size, flags);
QS60WindowSurface::lockBitmapHeap();
- if (flags & SF_StateDisabled) {
- // TODO: fix this
+ if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledPartGraphic(part)) {
QStyleOption opt;
-// opt.palette = q->standardPalette();
+ QPalette *themePalette = QS60StylePrivate::themePalette();
+ if (themePalette)
+ opt.palette = *themePalette;
result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt);
}
if (!result)
result = QS60StyleModeSpecifics::generateMissingThemeGraphic(part, size, flags);
-
+
return result;
}
@@ -1060,46 +1141,24 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, Skin
QPixmap result = QS60StyleModeSpecifics::skinnedGraphics(frame, size, flags);
QS60WindowSurface::lockBitmapHeap();
- if (flags & SF_StateDisabled) {
- // TODO: fix this
+ if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledFrameGraphic(frame)) {
QStyleOption opt;
-// opt.palette = q->standardPalette();
+ QPalette *themePalette = QS60StylePrivate::themePalette();
+ if (themePalette)
+ opt.palette = *themePalette;
result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt);
}
return result;
}
-void QS60StylePrivate::setStyleProperty_specific(const char *name, const QVariant &value)
+QPixmap QS60StylePrivate::backgroundTexture()
{
- if (name == QLatin1String("foo")) {
- // BaR
- } else {
- setStyleProperty(name, value);
+ if (!m_background) {
+ QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen,
+ QSize(S60->screenWidthInPixels, S60->screenHeightInPixels), SkinElementFlags());
+ m_background = new QPixmap(background);
}
-}
-
-QVariant QS60StylePrivate::styleProperty_specific(const char *name) const
-{
- if (name == QLatin1String("foo"))
- return QLatin1String("Bar");
- else
- return styleProperty(name);
-}
-
-QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list,
- int index, const QStyleOption *option)
-{
- static const TAknsItemID *idMap[] = {
- &KAknsIIDQsnHighlightColors,
- &KAknsIIDQsnIconColors,
- &KAknsIIDQsnLineColors,
- &KAknsIIDQsnOtherColors,
- &KAknsIIDQsnParentColors,
- &KAknsIIDQsnTextColors
- };
- Q_ASSERT((int)list <= (int)sizeof(idMap)/sizeof(idMap[0]));
- const QColor color = QS60StyleModeSpecifics::colorValue(*idMap[(int) list], index - 1);
- return option ? QS60StylePrivate::stateColor(color, option) : color;
+ return *m_background;
}
// If the public SDK returns compressed images, please let us also uncompress those!
@@ -1118,8 +1177,8 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap
if (displayMode != aTrgBitmap->DisplayMode())
User::Leave(KErrArgument);
- TSize trgSize = aTrgBitmap->SizeInPixels();
- TSize srcSize = aSrcBitmap->SizeInPixels();
+ const TSize trgSize = aTrgBitmap->SizeInPixels();
+ const TSize srcSize = aSrcBitmap->SizeInPixels();
// calculate the valid drawing area
TRect drawRect = aTrgRect;
@@ -1155,14 +1214,14 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap
const TInt drawWidth = drawRect.Width();
const TInt drawHeight = drawRect.Height();
- TRect offsetRect(aTrgRect.iTl, drawRect.iTl);
+ const TRect offsetRect(aTrgRect.iTl, drawRect.iTl);
const TInt yPosOffset = ySkip * offsetRect.Height();
const TInt xPosOffset = xSkip * offsetRect.Width();
if ((displayMode == EGray256) || (displayMode == EColor256)) {
- TInt srcScanLen8 = CFbsBitmap::ScanLineLength(srcSize.iWidth,
+ const TInt srcScanLen8 = CFbsBitmap::ScanLineLength(srcSize.iWidth,
displayMode);
- TInt trgScanLen8 = CFbsBitmap::ScanLineLength(trgSize.iWidth,
+ const TInt trgScanLen8 = CFbsBitmap::ScanLineLength(trgSize.iWidth,
displayMode);
TUint8* trgAddress8 = reinterpret_cast<TUint8*> (trgAddress);
@@ -1172,7 +1231,7 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap
trgAddress8 += trgScanLen8 * drawRect.iTl.iY + drawRect.iTl.iX;
for (TInt y = 0; y < drawHeight; y++) {
- TUint8* srcAddress8 = reinterpret_cast<TUint8*> (srcAddress)
+ const TUint8* srcAddress8 = reinterpret_cast<const TUint8*> (srcAddress)
+ (srcScanLen8 * (yPos >> 8));
TInt xPos = xPosOffset;
@@ -1186,9 +1245,9 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap
trgAddress8 += trgScanLen8 - drawWidth;
}
} else if (displayMode == EColor4K || displayMode == EColor64K) {
- TInt srcScanLen16 = CFbsBitmap::ScanLineLength(srcSize.iWidth,
+ const TInt srcScanLen16 = CFbsBitmap::ScanLineLength(srcSize.iWidth,
displayMode) >>1;
- TInt trgScanLen16 = CFbsBitmap::ScanLineLength(trgSize.iWidth,
+ const TInt trgScanLen16 = CFbsBitmap::ScanLineLength(trgSize.iWidth,
displayMode) >>1;
TUint16* trgAddress16 = reinterpret_cast<TUint16*> (trgAddress);
@@ -1198,7 +1257,7 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap
trgAddress16 += trgScanLen16 * drawRect.iTl.iY + drawRect.iTl.iX;
for (TInt y = 0; y < drawHeight; y++) {
- TUint16* srcAddress16 = reinterpret_cast<TUint16*> (srcAddress)
+ const TUint16* srcAddress16 = reinterpret_cast<const TUint16*> (srcAddress)
+ (srcScanLen16 * (yPos >> 8));
TInt xPos = xPosOffset;
@@ -1212,9 +1271,9 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap
trgAddress16 += trgScanLen16 - drawWidth;
}
} else if (displayMode == EColor16MU || displayMode == EColor16MA) {
- TInt srcScanLen32 = CFbsBitmap::ScanLineLength(srcSize.iWidth,
+ const TInt srcScanLen32 = CFbsBitmap::ScanLineLength(srcSize.iWidth,
displayMode) >>2;
- TInt trgScanLen32 = CFbsBitmap::ScanLineLength(trgSize.iWidth,
+ const TInt trgScanLen32 = CFbsBitmap::ScanLineLength(trgSize.iWidth,
displayMode) >>2;
TUint32* trgAddress32 = reinterpret_cast<TUint32*> (trgAddress);
@@ -1224,7 +1283,7 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap
trgAddress32 += trgScanLen32 * drawRect.iTl.iY + drawRect.iTl.iX;
for (TInt y = 0; y < drawHeight; y++) {
- TUint32* srcAddress32 = reinterpret_cast<TUint32*> (srcAddress)
+ const TUint32* srcAddress32 = reinterpret_cast<const TUint32*> (srcAddress)
+ (srcScanLen32 * (yPos >> 8));
TInt xPos = xPosOffset;
@@ -1244,8 +1303,8 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap
QSize QS60StylePrivate::screenSize()
{
- TSize mySize = QS60Data::screenDevice()->SizeInPixels();
- return QSize(mySize.iWidth, mySize.iHeight);
+ const TSize screenSize = QS60Data::screenDevice()->SizeInPixels();
+ return QSize(screenSize.iWidth, screenSize.iHeight);
}
void QS60StyleModeSpecifics::colorGroupAndIndex(
@@ -1253,30 +1312,34 @@ void QS60StyleModeSpecifics::colorGroupAndIndex(
{
switch(skinID) {
case QS60StyleEnums::SP_QgnIndiSubMenu:
- case QS60StyleEnums::SP_QgnIndiHlColSuper:
- case QS60StyleEnums::SP_QgnIndiHlExpSuper:
- case QS60StyleEnums::SP_QgnIndiHlLineBranch:
- case QS60StyleEnums::SP_QgnIndiHlLineEnd:
- case QS60StyleEnums::SP_QgnIndiHlLineStraight:
+ colorGroup = KAknsIIDQsnIconColors;
+ colorIndex = EAknsCIQsnIconColorsCG1;
+ break;
case QS60StyleEnums::SP_QgnIndiRadiobuttOff:
case QS60StyleEnums::SP_QgnIndiRadiobuttOn:
case QS60StyleEnums::SP_QgnIndiCheckboxOff:
case QS60StyleEnums::SP_QgnIndiCheckboxOn:
colorGroup = KAknsIIDQsnIconColors;
- colorIndex = EAknsCIQsnIconColorsCG1;
+ colorIndex = EAknsCIQsnIconColorsCG14;
break;
default:
break;
}
}
+/*!
+ Constructs a QS60Style object.
+*/
+QS60Style::QS60Style()
+ : QCommonStyle(*new QS60StylePrivate)
+{
+}
+
void QS60Style::handleDynamicLayoutVariantSwitch()
{
Q_D(QS60Style);
- d->clearCaches();
-#ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED
+ d->clearCaches(QS60StylePrivate::CC_LayoutChange);
d->setActiveLayout();
-#endif // QT_S60STYLE_LAYOUTDATA_SIMULATED
d->refreshUI();
d->setBackgroundTexture(qApp);
foreach (QWidget *widget, QApplication::allWidgets())
@@ -1286,11 +1349,12 @@ void QS60Style::handleDynamicLayoutVariantSwitch()
void QS60Style::handleSkinChange()
{
Q_D(QS60Style);
- d->clearCaches();
+ d->clearCaches(QS60StylePrivate::CC_ThemeChange);
d->setThemePalette(qApp);
foreach (QWidget *topLevelWidget, QApplication::allWidgets()){
QEvent e(QEvent::StyleChange);
QApplication::sendEvent(topLevelWidget, &e);
+ d->setThemePalette(topLevelWidget);
topLevelWidget->ensurePolished();
}
}
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
index 5a88f9a..684f232 100644
--- a/src/gui/styles/qs60style_simulated.cpp
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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$
**
****************************************************************************/
@@ -21,11 +51,117 @@
#include "qlayout.h"
#include "qpixmapcache.h"
#include "qmetaobject.h"
+#include "qdebug.h"
+#include "qbuffer.h"
+#include "qdesktopwidget.h"
#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN)
QT_BEGIN_NAMESPACE
+static const quint32 blobVersion = 1;
+static const int pictureSize = 256;
+
+#if defined(Q_CC_GNU)
+#if __GNUC__ >= 2
+#define __FUNCTION__ __func__
+#endif
+#endif
+
+
+bool saveThemeToBlob(const QString &themeBlob,
+ const QHash<QString, QPicture> &partPictures,
+ const QHash<QPair<QString, int>, QColor> &colors)
+{
+ QFile blob(themeBlob);
+ if (!blob.open(QIODevice::WriteOnly)) {
+ qWarning() << __FUNCTION__ << ": Could not create blob: " << themeBlob;
+ return false;
+ }
+
+ QByteArray data;
+ QBuffer dataBuffer(&data);
+ dataBuffer.open(QIODevice::WriteOnly);
+ QDataStream dataOut(&dataBuffer);
+
+ const int colorsCount = colors.count();
+ dataOut << colorsCount;
+ const QList<QPair<QString, int> > colorKeys = colors.keys();
+ for (int i = 0; i < colorsCount; ++i) {
+ const QPair<QString, int> &key = colorKeys.at(i);
+ dataOut << key;
+ const QColor color = colors.value(key);
+ dataOut << color;
+ }
+
+ const int picturesCount = partPictures.count();
+ dataOut << picturesCount;
+ foreach (const QString &key, partPictures.keys()) {
+ const QPicture picture = partPictures.value(key);
+ dataOut << key;
+ dataOut << picture;
+ }
+
+ QDataStream blobOut(&blob);
+ blobOut << blobVersion;
+ blobOut << qCompress(data);
+ return blobOut.status() == QDataStream::Ok;
+}
+
+bool loadThemeFromBlob(const QString &themeBlob,
+ QHash<QString, QPicture> &partPictures,
+ QHash<QPair<QString, int>, QColor> &colors)
+{
+ QFile blob(themeBlob);
+ if (!blob.open(QIODevice::ReadOnly)) {
+ qWarning() << __FUNCTION__ << ": Could not read blob: " << themeBlob;
+ return false;
+ }
+ QDataStream blobIn(&blob);
+
+ quint32 version;
+ blobIn >> version;
+
+ if (version != blobVersion) {
+ qWarning() << __FUNCTION__ << ": Invalid blob version: " << version << " ...expected: " << blobVersion;
+ return false;
+ }
+
+ QByteArray data;
+ blobIn >> data;
+ data = qUncompress(data);
+ QBuffer dataBuffer(&data);
+ dataBuffer.open(QIODevice::ReadOnly);
+ QDataStream dataIn(&dataBuffer);
+
+ int colorsCount;
+ dataIn >> colorsCount;
+ for (int i = 0; i < colorsCount; ++i) {
+ QPair<QString, int> key;
+ dataIn >> key;
+ QColor value;
+ dataIn >> value;
+ colors.insert(key, value);
+ }
+
+ int picturesCount;
+ dataIn >> picturesCount;
+ for (int i = 0; i < picturesCount; ++i) {
+ QString key;
+ dataIn >> key;
+ QPicture value;
+ dataIn >> value;
+ value.setBoundingRect(QRect(0, 0, pictureSize, pictureSize)); // Bug? The forced bounding rect was not deserialized.
+ partPictures.insert(key, value);
+ }
+
+ if (dataIn.status() != QDataStream::Ok) {
+ qWarning() << __FUNCTION__ << ": Invalid data blob: " << themeBlob;
+ return false;
+ }
+ return true;
+}
+
class QS60StyleModeSpecifics
{
public:
@@ -42,19 +178,6 @@ QS60StylePrivate::QS60StylePrivate()
setCurrentLayout(0);
}
-QS60StylePrivate::~QS60StylePrivate()
-{
-}
-
-short QS60StylePrivate::pixelMetric(int metric)
-{
- Q_ASSERT(metric < MAX_PIXELMETRICS);
- const short returnValue = m_pmPointer[metric];
- if (returnValue==-909)
- return -1;
- return returnValue;
-}
-
QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list,
int index, const QStyleOption *option)
{
@@ -106,9 +229,10 @@ QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part, const QSize &size
QPixmap result = QPixmap::fromImage(partImage);
if (flags & SF_StateDisabled) {
- // TODO: fix this
QStyleOption opt;
-// opt.palette = q->standardPalette();
+ QPalette *themePalette = QS60StylePrivate::themePalette();
+ if (themePalette)
+ opt.palette = *themePalette;
result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt);
}
@@ -150,7 +274,8 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size,
const QRect leftRect = rightRect.translated(cornerWidth - rectWidth, 0);
const QRect centerRect = drawOnlyCenter ? rect : rect.adjusted(cornerWidth, cornerWidth, -cornerWidth, -cornerWidth);
- QImage result(size, QImage::Format_ARGB32);
+ QPixmap result(size);
+ result.fill(Qt::transparent);
QPainter painter(&result);
#if 0
@@ -178,7 +303,7 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size,
drawPart(center, &painter, centerRect, flags);
#endif
- return QPixmap::fromImage(result);
+ return result;
}
void QS60StylePrivate::setStyleProperty_specific(const char *name, const QVariant &value)
@@ -193,23 +318,15 @@ QVariant QS60StylePrivate::styleProperty_specific(const char *name) const
QPixmap QS60StylePrivate::backgroundTexture()
{
- static QPixmap result;
- // Poor mans caching. + Making sure that there is always only one background image in memory at a time
-
-/*
- TODO: 1) Hold the background QPixmap as pointer in a static class member.
- Also add a deleteBackground() function and call that in ~QS60StylePrivate()
- 2) Don't cache the background at all as soon as we have native pixmap support
-*/
-
- if (!m_backgroundValid) {
- result = QPixmap();
- result = part(QS60StyleEnums::SP_QsnBgScreen, QApplication::activeWindow()->size());
- m_backgroundValid = true;
+ if (!m_background) {
+ const QSize size = QApplication::desktop()->screen()->size();
+ QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen, size);
+ m_background = new QPixmap(background);
}
- return result;
+ return *m_background;
}
+
bool QS60StylePrivate::isTouchSupported()
{
#ifdef QT_KEYPAD_NAVIGATION
@@ -224,7 +341,6 @@ bool QS60StylePrivate::isToolBarBackground()
return true;
}
-
QFont QS60StylePrivate::s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize)
{
QFont result;
@@ -244,6 +360,18 @@ QFont QS60StylePrivate::s60Font_specific(QS60StyleEnums::FontCategories fontCate
return result;
}
+/*!
+ Constructs a QS60Style object.
+*/
+QS60Style::QS60Style()
+ : QCommonStyle(*new QS60StylePrivate)
+{
+ // Assume, that the resource system has a ':/s60Stylethemes/Default.blob'
+ const QString defaultBlob = QString::fromLatin1(":/s60Stylethemes/Default.blob");
+ if (QFile::exists(defaultBlob))
+ loadS60ThemeFromBlob(defaultBlob);
+}
+
Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, enumPartKeys, {
const int enumIndex = QS60StyleEnums::staticMetaObject.indexOfEnumerator("SkinParts");
Q_ASSERT(enumIndex >= 0);
@@ -285,8 +413,35 @@ QStringList QS60Style::colorListKeys()
void QS60Style::setS60Theme(const QHash<QString, QPicture> &parts,
const QHash<QPair<QString , int>, QColor> &colors)
{
+ Q_D(QS60Style);
QS60StyleModeSpecifics::m_partPictures = parts;
QS60StyleModeSpecifics::m_colors = colors;
+ d->clearCaches(QS60StylePrivate::CC_ThemeChange);
+ d->setBackgroundTexture(qApp);
+ d->setThemePalette(qApp);
+}
+
+bool QS60Style::loadS60ThemeFromBlob(const QString &blobFile)
+{
+ QHash<QString, QPicture> partPictures;
+ QHash<QPair<QString, int>, QColor> colors;
+
+ if (!loadThemeFromBlob(blobFile, partPictures, colors))
+ return false;
+ setS60Theme(partPictures, colors);
+ return true;
+}
+
+bool QS60Style::saveS60ThemeToBlob(const QString &blobFile) const
+{
+ return saveThemeToBlob(blobFile,
+ QS60StyleModeSpecifics::m_partPictures, QS60StyleModeSpecifics::m_colors);
+}
+
+QPoint qt_s60_fill_background_offset(const QWidget *targetWidget)
+{
+ Q_UNUSED(targetWidget)
+ return QPoint();
}
QT_END_NAMESPACE
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 714b8c5..bd80bb6 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -5252,9 +5252,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/styles/styles.pri b/src/gui/styles/styles.pri
index 9aa170e..050d81d 100644
--- a/src/gui/styles/styles.pri
+++ b/src/gui/styles/styles.pri
@@ -160,9 +160,8 @@ contains( styles, s60 ) {
styles/qs60style.h \
styles/qs60style_p.h
SOURCES += styles/qs60style.cpp
- DEFINES += QT_S60STYLE_LAYOUTDATA_SIMULATED
symbian {
- SOURCES += styles/qs60style_symbian.cpp
+ SOURCES += styles/qs60style_s60.cpp
# TODO: fix the following LIBS hack. Line 1 is for armv5, 2 for winscw
LIBS += aknicon aknskins aknskinsrv fontutils
LIBS += -laknicon -laknskins -laknskinsrv -lfontutils
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index 5a97086..0bd2d9a 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -1162,13 +1162,20 @@ static bool setFontWeightFromValue(const Value &value, QFont *font)
return true;
}
-static bool setFontFamilyFromValues(const QVector<Value> &values, QFont *font)
+/** \internal
+ * parse the font family from the values (starting from index \a start)
+ * and set it the \a font
+ * \returns true if a family was extracted.
+ */
+static bool setFontFamilyFromValues(const QVector<Value> &values, QFont *font, int start = 0)
{
QString family;
- for (int i = 0; i < values.count(); ++i) {
+ for (int i = start; i < values.count(); ++i) {
const Value &v = values.at(i);
- if (v.type == Value::TermOperatorComma)
- break;
+ if (v.type == Value::TermOperatorComma) {
+ family += QLatin1Char(',');
+ continue;
+ }
const QString str = v.variant.toString();
if (str.isEmpty())
break;
@@ -1222,9 +1229,7 @@ static void parseShorthandFontProperty(const QVector<Value> &values, QFont *font
}
if (i < values.count()) {
- QString fam = values.at(i).variant.toString();
- if (!fam.isEmpty())
- font->setFamily(fam);
+ setFontFamilyFromValues(values, font, i);
}
}
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 6ee1d03..e324db6 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -173,8 +173,7 @@ Q_GUI_EXPORT int qt_defaultDpiX()
screen = subScreens.at(0);
dpi = qRound(screen->width() / (screen->physicalWidth() / qreal(25.4)));
#elif defined(Q_WS_S60)
- const TReal inchWidth = (TReal)S60->screenWidthInTwips / KTwipsPerInch;
- dpi = S60->screenWidthInPixels / inchWidth;
+ dpi = S60->defaultDpiX;
#endif // Q_WS_X11
return dpi;
@@ -202,8 +201,7 @@ Q_GUI_EXPORT int qt_defaultDpiY()
screen = subScreens.at(0);
dpi = qRound(screen->height() / (screen->physicalHeight() / qreal(25.4)));
#elif defined(Q_WS_S60)
- const TReal inchHeight = (TReal)S60->screenHeightInTwips / KTwipsPerInch;
- dpi = S60->screenHeightInPixels / inchHeight;
+ dpi = S60->defaultDpiY;
#endif // Q_WS_X11
return dpi;
@@ -316,7 +314,7 @@ QFontPrivate *QFontPrivate::smallCapsFontPrivate() const
font.setPointSizeF(pointSize * .7);
else
font.setPixelSize((font.pixelSize() * 7 + 5) / 10);
- scFont = font.d;
+ scFont = font.d.data();
if (scFont != this)
scFont->ref.ref();
return scFont;
@@ -723,12 +721,11 @@ QFont::QFont(const QFont &font, QPaintDevice *pd)
const int screen = 0;
#endif
if (font.d->dpi != dpi || font.d->screen != screen ) {
- d = new QFontPrivate(*font.d);
+ d.reset(new QFontPrivate(*font.d));
d->dpi = dpi;
d->screen = screen;
} else {
- d = font.d;
- d->ref.ref();
+ d.assign(font.d.data());
}
#ifdef Q_WS_WIN
if (pd->devType() == QInternal::Printer && pd->getDC())
@@ -742,8 +739,7 @@ QFont::QFont(const QFont &font, QPaintDevice *pd)
QFont::QFont(QFontPrivate *data)
: resolve_mask(QFont::AllPropertiesResolved)
{
- d = data;
- d->ref.ref();
+ d.assign(data);
}
/*! \internal
@@ -755,13 +751,13 @@ void QFont::detach()
if (d->engineData)
d->engineData->ref.deref();
d->engineData = 0;
- if (d->scFont && d->scFont != d)
+ if (d->scFont && d->scFont != d.data())
d->scFont->ref.deref();
d->scFont = 0;
return;
}
- qAtomicDetach(d);
+ d.detach();
}
/*!
@@ -770,9 +766,9 @@ void QFont::detach()
\sa QApplication::setFont(), QApplication::font()
*/
QFont::QFont()
- :d(QApplication::font().d), resolve_mask(0)
+ :resolve_mask(0)
{
- d->ref.ref();
+ d.assign(QApplication::font().d.data());
}
/*!
@@ -792,13 +788,12 @@ QFont::QFont()
setStyleHint() QApplication::font()
*/
QFont::QFont(const QString &family, int pointSize, int weight, bool italic)
- :d(new QFontPrivate)
{
+ d.reset(new QFontPrivate());
resolve_mask = QFont::FamilyResolved;
if (pointSize <= 0) {
#ifdef Q_WS_S60
- // TODO: What should the default QFont pointSize for Q_WS_S60 be?
pointSize = 7;
#else
pointSize = 12;
@@ -825,8 +820,7 @@ QFont::QFont(const QString &family, int pointSize, int weight, bool italic)
*/
QFont::QFont(const QFont &font)
{
- d = font.d;
- d->ref.ref();
+ d.assign(font.d.data());
resolve_mask = font.resolve_mask;
}
@@ -835,8 +829,6 @@ QFont::QFont(const QFont &font)
*/
QFont::~QFont()
{
- if (!d->ref.deref())
- delete d;
}
/*!
@@ -844,7 +836,7 @@ QFont::~QFont()
*/
QFont &QFont::operator=(const QFont &font)
{
- qAtomicAssign(d, font.d);
+ d.assign(font.d.data());
resolve_mask = font.resolve_mask;
return *this;
}
@@ -1727,7 +1719,7 @@ QFont QFont::resolve(const QFont &other) const
QFont font(*this);
font.detach();
- font.d->resolve(resolve_mask, other.d);
+ font.d->resolve(resolve_mask, other.d.data());
return font;
}
@@ -1911,6 +1903,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.
@@ -2166,11 +2172,11 @@ QDataStream &operator<<(QDataStream &s, const QFont &font)
s << (quint8) font.d->request.styleStrategy;
s << (quint8) 0
<< (quint8) font.d->request.weight
- << get_font_bits(s.version(), font.d);
+ << get_font_bits(s.version(), font.d.data());
if (s.version() >= QDataStream::Qt_4_3)
s << (quint16)font.d->request.stretch;
if (s.version() >= QDataStream::Qt_4_4)
- s << get_extended_font_bits(font.d);
+ s << get_extended_font_bits(font.d.data());
if (s.version() >= QDataStream::Qt_4_5) {
s << font.d->letterSpacing.value();
s << font.d->wordSpacing.value();
@@ -2189,10 +2195,8 @@ QDataStream &operator<<(QDataStream &s, const QFont &font)
*/
QDataStream &operator>>(QDataStream &s, QFont &font)
{
- if (!font.d->ref.deref())
- delete font.d;
-
- font.d = new QFontPrivate;
+ font.d.assign(0);
+ font.d.reset(new QFontPrivate);
font.resolve_mask = QFont::AllPropertiesResolved;
quint8 styleHint, styleStrategy = QFont::PreferDefault, charSet, weight, bits;
@@ -2233,7 +2237,7 @@ QDataStream &operator>>(QDataStream &s, QFont &font)
font.d->request.styleStrategy = styleStrategy;
font.d->request.weight = weight;
- set_font_bits(s.version(), bits, font.d);
+ set_font_bits(s.version(), bits, font.d.data());
if (s.version() >= QDataStream::Qt_4_3) {
quint16 stretch;
@@ -2244,7 +2248,7 @@ QDataStream &operator>>(QDataStream &s, QFont &font)
if (s.version() >= QDataStream::Qt_4_4) {
quint8 extendedBits;
s >> extendedBits;
- set_extended_font_bits(extendedBits, font.d);
+ set_extended_font_bits(extendedBits, font.d.data());
}
if (s.version() >= QDataStream::Qt_4_5) {
int value;
@@ -2326,7 +2330,7 @@ QDataStream &operator>>(QDataStream &s, QFont &font)
that is not screen-compatible.
*/
QFontInfo::QFontInfo(const QFont &font)
- : d(font.d)
+ : d(font.d.data())
{ d->ref.ref(); }
/*!
@@ -2599,7 +2603,14 @@ QFontCache *QFontCache::instance()
void QFontCache::cleanup()
{
- theFontCache()->setLocalData(0);
+ QThreadStorage<QFontCache *> *cache = 0;
+ QT_TRY {
+ cache = theFontCache();
+ } QT_CATCH (const std::bad_alloc &) {
+ // no cache - just ignore
+ }
+ if (cache && cache->hasLocalData())
+ cache->setLocalData(0);
}
#endif // QT_NO_THREAD
@@ -2612,8 +2623,8 @@ QFontCache::QFontCache()
QFontCache::~QFontCache()
{
{
- EngineDataCache::Iterator it = engineDataCache.begin(),
- end = engineDataCache.end();
+ EngineDataCache::ConstIterator it = engineDataCache.constBegin(),
+ end = engineDataCache.constEnd();
while (it != end) {
if (it.value()->ref == 0)
delete it.value();
@@ -2623,8 +2634,8 @@ QFontCache::~QFontCache()
++it;
}
}
- EngineCache::Iterator it = engineCache.begin(),
- end = engineCache.end();
+ EngineCache::ConstIterator it = engineCache.constBegin(),
+ end = engineCache.constEnd();
while (it != end) {
if (--it.value().data->cache_count == 0) {
if (it.value().data->ref == 0) {
diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h
index eec83b5..a513b7a 100644
--- a/src/gui/text/qfont.h
+++ b/src/gui/text/qfont.h
@@ -44,6 +44,7 @@
#include <QtGui/qwindowdefs.h>
#include <QtCore/qstring.h>
+#include <QtCore/qscopedpointer.h>
#if defined(Q_WS_X11) || defined(Q_WS_QWS)
typedef struct FT_FaceRec_* FT_Face;
@@ -312,7 +313,7 @@ private:
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QFont &);
#endif
- QFontPrivate *d;
+ QScopedSharedPointer<QFontPrivate> d;
uint resolve_mask;
};
diff --git a/src/gui/text/qfont_s60.cpp b/src/gui/text/qfont_s60.cpp
index 2606091..533e51f 100644
--- a/src/gui/text/qfont_s60.cpp
+++ b/src/gui/text/qfont_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/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 1345d21..416017d 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -167,10 +167,13 @@ QtFontEncoding *QtFontSize::encodingID(int id, uint xpoint, uint xres,
if (!add) return 0;
- if (!(count % 4))
- encodings = (QtFontEncoding *)
+ if (!(count % 4)) {
+ QtFontEncoding *newEncodings = (QtFontEncoding *)
realloc(encodings,
(((count+4) >> 2) << 2) * sizeof(QtFontEncoding));
+ Q_CHECK_PTR(newEncodings);
+ encodings = newEncodings;
+ }
encodings[count].encoding = id;
encodings[count].xpoint = xpoint;
encodings[count].xres = xres;
@@ -274,10 +277,13 @@ QtFontSize *QtFontStyle::pixelSize(unsigned short size, bool add)
if (!add)
return 0;
- if (!(count % 8))
- pixelSizes = (QtFontSize *)
+ if (!(count % 8)) {
+ QtFontSize *newPixelSizes = (QtFontSize *)
realloc(pixelSizes,
(((count+8) >> 3) << 3) * sizeof(QtFontSize));
+ Q_CHECK_PTR(newPixelSizes);
+ pixelSizes = newPixelSizes;
+ }
pixelSizes[count].pixelSize = size;
#ifdef Q_WS_X11
pixelSizes[count].count = 0;
@@ -328,12 +334,16 @@ QtFontStyle *QtFontFoundry::style(const QtFontStyle::Key &key, bool create)
return 0;
// qDebug("adding key (weight=%d, style=%d, oblique=%d stretch=%d) at %d", key.weight, key.style, key.oblique, key.stretch, pos);
- if (!(count % 8))
- styles = (QtFontStyle **)
+ if (!(count % 8)) {
+ QtFontStyle **newStyles = (QtFontStyle **)
realloc(styles, (((count+8) >> 3) << 3) * sizeof(QtFontStyle *));
+ Q_CHECK_PTR(newStyles);
+ styles = newStyles;
+ }
+ QtFontStyle *style = new QtFontStyle(key);
memmove(styles + pos + 1, styles + pos, (count-pos)*sizeof(QtFontStyle *));
- styles[pos] = new QtFontStyle(key);
+ styles[pos] = style;
count++;
return styles[pos];
}
@@ -438,10 +448,13 @@ QtFontFoundry *QtFontFamily::foundry(const QString &f, bool create)
if (!create)
return 0;
- if (!(count % 8))
- foundries = (QtFontFoundry **)
+ if (!(count % 8)) {
+ QtFontFoundry **newFoundries = (QtFontFoundry **)
realloc(foundries,
(((count+8) >> 3) << 3) * sizeof(QtFontFoundry *));
+ Q_CHECK_PTR(newFoundries);
+ foundries = newFoundries;
+ }
foundries[count] = new QtFontFoundry(f);
return foundries[count++];
@@ -684,13 +697,17 @@ QtFontFamily *QFontDatabasePrivate::family(const QString &f, bool create)
pos++;
// qDebug("adding family %s at %d total=%d", f.latin1(), pos, count);
- if (!(count % 8))
- families = (QtFontFamily **)
+ if (!(count % 8)) {
+ QtFontFamily **newFamilies = (QtFontFamily **)
realloc(families,
(((count+8) >> 3) << 3) * sizeof(QtFontFamily *));
+ Q_CHECK_PTR(newFamilies);
+ families = newFamilies;
+ }
+ QtFontFamily *family = new QtFontFamily(f);
memmove(families + pos + 1, families + pos, (count-pos)*sizeof(QtFontFamily *));
- families[pos] = new QtFontFamily(f);
+ families[pos] = family;
count++;
return families[pos];
}
@@ -969,6 +986,7 @@ static void getEngineData(const QFontPrivate *d, const QFontCache::Key &key)
d->engineData->ref.ref();
}
}
+#endif
static QStringList familyList(const QFontDef &req)
{
@@ -997,7 +1015,6 @@ static QStringList familyList(const QFontDef &req)
return family_list;
}
-#endif
Q_GLOBAL_STATIC(QFontDatabasePrivate, privateDb)
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, fontDatabaseMutex, (QMutex::Recursive))
diff --git a/src/gui/text/qfontdatabase_mac.cpp b/src/gui/text/qfontdatabase_mac.cpp
index 80ddbd5..26d8687 100644
--- a/src/gui/text/qfontdatabase_mac.cpp
+++ b/src/gui/text/qfontdatabase_mac.cpp
@@ -281,14 +281,7 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
}
//find the font
- QStringList family_list = req.family.split(QLatin1Char(','));
- // append the substitute list for each family in family_list
- {
- QStringList subs_list;
- for(QStringList::ConstIterator it = family_list.constBegin(); it != family_list.constEnd(); ++it)
- subs_list += QFont::substitutes(*it);
- family_list += subs_list;
- }
+ QStringList family_list = familyList(req);
const char *stylehint = styleHint(req);
if (stylehint)
diff --git a/src/gui/text/qfontdatabase_qws.cpp b/src/gui/text/qfontdatabase_qws.cpp
index 33b0728..978ff8e 100644
--- a/src/gui/text/qfontdatabase_qws.cpp
+++ b/src/gui/text/qfontdatabase_qws.cpp
@@ -566,8 +566,8 @@ QFontEngine *loadSingleEngine(int script, const QFontPrivate *fp,
QFontEngineQPF *fe = new QFontEngineQPF(request, res.data(), res.size());
if (fe->isValid())
return fe;
- qDebug() << "fontengine is not valid! " << size->fileName;
delete fe;
+ qDebug() << "fontengine is not valid! " << size->fileName;
} else {
qDebug() << "Resource not valid" << size->fileName;
}
@@ -577,8 +577,8 @@ QFontEngine *loadSingleEngine(int script, const QFontPrivate *fp,
QFontEngineQPF *fe = new QFontEngineQPF(request, f);
if (fe->isValid())
return fe;
- qDebug() << "fontengine is not valid!";
delete fe; // will close f
+ qDebug() << "fontengine is not valid!";
}
#endif
} else
@@ -592,70 +592,67 @@ QFontEngine *loadSingleEngine(int script, const QFontPrivate *fp,
static bool dontShareFonts = !qgetenv("QWS_NO_SHARE_FONTS").isEmpty();
bool shareFonts = !dontShareFonts;
- QFontEngine *engine = 0;
+ QScopedPointer<QFontEngine> engine;
#ifndef QT_NO_LIBRARY
QFontEngineFactoryInterface *factory = qobject_cast<QFontEngineFactoryInterface *>(loader()->instance(foundry->name));
- if (factory) {
- QFontEngineInfo info;
- info.setFamily(request.family);
- info.setPixelSize(request.pixelSize);
- info.setStyle(QFont::Style(request.style));
- info.setWeight(request.weight);
- // #### antialiased
-
- QAbstractFontEngine *customEngine = factory->create(info);
- if (customEngine) {
- engine = new QProxyFontEngine(customEngine, def);
-
- if (shareFonts) {
- QVariant hint = customEngine->fontProperty(QAbstractFontEngine::CacheGlyphsHint);
- if (hint.isValid())
- shareFonts = hint.toBool();
- else
- shareFonts = (pixelSize < 64);
- }
+ if (factory) {
+ QFontEngineInfo info;
+ info.setFamily(request.family);
+ info.setPixelSize(request.pixelSize);
+ info.setStyle(QFont::Style(request.style));
+ info.setWeight(request.weight);
+ // #### antialiased
+
+ QAbstractFontEngine *customEngine = factory->create(info);
+ if (customEngine) {
+ engine.reset(new QProxyFontEngine(customEngine, def));
+
+ if (shareFonts) {
+ QVariant hint = customEngine->fontProperty(QAbstractFontEngine::CacheGlyphsHint);
+ if (hint.isValid())
+ shareFonts = hint.toBool();
+ else
+ shareFonts = (pixelSize < 64);
}
+ }
}
#endif // QT_NO_LIBRARY
- if (!engine && !file.isEmpty() && QFile::exists(file) || privateDb()->isApplicationFont(file)) {
+ if ((engine.isNull() && !file.isEmpty() && QFile::exists(file)) || privateDb()->isApplicationFont(file)) {
QFontEngine::FaceId faceId;
faceId.filename = file.toLocal8Bit();
faceId.index = size->fileIndex;
#ifndef QT_NO_FREETYPE
- QFontEngineFT *fte = new QFontEngineFT(def);
+ QScopedPointer<QFontEngineFT> fte(new QFontEngineFT(def));
if (fte->init(faceId, style->antialiased,
style->antialiased ? QFontEngineFT::Format_A8 : QFontEngineFT::Format_Mono)) {
#ifdef QT_NO_QWS_QPF2
- return fte;
+ return fte.take();
#else
- engine = fte;
// try to distinguish between bdf and ttf fonts we can pre-render
// and don't try to share outline fonts
shareFonts = shareFonts
&& !fte->defaultGlyphs()->outline_drawing
&& !fte->getSfntTable(MAKE_TAG('h', 'e', 'a', 'd')).isEmpty();
+ engine.reset(fte.take());
#endif
- } else {
- delete fte;
}
#endif // QT_NO_FREETYPE
}
- if (engine) {
+ if (!engine.isNull()) {
#if !defined(QT_NO_QWS_QPF2) && !defined(QT_FONTS_ARE_RESOURCES)
if (shareFonts) {
- QFontEngineQPF *fe = new QFontEngineQPF(def, -1, engine);
- engine = 0;
+ QScopedPointer<QFontEngineQPF> fe(new QFontEngineQPF(def, -1, engine.data()));
+ engine.take();
if (fe->isValid())
- return fe;
+ return fe.take();
qWarning("Initializing QFontEngineQPF failed for %s", qPrintable(file));
- engine = fe->takeRenderingEngine();
- delete fe;
+ engine.reset(fe->takeRenderingEngine());
}
#endif
- return engine;
+ return engine.take();
}
} else
{
@@ -682,20 +679,22 @@ QFontEngine *loadEngine(int script, const QFontPrivate *fp,
QtFontFamily *family, QtFontFoundry *foundry,
QtFontStyle *style, QtFontSize *size)
{
- QFontEngine *fe = loadSingleEngine(script, fp, request, family, foundry,
- style, size);
- if (fe
+ QScopedPointer<QFontEngine> engine(loadSingleEngine(script, fp, request, family, foundry,
+ style, size));
+ if (!engine.isNull()
&& script == QUnicodeTables::Common
- && !(request.styleStrategy & QFont::NoFontMerging) && !fe->symbol) {
+ && !(request.styleStrategy & QFont::NoFontMerging) && !engine->symbol) {
QStringList fallbacks = privateDb()->fallbackFamilies;
if (family && !family->fallbackFamilies.isEmpty())
fallbacks = family->fallbackFamilies;
- fe = new QFontEngineMultiQWS(fe, script, fallbacks);
+ QFontEngine *fe = new QFontEngineMultiQWS(engine.data(), script, fallbacks);
+ engine.take();
+ engine.reset(fe);
}
- return fe;
+ return engine.take();
}
static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt)
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index 0b4567c..416c3d1 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -25,6 +55,39 @@
QT_BEGIN_NAMESPACE
+QFileInfoList alternativeFilePaths(const QString &path, const QStringList &nameFilters,
+ QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort,
+ bool uniqueFileNames = true)
+{
+ QFileInfoList result;
+
+ // Prepare a 'soft to hard' drive list: W:, X: ... A:, Z:
+ QStringList driveStrings;
+ foreach (const QFileInfo &drive, QDir::drives())
+ driveStrings.append(drive.absolutePath());
+ driveStrings.sort();
+ const QString zDriveString("Z:/");
+ driveStrings.removeAll(zDriveString);
+ driveStrings.prepend(zDriveString);
+
+ QStringList uniqueFileNameList;
+ for (int i = driveStrings.count() - 1; i >= 0; --i) {
+ const QDir dirOnDrive(driveStrings.at(i) + path);
+ const QFileInfoList entriesOnDrive = dirOnDrive.entryInfoList(nameFilters, filters, sort);
+ if (uniqueFileNames) {
+ foreach(const QFileInfo &entry, entriesOnDrive) {
+ if (!uniqueFileNameList.contains(entry.fileName())) {
+ uniqueFileNameList.append(entry.fileName());
+ result.append(entry);
+ }
+ }
+ } else {
+ result.append(entriesOnDrive);
+ }
+ }
+ return result;
+}
+
#if defined(QT_NO_FREETYPE)
class QFontDatabaseS60StoreImplementation : public QFontDatabaseS60Store
{
@@ -47,10 +110,13 @@ QFontDatabaseS60StoreImplementation::QFontDatabaseS60StoreImplementation()
m_store = CFontStore::NewL(m_heap);
m_rasterizer = COpenFontRasterizer::NewL(TUid::Uid(0x101F7F5E));
m_store->InstallRasterizerL(m_rasterizer);
- QDir dir(QDesktopServices::storageLocation(QDesktopServices::FontsLocation));
- dir.setNameFilters(QStringList() << QLatin1String("*.ttf") << QLatin1String("*.ccc"));
- for (int i = 0; i < int(dir.count()); ++i) {
- const QString fontFile = QDir::toNativeSeparators(dir.absoluteFilePath(dir[i]));
+
+ QStringList filters;
+ filters.append(QString::fromLatin1("*.ttf"));
+ filters.append(QString::fromLatin1("*.ccc"));
+ const QFileInfoList fontFiles = alternativeFilePaths(QString::fromLatin1("resource\\Fonts"), filters);
+ foreach (const QFileInfo &fontFileInfo, fontFiles) {
+ const QString fontFile = QDir::toNativeSeparators(fontFileInfo.absoluteFilePath());
m_store->AddFileL(qt_QString2TPtrC(fontFile));
}
}
diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp
index 15e626e..70e1599 100644
--- a/src/gui/text/qfontdatabase_x11.cpp
+++ b/src/gui/text/qfontdatabase_x11.cpp
@@ -494,7 +494,7 @@ static inline bool isFixedPitch(char **tokens)
Fills in a font definition (QFontDef) from an XLFD (X Logical Font
Description).
- Returns true if the the given xlfd is valid.
+ Returns true if the given xlfd is valid.
*/
bool qt_fillFontDef(const QByteArray &xlfd, QFontDef *fd, int dpi, QtFontDesc *desc)
{
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index c2c23ee..2f96984 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -191,18 +191,20 @@ QFontEngine::QFontEngine()
QFontEngine::~QFontEngine()
{
- for (GlyphPointerHash::iterator it = m_glyphPointerHash.begin(), end = m_glyphPointerHash.end();
- it != end; ++it) {
- for (QList<QFontEngineGlyphCache*>::iterator it2 = it.value().begin(), end2 = it.value().end();
- it2 != end2; ++it2)
- delete *it2;
+ for (GlyphPointerHash::const_iterator it = m_glyphPointerHash.constBegin(),
+ end = m_glyphPointerHash.constEnd(); it != end; ++it) {
+ for (QList<QFontEngineGlyphCache*>::const_iterator it2 = it.value().constBegin(),
+ end2 = it.value().constEnd(); it2 != end2; ++it2) {
+ delete *it2;
+ }
}
m_glyphPointerHash.clear();
- for (GlyphIntHash::iterator it = m_glyphIntHash.begin(), end = m_glyphIntHash.end();
- it != end; ++it) {
- for (QList<QFontEngineGlyphCache*>::iterator it2 = it.value().begin(), end2 = it.value().end();
- it2 != end2; ++it2)
- delete *it2;
+ for (GlyphIntHash::const_iterator it = m_glyphIntHash.constBegin(),
+ end = m_glyphIntHash.constEnd(); it != end; ++it) {
+ for (QList<QFontEngineGlyphCache*>::const_iterator it2 = it.value().constBegin(),
+ end2 = it.value().constEnd(); it2 != end2; ++it2) {
+ delete *it2;
+ }
}
m_glyphIntHash.clear();
qHBFreeFace(hbFace);
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 6f5ee1f..f1dac96 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -193,6 +193,9 @@ HB_Error QFreetypeFace::getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 p
/*
* One font file can contain more than one font (bold/italic for example)
* find the right one and return it.
+ *
+ * Returns the freetype face or 0 in case of an empty file or any other problems
+ * (like not being able to open the file)
*/
QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id)
{
@@ -205,7 +208,7 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id)
QFreetypeFace *freetype = freetypeData->faces.value(face_id, 0);
if (!freetype) {
- freetype = new QFreetypeFace;
+ QScopedPointer<QFreetypeFace> newFreetype(new QFreetypeFace);
FT_Face face;
QFile file(QString::fromUtf8(face_id.filename));
if (face_id.filename.startsWith(":qmemoryfonts/")) {
@@ -214,84 +217,82 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id)
QByteArray idx = face_id.filename;
idx.remove(0, 14); // remove ':qmemoryfonts/'
bool ok = false;
- freetype->fontData = qt_fontdata_from_index(idx.toInt(&ok));
+ newFreetype->fontData = qt_fontdata_from_index(idx.toInt(&ok));
if (!ok)
- freetype->fontData = QByteArray();
+ newFreetype->fontData = QByteArray();
} else if (!(file.fileEngine()->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::LocalDiskFlag)) {
if (!file.open(QIODevice::ReadOnly)) {
- delete freetype;
return 0;
}
- freetype->fontData = file.readAll();
+ newFreetype->fontData = file.readAll();
}
- if (!freetype->fontData.isEmpty()) {
- if (FT_New_Memory_Face(freetypeData->library, (const FT_Byte *)freetype->fontData.constData(), freetype->fontData.size(), face_id.index, &face)) {
- delete freetype;
+ if (!newFreetype->fontData.isEmpty()) {
+ if (FT_New_Memory_Face(freetypeData->library, (const FT_Byte *)newFreetype->fontData.constData(), newFreetype->fontData.size(), face_id.index, &face)) {
return 0;
}
} else if (FT_New_Face(freetypeData->library, face_id.filename, face_id.index, &face)) {
- delete freetype;
return 0;
}
- freetype->face = face;
-
- freetype->hbFace = qHBNewFace(face, hb_getSFntTable);
- freetype->ref = 0;
- freetype->xsize = 0;
- freetype->ysize = 0;
- freetype->matrix.xx = 0x10000;
- freetype->matrix.yy = 0x10000;
- freetype->matrix.xy = 0;
- freetype->matrix.yx = 0;
- freetype->unicode_map = 0;
- freetype->symbol_map = 0;
+ newFreetype->face = face;
+
+ newFreetype->hbFace = qHBNewFace(face, hb_getSFntTable);
+ newFreetype->ref = 0;
+ newFreetype->xsize = 0;
+ newFreetype->ysize = 0;
+ newFreetype->matrix.xx = 0x10000;
+ newFreetype->matrix.yy = 0x10000;
+ newFreetype->matrix.xy = 0;
+ newFreetype->matrix.yx = 0;
+ newFreetype->unicode_map = 0;
+ newFreetype->symbol_map = 0;
#ifndef QT_NO_FONTCONFIG
- freetype->charset = 0;
+ newFreetype->charset = 0;
#endif
- memset(freetype->cmapCache, 0, sizeof(freetype->cmapCache));
+ memset(newFreetype->cmapCache, 0, sizeof(newFreetype->cmapCache));
- for (int i = 0; i < freetype->face->num_charmaps; ++i) {
- FT_CharMap cm = freetype->face->charmaps[i];
+ for (int i = 0; i < newFreetype->face->num_charmaps; ++i) {
+ FT_CharMap cm = newFreetype->face->charmaps[i];
switch(cm->encoding) {
case FT_ENCODING_UNICODE:
- freetype->unicode_map = cm;
+ newFreetype->unicode_map = cm;
break;
case FT_ENCODING_APPLE_ROMAN:
case FT_ENCODING_ADOBE_LATIN_1:
- if (!freetype->unicode_map || freetype->unicode_map->encoding != FT_ENCODING_UNICODE)
- freetype->unicode_map = cm;
+ if (!newFreetype->unicode_map || newFreetype->unicode_map->encoding != FT_ENCODING_UNICODE)
+ newFreetype->unicode_map = cm;
break;
case FT_ENCODING_ADOBE_CUSTOM:
case FT_ENCODING_MS_SYMBOL:
- if (!freetype->symbol_map)
- freetype->symbol_map = cm;
+ if (!newFreetype->symbol_map)
+ newFreetype->symbol_map = cm;
break;
default:
break;
}
}
- if (!FT_IS_SCALABLE(freetype->face) && freetype->face->num_fixed_sizes == 1)
- FT_Set_Char_Size (face, X_SIZE(freetype->face, 0), Y_SIZE(freetype->face, 0), 0, 0);
+ if (!FT_IS_SCALABLE(newFreetype->face) && newFreetype->face->num_fixed_sizes == 1)
+ FT_Set_Char_Size (face, X_SIZE(newFreetype->face, 0), Y_SIZE(newFreetype->face, 0), 0, 0);
# if 0
FcChar8 *name;
FcPatternGetString(pattern, FC_FAMILY, 0, &name);
qDebug("%s: using maps: default: %x unicode: %x, symbol: %x", name,
- freetype->face->charmap ? freetype->face->charmap->encoding : 0,
- freetype->unicode_map ? freetype->unicode_map->encoding : 0,
- freetype->symbol_map ? freetype->symbol_map->encoding : 0);
+ newFreetype->face->charmap ? newFreetype->face->charmap->encoding : 0,
+ newFreetype->unicode_map ? newFreetype->unicode_map->encoding : 0,
+ newFreetype->symbol_map ? newFreetype->symbol_map->encoding : 0);
for (int i = 0; i < 256; i += 8)
qDebug(" %x: %d %d %d %d %d %d %d %d", i,
- FcCharSetHasChar(freetype->charset, i), FcCharSetHasChar(freetype->charset, i),
- FcCharSetHasChar(freetype->charset, i), FcCharSetHasChar(freetype->charset, i),
- FcCharSetHasChar(freetype->charset, i), FcCharSetHasChar(freetype->charset, i),
- FcCharSetHasChar(freetype->charset, i), FcCharSetHasChar(freetype->charset, i));
+ FcCharSetHasChar(newFreetype->charset, i), FcCharSetHasChar(newFreetype->charset, i),
+ FcCharSetHasChar(newFreetype->charset, i), FcCharSetHasChar(newFreetype->charset, i),
+ FcCharSetHasChar(newFreetype->charset, i), FcCharSetHasChar(newFreetype->charset, i),
+ FcCharSetHasChar(newFreetype->charset, i), FcCharSetHasChar(newFreetype->charset, i));
#endif
- FT_Set_Charmap(freetype->face, freetype->unicode_map);
- freetypeData->faces.insert(face_id, freetype);
+ FT_Set_Charmap(newFreetype->face, newFreetype->unicode_map);
+ freetypeData->faces.insert(face_id, newFreetype.data());
+ freetype = newFreetype.take();
}
freetype->ref.ref();
return freetype;
@@ -608,6 +609,7 @@ QFontEngineFT::QFontEngineFT(const QFontDef &fd)
kerning_pairs_loaded = false;
transform = false;
antialias = true;
+ freetype = 0;
default_load_flags = 0;
default_hint_style = HintNone;
subpixelType = Subpixel_None;
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index 649d78b..b67895b 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -119,6 +119,7 @@ struct QFreetypeFace
static void addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path, bool = false);
private:
+ friend class QScopedPointer<QFreetypeFace>;
QFreetypeFace() : _lock(QMutex::Recursive) {}
~QFreetypeFace() {}
QAtomicInt ref;
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 425cab2..d397e4a 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_qpf.cpp b/src/gui/text/qfontengine_qpf.cpp
index e9fcac4..435a102 100644
--- a/src/gui/text/qfontengine_qpf.cpp
+++ b/src/gui/text/qfontengine_qpf.cpp
@@ -325,21 +325,21 @@ QFontEngineQPF::QFontEngineQPF(const QFontDef &def, int fileDescriptor, QFontEng
fileName.replace(QLatin1Char(' '), QLatin1Char('_'));
fileName.prepend(qws_fontCacheDir());
- const QByteArray encodedName = QFile::encodeName(fileName);
- if (::access(encodedName, F_OK) == 0) {
+ encodedFileName = QFile::encodeName(fileName);
+ if (::access(encodedFileName, F_OK) == 0) {
#if defined(DEBUG_FONTENGINE)
qDebug() << "found existing qpf:" << fileName;
#endif
- if (::access(encodedName, W_OK | R_OK) == 0)
- fd = ::open(encodedName, O_RDWR);
- else if (::access(encodedName, R_OK) == 0)
- fd = ::open(encodedName, O_RDONLY);
+ if (::access(encodedFileName, W_OK | R_OK) == 0)
+ fd = ::open(encodedFileName, O_RDWR);
+ else if (::access(encodedFileName, R_OK) == 0)
+ fd = ::open(encodedFileName, O_RDONLY);
} else {
#if defined(DEBUG_FONTENGINE)
qDebug() << "creating qpf on the fly:" << fileName;
#endif
if (::access(QFile::encodeName(qws_fontCacheDir()), W_OK) == 0) {
- fd = ::open(encodedName, O_RDWR | O_EXCL | O_CREAT, 0644);
+ fd = ::open(encodedFileName, O_RDWR | O_EXCL | O_CREAT, 0644);
QBuffer buffer;
buffer.open(QIODevice::ReadWrite);
@@ -474,15 +474,21 @@ QFontEngineQPF::QFontEngineQPF(const QFontDef &def, int fileDescriptor, QFontEng
#endif
#if defined(Q_WS_QWS)
if (isValid() && renderingFontEngine)
- qt_fbdpy->sendFontCommand(QWSFontCommand::StartedUsingFont, QFile::encodeName(fileName));
+ qt_fbdpy->sendFontCommand(QWSFontCommand::StartedUsingFont, encodedFileName);
#endif
}
QFontEngineQPF::~QFontEngineQPF()
{
#if defined(Q_WS_QWS)
- if (isValid() && renderingFontEngine)
- qt_fbdpy->sendFontCommand(QWSFontCommand::StoppedUsingFont, QFile::encodeName(fileName));
+ if (isValid() && renderingFontEngine) {
+ QT_TRY {
+ qt_fbdpy->sendFontCommand(QWSFontCommand::StoppedUsingFont, encodedFileName);
+ } QT_CATCH(...) {
+ qDebug("QFontEngineQPF::~QFontEngineQPF: Out of memory");
+ // ignore.
+ }
+ }
#endif
delete renderingFontEngine;
if (fontData)
@@ -1128,6 +1134,11 @@ void QPFGenerator::writeTaggedQFixed(QFontEngineQPF::HeaderTag tag, QFixed value
#endif // QT_NO_QWS_QPF2
+/*
+ Creates a new multi qws engine.
+
+ This function takes ownership of the QFontEngine, increasing it's refcount.
+*/
QFontEngineMultiQWS::QFontEngineMultiQWS(QFontEngine *fe, int _script, const QStringList &fallbacks)
: QFontEngineMulti(fallbacks.size() + 1),
fallbackFamilies(fallbacks), script(_script)
diff --git a/src/gui/text/qfontengine_qpf_p.h b/src/gui/text/qfontengine_qpf_p.h
index a9b87ff..629f5c6 100644
--- a/src/gui/text/qfontengine_qpf_p.h
+++ b/src/gui/text/qfontengine_qpf_p.h
@@ -243,6 +243,7 @@ private:
quint32 glyphDataOffset;
quint32 glyphDataSize;
QString fileName;
+ QByteArray encodedFileName;
bool readOnly;
QFreetypeFace *freetype;
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index eec09f4..2e1abb2 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -197,27 +227,14 @@ QImage QFontEngineS60::alphaMapForGlyph(glyph_t glyph)
glyph_metrics_t QFontEngineS60::boundingBox(const QGlyphLayout &glyphs)
{
- glyph_metrics_t overall;
- // initialize with line height, we get the same behaviour on all platforms
- overall.y = -ascent();
- overall.height = ascent() + descent() + 1;
-
- QFixed ymax = 0;
- QFixed xmax = 0;
- for (int i = 0; i < glyphs.numGlyphs; i++) {
- const glyph_metrics_t glyphBounds = boundingBox_const(glyphs.glyphs[i]);
- QFixed x = overall.xoff + glyphs.offsets[i].x + glyphBounds.x;
- QFixed y = overall.yoff + glyphs.offsets[i].y - glyphBounds.y;
- overall.x = qMin(overall.x, x);
- overall.y = qMin(overall.y, y);
- xmax = qMax(xmax, x + glyphBounds.width);
- ymax = qMax(ymax, y + glyphBounds.height);
- overall.xoff += glyphBounds.xoff;
- }
- overall.height = qMax(overall.height, ymax - overall.y);
- overall.width = xmax - overall.x;
+ if (glyphs.numGlyphs == 0)
+ return glyph_metrics_t();
+
+ QFixed w = 0;
+ for (int i = 0; i < glyphs.numGlyphs; ++i)
+ w += glyphs.effectiveAdvance(i);
- return overall;
+ return glyph_metrics_t(0, -ascent(), w, ascent()+descent()+1, w, 0);
}
glyph_metrics_t QFontEngineS60::boundingBox_const(glyph_t glyph) const
diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h
index ef4a508..2998de8 100644
--- a/src/gui/text/qfontengine_s60_p.h
+++ b/src/gui/text/qfontengine_s60_p.h
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index bf3a176..dc2e1ff 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -1335,7 +1335,7 @@ bool QFontEngineWin::getSfntTableData(uint tag, uchar *buffer, uint *length) con
QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin,
- const QTransform &t)
+ const QTransform &t, QImage::Format mask_format)
{
glyph_metrics_t gm = boundingBox(glyph);
@@ -1406,9 +1406,9 @@ 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::systemFormat(), true);
+ QNativeImage *ni = new QNativeImage(iw + 2 * margin + 4,
+ ih + 2 * margin + 4,
+ mask_format, true);
ni->image.fill(0xffffffff);
HDC hdc = ni->hdc;
@@ -1448,8 +1448,12 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform)
lf.lfQuality = ANTIALIASED_QUALITY;
font = CreateFontIndirectW(&lf);
}
+ QImage::Format mask_format = QNativeImage::systemFormat();
+#ifndef Q_OS_WINCE
+ mask_format = QImage::Format_RGB32;
+#endif
- QNativeImage *mask = drawGDIGlyph(font, glyph, 2, xform);
+ QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform, mask_format);
if (mask == 0)
return QImage();
@@ -1466,22 +1470,20 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform)
// Alpha channel of the ni.image pixels...
for (int y=0; y<mask->height(); ++y) {
uchar *dest = indexed.scanLine(y);
- if (mask->systemFormat() == QImage::Format_RGB16) {
+ if (mask->image.format() == QImage::Format_RGB16) {
const qint16 *src = (qint16 *) ((const QImage &) mask->image).scanLine(y);
- for (int x=0; x<mask->width(); ++x) {
-#ifdef Q_OS_WINCE
+ for (int x=0; x<mask->width(); ++x)
dest[x] = 255 - qGray(src[x]);
-#else
- dest[x] = 255 - (qt_pow_gamma[qGray(src[x])] * 255. / 2047.);
-#endif
- }
} else {
const uint *src = (uint *) ((const QImage &) mask->image).scanLine(y);
for (int x=0; x<mask->width(); ++x) {
#ifdef Q_OS_WINCE
dest[x] = 255 - qGray(src[x]);
#else
- dest[x] = 255 - (qt_pow_gamma[qGray(src[x])] * 255. / 2047.);
+ if (QNativeImage::systemFormat() == QImage::Format_RGB16)
+ dest[x] = 255 - qGray(src[x]);
+ else
+ dest[x] = 255 - (qt_pow_gamma[qGray(src[x])] * 255. / 2047.);
#endif
}
}
@@ -1507,7 +1509,7 @@ QImage QFontEngineWin::alphaRGBMapForGlyph(glyph_t glyph, int margin, const QTra
SystemParametersInfo(SPI_GETFONTSMOOTHINGCONTRAST, 0, &contrast, 0);
SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 0, (void *) 1000, 0);
- QNativeImage *mask = drawGDIGlyph(font, glyph, margin, t);
+ QNativeImage *mask = drawGDIGlyph(font, glyph, margin, t, QImage::Format_RGB32);
SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 0, (void *) contrast, 0);
if (mask == 0)
diff --git a/src/gui/text/qfontengine_win_p.h b/src/gui/text/qfontengine_win_p.h
index 6f37e91..f78bc6a 100644
--- a/src/gui/text/qfontengine_win_p.h
+++ b/src/gui/text/qfontengine_win_p.h
@@ -138,7 +138,8 @@ public:
mutable int designAdvancesSize;
private:
- QNativeImage *drawGDIGlyph(HFONT font, glyph_t, int margin, const QTransform &xform);
+ QNativeImage *drawGDIGlyph(HFONT font, glyph_t, int margin, const QTransform &xform,
+ QImage::Format mask_format);
};
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 88d0610..991fed7 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -164,7 +164,7 @@ extern int qt_defaultDpi();
metrics that are compatible with a certain paint device.
*/
QFontMetrics::QFontMetrics(const QFont &font)
- : d(font.d)
+ : d(font.d.data())
{
d->ref.ref();
}
@@ -196,7 +196,7 @@ QFontMetrics::QFontMetrics(const QFont &font, QPaintDevice *paintdevice)
d->dpi = dpi;
d->screen = screen;
} else {
- d = font.d;
+ d = font.d.data();
d->ref.ref();
}
@@ -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
@@ -1006,7 +1006,7 @@ QFontMetricsF &QFontMetricsF::operator=(const QFontMetrics &other)
metrics that are compatible with a certain paint device.
*/
QFontMetricsF::QFontMetricsF(const QFont &font)
- : d(font.d)
+ : d(font.d.data())
{
d->ref.ref();
}
@@ -1038,7 +1038,7 @@ QFontMetricsF::QFontMetricsF(const QFont &font, QPaintDevice *paintdevice)
d->dpi = dpi;
d->screen = screen;
} else {
- d = font.d;
+ d = font.d.data();
d->ref.ref();
}
@@ -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/qfragmentmap_p.h b/src/gui/text/qfragmentmap_p.h
index 737a717..0f0e0ff 100644
--- a/src/gui/text/qfragmentmap_p.h
+++ b/src/gui/text/qfragmentmap_p.h
@@ -214,6 +214,7 @@ private:
template <class Fragment>
QFragmentMapData<Fragment>::QFragmentMapData()
+ : fragments(0)
{
init();
}
@@ -222,6 +223,7 @@ template <class Fragment>
void QFragmentMapData<Fragment>::init()
{
fragments = (Fragment *)malloc(64*fragmentSize);
+ Q_CHECK_PTR(fragments);
head->tag = (((quint32)'p') << 24) | (((quint32)'m') << 16) | (((quint32)'a') << 8) | 'p'; //TAG('p', 'm', 'a', 'p');
head->root = 0;
head->freelist = 1;
@@ -247,7 +249,9 @@ uint QFragmentMapData<Fragment>::createFragment()
// need to create some free space
uint needed = qAllocMore((freePos+1)*fragmentSize, 0);
Q_ASSERT(needed/fragmentSize > head->allocated);
- fragments = (Fragment *)realloc(fragments, needed);
+ Fragment *newFragments = (Fragment *)realloc(fragments, needed);
+ Q_CHECK_PTR(newFragments);
+ fragments = newFragments;
head->allocated = needed/fragmentSize;
F(freePos).right = 0;
}
@@ -787,6 +791,8 @@ public:
QFragmentMap() {}
~QFragmentMap()
{
+ if (!data.fragments)
+ return; // in case of out-of-memory, we won't have fragments
for (Iterator it = begin(); !it.atEnd(); ++it)
it.value()->free();
}
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index c74af23..69e1ee4 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1611,6 +1611,9 @@ void QTextControlPrivate::mouseMoveEvent(Qt::MouseButtons buttons, const QPointF
if (cursor.position() != oldCursorPos)
emit q->cursorPositionChanged();
_q_updateCurrentCharFormatAndSelection();
+ if (QInputContext *ic = inputContext()) {
+ ic->update();
+ }
} else {
//emit q->visibilityRequest(QRectF(mousePos, QSizeF(1, 1)));
if (cursor.position() != oldCursorPos)
@@ -1813,13 +1816,18 @@ bool QTextControlPrivate::dropEvent(const QMimeData *mimeData, const QPointF &po
void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
{
+ Q_Q(QTextControl);
if (!(interactionFlags & Qt::TextEditable) || cursor.isNull()) {
e->ignore();
return;
}
- cursor.beginEditBlock();
+ bool isGettingInput = !e->commitString().isEmpty() || !e->preeditString().isEmpty()
+ || e->replacementLength() > 0;
- cursor.removeSelectedText();
+ if (isGettingInput) {
+ cursor.beginEditBlock();
+ cursor.removeSelectedText();
+ }
// insert commit string
if (!e->commitString().isEmpty() || e->replacementLength()) {
@@ -1829,6 +1837,18 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
c.insertText(e->commitString());
}
+ for (int i = 0; i < e->attributes().size(); ++i) {
+ const QInputMethodEvent::Attribute &a = e->attributes().at(i);
+ if (a.type == QInputMethodEvent::Selection) {
+ QTextCursor oldCursor = cursor;
+ int blockStart = a.start + cursor.block().position();
+ cursor.setPosition(blockStart, QTextCursor::MoveAnchor);
+ cursor.setPosition(blockStart + a.length, QTextCursor::KeepAnchor);
+ q->ensureCursorVisible();
+ repaintOldAndNewSelection(oldCursor);
+ }
+ }
+
QTextBlock block = cursor.block();
QTextLayout *layout = block.layout();
layout->setPreeditArea(cursor.position() - block.position(), e->preeditString());
@@ -1852,7 +1872,9 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
}
}
layout->setAdditionalFormats(overrides);
- cursor.endEditBlock();
+
+ if (isGettingInput)
+ cursor.endEditBlock();
}
QVariant QTextControl::inputMethodQuery(Qt::InputMethodQuery property) const
@@ -1865,13 +1887,15 @@ QVariant QTextControl::inputMethodQuery(Qt::InputMethodQuery property) const
case Qt::ImFont:
return QVariant(d->cursor.charFormat().font());
case Qt::ImCursorPosition:
- return QVariant(d->cursor.selectionEnd() - block.position());
+ return QVariant(d->cursor.position() - block.position());
case Qt::ImSurroundingText:
return QVariant(block.text());
case Qt::ImCurrentSelection:
return QVariant(d->cursor.selectedText());
case Qt::ImMaximumTextLength:
return QVariant(); // No limit.
+ case Qt::ImAnchorPosition:
+ return QVariant(qBound(0, d->cursor.anchor() - block.position(), block.length()));
default:
return QVariant();
}
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 80a5425..0c55ce5 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -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);
@@ -2057,10 +2069,12 @@ void QTextEngine::LayoutData::reallocate(int totalGlyphs)
int newAllocated = space_charAttributes + space_glyphs + space_logClusters;
Q_ASSERT(newAllocated >= allocated);
- void **old_mem = memory;
- memory = (void **)::realloc(memory_on_stack ? 0 : old_mem, newAllocated*sizeof(void *));
- if (memory_on_stack && memory)
- memcpy(memory, old_mem, allocated*sizeof(void *));
+ void **newMem = memory;
+ newMem = (void **)::realloc(memory_on_stack ? 0 : memory, newAllocated*sizeof(void *));
+ Q_CHECK_PTR(newMem);
+ if (memory_on_stack && newMem)
+ memcpy(newMem, memory, allocated*sizeof(void *));
+ memory = newMem;
memory_on_stack = false;
void **m = memory;
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index 21bfc4d..38ac4ca 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -1449,7 +1449,7 @@ void QTextCharFormat::setUnderlineStyle(UnderlineStyle style)
/*!
\since 4.5
\fn bool QTextCharFormat::fontKerning() const
- Returns true if the the font kerning is enabled.
+ Returns true if the font kerning is enabled.
\sa setFontKerning()
\sa font()
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index fa624ef..6c67a68 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -367,7 +367,7 @@ QTextLayout::QTextLayout(const QString& text, const QFont &font, QPaintDevice *p
QFont f(font);
if (paintdevice)
f = QFont(font, paintdevice);
- d = new QTextEngine((text.isNull() ? (const QString&)QString::fromLatin1("") : text), f.d);
+ d = new QTextEngine((text.isNull() ? (const QString&)QString::fromLatin1("") : text), f.d.data());
}
/*!
diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp
index e1b9844..0f24d9b 100644
--- a/src/gui/text/qtextoption.cpp
+++ b/src/gui/text/qtextoption.cpp
@@ -117,7 +117,13 @@ QTextOption &QTextOption::operator=(const QTextOption &o)
{
if (this == &o)
return *this;
- delete d; d = 0;
+
+ QTextOptionPrivate* dNew = 0;
+ if (o.d)
+ dNew = new QTextOptionPrivate(*o.d);
+ delete d;
+ d = dNew;
+
align = o.align;
wordWrap = o.wordWrap;
design = o.design;
@@ -125,8 +131,6 @@ QTextOption &QTextOption::operator=(const QTextOption &o)
unused = o.unused;
f = o.f;
tab = o.tab;
- if (o.d)
- d = new QTextOptionPrivate(*o.d);
return *this;
}
diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp
index 48708c9..edba2c4 100644
--- a/src/gui/text/qtexttable.cpp
+++ b/src/gui/text/qtexttable.cpp
@@ -432,6 +432,13 @@ void QTextTablePrivate::fragmentRemoved(const QChar &type, uint fragment)
QTextFramePrivate::fragmentRemoved(type, fragment);
}
+/*!
+ /fn void QTextTablePrivate::update() const
+
+ This function is usually called when the table is "dirty".
+ It seems to update all kind of table information.
+
+*/
void QTextTablePrivate::update() const
{
Q_Q(const QTextTable);
@@ -439,7 +446,9 @@ void QTextTablePrivate::update() const
nRows = (cells.size() + nCols-1)/nCols;
// qDebug(">>>> QTextTablePrivate::update, nRows=%d, nCols=%d", nRows, nCols);
- grid = (int *)realloc(grid, nRows*nCols*sizeof(int));
+ int* newGrid = (int *)realloc(grid, nRows*nCols*sizeof(int));
+ Q_CHECK_PTR(newGrid);
+ grid = newGrid;
memset(grid, 0, nRows*nCols*sizeof(int));
QTextDocumentPrivate *p = pieceTable;
@@ -463,7 +472,9 @@ void QTextTablePrivate::update() const
cellIndices[i] = cell;
if (r + rowspan > nRows) {
- grid = (int *)realloc(grid, sizeof(int)*(r + rowspan)*nCols);
+ newGrid = (int *)realloc(grid, sizeof(int)*(r + rowspan)*nCols);
+ Q_CHECK_PTR(newGrid);
+ grid = newGrid;
memset(grid + (nRows*nCols), 0, sizeof(int)*(r+rowspan-nRows)*nCols);
nRows = r + rowspan;
}
diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp
index c6c2e69..04f081e 100644
--- a/src/gui/text/qzip.cpp
+++ b/src/gui/text/qzip.cpp
@@ -695,7 +695,7 @@ void QZipWriterPrivate::addEntry(EntryType type, const QString &fileName, const
*/
QZipReader::QZipReader(const QString &archive, QIODevice::OpenMode mode)
{
- QFile *f = new QFile(archive);
+ QScopedPointer<QFile> f(new QFile(archive));
f->open(mode);
QZipReader::Status status;
if (f->error() == QFile::NoError)
@@ -711,7 +711,8 @@ QZipReader::QZipReader(const QString &archive, QIODevice::OpenMode mode)
status = FileError;
}
- d = new QZipReaderPrivate(f, /*ownDevice=*/true);
+ d = new QZipReaderPrivate(f.data(), /*ownDevice=*/true);
+ f.take();
d->status = status;
}
@@ -969,7 +970,7 @@ void QZipReader::close()
*/
QZipWriter::QZipWriter(const QString &fileName, QIODevice::OpenMode mode)
{
- QFile *f = new QFile(fileName);
+ QScopedPointer<QFile> f(new QFile(fileName));
f->open(mode);
QZipWriter::Status status;
if (f->error() == QFile::NoError)
@@ -985,7 +986,8 @@ QZipWriter::QZipWriter(const QString &fileName, QIODevice::OpenMode mode)
status = QZipWriter::FileError;
}
- d = new QZipWriterPrivate(f, /*ownDevice=*/true);
+ d = new QZipWriterPrivate(f.data(), /*ownDevice=*/true);
+ f.take();
d->status = status;
}
diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp
index a32a91c..3588ec9 100644
--- a/src/gui/util/qdesktopservices_s60.cpp
+++ b/src/gui/util/qdesktopservices_s60.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -24,8 +54,8 @@
#include <eikenv.h> // CEikonEnv
#include <apgcli.h> // RApaLsSession
#include <apgtask.h> // TApaTaskList, TApaTask
-#include <sendui.h> // CSendUi
-#include <cmessagedata.h> // CMessageData
+#include <rsendas.h> // RSendAs
+#include <rsendasmessage.h> // RSendAsMessage
#include <pathinfo.h> // PathInfo
#ifdef USE_DOCUMENTHANDLER
#include <documenthandler.h> // CDocumentHandler
@@ -55,52 +85,57 @@ static void handleMailtoSchemeL(const QUrl &url)
QStringList bccs = bcc.split(",");
- CSendUi* sendUi = CSendUi::NewLC();
-
- // Construct symbian sendUI data holder
- CMessageData* messageData = CMessageData::NewLC();
-
- // Subject
- TPtrC subj( qt_QString2TPtrC(subject) );
- messageData->SetSubjectL( &subj );
-
- // Body
- CParaFormatLayer* paraFormat = CParaFormatLayer::NewL();
- CleanupStack::PushL( paraFormat );
- CCharFormatLayer* charFormat = CCharFormatLayer::NewL();
- CleanupStack::PushL( charFormat );
- CRichText* bodyRichText = CRichText::NewL( paraFormat, charFormat );
- CleanupStack::PushL( bodyRichText );
-
- TPtrC bodyPtr( qt_QString2TPtrC(body) );
- if( bodyPtr.Length() )
- {
- bodyRichText->InsertL( 0, bodyPtr );
- }
- else
- {
- bodyRichText->InsertL( 0, KNullDesC );
- }
-
- messageData->SetBodyTextL( bodyRichText );
-
- // To
- foreach(QString item, recipients)
- messageData->AppendToAddressL(qt_QString2TPtrC(item));
-
- foreach(QString item, tos)
- messageData->AppendToAddressL(qt_QString2TPtrC(item));
-
- // Cc
- foreach(QString item, ccs)
- messageData->AppendCcAddressL(qt_QString2TPtrC(item));
-
- // Bcc
- foreach(QString item, bccs)
- messageData->AppendBccAddressL(qt_QString2TPtrC(item));
-
- sendUi->CreateAndSendMessageL( KUidMsgTypeSMTP, messageData );
- CleanupStack::PopAndDestroy( 5 ); // bodyRichText, charFormat, paraFormat, messageData, sendUi
+ RSendAs sendAs;
+ User::LeaveIfError(sendAs.Connect());
+ CleanupClosePushL(sendAs);
+
+
+ CSendAsAccounts* accounts = CSendAsAccounts::NewL();
+ CleanupStack::PushL(accounts);
+ sendAs.AvailableAccountsL(KUidMsgTypeSMTP, *accounts);
+ TInt count = accounts->Count();
+ CleanupStack::PopAndDestroy(accounts);
+
+ if(!count) {
+ // TODO: we should try to create account if count == 0
+ // CSendUi would provide account creation service for us, but it requires ridicilous
+ // capabilities: LocalServices NetworkServices ReadDeviceData ReadUserData WriteDeviceData WriteUserData
+ User::Leave(KErrNotSupported);
+ } else {
+ RSendAsMessage sendAsMessage;
+ sendAsMessage.CreateL(sendAs, KUidMsgTypeSMTP);
+ CleanupClosePushL(sendAsMessage);
+
+
+ // Subject
+ sendAsMessage.SetSubjectL(qt_QString2TPtrC(subject));
+
+ // Body
+ sendAsMessage.SetBodyTextL(qt_QString2TPtrC(body));
+
+ // To
+ foreach(QString item, recipients)
+ sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo );
+
+ foreach(QString item, tos)
+ sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo );
+
+ // Cc
+ foreach(QString item, ccs)
+ sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientCc );
+
+ // Bcc
+ foreach(QString item, bccs)
+ sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientBcc );
+
+ // send the message
+ sendAsMessage.LaunchEditorAndCloseL();
+
+ // sendAsMessage (already closed)
+ CleanupStack::Pop();
+ }
+ // sendAs
+ CleanupStack::PopAndDestroy();
}
static bool handleMailtoScheme(const QUrl &url)
diff --git a/src/gui/util/qundostack.cpp b/src/gui/util/qundostack.cpp
index 11f65e3..a6b9c23 100644
--- a/src/gui/util/qundostack.cpp
+++ b/src/gui/util/qundostack.cpp
@@ -715,7 +715,7 @@ int QUndoStack::index() const
}
/*!
- Repeatedly calls undo() or redo() until the the current command index reaches
+ Repeatedly calls undo() or redo() until the current command index reaches
\a idx. This function can be used to roll the state of the document forwards
of backwards. indexChanged() is emitted only once.
diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri
index 69c53ae..e628229 100644
--- a/src/gui/util/util.pri
+++ b/src/gui/util/util.pri
@@ -35,11 +35,6 @@ embedded {
util/qsystemtrayicon_qws.cpp
}
-symbian {
- # QDesktopServices uses CSendUi which is located on app layer
- INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-}
-
!embedded:!x11:mac {
OBJECTIVE_SOURCES += util/qsystemtrayicon_mac.mm
}
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp
index 9886969..1ff56e8 100644
--- a/src/gui/widgets/qabstractscrollarea.cpp
+++ b/src/gui/widgets/qabstractscrollarea.cpp
@@ -281,8 +281,8 @@ void QAbstractScrollAreaPrivate::init()
scrollBarContainers[Qt::Vertical]->setVisible(false);
QObject::connect(vbar, SIGNAL(valueChanged(int)), q, SLOT(_q_vslide(int)));
QObject::connect(vbar, SIGNAL(rangeChanged(int,int)), q, SLOT(_q_showOrHideScrollBars()), Qt::QueuedConnection);
- viewportFilter = new QAbstractScrollAreaFilter(this);
- viewport->installEventFilter(viewportFilter);
+ viewportFilter.reset(new QAbstractScrollAreaFilter(this));
+ viewport->installEventFilter(viewportFilter.data());
viewport->setFocusProxy(q);
q->setFocusPolicy(Qt::WheelFocus);
q->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
@@ -471,7 +471,12 @@ QAbstractScrollArea::QAbstractScrollArea(QAbstractScrollAreaPrivate &dd, QWidget
:QFrame(dd, parent)
{
Q_D(QAbstractScrollArea);
- d->init();
+ QT_TRY {
+ d->init();
+ } QT_CATCH(...) {
+ d->viewportFilter.reset();
+ QT_RETHROW;
+ }
}
/*!
@@ -483,7 +488,12 @@ QAbstractScrollArea::QAbstractScrollArea(QWidget *parent)
:QFrame(*new QAbstractScrollAreaPrivate, parent)
{
Q_D(QAbstractScrollArea);
- d->init();
+ QT_TRY {
+ d->init();
+ } QT_CATCH(...) {
+ d->viewportFilter.reset();
+ QT_RETHROW;
+ }
}
@@ -493,7 +503,8 @@ QAbstractScrollArea::QAbstractScrollArea(QWidget *parent)
QAbstractScrollArea::~QAbstractScrollArea()
{
Q_D(QAbstractScrollArea);
- delete d->viewportFilter;
+ // reset it here, otherwise we'll have a dangling pointer in ~QWidget
+ d->viewportFilter.reset();
}
@@ -517,7 +528,7 @@ void QAbstractScrollArea::setViewport(QWidget *widget)
d->viewport = widget;
d->viewport->setParent(this);
d->viewport->setFocusProxy(this);
- d->viewport->installEventFilter(d->viewportFilter);
+ d->viewport->installEventFilter(d->viewportFilter.data());
d->layoutChildren();
if (isVisible())
d->viewport->show();
diff --git a/src/gui/widgets/qabstractscrollarea_p.h b/src/gui/widgets/qabstractscrollarea_p.h
index e4c47e9..999bdfc 100644
--- a/src/gui/widgets/qabstractscrollarea_p.h
+++ b/src/gui/widgets/qabstractscrollarea_p.h
@@ -98,7 +98,7 @@ public:
inline bool viewportEvent(QEvent *event)
{ return q_func()->viewportEvent(event); }
- QObject *viewportFilter;
+ QScopedPointer<QObject> viewportFilter;
};
class QAbstractScrollAreaFilter : public QObject
diff --git a/src/gui/widgets/qabstractspinbox.cpp b/src/gui/widgets/qabstractspinbox.cpp
index 347f89a..2bf1cda 100644
--- a/src/gui/widgets/qabstractspinbox.cpp
+++ b/src/gui/widgets/qabstractspinbox.cpp
@@ -659,7 +659,6 @@ void QAbstractSpinBox::setLineEdit(QLineEdit *lineEdit)
d->edit->setParent(this);
d->edit->setFrame(false);
- d->edit->setAttribute(Qt::WA_InputMethodEnabled, false);
d->edit->setFocusProxy(this);
d->edit->setAcceptDrops(false);
@@ -690,6 +689,18 @@ void QAbstractSpinBox::interpretText()
d->interpret(EmitIfChanged);
}
+/*
+ Reimplemented in 4.6, so be careful.
+ */
+/*!
+ \reimp
+*/
+QVariant QAbstractSpinBox::inputMethodQuery(Qt::InputMethodQuery query) const
+{
+ Q_D(const QAbstractSpinBox);
+ return d->edit->inputMethodQuery(query);
+}
+
/*!
\reimp
*/
diff --git a/src/gui/widgets/qabstractspinbox.h b/src/gui/widgets/qabstractspinbox.h
index 4e7fc3f..aa8905f 100644
--- a/src/gui/widgets/qabstractspinbox.h
+++ b/src/gui/widgets/qabstractspinbox.h
@@ -122,6 +122,8 @@ public:
void interpretText();
bool event(QEvent *event);
+ QVariant inputMethodQuery(Qt::InputMethodQuery) const;
+
virtual QValidator::State validate(QString &input, int &pos) const;
virtual void fixup(QString &input) const;
diff --git a/src/gui/widgets/qactiontokeyeventmapper.cpp b/src/gui/widgets/qactiontokeyeventmapper.cpp
new file mode 100644
index 0000000..280b1c6
--- /dev/null
+++ b/src/gui/widgets/qactiontokeyeventmapper.cpp
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the 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.h"
+#include "qevent.h"
+#include "qactiontokeyeventmapper_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QActionToKeyEventMapper::QActionToKeyEventMapper(QAction *softKeyAction, Qt::Key key, QObject *parent)
+ : QObject(parent)
+ , m_softKeyAction(softKeyAction)
+ , m_key(key)
+{
+
+}
+
+QString QActionToKeyEventMapper::roleText(QAction::SoftKeyRole role)
+{
+ switch (role) {
+ case QAction::OptionsSoftKey:
+ return QAction::tr("Options");
+ case QAction::SelectSoftKey:
+ return QAction::tr("Select");
+ case QAction::BackSoftKey:
+ return QAction::tr("Back");
+ case QAction::NextSoftKey:
+ return QAction::tr("Next");
+ case QAction::PreviousSoftKey:
+ return QAction::tr("Previous");
+ case QAction::OkSoftKey:
+ return QAction::tr("Ok");
+ case QAction::CancelSoftKey:
+ return QAction::tr("Cancel");
+ case QAction::EditSoftKey:
+ return QAction::tr("Edit");
+ case QAction::ViewSoftKey:
+ return QAction::tr("View");
+ default:
+ return QString();
+ };
+}
+void QActionToKeyEventMapper::addSoftKey(QAction::SoftKeyRole standardRole, Qt::Key key, QWidget *actionWidget)
+{
+ QAction *action = new QAction(actionWidget);
+ action->setSoftKeyRole(standardRole);
+ action->setText(roleText(standardRole));
+ QActionToKeyEventMapper *softKey = new QActionToKeyEventMapper(action, key, actionWidget);
+ connect(action, SIGNAL(triggered()), softKey, SLOT(sendKeyEvent()));
+ connect(action, SIGNAL(destroyed()), softKey, SLOT(deleteLater()));
+ actionWidget->setSoftKey(action);
+}
+
+void QActionToKeyEventMapper::removeSoftkey(QWidget *focussedWidget)
+{
+ focussedWidget->setSoftKey(0);
+}
+
+void QActionToKeyEventMapper::sendKeyEvent()
+{
+ QApplication::postEvent(parent(), new QKeyEvent(QEvent::KeyPress, m_key, Qt::NoModifier));
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/gui/widgets/qactiontokeyeventmapper_p.h b/src/gui/widgets/qactiontokeyeventmapper_p.h
new file mode 100644
index 0000000..c54e612
--- /dev/null
+++ b/src/gui/widgets/qactiontokeyeventmapper_p.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the 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 QACTIONTOKEYEVENTMAPPER_P_H
+#define QACTIONTOKEYEVENTMAPPER_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.
+//
+
+#include <QtCore/qobject.h>
+#include "QtGui/qaction.h"
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QActionToKeyEventMapper : public QObject
+{
+ Q_OBJECT
+public:
+ QActionToKeyEventMapper(QAction *softKeyAction, Qt::Key key, QObject *parent);
+ static QString roleText(QAction::SoftKeyRole role);
+ static void addSoftKey(QAction::SoftKeyRole standardRole, Qt::Key key, QWidget *actionWidget);
+ static void removeSoftkey(QWidget *focussedWidget);
+private:
+ QAction *m_softKeyAction;
+ Qt::Key m_key;
+private Q_SLOTS:
+ void sendKeyEvent();
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif //QACTIONTOKEYEVENTMAPPER_P_H
diff --git a/src/gui/widgets/qcalendarwidget.cpp b/src/gui/widgets/qcalendarwidget.cpp
index 92c12a5..4436c04 100644
--- a/src/gui/widgets/qcalendarwidget.cpp
+++ b/src/gui/widgets/qcalendarwidget.cpp
@@ -2791,7 +2791,7 @@ QTextCharFormat QCalendarWidget::dateTextFormat(const QDate &date) const
void QCalendarWidget::setDateTextFormat(const QDate &date, const QTextCharFormat &format)
{
Q_D(QCalendarWidget);
- if ( date.isNull() && !format.isValid() )
+ if (date.isNull())
d->m_model->m_dateFormats.clear();
else
d->m_model->m_dateFormats[date] = format;
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index e9884bb..a6a5e08 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -63,7 +63,7 @@
#include <private/qabstractitemmodel_p.h>
#include <private/qabstractscrollarea_p.h>
#include <qdebug.h>
-
+#include <private/qactiontokeyeventmapper_p.h>
#ifdef Q_WS_X11
#include <private/qt_x11_p.h>
#endif
@@ -628,6 +628,9 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
case Qt::Key_Select:
#endif
if (view->currentIndex().isValid() && (view->currentIndex().flags() & Qt::ItemIsEnabled) ) {
+#ifdef QT_KEYPAD_NAVIGATION
+ QActionToKeyEventMapper::removeSoftkey(this);
+#endif
combo->hidePopup();
emit itemSelected(view->currentIndex());
}
@@ -640,7 +643,7 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
case Qt::Key_Escape:
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Back:
- case Qt::Key_Context2: // TODO: aportale, KEYPAD_NAVIGATION_HACK when softkey support is there
+ QActionToKeyEventMapper::removeSoftkey(this);
#endif
combo->hidePopup();
return true;
@@ -948,7 +951,7 @@ QComboBoxPrivateContainer* QComboBoxPrivate::viewContainer()
container = new QComboBoxPrivateContainer(new QComboBoxListView(q), q);
container->itemView()->setModel(model);
container->itemView()->setTextElideMode(Qt::ElideMiddle);
- updateDelegate();
+ updateDelegate(true);
updateLayoutDirection();
QObject::connect(container, SIGNAL(itemSelected(QModelIndex)),
q, SLOT(_q_itemSelected(QModelIndex)));
@@ -1568,15 +1571,25 @@ bool QComboBox::isEditable() const
return d->lineEdit != 0;
}
-void QComboBoxPrivate::updateDelegate()
+/*! \internal
+ update the default delegate
+ depending on the style's SH_ComboBox_Popup hint, we use a different default delegate.
+
+ but we do not change the delegate is the combobox use a custom delegate,
+ unless \a force is set to true.
+ */
+void QComboBoxPrivate::updateDelegate(bool force)
{
Q_Q(QComboBox);
QStyleOptionComboBox opt;
q->initStyleOption(&opt);
- if (q->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, q))
- q->setItemDelegate(new QComboMenuDelegate(q->view(), q));
- else
- q->setItemDelegate(new QComboBoxDelegate(q->view(), q));
+ if (q->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, q)) {
+ if (force || qobject_cast<QComboBoxDelegate *>(q->itemDelegate()))
+ q->setItemDelegate(new QComboMenuDelegate(q->view(), q));
+ } else {
+ if (force || qobject_cast<QComboMenuDelegate *>(q->itemDelegate()))
+ q->setItemDelegate(new QComboBoxDelegate(q->view(), q));
+ }
}
QIcon QComboBoxPrivate::itemIcon(const QModelIndex &index) const
@@ -2425,6 +2438,7 @@ void QComboBox::showPopup()
#ifdef QT_KEYPAD_NAVIGATION
if (QApplication::keypadNavigationEnabled())
view()->setEditFocus(true);
+ QActionToKeyEventMapper::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, view());
#endif
}
diff --git a/src/gui/widgets/qcombobox_p.h b/src/gui/widgets/qcombobox_p.h
index c39a231..a55b439 100644
--- a/src/gui/widgets/qcombobox_p.h
+++ b/src/gui/widgets/qcombobox_p.h
@@ -256,7 +256,7 @@ private:
};
class QComboMenuDelegate : public QAbstractItemDelegate
-{
+{ Q_OBJECT
public:
QComboMenuDelegate(QObject *parent, QComboBox *cmb) : QAbstractItemDelegate(parent), mCombo(cmb) {}
@@ -285,7 +285,7 @@ private:
// Vista does not use the new theme for combo boxes and there might
// be other side effects from using the new class
class QComboBoxDelegate : public QItemDelegate
-{
+{ Q_OBJECT
public:
QComboBoxDelegate(QObject *parent, QComboBox *cmb) : QItemDelegate(parent), mCombo(cmb) {}
@@ -367,7 +367,7 @@ public:
int itemRole() const;
void updateLayoutDirection();
void setCurrentIndex(const QModelIndex &index);
- void updateDelegate();
+ void updateDelegate(bool force = false);
void keyboardSearchString(const QString &text);
void modelChanged();
diff --git a/src/gui/widgets/qdatetimeedit.cpp b/src/gui/widgets/qdatetimeedit.cpp
index 83bec68..4d34691 100644
--- a/src/gui/widgets/qdatetimeedit.cpp
+++ b/src/gui/widgets/qdatetimeedit.cpp
@@ -2390,6 +2390,7 @@ void QDateTimeEditPrivate::init(const QVariant &var)
q->setCalendarPopup(true);
#endif
updateTimeSpec();
+ q->setInputMethodHints(Qt::ImhPreferNumbers);
setLayoutItemMargins(QStyle::SE_DateTimeEditLayoutItem);
}
diff --git a/src/gui/widgets/qlcdnumber.cpp b/src/gui/widgets/qlcdnumber.cpp
index 0136f1a..af80963 100644
--- a/src/gui/widgets/qlcdnumber.cpp
+++ b/src/gui/widgets/qlcdnumber.cpp
@@ -1271,7 +1271,7 @@ bool QLCDNumber::event(QEvent *e)
/*!
\fn int QLCDNumber::margin() const
- Returns the with of the the margin around the contents of the widget.
+ Returns the width of the margin around the contents of the widget.
Use QWidget::getContentsMargins() instead.
\sa setMargin(), QWidget::getContentsMargins()
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index 116d000..a95d2f2 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -2274,8 +2274,16 @@ void QLineEdit::inputMethodEvent(QInputMethodEvent *e)
}
#endif
- int priorState = d->undoState;
- d->removeSelectedText();
+ int priorState = 0;
+ bool isGettingInput = !e->commitString().isEmpty() || !e->preeditString().isEmpty()
+ || e->replacementLength() > 0;
+ bool cursorPositionChanged = false;
+
+ if (isGettingInput) {
+ // If any text is being input, remove selected text.
+ priorState = d->undoState;
+ d->removeSelectedText();
+ }
int c = d->cursor; // cursor position after insertion of commit string
if (e->replacementStart() <= 0)
@@ -2289,11 +2297,30 @@ void QLineEdit::inputMethodEvent(QInputMethodEvent *e)
d->selend = d->selstart + e->replacementLength();
d->removeSelectedText();
}
- if (!e->commitString().isEmpty())
+ if (!e->commitString().isEmpty()) {
d->insert(e->commitString());
+ cursorPositionChanged = true;
+ }
d->cursor = qMin(c, d->text.length());
+ for (int i = 0; i < e->attributes().size(); ++i) {
+ const QInputMethodEvent::Attribute &a = e->attributes().at(i);
+ if (a.type == QInputMethodEvent::Selection) {
+ d->cursor = qBound(0, a.start + a.length, d->text.length());
+ if (a.length) {
+ d->selstart = qMax(0, qMin(a.start, d->text.length()));
+ d->selend = d->cursor;
+ if (d->selend < d->selstart) {
+ qSwap(d->selstart, d->selend);
+ }
+ } else {
+ d->selstart = d->selend = 0;
+ }
+ cursorPositionChanged = true;
+ }
+ }
+
d->textLayout.setPreeditArea(d->cursor, e->preeditString());
d->preeditCursor = e->preeditString().length();
d->hideCursor = false;
@@ -2317,9 +2344,12 @@ void QLineEdit::inputMethodEvent(QInputMethodEvent *e)
d->textLayout.setAdditionalFormats(formats);
d->updateTextLayout();
update();
- if (!e->commitString().isEmpty())
+ if (cursorPositionChanged)
d->emitCursorPositionChanged();
- d->finishChange(priorState);
+
+ if (isGettingInput)
+ d->finishChange(priorState);
+
#ifndef QT_NO_COMPLETER
if (!e->commitString().isEmpty())
d->complete(Qt::Key_unknown);
@@ -2337,13 +2367,20 @@ QVariant QLineEdit::inputMethodQuery(Qt::InputMethodQuery property) const
case Qt::ImFont:
return font();
case Qt::ImCursorPosition:
- return QVariant((d->selend - d->selstart == 0) ? d->cursor : d->selend);
+ return QVariant(d->cursor);
case Qt::ImSurroundingText:
return QVariant(d->text);
case Qt::ImCurrentSelection:
return QVariant(selectedText());
case Qt::ImMaximumTextLength:
return QVariant(maxLength());
+ case Qt::ImAnchorPosition:
+ if (d->selstart == d->selend)
+ return QVariant(d->cursor);
+ else if (d->selstart == d->cursor)
+ return QVariant(d->selend);
+ else
+ return QVariant(d->selstart);
default:
return QVariant();
}
@@ -3690,7 +3727,7 @@ void QLineEditPrivate::redo() {
/*!
\fn int QLineEdit::margin() const
- Returns the with of the the margin around the contents of the widget.
+ Returns the width of the margin around the contents of the widget.
Use QWidget::getContentsMargins() instead.
\sa setMargin(), QWidget::getContentsMargins()
diff --git a/src/gui/widgets/qmacnativewidget_mac.h b/src/gui/widgets/qmacnativewidget_mac.h
index 4db65e0..d36d74f 100644
--- a/src/gui/widgets/qmacnativewidget_mac.h
+++ b/src/gui/widgets/qmacnativewidget_mac.h
@@ -64,7 +64,7 @@ protected:
bool event(QEvent *ev);
private:
- Q_DECLARE_PRIVATE_D(QWidget::d_ptr, QMacNativeWidget)
+ Q_DECLARE_PRIVATE(QMacNativeWidget)
};
QT_END_NAMESPACE
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp
index 558ba42..2f3b412 100644
--- a/src/gui/widgets/qmainwindow.cpp
+++ b/src/gui/widgets/qmainwindow.cpp
@@ -481,6 +481,11 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar)
oldMenuBar->deleteLater();
}
d->layout->setMenuBar(menuBar);
+ if (menuBar) {
+ QAction* menu = new QAction(QString::fromLatin1("Menu"), this);
+ menu->setSoftKeyRole(QAction::MenuSoftKey);
+ setSoftKey(menu);
+ }
}
/*!
diff --git a/src/gui/widgets/qmdiarea.cpp b/src/gui/widgets/qmdiarea.cpp
index 598d3b5..6acd977 100644
--- a/src/gui/widgets/qmdiarea.cpp
+++ b/src/gui/widgets/qmdiarea.cpp
@@ -81,7 +81,7 @@
subwindows. This information could be used in a popup menu
containing a list of windows, for example.
- The subwindows are sorted by the the current
+ The subwindows are sorted by the current
\l{QMdiArea::}{WindowOrder}. This is used for the subWindowList()
and for activateNextSubWindow() and acivatePreviousSubWindow().
Also, it is used when cascading or tiling the windows with
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 6be0f19..6d4dcf2 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -60,6 +60,7 @@
#ifndef QT_NO_WHATSTHIS
# include <qwhatsthis.h>
#endif
+#include <private/qactiontokeyeventmapper_p.h>
#include "qmenu_p.h"
#include "qmenubar_p.h"
@@ -578,8 +579,14 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason
//when the action has no QWidget, the QMenu itself should
// get the focus
// Since the menu is a pop-up, it uses the popup reason.
- if (!q->hasFocus())
+ if (!q->hasFocus()) {
q->setFocus(Qt::PopupFocusReason);
+#ifdef QT_KEYPAD_NAVIGATION
+ // TODO: aportale, remove KEYPAD_NAVIGATION_HACK when softkey stack
+ // handles focus related and user related actions separately...
+ QActionToKeyEventMapper::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, q);
+#endif
+ }
}
}
} else { //action is a separator
@@ -1937,6 +1944,9 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::PopupMenuStart);
#endif
+#ifdef QT_KEYPAD_NAVIGATION
+ QActionToKeyEventMapper::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, this);
+#endif
}
/*!
@@ -2587,7 +2597,7 @@ void QMenu::keyPressEvent(QKeyEvent *e)
case Qt::Key_Escape:
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Back:
- case Qt::Key_Context2: // TODO: aportale, remove KEYPAD_NAVIGATION_HACK when softkey support is there
+ QActionToKeyEventMapper::removeSoftkey(this);
#endif
key_consumed = true;
if (d->tornoff) {
diff --git a/src/gui/widgets/qmenu.h b/src/gui/widgets/qmenu.h
index 1676eb8..bf1c39f 100644
--- a/src/gui/widgets/qmenu.h
+++ b/src/gui/widgets/qmenu.h
@@ -184,9 +184,6 @@ protected:
#ifdef Q_OS_WINCE
QAction* wceCommands(uint command);
#endif
-#ifdef Q_OS_SYMBIAN
- void symbianCommands(int command);
-#endif
private Q_SLOTS:
void internalSetSloppyAction();
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index ad848c9..2560cfa 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -871,8 +871,6 @@ static NSMenuItem *qt_mac_menu_merge_action(OSMenuRef merge, QMacMenuAction *act
}
}
- if ([ret tag] != 0)
- ret = 0; // already taken
#endif
return ret;
}
@@ -1131,15 +1129,15 @@ QMenuPrivate::QMacMenuPrivate::addAction(QMacMenuAction *action, QMacMenuAction
GetMenuItemAttributes(action->menu, itemCount , &testattr);
if (mergedItems.contains(action->command)
&& (testattr & kMenuItemAttrSeparator)) {
- InsertMenuItemTextWithCFString(action->menu, 0, qMax(itemCount - 1, 0), attr, action->command);
- index = itemCount;
- } else {
- MenuItemIndex tmpIndex;
- AppendMenuItemTextWithCFString(action->menu, 0, attr, action->command, &tmpIndex);
- index = tmpIndex;
- if (mergedItems.contains(action->command))
- AppendMenuItemTextWithCFString(action->menu, 0, kMenuItemAttrSeparator, 0, &tmpIndex);
- }
+ InsertMenuItemTextWithCFString(action->menu, 0, qMax(itemCount - 1, 0), attr, action->command);
+ index = itemCount;
+ } else {
+ MenuItemIndex tmpIndex;
+ AppendMenuItemTextWithCFString(action->menu, 0, attr, action->command, &tmpIndex);
+ index = tmpIndex;
+ if (mergedItems.contains(action->command))
+ AppendMenuItemTextWithCFString(action->menu, 0, kMenuItemAttrSeparator, 0, &tmpIndex);
+ }
#else
[menu addItem:newItem];
#endif
@@ -1477,11 +1475,18 @@ QMenuPrivate::QMacMenuPrivate::removeAction(QMacMenuAction *action)
DeleteMenuItem(action->menu, qt_mac_menu_find_action(action->menu, action));
#else
QMacCocoaAutoReleasePool pool;
- QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader();
- if (action->menuItem == [loader quitMenuItem] || action->menuItem == [loader preferencesMenuItem])
- [action->menuItem setEnabled:false];
- else
+ if (action->merged) {
+ if (reinterpret_cast<QAction *>([action->menuItem tag]) == action->action) {
+ QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader();
+ [action->menuItem setEnabled:false];
+ if (action->menuItem != [loader quitMenuItem]
+ && action->menuItem != [loader preferencesMenuItem]) {
+ [[action->menuItem menu] removeItem:action->menuItem];
+ }
+ }
+ } else {
[[action->menuItem menu] removeItem:action->menuItem];
+ }
#endif
actionItems.removeAll(action);
}
@@ -1934,6 +1939,23 @@ bool QMenuBar::macUpdateMenuBar()
[loader ensureAppMenuInMenu:menu];
[NSApp setMainMenu:menu];
syncMenuBarItemsVisiblity(mb->d_func()->mac_menubar);
+
+ if (OSMenuRef tmpMerge = QMenuPrivate::mergeMenuHash.value(menu)) {
+ if (QMenuMergeList *mergeList
+ = QMenuPrivate::mergeMenuItemsHash.value(tmpMerge)) {
+ const int mergeListSize = mergeList->size();
+
+ for (int i = 0; i < mergeListSize; ++i) {
+ const QMenuMergeItem &mergeItem = mergeList->at(i);
+ // Ideally we would call QMenuPrivate::syncAction, but that requires finding
+ // the original QMen and likely doing more work than we need.
+ // For example, enabled is handled below.
+ [mergeItem.menuItem setTag:reinterpret_cast<long>(
+ static_cast<QAction *>(mergeItem.action->action))];
+ [mergeItem.menuItem setHidden:!(mergeItem.action->action->isVisible())];
+ }
+ }
+ }
#endif
QWidget *modalWidget = qApp->activeModalWidget();
if (mb != menubars()->value(modalWidget)) {
diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h
index d47749f..aafc945 100644
--- a/src/gui/widgets/qmenu_p.h
+++ b/src/gui/widgets/qmenu_p.h
@@ -227,7 +227,7 @@ public:
QString searchBuffer;
QBasicTimer searchBufferTimer;
- //passing of mouse events up the parent heirarchy
+ //passing of mouse events up the parent hierarchy
QPointer<QMenu> activeMenu;
bool mouseEventTaken(QMouseEvent *);
@@ -358,7 +358,6 @@ public:
return 0;
}
} *symbian_menu;
- bool symbianCommands(int command);
#endif
QPointer<QWidget> noReplayFor;
};
diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp
index 86affe3..69ce981 100644
--- a/src/gui/widgets/qmenu_symbian.cpp
+++ b/src/gui/widgets/qmenu_symbian.cpp
@@ -4,14 +4,42 @@
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
-** $TROLLTECH_DUAL_EMBEDDED_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 "qmenu.h"
#include "qapplication.h"
-#include "qmainwindow.h"
-#include "qtoolbar.h"
#include "qevent.h"
#include "qstyle.h"
#include "qdebug.h"
@@ -26,12 +54,10 @@
#include <eikbtgpc.h>
#include <QtCore/qlibrary.h>
#include <avkon.rsg>
-
#ifndef QT_NO_MENUBAR
QT_BEGIN_NAMESPACE
-// ### FIX/Document this, we need some safe range of menu id's for Qt that don't clash with AIW ones
typedef QMultiHash<QWidget *, QMenuBarPrivate *> MenuBarHash;
Q_GLOBAL_STATIC(MenuBarHash, menubars)
@@ -48,6 +74,10 @@ struct SymbianMenuItem
static QList<SymbianMenuItem*> symbianMenus;
static QList<QMenuBar*> nativeMenuBars;
static uint qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM;
+static QPointer<QWidget> widgetWithContextMenu;
+static QList<QAction*> contextMenuActionList;
+static QAction contextAction(0);
+static int contexMenuCommand=0;
bool menuExists()
{
@@ -58,6 +88,16 @@ bool menuExists()
return true;
}
+static bool hasContextMenu(QWidget* widget)
+{
+ if (!widget)
+ return false;
+ const Qt::ContextMenuPolicy policy = widget->contextMenuPolicy();
+ if (policy != Qt::NoContextMenu && policy != Qt::PreventContextMenu ) {
+ return true;
+ }
+ return false;
+}
// ### FIX THIS, copy/paste of original (faulty) stripped text implementation.
// Implementation should be removed from QAction implementation to some generic place
static QString qt_strippedText_copy_from_qaction(QString s)
@@ -119,14 +159,14 @@ static void qt_symbian_insert_action(QSymbianMenuAction* action, QList<SymbianMe
// ### FIX THIS, the qt_strippedText2 doesn't work perfectly for stripping & marks. Same bug is in QAction
// New really working method is needed in a place where the implementation isn't copy/pasted
QString text = qt_strippedText_copy_from_qaction(action->action->text());
- HBufC* menuItemText = qt_QString2HBufCNewL(text);
+ TPtrC menuItemText(qt_QString2TPtrC(text));
if (action->action->menu()) {
SymbianMenuItem* menuItem = new SymbianMenuItem();
menuItem->menuItemData.iCascadeId = action->command;
menuItem->menuItemData.iCommandId = action->command;
menuItem->menuItemData.iFlags = 0;
- menuItem->menuItemData.iText = *menuItemText;
+ menuItem->menuItemData.iText = menuItemText;
menuItem->action = action->action;
if (action->action->menu()->actions().size() == 0 || !action->action->isEnabled() )
menuItem->menuItemData.iFlags |= EEikMenuItemDimmed;
@@ -147,7 +187,7 @@ static void qt_symbian_insert_action(QSymbianMenuAction* action, QList<SymbianMe
menuItem->menuItemData.iCascadeId = 0;
menuItem->menuItemData.iCommandId = action->command;
menuItem->menuItemData.iFlags = 0;
- menuItem->menuItemData.iText = *menuItemText;
+ menuItem->menuItemData.iText = menuItemText;
menuItem->action = action->action;
if (!action->action->isEnabled()){
menuItem->menuItemData.iFlags += EEikMenuItemDimmed;
@@ -161,7 +201,6 @@ static void qt_symbian_insert_action(QSymbianMenuAction* action, QList<SymbianMe
}
parent->append(menuItem);
}
- delete menuItemText;
}
}
@@ -174,24 +213,18 @@ void deleteAll(QList<SymbianMenuItem*> *items)
}
}
-static void setSoftkeys()
-{
- CEikButtonGroupContainer* cba = CEikonEnv::Static()->AppUiFactory()->Cba();
- if (cba){
- if (menuExists())
- cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_EXIT);
- else
- cba->SetCommandSetL(R_AVKON_SOFTKEYS_EXIT);
- }
-}
-
static void rebuildMenu()
{
+ widgetWithContextMenu = 0;
QMenuBarPrivate *mb = 0;
- setSoftkeys();
QWidget *w = qApp->activeWindow();
- if (w)
- {
+ QWidget* focusWidget = QApplication::focusWidget();
+ if (focusWidget) {
+ if (hasContextMenu(focusWidget))
+ widgetWithContextMenu = focusWidget;
+ }
+
+ if (w) {
mb = menubars()->value(w);
qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM;
deleteAll( &symbianMenus );
@@ -199,7 +232,7 @@ static void rebuildMenu()
return;
mb->symbian_menubar->rebuild();
}
- }
+}
Q_GUI_EXPORT void qt_symbian_show_toplevel( CEikMenuPane* menuPane)
{
@@ -219,42 +252,23 @@ Q_GUI_EXPORT void qt_symbian_show_submenu( CEikMenuPane* menuPane, int id)
}
}
-void QMenu::symbianCommands(int command)
-{
- Q_D(QMenu);
- d->symbianCommands(command);
-}
-
-void QMenuBar::symbianCommands(int command)
+void QMenuBarPrivate::symbianCommands(int command)
{
+ if (command == contexMenuCommand && !widgetWithContextMenu.isNull()) {
+ QContextMenuEvent* event = new QContextMenuEvent(QContextMenuEvent::Keyboard, QPoint(0,0));
+ QCoreApplication::postEvent(widgetWithContextMenu, event);
+ }
+
int size = nativeMenuBars.size();
for (int i = 0; i < nativeMenuBars.size(); ++i) {
- bool result = nativeMenuBars.at(i)->d_func()->symbianCommands(command);
- if (result)
- return;
- }
-}
-
-bool QMenuBarPrivate::symbianCommands(int command)
-{
SymbianMenuItem* menu = qt_symbian_find_menu_item(command, symbianMenus);
if (!menu)
- return false;
-
- emit q_func()->triggered(menu->action);
- menu->action->activate(QAction::Trigger);
- return true;
-}
-
-bool QMenuPrivate::symbianCommands(int command)
-{
- SymbianMenuItem* menu = qt_symbian_find_menu_item(command, symbianMenus);
- if (!menu)
- return false;
+ continue;
- emit q_func()->triggered(menu->action);
+ emit nativeMenuBars.at(i)->triggered(menu->action);
menu->action->activate(QAction::Trigger);
- return true;
+ break;
+ }
}
void QMenuBarPrivate::symbianCreateMenuBar(QWidget *parent)
@@ -289,7 +303,7 @@ QMenuBarPrivate::QSymbianMenuBarPrivate::~QSymbianMenuBarPrivate()
deleteAll( &symbianMenus );
symbianMenus.clear();
d = 0;
- rebuild();
+ rebuild();
}
QMenuPrivate::QSymbianMenuPrivate::QSymbianMenuPrivate()
@@ -371,22 +385,35 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::removeAction(QSymbianMenuAction *a
rebuild();
}
-void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild()
+void QMenuBarPrivate::QSymbianMenuBarPrivate::insertNativeMenuItems(const QList<QAction*> &actions)
{
- setSoftkeys();
- qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM;
- deleteAll( &symbianMenus );
- if (!d)
- return;
- for (int i = 0; i < d->actions.size(); ++i) {
+ for (int i = 0; i <actions.size(); ++i) {
QSymbianMenuAction *symbianActionTopLevel = new QSymbianMenuAction;
- symbianActionTopLevel->action = d->actions.at(i);
+ symbianActionTopLevel->action = actions.at(i);
symbianActionTopLevel->parent = 0;
symbianActionTopLevel->command = qt_symbian_menu_static_cmd_id++;
qt_symbian_insert_action(symbianActionTopLevel, &symbianMenus);
}
}
+
+
+void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild()
+{
+ contexMenuCommand = 0;
+ qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM;
+ deleteAll( &symbianMenus );
+ if (d)
+ insertNativeMenuItems(d->actions);
+
+ contextMenuActionList.clear();
+ if (widgetWithContextMenu) {
+ contexMenuCommand = qt_symbian_menu_static_cmd_id;
+ contextAction.setText(QMenuBar::tr("Actions"));
+ contextMenuActionList.append(&contextAction);
+ insertNativeMenuItems(contextMenuActionList);
+ }
+}
QT_END_NAMESPACE
#endif //QT_NO_MENUBAR
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index d05323d..fb8a69b 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -2417,7 +2417,7 @@ int QMenuBar::findIdForAction(QAction *act) const
/*!
\fn int QMenuBar::margin() const
- Returns the with of the the margin around the contents of the widget.
+ Returns the width of the margin around the contents of the widget.
Use QWidget::getContentsMargins() instead.
\sa setMargin(), QWidget::getContentsMargins()
diff --git a/src/gui/widgets/qmenubar.h b/src/gui/widgets/qmenubar.h
index 36c983b..42f0c0c 100644
--- a/src/gui/widgets/qmenubar.h
+++ b/src/gui/widgets/qmenubar.h
@@ -118,10 +118,6 @@ public:
static void wceRefresh();
#endif
-#ifdef Q_OS_SYMBIAN
- static void symbianCommands(int command);
-#endif
-
public Q_SLOTS:
virtual void setVisible(bool visible);
diff --git a/src/gui/widgets/qmenubar_p.h b/src/gui/widgets/qmenubar_p.h
index d562cd9..9e7d511 100644
--- a/src/gui/widgets/qmenubar_p.h
+++ b/src/gui/widgets/qmenubar_p.h
@@ -257,9 +257,10 @@ public:
}
return 0;
}
+ void insertNativeMenuItems(const QList<QAction*> &actions);
} *symbian_menubar;
- bool symbianCommands(int command);
+ static void symbianCommands(int command);
#endif
};
diff --git a/src/gui/widgets/qmenudata.h b/src/gui/widgets/qmenudata.h
index 24d960a..d570f20 100644
--- a/src/gui/widgets/qmenudata.h
+++ b/src/gui/widgets/qmenudata.h
@@ -67,6 +67,8 @@ private:
friend class QMenuBar;
void setId(int);
void setSignalValue(int);
+
+ Q_DISABLE_COPY(QMenuItem);
};
QT_END_NAMESPACE
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index e563fa1..3d2c4f5 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -72,6 +72,11 @@
QT_BEGIN_NAMESPACE
+static inline bool shouldEnableInputMethod(QPlainTextEdit *plaintextedit)
+{
+ return !plaintextedit->isReadOnly();
+}
+
class QPlainTextDocumentLayoutPrivate : public QAbstractTextDocumentLayoutPrivate
{
Q_DECLARE_PUBLIC(QPlainTextDocumentLayout)
@@ -705,7 +710,8 @@ QPlainTextEditPrivate::QPlainTextEditPrivate()
tabChangesFocus(false),
lineWrap(QPlainTextEdit::WidgetWidth),
wordWrap(QTextOption::WrapAtWordBoundaryOrAnywhere),
- topLine(0), pageUpDownLastCursorYIsValid(false)
+ clickCausedFocus(0),topLine(0),
+ pageUpDownLastCursorYIsValid(false)
{
showCursorOnInitialShow = true;
backgroundVisible = false;
@@ -1905,6 +1911,13 @@ void QPlainTextEdit::mouseReleaseEvent(QMouseEvent *e)
d->autoScrollTimer.stop();
d->ensureCursorVisible();
}
+
+ if (e->button() == Qt::LeftButton && qApp->autoSipEnabled()
+ && (!d->clickCausedFocus || qApp->autoSipOnMouseFocus())) {
+ QEvent event(QEvent::RequestSoftwareInputPanel);
+ QApplication::sendEvent(this, &event);
+ }
+ d->clickCausedFocus = 0;
}
/*! \reimp
@@ -2038,6 +2051,9 @@ QVariant QPlainTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const
void QPlainTextEdit::focusInEvent(QFocusEvent *e)
{
Q_D(QPlainTextEdit);
+ if (e->reason() == Qt::MouseFocusReason) {
+ d->clickCausedFocus = 1;
+ }
QAbstractScrollArea::focusInEvent(e);
d->sendControlEvent(e);
}
@@ -2304,7 +2320,7 @@ void QPlainTextEdit::setReadOnly(bool ro)
} else {
flags = Qt::TextEditorInteraction;
}
- setAttribute(Qt::WA_InputMethodEnabled, !ro);
+ setAttribute(Qt::WA_InputMethodEnabled, shouldEnableInputMethod(this));
d->control->setTextInteractionFlags(flags);
}
diff --git a/src/gui/widgets/qplaintextedit_p.h b/src/gui/widgets/qplaintextedit_p.h
index 0739d53..56a3aa9 100644
--- a/src/gui/widgets/qplaintextedit_p.h
+++ b/src/gui/widgets/qplaintextedit_p.h
@@ -91,7 +91,10 @@ public:
return r;
}
inline QRectF cursorRect() { return cursorRect(textCursor()); }
- void ensureCursorVisible() { textEdit->ensureCursorVisible(); }
+ void ensureCursorVisible() {
+ textEdit->ensureCursorVisible();
+ emit microFocusChanged();
+ }
QPlainTextEdit *textEdit;
@@ -148,6 +151,7 @@ public:
uint backgroundVisible : 1;
uint centerOnScroll : 1;
uint inDrag : 1;
+ uint clickCausedFocus : 1;
int topLine;
diff --git a/src/gui/widgets/qprintpreviewwidget.cpp b/src/gui/widgets/qprintpreviewwidget.cpp
index 16334b8..80c1271 100644
--- a/src/gui/widgets/qprintpreviewwidget.cpp
+++ b/src/gui/widgets/qprintpreviewwidget.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "qprintpreviewwidget.h"
+#include "private/qwidget_p.h"
#include <private/qprinter_p.h>
#include <QtCore/qmath.h>
@@ -170,12 +171,12 @@ protected:
} // anonymous namespace
-class QPrintPreviewWidgetPrivate
+class QPrintPreviewWidgetPrivate : public QWidgetPrivate
{
Q_DECLARE_PUBLIC(QPrintPreviewWidget)
public:
- QPrintPreviewWidgetPrivate(QPrintPreviewWidget *q)
- : q_ptr(q), scene(0), curPage(1),
+ QPrintPreviewWidgetPrivate()
+ : scene(0), curPage(1),
viewMode(QPrintPreviewWidget::SinglePageView),
zoomMode(QPrintPreviewWidget::FitInView),
zoomFactor(1), initialized(false), fitting(true)
@@ -194,7 +195,6 @@ public:
void setZoomFactor(qreal zoomFactor);
int calcCurrentPage();
- QPrintPreviewWidget *q_ptr;
GraphicsView *graphicsView;
QGraphicsScene *scene;
@@ -518,7 +518,7 @@ void QPrintPreviewWidgetPrivate::setZoomFactor(qreal _zoomFactor)
\sa QWidget::setWindowFlags()
*/
QPrintPreviewWidget::QPrintPreviewWidget(QPrinter *printer, QWidget *parent, Qt::WindowFlags flags)
- : QWidget(parent, flags), d_ptr(new QPrintPreviewWidgetPrivate(this))
+ : QWidget(*new QPrintPreviewWidgetPrivate, parent, flags)
{
Q_D(QPrintPreviewWidget);
d->printer = printer;
@@ -534,7 +534,7 @@ QPrintPreviewWidget::QPrintPreviewWidget(QPrinter *printer, QWidget *parent, Qt:
preview.
*/
QPrintPreviewWidget::QPrintPreviewWidget(QWidget *parent, Qt::WindowFlags flags)
- : QWidget(parent, flags), d_ptr(new QPrintPreviewWidgetPrivate(this))
+ : QWidget(*new QPrintPreviewWidgetPrivate, parent, flags)
{
Q_D(QPrintPreviewWidget);
d->printer = new QPrinter;
@@ -551,7 +551,6 @@ QPrintPreviewWidget::~QPrintPreviewWidget()
Q_D(QPrintPreviewWidget);
if (d->ownPrinter)
delete d->printer;
- delete d_ptr;
}
/*!
diff --git a/src/gui/widgets/qprintpreviewwidget.h b/src/gui/widgets/qprintpreviewwidget.h
index 27110a4..9f7ea6e 100644
--- a/src/gui/widgets/qprintpreviewwidget.h
+++ b/src/gui/widgets/qprintpreviewwidget.h
@@ -111,7 +111,7 @@ Q_SIGNALS:
void previewChanged();
private:
- QPrintPreviewWidgetPrivate *d_ptr;
+ void *dummy; // ### remove in Qt 5.0
Q_PRIVATE_SLOT(d_func(), void _q_fit())
Q_PRIVATE_SLOT(d_func(), void _q_updateCurrentPage())
};
diff --git a/src/gui/widgets/qprogressbar.cpp b/src/gui/widgets/qprogressbar.cpp
index cdb3836..1a7f878 100644
--- a/src/gui/widgets/qprogressbar.cpp
+++ b/src/gui/widgets/qprogressbar.cpp
@@ -349,6 +349,8 @@ void QProgressBar::setRange(int minimum, int maximum)
\property QProgressBar::textVisible
\brief whether the current completed percentage should be displayed
+ This property may be ignored by the style (e.g., QMacStyle never draws the text).
+
\sa textDirection
*/
void QProgressBar::setTextVisible(bool visible)
diff --git a/src/gui/widgets/qscrollarea.cpp b/src/gui/widgets/qscrollarea.cpp
index 6aca7d3..8b01453 100644
--- a/src/gui/widgets/qscrollarea.cpp
+++ b/src/gui/widgets/qscrollarea.cpp
@@ -127,7 +127,7 @@ QT_BEGIN_NAMESPACE
setting the layout's \l{QLayout::sizeConstraint}{size constraint}
property to one which provides constraints on the minimum and/or
maximum size of the layout (e.g., QLayout::SetMinAndMaxSize) will
- cause the size of the the scroll area to be updated whenever the
+ cause the size of the scroll area to be updated whenever the
contents of the layout changes.
For a complete example using the QScrollArea class, see the \l
diff --git a/src/gui/widgets/qspinbox.cpp b/src/gui/widgets/qspinbox.cpp
index c691eaf..295bf48 100644
--- a/src/gui/widgets/qspinbox.cpp
+++ b/src/gui/widgets/qspinbox.cpp
@@ -77,6 +77,8 @@ public:
QChar thousand;
inline void init() {
+ Q_Q(QSpinBox);
+ q->setInputMethodHints(Qt::ImhDigitsOnly);
setLayoutItemMargins(QStyle::SE_SpinBoxLayoutItem);
}
};
@@ -97,6 +99,11 @@ public:
// variables
int decimals;
QChar delimiter, thousand;
+
+ inline void init() {
+ Q_Q(QDoubleSpinBox);
+ q->setInputMethodHints(Qt::ImhFormattedNumbersOnly);
+ }
};
@@ -592,6 +599,8 @@ void QSpinBox::fixup(QString &input) const
QDoubleSpinBox::QDoubleSpinBox(QWidget *parent)
: QAbstractSpinBox(*new QDoubleSpinBoxPrivate(parent), parent)
{
+ Q_D(QDoubleSpinBox);
+ d->init();
}
/*!
diff --git a/src/gui/widgets/qsplitter.cpp b/src/gui/widgets/qsplitter.cpp
index bf8af35..45e838f 100644
--- a/src/gui/widgets/qsplitter.cpp
+++ b/src/gui/widgets/qsplitter.cpp
@@ -1517,7 +1517,7 @@ void QSplitter::setOpaqueResize(bool on)
/*!
\fn int QSplitter::margin() const
- Returns the with of the the margin around the contents of the widget.
+ Returns the width of the margin around the contents of the widget.
Use QWidget::getContentsMargins() instead.
\sa setMargin(), QWidget::getContentsMargins()
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index 69221ba..785d772 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -1536,9 +1536,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.
@@ -1805,7 +1806,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);
@@ -1813,7 +1816,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/gui/widgets/qtabwidget.cpp b/src/gui/widgets/qtabwidget.cpp
index c16e000..43b2f54 100644
--- a/src/gui/widgets/qtabwidget.cpp
+++ b/src/gui/widgets/qtabwidget.cpp
@@ -504,7 +504,7 @@ QIcon QTabWidget::tabIcon(int index) const
}
/*!
- Returns true if the the page at position \a index is enabled; otherwise returns false.
+ Returns true if the page at position \a index is enabled; otherwise returns false.
\sa setTabEnabled(), QWidget::isEnabled()
*/
diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp
index 1c4df93..c1ec5c2 100644
--- a/src/gui/widgets/qtextedit.cpp
+++ b/src/gui/widgets/qtextedit.cpp
@@ -74,6 +74,10 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_TEXTEDIT
+static inline bool shouldEnableInputMethod(QTextEdit *textedit)
+{
+ return !textedit->isReadOnly();
+}
class QTextEditControl : public QTextControl
{
@@ -104,7 +108,7 @@ public:
QTextEditPrivate::QTextEditPrivate()
: control(0),
autoFormatting(QTextEdit::AutoNone), tabChangesFocus(false),
- lineWrap(QTextEdit::WidgetWidth), lineWrapColumnOrWidth(0),
+ lineWrap(QTextEdit::WidgetWidth), lineWrapColumnOrWidth(0), clickCausedFocus(0),
wordWrap(QTextOption::WrapAtWordBoundaryOrAnywhere), textFormat(Qt::AutoText)
{
ignoreAutomaticScrollbarAdjustment = false;
@@ -1559,6 +1563,12 @@ void QTextEdit::mouseReleaseEvent(QMouseEvent *e)
d->autoScrollTimer.stop();
ensureCursorVisible();
}
+ if (e->button() == Qt::LeftButton && qApp->autoSipEnabled()
+ && (!d->clickCausedFocus || qApp->autoSipOnMouseFocus())) {
+ QEvent event(QEvent::RequestSoftwareInputPanel);
+ QApplication::sendEvent(this, &event);
+ }
+ d->clickCausedFocus = 0;
}
/*! \reimp
@@ -1694,6 +1704,9 @@ QVariant QTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const
void QTextEdit::focusInEvent(QFocusEvent *e)
{
Q_D(QTextEdit);
+ if (e->reason() == Qt::MouseFocusReason) {
+ d->clickCausedFocus = 1;
+ }
QAbstractScrollArea::focusInEvent(e);
d->sendControlEvent(e);
}
@@ -2058,7 +2071,7 @@ void QTextEdit::setReadOnly(bool ro)
} else {
flags = Qt::TextEditorInteraction;
}
- setAttribute(Qt::WA_InputMethodEnabled, !ro);
+ setAttribute(Qt::WA_InputMethodEnabled, shouldEnableInputMethod(this));
d->control->setTextInteractionFlags(flags);
}
diff --git a/src/gui/widgets/qtextedit_p.h b/src/gui/widgets/qtextedit_p.h
index 3c37868..594174a 100644
--- a/src/gui/widgets/qtextedit_p.h
+++ b/src/gui/widgets/qtextedit_p.h
@@ -123,6 +123,7 @@ public:
uint preferRichText : 1;
uint showCursorOnInitialShow : 1;
uint inDrag : 1;
+ uint clickCausedFocus : 1;
// Qt3 COMPAT only, for setText
Qt::TextFormat textFormat;
diff --git a/src/gui/widgets/qtoolbox.cpp b/src/gui/widgets/qtoolbox.cpp
index 81935a5..271130a 100644
--- a/src/gui/widgets/qtoolbox.cpp
+++ b/src/gui/widgets/qtoolbox.cpp
@@ -802,7 +802,7 @@ void QToolBox::itemRemoved(int index)
/*!
\fn int QToolBox::margin() const
- Returns the with of the the margin around the contents of the widget.
+ Returns the width of the margin around the contents of the widget.
Use QWidget::getContentsMargins() instead.
\sa setMargin(), QWidget::getContentsMargins()
diff --git a/src/gui/widgets/widgets.pri b/src/gui/widgets/widgets.pri
index fc57944..9e226e2 100644
--- a/src/gui/widgets/widgets.pri
+++ b/src/gui/widgets/widgets.pri
@@ -78,8 +78,8 @@ HEADERS += \
widgets/qtoolbararealayout_p.h \
widgets/qplaintextedit.h \
widgets/qplaintextedit_p.h \
- widgets/qprintpreviewwidget.h
-
+ widgets/qprintpreviewwidget.h \
+ widgets/qactiontokeyeventmapper_p.h
SOURCES += \
widgets/qabstractbutton.cpp \
widgets/qabstractslider.cpp \
@@ -138,8 +138,8 @@ SOURCES += \
widgets/qwidgetanimator.cpp \
widgets/qtoolbararealayout.cpp \
widgets/qplaintextedit.cpp \
- widgets/qprintpreviewwidget.cpp
-
+ widgets/qprintpreviewwidget.cpp \
+ widgets/qactiontokeyeventmapper.cpp
!embedded:mac {
HEADERS += widgets/qmacnativewidget_mac.h \
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp
index 569d2fd..c54c420 100644
--- a/src/network/access/qftp.cpp
+++ b/src/network/access/qftp.cpp
@@ -314,8 +314,10 @@ void QFtpDTP::connectToHost(const QString & host, quint16 port)
{
bytesFromSocket.clear();
- if (socket)
+ if (socket) {
delete socket;
+ socket = 0;
+ }
socket = new QTcpSocket(this);
socket->setObjectName(QLatin1String("QFtpDTP Passive state socket"));
connect(socket, SIGNAL(connected()), SLOT(socketConnected()));
@@ -1658,11 +1660,12 @@ QFtp::QFtp(QObject *parent, const char *name)
*/
int QFtp::connectToHost(const QString &host, quint16 port)
{
- d_func()->pi.transferConnectionExtended = true;
QStringList cmds;
cmds << host;
cmds << QString::number((uint)port);
- return d_func()->addCommand(new QFtpCommand(ConnectToHost, cmds));
+ int id = d_func()->addCommand(new QFtpCommand(ConnectToHost, cmds));
+ d_func()->pi.transferConnectionExtended = true;
+ return id;
}
/*!
@@ -1721,9 +1724,10 @@ int QFtp::close()
*/
int QFtp::setTransferMode(TransferMode mode)
{
+ int id = d_func()->addCommand(new QFtpCommand(SetTransferMode, QStringList()));
d_func()->pi.transferConnectionExtended = true;
d_func()->transferMode = mode;
- return d_func()->addCommand(new QFtpCommand(SetTransferMode, QStringList()));
+ return id;
}
/*!
diff --git a/src/network/access/qhttp.cpp b/src/network/access/qhttp.cpp
index 96ccc91..332c67b 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
{
@@ -624,7 +624,6 @@ QHttpHeader::QHttpHeader(QHttpHeaderPrivate &dd, const QHttpHeader &header)
*/
QHttpHeader::~QHttpHeader()
{
- delete d_ptr;
}
/*!
@@ -950,7 +949,7 @@ void QHttpHeader::setContentLength(int len)
}
/*!
- Returns true if the header has an entry for the the special HTTP
+ Returns true if the header has an entry for the special HTTP
header field \c content-type; otherwise returns false.
\sa contentType() setContentType()
diff --git a/src/network/access/qhttp.h b/src/network/access/qhttp.h
index 771176a..d575644 100644
--- a/src/network/access/qhttp.h
+++ b/src/network/access/qhttp.h
@@ -46,6 +46,7 @@
#include <QtCore/qstringlist.h>
#include <QtCore/qmap.h>
#include <QtCore/qpair.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -108,7 +109,7 @@ protected:
QHttpHeader(QHttpHeaderPrivate &dd, const QString &str = QString());
QHttpHeader(QHttpHeaderPrivate &dd, const QHttpHeader &header);
- QHttpHeaderPrivate *d_ptr;
+ QScopedPointer<QHttpHeaderPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QHttpHeader)
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index ae518df..cec9c87 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -77,8 +77,10 @@ QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(const QString &host
QHttpNetworkConnectionPrivate::~QHttpNetworkConnectionPrivate()
{
for (int i = 0; i < channelCount; ++i) {
- channels[i].socket->close();
- delete channels[i].socket;
+ if (channels[i].socket) {
+ channels[i].socket->close();
+ delete channels[i].socket;
+ }
}
}
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index 09bd459..0f80bd9 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -244,8 +244,8 @@ public:
#ifndef QT_NO_OPENSSL
bool ignoreSSLErrors;
#endif
- Channel() :state(IdleState), reply(0), written(0), bytesTotal(0), resendCurrent(false), reconnectAttempts(2),
- authMehtod(QAuthenticatorPrivate::None), proxyAuthMehtod(QAuthenticatorPrivate::None)
+ Channel() : socket(0), state(IdleState), reply(0), written(0), bytesTotal(0), resendCurrent(false),
+ reconnectAttempts(2), authMehtod(QAuthenticatorPrivate::None), proxyAuthMehtod(QAuthenticatorPrivate::None)
#ifndef QT_NO_OPENSSL
, ignoreSSLErrors(false)
#endif
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index f214699..4874d9d 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -605,6 +605,7 @@ void QNetworkAccessHttpBackend::open()
QNetworkAccessCache *cache = QNetworkAccessManagerPrivate::getCache(this);
if ((http = static_cast<QNetworkAccessHttpBackendCache *>(cache->requestEntryNow(cacheKey))) == 0) {
// no entry in cache; create an object
+ //### thiago: can we try/catch/ignore this????
http = new QNetworkAccessHttpBackendCache(url.host(), url.port(), encrypt);
#ifndef QT_NO_NETWORKPROXY
@@ -732,10 +733,15 @@ void QNetworkAccessHttpBackend::replyFinished()
// store the SSL configuration now
// once we call finished(), we won't have access to httpReply anymore
QSslConfiguration sslConfig = httpReply->sslConfiguration();
- if (pendingSslConfiguration)
+ if (pendingSslConfiguration) {
*pendingSslConfiguration = sslConfig;
- else if (!sslConfig.isNull())
- pendingSslConfiguration = new QSslConfiguration(sslConfig);
+ } else if (!sslConfig.isNull()) {
+ QT_TRY {
+ pendingSslConfiguration = new QSslConfiguration(sslConfig);
+ } QT_CATCH(...) {
+ qWarning("QNetworkAccess: could not allocate a QSslConfiguration object for a SSL connection.");
+ }
+ }
#endif
finished();
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index bcbeef1..38e8af9 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -748,8 +748,8 @@ void QNetworkAccessManagerPrivate::createCookieJar() const
if (!cookieJarCreated) {
// keep the ugly hack in here
QNetworkAccessManagerPrivate *that = const_cast<QNetworkAccessManagerPrivate *>(this);
- that->cookieJarCreated = true;
that->cookieJar = new QNetworkCookieJar(that->q_func());
+ that->cookieJarCreated = true;
}
}
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index 892929e..daa2335 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -43,6 +43,7 @@
#include "qnetworkdiskcache.h"
#include "qnetworkdiskcache_p.h"
+#include "QtCore/qscopedpointer.h"
#include <qfile.h>
#include <qdir.h>
@@ -180,8 +181,7 @@ QIODevice *QNetworkDiskCache::prepare(const QNetworkCacheMetaData &metaData)
break;
}
}
-
- QCacheItem *cacheItem = new QCacheItem;
+ QScopedPointer<QCacheItem> cacheItem(new QCacheItem);
cacheItem->metaData = metaData;
QIODevice *device = 0;
@@ -190,16 +190,20 @@ QIODevice *QNetworkDiskCache::prepare(const QNetworkCacheMetaData &metaData)
device = &(cacheItem->data);
} else {
QString templateName = d->tmpCacheFileName();
- cacheItem->file = new QTemporaryFile(templateName, &cacheItem->data);
- if (!cacheItem->file->open()) {
+ QT_TRY {
+ cacheItem->file = new QTemporaryFile(templateName, &cacheItem->data);
+ } QT_CATCH(...) {
+ cacheItem->file = 0;
+ }
+ if (!cacheItem->file || !cacheItem->file->open()) {
qWarning() << "QNetworkDiskCache::prepare() unable to open temporary file";
- delete cacheItem;
+ cacheItem.reset();
return 0;
}
cacheItem->writeHeader(cacheItem->file);
device = cacheItem->file;
}
- d->inserting[device] = cacheItem;
+ d->inserting[device] = cacheItem.take();
return device;
}
@@ -358,31 +362,28 @@ QIODevice *QNetworkDiskCache::data(const QUrl &url)
qDebug() << "QNetworkDiskCache::data()" << url;
#endif
Q_D(QNetworkDiskCache);
- QBuffer *buffer = 0;
+ QScopedPointer<QBuffer> buffer;
if (!url.isValid())
- return buffer;
+ return 0;
if (d->lastItem.metaData.url() == url && d->lastItem.data.isOpen()) {
- buffer = new QBuffer;
+ buffer.reset(new QBuffer);
buffer->setData(d->lastItem.data.data());
} else {
- QFile *file = new QFile(d->cacheFileName(url));
- if (!file->open(QFile::ReadOnly | QIODevice::Unbuffered)) {
- delete file;
+ QScopedPointer<QFile> file(new QFile(d->cacheFileName(url)));
+ if (!file->open(QFile::ReadOnly | QIODevice::Unbuffered))
return 0;
- }
- if (!d->lastItem.read(file, true)) {
+
+ if (!d->lastItem.read(file.data(), true)) {
file->close();
remove(url);
- delete file;
return 0;
}
if (d->lastItem.data.isOpen()) {
// compressed
- buffer = new QBuffer;
+ buffer.reset(new QBuffer);
buffer->setData(d->lastItem.data.data());
- delete file;
} else {
- buffer = new QBuffer;
+ buffer.reset(new QBuffer);
// ### verify that QFile uses the fd size and not the file name
qint64 size = file->size() - file->pos();
const uchar *p = 0;
@@ -390,16 +391,15 @@ QIODevice *QNetworkDiskCache::data(const QUrl &url)
p = file->map(file->pos(), size);
#endif
if (p) {
- file->setParent(buffer);
buffer->setData((const char *)p, size);
+ file.take()->setParent(buffer.data());
} else {
buffer->setData(file->readAll());
- delete file;
}
}
}
buffer->open(QBuffer::ReadOnly);
- return buffer;
+ return buffer.take();
}
/*!
@@ -494,21 +494,21 @@ qint64 QNetworkDiskCache::expire()
QDir::Filters filters = QDir::AllDirs | QDir:: Files | QDir::NoDotAndDotDot;
QDirIterator it(cacheDirectory(), filters, QDirIterator::Subdirectories);
- QMap<QDateTime, QString> cacheItems;
+ QMultiMap<QDateTime, QString> cacheItems;
qint64 totalSize = 0;
while (it.hasNext()) {
QString path = it.next();
QFileInfo info = it.fileInfo();
QString fileName = info.fileName();
if (fileName.endsWith(CACHE_POSTFIX) && fileName.startsWith(CACHE_PREFIX)) {
- cacheItems[info.created()] = path;
+ cacheItems.insert(info.created(), path);
totalSize += info.size();
}
}
int removedFiles = 0;
qint64 goal = (maximumCacheSize() * 9) / 10;
- QMap<QDateTime, QString>::const_iterator i = cacheItems.constBegin();
+ QMultiMap<QDateTime, QString>::const_iterator i = cacheItems.constBegin();
while (i != cacheItems.constEnd()) {
if (totalSize < goal)
break;
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 79c3d1a..6f715e5 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -382,7 +382,8 @@ void QNetworkReplyImplPrivate::feed(const QByteArray &data)
void QNetworkReplyImplPrivate::feed(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/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index 4f9ea52..2ff561a 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -216,10 +216,9 @@ public:
url = other.url;
#ifndef QT_NO_OPENSSL
+ sslConfiguration = 0;
if (other.sslConfiguration)
sslConfiguration = new QSslConfiguration(*other.sslConfiguration);
- else
- sslConfiguration = 0;
#endif
}
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index b225c17..a3634ce 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -523,7 +523,7 @@ QHostAddress::QHostAddress(const struct sockaddr *sockaddr)
Constructs a copy of the given \a address.
*/
QHostAddress::QHostAddress(const QHostAddress &address)
- : d(new QHostAddressPrivate(*address.d))
+ : d(new QHostAddressPrivate(*address.d.data()))
{
}
@@ -559,7 +559,6 @@ QHostAddress::QHostAddress(SpecialAddress address)
*/
QHostAddress::~QHostAddress()
{
- delete d;
}
/*!
@@ -568,7 +567,7 @@ QHostAddress::~QHostAddress()
*/
QHostAddress &QHostAddress::operator=(const QHostAddress &address)
{
- *d = *address.d;
+ *d.data() = *address.d.data();
return *this;
}
diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h
index 02a6f97..857b4af 100644
--- a/src/network/kernel/qhostaddress.h
+++ b/src/network/kernel/qhostaddress.h
@@ -44,6 +44,7 @@
#include <QtCore/qpair.h>
#include <QtCore/qstring.h>
+#include <QtCore/qscopedpointer.h>
#include <QtNetwork/qabstractsocket.h>
struct sockaddr;
@@ -130,7 +131,7 @@ public:
static QPair<QHostAddress, int> parseSubnet(const QString &subnet);
protected:
- QHostAddressPrivate *d;
+ QScopedPointer<QHostAddressPrivate> d;
};
inline bool operator ==(QHostAddress::SpecialAddress address1, const QHostAddress &address2)
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index ca4124d..1858e02 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -42,6 +42,7 @@
#include "qhostinfo.h"
#include "qhostinfo_p.h"
+#include "QtCore/qscopedpointer.h"
#include <qabstracteventdispatcher.h>
#include <private/qunicodetables_p.h>
#include <qcoreapplication.h>
@@ -165,24 +166,24 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver,
// Support for IDNA
QString lookup = QString::fromLatin1(QUrl::toAce(name));
- QHostInfoResult *result = new QHostInfoResult;
- result->autoDelete = false;
- QObject::connect(result, SIGNAL(resultsReady(QHostInfo)),
+ QScopedPointer<QHostInfoResult> result(new QHostInfoResult);
+ result.data()->autoDelete = false;
+ QObject::connect(result.data(), SIGNAL(resultsReady(QHostInfo)),
receiver, member);
- int id = result->lookupId = theIdCounter.fetchAndAddRelaxed(1);
+ int id = result.data()->lookupId = theIdCounter.fetchAndAddRelaxed(1);
if (lookup.isEmpty()) {
QHostInfo info(id);
info.setError(QHostInfo::HostNotFound);
info.setErrorString(QObject::tr("No host name given"));
- QMetaObject::invokeMethod(result, "emitResultsReady", Qt::QueuedConnection,
+ QMetaObject::invokeMethod(result.data(), "emitResultsReady", Qt::QueuedConnection,
Q_ARG(QHostInfo, info));
- result->autoDelete = true;
+ result.take()->autoDelete = true;
return id;
}
QHostInfoAgent *agent = theAgent();
- agent->addHostName(lookup, result);
+ agent->addHostName(lookup, result.take());
#if !defined QT_NO_THREAD
if (!agent->isRunning())
@@ -327,7 +328,7 @@ QHostInfo::QHostInfo(int id)
Constructs a copy of \a other.
*/
QHostInfo::QHostInfo(const QHostInfo &other)
- : d(new QHostInfoPrivate(*other.d))
+ : d(new QHostInfoPrivate(*other.d.data()))
{
}
@@ -337,7 +338,7 @@ QHostInfo::QHostInfo(const QHostInfo &other)
*/
QHostInfo &QHostInfo::operator=(const QHostInfo &other)
{
- *d = *other.d;
+ *d.data() = *other.d.data();
return *this;
}
@@ -346,7 +347,6 @@ QHostInfo &QHostInfo::operator=(const QHostInfo &other)
*/
QHostInfo::~QHostInfo()
{
- delete d;
}
/*!
diff --git a/src/network/kernel/qhostinfo.h b/src/network/kernel/qhostinfo.h
index 084ec89..c68b111 100644
--- a/src/network/kernel/qhostinfo.h
+++ b/src/network/kernel/qhostinfo.h
@@ -43,6 +43,7 @@
#define QHOSTINFO_H
#include <QtCore/qlist.h>
+#include <QtCore/qscopedpointer.h>
#include <QtNetwork/qhostaddress.h>
QT_BEGIN_HEADER
@@ -91,7 +92,7 @@ public:
static QString localDomainName();
private:
- QHostInfoPrivate *d;
+ QScopedPointer<QHostInfoPrivate> d;
};
QT_END_NAMESPACE
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 3271deb..f5d7166 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -320,6 +320,8 @@ QString QHostInfo::localDomainName()
if (local_res_ninit) {
// using thread-safe version
res_state_ptr state = res_state_ptr(qMalloc(sizeof(*state)));
+ if (!state)
+ qBadAlloc();
memset(state, 0, sizeof(*state));
local_res_ninit(state);
QString domainName = QUrl::fromAce(state->defdname);
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 a339388..f8fff88 100644
--- a/src/network/kernel/qnetworkinterface.cpp
+++ b/src/network/kernel/qnetworkinterface.cpp
@@ -170,7 +170,7 @@ QNetworkAddressEntry::QNetworkAddressEntry()
object \a other.
*/
QNetworkAddressEntry::QNetworkAddressEntry(const QNetworkAddressEntry &other)
- : d(new QNetworkAddressEntryPrivate(*other.d))
+ : d(new QNetworkAddressEntryPrivate(*other.d.data()))
{
}
@@ -179,7 +179,7 @@ QNetworkAddressEntry::QNetworkAddressEntry(const QNetworkAddressEntry &other)
*/
QNetworkAddressEntry &QNetworkAddressEntry::operator=(const QNetworkAddressEntry &other)
{
- *d = *other.d;
+ *d.data() = *other.d.data();
return *this;
}
@@ -188,7 +188,6 @@ QNetworkAddressEntry &QNetworkAddressEntry::operator=(const QNetworkAddressEntry
*/
QNetworkAddressEntry::~QNetworkAddressEntry()
{
- delete d;
}
/*!
@@ -397,7 +396,7 @@ QNetworkInterface::~QNetworkInterface()
}
/*!
- Creates a copy of the the QNetworkInterface object contained in \a
+ Creates a copy of the QNetworkInterface object contained in \a
other.
*/
QNetworkInterface::QNetworkInterface(const QNetworkInterface &other)
diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h
index 09fbd0f..dd16550 100644
--- a/src/network/kernel/qnetworkinterface.h
+++ b/src/network/kernel/qnetworkinterface.h
@@ -43,6 +43,7 @@
#define QNETWORKINTERFACE_H
#include <QtCore/qshareddata.h>
+#include <QtCore/qscopedpointer.h>
#include <QtNetwork/qhostaddress.h>
#ifndef QT_NO_NETWORKINTERFACE
@@ -79,7 +80,7 @@ public:
void setBroadcast(const QHostAddress &newBroadcast);
private:
- QNetworkAddressEntryPrivate *d;
+ QScopedPointer<QNetworkAddressEntryPrivate> d;
};
class QNetworkInterfacePrivate;
diff --git a/src/network/kernel/qnetworkinterface_symbian.cpp b/src/network/kernel/qnetworkinterface_symbian.cpp
index 82c673f..59f1c02 100644
--- a/src/network/kernel/qnetworkinterface_symbian.cpp
+++ b/src/network/kernel/qnetworkinterface_symbian.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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/network/kernel/qnetworkinterface_win.cpp b/src/network/kernel/qnetworkinterface_win.cpp
index de97629..c783c33 100644
--- a/src/network/kernel/qnetworkinterface_win.cpp
+++ b/src/network/kernel/qnetworkinterface_win.cpp
@@ -115,6 +115,8 @@ static QHash<QHostAddress, QHostAddress> ipv4Netmasks()
if (retval == ERROR_BUFFER_OVERFLOW) {
// need more memory
pAdapter = (IP_ADAPTER_INFO *)qMalloc(bufSize);
+ if (!pAdapter)
+ return ipv4netmasks;
// try again
if (ptrGetAdaptersInfo(pAdapter, &bufSize) != ERROR_SUCCESS) {
qFree(pAdapter);
@@ -156,7 +158,8 @@ static QList<QNetworkInterfacePrivate *> interfaceListingWinXP()
if (retval == ERROR_BUFFER_OVERFLOW) {
// need more memory
pAdapter = (IP_ADAPTER_ADDRESSES *)qMalloc(bufSize);
-
+ if (!pAdapter)
+ return interfaces;
// try again
if (ptrGetAdaptersAddresses(AF_UNSPEC, flags, NULL, pAdapter, &bufSize) != ERROR_SUCCESS) {
qFree(pAdapter);
@@ -236,7 +239,8 @@ static QList<QNetworkInterfacePrivate *> interfaceListingWin2k()
if (retval == ERROR_BUFFER_OVERFLOW) {
// need more memory
pAdapter = (IP_ADAPTER_INFO *)qMalloc(bufSize);
-
+ if (!pAdapter)
+ return interfaces;
// try again
if (ptrGetAdaptersInfo(pAdapter, &bufSize) != ERROR_SUCCESS) {
qFree(pAdapter);
@@ -306,7 +310,8 @@ QString QHostInfo::localDomainName()
pinfo = &info;
if (ptrGetNetworkParams(pinfo, &bufSize) == ERROR_BUFFER_OVERFLOW) {
pinfo = (FIXED_INFO *)qMalloc(bufSize);
-
+ if (!pinfo)
+ return QString();
// try again
if (ptrGetNetworkParams(pinfo, &bufSize) != ERROR_SUCCESS) {
qFree(pinfo);
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 67e32fe..b6f91e4 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}
*/
/*!
@@ -1128,7 +1130,7 @@ bool QAbstractSocketPrivate::readFromSocket()
/*! \internal
- Sets up the the internal state after the connection has succeeded.
+ Sets up the internal state after the connection has succeeded.
*/
void QAbstractSocketPrivate::fetchConnectionParameters()
{
@@ -1865,9 +1867,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()
*/
@@ -2164,7 +2166,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()
*/
@@ -2457,7 +2464,8 @@ QNetworkProxy QAbstractSocket::proxy() const
#endif // QT_NO_NETWORKPROXY
#ifdef QT3_SUPPORT
-/*! \enum QAbstractSocket::Error
+/*!
+ \enum QAbstractSocket::Error
\compat
Use QAbstractSocket::SocketError instead.
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/qlocalserver.cpp b/src/network/socket/qlocalserver.cpp
index d6b1507..35701a7 100644
--- a/src/network/socket/qlocalserver.cpp
+++ b/src/network/socket/qlocalserver.cpp
@@ -276,6 +276,10 @@ QLocalSocket *QLocalServer::nextPendingConnection()
if (d->pendingConnections.isEmpty())
return 0;
QLocalSocket *nextSocket = d->pendingConnections.dequeue();
+#ifdef Q_OS_SYMBIAN
+ if(!d->socketNotifier)
+ return nextSocket;
+#endif
#ifndef Q_OS_WIN
d->socketNotifier->setEnabled(d->pendingConnections.size()
<= d->maxPendingConnections);
diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp
index 2471043..03723cf 100644
--- a/src/network/socket/qlocalsocket_unix.cpp
+++ b/src/network/socket/qlocalsocket_unix.cpp
@@ -237,7 +237,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode)
QLatin1String("QLocalSocket::connectToServer"));
return;
}
-
+#ifndef Q_OS_SYMBIAN
// set non blocking so we can try to connect and it wont wait
int flags = fcntl(d->connectingSocket, F_GETFL, 0);
if (-1 == flags
@@ -246,6 +246,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode)
QLatin1String("QLocalSocket::connectToServer"));
return;
}
+#endif
// _q_connectToSocket does the actual connecting
d->connectingName = name;
@@ -304,7 +305,7 @@ void QLocalSocketPrivate::_q_connectToSocket()
case EAGAIN:
// Try again later, all of the sockets listening are full
if (!delayConnect) {
- delayConnect = new QSocketNotifier(connectingSocket, QSocketNotifier::Write);
+ delayConnect = new QSocketNotifier(connectingSocket, QSocketNotifier::Write, q);
q->connect(delayConnect, SIGNAL(activated(int)), q, SLOT(_q_connectToSocket()));
}
if (!connectTimer) {
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index 39c9284..ace3bc5 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -144,7 +144,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode)
0, // no sharing
NULL, // default security attributes
OPEN_EXISTING, // opens existing pipe
- 0, // default attributes
+ FILE_FLAG_OVERLAPPED,
NULL); // no template file
}, {
localSocket = CreateFileA(
@@ -153,7 +153,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode)
0, // no sharing
NULL, // default security attributes
OPEN_EXISTING, // opens existing pipe
- 0, // default attributes
+ FILE_FLAG_OVERLAPPED,
NULL); // no template file
});
if (localSocket != INVALID_HANDLE_VALUE)
diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h
index 515ad84..95ffba5 100644
--- a/src/network/socket/qnativesocketengine_p.h
+++ b/src/network/socket/qnativesocketengine_p.h
@@ -55,9 +55,9 @@
#include "QtNetwork/qhostaddress.h"
#include "private/qabstractsocketengine_p.h"
#ifndef Q_OS_WIN
-#include "qplatformdefs.h"
+# include "qplatformdefs.h"
#else
-#include <Winsock2.h> // sockaddr_storage, sockaddr_in
+# include <winsock2.h>
#endif
#ifdef Q_OS_SYMBIAN
@@ -227,6 +227,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 a3f62db..5136978 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -122,36 +122,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)) {
+ if (::if_indextoname(s->a6.sin6_scope_id, scopeid)) {
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;
}
}
@@ -547,26 +545,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 = qt_socket_recvfrom(socketDescriptor, &c, 1, MSG_PEEK, storagePtr, &storageSize);
+ readBytes = qt_socket_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
@@ -618,11 +606,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);
@@ -631,13 +615,13 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxS
do {
char c;
recvFromResult = qt_socket_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)
@@ -716,21 +700,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 (qt_socket_getsockname(socketDescriptor, sockAddrPtr, &sockAddrSize) == 0) {
- qt_socket_getPortAndAddress(sockAddrPtr, &localPort, &localAddress);
+ if (qt_socket_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;
@@ -750,8 +729,8 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters()
}
// Determine the remote address
- if (!qt_socket_getpeername(socketDescriptor, sockAddrPtr, &sockAddrSize))
- qt_socket_getPortAndAddress(sockAddrPtr, &peerPort, &peerAddress);
+ if (!qt_socket_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..8c6cd31 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
@@ -605,6 +570,11 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin
socketState = QAbstractSocket::UnconnectedState;
break;
}
+ if (value == WSAEHOSTUNREACH) {
+ setError(QAbstractSocket::NetworkError, HostUnreachableErrorString);
+ socketState = QAbstractSocket::UnconnectedState;
+ break;
+ }
}
// fall through
}
diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp
index b6b0e89..98666c2 100644
--- a/src/network/socket/qsocks5socketengine.cpp
+++ b/src/network/socket/qsocks5socketengine.cpp
@@ -1834,9 +1834,9 @@ QSocks5SocketEngineHandler::createSocketEngine(QAbstractSocket::SocketType socke
QSOCKS5_DEBUG << "not proxying";
return 0;
}
- QSocks5SocketEngine *engine = new QSocks5SocketEngine(parent);
+ QScopedPointer<QSocks5SocketEngine> engine(new QSocks5SocketEngine(parent));
engine->setProxy(proxy);
- return engine;
+ return engine.take();
}
QAbstractSocketEngine *QSocks5SocketEngineHandler::createSocketEngine(int socketDescriptor, QObject *parent)
diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp
index c1fedc3..1978ee2 100644
--- a/src/network/socket/qtcpserver.cpp
+++ b/src/network/socket/qtcpserver.cpp
@@ -354,7 +354,12 @@ void QTcpServer::close()
if (d->socketEngine) {
d->socketEngine->close();
- d->socketEngine->deleteLater();
+ QT_TRY {
+ d->socketEngine->deleteLater();
+ } QT_CATCH(const std::bad_alloc &) {
+ // in out of memory situations, the socketEngine
+ // will be deleted in ~QTcpServer (it's a child-object of this)
+ }
d->socketEngine = 0;
}
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index a2ba644..c4aa43e 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -155,7 +155,7 @@ QSslCertificate::QSslCertificate(const QByteArray &data, QSsl::EncodingFormat fo
/*!
Constructs an identical copy of \a other.
*/
-QSslCertificate::QSslCertificate(const QSslCertificate &other) : d(other.d)
+QSslCertificate::QSslCertificate(const QSslCertificate &other) : d(other.d.data())
{
d->ref.ref();
}
@@ -165,8 +165,6 @@ QSslCertificate::QSslCertificate(const QSslCertificate &other) : d(other.d)
*/
QSslCertificate::~QSslCertificate()
{
- if (!d->ref.deref())
- delete d;
}
/*!
@@ -175,7 +173,7 @@ QSslCertificate::~QSslCertificate()
*/
QSslCertificate &QSslCertificate::operator=(const QSslCertificate &other)
{
- qAtomicAssign(d, other.d);
+ d.assign(other.d.data());
return *this;
}
@@ -241,12 +239,7 @@ void QSslCertificate::clear()
{
if (isNull())
return;
- if (d->ref == 1)
- delete d;
- else
- d->ref.deref();
-
- d = new QSslCertificatePrivate;
+ d.reset(new QSslCertificatePrivate);
}
/*!
@@ -267,7 +260,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
diff --git a/src/network/ssl/qsslcertificate.h b/src/network/ssl/qsslcertificate.h
index d4597cd..19152fb 100644
--- a/src/network/ssl/qsslcertificate.h
+++ b/src/network/ssl/qsslcertificate.h
@@ -118,7 +118,7 @@ public:
Qt::HANDLE handle() const;
private:
- QSslCertificatePrivate *d;
+ QScopedSharedPointer<QSslCertificatePrivate> d;
friend class QSslCertificatePrivate;
friend class QSslSocketBackendPrivate;
};
diff --git a/src/network/ssl/qsslcipher.cpp b/src/network/ssl/qsslcipher.cpp
index 7fec2df..a72879d 100644
--- a/src/network/ssl/qsslcipher.cpp
+++ b/src/network/ssl/qsslcipher.cpp
@@ -103,7 +103,7 @@ QSslCipher::QSslCipher(const QString &name, QSsl::SslProtocol protocol)
QSslCipher::QSslCipher(const QSslCipher &other)
: d(new QSslCipherPrivate)
{
- *d = *other.d;
+ *d.data() = *other.d.data();
}
/*!
@@ -111,7 +111,6 @@ QSslCipher::QSslCipher(const QSslCipher &other)
*/
QSslCipher::~QSslCipher()
{
- delete d;
}
/*!
@@ -120,7 +119,7 @@ QSslCipher::~QSslCipher()
*/
QSslCipher &QSslCipher::operator=(const QSslCipher &other)
{
- *d = *other.d;
+ *d.data() = *other.d.data();
return *this;
}
diff --git a/src/network/ssl/qsslcipher.h b/src/network/ssl/qsslcipher.h
index 404dc3d..d9ac7a9 100644
--- a/src/network/ssl/qsslcipher.h
+++ b/src/network/ssl/qsslcipher.h
@@ -44,6 +44,7 @@
#define QSSLCIPHER_H
#include <QtCore/qstring.h>
+#include <QtCore/qscopedpointer.h>
#include <QtNetwork/qssl.h>
QT_BEGIN_HEADER
@@ -78,7 +79,7 @@ public:
QSsl::SslProtocol protocol() const;
private:
- QSslCipherPrivate *d;
+ QScopedPointer<QSslCipherPrivate> d;
friend class QSslSocketBackendPrivate;
};
diff --git a/src/network/ssl/qsslerror.cpp b/src/network/ssl/qsslerror.cpp
index 3096fee..280c659 100644
--- a/src/network/ssl/qsslerror.cpp
+++ b/src/network/ssl/qsslerror.cpp
@@ -140,7 +140,7 @@ QSslError::QSslError(SslError error, const QSslCertificate &certificate)
QSslError::QSslError(const QSslError &other)
: d(new QSslErrorPrivate)
{
- *d = *other.d;
+ *d.data() = *other.d.data();
}
/*!
@@ -148,7 +148,6 @@ QSslError::QSslError(const QSslError &other)
*/
QSslError::~QSslError()
{
- delete d;
}
/*!
@@ -158,7 +157,7 @@ QSslError::~QSslError()
*/
QSslError &QSslError::operator=(const QSslError &other)
{
- *d = *other.d;
+ *d.data() = *other.d.data();
return *this;
}
diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h
index 50cc142..8b8ebff 100644
--- a/src/network/ssl/qsslerror.h
+++ b/src/network/ssl/qsslerror.h
@@ -105,7 +105,7 @@ public:
QSslCertificate certificate() const;
private:
- QSslErrorPrivate *d;
+ QScopedPointer<QSslErrorPrivate> d;
};
#ifndef QT_NO_DEBUG_STREAM
diff --git a/src/network/ssl/qsslkey.cpp b/src/network/ssl/qsslkey.cpp
index 8d550c0..d076112 100644
--- a/src/network/ssl/qsslkey.cpp
+++ b/src/network/ssl/qsslkey.cpp
@@ -269,7 +269,7 @@ QSslKey::QSslKey(QIODevice *device, QSsl::KeyAlgorithm algorithm, QSsl::Encoding
/*!
Constructs an identical copy of \a other.
*/
-QSslKey::QSslKey(const QSslKey &other) : d(other.d)
+QSslKey::QSslKey(const QSslKey &other) : d(other.d.data())
{
d->ref.ref();
}
@@ -279,8 +279,6 @@ QSslKey::QSslKey(const QSslKey &other) : d(other.d)
*/
QSslKey::~QSslKey()
{
- if (!d->ref.deref())
- delete d;
}
/*!
@@ -291,7 +289,7 @@ QSslKey::~QSslKey()
*/
QSslKey &QSslKey::operator=(const QSslKey &other)
{
- qAtomicAssign(d, other.d);
+ d.assign(other.d.data());
return *this;
}
@@ -312,10 +310,13 @@ bool QSslKey::isNull() const
*/
void QSslKey::clear()
{
- if (!d->ref.deref()) {
- delete d;
- d = new QSslKeyPrivate;
- }
+ d.reset(new QSslKeyPrivate);
+
+ //### old code: is this really correct???
+ //if (!d->ref.deref()) {
+ // delete d;
+ // d = new QSslKeyPrivate;
+ //}
}
/*!
diff --git a/src/network/ssl/qsslkey.h b/src/network/ssl/qsslkey.h
index 45d03f7..d5d60a6 100644
--- a/src/network/ssl/qsslkey.h
+++ b/src/network/ssl/qsslkey.h
@@ -45,6 +45,7 @@
#include <QtCore/qnamespace.h>
#include <QtCore/qbytearray.h>
+#include <QtCore/qscopedpointer.h>
#include <QtNetwork/qssl.h>
QT_BEGIN_HEADER
@@ -92,7 +93,7 @@ public:
inline bool operator!=(const QSslKey &key) const { return !operator==(key); }
private:
- QSslKeyPrivate *d;
+ QScopedSharedPointer<QSslKeyPrivate> d;
friend class QSslCertificate;
};
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 6f8cf42..cb101af 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -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/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index 42c09f5..0723822 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -231,10 +231,16 @@ DEFINEFUNC3(DSA *, d2i_DSAPrivateKey, DSA **a, a, unsigned char **b, b, long c,
DEFINEFUNC(void, OPENSSL_add_all_algorithms_noconf, void, DUMMYARG, return, DUMMYARG)
DEFINEFUNC(void, OPENSSL_add_all_algorithms_conf, void, DUMMYARG, return, DUMMYARG)
+#ifdef Q_OS_SYMBIAN
+#define RESOLVEFUNC(func, ordinal, lib) \
+ if (!(_q_##func = _q_PTR_##func(lib->resolve(#ordinal)))) \
+ qWarning("QSslSocket: cannot resolve "#func);
+#else
#define RESOLVEFUNC(func) \
if (!(_q_##func = _q_PTR_##func(libs.first->resolve(#func))) \
&& !(_q_##func = _q_PTR_##func(libs.second->resolve(#func)))) \
qWarning("QSslSocket: cannot resolve "#func);
+#endif
#if !defined QT_LINKED_OPENSSL
@@ -335,7 +341,24 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
pair.first = ssleay32;
pair.second = libeay32;
return pair;
+# elif defined(Q_OS_SYMBIAN)
+ QLibrary *libssl = new QLibrary(QLatin1String("libssl"));
+ if (!libssl->load()) {
+ // Cannot find ssleay32.dll
+ delete libssl;
+ return pair;
+ }
+ QLibrary *libcrypto = new QLibrary(QLatin1String("libcrypto"));
+ if (!libcrypto->load()) {
+ delete libcrypto;
+ delete libssl;
+ return pair;
+ }
+
+ pair.first = libssl;
+ pair.second = libcrypto;
+ return pair;
# elif defined(Q_OS_UNIX)
QLibrary *&libssl = pair.first;
QLibrary *&libcrypto = pair.second;
@@ -437,6 +460,127 @@ bool q_resolveOpenSslSymbols()
// failed to load them
return false;
+#ifdef Q_OS_SYMBIAN
+#ifdef SSLEAY_MACROS
+ RESOLVEFUNC(ASN1_dup, 125, libs.second )
+#endif
+ RESOLVEFUNC(ASN1_STRING_data, 71, libs.second )
+ RESOLVEFUNC(ASN1_STRING_length, 76, libs.second )
+ RESOLVEFUNC(BIO_ctrl, 184, libs.second )
+ RESOLVEFUNC(BIO_free, 209, libs.second )
+ RESOLVEFUNC(BIO_new, 222, libs.second )
+ RESOLVEFUNC(BIO_new_mem_buf, 230, libs.second )
+ RESOLVEFUNC(BIO_read, 244, libs.second )
+ RESOLVEFUNC(BIO_s_mem, 251, libs.second )
+ RESOLVEFUNC(BIO_write, 269, libs.second )
+ RESOLVEFUNC(BN_num_bits, 387, libs.second )
+ RESOLVEFUNC(CRYPTO_free, 469, libs.second )
+ RESOLVEFUNC(CRYPTO_num_locks, 500, libs.second )
+ RESOLVEFUNC(CRYPTO_set_id_callback, 513, libs.second )
+ RESOLVEFUNC(CRYPTO_set_locking_callback, 516, libs.second )
+ RESOLVEFUNC(DSA_free, 594, libs.second )
+ RESOLVEFUNC(ERR_error_string, 744, libs.second )
+ RESOLVEFUNC(ERR_get_error, 749, libs.second )
+ RESOLVEFUNC(EVP_des_ede3_cbc, 919, libs.second )
+ RESOLVEFUNC(EVP_PKEY_assign, 859, libs.second )
+ RESOLVEFUNC(EVP_PKEY_free, 867, libs.second )
+ RESOLVEFUNC(EVP_PKEY_get1_DSA, 869, libs.second )
+ RESOLVEFUNC(EVP_PKEY_get1_RSA, 870, libs.second )
+ RESOLVEFUNC(EVP_PKEY_new, 876, libs.second )
+ RESOLVEFUNC(EVP_PKEY_type, 882, libs.second )
+ RESOLVEFUNC(OBJ_nid2sn, 1036, libs.second )
+ RESOLVEFUNC(OBJ_obj2nid, 1037, libs.second )
+#ifdef SSLEAY_MACROS // ### verify
+ RESOLVEFUNC(PEM_ASN1_read_bio, 1180, libs.second )
+#else
+ RESOLVEFUNC(PEM_read_bio_DSAPrivateKey, 1219, libs.second )
+ RESOLVEFUNC(PEM_read_bio_RSAPrivateKey, 1228, libs.second )
+ RESOLVEFUNC(PEM_write_bio_DSAPrivateKey, 1260, libs.second )
+ RESOLVEFUNC(PEM_write_bio_RSAPrivateKey, 1271, libs.second )
+#endif
+ RESOLVEFUNC(PEM_read_bio_DSA_PUBKEY, 1220, libs.second )
+ RESOLVEFUNC(PEM_read_bio_RSA_PUBKEY, 1230, libs.second )
+ RESOLVEFUNC(PEM_write_bio_DSA_PUBKEY, 1261, libs.second )
+ RESOLVEFUNC(PEM_write_bio_RSA_PUBKEY, 1273, libs.second )
+ RESOLVEFUNC(RAND_seed, 1426, libs.second )
+ RESOLVEFUNC(RAND_status, 1429, libs.second )
+ RESOLVEFUNC(RSA_free, 1450, libs.second )
+ RESOLVEFUNC(sk_free, 2571, libs.second )
+ RESOLVEFUNC(sk_num, 2576, libs.second )
+ RESOLVEFUNC(sk_value, 2585, libs.second )
+ RESOLVEFUNC(SSL_CIPHER_description, 11, libs.first )
+ RESOLVEFUNC(SSL_CTX_check_private_key, 21, libs.first )
+ RESOLVEFUNC(SSL_CTX_ctrl, 22, libs.first )
+ RESOLVEFUNC(SSL_CTX_free, 24, libs.first )
+ RESOLVEFUNC(SSL_CTX_new, 35, libs.first )
+ RESOLVEFUNC(SSL_CTX_set_cipher_list, 40, libs.first )
+ RESOLVEFUNC(SSL_CTX_set_default_verify_paths, 44, libs.first )
+ RESOLVEFUNC(SSL_CTX_set_verify, 56, libs.first )
+ RESOLVEFUNC(SSL_CTX_set_verify_depth, 57, libs.first )
+ RESOLVEFUNC(SSL_CTX_use_certificate, 64, libs.first )
+ RESOLVEFUNC(SSL_CTX_use_certificate_file, 67, libs.first )
+ RESOLVEFUNC(SSL_CTX_use_PrivateKey, 58, libs.first )
+ RESOLVEFUNC(SSL_CTX_use_RSAPrivateKey, 61, libs.first )
+ RESOLVEFUNC(SSL_CTX_use_PrivateKey_file, 60, libs.first )
+ RESOLVEFUNC(SSL_accept, 82, libs.first )
+ RESOLVEFUNC(SSL_clear, 92, libs.first )
+ RESOLVEFUNC(SSL_connect, 93, libs.first )
+ RESOLVEFUNC(SSL_free, 99, libs.first )
+ RESOLVEFUNC(SSL_get_ciphers, 104, libs.first )
+ RESOLVEFUNC(SSL_get_current_cipher, 106, libs.first )
+ RESOLVEFUNC(SSL_get_error, 110, libs.first )
+ RESOLVEFUNC(SSL_get_peer_cert_chain, 117, libs.first )
+ RESOLVEFUNC(SSL_get_peer_certificate, 118, libs.first )
+ RESOLVEFUNC(SSL_get_verify_result, 132, libs.first )
+ RESOLVEFUNC(SSL_library_init, 137, libs.first )
+ RESOLVEFUNC(SSL_load_error_strings, 139, libs.first )
+ RESOLVEFUNC(SSL_new, 140, libs.first )
+ RESOLVEFUNC(SSL_read, 143, libs.first )
+ RESOLVEFUNC(SSL_set_accept_state, 148, libs.first )
+ RESOLVEFUNC(SSL_set_bio, 149, libs.first )
+ RESOLVEFUNC(SSL_set_connect_state, 152, libs.first )
+ RESOLVEFUNC(SSL_shutdown, 173, libs.first )
+ RESOLVEFUNC(SSL_write, 188, libs.first )
+ RESOLVEFUNC(SSLv2_client_method, 192, libs.first )
+ RESOLVEFUNC(SSLv3_client_method, 195, libs.first )
+ RESOLVEFUNC(SSLv23_client_method, 189, libs.first )
+ RESOLVEFUNC(TLSv1_client_method, 198, libs.first )
+ RESOLVEFUNC(SSLv2_server_method, 194, libs.first )
+ RESOLVEFUNC(SSLv3_server_method, 197, libs.first )
+ RESOLVEFUNC(SSLv23_server_method, 191, libs.first )
+ RESOLVEFUNC(TLSv1_server_method, 200, libs.first )
+ RESOLVEFUNC(X509_NAME_oneline, 1830, libs.second )
+ RESOLVEFUNC(X509_PUBKEY_get, 1844, libs.second )
+ RESOLVEFUNC(X509_STORE_free, 1939, libs.second )
+ RESOLVEFUNC(X509_STORE_new, 1942, libs.second )
+ RESOLVEFUNC(X509_STORE_add_cert, 1936, libs.second )
+ RESOLVEFUNC(X509_STORE_CTX_free, 1907, libs.second )
+ RESOLVEFUNC(X509_STORE_CTX_init, 1919, libs.second )
+ RESOLVEFUNC(X509_STORE_CTX_new, 1920, libs.second )
+ RESOLVEFUNC(X509_STORE_CTX_set_purpose, 1931, libs.second )
+ RESOLVEFUNC(X509_cmp, 1992, libs.second )
+#ifndef SSLEAY_MACROS
+ RESOLVEFUNC(X509_dup, 1997, libs.second )
+#endif
+ RESOLVEFUNC(X509_EXTENSION_get_object, 1785, libs.second )
+ RESOLVEFUNC(X509_free, 2001, libs.second )
+ RESOLVEFUNC(X509_get_ext, 2012, libs.second )
+ RESOLVEFUNC(X509_get_ext_count, 2016, libs.second )
+ RESOLVEFUNC(X509_get_ext_d2i, 2017, libs.second )
+ RESOLVEFUNC(X509_get_issuer_name, 2018, libs.second )
+ RESOLVEFUNC(X509_get_subject_name, 2022, libs.second )
+ RESOLVEFUNC(X509_verify_cert, 2069, libs.second )
+ RESOLVEFUNC(d2i_X509, 2309, libs.second )
+ RESOLVEFUNC(i2d_X509, 2489, libs.second )
+#ifdef SSLEAY_MACROS
+ RESOLVEFUNC(i2d_DSAPrivateKey, 2395, libs.second )
+ RESOLVEFUNC(i2d_RSAPrivateKey, 2476, libs.second )
+ RESOLVEFUNC(d2i_DSAPrivateKey, 2220, libs.second )
+ RESOLVEFUNC(d2i_RSAPrivateKey, 2296, libs.second )
+#endif
+ RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf, 1153, libs.second )
+ RESOLVEFUNC(OPENSSL_add_all_algorithms_conf, 1152, libs.second )
+#else // Q_OS_SYMBIAN
#ifdef SSLEAY_MACROS
RESOLVEFUNC(ASN1_dup)
#endif
@@ -556,6 +700,7 @@ bool q_resolveOpenSslSymbols()
#endif
RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf)
RESOLVEFUNC(OPENSSL_add_all_algorithms_conf)
+#endif // Q_OS_SYMBIAN
symbolsResolved = true;
delete libs.first;
delete libs.second;
diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri
index 5427370..6021d5d 100644
--- a/src/network/ssl/ssl.pri
+++ b/src/network/ssl/ssl.pri
@@ -3,11 +3,7 @@ contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
symbian {
- TRY_INCLUDEPATHS = $${EPOCROOT}epoc32/include $${EPOCROOT}epoc32/include/stdapis $${EPOCROOT}epoc32/include/stdapis/sys $$OS_LAYER_LIBC_SYSTEMINCLUDE
- for(p, TRY_INCLUDEPATHS) {
- pp = $$join(p, "", "", "/openssl")
- exists($$pp):INCLUDEPATH *= $$pp
- }
+ INCLUDEPATH *= $$OS_LAYER_SSL_SYSTEMINCLUDE
} else {
include($$QT_SOURCE_TREE/config.tests/unix/openssl/openssl.pri)
}
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index a74f044..beb4da6 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -926,6 +926,9 @@ void QGL2PaintEngineEx::drawCachedGlyphs(const QPointF &p, const QTextItemInt &t
const QImage &image = cache->image();
int margin = cache->glyphMargin();
+ if (image.isNull())
+ return;
+
glActiveTexture(QT_BRUSH_TEXTURE_UNIT);
d->ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, true);
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 04bc611..cd7a7f0 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1484,8 +1484,8 @@ Q_OPENGL_EXPORT QGLShareRegister* qgl_share_reg()
*/
QGLContext::QGLContext(const QGLFormat &format, QPaintDevice *device)
+ : d_ptr(new QGLContextPrivate(this))
{
- d_ptr = new QGLContextPrivate(this);
Q_D(QGLContext);
d->init(device, format);
}
@@ -1507,8 +1507,8 @@ QGLContext::QGLContext(const QGLFormat &format, QPaintDevice *device)
\sa format(), isValid()
*/
QGLContext::QGLContext(const QGLFormat &format)
+ : d_ptr(new QGLContextPrivate(this))
{
- d_ptr = new QGLContextPrivate(this);
Q_D(QGLContext);
d->init(0, format);
}
@@ -1539,7 +1539,6 @@ QGLContext::~QGLContext()
QGLSignalProxy::instance()->emitAboutToDestroyContext(this);
reset();
- delete d;
}
void QGLContextPrivate::cleanup()
@@ -2504,6 +2503,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()
@@ -2588,7 +2623,7 @@ const QGLContext* QGLContext::currentContext()
\i paintGL() - Renders the OpenGL scene. Gets called whenever the widget
needs to be updated.
\i resizeGL() - Sets up the OpenGL viewport, projection, etc. Gets
- called whenever the the widget has been resized (and also when it
+ called whenever the widget has been resized (and also when it
is shown for the first time because all newly created widgets get a
resize event automatically).
\i initializeGL() - Sets up the OpenGL rendering context, defines display
@@ -3020,11 +3055,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
@@ -3174,9 +3208,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);
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index 01b1d6f..b7b2f36 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -45,6 +45,7 @@
#include <QtGui/qwidget.h>
#include <QtOpenGL/qglcolormap.h>
#include <QtCore/qmap.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -348,7 +349,7 @@ protected:
static QGLContext* currentCtx;
private:
- QGLContextPrivate* d_ptr;
+ QScopedPointer<QGLContextPrivate> d_ptr;
friend class QGLPixelBuffer;
friend class QGLPixelBufferPrivate;
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..7ed7a23 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -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,17 +509,9 @@ 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);
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index c362b7e..6e908e2 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -448,7 +448,6 @@ QGLFramebufferObject::~QGLFramebufferObject()
glDeleteRenderbuffersEXT(1, &d->depth_stencil_buffer);
glDeleteFramebuffersEXT(1, &d->fbo);
}
- delete d_ptr;
}
/*!
diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h
index a9e1b2f..fea8920 100644
--- a/src/opengl/qglframebufferobject.h
+++ b/src/opengl/qglframebufferobject.h
@@ -116,7 +116,7 @@ protected:
private:
Q_DISABLE_COPY(QGLFramebufferObject)
- QGLFramebufferObjectPrivate *d_ptr;
+ QScopedPointer<QGLFramebufferObjectPrivate> d_ptr;
friend class QGLDrawable;
};
diff --git a/src/opengl/qglpaintdevice_qws.cpp b/src/opengl/qglpaintdevice_qws.cpp
index 18905ab..60a1238 100644
--- a/src/opengl/qglpaintdevice_qws.cpp
+++ b/src/opengl/qglpaintdevice_qws.cpp
@@ -68,8 +68,6 @@ QWSGLPaintDevice::QWSGLPaintDevice(QWidget *widget) :
QWSGLPaintDevice::~QWSGLPaintDevice()
{
- Q_D(QWSGLPaintDevice);
- delete d;
}
QPaintEngine* QWSGLPaintDevice::paintEngine() const
diff --git a/src/opengl/qglpaintdevice_qws_p.h b/src/opengl/qglpaintdevice_qws_p.h
index 369de7f..a471b1b 100644
--- a/src/opengl/qglpaintdevice_qws_p.h
+++ b/src/opengl/qglpaintdevice_qws_p.h
@@ -53,6 +53,7 @@
// We mean it.
//
+#include <QtCore/qscopedpointer.h>
#include <QPaintDevice>
QT_BEGIN_NAMESPACE
@@ -76,7 +77,7 @@ public:
private:
friend class QWSGLWindowSurface;
- QWSGLPaintDevicePrivate *d_ptr;
+ QScopedPointer<QWSGLPaintDevicePrivate> d_ptr;
};
diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp
index 5f74f26..8ff2e1d 100644
--- a/src/opengl/qglpixelbuffer.cpp
+++ b/src/opengl/qglpixelbuffer.cpp
@@ -186,7 +186,6 @@ QGLPixelBuffer::~QGLPixelBuffer()
delete d->qctx;
if (current && current != d->qctx)
current->makeCurrent();
- delete d_ptr;
}
/*! \fn bool QGLPixelBuffer::makeCurrent()
diff --git a/src/opengl/qglpixelbuffer.h b/src/opengl/qglpixelbuffer.h
index 0131570..8264c22 100644
--- a/src/opengl/qglpixelbuffer.h
+++ b/src/opengl/qglpixelbuffer.h
@@ -107,7 +107,7 @@ protected:
private:
Q_DISABLE_COPY(QGLPixelBuffer)
- QGLPixelBufferPrivate *d_ptr;
+ QScopedPointer<QGLPixelBufferPrivate> d_ptr;
friend class QGLDrawable;
friend class QGLWindowSurface;
};
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index 5a212f5..c9fbc7e 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -5625,7 +5625,7 @@ void QOpenGLPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
QPainter *p = painter();
QBrush oldBrush = p->brush();
p->setBrush(brush);
- qt_draw_helper(p->d_ptr, painterPathFromVectorPath(path), QPainterPrivate::FillDraw);
+ qt_draw_helper(p->d_ptr.data(), painterPathFromVectorPath(path), QPainterPrivate::FillDraw);
p->setBrush(oldBrush);
return;
}
diff --git a/src/phonon/phonon.pro b/src/phonon/phonon.pro
index 679a1b0..221304d 100644
--- a/src/phonon/phonon.pro
+++ b/src/phonon/phonon.pro
@@ -13,13 +13,6 @@ PHONON_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/phonon
unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork
-# Phonon depends on numeric_limits. Enabling STL support in Qt
-# would bring in link dependencies, and we don't need that for
-# numeric_limits, hence we here merely ensure we bring in the necessary
-# header.
-symbian:INCLUDEPATH += $${EPOCROOT}epoc32/include/stdapis/stlport \
- $$OS_LAYER_STDCPP_SYSTEMINCLUDE
-
# Input
HEADERS += $$PHONON_DIR/abstractaudiooutput.h \
$$PHONON_DIR/abstractaudiooutput_p.h \
@@ -122,7 +115,15 @@ contains(QT_CONFIG, dbus) {
contains(QT_CONFIG, reduce_exports): CONFIG += hide_symbols
symbian: {
+ # Phonon depends on numeric_limits. Enabling STL support in Qt
+ # would bring in link dependencies, and we don't need that for
+ # numeric_limits, hence we here merely ensure we bring in the necessary
+ # header.
+ INCLUDEPATH *= $$OS_LAYER_STDCPP_SYSTEMINCLUDE
+
# Without this setting, code using numeric_limits will fail
# for winscw, although armv5 works fine no matter what.
- MMP_RULES += "option cw -wchar_t on"
+ QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS
+
+ TARGET.UID3 = 0x2001E624
}
diff --git a/src/plugins/accessible/widgets/rangecontrols.h b/src/plugins/accessible/widgets/rangecontrols.h
index aea91e1..57073ee 100644
--- a/src/plugins/accessible/widgets/rangecontrols.h
+++ b/src/plugins/accessible/widgets/rangecontrols.h
@@ -60,6 +60,7 @@ class QDial;
#ifndef QT_NO_SPINBOX
class QAccessibleAbstractSpinBox: public QAccessibleWidgetEx, public QAccessibleValueInterface
{
+ Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleAbstractSpinBox(QWidget *w);
@@ -132,6 +133,7 @@ protected:
class QAccessibleAbstractSlider: public QAccessibleWidgetEx, public QAccessibleValueInterface
{
+ Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleAbstractSlider(QWidget *w, Role r = Slider);
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
index 13f0a8f..180acaf 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
@@ -61,8 +61,6 @@ public:
void lockDirectFB(uint flags);
void unlockDirectFB();
- inline bool forceRasterPrimitives() const { return forceRaster; }
-
// Reimplemented from QCustomRasterPaintDevice:
void* memory() const;
QImage::Format format() const;
@@ -77,7 +75,6 @@ protected:
dfbSurface(0),
lockedImage(0),
screen(scr),
- forceRaster(false),
lock(0),
mem(0)
{}
@@ -95,7 +92,6 @@ protected:
QImage *lockedImage;
QDirectFBScreen *screen;
int bpl;
- bool forceRaster;
uint lock;
uchar *mem;
private:
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index 989a37a..2fb533a 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -81,7 +81,7 @@ template <> inline const bool* ptr<bool>(const bool &) { return 0; }
template <typename device, typename T1, typename T2, typename T3>
static void rasterFallbackWarn(const char *msg, const char *func, const device *dev,
int scale, bool matrixRotShear, bool simplePen,
- bool dfbHandledClip, bool forceRasterPrimitives,
+ bool dfbHandledClip,
const char *nameOne, const T1 &one,
const char *nameTwo, const T2 &two,
const char *nameThree, const T3 &three)
@@ -98,8 +98,7 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device *
dbg << "scale" << scale
<< "matrixRotShear" << matrixRotShear
<< "simplePen" << simplePen
- << "dfbHandledClip" << dfbHandledClip
- << "forceRasterPrimitives" << forceRasterPrimitives;
+ << "dfbHandledClip" << dfbHandledClip;
const T1 *t1 = ptr(one);
const T2 *t2 = ptr(two);
@@ -125,7 +124,6 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device *
__FUNCTION__, state()->painter->device(), \
d_func()->scale, d_func()->matrixRotShear, \
d_func()->simplePen, d_func()->dfbCanHandleClip(), \
- d_func()->forceRasterPrimitives, \
#one, one, #two, two, #three, three); \
if (op & (QT_DIRECTFB_DISABLE_RASTERFALLBACKS)) \
return;
@@ -140,7 +138,6 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device *
__FUNCTION__, state()->painter->device(), \
d_func()->scale, d_func()->matrixRotShear, \
d_func()->simplePen, d_func()->dfbCanHandleClip(), \
- d_func()->forceRasterPrimitives, \
#one, one, #two, two, #three, three);
#else
#define RASTERFALLBACK(op, one, two, three)
@@ -218,8 +215,8 @@ public:
void setTransform(const QTransform &m);
void setPen(const QPen &pen);
- void setCompositionMode(QPainter::CompositionMode mode);
- void setOpacity(quint8 value);
+ inline void setCompositionMode(QPainter::CompositionMode mode);
+ inline void setOpacity(quint8 value);
void setRenderHints(QPainter::RenderHints hints);
inline void setDFBColor(const QColor &color);
@@ -263,7 +260,6 @@ private:
QPen pen;
bool antialiased;
- bool forceRasterPrimitives;
bool simplePen;
@@ -280,14 +276,12 @@ private:
quint8 opacity;
- quint32 drawFlagsFromCompositionMode, blitFlagsFromCompositionMode;
- DFBSurfacePorterDuffRule porterDuffRule;
-
bool dirtyClip;
bool dfbHandledClip;
bool ignoreSystemClip;
QDirectFBPaintDevice *dfbDevice;
void *lockedMemory;
+ bool unsupportedCompositionMode;
QDirectFBPaintEngine *q;
friend class QDirectFBPaintEngine;
@@ -383,7 +377,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);
@@ -407,9 +401,8 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount)
Q_D(QDirectFBPaintEngine);
d->updateClip();
const QBrush &brush = state()->brush;
- if (!d->dfbCanHandleClip() || d->matrixRotShear
- || !d->simplePen || d->forceRasterPrimitives
- || !d->isSimpleBrush(brush)) {
+ if (d->unsupportedCompositionMode || !d->dfbCanHandleClip() || d->matrixRotShear
+ || !d->simplePen || !d->isSimpleBrush(brush)) {
RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawRects(rects, rectCount);
@@ -433,9 +426,8 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount)
Q_D(QDirectFBPaintEngine);
d->updateClip();
const QBrush &brush = state()->brush;
- if (!d->dfbCanHandleClip() || d->matrixRotShear
- || !d->simplePen || d->forceRasterPrimitives
- || !d->isSimpleBrush(brush)) {
+ if (d->unsupportedCompositionMode || !d->dfbCanHandleClip() || d->matrixRotShear
+ || !d->simplePen || !d->isSimpleBrush(brush)) {
RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawRects(rects, rectCount);
@@ -458,7 +450,7 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount)
{
Q_D(QDirectFBPaintEngine);
d->updateClip();
- if (!d->simplePen || !d->dfbCanHandleClip() || d->forceRasterPrimitives) {
+ if (d->unsupportedCompositionMode || !d->simplePen || !d->dfbCanHandleClip()) {
RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawLines(lines, lineCount);
@@ -476,7 +468,7 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount)
{
Q_D(QDirectFBPaintEngine);
d->updateClip();
- if (!d->simplePen || !d->dfbCanHandleClip() || d->forceRasterPrimitives) {
+ if (d->unsupportedCompositionMode || !d->simplePen || !d->dfbCanHandleClip()) {
RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawLines(lines, lineCount);
@@ -516,7 +508,8 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image,
d->updateClip();
#if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE
- if (d->matrixRotShear
+ if (d->unsupportedCompositionMode
+ || d->matrixRotShear
|| d->scale == QDirectFBPaintEnginePrivate::NegativeScale
|| !d->dfbCanHandleClip(r)
#ifndef QT_DIRECTFB_IMAGECACHE
@@ -560,7 +553,7 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap,
RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr);
d->lock();
QRasterPaintEngine::drawPixmap(r, pixmap, sr);
- } else if (!d->dfbCanHandleClip(r) || d->matrixRotShear
+ } else if (d->unsupportedCompositionMode || !d->dfbCanHandleClip(r) || d->matrixRotShear
|| d->scale == QDirectFBPaintEnginePrivate::NegativeScale) {
RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr);
const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer(DSLF_READ);
@@ -592,7 +585,7 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r,
RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), sp);
d->lock();
QRasterPaintEngine::drawTiledPixmap(r, pixmap, sp);
- } else if (!d->dfbCanHandleClip(r) || d->matrixRotShear || !sp.isNull()
+ } else if (d->unsupportedCompositionMode || !d->dfbCanHandleClip(r) || d->matrixRotShear || !sp.isNull()
|| d->scale == QDirectFBPaintEnginePrivate::NegativeScale) {
RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), sp);
const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer(DSLF_READ);
@@ -688,11 +681,9 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush)
{
Q_D(QDirectFBPaintEngine);
d->updateClip();
- if (d->dfbCanHandleClip(rect) && !d->matrixRotShear) {
+ if (!d->unsupportedCompositionMode && d->dfbCanHandleClip(rect) && !d->matrixRotShear) {
switch (brush.style()) {
case Qt::SolidPattern: {
- if (d->forceRasterPrimitives)
- break;
d->unlock();
d->setDFBColor(brush.color());
const QRect r = d->transform.mapRect(rect).toRect();
@@ -720,7 +711,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QColor &color)
{
Q_D(QDirectFBPaintEngine);
d->updateClip();
- if (!d->dfbCanHandleClip() || d->matrixRotShear || d->forceRasterPrimitives) {
+ if (d->unsupportedCompositionMode || !d->dfbCanHandleClip() || d->matrixRotShear) {
RASTERFALLBACK(FILL_RECT, rect, color, VOID_ARG());
d->lock();
QRasterPaintEngine::fillRect(rect, color);
@@ -737,38 +728,32 @@ void QDirectFBPaintEngine::drawColorSpans(const QSpan *spans, int count,
uint color)
{
Q_D(QDirectFBPaintEngine);
- if (d->forceRasterPrimitives) {
- RASTERFALLBACK(DRAW_COLORSPANS, count, color, VOID_ARG());
- d->lock();
- QRasterPaintEngine::drawColorSpans(spans, count, color);
- } else {
- color = INV_PREMUL(color);
-
- QVarLengthArray<DFBRegion> lines(count);
- int j = 0;
- for (int i = 0; i < count; ++i) {
- if (spans[i].coverage == 255) {
- lines[j].x1 = spans[i].x;
- lines[j].y1 = spans[i].y;
- lines[j].x2 = spans[i].x + spans[i].len - 1;
- lines[j].y2 = spans[i].y;
- ++j;
- } else {
- DFBSpan span = { spans[i].x, spans[i].len };
- uint c = BYTE_MUL(color, spans[i].coverage);
- // ### how does this play with setDFBColor
- d->surface->SetColor(d->surface,
- qRed(c), qGreen(c), qBlue(c), qAlpha(c));
- d->surface->FillSpans(d->surface, spans[i].y, &span, 1);
- }
- }
- if (j > 0) {
+ color = INV_PREMUL(color);
+
+ QVarLengthArray<DFBRegion> lines(count);
+ int j = 0;
+ for (int i = 0; i < count; ++i) {
+ if (spans[i].coverage == 255) {
+ lines[j].x1 = spans[i].x;
+ lines[j].y1 = spans[i].y;
+ lines[j].x2 = spans[i].x + spans[i].len - 1;
+ lines[j].y2 = spans[i].y;
+ ++j;
+ } else {
+ DFBSpan span = { spans[i].x, spans[i].len };
+ uint c = BYTE_MUL(color, spans[i].coverage);
+ // ### how does this play with setDFBColor
d->surface->SetColor(d->surface,
- qRed(color), qGreen(color), qBlue(color),
- qAlpha(color));
- d->surface->DrawLines(d->surface, lines.data(), j);
+ qRed(c), qGreen(c), qBlue(c), qAlpha(c));
+ d->surface->FillSpans(d->surface, spans[i].y, &span, 1);
}
}
+ if (j > 0) {
+ d->surface->SetColor(d->surface,
+ qRed(color), qGreen(color), qBlue(color),
+ qAlpha(color));
+ d->surface->DrawLines(d->surface, lines.data(), j);
+ }
}
void QDirectFBPaintEngine::drawBufferSpan(const uint *buffer, int bufsize,
@@ -803,11 +788,11 @@ void QDirectFBPaintEngine::initImageCache(int size)
QDirectFBPaintEnginePrivate::QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p)
- : surface(0), antialiased(false), forceRasterPrimitives(false), simplePen(false),
+ : surface(0), antialiased(false), simplePen(false),
matrixRotShear(false), scale(NoScale), lastLockedHeight(-1),
- fbWidth(-1), fbHeight(-1), opacity(255), drawFlagsFromCompositionMode(0),
- blitFlagsFromCompositionMode(0), porterDuffRule(DSPD_SRC_OVER), dirtyClip(true),
- dfbHandledClip(false), dfbDevice(0), lockedMemory(0), q(p)
+ fbWidth(-1), fbHeight(-1), opacity(255), dirtyClip(true),
+ dfbHandledClip(false), dfbDevice(0), lockedMemory(0),
+ unsupportedCompositionMode(false), q(p)
{
fb = QDirectFBScreen::instance()->dfb();
ignoreSystemClip = QDirectFBScreen::instance()->directFBFlags() & QDirectFBScreen::IgnoreSystemClip;
@@ -896,13 +881,12 @@ void QDirectFBPaintEnginePrivate::begin(QPaintDevice *device)
device->devType());
}
lockedMemory = 0;
- forceRasterPrimitives = dfbDevice->forceRasterPrimitives();
surface->GetSize(surface, &fbWidth, &fbHeight);
setTransform(QTransform());
antialiased = false;
- opacity = 255;
+ setOpacity(255);
setCompositionMode(q->state()->compositionMode());
dirtyClip = true;
setPen(q->state()->pen);
@@ -930,72 +914,13 @@ void QDirectFBPaintEnginePrivate::setPen(const QPen &p)
void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode mode)
{
- blitFlagsFromCompositionMode = DSBLIT_NOFX;
- drawFlagsFromCompositionMode = DSDRAW_NOFX;
-
- bool blend = true;
- switch (mode) {
- case QPainter::CompositionMode_SourceOver:
- porterDuffRule = DSPD_SRC_OVER;
- break;
- case QPainter::CompositionMode_DestinationOver:
- porterDuffRule = DSPD_DST_OVER;
- break;
- case QPainter::CompositionMode_Clear:
- porterDuffRule = DSPD_CLEAR;
- blend = false;
- break;
- case QPainter::CompositionMode_Source:
- porterDuffRule = DSPD_SRC;
- blend = false;
- break;
- case QPainter::CompositionMode_Destination:
- porterDuffRule = DSPD_NONE; // ### need to double check this
- blend = false;
- return;
- case QPainter::CompositionMode_SourceIn:
- porterDuffRule = DSPD_SRC_IN;
- break;
- case QPainter::CompositionMode_DestinationIn:
- porterDuffRule = DSPD_DST_IN;
- break;
- case QPainter::CompositionMode_SourceOut:
- porterDuffRule = DSPD_SRC_OUT;
- break;
- case QPainter::CompositionMode_DestinationOut:
- porterDuffRule = DSPD_DST_OUT;
- break;
- case QPainter::CompositionMode_Xor:
- porterDuffRule = DSPD_XOR;
- blitFlagsFromCompositionMode |= DSBLIT_XOR;
- drawFlagsFromCompositionMode |= DSDRAW_XOR;
- break;
-// case QPainter::CompositionMode_Plus: // ???
-// porterDuffRule = DSPD_ADD;
-// break;
- default:
- qWarning("QDirectFBPaintEnginePrivate::setCompositionMode(): "
- "mode %d not implemented", mode);
- return;
- }
- // intentially not comparing with current porterDuffRule. surface might have changed.
- if (blend) {
- blitFlagsFromCompositionMode |= DSBLIT_BLEND_ALPHACHANNEL;
- drawFlagsFromCompositionMode |= DSDRAW_BLEND;
- }
- if (opacity != 255) {
- setOpacity(opacity);
- }
+ unsupportedCompositionMode = (mode != QPainter::CompositionMode_SourceOver);
}
+
void QDirectFBPaintEnginePrivate::setOpacity(quint8 op)
{
opacity = op;
- if (opacity == 255) {
- blitFlagsFromCompositionMode &= ~DSBLIT_BLEND_COLORALPHA;
- } else {
- blitFlagsFromCompositionMode |= DSBLIT_BLEND_COLORALPHA;
- }
}
void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints)
@@ -1009,15 +934,9 @@ void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints)
void QDirectFBPaintEnginePrivate::prepareForBlit(bool alpha)
{
- quint32 blittingFlags = blitFlagsFromCompositionMode;
- if (alpha) {
- surface->SetPorterDuff(surface,
- (blittingFlags & DSBLIT_BLEND_COLORALPHA)
- ? DSPD_NONE
- : porterDuffRule);
- } else {
- blittingFlags &= ~DSBLIT_BLEND_ALPHACHANNEL;
- surface->SetPorterDuff(surface, DSPD_NONE);
+ quint32 blittingFlags = alpha ? DSBLIT_BLEND_ALPHACHANNEL : DSBLIT_NOFX;
+ if (opacity != 255) {
+ blittingFlags |= DSBLIT_BLEND_COLORALPHA;
}
surface->SetColor(surface, 0xff, 0xff, 0xff, opacity);
surface->SetBlittingFlags(surface, DFBSurfaceBlittingFlags(blittingFlags));
@@ -1028,15 +947,9 @@ void QDirectFBPaintEnginePrivate::setDFBColor(const QColor &color)
Q_ASSERT(surface);
const quint8 alpha = (opacity == 255 ?
color.alpha() : ALPHA_MUL(color.alpha(), opacity));
- surface->SetColor(surface,
- color.red(), color.green(), color.blue(), alpha);
- quint32 drawingFlags = drawFlagsFromCompositionMode;
- if (alpha == 255) {
- drawingFlags &= ~DSDRAW_BLEND;
- }
+ surface->SetColor(surface, color.red(), color.green(), color.blue(), alpha);
surface->SetPorterDuff(surface, DSPD_NONE);
- // PorterDuff messes up alpha values for primitives
- surface->SetDrawingFlags(surface, DFBSurfaceDrawingFlags(drawingFlags));
+ surface->SetDrawingFlags(surface, alpha == 255 ? DSDRAW_NOFX : DSDRAW_BLEND);
}
void QDirectFBPaintEnginePrivate::drawLines(const QLine *lines, int n)
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index c9b676a..18754f5 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -76,7 +76,6 @@ void QDirectFBPixmapData::resize(int width, int height)
format,
QDirectFBScreen::TrackSurface);
alpha = false;
- forceRaster = (format == QImage::Format_RGB32);
if (!dfbSurface) {
invalidate();
qWarning("QDirectFBPixmapData::resize(): Unable to allocate surface");
@@ -187,7 +186,6 @@ void QDirectFBPixmapData::fromImage(const QImage &i,
}
dfbSurface = screen->copyToDFBSurface(img, format,
QDirectFBScreen::TrackSurface);
- forceRaster = (format == QImage::Format_RGB32);
if (!dfbSurface) {
qWarning("QDirectFBPixmapData::fromImage()");
invalidate();
@@ -204,11 +202,12 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect)
}
IDirectFBSurface *src = static_cast<const QDirectFBPixmapData*>(data)->directFBSurface();
- const bool hasAlpha = data->hasAlphaChannel();
- format = (hasAlpha
+ alpha = data->hasAlphaChannel();
+ format = (alpha
? QDirectFBScreen::instance()->alphaPixmapFormat()
: QDirectFBScreen::instance()->pixelFormat());
+
dfbSurface = screen->createDFBSurface(rect.size(), format,
QDirectFBScreen::TrackSurface);
if (!dfbSurface) {
@@ -216,9 +215,8 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect)
invalidate();
return;
}
- forceRaster = (format == QImage::Format_RGB32);
- if (hasAlpha) {
+ if (alpha) {
dfbSurface->Clear(dfbSurface, 0, 0, 0, 0);
dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_BLEND_ALPHACHANNEL);
} else {
@@ -268,7 +266,6 @@ void QDirectFBPixmapData::fill(const QColor &color)
screen->releaseDFBSurface(dfbSurface);
format = screen->alphaPixmapFormat();
dfbSurface = screen->createDFBSurface(size, screen->alphaPixmapFormat(), QDirectFBScreen::TrackSurface);
- forceRaster = false;
setSerialNumber(++global_ser_no);
if (!dfbSurface) {
qWarning("QDirectFBPixmapData::fill()");
@@ -277,24 +274,7 @@ void QDirectFBPixmapData::fill(const QColor &color)
}
}
- if (forceRaster) {
- // in DSPF_RGB32 all dfb drawing causes the Alpha byte to be
- // set to 0. This causes issues for the raster engine.
- uchar *mem = QDirectFBScreen::lockSurface(dfbSurface, DSLF_WRITE, &bpl);
- if (mem) {
- const int h = QPixmapData::height();
- const int w = QPixmapData::width() * 4; // 4 bytes per 32 bit pixel
- const int c = color.rgba();
- for (int i = 0; i < h; ++i) {
- memset(mem, c, w);
- mem += bpl;
- }
- dfbSurface->Unlock(dfbSurface);
- }
- } else {
- dfbSurface->Clear(dfbSurface, color.red(), color.green(), color.blue(),
- color.alpha());
- }
+ dfbSurface->Clear(dfbSurface, color.red(), color.green(), color.blue(), color.alpha());
}
QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index 98e32ed..9e35a66 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -958,9 +958,6 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
return false;
}
- if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive))
- printDirectFBInfo(d_ptr->dfb, d_ptr->dfbSurface);
-
// Work out what format we're going to use for surfaces with an alpha channel
d_ptr->alphaPixmapFormat = QDirectFBScreen::getImageFormat(d_ptr->dfbSurface);
setPixelFormat(d_ptr->alphaPixmapFormat);
@@ -971,12 +968,17 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
case QImage::Format_RGB444:
d_ptr->alphaPixmapFormat = QImage::Format_ARGB4444_Premultiplied;
break;
+ case QImage::Format_RGB32:
+ qWarning("QDirectFBScreen::connect(). Qt/DirectFB does not work with the RGB32 pixelformat. "
+ "We recommmend using ARGB instead");
+ return false;
+ case QImage::Format_Indexed8:
+ qWarning("QDirectFBScreen::connect(). Qt/DirectFB does not work with the LUT8 pixelformat.");
+ return false;
case QImage::NImageFormats:
case QImage::Format_Invalid:
case QImage::Format_Mono:
case QImage::Format_MonoLSB:
- case QImage::Format_Indexed8:
- case QImage::Format_RGB32:
case QImage::Format_RGB888:
case QImage::Format_RGB16:
case QImage::Format_RGB555:
@@ -1037,6 +1039,9 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
setGraphicsSystem(d_ptr);
+ if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive))
+ printDirectFBInfo(d_ptr->dfb, d_ptr->dfbSurface);
+
return true;
}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index cd8796b..330eb88 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -127,7 +127,6 @@ void QDirectFBWindowSurface::createWindow()
dfbSurface->Release(dfbSurface);
dfbWindow->GetSurface(dfbWindow, &dfbSurface);
- forceRaster = (format == QImage::Format_RGB32);
#endif
}
#endif // QT_NO_DIRECTFB_WM
@@ -164,7 +163,6 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask)
rect.width(), rect.height() };
result = primarySurface->GetSubSurface(primarySurface, &r, &dfbSurface);
}
- forceRaster = (dfbSurface && QDirectFBScreen::getImageFormat(dfbSurface) == QImage::Format_RGB32);
} else {
const bool isResize = rect.size() != geometry().size();
#ifdef QT_NO_DIRECTFB_WM
@@ -179,7 +177,6 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask)
}
dfbSurface = screen->createDFBSurface(rect.size(), screen->pixelFormat(), QDirectFBScreen::DontTrackSurface);
- forceRaster = (dfbSurface && QDirectFBScreen::getImageFormat(dfbSurface) == QImage::Format_RGB32);
} else {
Q_ASSERT(dfbSurface);
}
@@ -242,31 +239,28 @@ void QDirectFBWindowSurface::setPermanentState(const QByteArray &state)
#endif
}
-bool QDirectFBWindowSurface::scroll(const QRegion &region, int dx, int dy)
+static inline void scrollSurface(IDirectFBSurface *surface, const QRect &r, int dx, int dy)
{
- if (!dfbSurface || !(flipFlags & DSFLIP_BLIT))
- return false;
-
- const QVector<QRect> rects = region.rects();
- const int n = rects.size();
-
- QVarLengthArray<DFBRectangle, 8> dfbRects(n);
- QVarLengthArray<DFBPoint, 8> dfbPoints(n);
+ surface->SetBlittingFlags(surface, DSBLIT_NOFX);
+ const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() };
+ surface->Blit(surface, surface, &rect, r.x() + dx, r.y() + dy);
+}
- for (int i = 0; i < n; ++i) {
- const QRect r = rects.at(i);
- dfbRects[i].x = r.x();
- dfbRects[i].y = r.y();
- dfbRects[i].w = r.width();
- dfbRects[i].h = r.height();
- dfbPoints[i].x = r.x() + dx;
- dfbPoints[i].y = r.y() + dy;
- }
+bool QDirectFBWindowSurface::scroll(const QRegion &region, int dx, int dy)
+{
+ if (!dfbSurface || !(flipFlags & DSFLIP_BLIT) || region.isEmpty())
+ return false;
dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
- dfbSurface->BatchBlit(dfbSurface, dfbSurface,
- dfbRects.data(), dfbPoints.data(), n);
- dfbSurface->ReleaseSource(dfbSurface);
+ if (region.numRects() == 1) {
+ ::scrollSurface(dfbSurface, region.boundingRect(), dx, dy);
+ } else {
+ const QVector<QRect> rects = region.rects();
+ const int n = rects.size();
+ for (int i=0; i<n; ++i) {
+ ::scrollSurface(dfbSurface, rects.at(i), dx, dy);
+ }
+ }
return true;
}
diff --git a/src/plugins/imageformats/mng/qmnghandler.cpp b/src/plugins/imageformats/mng/qmnghandler.cpp
index 19cc16d..7fabcd9 100644
--- a/src/plugins/imageformats/mng/qmnghandler.cpp
+++ b/src/plugins/imageformats/mng/qmnghandler.cpp
@@ -375,8 +375,6 @@ QMngHandler::QMngHandler()
QMngHandler::~QMngHandler()
{
- Q_D(QMngHandler);
- delete d;
}
/*! \reimp */
diff --git a/src/plugins/imageformats/mng/qmnghandler.h b/src/plugins/imageformats/mng/qmnghandler.h
index 909be2d..ce2ec6f 100644
--- a/src/plugins/imageformats/mng/qmnghandler.h
+++ b/src/plugins/imageformats/mng/qmnghandler.h
@@ -42,6 +42,7 @@
#ifndef QMNGHANDLER_H
#define QMNGHANDLER_H
+#include <QtCore/qscopedpointer.h>
#include <QtGui/qimageiohandler.h>
QT_BEGIN_NAMESPACE
@@ -74,7 +75,7 @@ class QMngHandler : public QImageIOHandler
private:
Q_DECLARE_PRIVATE(QMngHandler)
- QMngHandlerPrivate *d_ptr;
+ QScopedPointer<QMngHandlerPrivate> d_ptr;
};
QT_END_NAMESPACE
diff --git a/src/plugins/s60/src/qdesktopservices_3_1.cpp b/src/plugins/s60/src/qdesktopservices_3_1.cpp
index 1b7edbd..0551a74 100644
--- a/src/plugins/s60/src/qdesktopservices_3_1.cpp
+++ b/src/plugins/s60/src/qdesktopservices_3_1.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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/plugins/s60/src/qdesktopservices_3_2.cpp b/src/plugins/s60/src/qdesktopservices_3_2.cpp
index e563c14..7695f00 100644
--- a/src/plugins/s60/src/qdesktopservices_3_2.cpp
+++ b/src/plugins/s60/src/qdesktopservices_3_2.cpp
@@ -5,15 +5,47 @@
**
** This file is part of the $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 <private/qcore_symbian_p.h>
-#include <cdirectorylocalizer.h> // CDirectoryLocalizer
#include <qstring.h>
#include <qdir.h>
+#include <e32base.h> // CBase -> Required by cdirectorylocalizer.h
+#include <cdirectorylocalizer.h> // CDirectoryLocalizer
+
EXPORT_C QString localizedDirectoryName(QString& rawPath)
{
QString ret;
diff --git a/src/plugins/s60/src/qlocale_3_1.cpp b/src/plugins/s60/src/qlocale_3_1.cpp
index 95cf244..b2e6a5d 100644
--- a/src/plugins/s60/src/qlocale_3_1.cpp
+++ b/src/plugins/s60/src/qlocale_3_1.cpp
@@ -5,7 +5,37 @@
**
** This file is part of the $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/plugins/s60/src/qlocale_3_2.cpp b/src/plugins/s60/src/qlocale_3_2.cpp
index 027eefc..7a3a7e5 100644
--- a/src/plugins/s60/src/qlocale_3_2.cpp
+++ b/src/plugins/s60/src/qlocale_3_2.cpp
@@ -5,11 +5,43 @@
**
** This file is part of the $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 <exception>
#include <e32std.h>
+#include <e32base.h>
EXPORT_C TPtrC defaultGetLongDateFormatSpec(TExtendedLocale& locale)
{
diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
index bacf23b..0574341 100644
--- a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
+++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
@@ -2,7 +2,5 @@
TEMPLATE = subdirs
# We just want to extract the zip file containing sqlite binaries for Symbian
-!exists($${EPOCROOT}epoc32/release/armv5/urel/sqlite3.dll): {
- BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip"
-}
+BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip"
diff --git a/src/qt3support/itemviews/q3table.cpp b/src/qt3support/itemviews/q3table.cpp
index 658b0ad..458f5a5 100644
--- a/src/qt3support/itemviews/q3table.cpp
+++ b/src/qt3support/itemviews/q3table.cpp
@@ -166,6 +166,7 @@ private:
QTimer *stretchTimer, *widgetStretchTimer;
Q3TableHeaderPrivate *d;
+ Q_DISABLE_COPY(Q3TableHeader)
};
#ifdef _WS_QWS_
diff --git a/src/qt3support/network/q3http.cpp b/src/qt3support/network/q3http.cpp
index f1590a6..591b381 100644
--- a/src/qt3support/network/q3http.cpp
+++ b/src/qt3support/network/q3http.cpp
@@ -626,7 +626,7 @@ void Q3HttpHeader::setContentLength( int len )
}
/*!
- Returns true if the header has an entry for the the special HTTP
+ Returns true if the header has an entry for the special HTTP
header field \c content-type; otherwise returns false.
\sa contentType() setContentType()
diff --git a/src/qt3support/network/q3urloperator.cpp b/src/qt3support/network/q3urloperator.cpp
index 3f334a8..b415e12 100644
--- a/src/qt3support/network/q3urloperator.cpp
+++ b/src/qt3support/network/q3urloperator.cpp
@@ -543,7 +543,7 @@ const Q3NetworkOperation *Q3UrlOperator::rename( const QString &oldname, const Q
in mind that the get() and put() operations emit this signal
through the Q3UrlOperator. The number of transferred bytes and the
total bytes that you receive as arguments in this signal do not
- relate to the the whole copy operation; they relate first to the
+ relate to the whole copy operation; they relate first to the
get() and then to the put() operation. Always check what type of
operation the signal comes from; this is given in the signal's
last argument.
diff --git a/src/qt3support/other/q3accel.cpp b/src/qt3support/other/q3accel.cpp
index a570a70..2358092 100644
--- a/src/qt3support/other/q3accel.cpp
+++ b/src/qt3support/other/q3accel.cpp
@@ -206,7 +206,7 @@ bool Q_COMPAT_EXPORT qt_tryComposeUnicode(QWidget* w, QKeyEvent* e){
void Q3AccelManager::setFuncPtr() {
if (qApp->d_func()->qt_compat_used)
return;
- QApplicationPrivate *data = static_cast<QApplicationPrivate*>(qApp->d_ptr);
+ QApplicationPrivate *data = static_cast<QApplicationPrivate*>(qApp->d_ptr.data());
data->qt_tryAccelEvent = qt_tryAccelEvent;
data->qt_tryComposeUnicode = qt_tryComposeUnicode;
data->qt_dispatchAccelEvent = qt_dispatchAccelEvent;
diff --git a/src/qt3support/painting/q3painter.h b/src/qt3support/painting/q3painter.h
index 6fd17cb..c301ee7 100644
--- a/src/qt3support/painting/q3painter.h
+++ b/src/qt3support/painting/q3painter.h
@@ -82,6 +82,8 @@ public:
private:
QRect adjustedRectangle(const QRect &r);
+
+ Q_DISABLE_COPY(Q3Painter)
};
void inline Q3Painter::drawRect(const QRect &r)
diff --git a/src/qt3support/widgets/q3action.cpp b/src/qt3support/widgets/q3action.cpp
index 4e1a1bf..311212a 100644
--- a/src/qt3support/widgets/q3action.cpp
+++ b/src/qt3support/widgets/q3action.cpp
@@ -497,7 +497,7 @@ Q3Action::Q3Action(const QIcon& icon, const QString& menuText, QKeySequence acce
}
/*!
- This constructor results in an icon-less action with the the menu
+ This constructor results in an icon-less action with the menu
text \a menuText and keyboard accelerator \a accel. It is a child
of \a parent and called \a name.
diff --git a/src/qt3support/widgets/q3groupbox.cpp b/src/qt3support/widgets/q3groupbox.cpp
index 1fa7e7c..e0b609a 100644
--- a/src/qt3support/widgets/q3groupbox.cpp
+++ b/src/qt3support/widgets/q3groupbox.cpp
@@ -382,7 +382,7 @@ int Q3GroupBox::insideSpacing() const
}
/*!
- Sets the the width of the inside margin to \a m pixels.
+ Sets the width of the inside margin to \a m pixels.
\sa insideMargin()
*/
@@ -954,7 +954,7 @@ int Q3GroupBox::frameWidth() const
\fn int Q3GroupBox::margin() const
\since 4.2
- Returns the width of the the margin around the contents of the widget.
+ Returns the width of the margin around the contents of the widget.
This function uses QWidget::getContentsMargins() to get the margin.
diff --git a/src/qt3support/widgets/q3popupmenu.cpp b/src/qt3support/widgets/q3popupmenu.cpp
index 7f890b5..0b3a524 100644
--- a/src/qt3support/widgets/q3popupmenu.cpp
+++ b/src/qt3support/widgets/q3popupmenu.cpp
@@ -134,7 +134,7 @@ QT_BEGIN_NAMESPACE
\fn int Q3PopupMenu::margin() const
\since 4.2
- Returns the with of the the margin around the contents of the widget.
+ Returns the width of the margin around the contents of the widget.
This function uses QWidget::getContentsMargins() to get the margin.
\sa setMargin(), QWidget::getContentsMargins()
diff --git a/src/qt3support/widgets/q3progressbar.cpp b/src/qt3support/widgets/q3progressbar.cpp
index caae460..81f0dbf 100644
--- a/src/qt3support/widgets/q3progressbar.cpp
+++ b/src/qt3support/widgets/q3progressbar.cpp
@@ -455,7 +455,7 @@ void Q3ProgressBar::paintEvent(QPaintEvent *)
\fn int Q3ProgressBar::margin() const
\since 4.2
- Returns the with of the the margin around the contents of the widget.
+ Returns the width of the margin around the contents of the widget.
This function uses QWidget::getContentsMargins() to get the margin.
\sa setMargin(), QWidget::getContentsMargins()
diff --git a/src/qt3support/widgets/q3scrollview.cpp b/src/qt3support/widgets/q3scrollview.cpp
index 91a9203..5a91027 100644
--- a/src/qt3support/widgets/q3scrollview.cpp
+++ b/src/qt3support/widgets/q3scrollview.cpp
@@ -2038,7 +2038,7 @@ void Q3ScrollView::center(int x, int y)
\list
\i Margin 0.0 allows (x, y) to be on the edge of the visible area.
\i Margin 0.5 ensures that (x, y) is in middle 50% of the visible area.
- \i Margin 1.0 ensures that (x, y) is in the center of the the visible area.
+ \i Margin 1.0 ensures that (x, y) is in the center of the visible area.
\endlist
*/
void Q3ScrollView::center(int x, int y, float xmargin, float ymargin)
diff --git a/src/s60installs/qt_libs.pro b/src/s60installs/qt_libs.pro
index 9aadfc0..e9da90d 100644
--- a/src/s60installs/qt_libs.pro
+++ b/src/s60installs/qt_libs.pro
@@ -41,7 +41,7 @@ symbian: {
contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
qtlibraries.depends += "(0x200110CB), 1, 5, 1, {\"Open C LIBSSL Common\"}"
}
- contains(QT_CONFIG, stl) {
+ contains(CONFIG, stl) {
qtlibraries.depends += "(0x2000F866), 1, 0, 0, {\"Standard C++ Library Common\"}"
}
diff --git a/src/s60main/qts60main.cpp b/src/s60main/qts60main.cpp
index 1d19cc6..d7daf4a 100644
--- a/src/s60main/qts60main.cpp
+++ b/src/s60main/qts60main.cpp
@@ -5,11 +5,42 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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 FILES
+#include <exception>
#include <eikstart.h>
#include "qts60mainapplication.h"
diff --git a/src/s60main/qts60main_mcrt0.cpp b/src/s60main/qts60main_mcrt0.cpp
index 10a784a..49a47bd 100644
--- a/src/s60main/qts60main_mcrt0.cpp
+++ b/src/s60main/qts60main_mcrt0.cpp
@@ -2,7 +2,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_3RDPARTY_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$
**
****************************************************************************/
@@ -49,7 +79,15 @@ GLDEF_C TInt QtMainWrapper()
CleanupArrayDelete<char*>::PushL(argv);
CleanupArrayDelete<char*>::PushL(envp);
//Call user(application)'s main
- int ret = CALLMAIN(argc,argv,envp);
+ int ret = 0;
+ try
+ {
+ ret = CALLMAIN(argc, argv, envp);
+ }
+ catch (...)
+ {
+ User::Leave(KErrGeneral);
+ }
CleanupStack::PopAndDestroy(2,argv);
return ret;
}
diff --git a/src/s60main/qts60mainapplication.cpp b/src/s60main/qts60mainapplication.cpp
index 807b5af..2fada3d 100644
--- a/src/s60main/qts60mainapplication.cpp
+++ b/src/s60main/qts60mainapplication.cpp
@@ -5,11 +5,42 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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 FILES
+#include <exception>
#include "qts60maindocument.h"
#include "qts60mainapplication.h"
#include <bautils.h>
diff --git a/src/s60main/qts60mainapplication.h b/src/s60main/qts60mainapplication.h
index 318f83b..70b6909 100644
--- a/src/s60main/qts60mainapplication.h
+++ b/src/s60main/qts60mainapplication.h
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/s60main/qts60mainappui.cpp b/src/s60main/qts60mainappui.cpp
index dafbe96..1ac4f5a 100644
--- a/src/s60main/qts60mainappui.cpp
+++ b/src/s60main/qts60mainappui.cpp
@@ -5,11 +5,42 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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 FILES
+#include <exception>
#include <avkon.hrh>
#include <eikmenub.h>
#include <eikmenup.h>
@@ -38,6 +69,9 @@ void CQtS60MainAppUi::ConstructL()
// even these flags are defined
BaseConstructL(CAknAppUi::EAknEnableSkin);
+ CEikButtonGroupContainer* nativeContainer = Cba();
+ nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
+
// Create async callback to call Qt main,
// this is required to give S60 app FW to finish starting correctly
TCallBack callBack( OpenCMainStaticCallBack, this );
@@ -73,14 +107,29 @@ CQtS60MainAppUi::~CQtS60MainAppUi()
void CQtS60MainAppUi::HandleCommandL( TInt aCommand )
{
if (qApp)
- qApp->s60HandleCommandL(aCommand);
+ qApp->symbianHandleCommand(aCommand);
+}
+
+// -----------------------------------------------------------------------------
+// CQtS60MainAppUi::HandleResourceChangeL()
+// Takes care of event handling.
+// -----------------------------------------------------------------------------
+//
+void CQtS60MainAppUi::HandleResourceChangeL(TInt aType)
+{
+ CAknAppUi::HandleResourceChangeL(aType);
+
+ if (qApp)
+ qApp->symbianResourceChange(aType);
}
void CQtS60MainAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl *control)
{
int result = 0;
if (qApp)
- result = qApp->s60ProcessEvent(const_cast<TWsEvent*>(&aEvent));
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(
+ result = qApp->s60ProcessEvent(const_cast<TWsEvent*>(&aEvent))
+ );
if (result <= 0)
CAknAppUi::HandleWsEventL(aEvent, control);
@@ -119,7 +168,8 @@ TInt CQtS60MainAppUi::OpenCMainStaticCallBack( TAny* aObject )
//
void CQtS60MainAppUi::OpenCMainCallBack()
{
- TInt ret = QtMainWrapper();
+ TInt ret;
+ TRAPD(err, ret = QtMainWrapper());
Exit();
}
diff --git a/src/s60main/qts60mainappui.h b/src/s60main/qts60mainappui.h
index 3addb0c..6bdeb2e 100644
--- a/src/s60main/qts60mainappui.h
+++ b/src/s60main/qts60mainappui.h
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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$
**
****************************************************************************/
@@ -61,6 +91,13 @@ class CQtS60MainAppUi : public CAknAppUi
void HandleCommandL( TInt aCommand );
/**
+ * From CAknAppUi, HandleResourceChangeL
+ * Handles resource change events such as layout switches in global level.
+ * @param aType event type.
+ */
+ void HandleResourceChangeL(TInt aType);
+
+ /**
* HandleStatusPaneSizeChange.
* Called by the framework when the application status pane
* size is changed.
diff --git a/src/s60main/qts60maindocument.cpp b/src/s60main/qts60maindocument.cpp
index 9ab426d..eb7ea42 100644
--- a/src/s60main/qts60maindocument.cpp
+++ b/src/s60main/qts60maindocument.cpp
@@ -5,11 +5,42 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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 FILES
+#include <exception>
#include "qts60mainappui.h"
#include "qts60maindocument.h"
diff --git a/src/s60main/qts60maindocument.h b/src/s60main/qts60maindocument.h
index 4979e7f..a95e620 100644
--- a/src/s60main/qts60maindocument.h
+++ b/src/s60main/qts60maindocument.h
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/s60main/s60main.rss b/src/s60main/s60main.rss
index 569f59e..6e8004c 100644
--- a/src/s60main/s60main.rss
+++ b/src/s60main/s60main.rss
@@ -5,7 +5,37 @@
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_EMBEDDED_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/script/qscriptable.cpp b/src/script/qscriptable.cpp
index a6401d6..56291d8 100644
--- a/src/script/qscriptable.cpp
+++ b/src/script/qscriptable.cpp
@@ -118,8 +118,6 @@ QScriptable::QScriptable()
*/
QScriptable::~QScriptable()
{
- delete d_ptr;
- d_ptr = 0;
}
/*!
diff --git a/src/script/qscriptable.h b/src/script/qscriptable.h
index f990db2..d09b945 100644
--- a/src/script/qscriptable.h
+++ b/src/script/qscriptable.h
@@ -46,6 +46,8 @@
#ifndef QT_NO_SCRIPT
+#include <QtCore/qscopedpointer.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -73,7 +75,7 @@ public:
QScriptValue argument(int index) const;
private:
- QScriptablePrivate *d_ptr;
+ QScopedPointer<QScriptablePrivate> d_ptr;
Q_DISABLE_COPY(QScriptable)
Q_DECLARE_PRIVATE(QScriptable)
diff --git a/src/script/qscriptclass.cpp b/src/script/qscriptclass.cpp
index 14b8add..535a530 100644
--- a/src/script/qscriptclass.cpp
+++ b/src/script/qscriptclass.cpp
@@ -457,8 +457,6 @@ QScriptClass::QScriptClass(QScriptEngine *engine, QScriptClassPrivate &dd)
*/
QScriptClass::~QScriptClass()
{
- delete d_ptr;
- d_ptr = 0;
}
/*!
diff --git a/src/script/qscriptclass.h b/src/script/qscriptclass.h
index 9c06ea2..77e9b08 100644
--- a/src/script/qscriptclass.h
+++ b/src/script/qscriptclass.h
@@ -47,6 +47,7 @@
#ifndef QT_NO_SCRIPT
#include <QtCore/qvariant.h>
+#include <QtCore/qscopedpointer.h>
#include <QtScript/qscriptvalue.h>
QT_BEGIN_HEADER
@@ -103,7 +104,7 @@ public:
protected:
QScriptClass(QScriptEngine *engine, QScriptClassPrivate &dd);
- QScriptClassPrivate *d_ptr;
+ QScopedPointer<QScriptClassPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptClass)
diff --git a/src/script/qscriptclasspropertyiterator.cpp b/src/script/qscriptclasspropertyiterator.cpp
index 96f34d5..f328e14 100644
--- a/src/script/qscriptclasspropertyiterator.cpp
+++ b/src/script/qscriptclasspropertyiterator.cpp
@@ -111,8 +111,6 @@ QScriptClassPropertyIterator::QScriptClassPropertyIterator(const QScriptValue &o
*/
QScriptClassPropertyIterator::~QScriptClassPropertyIterator()
{
- delete d_ptr;
- d_ptr = 0;
}
/*!
diff --git a/src/script/qscriptclasspropertyiterator.h b/src/script/qscriptclasspropertyiterator.h
index 2041a65..05d49d8 100644
--- a/src/script/qscriptclasspropertyiterator.h
+++ b/src/script/qscriptclasspropertyiterator.h
@@ -46,6 +46,7 @@
#ifndef QT_NO_SCRIPT
+#include <QtCore/qscopedpointer.h>
#include <QtScript/qscriptvalue.h>
QT_BEGIN_HEADER
@@ -80,7 +81,7 @@ public:
protected:
QScriptClassPropertyIterator(const QScriptValue &object, QScriptClassPropertyIteratorPrivate &dd);
- QScriptClassPropertyIteratorPrivate *d_ptr;
+ QScopedPointer<QScriptClassPropertyIteratorPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptClassPropertyIterator)
diff --git a/src/script/qscriptcontext.cpp b/src/script/qscriptcontext.cpp
index 020601b..0b72342 100644
--- a/src/script/qscriptcontext.cpp
+++ b/src/script/qscriptcontext.cpp
@@ -219,8 +219,6 @@ QScriptContext::QScriptContext():
*/
QScriptContext::~QScriptContext()
{
- delete d_ptr;
- d_ptr = 0;
}
/*!
diff --git a/src/script/qscriptcontext.h b/src/script/qscriptcontext.h
index 1e1f987..25a2198 100644
--- a/src/script/qscriptcontext.h
+++ b/src/script/qscriptcontext.h
@@ -46,6 +46,7 @@
#ifndef QT_NO_SCRIPT
+#include <QtCore/qscopedpointer.h>
#include <QtScript/qscriptvalue.h>
QT_BEGIN_HEADER
@@ -111,7 +112,7 @@ public:
private:
QScriptContext();
- QScriptContextPrivate *d_ptr;
+ QScopedPointer<QScriptContextPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptContext)
Q_DISABLE_COPY(QScriptContext)
diff --git a/src/script/qscriptcontextinfo.cpp b/src/script/qscriptcontextinfo.cpp
index 260d19f..0fa5c62 100644
--- a/src/script/qscriptcontextinfo.cpp
+++ b/src/script/qscriptcontextinfo.cpp
@@ -204,13 +204,12 @@ QScriptContextInfoPrivate::~QScriptContextInfoPrivate()
previously created QScriptContextInfo.
*/
QScriptContextInfo::QScriptContextInfo(const QScriptContext *context)
+ : d_ptr(0)
{
if (context) {
- d_ptr = new QScriptContextInfoPrivate(context);
+ d_ptr.data_ptr() = new QScriptContextInfoPrivate(context);
d_ptr->q_ptr = this;
d_ptr->ref.ref();
- } else {
- d_ptr = 0;
}
}
@@ -218,7 +217,7 @@ QScriptContextInfo::QScriptContextInfo(const QScriptContext *context)
Constructs a new QScriptContextInfo from the \a other info.
*/
QScriptContextInfo::QScriptContextInfo(const QScriptContextInfo &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
if (d_ptr)
d_ptr->ref.ref();
@@ -239,10 +238,6 @@ QScriptContextInfo::QScriptContextInfo()
*/
QScriptContextInfo::~QScriptContextInfo()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
}
/*!
@@ -251,15 +246,7 @@ QScriptContextInfo::~QScriptContextInfo()
*/
QScriptContextInfo &QScriptContextInfo::operator=(const QScriptContextInfo &other)
{
- if (d_ptr == other.d_ptr)
- return *this;
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
- d_ptr = other.d_ptr;
- if (d_ptr)
- d_ptr->ref.ref();
+ d_ptr.assign(other.d_ptr.data());
return *this;
}
@@ -510,7 +497,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptContextInfo &info)
Q_SCRIPT_EXPORT QDataStream &operator>>(QDataStream &in, QScriptContextInfo &info)
{
if (!info.d_ptr) {
- info.d_ptr = new QScriptContextInfoPrivate();
+ info.d_ptr.data_ptr() = new QScriptContextInfoPrivate();
info.d_ptr->ref.ref();
}
diff --git a/src/script/qscriptcontextinfo.h b/src/script/qscriptcontextinfo.h
index a683733..20b6607 100644
--- a/src/script/qscriptcontextinfo.h
+++ b/src/script/qscriptcontextinfo.h
@@ -48,6 +48,7 @@
#include <QtCore/qlist.h>
#include <QtCore/qstringlist.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -104,7 +105,7 @@ public:
bool operator!=(const QScriptContextInfo &other) const;
private:
- QScriptContextInfoPrivate *d_ptr;
+ QScopedSharedPointer<QScriptContextInfoPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptContextInfo)
};
diff --git a/src/script/qscriptengine.cpp b/src/script/qscriptengine.cpp
index d8908ed..2a36104 100644
--- a/src/script/qscriptengine.cpp
+++ b/src/script/qscriptengine.cpp
@@ -330,10 +330,6 @@ QScriptEngine::~QScriptEngine()
Q_D(QScriptEngine);
d->m_frameRepository.release(currentContext());
d->objectAllocator.destruct();
-#ifdef QT_NO_QOBJECT
- delete d_ptr;
- d_ptr = 0;
-#endif
}
/*!
@@ -1777,7 +1773,7 @@ QScriptValue QScriptEngine::objectById(qint64 id) const
Constructs a new QScriptSyntaxCheckResult from the \a other result.
*/
QScriptSyntaxCheckResult::QScriptSyntaxCheckResult(const QScriptSyntaxCheckResult &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
if (d_ptr)
d_ptr->ref.ref();
@@ -1806,10 +1802,6 @@ QScriptSyntaxCheckResult::QScriptSyntaxCheckResult()
*/
QScriptSyntaxCheckResult::~QScriptSyntaxCheckResult()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
}
/*!
@@ -1863,15 +1855,7 @@ QString QScriptSyntaxCheckResult::errorMessage() const
*/
QScriptSyntaxCheckResult &QScriptSyntaxCheckResult::operator=(const QScriptSyntaxCheckResult &other)
{
- if (d_ptr == other.d_ptr)
- return *this;
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
- d_ptr = other.d_ptr;
- if (d_ptr)
- d_ptr->ref.ref();
+ d_ptr.assign(other.d_ptr.data());
return *this;
}
diff --git a/src/script/qscriptengine.h b/src/script/qscriptengine.h
index afd551b..c55caac 100644
--- a/src/script/qscriptengine.h
+++ b/src/script/qscriptengine.h
@@ -47,6 +47,7 @@
#ifndef QT_NO_SCRIPT
#include <QtCore/qvariant.h>
+#include <QtCore/qscopedpointer.h>
#ifndef QT_NO_QOBJECT
#include <QtCore/qobject.h>
@@ -114,7 +115,7 @@ public:
private:
QScriptSyntaxCheckResult();
QScriptSyntaxCheckResult(QScriptSyntaxCheckResultPrivate *d);
- QScriptSyntaxCheckResultPrivate *d_ptr;
+ QScopedSharedPointer<QScriptSyntaxCheckResultPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptSyntaxCheckResult)
friend class QScriptEnginePrivate;
@@ -282,7 +283,7 @@ private:
protected:
#ifdef QT_NO_QOBJECT
- QScriptEnginePrivate *d_ptr;
+ QScopedPointer<QScriptEnginePrivate> d_ptr;
QScriptEngine(QScriptEnginePrivate &dd);
#else
diff --git a/src/script/qscriptengineagent.cpp b/src/script/qscriptengineagent.cpp
index bda94ae..c3eaf96 100644
--- a/src/script/qscriptengineagent.cpp
+++ b/src/script/qscriptengineagent.cpp
@@ -173,8 +173,6 @@ QScriptEngineAgent::QScriptEngineAgent(QScriptEngineAgentPrivate &dd, QScriptEng
*/
QScriptEngineAgent::~QScriptEngineAgent()
{
- delete d_ptr;
- d_ptr = 0;
}
/*!
diff --git a/src/script/qscriptengineagent.h b/src/script/qscriptengineagent.h
index 3334bc0..461d756 100644
--- a/src/script/qscriptengineagent.h
+++ b/src/script/qscriptengineagent.h
@@ -47,6 +47,7 @@
#ifndef QT_NO_SCRIPT
#include <QtCore/qvariant.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -96,7 +97,7 @@ public:
protected:
QScriptEngineAgent(QScriptEngineAgentPrivate &dd, QScriptEngine *engine);
- QScriptEngineAgentPrivate *d_ptr;
+ QScopedPointer<QScriptEngineAgentPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptEngineAgent)
diff --git a/src/script/qscriptstring.cpp b/src/script/qscriptstring.cpp
index 69b0796..e7591e1 100644
--- a/src/script/qscriptstring.cpp
+++ b/src/script/qscriptstring.cpp
@@ -54,6 +54,29 @@
QT_BEGIN_NAMESPACE
+/*! \internal */
+struct QScriptStringPrivatePointerHandler
+{
+ static inline void cleanup(QScriptStringPrivate *d)
+ {
+ if (!d || d->ref.deref())
+ return;
+
+ if (d->nameId) {
+ d->engine->uninternString(d);
+ } else {
+ // the engine has already been deleted
+ delete d;
+ }
+ }
+
+ static inline void reset(QScriptStringPrivate *&d, QScriptStringPrivate *other)
+ {
+ cleanup(d);
+ d = other;
+ }
+};
+
/*!
\since 4.4
\class QScriptString
@@ -108,8 +131,8 @@ QScriptStringPrivate *QScriptStringPrivate::get(const QScriptString &q)
void QScriptStringPrivate::init(QScriptString &q, QScriptStringPrivate *d)
{
Q_ASSERT(q.d_ptr == 0);
- q.d_ptr = d;
- q.d_ptr->ref.ref();
+ q.d_ptr.data_ptr() = d;
+ d->ref.ref();
}
/*!
@@ -124,7 +147,7 @@ QScriptString::QScriptString()
Constructs a new QScriptString that is a copy of \a other.
*/
QScriptString::QScriptString(const QScriptString &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
if (d_ptr)
d_ptr->ref.ref();
@@ -135,15 +158,6 @@ QScriptString::QScriptString(const QScriptString &other)
*/
QScriptString::~QScriptString()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- if (isValid()) {
- d_ptr->engine->uninternString(d_ptr);
- } else {
- // the engine has already been deleted
- delete d_ptr;
- }
- d_ptr = 0;
- }
}
/*!
@@ -153,15 +167,7 @@ QScriptString &QScriptString::operator=(const QScriptString &other)
{
if (d_ptr == other.d_ptr)
return *this;
- if (d_ptr && !d_ptr->ref.deref()) {
- if (isValid()) {
- d_ptr->engine->uninternString(d_ptr);
- } else {
- // the engine has already been deleted
- delete d_ptr;
- }
- }
- d_ptr = other.d_ptr;
+ d_ptr.reset(other.d_ptr.data());
if (d_ptr)
d_ptr->ref.ref();
return *this;
diff --git a/src/script/qscriptstring.h b/src/script/qscriptstring.h
index d2fecd8..f68be0c 100644
--- a/src/script/qscriptstring.h
+++ b/src/script/qscriptstring.h
@@ -46,6 +46,8 @@
#ifndef QT_NO_SCRIPT
+#include <QtCore/qscopedpointer.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -54,6 +56,7 @@ QT_MODULE(Script)
class QScriptEngine;
class QScriptStringPrivate;
+struct QScriptStringPrivatePointerHandler;
class Q_SCRIPT_EXPORT QScriptString
{
@@ -73,7 +76,7 @@ public:
operator QString() const;
private:
- QScriptStringPrivate *d_ptr;
+ QScopedCustomPointer<QScriptStringPrivate, QScriptStringPrivatePointerHandler> d_ptr;
Q_DECLARE_PRIVATE(QScriptString)
};
diff --git a/src/script/qscriptvalue.cpp b/src/script/qscriptvalue.cpp
index a253985..4282248 100644
--- a/src/script/qscriptvalue.cpp
+++ b/src/script/qscriptvalue.cpp
@@ -57,6 +57,28 @@
QT_BEGIN_NAMESPACE
+/*! \internal
+ */
+struct QScriptValuePrivatePointerHandler
+{
+ static inline void cleanup(QScriptValuePrivate *d)
+ {
+ if (!d || d->ref.deref())
+ return;
+ if (d->engine) {
+ QScriptEnginePrivate::get(d->engine)->unregisterValue(d);
+ } else {
+ delete d;
+ }
+ }
+
+ static inline void reset(QScriptValuePrivate *&d, QScriptValuePrivate *other)
+ {
+ cleanup(d);
+ d = other;
+ }
+};
+
/*!
\since 4.3
\class QScriptValue
@@ -194,14 +216,6 @@ QScriptValue::QScriptValue()
*/
QScriptValue::~QScriptValue()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- if (engine()) {
- QScriptEnginePrivate::get(engine())->unregisterValue(d_ptr);
- } else {
- delete d_ptr;
- }
- d_ptr = 0;
- }
}
/*!
@@ -212,7 +226,7 @@ QScriptValue::~QScriptValue()
the new script value (i.e., the object itself is not copied).
*/
QScriptValue::QScriptValue(const QScriptValue &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
if (d_ptr)
d_ptr->ref.ref();
@@ -225,13 +239,12 @@ QScriptValue::QScriptValue(const QScriptValue &other)
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine *engine, QScriptValue::SpecialValue value)
+ : d_ptr(0)
{
if (engine) {
QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
- d_ptr = eng_p->registerValue(QScriptValueImpl(value));
+ d_ptr.data_ptr() = eng_p->registerValue(QScriptValueImpl(value));
d_ptr->ref.ref();
- } else {
- d_ptr = 0;
}
}
@@ -244,13 +257,12 @@ QScriptValue::QScriptValue(QScriptEngine *engine, QScriptValue::SpecialValue val
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine *engine, bool val)
+ : d_ptr(0)
{
if (engine) {
QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
- d_ptr = eng_p->registerValue(QScriptValueImpl(val));
+ d_ptr.data_ptr() = eng_p->registerValue(QScriptValueImpl(val));
d_ptr->ref.ref();
- } else {
- d_ptr = 0;
}
}
@@ -262,13 +274,12 @@ QScriptValue::QScriptValue(QScriptEngine *engine, bool val)
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine *engine, int val)
+ : d_ptr(0)
{
if (engine) {
QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
- d_ptr = eng_p->registerValue(QScriptValueImpl(val));
+ d_ptr.data_ptr() = eng_p->registerValue(QScriptValueImpl(val));
d_ptr->ref.ref();
- } else {
- d_ptr = 0;
}
}
@@ -280,13 +291,12 @@ QScriptValue::QScriptValue(QScriptEngine *engine, int val)
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine *engine, uint val)
+ : d_ptr(0)
{
if (engine) {
QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
- d_ptr = eng_p->registerValue(QScriptValueImpl(val));
+ d_ptr.data_ptr() = eng_p->registerValue(QScriptValueImpl(val));
d_ptr->ref.ref();
- } else {
- d_ptr = 0;
}
}
@@ -298,13 +308,12 @@ QScriptValue::QScriptValue(QScriptEngine *engine, uint val)
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine *engine, qsreal val)
+ : d_ptr(0)
{
if (engine) {
QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
- d_ptr = eng_p->registerValue(QScriptValueImpl(val));
+ d_ptr.data_ptr() = eng_p->registerValue(QScriptValueImpl(val));
d_ptr->ref.ref();
- } else {
- d_ptr = 0;
}
}
@@ -316,15 +325,14 @@ QScriptValue::QScriptValue(QScriptEngine *engine, qsreal val)
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine *engine, const QString &val)
+ : d_ptr(0)
{
if (engine) {
QScriptValueImpl v;
QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
eng_p->newString(&v, val);
- d_ptr = eng_p->registerValue(v);
+ d_ptr.data_ptr() = eng_p->registerValue(v);
d_ptr->ref.ref();
- } else {
- d_ptr = 0;
}
}
@@ -338,15 +346,14 @@ QScriptValue::QScriptValue(QScriptEngine *engine, const QString &val)
#ifndef QT_NO_CAST_FROM_ASCII
QScriptValue::QScriptValue(QScriptEngine *engine, const char *val)
+ : d_ptr(0)
{
if (engine) {
QScriptValueImpl v;
QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
eng_p->newString(&v, QString::fromAscii(val));
- d_ptr = eng_p->registerValue(v);
+ d_ptr.data_ptr() = eng_p->registerValue(v);
d_ptr->ref.ref();
- } else {
- d_ptr = 0;
}
}
#endif
@@ -464,14 +471,7 @@ QScriptValue &QScriptValue::operator=(const QScriptValue &other)
{
if (d_ptr == other.d_ptr)
return *this;
- if (d_ptr && !d_ptr->ref.deref()) {
- if (engine()) {
- QScriptEnginePrivate::get(engine())->unregisterValue(d_ptr);
- } else {
- delete d_ptr;
- }
- }
- d_ptr = other.d_ptr;
+ d_ptr.reset(other.d_ptr.data());
if (d_ptr)
d_ptr->ref.ref();
return *this;
diff --git a/src/script/qscriptvalue.h b/src/script/qscriptvalue.h
index 306da53..76b1186 100644
--- a/src/script/qscriptvalue.h
+++ b/src/script/qscriptvalue.h
@@ -47,6 +47,7 @@
#ifndef QT_NO_SCRIPT
#include <QtCore/qlist.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -71,6 +72,7 @@ typedef QList<QScriptValue> QScriptValueList;
typedef double qsreal;
class QScriptValuePrivate;
+struct QScriptValuePrivatePointerHandler;
class Q_SCRIPT_EXPORT QScriptValue
{
public:
@@ -216,12 +218,12 @@ public:
private:
// force compile error, prevent QScriptValue(bool) to be called
- inline QScriptValue(void *) { Q_ASSERT(false); }
+ inline QScriptValue(void *);
// force compile error, prevent QScriptValue(QScriptEngine*, bool) to be called
- inline QScriptValue(QScriptEngine *, void *) { Q_ASSERT(false); }
+ inline QScriptValue(QScriptEngine *, void *);
private:
- QScriptValuePrivate *d_ptr;
+ QScopedCustomPointer<QScriptValuePrivate, QScriptValuePrivatePointerHandler> d_ptr;
Q_DECLARE_PRIVATE(QScriptValue)
};
diff --git a/src/script/qscriptvalue_p.h b/src/script/qscriptvalue_p.h
index 8463ed2..6528464 100644
--- a/src/script/qscriptvalue_p.h
+++ b/src/script/qscriptvalue_p.h
@@ -91,7 +91,7 @@ inline QScriptValueImpl QScriptValuePrivate::valueOf(const QScriptValue &value)
inline void QScriptValuePrivate::init(QScriptValue &value, QScriptValuePrivate *p)
{
- value.d_ptr = p;
+ value.d_ptr.data_ptr() = p;
value.d_ptr->ref.ref();
}
diff --git a/src/script/qscriptvalueiterator.cpp b/src/script/qscriptvalueiterator.cpp
index 1a60632..2cf5575 100644
--- a/src/script/qscriptvalueiterator.cpp
+++ b/src/script/qscriptvalueiterator.cpp
@@ -115,12 +115,11 @@ QScriptValueIteratorPrivate::~QScriptValueIteratorPrivate()
first property).
*/
QScriptValueIterator::QScriptValueIterator(const QScriptValue &object)
+ : d_ptr(0)
{
QScriptValueImpl val = QScriptValuePrivate::valueOf(object);
- if (!val.isObject()) {
- d_ptr = 0;
- } else {
- d_ptr = new QScriptValueIteratorPrivate();
+ if (val.isObject()) {
+ d_ptr.reset(new QScriptValueIteratorPrivate());
d_ptr->it = new QScriptValueIteratorImpl(val);
}
}
@@ -130,10 +129,6 @@ QScriptValueIterator::QScriptValueIterator(const QScriptValue &object)
*/
QScriptValueIterator::~QScriptValueIterator()
{
- if (d_ptr) {
- delete d_ptr;
- d_ptr = 0;
- }
}
/*!
@@ -311,13 +306,10 @@ void QScriptValueIterator::remove()
*/
QScriptValueIterator& QScriptValueIterator::operator=(QScriptValue &object)
{
- if (d_ptr) {
- delete d_ptr;
- d_ptr = 0;
- }
+ d_ptr.reset();
QScriptValueImpl val = QScriptValuePrivate::valueOf(object);
if (val.isObject()) {
- d_ptr = new QScriptValueIteratorPrivate();
+ d_ptr.reset(new QScriptValueIteratorPrivate());
d_ptr->it = new QScriptValueIteratorImpl(val);
}
return *this;
diff --git a/src/script/qscriptvalueiterator.h b/src/script/qscriptvalueiterator.h
index 91561e8..082158d 100644
--- a/src/script/qscriptvalueiterator.h
+++ b/src/script/qscriptvalueiterator.h
@@ -46,6 +46,8 @@
#ifndef QT_NO_SCRIPT
+#include <QtCore/qscopedpointer.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -84,7 +86,7 @@ public:
QScriptValueIterator& operator=(QScriptValue &value);
private:
- QScriptValueIteratorPrivate *d_ptr;
+ QScopedPointer<QScriptValueIteratorPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptValueIterator)
Q_DISABLE_COPY(QScriptValueIterator)
diff --git a/src/scripttools/debugging/qscriptbreakpointdata.cpp b/src/scripttools/debugging/qscriptbreakpointdata.cpp
index 9762ca4..50e597e 100644
--- a/src/scripttools/debugging/qscriptbreakpointdata.cpp
+++ b/src/scripttools/debugging/qscriptbreakpointdata.cpp
@@ -136,7 +136,6 @@ QScriptBreakpointData::QScriptBreakpointData(const QScriptBreakpointData &other)
*/
QScriptBreakpointData::~QScriptBreakpointData()
{
- delete d_ptr;
}
/*!
@@ -355,7 +354,7 @@ bool QScriptBreakpointData::operator!=(const QScriptBreakpointData &other) const
*/
QDataStream &operator<<(QDataStream &out, const QScriptBreakpointData &data)
{
- const QScriptBreakpointDataPrivate *d = data.d_ptr;
+ const QScriptBreakpointDataPrivate *d = data.d_ptr.data();
out << d->scriptId;
out << d->fileName;
out << d->lineNumber;
@@ -377,7 +376,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptBreakpointData &data)
*/
QDataStream &operator>>(QDataStream &in, QScriptBreakpointData &data)
{
- QScriptBreakpointDataPrivate *d = data.d_ptr;
+ QScriptBreakpointDataPrivate *d = data.d_ptr.data();
in >> d->scriptId;
in >> d->fileName;
in >> d->lineNumber;
diff --git a/src/scripttools/debugging/qscriptbreakpointdata_p.h b/src/scripttools/debugging/qscriptbreakpointdata_p.h
index c1ff033..6cfceed 100644
--- a/src/scripttools/debugging/qscriptbreakpointdata_p.h
+++ b/src/scripttools/debugging/qscriptbreakpointdata_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qmap.h>
QT_BEGIN_NAMESPACE
@@ -114,7 +114,7 @@ public:
bool operator!=(const QScriptBreakpointData &other) const;
private:
- QScriptBreakpointDataPrivate *d_ptr;
+ QScopedPointer<QScriptBreakpointDataPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptBreakpointData)
};
diff --git a/src/scripttools/debugging/qscriptdebuggerbackend.cpp b/src/scripttools/debugging/qscriptdebuggerbackend.cpp
index 3c29130..46d8497 100644
--- a/src/scripttools/debugging/qscriptdebuggerbackend.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerbackend.cpp
@@ -385,7 +385,6 @@ QScriptDebuggerBackend::QScriptDebuggerBackend()
QScriptDebuggerBackend::~QScriptDebuggerBackend()
{
detach();
- delete d_ptr;
}
/*!
diff --git a/src/scripttools/debugging/qscriptdebuggerbackend_p.h b/src/scripttools/debugging/qscriptdebuggerbackend_p.h
index 6d593a6..d9ec307 100644
--- a/src/scripttools/debugging/qscriptdebuggerbackend_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerbackend_p.h
@@ -144,7 +144,7 @@ protected:
protected:
QScriptDebuggerBackend(QScriptDebuggerBackendPrivate &dd);
- QScriptDebuggerBackendPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerBackendPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptDebuggerBackend)
diff --git a/src/scripttools/debugging/qscriptdebuggercommand.cpp b/src/scripttools/debugging/qscriptdebuggercommand.cpp
index c40bfc4..98bb3b3 100644
--- a/src/scripttools/debugging/qscriptdebuggercommand.cpp
+++ b/src/scripttools/debugging/qscriptdebuggercommand.cpp
@@ -118,7 +118,6 @@ QScriptDebuggerCommand::QScriptDebuggerCommand(const QScriptDebuggerCommand &oth
*/
QScriptDebuggerCommand::~QScriptDebuggerCommand()
{
- delete d_ptr;
}
/*!
@@ -646,7 +645,7 @@ QScriptDebuggerCommand QScriptDebuggerCommand::clearExceptionsCommand()
*/
QDataStream &operator<<(QDataStream &out, const QScriptDebuggerCommand &command)
{
- const QScriptDebuggerCommandPrivate *d = command.d_ptr;
+ const QScriptDebuggerCommandPrivate *d = command.d_ptr.data();
out << (quint32)d->type;
out << (qint32)d->attributes.size();
QHash<QScriptDebuggerCommand::Attribute, QVariant>::const_iterator it;
@@ -666,7 +665,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptDebuggerCommand &command)
*/
QDataStream &operator>>(QDataStream &in, QScriptDebuggerCommand &command)
{
- QScriptDebuggerCommandPrivate *d = command.d_ptr;
+ QScriptDebuggerCommandPrivate *d = command.d_ptr.data();
quint32 type;
in >> type;
diff --git a/src/scripttools/debugging/qscriptdebuggercommand_p.h b/src/scripttools/debugging/qscriptdebuggercommand_p.h
index 260e3ec..363738f 100644
--- a/src/scripttools/debugging/qscriptdebuggercommand_p.h
+++ b/src/scripttools/debugging/qscriptdebuggercommand_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qhash.h>
#include <QtCore/qvariant.h>
@@ -250,7 +250,7 @@ public:
static QScriptDebuggerCommand clearExceptionsCommand();
private:
- QScriptDebuggerCommandPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerCommandPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerCommand)
};
diff --git a/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp b/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp
index 1be8c5f..e75ff99 100644
--- a/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp
+++ b/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp
@@ -98,7 +98,6 @@ QScriptDebuggerCommandExecutor::QScriptDebuggerCommandExecutor()
QScriptDebuggerCommandExecutor::~QScriptDebuggerCommandExecutor()
{
- delete d_ptr;
}
/*!
diff --git a/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h b/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h
index 8fff5e5..da7de76 100644
--- a/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h
+++ b/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h
@@ -54,6 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_NAMESPACE
@@ -74,7 +75,7 @@ public:
protected:
QScriptDebuggerCommandExecutor(QScriptDebuggerCommandExecutorPrivate &dd);
- QScriptDebuggerCommandExecutorPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerCommandExecutorPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptDebuggerCommandExecutor)
diff --git a/src/scripttools/debugging/qscriptdebuggerconsole.cpp b/src/scripttools/debugging/qscriptdebuggerconsole.cpp
index 70bb8b1..09a32db 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsole.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerconsole.cpp
@@ -199,7 +199,6 @@ QScriptDebuggerConsole::QScriptDebuggerConsole()
QScriptDebuggerConsole::~QScriptDebuggerConsole()
{
- delete d_ptr;
}
void QScriptDebuggerConsole::loadScriptedCommands(const QString &scriptsPath,
diff --git a/src/scripttools/debugging/qscriptdebuggerconsole_p.h b/src/scripttools/debugging/qscriptdebuggerconsole_p.h
index b5ebf44..a8c4163 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsole_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerconsole_p.h
@@ -54,6 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
+#include <QtCore/qscopedpointer.h>
#include "qscriptdebuggerconsolehistorianinterface_p.h"
@@ -109,7 +110,7 @@ public:
void bumpSessionId();
private:
- QScriptDebuggerConsolePrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerConsolePrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerConsole)
Q_DISABLE_COPY(QScriptDebuggerConsole)
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp b/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp
index 6cbf58c..8e4bc06 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp
@@ -72,7 +72,6 @@ QScriptDebuggerConsoleCommand::QScriptDebuggerConsoleCommand()
QScriptDebuggerConsoleCommand::~QScriptDebuggerConsoleCommand()
{
- delete d_ptr;
}
QScriptDebuggerConsoleCommand::QScriptDebuggerConsoleCommand(QScriptDebuggerConsoleCommandPrivate &dd)
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h b/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h
index fbf285f..2ce3315 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qlist.h>
QT_BEGIN_NAMESPACE
@@ -91,7 +91,7 @@ public:
protected:
QScriptDebuggerConsoleCommand(QScriptDebuggerConsoleCommandPrivate &dd);
- QScriptDebuggerConsoleCommandPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerConsoleCommandPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptDebuggerConsoleCommand)
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp
index 9cfac97..1d43dd0 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp
@@ -90,7 +90,7 @@ QScriptDebuggerConsoleCommandGroupData::QScriptDebuggerConsoleCommandGroupData(
QScriptDebuggerConsoleCommandGroupData::QScriptDebuggerConsoleCommandGroupData(
const QScriptDebuggerConsoleCommandGroupData &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
if (d_ptr)
d_ptr->ref.ref();
@@ -98,22 +98,12 @@ QScriptDebuggerConsoleCommandGroupData::QScriptDebuggerConsoleCommandGroupData(
QScriptDebuggerConsoleCommandGroupData::~QScriptDebuggerConsoleCommandGroupData()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
}
QScriptDebuggerConsoleCommandGroupData &QScriptDebuggerConsoleCommandGroupData::operator=(
const QScriptDebuggerConsoleCommandGroupData &other)
{
- if (d_ptr == other.d_ptr)
- return *this;
- if (d_ptr && !d_ptr->ref.deref())
- delete d_ptr;
- d_ptr = other.d_ptr;
- if (d_ptr)
- d_ptr->ref.ref();
+ d_ptr.assign(other.d_ptr.data());
return *this;
}
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h
index c32277f..9b0e281 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qmap.h>
QT_BEGIN_NAMESPACE
@@ -82,7 +82,7 @@ public:
const QScriptDebuggerConsoleCommandGroupData &other);
private:
- QScriptDebuggerConsoleCommandGroupDataPrivate *d_ptr;
+ QScopedSharedPointer<QScriptDebuggerConsoleCommandGroupDataPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptDebuggerConsoleCommandGroupData)
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp
index ef9687e..f22efc5 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp
@@ -105,7 +105,6 @@ QScriptDebuggerConsoleCommandManager::QScriptDebuggerConsoleCommandManager()
QScriptDebuggerConsoleCommandManager::~QScriptDebuggerConsoleCommandManager()
{
- delete d_ptr;
}
/*!
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h
index b5c9842..cebb999 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qmap.h>
#include <QtCore/qlist.h>
@@ -86,7 +86,7 @@ public:
QStringList completions(const QString &prefix) const;
private:
- QScriptDebuggerConsoleCommandManagerPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerConsoleCommandManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerConsoleCommandManager)
};
diff --git a/src/scripttools/debugging/qscriptdebuggerevent.cpp b/src/scripttools/debugging/qscriptdebuggerevent.cpp
index 9d971a9..418e8fa 100644
--- a/src/scripttools/debugging/qscriptdebuggerevent.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerevent.cpp
@@ -97,7 +97,6 @@ QScriptDebuggerEvent::QScriptDebuggerEvent(const QScriptDebuggerEvent &other)
QScriptDebuggerEvent::~QScriptDebuggerEvent()
{
- delete d_ptr;
}
QScriptDebuggerEvent &QScriptDebuggerEvent::operator=(const QScriptDebuggerEvent &other)
@@ -276,7 +275,7 @@ bool QScriptDebuggerEvent::operator!=(const QScriptDebuggerEvent &other) const
*/
QDataStream &operator<<(QDataStream &out, const QScriptDebuggerEvent &event)
{
- const QScriptDebuggerEventPrivate *d = event.d_ptr;
+ const QScriptDebuggerEventPrivate *d = event.d_ptr.data();
out << (quint32)d->type;
out << (qint32)d->attributes.size();
QHash<QScriptDebuggerEvent::Attribute, QVariant>::const_iterator it;
@@ -296,7 +295,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptDebuggerEvent &event)
*/
QDataStream &operator>>(QDataStream &in, QScriptDebuggerEvent &event)
{
- QScriptDebuggerEventPrivate *d = event.d_ptr;
+ QScriptDebuggerEventPrivate *d = event.d_ptr.data();
quint32 type;
in >> type;
diff --git a/src/scripttools/debugging/qscriptdebuggerevent_p.h b/src/scripttools/debugging/qscriptdebuggerevent_p.h
index d9c073c..0cfde4f 100644
--- a/src/scripttools/debugging/qscriptdebuggerevent_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerevent_p.h
@@ -57,6 +57,7 @@
#include <QtCore/qcoreevent.h>
#include <QtCore/qhash.h>
#include <QtCore/qvariant.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_NAMESPACE
@@ -137,7 +138,7 @@ public:
bool operator!=(const QScriptDebuggerEvent &other) const;
private:
- QScriptDebuggerEventPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerEventPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerEvent)
};
diff --git a/src/scripttools/debugging/qscriptdebuggerfrontend.cpp b/src/scripttools/debugging/qscriptdebuggerfrontend.cpp
index ced20b1..4d0a8b4 100644
--- a/src/scripttools/debugging/qscriptdebuggerfrontend.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerfrontend.cpp
@@ -143,7 +143,6 @@ QScriptDebuggerFrontend::QScriptDebuggerFrontend()
QScriptDebuggerFrontend::~QScriptDebuggerFrontend()
{
- delete d_ptr;
}
QScriptDebuggerFrontend::QScriptDebuggerFrontend(QScriptDebuggerFrontendPrivate &dd)
diff --git a/src/scripttools/debugging/qscriptdebuggerfrontend_p.h b/src/scripttools/debugging/qscriptdebuggerfrontend_p.h
index a763463..bed0f85 100644
--- a/src/scripttools/debugging/qscriptdebuggerfrontend_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerfrontend_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qstring.h>
#include "qscriptdebuggercommandschedulerinterface_p.h"
@@ -90,7 +90,7 @@ protected:
protected:
QScriptDebuggerFrontend(QScriptDebuggerFrontendPrivate &dd);
- QScriptDebuggerFrontendPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerFrontendPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptDebuggerFrontend)
diff --git a/src/scripttools/debugging/qscriptdebuggerjob.cpp b/src/scripttools/debugging/qscriptdebuggerjob.cpp
index 109c805..20d17bb 100644
--- a/src/scripttools/debugging/qscriptdebuggerjob.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerjob.cpp
@@ -85,7 +85,6 @@ QScriptDebuggerJob::QScriptDebuggerJob(QScriptDebuggerJobPrivate &dd)
QScriptDebuggerJob::~QScriptDebuggerJob()
{
- delete d_ptr;
}
void QScriptDebuggerJob::finish()
diff --git a/src/scripttools/debugging/qscriptdebuggerjob_p.h b/src/scripttools/debugging/qscriptdebuggerjob_p.h
index e84d6d5..2f7305f 100644
--- a/src/scripttools/debugging/qscriptdebuggerjob_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerjob_p.h
@@ -54,6 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_NAMESPACE
@@ -76,7 +77,7 @@ public:
protected:
QScriptDebuggerJob(QScriptDebuggerJobPrivate &dd);
- QScriptDebuggerJobPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerJobPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptDebuggerJob)
diff --git a/src/scripttools/debugging/qscriptdebuggerresponse.cpp b/src/scripttools/debugging/qscriptdebuggerresponse.cpp
index 82bfff2..bf24846 100644
--- a/src/scripttools/debugging/qscriptdebuggerresponse.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerresponse.cpp
@@ -101,7 +101,6 @@ QScriptDebuggerResponse::QScriptDebuggerResponse(const QScriptDebuggerResponse &
QScriptDebuggerResponse::~QScriptDebuggerResponse()
{
- delete d_ptr;
}
QScriptDebuggerResponse &QScriptDebuggerResponse::operator=(const QScriptDebuggerResponse &other)
@@ -320,7 +319,7 @@ bool QScriptDebuggerResponse::operator!=(const QScriptDebuggerResponse &other) c
*/
QDataStream &operator<<(QDataStream &out, const QScriptDebuggerResponse &response)
{
- const QScriptDebuggerResponsePrivate *d = response.d_ptr;
+ const QScriptDebuggerResponsePrivate *d = response.d_ptr.data();
out << (quint32)d->error;
out << d->result;
out << d->async;
@@ -336,7 +335,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptDebuggerResponse &respons
*/
QDataStream &operator>>(QDataStream &in, QScriptDebuggerResponse &response)
{
- QScriptDebuggerResponsePrivate *d = response.d_ptr;
+ QScriptDebuggerResponsePrivate *d = response.d_ptr.data();
quint32 error;
in >> error;
diff --git a/src/scripttools/debugging/qscriptdebuggerresponse_p.h b/src/scripttools/debugging/qscriptdebuggerresponse_p.h
index dd65ffd..4fa1731 100644
--- a/src/scripttools/debugging/qscriptdebuggerresponse_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerresponse_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qmap.h>
#include <QtCore/qvariant.h>
@@ -127,7 +127,7 @@ public:
bool operator!=(const QScriptDebuggerResponse &other) const;
private:
- QScriptDebuggerResponsePrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerResponsePrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerResponse)
};
diff --git a/src/scripttools/debugging/qscriptdebuggervalue.cpp b/src/scripttools/debugging/qscriptdebuggervalue.cpp
index bb41ee8..b92cbd2 100644
--- a/src/scripttools/debugging/qscriptdebuggervalue.cpp
+++ b/src/scripttools/debugging/qscriptdebuggervalue.cpp
@@ -94,7 +94,7 @@ QScriptDebuggerValue::QScriptDebuggerValue(const QScriptValue &value)
: d_ptr(0)
{
if (value.isValid()) {
- d_ptr = new QScriptDebuggerValuePrivate;
+ d_ptr.reset(new QScriptDebuggerValuePrivate);
if (value.isUndefined())
d_ptr->type = UndefinedValue;
else if (value.isNull())
@@ -157,7 +157,7 @@ QScriptDebuggerValue::QScriptDebuggerValue(ValueType type)
}
QScriptDebuggerValue::QScriptDebuggerValue(const QScriptDebuggerValue &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
if (d_ptr)
d_ptr->ref.ref();
@@ -165,21 +165,11 @@ QScriptDebuggerValue::QScriptDebuggerValue(const QScriptDebuggerValue &other)
QScriptDebuggerValue::~QScriptDebuggerValue()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
}
QScriptDebuggerValue &QScriptDebuggerValue::operator=(const QScriptDebuggerValue &other)
{
- if (d_ptr == other.d_ptr)
- return *this;
- if (d_ptr && !d_ptr->ref.deref())
- delete d_ptr;
- d_ptr = other.d_ptr;
- if (d_ptr)
- d_ptr->ref.ref();
+ d_ptr.assign(other.d_ptr.data());
return *this;
}
diff --git a/src/scripttools/debugging/qscriptdebuggervalue_p.h b/src/scripttools/debugging/qscriptdebuggervalue_p.h
index 0142de0..c082bf3 100644
--- a/src/scripttools/debugging/qscriptdebuggervalue_p.h
+++ b/src/scripttools/debugging/qscriptdebuggervalue_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qlist.h>
QT_BEGIN_NAMESPACE
@@ -103,7 +103,7 @@ public:
bool operator!=(const QScriptDebuggerValue &other) const;
private:
- QScriptDebuggerValuePrivate *d_ptr;
+ QScopedSharedPointer<QScriptDebuggerValuePrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerValue)
};
diff --git a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp
index 723e304..63f820b 100644
--- a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp
+++ b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp
@@ -105,7 +105,7 @@ QScriptDebuggerValueProperty::QScriptDebuggerValueProperty(const QString &name,
Constructs a QScriptDebuggerValueProperty that is a copy of the \a other property.
*/
QScriptDebuggerValueProperty::QScriptDebuggerValueProperty(const QScriptDebuggerValueProperty &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
if (d_ptr)
d_ptr->ref.ref();
@@ -116,10 +116,6 @@ QScriptDebuggerValueProperty::QScriptDebuggerValueProperty(const QScriptDebugger
*/
QScriptDebuggerValueProperty::~QScriptDebuggerValueProperty()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
}
/*!
@@ -127,13 +123,7 @@ QScriptDebuggerValueProperty::~QScriptDebuggerValueProperty()
*/
QScriptDebuggerValueProperty &QScriptDebuggerValueProperty::operator=(const QScriptDebuggerValueProperty &other)
{
- if (d_ptr == other.d_ptr)
- return *this;
- if (d_ptr && !d_ptr->ref.deref())
- delete d_ptr;
- d_ptr = other.d_ptr;
- if (d_ptr)
- d_ptr->ref.ref();
+ d_ptr.assign(other.d_ptr.data());
return *this;
}
diff --git a/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h b/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h
index f67bafd..be27ebd 100644
--- a/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h
+++ b/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h
@@ -55,6 +55,7 @@
#include <QtCore/qobjectdefs.h>
#include <QtCore/qlist.h>
+#include <QtCore/qscopedpointer.h>
#include <QtScript/qscriptvalue.h>
QT_BEGIN_NAMESPACE
@@ -85,7 +86,7 @@ public:
bool isValid() const;
private:
- QScriptDebuggerValuePropertyPrivate *d_ptr;
+ QScopedSharedPointer<QScriptDebuggerValuePropertyPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerValueProperty)
};
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/scripttools/debugging/qscriptscriptdata.cpp b/src/scripttools/debugging/qscriptscriptdata.cpp
index 068748f..a4f8cd7 100644
--- a/src/scripttools/debugging/qscriptscriptdata.cpp
+++ b/src/scripttools/debugging/qscriptscriptdata.cpp
@@ -98,7 +98,7 @@ QScriptScriptData::QScriptScriptData(const QString &contents, const QString &fil
}
QScriptScriptData::QScriptScriptData(const QScriptScriptData &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
if (d_ptr)
d_ptr->ref.ref();
@@ -106,21 +106,11 @@ QScriptScriptData::QScriptScriptData(const QScriptScriptData &other)
QScriptScriptData::~QScriptScriptData()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
}
QScriptScriptData &QScriptScriptData::operator=(const QScriptScriptData &other)
{
- if (d_ptr == other.d_ptr)
- return *this;
- if (d_ptr && !d_ptr->ref.deref())
- delete d_ptr;
- d_ptr = other.d_ptr;
- if (d_ptr)
- d_ptr->ref.ref();
+ d_ptr.assign(other.d_ptr.data());
return *this;
}
@@ -191,7 +181,7 @@ bool QScriptScriptData::operator!=(const QScriptScriptData &other) const
QDataStream &operator<<(QDataStream &out, const QScriptScriptData &data)
{
- const QScriptScriptDataPrivate *d = data.d_ptr;
+ const QScriptScriptDataPrivate *d = data.d_ptr.data();
if (d) {
out << d->contents;
out << d->fileName;
@@ -207,10 +197,10 @@ QDataStream &operator<<(QDataStream &out, const QScriptScriptData &data)
QDataStream &operator>>(QDataStream &in, QScriptScriptData &data)
{
if (!data.d_ptr) {
- data.d_ptr = new QScriptScriptDataPrivate();
+ data.d_ptr.reset(new QScriptScriptDataPrivate());
data.d_ptr->ref.ref();
}
- QScriptScriptDataPrivate *d = data.d_ptr;
+ QScriptScriptDataPrivate *d = data.d_ptr.data();
in >> d->contents;
in >> d->fileName;
qint32 ln;
diff --git a/src/scripttools/debugging/qscriptscriptdata_p.h b/src/scripttools/debugging/qscriptscriptdata_p.h
index 50cad32..e871c2c 100644
--- a/src/scripttools/debugging/qscriptscriptdata_p.h
+++ b/src/scripttools/debugging/qscriptscriptdata_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qmap.h>
@@ -91,7 +91,7 @@ public:
bool operator!=(const QScriptScriptData &other) const;
private:
- QScriptScriptDataPrivate *d_ptr;
+ QScopedSharedPointer<QScriptScriptDataPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptScriptData)
};
diff --git a/src/scripttools/debugging/qscriptstdmessagehandler.cpp b/src/scripttools/debugging/qscriptstdmessagehandler.cpp
index 4e0f12c..6742554 100644
--- a/src/scripttools/debugging/qscriptstdmessagehandler.cpp
+++ b/src/scripttools/debugging/qscriptstdmessagehandler.cpp
@@ -66,7 +66,6 @@ QScriptStdMessageHandler::QScriptStdMessageHandler()
QScriptStdMessageHandler::~QScriptStdMessageHandler()
{
- delete d_ptr;
}
void QScriptStdMessageHandler::message(QtMsgType type, const QString &text,
diff --git a/src/scripttools/debugging/qscriptstdmessagehandler_p.h b/src/scripttools/debugging/qscriptstdmessagehandler_p.h
index 8b75f6a..06d680b 100644
--- a/src/scripttools/debugging/qscriptstdmessagehandler_p.h
+++ b/src/scripttools/debugging/qscriptstdmessagehandler_p.h
@@ -53,6 +53,8 @@
// We mean it.
//
+#include <QtCore/qscopedpointer.h>
+
#include "qscriptmessagehandlerinterface_p.h"
QT_BEGIN_NAMESPACE
@@ -71,7 +73,7 @@ public:
const QVariant &data = QVariant());
private:
- QScriptStdMessageHandlerPrivate *d_ptr;
+ QScopedPointer<QScriptStdMessageHandlerPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptStdMessageHandler)
diff --git a/src/scripttools/debugging/qscriptvalueproperty.cpp b/src/scripttools/debugging/qscriptvalueproperty.cpp
index 245edc3..75cfdd7 100644
--- a/src/scripttools/debugging/qscriptvalueproperty.cpp
+++ b/src/scripttools/debugging/qscriptvalueproperty.cpp
@@ -95,7 +95,7 @@ QScriptValueProperty::QScriptValueProperty(const QString &name,
Constructs a QScriptValueProperty that is a copy of the \a other property.
*/
QScriptValueProperty::QScriptValueProperty(const QScriptValueProperty &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
if (d_ptr)
d_ptr->ref.ref();
@@ -106,10 +106,6 @@ QScriptValueProperty::QScriptValueProperty(const QScriptValueProperty &other)
*/
QScriptValueProperty::~QScriptValueProperty()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
}
/*!
@@ -117,13 +113,7 @@ QScriptValueProperty::~QScriptValueProperty()
*/
QScriptValueProperty &QScriptValueProperty::operator=(const QScriptValueProperty &other)
{
- if (d_ptr == other.d_ptr)
- return *this;
- if (d_ptr && !d_ptr->ref.deref())
- delete d_ptr;
- d_ptr = other.d_ptr;
- if (d_ptr)
- d_ptr->ref.ref();
+ d_ptr.assign(other.d_ptr.data());
return *this;
}
diff --git a/src/scripttools/debugging/qscriptvalueproperty_p.h b/src/scripttools/debugging/qscriptvalueproperty_p.h
index 938ab83..ca6980f 100644
--- a/src/scripttools/debugging/qscriptvalueproperty_p.h
+++ b/src/scripttools/debugging/qscriptvalueproperty_p.h
@@ -55,6 +55,7 @@
#include <QtCore/qobjectdefs.h>
#include <QtCore/qlist.h>
+#include <QtCore/qscopedpointer.h>
#include <QtScript/qscriptvalue.h>
QT_BEGIN_NAMESPACE
@@ -81,7 +82,7 @@ public:
bool isValid() const;
private:
- QScriptValuePropertyPrivate *d_ptr;
+ QScopedSharedPointer<QScriptValuePropertyPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptValueProperty)
};
diff --git a/src/scripttools/scripttools.pro b/src/scripttools/scripttools.pro
index faf0936a..5878db2 100644
--- a/src/scripttools/scripttools.pro
+++ b/src/scripttools/scripttools.pro
@@ -10,3 +10,5 @@ unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtScript
include(../qbase.pri)
include(debugging/debugging.pri)
+
+symbian:TARGET.UID3=0x2001E625
diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp
index 4f3d79d..1645555 100644
--- a/src/sql/drivers/ibase/qsql_ibase.cpp
+++ b/src/sql/drivers/ibase/qsql_ibase.cpp
@@ -55,6 +55,7 @@
#include <limits.h>
#include <math.h>
#include <qdebug.h>
+#include <QVarLengthArray>
QT_BEGIN_NAMESPACE
@@ -583,7 +584,7 @@ QVariant QIBaseResultPrivate::fetchArray(int pos, ISC_QUAD *arr)
int arraySize = 1, subArraySize;
short dimensions = desc.array_desc_dimensions;
- short *numElements = new short[dimensions];
+ QVarLengthArray<short> numElements(dimensions);
for(int i = 0; i < dimensions; ++i) {
subArraySize = (desc.array_desc_bounds[i].array_bound_upper -
@@ -612,9 +613,7 @@ QVariant QIBaseResultPrivate::fetchArray(int pos, ISC_QUAD *arr)
QSqlError::StatementError))
return list;
- readArrayBuffer(list, ba.data(), 0, numElements, &desc, tc);
-
- delete[] numElements;
+ readArrayBuffer(list, ba.data(), 0, numElements.data(), &desc, tc);
return QVariant(list);
}
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp
index fbefa0c..53645c9 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; }
}
}
@@ -1279,6 +1278,11 @@ bool QMYSQLDriver::open(const QString& db,
d->preparedQuerysEnabled = false;
#endif
+#ifndef QT_NO_THREAD
+ mysql_thread_init();
+#endif
+
+
setOpen(true);
setOpenError(false);
return true;
@@ -1287,6 +1291,9 @@ bool QMYSQLDriver::open(const QString& db,
void QMYSQLDriver::close()
{
if (isOpen()) {
+#ifndef QT_NO_THREAD
+ mysql_thread_end();
+#endif
mysql_close(d->mysql);
d->mysql = NULL;
setOpen(false);
diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp
index d63c482..a7031b1 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;
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index e6729a5..2a07e28 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -1195,7 +1195,7 @@ void QSqlQuery::finish()
The query will be repositioned on an \e invalid record in the new
result set and must be navigated to a valid record before data
values can be retrieved. If a new result set isn't available the
- function returns false and the the query is set to inactive. In any
+ function returns false and the query is set to inactive. In any
case the old result set will be discarded.
When one of the statements is a non-select statement a count of
diff --git a/src/src.pro b/src/src.pro
index 3e63e6e..f131e4f 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -23,6 +23,9 @@ win32:{
!wince*: SRC_SUBDIRS += src_tools_idc
}
+# TODO the following line should be between opengl and webkit when the 'symbian' block is removed
+contains(QT_CONFIG, phonon): SRC_SUBDIRS += src_phonon
+
!symbian {
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2): SRC_SUBDIRS += src_opengl
contains(QT_CONFIG, xmlpatterns): SRC_SUBDIRS += src_xmlpatterns
@@ -35,8 +38,6 @@ contains(QT_CONFIG, scripttools): SRC_SUBDIRS += src_scripttools
SRC_SUBDIRS += src_plugins
}
-contains(QT_CONFIG, phonon): SRC_SUBDIRS += src_phonon
-
src_s60main.subdir = $$QT_SOURCE_TREE/src/s60main
src_s60main.target = sub-s60main
src_winmain.subdir = $$QT_SOURCE_TREE/src/winmain
diff --git a/src/svg/qgraphicssvgitem.h b/src/svg/qgraphicssvgitem.h
index c6ab0f7..940ce9b 100644
--- a/src/svg/qgraphicssvgitem.h
+++ b/src/svg/qgraphicssvgitem.h
@@ -41,8 +41,8 @@
#ifndef QGRAPHICSSVGITEM_H
#define QGRAPHICSSVGITEM_H
-#include <QtGui/qgraphicsitem.h>
#include <QtCore/qobject.h>
+#include <QtGui/qgraphicsitem.h>
#ifndef QT_NO_GRAPHICSSVGITEM
@@ -89,9 +89,9 @@ private:
// Q_DECLARE_PRIVATE_WITH_BASE(QGraphicsSvgItem, QObject)
inline QGraphicsSvgItemPrivate *d_func()
- { return reinterpret_cast<QGraphicsSvgItemPrivate *>(QObject::d_ptr); }
+ { return reinterpret_cast<QGraphicsSvgItemPrivate *>(QObject::d_ptr.data()); }
inline const QGraphicsSvgItemPrivate *d_func() const
- { return reinterpret_cast<const QGraphicsSvgItemPrivate *>(QObject::d_ptr); }
+ { return reinterpret_cast<const QGraphicsSvgItemPrivate *>(QObject::d_ptr.data()); }
friend class QGraphicsSvgItemPrivate;
Q_PRIVATE_SLOT(d_func(), void _q_repaintItem())
diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp
index e822da5..5052ec7 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;
@@ -567,7 +567,6 @@ QSvgGenerator::~QSvgGenerator()
if (d->owns_iodevice)
delete d->engine->outputDevice();
delete d->engine;
- delete d_ptr;
}
/*!
diff --git a/src/svg/qsvggenerator.h b/src/svg/qsvggenerator.h
index 723a220..1d24324 100644
--- a/src/svg/qsvggenerator.h
+++ b/src/svg/qsvggenerator.h
@@ -49,6 +49,7 @@
#include <QtCore/qnamespace.h>
#include <QtCore/qiodevice.h>
#include <QtCore/qobjectdefs.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -100,7 +101,7 @@ protected:
int metric(QPaintDevice::PaintDeviceMetric metric) const;
private:
- QSvgGeneratorPrivate *d_ptr;
+ QScopedPointer<QSvgGeneratorPrivate> d_ptr;
};
QT_END_NAMESPACE
diff --git a/src/testlib/3rdparty/cycle_p.h b/src/testlib/3rdparty/cycle_p.h
index 547fdc1..a292423 100644
--- a/src/testlib/3rdparty/cycle_p.h
+++ b/src/testlib/3rdparty/cycle_p.h
@@ -190,6 +190,7 @@ INLINE_ELAPSED(__inline__)
#endif
/* Visual C++ -- thanks to Morten Nissov for his help with this */
+#if defined(_MSC_VER)
#if _MSC_VER >= 1200 && (_M_IX86 >= 500 || (defined(_WIN32_WCE) && defined(_X86_))) && !defined(HAVE_TICK_COUNTER)
#include <windows.h>
typedef LARGE_INTEGER CycleCounterTicks;
@@ -215,6 +216,7 @@ static __inline double elapsed(CycleCounterTicks t1, CycleCounterTicks t0)
#define HAVE_TICK_COUNTER
#define TIME_MIN 5000.0 /* unreliable pentium IV cycle counter */
#endif
+#endif
#if _MSC_VER >= 1400 && defined(_WIN32_WCE) && !defined(HAVE_TICK_COUNTER)
#include <windows.h>
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index 6ea38f7..15319ce 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -226,10 +226,17 @@ int main(int argc, char *argv[]) \
#include <QtTest/qtest_gui.h>
+#ifdef QT_KEYPAD_NAVIGATION
+# define QTEST_DISABLE_KEYPAD_NAVIGATION QApplication::setKeypadNavigationEnabled(false);
+#else
+# define QTEST_DISABLE_KEYPAD_NAVIGATION
+#endif
+
#define QTEST_MAIN(TestObject) \
int main(int argc, char *argv[]) \
{ \
QApplication app(argc, argv); \
+ QTEST_DISABLE_KEYPAD_NAVIGATION \
TestObject tc; \
return QTest::qExec(&tc, argc, argv); \
}
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 27ba6da..38e63cf 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -300,10 +300,15 @@ QT_BEGIN_NAMESPACE
the \a TestClass, and executes all tests in the order they were defined.
Use this macro to build stand-alone executables.
+ \bold {Note:} On platforms that have keypad navigation enabled by default (eg: Symbian),
+ this macro will forcfully disable it to simplify the usage of key events when writing
+ autotests. If you wish to write a test case that uses keypad navigation, you should
+ enable it either in the \c {initTestCase()} or \c {init()} functions of your test case.
+
Example:
\snippet doc/src/snippets/code/src_qtestlib_qtestcase.cpp 11
- \sa QTEST_APPLESS_MAIN(), QTest::qExec()
+ \sa QTEST_APPLESS_MAIN(), QTest::qExec(), QApplication::setKeypadNavigationEnabled()
*/
/*! \macro QTEST_APPLESS_MAIN(TestClass)
@@ -1432,7 +1437,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
}
#endif
- #ifndef QT_NO_EXCEPTIONS
+#ifndef QT_NO_EXCEPTIONS
} catch (...) {
QTestResult::addFailure("Caught unhandled exception", __FILE__, __LINE__);
if (QTestResult::currentTestFunction()) {
@@ -1446,13 +1451,13 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
IOPMAssertionRelease(powerID);
}
#endif
- #ifdef Q_OS_WIN
+//# ifdef Q_OS_WIN
// rethrow exception to make debugging easier
throw;
- #endif
- return -1;
+//# endif
+ return 1;
}
- #endif
+# endif
currentTestObject = 0;
#ifdef QT_MAC_USE_COCOA
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 550abc9..5e2c74b 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -512,8 +512,8 @@ public:
bool setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg, int *errorLine, int *errorColumn);
// Attributes
- QDomDocumentTypePrivate* doctype() { return type; };
- QDomImplementationPrivate* implementation() { return impl; };
+ QDomDocumentTypePrivate* doctype() { return type.data(); };
+ QDomImplementationPrivate* implementation() { return impl.data(); };
QDomElementPrivate* documentElement();
// Factories
@@ -537,8 +537,8 @@ public:
void clear();
// Variables
- QDomImplementationPrivate* impl;
- QDomDocumentTypePrivate* type;
+ QScopedSharedPointer<QDomImplementationPrivate> impl;
+ QScopedSharedPointer<QDomDocumentTypePrivate> type;
void saveDocument(QTextStream& stream, const int indent, QDomNode::EncodingPolicy encUsed) const;
@@ -3060,7 +3060,7 @@ QDomNamedNodeMapPrivate::~QDomNamedNodeMapPrivate()
QDomNamedNodeMapPrivate* QDomNamedNodeMapPrivate::clone(QDomNodePrivate* p)
{
- QDomNamedNodeMapPrivate* m = new QDomNamedNodeMapPrivate(p);
+ QScopedPointer<QDomNamedNodeMapPrivate> m(new QDomNamedNodeMapPrivate(p));
m->readonly = readonly;
m->appendToParent = appendToParent;
@@ -3073,7 +3073,7 @@ QDomNamedNodeMapPrivate* QDomNamedNodeMapPrivate::clone(QDomNodePrivate* p)
// we are no longer interested in ownership
m->ref.deref();
- return m;
+ return m.take();
}
void QDomNamedNodeMapPrivate::clearMap()
@@ -3499,13 +3499,18 @@ QDomDocumentTypePrivate::~QDomDocumentTypePrivate()
void QDomDocumentTypePrivate::init()
{
entities = new QDomNamedNodeMapPrivate(this);
- notations = new QDomNamedNodeMapPrivate(this);
- publicId.clear();
- systemId.clear();
- internalSubset.clear();
-
- entities->setAppendToParent(true);
- notations->setAppendToParent(true);
+ QT_TRY {
+ notations = new QDomNamedNodeMapPrivate(this);
+ publicId.clear();
+ systemId.clear();
+ internalSubset.clear();
+
+ entities->setAppendToParent(true);
+ notations->setAppendToParent(true);
+ } QT_CATCH(...) {
+ delete entities;
+ QT_RETHROW;
+ }
}
QDomNodePrivate* QDomDocumentTypePrivate::cloneNode(bool deep)
@@ -6148,8 +6153,8 @@ QDomDocumentPrivate::QDomDocumentPrivate()
: QDomNodePrivate(0),
nodeListTime(1)
{
- impl = new QDomImplementationPrivate;
- type = new QDomDocumentTypePrivate(this, this);
+ impl.reset(new QDomImplementationPrivate);
+ type.reset(new QDomDocumentTypePrivate(this, this));
name = QLatin1String("#document");
}
@@ -6158,8 +6163,8 @@ QDomDocumentPrivate::QDomDocumentPrivate(const QString& aname)
: QDomNodePrivate(0),
nodeListTime(1)
{
- impl = new QDomImplementationPrivate;
- type = new QDomDocumentTypePrivate(this, this);
+ impl.reset(new QDomImplementationPrivate);
+ type.reset(new QDomDocumentTypePrivate(this, this));
type->name = aname;
name = QLatin1String("#document");
@@ -6169,12 +6174,11 @@ QDomDocumentPrivate::QDomDocumentPrivate(QDomDocumentTypePrivate* dt)
: QDomNodePrivate(0),
nodeListTime(1)
{
- impl = new QDomImplementationPrivate;
+ impl.reset(new QDomImplementationPrivate);
if (dt != 0) {
- type = dt;
- type->ref.ref();
+ type.assign(dt);
} else {
- type = new QDomDocumentTypePrivate(this, this);
+ type.reset(new QDomDocumentTypePrivate(this, this));
}
name = QLatin1String("#document");
@@ -6184,31 +6188,19 @@ QDomDocumentPrivate::QDomDocumentPrivate(QDomDocumentPrivate* n, bool deep)
: QDomNodePrivate(n, deep),
nodeListTime(1)
{
- impl = n->impl->clone();
- // Reference count is down to 0, so we set it to 1 here.
- impl->ref.ref();
- type = (QDomDocumentTypePrivate*)n->type->cloneNode();
+ impl.assign(n->impl->clone());
+ type.assign((QDomDocumentTypePrivate*)n->type->cloneNode());
type->setParent(this);
- // Reference count is down to 0, so we set it to 1 here.
- type->ref.ref();
}
QDomDocumentPrivate::~QDomDocumentPrivate()
{
- if (!impl->ref.deref())
- delete impl;
- if (!type->ref.deref())
- delete type;
}
void QDomDocumentPrivate::clear()
{
- if (!impl->ref.deref())
- delete impl;
- if (!type->ref.deref())
- delete type;
- impl = 0;
- type = 0;
+ impl.assign(0);
+ type.assign(0);
QDomNodePrivate::clear();
}
@@ -6229,8 +6221,8 @@ bool QDomDocumentPrivate::setContent(QXmlInputSource *source, bool namespaceProc
bool QDomDocumentPrivate::setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg, int *errorLine, int *errorColumn)
{
clear();
- impl = new QDomImplementationPrivate;
- type = new QDomDocumentTypePrivate(this, this);
+ impl.reset(new QDomImplementationPrivate);
+ type.reset(new QDomDocumentTypePrivate(this, this));
bool namespaceProcessing = reader->feature(QLatin1String("http://xml.org/sax/features/namespaces"))
&& !reader->feature(QLatin1String("http://xml.org/sax/features/namespace-prefixes"));
@@ -7448,20 +7440,22 @@ bool QDomHandler::characters(const QString& ch)
if (node == doc)
return false;
- QDomNodePrivate *n;
+ QScopedPointer<QDomNodePrivate> n;
if (cdata) {
- n = doc->createCDATASection(ch);
+ n.reset(doc->createCDATASection(ch));
} else if (!entityName.isEmpty()) {
- QDomEntityPrivate* e = new QDomEntityPrivate(doc, 0, entityName,
- QString(), QString(), QString());
+ QScopedPointer<QDomEntityPrivate> e(new QDomEntityPrivate(doc, 0, entityName,
+ QString(), QString(), QString()));
e->value = ch;
- doc->doctype()->appendChild(e);
- n = doc->createEntityReference(entityName);
+ doc->doctype()->appendChild(e.data());
+ e.take();
+ n.reset(doc->createEntityReference(entityName));
} else {
- n = doc->createTextNode(ch);
+ n.reset(doc->createTextNode(ch));
}
n->setLocation(locator->lineNumber(), locator->columnNumber());
- node->appendChild(n);
+ node->appendChild(n.data());
+ n.take();
return true;
}
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
index b94d3fa..1655642 100644
--- a/src/xml/sax/qxml.cpp
+++ b/src/xml/sax/qxml.cpp
@@ -262,10 +262,11 @@ class QXmlDefaultHandlerPrivate
class QXmlSimpleReaderPrivate
{
+public:
+ ~QXmlSimpleReaderPrivate();
private:
// functions
- QXmlSimpleReaderPrivate();
- ~QXmlSimpleReaderPrivate();
+ QXmlSimpleReaderPrivate(QXmlSimpleReader *reader);
void initIncrementalParsing();
// used to determine if elements are correctly nested
@@ -350,7 +351,7 @@ private:
bool contentCharDataRead;
// helper classes
- QXmlLocator *locator;
+ QScopedPointer<QXmlLocator> locator;
QXmlNamespaceSupport namespaceSupport;
// error string
@@ -545,8 +546,8 @@ private:
QXmlParseException::QXmlParseException(const QString& name, int c, int l,
const QString& p, const QString& s)
+ : d(new QXmlParseExceptionPrivate)
{
- d = new QXmlParseExceptionPrivate;
d->msg = name;
d->column = c;
d->line = l;
@@ -559,7 +560,6 @@ QXmlParseException::QXmlParseException(const QString& name, int c, int l,
*/
QXmlParseException::~QXmlParseException()
{
- delete d;
}
/*!
@@ -928,8 +928,9 @@ void QXmlNamespaceSupport::popContext()
*/
void QXmlNamespaceSupport::reset()
{
+ QXmlNamespaceSupportPrivate *newD = new QXmlNamespaceSupportPrivate;
delete d;
- d = new QXmlNamespaceSupportPrivate;
+ d = newD;
}
@@ -1260,18 +1261,23 @@ void QXmlInputSource::init()
{
d = new QXmlInputSourcePrivate;
- d->inputDevice = 0;
- d->inputStream = 0;
+ QT_TRY {
+ d->inputDevice = 0;
+ d->inputStream = 0;
- setData(QString());
+ setData(QString());
#ifndef QT_NO_TEXTCODEC
- d->encMapper = 0;
+ d->encMapper = 0;
#endif
- d->nextReturnedEndOfData = true; // first call to next() will call fetchData()
+ d->nextReturnedEndOfData = true; // first call to next() will call fetchData()
- d->encodingDeclBytes.clear();
- d->encodingDeclChars.clear();
- d->lookingForEncodingDecl = true;
+ d->encodingDeclBytes.clear();
+ d->encodingDeclChars.clear();
+ d->lookingForEncodingDecl = true;
+ } QT_CATCH(...) {
+ delete(d);
+ QT_RETHROW;
+ }
}
/*!
@@ -2109,7 +2115,7 @@ events are reported.
You can set the lexical handler with
QXmlReader::setLexicalHandler().
- This interface's design is based on the the SAX2 extension
+ This interface's design is based on the SAX2 extension
LexicalHandler.
The interface provides the startDTD(), endDTD(), startEntity(),
@@ -2715,9 +2721,24 @@ inline void QXmlSimpleReaderPrivate::refClear()
refValueLen = 0; refArrayPos = 0;
}
-QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate()
+QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate(QXmlSimpleReader *reader)
{
+ q_ptr = reader;
parseStack = 0;
+
+ locator.reset(new QXmlSimpleReaderLocator(reader));
+ entityRes = 0;
+ dtdHnd = 0;
+ contentHnd = 0;
+ errorHnd = 0;
+ lexicalHnd = 0;
+ declHnd = 0;
+
+ // default feature settings
+ useNamespaces = true;
+ useNamespacePrefixes = false;
+ reportWhitespaceCharData = true;
+ reportEntities = false;
}
QXmlSimpleReaderPrivate::~QXmlSimpleReaderPrivate()
@@ -2727,8 +2748,10 @@ QXmlSimpleReaderPrivate::~QXmlSimpleReaderPrivate()
void QXmlSimpleReaderPrivate::initIncrementalParsing()
{
- delete parseStack;
- parseStack = new QStack<ParseState>;
+ if( parseStack )
+ parseStack->clear();
+ else
+ parseStack = new QStack<ParseState>;
}
/*********************************************
@@ -3101,25 +3124,8 @@ static NameChar determineNameChar(QChar ch)
*/
QXmlSimpleReader::QXmlSimpleReader()
+ : d_ptr(new QXmlSimpleReaderPrivate(this))
{
- d_ptr = new QXmlSimpleReaderPrivate();
- Q_D(QXmlSimpleReader);
- d->q_ptr = this;
-
- d->locator = new QXmlSimpleReaderLocator(this);
-
- d->entityRes = 0;
- d->dtdHnd = 0;
- d->contentHnd = 0;
- d->errorHnd = 0;
- d->lexicalHnd = 0;
- d->declHnd = 0;
-
- // default feature settings
- d->useNamespaces = true;
- d->useNamespacePrefixes = false;
- d->reportWhitespaceCharData = true;
- d->reportEntities = false;
}
/*!
@@ -3127,9 +3133,6 @@ QXmlSimpleReader::QXmlSimpleReader()
*/
QXmlSimpleReader::~QXmlSimpleReader()
{
- Q_D(QXmlSimpleReader);
- delete d->locator;
- delete d;
}
/*!
@@ -3412,7 +3415,7 @@ bool QXmlSimpleReader::parse(const QXmlInputSource *input, bool incremental)
// call the handler
if (d->contentHnd) {
- d->contentHnd->setDocumentLocator(d->locator);
+ d->contentHnd->setDocumentLocator(d->locator.data());
if (!d->contentHnd->startDocument()) {
d->reportParseError(d->contentHnd->errorString());
d->tags.clear();
diff --git a/src/xml/sax/qxml.h b/src/xml/sax/qxml.h
index e0165d3..8e3eb25 100644
--- a/src/xml/sax/qxml.h
+++ b/src/xml/sax/qxml.h
@@ -47,6 +47,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qlist.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -202,7 +203,7 @@ public:
QString message() const;
private:
- QXmlParseExceptionPrivate *d;
+ QScopedPointer<QXmlParseExceptionPrivate> d;
};
@@ -271,7 +272,7 @@ public:
private:
Q_DISABLE_COPY(QXmlSimpleReader)
Q_DECLARE_PRIVATE(QXmlSimpleReader)
- QXmlSimpleReaderPrivate* d_ptr;
+ QScopedPointer<QXmlSimpleReaderPrivate> d_ptr;
friend class QXmlSimpleReaderLocator;
};
diff --git a/src/xmlpatterns/api/qabstractxmlnodemodel.cpp b/src/xmlpatterns/api/qabstractxmlnodemodel.cpp
index 0caa8c4..12ce6a7 100644
--- a/src/xmlpatterns/api/qabstractxmlnodemodel.cpp
+++ b/src/xmlpatterns/api/qabstractxmlnodemodel.cpp
@@ -302,7 +302,6 @@ QAbstractXmlNodeModel::QAbstractXmlNodeModel(QAbstractXmlNodeModelPrivate *d) :
*/
QAbstractXmlNodeModel::~QAbstractXmlNodeModel()
{
- delete d_ptr;
}
/*!
diff --git a/src/xmlpatterns/api/qabstractxmlnodemodel.h b/src/xmlpatterns/api/qabstractxmlnodemodel.h
index 6c9574c..9b5b3dd 100644
--- a/src/xmlpatterns/api/qabstractxmlnodemodel.h
+++ b/src/xmlpatterns/api/qabstractxmlnodemodel.h
@@ -44,6 +44,7 @@
#include <QtXmlPatterns/QXmlName>
#include <QtCore/QSharedData>
+#include <QtCore/QScopedPointer>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -339,7 +340,7 @@ protected:
return QXmlNodeModelIndex::create(data, this, additionalData);
}
- QAbstractXmlNodeModelPrivate *d_ptr;
+ QScopedPointer<QAbstractXmlNodeModelPrivate> d_ptr;
private:
friend class QPatternist::ItemMappingIterator<QXmlNodeModelIndex, QXmlNodeModelIndex, const QAbstractXmlNodeModel *, QExplicitlySharedDataPointer<QPatternist::DynamicContext> >;
friend class QPatternist::SequenceMappingIterator<QXmlNodeModelIndex, QXmlNodeModelIndex, const QAbstractXmlNodeModel *>;
diff --git a/src/xmlpatterns/api/qabstractxmlreceiver.cpp b/src/xmlpatterns/api/qabstractxmlreceiver.cpp
index ddd01e4..4253ce0 100644
--- a/src/xmlpatterns/api/qabstractxmlreceiver.cpp
+++ b/src/xmlpatterns/api/qabstractxmlreceiver.cpp
@@ -224,7 +224,6 @@ QAbstractXmlReceiver::QAbstractXmlReceiver() : d_ptr(0)
*/
QAbstractXmlReceiver::~QAbstractXmlReceiver()
{
- delete d_ptr;
}
/*!
diff --git a/src/xmlpatterns/api/qabstractxmlreceiver.h b/src/xmlpatterns/api/qabstractxmlreceiver.h
index 355576a..270b9da 100644
--- a/src/xmlpatterns/api/qabstractxmlreceiver.h
+++ b/src/xmlpatterns/api/qabstractxmlreceiver.h
@@ -43,6 +43,7 @@
#define QABSTRACTXMLRECEIVER_H
#include <QtCore/QVariant>
+#include <QtCore/QScopedPointer>
#include <QtXmlPatterns/QXmlNodeModelIndex>
QT_BEGIN_HEADER
@@ -90,7 +91,7 @@ public:
protected:
QAbstractXmlReceiver(QAbstractXmlReceiverPrivate *d);
- QAbstractXmlReceiverPrivate *d_ptr;
+ QScopedPointer<QAbstractXmlReceiverPrivate> d_ptr;
void sendAsNode(const QPatternist::Item &outputItem);
private:
diff --git a/src/xmlpatterns/api/qxmlresultitems.cpp b/src/xmlpatterns/api/qxmlresultitems.cpp
index a2253c9..652d931 100644
--- a/src/xmlpatterns/api/qxmlresultitems.cpp
+++ b/src/xmlpatterns/api/qxmlresultitems.cpp
@@ -85,7 +85,6 @@ QXmlResultItems::QXmlResultItems() : d_ptr(new QXmlResultItemsPrivate())
*/
QXmlResultItems::~QXmlResultItems()
{
- delete d_ptr;
}
/*!
diff --git a/src/xmlpatterns/api/qxmlresultitems.h b/src/xmlpatterns/api/qxmlresultitems.h
index aeb7d2c..5484616 100644
--- a/src/xmlpatterns/api/qxmlresultitems.h
+++ b/src/xmlpatterns/api/qxmlresultitems.h
@@ -43,6 +43,7 @@
#define QXMLRESULTITEMS
#include <QtCore/QString>
+#include <QtCore/QScopedPointer>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -66,7 +67,7 @@ public:
private:
friend class QXmlQuery;
Q_DECLARE_PRIVATE(QXmlResultItems)
- QXmlResultItemsPrivate *d_ptr;
+ QScopedPointer<QXmlResultItemsPrivate> d_ptr;
Q_DISABLE_COPY(QXmlResultItems)
};
diff --git a/src/xmlpatterns/expr/qpath.cpp b/src/xmlpatterns/expr/qpath.cpp
index 33bfa0f..a60f622 100644
--- a/src/xmlpatterns/expr/qpath.cpp
+++ b/src/xmlpatterns/expr/qpath.cpp
@@ -170,7 +170,7 @@ Expression::Ptr Path::compress(const StaticContext::Ptr &context)
/* We do this as late as we can, such that we pick up the most recent type
* from the operand. */
- if(m_isLast && !m_kind == XSLTForEach && m_operand2->staticType()->itemType() == BuiltinTypes::item)
+ if(m_isLast && m_kind != XSLTForEach && m_operand2->staticType()->itemType() == BuiltinTypes::item)
m_checkXPTY0018 = true;
return me;
diff --git a/tests/auto/_Categories/QtCore.txt b/tests/auto/_Categories/QtCore.txt
index fc19f45..7238bf8 100644
--- a/tests/auto/_Categories/QtCore.txt
+++ b/tests/auto/_Categories/QtCore.txt
@@ -3,13 +3,14 @@
collections
exceptionsafety
qabstractitemmodel
-# Requires std
-#qalgorithms
+#Requires STL
+qalgorithms
qatomicint
qatomicpointer
qbitarray
qbuffer
qbytearray
+qbytearraymatcher
qcache
qchar
qcoreapplication
@@ -68,7 +69,8 @@ qsignalspy
qsize
qsizef
qsocketnotifier
-#qstl requires STL
+#Requires STL
+qstl
qstring
qstringlist
qstringmatcher
@@ -103,3 +105,4 @@ qwaitcondition
qwineventnotifier
qwritelocker
q_func_info
+utf8
diff --git a/tests/auto/_Categories/QtGui.txt b/tests/auto/_Categories/QtGui.txt
index f0975e4..b03a870 100644
--- a/tests/auto/_Categories/QtGui.txt
+++ b/tests/auto/_Categories/QtGui.txt
@@ -1,4 +1,5 @@
languagechange
+modeltest
qabstractbutton
qabstractitemview
#qabstractprintdialog NO PRINTING SUPPORT
diff --git a/tests/auto/_Categories/QtNetwork.txt b/tests/auto/_Categories/QtNetwork.txt
index 60df74a..f5d191d 100644
--- a/tests/auto/_Categories/QtNetwork.txt
+++ b/tests/auto/_Categories/QtNetwork.txt
@@ -1,3 +1,5 @@
+_networkselftest
+#qsocketnotifier
qabstractnetworkcache
qabstractsocket
qftp
diff --git a/tests/auto/_Categories/QtSql.txt b/tests/auto/_Categories/QtSql.txt
index 55c1464..1232500 100644
--- a/tests/auto/_Categories/QtSql.txt
+++ b/tests/auto/_Categories/QtSql.txt
@@ -1,6 +1,7 @@
qsql
qsqlbatch
qsqldatabase
+qsqldriver
qsqlerror
qsqlfield
qsqlquery
diff --git a/tests/auto/_networkselftest/_networkselftest.pro b/tests/auto/_networkselftest/_networkselftest.pro
new file mode 100644
index 0000000..a2e1adf
--- /dev/null
+++ b/tests/auto/_networkselftest/_networkselftest.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+
+SOURCES += tst_networkselftest.cpp
+QT = core network
+!symbian: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..ad9e172
--- /dev/null
+++ b/tests/auto/_networkselftest/tst_networkselftest.cpp
@@ -0,0 +1,612 @@
+/****************************************************************************
+**
+** 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"
+
+#if defined(Q_OS_SYMBIAN)
+#define SRCDIR ""
+#endif
+
+class tst_NetworkSelfTest: public QObject
+{
+ Q_OBJECT
+public:
+ tst_NetworkSelfTest();
+ virtual ~tst_NetworkSelfTest();
+
+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) {
+ 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
+ }
+ }
+}
+
+tst_NetworkSelfTest::tst_NetworkSelfTest()
+{
+ Q_SET_DEFAULT_IAP
+}
+
+tst_NetworkSelfTest::~tst_NetworkSelfTest()
+{
+}
+
+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()
+{
+#ifdef Q_OS_SYMBIAN
+ if (qstrcmp(QTest::currentDataTag(), "http-proxy-auth-ntlm") == 0)
+ QSKIP("NTML authentication not yet supported in Symbian", SkipSingle);
+#endif
+
+ 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", SkipAll);
+#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()
+{
+#ifdef Q_OS_SYMBIAN
+ QSKIP("NTML authentication not yet supported in Symbian", SkipAll);
+#else
+ 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
+ );
+#endif
+}
+
+// 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 aa7c116..178351b 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -5,7 +5,8 @@ TEMPLATE = subdirs
!wince*:SUBDIRS += \
headers
-SUBDIRS += bic \
+SUBDIRS += _networkselftest \
+ bic \
collections \
compile \
compilerwarnings \
@@ -230,6 +231,7 @@ SUBDIRS += bic \
qprogressbar \
qprogressdialog \
qpushbutton \
+ qscopedpointer \
qqueue \
qradiobutton \
qreadlocker \
diff --git a/tests/auto/collections/tst_collections.cpp b/tests/auto/collections/tst_collections.cpp
index c05d8da..cbd72dc 100644
--- a/tests/auto/collections/tst_collections.cpp
+++ b/tests/auto/collections/tst_collections.cpp
@@ -1364,6 +1364,9 @@ void tst_Collections::byteArray()
ba1 = "FooFoo";
ba1.replace(char('F'), ba1);
QCOMPARE(ba1, QByteArray("FooFooooFooFoooo"));
+ ba1 = "FooFoo";
+ ba1.replace(char('o'), ba1);
+ QCOMPARE(ba1, QByteArray("FFooFooFooFooFFooFooFooFoo"));
ba1.replace(ba1, "xxx");
QCOMPARE(ba1, QByteArray("xxx"));
@@ -2354,6 +2357,9 @@ void tst_Collections::qstring()
str1 = "FooFoo";
str1.replace(char('F'), str1);
QCOMPARE(str1, QString("FooFooooFooFoooo"));
+ str1 = "FooFoo";
+ str1.replace(char('o'), str1);
+ QCOMPARE(str1, QString("FFooFooFooFooFFooFooFooFoo"));
str1 = "Foo";
str1.replace("Foo", str1);
diff --git a/tests/auto/exceptionsafety/tst_exceptionsafety.cpp b/tests/auto/exceptionsafety/tst_exceptionsafety.cpp
index 9c4f78d..8ed2913 100644
--- a/tests/auto/exceptionsafety/tst_exceptionsafety.cpp
+++ b/tests/auto/exceptionsafety/tst_exceptionsafety.cpp
@@ -52,9 +52,16 @@ class tst_ExceptionSafety: public QObject
Q_OBJECT
private slots:
void exceptionInSlot();
+ void exceptionVector();
+ void exceptionHash();
+ void exceptionMap();
+ void exceptionList();
+ void exceptionLinkedList();
+ void exceptionEventLoop();
+ void exceptionSignalSlot();
};
-class Emitter: public QObject
+class Emitter : public QObject
{
Q_OBJECT
public:
@@ -63,13 +70,111 @@ signals:
void testSignal();
};
-class ExceptionThrower: public QObject
+class ExceptionThrower : public QObject
{
Q_OBJECT
public slots:
void thrower() { throw 5; }
};
+class Receiver : public QObject
+{
+ Q_OBJECT
+public:
+ Receiver()
+ : received(0) {}
+ int received;
+
+public slots:
+ void receiver() { ++received; }
+};
+
+enum ThrowType { ThrowNot = 0, ThrowAtCreate = 1, ThrowAtCopy = 2, ThrowLater = 3, ThrowAtComparison = 4 };
+
+ThrowType throwType = ThrowNot; // global flag to indicate when an exception should be throw. Will be reset when the exception has been generated.
+
+int objCounter = 0;
+
+/*! Class that does not throw any exceptions. Used as baseclass for all the other ones.
+ */
+template <int T>
+class FlexibleThrower
+{
+ public:
+ FlexibleThrower() : _value(-1) {
+ if( throwType == ThrowAtCreate ) {
+ throwType = ThrowNot;
+ throw ThrowAtCreate;
+ }
+ objCounter++;
+ }
+
+ FlexibleThrower( short value ) : _value(value) {
+ if( throwType == ThrowAtCreate ) {
+ throwType = ThrowNot;
+ throw ThrowAtCreate;
+ }
+ objCounter++;
+ }
+
+ FlexibleThrower(FlexibleThrower const& other ) {
+ // qDebug("cc");
+
+ if( throwType == ThrowAtCopy ) {
+ throwType = ThrowNot;
+ throw ThrowAtCopy;
+
+ } else if( throwType == ThrowLater ) {
+ throwType = ThrowAtCopy;
+ }
+
+ objCounter++;
+ _value = other.value();
+ }
+
+ ~FlexibleThrower() { objCounter--; }
+
+ bool operator==(const FlexibleThrower<T> &t) const
+ {
+ // qDebug("vv == %d %d", value(), t.value());
+ if( throwType == ThrowAtComparison ) {
+ throwType = ThrowNot;
+ throw ThrowAtComparison;
+ }
+ return value()==t.value();
+ }
+
+ bool operator<(const FlexibleThrower<T> &t) const
+ {
+ // qDebug("vv < %d %d", value(), t.value());
+ if( throwType == ThrowAtComparison ) {
+ throwType = ThrowNot;
+ throw ThrowAtComparison;
+ }
+ return value()<t.value();
+ }
+
+ int value() const
+ { return (int)_value; }
+
+ short _value;
+ char dummy[T];
+};
+
+uint qHash(const FlexibleThrower<2>& t)
+{
+ // qDebug("ha");
+ if( throwType == ThrowAtComparison ) {
+ throwType = ThrowNot;
+ throw ThrowAtComparison;
+ }
+ return (uint)t.value();
+}
+
+typedef FlexibleThrower<2> FlexibleThrowerSmall;
+typedef QMap<FlexibleThrowerSmall,FlexibleThrowerSmall> MyMap;
+typedef QHash<FlexibleThrowerSmall,FlexibleThrowerSmall> MyHash;
+
// connect a signal to a slot that throws an exception
// run this through valgrind to make sure it doesn't corrupt
void tst_ExceptionSafety::exceptionInSlot()
@@ -86,6 +191,525 @@ void tst_ExceptionSafety::exceptionInSlot()
}
}
+void tst_ExceptionSafety::exceptionList() {
+
+ {
+ QList<FlexibleThrowerSmall> list;
+ QList<FlexibleThrowerSmall> list2;
+ QList<FlexibleThrowerSmall> list3;
+
+ for( int i = 0; i<10; i++ )
+ list.append( FlexibleThrowerSmall(i) );
+
+ try {
+ throwType = ThrowAtCopy;
+ list.append( FlexibleThrowerSmall(10));
+ } catch (...) {
+ }
+ QCOMPARE( list.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ list.prepend( FlexibleThrowerSmall(10));
+ } catch (...) {
+ }
+ QCOMPARE( list.at(0).value(), 0 );
+ QCOMPARE( list.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ list.insert( 8, FlexibleThrowerSmall(10));
+ } catch (...) {
+ }
+ QCOMPARE( list.at(7).value(), 7 );
+ QCOMPARE( list.at(8).value(), 8 );
+ QCOMPARE( list.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ FlexibleThrowerSmall t = list.takeAt( 6 );
+ } catch (...) {
+ }
+ QCOMPARE( list.at(6).value(), 6 );
+ QCOMPARE( list.at(7).value(), 7 );
+ QCOMPARE( list.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ list3 = list;
+ } catch (...) {
+ }
+ QCOMPARE( list.at(0).value(), 0 );
+ QCOMPARE( list.at(7).value(), 7 );
+ QCOMPARE( list.size(), 10 );
+ QCOMPARE( list3.at(0).value(), 0 );
+ QCOMPARE( list3.at(7).value(), 7 );
+ QCOMPARE( list3.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ list3.append( FlexibleThrowerSmall(11) );
+ } catch (...) {
+ }
+ QCOMPARE( list.at(0).value(), 0 );
+ QCOMPARE( list.at(7).value(), 7 );
+ QCOMPARE( list.size(), 10 );
+ QCOMPARE( list3.at(0).value(), 0 );
+ QCOMPARE( list3.at(7).value(), 7 );
+ QCOMPARE( list3.size(), 10 );
+
+ try {
+ list2.clear();
+ list2.append( FlexibleThrowerSmall(11));
+ throwType = ThrowAtCopy;
+ list3 = list+list2;
+ } catch (...) {
+ }
+ QCOMPARE( list.at(0).value(), 0 );
+ QCOMPARE( list.at(7).value(), 7 );
+ QCOMPARE( list.size(), 10 );
+
+ // check that copy on write works atomar
+ list2.clear();
+ list2.append( FlexibleThrowerSmall(11));
+ list3 = list+list2;
+ try {
+ throwType = ThrowAtCreate;
+ list3[7]=FlexibleThrowerSmall(12);
+ } catch (...) {
+ }
+ QCOMPARE( list.at(7).value(), 7 );
+ QCOMPARE( list.size(), 10 );
+ QCOMPARE( list3.at(7).value(), 7 );
+ QCOMPARE( list3.size(), 11 );
+
+ }
+ QCOMPARE(objCounter, 0 ); // check that every object has been freed
+}
+
+void tst_ExceptionSafety::exceptionLinkedList() {
+
+ {
+ QLinkedList<FlexibleThrowerSmall> list;
+ QLinkedList<FlexibleThrowerSmall> list2;
+ QLinkedList<FlexibleThrowerSmall> list3;
+
+ for( int i = 0; i<10; i++ )
+ list.append( FlexibleThrowerSmall(i) );
+
+ try {
+ throwType = ThrowAtCopy;
+ list.append( FlexibleThrowerSmall(10));
+ } catch (...) {
+ }
+ QCOMPARE( list.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ list.prepend( FlexibleThrowerSmall(10));
+ } catch (...) {
+ }
+ QCOMPARE( list.first().value(), 0 );
+ QCOMPARE( list.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ list3 = list;
+ list3.append( FlexibleThrowerSmall(11) );
+ } catch (...) {
+ }
+ QCOMPARE( list.first().value(), 0 );
+ QCOMPARE( list.size(), 10 );
+ QCOMPARE( list3.size(), 10 );
+ }
+ QCOMPARE(objCounter, 0 ); // check that every object has been freed
+}
+
+void tst_ExceptionSafety::exceptionVector() {
+
+ {
+ QVector<FlexibleThrowerSmall> vector;
+ QVector<FlexibleThrowerSmall> vector2;
+ QVector<FlexibleThrowerSmall> vector3;
+
+ for (int i = 0; i<10; i++)
+ vector.append( FlexibleThrowerSmall(i) );
+
+ try {
+ throwType = ThrowAtCopy;
+ vector.append( FlexibleThrowerSmall(10));
+ } catch (...) {
+ }
+ QCOMPARE( vector.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ vector.prepend( FlexibleThrowerSmall(10));
+ } catch (...) {
+ }
+ QCOMPARE( vector.at(0).value(), 0 );
+ QCOMPARE( vector.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ vector.insert( 8, FlexibleThrowerSmall(10));
+ } catch (...) {
+ }
+ QCOMPARE( vector.at(7).value(), 7 );
+ QCOMPARE( vector.at(8).value(), 8 );
+ QCOMPARE( vector.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ vector3 = vector;
+ } catch (...) {
+ }
+ QCOMPARE( vector.at(0).value(), 0 );
+ QCOMPARE( vector.at(7).value(), 7 );
+ QCOMPARE( vector.size(), 10 );
+ QCOMPARE( vector3.at(0).value(), 0 );
+ QCOMPARE( vector3.at(7).value(), 7 );
+ QCOMPARE( vector3.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ vector3.append( FlexibleThrowerSmall(11) );
+ } catch (...) {
+ }
+ QCOMPARE( vector.at(0).value(), 0 );
+ QCOMPARE( vector.at(7).value(), 7 );
+ QCOMPARE( vector.size(), 10 );
+ QCOMPARE( vector3.at(0).value(), 0 );
+ QCOMPARE( vector3.at(7).value(), 7 );
+
+ try {
+ vector2.clear();
+ vector2.append( FlexibleThrowerSmall(11));
+ throwType = ThrowAtCopy;
+ vector3 = vector+vector2;
+ } catch (...) {
+ }
+ QCOMPARE( vector.at(0).value(), 0 );
+ QCOMPARE( vector.at(7).value(), 7 );
+ QCOMPARE( vector.size(), 10 );
+
+ // check that copy on write works atomar
+ vector2.clear();
+ vector2.append( FlexibleThrowerSmall(11));
+ vector3 = vector+vector2;
+ try {
+ throwType = ThrowAtCreate;
+ vector3[7]=FlexibleThrowerSmall(12);
+ } catch (...) {
+ }
+ QCOMPARE( vector.at(7).value(), 7 );
+ QCOMPARE( vector.size(), 10 );
+ QCOMPARE( vector3.at(7).value(), 7 );
+ QCOMPARE( vector3.size(), 11 );
+
+ try {
+ throwType = ThrowAtCreate;
+ vector.resize(15);
+ } catch (...) {
+ }
+ QCOMPARE( vector.at(7).value(), 7 );
+ QCOMPARE( vector.size(), 10 );
+
+ try {
+ throwType = ThrowAtCreate;
+ vector.resize(15);
+ } catch (...) {
+ }
+ QCOMPARE( vector.at(7).value(), 7 );
+ QCOMPARE( vector.size(), 10 );
+
+ try {
+ throwType = ThrowLater;
+ vector.fill(FlexibleThrowerSmall(1), 15);
+ } catch (...) {
+ }
+ QCOMPARE( vector.at(0).value(), 0 );
+ QCOMPARE( vector.size(), 10 );
+
+
+ }
+ QCOMPARE(objCounter, 0 ); // check that every object has been freed
+}
+
+
+void tst_ExceptionSafety::exceptionMap() {
+
+ {
+ MyMap map;
+ MyMap map2;
+ MyMap map3;
+
+ throwType = ThrowNot;
+ for (int i = 0; i<10; i++)
+ map[ FlexibleThrowerSmall(i) ] = FlexibleThrowerSmall(i);
+
+ return; // further test are deactivated until Map is fixed.
+
+ for( int i = ThrowAtCopy; i<=ThrowAtComparison; i++ ) {
+ try {
+ throwType = (ThrowType)i;
+ map[ FlexibleThrowerSmall(10) ] = FlexibleThrowerSmall(10);
+ } catch(...) {
+ }
+ QCOMPARE( map.size(), 10 );
+ QCOMPARE( map[ FlexibleThrowerSmall(1) ], FlexibleThrowerSmall(1) );
+ }
+
+ map2 = map;
+ try {
+ throwType = ThrowLater;
+ map2[ FlexibleThrowerSmall(10) ] = FlexibleThrowerSmall(10);
+ } catch(...) {
+ }
+ /* qDebug("%d %d", map.size(), map2.size() );
+ for( int i=0; i<map.size(); i++ )
+ qDebug( "Value at %d: %d",i, map.value(FlexibleThrowerSmall(i), FlexibleThrowerSmall()).value() );
+ QCOMPARE( map.value(FlexibleThrowerSmall(1), FlexibleThrowerSmall()), FlexibleThrowerSmall(1) );
+ qDebug( "Value at %d: %d",1, map[FlexibleThrowerSmall(1)].value() );
+ qDebug("%d %d", map.size(), map2.size() );
+ */
+ QCOMPARE( map[ FlexibleThrowerSmall(1) ], FlexibleThrowerSmall(1) );
+ QCOMPARE( map.size(), 10 );
+ QCOMPARE( map2[ FlexibleThrowerSmall(1) ], FlexibleThrowerSmall(1) );
+ QCOMPARE( map2.size(), 10 );
+
+ }
+ QCOMPARE(objCounter, 0 ); // check that every object has been freed
+}
+
+void tst_ExceptionSafety::exceptionHash() {
+
+ {
+ MyHash hash;
+ MyHash hash2;
+ MyHash hash3;
+
+ for( int i = 0; i<10; i++ )
+ hash[ FlexibleThrowerSmall(i) ] = FlexibleThrowerSmall(i);
+
+ for( int i = ThrowAtCopy; i<=ThrowAtComparison; i++ ) {
+ try {
+ throwType = (ThrowType)i;
+ hash[ FlexibleThrowerSmall(10) ] = FlexibleThrowerSmall(10);
+ } catch(...) {
+ }
+ QCOMPARE( hash.size(), 10 );
+ }
+
+ hash2 = hash;
+ try {
+ throwType = ThrowLater;
+ hash2[ FlexibleThrowerSmall(10) ] = FlexibleThrowerSmall(10);
+ } catch(...) {
+ }
+ QCOMPARE( hash[ FlexibleThrowerSmall(1) ], FlexibleThrowerSmall(1) );
+ QCOMPARE( hash.size(), 10 );
+ QCOMPARE( hash2[ FlexibleThrowerSmall(1) ], FlexibleThrowerSmall(1) );
+ QCOMPARE( hash2.size(), 10 );
+
+ hash2.clear();
+ try {
+ throwType = ThrowLater;
+ hash2.reserve(30);
+ } catch(...) {
+ }
+ QCOMPARE( hash2.size(), 0 );
+
+ /*
+ try {
+ throwType = ThrowAtCopy;
+ hash.prepend( FlexibleThrowerSmall(10));
+ } catch (...) {
+ }
+ QCOMPARE( hash.at(0).value(), 0 );
+ QCOMPARE( hash.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ hash.insert( 8, FlexibleThrowerSmall(10));
+ } catch (...) {
+ }
+ QCOMPARE( hash.at(7).value(), 7 );
+ QCOMPARE( hash.at(8).value(), 8 );
+ QCOMPARE( hash.size(), 10 );
+
+ qDebug("val");
+ try {
+ throwType = ThrowAtCopy;
+ hash3 = hash;
+ } catch (...) {
+ }
+ QCOMPARE( hash.at(0).value(), 0 );
+ QCOMPARE( hash.at(7).value(), 7 );
+ QCOMPARE( hash.size(), 10 );
+ QCOMPARE( hash3.at(0).value(), 0 );
+ QCOMPARE( hash3.at(7).value(), 7 );
+ QCOMPARE( hash3.size(), 10 );
+
+ try {
+ throwType = ThrowAtCopy;
+ hash3.append( FlexibleThrowerSmall(11) );
+ } catch (...) {
+ }
+ QCOMPARE( hash.at(0).value(), 0 );
+ QCOMPARE( hash.at(7).value(), 7 );
+ QCOMPARE( hash.size(), 10 );
+ QCOMPARE( hash3.at(0).value(), 0 );
+ QCOMPARE( hash3.at(7).value(), 7 );
+ QCOMPARE( hash3.at(11).value(), 11 );
+
+ try {
+ hash2.clear();
+ hash2.append( FlexibleThrowerSmall(11));
+ throwType = ThrowAtCopy;
+ hash3 = hash+hash2;
+ } catch (...) {
+ }
+ QCOMPARE( hash.at(0).value(), 0 );
+ QCOMPARE( hash.at(7).value(), 7 );
+ QCOMPARE( hash.size(), 10 );
+
+ // check that copy on write works atomar
+ hash2.clear();
+ hash2.append( FlexibleThrowerSmall(11));
+ hash3 = hash+hash2;
+ try {
+ throwType = ThrowAtCopy;
+ hash3[7]=FlexibleThrowerSmall(12);
+ } catch (...) {
+ }
+ QCOMPARE( hash.at(7).value(), 7 );
+ QCOMPARE( hash.size(), 10 );
+ QCOMPARE( hash3.at(7).value(), 7 );
+ QCOMPARE( hash3.size(), 11 );
+ */
+
+
+ }
+ QCOMPARE(objCounter, 0 ); // check that every object has been freed
+}
+
+enum
+{
+ ThrowEventId = QEvent::User + 42,
+ NoThrowEventId = QEvent::User + 43
+};
+
+class ThrowEvent : public QEvent
+{
+public:
+ ThrowEvent()
+ : QEvent(static_cast<QEvent::Type>(ThrowEventId))
+ {
+ }
+};
+
+class NoThrowEvent : public QEvent
+{
+public:
+ NoThrowEvent()
+ : QEvent(static_cast<QEvent::Type>(NoThrowEventId))
+ {}
+};
+
+class TestObject : public QObject
+{
+public:
+ TestObject()
+ : throwEventCount(0), noThrowEventCount(0) {}
+
+ int throwEventCount;
+ int noThrowEventCount;
+
+protected:
+ bool event(QEvent *event)
+ {
+ if (int(event->type()) == ThrowEventId) {
+ throw ++throwEventCount;
+ } else if (int(event->type()) == NoThrowEventId) {
+ ++noThrowEventCount;
+ }
+ return QObject::event(event);
+ }
+};
+
+void tst_ExceptionSafety::exceptionEventLoop()
+{
+ // send an event that throws
+ TestObject obj;
+ ThrowEvent throwEvent;
+ try {
+ qApp->sendEvent(&obj, &throwEvent);
+ } catch (int code) {
+ QCOMPARE(code, 1);
+ }
+ QCOMPARE(obj.throwEventCount, 1);
+
+ // post an event that throws
+ qApp->postEvent(&obj, new ThrowEvent);
+
+ try {
+ qApp->processEvents();
+ } catch (int code) {
+ QCOMPARE(code, 2);
+ }
+ QCOMPARE(obj.throwEventCount, 2);
+
+ // post a normal event, then a throwing event, then a normal event
+ // run this in valgrind to ensure that it doesn't leak.
+
+ qApp->postEvent(&obj, new NoThrowEvent);
+ qApp->postEvent(&obj, new ThrowEvent);
+ qApp->postEvent(&obj, new NoThrowEvent);
+
+ try {
+ qApp->processEvents();
+ } catch (int code) {
+ QCOMPARE(code, 3);
+ }
+ // here, we should have received on non-throwing event and one throwing one
+ QCOMPARE(obj.throwEventCount, 3);
+ QCOMPARE(obj.noThrowEventCount, 1);
+
+ // spin the event loop again
+ qApp->processEvents();
+
+ // now, we should have received the second non-throwing event
+ QCOMPARE(obj.noThrowEventCount, 2);
+}
+
+void tst_ExceptionSafety::exceptionSignalSlot()
+{
+ Emitter e;
+ ExceptionThrower thrower;
+ Receiver r1;
+ Receiver r2;
+
+ // connect a signal to a normal object, a thrower and a normal object again
+ connect(&e, SIGNAL(testSignal()), &r1, SLOT(receiver()));
+ connect(&e, SIGNAL(testSignal()), &thrower, SLOT(thrower()));
+ connect(&e, SIGNAL(testSignal()), &r2, SLOT(receiver()));
+
+ int code = 0;
+ try {
+ e.emitTestSignal();
+ } catch (int c) {
+ code = c;
+ }
+
+ // 5 is the magic number that's thrown by thrower
+ QCOMPARE(code, 5);
+
+ // assumption: slots are called in the connection order
+ QCOMPARE(r1.received, 1);
+ QCOMPARE(r2.received, 0);
+}
+
QTEST_MAIN(tst_ExceptionSafety)
#include "tst_exceptionsafety.moc"
#endif // QT_NO_EXCEPTIONS
diff --git a/tests/auto/macgui/tst_gui.cpp b/tests/auto/macgui/tst_gui.cpp
index b302f8b..641e596 100644
--- a/tests/auto/macgui/tst_gui.cpp
+++ b/tests/auto/macgui/tst_gui.cpp
@@ -69,8 +69,7 @@ private slots:
QPixmap grabWindowContents(QWidget * widget)
{
- const int titleBarHeight = widget->frameGeometry().height() - widget->height();
- return QPixmap::grabWindow(widget->winId(), 0, titleBarHeight, -1, widget->height());
+ return QPixmap::grabWindow(widget->winId());
}
/*
@@ -79,10 +78,6 @@ QPixmap grabWindowContents(QWidget * widget)
*/
void tst_gui::scrollbarPainting()
{
-#if defined (Q_WS_MAC) && defined (__i386__)
- QSKIP("This test fails on scruffy when run by the autotest system (but not when you run it manually).", SkipAll);
-#endif
-
ColorWidget colorWidget;
colorWidget.resize(400, 400);
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h
index 5b671bf..0924c57 100644
--- a/tests/auto/network-settings.h
+++ b/tests/auto/network-settings.h
@@ -1,6 +1,4 @@
/****************************************************************************
-**
-** 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.
@@ -40,6 +38,12 @@
****************************************************************************/
#include <QString>
+/*
+#ifdef QT_NETWORK_LIB
+#include <QtNetwork/QHostInfo>
+#endif
+*/
+
#ifdef Q_OS_SYMBIAN
#include <sys/socket.h>
#include <net/if.h>
@@ -49,33 +53,34 @@
#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
// In emulator we use WINSOCK connectivity by default. Unfortunately winsock
// does not work very well with UDP sockets. This defines skips some test
-// cases which have known problems.
+// cases which have known problems.
// NOTE: Prefer to use WINPCAP based connectivity in S60 emulator when running
-// network tests. WINPCAP connectivity uses Symbian OS IP stack,
+// network tests. WINPCAP connectivity uses Symbian OS IP stack,
// correspondingly as HW does. When using WINPCAP disable this define
//#define SYMBIAN_WINSOCK_CONNECTIVITY
-#endif
- class QtNetworkSettingsRecord {
- public:
- QtNetworkSettingsRecord() { }
+class QtNetworkSettingsRecord {
+public:
+ QtNetworkSettingsRecord() { }
- QtNetworkSettingsRecord(const QString& recName, const QString& recVal)
- : strRecordName(recName), strRecordValue(recVal) { }
+ QtNetworkSettingsRecord(const QString& recName, const QString& recVal)
+ : strRecordName(recName), strRecordValue(recVal) { }
- QtNetworkSettingsRecord(const QtNetworkSettingsRecord & other)
- : strRecordName(other.strRecordName), strRecordValue(other.strRecordValue) { }
+ QtNetworkSettingsRecord(const QtNetworkSettingsRecord & other)
+ : strRecordName(other.strRecordName), strRecordValue(other.strRecordValue) { }
- ~QtNetworkSettingsRecord() { }
+ ~QtNetworkSettingsRecord() { }
- const QString& recordName() const { return strRecordName; }
- const QString& recordValue() const { return strRecordValue; }
+ const QString& recordName() const { return strRecordName; }
+ const QString& recordValue() const { return strRecordValue; }
- private:
- QString strRecordName;
- QString strRecordValue;
- };
+private:
+ QString strRecordName;
+ QString strRecordValue;
+};
+
+#endif
class QtNetworkSettings
{
@@ -139,7 +144,7 @@ public:
#endif
return "10.10.14.172";
}
-
+
static QByteArray expectedReplyIMAP()
{
#ifdef Q_OS_SYMBIAN
@@ -161,12 +166,13 @@ public:
QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4REV1] " );
expected = expected.append(QtNetworkSettings::serverLocalName().toAscii());
expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
-
+
return expected;
}
static QByteArray expectedReplySSL()
{
+#ifdef Q_OS_SYMBIAN
loadTestSettings();
if(QtNetworkSettings::entries.contains("imap.expectedreplyssl")) {
@@ -176,19 +182,19 @@ public:
imapExpectedReplySsl.append('\r').append('\n');
}
return imapExpectedReplySsl.data();
- } else {
- QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR] " );
- expected = expected.append(QtNetworkSettings::serverLocalName().toAscii());
- expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
- return expected;
}
+#endif
+ QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR] " );
+ expected = expected.append(QtNetworkSettings::serverLocalName().toAscii());
+ expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ return expected;
}
-
+
static QByteArray expectedReplyFtp()
{
QByteArray expected( "220 (vsFTPd 2.0.5)\r\n221 Goodbye.\r\n" );
return expected;
- }
+ }
#ifdef Q_OS_SYMBIAN
static void setDefaultIap()
@@ -251,7 +257,7 @@ private:
position += QString("=").length();
//create record
- QtNetworkSettingsRecord *entry =
+ QtNetworkSettingsRecord *entry =
new QtNetworkSettingsRecord( QString("iap.default"), line.mid(position).trimmed() );
entries.insert(entry->recordName(), entry);
break;
@@ -307,6 +313,15 @@ private:
}
#endif
+/*
+#ifdef QT_NETWORK_LIB
+ static QHostAddress serverIP()
+ {
+ return QHostInfo::fromName(serverName()).addresses().first();
+ }
+#endif
+*/
+
};
#ifdef Q_OS_SYMBIAN
QHash<QString, QtNetworkSettingsRecord* > QtNetworkSettings::entries = QHash<QString, QtNetworkSettingsRecord* > ();
diff --git a/tests/auto/q3socketdevice/tst_q3socketdevice.cpp b/tests/auto/q3socketdevice/tst_q3socketdevice.cpp
index 2b0c606..6255aee 100644
--- a/tests/auto/q3socketdevice/tst_q3socketdevice.cpp
+++ b/tests/auto/q3socketdevice/tst_q3socketdevice.cpp
@@ -45,6 +45,8 @@
#include <q3socketdevice.h>
+#include "../network-settings.h"
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -97,8 +99,7 @@ void tst_Q3SocketDevice::readNull()
int attempts = 10;
while (attempts--) {
- // connect to imap.troll.no
- if (device.connect(QHostAddress("62.70.27.18"), 143))
+ if (device.connect(QtNetworkSettings::serverIP(), 143))
break;
}
@@ -117,7 +118,7 @@ void tst_Q3SocketDevice::readNull()
#endif
QCOMPARE(device.peerPort(), quint16(143));
QCOMPARE(device.peerAddress().toString(),
- QHostAddress("62.70.27.18").toString());
+ QtNetworkSettings::serverIP().toString());
QCOMPARE(device.error(), Q3SocketDevice::NoError);
// write a logout notice
diff --git a/tests/auto/qbitarray/tst_qbitarray.cpp b/tests/auto/qbitarray/tst_qbitarray.cpp
index 12fbdc3..244183e 100644
--- a/tests/auto/qbitarray/tst_qbitarray.cpp
+++ b/tests/auto/qbitarray/tst_qbitarray.cpp
@@ -108,6 +108,8 @@ private slots:
void invertOnNull() const;
void operator_noteq_data();
void operator_noteq();
+
+ void resize();
};
Q_DECLARE_METATYPE(QBitArray)
@@ -628,5 +630,30 @@ void tst_QBitArray::operator_noteq()
QCOMPARE(b, res);
}
+void tst_QBitArray::resize()
+{
+ // -- check that a resize handles the bits correctly
+ QBitArray a = QStringToQBitArray(QString("11"));
+ a.resize(10);
+ QVERIFY(a.size() == 10);
+ QCOMPARE( a, QStringToQBitArray(QString("1100000000")) );
+
+ a.setBit(9);
+ a.resize(9);
+ // now the bit in a should have been gone:
+ QCOMPARE( a, QStringToQBitArray(QString("110000000")) );
+
+ // grow the array back and check the new bit
+ a.resize(10);
+ QCOMPARE( a, QStringToQBitArray(QString("1100000000")) );
+
+ // other test with and
+ a.resize(9);
+ QBitArray b = QStringToQBitArray(QString("1111111111"));
+ b &= a;
+ QCOMPARE( b, QStringToQBitArray(QString("1100000000")) );
+
+}
+
QTEST_APPLESS_MAIN(tst_QBitArray)
#include "tst_qbitarray.moc"
diff --git a/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp b/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp
index 30ac638..0c7a1c9 100644
--- a/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp
+++ b/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp
@@ -47,6 +47,8 @@
#include <qspinbox.h>
#include <qmenu.h>
#include <qdebug.h>
+#include <qdatetime.h>
+#include <qtextformat.h>
//TESTED_CLASS=
@@ -68,6 +70,11 @@ public slots:
private slots:
void getSetCheck();
void buttonClickCheck();
+
+ void setTextFormat();
+ void resetTextFormat();
+
+ void setWeekdayFormat();
};
// Testing get/set functions
@@ -215,6 +222,52 @@ void tst_QCalendarWidget::buttonClickCheck()
}
+void tst_QCalendarWidget::setTextFormat()
+{
+ QCalendarWidget calendar;
+ QTextCharFormat format;
+ format.setFontItalic(true);
+ format.setForeground(Qt::green);
+
+ const QDate date(1984, 10, 20);
+ calendar.setDateTextFormat(date, format);
+ QCOMPARE(calendar.dateTextFormat(date), format);
+}
+
+void tst_QCalendarWidget::resetTextFormat()
+{
+ QCalendarWidget calendar;
+ QTextCharFormat format;
+ format.setFontItalic(true);
+ format.setForeground(Qt::green);
+
+ const QDate date(1984, 10, 20);
+ calendar.setDateTextFormat(date, format);
+
+ calendar.setDateTextFormat(QDate(), QTextCharFormat());
+ QCOMPARE(calendar.dateTextFormat(date), QTextCharFormat());
+}
+
+void tst_QCalendarWidget::setWeekdayFormat()
+{
+ QCalendarWidget calendar;
+
+ QTextCharFormat format;
+ format.setFontItalic(true);
+ format.setForeground(Qt::green);
+
+ calendar.setWeekdayTextFormat(Qt::Wednesday, format);
+
+ // check the format of the a given month
+ for (int i = 1; i <= 31; ++i) {
+ const QDate date(1984, 10, i);
+ const Qt::DayOfWeek dayOfWeek = static_cast<Qt::DayOfWeek>(date.dayOfWeek());
+ if (dayOfWeek == Qt::Wednesday)
+ QCOMPARE(calendar.weekdayTextFormat(dayOfWeek), format);
+ else
+ QVERIFY(calendar.weekdayTextFormat(dayOfWeek) != format);
+ }
+}
tst_QCalendarWidget::tst_QCalendarWidget()
{
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index e881496..4973d4f 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -76,6 +76,7 @@
#endif
#include <qabstractitemview.h>
#include "../../shared/util.h"
+#include <qstyleditemdelegate.h>
//TESTED_CLASS=
//TESTED_FILES=
@@ -141,6 +142,8 @@ private slots:
void setModelColumn();
void noScrollbar_data();
void noScrollbar();
+ void setItemDelegate();
+ void task253944_itemDelegateIsReset();
protected slots:
void onEditTextChanged( const QString &newString );
@@ -2171,7 +2174,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 +2182,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 +2200,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 +2210,29 @@ void tst_QComboBox::noScrollbar()
QVERIFY(!comboBox.view()->horizontalScrollBar()->isVisible());
QVERIFY(!comboBox.view()->verticalScrollBar()->isVisible());
}
+
+ qApp->setStyleSheet(oldCss);
+}
+
+void tst_QComboBox::setItemDelegate()
+{
+ QComboBox comboBox;
+ QStyledItemDelegate *itemDelegate = new QStyledItemDelegate;
+ comboBox.setItemDelegate(itemDelegate);
+ QCOMPARE(static_cast<QStyledItemDelegate*>(comboBox.itemDelegate()), itemDelegate);
+}
+
+void tst_QComboBox::task253944_itemDelegateIsReset()
+{
+ QComboBox comboBox;
+ QStyledItemDelegate *itemDelegate = new QStyledItemDelegate;
+ comboBox.setItemDelegate(itemDelegate);
+
+ comboBox.setEditable(true);
+ QCOMPARE(static_cast<QStyledItemDelegate*>(comboBox.itemDelegate()), itemDelegate);
+
+ comboBox.setStyleSheet("QComboBox { border: 1px solid gray; }");
+ QCOMPARE(static_cast<QStyledItemDelegate*>(comboBox.itemDelegate()), itemDelegate);
}
QTEST_MAIN(tst_QComboBox)
diff --git a/tests/auto/qcssparser/tst_cssparser.cpp b/tests/auto/qcssparser/tst_cssparser.cpp
index c3397ea..17df9a2 100644
--- a/tests/auto/qcssparser/tst_cssparser.cpp
+++ b/tests/auto/qcssparser/tst_cssparser.cpp
@@ -123,7 +123,7 @@ static void debug(const QVector<QCss::Symbol> &symbols, int index = -1)
qDebug() << "failure at index" << index;
}
-static void debug(const QCss::Parser &p) { debug(p.symbols); }
+//static void debug(const QCss::Parser &p) { debug(p.symbols); }
void tst_CssParser::scanner()
{
@@ -1473,7 +1473,12 @@ void tst_CssParser::extractFontFamily_data()
QTest::newRow("quoted-family-name") << "font-family: 'Times New Roman'" << QString("Times New Roman");
QTest::newRow("unquoted-family-name") << "font-family: Times New Roman" << QString("Times New Roman");
QTest::newRow("unquoted-family-name2") << "font-family: Times New Roman" << QString("Times New Roman");
- QTest::newRow("multiple") << "font-family: Times New Roman , foobar, 'baz'" << QString("Times New Roman");
+ QTest::newRow("multiple") << "font-family: Times New Roman , foobar, 'baz'" << QString("Times New Roman");
+ QTest::newRow("multiple2") << "font-family: invalid, Times New Roman " << QString("Times New Roman");
+ QTest::newRow("invalid") << "font-family: invalid" << QFontInfo(QFont("invalid font")).family();
+ QTest::newRow("shorthand") << "font: 12pt Times New Roman" << QString("Times New Roman");
+ QTest::newRow("shorthand multiple quote") << "font: 12pt invalid, \"Times New Roman\" " << QString("Times New Roman");
+ QTest::newRow("shorthand multiple") << "font: 12pt invalid, Times New Roman " << QString("Times New Roman");
}
void tst_CssParser::extractFontFamily()
@@ -1497,8 +1502,8 @@ void tst_CssParser::extractFontFamily()
int adjustment = 0;
QFont fnt;
extractor.extractFont(&fnt, &adjustment);
-
- QTEST(fnt.family(), "expectedFamily");
+ QFontInfo info(fnt);
+ QTEST(info.family(), "expectedFamily");
}
void tst_CssParser::extractBorder_data()
diff --git a/tests/auto/qdatastream/tst_qdatastream.cpp b/tests/auto/qdatastream/tst_qdatastream.cpp
index 544c8c3..93f2b18 100644
--- a/tests/auto/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/qdatastream/tst_qdatastream.cpp
@@ -469,7 +469,7 @@ void tst_QDataStream::writeQString(QDataStream* s)
{
QString test(QStringData(dataIndex(QTest::currentDataTag())));
*s << test;
- *s << QString("Faen her spyr man");
+ *s << QString("Her er det noe tekst");
*s << test;
*s << QString();
*s << test;
@@ -487,7 +487,7 @@ void tst_QDataStream::readQString(QDataStream *s)
*s >> S;
QCOMPARE(S, test);
*s >> S;
- QCOMPARE(S, QString("Faen her spyr man"));
+ QCOMPARE(S, QString("Her er det noe tekst"));
*s >> S;
QCOMPARE(S, test);
*s >> S;
@@ -540,7 +540,7 @@ void tst_QDataStream::writeQRegExp(QDataStream* s)
{
QRegExp test(QRegExpData(dataIndex(QTest::currentDataTag())));
*s << test;
- *s << QString("Faen her spyr man");
+ *s << QString("Her er det noe tekst");
*s << test;
*s << QString("nonempty");
*s << test;
@@ -557,7 +557,7 @@ void tst_QDataStream::readQRegExp(QDataStream *s)
*s >> R;
QCOMPARE(R, test);
*s >> S;
- QCOMPARE(S, QString("Faen her spyr man"));
+ QCOMPARE(S, QString("Her er det noe tekst"));
*s >> R;
QCOMPARE(R, test);
*s >> S;
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/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp
index b975405..624d193 100644
--- a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp
+++ b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp
@@ -2213,21 +2213,16 @@ void tst_QDateTimeEdit::mousePress()
testWidget->setDate(QDate(2004, 6, 23));
testWidget->setCurrentSection(QDateTimeEdit::YearSection);
QCOMPARE(testWidget->currentSection(), QDateTimeEdit::YearSection);
- int offset = 10;
-#if defined(Q_OS_WINCE)
- offset = 20;
- if (qt_wince_is_pocket_pc()) {
- // depending on wether the display is double-pixeld, we need
- // to click at a different position
- bool doubledSize = false;
- int dpi = GetDeviceCaps(GetDC(0), LOGPIXELSX);
- if ((dpi < 1000) && (dpi > 0))
- doubledSize = true;
- offset = doubledSize ? 50 : 25; // On CE buttons are aligned horizontal
- }
-#endif
- QTest::mouseClick(testWidget, Qt::LeftButton, 0, QPoint(testWidget->width() - offset, 5));
- QCOMPARE(testWidget->date().year(), 2005);
+
+ // Ask the SC_SpinBoxUp button location from style
+ QStyleOptionSpinBox so;
+ so.rect = testWidget->rect();
+ QRect rectUp = testWidget->style()->subControlRect(QStyle::CC_SpinBox, &so, QStyle::SC_SpinBoxUp, testWidget);
+
+ // Send mouseClick to center of SC_SpinBoxUp
+ QTest::mouseClick(testWidget, Qt::LeftButton, 0, rectUp.center());
+ QCOMPARE(testWidget->date().year(), 2005);
+
}
void tst_QDateTimeEdit::stepHourAMPM_data()
diff --git a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
index ad1a1b8..58bfabc 100644
--- a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
+++ b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
@@ -84,6 +84,8 @@ private slots:
void sendArgument_data();
void sendArgument();
+ void sendErrors();
+
private:
QProcess proc;
};
@@ -782,5 +784,28 @@ void tst_QDBusMarshall::sendArgument()
QCOMPARE(extracted, value);
}
+void tst_QDBusMarshall::sendErrors()
+{
+ QDBusConnection con = QDBusConnection::sessionBus();
+
+ QVERIFY(con.isConnected());
+ QDBusMessage msg = QDBusMessage::createSignal("/foo", "local.interfaceName",
+ "signalName");
+ msg << qVariantFromValue(QDBusObjectPath());
+
+ QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\"");
+ QVERIFY(!con.send(msg));
+
+ msg.setArguments(QVariantList());
+ QDBusObjectPath path;
+
+ QTest::ignoreMessage(QtWarningMsg, "QDBusObjectPath: invalid path \"abc\"");
+ path.setPath("abc");
+ msg << qVariantFromValue(path);
+
+ QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\"");
+ QVERIFY(!con.send(msg));
+}
+
QTEST_MAIN(tst_QDBusMarshall)
#include "tst_qdbusmarshall.moc"
diff --git a/tests/auto/qeventloop/tst_qeventloop.cpp b/tests/auto/qeventloop/tst_qeventloop.cpp
index a4017b8..ed95402 100644
--- a/tests/auto/qeventloop/tst_qeventloop.cpp
+++ b/tests/auto/qeventloop/tst_qeventloop.cpp
@@ -243,8 +243,10 @@ public slots:
// Let all the events occur twice so we know they reactivated after
// each occurrence.
if (++timerCount >= 2) {
+#ifdef Q_OS_SYMBIAN
// This will hopefully run last, so stop the active scheduler.
CActiveScheduler::Stop();
+#endif
}
}
void zeroTimerSlot()
diff --git a/tests/auto/qfile/copy-fallback.qrc b/tests/auto/qfile/copy-fallback.qrc
new file mode 100644
index 0000000..864491f
--- /dev/null
+++ b/tests/auto/qfile/copy-fallback.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>copy-fallback.qrc</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/qfile/test/test.pro b/tests/auto/qfile/test/test.pro
index b51eff6..80102f0 100644
--- a/tests/auto/qfile/test/test.pro
+++ b/tests/auto/qfile/test/test.pro
@@ -23,7 +23,7 @@ wince*:{
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 483e978..597343f 100644
--- a/tests/auto/qfile/tst_qfile.cpp
+++ b/tests/auto/qfile/tst_qfile.cpp
@@ -128,6 +128,7 @@ private slots:
void copy();
void copyRemovesTemporaryFile() const;
void copyShouldntOverwrite();
+ void copyFallback();
void link();
void linkToDir();
void absolutePathLinkToRelativePath();
@@ -216,6 +217,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");
@@ -921,6 +929,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>
@@ -2109,6 +2145,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 f5bcfec..5f0776f 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;
@@ -464,10 +465,11 @@ void tst_QFiledialog::completer()
if (!tmp.exists(tempPath))
QVERIFY(tmp.mkdir("QFileDialogTestDir"));
QList<QTemporaryFile*> files;
+ QT_TRY {
for (int i = 0; i < 10; ++i) {
- QTemporaryFile *file = new QTemporaryFile(tempPath + "/rXXXXXX");
+ QScopedPointer<QTemporaryFile> file(new QTemporaryFile(tempPath + "/rXXXXXX"));
file->open();
- files.append(file);
+ files.append(file.take());
}
// ### flesh this out more
@@ -558,6 +560,10 @@ void tst_QFiledialog::completer()
// ### FIXME: This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel
// are fixed to properly capitalize paths, so that some folders are not duplicated in QFileSystemModel.
QTRY_COMPARE(cModel->rowCount(), expected);
+ } QT_CATCH(...) {
+ qDeleteAll(files);
+ QT_RETHROW;
+ }
qDeleteAll(files);
}
@@ -1991,5 +1997,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/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 963fccc..ae60332 100644
--- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -43,6 +43,7 @@
#include <QtTest/QtTest>
#include "../../../src/gui/dialogs/qfilesystemmodel_p.h"
#include <QFileIconProvider>
+#include <QTreeView>
#include "../../shared/util.h"
#include <QTime>
#include <QStyle>
@@ -121,6 +122,7 @@ private slots:
void setData_data();
void setData();
+ void sort_data();
void sort();
void mkdir();
@@ -486,8 +488,12 @@ void tst_QFileSystemModel::rowsInserted()
} else {
QCOMPARE(model->index(model->rowCount(root) - 1, 0, root).data().toString(), QString("b"));
}
- if (spy0.count() > 0)
- if (count == 0) QCOMPARE(spy0.count(), 0); else QVERIFY(spy0.count() >= 1);
+ if (spy0.count() > 0) {
+ if (count == 0)
+ QCOMPARE(spy0.count(), 0);
+ else
+ QVERIFY(spy0.count() >= 1);
+ }
if (count == 0) QCOMPARE(spy1.count(), 0); else QVERIFY(spy1.count() >= 1);
QVERIFY(createFiles(tmp, QStringList(".hidden_file"), 5 + count));
@@ -761,6 +767,19 @@ void tst_QFileSystemModel::setData()
QTRY_COMPARE(model->rowCount(root), files.count());
}
+class MyFriendFileSystemModel : public QFileSystemModel
+{
+ friend class tst_QFileSystemModel;
+ Q_DECLARE_PRIVATE(QFileSystemModel)
+};
+
+void tst_QFileSystemModel::sort_data()
+{
+ QTest::addColumn<bool>("fileDialogMode");
+ QTest::newRow("standard usage") << false;
+ QTest::newRow("QFileDialog usage") << true;
+}
+
void tst_QFileSystemModel::sort()
{
QTemporaryFile file;
@@ -772,8 +791,48 @@ void tst_QFileSystemModel::sort()
model->sort(0, Qt::AscendingOrder);
model->sort(0, Qt::DescendingOrder);
QVERIFY(idx.column() != 0);
-}
+ QFETCH(bool, fileDialogMode);
+
+ MyFriendFileSystemModel *myModel = new MyFriendFileSystemModel();
+ QTreeView *tree = new QTreeView();
+
+ if (fileDialogMode)
+ myModel->d_func()->disableRecursiveSort = true;
+
+ const QString dirPath = QString("%1/sortTemp").arg(QDir::tempPath());
+ QDir dir(dirPath);
+ dir.mkpath(dirPath);
+ QVERIFY(dir.exists());
+ dir.mkdir("a");
+ dir.mkdir("b");
+ dir.mkdir("c");
+ dir.mkdir("d");
+ dir.mkdir("e");
+ dir.mkdir("f");
+ dir.mkdir("g");
+ QTemporaryFile tempFile(dirPath + "/rXXXXXX");
+ tempFile.open();
+ myModel->setRootPath(QDir::rootPath());
+ tree->setModel(myModel);
+ tree->show();
+ QTest::qWait(500);
+ tree->expand(myModel->index(dir.absolutePath(), 0));
+ while (dir.cdUp())
+ {
+ tree->expand(myModel->index(dir.absolutePath(), 0));
+ }
+ QTest::qWait(250);
+ //File dialog Mode means sub trees are not sorted, only the current root
+ if (fileDialogMode)
+ QVERIFY(myModel->index(0, 1, myModel->index(dirPath, 0)).data(QFileSystemModel::FilePathRole).toString() != dirPath + QLatin1String("/a"));
+ else
+ QCOMPARE(myModel->index(0, 1, myModel->index(dirPath, 0)).data(QFileSystemModel::FilePathRole).toString(), dirPath + QLatin1String("/a"));
+
+ delete tree;
+ delete myModel;
+
+}
void tst_QFileSystemModel::mkdir()
{
diff --git a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp
index a006462..cb5790d 100644
--- a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp
@@ -242,7 +242,7 @@ void tst_QFontDatabase::addAppFont()
QVERIFY(QFontDatabase::removeApplicationFont(id));
QCOMPARE(fontDbChangedSpy.count(), 2);
- QVERIFY(db.families() == oldFamilies);
+ QVERIFY(db.families() == oldFamilies);
#endif
}
diff --git a/tests/auto/qfuture/tst_qfuture.cpp b/tests/auto/qfuture/tst_qfuture.cpp
index 43fd614..383ecba 100644
--- a/tests/auto/qfuture/tst_qfuture.cpp
+++ b/tests/auto/qfuture/tst_qfuture.cpp
@@ -45,7 +45,7 @@
#include <QtTest/QtTest>
#include <qfuture.h>
-#include <versioncheck.h>
+#include "versioncheck.h"
#include <qfuturewatcher.h>
#include <qtconcurrentresultstore.h>
#include <qtconcurrentexception.h>
diff --git a/tests/auto/qglobal/tst_qglobal.cpp b/tests/auto/qglobal/tst_qglobal.cpp
index 88fbcd2..b4d42e4 100644
--- a/tests/auto/qglobal/tst_qglobal.cpp
+++ b/tests/auto/qglobal/tst_qglobal.cpp
@@ -50,6 +50,7 @@ private slots:
void qInternalCallbacks();
void for_each();
void qassert();
+ void qtry();
};
void tst_QGlobal::qIsNull()
@@ -190,5 +191,66 @@ void tst_QGlobal::qassert()
QVERIFY(passed);
}
+void tst_QGlobal::qtry()
+{
+ int i = 0;
+ QT_TRY {
+ i = 1;
+ QT_THROW(42);
+ i = 2;
+ } QT_CATCH(int) {
+ QCOMPARE(i, 1);
+ i = 7;
+ }
+#ifdef QT_NO_EXCEPTIONS
+ QCOMPARE(i, 2);
+#else
+ QCOMPARE(i, 7);
+#endif
+
+ // check propper if/else scoping
+ i = 0;
+ if (true)
+ QT_TRY {
+ i = 2;
+ QT_THROW(42);
+ i = 4;
+ } QT_CATCH(int) {
+ QCOMPARE(i, 2);
+ i = 4;
+ }
+ else
+ QCOMPARE(i, 0);
+ QCOMPARE(i, 4);
+
+ i = 0;
+ if (false)
+ QT_TRY {
+ i = 2;
+ QT_THROW(42);
+ i = 4;
+ } QT_CATCH(int) {
+ QCOMPARE(i, 2);
+ i = 2;
+ }
+ else
+ i = 8;
+ QCOMPARE(i, 8);
+
+ i = 0;
+ if (false)
+ i = 42;
+ else
+ QT_TRY {
+ i = 2;
+ QT_THROW(42);
+ i = 4;
+ } QT_CATCH(int) {
+ QCOMPARE(i, 2);
+ i = 4;
+ }
+ QCOMPARE(i, 4);
+}
+
QTEST_MAIN(tst_QGlobal)
#include "tst_qglobal.moc"
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 58a17ea..34a6ab1 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -226,6 +226,7 @@ private slots:
void task240400_clickOnTextItem_data();
void task240400_clickOnTextItem();
void task243707_addChildBeforeParent();
+ void task197802_childrenVisibility();
};
void tst_QGraphicsItem::init()
@@ -5346,7 +5347,7 @@ void tst_QGraphicsItem::task243707_addChildBeforeParent()
// inconsistent internal state that can cause a crash. This test shows
// one such crash.
QGraphicsScene scene;
- QGraphicsWidget *widget = new QGraphicsWidget;
+ QGraphicsWidget *widget = new QGraphicsWidget;
QGraphicsWidget *widget2 = new QGraphicsWidget(widget);
scene.addItem(widget2);
QVERIFY(!widget2->parentItem());
@@ -5355,6 +5356,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");
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index b741da6..d020c10 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -47,6 +47,7 @@
#include <QtGui>
#include <math.h>
+#include "../../shared/util.h"
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
#include <windows.h>
@@ -3547,8 +3548,7 @@ void tst_QGraphicsScene::changedSignal()
scene.addItem(rect);
QCOMPARE(cl.changes.size(), 0);
- qApp->processEvents();
- QCOMPARE(cl.changes.size(), 1);
+ QTRY_COMPARE(cl.changes.size(), 1);
QCOMPARE(cl.changes.at(0).size(), 1);
QCOMPARE(cl.changes.at(0).first(), QRectF(0, 0, 10, 10));
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index b85abd3..1917357 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -51,6 +51,7 @@
#include <qlineedit.h>
#include <qboxlayout.h>
#include <qaction.h>
+#include <qwidgetaction.h>
#include "../../shared/util.h"
@@ -147,6 +148,7 @@ private slots:
void setSizes();
void closePopupOnOutsideClick();
void defaultSize();
+ void shortcutsDeletion();
// Task fixes
void task236127_bspTreeIndexFails();
@@ -1782,6 +1784,20 @@ void tst_QGraphicsWidget::defaultSize()
}
+void tst_QGraphicsWidget::shortcutsDeletion()
+{
+ QGraphicsWidget *widget = new QGraphicsWidget;
+ QGraphicsWidget *widget2 = new QGraphicsWidget;
+ widget->setMinimumSize(40, 40);
+ QWidgetAction *del = new QWidgetAction(widget);
+ del->setIcon(QIcon("edit-delete"));
+ del->setShortcut(Qt::Key_Delete);
+ del->setShortcutContext(Qt::WidgetShortcut);
+ widget2->addAction(del);
+ widget2->addAction(del);
+ delete widget;
+}
+
class ProxyStyle : public QCommonStyle
{
public:
diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp
index c3aca7a..0395ca0 100644
--- a/tests/auto/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp
@@ -92,7 +92,6 @@
//TESTED_CLASS=
//TESTED_FILES=
-const char * const lupinellaIp = "10.3.4.6";
class tst_QHostInfo : public QObject
{
diff --git a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp
index 469904f..3161873 100644
--- a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp
+++ b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp
@@ -306,7 +306,6 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128));
- // Connect to imap.trolltech.com's IP
QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143));
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
@@ -368,7 +367,6 @@ void tst_QHttpSocketEngine::simpleErrorsAndStates()
QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverName()), 8088));
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
if (socketDevice.waitForWrite(15000)) {
- qDebug() << socketDevice.state();
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState ||
socketDevice.state() == QAbstractSocket::UnconnectedState);
} else {
@@ -697,7 +695,6 @@ void tst_QHttpSocketEngine::passwordAuth()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128, "qsockstest", "password"));
- // Connect to imap.trolltech.com's IP
QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143));
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp
index c7bee47..4cbc0e7 100644
--- a/tests/auto/qicon/tst_qicon.cpp
+++ b/tests/auto/qicon/tst_qicon.cpp
@@ -76,6 +76,8 @@ private slots:
void svg();
void addFile();
void availableSizes();
+ void streamAvailableSizes_data();
+ void streamAvailableSizes();
void task184901_badCache();
void task223279_inconsistentAddFile();
@@ -541,6 +543,47 @@ void tst_QIcon::availableSizes()
}
}
+void tst_QIcon::streamAvailableSizes_data()
+{
+ QTest::addColumn<QIcon>("icon");
+
+ QIcon icon;
+ icon.addFile(":/image.png", QSize(32,32));
+ QTest::newRow( "32x32" ) << icon;
+ icon.addFile(":/image.png", QSize(64,64));
+ QTest::newRow( "64x64" ) << icon;
+ icon.addFile(":/image.png", QSize(128,128));
+ QTest::newRow( "128x128" ) << icon;
+ icon.addFile(":/image.png", QSize(256,256));
+ QTest::newRow( "256x256" ) << icon;
+}
+
+void tst_QIcon::streamAvailableSizes()
+{
+ QFETCH(QIcon, icon);
+
+ QByteArray ba;
+ // write to QByteArray
+ {
+ QBuffer buffer(&ba);
+ buffer.open(QIODevice::WriteOnly);
+ QDataStream stream(&buffer);
+ stream << icon;
+ }
+
+ // read from QByteArray
+ {
+ QBuffer buffer(&ba);
+ buffer.open(QIODevice::ReadOnly);
+ QDataStream stream(&buffer);
+ QIcon i;
+ stream >> i;
+ QCOMPARE(i.isNull(), icon.isNull());
+ QCOMPARE(i.availableSizes(), icon.availableSizes());
+ }
+}
+
+
static inline bool operator<(const QSize &lhs, const QSize &rhs)
{
if (lhs.width() < rhs.width())
diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp
index 3b04d56..b6be5e6 100644
--- a/tests/auto/qimage/tst_qimage.cpp
+++ b/tests/auto/qimage/tst_qimage.cpp
@@ -1460,9 +1460,9 @@ void tst_QImage::smoothScale3()
QRgb cb = b.pixel(x, y);
// tolerate a little bit of rounding errors
- QVERIFY(compare(qRed(ca), qRed(cb), 2));
- QVERIFY(compare(qGreen(ca), qGreen(cb), 2));
- QVERIFY(compare(qBlue(ca), qBlue(cb), 2));
+ QVERIFY(compare(qRed(ca), qRed(cb), 3));
+ QVERIFY(compare(qGreen(ca), qGreen(cb), 3));
+ QVERIFY(compare(qBlue(ca), qBlue(cb), 3));
}
}
}
diff --git a/tests/auto/qinputcontext/tst_qinputcontext.cpp b/tests/auto/qinputcontext/tst_qinputcontext.cpp
index 444b400..67a6819 100644
--- a/tests/auto/qinputcontext/tst_qinputcontext.cpp
+++ b/tests/auto/qinputcontext/tst_qinputcontext.cpp
@@ -66,6 +66,7 @@ private slots:
void filterMouseEvents();
void requestSoftwareInputPanel();
void closeSoftwareInputPanel();
+ void selections();
};
void tst_QInputContext::maximumTextLength()
@@ -86,7 +87,7 @@ void tst_QInputContext::maximumTextLength()
class QFilterInputContext : public QInputContext
{
public:
- QFilterInputContext() : lastType(QEvent::None) {}
+ QFilterInputContext() {}
~QFilterInputContext() {}
QString identifierName() { return QString(); }
@@ -98,12 +99,12 @@ public:
bool filterEvent( const QEvent *event )
{
- lastType = event->type();
+ lastTypes.append(event->type());
return false;
}
public:
- QEvent::Type lastType;
+ QList<QEvent::Type> lastTypes;
};
void tst_QInputContext::filterMouseEvents()
@@ -116,7 +117,7 @@ void tst_QInputContext::filterMouseEvents()
le.setInputContext(ic);
QTest::mouseClick(&le, Qt::LeftButton);
- QCOMPARE(ic->lastType, QEvent::MouseButtonRelease);
+ QVERIFY(ic->lastTypes.indexOf(QEvent::MouseButtonRelease) >= 0);
le.setInputContext(0);
}
@@ -142,20 +143,22 @@ void tst_QInputContext::requestSoftwareInputPanel()
QApplication::setActiveWindow(&w);
// Testing single click panel activation.
- QApplication::setTwoClicksToRequestSIP(false);
+ qApp->setAutoSipOnMouseFocus(true);
QTest::mouseClick(le2, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
- QCOMPARE(ic2->lastType, QEvent::RequestSoftwareInputPanel);
+ QVERIFY(ic2->lastTypes.indexOf(QEvent::RequestSoftwareInputPanel) >= 0);
+ ic2->lastTypes.clear();
// Testing double click panel activation.
- QApplication::setTwoClicksToRequestSIP(true);
+ qApp->setAutoSipOnMouseFocus(false);
QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
- QVERIFY(ic1->lastType != QEvent::RequestSoftwareInputPanel);
+ QVERIFY(ic1->lastTypes.indexOf(QEvent::RequestSoftwareInputPanel) < 0);
QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
- QCOMPARE(ic1->lastType, QEvent::RequestSoftwareInputPanel);
+ QVERIFY(ic1->lastTypes.indexOf(QEvent::RequestSoftwareInputPanel) >= 0);
+ ic1->lastTypes.clear();
// Testing right mouse button
QTest::mouseClick(le1, Qt::RightButton, Qt::NoModifier, QPoint(5, 5));
- QVERIFY(ic1->lastType != QEvent::RequestSoftwareInputPanel);
+ QVERIFY(ic1->lastTypes.indexOf(QEvent::RequestSoftwareInputPanel) < 0);
}
void tst_QInputContext::closeSoftwareInputPanel()
@@ -184,11 +187,29 @@ void tst_QInputContext::closeSoftwareInputPanel()
// Testing that panel doesn't close between two input methods aware widgets.
QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
QTest::mouseClick(le2, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
- QVERIFY(ic2->lastType != QEvent::CloseSoftwareInputPanel);
+ QVERIFY(ic2->lastTypes.indexOf(QEvent::CloseSoftwareInputPanel) < 0);
// Testing that panel closes when focusing non-aware widget.
QTest::mouseClick(rb, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
- QCOMPARE(ic2->lastType, QEvent::CloseSoftwareInputPanel);
+ QVERIFY(ic2->lastTypes.indexOf(QEvent::CloseSoftwareInputPanel) >= 0);
+}
+
+void tst_QInputContext::selections()
+{
+ QLineEdit le;
+ le.setText("Test text");
+ le.setSelection(2, 2);
+ QCOMPARE(le.inputMethodQuery(Qt::ImCursorPosition).toInt(), 4);
+ QCOMPARE(le.inputMethodQuery(Qt::ImAnchorPosition).toInt(), 2);
+
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 5, 3, QVariant()));
+ QInputMethodEvent event("", attributes);
+ QApplication::sendEvent(&le, &event);
+ QCOMPARE(le.cursorPosition(), 8);
+ QCOMPARE(le.selectionStart(), 5);
+ QCOMPARE(le.inputMethodQuery(Qt::ImCursorPosition).toInt(), 8);
+ QCOMPARE(le.inputMethodQuery(Qt::ImAnchorPosition).toInt(), 5);
}
QTEST_MAIN(tst_QInputContext)
diff --git a/tests/auto/qiodevice/tst_qiodevice.cpp b/tests/auto/qiodevice/tst_qiodevice.cpp
index 38eac55..dee37dc 100644
--- a/tests/auto/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/qiodevice/tst_qiodevice.cpp
@@ -138,7 +138,7 @@ void tst_QIODevice::constructing_QTcpSocket()
QCOMPARE(socket.pos(), qlonglong(0));
socket.close();
- socket.connectToHost("imap.troll.no", 143);
+ socket.connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY(socket.waitForConnected(5000));
QVERIFY(device->isOpen());
diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
index 27741e0..955760a 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,83 @@ 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);
+
+ QPointer<QWidget> editor = lineEditors.at(0);
+ QCOMPARE(editor->hasFocus(), true);
+
+ QTest::keyClick(editor, Qt::Key(key));
+ QApplication::processEvents();
+
+ if (widget == 2 || widget == 3) {
+ QVERIFY(!editor.isNull());
+ QCOMPARE(editor->hasFocus(), expectedFocus);
+ }
+}
+
+
+
// ### _not_ covered:
// editing with a custom editor factory
diff --git a/tests/auto/qitemmodel/tst_qitemmodel.cpp b/tests/auto/qitemmodel/tst_qitemmodel.cpp
index ea1972e..d29a3e3 100644
--- a/tests/auto/qitemmodel/tst_qitemmodel.cpp
+++ b/tests/auto/qitemmodel/tst_qitemmodel.cpp
@@ -54,7 +54,7 @@
#include <QtTest/QtTest>
#include <QtCore>
#include <qdebug.h>
-#include <modelstotest.cpp>
+#include "modelstotest.cpp"
#include <QMetaType>
Q_DECLARE_METATYPE(QModelIndex)
diff --git a/tests/auto/qitemview/tst_qitemview.cpp b/tests/auto/qitemview/tst_qitemview.cpp
index 1b02873..907cabb 100644
--- a/tests/auto/qitemview/tst_qitemview.cpp
+++ b/tests/auto/qitemview/tst_qitemview.cpp
@@ -42,7 +42,7 @@
#include <QtTest/QtTest>
#include <QtCore/QtCore>
-#include <viewstotest.cpp>
+#include "viewstotest.cpp"
#include <stdlib.h>
#if defined(Q_OS_WIN)
diff --git a/tests/auto/qlibrary/lib2/lib2.pro b/tests/auto/qlibrary/lib2/lib2.pro
index 724077a..436d7ba 100644
--- a/tests/auto/qlibrary/lib2/lib2.pro
+++ b/tests/auto/qlibrary/lib2/lib2.pro
@@ -27,10 +27,11 @@ unix:!symbian: {
symbian-abld: {
TARGET.CAPABILITY=ALL -TCB
+ FIXEDROOT = $$replace(EPOCROOT,/,\\)
QMAKE_POST_LINK = \
- copy /Y $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dl2 && \
- copy /Y $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\system.trolltech.test.mylib.dll && \
- IF NOT "$(PLATFORM)==WINSCW" copy /Y $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll ..\tst\mylib.dl2
+ copy /Y $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dl2 && \
+ copy /Y $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\system.trolltech.test.mylib.dll && \
+ IF NOT "$(PLATFORM)==WINSCW" copy /Y $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll ..\tst\mylib.dl2
}
symbian-sbsv2: {
diff --git a/tests/auto/qlibrary/qlibrary.pro b/tests/auto/qlibrary/qlibrary.pro
index 9ba49ee..fd5790b 100644
--- a/tests/auto/qlibrary/qlibrary.pro
+++ b/tests/auto/qlibrary/qlibrary.pro
@@ -1,9 +1,16 @@
QT -= gui
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS = lib \
- lib2 \
- tst
+
+symbian: {
+# Can't build two versions of lib with same name in symbian, so just build one
+SUBDIRS = lib2 \
+ tst
+} else {
+SUBDIRS = lib \
+ lib2 \
+ tst
+}
TARGET = tst_qlibrary
# no special install rule for subdir
diff --git a/tests/auto/qlocale/test/test.pro b/tests/auto/qlocale/test/test.pro
index 32e2423..7bc9f59 100644
--- a/tests/auto/qlocale/test/test.pro
+++ b/tests/auto/qlocale/test/test.pro
@@ -29,4 +29,11 @@ wince*: {
DEPLOYMENT += addFiles
}
-
+symbian:contains(S60_VERSION,3.2) {
+ # This test case compilation crashes on 3.2 for gcce if paging is on
+ MMP_RULES -= PAGED
+ custom_paged_rule = "$${LITERAL_HASH}ifndef GCCE"\
+ "PAGED" \
+ "$${LITERAL_HASH}endif"
+ MMP_RULES += custom_paged_rule
+} \ No newline at end of file
diff --git a/tests/auto/qlocalsocket/lackey/lackey.pro b/tests/auto/qlocalsocket/lackey/lackey.pro
index 7460d8c..f073e7a 100644
--- a/tests/auto/qlocalsocket/lackey/lackey.pro
+++ b/tests/auto/qlocalsocket/lackey/lackey.pro
@@ -15,4 +15,4 @@ DEFINES += QLOCALSOCKET_DEBUG
SOURCES += main.cpp
TARGET = lackey
-
+symbian:TARGET.CAPABILITY = ALL -TCB \ No newline at end of file
diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro
index c58bfee..e399a29 100644
--- a/tests/auto/qlocalsocket/test/test.pro
+++ b/tests/auto/qlocalsocket/test/test.pro
@@ -3,7 +3,7 @@ load(qttest_p4)
DEFINES += QLOCALSERVER_DEBUG
DEFINES += QLOCALSOCKET_DEBUG
-symbian* {
+symbian {
# nothing
} else:wince* {
DEFINES += QT_LOCALSOCKET_TCP
@@ -27,12 +27,21 @@ CONFIG(debug_and_release) {
DESTDIR = ..
}
-wince* | symbian* {
+wince* {
additionalFiles.sources = ../lackey/lackey.exe
additionalFiles.path = lackey
+}
+
+symbian {
+ additionalFiles.sources = lackey.exe
+ additionalFiles.path = \sys\bin
+ DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
+}
+
+wince*|symbian {
scriptFiles.sources = ../lackey/scripts/*.js
scriptFiles.path = lackey/scripts
DEPLOYMENT = additionalFiles scriptFiles
QT += script # for easy deployment of QtScript
-}
+}
diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
index 5d73c98..a8aab19 100644
--- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
@@ -53,7 +53,9 @@
//TESTED_CLASS=QLocalServer, QLocalSocket
//TESTED_FILES=network/socket/qlocalserver.cpp network/socket/qlocalsocket.cpp
#ifdef Q_OS_SYMBIAN
- #define SRCDIR ""
+ #define STRINGIFY(x) #x
+ #define TOSTRING(x) STRINGIFY(x)
+ #define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
#endif
Q_DECLARE_METATYPE(QLocalSocket::LocalSocketError)
Q_DECLARE_METATYPE(QLocalSocket::LocalSocketState)
@@ -122,8 +124,6 @@ tst_QLocalSocket::tst_QLocalSocket()
#endif
))
qWarning() << "lackey executable doesn't exists!";
-
- QLocalServer::removeServer("tst_localsocket");
}
tst_QLocalSocket::~tst_QLocalSocket()
@@ -148,7 +148,13 @@ public:
LocalServer() : QLocalServer()
{
connect(this, SIGNAL(newConnection()), this, SLOT(slotNewConnection()));
- };
+ }
+
+ bool listen(const QString &name)
+ {
+ removeServer(name);
+ return QLocalServer::listen(name);
+ }
QList<int> hits;
@@ -492,11 +498,11 @@ void tst_QLocalSocket::sendData()
// test creating a connection
socket.connectToServer(name);
bool timedOut = true;
+
QCOMPARE(server.waitForNewConnection(3000, &timedOut), canListen);
-#if defined(QT_LOCALSOCKET_TCP)
+
+#if defined(QT_LOCALSOCKET_TCP) || defined(Q_OS_SYMBIAN)
QTest::qWait(250);
-#elif defined(Q_OS_SYMBIAN)
- QTest::qWait(10000);
#endif
QVERIFY(!timedOut);
QCOMPARE(spyConnected.count(), canListen ? 1 : 0);
@@ -530,7 +536,9 @@ void tst_QLocalSocket::sendData()
QCOMPARE(spyReadyRead.count(), 1);
QVERIFY(testLine.startsWith(in.readLine()));
+
QVERIFY(wrote || serverSocket->waitForBytesWritten(1000));
+
QCOMPARE(serverSocket->errorString(), QString("Unknown error"));
QCOMPARE(socket.errorString(), QString("Unknown error"));
}
@@ -551,7 +559,7 @@ void tst_QLocalSocket::sendData()
// QLocalSocket/Server can take a name or path, check that it works as expected
void tst_QLocalSocket::fullPath()
{
- QLocalServer server;
+ LocalServer server;
QString name = "qlocalsocket_pathtest";
#if defined(Q_OS_SYMBIAN)
QString path = "";
@@ -871,7 +879,7 @@ void tst_QLocalSocket::recycleServer()
unlink("recycletest1");
#endif
- QLocalServer server;
+ LocalServer server;
QLocalSocket client;
QVERIFY(server.listen("recycletest1"));
diff --git a/tests/auto/qmake/testcompiler.cpp b/tests/auto/qmake/testcompiler.cpp
index 122a2b8..7255d93 100644
--- a/tests/auto/qmake/testcompiler.cpp
+++ b/tests/auto/qmake/testcompiler.cpp
@@ -56,10 +56,8 @@ static QString targetName( BuildType buildMode, const QString& target, const QSt
targetName.append(".exe");
break;
case Dll: // dll
- if (version != "") {
- QStringList ver = QStringList::split(".", version);
- targetName.append(ver.first());
- }
+ if (!version.empty())
+ targetName.append(version.section(".", 0, 0));
targetName.append(".dll");
break;
case Lib: // lib
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/qnativesocketengine/tst_qnativesocketengine.cpp b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp
index 146bc7b..e3f6c94 100644
--- a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp
+++ b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp
@@ -153,9 +153,8 @@ void tst_QNativeSocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
- // Connect to imap.trolltech.com's IP
- bool connected = socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143);
- if (!connected) {
+ const bool isConnected = socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143);
+ if (!isConnected) {
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
@@ -593,9 +592,8 @@ void tst_QNativeSocketEngine::networkError()
QVERIFY(client.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- // Connect to imap.trolltech.com's IP
- bool connected = client.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143);
- if (!connected) {
+ const bool isConnected = client.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143);
+ if (!isConnected) {
QVERIFY(client.state() == QAbstractSocket::ConnectingState);
QVERIFY(client.waitForWrite());
QVERIFY(client.state() == QAbstractSocket::ConnectedState);
diff --git a/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
index fc15437..2f6180f 100644
--- a/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
+++ b/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
@@ -76,7 +76,7 @@ private slots:
void oldCacheVersionFile_data();
void oldCacheVersionFile();
-
+
void sync();
};
@@ -389,7 +389,8 @@ void tst_QNetworkDiskCache::expire()
qint64 max = cache.maximumCacheSize();
QCOMPARE(max, limit);
for (int i = 0; i < 10; ++i) {
- QTest::qWait(2000);
+ if (i % 3 == 0)
+ QTest::qWait(2000);
QNetworkCacheMetaData m;
m.setUrl(QUrl("http://www.foo.com/" + QString::number(i)));
QIODevice *d = cache.prepare(m);
@@ -485,7 +486,7 @@ public:
void run()
{
QByteArray longString = "Hello World, this is some long string, well not really that long";
- for (int i = 0; i < 10; ++i)
+ for (int j = 0; j < 10; ++j)
longString += longString;
QByteArray longString2 = "Help, I am stuck in an autotest!";
QUrl url(EXAMPLE_URL);
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index acc1d42..b4e596f 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -424,11 +424,19 @@ public:
QTcpSocket *active = new QTcpSocket(this);
active->connectToHost("127.0.0.1", server.serverPort());
+#ifndef Q_OS_SYMBIAN
if (!active->waitForConnected(10))
return false;
if (!server.waitForNewConnection(10))
return false;
+#else
+ if (!active->waitForConnected(5000))
+ return false;
+
+ if (!server.waitForNewConnection(5000))
+ return false;
+#endif
QTcpSocket *passive = server.nextPendingConnection();
passive->setParent(this);
@@ -2327,8 +2335,13 @@ void tst_QNetworkReply::ioPutToFileFromLocalSocket()
}
QLocalSocket active;
active.connectToServer(socketname);
+#ifndef Q_OS_SYMBIAN
QVERIFY2(server.waitForNewConnection(10), server.errorString().toLatin1().constData());
QVERIFY2(active.waitForConnected(10), active.errorString().toLatin1().constData());
+#else
+ QVERIFY2(server.waitForNewConnection(5000), server.errorString().toLatin1().constData());
+ QVERIFY2(active.waitForConnected(5000), active.errorString().toLatin1().constData());
+#endif
QVERIFY2(server.hasPendingConnections(), server.errorString().toLatin1().constData());
QLocalSocket *passive = server.nextPendingConnection();
@@ -2343,7 +2356,11 @@ void tst_QNetworkReply::ioPutToFileFromLocalSocket()
passive->setParent(reply);
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+#ifndef Q_OS_SYMBIAN
QTestEventLoop::instance().enterLoop(10);
+#else
+ QTestEventLoop::instance().enterLoop(30);
+#endif
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(reply->url(), url);
@@ -2652,7 +2669,11 @@ void tst_QNetworkReply::downloadProgress_data()
QTest::newRow("empty") << 0;
QTest::newRow("small") << 4;
+#ifndef Q_OS_SYMBIAN
QTest::newRow("big") << 4096;
+#else
+ QTest::newRow("big") << 1024;
+#endif
}
void tst_QNetworkReply::downloadProgress()
@@ -2668,7 +2689,8 @@ void tst_QNetworkReply::downloadProgress()
QVERIFY(spy.isValid());
QCoreApplication::instance()->processEvents();
- server.waitForNewConnection(0); // ignore result, since processEvents may have got it
+ if (!server.hasPendingConnections())
+ server.waitForNewConnection(1000);
QVERIFY(server.hasPendingConnections());
QCOMPARE(spy.count(), 0);
@@ -2735,7 +2757,8 @@ void tst_QNetworkReply::uploadProgress()
QVERIFY(finished.isValid());
QCoreApplication::instance()->processEvents();
- server.waitForNewConnection(0); // ignore result, since processEvents may have got it
+ if (!server.hasPendingConnections())
+ server.waitForNewConnection(1000);
QVERIFY(server.hasPendingConnections());
QTcpSocket *receiver = server.nextPendingConnection();
diff --git a/tests/auto/qobjectrace/tst_qobjectrace.cpp b/tests/auto/qobjectrace/tst_qobjectrace.cpp
index 0c88f29..fcfd528 100644
--- a/tests/auto/qobjectrace/tst_qobjectrace.cpp
+++ b/tests/auto/qobjectrace/tst_qobjectrace.cpp
@@ -50,6 +50,7 @@ class tst_QObjectRace: public QObject
Q_OBJECT
private slots:
void moveToThreadRace();
+ void destroyRace();
};
class RaceObject : public QObject
@@ -147,5 +148,93 @@ void tst_QObjectRace::moveToThreadRace()
delete object;
}
+
+class MyObject : public QObject
+{ Q_OBJECT
+ public slots:
+ void slot1() { emit signal1(); }
+ void slot2() { emit signal2(); }
+ void slot3() { emit signal3(); }
+ void slot4() { emit signal4(); }
+ void slot5() { emit signal5(); }
+ void slot6() { emit signal6(); }
+ void slot7() { emit signal7(); }
+ signals:
+ void signal1();
+ void signal2();
+ void signal3();
+ void signal4();
+ void signal5();
+ void signal6();
+ void signal7();
+};
+
+
+
+class DestroyThread : public QThread
+{
+ Q_OBJECT
+ QObject **objects;
+ int number;
+
+public:
+ void setObjects(QObject **o, int n)
+ {
+ objects = o;
+ number = n;
+ for(int i = 0; i < number; i++)
+ objects[i]->moveToThread(this);
+ }
+
+ void run() {
+ for(int i = 0; i < number; i++)
+ delete objects[i];
+ }
+};
+
+void tst_QObjectRace::destroyRace()
+{
+ enum { ThreadCount = 10, ObjectCountPerThread = 733,
+ ObjectCount = ThreadCount * ObjectCountPerThread };
+
+ const char *_slots[] = { SLOT(slot1()) , SLOT(slot2()) , SLOT(slot3()),
+ SLOT(slot4()) , SLOT(slot5()) , SLOT(slot6()),
+ SLOT(slot7()) };
+
+ const char *_signals[] = { SIGNAL(signal1()), SIGNAL(signal2()), SIGNAL(signal3()),
+ SIGNAL(signal4()), SIGNAL(signal5()), SIGNAL(signal6()),
+ SIGNAL(signal7()) };
+
+ QObject *objects[ObjectCount];
+ for (int i = 0; i < ObjectCount; ++i)
+ objects[i] = new MyObject;
+
+
+ for (int i = 0; i < ObjectCount * 11; ++i) {
+ connect(objects[(i*13) % ObjectCount], _signals[(2*i)%7],
+ objects[((i+2)*17) % ObjectCount], _slots[(3*i+2)%7] );
+ connect(objects[((i+6)*23) % ObjectCount], _signals[(5*i+4)%7],
+ objects[((i+8)*41) % ObjectCount], _slots[(i+6)%7] );
+ }
+
+ DestroyThread *threads[ThreadCount];
+ for (int i = 0; i < ThreadCount; ++i) {
+ threads[i] = new DestroyThread;
+ threads[i]->setObjects(objects + i*ObjectCountPerThread, ObjectCountPerThread);
+ }
+
+ for (int i = 0; i < ThreadCount; ++i)
+ threads[i]->start();
+
+ QVERIFY(threads[0]->wait(TwoMinutes));
+ // the other threads should finish pretty quickly now
+ for (int i = 1; i < ThreadCount; ++i)
+ QVERIFY(threads[i]->wait(3000));
+
+ for (int i = 0; i < ThreadCount; ++i)
+ delete threads[i];
+}
+
+
QTEST_MAIN(tst_QObjectRace)
#include "tst_qobjectrace.moc"
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index b813d1d..740cfb1 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -219,6 +219,7 @@ private slots:
void imageCoordinateLimit();
void imageBlending_data();
void imageBlending();
+ void imageBlending_clipped();
void paintOnNullPixmap();
void checkCompositionMode();
@@ -3795,6 +3796,31 @@ void tst_QPainter::imageBlending()
}
}
+void tst_QPainter::imageBlending_clipped()
+{
+ QImage src(20, 20, QImage::Format_RGB16);
+ QPainter p(&src);
+ p.fillRect(src.rect(), Qt::red);
+ p.end();
+
+ QImage dst(40, 20, QImage::Format_RGB16);
+ p.begin(&dst);
+ p.fillRect(dst.rect(), Qt::white);
+ p.end();
+
+ QImage expected = dst;
+
+ p.begin(&dst);
+ p.setClipRect(QRect(23, 0, 20, 20));
+
+ // should be completely clipped
+ p.drawImage(QRectF(3, 0, 20, 20), src);
+ p.end();
+
+ // dst should be left unchanged
+ QCOMPARE(dst, expected);
+}
+
void tst_QPainter::paintOnNullPixmap()
{
QPixmap pix(16, 16);
diff --git a/tests/auto/qpen/tst_qpen.cpp b/tests/auto/qpen/tst_qpen.cpp
index 0327629..4fc19c4 100644
--- a/tests/auto/qpen/tst_qpen.cpp
+++ b/tests/auto/qpen/tst_qpen.cpp
@@ -111,22 +111,22 @@ void tst_QPen::operator_eq_eq_data()
QTest::newRow("differentColor") << QPen(Qt::red)
<< QPen(Qt::blue)
- << FALSE;
+ << bool(FALSE);
QTest::newRow("differentWidth") << QPen(Qt::red, 2)
<< QPen(Qt::red, 3)
- << FALSE;
+ << bool(FALSE);
QTest::newRow("differentPenStyle") << QPen(Qt::red, 2, Qt::DashLine)
<< QPen(Qt::red, 2, Qt::DotLine)
- << FALSE;
+ << bool(FALSE);
QTest::newRow("differentCapStyle") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
<< QPen(Qt::red, 2, Qt::DashLine, Qt::SquareCap, Qt::BevelJoin)
- << FALSE;
+ << bool(FALSE);
QTest::newRow("differentJoinStyle") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
<< QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::MiterJoin)
- << FALSE;
+ << bool(FALSE);
QTest::newRow("same") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
<< QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
- << TRUE;
+ << bool(TRUE);
}
diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro
index aa767aa..c992f6e 100644
--- a/tests/auto/qpixmap/qpixmap.pro
+++ b/tests/auto/qpixmap/qpixmap.pro
@@ -1,26 +1,21 @@
load(qttest_p4)
SOURCES += tst_qpixmap.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
-wince*: {
+wince*|symbian*: {
task31722_0.sources = convertFromImage/task31722_0/*
task31722_0.path = convertFromImage/task31722_0
task31722_1.sources = convertFromImage/task31722_1/*
task31722_1.path = convertFromImage/task31722_1
DEPLOYMENT += task31722_0 task31722_1
- DEFINES += SRCDIR=\\\".\\\"
}
-symbian*:{
- task31722_0.sources = convertFromImage/task31722_0/*
- task31722_0.path = convertFromImage/task31722_0
- task31722_1.sources = convertFromImage/task31722_1/*
- task31722_1.path = convertFromImage/task31722_1
- DEPLOYMENT += task31722_0 task31722_1
+
+wince*: {
+ DEFINES += SRCDIR=\\\".\\\"
+} symbian*: {
DEPLOYMENT_PLUGIN += qmng
-}
-else {
+ LIBS += -lfbscli.lib -lbitgdi.lib -lgdi.lib
+} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
win32:LIBS += -lgdi32 -luser32
}
-
-
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 493333b..9f73e34 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -58,6 +58,14 @@
#include <qscreen_qws.h>
#endif
+#ifdef Q_OS_SYMBIAN
+#include <e32std.h>
+#include <fbs.h>
+#include <gdi.h>
+#include <bitdev.h>
+#endif
+
+
//TESTED_CLASS=
//TESTED_FILES=
#if defined(Q_OS_SYMBIAN)
@@ -120,6 +128,11 @@ private slots:
void fromWinHBITMAP();
#endif
+#if defined(Q_WS_S60)
+ void fromSymbianCFbsBitmap_data();
+ void fromSymbianCFbsBitmap();
+#endif
+
void onlyNullPixmapsOutsideGuiThread();
void refUnref();
@@ -798,6 +811,94 @@ void tst_QPixmap::fromWinHBITMAP()
#endif
+#if defined(Q_WS_S60)
+Q_DECLARE_METATYPE(TDisplayMode)
+
+void tst_QPixmap::fromSymbianCFbsBitmap_data()
+{
+ QTest::addColumn<TDisplayMode>("format");
+ QTest::addColumn<int>("width");
+ QTest::addColumn<int>("height");
+ QTest::addColumn<QColor>("color");
+
+ const int smallWidth = 20;
+ const int smallHeight = 20;
+ const int largeWidth = 240;
+ const int largeHeight = 320;
+
+ // Indexed Color Formats - Disabled since images seem to be blank -> no palette?
+// QTest::newRow("EGray2 small") << EGray2 << smallWidth << smallHeight << QColor(Qt::black);
+// QTest::newRow("EGray2 big") << EGray2 << largeWidth << largeHeight << QColor(Qt::black);
+// QTest::newRow("EGray256 small") << EGray256 << smallWidth << smallHeight << QColor(Qt::blue);
+// QTest::newRow("EGray256 big") << EGray256 << largeWidth << largeHeight << QColor(Qt::blue);
+// QTest::newRow("EColor256 small") << EColor256 << smallWidth << smallHeight << QColor(Qt::red);
+// QTest::newRow("EColor256 big") << EColor256 << largeWidth << largeHeight << QColor(Qt::red);
+
+ // Direct Color Formats
+ QTest::newRow("EColor4K small") << EColor4K << smallWidth << smallHeight << QColor(Qt::red);
+ QTest::newRow("EColor4K big") << EColor4K << largeWidth << largeHeight << QColor(Qt::red);
+ QTest::newRow("EColor64K small") << EColor64K << smallWidth << smallHeight << QColor(Qt::green);
+ QTest::newRow("EColor64K big") << EColor64K << largeWidth << largeHeight << QColor(Qt::green);
+ QTest::newRow("EColor16MU small") << EColor16MU << smallWidth << smallHeight << QColor(Qt::red);
+ QTest::newRow("EColor16MU big") << EColor16MU << largeWidth << largeHeight << QColor(Qt::red);
+ QTest::newRow("EColor16MA small opaque") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0);
+ QTest::newRow("EColor16MA big opaque") << EColor16MA << largeWidth << largeHeight << QColor(255, 255, 0);
+
+ // Semi-transparent Colors - Disabled for now, since the QCOMPARE fails, but visually confirmed to work
+// QTest::newRow("EColor16MA small semi") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0, 127);
+// QTest::newRow("EColor16MA big semi") << EColor16MA << largeWidth << largeHeight << QColor(255, 255, 0, 127);
+// QTest::newRow("EColor16MA small trans") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0, 0);
+// QTest::newRow("EColor16MA big trans") << EColor16MA << largeWidth << largeHeight << QColor(255, 255, 0, 0);
+
+#if !defined(__SERIES60_31__) && !defined(__S60_32__)
+ QTest::newRow("EColor16MAP small") << EColor16MAP << smallWidth << smallHeight << QColor(Qt::red);
+ QTest::newRow("EColor16MAP big") << EColor16MAP << largeWidth << largeHeight << QColor(Qt::red);
+#endif
+}
+
+void tst_QPixmap::fromSymbianCFbsBitmap()
+{
+ QFETCH(TDisplayMode, format);
+ QFETCH(int, width);
+ QFETCH(int, height);
+ QFETCH(QColor, color);
+ int expectedDepth = TDisplayModeUtils::NumDisplayModeBitsPerPixel(format);
+
+ CFbsBitmap *nativeBitmap = 0;
+ CFbsBitmapDevice *bitmapDevice = 0;
+ CBitmapContext *bitmapContext = 0;
+
+ nativeBitmap = new (ELeave) CFbsBitmap();
+ TInt err = nativeBitmap->Create(TSize(width, height), format);
+ CleanupStack::PushL(nativeBitmap);
+ QVERIFY(err == KErrNone);
+ bitmapDevice = CFbsBitmapDevice::NewL(nativeBitmap);
+ CleanupStack::PushL(bitmapDevice);
+
+ err = bitmapDevice->CreateBitmapContext(bitmapContext);
+ CleanupStack::PushL(bitmapContext);
+ QVERIFY(err == KErrNone);
+ TRgb symbianColor = TRgb(color.red(), color.green(), color.blue(), color.alpha());
+ bitmapContext->SetBrushColor(symbianColor);
+ bitmapContext->Clear();
+
+ __UHEAP_MARK;
+ { // Test the normal case
+ QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(nativeBitmap);
+// QCOMPARE(pixmap.depth(), expectedDepth); // Depth is not preserved now
+ QCOMPARE(pixmap.width(), width);
+ QCOMPARE(pixmap.height(), height);
+ QImage image = pixmap.toImage();
+
+ QColor actualColor(image.pixel(1, 1));
+ QCOMPARE(actualColor, color);
+ }
+ __UHEAP_MARKEND;
+
+ CleanupStack::PopAndDestroy(3);
+}
+#endif
+
void tst_QPixmap::onlyNullPixmapsOutsideGuiThread()
{
#if !defined(Q_WS_WIN)
diff --git a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
index 6835c21..456ab7b 100644
--- a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
+++ b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
@@ -221,7 +221,7 @@ void tst_QPlainTextEdit::getSetCheck()
QCOMPARE(0, obj1.tabStopWidth());
obj1.setTabStopWidth(INT_MIN);
QCOMPARE(0, obj1.tabStopWidth()); // Makes no sense to set a negative tabstop value
-#if defined(QT_ARCH_WINDOWSCE)
+#if defined(QT_ARCH_WINDOWSCE) || defined (QT_ARCH_SYMBIAN)
// due to rounding error in qRound when qreal==float
// we cannot use INT_MAX for this check
obj1.setTabStopWidth(SHRT_MAX*2);
diff --git a/tests/auto/qpluginloader/tst_qpluginloader.cpp b/tests/auto/qpluginloader/tst_qpluginloader.cpp
index 20ca997..3b2cb66 100644
--- a/tests/auto/qpluginloader/tst_qpluginloader.cpp
+++ b/tests/auto/qpluginloader/tst_qpluginloader.cpp
@@ -122,7 +122,7 @@ private slots:
void errorString();
void loadHints();
void deleteinstanceOnUnload();
-
+ void checkingStubsFromDifferentDrives();
};
tst_QPluginLoader::tst_QPluginLoader()
@@ -297,6 +297,56 @@ void tst_QPluginLoader::deleteinstanceOnUnload()
}
}
+void tst_QPluginLoader::checkingStubsFromDifferentDrives()
+{
+#if defined(Q_OS_SYMBIAN)
+
+ // This test needs C-drive + some additional drive (driveForStubs)
+
+ const QString driveForStubs("E:/");// != "C:/"
+ const QString stubDir("system/temp/stubtest/");
+ const QString stubName("dummyStub.qtplugin");
+ const QString fullStubFileName(stubDir + stubName);
+ QDir dir(driveForStubs);
+ bool test1(false); bool test2(false);
+
+ // initial clean up
+ QFile::remove(driveForStubs + fullStubFileName);
+ dir.rmdir(driveForStubs + stubDir);
+
+ // create a stub dir and do stub drive check
+ if (!dir.mkpath(stubDir))
+ QSKIP("Required drive not available for this test", SkipSingle);
+
+ {// test without stub, should not be found
+ QPluginLoader loader("C:/" + fullStubFileName);
+ test1 = !loader.fileName().length();
+ }
+
+ // create a stub to defined drive
+ QFile tempFile(driveForStubs + fullStubFileName);
+ tempFile.open(QIODevice::ReadWrite);
+ QFileInfo fileInfo(tempFile);
+
+ {// now should be found even tried to find from C:
+ QPluginLoader loader("C:/" + fullStubFileName);
+ test2 = (loader.fileName() == fileInfo.absoluteFilePath());
+ }
+
+ // clean up
+ tempFile.close();
+ if (!QFile::remove(driveForStubs + fullStubFileName))
+ QWARN("Could not remove stub file");
+ if (!dir.rmdir(driveForStubs + stubDir))
+ QWARN("Could not remove stub directory");
+
+ // test after cleanup
+ QVERIFY(test1);
+ QVERIFY(test2);
+
+#endif//Q_OS_SYMBIAN
+}
+
QTEST_APPLESS_MAIN(tst_QPluginLoader)
#include "tst_qpluginloader.moc"
diff --git a/tests/auto/qprinter/tst_qprinter.cpp b/tests/auto/qprinter/tst_qprinter.cpp
index cde4ae5..221e3b0 100644
--- a/tests/auto/qprinter/tst_qprinter.cpp
+++ b/tests/auto/qprinter/tst_qprinter.cpp
@@ -953,8 +953,9 @@ void tst_QPrinter::printDialogCompleter()
QTest::qWait(100);
- QTest::keyClick(0, Qt::Key_Tab);
- QTest::keyClick(0, 'P');
+ QTest::keyClick(&dialog, Qt::Key_Tab);
+ QTest::keyClick(&dialog, 'P');
+ // The test passes if it doesn't crash.
#endif
}
diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp
index 2610af9..8101708 100644
--- a/tests/auto/qprocess/tst_qprocess.cpp
+++ b/tests/auto/qprocess/tst_qprocess.cpp
@@ -1623,12 +1623,10 @@ void tst_QProcess::spaceArgsTest()
//-----------------------------------------------------------------------------
void tst_QProcess::exitCodeTest()
{
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- // WINSCW builds in Symbian panic somewhere deep inside Symbian codes
- // when eventdispather is deleted if too many test iterations are used.
- // Reason for this is unclear.
- // TODO: Remove special case when eventdispatcher is fixed.
- for (int i = 0; i < 25; ++i) {
+#if defined(Q_OS_SYMBIAN)
+ // Kernel will run out of process handles on some hw, as there is some
+ // delay before they are recycled, so limit the amount of processes.
+ for (int i = 0; i < 50; ++i) {
#else
for (int i = 0; i < 255; ++i) {
#endif
diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp
index d6379d3..cb037e0 100644
--- a/tests/auto/qprogressbar/tst_qprogressbar.cpp
+++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp
@@ -63,6 +63,7 @@ private slots:
void setValueRepaint();
void sizeHint();
+ void task245201_testChangeStyleAndDelete_data();
void task245201_testChangeStyleAndDelete();
};
@@ -224,15 +225,30 @@ void tst_QProgressBar::sizeHint()
QCOMPARE(barSize.height(), size.height());
}
+void tst_QProgressBar::task245201_testChangeStyleAndDelete_data()
+{
+ QTest::addColumn<QString>("style1_str");
+ QTest::addColumn<QString>("style2_str");
+
+ QTest::newRow("plastique-windows") << QString::fromLatin1("plastique") << QString::fromLatin1("windows");
+ QTest::newRow("mlotif-windows") << QString::fromLatin1("motif") << QString::fromLatin1("windows");
+ QTest::newRow("cleanlooks-cde") << QString::fromLatin1("cleanlooks") << QString::fromLatin1("cde");
+ QTest::newRow("gtk-plastique") << QString::fromLatin1("gtk") << QString::fromLatin1("plastique");
+}
+
void tst_QProgressBar::task245201_testChangeStyleAndDelete()
{
+ QFETCH(QString, style1_str);
+ QFETCH(QString, style2_str);
+
QProgressBar *bar = new QProgressBar;
- QStyle *style = QStyleFactory::create("plastique");
+ QStyle *style = QStyleFactory::create(style1_str);
bar->setStyle(style);
bar->show();
- QStyle *style2 = QStyleFactory::create("windows");
+ QStyle *style2 = QStyleFactory::create(style2_str);
bar->setStyle(style2);
+ QTest::qWait(10);
delete bar;
QTest::qWait(100); //should not crash
diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro
index f487b97..d98c2db 100644
--- a/tests/auto/qresourceengine/qresourceengine.pro
+++ b/tests/auto/qresourceengine/qresourceengine.pro
@@ -9,7 +9,11 @@ load(resources)
SOURCES += tst_resourceengine.cpp
RESOURCES += testqrc/test.qrc
-runtime_resource.target = $$PWD/runtime_resource.rcc
+symbian-sbsv2 {
+ runtime_resource.target = $$PWD/runtime_resource.rcc
+} else {
+ runtime_resource.target = runtime_resource.rcc
+}
runtime_resource.depends = $$PWD/testqrc/test.qrc
runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $${runtime_resource.depends} -o $${runtime_resource.target}
QMAKE_EXTRA_TARGETS = runtime_resource
diff --git a/tests/auto/qscopedpointer/.gitignore b/tests/auto/qscopedpointer/.gitignore
new file mode 100644
index 0000000..9f2324c
--- /dev/null
+++ b/tests/auto/qscopedpointer/.gitignore
@@ -0,0 +1 @@
+tst_qscopedpointer
diff --git a/tests/auto/qscopedpointer/qscopedpointer.pro b/tests/auto/qscopedpointer/qscopedpointer.pro
new file mode 100644
index 0000000..13d8425
--- /dev/null
+++ b/tests/auto/qscopedpointer/qscopedpointer.pro
@@ -0,0 +1,3 @@
+load(qttest_p4)
+SOURCES += tst_qscopedpointer.cpp
+QT -= gui
diff --git a/tests/auto/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/qscopedpointer/tst_qscopedpointer.cpp
new file mode 100644
index 0000000..0e005c3
--- /dev/null
+++ b/tests/auto/qscopedpointer/tst_qscopedpointer.cpp
@@ -0,0 +1,282 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtCore/QScopedPointer>
+
+/*!
+ \class tst_QScopedPointer
+ \internal
+ \since 4.6
+ \brief Tests class QScopedPointer.
+
+ */
+class tst_QScopedPointer : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void defaultConstructor() const;
+ void dataOnDefaultConstructed() const;
+ void useSubClassInConstructor() const;
+ void dataOnValue() const;
+ void dataSignature() const;
+ void reset() const;
+ void dereferenceOperator() const;
+ void dereferenceOperatorSignature() const;
+ void pointerOperator() const;
+ void pointerOperatorSignature() const;
+ void negationOperator() const;
+ void negationOperatorSignature() const;
+ void operatorBool() const;
+ void operatorBoolSignature() const;
+ void isNull() const;
+ void isNullSignature() const;
+ void objectSize() const;
+ // TODO instansiate on const object
+};
+
+void tst_QScopedPointer::defaultConstructor() const
+{
+ /* Check that the members, one, is correctly initialized. */
+ QScopedPointer<int> p;
+ QCOMPARE(p.data(), static_cast<int *>(0));
+}
+
+void tst_QScopedPointer::dataOnDefaultConstructed() const
+{
+ QScopedPointer<int> p;
+
+ QCOMPARE(p.data(), static_cast<int *>(0));
+}
+
+class MyClass
+{
+};
+
+class MySubClass : public MyClass
+{
+};
+
+void tst_QScopedPointer::useSubClassInConstructor() const
+{
+ /* Use a syntax which users typically would do. */
+ QScopedPointer<MyClass> p(new MyClass());
+}
+
+void tst_QScopedPointer::dataOnValue() const
+{
+ int *const rawPointer = new int(5);
+ QScopedPointer<int> p(rawPointer);
+
+ QCOMPARE(p.data(), rawPointer);
+}
+
+void tst_QScopedPointer::dataSignature() const
+{
+ const QScopedPointer<int> p;
+ /* data() should be const. */
+ p.data();
+}
+
+void tst_QScopedPointer::reset() const
+{
+ /* Call reset() on a default constructed value. */
+ {
+ QScopedPointer<int> p;
+ p.reset();
+ QCOMPARE(p.data(), static_cast<int *>(0));
+ }
+
+ /* Call reset() on an active value. */
+ {
+ QScopedPointer<int> p(new int(3));
+ p.reset();
+ QCOMPARE(p.data(), static_cast<int *>(0));
+ }
+
+ /* Call reset() with a value, on an active value. */
+ {
+ QScopedPointer<int> p(new int(3));
+
+ int *const value = new int(9);
+ p.reset(value);
+ QCOMPARE(*p.data(), 9);
+ }
+
+ /* Call reset() with a value, on default constructed value. */
+ {
+ QScopedPointer<int> p;
+
+ int *const value = new int(9);
+ p.reset(value);
+ QCOMPARE(*p.data(), 9);
+ }
+}
+
+class AbstractClass
+{
+public:
+ virtual ~AbstractClass()
+ {
+ }
+
+ virtual int member() const = 0;
+};
+
+class SubClass : public AbstractClass
+{
+public:
+ virtual int member() const
+ {
+ return 5;
+ }
+};
+
+void tst_QScopedPointer::dereferenceOperator() const
+{
+ /* Dereference a basic value. */
+ {
+ QScopedPointer<int> p(new int(5));
+
+ const int value2 = *p;
+ QCOMPARE(value2, 5);
+ }
+
+ /* Dereference a pointer to an abstract class. This verifies
+ * that the operator returns a reference, when compiling
+ * with MSVC 2005. */
+ {
+ QScopedPointer<AbstractClass> p(new SubClass());
+
+ QCOMPARE((*p).member(), 5);
+ }
+}
+
+void tst_QScopedPointer::dereferenceOperatorSignature() const
+{
+ /* The operator should be const. */
+ {
+ const QScopedPointer<int> p(new int(5));
+ *p;
+ }
+
+ /* A reference should be returned, not a value. */
+ {
+ const QScopedPointer<int> p(new int(5));
+ Q_UNUSED(static_cast<int &>(*p));
+ }
+
+ /* Instantiated on a const object, the returned object is a const reference. */
+ {
+ const QScopedPointer<const int> p(new int(5));
+ Q_UNUSED(static_cast<const int &>(*p));
+ }
+}
+
+class AnyForm
+{
+public:
+ int value;
+};
+
+void tst_QScopedPointer::pointerOperator() const
+{
+ QScopedPointer<AnyForm> p(new AnyForm());
+ p->value = 5;
+
+ QCOMPARE(p->value, 5);
+}
+
+void tst_QScopedPointer::pointerOperatorSignature() const
+{
+ /* The operator should be const. */
+ const QScopedPointer<AnyForm> p(new AnyForm);
+ p->value = 5;
+
+ QVERIFY(p->value);
+}
+
+void tst_QScopedPointer::negationOperator() const
+{
+ /* Invoke on default constructed value. */
+ {
+ QScopedPointer<int> p;
+ QVERIFY(!p);
+ }
+
+ /* Invoke on a value. */
+ {
+ QScopedPointer<int> p(new int(2));
+ QCOMPARE(!p, false);
+ }
+}
+
+void tst_QScopedPointer::negationOperatorSignature() const
+{
+ /* The signature should be const. */
+ const QScopedPointer<int> p;
+ !p;
+
+ /* The return value should be bool. */
+ static_cast<bool>(!p);
+}
+
+void tst_QScopedPointer::operatorBool() const
+{
+ /* Invoke on default constructed value. */
+ {
+ QScopedPointer<int> p;
+ QCOMPARE(bool(p), false);
+ }
+
+ /* Invoke on active value. */
+ {
+ QScopedPointer<int> p(new int(3));
+ QVERIFY(p);
+ }
+}
+
+void tst_QScopedPointer::operatorBoolSignature() const
+{
+ /* The signature should be const and return bool. */
+ const QScopedPointer<int> p;
+
+ static_cast<bool>(p);
+}
+
+void tst_QScopedPointer::isNull() const
+{
+ /* Invoke on default constructed value. */
+ {
+ QScopedPointer<int> p;
+ QVERIFY(p.isNull());
+ }
+
+ /* Invoke on a set value. */
+ {
+ QScopedPointer<int> p(new int(69));
+ QVERIFY(!p.isNull());
+ }
+}
+
+void tst_QScopedPointer::isNullSignature() const
+{
+ const QScopedPointer<int> p(new int(69));
+
+ /* The signature should be const and return bool. */
+ static_cast<bool>(p.isNull());
+}
+
+void tst_QScopedPointer::objectSize() const
+{
+ /* The size of QScopedPointer should be the same as one pointer. */
+ QCOMPARE(sizeof(QScopedPointer<int>), sizeof(void *));
+}
+
+QTEST_MAIN(tst_QScopedPointer)
+#include "tst_qscopedpointer.moc"
diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro
index 9e35801..9976bb2 100644
--- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro
+++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro
@@ -2,10 +2,10 @@ load(qttest_p4)
QT = core script
SOURCES += tst_qscriptv8testsuite.cpp
-wince*: {
+wince*|symbian: {
testFiles.sources = tests
testFiles.path = .
DEPLOYMENT += testFiles
}
-
+symbian:TARGET.EPOCHEAPSIZE = 0x00020000 0x02000000
diff --git a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
index 435af41..5811938 100644
--- a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
+++ b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
@@ -256,6 +256,11 @@ tst_Suite::tst_Suite()
addTestExclusion("mul-exhaustive", "Demands too much memory on WinCE");
#endif
+#ifdef Q_OS_SYMBIAN
+ addTestExclusion("nested-repetition-count-overflow", "Demands too much memory on Symbian");
+ addTestExclusion("unicode-test", "Demands too much memory on Symbian");
+#endif
+
QVector<uint> *data = qt_meta_data_tst_Suite();
// content:
*data << 1 // revision
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
index becbf52..3ae849d 100644
--- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
@@ -61,8 +61,11 @@ private slots:
void downCast();
void upCast();
void differentPointers();
+ void virtualBaseDifferentPointers();
#ifndef QTEST_NO_RTTI
void dynamicCast();
+ void dynamicCastDifferentPointers();
+ void dynamicCastVirtualBase();
void dynamicCastFailure();
#endif
void customDeleter();
@@ -325,6 +328,10 @@ class DiffPtrDerivedData: public Stuffing, public Data
{
};
+class VirtualDerived: virtual public Data
+{
+};
+
void tst_QSharedPointer::downCast()
{
{
@@ -443,7 +450,7 @@ void tst_QSharedPointer::differentPointers()
DiffPtrDerivedData *aData = new DiffPtrDerivedData;
Data *aBase = aData;
Q_ASSERT(aData == aBase);
- Q_ASSERT(quintptr(&aData) != quintptr(&aBase));
+ Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase));
QSharedPointer<Data> baseptr = QSharedPointer<Data>(aData);
QSharedPointer<DiffPtrDerivedData> ptr = qSharedPointerCast<DiffPtrDerivedData>(baseptr);
@@ -457,7 +464,7 @@ void tst_QSharedPointer::differentPointers()
DiffPtrDerivedData *aData = new DiffPtrDerivedData;
Data *aBase = aData;
Q_ASSERT(aData == aBase);
- Q_ASSERT(quintptr(&aData) != quintptr(&aBase));
+ Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase));
QSharedPointer<DiffPtrDerivedData> ptr = QSharedPointer<DiffPtrDerivedData>(aData);
QSharedPointer<Data> baseptr = ptr;
@@ -468,23 +475,53 @@ void tst_QSharedPointer::differentPointers()
QVERIFY(baseptr == aData);
QVERIFY(baseptr == aBase);
}
+}
+
+void tst_QSharedPointer::virtualBaseDifferentPointers()
+{
+ {
+ VirtualDerived *aData = new VirtualDerived;
+ Data *aBase = aData;
+ Q_ASSERT(aData == aBase);
+ Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase));
+
+ QSharedPointer<VirtualDerived> ptr = QSharedPointer<VirtualDerived>(aData);
+ QSharedPointer<Data> baseptr = qSharedPointerCast<Data>(ptr);
+ QVERIFY(ptr == baseptr);
+ QVERIFY(ptr.data() == baseptr.data());
+ QVERIFY(ptr == aBase);
+ QVERIFY(ptr == aData);
+ QVERIFY(baseptr == aData);
+ QVERIFY(baseptr == aBase);
+ }
+
+ {
+ VirtualDerived *aData = new VirtualDerived;
+ Data *aBase = aData;
+ Q_ASSERT(aData == aBase);
+ Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase));
- // there is no possibility for different pointers in
- // internal reference counting right now
- //
- // to do that, it's necessary to first implement the ability to
- // call (virtual) functions, so that the two differing bases have
- // the same reference counter
+ QSharedPointer<VirtualDerived> ptr = QSharedPointer<VirtualDerived>(aData);
+ QSharedPointer<Data> baseptr = ptr;
+ QVERIFY(ptr == baseptr);
+ QVERIFY(ptr.data() == baseptr.data());
+ QVERIFY(ptr == aBase);
+ QVERIFY(ptr == aData);
+ QVERIFY(baseptr == aData);
+ QVERIFY(baseptr == aBase);
+ }
}
#ifndef QTEST_NO_RTTI
void tst_QSharedPointer::dynamicCast()
{
- QSharedPointer<Data> baseptr = QSharedPointer<Data>(new DerivedData);
+ DerivedData *aData = new DerivedData;
+ QSharedPointer<Data> baseptr = QSharedPointer<Data>(aData);
{
QSharedPointer<DerivedData> derivedptr = qSharedPointerDynamicCast<DerivedData>(baseptr);
QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
QCOMPARE(int(baseptr.d->weakref), 1);
@@ -494,6 +531,7 @@ void tst_QSharedPointer::dynamicCast()
QWeakPointer<Data> weakptr = baseptr;
QSharedPointer<DerivedData> derivedptr = qSharedPointerDynamicCast<DerivedData>(weakptr);
QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
QCOMPARE(int(baseptr.d->weakref), 1);
@@ -502,6 +540,87 @@ void tst_QSharedPointer::dynamicCast()
{
QSharedPointer<DerivedData> derivedptr = baseptr.dynamicCast<DerivedData>();
QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
+ QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
+ }
+ QCOMPARE(int(baseptr.d->weakref), 1);
+ QCOMPARE(int(baseptr.d->strongref), 1);
+}
+
+void tst_QSharedPointer::dynamicCastDifferentPointers()
+{
+ // DiffPtrDerivedData derives from both Data and Stuffing
+ DiffPtrDerivedData *aData = new DiffPtrDerivedData;
+ QSharedPointer<Data> baseptr = QSharedPointer<Data>(aData);
+
+ {
+ QSharedPointer<DiffPtrDerivedData> derivedptr = qSharedPointerDynamicCast<DiffPtrDerivedData>(baseptr);
+ QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
+ QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
+ }
+ QCOMPARE(int(baseptr.d->weakref), 1);
+ QCOMPARE(int(baseptr.d->strongref), 1);
+
+ {
+ QWeakPointer<Data> weakptr = baseptr;
+ QSharedPointer<DiffPtrDerivedData> derivedptr = qSharedPointerDynamicCast<DiffPtrDerivedData>(weakptr);
+ QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
+ QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
+ }
+ QCOMPARE(int(baseptr.d->weakref), 1);
+ QCOMPARE(int(baseptr.d->strongref), 1);
+
+ {
+ QSharedPointer<DiffPtrDerivedData> derivedptr = baseptr.dynamicCast<DiffPtrDerivedData>();
+ QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
+ QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
+ }
+ QCOMPARE(int(baseptr.d->weakref), 1);
+ QCOMPARE(int(baseptr.d->strongref), 1);
+
+ {
+ Stuffing *nakedptr = dynamic_cast<Stuffing *>(baseptr.data());
+ QVERIFY(nakedptr);
+
+ QSharedPointer<Stuffing> otherbaseptr = qSharedPointerDynamicCast<Stuffing>(baseptr);
+ QVERIFY(!otherbaseptr.isNull());
+ QVERIFY(otherbaseptr == nakedptr);
+ QCOMPARE(otherbaseptr.data(), nakedptr);
+ QCOMPARE(static_cast<DiffPtrDerivedData*>(otherbaseptr.data()), aData);
+ }
+}
+
+void tst_QSharedPointer::dynamicCastVirtualBase()
+{
+ VirtualDerived *aData = new VirtualDerived;
+ QSharedPointer<Data> baseptr = QSharedPointer<Data>(aData);
+
+ {
+ QSharedPointer<VirtualDerived> derivedptr = qSharedPointerDynamicCast<VirtualDerived>(baseptr);
+ QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
+ QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
+ }
+ QCOMPARE(int(baseptr.d->weakref), 1);
+ QCOMPARE(int(baseptr.d->strongref), 1);
+
+ {
+ QWeakPointer<Data> weakptr = baseptr;
+ QSharedPointer<VirtualDerived> derivedptr = qSharedPointerDynamicCast<VirtualDerived>(weakptr);
+ QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
+ QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
+ }
+ QCOMPARE(int(baseptr.d->weakref), 1);
+ QCOMPARE(int(baseptr.d->strongref), 1);
+
+ {
+ QSharedPointer<VirtualDerived> derivedptr = baseptr.dynamicCast<VirtualDerived>();
+ QVERIFY(baseptr == derivedptr);
+ QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
QCOMPARE(int(baseptr.d->weakref), 1);
diff --git a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp
index 74f09d0..a27ea00 100644
--- a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp
+++ b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp
@@ -319,7 +319,6 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
- // Connect to imap.trolltech.com's IP
QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143));
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
@@ -799,14 +798,14 @@ void tst_QSocks5SocketEngine::downloadBigFile()
if (QTestEventLoop::instance().timeout())
QFAIL("Network operation timed out");
- QCOMPARE(bytesAvailable, qint64(10000309));
+ QCOMPARE(bytesAvailable, qint64(10000000));
QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
- qDebug("\t\t%.1fMB/%.1fs: %.1fMB/s",
+ /*qDebug("\t\t%.1fMB/%.1fs: %.1fMB/s",
bytesAvailable / (1024.0 * 1024.0),
stopWatch.elapsed() / 1024.0,
- (bytesAvailable / (stopWatch.elapsed() / 1000.0)) / (1024 * 1024));
+ (bytesAvailable / (stopWatch.elapsed() / 1000.0)) / (1024 * 1024));*/
delete tmpSocket;
tmpSocket = 0;
@@ -820,7 +819,10 @@ void tst_QSocks5SocketEngine::exitLoopSlot()
void tst_QSocks5SocketEngine::downloadBigFileSlot()
{
- bytesAvailable += tmpSocket->readAll().size();
+ QByteArray tmp=tmpSocket->readAll();
+ int correction=tmp.indexOf((char)0,0); //skip header
+ if (correction==-1) correction=0;
+ bytesAvailable += (tmp.size()-correction);
if (bytesAvailable >= 10000000)
QTestEventLoop::instance().exitLoop();
}
@@ -902,7 +904,6 @@ void tst_QSocks5SocketEngine::passwordAuth2()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081));
socketDevice.setReceiver(this);
- // Connect to imap.trolltech.com's IP
QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143));
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
while (socketDevice.state() == QAbstractSocket::ConnectingState) {
diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index bd66fdf..80d90a6 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/qsplitter/tst_qsplitter.cpp b/tests/auto/qsplitter/tst_qsplitter.cpp
index b463f7f..51bd99f 100644
--- a/tests/auto/qsplitter/tst_qsplitter.cpp
+++ b/tests/auto/qsplitter/tst_qsplitter.cpp
@@ -55,6 +55,7 @@
#include <qtreeview.h>
#include <qlabel.h>
#include <qdebug.h> // for file error messages
+#include "../../shared/util.h"
//TESTED_CLASS=
//TESTED_FILES=
@@ -1341,9 +1342,7 @@ void tst_QSplitter::task187373_addAbstractScrollAreas()
if (addOutsideConstructor)
splitter->addWidget(w);
- qApp->processEvents();
-
- QVERIFY(w->isVisible());
+ QTRY_VERIFY(w->isVisible());
QVERIFY(!w->isHidden());
QVERIFY(w->viewport()->isVisible());
QVERIFY(!w->viewport()->isHidden());
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index 66cf81f..4fa3dc4 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -1058,7 +1058,6 @@ void tst_QSqlDatabase::recordMySQL()
specifically: Before MySQL 5.0.15, the pad value is space. Values are right-padded
with space on insert, and trailing spaces are removed on select.
*/
-#ifdef QT3_SUPPORT
if ( major >5 || ( major == 5 && minor > 0) || ( major == 5 && minor == 0 && revision >= 15) ) {
bin10 = FieldDef("binary(10)", QVariant::ByteArray, QByteArray(Q3CString("123abc ")));
varbin10 = FieldDef("varbinary(10)", QVariant::ByteArray, QByteArray(Q3CString("123abcv ")));
diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro
index 3886687..8f61318 100644
--- a/tests/auto/qsslsocket/qsslsocket.pro
+++ b/tests/auto/qsslsocket/qsslsocket.pro
@@ -15,14 +15,20 @@ win32 {
}
}
-
-symbian:{
+wince* {
+ DEFINES += SRCDIR=\\\"./\\\"
+
+ certFiles.sources = certs ssl.tar.gz
+ certFiles.path = .
+ DEPLOYMENT += certFiles
+} else:symbian {
DEFINES += QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
TARGET.EPOCHEAPSIZE="0x100 0x1000000"
TARGET.CAPABILITY="ALL -TCB"
-}
-wince*|symbian: {
- certFiles.sources = certs ssl.tar.gz
- certFiles.path = .
- DEPLOYMENT += certFiles
+
+ certFiles.sources = certs ssl.tar.gz
+ certFiles.path = .
+ DEPLOYMENT += certFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp
index c9f9cbd..9f7b537 100644
--- a/tests/auto/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp
@@ -76,6 +76,10 @@ Q_DECLARE_METATYPE(QSslError)
#define QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
#endif
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR ""
+#endif
+
#ifndef QT_NO_OPENSSL
class QSslSocketPtr: public QSharedPointer<QSslSocket>
{
@@ -493,11 +497,6 @@ void tst_QSslSocket::simpleConnectWithIgnore()
if (!socket.canReadLine())
enterLoop(10);
-/*
- QByteArray data(socket.readAll());
- QBYTEARRAY_DEBUG(data, 4096);
-*/
-
QCOMPARE(socket.readAll(), QtNetworkSettings::expectedReplySSL());
socket.disconnectFromHost();
}
@@ -506,40 +505,41 @@ void tst_QSslSocket::sslErrors_data()
{
QTest::addColumn<QString>("host");
QTest::addColumn<int>("port");
- QTest::addColumn<SslErrorList>("errors");
-
- QTest::newRow(QtNetworkSettings::serverName().toAscii() + " port443") << QtNetworkSettings::serverName() << 443
- << (SslErrorList()
- << QSslError::UnableToGetLocalIssuerCertificate
- << QSslError::CertificateUntrusted
- << QSslError::UnableToVerifyFirstCertificate
- );
- QTest::newRow(QtNetworkSettings::serverName().toAscii() + " port993") << QtNetworkSettings::serverName() << 993
- << (SslErrorList()
- << QSslError::HostNameMismatch
- << QSslError::SelfSignedCertificate
- );
- // TODO: Should we have QtNetworkSettings::serverName alias
- // in order that we could test with different host name
+ QTest::addColumn<SslErrorList>("expected");
+
+ QTest::newRow(qPrintable(QtNetworkSettings::serverLocalName()))
+ << QtNetworkSettings::serverLocalName()
+ << 993
+ << (SslErrorList() << QSslError::HostNameMismatch
+ << QSslError::SelfSignedCertificate);
+
+ QTest::newRow("imap.trolltech.com")
+ << "imap.trolltech.com"
+ << 993
+ << (SslErrorList() << QSslError::SelfSignedCertificateInChain);
}
void tst_QSslSocket::sslErrors()
{
QFETCH(QString, host);
QFETCH(int, port);
- QFETCH(SslErrorList, errors);
+ QFETCH(SslErrorList, expected);
QSslSocketPtr socket = newSocket();
socket->connectToHostEncrypted(host, port);
socket->waitForEncrypted(5000);
- SslErrorList list;
+ SslErrorList output;
foreach (QSslError error, socket->sslErrors()) {
//printf("error = %s\n", error.errorString().toAscii().data());
- list << error.error();
+ output << error.error();
}
- QCOMPARE(list, errors);
+#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
+ if (output.last() == QSslError::CertificateUntrusted)
+ output.takeLast();
+#endif
+ QCOMPARE(output, expected);
}
void tst_QSslSocket::addCaCertificate()
@@ -585,7 +585,7 @@ void tst_QSslSocket::connectToHostEncrypted()
QSslSocketPtr socket = newSocket();
this->socket = socket;
- socket->addCaCertificates(QLatin1String("certs/qt-test-server-cacert.pem"));
+ QVERIFY(socket->addCaCertificates(QLatin1String("certs/qt-test-server-cacert.pem")));
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
connect(socket, SIGNAL(sslErrors(QList<QSslError>)),
this, SLOT(untrustedWorkaroundSlot(QList<QSslError>)));
@@ -657,7 +657,7 @@ void tst_QSslSocket::peerCertificateChain()
QSslSocketPtr socket = newSocket();
this->socket = socket;
- QList<QSslCertificate> caCertificates = QSslCertificate::fromPath(QLatin1String("certs/qt-test-server-cacert.pem"));
+ QList<QSslCertificate> caCertificates = QSslCertificate::fromPath(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem"));
QVERIFY(caCertificates.count() == 1);
socket->addCaCertificates(caCertificates);
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
@@ -717,7 +717,7 @@ void tst_QSslSocket::protocol()
QSslSocketPtr socket = newSocket();
this->socket = socket;
- QList<QSslCertificate> certs = QSslCertificate::fromPath("certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> certs = QSslCertificate::fromPath(SRCDIR "certs/qt-test-server-cacert.pem");
// qDebug() << "certs:" << certs.at(0).issuerInfo(QSslCertificate::CommonName);
socket->setCaCertificates(certs);
@@ -800,7 +800,7 @@ void tst_QSslSocket::setCaCertificates()
QSslSocket socket;
QCOMPARE(socket.caCertificates(), QSslSocket::defaultCaCertificates());
- socket.setCaCertificates(QSslCertificate::fromPath("certs/qt-test-server-cacert.pem"));
+ socket.setCaCertificates(QSslCertificate::fromPath(SRCDIR "certs/qt-test-server-cacert.pem"));
QCOMPARE(socket.caCertificates().size(), 1);
socket.setCaCertificates(socket.defaultCaCertificates());
QCOMPARE(socket.caCertificates(), QSslSocket::defaultCaCertificates());
@@ -831,13 +831,13 @@ protected:
socket = new QSslSocket(this);
connect(socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(ignoreErrorSlot()));
- QFile file("certs/fluke.key");
+ QFile file(SRCDIR "certs/fluke.key");
QVERIFY(file.open(QIODevice::ReadOnly));
QSslKey key(file.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
QVERIFY(!key.isNull());
socket->setPrivateKey(key);
- QList<QSslCertificate> localCert = QSslCertificate::fromPath("certs/fluke.cert");
+ QList<QSslCertificate> localCert = QSslCertificate::fromPath(SRCDIR "certs/fluke.cert");
QVERIFY(!localCert.isEmpty());
QVERIFY(localCert.first().handle());
socket->setLocalCertificate(localCert.first());
@@ -951,7 +951,7 @@ void tst_QSslSocket::addDefaultCaCertificate()
// Reset the global CA chain
QSslSocket::setDefaultCaCertificates(QSslSocket::systemCaCertificates());
- QList<QSslCertificate> flukeCerts = QSslCertificate::fromPath("certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> flukeCerts = QSslCertificate::fromPath(SRCDIR "certs/qt-test-server-cacert.pem");
QCOMPARE(flukeCerts.size(), 1);
QList<QSslCertificate> globalCerts = QSslSocket::defaultCaCertificates();
QVERIFY(!globalCerts.contains(flukeCerts.first()));
@@ -1061,7 +1061,7 @@ protected:
socket->ignoreSslErrors();
// Only set the certificate
- QList<QSslCertificate> localCert = QSslCertificate::fromPath("certs/fluke.cert");
+ QList<QSslCertificate> localCert = QSslCertificate::fromPath(SRCDIR "certs/fluke.cert");
QVERIFY(!localCert.isEmpty());
QVERIFY(localCert.first().handle());
socket->setLocalCertificate(localCert.first());
@@ -1220,13 +1220,13 @@ protected:
socket = new QSslSocket(this);
connect(socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(ignoreErrorSlot()));
- QFile file("certs/fluke.key");
+ QFile file(SRCDIR "certs/fluke.key");
QVERIFY(file.open(QIODevice::ReadOnly));
QSslKey key(file.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
QVERIFY(!key.isNull());
socket->setPrivateKey(key);
- QList<QSslCertificate> localCert = QSslCertificate::fromPath("certs/fluke.cert");
+ QList<QSslCertificate> localCert = QSslCertificate::fromPath(SRCDIR "certs/fluke.cert");
QVERIFY(!localCert.isEmpty());
QVERIFY(localCert.first().handle());
socket->setLocalCertificate(localCert.first());
@@ -1388,8 +1388,8 @@ protected:
{
socket = new QSslSocket(this);
- socket->setPrivateKey("certs/fluke.key");
- socket->setLocalCertificate("certs/fluke.cert");
+ socket->setPrivateKey(SRCDIR "certs/fluke.key");
+ socket->setLocalCertificate(SRCDIR "certs/fluke.cert");
socket->setSocketDescriptor(socketDescriptor);
socket->startServerEncryption();
}
@@ -1531,7 +1531,7 @@ void tst_QSslSocket::resetProxy()
// make sure the connection works, and then set a nonsense proxy, and then
// make sure it does not work anymore
QSslSocket socket;
- socket.addCaCertificates(QLatin1String("certs/qt-test-server-cacert.pem"));
+ socket.addCaCertificates(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem"));
socket.setProxy(goodProxy);
socket.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
QVERIFY2(socket.waitForConnected(10000), qPrintable(socket.errorString()));
@@ -1550,7 +1550,7 @@ void tst_QSslSocket::resetProxy()
// set the nonsense proxy and make sure the connection does not work,
// and then set the right proxy and make sure it works
QSslSocket socket2;
- socket2.addCaCertificates(QLatin1String("certs/qt-test-server-cacert.pem"));
+ socket2.addCaCertificates(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem"));
socket2.setProxy(badProxy);
socket2.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
QVERIFY(! socket2.waitForConnected(10000));
diff --git a/tests/auto/qstylesheetstyle/qstylesheetstyle.pro b/tests/auto/qstylesheetstyle/qstylesheetstyle.pro
index 6acb0b4..7babe25 100644
--- a/tests/auto/qstylesheetstyle/qstylesheetstyle.pro
+++ b/tests/auto/qstylesheetstyle/qstylesheetstyle.pro
@@ -1,14 +1,4 @@
-######################################################################
-# Automatically generated by qmake (2.01a) Wed Apr 26 13:53:24 2006
-######################################################################
-
-TEMPLATE = app
-TARGET = tst_qstylesheetstyle
-DEPENDPATH += .
-INCLUDEPATH += . ..
-
-CONFIG += console qtestlib
-contains(QT_CONFIG, qt3support): QT += qt3support
+load(qttest_p4)
# Input
SOURCES += tst_qstylesheetstyle.cpp
diff --git a/tests/auto/qtablewidget/qtablewidget.pro b/tests/auto/qtablewidget/qtablewidget.pro
index 2b2a016..d66d0ac 100644
--- a/tests/auto/qtablewidget/qtablewidget.pro
+++ b/tests/auto/qtablewidget/qtablewidget.pro
@@ -1,4 +1,16 @@
load(qttest_p4)
SOURCES += tst_qtablewidget.cpp
+# This prevents the GCCE compile failure: "elf2e32: Error 1063: Fatal Error in
+# PostLinker." The paged statement is documented in the S60 docs.
+symbian {
+ MMP_RULES -= PAGED
+
+ custom_paged_rule = "$${LITERAL_HASH}ifndef GCCE"\
+ "PAGED" \
+ "$${LITERAL_HASH}endif"
+ MMP_RULES += custom_paged_rule
+}
+
+symbian:MMP_RULES += "OPTION GCCE -mlong-calls"
diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
index da3f19a..cf16abb 100644
--- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
@@ -81,10 +81,8 @@
#ifndef TEST_QNETWORK_PROXY
//#define TEST_QNETWORK_PROXY
#endif
-#if defined(TEST_QNETWORK_PROXY) || defined (Q_CC_RVCT)
// RVCT compiles also unused inline methods
# include <QNetworkProxy>
-#endif
#ifdef Q_OS_LINUX
#include <stdio.h>
@@ -961,7 +959,11 @@ protected:
{
bool timedOut = false;
while (!quit) {
+#ifndef Q_OS_SYMBIAN
if (server->waitForNewConnection(500, &timedOut))
+#else
+ if (server->waitForNewConnection(5000, &timedOut))
+#endif
break;
if (!timedOut)
return;
@@ -972,7 +974,7 @@ protected:
#ifndef Q_OS_SYMBIAN
if (socket->waitForDisconnected(500))
#else
- if (socket->waitForDisconnected(1000))
+ if (socket->waitForDisconnected(5000))
#endif
break;
if (socket->error() != QAbstractSocket::SocketTimeoutError)
@@ -1024,7 +1026,7 @@ void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop()
#ifndef Q_OS_SYMBIAN
QVERIFY2(socket->waitForDisconnected(10000), "Network timeout");
#else
- QVERIFY2(socket->waitForDisconnected(20000), "Network timeout");
+ QVERIFY2(socket->waitForDisconnected(30000), "Network timeout");
#endif
QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
if (!closeDirectly) {
@@ -1035,7 +1037,7 @@ void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop()
delete socket;
// check if the other side received everything ok
- QVERIFY(thread.wait(10000));
+ QVERIFY(thread.wait(30000));
QVERIFY(thread.ok);
QCOMPARE(thread.receivedData, data);
}
@@ -1074,7 +1076,7 @@ void tst_QTcpSocket::disconnectWhileLookingUp()
#ifndef Q_OS_SYMBIAN
QTimer::singleShot(50, &loop, SLOT(quit()));
#else
- QTimer::singleShot(500, &loop, SLOT(quit()));
+ QTimer::singleShot(5000, &loop, SLOT(quit()));
#endif
loop.exec();
@@ -1181,7 +1183,7 @@ void tst_QTcpSocket::readLine()
char buffer[1024];
int expectedReplySize = QtNetworkSettings::expectedReplyIMAP().size();
- ASSERT(expectedReplySize >= 3);
+ Q_ASSERT(expectedReplySize >= 3);
QCOMPARE(socket->readLine(buffer, sizeof(buffer)), qint64(expectedReplySize));
QCOMPARE((int) buffer[expectedReplySize-2], (int) '\r');
@@ -1321,11 +1323,19 @@ void tst_QTcpSocket::dontCloseOnTimeout()
QTcpSocket *socket = newSocket();
socket->connectToHost(serverAddress, server.serverPort());
+#ifndef Q_OS_SYMBIAN
QVERIFY(!socket->waitForReadyRead(100));
+#else
+ QVERIFY(!socket->waitForReadyRead(5000));
+#endif
QCOMPARE(socket->error(), QTcpSocket::SocketTimeoutError);
QVERIFY(socket->isOpen());
+#ifndef Q_OS_SYMBIAN
QVERIFY(!socket->waitForDisconnected(100));
+#else
+ QVERIFY(!socket->waitForDisconnected(5000));
+#endif
QCOMPARE(socket->error(), QTcpSocket::SocketTimeoutError);
QVERIFY(socket->isOpen());
diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro
index bde990a..0f2a6ea 100644
--- a/tests/auto/qtemporaryfile/qtemporaryfile.pro
+++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro
@@ -2,4 +2,11 @@ load(qttest_p4)
SOURCES += tst_qtemporaryfile.cpp
QT = core
-DEFINES += SRCDIR=\\\"$$PWD/\\\"
+
+symbian {
+ testData.sources = tst_qtemporaryfile.cpp
+ testData.path = .
+ DEPLOYMENT += testData
+}else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
+}
diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
index 8cae64e..b9f1cc5 100644
--- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -59,6 +59,10 @@
# include <unistd.h> // close(2)
#endif
+#ifdef Q_OS_SYMBIAN
+#define SRCDIR ""
+#endif
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -77,6 +81,7 @@ private slots:
void fileTemplate_data();
void getSetCheck();
void fileName();
+ void fileNameIsEmpty();
void autoRemove();
void write();
void openCloseOpenClose();
@@ -86,6 +91,8 @@ private slots:
void stressTest();
void rename();
void renameFdLeak();
+ void reOpenThroughQFile();
+
public:
};
@@ -189,6 +196,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 +386,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 +430,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/qtessellator/testtessellator.cpp b/tests/auto/qtessellator/testtessellator.cpp
index bd2795c..423c1e8 100644
--- a/tests/auto/qtessellator/testtessellator.cpp
+++ b/tests/auto/qtessellator/testtessellator.cpp
@@ -38,7 +38,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <testtessellator.h>
+#include "testtessellator.h"
#include <private/qtessellator_p.h>
#include "math.h"
diff --git a/tests/auto/qtessellator/tst_tessellator.cpp b/tests/auto/qtessellator/tst_tessellator.cpp
index 8958ac3..8899285 100644
--- a/tests/auto/qtessellator/tst_tessellator.cpp
+++ b/tests/auto/qtessellator/tst_tessellator.cpp
@@ -218,8 +218,8 @@ void tst_QTessellator::testArc()
const int stop = 1000;
#endif
for (int i = 0; i < stop; ++i) {
- mat.rotate(.01);
- mat.scale(.99, .99);
+ mat.rotate(qreal(.01));
+ mat.scale(qreal(.99), qreal(.99));
QPolygonF poly = arc.at(0);
QPolygonF vec = poly * mat;
QVERIFY(test_arc(vec, true));
@@ -361,11 +361,11 @@ void tst_QTessellator::testRects()
QVector<QPointF> v(5);
for (int i = 0; i < 5; ++i)
v[i] = vec[5 * rect + i];
- if (!test(v.data(), v.size(), false, test_tessellate_polygon_rect, 0.05)) {
+ if (!test(v.data(), v.size(), false, test_tessellate_polygon_rect, qreal(0.05))) {
simplifyTestFailure(v, false);
++failures;
}
- if (!test(v.data(), v.size(), true, test_tessellate_polygon_rect, 0.05)) {
+ if (!test(v.data(), v.size(), true, test_tessellate_polygon_rect, qreal(0.05))) {
simplifyTestFailure(v, true);
++failures;
}
diff --git a/tests/auto/qtessellator/utils.cpp b/tests/auto/qtessellator/utils.cpp
index 8a9dc1e..d408193 100644
--- a/tests/auto/qtessellator/utils.cpp
+++ b/tests/auto/qtessellator/utils.cpp
@@ -43,7 +43,7 @@
#include <assert.h>
#include <qglobal.h>
-#include <qnum.h>
+#include "qnum.h"
#define FloatToXFixed(i) (int)((i) * 65536)
#define IntToXFixed(i) ((i) << 16)
diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/qtextcodec/tst_qtextcodec.cpp
index ff4b4bb..fa41f43 100644
--- a/tests/auto/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/qtextcodec/tst_qtextcodec.cpp
@@ -1537,7 +1537,7 @@ void tst_QTextCodec::utfHeaders_data()
<< QByteArray("\xef\xbb\xbfhello")
<< (QString(QChar(0xfeff)) + QString::fromLatin1("hello"))
<< true;
- QTest::newRow("utf8 nobom")
+ QTest::newRow("utf8 nobom ignore header")
<< QByteArray("UTF-8")
<< (int)QTextCodec::IgnoreHeader
<< QByteArray("hello")
@@ -1719,14 +1719,23 @@ void tst_QTextCodec::utfHeaders()
QFETCH(bool, toUnicode);
+ QLatin1String ignoreReverseTestOn = (QSysInfo::ByteOrder == QSysInfo::BigEndian) ? QLatin1String(" le") : QLatin1String(" be");
+ QString rowName(QTest::currentDataTag());
+
for (int i = 0; i < encoded.length(); ++i)
qDebug() << hex << " " << (uint)(uchar)encoded.at(i);
if (toUnicode) {
QString result = codec->toUnicode(encoded.constData(), encoded.length(), &state);
- for (int i = 0; i < result.length(); ++i)
- qDebug() << hex << " " << (uint)result.at(i).unicode();
+ for (int i = 0; i < result.length(); ++i)
+ qDebug() << hex << " " << (uint)result.at(i).unicode();
QCOMPARE(result.length(), unicode.length());
QCOMPARE(result, unicode);
+
+ if (!rowName.endsWith("nobom") && !rowName.contains(ignoreReverseTestOn)) {
+ QTextCodec::ConverterState state2(cFlags);
+ QByteArray reencoded = codec->fromUnicode(unicode.unicode(), unicode.length(), &state2);
+ QCOMPARE(reencoded, encoded);
+ }
} else {
QByteArray result = codec->fromUnicode(unicode.unicode(), unicode.length(), &state);
QCOMPARE(result, encoded);
diff --git a/tests/auto/qthreadonce/tst_qthreadonce.cpp b/tests/auto/qthreadonce/tst_qthreadonce.cpp
index 7e67dc3..f20788a 100644
--- a/tests/auto/qthreadonce/tst_qthreadonce.cpp
+++ b/tests/auto/qthreadonce/tst_qthreadonce.cpp
@@ -46,7 +46,7 @@
#include <qmutex.h>
#include <qthread.h>
#include <qwaitcondition.h>
-#include <qthreadonce.h>
+#include "qthreadonce.h"
//TESTED_CLASS=
//TESTED_FILES=corelib/thread/qthreadonce.h corelib/thread/qthreadonce.cpp
diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp
index 0051a9b..694ea33 100644
--- a/tests/auto/qtimer/tst_qtimer.cpp
+++ b/tests/auto/qtimer/tst_qtimer.cpp
@@ -146,6 +146,13 @@ void tst_QTimer::singleShotTimeout()
QCOMPARE(helper.count, 1);
}
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+// Increase wait as emulator startup can cause unexpected delays
+#define TIMEOUT_TIMEOUT 2000
+#else
+#define TIMEOUT_TIMEOUT 200
+#endif
+
void tst_QTimer::timeout()
{
TimerHelper helper;
@@ -156,11 +163,11 @@ void tst_QTimer::timeout()
QCOMPARE(helper.count, 0);
- QTest::qWait(200);
+ QTest::qWait(TIMEOUT_TIMEOUT);
QVERIFY(helper.count > 0);
int oldCount = helper.count;
- QTest::qWait(200);
+ QTest::qWait(TIMEOUT_TIMEOUT);
QVERIFY(helper.count > oldCount);
}
@@ -391,29 +398,38 @@ void tst_QTimer::deleteLaterOnQTimer()
QVERIFY(pointer.isNull());
}
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+// Increase wait as emulator startup can cause unexpected delays
+#define MOVETOTHREAD_TIMEOUT 200
+#define MOVETOTHREAD_WAIT 5000
+#else
+#define MOVETOTHREAD_TIMEOUT 200
+#define MOVETOTHREAD_WAIT 300
+#endif
+
void tst_QTimer::moveToThread()
{
QTimer ti1;
QTimer ti2;
- ti1.start(200);
- ti2.start(200);
+ ti1.start(MOVETOTHREAD_TIMEOUT);
+ ti2.start(MOVETOTHREAD_TIMEOUT);
QVERIFY((ti1.timerId() & 0xffffff) != (ti2.timerId() & 0xffffff));
QThread tr;
ti1.moveToThread(&tr);
connect(&ti1,SIGNAL(timeout()), &tr, SLOT(quit()));
tr.start();
QTimer ti3;
- ti3.start(200);
+ ti3.start(MOVETOTHREAD_TIMEOUT);
QVERIFY((ti3.timerId() & 0xffffff) != (ti2.timerId() & 0xffffff));
QVERIFY((ti3.timerId() & 0xffffff) != (ti1.timerId() & 0xffffff));
- QTest::qWait(300);
+ QTest::qWait(MOVETOTHREAD_WAIT);
QVERIFY(tr.wait());
ti2.stop();
QTimer ti4;
- ti4.start(200);
+ ti4.start(MOVETOTHREAD_TIMEOUT);
ti3.stop();
- ti2.start(200);
- ti3.start(200);
+ ti2.start(MOVETOTHREAD_TIMEOUT);
+ ti3.start(MOVETOTHREAD_TIMEOUT);
QVERIFY((ti4.timerId() & 0xffffff) != (ti2.timerId() & 0xffffff));
QVERIFY((ti3.timerId() & 0xffffff) != (ti2.timerId() & 0xffffff));
QVERIFY((ti3.timerId() & 0xffffff) != (ti1.timerId() & 0xffffff));
@@ -533,4 +549,4 @@ void tst_QTimer::timerFiresOnlyOncePerProcessEvents()
QTEST_MAIN(tst_QTimer)
#include "tst_qtimer.moc"
-\
+
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index 3612f2e..e7d548f 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -229,6 +229,7 @@ private slots:
void task238873_avoidAutoReopening();
void task244304_clickOnDecoration();
void task246536_scrollbarsNotWorking();
+ void task254234_proxySort();
};
class QtTestModel: public QAbstractItemModel
@@ -2503,7 +2504,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"));
-
}
/*
@@ -3282,5 +3282,32 @@ void tst_QTreeView::task246536_scrollbarsNotWorking()
QVERIFY(o.count > 0);
}
+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/auto/qtwidgets/tst_qtwidgets.cpp b/tests/auto/qtwidgets/tst_qtwidgets.cpp
index a6a3be1..6a79242 100644
--- a/tests/auto/qtwidgets/tst_qtwidgets.cpp
+++ b/tests/auto/qtwidgets/tst_qtwidgets.cpp
@@ -47,15 +47,28 @@
#include "mainwindow.h"
+#include "../network-settings.h"
class tst_QtWidgets: public QObject
{
Q_OBJECT
+public:
+ tst_QtWidgets();
+ virtual ~tst_QtWidgets();
+
private slots:
void snapshot();
};
+tst_QtWidgets::tst_QtWidgets()
+{
+ Q_SET_DEFAULT_IAP
+}
+
+tst_QtWidgets::~tst_QtWidgets()
+{
+}
void tst_QtWidgets::snapshot()
{
diff --git a/tests/auto/qudpsocket/tst_qudpsocket.cpp b/tests/auto/qudpsocket/tst_qudpsocket.cpp
index 621acbb..e9bf51b 100644
--- a/tests/auto/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/qudpsocket/tst_qudpsocket.cpp
@@ -853,4 +853,4 @@ void tst_QUdpSocket::zeroLengthDatagram()
}
QTEST_MAIN(tst_QUdpSocket)
-#include "test/tmp/tst_qudpsocket.moc"
+#include "tst_qudpsocket.moc"
diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp
index d15f9c8..9c9ff33 100644
--- a/tests/auto/qvariant/tst_qvariant.cpp
+++ b/tests/auto/qvariant/tst_qvariant.cpp
@@ -255,6 +255,7 @@ private slots:
void convertByteArrayToBool() const;
void convertByteArrayToBool_data() const;
void toIntFromQString() const;
+ void toIntFromDouble() const;
};
Q_DECLARE_METATYPE(QDate)
@@ -2909,5 +2910,30 @@ void tst_QVariant::toIntFromQString() const
QVERIFY(ok);
}
+/*!
+ We verify that:
+ 1. Conversion from (64 bit) double to int works (no overflow).
+ 2. Same conversion works for QVariant::convert.
+
+ Rationale: if 2147483630 is set in float and then converted to int,
+ there will be overflow and the result will be -2147483648.
+
+ See task 250267.
+ */
+void tst_QVariant::toIntFromDouble() const
+{
+ double d = 2147483630; // max int 2147483647
+ QVERIFY((int)d == 2147483630);
+
+ QVariant var(d);
+ QVERIFY( var.canConvert( QVariant::Int ) );
+
+ bool ok;
+ int result = var.toInt(&ok);
+
+ QVERIFY( ok == true );
+ QCOMPARE(result, 2147483630);
+}
+
QTEST_MAIN(tst_QVariant)
#include "tst_qvariant.moc"
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 8a181c6..95dc12b 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -8441,6 +8441,7 @@ void tst_QWidget::translucentWidget()
ColorRedWidget label;
label.setFixedSize(16,16);
label.setAttribute(Qt::WA_TranslucentBackground);
+ label.move(qApp->desktop()->availableGeometry().topLeft());
label.show();
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&label);
diff --git a/tests/auto/selftests/expected_skip.txt b/tests/auto/selftests/expected_skip.txt
index ba41e67..f3be5b5 100644
--- a/tests/auto/selftests/expected_skip.txt
+++ b/tests/auto/selftests/expected_skip.txt
@@ -7,7 +7,7 @@ SKIP : tst_Skip::emptytest() skipping all
Loc: [/home/fenglich/dev/qt-4.3/tests/auto/selftests/skip/tst_skip.cpp(45)]
SKIP : tst_Skip::singleSkip(local 1) skipping one
Loc: [/home/fenglich/dev/qt-4.3/tests/auto/selftests/skip/tst_skip.cpp(64)]
-this line should only be reached once (true)
+QDEBUG : tst_Skip::singleSkip(local 2) this line should only be reached once (true)
PASS : tst_Skip::singleSkip()
PASS : tst_Skip::cleanupTestCase()
Totals: 3 passed, 0 failed, 3 skipped
diff --git a/tests/auto/selftests/skip/tst_skip.cpp b/tests/auto/selftests/skip/tst_skip.cpp
index b1a3936..437cf62 100644
--- a/tests/auto/selftests/skip/tst_skip.cpp
+++ b/tests/auto/selftests/skip/tst_skip.cpp
@@ -70,7 +70,7 @@ void tst_Skip::test_data()
void tst_Skip::test()
{
- printf("this line should never be reached, since we skip in the _data function\n");
+ qDebug("this line should never be reached, since we skip in the _data function");
}
void tst_Skip::emptytest_data()
@@ -80,7 +80,7 @@ void tst_Skip::emptytest_data()
void tst_Skip::emptytest()
{
- printf("this line should never be reached, since we skip in the _data function\n");
+ qDebug("this line should never be reached, since we skip in the _data function");
}
void tst_Skip::singleSkip_data()
@@ -95,7 +95,7 @@ void tst_Skip::singleSkip()
QFETCH(bool, booll);
if (!booll)
QSKIP("skipping one", SkipSingle);
- printf("this line should only be reached once (%s)\n", booll ? "true" : "false");
+ qDebug("this line should only be reached once (%s)", booll ? "true" : "false");
}
QTEST_MAIN(tst_Skip)
diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp
index 103fd79..6776b12 100644
--- a/tests/auto/selftests/tst_selftests.cpp
+++ b/tests/auto/selftests/tst_selftests.cpp
@@ -295,6 +295,11 @@ void tst_Selftests::initTestCase()
m_checkXMLBlacklist.append("differentexec");
m_checkXMLBlacklist.append("qexecstringlist");
m_checkXMLBlacklist.append("benchliboptions");
+
+ /* These tests use printf and therefore corrupt the testlog */
+ m_checkXMLBlacklist.append("subtest");
+ m_checkXMLBlacklist.append("globaldata");
+ m_checkXMLBlacklist.append("warnings");
}
void tst_Selftests::checkXML() const
diff --git a/tests/auto/symbian/orientationchange/orientationchange.pro b/tests/auto/symbian/orientationchange/orientationchange.pro
new file mode 100644
index 0000000..d240fa1
--- /dev/null
+++ b/tests/auto/symbian/orientationchange/orientationchange.pro
@@ -0,0 +1,7 @@
+load(qttest_p4)
+HEADERS +=
+SOURCES += tst_orientationchange.cpp
+
+symbian {
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+}
diff --git a/tests/auto/symbian/orientationchange/tst_orientationchange.cpp b/tests/auto/symbian/orientationchange/tst_orientationchange.cpp
new file mode 100644
index 0000000..9d57ae1
--- /dev/null
+++ b/tests/auto/symbian/orientationchange/tst_orientationchange.cpp
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** 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>
+
+#ifdef Q_OS_SYMBIAN
+
+#include <eikenv.h>
+#include <aknappui.h>
+
+class tst_orientationchange : public QObject
+{
+ Q_OBJECT
+public:
+ tst_orientationchange(){};
+ ~tst_orientationchange(){};
+
+private slots:
+ void resizeEventOnOrientationChange();
+};
+
+class TestWidget : public QWidget
+{
+public:
+ TestWidget(QWidget *parent = 0);
+
+ void reset();
+public:
+ void resizeEvent(QResizeEvent *event);
+
+public:
+ QSize resizeEventSize;
+ int resizeEventCount;
+};
+
+TestWidget::TestWidget(QWidget *parent)
+: QWidget(parent)
+{
+ reset();
+}
+
+void TestWidget::reset()
+{
+ resizeEventSize = QSize();
+ resizeEventCount = 0;
+}
+
+void TestWidget::resizeEvent(QResizeEvent *event)
+{
+ QWidget::resizeEvent(event);
+
+ // Size delivered in first resize event is stored.
+ if (!resizeEventCount)
+ resizeEventSize = event->size();
+
+ resizeEventCount++;
+}
+
+void tst_orientationchange::resizeEventOnOrientationChange()
+{
+ // This will test that when orientation 'changes', then
+ // at most one resize event is generated.
+
+ TestWidget *normalWidget = new TestWidget();
+ TestWidget *fullScreenWidget = new TestWidget();
+ TestWidget *maximizedWidget = new TestWidget();
+
+ fullScreenWidget->showFullScreen();
+ maximizedWidget->showMaximized();
+ normalWidget->show();
+
+ QCoreApplication::sendPostedEvents();
+ QCoreApplication::sendPostedEvents();
+
+ QCOMPARE(fullScreenWidget->resizeEventCount, 1);
+ QCOMPARE(fullScreenWidget->size(), fullScreenWidget->resizeEventSize);
+ QCOMPARE(maximizedWidget->resizeEventCount, 1);
+ QCOMPARE(maximizedWidget->size(), maximizedWidget->resizeEventSize);
+ QCOMPARE(normalWidget->resizeEventCount, 1);
+ QCOMPARE(normalWidget->size(), normalWidget->resizeEventSize);
+
+ fullScreenWidget->reset();
+ maximizedWidget->reset();
+ normalWidget->reset();
+
+ // Assumes that Qt application is AVKON application.
+ CAknAppUi *appUi = static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi());
+
+ // Determine 'opposite' orientation to the current orientation.
+
+ CAknAppUi::TAppUiOrientation orientation = CAknAppUi::EAppUiOrientationLandscape;
+ if (fullScreenWidget->size().width() > fullScreenWidget->size().height()) {
+ orientation = CAknAppUi::EAppUiOrientationPortrait;
+ }
+
+ TRAPD(err, appUi->SetOrientationL(orientation));
+
+ QCoreApplication::sendPostedEvents();
+ QCoreApplication::sendPostedEvents();
+
+ // setOrientationL is not guaranteed to change orientation
+ // (if emulator configured to support just portrait or landscape, then
+ // setOrientationL call shouldn't do anything).
+ // So let's ensure that we do not get resize event twice.
+
+ QVERIFY(fullScreenWidget->resizeEventCount <= 1);
+ if (fullScreenWidget->resizeEventCount) {
+ QCOMPARE(fullScreenWidget->size(), fullScreenWidget->resizeEventSize);
+ }
+ QVERIFY(maximizedWidget->resizeEventCount <= 1);
+ if (fullScreenWidget->resizeEventCount) {
+ QCOMPARE(maximizedWidget->size(), maximizedWidget->resizeEventSize);
+ }
+ QCOMPARE(normalWidget->resizeEventCount, 0);
+
+ TRAP(err, appUi->SetOrientationL(CAknAppUi::EAppUiOrientationUnspecified));
+
+ delete normalWidget;
+ delete fullScreenWidget;
+ delete maximizedWidget;
+}
+
+QTEST_MAIN(tst_orientationchange)
+#include "tst_orientationchange.moc"
+#else
+QTEST_NOOP_MAIN
+#endif
diff --git a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp
index 103dd62..adad544 100644
--- a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp
+++ b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp
@@ -40,21 +40,38 @@
****************************************************************************/
#include <QtTest/QtTest>
+#include <e32base.h>
#ifdef Q_OS_SYMBIAN
+typedef void TLeavingFunc();
+
class tst_qmainexceptions : public QObject
{
Q_OBJECT
public:
tst_qmainexceptions(){};
~tst_qmainexceptions(){};
+
+ void TestSchedulerCatchesError(TLeavingFunc* f, int error);
+ void TestSymbianRoundTrip(int leave, int trap);
+
+ bool event(QEvent *event);
+
public slots:
void initTestCase();
private slots:
void trap();
void cleanupstack();
void leave();
+ void testTranslateBadAlloc();
+ void testTranslateBigAlloc();
+ void testRoundTrip();
+ void testTrap();
+ void testPropagation();
+ void testDtor1();
+ void testDtor2();
+ void testNestedExceptions();
};
class CDummy : public CBase
@@ -84,6 +101,7 @@ void tst_qmainexceptions::cleanupstack()
CleanupStack::PopAndDestroy(dummy1);
__UHEAP_MARKEND;
}
+
void tst_qmainexceptions::leave()
{
__UHEAP_MARK;
@@ -92,14 +110,206 @@ void tst_qmainexceptions::leave()
CDummy* csDummy = new (ELeave) CDummy;
CleanupStack::PushL(csDummy);
__UHEAP_FAILNEXT(1);
- dummy1 = new (ELeave) CDummy;
+ dummy1 = new (ELeave) CDummy;
//CleanupStack::PopAndDestroy(csDummy); not executed as previous line throws
});
QCOMPARE(err,KErrNoMemory);
- QVERIFY(!((int)dummy1));
+ QVERIFY(!((int)dummy1));
+ __UHEAP_MARKEND;
+}
+
+class CTestActive : public CActive
+{
+public:
+ CTestActive(TLeavingFunc* aFunc) : CActive(EPriorityStandard), iFunc(aFunc)
+ {
+ CActiveScheduler::Add(this);
+ }
+ ~CTestActive()
+ {
+ Cancel();
+ }
+ void DoCancel() {}
+ void Test()
+ {
+ // complete this AO in a nested scheduler, to make it synchronous
+ TRequestStatus* s = &iStatus;
+ SetActive();
+ User::RequestComplete(s, KErrNone);
+ CActiveScheduler::Start();
+ }
+ void RunL()
+ {
+ (*iFunc)();
+ CActiveScheduler::Stop(); // will only get here if iFunc does not leave
+ }
+ TInt RunError(TInt aError)
+ {
+ error = aError;
+ CActiveScheduler::Stop(); // will only get here if iFunc leaves
+ return KErrNone;
+ }
+public:
+ TLeavingFunc* iFunc;
+ int error;
+};
+
+void tst_qmainexceptions::TestSchedulerCatchesError(TLeavingFunc* f, int error)
+{
+ CTestActive *act = new(ELeave) CTestActive(f);
+ act->Test();
+ QCOMPARE(act->error, error);
+ delete act;
+}
+
+void ThrowBadAlloc()
+{
+ throw std::bad_alloc();
+}
+
+void TranslateThrowBadAllocL()
+{
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(ThrowBadAlloc());
+}
+
+void tst_qmainexceptions::testTranslateBadAlloc()
+{
+ // bad_alloc should give KErrNoMemory in an AO
+ TestSchedulerCatchesError(&TranslateThrowBadAllocL, KErrNoMemory);
+}
+
+void BigAlloc()
+{
+ int *x = new int[100000000];
+ delete [] x;
+}
+
+void TranslateBigAllocL()
+{
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(BigAlloc());
+}
+
+void tst_qmainexceptions::testTranslateBigAlloc()
+{
+ // this test will fail if new does not throw on failure, otherwise should give KErrNoMemory in AO
+ TestSchedulerCatchesError(&TranslateBigAllocL, KErrNoMemory);
+}
+
+void tst_qmainexceptions::TestSymbianRoundTrip(int leave, int trap)
+{
+ // check that leave converted to exception, converted to error gives expected error code
+ int trapped;
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(
+ trapped,
+ QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(
+ User::LeaveIfError(leave)));
+ QCOMPARE(trap, trapped);
+}
+
+void tst_qmainexceptions::testRoundTrip()
+{
+ for (int e=-50; e<0; e++)
+ TestSymbianRoundTrip(e, e);
+ TestSymbianRoundTrip(KErrNone, KErrNone);
+ // positive error codes are not errors
+ TestSymbianRoundTrip(1, KErrNone);
+ TestSymbianRoundTrip(1000000000, KErrNone);
+}
+
+void tst_qmainexceptions::testTrap()
+{
+ // testing qt_translateExceptionToSymbianErrorL
+ TRAPD(err, qt_translateExceptionToSymbianErrorL(std::bad_alloc()));
+ QCOMPARE(err, KErrNoMemory);
+}
+
+bool tst_qmainexceptions::event(QEvent *aEvent)
+{
+ if (aEvent->type() == QEvent::User+1)
+ throw std::bad_alloc();
+ else if (aEvent->type() == QEvent::User+2) {
+ QEvent event(QEvent::Type(QEvent::User+1));
+ QApplication::sendEvent(this, &event);
+ }
+ return QObject::event(aEvent);
+}
+
+void tst_qmainexceptions::testPropagation()
+{
+ // test exception thrown from event is propagated back to sender
+ QEvent event(QEvent::Type(QEvent::User+1));
+ bool caught = false;
+ try {
+ QApplication::sendEvent(this, &event);
+ } catch (const std::bad_alloc&) {
+ caught = true;
+ }
+ QCOMPARE(caught, true);
+
+ // testing nested events propagate back to top level sender
+ caught = false;
+ QEvent event2(QEvent::Type(QEvent::User+2));
+ try {
+ QApplication::sendEvent(this, &event2);
+ } catch (const std::bad_alloc&) {
+ caught = true;
+ }
+ QCOMPARE(caught, true);
+}
+
+void tst_qmainexceptions::testDtor1()
+{
+ // destructors work on exception
+ int i = 0;
+ struct SAutoInc {
+ SAutoInc(int& aI) : i(aI) { ++i; }
+ ~SAutoInc() { --i; }
+ int &i;
+ } ai(i);
+ QCOMPARE(i, 1);
+ try {
+ SAutoInc ai2(i);
+ QCOMPARE(i, 2);
+ throw std::bad_alloc();
+ QFAIL("should not get here");
+ } catch (const std::bad_alloc&) {
+ QCOMPARE(i, 1);
+ }
+ QCOMPARE(i, 1);
+}
+
+void tst_qmainexceptions::testDtor2()
+{
+ // memory is cleaned up correctly on exception
+ // this crashes with winscw compiler build < 481
+ __UHEAP_MARK;
+ try {
+ QString str("abc");
+ str += "def";
+ throw std::bad_alloc();
+ QFAIL("should not get here");
+ } catch (const std::bad_alloc&) { }
__UHEAP_MARKEND;
}
+void tst_qmainexceptions::testNestedExceptions()
+{
+ // throwing exceptions while handling exceptions
+ struct Oops {
+ Oops* next;
+ Oops(int level) : next(level > 0 ? new Oops(level-1) : 0) {}
+ ~Oops() {
+ try { throw std::bad_alloc(); }
+ catch (const std::exception&) {delete next;}
+ }
+ };
+ try {
+ Oops oops(5);
+ throw std::bad_alloc();
+ }
+ catch (const std::exception&) {}
+}
+
QTEST_MAIN(tst_qmainexceptions)
#include "tst_qmainexceptions.moc"
diff --git a/tests/auto/symbian/qsymbiantests.pro b/tests/auto/symbian/qsymbiantests.pro
index 151d7ec..648335e 100644
--- a/tests/auto/symbian/qsymbiantests.pro
+++ b/tests/auto/symbian/qsymbiantests.pro
@@ -1,2 +1,2 @@
TEMPLATE = subdirs
-SUBDIRS = qmainexceptions \ No newline at end of file
+SUBDIRS = qmainexceptions orientationchange \ No newline at end of file
diff --git a/tests/auto/utf8/tst_utf8.cpp b/tests/auto/utf8/tst_utf8.cpp
index 3aef69f..e21e5a3 100644
--- a/tests/auto/utf8/tst_utf8.cpp
+++ b/tests/auto/utf8/tst_utf8.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** 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.
diff --git a/tools/assistant/lib/fulltextsearch/qclucene_global_p.h b/tools/assistant/lib/fulltextsearch/qclucene_global_p.h
index 2a9d146..3dba45a 100644
--- a/tools/assistant/lib/fulltextsearch/qclucene_global_p.h
+++ b/tools/assistant/lib/fulltextsearch/qclucene_global_p.h
@@ -29,6 +29,14 @@
#include <QtCore/QChar>
#include <QtCore/QString>
+#if !defined(_MSC_VER) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T)
+# if !defined(TCHAR)
+# define TCHAR wchar_t
+# endif
+#else
+# include <windows.h>
+#endif
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -87,14 +95,6 @@ QT_BEGIN_NAMESPACE
# define CL_NS2(sub,sub2)
#endif
-#if !defined(_MSC_VER) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T)
-# if !defined(TCHAR)
-# define TCHAR wchar_t
-# endif
-#else
-# include <windows.h>
-#endif
-
namespace {
TCHAR* QStringToTChar(const QString &str)
{
diff --git a/tools/assistant/lib/qhelpdbreader.cpp b/tools/assistant/lib/qhelpdbreader.cpp
index 76994a7..27bc4d7 100644
--- a/tools/assistant/lib/qhelpdbreader.cpp
+++ b/tools/assistant/lib/qhelpdbreader.cpp
@@ -92,6 +92,9 @@ bool QHelpDBReader::init()
QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), m_uniqueId);
db.setDatabaseName(m_dbName);
if (!db.open()) {
+ /*: The placeholders are: %1 - The name of the database which cannot be opened
+ %2 - The unique id for the connection
+ %3 - The actual error string */
m_error = tr("Cannot open database '%1' '%2': %3").arg(m_dbName, m_uniqueId, db.lastError().text());
QSqlDatabase::removeDatabase(m_uniqueId);
return false;
diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp
index 6f5732f..66475a4 100644
--- a/tools/assistant/tools/assistant/bookmarkmanager.cpp
+++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp
@@ -536,58 +536,57 @@ void BookmarkWidget::focusInEvent(QFocusEvent *e)
bool BookmarkWidget::eventFilter(QObject *object, QEvent *e)
{
- if (object == this && e->type() == QEvent::KeyPress) {
- QKeyEvent *ke = static_cast<QKeyEvent*>(e);
+ if ((object == this) || (object == treeView->viewport())) {
QModelIndex index = treeView->currentIndex();
- switch (ke->key()) {
+ if (e->type() == QEvent::KeyPress) {
+ QKeyEvent *ke = static_cast<QKeyEvent*>(e);
if (index.isValid() && searchField->text().isEmpty()) {
- case Qt::Key_F2: {
- const QModelIndex& source = filterBookmarkModel->mapToSource(index);
- QStandardItem *item =
- bookmarkManager->treeBookmarkModel()->itemFromIndex(source);
+ if (ke->key() == Qt::Key_F2) {
+ QStandardItem *item = bookmarkManager->treeBookmarkModel()
+ ->itemFromIndex(filterBookmarkModel->mapToSource(index));
if (item) {
item->setEditable(true);
treeView->edit(index);
item->setEditable(false);
}
- } break;
-
- case Qt::Key_Delete: {
+ } else if (ke->key() == Qt::Key_Delete) {
bookmarkManager->removeBookmarkItem(treeView,
filterBookmarkModel->mapToSource(index));
- } break;
+ }
}
- case Qt::Key_Up:
- case Qt::Key_Down:
- treeView->subclassKeyPressEvent(ke);
- break;
-
- case Qt::Key_Enter: {
- case Qt::Key_Return:
- index = treeView->selectionModel()->currentIndex();
- if (index.isValid()) {
- QString data = index.data(Qt::UserRole + 10).toString();
- if (!data.isEmpty() && data != QLatin1String("Folder"))
- emit requestShowLink(data);
- }
- } break;
+ switch (ke->key()) {
+ default: break;
+ case Qt::Key_Up: {
+ case Qt::Key_Down:
+ treeView->subclassKeyPressEvent(ke);
+ } break;
- case Qt::Key_Escape:
- emit escapePressed();
- break;
+ case Qt::Key_Enter: {
+ case Qt::Key_Return:
+ index = treeView->selectionModel()->currentIndex();
+ if (index.isValid()) {
+ QString data = index.data(Qt::UserRole + 10).toString();
+ if (!data.isEmpty() && data != QLatin1String("Folder"))
+ emit requestShowLink(data);
+ }
+ } break;
- default:
- break;
- }
- }
- else if (object == treeView->viewport() && e->type() == QEvent::MouseButtonRelease) {
- const QModelIndex& index = treeView->currentIndex();
- QMouseEvent *me = static_cast<QMouseEvent*>(e);
- if (index.isValid() && (me->button() == Qt::MidButton)) {
- QString data = index.data(Qt::UserRole + 10).toString();
- if (!data.isEmpty() && data != QLatin1String("Folder"))
- CentralWidget::instance()->setSourceInNewTab(data);
+ case Qt::Key_Escape: {
+ emit escapePressed();
+ } break;
+ }
+ } else if (e->type() == QEvent::MouseButtonRelease) {
+ if (index.isValid()) {
+ QMouseEvent *me = static_cast<QMouseEvent*>(e);
+ bool controlPressed = me->modifiers() & Qt::ControlModifier;
+ if(((me->button() == Qt::LeftButton) && controlPressed)
+ || (me->button() == Qt::MidButton)) {
+ QString data = index.data(Qt::UserRole + 10).toString();
+ if (!data.isEmpty() && data != QLatin1String("Folder"))
+ CentralWidget::instance()->setSourceInNewTab(data);
+ }
+ }
}
}
return QWidget::eventFilter(object, e);
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/contentwindow.cpp b/tools/assistant/tools/assistant/contentwindow.cpp
index 89060bd..9f39de5 100644
--- a/tools/assistant/tools/assistant/contentwindow.cpp
+++ b/tools/assistant/tools/assistant/contentwindow.cpp
@@ -124,10 +124,10 @@ bool ContentWindow::eventFilter(QObject *o, QEvent *e)
QModelIndex index = m_contentWidget->indexAt(me->pos());
QItemSelectionModel *sm = m_contentWidget->selectionModel();
+ Qt::MouseButtons button = me->button();
if (index.isValid() && (sm && sm->isSelected(index))) {
- if (me->button() == Qt::LeftButton) {
- itemClicked(index);
- } else if (me->button() == Qt::MidButton) {
+ if ((button == Qt::LeftButton && (me->modifiers() & Qt::ControlModifier))
+ || (button == Qt::MidButton)) {
QHelpContentModel *contentModel =
qobject_cast<QHelpContentModel*>(m_contentWidget->model());
if (contentModel) {
@@ -135,12 +135,15 @@ bool ContentWindow::eventFilter(QObject *o, QEvent *e)
if (itm && !isPdfFile(itm))
CentralWidget::instance()->setSourceInNewTab(itm->url());
}
+ } else if (button == Qt::LeftButton) {
+ itemClicked(index);
}
}
}
return QWidget::eventFilter(o, e);
}
+
void ContentWindow::showContextMenu(const QPoint &pos)
{
if (!m_contentWidget->indexAt(pos).isValid())
diff --git a/tools/assistant/tools/assistant/indexwindow.cpp b/tools/assistant/tools/assistant/indexwindow.cpp
index a2c0950..1117ae0 100644
--- a/tools/assistant/tools/assistant/indexwindow.cpp
+++ b/tools/assistant/tools/assistant/indexwindow.cpp
@@ -146,8 +146,13 @@ bool IndexWindow::eventFilter(QObject *obj, QEvent *e)
&& e->type() == QEvent::MouseButtonRelease) {
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(e);
QModelIndex idx = m_indexWidget->indexAt(mouseEvent->pos());
- if (idx.isValid() && mouseEvent->button()==Qt::MidButton)
- open(m_indexWidget, idx);
+ if (idx.isValid()) {
+ Qt::MouseButtons button = mouseEvent->button();
+ if (((button == Qt::LeftButton) && (mouseEvent->modifiers() & Qt::ControlModifier))
+ || (button == Qt::MidButton)) {
+ open(m_indexWidget, idx);
+ }
+ }
}
#ifdef Q_OS_MAC
else if (obj == m_indexWidget && e->type() == QEvent::KeyPress) {
diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp
index b0c2c6b..582eef3 100644
--- a/tools/assistant/tools/assistant/mainwindow.cpp
+++ b/tools/assistant/tools/assistant/mainwindow.cpp
@@ -926,25 +926,27 @@ void MainWindow::expandTOC(int depth)
void MainWindow::indexingStarted()
{
- m_progressWidget = new QWidget();
- QLayout* hlayout = new QHBoxLayout(m_progressWidget);
+ if (!m_progressWidget) {
+ m_progressWidget = new QWidget();
+ QLayout* hlayout = new QHBoxLayout(m_progressWidget);
- QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
+ QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
- QLabel *label = new QLabel(tr("Updating search index"));
- label->setSizePolicy(sizePolicy);
- hlayout->addWidget(label);
+ QLabel *label = new QLabel(tr("Updating search index"));
+ label->setSizePolicy(sizePolicy);
+ hlayout->addWidget(label);
- QProgressBar *progressBar = new QProgressBar();
- progressBar->setRange(0, 0);
- progressBar->setTextVisible(false);
- progressBar->setSizePolicy(sizePolicy);
+ QProgressBar *progressBar = new QProgressBar();
+ progressBar->setRange(0, 0);
+ progressBar->setTextVisible(false);
+ progressBar->setSizePolicy(sizePolicy);
- hlayout->setSpacing(6);
- hlayout->setMargin(0);
- hlayout->addWidget(progressBar);
+ hlayout->setSpacing(6);
+ hlayout->setMargin(0);
+ hlayout->addWidget(progressBar);
- statusBar()->addPermanentWidget(m_progressWidget);
+ statusBar()->addPermanentWidget(m_progressWidget);
+ }
}
void MainWindow::indexingFinished()
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 a879e5d..945a0f0 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -1381,6 +1381,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";
@@ -1404,10 +1405,10 @@ void Configure::applySpecSpecifics()
dictionary[ "FREETYPE" ] = "no";
dictionary[ "QT3SUPPORT" ] = "no";
dictionary[ "OPENGL" ] = "no";
- dictionary[ "OPENSSL" ] = "no";
- dictionary[ "STL" ] = "no";
- dictionary[ "EXCEPTIONS" ] = "no";
- dictionary[ "RTTI" ] = "no";
+ dictionary[ "OPENSSL" ] = "yes";
+ dictionary[ "STL" ] = "yes";
+ dictionary[ "EXCEPTIONS" ] = "yes";
+ dictionary[ "RTTI" ] = "yes";
dictionary[ "ARCHITECTURE" ] = "symbian";
dictionary[ "3DNOW" ] = "no";
dictionary[ "SSE" ] = "no";
@@ -1428,7 +1429,9 @@ void Configure::applySpecSpecifics()
dictionary[ "QT_HOST_PREFIX" ] = dictionary[ "QT_INSTALL_PREFIX" ];
dictionary[ "QT_INSTALL_PREFIX" ] = "";
dictionary[ "QT_INSTALL_PLUGINS" ] = "\\resource\\qt\\plugins";
- dictionary[ "ARM_FPU_TYPE" ] = "softvfp";
+ dictionary[ "ARM_FPU_TYPE" ] = "softvfp";
+ dictionary[ "SQL_SQLITE" ] = "yes";
+ dictionary[ "SQL_SQLITE_LIB" ] = "system";
} else if(dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong.
//TODO
@@ -3644,12 +3647,15 @@ void Configure::readLicense()
dictionary["PLATFORM NAME"] = "Qt for S60";
else
dictionary["PLATFORM NAME"] = "Qt for Windows";
+ dictionary["LICENSE FILE"] = sourcePath;
+
bool openSource = false;
+ bool hasOpenSource = QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.GPL3") || QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.LGPL");
if (dictionary["BUILDNOKIA"] == "yes" || dictionary["BUILDTYPE"] == "commercial") {
openSource = false;
} else if (dictionary["BUILDTYPE"] == "opensource") {
openSource = true;
- } else {
+ } else if (hasOpenSource) { // No Open Source? Just display the commercial license right away
forever {
char accept = '?';
cout << "Which edition of Qt do you want to use ?" << endl;
@@ -3667,28 +3673,23 @@ void Configure::readLicense()
}
}
}
- if (openSource) {
- dictionary["LICENSE FILE"] = sourcePath;
- if (QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.GPL3") || QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.LGPL")) {
- cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl;
- licenseInfo["LICENSEE"] = "Open Source";
- dictionary["EDITION"] = "OpenSource";
- dictionary["QT_EDITION"] = "QT_EDITION_OPENSOURCE";
- cout << endl;
- if (!showLicense(dictionary["LICENSE FILE"])) {
- cout << "Configuration aborted since license was not accepted";
- dictionary["DONE"] = "error";
- return;
- }
+ if (hasOpenSource && openSource) {
+ cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl;
+ licenseInfo["LICENSEE"] = "Open Source";
+ dictionary["EDITION"] = "OpenSource";
+ dictionary["QT_EDITION"] = "QT_EDITION_OPENSOURCE";
+ cout << endl;
+ if (!showLicense(dictionary["LICENSE FILE"])) {
+ cout << "Configuration aborted since license was not accepted";
+ dictionary["DONE"] = "error";
return;
}
-#ifndef COMMERCIAL_VERSION
- else {
- cout << endl << "Cannot find the GPL license files!" << endl;
+ } else if (openSource) {
+ cout << endl << "Cannot find the GPL license files! Please download the Open Source version of the library." << endl;
dictionary["DONE"] = "error";
}
-#else
- } else {
+#ifdef COMMERCIAL_VERSION
+ else {
Tools::checkLicense(dictionary, licenseInfo, firstLicensePath());
if (dictionary["DONE"] != "error" && dictionary["BUILDNOKIA"] != "yes") {
// give the user some feedback, and prompt for license acceptance
@@ -3700,7 +3701,12 @@ void Configure::readLicense()
}
}
}
-#endif // COMMERCIAL_VERSION
+#else // !COMMERCIAL_VERSION
+ else {
+ cout << endl << "Cannot build commercial edition from the open source version of the library." << endl;
+ dictionary["DONE"] = "error";
+ }
+#endif
}
void Configure::reloadCmdLine()
diff --git a/tools/designer/src/components/formeditor/brushmanagerproxy.cpp b/tools/designer/src/components/formeditor/brushmanagerproxy.cpp
index b1c056e..86880f3 100644
--- a/tools/designer/src/components/formeditor/brushmanagerproxy.cpp
+++ b/tools/designer/src/components/formeditor/brushmanagerproxy.cpp
@@ -146,14 +146,12 @@ QString BrushManagerProxyPrivate::uniqueBrushFileName(const QString &brushName)
BrushManagerProxy::BrushManagerProxy(QDesignerFormEditorInterface *core, QObject *parent)
- : QObject(parent)
+ : QObject(parent), d_ptr(new BrushManagerProxyPrivate(this, core))
{
- d_ptr = new BrushManagerProxyPrivate(this, core);
}
BrushManagerProxy::~BrushManagerProxy()
{
- delete d_ptr;
}
void BrushManagerProxy::setBrushManager(QtBrushManager *manager)
diff --git a/tools/designer/src/components/formeditor/brushmanagerproxy.h b/tools/designer/src/components/formeditor/brushmanagerproxy.h
index cbe50ae..43bcf29 100644
--- a/tools/designer/src/components/formeditor/brushmanagerproxy.h
+++ b/tools/designer/src/components/formeditor/brushmanagerproxy.h
@@ -63,7 +63,7 @@ public:
void setBrushManager(QtBrushManager *manager);
private:
- BrushManagerProxyPrivate *d_ptr;
+ QScopedPointer<BrushManagerProxyPrivate> d_ptr;
Q_DECLARE_PRIVATE(BrushManagerProxy)
Q_DISABLE_COPY(BrushManagerProxy)
Q_PRIVATE_SLOT(d_func(), void brushAdded(const QString &, const QBrush &))
diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.cpp b/tools/designer/src/components/formeditor/qdesigner_resource.cpp
index 75a53b7..064da9b 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
diff --git a/tools/designer/src/components/formeditor/qtbrushmanager.cpp b/tools/designer/src/components/formeditor/qtbrushmanager.cpp
index c28c6b9..3ac9851 100644
--- a/tools/designer/src/components/formeditor/qtbrushmanager.cpp
+++ b/tools/designer/src/components/formeditor/qtbrushmanager.cpp
@@ -57,16 +57,13 @@ public:
};
QtBrushManager::QtBrushManager(QObject *parent)
- : QDesignerBrushManagerInterface(parent)
+ : QDesignerBrushManagerInterface(parent), d_ptr(new QtBrushManagerPrivate)
{
- d_ptr = new QtBrushManagerPrivate;
d_ptr->q_ptr = this;
-
}
QtBrushManager::~QtBrushManager()
{
- delete d_ptr;
}
QBrush QtBrushManager::brush(const QString &name) const
diff --git a/tools/designer/src/components/formeditor/qtbrushmanager.h b/tools/designer/src/components/formeditor/qtbrushmanager.h
index f8f1b8a..0855175 100644
--- a/tools/designer/src/components/formeditor/qtbrushmanager.h
+++ b/tools/designer/src/components/formeditor/qtbrushmanager.h
@@ -77,7 +77,7 @@ signals:
void currentBrushChanged(const QString &name, const QBrush &brush);
private:
- QtBrushManagerPrivate *d_ptr;
+ QScopedPointer<QtBrushManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtBrushManager)
Q_DISABLE_COPY(QtBrushManager)
};
diff --git a/tools/designer/src/lib/shared/iconselector.cpp b/tools/designer/src/lib/shared/iconselector.cpp
index 02a3dee..302a077 100644
--- a/tools/designer/src/lib/shared/iconselector.cpp
+++ b/tools/designer/src/lib/shared/iconselector.cpp
@@ -157,7 +157,6 @@ LanguageResourceDialog::LanguageResourceDialog(QDesignerResourceBrowserInterface
LanguageResourceDialog::~LanguageResourceDialog()
{
- delete d_ptr;
}
void LanguageResourceDialog::setCurrentPath(const QString &filePath)
@@ -427,9 +426,8 @@ void IconSelectorPrivate::slotResetAllActivated()
// ------------- IconSelector
IconSelector::IconSelector(QWidget *parent) :
- QWidget(parent)
+ QWidget(parent), d_ptr(new IconSelectorPrivate())
{
- d_ptr = new IconSelectorPrivate();
d_ptr->q_ptr = this;
d_ptr->m_stateComboBox = new QComboBox(this);
@@ -500,7 +498,6 @@ IconSelector::IconSelector(QWidget *parent) :
IconSelector::~IconSelector()
{
- delete d_ptr;
}
void IconSelector::setIcon(const PropertySheetIconValue &icon)
diff --git a/tools/designer/src/lib/shared/iconselector_p.h b/tools/designer/src/lib/shared/iconselector_p.h
index 6b70cd2..de4c54f 100644
--- a/tools/designer/src/lib/shared/iconselector_p.h
+++ b/tools/designer/src/lib/shared/iconselector_p.h
@@ -87,7 +87,7 @@ public:
QString currentPath() const;
private:
- class LanguageResourceDialogPrivate *d_ptr;
+ QScopedPointer<class LanguageResourceDialogPrivate> d_ptr;
Q_DECLARE_PRIVATE(LanguageResourceDialog)
Q_DISABLE_COPY(LanguageResourceDialog)
Q_PRIVATE_SLOT(d_func(), void slotAccepted())
@@ -120,7 +120,7 @@ public:
signals:
void iconChanged(const PropertySheetIconValue &icon);
private:
- class IconSelectorPrivate *d_ptr;
+ QScopedPointer<class IconSelectorPrivate> d_ptr;
Q_DECLARE_PRIVATE(IconSelector)
Q_DISABLE_COPY(IconSelector)
diff --git a/tools/designer/src/lib/shared/qtresourceeditordialog.cpp b/tools/designer/src/lib/shared/qtresourceeditordialog.cpp
index adddf72..bd6be95 100644
--- a/tools/designer/src/lib/shared/qtresourceeditordialog.cpp
+++ b/tools/designer/src/lib/shared/qtresourceeditordialog.cpp
@@ -1949,9 +1949,8 @@ bool QtResourceEditorDialogPrivate::saveQrcFile(const QtQrcFileData &qrcFileData
}
QtResourceEditorDialog::QtResourceEditorDialog(QDesignerFormEditorInterface *core, QDesignerDialogGuiInterface *dlgGui, QWidget *parent)
- : QDialog(parent)
+ : QDialog(parent), d_ptr(new QtResourceEditorDialogPrivate())
{
- d_ptr = new QtResourceEditorDialogPrivate();
d_ptr->q_ptr = this;
d_ptr->m_ui.setupUi(this);
d_ptr->m_qrcManager = new QtQrcManager(this);
@@ -2085,8 +2084,6 @@ QtResourceEditorDialog::~QtResourceEditorDialog()
settings->setValue(QLatin1String(SplitterPosition), d_ptr->m_ui.splitter->saveState());
settings->setValue(QLatin1String(Geometry), geometry());
settings->endGroup();
-
- delete d_ptr;
}
QtResourceModel *QtResourceEditorDialog::model() const
diff --git a/tools/designer/src/lib/shared/qtresourceeditordialog_p.h b/tools/designer/src/lib/shared/qtresourceeditordialog_p.h
index f2531d9..aa768e9 100644
--- a/tools/designer/src/lib/shared/qtresourceeditordialog_p.h
+++ b/tools/designer/src/lib/shared/qtresourceeditordialog_p.h
@@ -53,6 +53,7 @@
#ifndef QTRESOURCEEDITOR_H
#define QTRESOURCEEDITOR_H
+#include <QtCore/QScopedPointer>
#include <QtGui/QDialog>
QT_BEGIN_NAMESPACE
@@ -83,7 +84,7 @@ private:
QtResourceEditorDialog(QDesignerFormEditorInterface *core, QDesignerDialogGuiInterface *dlgGui, QWidget *parent = 0);
~QtResourceEditorDialog();
- class QtResourceEditorDialogPrivate *d_ptr;
+ QScopedPointer<class QtResourceEditorDialogPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtResourceEditorDialog)
Q_DISABLE_COPY(QtResourceEditorDialog)
diff --git a/tools/designer/src/lib/shared/qtresourcemodel.cpp b/tools/designer/src/lib/shared/qtresourcemodel.cpp
index e6152be..89615c8 100644
--- a/tools/designer/src/lib/shared/qtresourcemodel.cpp
+++ b/tools/designer/src/lib/shared/qtresourcemodel.cpp
@@ -141,7 +141,6 @@ QtResourceSet::QtResourceSet(QtResourceModel *model) :
QtResourceSet::~QtResourceSet()
{
- delete d_ptr;
}
QStringList QtResourceSet::activeQrcPaths() const
@@ -489,7 +488,6 @@ QtResourceModel::~QtResourceModel()
while (it.hasNext())
removeResourceSet(it.next());
blockSignals(false);
- delete d_ptr;
}
QStringList QtResourceModel::loadedQrcFiles() const
diff --git a/tools/designer/src/lib/shared/qtresourcemodel_p.h b/tools/designer/src/lib/shared/qtresourcemodel_p.h
index 726db29..61d6763 100644
--- a/tools/designer/src/lib/shared/qtresourcemodel_p.h
+++ b/tools/designer/src/lib/shared/qtresourcemodel_p.h
@@ -56,6 +56,7 @@
#include "shared_global_p.h"
#include <QtCore/QMap>
#include <QtCore/QObject>
+#include <QtCore/QScopedPointer>
QT_BEGIN_NAMESPACE
@@ -87,7 +88,7 @@ private:
~QtResourceSet();
friend class QtResourceModel;
- class QtResourceSetPrivate *d_ptr;
+ QScopedPointer<class QtResourceSetPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtResourceSet)
Q_DISABLE_COPY(QtResourceSet)
};
@@ -132,7 +133,7 @@ signals:
private:
friend class QtResourceSet;
- class QtResourceModelPrivate *d_ptr;
+ QScopedPointer<class QtResourceModelPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtResourceModel)
Q_DISABLE_COPY(QtResourceModel)
diff --git a/tools/designer/src/lib/shared/qtresourceview.cpp b/tools/designer/src/lib/shared/qtresourceview.cpp
index d956491..22439a2 100644
--- a/tools/designer/src/lib/shared/qtresourceview.cpp
+++ b/tools/designer/src/lib/shared/qtresourceview.cpp
@@ -499,8 +499,6 @@ QtResourceView::~QtResourceView()
{
if (!d_ptr->m_settingsKey.isEmpty())
d_ptr->saveSettings();
-
- delete d_ptr;
}
bool QtResourceView::event(QEvent *event)
@@ -737,8 +735,6 @@ QtResourceViewDialog::~QtResourceViewDialog()
settings->setValue(QLatin1String(Geometry), geometry());
settings->endGroup();
-
- delete d_ptr;
}
QString QtResourceViewDialog::selectedResource() const
diff --git a/tools/designer/src/lib/shared/qtresourceview_p.h b/tools/designer/src/lib/shared/qtresourceview_p.h
index 33162c5..1d3a1b0 100644
--- a/tools/designer/src/lib/shared/qtresourceview_p.h
+++ b/tools/designer/src/lib/shared/qtresourceview_p.h
@@ -102,7 +102,7 @@ protected:
private:
- class QtResourceViewPrivate *d_ptr;
+ QScopedPointer<class QtResourceViewPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtResourceView)
Q_DISABLE_COPY(QtResourceView)
Q_PRIVATE_SLOT(d_func(), void slotResourceSetActivated(QtResourceSet *))
@@ -129,7 +129,7 @@ public:
void setResourceEditingEnabled(bool enable);
private:
- class QtResourceViewDialogPrivate *d_ptr;
+ QScopedPointer<class QtResourceViewDialogPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtResourceViewDialog)
Q_DISABLE_COPY(QtResourceViewDialog)
Q_PRIVATE_SLOT(d_func(), void slotResourceSelected(const QString &))
diff --git a/tools/designer/src/uitools/quiloader.cpp b/tools/designer/src/uitools/quiloader.cpp
index 2a66095..9e904d4 100644
--- a/tools/designer/src/uitools/quiloader.cpp
+++ b/tools/designer/src/uitools/quiloader.cpp
@@ -648,7 +648,6 @@ QUiLoader::QUiLoader(QObject *parent)
*/
QUiLoader::~QUiLoader()
{
- delete d_ptr;
}
/*!
diff --git a/tools/designer/src/uitools/quiloader.h b/tools/designer/src/uitools/quiloader.h
index 6543ba8..90403bf 100644
--- a/tools/designer/src/uitools/quiloader.h
+++ b/tools/designer/src/uitools/quiloader.h
@@ -43,6 +43,7 @@
#define QUILOADER_H
#include <QtCore/QObject>
+#include <QtCore/QScopedPointer>
QT_BEGIN_HEADER
@@ -90,7 +91,7 @@ public:
bool isTranslationEnabled() const;
private:
- QUiLoaderPrivate *d_ptr;
+ QScopedPointer<QUiLoaderPrivate> d_ptr;
Q_DECLARE_PRIVATE(QUiLoader)
Q_DISABLE_COPY(QUiLoader)
};
diff --git a/tools/linguist/shared/cpp.cpp b/tools/linguist/shared/cpp.cpp
index 2e137cf..0aab661 100644
--- a/tools/linguist/shared/cpp.cpp
+++ b/tools/linguist/shared/cpp.cpp
@@ -134,13 +134,28 @@ static uint getChar()
if (yyInPos >= yyInStr.size())
return EOF;
uint c = yyInStr[yyInPos++].unicode();
- if (c == '\\' && yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n') {
- ++yyCurLineNo;
- ++yyInPos;
- continue;
+ if (c == '\\' && yyInPos < yyInStr.size()) {
+ if (yyInStr[yyInPos].unicode() == '\n') {
+ ++yyCurLineNo;
+ ++yyInPos;
+ continue;
+ }
+ if (yyInStr[yyInPos].unicode() == '\r') {
+ ++yyCurLineNo;
+ ++yyInPos;
+ if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n')
+ ++yyInPos;
+ continue;
+ }
}
- if (c == '\n')
+ if (c == '\r') {
+ if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n')
+ ++yyInPos;
+ c = '\n';
++yyCurLineNo;
+ } else if (c == '\n') {
+ ++yyCurLineNo;
+ }
return c;
}
}
diff --git a/tools/linguist/shared/java.cpp b/tools/linguist/shared/java.cpp
index 912a8d7..4c244d2 100644
--- a/tools/linguist/shared/java.cpp
+++ b/tools/linguist/shared/java.cpp
@@ -58,7 +58,7 @@ enum { Tok_Eof, Tok_class, Tok_return, Tok_tr,
Tok_Comment, Tok_String, Tok_Colon, Tok_Dot,
Tok_LeftBrace, Tok_RightBrace, Tok_LeftParen,
Tok_RightParen, Tok_Comma, Tok_Semicolon,
- Tok_Integer, Tok_Plus, Tok_PlusPlus, Tok_PlusEq };
+ Tok_Integer, Tok_Plus, Tok_PlusPlus, Tok_PlusEq, Tok_null };
class Scope
{
@@ -142,7 +142,11 @@ static int getToken()
case 'c':
if ( yyIdent == QLatin1String("class") )
return Tok_class;
- break;
+ break;
+ case 'n':
+ if ( yyIdent == QLatin1String("null") )
+ return Tok_null;
+ break;
}
}
switch ( yyIdent.at(0).toLatin1() ) {
@@ -382,9 +386,11 @@ static bool matchInteger( qlonglong *number)
static bool matchStringOrNull(QString &s)
{
bool matches = matchString(s);
- qlonglong num = 0;
- if (!matches) matches = matchInteger(&num);
- return matches && num == 0;
+ if (!matches) {
+ matches = (yyTok == Tok_null);
+ if (matches) yyTok = getToken();
+ }
+ return matches;
}
/*
diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp
index f3a29cc..50e85cb 100644
--- a/tools/linguist/shared/numerus.cpp
+++ b/tools/linguist/shared/numerus.cpp
@@ -60,12 +60,11 @@ static const uchar frenchStyleRules[] =
static const uchar latvianRules[] =
{ Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE,
Q_NEQ, 0 };
+static const uchar icelandicRules[] =
+ { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11 };
static const uchar irishStyleRules[] =
{ Q_EQ, 1, Q_NEWRULE,
Q_EQ, 2 };
-static const uchar czechRules[] =
- { Q_MOD_100 | Q_EQ, 1, Q_NEWRULE,
- Q_MOD_100 | Q_BETWEEN, 2, 4 };
static const uchar slovakRules[] =
{ Q_EQ, 1, Q_NEWRULE,
Q_BETWEEN, 2, 4 };
@@ -74,7 +73,7 @@ static const uchar macedonianRules[] =
Q_MOD_10 | Q_EQ, 2 };
static const uchar lithuanianRules[] =
{ Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE,
- Q_MOD_10 | Q_EQ, 2, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 };
+ Q_MOD_10 | Q_NEQ, 0, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 };
static const uchar russianStyleRules[] =
{ Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE,
Q_MOD_10 | Q_BETWEEN, 2, 4, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 };
@@ -103,27 +102,35 @@ static const uchar arabicRules[] =
Q_EQ, 2, Q_NEWRULE,
Q_MOD_100 | Q_BETWEEN, 3, 10, Q_NEWRULE,
Q_MOD_100 | Q_NEQ, 0 };
+static const uchar tagalogRules[] =
+ { Q_LEQ, 1, Q_NEWRULE,
+ Q_MOD_10 | Q_EQ, 4, Q_OR, Q_MOD_10 | Q_EQ, 6, Q_OR, Q_MOD_10 | Q_EQ, 9 };
+static const uchar catalanRules[] =
+ { Q_EQ, 1, Q_NEWRULE,
+ Q_LEAD_1000 | Q_EQ, 11 };
static const char * const japaneseStyleForms[] = { "Universal Form", 0 };
static const char * const englishStyleForms[] = { "Singular", "Plural", 0 };
static const char * const frenchStyleForms[] = { "Singular", "Plural", 0 };
+static const char * const icelandicForms[] = { "Singular", "Plural", 0 };
static const char * const latvianForms[] = { "Singular", "Plural", "Nullar", 0 };
static const char * const irishStyleForms[] = { "Singular", "Dual", "Plural", 0 };
-static const char * const czechForms[] = { "Singular", "Dual", "Plural", 0 };
-static const char * const slovakForms[] = { "Singular", "Dual", "Plural", 0 };
+static const char * const slovakForms[] = { "Singular", "Paucal", "Plural", 0 };
static const char * const macedonianForms[] = { "Singular", "Dual", "Plural", 0 };
-static const char * const lithuanianForms[] = { "Singular", "Dual", "Plural", 0 };
+static const char * const lithuanianForms[] = { "Singular", "Paucal", "Plural", 0 };
static const char * const russianStyleForms[] = { "Singular", "Dual", "Plural", 0 };
static const char * const polishForms[] = { "Singular", "Paucal", "Plural", 0 };
-static const char * const romanianForms[] =
- { "Singular", "Plural Form for 2 to 19", "Plural", 0 };
+static const char * const romanianForms[] = { "Singular", "Paucal", "Plural", 0 };
static const char * const slovenianForms[] = { "Singular", "Dual", "Trial", "Plural", 0 };
static const char * const malteseForms[] =
- { "Singular", "Plural Form for 2 to 10", "Plural Form for 11 to 19", "Plural", 0 };
+ { "Singular", "Paucal", "Greater Paucal", "Plural", 0 };
static const char * const welshForms[] =
{ "Nullar", "Singular", "Dual", "Sexal", "Plural", 0 };
static const char * const arabicForms[] =
{ "Nullar", "Singular", "Dual", "Minority Plural", "Plural", "Plural Form for 100, 200, ...", 0 };
+static const char * const tagalogForms[] =
+ { "Singular", "Plural (consonant-ended)", "Plural (vowel-ended)", 0 };
+static const char * const catalanForms[] = { "Singular", "Undecal (11)", "Plural", 0 };
#define EOL QLocale::C
@@ -147,6 +154,7 @@ static const QLocale::Language japaneseStyleLanguages[] = {
QLocale::Sundanese,
QLocale::Thai,
QLocale::Tibetan,
+ QLocale::Turkish,
QLocale::Vietnamese,
QLocale::Yoruba,
QLocale::Zhuang,
@@ -169,7 +177,6 @@ static const QLocale::Language englishStyleLanguages[] = {
// Missing: Bokmal,
QLocale::Bulgarian,
QLocale::Cambodian,
- QLocale::Catalan,
QLocale::Cornish,
QLocale::Corsican,
QLocale::Danish,
@@ -190,7 +197,6 @@ static const QLocale::Language englishStyleLanguages[] = {
QLocale::Hausa,
QLocale::Hebrew,
QLocale::Hindi,
- QLocale::Icelandic,
QLocale::Interlingua,
QLocale::Interlingue,
QLocale::Italian,
@@ -231,14 +237,12 @@ static const QLocale::Language englishStyleLanguages[] = {
QLocale::Spanish,
QLocale::Swahili,
QLocale::Swedish,
- QLocale::Tagalog,
QLocale::Tajik,
QLocale::Tamil,
QLocale::Tatar,
QLocale::Telugu,
QLocale::TongaLanguage,
QLocale::Tsonga,
- QLocale::Turkish,
QLocale::Turkmen,
QLocale::Twi,
QLocale::Uigur,
@@ -261,6 +265,7 @@ static const QLocale::Language frenchStyleLanguages[] = {
EOL
};
static const QLocale::Language latvianLanguage[] = { QLocale::Latvian, EOL };
+static const QLocale::Language icelandicLanguage[] = { QLocale::Icelandic, EOL };
static const QLocale::Language irishStyleLanguages[] = {
QLocale::Divehi,
QLocale::Gaelic,
@@ -274,8 +279,7 @@ static const QLocale::Language irishStyleLanguages[] = {
QLocale::Sanskrit,
EOL
};
-static const QLocale::Language czechLanguage[] = { QLocale::Czech, EOL };
-static const QLocale::Language slovakLanguage[] = { QLocale::Slovak, EOL };
+static const QLocale::Language slovakLanguages[] = { QLocale::Slovak, QLocale::Czech, EOL };
static const QLocale::Language macedonianLanguage[] = { QLocale::Macedonian, EOL };
static const QLocale::Language lithuanianLanguage[] = { QLocale::Lithuanian, EOL };
static const QLocale::Language russianStyleLanguages[] = {
@@ -298,6 +302,8 @@ static const QLocale::Language slovenianLanguage[] = { QLocale::Slovenian, EOL }
static const QLocale::Language malteseLanguage[] = { QLocale::Maltese, EOL };
static const QLocale::Language welshLanguage[] = { QLocale::Welsh, EOL };
static const QLocale::Language arabicLanguage[] = { QLocale::Arabic, EOL };
+static const QLocale::Language tagalogLanguage[] = { QLocale::Tagalog, EOL };
+static const QLocale::Language catalanLanguage[] = { QLocale::Catalan, EOL };
static const QLocale::Country frenchStyleCountries[] = {
// keep synchronized with frenchStyleLanguages
@@ -320,9 +326,9 @@ static const NumerusTableEntry numerusTable[] = {
{ frenchStyleRules, sizeof(frenchStyleRules), frenchStyleForms, frenchStyleLanguages,
frenchStyleCountries },
{ latvianRules, sizeof(latvianRules), latvianForms, latvianLanguage, 0 },
+ { icelandicRules, sizeof(icelandicRules), icelandicForms, icelandicLanguage, 0 },
{ irishStyleRules, sizeof(irishStyleRules), irishStyleForms, irishStyleLanguages, 0 },
- { czechRules, sizeof(czechRules), czechForms, czechLanguage, 0 },
- { slovakRules, sizeof(slovakRules), slovakForms, slovakLanguage, 0 },
+ { slovakRules, sizeof(slovakRules), slovakForms, slovakLanguages, 0 },
{ macedonianRules, sizeof(macedonianRules), macedonianForms, macedonianLanguage, 0 },
{ lithuanianRules, sizeof(lithuanianRules), lithuanianForms, lithuanianLanguage, 0 },
{ russianStyleRules, sizeof(russianStyleRules), russianStyleForms, russianStyleLanguages, 0 },
@@ -331,7 +337,9 @@ static const NumerusTableEntry numerusTable[] = {
{ slovenianRules, sizeof(slovenianRules), slovenianForms, slovenianLanguage, 0 },
{ malteseRules, sizeof(malteseRules), malteseForms, malteseLanguage, 0 },
{ welshRules, sizeof(welshRules), welshForms, welshLanguage, 0 },
- { arabicRules, sizeof(arabicRules), arabicForms, arabicLanguage, 0 }
+ { arabicRules, sizeof(arabicRules), arabicForms, arabicLanguage, 0 },
+ { tagalogRules, sizeof(tagalogRules), tagalogForms, tagalogLanguage, 0 },
+ { catalanRules, sizeof(catalanRules), catalanForms, catalanLanguage, 0 }
};
static const int NumerusTableSize = sizeof(numerusTable) / sizeof(numerusTable[0]);
diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp
index 61d0ed6..397fbfa 100644
--- a/tools/qdoc3/doc.cpp
+++ b/tools/qdoc3/doc.cpp
@@ -1265,9 +1265,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);
}
diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp
index 3e6f832..5c247fa 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"
@@ -136,7 +137,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);
}
/*!
diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css
index 6cf7377..f22a77a 100644
--- a/tools/qdoc3/test/classic.css
+++ b/tools/qdoc3/test/classic.css
@@ -77,10 +77,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/qtgradienteditor/qtcolorbutton.cpp b/tools/shared/qtgradienteditor/qtcolorbutton.cpp
index 6926f60..49581bd 100644
--- a/tools/shared/qtgradienteditor/qtcolorbutton.cpp
+++ b/tools/shared/qtgradienteditor/qtcolorbutton.cpp
@@ -121,9 +121,8 @@ QPixmap QtColorButtonPrivate::generatePixmap() const
///////////////
QtColorButton::QtColorButton(QWidget *parent)
- : QToolButton(parent)
+ : QToolButton(parent), d_ptr(new QtColorButtonPrivate)
{
- d_ptr = new QtColorButtonPrivate;
d_ptr->q_ptr = this;
d_ptr->m_dragging = false;
d_ptr->m_backgroundCheckered = true;
@@ -136,7 +135,6 @@ QtColorButton::QtColorButton(QWidget *parent)
QtColorButton::~QtColorButton()
{
- delete d_ptr;
}
void QtColorButton::setColor(const QColor &color)
diff --git a/tools/shared/qtgradienteditor/qtcolorbutton.h b/tools/shared/qtgradienteditor/qtcolorbutton.h
index fb91452..9e4f357 100644
--- a/tools/shared/qtgradienteditor/qtcolorbutton.h
+++ b/tools/shared/qtgradienteditor/qtcolorbutton.h
@@ -75,7 +75,7 @@ protected:
void dropEvent(QDropEvent *event);
#endif
private:
- class QtColorButtonPrivate *d_ptr;
+ QScopedPointer<class QtColorButtonPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtColorButton)
Q_DISABLE_COPY(QtColorButton)
Q_PRIVATE_SLOT(d_func(), void slotEditColor())
diff --git a/tools/shared/qtgradienteditor/qtcolorline.cpp b/tools/shared/qtgradienteditor/qtcolorline.cpp
index 337726c..b0b0ee0 100644
--- a/tools/shared/qtgradienteditor/qtcolorline.cpp
+++ b/tools/shared/qtgradienteditor/qtcolorline.cpp
@@ -999,9 +999,8 @@ void QtColorLinePrivate::mouseDoubleClickEvent(QMouseEvent *event)
////////////////////////////////////////////////////
QtColorLine::QtColorLine(QWidget *parent)
- : QWidget(parent)
+ : QWidget(parent), d_ptr(new QtColorLinePrivate)
{
- d_ptr = new QtColorLinePrivate;
d_ptr->q_ptr = this;
setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
@@ -1009,7 +1008,6 @@ QtColorLine::QtColorLine(QWidget *parent)
QtColorLine::~QtColorLine()
{
- delete d_ptr;
}
QSize QtColorLine::minimumSizeHint() const
diff --git a/tools/shared/qtgradienteditor/qtcolorline.h b/tools/shared/qtgradienteditor/qtcolorline.h
index d5535b1..16169d1 100644
--- a/tools/shared/qtgradienteditor/qtcolorline.h
+++ b/tools/shared/qtgradienteditor/qtcolorline.h
@@ -114,7 +114,7 @@ protected:
private:
- class QtColorLinePrivate *d_ptr;
+ QScopedPointer<class QtColorLinePrivate> d_ptr;
Q_DECLARE_PRIVATE(QtColorLine)
Q_DISABLE_COPY(QtColorLine)
};
diff --git a/tools/shared/qtgradienteditor/qtgradientdialog.cpp b/tools/shared/qtgradienteditor/qtgradientdialog.cpp
index 032cb16..001709c 100644
--- a/tools/shared/qtgradienteditor/qtgradientdialog.cpp
+++ b/tools/shared/qtgradienteditor/qtgradientdialog.cpp
@@ -200,10 +200,9 @@ void QtGradientDialogPrivate::slotAboutToShowDetails(bool details, int extension
*/
QtGradientDialog::QtGradientDialog(QWidget *parent)
- : QDialog(parent)
+ : QDialog(parent), d_ptr(new QtGradientDialogPrivate())
{
// setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
- d_ptr = new QtGradientDialogPrivate();
d_ptr->q_ptr = this;
d_ptr->m_ui.setupUi(this);
QPushButton *button = d_ptr->m_ui.buttonBox->button(QDialogButtonBox::Ok);
@@ -222,7 +221,6 @@ QtGradientDialog::QtGradientDialog(QWidget *parent)
QtGradientDialog::~QtGradientDialog()
{
- delete d_ptr;
}
/*!
diff --git a/tools/shared/qtgradienteditor/qtgradientdialog.h b/tools/shared/qtgradienteditor/qtgradientdialog.h
index d3bafc9..819ad21 100644
--- a/tools/shared/qtgradienteditor/qtgradientdialog.h
+++ b/tools/shared/qtgradienteditor/qtgradientdialog.h
@@ -76,7 +76,7 @@ public:
static QGradient getGradient(bool *ok, QWidget *parent = 0, const QString &caption = QString());
private:
- class QtGradientDialogPrivate *d_ptr;
+ QScopedPointer<class QtGradientDialogPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtGradientDialog)
Q_DISABLE_COPY(QtGradientDialog)
Q_PRIVATE_SLOT(d_func(), void slotAboutToShowDetails(bool details, int extensionWidthHint))
diff --git a/tools/shared/qtgradienteditor/qtgradienteditor.cpp b/tools/shared/qtgradienteditor/qtgradienteditor.cpp
index 9eca9d8..0a7eee0 100644
--- a/tools/shared/qtgradienteditor/qtgradienteditor.cpp
+++ b/tools/shared/qtgradienteditor/qtgradienteditor.cpp
@@ -727,9 +727,8 @@ void QtGradientEditorPrivate::setAngleConical(qreal angle)
}
QtGradientEditor::QtGradientEditor(QWidget *parent)
- : QWidget(parent)
+ : QWidget(parent), d_ptr(new QtGradientEditorPrivate())
{
- d_ptr = new QtGradientEditorPrivate();
d_ptr->q_ptr = this;
d_ptr->m_type = QGradient::RadialGradient;
d_ptr->m_ui.setupUi(this);
@@ -835,7 +834,6 @@ QtGradientEditor::~QtGradientEditor()
{
if (d_ptr->m_hiddenWidget)
delete d_ptr->m_hiddenWidget;
- delete d_ptr;
}
void QtGradientEditor::setGradient(const QGradient &grad)
diff --git a/tools/shared/qtgradienteditor/qtgradienteditor.h b/tools/shared/qtgradienteditor/qtgradienteditor.h
index 9974065..7dc75195 100644
--- a/tools/shared/qtgradienteditor/qtgradienteditor.h
+++ b/tools/shared/qtgradienteditor/qtgradienteditor.h
@@ -78,7 +78,7 @@ signals:
void aboutToShowDetails(bool details, int extenstionWidthHint);
private:
- class QtGradientEditorPrivate *d_ptr;
+ QScopedPointer<class QtGradientEditorPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtGradientEditor)
Q_DISABLE_COPY(QtGradientEditor)
Q_PRIVATE_SLOT(d_func(), void slotGradientStopsChanged(const QGradientStops &stops))
diff --git a/tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp b/tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp
index cbc53db..0e9521c 100644
--- a/tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp
+++ b/tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp
@@ -594,9 +594,8 @@ void QtGradientStopsControllerPrivate::slotZoomChanged(double zoom)
}
QtGradientStopsController::QtGradientStopsController(QObject *parent)
- : QObject(parent)
+ : QObject(parent), d_ptr(new QtGradientStopsControllerPrivate())
{
- d_ptr = new QtGradientStopsControllerPrivate();
d_ptr->q_ptr = this;
d_ptr->m_spec = QColor::Hsv;
@@ -675,7 +674,6 @@ void QtGradientStopsController::setUi(Ui::QtGradientEditor *ui)
QtGradientStopsController::~QtGradientStopsController()
{
- delete d_ptr;
}
void QtGradientStopsController::setGradientStops(const QGradientStops &stops)
diff --git a/tools/shared/qtgradienteditor/qtgradientstopscontroller.h b/tools/shared/qtgradienteditor/qtgradientstopscontroller.h
index 9f16fb0..37f2e01 100644
--- a/tools/shared/qtgradienteditor/qtgradientstopscontroller.h
+++ b/tools/shared/qtgradienteditor/qtgradientstopscontroller.h
@@ -70,7 +70,7 @@ signals:
void gradientStopsChanged(const QGradientStops &stops);
private:
- class QtGradientStopsControllerPrivate *d_ptr;
+ QScopedPointer<class QtGradientStopsControllerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtGradientStopsController)
Q_DISABLE_COPY(QtGradientStopsController)
Q_PRIVATE_SLOT(d_func(), void slotHsvClicked())
diff --git a/tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp b/tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp
index a632c0f..6260870 100644
--- a/tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp
+++ b/tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp
@@ -78,8 +78,8 @@ void QtGradientStop::setPosition(qreal position)
}
QtGradientStop::QtGradientStop(QtGradientStopsModel *model)
+ : d_ptr(new QtGradientStopPrivate())
{
- d_ptr = new QtGradientStopPrivate();
d_ptr->m_position = 0;
d_ptr->m_color = Qt::white;
d_ptr->m_model = model;
@@ -87,7 +87,6 @@ QtGradientStop::QtGradientStop(QtGradientStopsModel *model)
QtGradientStop::~QtGradientStop()
{
- delete d_ptr;
}
class QtGradientStopsModelPrivate
@@ -104,9 +103,8 @@ public:
QtGradientStopsModel::QtGradientStopsModel(QObject *parent)
- : QObject(parent)
+ : QObject(parent), d_ptr(new QtGradientStopsModelPrivate)
{
- d_ptr = new QtGradientStopsModelPrivate;
d_ptr->q_ptr = this;
d_ptr->m_current = 0;
}
@@ -114,7 +112,6 @@ QtGradientStopsModel::QtGradientStopsModel(QObject *parent)
QtGradientStopsModel::~QtGradientStopsModel()
{
clear();
- delete d_ptr;
}
QtGradientStopsModel::PositionStopMap QtGradientStopsModel::stops() const
diff --git a/tools/shared/qtgradienteditor/qtgradientstopsmodel.h b/tools/shared/qtgradienteditor/qtgradientstopsmodel.h
index d4e6b3c..2c04c8f 100644
--- a/tools/shared/qtgradienteditor/qtgradientstopsmodel.h
+++ b/tools/shared/qtgradienteditor/qtgradientstopsmodel.h
@@ -64,7 +64,7 @@ private:
friend class QtGradientStopsModel;
QtGradientStop(QtGradientStopsModel *model = 0);
~QtGradientStop();
- class QtGradientStopPrivate *d_ptr;
+ QScopedPointer<class QtGradientStopPrivate> d_ptr;
};
class QtGradientStopsModel : public QObject
@@ -111,7 +111,7 @@ signals:
void currentStopChanged(QtGradientStop *stop);
private:
- class QtGradientStopsModelPrivate *d_ptr;
+ QScopedPointer<class QtGradientStopsModelPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtGradientStopsModel)
Q_DISABLE_COPY(QtGradientStopsModel)
};
diff --git a/tools/shared/qtgradienteditor/qtgradientstopswidget.cpp b/tools/shared/qtgradienteditor/qtgradientstopswidget.cpp
index adaf57d..570bd6f 100644
--- a/tools/shared/qtgradienteditor/qtgradientstopswidget.cpp
+++ b/tools/shared/qtgradienteditor/qtgradientstopswidget.cpp
@@ -360,9 +360,8 @@ void QtGradientStopsWidgetPrivate::slotResetZoom()
}
QtGradientStopsWidget::QtGradientStopsWidget(QWidget *parent)
- : QAbstractScrollArea(parent)
+ : QAbstractScrollArea(parent), d_ptr(new QtGradientStopsWidgetPrivate)
{
- d_ptr = new QtGradientStopsWidgetPrivate;
d_ptr->q_ptr = this;
d_ptr->m_backgroundCheckered = true;
d_ptr->m_model = 0;
@@ -391,7 +390,6 @@ QtGradientStopsWidget::QtGradientStopsWidget(QWidget *parent)
QtGradientStopsWidget::~QtGradientStopsWidget()
{
- delete d_ptr;
}
QSize QtGradientStopsWidget::sizeHint() const
diff --git a/tools/shared/qtgradienteditor/qtgradientstopswidget.h b/tools/shared/qtgradienteditor/qtgradientstopswidget.h
index aafea8b..79d6576 100644
--- a/tools/shared/qtgradienteditor/qtgradientstopswidget.h
+++ b/tools/shared/qtgradienteditor/qtgradientstopswidget.h
@@ -91,7 +91,7 @@ protected:
#endif
private:
- QtGradientStopsWidgetPrivate *d_ptr;
+ QScopedPointer<QtGradientStopsWidgetPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtGradientStopsWidget)
Q_DISABLE_COPY(QtGradientStopsWidget)
Q_PRIVATE_SLOT(d_func(), void slotStopAdded(QtGradientStop *stop))
diff --git a/tools/shared/qtgradienteditor/qtgradientwidget.cpp b/tools/shared/qtgradienteditor/qtgradientwidget.cpp
index 3f6b48d..4b70cc2 100644
--- a/tools/shared/qtgradienteditor/qtgradientwidget.cpp
+++ b/tools/shared/qtgradienteditor/qtgradientwidget.cpp
@@ -232,9 +232,8 @@ void QtGradientWidgetPrivate::setupDrag(QtGradientStop *stop, int x)
////////////////////////////
QtGradientWidget::QtGradientWidget(QWidget *parent)
- : QWidget(parent)
+ : QWidget(parent), d_ptr(new QtGradientWidgetPrivate)
{
- d_ptr = new QtGradientWidgetPrivate;
d_ptr->q_ptr = this;
d_ptr->m_backgroundCheckered = true;
d_ptr->m_handleSize = 20.0;
@@ -253,7 +252,6 @@ QtGradientWidget::QtGradientWidget(QWidget *parent)
QtGradientWidget::~QtGradientWidget()
{
- delete d_ptr;
}
QSize QtGradientWidget::sizeHint() const
diff --git a/tools/shared/qtgradienteditor/qtgradientwidget.h b/tools/shared/qtgradienteditor/qtgradientwidget.h
index 4dc740b..d994534 100644
--- a/tools/shared/qtgradienteditor/qtgradientwidget.h
+++ b/tools/shared/qtgradienteditor/qtgradientwidget.h
@@ -110,7 +110,7 @@ protected:
void mouseDoubleClickEvent(QMouseEvent *e);
private:
- class QtGradientWidgetPrivate *d_ptr;
+ QScopedPointer<class QtGradientWidgetPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtGradientWidget)
Q_DISABLE_COPY(QtGradientWidget)
};
diff --git a/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp b/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp
index 09394e7..3ccc423 100644
--- a/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp
+++ b/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp
@@ -547,9 +547,8 @@ void QtButtonPropertyBrowserPrivate::updateItem(WidgetItem *item)
Creates a property browser with the given \a parent.
*/
QtButtonPropertyBrowser::QtButtonPropertyBrowser(QWidget *parent)
- : QtAbstractPropertyBrowser(parent)
+ : QtAbstractPropertyBrowser(parent), d_ptr(new QtButtonPropertyBrowserPrivate)
{
- d_ptr = new QtButtonPropertyBrowserPrivate;
d_ptr->q_ptr = this;
d_ptr->init(this);
@@ -570,7 +569,6 @@ QtButtonPropertyBrowser::~QtButtonPropertyBrowser()
const QMap<QtButtonPropertyBrowserPrivate::WidgetItem *, QtBrowserItem *>::ConstIterator icend = d_ptr->m_itemToIndex.constEnd();
for (QMap<QtButtonPropertyBrowserPrivate::WidgetItem *, QtBrowserItem *>::ConstIterator it = d_ptr->m_itemToIndex.constBegin(); it != icend; ++it)
delete it.key();
- delete d_ptr;
}
/*!
diff --git a/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.h b/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.h
index 0238f5c..bac9d95 100644
--- a/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.h
+++ b/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.h
@@ -71,7 +71,7 @@ protected:
private:
- QtButtonPropertyBrowserPrivate *d_ptr;
+ QScopedPointer<QtButtonPropertyBrowserPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtButtonPropertyBrowser)
Q_DISABLE_COPY(QtButtonPropertyBrowser)
Q_PRIVATE_SLOT(d_func(), void slotUpdate())
diff --git a/tools/shared/qtpropertybrowser/qteditorfactory.cpp b/tools/shared/qtpropertybrowser/qteditorfactory.cpp
index a2e3917..01d955a 100644
--- a/tools/shared/qtpropertybrowser/qteditorfactory.cpp
+++ b/tools/shared/qtpropertybrowser/qteditorfactory.cpp
@@ -227,9 +227,8 @@ void QtSpinBoxFactoryPrivate::slotSetValue(int value)
Creates a factory with the given \a parent.
*/
QtSpinBoxFactory::QtSpinBoxFactory(QObject *parent)
- : QtAbstractEditorFactory<QtIntPropertyManager>(parent)
+ : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(new QtSpinBoxFactoryPrivate())
{
- d_ptr = new QtSpinBoxFactoryPrivate();
d_ptr->q_ptr = this;
}
@@ -240,7 +239,6 @@ QtSpinBoxFactory::QtSpinBoxFactory(QObject *parent)
QtSpinBoxFactory::~QtSpinBoxFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -383,9 +381,8 @@ void QtSliderFactoryPrivate::slotSetValue(int value)
Creates a factory with the given \a parent.
*/
QtSliderFactory::QtSliderFactory(QObject *parent)
- : QtAbstractEditorFactory<QtIntPropertyManager>(parent)
+ : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(new QtSliderFactoryPrivate())
{
- d_ptr = new QtSliderFactoryPrivate();
d_ptr->q_ptr = this;
}
@@ -396,7 +393,6 @@ QtSliderFactory::QtSliderFactory(QObject *parent)
QtSliderFactory::~QtSliderFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -539,9 +535,8 @@ void QtScrollBarFactoryPrivate::slotSetValue(int value)
Creates a factory with the given \a parent.
*/
QtScrollBarFactory::QtScrollBarFactory(QObject *parent)
- : QtAbstractEditorFactory<QtIntPropertyManager>(parent)
+ : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(new QtScrollBarFactoryPrivate())
{
- d_ptr = new QtScrollBarFactoryPrivate();
d_ptr->q_ptr = this;
}
@@ -552,7 +547,6 @@ QtScrollBarFactory::QtScrollBarFactory(QObject *parent)
QtScrollBarFactory::~QtScrollBarFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -661,9 +655,8 @@ void QtCheckBoxFactoryPrivate::slotSetValue(bool value)
Creates a factory with the given \a parent.
*/
QtCheckBoxFactory::QtCheckBoxFactory(QObject *parent)
- : QtAbstractEditorFactory<QtBoolPropertyManager>(parent)
+ : QtAbstractEditorFactory<QtBoolPropertyManager>(parent), d_ptr(new QtCheckBoxFactoryPrivate())
{
- d_ptr = new QtCheckBoxFactoryPrivate();
d_ptr->q_ptr = this;
}
@@ -674,7 +667,6 @@ QtCheckBoxFactory::QtCheckBoxFactory(QObject *parent)
QtCheckBoxFactory::~QtCheckBoxFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -836,9 +828,8 @@ void QtDoubleSpinBoxFactoryPrivate::slotSetValue(double value)
Creates a factory with the given \a parent.
*/
QtDoubleSpinBoxFactory::QtDoubleSpinBoxFactory(QObject *parent)
- : QtAbstractEditorFactory<QtDoublePropertyManager>(parent)
+ : QtAbstractEditorFactory<QtDoublePropertyManager>(parent), d_ptr(new QtDoubleSpinBoxFactoryPrivate())
{
- d_ptr = new QtDoubleSpinBoxFactoryPrivate();
d_ptr->q_ptr = this;
}
@@ -849,7 +840,6 @@ QtDoubleSpinBoxFactory::QtDoubleSpinBoxFactory(QObject *parent)
QtDoubleSpinBoxFactory::~QtDoubleSpinBoxFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -991,9 +981,8 @@ void QtLineEditFactoryPrivate::slotSetValue(const QString &value)
Creates a factory with the given \a parent.
*/
QtLineEditFactory::QtLineEditFactory(QObject *parent)
- : QtAbstractEditorFactory<QtStringPropertyManager>(parent)
+ : QtAbstractEditorFactory<QtStringPropertyManager>(parent), d_ptr(new QtLineEditFactoryPrivate())
{
- d_ptr = new QtLineEditFactoryPrivate();
d_ptr->q_ptr = this;
}
@@ -1004,7 +993,6 @@ QtLineEditFactory::QtLineEditFactory(QObject *parent)
QtLineEditFactory::~QtLineEditFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -1134,9 +1122,8 @@ void QtDateEditFactoryPrivate::slotSetValue(const QDate &value)
Creates a factory with the given \a parent.
*/
QtDateEditFactory::QtDateEditFactory(QObject *parent)
- : QtAbstractEditorFactory<QtDatePropertyManager>(parent)
+ : QtAbstractEditorFactory<QtDatePropertyManager>(parent), d_ptr(new QtDateEditFactoryPrivate())
{
- d_ptr = new QtDateEditFactoryPrivate();
d_ptr->q_ptr = this;
}
@@ -1147,7 +1134,6 @@ QtDateEditFactory::QtDateEditFactory(QObject *parent)
QtDateEditFactory::~QtDateEditFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -1252,9 +1238,8 @@ void QtTimeEditFactoryPrivate::slotSetValue(const QTime &value)
Creates a factory with the given \a parent.
*/
QtTimeEditFactory::QtTimeEditFactory(QObject *parent)
- : QtAbstractEditorFactory<QtTimePropertyManager>(parent)
+ : QtAbstractEditorFactory<QtTimePropertyManager>(parent), d_ptr(new QtTimeEditFactoryPrivate())
{
- d_ptr = new QtTimeEditFactoryPrivate();
d_ptr->q_ptr = this;
}
@@ -1265,7 +1250,6 @@ QtTimeEditFactory::QtTimeEditFactory(QObject *parent)
QtTimeEditFactory::~QtTimeEditFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -1367,9 +1351,8 @@ void QtDateTimeEditFactoryPrivate::slotSetValue(const QDateTime &value)
Creates a factory with the given \a parent.
*/
QtDateTimeEditFactory::QtDateTimeEditFactory(QObject *parent)
- : QtAbstractEditorFactory<QtDateTimePropertyManager>(parent)
+ : QtAbstractEditorFactory<QtDateTimePropertyManager>(parent), d_ptr(new QtDateTimeEditFactoryPrivate())
{
- d_ptr = new QtDateTimeEditFactoryPrivate();
d_ptr->q_ptr = this;
}
@@ -1380,7 +1363,6 @@ QtDateTimeEditFactory::QtDateTimeEditFactory(QObject *parent)
QtDateTimeEditFactory::~QtDateTimeEditFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -1481,9 +1463,8 @@ void QtKeySequenceEditorFactoryPrivate::slotSetValue(const QKeySequence &value)
Creates a factory with the given \a parent.
*/
QtKeySequenceEditorFactory::QtKeySequenceEditorFactory(QObject *parent)
- : QtAbstractEditorFactory<QtKeySequencePropertyManager>(parent)
+ : QtAbstractEditorFactory<QtKeySequencePropertyManager>(parent), d_ptr(new QtKeySequenceEditorFactoryPrivate())
{
- d_ptr = new QtKeySequenceEditorFactoryPrivate();
d_ptr->q_ptr = this;
}
@@ -1494,7 +1475,6 @@ QtKeySequenceEditorFactory::QtKeySequenceEditorFactory(QObject *parent)
QtKeySequenceEditorFactory::~QtKeySequenceEditorFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -1765,9 +1745,8 @@ void QtCharEditorFactoryPrivate::slotSetValue(const QChar &value)
Creates a factory with the given \a parent.
*/
QtCharEditorFactory::QtCharEditorFactory(QObject *parent)
- : QtAbstractEditorFactory<QtCharPropertyManager>(parent)
+ : QtAbstractEditorFactory<QtCharPropertyManager>(parent), d_ptr(new QtCharEditorFactoryPrivate())
{
- d_ptr = new QtCharEditorFactoryPrivate();
d_ptr->q_ptr = this;
}
@@ -1778,7 +1757,6 @@ QtCharEditorFactory::QtCharEditorFactory(QObject *parent)
QtCharEditorFactory::~QtCharEditorFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -1929,9 +1907,8 @@ void QtEnumEditorFactoryPrivate::slotSetValue(int value)
Creates a factory with the given \a parent.
*/
QtEnumEditorFactory::QtEnumEditorFactory(QObject *parent)
- : QtAbstractEditorFactory<QtEnumPropertyManager>(parent)
+ : QtAbstractEditorFactory<QtEnumPropertyManager>(parent), d_ptr(new QtEnumEditorFactoryPrivate())
{
- d_ptr = new QtEnumEditorFactoryPrivate();
d_ptr->q_ptr = this;
}
@@ -1942,7 +1919,6 @@ QtEnumEditorFactory::QtEnumEditorFactory(QObject *parent)
QtEnumEditorFactory::~QtEnumEditorFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -2094,9 +2070,8 @@ void QtCursorEditorFactoryPrivate::slotEditorDestroyed(QObject *object)
Creates a factory with the given \a parent.
*/
QtCursorEditorFactory::QtCursorEditorFactory(QObject *parent)
- : QtAbstractEditorFactory<QtCursorPropertyManager>(parent)
+ : QtAbstractEditorFactory<QtCursorPropertyManager>(parent), d_ptr(new QtCursorEditorFactoryPrivate())
{
- d_ptr = new QtCursorEditorFactoryPrivate();
d_ptr->q_ptr = this;
d_ptr->m_enumEditorFactory = new QtEnumEditorFactory(this);
@@ -2111,7 +2086,6 @@ QtCursorEditorFactory::QtCursorEditorFactory(QObject *parent)
*/
QtCursorEditorFactory::~QtCursorEditorFactory()
{
- delete d_ptr;
}
/*!
@@ -2328,7 +2302,6 @@ QtColorEditorFactory::QtColorEditorFactory(QObject *parent) :
QtColorEditorFactory::~QtColorEditorFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
@@ -2542,7 +2515,6 @@ QtFontEditorFactory::QtFontEditorFactory(QObject *parent) :
QtFontEditorFactory::~QtFontEditorFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
- delete d_ptr;
}
/*!
diff --git a/tools/shared/qtpropertybrowser/qteditorfactory.h b/tools/shared/qtpropertybrowser/qteditorfactory.h
index d86f9f6..f5a1605 100644
--- a/tools/shared/qtpropertybrowser/qteditorfactory.h
+++ b/tools/shared/qtpropertybrowser/qteditorfactory.h
@@ -60,7 +60,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtIntPropertyManager *manager);
private:
- QtSpinBoxFactoryPrivate *d_ptr;
+ QScopedPointer<QtSpinBoxFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtSpinBoxFactory)
Q_DISABLE_COPY(QtSpinBoxFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int))
@@ -84,7 +84,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtIntPropertyManager *manager);
private:
- QtSliderFactoryPrivate *d_ptr;
+ QScopedPointer<QtSliderFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtSliderFactory)
Q_DISABLE_COPY(QtSliderFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int))
@@ -108,7 +108,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtIntPropertyManager *manager);
private:
- QtScrollBarFactoryPrivate *d_ptr;
+ QScopedPointer<QtScrollBarFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtScrollBarFactory)
Q_DISABLE_COPY(QtScrollBarFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int))
@@ -132,7 +132,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtBoolPropertyManager *manager);
private:
- QtCheckBoxFactoryPrivate *d_ptr;
+ QScopedPointer<QtCheckBoxFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtCheckBoxFactory)
Q_DISABLE_COPY(QtCheckBoxFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, bool))
@@ -154,7 +154,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtDoublePropertyManager *manager);
private:
- QtDoubleSpinBoxFactoryPrivate *d_ptr;
+ QScopedPointer<QtDoubleSpinBoxFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtDoubleSpinBoxFactory)
Q_DISABLE_COPY(QtDoubleSpinBoxFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, double))
@@ -179,7 +179,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtStringPropertyManager *manager);
private:
- QtLineEditFactoryPrivate *d_ptr;
+ QScopedPointer<QtLineEditFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtLineEditFactory)
Q_DISABLE_COPY(QtLineEditFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QString &))
@@ -202,7 +202,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtDatePropertyManager *manager);
private:
- QtDateEditFactoryPrivate *d_ptr;
+ QScopedPointer<QtDateEditFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtDateEditFactory)
Q_DISABLE_COPY(QtDateEditFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QDate &))
@@ -226,7 +226,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtTimePropertyManager *manager);
private:
- QtTimeEditFactoryPrivate *d_ptr;
+ QScopedPointer<QtTimeEditFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtTimeEditFactory)
Q_DISABLE_COPY(QtTimeEditFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QTime &))
@@ -248,7 +248,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtDateTimePropertyManager *manager);
private:
- QtDateTimeEditFactoryPrivate *d_ptr;
+ QScopedPointer<QtDateTimeEditFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtDateTimeEditFactory)
Q_DISABLE_COPY(QtDateTimeEditFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QDateTime &))
@@ -270,7 +270,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtKeySequencePropertyManager *manager);
private:
- QtKeySequenceEditorFactoryPrivate *d_ptr;
+ QScopedPointer<QtKeySequenceEditorFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtKeySequenceEditorFactory)
Q_DISABLE_COPY(QtKeySequenceEditorFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QKeySequence &))
@@ -292,7 +292,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtCharPropertyManager *manager);
private:
- QtCharEditorFactoryPrivate *d_ptr;
+ QScopedPointer<QtCharEditorFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtCharEditorFactory)
Q_DISABLE_COPY(QtCharEditorFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QChar &))
@@ -314,7 +314,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtEnumPropertyManager *manager);
private:
- QtEnumEditorFactoryPrivate *d_ptr;
+ QScopedPointer<QtEnumEditorFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtEnumEditorFactory)
Q_DISABLE_COPY(QtEnumEditorFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int))
@@ -340,7 +340,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtCursorPropertyManager *manager);
private:
- QtCursorEditorFactoryPrivate *d_ptr;
+ QScopedPointer<QtCursorEditorFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtCursorEditorFactory)
Q_DISABLE_COPY(QtCursorEditorFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QCursor &))
@@ -362,7 +362,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtColorPropertyManager *manager);
private:
- QtColorEditorFactoryPrivate *d_ptr;
+ QScopedPointer<QtColorEditorFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtColorEditorFactory)
Q_DISABLE_COPY(QtColorEditorFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QColor &))
@@ -384,7 +384,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtFontPropertyManager *manager);
private:
- QtFontEditorFactoryPrivate *d_ptr;
+ QScopedPointer<QtFontEditorFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtFontEditorFactory)
Q_DISABLE_COPY(QtFontEditorFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QFont &))
diff --git a/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp b/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp
index 9ac9744..4b44f97 100644
--- a/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp
+++ b/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp
@@ -476,9 +476,8 @@ void QtGroupBoxPropertyBrowserPrivate::updateItem(WidgetItem *item)
Creates a property browser with the given \a parent.
*/
QtGroupBoxPropertyBrowser::QtGroupBoxPropertyBrowser(QWidget *parent)
- : QtAbstractPropertyBrowser(parent)
+ : QtAbstractPropertyBrowser(parent), d_ptr(new QtGroupBoxPropertyBrowserPrivate)
{
- d_ptr = new QtGroupBoxPropertyBrowserPrivate;
d_ptr->q_ptr = this;
d_ptr->init(this);
@@ -499,7 +498,6 @@ QtGroupBoxPropertyBrowser::~QtGroupBoxPropertyBrowser()
const QMap<QtGroupBoxPropertyBrowserPrivate::WidgetItem *, QtBrowserItem *>::ConstIterator icend = d_ptr->m_itemToIndex.constEnd();
for (QMap<QtGroupBoxPropertyBrowserPrivate::WidgetItem *, QtBrowserItem *>::ConstIterator it = d_ptr->m_itemToIndex.constBegin(); it != icend; ++it)
delete it.key();
- delete d_ptr;
}
/*!
diff --git a/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.h b/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.h
index 6d1b2b1..6f48b8f 100644
--- a/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.h
+++ b/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.h
@@ -63,7 +63,7 @@ protected:
private:
- QtGroupBoxPropertyBrowserPrivate *d_ptr;
+ QScopedPointer<QtGroupBoxPropertyBrowserPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtGroupBoxPropertyBrowser)
Q_DISABLE_COPY(QtGroupBoxPropertyBrowser)
Q_PRIVATE_SLOT(d_func(), void slotUpdate())
diff --git a/tools/shared/qtpropertybrowser/qtpropertybrowser.cpp b/tools/shared/qtpropertybrowser/qtpropertybrowser.cpp
index cca082d..0f4b197 100644
--- a/tools/shared/qtpropertybrowser/qtpropertybrowser.cpp
+++ b/tools/shared/qtpropertybrowser/qtpropertybrowser.cpp
@@ -142,8 +142,8 @@ public:
\sa QtAbstractPropertyManager::addProperty()
*/
QtProperty::QtProperty(QtAbstractPropertyManager *manager)
+ : d_ptr(new QtPropertyPrivate(manager))
{
- d_ptr = new QtPropertyPrivate(manager);
d_ptr->q_ptr = this;
}
@@ -177,7 +177,6 @@ QtProperty::~QtProperty()
QtProperty *property = itParent.next();
property->d_ptr->m_subItems.removeAll(this);
}
- delete d_ptr;
}
/*!
@@ -638,9 +637,8 @@ void QtAbstractPropertyManagerPrivate::propertyInserted(QtProperty *property,
Creates an abstract property manager with the given \a parent.
*/
QtAbstractPropertyManager::QtAbstractPropertyManager(QObject *parent)
- : QObject(parent)
+ : QObject(parent), d_ptr(new QtAbstractPropertyManagerPrivate)
{
- d_ptr = new QtAbstractPropertyManagerPrivate;
d_ptr->q_ptr = this;
}
@@ -652,7 +650,6 @@ QtAbstractPropertyManager::QtAbstractPropertyManager(QObject *parent)
QtAbstractPropertyManager::~QtAbstractPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -1167,14 +1164,13 @@ QtAbstractPropertyBrowser *QtBrowserItem::browser() const
}
QtBrowserItem::QtBrowserItem(QtAbstractPropertyBrowser *browser, QtProperty *property, QtBrowserItem *parent)
+ : d_ptr(new QtBrowserItemPrivate(browser, property, parent))
{
- d_ptr = new QtBrowserItemPrivate(browser, property, parent);
d_ptr->q_ptr = this;
}
QtBrowserItem::~QtBrowserItem()
{
- delete d_ptr;
}
@@ -1646,9 +1642,8 @@ void QtAbstractPropertyBrowserPrivate::slotPropertyDataChanged(QtProperty *prope
Creates an abstract property browser with the given \a parent.
*/
QtAbstractPropertyBrowser::QtAbstractPropertyBrowser(QWidget *parent)
- : QWidget(parent)
+ : QWidget(parent), d_ptr(new QtAbstractPropertyBrowserPrivate)
{
- d_ptr = new QtAbstractPropertyBrowserPrivate;
d_ptr->q_ptr = this;
}
@@ -1671,7 +1666,6 @@ QtAbstractPropertyBrowser::~QtAbstractPropertyBrowser()
QListIterator<QtBrowserItem *> itItem(indexes);
while (itItem.hasNext())
d_ptr->clearIndex(itItem.next());
- delete d_ptr;
}
/*!
diff --git a/tools/shared/qtpropertybrowser/qtpropertybrowser.h b/tools/shared/qtpropertybrowser/qtpropertybrowser.h
index 20ffb81..5a878bb 100644
--- a/tools/shared/qtpropertybrowser/qtpropertybrowser.h
+++ b/tools/shared/qtpropertybrowser/qtpropertybrowser.h
@@ -85,7 +85,7 @@ protected:
void propertyChanged();
private:
friend class QtAbstractPropertyManager;
- QtPropertyPrivate *d_ptr;
+ QScopedPointer<QtPropertyPrivate> d_ptr;
};
class QtAbstractPropertyManagerPrivate;
@@ -118,7 +118,7 @@ protected:
virtual QtProperty *createProperty();
private:
friend class QtProperty;
- QtAbstractPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtAbstractPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtAbstractPropertyManager)
Q_DISABLE_COPY(QtAbstractPropertyManager)
};
@@ -235,7 +235,7 @@ public:
private:
explicit QtBrowserItem(QtAbstractPropertyBrowser *browser, QtProperty *property, QtBrowserItem *parent);
~QtBrowserItem();
- QtBrowserItemPrivate *d_ptr;
+ QScopedPointer<QtBrowserItemPrivate> d_ptr;
friend class QtAbstractPropertyBrowserPrivate;
};
@@ -292,7 +292,7 @@ private:
bool addFactory(QtAbstractPropertyManager *abstractManager,
QtAbstractEditorFactoryBase *abstractFactory);
- QtAbstractPropertyBrowserPrivate *d_ptr;
+ QScopedPointer<QtAbstractPropertyBrowserPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtAbstractPropertyBrowser)
Q_DISABLE_COPY(QtAbstractPropertyBrowser)
Q_PRIVATE_SLOT(d_func(), void slotPropertyInserted(QtProperty *,
diff --git a/tools/shared/qtpropertybrowser/qtpropertymanager.cpp b/tools/shared/qtpropertybrowser/qtpropertymanager.cpp
index 47b8c9b..df74b6e 100644
--- a/tools/shared/qtpropertybrowser/qtpropertymanager.cpp
+++ b/tools/shared/qtpropertybrowser/qtpropertymanager.cpp
@@ -677,9 +677,8 @@ public:
Creates a manager with the given \a parent.
*/
QtIntPropertyManager::QtIntPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtIntPropertyManagerPrivate)
{
- d_ptr = new QtIntPropertyManagerPrivate;
d_ptr->q_ptr = this;
}
@@ -689,7 +688,6 @@ QtIntPropertyManager::QtIntPropertyManager(QObject *parent)
QtIntPropertyManager::~QtIntPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -762,7 +760,7 @@ QString QtIntPropertyManager::valueText(const QtProperty *property) const
void QtIntPropertyManager::setValue(QtProperty *property, int val)
{
void (QtIntPropertyManagerPrivate::*setSubPropertyValue)(QtProperty *, int) = 0;
- setValueInRange<int, QtIntPropertyManagerPrivate, QtIntPropertyManager, int>(this, d_ptr,
+ setValueInRange<int, QtIntPropertyManagerPrivate, QtIntPropertyManager, int>(this, d_ptr.data(),
&QtIntPropertyManager::propertyChanged,
&QtIntPropertyManager::valueChanged,
property, val, setSubPropertyValue);
@@ -779,7 +777,7 @@ void QtIntPropertyManager::setValue(QtProperty *property, int val)
*/
void QtIntPropertyManager::setMinimum(QtProperty *property, int minVal)
{
- setMinimumValue<int, QtIntPropertyManagerPrivate, QtIntPropertyManager, int, QtIntPropertyManagerPrivate::Data>(this, d_ptr,
+ setMinimumValue<int, QtIntPropertyManagerPrivate, QtIntPropertyManager, int, QtIntPropertyManagerPrivate::Data>(this, d_ptr.data(),
&QtIntPropertyManager::propertyChanged,
&QtIntPropertyManager::valueChanged,
&QtIntPropertyManager::rangeChanged,
@@ -797,7 +795,7 @@ void QtIntPropertyManager::setMinimum(QtProperty *property, int minVal)
*/
void QtIntPropertyManager::setMaximum(QtProperty *property, int maxVal)
{
- setMaximumValue<int, QtIntPropertyManagerPrivate, QtIntPropertyManager, int, QtIntPropertyManagerPrivate::Data>(this, d_ptr,
+ setMaximumValue<int, QtIntPropertyManagerPrivate, QtIntPropertyManager, int, QtIntPropertyManagerPrivate::Data>(this, d_ptr.data(),
&QtIntPropertyManager::propertyChanged,
&QtIntPropertyManager::valueChanged,
&QtIntPropertyManager::rangeChanged,
@@ -821,7 +819,7 @@ void QtIntPropertyManager::setMaximum(QtProperty *property, int maxVal)
void QtIntPropertyManager::setRange(QtProperty *property, int minVal, int maxVal)
{
void (QtIntPropertyManagerPrivate::*setSubPropertyRange)(QtProperty *, int, int, int) = 0;
- setBorderValues<int, QtIntPropertyManagerPrivate, QtIntPropertyManager, int>(this, d_ptr,
+ setBorderValues<int, QtIntPropertyManagerPrivate, QtIntPropertyManager, int>(this, d_ptr.data(),
&QtIntPropertyManager::propertyChanged,
&QtIntPropertyManager::valueChanged,
&QtIntPropertyManager::rangeChanged,
@@ -968,9 +966,8 @@ public:
Creates a manager with the given \a parent.
*/
QtDoublePropertyManager::QtDoublePropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtDoublePropertyManagerPrivate)
{
- d_ptr = new QtDoublePropertyManagerPrivate;
d_ptr->q_ptr = this;
}
@@ -980,7 +977,6 @@ QtDoublePropertyManager::QtDoublePropertyManager(QObject *parent)
QtDoublePropertyManager::~QtDoublePropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -1063,7 +1059,7 @@ QString QtDoublePropertyManager::valueText(const QtProperty *property) const
void QtDoublePropertyManager::setValue(QtProperty *property, double val)
{
void (QtDoublePropertyManagerPrivate::*setSubPropertyValue)(QtProperty *, double) = 0;
- setValueInRange<double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager, double>(this, d_ptr,
+ setValueInRange<double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager, double>(this, d_ptr.data(),
&QtDoublePropertyManager::propertyChanged,
&QtDoublePropertyManager::valueChanged,
property, val, setSubPropertyValue);
@@ -1140,7 +1136,7 @@ void QtDoublePropertyManager::setDecimals(QtProperty *property, int prec)
*/
void QtDoublePropertyManager::setMinimum(QtProperty *property, double minVal)
{
- setMinimumValue<double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager, double, QtDoublePropertyManagerPrivate::Data>(this, d_ptr,
+ setMinimumValue<double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager, double, QtDoublePropertyManagerPrivate::Data>(this, d_ptr.data(),
&QtDoublePropertyManager::propertyChanged,
&QtDoublePropertyManager::valueChanged,
&QtDoublePropertyManager::rangeChanged,
@@ -1158,7 +1154,7 @@ void QtDoublePropertyManager::setMinimum(QtProperty *property, double minVal)
*/
void QtDoublePropertyManager::setMaximum(QtProperty *property, double maxVal)
{
- setMaximumValue<double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager, double, QtDoublePropertyManagerPrivate::Data>(this, d_ptr,
+ setMaximumValue<double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager, double, QtDoublePropertyManagerPrivate::Data>(this, d_ptr.data(),
&QtDoublePropertyManager::propertyChanged,
&QtDoublePropertyManager::valueChanged,
&QtDoublePropertyManager::rangeChanged,
@@ -1182,7 +1178,7 @@ void QtDoublePropertyManager::setMaximum(QtProperty *property, double maxVal)
void QtDoublePropertyManager::setRange(QtProperty *property, double minVal, double maxVal)
{
void (QtDoublePropertyManagerPrivate::*setSubPropertyRange)(QtProperty *, double, double, double) = 0;
- setBorderValues<double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager, double>(this, d_ptr,
+ setBorderValues<double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager, double>(this, d_ptr.data(),
&QtDoublePropertyManager::propertyChanged,
&QtDoublePropertyManager::valueChanged,
&QtDoublePropertyManager::rangeChanged,
@@ -1273,9 +1269,8 @@ public:
Creates a manager with the given \a parent.
*/
QtStringPropertyManager::QtStringPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtStringPropertyManagerPrivate)
{
- d_ptr = new QtStringPropertyManagerPrivate;
d_ptr->q_ptr = this;
}
@@ -1285,7 +1280,6 @@ QtStringPropertyManager::QtStringPropertyManager(QObject *parent)
QtStringPropertyManager::~QtStringPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -1437,9 +1431,8 @@ public:
Creates a manager with the given \a parent.
*/
QtBoolPropertyManager::QtBoolPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtBoolPropertyManagerPrivate)
{
- d_ptr = new QtBoolPropertyManagerPrivate;
d_ptr->q_ptr = this;
}
@@ -1449,7 +1442,6 @@ QtBoolPropertyManager::QtBoolPropertyManager(QObject *parent)
QtBoolPropertyManager::~QtBoolPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -1630,9 +1622,8 @@ public:
Creates a manager with the given \a parent.
*/
QtDatePropertyManager::QtDatePropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtDatePropertyManagerPrivate)
{
- d_ptr = new QtDatePropertyManagerPrivate;
d_ptr->q_ptr = this;
QLocale loc;
@@ -1645,7 +1636,6 @@ QtDatePropertyManager::QtDatePropertyManager(QObject *parent)
QtDatePropertyManager::~QtDatePropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -1706,7 +1696,7 @@ QString QtDatePropertyManager::valueText(const QtProperty *property) const
void QtDatePropertyManager::setValue(QtProperty *property, const QDate &val)
{
void (QtDatePropertyManagerPrivate::*setSubPropertyValue)(QtProperty *, const QDate &) = 0;
- setValueInRange<const QDate &, QtDatePropertyManagerPrivate, QtDatePropertyManager, const QDate>(this, d_ptr,
+ setValueInRange<const QDate &, QtDatePropertyManagerPrivate, QtDatePropertyManager, const QDate>(this, d_ptr.data(),
&QtDatePropertyManager::propertyChanged,
&QtDatePropertyManager::valueChanged,
property, val, setSubPropertyValue);
@@ -1723,7 +1713,7 @@ void QtDatePropertyManager::setValue(QtProperty *property, const QDate &val)
*/
void QtDatePropertyManager::setMinimum(QtProperty *property, const QDate &minVal)
{
- setMinimumValue<const QDate &, QtDatePropertyManagerPrivate, QtDatePropertyManager, QDate, QtDatePropertyManagerPrivate::Data>(this, d_ptr,
+ setMinimumValue<const QDate &, QtDatePropertyManagerPrivate, QtDatePropertyManager, QDate, QtDatePropertyManagerPrivate::Data>(this, d_ptr.data(),
&QtDatePropertyManager::propertyChanged,
&QtDatePropertyManager::valueChanged,
&QtDatePropertyManager::rangeChanged,
@@ -1741,7 +1731,7 @@ void QtDatePropertyManager::setMinimum(QtProperty *property, const QDate &minVal
*/
void QtDatePropertyManager::setMaximum(QtProperty *property, const QDate &maxVal)
{
- setMaximumValue<const QDate &, QtDatePropertyManagerPrivate, QtDatePropertyManager, QDate, QtDatePropertyManagerPrivate::Data>(this, d_ptr,
+ setMaximumValue<const QDate &, QtDatePropertyManagerPrivate, QtDatePropertyManager, QDate, QtDatePropertyManagerPrivate::Data>(this, d_ptr.data(),
&QtDatePropertyManager::propertyChanged,
&QtDatePropertyManager::valueChanged,
&QtDatePropertyManager::rangeChanged,
@@ -1766,7 +1756,7 @@ void QtDatePropertyManager::setRange(QtProperty *property, const QDate &minVal,
{
void (QtDatePropertyManagerPrivate::*setSubPropertyRange)(QtProperty *, const QDate &,
const QDate &, const QDate &) = 0;
- setBorderValues<const QDate &, QtDatePropertyManagerPrivate, QtDatePropertyManager, QDate>(this, d_ptr,
+ setBorderValues<const QDate &, QtDatePropertyManagerPrivate, QtDatePropertyManager, QDate>(this, d_ptr.data(),
&QtDatePropertyManager::propertyChanged,
&QtDatePropertyManager::valueChanged,
&QtDatePropertyManager::rangeChanged,
@@ -1835,9 +1825,8 @@ public:
Creates a manager with the given \a parent.
*/
QtTimePropertyManager::QtTimePropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtTimePropertyManagerPrivate)
{
- d_ptr = new QtTimePropertyManagerPrivate;
d_ptr->q_ptr = this;
QLocale loc;
@@ -1850,7 +1839,6 @@ QtTimePropertyManager::QtTimePropertyManager(QObject *parent)
QtTimePropertyManager::~QtTimePropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -1950,9 +1938,8 @@ public:
Creates a manager with the given \a parent.
*/
QtDateTimePropertyManager::QtDateTimePropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtDateTimePropertyManagerPrivate)
{
- d_ptr = new QtDateTimePropertyManagerPrivate;
d_ptr->q_ptr = this;
QLocale loc;
@@ -1967,7 +1954,6 @@ QtDateTimePropertyManager::QtDateTimePropertyManager(QObject *parent)
QtDateTimePropertyManager::~QtDateTimePropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -2068,9 +2054,8 @@ public:
Creates a manager with the given \a parent.
*/
QtKeySequencePropertyManager::QtKeySequencePropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtKeySequencePropertyManagerPrivate)
{
- d_ptr = new QtKeySequencePropertyManagerPrivate;
d_ptr->q_ptr = this;
}
@@ -2080,7 +2065,6 @@ QtKeySequencePropertyManager::QtKeySequencePropertyManager(QObject *parent)
QtKeySequencePropertyManager::~QtKeySequencePropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -2179,9 +2163,8 @@ public:
Creates a manager with the given \a parent.
*/
QtCharPropertyManager::QtCharPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtCharPropertyManagerPrivate)
{
- d_ptr = new QtCharPropertyManagerPrivate;
d_ptr->q_ptr = this;
}
@@ -2191,7 +2174,6 @@ QtCharPropertyManager::QtCharPropertyManager(QObject *parent)
QtCharPropertyManager::~QtCharPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -2347,9 +2329,8 @@ void QtLocalePropertyManagerPrivate::slotPropertyDestroyed(QtProperty *property)
Creates a manager with the given \a parent.
*/
QtLocalePropertyManager::QtLocalePropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtLocalePropertyManagerPrivate)
{
- d_ptr = new QtLocalePropertyManagerPrivate;
d_ptr->q_ptr = this;
d_ptr->m_enumPropertyManager = new QtEnumPropertyManager(this);
@@ -2366,7 +2347,6 @@ QtLocalePropertyManager::QtLocalePropertyManager(QObject *parent)
QtLocalePropertyManager::~QtLocalePropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -2586,9 +2566,8 @@ void QtPointPropertyManagerPrivate::slotPropertyDestroyed(QtProperty *property)
Creates a manager with the given \a parent.
*/
QtPointPropertyManager::QtPointPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtPointPropertyManagerPrivate)
{
- d_ptr = new QtPointPropertyManagerPrivate;
d_ptr->q_ptr = this;
d_ptr->m_intPropertyManager = new QtIntPropertyManager(this);
@@ -2604,7 +2583,6 @@ QtPointPropertyManager::QtPointPropertyManager(QObject *parent)
QtPointPropertyManager::~QtPointPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -2818,9 +2796,8 @@ void QtPointFPropertyManagerPrivate::slotPropertyDestroyed(QtProperty *property)
Creates a manager with the given \a parent.
*/
QtPointFPropertyManager::QtPointFPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtPointFPropertyManagerPrivate)
{
- d_ptr = new QtPointFPropertyManagerPrivate;
d_ptr->q_ptr = this;
d_ptr->m_doublePropertyManager = new QtDoublePropertyManager(this);
@@ -2836,7 +2813,6 @@ QtPointFPropertyManager::QtPointFPropertyManager(QObject *parent)
QtPointFPropertyManager::~QtPointFPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -3131,9 +3107,8 @@ void QtSizePropertyManagerPrivate::setRange(QtProperty *property,
Creates a manager with the given \a parent.
*/
QtSizePropertyManager::QtSizePropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtSizePropertyManagerPrivate)
{
- d_ptr = new QtSizePropertyManagerPrivate;
d_ptr->q_ptr = this;
d_ptr->m_intPropertyManager = new QtIntPropertyManager(this);
@@ -3149,7 +3124,6 @@ QtSizePropertyManager::QtSizePropertyManager(QObject *parent)
QtSizePropertyManager::~QtSizePropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -3226,7 +3200,7 @@ QString QtSizePropertyManager::valueText(const QtProperty *property) const
*/
void QtSizePropertyManager::setValue(QtProperty *property, const QSize &val)
{
- setValueInRange<const QSize &, QtSizePropertyManagerPrivate, QtSizePropertyManager, const QSize>(this, d_ptr,
+ setValueInRange<const QSize &, QtSizePropertyManagerPrivate, QtSizePropertyManager, const QSize>(this, d_ptr.data(),
&QtSizePropertyManager::propertyChanged,
&QtSizePropertyManager::valueChanged,
property, val, &QtSizePropertyManagerPrivate::setValue);
@@ -3243,7 +3217,7 @@ void QtSizePropertyManager::setValue(QtProperty *property, const QSize &val)
*/
void QtSizePropertyManager::setMinimum(QtProperty *property, const QSize &minVal)
{
- setBorderValue<const QSize &, QtSizePropertyManagerPrivate, QtSizePropertyManager, QSize, QtSizePropertyManagerPrivate::Data>(this, d_ptr,
+ setBorderValue<const QSize &, QtSizePropertyManagerPrivate, QtSizePropertyManager, QSize, QtSizePropertyManagerPrivate::Data>(this, d_ptr.data(),
&QtSizePropertyManager::propertyChanged,
&QtSizePropertyManager::valueChanged,
&QtSizePropertyManager::rangeChanged,
@@ -3264,7 +3238,7 @@ void QtSizePropertyManager::setMinimum(QtProperty *property, const QSize &minVal
*/
void QtSizePropertyManager::setMaximum(QtProperty *property, const QSize &maxVal)
{
- setBorderValue<const QSize &, QtSizePropertyManagerPrivate, QtSizePropertyManager, QSize, QtSizePropertyManagerPrivate::Data>(this, d_ptr,
+ setBorderValue<const QSize &, QtSizePropertyManagerPrivate, QtSizePropertyManager, QSize, QtSizePropertyManagerPrivate::Data>(this, d_ptr.data(),
&QtSizePropertyManager::propertyChanged,
&QtSizePropertyManager::valueChanged,
&QtSizePropertyManager::rangeChanged,
@@ -3290,7 +3264,7 @@ void QtSizePropertyManager::setMaximum(QtProperty *property, const QSize &maxVal
*/
void QtSizePropertyManager::setRange(QtProperty *property, const QSize &minVal, const QSize &maxVal)
{
- setBorderValues<const QSize &, QtSizePropertyManagerPrivate, QtSizePropertyManager, QSize>(this, d_ptr,
+ setBorderValues<const QSize &, QtSizePropertyManagerPrivate, QtSizePropertyManager, QSize>(this, d_ptr.data(),
&QtSizePropertyManager::propertyChanged,
&QtSizePropertyManager::valueChanged,
&QtSizePropertyManager::rangeChanged,
@@ -3487,9 +3461,8 @@ void QtSizeFPropertyManagerPrivate::setRange(QtProperty *property,
Creates a manager with the given \a parent.
*/
QtSizeFPropertyManager::QtSizeFPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtSizeFPropertyManagerPrivate)
{
- d_ptr = new QtSizeFPropertyManagerPrivate;
d_ptr->q_ptr = this;
d_ptr->m_doublePropertyManager = new QtDoublePropertyManager(this);
@@ -3505,7 +3478,6 @@ QtSizeFPropertyManager::QtSizeFPropertyManager(QObject *parent)
QtSizeFPropertyManager::~QtSizeFPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -3593,7 +3565,7 @@ QString QtSizeFPropertyManager::valueText(const QtProperty *property) const
*/
void QtSizeFPropertyManager::setValue(QtProperty *property, const QSizeF &val)
{
- setValueInRange<const QSizeF &, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF>(this, d_ptr,
+ setValueInRange<const QSizeF &, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF>(this, d_ptr.data(),
&QtSizeFPropertyManager::propertyChanged,
&QtSizeFPropertyManager::valueChanged,
property, val, &QtSizeFPropertyManagerPrivate::setValue);
@@ -3644,7 +3616,7 @@ void QtSizeFPropertyManager::setDecimals(QtProperty *property, int prec)
*/
void QtSizeFPropertyManager::setMinimum(QtProperty *property, const QSizeF &minVal)
{
- setBorderValue<const QSizeF &, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF, QtSizeFPropertyManagerPrivate::Data>(this, d_ptr,
+ setBorderValue<const QSizeF &, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF, QtSizeFPropertyManagerPrivate::Data>(this, d_ptr.data(),
&QtSizeFPropertyManager::propertyChanged,
&QtSizeFPropertyManager::valueChanged,
&QtSizeFPropertyManager::rangeChanged,
@@ -3665,7 +3637,7 @@ void QtSizeFPropertyManager::setMinimum(QtProperty *property, const QSizeF &minV
*/
void QtSizeFPropertyManager::setMaximum(QtProperty *property, const QSizeF &maxVal)
{
- setBorderValue<const QSizeF &, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF, QtSizeFPropertyManagerPrivate::Data>(this, d_ptr,
+ setBorderValue<const QSizeF &, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF, QtSizeFPropertyManagerPrivate::Data>(this, d_ptr.data(),
&QtSizeFPropertyManager::propertyChanged,
&QtSizeFPropertyManager::valueChanged,
&QtSizeFPropertyManager::rangeChanged,
@@ -3691,7 +3663,7 @@ void QtSizeFPropertyManager::setMaximum(QtProperty *property, const QSizeF &maxV
*/
void QtSizeFPropertyManager::setRange(QtProperty *property, const QSizeF &minVal, const QSizeF &maxVal)
{
- setBorderValues<const QSizeF &, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF>(this, d_ptr,
+ setBorderValues<const QSizeF &, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF>(this, d_ptr.data(),
&QtSizeFPropertyManager::propertyChanged,
&QtSizeFPropertyManager::valueChanged,
&QtSizeFPropertyManager::rangeChanged,
@@ -3903,9 +3875,8 @@ void QtRectPropertyManagerPrivate::setConstraint(QtProperty *property,
Creates a manager with the given \a parent.
*/
QtRectPropertyManager::QtRectPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtRectPropertyManagerPrivate)
{
- d_ptr = new QtRectPropertyManagerPrivate;
d_ptr->q_ptr = this;
d_ptr->m_intPropertyManager = new QtIntPropertyManager(this);
@@ -3921,7 +3892,6 @@ QtRectPropertyManager::QtRectPropertyManager(QObject *parent)
QtRectPropertyManager::~QtRectPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -4325,9 +4295,8 @@ void QtRectFPropertyManagerPrivate::setConstraint(QtProperty *property,
Creates a manager with the given \a parent.
*/
QtRectFPropertyManager::QtRectFPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtRectFPropertyManagerPrivate)
{
- d_ptr = new QtRectFPropertyManagerPrivate;
d_ptr->q_ptr = this;
d_ptr->m_doublePropertyManager = new QtDoublePropertyManager(this);
@@ -4343,7 +4312,6 @@ QtRectFPropertyManager::QtRectFPropertyManager(QObject *parent)
QtRectFPropertyManager::~QtRectFPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -4710,9 +4678,8 @@ public:
Creates a manager with the given \a parent.
*/
QtEnumPropertyManager::QtEnumPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtEnumPropertyManagerPrivate)
{
- d_ptr = new QtEnumPropertyManagerPrivate;
d_ptr->q_ptr = this;
}
@@ -4722,7 +4689,6 @@ QtEnumPropertyManager::QtEnumPropertyManager(QObject *parent)
QtEnumPropertyManager::~QtEnumPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -5022,9 +4988,8 @@ void QtFlagPropertyManagerPrivate::slotPropertyDestroyed(QtProperty *property)
Creates a manager with the given \a parent.
*/
QtFlagPropertyManager::QtFlagPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtFlagPropertyManagerPrivate)
{
- d_ptr = new QtFlagPropertyManagerPrivate;
d_ptr->q_ptr = this;
d_ptr->m_boolPropertyManager = new QtBoolPropertyManager(this);
@@ -5040,7 +5005,6 @@ QtFlagPropertyManager::QtFlagPropertyManager(QObject *parent)
QtFlagPropertyManager::~QtFlagPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -5350,9 +5314,8 @@ void QtSizePolicyPropertyManagerPrivate::slotPropertyDestroyed(QtProperty *prope
Creates a manager with the given \a parent.
*/
QtSizePolicyPropertyManager::QtSizePolicyPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtSizePolicyPropertyManagerPrivate)
{
- d_ptr = new QtSizePolicyPropertyManagerPrivate;
d_ptr->q_ptr = this;
d_ptr->m_intPropertyManager = new QtIntPropertyManager(this);
@@ -5374,7 +5337,6 @@ QtSizePolicyPropertyManager::QtSizePolicyPropertyManager(QObject *parent)
QtSizePolicyPropertyManager::~QtSizePolicyPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -5762,9 +5724,8 @@ void QtFontPropertyManagerPrivate::slotFontDatabaseDelayedChange()
Creates a manager with the given \a parent.
*/
QtFontPropertyManager::QtFontPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtFontPropertyManagerPrivate)
{
- d_ptr = new QtFontPropertyManagerPrivate;
d_ptr->q_ptr = this;
QObject::connect(qApp, SIGNAL(fontDatabaseChanged()), this, SLOT(slotFontDatabaseChanged()));
@@ -5792,7 +5753,6 @@ QtFontPropertyManager::QtFontPropertyManager(QObject *parent)
QtFontPropertyManager::~QtFontPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -6140,9 +6100,8 @@ void QtColorPropertyManagerPrivate::slotPropertyDestroyed(QtProperty *property)
Creates a manager with the given \a parent.
*/
QtColorPropertyManager::QtColorPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtColorPropertyManagerPrivate)
{
- d_ptr = new QtColorPropertyManagerPrivate;
d_ptr->q_ptr = this;
d_ptr->m_intPropertyManager = new QtIntPropertyManager(this);
@@ -6159,7 +6118,6 @@ QtColorPropertyManager::QtColorPropertyManager(QObject *parent)
QtColorPropertyManager::~QtColorPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -6364,9 +6322,8 @@ public:
Creates a manager with the given \a parent.
*/
QtCursorPropertyManager::QtCursorPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtCursorPropertyManagerPrivate)
{
- d_ptr = new QtCursorPropertyManagerPrivate;
d_ptr->q_ptr = this;
}
@@ -6376,7 +6333,6 @@ QtCursorPropertyManager::QtCursorPropertyManager(QObject *parent)
QtCursorPropertyManager::~QtCursorPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
diff --git a/tools/shared/qtpropertybrowser/qtpropertymanager.h b/tools/shared/qtpropertybrowser/qtpropertymanager.h
index 2fb69bf..46ff485 100644
--- a/tools/shared/qtpropertybrowser/qtpropertymanager.h
+++ b/tools/shared/qtpropertybrowser/qtpropertymanager.h
@@ -94,7 +94,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtIntPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtIntPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtIntPropertyManager)
Q_DISABLE_COPY(QtIntPropertyManager)
};
@@ -120,7 +120,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtBoolPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtBoolPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtBoolPropertyManager)
Q_DISABLE_COPY(QtBoolPropertyManager)
};
@@ -157,7 +157,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtDoublePropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtDoublePropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtDoublePropertyManager)
Q_DISABLE_COPY(QtDoublePropertyManager)
};
@@ -185,7 +185,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtStringPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtStringPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtStringPropertyManager)
Q_DISABLE_COPY(QtStringPropertyManager)
};
@@ -216,7 +216,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtDatePropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtDatePropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtDatePropertyManager)
Q_DISABLE_COPY(QtDatePropertyManager)
};
@@ -241,7 +241,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtTimePropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtTimePropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtTimePropertyManager)
Q_DISABLE_COPY(QtTimePropertyManager)
};
@@ -266,7 +266,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtDateTimePropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtDateTimePropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtDateTimePropertyManager)
Q_DISABLE_COPY(QtDateTimePropertyManager)
};
@@ -291,7 +291,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtKeySequencePropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtKeySequencePropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtKeySequencePropertyManager)
Q_DISABLE_COPY(QtKeySequencePropertyManager)
};
@@ -316,7 +316,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtCharPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtCharPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtCharPropertyManager)
Q_DISABLE_COPY(QtCharPropertyManager)
};
@@ -344,7 +344,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtLocalePropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtLocalePropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtLocalePropertyManager)
Q_DISABLE_COPY(QtLocalePropertyManager)
Q_PRIVATE_SLOT(d_func(), void slotEnumChanged(QtProperty *, int))
@@ -373,7 +373,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtPointPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtPointPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtPointPropertyManager)
Q_DISABLE_COPY(QtPointPropertyManager)
Q_PRIVATE_SLOT(d_func(), void slotIntChanged(QtProperty *, int))
@@ -405,7 +405,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtPointFPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtPointFPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtPointFPropertyManager)
Q_DISABLE_COPY(QtPointFPropertyManager)
Q_PRIVATE_SLOT(d_func(), void slotDoubleChanged(QtProperty *, double))
@@ -440,7 +440,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtSizePropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtSizePropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtSizePropertyManager)
Q_DISABLE_COPY(QtSizePropertyManager)
Q_PRIVATE_SLOT(d_func(), void slotIntChanged(QtProperty *, int))
@@ -478,7 +478,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtSizeFPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtSizeFPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtSizeFPropertyManager)
Q_DISABLE_COPY(QtSizeFPropertyManager)
Q_PRIVATE_SLOT(d_func(), void slotDoubleChanged(QtProperty *, double))
@@ -510,7 +510,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtRectPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtRectPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtRectPropertyManager)
Q_DISABLE_COPY(QtRectPropertyManager)
Q_PRIVATE_SLOT(d_func(), void slotIntChanged(QtProperty *, int))
@@ -545,7 +545,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtRectFPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtRectFPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtRectFPropertyManager)
Q_DISABLE_COPY(QtRectFPropertyManager)
Q_PRIVATE_SLOT(d_func(), void slotDoubleChanged(QtProperty *, double))
@@ -579,7 +579,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtEnumPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtEnumPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtEnumPropertyManager)
Q_DISABLE_COPY(QtEnumPropertyManager)
};
@@ -609,7 +609,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtFlagPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtFlagPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtFlagPropertyManager)
Q_DISABLE_COPY(QtFlagPropertyManager)
Q_PRIVATE_SLOT(d_func(), void slotBoolChanged(QtProperty *, bool))
@@ -639,7 +639,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtSizePolicyPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtSizePolicyPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtSizePolicyPropertyManager)
Q_DISABLE_COPY(QtSizePolicyPropertyManager)
Q_PRIVATE_SLOT(d_func(), void slotIntChanged(QtProperty *, int))
@@ -672,7 +672,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtFontPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtFontPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtFontPropertyManager)
Q_DISABLE_COPY(QtFontPropertyManager)
Q_PRIVATE_SLOT(d_func(), void slotIntChanged(QtProperty *, int))
@@ -706,7 +706,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtColorPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtColorPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtColorPropertyManager)
Q_DISABLE_COPY(QtColorPropertyManager)
Q_PRIVATE_SLOT(d_func(), void slotIntChanged(QtProperty *, int))
@@ -736,7 +736,7 @@ protected:
virtual void initializeProperty(QtProperty *property);
virtual void uninitializeProperty(QtProperty *property);
private:
- QtCursorPropertyManagerPrivate *d_ptr;
+ QScopedPointer<QtCursorPropertyManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtCursorPropertyManager)
Q_DISABLE_COPY(QtCursorPropertyManager)
};
diff --git a/tools/shared/qtpropertybrowser/qttreepropertybrowser.cpp b/tools/shared/qtpropertybrowser/qttreepropertybrowser.cpp
index 1ad3f6b..77af2d4 100644
--- a/tools/shared/qtpropertybrowser/qttreepropertybrowser.cpp
+++ b/tools/shared/qtpropertybrowser/qttreepropertybrowser.cpp
@@ -726,9 +726,8 @@ void QtTreePropertyBrowserPrivate::editItem(QtBrowserItem *browserItem)
Creates a property browser with the given \a parent.
*/
QtTreePropertyBrowser::QtTreePropertyBrowser(QWidget *parent)
- : QtAbstractPropertyBrowser(parent)
+ : QtAbstractPropertyBrowser(parent), d_ptr(new QtTreePropertyBrowserPrivate)
{
- d_ptr = new QtTreePropertyBrowserPrivate;
d_ptr->q_ptr = this;
d_ptr->init(this);
@@ -747,7 +746,6 @@ QtTreePropertyBrowser::QtTreePropertyBrowser(QWidget *parent)
*/
QtTreePropertyBrowser::~QtTreePropertyBrowser()
{
- delete d_ptr;
}
/*!
diff --git a/tools/shared/qtpropertybrowser/qttreepropertybrowser.h b/tools/shared/qtpropertybrowser/qttreepropertybrowser.h
index 813e050..8f21588 100644
--- a/tools/shared/qtpropertybrowser/qttreepropertybrowser.h
+++ b/tools/shared/qtpropertybrowser/qttreepropertybrowser.h
@@ -118,7 +118,7 @@ protected:
private:
- QtTreePropertyBrowserPrivate *d_ptr;
+ QScopedPointer<QtTreePropertyBrowserPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtTreePropertyBrowser)
Q_DISABLE_COPY(QtTreePropertyBrowser)
diff --git a/tools/shared/qtpropertybrowser/qtvariantproperty.cpp b/tools/shared/qtpropertybrowser/qtvariantproperty.cpp
index f712ba6..8931419 100644
--- a/tools/shared/qtpropertybrowser/qtvariantproperty.cpp
+++ b/tools/shared/qtpropertybrowser/qtvariantproperty.cpp
@@ -188,9 +188,8 @@ public:
\sa QtVariantPropertyManager
*/
QtVariantProperty::QtVariantProperty(QtVariantPropertyManager *manager)
- : QtProperty(manager), d_ptr(new QtVariantPropertyPrivate(manager))
+ : QtProperty(manager), d_ptr(new QtVariantPropertyPrivate(manager))
{
-
}
/*!
@@ -200,7 +199,6 @@ QtVariantProperty::QtVariantProperty(QtVariantPropertyManager *manager)
*/
QtVariantProperty::~QtVariantProperty()
{
- delete d_ptr;
}
/*!
@@ -912,9 +910,8 @@ void QtVariantPropertyManagerPrivate::slotFlagNamesChanged(QtProperty *property,
Creates a manager with the given \a parent.
*/
QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent)
- : QtAbstractPropertyManager(parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtVariantPropertyManagerPrivate)
{
- d_ptr = new QtVariantPropertyManagerPrivate;
d_ptr->q_ptr = this;
d_ptr->m_creatingProperty = false;
@@ -1234,7 +1231,6 @@ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent)
QtVariantPropertyManager::~QtVariantPropertyManager()
{
clear();
- delete d_ptr;
}
/*!
@@ -1929,9 +1925,8 @@ public:
Creates a factory with the given \a parent.
*/
QtVariantEditorFactory::QtVariantEditorFactory(QObject *parent)
- : QtAbstractEditorFactory<QtVariantPropertyManager>(parent)
+ : QtAbstractEditorFactory<QtVariantPropertyManager>(parent), d_ptr(new QtVariantEditorFactoryPrivate())
{
- d_ptr = new QtVariantEditorFactoryPrivate();
d_ptr->q_ptr = this;
d_ptr->m_spinBoxFactory = new QtSpinBoxFactory(this);
@@ -1993,7 +1988,6 @@ QtVariantEditorFactory::QtVariantEditorFactory(QObject *parent)
*/
QtVariantEditorFactory::~QtVariantEditorFactory()
{
- delete d_ptr;
}
/*!
diff --git a/tools/shared/qtpropertybrowser/qtvariantproperty.h b/tools/shared/qtpropertybrowser/qtvariantproperty.h
index 9253809..2576f30 100644
--- a/tools/shared/qtpropertybrowser/qtvariantproperty.h
+++ b/tools/shared/qtpropertybrowser/qtvariantproperty.h
@@ -67,7 +67,7 @@ protected:
QtVariantProperty(QtVariantPropertyManager *manager);
private:
friend class QtVariantPropertyManager;
- class QtVariantPropertyPrivate *d_ptr;
+ QScopedPointer<class QtVariantPropertyPrivate> d_ptr;
};
class QtVariantPropertyManager : public QtAbstractPropertyManager
@@ -111,7 +111,7 @@ protected:
virtual void uninitializeProperty(QtProperty *property);
virtual QtProperty *createProperty();
private:
- class QtVariantPropertyManagerPrivate *d_ptr;
+ QScopedPointer<class QtVariantPropertyManagerPrivate> d_ptr;
Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, int))
Q_PRIVATE_SLOT(d_func(), void slotRangeChanged(QtProperty *, int, int))
Q_PRIVATE_SLOT(d_func(), void slotSingleStepChanged(QtProperty *, int))
@@ -165,7 +165,7 @@ protected:
QWidget *parent);
void disconnectPropertyManager(QtVariantPropertyManager *manager);
private:
- class QtVariantEditorFactoryPrivate *d_ptr;
+ QScopedPointer<class QtVariantEditorFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtVariantEditorFactory)
Q_DISABLE_COPY(QtVariantEditorFactory)
};
diff --git a/tools/shared/qttoolbardialog/qttoolbardialog.cpp b/tools/shared/qttoolbardialog/qttoolbardialog.cpp
index f15c4bc..5ace584 100644
--- a/tools/shared/qttoolbardialog/qttoolbardialog.cpp
+++ b/tools/shared/qttoolbardialog/qttoolbardialog.cpp
@@ -119,7 +119,7 @@ signals:
void toolBarChanged(QToolBar *toolBar, const QList<QAction *> &actions);
private:
- QtFullToolBarManagerPrivate *d_ptr;
+ QScopedPointer<QtFullToolBarManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtFullToolBarManager)
Q_DISABLE_COPY(QtFullToolBarManager)
};
@@ -443,15 +443,13 @@ QToolBar *QtFullToolBarManagerPrivate::toolBarByName(const QString &toolBarName)
//////////////////////////////
QtFullToolBarManager::QtFullToolBarManager(QObject *parent)
- : QObject(parent)
+ : QObject(parent), d_ptr(new QtFullToolBarManagerPrivate)
{
- d_ptr = new QtFullToolBarManagerPrivate;
d_ptr->q_ptr = this;
}
QtFullToolBarManager::~QtFullToolBarManager()
{
- delete d_ptr;
}
void QtFullToolBarManager::setMainWindow(QMainWindow *mainWindow)
@@ -831,9 +829,8 @@ public:
Creates a toolbar manager with the given \a parent.
*/
QtToolBarManager::QtToolBarManager(QObject *parent)
- : QObject(parent)
+ : QObject(parent), d_ptr(new QtToolBarManagerPrivate)
{
- d_ptr = new QtToolBarManagerPrivate;
d_ptr->q_ptr = this;
d_ptr->manager = new QtFullToolBarManager(this);
@@ -844,7 +841,6 @@ QtToolBarManager::QtToolBarManager(QObject *parent)
*/
QtToolBarManager::~QtToolBarManager()
{
- delete d_ptr;
}
/*!
@@ -1781,9 +1777,8 @@ void QtToolBarListWidget::dropEvent(QDropEvent *event)
window \a flags.
*/
QtToolBarDialog::QtToolBarDialog(QWidget *parent, Qt::WindowFlags flags)
- : QDialog(parent, flags)
+ : QDialog(parent, flags), d_ptr(new QtToolBarDialogPrivate)
{
- d_ptr = new QtToolBarDialogPrivate;
d_ptr->q_ptr = this;
d_ptr->ui.setupUi(this);
d_ptr->separatorText = tr("< S E P A R A T O R >");
@@ -1834,7 +1829,6 @@ QtToolBarDialog::QtToolBarDialog(QWidget *parent, Qt::WindowFlags flags)
QtToolBarDialog::~QtToolBarDialog()
{
d_ptr->clearOld();
- delete d_ptr;
}
/*!
diff --git a/tools/shared/qttoolbardialog/qttoolbardialog.h b/tools/shared/qttoolbardialog/qttoolbardialog.h
index 879b437..a0734d2 100644
--- a/tools/shared/qttoolbardialog/qttoolbardialog.h
+++ b/tools/shared/qttoolbardialog/qttoolbardialog.h
@@ -88,7 +88,7 @@ public:
private:
friend class QtToolBarDialog;
- QtToolBarManagerPrivate *d_ptr;
+ QScopedPointer<QtToolBarManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtToolBarManager)
Q_DISABLE_COPY(QtToolBarManager)
};
@@ -112,7 +112,7 @@ protected:
private:
- QtToolBarDialogPrivate *d_ptr;
+ QScopedPointer<QtToolBarDialogPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtToolBarDialog)
Q_DISABLE_COPY(QtToolBarDialog)
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/assistant_ja.ts b/translations/assistant_ja.ts
index 1853155..5e4d2c9 100644
--- a/translations/assistant_ja.ts
+++ b/translations/assistant_ja.ts
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.0">
+<TS version="2.0" language="ja_JP">
<context>
<name>AboutDialog</name>
<message>
<location filename="../tools/assistant/tools/assistant/aboutdialog.cpp" line="+110"/>
<source>&amp;Close</source>
- <translation type="unfinished"></translation>
+ <translation>閉じる(&amp;C)</translation>
</message>
</context>
<context>
@@ -14,18 +14,19 @@
<message>
<location line="-14"/>
<source>Warning</source>
- <translation type="unfinished"></translation>
+ <translation>警告</translation>
</message>
<message>
<location line="+1"/>
<source>Unable to launch external application.
</source>
- <translation type="unfinished"></translation>
+ <translation>外部アプリケーションを起動できません。
+</translation>
</message>
<message>
<location line="+1"/>
<source>OK</source>
- <translation type="unfinished"></translation>
+ <translation>OK</translation>
</message>
</context>
<context>
@@ -37,42 +38,42 @@
<location line="+24"/>
<location line="+32"/>
<source>Bookmarks</source>
- <translation type="unfinished"></translation>
+ <translation>ブックマーク</translation>
</message>
<message>
<location filename="../tools/assistant/tools/assistant/bookmarkdialog.ui"/>
<source>Add Bookmark</source>
- <translation type="unfinished"></translation>
+ <translation>ブックマークの追加</translation>
</message>
<message>
<location/>
<source>Bookmark:</source>
- <translation type="unfinished"></translation>
+ <translation>ブックマーク:</translation>
</message>
<message>
<location/>
<source>Add in Folder:</source>
- <translation type="unfinished"></translation>
+ <translation>追加先フォルダ:</translation>
</message>
<message>
<location/>
<source>+</source>
- <translation type="unfinished"></translation>
+ <translation>+</translation>
</message>
<message>
<location/>
<source>New Folder</source>
- <translation type="unfinished"></translation>
+ <translation>新しいフォルダ</translation>
</message>
<message>
<location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="-69"/>
<source>Delete Folder</source>
- <translation type="unfinished"></translation>
+ <translation>フォルダを削除</translation>
</message>
<message>
<location line="+1"/>
<source>Rename Folder</source>
- <translation type="unfinished"></translation>
+ <translation>フォルダの名前変更</translation>
</message>
</context>
<context>
@@ -80,23 +81,23 @@
<message>
<location line="+450"/>
<source>Bookmarks</source>
- <translation type="unfinished"></translation>
+ <translation>ブックマーク</translation>
</message>
<message>
<location line="+36"/>
<source>Remove</source>
- <translation type="unfinished"></translation>
+ <translation>削除</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 type="unfinished"></translation>
+ <translation>フォルダを削除すると中身も削除されますが、続けてよろしいですか?</translation>
</message>
<message>
<location line="+109"/>
<location line="+9"/>
<source>New Folder</source>
- <translation type="unfinished"></translation>
+ <translation>新しいフォルダ</translation>
</message>
</context>
<context>
@@ -104,47 +105,47 @@
<message>
<location line="-391"/>
<source>Filter:</source>
- <translation type="unfinished"></translation>
+ <translation>フィルタ:</translation>
</message>
<message>
<location line="+32"/>
<source>Remove</source>
- <translation type="unfinished"></translation>
+ <translation>削除</translation>
</message>
<message>
<location line="-78"/>
<source>Delete Folder</source>
- <translation type="unfinished"></translation>
+ <translation>フォルダを削除</translation>
</message>
<message>
<location line="+1"/>
<source>Rename Folder</source>
- <translation type="unfinished"></translation>
+ <translation>フォルダの名前変更</translation>
</message>
<message>
<location line="+2"/>
<source>Show Bookmark</source>
- <translation type="unfinished"></translation>
+ <translation>ブックマークを開く</translation>
</message>
<message>
<location line="+1"/>
<source>Show Bookmark in New Tab</source>
- <translation type="unfinished"></translation>
+ <translation>ブックマークを新しいタブで開く</translation>
</message>
<message>
<location line="+3"/>
<source>Delete Bookmark</source>
- <translation type="unfinished"></translation>
+ <translation>ブックマークを削除</translation>
</message>
<message>
<location line="+1"/>
<source>Rename Bookmark</source>
- <translation type="unfinished"></translation>
+ <translation>ブックマークの名前変更</translation>
</message>
<message>
<location line="+61"/>
<source>Add</source>
- <translation type="unfinished"></translation>
+ <translation>追加</translation>
</message>
</context>
<context>
@@ -152,48 +153,48 @@
<message>
<location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="+195"/>
<source>Add new page</source>
- <translation type="unfinished"></translation>
+ <translation>新しいページの追加</translation>
</message>
<message>
<location line="+9"/>
<source>Close current page</source>
- <translation type="unfinished"></translation>
+ <translation>現在のページを閉じる</translation>
</message>
<message>
<location line="+265"/>
<source>Print Document</source>
- <translation type="unfinished"></translation>
+ <translation>ドキュメントを印刷</translation>
</message>
<message>
<location line="+147"/>
<location line="+2"/>
<source>unknown</source>
- <translation type="unfinished"></translation>
+ <translation>不明</translation>
</message>
<message>
<location line="+96"/>
<source>Add New Page</source>
- <translation type="unfinished"></translation>
+ <translation>新しいページの追加</translation>
</message>
<message>
<location line="+1"/>
<source>Close This Page</source>
- <translation type="unfinished"></translation>
+ <translation>このページを閉じる</translation>
</message>
<message>
<location line="+1"/>
<source>Close Other Pages</source>
- <translation type="unfinished"></translation>
+ <translation>他のページを閉じる</translation>
</message>
<message>
<location line="+2"/>
<source>Add Bookmark for this Page...</source>
- <translation type="unfinished"></translation>
+ <translation>このページをブックマークに追加...</translation>
</message>
<message>
<location line="+257"/>
<source>Search</source>
- <translation type="unfinished"></translation>
+ <translation>検索</translation>
</message>
</context>
<context>
@@ -201,12 +202,12 @@
<message>
<location filename="../tools/assistant/tools/assistant/contentwindow.cpp" line="+155"/>
<source>Open Link</source>
- <translation type="unfinished"></translation>
+ <translation>リンクを開く</translation>
</message>
<message>
<location line="+1"/>
<source>Open Link in New Tab</source>
- <translation type="unfinished"></translation>
+ <translation>リンクを新しいタブで開く</translation>
</message>
</context>
<context>
@@ -214,12 +215,12 @@
<message>
<location filename="../tools/assistant/tools/assistant/filternamedialog.ui"/>
<source>Add Filter Name</source>
- <translation type="unfinished"></translation>
+ <translation>フィルタ名を追加</translation>
</message>
<message>
<location/>
<source>Filter Name:</source>
- <translation type="unfinished"></translation>
+ <translation>フィルタ名:</translation>
</message>
</context>
<context>
@@ -227,27 +228,27 @@
<message>
<location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="-863"/>
<source>Previous</source>
- <translation type="unfinished"></translation>
+ <translation>戻る</translation>
</message>
<message>
<location line="+7"/>
<source>Next</source>
- <translation type="unfinished"></translation>
+ <translation>進む</translation>
</message>
<message>
<location line="+5"/>
<source>Case Sensitive</source>
- <translation type="unfinished"></translation>
+ <translation>大文字/小文字を区別する</translation>
</message>
<message>
<location line="+3"/>
<source>Whole words</source>
- <translation type="unfinished"></translation>
+ <translation>単語単位で検索する</translation>
</message>
<message>
<location line="+12"/>
<source>&lt;img src=&quot;:/trolltech/assistant/images/wrap.png&quot;&gt;&amp;nbsp;Search wrapped</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;img src=&quot;:/trolltech/assistant/images/wrap.png&quot;&gt;&amp;nbsp;見つからなければ先頭から検索する</translation>
</message>
</context>
<context>
@@ -255,27 +256,27 @@
<message>
<location filename="../tools/shared/fontpanel/fontpanel.cpp" line="+63"/>
<source>Font</source>
- <translation type="unfinished"></translation>
+ <translation>フォント</translation>
</message>
<message>
<location line="+11"/>
<source>&amp;Writing system</source>
- <translation type="unfinished"></translation>
+ <translation>文字セット(&amp;W)</translation>
</message>
<message>
<location line="+3"/>
<source>&amp;Family</source>
- <translation type="unfinished"></translation>
+ <translation>フォント名(&amp;F)</translation>
</message>
<message>
<location line="+4"/>
<source>&amp;Style</source>
- <translation type="unfinished"></translation>
+ <translation>スタイル(&amp;S)</translation>
</message>
<message>
<location line="+4"/>
<source>&amp;Point size</source>
- <translation type="unfinished"></translation>
+ <translation>サイズ(&amp;P)</translation>
</message>
</context>
<context>
@@ -283,38 +284,39 @@
<message>
<location filename="../tools/assistant/tools/assistant/helpviewer.cpp" line="+481"/>
<source>Help</source>
- <translation type="unfinished"></translation>
+ <translation>ヘルプ</translation>
</message>
<message>
<location line="+1"/>
<source>OK</source>
- <translation type="unfinished"></translation>
+ <translation>OK</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 type="unfinished"></translation>
+ <translation>&lt;title&gt;Error 404...&lt;/title&gt;&lt;div align=&quot;center&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;h1&gt;ページが見つかりませんでした&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 type="unfinished"></translation>
+ <translation>リンクのURLをコピー(&amp;L)</translation>
</message>
<message>
<location line="+3"/>
<source>Open Link in New Tab Ctrl+LMB</source>
- <translation type="unfinished"></translation>
+ <translation>リンクを新しいタブで開く Ctrl+LMB</translation>
</message>
<message>
<location line="-267"/>
<source>Open Link in New Tab</source>
- <translation type="unfinished"></translation>
+ <translation>リンクを新しいタブで開く</translation>
</message>
<message>
<location line="+201"/>
<source>Unable to launch external application.
</source>
- <translation type="unfinished"></translation>
+ <translation>外部アプリケーションを起動できません。
+</translation>
</message>
</context>
<context>
@@ -322,17 +324,17 @@
<message>
<location filename="../tools/assistant/tools/assistant/indexwindow.cpp" line="+66"/>
<source>&amp;Look for:</source>
- <translation type="unfinished"></translation>
+ <translation>検索文字列(&amp;L):</translation>
</message>
<message>
<location line="+68"/>
<source>Open Link</source>
- <translation type="unfinished"></translation>
+ <translation>リンクを開く</translation>
</message>
<message>
<location line="+1"/>
<source>Open Link in New Tab</source>
- <translation type="unfinished"></translation>
+ <translation>リンクを新しいタブで開く</translation>
</message>
</context>
<context>
@@ -341,97 +343,98 @@
<location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="+75"/>
<location filename="../tools/assistant/tools/assistant/installdialog.ui"/>
<source>Install Documentation</source>
- <translation type="unfinished"></translation>
+ <translation>ドキュメントのインストール</translation>
</message>
<message>
<location line="+30"/>
<source>Downloading documentation info...</source>
- <translation type="unfinished"></translation>
+ <translation>ドキュメント情報をダウンロード中...</translation>
</message>
<message>
<location line="+48"/>
<source>Download canceled.</source>
- <translation type="unfinished"></translation>
+ <translation>ダウンロードを中止しました。</translation>
</message>
<message>
<location line="+26"/>
<location line="+78"/>
<location line="+27"/>
<source>Done.</source>
- <translation type="unfinished"></translation>
+ <translation>完了.</translation>
</message>
<message>
<location line="-90"/>
<source>The file %1 already exists. Do you want to overwrite it?</source>
- <translation type="unfinished"></translation>
+ <translation>%1 は既に存在します。上書きしますか?</translation>
</message>
<message>
<location line="+11"/>
<source>Unable to save the file %1: %2.</source>
- <translation type="unfinished"></translation>
+ <translation>ファイルを保存できません。%1: %2.</translation>
</message>
<message>
<location line="+8"/>
<source>Downloading %1...</source>
- <translation type="unfinished"></translation>
+ <translation>%1 をダウンロード中...</translation>
</message>
<message>
<location line="+19"/>
<location line="+42"/>
<location line="+38"/>
<source>Download failed: %1.</source>
- <translation type="unfinished"></translation>
+ <translation>ダウンロード失敗: %1.</translation>
</message>
<message>
<location line="-70"/>
<source>Documentation info file is corrupt!</source>
- <translation type="unfinished"></translation>
+ <translation>ドキュメント情報ファイルが不正です!</translation>
</message>
<message>
<location line="+37"/>
<source>Download failed: Downloaded file is corrupted.</source>
- <translation type="unfinished"></translation>
+ <translation>ダウンロード失敗: ダウンロードしたファイルが不正です。</translation>
</message>
<message>
<location line="+2"/>
<source>Installing documentation %1...</source>
- <translation type="unfinished"></translation>
+ <translation>%1 のドキュメントをインストール中...</translation>
</message>
<message>
<location line="+22"/>
<source>Error while installing documentation:
%1</source>
- <translation type="unfinished"></translation>
+ <translation>ドキュメントのインストール中にエラーが発生しました:
+%1 </translation>
</message>
<message>
<location filename="../tools/assistant/tools/assistant/installdialog.ui"/>
<source>Available Documentation:</source>
- <translation type="unfinished"></translation>
+ <translation>使用可能なドキュメント:</translation>
</message>
<message>
<location/>
<source>Install</source>
- <translation type="unfinished"></translation>
+ <translation>インストール</translation>
</message>
<message>
<location/>
<source>Cancel</source>
- <translation type="unfinished"></translation>
+ <translation>キャンセル</translation>
</message>
<message>
<location/>
<source>Close</source>
- <translation type="unfinished"></translation>
+ <translation>閉じる</translation>
</message>
<message>
<location/>
<source>Installation Path:</source>
- <translation type="unfinished"></translation>
+ <translation>インストール先のパス:</translation>
</message>
<message>
<location/>
<source>...</source>
- <translation type="unfinished"></translation>
+ <translation>...</translation>
</message>
</context>
<context>
@@ -440,298 +443,298 @@
<location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="+108"/>
<location line="+350"/>
<source>Index</source>
- <translation type="unfinished"></translation>
+ <translation>インデックス</translation>
</message>
<message>
<location line="-344"/>
<location line="+342"/>
<source>Contents</source>
- <translation type="unfinished"></translation>
+ <translation>コンテンツ</translation>
</message>
<message>
<location line="-337"/>
<location line="+341"/>
<source>Bookmarks</source>
- <translation type="unfinished"></translation>
+ <translation>ブックマーク</translation>
</message>
<message>
<location line="-329"/>
<location line="+331"/>
<source>Search</source>
- <translation type="unfinished"></translation>
+ <translation>検索</translation>
</message>
<message>
<location line="-319"/>
<location line="+192"/>
<location line="+470"/>
<source>Qt Assistant</source>
- <translation type="unfinished"></translation>
+ <translation>Qt Assistant</translation>
</message>
<message>
<location line="-501"/>
<location line="+4"/>
<source>Unfiltered</source>
- <translation type="unfinished"></translation>
+ <translation>フィルタなし</translation>
</message>
<message>
<location line="+84"/>
<source>Page Set&amp;up...</source>
- <translation type="unfinished"></translation>
+ <translation>ページ設定(&amp;U)...</translation>
</message>
<message>
<location line="+2"/>
<source>Print Preview...</source>
- <translation type="unfinished"></translation>
+ <translation>印刷プレビュー...</translation>
</message>
<message>
<location line="+3"/>
<source>&amp;Print...</source>
- <translation type="unfinished"></translation>
+ <translation>印刷(&amp;P)...</translation>
</message>
<message>
<location line="+6"/>
<source>New &amp;Tab</source>
- <translation type="unfinished"></translation>
+ <translation>新しいタブ(&amp;T)</translation>
</message>
<message>
<location line="+3"/>
<source>&amp;Close Tab</source>
- <translation type="unfinished"></translation>
+ <translation>タブを閉じる(&amp;C)</translation>
</message>
<message>
<location line="+4"/>
<source>&amp;Quit</source>
- <translation type="unfinished"></translation>
+ <translation>終了(&amp;Q)</translation>
</message>
<message>
<location line="+1"/>
<source>CTRL+Q</source>
- <translation type="unfinished"></translation>
+ <translation>CTRL+Q</translation>
</message>
<message>
<location line="+4"/>
<source>&amp;Copy selected Text</source>
- <translation type="unfinished"></translation>
+ <translation>選択中の文字をコピー(&amp;C)</translation>
</message>
<message>
<location line="+6"/>
<source>&amp;Find in Text...</source>
- <translation type="unfinished"></translation>
+ <translation>検索(&amp;F)...</translation>
</message>
<message>
<location line="+5"/>
<source>Find &amp;Next</source>
- <translation type="unfinished"></translation>
+ <translation>次を検索(&amp;N)</translation>
</message>
<message>
<location line="+4"/>
<source>Find &amp;Previous</source>
- <translation type="unfinished"></translation>
+ <translation>前を検索(&amp;P)</translation>
</message>
<message>
<location line="+5"/>
<source>Preferences...</source>
- <translation type="unfinished"></translation>
+ <translation>設定...</translation>
</message>
<message>
<location line="+4"/>
<source>Zoom &amp;in</source>
- <translation type="unfinished"></translation>
+ <translation>拡大(&amp;I)</translation>
</message>
<message>
<location line="+5"/>
<source>Zoom &amp;out</source>
- <translation type="unfinished"></translation>
+ <translation>縮小(&amp;O)</translation>
</message>
<message>
<location line="+5"/>
<source>Normal &amp;Size</source>
- <translation type="unfinished"></translation>
+ <translation>普通の大きさ(&amp;S)</translation>
</message>
<message>
<location line="+3"/>
<source>Ctrl+0</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl+0</translation>
</message>
<message>
<location line="+5"/>
<source>ALT+C</source>
- <translation type="unfinished"></translation>
+ <translation>ALT+C</translation>
</message>
<message>
<location line="+2"/>
<source>ALT+I</source>
- <translation type="unfinished"></translation>
+ <translation>ALT+I</translation>
</message>
<message>
<location line="+4"/>
<source>ALT+S</source>
- <translation type="unfinished"></translation>
+ <translation>ALT+S</translation>
</message>
<message>
<location line="+3"/>
<source>&amp;Home</source>
- <translation type="unfinished"></translation>
+ <translation>ホーム(&amp;H)</translation>
</message>
<message>
<location line="+1"/>
<source>Ctrl+Home</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl+Home</translation>
</message>
<message>
<location line="+3"/>
<source>&amp;Back</source>
- <translation type="unfinished"></translation>
+ <translation>戻る(&amp;B)</translation>
</message>
<message>
<location line="+5"/>
<source>&amp;Forward</source>
- <translation type="unfinished"></translation>
+ <translation>進む(&amp;F)</translation>
</message>
<message>
<location line="+5"/>
<source>Sync with Table of Contents</source>
- <translation type="unfinished"></translation>
+ <translation>内容と目次を同期する</translation>
</message>
<message>
<location line="+6"/>
<source>Next Page</source>
- <translation type="unfinished"></translation>
+ <translation>次のページ</translation>
</message>
<message>
<location line="+1"/>
<source>Ctrl+Alt+Right</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl+Alt+Right</translation>
</message>
<message>
<location line="+3"/>
<source>Previous Page</source>
- <translation type="unfinished"></translation>
+ <translation>前のページ</translation>
</message>
<message>
<location line="+1"/>
<source>Ctrl+Alt+Left</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl+Alt+Left</translation>
</message>
<message>
<location line="+4"/>
<source>Add Bookmark...</source>
- <translation type="unfinished"></translation>
+ <translation>ブックマークの追加...</translation>
</message>
<message>
<location line="+4"/>
<source>About...</source>
- <translation type="unfinished"></translation>
+ <translation>Qt Assistant について...</translation>
</message>
<message>
<location line="+3"/>
<source>Navigation Toolbar</source>
- <translation type="unfinished"></translation>
+ <translation>ナビゲーション ツールバー</translation>
</message>
<message>
<location line="+74"/>
<source>Toolbars</source>
- <translation type="unfinished"></translation>
+ <translation>ツールバー</translation>
</message>
<message>
<location line="+15"/>
<source>Filter Toolbar</source>
- <translation type="unfinished"></translation>
+ <translation>フィルター ツールバー</translation>
</message>
<message>
<location line="+2"/>
<source>Filtered by:</source>
- <translation type="unfinished"></translation>
+ <translation>フィルタ条件:</translation>
</message>
<message>
<location line="+23"/>
<source>Address Toolbar</source>
- <translation type="unfinished"></translation>
+ <translation>アドレス ツールバー</translation>
</message>
<message>
<location line="+4"/>
<source>Address:</source>
- <translation type="unfinished"></translation>
+ <translation>アドレス:</translation>
</message>
<message>
<location line="+110"/>
<source>Could not find the associated content item.</source>
- <translation type="unfinished"></translation>
+ <translation>関連付いた内容が見つかりません。</translation>
</message>
<message>
<location line="+81"/>
<source>About %1</source>
- <translation type="unfinished"></translation>
+ <translation>%1 について</translation>
</message>
<message>
<location line="+115"/>
<source>Updating search index</source>
- <translation type="unfinished"></translation>
+ <translation>検索インデックスを更新中</translation>
</message>
<message>
<location line="-597"/>
<source>Looking for Qt Documentation...</source>
- <translation type="unfinished"></translation>
+ <translation>Qt ドキュメントを探しています...</translation>
</message>
<message>
<location line="+195"/>
<source>&amp;Window</source>
- <translation type="unfinished"></translation>
+ <translation>ウィンドウ(&amp;W)</translation>
</message>
<message>
<location line="+3"/>
<source>Minimize</source>
- <translation type="unfinished"></translation>
+ <translation>最小化</translation>
</message>
<message>
<location line="+1"/>
<source>Ctrl+M</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl+M</translation>
</message>
<message>
<location line="-2"/>
<source>Zoom</source>
- <translation type="unfinished"></translation>
+ <translation>ズーム</translation>
</message>
<message>
<location line="-136"/>
<source>&amp;File</source>
- <translation type="unfinished"></translation>
+ <translation>ファイル(&amp;F)</translation>
</message>
<message>
<location line="+24"/>
<source>&amp;Edit</source>
- <translation type="unfinished"></translation>
+ <translation>編集(&amp;E)</translation>
</message>
<message>
<location line="+24"/>
<source>&amp;View</source>
- <translation type="unfinished"></translation>
+ <translation>表示(&amp;V)</translation>
</message>
<message>
<location line="+27"/>
<source>&amp;Go</source>
- <translation type="unfinished"></translation>
+ <translation>ジャンプ(&amp;G)</translation>
</message>
<message>
<location line="+29"/>
<source>&amp;Bookmarks</source>
- <translation type="unfinished"></translation>
+ <translation>ブックマーク(&amp;B)</translation>
</message>
<message>
<location line="+4"/>
<source>&amp;Help</source>
- <translation type="unfinished"></translation>
+ <translation>ヘルプ(&amp;H)</translation>
</message>
<message>
<location line="-37"/>
<source>ALT+O</source>
- <translation type="unfinished"></translation>
+ <translation>ALT+O</translation>
</message>
<message>
<location line="+35"/>
<source>CTRL+D</source>
- <translation type="unfinished"></translation>
+ <translation>CTRL+D</translation>
</message>
</context>
<context>
@@ -741,47 +744,47 @@
<location line="+7"/>
<location line="+6"/>
<source>Add Documentation</source>
- <translation type="unfinished"></translation>
+ <translation>ドキュメントの追加</translation>
</message>
<message>
<location line="-13"/>
<source>Qt Compressed Help Files (*.qch)</source>
- <translation type="unfinished"></translation>
+ <translation>圧縮済み Qt ヘルプファイル (*.qch)</translation>
</message>
<message>
<location line="+8"/>
<source>The specified file is not a valid Qt Help File!</source>
- <translation type="unfinished"></translation>
+ <translation>指定されたファイルは有効な Qt ヘルプ ファイルではありません!</translation>
</message>
<message>
<location line="+6"/>
<source>The namespace %1 is already registered!</source>
- <translation type="unfinished"></translation>
+ <translation>ネームスペース %1 は既に登録済みです!</translation>
</message>
<message>
<location line="+23"/>
<source>Remove Documentation</source>
- <translation type="unfinished"></translation>
+ <translation>ドキュメントの除去</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 type="unfinished"></translation>
+ <translation>除去しようとしているいくつかのドキュメントは Assistant 上で参照されています。除去すると、これらのドキュメントは閉じられます。</translation>
</message>
<message>
<location line="+2"/>
<source>Cancel</source>
- <translation type="unfinished"></translation>
+ <translation>キャンセル</translation>
</message>
<message>
<location line="+1"/>
<source>OK</source>
- <translation type="unfinished"></translation>
+ <translation>OK</translation>
</message>
<message>
<location line="+86"/>
<source>Use custom settings</source>
- <translation type="unfinished"></translation>
+ <translation>独自設定を使用する</translation>
</message>
</context>
<context>
@@ -789,92 +792,92 @@
<message>
<location filename="../tools/assistant/tools/assistant/preferencesdialog.ui"/>
<source>Preferences</source>
- <translation type="unfinished"></translation>
+ <translation>設定</translation>
</message>
<message>
<location/>
<source>Fonts</source>
- <translation type="unfinished"></translation>
+ <translation>フォント</translation>
</message>
<message>
<location/>
<source>Font settings:</source>
- <translation type="unfinished"></translation>
+ <translation>フォント設定:</translation>
</message>
<message>
<location/>
<source>Browser</source>
- <translation type="unfinished"></translation>
+ <translation>ブラウザー</translation>
</message>
<message>
<location/>
<source>Application</source>
- <translation type="unfinished"></translation>
+ <translation>アプリケーション</translation>
</message>
<message>
<location/>
<source>Filters</source>
- <translation type="unfinished"></translation>
+ <translation>フィルタ</translation>
</message>
<message>
<location/>
<source>Filter:</source>
- <translation type="unfinished"></translation>
+ <translation>フィルタ:</translation>
</message>
<message>
<location/>
<source>Attributes:</source>
- <translation type="unfinished"></translation>
+ <translation>属性:</translation>
</message>
<message>
<location/>
<source>1</source>
- <translation type="unfinished"></translation>
+ <translation>1</translation>
</message>
<message>
<location/>
<source>Add</source>
- <translation type="unfinished"></translation>
+ <translation>追加</translation>
</message>
<message>
<location/>
<source>Remove</source>
- <translation type="unfinished"></translation>
+ <translation>削除</translation>
</message>
<message>
<location/>
<source>Documentation</source>
- <translation type="unfinished"></translation>
+ <translation>ドキュメント</translation>
</message>
<message>
<location/>
<source>Registered Documentation:</source>
- <translation type="unfinished"></translation>
+ <translation>登録済みドキュメント:</translation>
</message>
<message>
<location/>
<source>Add...</source>
- <translation type="unfinished"></translation>
+ <translation>追加...</translation>
</message>
<message>
<location/>
<source>Options</source>
- <translation type="unfinished"></translation>
+ <translation>オプション</translation>
</message>
<message>
<location/>
<source>Current Page</source>
- <translation type="unfinished"></translation>
+ <translation>現在のページ</translation>
</message>
<message>
<location/>
<source>Restore to default</source>
- <translation type="unfinished"></translation>
+ <translation>デフォルト設定に戻す</translation>
</message>
<message>
<location/>
<source>Homepage</source>
- <translation type="unfinished"></translation>
+ <translation>ホームページ</translation>
</message>
</context>
<context>
@@ -882,64 +885,64 @@
<message>
<location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="+110"/>
<source>The specified collection file does not exist!</source>
- <translation type="unfinished"></translation>
+ <translation>指定されたコレクションファイルは存在しません!</translation>
</message>
<message>
<location line="+4"/>
<source>Missing collection file!</source>
- <translation type="unfinished"></translation>
+ <translation>コレクションファイルが見つかりません!</translation>
</message>
<message>
<location line="+9"/>
<source>Invalid URL!</source>
- <translation type="unfinished"></translation>
+ <translation>不正なURLです!</translation>
</message>
<message>
<location line="+4"/>
<source>Missing URL!</source>
- <translation type="unfinished"></translation>
+ <translation>URLが見つかりません!</translation>
</message>
<message>
<location line="+17"/>
<location line="+19"/>
<location line="+19"/>
<source>Unknown widget: %1</source>
- <translation type="unfinished"></translation>
+ <translation>不明なウィジェット: %1</translation>
</message>
<message>
<location line="-34"/>
<location line="+19"/>
<location line="+19"/>
<source>Missing widget!</source>
- <translation type="unfinished"></translation>
+ <translation>ウィジェットが見つかりません!</translation>
</message>
<message>
<location line="+7"/>
<location line="+12"/>
<source>The specified Qt help file does not exist!</source>
- <translation type="unfinished"></translation>
+ <translation>指定された Qt ヘルプ ファイルが存在しません!</translation>
</message>
<message>
<location line="-7"/>
<location line="+12"/>
<source>Missing help file!</source>
- <translation type="unfinished"></translation>
+ <translation>ヘルプファイルが見つかりません!</translation>
</message>
<message>
<location line="+7"/>
<source>Missing filter argument!</source>
- <translation type="unfinished"></translation>
+ <translation>フィルタ引数が不足しています!</translation>
</message>
<message>
<location line="+10"/>
<source>Unknown option: %1</source>
- <translation type="unfinished"></translation>
+ <translation>不明なオプション: %1</translation>
</message>
<message>
<location line="+30"/>
<location line="+2"/>
<source>Qt Assistant</source>
- <translation type="unfinished"></translation>
+ <translation>Qt Assistant</translation>
</message>
<message>
<location filename="../tools/assistant/tools/assistant/main.cpp" line="+190"/>
@@ -948,12 +951,16 @@
Reason:
%2</source>
- <translation type="unfinished"></translation>
+ <translation>ドキュメントファイルを登録できませんでした。
+%1
+
+原因:
+%2</translation>
</message>
<message>
<location line="+4"/>
<source>Documentation successfully registered.</source>
- <translation type="unfinished"></translation>
+ <translation>ドキュメントの登録に成功しました。</translation>
</message>
<message>
<location line="+11"/>
@@ -962,28 +969,32 @@ Reason:
Reason:
%2</source>
- <translation type="unfinished"></translation>
+ <translation>ドキュメントファイルを解除できませんでした。
+%1
+
+原因:
+%2</translation>
</message>
<message>
<location line="-3"/>
<source>Documentation successfully unregistered.</source>
- <translation type="unfinished"></translation>
+ <translation>ドキュメントの解放に成功しました。</translation>
</message>
<message>
<location line="+18"/>
<source>Cannot load sqlite database driver!</source>
- <translation type="unfinished"></translation>
+ <translation>SQLite データベース ドライバーをロードできません!</translation>
</message>
<message>
<location line="+9"/>
<source>The specified collection file could not be read!</source>
- <translation type="unfinished"></translation>
+ <translation>指定されたコレクションファイルは読み込めません!</translation>
</message>
<message>
<location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="+167"/>
<location line="+1"/>
<source>Bookmark</source>
- <translation type="unfinished"></translation>
+ <translation>ブックマーク</translation>
</message>
</context>
<context>
@@ -991,12 +1002,12 @@ Reason:
<message>
<location filename="../tools/assistant/tools/assistant/remotecontrol.cpp" line="+157"/>
<source>Debugging Remote Control</source>
- <translation type="unfinished"></translation>
+ <translation>リモート コントロールをデバッグ中</translation>
</message>
<message>
<location line="+1"/>
<source>Received Command: %1 %2</source>
- <translation type="unfinished"></translation>
+ <translation>受信したコマンド: %1 %2</translation>
</message>
</context>
<context>
@@ -1004,28 +1015,28 @@ Reason:
<message>
<location filename="../tools/assistant/tools/assistant/searchwidget.cpp" line="+193"/>
<source>&amp;Copy</source>
- <translation type="unfinished"></translation>
+ <translation>コピー(&amp;C)</translation>
</message>
<message>
<location line="+4"/>
<source>Copy &amp;Link Location</source>
- <translation type="unfinished"></translation>
+ <translation>リンクのURLをコピー(&amp;L)</translation>
</message>
<message>
<location line="+3"/>
<location line="+36"/>
<source>Open Link in New Tab</source>
- <translation type="unfinished"></translation>
+ <translation>リンクを新しいタブで開く</translation>
</message>
<message>
<location line="-29"/>
<source>Select All</source>
- <translation type="unfinished"></translation>
+ <translation>すべてを選択</translation>
</message>
<message>
<location line="+28"/>
<source>Open Link</source>
- <translation type="unfinished"></translation>
+ <translation>リンクを開く</translation>
</message>
</context>
<context>
@@ -1033,27 +1044,27 @@ Reason:
<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 type="unfinished"></translation>
+ <translation>&lt;b&gt;%1&lt;/b&gt; の検索先トピックを選択してください:</translation>
</message>
<message>
<location filename="../tools/assistant/tools/assistant/topicchooser.ui"/>
<source>Choose Topic</source>
- <translation type="unfinished"></translation>
+ <translation>トピックを選択</translation>
</message>
<message>
<location/>
<source>&amp;Topics</source>
- <translation type="unfinished"></translation>
+ <translation>トピック(&amp;T)</translation>
</message>
<message>
<location/>
<source>&amp;Display</source>
- <translation type="unfinished"></translation>
+ <translation>表示(&amp;D)</translation>
</message>
<message>
<location/>
<source>&amp;Close</source>
- <translation type="unfinished"></translation>
+ <translation>閉じる(&amp;C)</translation>
</message>
</context>
</TS>
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_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/translations.pri b/translations/translations.pri
index efefa09..0c5c1ee 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 \
3rdparty/phonon \
diff --git a/util/s60theme/README b/util/s60theme/README
new file mode 100644
index 0000000..da4e81a
--- /dev/null
+++ b/util/s60theme/README
@@ -0,0 +1,31 @@
+'s60theme' is a commandline tool which converts Carbide.ui themes into
+an intermediate binary format that can be read by the simulated
+QS60Style. So, for example Designer (standalone or in Carbide) will
+be able to display a realistic S60 Ui.
+
+The intermediate binary format consists of hashes of QPictures and
+QColors, streamed to a QByteArray and compressed. QS60Style could not load
+the Carbide.ui theme directly because SVG handling is unfortunately
+not part of QtGui, and would require a dependency on the QtSvg module.
+
+Also, 's60theme' uses QWebkit to parse the SVG graphics (inspired by
+Ariya's 'WebKit-based SVG rasterizer' labs post). QtSvg had some issues
+with the SVGs that come with Carbide.ui.
+
+Usage examples:
+> s60theme "com.nokia.tools.theme.s60.50_3.4.0.0\config\model" Default.blob
+ (Reads the default 's60.50' theme and saves it as 'Default.blob')
+
+> s60theme "Eclipse\Examples\Haze\Haze.tdf" Haze.blob
+ (Reads the Haze theme and saves it as 'Haze.blob')
+
+To use the blob in a Qt application, get an instance of a QS60Style and call
+ style->loadS60ThemeFromBlob("Theme.blob");
+
+The simulated QS60Style will, in its constructor by default, try to load a
+":/s60Stylethemes/Default.blob". If your application has that a resource with
+exactly that filename, it will be used by default.
+'Default.blob' is not included in the current Qt source package. But it can
+easily be created with 's60theme' and a fresh install of Carbide.ui
+
+Visit http://www.forum.nokia.com for details about Carbide.ui
diff --git a/util/s60theme/main.cpp b/util/s60theme/main.cpp
new file mode 100644
index 0000000..f092a9a
--- /dev/null
+++ b/util/s60theme/main.cpp
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications 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 "s60themeconvert.h"
+
+int help()
+{
+ qDebug() << "Usage: s60theme [modeldir|theme.tdf] output.blob";
+ qDebug() << "";
+ qDebug() << "Options:";
+ qDebug() << " modeldir: Theme 'model' directory in Carbide.ui tree";
+ qDebug() << " theme.tdf: Theme .tdf file";
+ qDebug() << " output.blob: Theme blob output filename";
+ qDebug() << "";
+ qDebug() << "s60theme takes an S60 theme from Carbide.ui and converts";
+ qDebug() << "it into a compact, binary format, that can be directly loaded by";
+ qDebug() << "the QtS60Style.";
+ qDebug() << "";
+ qDebug() << "Visit http://www.forum.nokia.com for details about Carbide.ui";
+ return 1;
+}
+
+int main(int argc, char *argv[])
+{
+ if (argc != 3)
+ return help();
+
+ QApplication app(argc, argv);
+
+ const QString input = QString::fromLatin1(argv[1]);
+ const QFileInfo inputInfo(input);
+ const QString output = QString::fromLatin1(argv[2]);
+ if (inputInfo.isDir())
+ return S60ThemeConvert::convertDefaultThemeToBlob(input, output);
+ else if (inputInfo.suffix().compare(QString::fromLatin1("tdf"), Qt::CaseInsensitive) == 0)
+ return S60ThemeConvert::convertTdfToBlob(input, output);
+
+ return help();
+}
diff --git a/util/s60theme/s60theme.pro b/util/s60theme/s60theme.pro
new file mode 100644
index 0000000..83c0cf2
--- /dev/null
+++ b/util/s60theme/s60theme.pro
@@ -0,0 +1,12 @@
+SOURCES += \
+ s60themeconvert.cpp \
+ main.cpp
+
+HEADERS += \
+ s60themeconvert.h
+
+QT += \
+ webkit
+
+CONFIG += \
+ console
diff --git a/util/s60theme/s60themeconvert.cpp b/util/s60theme/s60themeconvert.cpp
new file mode 100644
index 0000000..a1e1d58
--- /dev/null
+++ b/util/s60theme/s60themeconvert.cpp
@@ -0,0 +1,301 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications 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 "s60themeconvert.h"
+
+#include <QtGui>
+#include <QtWebKit>
+
+static const int pictureSize = 256;
+
+void dumpPartPictures(const QHash<QString, QPicture> &partPictures) {
+ foreach (const QString &partKey, partPictures.keys()) {
+ QPicture partPicture = partPictures.value(partKey);
+ qDebug() << partKey << partPicture.boundingRect();
+ QImage image(partPicture.boundingRect().size(), QImage::Format_ARGB32);
+ image.fill(Qt::transparent);
+ QPainter p(&image);
+ partPicture.play(&p);
+ image.save(partKey + QString::fromLatin1(".png"));
+ }
+}
+
+void dumpColors(const QHash<QPair<QString, int>, QColor> &colors) {
+ foreach (const QColor &color, colors.values()) {
+ const QPair<QString, int> key = colors.key(color);
+ qDebug() << key << color;
+ }
+}
+
+class WebKitSVGRenderer : public QWebView
+{
+ Q_OBJECT
+
+public:
+ WebKitSVGRenderer(QWidget *parent = 0);
+ QPicture svgToQPicture(const QString &svgFileName);
+
+private slots:
+ void loadFinishedSlot(bool ok);
+
+private:
+ QEventLoop m_loop;
+ QPicture m_result;
+};
+
+WebKitSVGRenderer::WebKitSVGRenderer(QWidget *parent)
+ : QWebView(parent)
+{
+ connect(this, SIGNAL(loadFinished(bool)), SLOT(loadFinishedSlot(bool)));
+ setFixedSize(pictureSize, pictureSize);
+ QPalette pal = palette();
+ pal.setColor(QPalette::Base, Qt::transparent);
+ setPalette(pal);
+}
+
+QPicture WebKitSVGRenderer::svgToQPicture(const QString &svgFileName)
+{
+ load(QUrl::fromLocalFile(svgFileName));
+ m_loop.exec();
+ return m_result;
+}
+
+void WebKitSVGRenderer::loadFinishedSlot(bool ok)
+{
+ // crude error-checking
+ if (!ok)
+ qDebug() << "Failed loading " << qPrintable(url().toString());
+
+ page()->mainFrame()->evaluateJavaScript(QString::fromLatin1(
+ "document.rootElement.preserveAspectRatio.baseVal.align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_NONE;"
+ "document.rootElement.style.width = '100%';"
+ "document.rootElement.style.height = '100%';"
+ "document.rootElement.width.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE, 100);"
+ "document.rootElement.height.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE, 100);"
+ ));
+
+ m_result = QPicture(); // "Clear"
+ QPainter p(&m_result);
+ page()->mainFrame()->render(&p);
+ p.end();
+ m_result.setBoundingRect(QRect(0, 0, pictureSize, pictureSize));
+
+ m_loop.exit();
+}
+
+QPair<QString, int> colorIdPair(const QString &colorID)
+{
+ QPair<QString, int> result;
+ QString idText = colorID;
+ idText.remove(QRegExp(QString::fromLatin1("[0-9]")));
+ if (QS60Style::colorListKeys().contains(idText)) {
+ QString idNumber = colorID;
+ idNumber.remove(QRegExp(QString::fromLatin1("[a-zA-Z]")));
+ result.first = idText;
+ result.second = idNumber.toInt();
+ }
+ return result;
+}
+
+bool parseTdfFile(const QString &tdfFile,
+ QHash<QString, QString> &partSvgs,
+ QHash<QPair<QString, int>, QColor> &colors)
+{
+ QFile file(tdfFile);
+ if (!file.open(QIODevice::ReadOnly))
+ return false;
+
+ const QLatin1String elementKey("element");
+ const QLatin1String partKey("part");
+ const QLatin1String elementIdKey("id");
+ const QLatin1String layerKey("layer");
+ const QLatin1String layerFileNameKey("filename");
+ const QLatin1String layerColourrgbKey("colourrgb");
+ const QString annoyingPrefix = QString::fromLatin1("S60_2_6%");
+
+ QXmlStreamReader reader(&file);
+ QString partId;
+ QPair<QString, int> colorId;
+ // Somebody with a sense of aesthetics may implement proper XML parsing, here.
+ while (!reader.atEnd()) {
+ const QXmlStreamReader::TokenType token = reader.readNext();
+ switch (token) {
+ case QXmlStreamReader::StartElement:
+ if (reader.name() == elementKey || reader.name() == partKey) {
+ QString id = reader.attributes().value(elementIdKey).toString();
+ if (QS60Style::partKeys().contains(id))
+ partId = id;
+ else if (!id.isEmpty() && id.at(id.length()-1).isDigit())
+ colorId = colorIdPair(id);
+ else if (QS60Style::partKeys().contains(id.mid(annoyingPrefix.length())))
+ partId = id.mid(annoyingPrefix.length());
+ } else if(reader.name() == layerKey) {
+ if (!partId.isEmpty()) {
+ const QString svgFile = reader.attributes().value(layerFileNameKey).toString();
+ partSvgs.insert(partId, svgFile);
+ partId.clear();
+ } else if (!colorId.first.isEmpty()) {
+ const QColor colorValue(reader.attributes().value(layerColourrgbKey).toString().toInt(NULL, 16));
+ colors.insert(colorId, colorValue);
+ colorId.first.clear();
+ }
+ }
+ break;
+ case QXmlStreamReader::EndElement:
+ if (reader.tokenString() == elementKey || reader.name() == partKey)
+ partId.clear();
+ break;
+ default:
+ break;
+ }
+ }
+ return true;
+}
+
+bool loadThemeFromTdf(const QString &tdfFile,
+ QHash<QString, QPicture> &partPictures,
+ QHash<QPair<QString, int>, QColor> &colors)
+{
+ QHash<QString, QString> parsedPartSvgs;
+ QHash<QString, QPicture> parsedPartPictures;
+ QHash<QPair<QString, int>, QColor> parsedColors;
+ bool success = parseTdfFile(tdfFile, parsedPartSvgs, parsedColors);
+ if (!success)
+ return false;
+ const QString tdfBasePath = QFileInfo(tdfFile).absolutePath();
+ WebKitSVGRenderer renderer;
+ foreach(const QString& partKey, parsedPartSvgs.keys()) {
+ const QString tdfFullName =
+ tdfBasePath + QDir::separator() + parsedPartSvgs.value(partKey);
+ if (!QFile(tdfFullName).exists())
+ qWarning() << "Could not find part:" << parsedPartSvgs.value(partKey);
+ const QPicture partPicture = renderer.svgToQPicture(tdfFullName);
+ parsedPartPictures.insert(partKey, partPicture);
+ }
+// dumpPartPictures(parsedPartPictures);
+// dumpColors(colors);
+ partPictures = parsedPartPictures;
+ colors = parsedColors;
+ return true;
+}
+
+bool S60ThemeConvert::convertTdfToBlob(const QString &themeTdf, const QString &themeBlob)
+{
+ QHash<QString, QPicture> partPictures;
+ QHash<QPair<QString, int>, QColor> colors;
+
+ if (!::loadThemeFromTdf(themeTdf, partPictures, colors))
+ return false;
+
+ QS60Style style;
+ style.setS60Theme(partPictures, colors);
+ return style.saveS60ThemeToBlob(themeBlob);
+}
+
+bool parseDesignFile(const QString &designFile,
+ QHash<QPair<QString, int>, QColor> &colors)
+{
+ const QLatin1String elementKey("element");
+ const QLatin1String elementIdKey("id");
+ const QLatin1String colorKey("defaultcolour_rgb");
+ QFile file(designFile);
+ if (!file.open(QIODevice::ReadOnly))
+ return false;
+ QXmlStreamReader reader(&file);
+ QPair<QString, int> colorId;
+ // Somebody with a sense of aesthetics may implement proper XML parsing, here.
+ while (!reader.atEnd()) {
+ const QXmlStreamReader::TokenType token = reader.readNext();
+ switch (token) {
+ case QXmlStreamReader::StartElement:
+ if (reader.name() == elementKey) {
+ const QString colorString = reader.attributes().value(colorKey).toString();
+ if (!colorString.isEmpty()) {
+ const QString colorId = reader.attributes().value(elementIdKey).toString();
+ colors.insert(colorIdPair(colorId), colorString.toInt(NULL, 16));
+ }
+ }
+ default:
+ break;
+ }
+ }
+ return true;
+}
+
+bool loadDefaultTheme(const QString &themePath,
+ QHash<QString, QPicture> &partPictures,
+ QHash<QPair<QString, int>, QColor> &colors)
+{
+ const QDir dir(themePath);
+ if (!dir.exists())
+ return false;
+
+ if (!parseDesignFile(themePath + QDir::separator() + QString::fromLatin1("defaultdesign.xml"), colors))
+ return false;
+
+ WebKitSVGRenderer renderer;
+ foreach (const QString &partKey, QS60Style::partKeys()) {
+ const QString partFileName = partKey + QLatin1String(".svg");
+ const QString partFile(dir.absolutePath() + QDir::separator() + partFileName);
+ if (!QFile::exists(partFile)) {
+ qWarning() << "Could not find part:" << partFileName;
+ continue;
+ }
+ const QPicture partPicture = renderer.svgToQPicture(partFile);
+ partPictures.insert(partKey, partPicture);
+ }
+ return true;
+}
+
+bool S60ThemeConvert::convertDefaultThemeToBlob(const QString &themePath, const QString &themeBlob)
+{
+ QHash<QString, QPicture> partPictures;
+ QHash<QPair<QString, int>, QColor> colors;
+
+ if (!::loadDefaultTheme(themePath, partPictures, colors))
+ return false;
+
+ QS60Style style;
+ style.setS60Theme(partPictures, colors);
+ return style.saveS60ThemeToBlob(themeBlob);
+}
+
+#include "s60themeconvert.moc"
diff --git a/util/s60theme/s60themeconvert.h b/util/s60theme/s60themeconvert.h
new file mode 100644
index 0000000..e48922f
--- /dev/null
+++ b/util/s60theme/s60themeconvert.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications 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 S60THEMECONVERT_H
+#define S60THEMECONVERT_H
+
+#include <QString>
+
+class S60ThemeConvert
+{
+public:
+ static bool convertTdfToBlob(const QString &themeTdf, const QString &themeBlob);
+ static bool convertDefaultThemeToBlob(const QString &themePath, const QString &themeBlob);
+};
+
+#endif // S60THEMECONVERT_H
diff --git a/util/webkit/mkdist-webkit b/util/webkit/mkdist-webkit
index d4e6d9e..c26fdc1 100755
--- a/util/webkit/mkdist-webkit
+++ b/util/webkit/mkdist-webkit
@@ -185,7 +185,7 @@ fi
rev=`git ls-remote $repository | grep -E "^.+$tag$" | awk '{print $1}'`
-tarball=`mktemp /tmp/webkit-snapshot.tar` || exit 1
+tarball=`mktemp /tmp/webkit-snapshot.tar.XXXXXX` || exit 1
echo "creating $tarball"
echo "archiving webkit from $repository $tag ( $rev )"