From 38be0d13830efd2d98281c645c3a60afe05ffece Mon Sep 17 00:00:00 2001 From: Qt by Nokia Date: Wed, 27 Apr 2011 12:05:43 +0200 Subject: Initial import from the monolithic Qt. This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12 --- src/corelib/global/global.pri | 34 + src/corelib/global/qconfig-dist.h | 50 + src/corelib/global/qconfig-large.h | 173 ++ src/corelib/global/qconfig-medium.h | 297 +++ src/corelib/global/qconfig-minimal.h | 600 ++++++ src/corelib/global/qconfig-nacl.h | 371 ++++ src/corelib/global/qconfig-small.h | 335 ++++ src/corelib/global/qendian.h | 370 ++++ src/corelib/global/qendian.qdoc | 154 ++ src/corelib/global/qfeatures.h | 893 +++++++++ src/corelib/global/qfeatures.txt | 1487 ++++++++++++++ src/corelib/global/qglobal.cpp | 3653 ++++++++++++++++++++++++++++++++++ src/corelib/global/qglobal.h | 2767 +++++++++++++++++++++++++ src/corelib/global/qlibraryinfo.cpp | 555 ++++++ src/corelib/global/qlibraryinfo.h | 94 + src/corelib/global/qmalloc.cpp | 127 ++ src/corelib/global/qnamespace.h | 1882 ++++++++++++++++++ src/corelib/global/qnamespace.qdoc | 3008 ++++++++++++++++++++++++++++ src/corelib/global/qnumeric.cpp | 93 + src/corelib/global/qnumeric.h | 71 + src/corelib/global/qnumeric_p.h | 243 +++ src/corelib/global/qt_pch.h | 67 + src/corelib/global/qt_windows.h | 151 ++ 23 files changed, 17475 insertions(+) create mode 100644 src/corelib/global/global.pri create mode 100644 src/corelib/global/qconfig-dist.h create mode 100644 src/corelib/global/qconfig-large.h create mode 100644 src/corelib/global/qconfig-medium.h create mode 100644 src/corelib/global/qconfig-minimal.h create mode 100644 src/corelib/global/qconfig-nacl.h create mode 100644 src/corelib/global/qconfig-small.h create mode 100644 src/corelib/global/qendian.h create mode 100644 src/corelib/global/qendian.qdoc create mode 100644 src/corelib/global/qfeatures.h create mode 100644 src/corelib/global/qfeatures.txt create mode 100644 src/corelib/global/qglobal.cpp create mode 100644 src/corelib/global/qglobal.h create mode 100644 src/corelib/global/qlibraryinfo.cpp create mode 100644 src/corelib/global/qlibraryinfo.h create mode 100644 src/corelib/global/qmalloc.cpp create mode 100644 src/corelib/global/qnamespace.h create mode 100644 src/corelib/global/qnamespace.qdoc create mode 100644 src/corelib/global/qnumeric.cpp create mode 100644 src/corelib/global/qnumeric.h create mode 100644 src/corelib/global/qnumeric_p.h create mode 100644 src/corelib/global/qt_pch.h create mode 100644 src/corelib/global/qt_windows.h (limited to 'src/corelib/global') diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri new file mode 100644 index 0000000000..68582bf2d5 --- /dev/null +++ b/src/corelib/global/global.pri @@ -0,0 +1,34 @@ +# Qt kernel library base module + +HEADERS += \ + global/qglobal.h \ + global/qnamespace.h \ + global/qendian.h \ + global/qnumeric_p.h \ + global/qnumeric.h + +SOURCES += \ + global/qglobal.cpp \ + global/qlibraryinfo.cpp \ + global/qmalloc.cpp \ + global/qnumeric.cpp + +# qlibraryinfo.cpp includes qconfig.cpp +INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global + +# Only used on platforms with CONFIG += precompile_header +PRECOMPILED_HEADER = global/qt_pch.h + +linux*:!static:!symbian-gcce:!*-armcc* { + QMAKE_LFLAGS += -Wl,-e,qt_core_boilerplate + prog=$$quote(if (/program interpreter: (.*)]/) { print $1; }) + DEFINES += ELF_INTERPRETER=\\\"$$system(readelf -l /bin/ls | perl -n -e \'$$prog\')\\\" +} + +# Compensate for lack of platform defines in Symbian3 and Symbian4 +symbian { + DEFINES += SYMBIAN_VERSION_$$upper($$replace(SYMBIAN_VERSION,\\.,_)) \ + S60_VERSION_$$upper($$replace(S60_VERSION,\\.,_)) +} + +include(../../../tools/shared/symbian/epocroot.pri) diff --git a/src/corelib/global/qconfig-dist.h b/src/corelib/global/qconfig-dist.h new file mode 100644 index 0000000000..5f60031cde --- /dev/null +++ b/src/corelib/global/qconfig-dist.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +/* + Empty leaves all features enabled. See doc/html/emb-features.html for choices. + + Note that disabling some features will produce a libqt that is not + compatible with other libqt builds. Such modifications are only + supported on Qt for Embedded Linux where reducing the library size is + important and where the application suite is often a fixed set. +*/ diff --git a/src/corelib/global/qconfig-large.h b/src/corelib/global/qconfig-large.h new file mode 100644 index 0000000000..47896a7245 --- /dev/null +++ b/src/corelib/global/qconfig-large.h @@ -0,0 +1,173 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* Dialogs */ +#ifndef QT_NO_FILEDIALOG +# define QT_NO_FILEDIALOG +#endif +#ifndef QT_NO_FONTDIALOG +# define QT_NO_FONTDIALOG +#endif +#ifndef QT_NO_INPUTDIALOG +# define QT_NO_INPUTDIALOG +#endif +#ifndef QT_NO_PRINTDIALOG +# define QT_NO_PRINTDIALOG +#endif +#ifndef QT_NO_PROGRESSDIALOG +# define QT_NO_PROGRESSDIALOG +#endif + +/* Fonts */ +#ifndef QT_NO_QWS_QPF +# define QT_NO_QWS_QPF +#endif + +/* Images */ +#ifndef QT_NO_IMAGEFORMAT_BMP +# define QT_NO_IMAGEFORMAT_BMP +#endif +#ifndef QT_NO_IMAGEFORMAT_PPM +# define QT_NO_IMAGEFORMAT_PPM +#endif + +/* Internationalization */ +#ifndef QT_NO_CODECS +# define QT_NO_CODECS +#endif +#ifndef QT_NO_TRANSLATION +# define QT_NO_TRANSLATION +#endif +#ifndef QT_NO_TRANSLATION_UTF8 +# define QT_NO_TRANSLATION_UTF8 +#endif + +/* ItemViews */ +#ifndef QT_NO_TABLEVIEW +# define QT_NO_TABLEVIEW +#endif +#ifndef QT_NO_TREEVIEW +# define QT_NO_TREEVIEW +#endif + +/* Kernel */ +#ifndef QT_NO_CLIPBOARD +# define QT_NO_CLIPBOARD +#endif +#ifndef QT_NO_DRAGANDDROP +# define QT_NO_DRAGANDDROP +#endif +#ifndef QT_NO_EFFECTS +# define QT_NO_EFFECTS +#endif +#ifndef QT_NO_PROPERTIES +# define QT_NO_PROPERTIES +#endif +#ifndef QT_NO_SOUND +# define QT_NO_SOUND +#endif + +/* Networking */ +#ifndef QT_NO_HOSTINFO +# define QT_NO_HOSTINFO +#endif +#ifndef QT_NO_HTTP +# define QT_NO_HTTP +#endif +#ifndef QT_NO_UDPSOCKET +# define QT_NO_UDPSOCKET +#endif +#ifndef QT_NO_URLINFO +# define QT_NO_URLINFO +#endif +#ifndef QT_NO_FTP +# define QT_NO_FTP +#endif + +/* Painting */ +#ifndef QT_NO_COLORNAMES +# define QT_NO_COLORNAMES +#endif +#ifndef QT_NO_PICTURE +# define QT_NO_PICTURE +#endif +#ifndef QT_NO_PRINTER +# define QT_NO_PRINTER +#endif +#ifndef QT_NO_CUPS +# define QT_NO_CUPS +#endif + +/* Qt for Embedded Linux */ +#ifndef QT_NO_QWS_SOUNDSERVER +# define QT_NO_QWS_SOUNDSERVER +#endif + +/* Styles */ +#ifndef QT_NO_STYLE_MOTIF +# define QT_NO_STYLE_MOTIF +#endif +#ifndef QT_NO_STYLE_CDE +# define QT_NO_STYLE_CDE +#endif +#ifndef QT_NO_STYLE_STYLESHEET +# define QT_NO_STYLE_STYLESHEET +#endif + +/* Widgets */ +#ifndef QT_NO_CALENDARWIDGET +# define QT_NO_CALENDARWIDGET +#endif +#ifndef QT_NO_DATETIMEEDIT +# define QT_NO_DATETIMEEDIT +#endif +#ifndef QT_NO_WORKSPACE +# define QT_NO_WORKSPACE +#endif +#ifndef QT_NO_DIAL +# define QT_NO_DIAL +#endif +#ifndef QT_NO_TABLEWIDGET +# define QT_NO_TABLEWIDGET +#endif +#ifndef QT_NO_TREEWIDGET +# define QT_NO_TREEWIDGET +#endif diff --git a/src/corelib/global/qconfig-medium.h b/src/corelib/global/qconfig-medium.h new file mode 100644 index 0000000000..0f8494b50a --- /dev/null +++ b/src/corelib/global/qconfig-medium.h @@ -0,0 +1,297 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* Dialogs */ +#ifndef QT_NO_COLORDIALOG +# define QT_NO_COLORDIALOG +#endif +#ifndef QT_NO_FILEDIALOG +# define QT_NO_FILEDIALOG +#endif +#ifndef QT_NO_FONTDIALOG +# define QT_NO_FONTDIALOG +#endif +#ifndef QT_NO_INPUTDIALOG +# define QT_NO_INPUTDIALOG +#endif +#ifndef QT_NO_PRINTDIALOG +# define QT_NO_PRINTDIALOG +#endif +#ifndef QT_NO_PROGRESSDIALOG +# define QT_NO_PROGRESSDIALOG +#endif +#ifndef QT_NO_TABDIALOG +# define QT_NO_TABDIALOG +#endif + +/* Fonts */ +#ifndef QT_NO_QWS_QPF +# define QT_NO_QWS_QPF +#endif + +/* Images */ +#ifndef QT_NO_IMAGEFORMAT_BMP +# define QT_NO_IMAGEFORMAT_BMP +#endif +#ifndef QT_NO_IMAGEFORMAT_PPM +# define QT_NO_IMAGEFORMAT_PPM +#endif +#ifndef QT_NO_IMAGE_TEXT +# define QT_NO_IMAGE_TEXT +#endif +#ifndef QT_NO_MOVIE +# define QT_NO_MOVIE +#endif + +/* Internationalization */ +#ifndef QT_NO_BIG_CODECS +# define QT_NO_BIG_CODECS +#endif +#ifndef QT_NO_TEXTCODEC +# define QT_NO_TEXTCODEC +#endif +#ifndef QT_NO_CODECS +# define QT_NO_CODECS +#endif +#ifndef QT_NO_TEXTCODECPLUGIN +# define QT_NO_TEXTCODECPLUGIN +#endif +#ifndef QT_NO_TRANSLATION +# define QT_NO_TRANSLATION +#endif +#ifndef QT_NO_TRANSLATION_UTF8 +# define QT_NO_TRANSLATION_UTF8 +#endif + +/* ItemViews */ +#ifndef QT_NO_TABLEVIEW +# define QT_NO_TABLEVIEW +#endif +#ifndef QT_NO_TREEVIEW +# define QT_NO_TREEVIEW +#endif + +/* Kernel */ +#ifndef QT_NO_ACTION +# define QT_NO_ACTION +#endif +#ifndef QT_NO_CLIPBOARD +# define QT_NO_CLIPBOARD +#endif +#ifndef QT_NO_DRAGANDDROP +# define QT_NO_DRAGANDDROP +#endif +#ifndef QT_NO_EFFECTS +# define QT_NO_EFFECTS +#endif +#ifndef QT_NO_PROPERTIES +# define QT_NO_PROPERTIES +#endif +#ifndef QT_NO_SESSIONMANAGER +# define QT_NO_SESSIONMANAGER +#endif +#ifndef QT_NO_SHORTCUT +# define QT_NO_SHORTCUT +#endif +#ifndef QT_NO_SOUND +# define QT_NO_SOUND +#endif +#ifndef QT_NO_WHEELEVENT +# define QT_NO_WHEELEVENT +#endif + +/* Networking */ +#ifndef QT_NO_COP +# define QT_NO_COP +#endif +#ifndef QT_NO_HOSTINFO +# define QT_NO_HOSTINFO +#endif +#ifndef QT_NO_HTTP +# define QT_NO_HTTP +#endif +#ifndef QT_NO_NETWORKPROXY +# define QT_NO_NETWORKPROXY +#endif +#ifndef QT_NO_SOCKS5 +# define QT_NO_SOCKS5 +#endif +#ifndef QT_NO_UDPSOCKET +# define QT_NO_UDPSOCKET +#endif +#ifndef QT_NO_URLINFO +# define QT_NO_URLINFO +#endif +#ifndef QT_NO_FTP +# define QT_NO_FTP +#endif + +/* Painting */ +#ifndef QT_NO_COLORNAMES +# define QT_NO_COLORNAMES +#endif +#ifndef QT_NO_PICTURE +# define QT_NO_PICTURE +#endif +#ifndef QT_NO_PRINTER +# define QT_NO_PRINTER +#endif +#ifndef QT_NO_CUPS +# define QT_NO_CUPS +#endif + +/* Qt for Embedded Linux */ +#ifndef QT_NO_QWSEMBEDWIDGET +# define QT_NO_QWSEMBEDWIDGET +#endif +#ifndef QT_NO_QWS_SOUNDSERVER +# define QT_NO_QWS_SOUNDSERVER +#endif +#ifndef QT_NO_QWS_PROPERTIES +# define QT_NO_QWS_PROPERTIES +#endif + +/* Styles */ +#ifndef QT_NO_STYLE_MOTIF +# define QT_NO_STYLE_MOTIF +#endif +#ifndef QT_NO_STYLE_CDE +# define QT_NO_STYLE_CDE +#endif +#ifndef QT_NO_STYLE_STYLESHEET +# define QT_NO_STYLE_STYLESHEET +#endif + +/* Utilities */ +#ifndef QT_NO_UNDOCOMMAND +# define QT_NO_UNDOCOMMAND +#endif +#ifndef QT_NO_UNDOGROUP +# define QT_NO_UNDOGROUP +#endif +#ifndef QT_NO_UNDOSTACK +# define QT_NO_UNDOSTACK +#endif +#ifndef QT_NO_UNDOVIEW +# define QT_NO_UNDOVIEW +#endif +#ifndef QT_NO_GESTURES +# define QT_NO_GESTURES +#endif + +/* Widgets */ +#ifndef QT_NO_LCDNUMBER +# define QT_NO_LCDNUMBER +#endif +#ifndef QT_NO_CALENDARWIDGET +# define QT_NO_CALENDARWIDGET +#endif +#ifndef QT_NO_DATETIMEEDIT +# define QT_NO_DATETIMEEDIT +#endif +#ifndef QT_NO_MENU +# define QT_NO_MENU +#endif +#ifndef QT_NO_CONTEXTMENU +# define QT_NO_CONTEXTMENU +#endif +#ifndef QT_NO_MAINWINDOW +# define QT_NO_MAINWINDOW +#endif +#ifndef QT_NO_DOCKWIDGET +# define QT_NO_DOCKWIDGET +#endif +#ifndef QT_NO_TOOLBAR +# define QT_NO_TOOLBAR +#endif +#ifndef QT_NO_MENUBAR +# define QT_NO_MENUBAR +#endif +#ifndef QT_NO_WORKSPACE +# define QT_NO_WORKSPACE +#endif +#ifndef QT_NO_PROGRESSBAR +# define QT_NO_PROGRESSBAR +#endif +#ifndef QT_NO_SIZEGRIP +# define QT_NO_SIZEGRIP +#endif +#ifndef QT_NO_DIAL +# define QT_NO_DIAL +#endif +#ifndef QT_NO_STACKEDWIDGET +# define QT_NO_STACKEDWIDGET +#endif +#ifndef QT_NO_TABWIDGET +# define QT_NO_TABWIDGET +#endif +#ifndef QT_NO_STATUSBAR +# define QT_NO_STATUSBAR +#endif +#ifndef QT_NO_STATUSTIP +# define QT_NO_STATUSTIP +#endif +#ifndef QT_NO_TABLEWIDGET +# define QT_NO_TABLEWIDGET +#endif +#ifndef QT_NO_TOOLBUTTON +# define QT_NO_TOOLBUTTON +#endif +#ifndef QT_NO_TABBAR +# define QT_NO_TABBAR +#endif +#ifndef QT_NO_TOOLBOX +# define QT_NO_TOOLBOX +#endif +#ifndef QT_NO_WHATSTHIS +# define QT_NO_WHATSTHIS +#endif +#ifndef QT_NO_TOOLTIP +# define QT_NO_TOOLTIP +#endif +#ifndef QT_NO_TREEWIDGET +# define QT_NO_TREEWIDGET +#endif + +/* Windows */ +#ifndef QT_NO_WIN_ACTIVEQT +# define QT_NO_WIN_ACTIVEQT +#endif diff --git a/src/corelib/global/qconfig-minimal.h b/src/corelib/global/qconfig-minimal.h new file mode 100644 index 0000000000..a2714a9127 --- /dev/null +++ b/src/corelib/global/qconfig-minimal.h @@ -0,0 +1,600 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* Data structures */ +#ifndef QT_NO_QUUID_STRING +# define QT_NO_QUUID_STRING +#endif +#ifndef QT_NO_STL +# define QT_NO_STL +#endif +#ifndef QT_NO_TEXTDATE +# define QT_NO_TEXTDATE +#endif +#ifndef QT_NO_DATESTRING +# define QT_NO_DATESTRING +#endif + +/* Dialogs */ +#ifndef QT_NO_COLORDIALOG +# define QT_NO_COLORDIALOG +#endif +#ifndef QT_NO_ERRORMESSAGE +# define QT_NO_ERRORMESSAGE +#endif +#ifndef QT_NO_FILEDIALOG +# define QT_NO_FILEDIALOG +#endif +#ifndef QT_NO_FONTDIALOG +# define QT_NO_FONTDIALOG +#endif +#ifndef QT_NO_INPUTDIALOG +# define QT_NO_INPUTDIALOG +#endif +#ifndef QT_NO_MESSAGEBOX +# define QT_NO_MESSAGEBOX +#endif +#ifndef QT_NO_PRINTDIALOG +# define QT_NO_PRINTDIALOG +#endif +#ifndef QT_NO_PRINTPREVIEWDIALOG +# define QT_NO_PRINTPREVIEWDIALOG +#endif +#ifndef QT_NO_PROGRESSDIALOG +# define QT_NO_PROGRESSDIALOG +#endif +#ifndef QT_NO_TABDIALOG +# define QT_NO_TABDIALOG +#endif +#ifndef QT_NO_WIZARD +# define QT_NO_WIZARD +#endif + +/* File I/O */ +#ifndef QT_NO_DOM +# define QT_NO_DOM +#endif +#ifndef QT_NO_FILESYSTEMWATCHER +# define QT_NO_FILESYSTEMWATCHER +#endif +#ifndef QT_NO_FILESYSTEMMODEL +# define QT_NO_FILESYSTEMMODEL +#endif +#ifndef QT_NO_PROCESS +# define QT_NO_PROCESS +#endif +#ifndef QT_NO_TEMPORARYFILE +# define QT_NO_TEMPORARYFILE +#endif +#ifndef QT_NO_TEXTSTREAM +# define QT_NO_TEXTSTREAM +#endif +#ifndef QT_NO_SETTINGS +# define QT_NO_SETTINGS +#endif +#ifndef QT_NO_LIBRARY +# define QT_NO_LIBRARY +#endif + +/* Fonts */ +#ifndef QT_NO_FREETYPE +# define QT_NO_FREETYPE +#endif +#ifndef QT_NO_QWS_QPF2 +# define QT_NO_QWS_QPF2 +#endif + +/* Images */ +#ifndef QT_NO_IMAGEFORMATPLUGIN +# define QT_NO_IMAGEFORMATPLUGIN +#endif +#ifndef QT_NO_IMAGEFORMAT_BMP +# define QT_NO_IMAGEFORMAT_BMP +#endif +#ifndef QT_NO_IMAGEFORMAT_JPEG +# define QT_NO_IMAGEFORMAT_JPEG +#endif +#ifndef QT_NO_IMAGEFORMAT_PNG +# define QT_NO_IMAGEFORMAT_PNG +#endif +#ifndef QT_NO_IMAGEFORMAT_PPM +# define QT_NO_IMAGEFORMAT_PPM +#endif +#ifndef QT_NO_IMAGEFORMAT_XBM +# define QT_NO_IMAGEFORMAT_XBM +#endif +#ifndef QT_NO_IMAGEFORMAT_XPM +# define QT_NO_IMAGEFORMAT_XPM +#endif +#ifndef QT_NO_IMAGE_HEURISTIC_MASK +# define QT_NO_IMAGE_HEURISTIC_MASK +#endif +#ifndef QT_NO_IMAGE_TEXT +# define QT_NO_IMAGE_TEXT +#endif +#ifndef QT_NO_MOVIE +# define QT_NO_MOVIE +#endif + +/* Internationalization */ +#ifndef QT_NO_BIG_CODECS +# define QT_NO_BIG_CODECS +#endif +#ifndef QT_NO_QWS_INPUTMETHODS +# define QT_NO_QWS_INPUTMETHODS +#endif +#ifndef QT_NO_TEXTCODEC +# define QT_NO_TEXTCODEC +#endif +#ifndef QT_NO_CODECS +# define QT_NO_CODECS +#endif +#ifndef QT_NO_TEXTCODECPLUGIN +# define QT_NO_TEXTCODECPLUGIN +#endif +#ifndef QT_NO_TRANSLATION +# define QT_NO_TRANSLATION +#endif +#ifndef QT_NO_TRANSLATION_UTF8 +# define QT_NO_TRANSLATION_UTF8 +#endif + +/* ItemViews */ +#ifndef QT_NO_ITEMVIEWS +# define QT_NO_ITEMVIEWS +#endif +#ifndef QT_NO_DATAWIDGETMAPPER +# define QT_NO_DATAWIDGETMAPPER +#endif +#ifndef QT_NO_DIRMODEL +# define QT_NO_DIRMODEL +#endif +#ifndef QT_NO_LISTVIEW +# define QT_NO_LISTVIEW +#endif +#ifndef QT_NO_COLUMNVIEW +# define QT_NO_COLUMNVIEW +#endif +#ifndef QT_NO_PROXYMODEL +# define QT_NO_PROXYMODEL +#endif +#ifndef QT_NO_SORTFILTERPROXYMODEL +# define QT_NO_SORTFILTERPROXYMODEL +#endif +#ifndef QT_NO_STANDARDITEMMODEL +# define QT_NO_STANDARDITEMMODEL +#endif +#ifndef QT_NO_STRINGLISTMODEL +# define QT_NO_STRINGLISTMODEL +#endif +#ifndef QT_NO_TABLEVIEW +# define QT_NO_TABLEVIEW +#endif +#ifndef QT_NO_TREEVIEW +# define QT_NO_TREEVIEW +#endif + +/* Kernel */ +#ifndef QT_NO_ACTION +# define QT_NO_ACTION +#endif +#ifndef QT_NO_CLIPBOARD +# define QT_NO_CLIPBOARD +#endif +#ifndef QT_NO_CSSPARSER +# define QT_NO_CSSPARSER +#endif +#ifndef QT_NO_CURSOR +# define QT_NO_CURSOR +#endif +#ifndef QT_NO_DRAGANDDROP +# define QT_NO_DRAGANDDROP +#endif +#ifndef QT_NO_EFFECTS +# define QT_NO_EFFECTS +#endif +#ifndef QT_NO_PROPERTIES +# define QT_NO_PROPERTIES +#endif +#ifndef QT_NO_SESSIONMANAGER +# define QT_NO_SESSIONMANAGER +#endif +#ifndef QT_NO_SHAREDMEMORY +# define QT_NO_SHAREDMEMORY +#endif +#ifndef QT_NO_SHORTCUT +# define QT_NO_SHORTCUT +#endif +#ifndef QT_NO_SOUND +# define QT_NO_SOUND +#endif +#ifndef QT_NO_SYSTEMSEMAPHORE +# define QT_NO_SYSTEMSEMAPHORE +#endif +#ifndef QT_NO_TABLETEVENT +# define QT_NO_TABLETEVENT +#endif +#ifndef QT_NO_TEXTHTMLPARSER +# define QT_NO_TEXTHTMLPARSER +#endif +#ifndef QT_NO_CONCURRENT +# define QT_NO_CONCURRENT +#endif +#ifndef QT_NO_WHEELEVENT +# define QT_NO_WHEELEVENT +#endif +#ifndef QT_NO_XMLSTREAM +# define QT_NO_XMLSTREAM +#endif +#ifndef QT_NO_XMLSTREAMREADER +# define QT_NO_XMLSTREAMREADER +#endif +#ifndef QT_NO_XMLSTREAMWRITER +# define QT_NO_XMLSTREAMWRITER +#endif + +/* Networking */ +#ifndef QT_NO_COP +# define QT_NO_COP +#endif +#ifndef QT_NO_HOSTINFO +# define QT_NO_HOSTINFO +#endif +#ifndef QT_NO_HTTP +# define QT_NO_HTTP +#endif +#ifndef QT_NO_NETWORKPROXY +# define QT_NO_NETWORKPROXY +#endif +#ifndef QT_NO_SOCKS5 +# define QT_NO_SOCKS5 +#endif +#ifndef QT_NO_UDPSOCKET +# define QT_NO_UDPSOCKET +#endif +#ifndef QT_NO_URLINFO +# define QT_NO_URLINFO +#endif +#ifndef QT_NO_FTP +# define QT_NO_FTP +#endif + +/* Painting */ +#ifndef QT_NO_COLORNAMES +# define QT_NO_COLORNAMES +#endif +#ifndef QT_NO_DIRECTPAINTER +# define QT_NO_DIRECTPAINTER +#endif +#ifndef QT_NO_PAINTONSCREEN +# define QT_NO_PAINTONSCREEN +#endif +#ifndef QT_NO_PAINT_DEBUG +# define QT_NO_PAINT_DEBUG +#endif +#ifndef QT_NO_PICTURE +# define QT_NO_PICTURE +#endif +#ifndef QT_NO_PRINTER +# define QT_NO_PRINTER +#endif +#ifndef QT_NO_CUPS +# define QT_NO_CUPS +#endif + +/* Qt for Embedded Linux */ +#ifndef QT_NO_QWSEMBEDWIDGET +# define QT_NO_QWSEMBEDWIDGET +#endif +#ifndef QT_NO_QWS_ALPHA_CURSOR +# define QT_NO_QWS_ALPHA_CURSOR +#endif +#ifndef QT_NO_QWS_CURSOR +# define QT_NO_QWS_CURSOR +#endif +#ifndef QT_NO_QWS_DECORATION_DEFAULT +# define QT_NO_QWS_DECORATION_DEFAULT +#endif +#ifndef QT_NO_QWS_DECORATION_STYLED +# define QT_NO_QWS_DECORATION_STYLED +#endif +#ifndef QT_NO_QWS_DECORATION_WINDOWS +# define QT_NO_QWS_DECORATION_WINDOWS +#endif +#ifndef QT_NO_QWS_MANAGER +# define QT_NO_QWS_MANAGER +#endif +#ifndef QT_NO_QWS_KEYBOARD +# define QT_NO_QWS_KEYBOARD +#endif +#ifndef QT_NO_QWS_MOUSE +# define QT_NO_QWS_MOUSE +#endif +#ifndef QT_NO_QWS_MOUSE_AUTO +# define QT_NO_QWS_MOUSE_AUTO +#endif +#ifndef QT_NO_QWS_MOUSE_MANUAL +# define QT_NO_QWS_MOUSE_MANUAL +#endif +#ifndef QT_NO_QWS_MULTIPROCESS +# define QT_NO_QWS_MULTIPROCESS +#endif +#ifndef QT_NO_QWS_SOUNDSERVER +# define QT_NO_QWS_SOUNDSERVER +#endif +#ifndef QT_NO_SXE +# define QT_NO_SXE +#endif +#ifndef QT_NO_QWS_PROPERTIES +# define QT_NO_QWS_PROPERTIES +#endif +#ifndef QT_NO_QWS_PROXYSCREEN +# define QT_NO_QWS_PROXYSCREEN +#endif +#ifndef QT_NO_QWS_DYNAMICSCREENTRANSFORMATION +# define QT_NO_QWS_DYNAMICSCREENTRANSFORMATION +#endif + +/* SVG */ +#ifndef QT_NO_SVG +# define QT_NO_SVG +#endif +#ifndef QT_NO_GRAPHICSSVGITEM +# define QT_NO_GRAPHICSSVGITEM +#endif +#ifndef QT_NO_SVGGENERATOR +# define QT_NO_SVGGENERATOR +#endif +#ifndef QT_NO_SVGRENDERER +# define QT_NO_SVGRENDERER +#endif +#ifndef QT_NO_SVGWIDGET +# define QT_NO_SVGWIDGET +#endif + +/* Styles */ +#ifndef QT_NO_STYLE_MOTIF +# define QT_NO_STYLE_MOTIF +#endif +#ifndef QT_NO_STYLE_CDE +# define QT_NO_STYLE_CDE +#endif +#ifndef QT_NO_STYLE_CLEANLOOKS +# define QT_NO_STYLE_CLEANLOOKS +#endif +#ifndef QT_NO_STYLE_PLASTIQUE +# define QT_NO_STYLE_PLASTIQUE +#endif +#ifndef QT_NO_STYLE_STYLESHEET +# define QT_NO_STYLE_STYLESHEET +#endif +#ifndef QT_NO_STYLE_WINDOWSCE +# define QT_NO_STYLE_WINDOWSCE +#endif +#ifndef QT_NO_STYLE_WINDOWSMOBILE +# define QT_NO_STYLE_WINDOWSMOBILE +#endif +#ifndef QT_NO_STYLE_WINDOWSVISTA +# define QT_NO_STYLE_WINDOWSVISTA +#endif +#ifndef QT_NO_STYLE_WINDOWSXP +# define QT_NO_STYLE_WINDOWSXP +#endif + +/* Utilities */ +#ifndef QT_NO_ACCESSIBILITY +# define QT_NO_ACCESSIBILITY +#endif +#ifndef QT_NO_COMPLETER +# define QT_NO_COMPLETER +#endif +#ifndef QT_NO_DESKTOPSERVICES +# define QT_NO_DESKTOPSERVICES +#endif +#ifndef QT_NO_SCRIPT +# define QT_NO_SCRIPT +#endif +#ifndef QT_NO_SYSTEMTRAYICON +# define QT_NO_SYSTEMTRAYICON +#endif +#ifndef QT_NO_UNDOCOMMAND +# define QT_NO_UNDOCOMMAND +#endif +#ifndef QT_NO_UNDOGROUP +# define QT_NO_UNDOGROUP +#endif +#ifndef QT_NO_UNDOSTACK +# define QT_NO_UNDOSTACK +#endif +#ifndef QT_NO_UNDOVIEW +# define QT_NO_UNDOVIEW +#endif +#ifndef QT_NO_GESTURES +# define QT_NO_GESTURES +#endif + +/* Widgets */ +#ifndef QT_NO_GROUPBOX +# define QT_NO_GROUPBOX +#endif +#ifndef QT_NO_BUTTONGROUP +# define QT_NO_BUTTONGROUP +#endif +#ifndef QT_NO_LCDNUMBER +# define QT_NO_LCDNUMBER +#endif +#ifndef QT_NO_LINEEDIT +# define QT_NO_LINEEDIT +#endif +#ifndef QT_NO_COMBOBOX +# define QT_NO_COMBOBOX +#endif +#ifndef QT_NO_FONTCOMBOBOX +# define QT_NO_FONTCOMBOBOX +#endif +#ifndef QT_NO_SPINBOX +# define QT_NO_SPINBOX +#endif +#ifndef QT_NO_CALENDARWIDGET +# define QT_NO_CALENDARWIDGET +#endif +#ifndef QT_NO_DATETIMEEDIT +# define QT_NO_DATETIMEEDIT +#endif +#ifndef QT_NO_LISTWIDGET +# define QT_NO_LISTWIDGET +#endif +#ifndef QT_NO_MENU +# define QT_NO_MENU +#endif +#ifndef QT_NO_CONTEXTMENU +# define QT_NO_CONTEXTMENU +#endif +#ifndef QT_NO_MAINWINDOW +# define QT_NO_MAINWINDOW +#endif +#ifndef QT_NO_DOCKWIDGET +# define QT_NO_DOCKWIDGET +#endif +#ifndef QT_NO_TOOLBAR +# define QT_NO_TOOLBAR +#endif +#ifndef QT_NO_MENUBAR +# define QT_NO_MENUBAR +#endif +#ifndef QT_NO_WORKSPACE +# define QT_NO_WORKSPACE +#endif +#ifndef QT_NO_PROGRESSBAR +# define QT_NO_PROGRESSBAR +#endif +#ifndef QT_NO_RESIZEHANDLER +# define QT_NO_RESIZEHANDLER +#endif +#ifndef QT_NO_RUBBERBAND +# define QT_NO_RUBBERBAND +#endif +#ifndef QT_NO_SPLITTER +# define QT_NO_SPLITTER +#endif +#ifndef QT_NO_SIGNALMAPPER +# define QT_NO_SIGNALMAPPER +#endif +#ifndef QT_NO_SIZEGRIP +# define QT_NO_SIZEGRIP +#endif +#ifndef QT_NO_SLIDER +# define QT_NO_SLIDER +#endif +#ifndef QT_NO_DIAL +# define QT_NO_DIAL +#endif +#ifndef QT_NO_SCROLLBAR +# define QT_NO_SCROLLBAR +#endif +#ifndef QT_NO_SCROLLAREA +# define QT_NO_SCROLLAREA +#endif +#ifndef QT_NO_GRAPHICSVIEW +# define QT_NO_GRAPHICSVIEW +#endif +#ifndef QT_NO_PRINTPREVIEWWIDGET +# define QT_NO_PRINTPREVIEWWIDGET +#endif +#ifndef QT_NO_MDIAREA +# define QT_NO_MDIAREA +#endif +#ifndef QT_NO_TEXTEDIT +# define QT_NO_TEXTEDIT +#endif +#ifndef QT_NO_SYNTAXHIGHLIGHTER +# define QT_NO_SYNTAXHIGHLIGHTER +#endif +#ifndef QT_NO_TEXTBROWSER +# define QT_NO_TEXTBROWSER +#endif +#ifndef QT_NO_SPINWIDGET +# define QT_NO_SPINWIDGET +#endif +#ifndef QT_NO_SPLASHSCREEN +# define QT_NO_SPLASHSCREEN +#endif +#ifndef QT_NO_STACKEDWIDGET +# define QT_NO_STACKEDWIDGET +#endif +#ifndef QT_NO_TABWIDGET +# define QT_NO_TABWIDGET +#endif +#ifndef QT_NO_STATUSBAR +# define QT_NO_STATUSBAR +#endif +#ifndef QT_NO_STATUSTIP +# define QT_NO_STATUSTIP +#endif +#ifndef QT_NO_TABLEWIDGET +# define QT_NO_TABLEWIDGET +#endif +#ifndef QT_NO_TOOLBUTTON +# define QT_NO_TOOLBUTTON +#endif +#ifndef QT_NO_TABBAR +# define QT_NO_TABBAR +#endif +#ifndef QT_NO_TOOLBOX +# define QT_NO_TOOLBOX +#endif +#ifndef QT_NO_WHATSTHIS +# define QT_NO_WHATSTHIS +#endif +#ifndef QT_NO_TOOLTIP +# define QT_NO_TOOLTIP +#endif +#ifndef QT_NO_TREEWIDGET +# define QT_NO_TREEWIDGET +#endif +#ifndef QT_NO_VALIDATOR +# define QT_NO_VALIDATOR +#endif + +/* Windows */ +#ifndef QT_NO_WIN_ACTIVEQT +# define QT_NO_WIN_ACTIVEQT +#endif diff --git a/src/corelib/global/qconfig-nacl.h b/src/corelib/global/qconfig-nacl.h new file mode 100644 index 0000000000..a44391c1c9 --- /dev/null +++ b/src/corelib/global/qconfig-nacl.h @@ -0,0 +1,371 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#define QT_FONTS_ARE_RESOURCES + +/* Data structures */ +#ifndef QT_NO_QUUID_STRING +# define QT_NO_QUUID_STRING +#endif +#ifndef QT_NO_STL +# define QT_NO_STL +#endif +#ifndef QT_NO_TEXTDATE +# define QT_NO_TEXTDATE +#endif +#ifndef QT_NO_DATESTRING +# define QT_NO_DATESTRING +#endif + +/* Dialogs */ +#ifndef QT_NO_FILEDIALOG +# define QT_NO_FILEDIALOG +#endif +#ifndef QT_NO_PRINTDIALOG +# define QT_NO_PRINTDIALOG +#endif +#ifndef QT_NO_PRINTPREVIEWDIALOG +# define QT_NO_PRINTPREVIEWDIALOG +#endif + + +/* File I/O */ +#ifndef QT_NO_DOM +# define QT_NO_DOM +#endif +#ifndef QT_NO_FILESYSTEMWATCHER +# define QT_NO_FILESYSTEMWATCHER +#endif +#ifndef QT_NO_FSFILEENGINE +# define QT_NO_FSFILEENGINE +#endif +#ifndef QT_NO_FILESYSTEMMODEL +# define QT_NO_FILESYSTEMMODEL +#endif +#ifndef QT_NO_FILESYSTEMMODEL +# define QT_NO_FILESYSTEMMODEL +#endif +#ifndef QT_NO_PROCESS +# define QT_NO_PROCESS +#endif +#ifndef QT_NO_TEMPORARYFILE +# define QT_NO_TEMPORARYFILE +#endif +#ifndef QT_NO_SETTINGS +# define QT_NO_SETTINGS +#endif +#ifndef QT_NO_LIBRARY +# define QT_NO_LIBRARY +#endif + +/* Fonts */ +#ifndef QT_NO_QWS_QPF2 +# define QT_NO_QWS_QPF2 +#endif + +/* Images */ +#ifndef QT_NO_IMAGEFORMATPLUGIN +# define QT_NO_IMAGEFORMATPLUGIN +#endif +#ifndef QT_NO_IMAGE_HEURISTIC_MASK +# define QT_NO_IMAGE_HEURISTIC_MASK +#endif +#ifndef QT_NO_IMAGE_TEXT +# define QT_NO_IMAGE_TEXT +#endif +#ifndef QT_NO_MOVIE +# define QT_NO_MOVIE +#endif + +/* Internationalization */ +#ifndef QT_NO_BIG_CODECS +# define QT_NO_BIG_CODECS +#endif +#ifndef QT_NO_QWS_INPUTMETHODS +# define QT_NO_QWS_INPUTMETHODS +#endif +#ifndef QT_NO_TEXTCODEC +# define QT_NO_TEXTCODEC +#endif +#ifndef QT_NO_CODECS +# define QT_NO_CODECS +#endif +#ifndef QT_NO_TEXTCODECPLUGIN +# define QT_NO_TEXTCODECPLUGIN +#endif +#ifndef QT_NO_TRANSLATION +# define QT_NO_TRANSLATION +#endif +#ifndef QT_NO_TRANSLATION_UTF8 +# define QT_NO_TRANSLATION_UTF8 +#endif + +/* ItemViews */ + +#ifndef QT_NO_DIRMODEL +# define QT_NO_DIRMODEL +#endif + +/* Kernel */ +#ifndef QT_NO_CLIPBOARD +# define QT_NO_CLIPBOARD +#endif +#ifndef QT_NO_CSSPARSER +# define QT_NO_CSSPARSER +#endif +#ifndef QT_NO_CURSOR +# define QT_NO_CURSOR +#endif +#ifndef QT_NO_DRAGANDDROP +# define QT_NO_DRAGANDDROP +#endif +#ifndef QT_NO_EFFECTS +# define QT_NO_EFFECTS +#endif +#ifndef QT_NO_SESSIONMANAGER +# define QT_NO_SESSIONMANAGER +#endif +#ifndef QT_NO_SHAREDMEMORY +# define QT_NO_SHAREDMEMORY +#endif +#ifndef QT_NO_SOUND +# define QT_NO_SOUND +#endif +#ifndef QT_NO_SYSTEMLOCALE +# define QT_NO_SYSTEMSEMAPHORE +#endif +#ifndef QT_NO_SYSTEMSEMAPHORE +# define QT_NO_SYSTEMSEMAPHORE +#endif +#ifndef QT_NO_TABLETEVENT +# define QT_NO_TABLETEVENT +#endif +#ifndef QT_NO_CRASHHANDLER +# define QT_NO_CRASHHANDLER +#endif +#ifndef QT_NO_CONCURRENT +# define QT_NO_CONCURRENT +#endif +#ifndef QT_NO_XMLSTREAM +# define QT_NO_XMLSTREAM +#endif +#ifndef QT_NO_XMLSTREAMREADER +# define QT_NO_XMLSTREAMREADER +#endif +#ifndef QT_NO_XMLSTREAMWRITER +# define QT_NO_XMLSTREAMWRITER +#endif + +/* Networking */ +#ifndef QT_NO_COP +# define QT_NO_COP +#endif +#ifndef QT_NO_HOSTINFO +# define QT_NO_HOSTINFO +#endif +#ifndef QT_NO_HTTP +# define QT_NO_HTTP +#endif +#ifndef QT_NO_NETWORKPROXY +# define QT_NO_NETWORKPROXY +#endif +#ifndef QT_NO_SOCKS5 +# define QT_NO_SOCKS5 +#endif +#ifndef QT_NO_UDPSOCKET +# define QT_NO_UDPSOCKET +#endif +#ifndef QT_NO_URLINFO +# define QT_NO_URLINFO +#endif +#ifndef QT_NO_FTP +# define QT_NO_FTP +#endif + +/* Painting */ +#ifndef QT_NO_COLORNAMES +# define QT_NO_COLORNAMES +#endif +#ifndef QT_NO_DIRECTPAINTER +# define QT_NO_DIRECTPAINTER +#endif +#ifndef QT_NO_PAINTONSCREEN +# define QT_NO_PAINTONSCREEN +#endif +#ifndef QT_NO_PAINT_DEBUG +# define QT_NO_PAINT_DEBUG +#endif +#ifndef QT_NO_PICTURE +# define QT_NO_PICTURE +#endif +#ifndef QT_NO_PRINTER +# define QT_NO_PRINTER +#endif +#ifndef QT_NO_CUPS +# define QT_NO_CUPS +#endif + +/* Qt for Embedded Linux */ +#ifndef QT_NO_QWSEMBEDWIDGET +# define QT_NO_QWSEMBEDWIDGET +#endif +#ifndef QT_NO_QWS_ALPHA_CURSOR +# define QT_NO_QWS_ALPHA_CURSOR +#endif +#ifndef QT_NO_QWS_CURSOR +# define QT_NO_QWS_CURSOR +#endif +#ifndef QT_NO_QWS_DECORATION_DEFAULT +# define QT_NO_QWS_DECORATION_DEFAULT +#endif +#ifndef QT_NO_QWS_DECORATION_STYLED +# define QT_NO_QWS_DECORATION_STYLED +#endif +#ifndef QT_NO_QWS_DECORATION_WINDOWS +# define QT_NO_QWS_DECORATION_WINDOWS +#endif +#ifndef QT_NO_QWS_MANAGER +# define QT_NO_QWS_MANAGER +#endif +#ifndef QT_NO_QWS_KEYBOARD +# define QT_NO_QWS_KEYBOARD +#endif +#ifndef QT_NO_QWS_MOUSE +# define QT_NO_QWS_MOUSE +#endif +#ifndef QT_NO_QWS_MOUSE_AUTO +# define QT_NO_QWS_MOUSE_AUTO +#endif +#ifndef QT_NO_QWS_MOUSE_MANUAL +# define QT_NO_QWS_MOUSE_MANUAL +#endif +#ifndef QT_NO_QWS_MULTIPROCESS +# define QT_NO_QWS_MULTIPROCESS +#endif +#ifndef QT_NO_QWS_SOUNDSERVER +# define QT_NO_QWS_SOUNDSERVER +#endif +#ifndef QT_NO_SXE +# define QT_NO_SXE +#endif +#ifndef QT_NO_QWS_PROPERTIES +# define QT_NO_QWS_PROPERTIES +#endif +#ifndef QT_NO_QWS_PROXYSCREEN +# define QT_NO_QWS_PROXYSCREEN +#endif +#ifndef QT_NO_QWS_DYNAMICSCREENTRANSFORMATION +# define QT_NO_QWS_DYNAMICSCREENTRANSFORMATION +#endif +#ifndef QT_NO_QWS_LINUXFB +# define QT_NO_QWS_LINUXFB +#endif +#ifndef QT_NO_QWS_MOUSE_PC +# define QT_NO_QWS_MOUSE_PC +#endif +#ifndef QT_NO_QWS_MOUSE_LINUXTP +# define QT_NO_QWS_MOUSE_LINUXTP +#endif +#ifndef QT_NO_QWS_QPF +# define QT_NO_QWS_QPF +#endif + +/* SVG */ +#ifndef QT_NO_SVG +# define QT_NO_SVG +#endif +#ifndef QT_NO_GRAPHICSSVGITEM +# define QT_NO_GRAPHICSSVGITEM +#endif +#ifndef QT_NO_SVGGENERATOR +# define QT_NO_SVGGENERATOR +#endif +#ifndef QT_NO_SVGRENDERER +# define QT_NO_SVGRENDERER +#endif +#ifndef QT_NO_SVGWIDGET +# define QT_NO_SVGWIDGET +#endif + +/* Styles */ +#ifndef QT_NO_STYLE_MOTIF +# define QT_NO_STYLE_MOTIF +#endif +#ifndef QT_NO_STYLE_CDE +# define QT_NO_STYLE_CDE +#endif +#ifndef QT_NO_STYLE_STYLESHEET +# define QT_NO_STYLE_STYLESHEET +#endif +#ifndef QT_NO_STYLE_WINDOWSCE +# define QT_NO_STYLE_WINDOWSCE +#endif +#ifndef QT_NO_STYLE_WINDOWSMOBILE +# define QT_NO_STYLE_WINDOWSMOBILE +#endif +#ifndef QT_NO_STYLE_WINDOWSVISTA +# define QT_NO_STYLE_WINDOWSVISTA +#endif +#ifndef QT_NO_STYLE_WINDOWSXP +# define QT_NO_STYLE_WINDOWSXP +#endif + +/* Utilities */ +#ifndef QT_NO_ACCESSIBILITY +# define QT_NO_ACCESSIBILITY +#endif +#ifndef QT_NO_COMPLETER +# define QT_NO_COMPLETER +#endif +#ifndef QT_NO_DESKTOPSERVICES +# define QT_NO_DESKTOPSERVICES +#endif +#ifndef QT_NO_SCRIPT +# define QT_NO_SCRIPT +#endif +#ifndef QT_NO_SYSTEMTRAYICON +# define QT_NO_SYSTEMTRAYICON +#endif + +/* Windows */ +#ifndef QT_NO_WIN_ACTIVEQT +# define QT_NO_WIN_ACTIVEQT +#endif diff --git a/src/corelib/global/qconfig-small.h b/src/corelib/global/qconfig-small.h new file mode 100644 index 0000000000..b4ec6548e9 --- /dev/null +++ b/src/corelib/global/qconfig-small.h @@ -0,0 +1,335 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* Data structures */ +#ifndef QT_NO_QUUID_STRING +# define QT_NO_QUUID_STRING +#endif +#ifndef QT_NO_STL +# define QT_NO_STL +#endif + +/* Dialogs */ +#ifndef QT_NO_COLORDIALOG +# define QT_NO_COLORDIALOG +#endif +#ifndef QT_NO_ERRORMESSAGE +# define QT_NO_ERRORMESSAGE +#endif +#ifndef QT_NO_FILEDIALOG +# define QT_NO_FILEDIALOG +#endif +#ifndef QT_NO_FONTDIALOG +# define QT_NO_FONTDIALOG +#endif +#ifndef QT_NO_INPUTDIALOG +# define QT_NO_INPUTDIALOG +#endif +#ifndef QT_NO_MESSAGEBOX +# define QT_NO_MESSAGEBOX +#endif +#ifndef QT_NO_PRINTDIALOG +# define QT_NO_PRINTDIALOG +#endif +#ifndef QT_NO_PROGRESSDIALOG +# define QT_NO_PROGRESSDIALOG +#endif +#ifndef QT_NO_TABDIALOG +# define QT_NO_TABDIALOG +#endif + +/* File I/O */ +#ifndef QT_NO_TEXTSTREAM +# define QT_NO_TEXTSTREAM +#endif +#ifndef QT_NO_SETTINGS +# define QT_NO_SETTINGS +#endif +#ifndef QT_NO_LIBRARY +# define QT_NO_LIBRARY +#endif + +/* Fonts */ +#ifndef QT_NO_FREETYPE +# define QT_NO_FREETYPE +#endif + +/* Images */ +#ifndef QT_NO_IMAGEFORMATPLUGIN +# define QT_NO_IMAGEFORMATPLUGIN +#endif +#ifndef QT_NO_IMAGEFORMAT_BMP +# define QT_NO_IMAGEFORMAT_BMP +#endif +#ifndef QT_NO_IMAGEFORMAT_JPEG +# define QT_NO_IMAGEFORMAT_JPEG +#endif +#ifndef QT_NO_IMAGEFORMAT_PPM +# define QT_NO_IMAGEFORMAT_PPM +#endif +#ifndef QT_NO_IMAGEFORMAT_XBM +# define QT_NO_IMAGEFORMAT_XBM +#endif +#ifndef QT_NO_IMAGEFORMAT_XPM +# define QT_NO_IMAGEFORMAT_XPM +#endif +#ifndef QT_NO_IMAGE_TEXT +# define QT_NO_IMAGE_TEXT +#endif +#ifndef QT_NO_MOVIE +# define QT_NO_MOVIE +#endif + +/* Internationalization */ +#ifndef QT_NO_QWS_INPUTMETHODS +# define QT_NO_QWS_INPUTMETHODS +#endif +#ifndef QT_NO_TEXTCODEC +# define QT_NO_TEXTCODEC +#endif +#ifndef QT_NO_CODECS +# define QT_NO_CODECS +#endif +#ifndef QT_NO_TEXTCODECPLUGIN +# define QT_NO_TEXTCODECPLUGIN +#endif +#ifndef QT_NO_TRANSLATION +# define QT_NO_TRANSLATION +#endif +#ifndef QT_NO_TRANSLATION_UTF8 +# define QT_NO_TRANSLATION_UTF8 +#endif + +/* ItemViews */ +#ifndef QT_NO_DIRMODEL +# define QT_NO_DIRMODEL +#endif +#ifndef QT_NO_PROXYMODEL +# define QT_NO_PROXYMODEL +#endif +#ifndef QT_NO_SORTFILTERPROXYMODEL +# define QT_NO_SORTFILTERPROXYMODEL +#endif +#ifndef QT_NO_STRINGLISTMODEL +# define QT_NO_STRINGLISTMODEL +#endif +#ifndef QT_NO_TABLEVIEW +# define QT_NO_TABLEVIEW +#endif +#ifndef QT_NO_TREEVIEW +# define QT_NO_TREEVIEW +#endif + +/* Kernel */ +#ifndef QT_NO_ACTION +# define QT_NO_ACTION +#endif +#ifndef QT_NO_CLIPBOARD +# define QT_NO_CLIPBOARD +#endif +#ifndef QT_NO_DRAGANDDROP +# define QT_NO_DRAGANDDROP +#endif +#ifndef QT_NO_EFFECTS +# define QT_NO_EFFECTS +#endif +#ifndef QT_NO_PROPERTIES +# define QT_NO_PROPERTIES +#endif +#ifndef QT_NO_SESSIONMANAGER +# define QT_NO_SESSIONMANAGER +#endif +#ifndef QT_NO_SHORTCUT +# define QT_NO_SHORTCUT +#endif +#ifndef QT_NO_SOUND +# define QT_NO_SOUND +#endif +#ifndef QT_NO_WHEELEVENT +# define QT_NO_WHEELEVENT +#endif + +/* Networking */ +#ifndef QT_NO_COP +# define QT_NO_COP +#endif +#ifndef QT_NO_HOSTINFO +# define QT_NO_HOSTINFO +#endif +#ifndef QT_NO_HTTP +# define QT_NO_HTTP +#endif + +/* Painting */ +#ifndef QT_NO_COLORNAMES +# define QT_NO_COLORNAMES +#endif +#ifndef QT_NO_PICTURE +# define QT_NO_PICTURE +#endif +#ifndef QT_NO_PRINTER +# define QT_NO_PRINTER +#endif +#ifndef QT_NO_CUPS +# define QT_NO_CUPS +#endif + +/* Qt for Embedded Linux */ +#ifndef QT_NO_QWS_SOUNDSERVER +# define QT_NO_QWS_SOUNDSERVER +#endif +#ifndef QT_NO_QWS_PROPERTIES +# define QT_NO_QWS_PROPERTIES +#endif + +/* Styles */ +#ifndef QT_NO_STYLE_MOTIF +# define QT_NO_STYLE_MOTIF +#endif +#ifndef QT_NO_STYLE_CDE +# define QT_NO_STYLE_CDE +#endif +#ifndef QT_NO_STYLE_CLEANLOOKS +# define QT_NO_STYLE_CLEANLOOKS +#endif +#ifndef QT_NO_STYLE_PLASTIQUE +# define QT_NO_STYLE_PLASTIQUE +#endif +#ifndef QT_NO_STYLE_STYLESHEET +# define QT_NO_STYLE_STYLESHEET +#endif +#ifndef QT_NO_STYLE_WINDOWSXP +# define QT_NO_STYLE_WINDOWSXP +#endif + +/* Utilities */ +#ifndef QT_NO_COMPLETER +# define QT_NO_COMPLETER +#endif +#ifndef QT_NO_DESKTOPSERVICES +# define QT_NO_DESKTOPSERVICES +#endif +#ifndef QT_NO_SYSTEMTRAYICON +# define QT_NO_SYSTEMTRAYICON +#endif +#ifndef QT_NO_GESTURES +# define QT_NO_GESTURES +#endif + +/* Widgets */ +#ifndef QT_NO_LCDNUMBER +# define QT_NO_LCDNUMBER +#endif +#ifndef QT_NO_FONTCOMBOBOX +# define QT_NO_FONTCOMBOBOX +#endif +#ifndef QT_NO_SPINBOX +# define QT_NO_SPINBOX +#endif +#ifndef QT_NO_CALENDARWIDGET +# define QT_NO_CALENDARWIDGET +#endif +#ifndef QT_NO_DATETIMEEDIT +# define QT_NO_DATETIMEEDIT +#endif +#ifndef QT_NO_MENU +# define QT_NO_MENU +#endif +#ifndef QT_NO_CONTEXTMENU +# define QT_NO_CONTEXTMENU +#endif +#ifndef QT_NO_MAINWINDOW +# define QT_NO_MAINWINDOW +#endif +#ifndef QT_NO_DOCKWIDGET +# define QT_NO_DOCKWIDGET +#endif +#ifndef QT_NO_TOOLBAR +# define QT_NO_TOOLBAR +#endif +#ifndef QT_NO_MENUBAR +# define QT_NO_MENUBAR +#endif +#ifndef QT_NO_WORKSPACE +# define QT_NO_WORKSPACE +#endif +#ifndef QT_NO_PROGRESSBAR +# define QT_NO_PROGRESSBAR +#endif +#ifndef QT_NO_SPLITTER +# define QT_NO_SPLITTER +#endif +#ifndef QT_NO_SIZEGRIP +# define QT_NO_SIZEGRIP +#endif +#ifndef QT_NO_STACKEDWIDGET +# define QT_NO_STACKEDWIDGET +#endif +#ifndef QT_NO_TABWIDGET +# define QT_NO_TABWIDGET +#endif +#ifndef QT_NO_STATUSBAR +# define QT_NO_STATUSBAR +#endif +#ifndef QT_NO_TABLEWIDGET +# define QT_NO_TABLEWIDGET +#endif +#ifndef QT_NO_TOOLBUTTON +# define QT_NO_TOOLBUTTON +#endif +#ifndef QT_NO_TABBAR +# define QT_NO_TABBAR +#endif +#ifndef QT_NO_TOOLBOX +# define QT_NO_TOOLBOX +#endif +#ifndef QT_NO_WHATSTHIS +# define QT_NO_WHATSTHIS +#endif +#ifndef QT_NO_TOOLTIP +# define QT_NO_TOOLTIP +#endif +#ifndef QT_NO_TREEWIDGET +# define QT_NO_TREEWIDGET +#endif +#ifndef QT_NO_VALIDATOR +# define QT_NO_VALIDATOR +#endif diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h new file mode 100644 index 0000000000..566307b311 --- /dev/null +++ b/src/corelib/global/qendian.h @@ -0,0 +1,370 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QENDIAN_H +#define QENDIAN_H + +#include + +// include stdlib.h and hope that it defines __GLIBC__ for glibc-based systems +#include + +#ifdef __GLIBC__ +#include +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +/* + * ENDIAN FUNCTIONS +*/ +inline void qbswap_helper(const uchar *src, uchar *dest, int size) +{ + for (int i = 0; i < size ; ++i) dest[i] = src[size - 1 - i]; +} + +/* + * qbswap(const T src, const uchar *dest); + * Changes the byte order of \a src from big endian to little endian or vice versa + * and stores the result in \a dest. + * There is no alignment requirements for \a dest. +*/ +template inline void qbswap(const T src, uchar *dest) +{ + qbswap_helper(reinterpret_cast(&src), dest, sizeof(T)); +} + +// Used to implement a type-safe and alignment-safe copy operation +// If you want to avoid the memcopy, you must write specializations for this function +template inline void qToUnaligned(const T src, uchar *dest) +{ + qMemCopy(dest, &src, sizeof(T)); +} + +/* T qFromLittleEndian(const uchar *src) + * This function will read a little-endian encoded value from \a src + * and return the value in host-endian encoding. + * There is no requirement that \a src must be aligned. +*/ +#if defined Q_CC_SUN +inline quint64 qFromLittleEndian_helper(const uchar *src, quint64 *dest) +{ + return 0 + | src[0] + | src[1] * Q_UINT64_C(0x0000000000000100) + | src[2] * Q_UINT64_C(0x0000000000010000) + | src[3] * Q_UINT64_C(0x0000000001000000) + | src[4] * Q_UINT64_C(0x0000000100000000) + | src[5] * Q_UINT64_C(0x0000010000000000) + | src[6] * Q_UINT64_C(0x0001000000000000) + | src[7] * Q_UINT64_C(0x0100000000000000); +} + +inline quint32 qFromLittleEndian_helper(const uchar *src, quint32 *dest) +{ + return 0 + | src[0] + | src[1] * quint32(0x00000100) + | src[2] * quint32(0x00010000) + | src[3] * quint32(0x01000000); +} + +inline quint16 qFromLittleEndian_helper(const uchar *src, quint16 *dest) +{ + return 0 + | src[0] + | src[1] * 0x0100; +} + +inline qint64 qFromLittleEndian_helper(const uchar *src, qint64 * dest) +{ return static_cast(qFromLittleEndian_helper(src, reinterpret_cast(0))); } +inline qint32 qFromLittleEndian_helper(const uchar *src, qint32 * dest) +{ return static_cast(qFromLittleEndian_helper(src, reinterpret_cast(0))); } +inline qint16 qFromLittleEndian_helper(const uchar *src, qint16 * dest) +{ return static_cast(qFromLittleEndian_helper(src, reinterpret_cast(0))); } + +template inline T qFromLittleEndian(const uchar *src) +{ + return qFromLittleEndian_helper(src, reinterpret_cast(0)); +} + +#else +template inline T qFromLittleEndian(const uchar *src); +template <> inline quint64 qFromLittleEndian(const uchar *src) +{ + return 0 + | src[0] + | src[1] * Q_UINT64_C(0x0000000000000100) + | src[2] * Q_UINT64_C(0x0000000000010000) + | src[3] * Q_UINT64_C(0x0000000001000000) + | src[4] * Q_UINT64_C(0x0000000100000000) + | src[5] * Q_UINT64_C(0x0000010000000000) + | src[6] * Q_UINT64_C(0x0001000000000000) + | src[7] * Q_UINT64_C(0x0100000000000000); +} + +template <> inline quint32 qFromLittleEndian(const uchar *src) +{ + return 0 + | src[0] + | src[1] * quint32(0x00000100) + | src[2] * quint32(0x00010000) + | src[3] * quint32(0x01000000); +} + +template <> inline quint16 qFromLittleEndian(const uchar *src) +{ + return quint16(0 + | src[0] + | src[1] * 0x0100); +} + +// signed specializations +template <> inline qint64 qFromLittleEndian(const uchar *src) +{ return static_cast(qFromLittleEndian(src)); } + +template <> inline qint32 qFromLittleEndian(const uchar *src) +{ return static_cast(qFromLittleEndian(src)); } + +template <> inline qint16 qFromLittleEndian(const uchar *src) +{ return static_cast(qFromLittleEndian(src)); } +#endif + +/* This function will read a big-endian (also known as network order) encoded value from \a src + * and return the value in host-endian encoding. + * There is no requirement that \a src must be aligned. +*/ +#if defined Q_CC_SUN +inline quint64 qFromBigEndian_helper(const uchar *src, quint64 *dest) +{ + return 0 + | src[7] + | src[6] * Q_UINT64_C(0x0000000000000100) + | src[5] * Q_UINT64_C(0x0000000000010000) + | src[4] * Q_UINT64_C(0x0000000001000000) + | src[3] * Q_UINT64_C(0x0000000100000000) + | src[2] * Q_UINT64_C(0x0000010000000000) + | src[1] * Q_UINT64_C(0x0001000000000000) + | src[0] * Q_UINT64_C(0x0100000000000000); +} + +inline quint32 qFromBigEndian_helper(const uchar *src, quint32 * dest) +{ + return 0 + | src[3] + | src[2] * quint32(0x00000100) + | src[1] * quint32(0x00010000) + | src[0] * quint32(0x01000000); +} + +inline quint16 qFromBigEndian_helper(const uchar *src, quint16 * des) +{ + return 0 + | src[1] + | src[0] * 0x0100; +} + + +inline qint64 qFromBigEndian_helper(const uchar *src, qint64 * dest) +{ return static_cast(qFromBigEndian_helper(src, reinterpret_cast(0))); } +inline qint32 qFromBigEndian_helper(const uchar *src, qint32 * dest) +{ return static_cast(qFromBigEndian_helper(src, reinterpret_cast(0))); } +inline qint16 qFromBigEndian_helper(const uchar *src, qint16 * dest) +{ return static_cast(qFromBigEndian_helper(src, reinterpret_cast(0))); } + +template inline T qFromBigEndian(const uchar *src) +{ + return qFromBigEndian_helper(src, reinterpret_cast(0)); +} + +#else +template inline T qFromBigEndian(const uchar *src); +template<> +inline quint64 qFromBigEndian(const uchar *src) +{ + return 0 + | src[7] + | src[6] * Q_UINT64_C(0x0000000000000100) + | src[5] * Q_UINT64_C(0x0000000000010000) + | src[4] * Q_UINT64_C(0x0000000001000000) + | src[3] * Q_UINT64_C(0x0000000100000000) + | src[2] * Q_UINT64_C(0x0000010000000000) + | src[1] * Q_UINT64_C(0x0001000000000000) + | src[0] * Q_UINT64_C(0x0100000000000000); +} + +template<> +inline quint32 qFromBigEndian(const uchar *src) +{ + return 0 + | src[3] + | src[2] * quint32(0x00000100) + | src[1] * quint32(0x00010000) + | src[0] * quint32(0x01000000); +} + +template<> +inline quint16 qFromBigEndian(const uchar *src) +{ + return quint16( 0 + | src[1] + | src[0] * quint16(0x0100)); +} + + +// signed specializations +template <> inline qint64 qFromBigEndian(const uchar *src) +{ return static_cast(qFromBigEndian(src)); } + +template <> inline qint32 qFromBigEndian(const uchar *src) +{ return static_cast(qFromBigEndian(src)); } + +template <> inline qint16 qFromBigEndian(const uchar *src) +{ return static_cast(qFromBigEndian(src)); } +#endif +/* + * T qbswap(T source). + * Changes the byte order of a value from big endian to little endian or vice versa. + * This function can be used if you are not concerned about alignment issues, + * and it is therefore a bit more convenient and in most cases more efficient. +*/ +template T qbswap(T source); + +#ifdef __GLIBC__ +template <> inline quint64 qbswap(quint64 source) +{ + return bswap_64(source); +} +template <> inline quint32 qbswap(quint32 source) +{ + return bswap_32(source); +} +template <> inline quint16 qbswap(quint16 source) +{ + return bswap_16(source); +} +#else +template <> inline quint64 qbswap(quint64 source) +{ + return 0 + | ((source & Q_UINT64_C(0x00000000000000ff)) << 56) + | ((source & Q_UINT64_C(0x000000000000ff00)) << 40) + | ((source & Q_UINT64_C(0x0000000000ff0000)) << 24) + | ((source & Q_UINT64_C(0x00000000ff000000)) << 8) + | ((source & Q_UINT64_C(0x000000ff00000000)) >> 8) + | ((source & Q_UINT64_C(0x0000ff0000000000)) >> 24) + | ((source & Q_UINT64_C(0x00ff000000000000)) >> 40) + | ((source & Q_UINT64_C(0xff00000000000000)) >> 56); +} + +template <> inline quint32 qbswap(quint32 source) +{ + return 0 + | ((source & 0x000000ff) << 24) + | ((source & 0x0000ff00) << 8) + | ((source & 0x00ff0000) >> 8) + | ((source & 0xff000000) >> 24); +} + +template <> inline quint16 qbswap(quint16 source) +{ + return quint16( 0 + | ((source & 0x00ff) << 8) + | ((source & 0xff00) >> 8) ); +} +#endif // __GLIBC__ + +// signed specializations +template <> inline qint64 qbswap(qint64 source) +{ + return qbswap(quint64(source)); +} + +template <> inline qint32 qbswap(qint32 source) +{ + return qbswap(quint32(source)); +} + +template <> inline qint16 qbswap(qint16 source) +{ + return qbswap(quint16(source)); +} + +#if Q_BYTE_ORDER == Q_BIG_ENDIAN + +template inline T qToBigEndian(T source) +{ return source; } +template inline T qFromBigEndian(T source) +{ return source; } +template inline T qToLittleEndian(T source) +{ return qbswap(source); } +template inline T qFromLittleEndian(T source) +{ return qbswap(source); } +template inline void qToBigEndian(T src, uchar *dest) +{ qToUnaligned(src, dest); } +template inline void qToLittleEndian(T src, uchar *dest) +{ qbswap(src, dest); } +#else // Q_LITTLE_ENDIAN + +template inline T qToBigEndian(T source) +{ return qbswap(source); } +template inline T qFromBigEndian(T source) +{ return qbswap(source); } +template inline T qToLittleEndian(T source) +{ return source; } +template inline T qFromLittleEndian(T source) +{ return source; } +template inline void qToBigEndian(T src, uchar *dest) +{ qbswap(src, dest); } +template inline void qToLittleEndian(T src, uchar *dest) +{ qToUnaligned(src, dest); } + +#endif // Q_BYTE_ORDER == Q_BIG_ENDIAN + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QENDIAN_H diff --git a/src/corelib/global/qendian.qdoc b/src/corelib/global/qendian.qdoc new file mode 100644 index 0000000000..85d600d7a2 --- /dev/null +++ b/src/corelib/global/qendian.qdoc @@ -0,0 +1,154 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of this +** file. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \headerfile + \title Endian Conversion Functions + \ingroup funclists + \brief The header provides functions to convert between + little and big endian representations of numbers. +*/ + +/*! + \fn T qFromBigEndian(const uchar *src) + \since 4.3 + \relates + + Reads a big-endian number from memory location \a src and returns the number in the + host byte order representation. + On CPU architectures where the host byte order is little-endian (such as x86) this + will swap the byte order; otherwise it will just read from \a src. + + \note Template type \c{T} can either be a qint16, qint32 or qint64. Other types of + integers, e.g., qlong, are not applicable. + + There are no data alignment constraints for \a src. + + \sa qFromLittleEndian() + \sa qToBigEndian() + \sa qToLittleEndian() +*/ +/*! + \fn T qFromBigEndian(T src) + \since 4.3 + \relates + \overload + + Converts \a src from big-endian byte order and returns the number in host byte order + representation of that number. + On CPU architectures where the host byte order is little-endian (such as x86) this + will return \a src with the byte order swapped; otherwise it will return \a src + unmodified. +*/ +/*! + \fn T qFromLittleEndian(const uchar *src) + \since 4.3 + \relates + + Reads a little-endian number from memory location \a src and returns the number in + the host byte order representation. + On CPU architectures where the host byte order is big-endian (such as PowerPC) this + will swap the byte order; otherwise it will just read from \a src. + + \note Template type \c{T} can either be a qint16, qint32 or qint64. Other types of + integers, e.g., qlong, are not applicable. + + There are no data alignment constraints for \a src. + + \sa qFromBigEndian() + \sa qToBigEndian() + \sa qToLittleEndian() +*/ +/*! + \fn T qFromLittleEndian(T src) + \since 4.3 + \relates + \overload + + Converts \a src from little-endian byte order and returns the number in host byte + order representation of that number. + On CPU architectures where the host byte order is big-endian (such as PowerPC) this + will return \a src with the byte order swapped; otherwise it will return \a src + unmodified. +*/ +/*! + \fn void qToBigEndian(T src, uchar *dest) + \since 4.3 + \relates + + Writes the number \a src with template type \c{T} to the memory location at \a dest + in big-endian byte order. + + Note that template type \c{T} can only be an integer data type (signed or unsigned). + + There are no data alignment constraints for \a dest. + + \sa qFromBigEndian() + \sa qFromLittleEndian() + \sa qToLittleEndian() +*/ +/*! + \fn T qToBigEndian(T src) + \since 4.3 + \relates + \overload + + Converts \a src from host byte order and returns the number in big-endian byte order + representation of that number. + On CPU architectures where the host byte order is little-endian (such as x86) this + will return \a src with the byte order swapped; otherwise it will return \a src + unmodified. +*/ +/*! + \fn void qToLittleEndian(T src, uchar *dest) + \since 4.3 + \relates + + Writes the number \a src with template type \c{T} to the memory location at \a dest + in little-endian byte order. + + Note that template type \c{T} can only be an integer data type (signed or unsigned). + + There are no data alignment constraints for \a dest. + + \sa qFromBigEndian() + \sa qFromLittleEndian() + \sa qToBigEndian() +*/ +/*! + \fn T qToLittleEndian(T src) + \since 4.3 + \relates + \overload + + Converts \a src from host byte order and returns the number in little-endian byte + order representation of that number. + On CPU architectures where the host byte order is big-endian (such as PowerPC) this + will return \a src with the byte order swapped; otherwise it will return \a src + unmodified. +*/ + diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h new file mode 100644 index 0000000000..604d08a34b --- /dev/null +++ b/src/corelib/global/qfeatures.h @@ -0,0 +1,893 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + * All features and their dependencies. + * + * This list is generated from $QTDIR/src/corelib/global/qfeatures.txt + * by $QTSRCDIR/util/scripts/make_qfeatures_dot_h + */ + +// QAction +//#define QT_NO_ACTION + +// Big Codecs +//#define QT_NO_BIG_CODECS + +// Color Names +//#define QT_NO_COLORNAMES + +// QtConcurrent +//#define QT_NO_CONCURRENT + +// QCopChannel +//#define QT_NO_COP + +// CssParser +//#define QT_NO_CSSPARSER + +// QCursor +//#define QT_NO_CURSOR + +// QDesktopServices +//#define QT_NO_DESKTOPSERVICES + +// QDirectPainter +//#define QT_NO_DIRECTPAINTER + +// Document Object Model +//#define QT_NO_DOM + +// Effects +//#define QT_NO_EFFECTS + +// QFileSystemIterator +//#define QT_NO_FILESYSTEMITERATOR + +// QFileSystemWatcher +//#define QT_NO_FILESYSTEMWATCHER + +// Freetype Font Engine +//#define QT_NO_FREETYPE + +// Gesture +//#define QT_NO_GESTURES + +// QGroupBox +//#define QT_NO_GROUPBOX + +// QImageIOPlugin +//#define QT_NO_IMAGEFORMATPLUGIN + +// BMP Image Format +//#define QT_NO_IMAGEFORMAT_BMP + +// JPEG Image Format +//#define QT_NO_IMAGEFORMAT_JPEG + +// PNG Image Format +//#define QT_NO_IMAGEFORMAT_PNG + +// PPM Image Format +//#define QT_NO_IMAGEFORMAT_PPM + +// XBM Image Format +//#define QT_NO_IMAGEFORMAT_XBM + +// QImage::createHeuristicMask() +//#define QT_NO_IMAGE_HEURISTIC_MASK + +// Image Text +//#define QT_NO_IMAGE_TEXT + +// QLCDNumber +//#define QT_NO_LCDNUMBER + +// QLineEdit +//#define QT_NO_LINEEDIT + +// QMessageBox +//#define QT_NO_MESSAGEBOX + +// QMovie +//#define QT_NO_MOVIE + +// QNetworkInterface +//#define QT_NO_NETWORKINTERFACE + +// QNetworkProxy +//#define QT_NO_NETWORKPROXY + +// Qt::WA_PaintOnScreen +//#define QT_NO_PAINTONSCREEN + +// Painting Debug Utilities +//#define QT_NO_PAINT_DEBUG + +// Phonon::AbstractMediaStream +//#define QT_NO_PHONON_ABSTRACTMEDIASTREAM + +// Support for Audio Capture +//#define QT_NO_PHONON_AUDIOCAPTURE + +// Phonon::Effect +//#define QT_NO_PHONON_EFFECT + +// Phonon::MediaController +//#define QT_NO_PHONON_MEDIACONTROLLER + +// Phonon::ObjectDescriptionModel +//#define QT_NO_PHONON_OBJECTDESCRIPTIONMODEL + +// Phonon::VideoWidget +//#define QT_NO_PHONON_VIDEO + +// QPicture +//#define QT_NO_PICTURE + +// QProcess +//#define QT_NO_PROCESS + +// QProgressBar +//#define QT_NO_PROGRESSBAR + +// Properties +//#define QT_NO_PROPERTIES + +// Universally Unique Identifier Convertion +//#define QT_NO_QUUID_STRING + +// QWSEmbedWidget +//#define QT_NO_QWSEMBEDWIDGET + +// Alpha Cursor +//#define QT_NO_QWS_ALPHA_CURSOR + +// Decoration +//#define QT_NO_QWS_DECORATION_DEFAULT + +// Keyboard +//#define QT_NO_QWS_KEYBOARD + +// Mouse +//#define QT_NO_QWS_MOUSE + +// Mouse (Auto) +//#define QT_NO_QWS_MOUSE_AUTO + +// Mouse (Non-Auto) +//#define QT_NO_QWS_MOUSE_MANUAL + +// Multi-Process +//#define QT_NO_QWS_MULTIPROCESS + +// Properties +//#define QT_NO_QWS_PROPERTIES + +// QProxyScreen +//#define QT_NO_QWS_PROXYSCREEN + +// Qt Prerendered Font Format +//#define QT_NO_QWS_QPF + +// Qt Prerendered Font Format 2 +//#define QT_NO_QWS_QPF2 + +// Raster Paint Engine callback functions +//#define QT_NO_RASTERCALLBACKS + +// Resize Handler +//#define QT_NO_RESIZEHANDLER + +// QRubberBand +//#define QT_NO_RUBBERBAND + +// Session Manager +//#define QT_NO_SESSIONMANAGER + +// QSettings +//#define QT_NO_SETTINGS + +// QSharedMemory +//#define QT_NO_SHAREDMEMORY + +// QShortcut +//#define QT_NO_SHORTCUT + +// QSignalMapper +//#define QT_NO_SIGNALMAPPER + +// QSizeGrip +//#define QT_NO_SIZEGRIP + +// QSlider +//#define QT_NO_SLIDER + +// Sounds +//#define QT_NO_SOUND + +// Spin Widget +//#define QT_NO_SPINWIDGET + +// Splash screen widget +//#define QT_NO_SPLASHSCREEN + +// QStackedWidget +//#define QT_NO_STACKEDWIDGET + +// QStatusBar +//#define QT_NO_STATUSBAR + +// Status Tip +//#define QT_NO_STATUSTIP + +// Standard Template Library +//#define QT_NO_STL + +// QMotifStyle +//#define QT_NO_STYLE_MOTIF + +// QWindowsStyle +//#define QT_NO_STYLE_WINDOWS + +// QSystemSemaphore +//#define QT_NO_SYSTEMSEMAPHORE + +// QSystemTrayIcon +//#define QT_NO_SYSTEMTRAYICON + +// QTabletEvent +//#define QT_NO_TABLETEVENT + +// QTemporaryFile +//#define QT_NO_TEMPORARYFILE + +// QTextCodec +//#define QT_NO_TEXTCODEC + +// Text Date +//#define QT_NO_TEXTDATE + +// HtmlParser +//#define QT_NO_TEXTHTMLPARSER + +// QTextStream +//#define QT_NO_TEXTSTREAM + +// QToolTip +//#define QT_NO_TOOLTIP + +// Translation +//#define QT_NO_TRANSLATION + +// QUdpSocket +//#define QT_NO_UDPSOCKET + +// QUndoCommand +//#define QT_NO_UNDOCOMMAND + +// QUrlInfo +//#define QT_NO_URLINFO + +// QValidator +//#define QT_NO_VALIDATOR + +// QWheelEvent +//#define QT_NO_WHEELEVENT + +// +//#define QT_NO_XMLSTREAM + +// Animation +#if !defined(QT_NO_ANIMATION) && (defined(QT_NO_PROPERTIES)) +#define QT_NO_ANIMATION +#endif + +// QButtonGroup +#if !defined(QT_NO_BUTTONGROUP) && (defined(QT_NO_GROUPBOX)) +#define QT_NO_BUTTONGROUP +#endif + +// QClipboard +#if !defined(QT_NO_CLIPBOARD) && (defined(QT_NO_QWS_PROPERTIES)) +#define QT_NO_CLIPBOARD +#endif + +// Codecs +#if !defined(QT_NO_CODECS) && (defined(QT_NO_TEXTCODEC)) +#define QT_NO_CODECS +#endif + +// QDate/QTime/QDateTime +#if !defined(QT_NO_DATESTRING) && (defined(QT_NO_TEXTDATE)) +#define QT_NO_DATESTRING +#endif + +// QDial +#if !defined(QT_NO_DIAL) && (defined(QT_NO_SLIDER)) +#define QT_NO_DIAL +#endif + +// QFileSystemModel +#if !defined(QT_NO_FILESYSTEMMODEL) && (defined(QT_NO_FILESYSTEMWATCHER)) +#define QT_NO_FILESYSTEMMODEL +#endif + +// QHostInfo +#if !defined(QT_NO_HOSTINFO) && (defined(QT_NO_TEXTSTREAM)) +#define QT_NO_HOSTINFO +#endif + +// XPM Image Format +#if !defined(QT_NO_IMAGEFORMAT_XPM) && (defined(QT_NO_TEXTSTREAM)) +#define QT_NO_IMAGEFORMAT_XPM +#endif + +// QLibrary +#if !defined(QT_NO_LIBRARY) && (defined(QT_NO_SETTINGS)) +#define QT_NO_LIBRARY +#endif + +// QMenu +#if !defined(QT_NO_MENU) && (defined(QT_NO_ACTION)) +#define QT_NO_MENU +#endif + +// QNetworkDiskCache +#if !defined(QT_NO_NETWORKDISKCACHE) && (defined(QT_NO_TEMPORARYFILE)) +#define QT_NO_NETWORKDISKCACHE +#endif + +// Phonon::SeekSlider +#if !defined(QT_NO_PHONON_SEEKSLIDER) && (defined(QT_NO_SLIDER)) +#define QT_NO_PHONON_SEEKSLIDER +#endif + +// Phonon::AbstractMediaStream +#if !defined(QT_NO_PHONON_SETTINGSGROUP) && (defined(QT_NO_SETTINGS)) +#define QT_NO_PHONON_SETTINGSGROUP +#endif + +// Phonon::VideoPlayer +#if !defined(QT_NO_PHONON_VIDEOPLAYER) && (defined(QT_NO_PHONON_VIDEO)) +#define QT_NO_PHONON_VIDEOPLAYER +#endif + +// Phonon::VolumeFaderEffect +#if !defined(QT_NO_PHONON_VOLUMEFADEREFFECT) && (defined(QT_NO_PHONON_EFFECT)) +#define QT_NO_PHONON_VOLUMEFADEREFFECT +#endif + +// QProgressDialog +#if !defined(QT_NO_PROGRESSDIALOG) && (defined(QT_NO_PROGRESSBAR)) +#define QT_NO_PROGRESSDIALOG +#endif + +// Cursor +#if !defined(QT_NO_QWS_CURSOR) && (defined(QT_NO_CURSOR)) +#define QT_NO_QWS_CURSOR +#endif + +// Decoration (Styled) +#if !defined(QT_NO_QWS_DECORATION_STYLED) && (defined(QT_NO_QWS_DECORATION_DEFAULT)) +#define QT_NO_QWS_DECORATION_STYLED +#endif + +// Decoration (Windows Style) +#if !defined(QT_NO_QWS_DECORATION_WINDOWS) && (defined(QT_NO_QWS_DECORATION_DEFAULT)) +#define QT_NO_QWS_DECORATION_WINDOWS +#endif + +// Dynamic screen transformation. +#if !defined(QT_NO_QWS_DYNAMICSCREENTRANSFORMATION) && (defined(QT_NO_QWS_PROXYSCREEN)) +#define QT_NO_QWS_DYNAMICSCREENTRANSFORMATION +#endif + +// Manager +#if !defined(QT_NO_QWS_MANAGER) && (defined(QT_NO_QWS_DECORATION_DEFAULT)) +#define QT_NO_QWS_MANAGER +#endif + +// QVncTransformed +#if !defined(QT_NO_QWS_TRANSFORMED) && (defined(QT_NO_QWS_PROXYSCREEN)) +#define QT_NO_QWS_TRANSFORMED +#endif + +// QVncScreen +#if !defined(QT_NO_QWS_VNC) && (defined(QT_NO_QWS_PROXYSCREEN)) +#define QT_NO_QWS_VNC +#endif + +// QScrollBar +#if !defined(QT_NO_SCROLLBAR) && (defined(QT_NO_SLIDER)) +#define QT_NO_SCROLLBAR +#endif + +// SOCKS5 +#if !defined(QT_NO_SOCKS5) && (defined(QT_NO_NETWORKPROXY)) +#define QT_NO_SOCKS5 +#endif + +// QSoftKeyManager +#if !defined(QT_NO_SOFTKEYMANAGER) && (defined(QT_NO_ACTION)) +#define QT_NO_SOFTKEYMANAGER +#endif + +// QSplitter +#if !defined(QT_NO_SPLITTER) && (defined(QT_NO_RUBBERBAND)) +#define QT_NO_SPLITTER +#endif + +// State machine +#if !defined(QT_NO_STATEMACHINE) && (defined(QT_NO_PROPERTIES)) +#define QT_NO_STATEMACHINE +#endif + +// QCDEStyle +#if !defined(QT_NO_STYLE_CDE) && (defined(QT_NO_STYLE_MOTIF)) +#define QT_NO_STYLE_CDE +#endif + +// QWindowsXPStyle +#if !defined(QT_NO_STYLE_WINDOWSXP) && (defined(QT_NO_STYLE_WINDOWS)) +#define QT_NO_STYLE_WINDOWSXP +#endif + +// SXE +#if !defined(QT_NO_SXE) && (defined(QT_NO_QWS_MULTIPROCESS)) +#define QT_NO_SXE +#endif + +// QToolButton +#if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_ACTION)) +#define QT_NO_TOOLBUTTON +#endif + +// QUndoStack +#if !defined(QT_NO_UNDOSTACK) && (defined(QT_NO_UNDOCOMMAND)) +#define QT_NO_UNDOSTACK +#endif + +// ActiveQt +#if !defined(QT_NO_WIN_ACTIVEQT) && (defined(QT_NO_PROPERTIES)) +#define QT_NO_WIN_ACTIVEQT +#endif + +// QWizard +#if !defined(QT_NO_WIZARD) && (defined(QT_NO_PROPERTIES)) +#define QT_NO_WIZARD +#endif + +// QXmlStreamReader +#if !defined(QT_NO_XMLSTREAMREADER) && (defined(QT_NO_XMLSTREAM)) +#define QT_NO_XMLSTREAMREADER +#endif + +// QXmlStreamWriter +#if !defined(QT_NO_XMLSTREAMWRITER) && (defined(QT_NO_XMLSTREAM)) +#define QT_NO_XMLSTREAMWRITER +#endif + +// Bearer Management +#if !defined(QT_NO_BEARERMANAGEMENT) && (defined(QT_NO_LIBRARY)) +#define QT_NO_BEARERMANAGEMENT +#endif + +// Context menu +#if !defined(QT_NO_CONTEXTMENU) && (defined(QT_NO_MENU)) +#define QT_NO_CONTEXTMENU +#endif + +// QtDBus module +#if !defined(QT_NO_DBUS) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_DOM)) +#define QT_NO_DBUS +#endif + +// File Transfer Protocol +#if !defined(QT_NO_FTP) && (defined(QT_NO_URLINFO) || defined(QT_NO_TEXTDATE)) +#define QT_NO_FTP +#endif + +// QInputContext +#if !defined(QT_NO_IM) && (defined(QT_NO_LIBRARY)) +#define QT_NO_IM +#endif + +// Phonon::PlatformPlugin +#if !defined(QT_NO_PHONON_PLATFORMPLUGIN) && (defined(QT_NO_LIBRARY)) +#define QT_NO_PHONON_PLATFORMPLUGIN +#endif + +// QScrollArea +#if !defined(QT_NO_SCROLLAREA) && (defined(QT_NO_SCROLLBAR)) +#define QT_NO_SCROLLAREA +#endif + +// QWindowsVistaStyle +#if !defined(QT_NO_STYLE_WINDOWSVISTA) && (defined(QT_NO_STYLE_WINDOWSXP)) +#define QT_NO_STYLE_WINDOWSVISTA +#endif + +// QTabBar +#if !defined(QT_NO_TABBAR) && (defined(QT_NO_TOOLBUTTON)) +#define QT_NO_TABBAR +#endif + +// OdfWriter +#if !defined(QT_NO_TEXTODFWRITER) && (defined(QT_NO_XMLSTREAMWRITER)) +#define QT_NO_TEXTODFWRITER +#endif + +// Translation (UTF-8 representation) +#if !defined(QT_NO_TRANSLATION_UTF8) && (defined(QT_NO_TRANSLATION) || defined(QT_NO_TEXTCODEC)) +#define QT_NO_TRANSLATION_UTF8 +#endif + +// QUndoGroup +#if !defined(QT_NO_UNDOGROUP) && (defined(QT_NO_UNDOSTACK)) +#define QT_NO_UNDOGROUP +#endif + +// QWhatsThis +#if !defined(QT_NO_WHATSTHIS) && (defined(QT_NO_TOOLBUTTON)) +#define QT_NO_WHATSTHIS +#endif + +// Drag and drop +#if !defined(QT_NO_DRAGANDDROP) && (defined(QT_NO_QWS_PROPERTIES) || defined(QT_NO_IMAGEFORMAT_XPM)) +#define QT_NO_DRAGANDDROP +#endif + +// QGraphicsView +#if !defined(QT_NO_GRAPHICSVIEW) && (defined(QT_NO_SCROLLAREA)) +#define QT_NO_GRAPHICSVIEW +#endif + +// Hyper Text Transfer Protocol +#if !defined(QT_NO_HTTP) && defined(QT_NO_HOSTINFO) +#define QT_NO_HTTP +#endif + +// QMdiArea +#if !defined(QT_NO_MDIAREA) && (defined(QT_NO_SCROLLAREA)) +#define QT_NO_MDIAREA +#endif + +// Phonon::VolumeSlider +#if !defined(QT_NO_PHONON_VOLUMESLIDER) && (defined(QT_NO_SLIDER) || defined(QT_NO_TOOLBUTTON)) +#define QT_NO_PHONON_VOLUMESLIDER +#endif + +// QPrinter +#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_PICTURE) || defined(QT_NO_TEMPORARYFILE)) +#define QT_NO_PRINTER +#endif + +// QWSInputMethod +#if !defined(QT_NO_QWS_INPUTMETHODS) && (defined(QT_NO_IM)) +#define QT_NO_QWS_INPUTMETHODS +#endif + +// QSpinBox +#if !defined(QT_NO_SPINBOX) && (defined(QT_NO_SPINWIDGET) || defined(QT_NO_LINEEDIT) || defined(QT_NO_VALIDATOR)) +#define QT_NO_SPINBOX +#endif + +// QCleanLooksStyle +#if !defined(QT_NO_STYLE_CLEANLOOKS) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGEFORMAT_XPM)) +#define QT_NO_STYLE_CLEANLOOKS +#endif + +// QPlastiqueStyle +#if !defined(QT_NO_STYLE_PLASTIQUE) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGEFORMAT_XPM)) +#define QT_NO_STYLE_PLASTIQUE +#endif + +// QStyleSheetStyle +#if !defined(QT_NO_STYLE_STYLESHEET) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_PROPERTIES) || defined(QT_NO_CSSPARSER)) +#define QT_NO_STYLE_STYLESHEET +#endif + +// QWindowsCEStyle +#if !defined(QT_NO_STYLE_WINDOWSCE) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGEFORMAT_XPM)) +#define QT_NO_STYLE_WINDOWSCE +#endif + +// QWindowsMobileStyle +#if !defined(QT_NO_STYLE_WINDOWSMOBILE) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGEFORMAT_XPM)) +#define QT_NO_STYLE_WINDOWSMOBILE +#endif + +// QtSvg module +#if !defined(QT_NO_SVG) && (defined(QT_NO_XMLSTREAMREADER) || defined(QT_NO_CSSPARSER)) +#define QT_NO_SVG +#endif + +// Q3TabDialog +#if !defined(QT_NO_TABDIALOG) && (defined(QT_NO_TABBAR)) +#define QT_NO_TABDIALOG +#endif + +// QTextCodecPlugin +#if !defined(QT_NO_TEXTCODECPLUGIN) && (defined(QT_NO_TEXTCODEC) || defined(QT_NO_LIBRARY)) +#define QT_NO_TEXTCODECPLUGIN +#endif + +// QColorDialog +#if !defined(QT_NO_COLORDIALOG) && (defined(QT_NO_SPINBOX)) +#define QT_NO_COLORDIALOG +#endif + +// QGraphicsEffect +#if !defined(QT_NO_GRAPHICSEFFECT) && (defined(QT_NO_GRAPHICSVIEW)) +#define QT_NO_GRAPHICSEFFECT +#endif + +// The Model/View Framework +#if !defined(QT_NO_ITEMVIEWS) && (defined(QT_NO_RUBBERBAND) || defined(QT_NO_SCROLLAREA)) +#define QT_NO_ITEMVIEWS +#endif + +// QMenuBar +#if !defined(QT_NO_MENUBAR) && (defined(QT_NO_MENU) || defined(QT_NO_TOOLBUTTON)) +#define QT_NO_MENUBAR +#endif + +// Sound Server +#if !defined(QT_NO_QWS_SOUNDSERVER) && (defined(QT_NO_SOUND) || defined(QT_NO_HOSTINFO) || defined(QT_NO_QWS_MULTIPROCESS)) +#define QT_NO_QWS_SOUNDSERVER +#endif + +// QSvgGenerator +#if !defined(QT_NO_SVGGENERATOR) && (defined(QT_NO_SVG)) +#define QT_NO_SVGGENERATOR +#endif + +// QSvgRenderer +#if !defined(QT_NO_SVGRENDERER) && (defined(QT_NO_SVG)) +#define QT_NO_SVGRENDERER +#endif + +// QTabWidget +#if !defined(QT_NO_TABWIDGET) && (defined(QT_NO_TABBAR) || defined(QT_NO_STACKEDWIDGET)) +#define QT_NO_TABWIDGET +#endif + +// QTextEdit +#if !defined(QT_NO_TEXTEDIT) && (defined(QT_NO_SCROLLAREA) || defined(QT_NO_PROPERTIES)) +#define QT_NO_TEXTEDIT +#endif + +// QErrorMessage +#if !defined(QT_NO_ERRORMESSAGE) && (defined(QT_NO_TEXTEDIT)) +#define QT_NO_ERRORMESSAGE +#endif + +// QListView +#if !defined(QT_NO_LISTVIEW) && (defined(QT_NO_ITEMVIEWS)) +#define QT_NO_LISTVIEW +#endif + +// QMainWindow +#if !defined(QT_NO_MAINWINDOW) && (defined(QT_NO_MENU) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_TOOLBUTTON)) +#define QT_NO_MAINWINDOW +#endif + +// QAbstractProxyModel +#if !defined(QT_NO_PROXYMODEL) && (defined(QT_NO_ITEMVIEWS)) +#define QT_NO_PROXYMODEL +#endif + +// QStandardItemModel +#if !defined(QT_NO_STANDARDITEMMODEL) && (defined(QT_NO_ITEMVIEWS)) +#define QT_NO_STANDARDITEMMODEL +#endif + +// QStringListModel +#if !defined(QT_NO_STRINGLISTMODEL) && (defined(QT_NO_ITEMVIEWS)) +#define QT_NO_STRINGLISTMODEL +#endif + +// QSvgWidget +#if !defined(QT_NO_SVGWIDGET) && (defined(QT_NO_SVGRENDERER)) +#define QT_NO_SVGWIDGET +#endif + +// QSyntaxHighlighter +#if !defined(QT_NO_SYNTAXHIGHLIGHTER) && (defined(QT_NO_TEXTEDIT)) +#define QT_NO_SYNTAXHIGHLIGHTER +#endif + +// QTableView +#if !defined(QT_NO_TABLEVIEW) && (defined(QT_NO_ITEMVIEWS)) +#define QT_NO_TABLEVIEW +#endif + +// QTextBrowser +#if !defined(QT_NO_TEXTBROWSER) && (defined(QT_NO_TEXTEDIT)) +#define QT_NO_TEXTBROWSER +#endif + +// QToolBox +#if !defined(QT_NO_TOOLBOX) && (defined(QT_NO_TOOLBUTTON) || defined(QT_NO_SCROLLAREA)) +#define QT_NO_TOOLBOX +#endif + +// QTreeView +#if !defined(QT_NO_TREEVIEW) && (defined(QT_NO_ITEMVIEWS)) +#define QT_NO_TREEVIEW +#endif + +// Accessibility +#if !defined(QT_NO_ACCESSIBILITY) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_MENUBAR)) +#define QT_NO_ACCESSIBILITY +#endif + +// QColumnView +#if !defined(QT_NO_COLUMNVIEW) && (defined(QT_NO_LISTVIEW)) +#define QT_NO_COLUMNVIEW +#endif + +// QCompleter +#if !defined(QT_NO_COMPLETER) && (defined(QT_NO_PROXYMODEL)) +#define QT_NO_COMPLETER +#endif + +// Common UNIX Printing System +#if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) +#define QT_NO_CUPS +#endif + +// QDataWidgetMapper +#if !defined(QT_NO_DATAWIDGETMAPPER) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_PROPERTIES)) +#define QT_NO_DATAWIDGETMAPPER +#endif + +// QListWidget +#if !defined(QT_NO_LISTWIDGET) && (defined(QT_NO_LISTVIEW)) +#define QT_NO_LISTWIDGET +#endif + +// QSortFilterProxyModel +#if !defined(QT_NO_SORTFILTERPROXYMODEL) && (defined(QT_NO_PROXYMODEL)) +#define QT_NO_SORTFILTERPROXYMODEL +#endif + +// QTableWidget +#if !defined(QT_NO_TABLEWIDGET) && (defined(QT_NO_TABLEVIEW)) +#define QT_NO_TABLEWIDGET +#endif + +// QToolBar +#if !defined(QT_NO_TOOLBAR) && (defined(QT_NO_MAINWINDOW)) +#define QT_NO_TOOLBAR +#endif + +// QTreeWidget +#if !defined(QT_NO_TREEWIDGET) && (defined(QT_NO_TREEVIEW)) +#define QT_NO_TREEWIDGET +#endif + +// QDirModel +#if !defined(QT_NO_DIRMODEL) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_FILESYSTEMMODEL)) +#define QT_NO_DIRMODEL +#endif + +// QDockwidget +#if !defined(QT_NO_DOCKWIDGET) && (defined(QT_NO_RUBBERBAND) || defined(QT_NO_MAINWINDOW)) +#define QT_NO_DOCKWIDGET +#endif + +// QUndoView +#if !defined(QT_NO_UNDOVIEW) && (defined(QT_NO_UNDOSTACK) || defined(QT_NO_LISTVIEW)) +#define QT_NO_UNDOVIEW +#endif + +// QCompleter +#if !defined(QT_NO_FSCOMPLETER) && (defined(QT_NO_FILESYSTEMMODEL) || defined(QT_NO_COMPLETER)) +#define QT_NO_FSCOMPLETER +#endif + +// QGraphicsSvgItem +#if !defined(QT_NO_GRAPHICSSVGITEM) && (defined(QT_NO_SVGRENDERER) || defined(QT_NO_GRAPHICSVIEW)) +#define QT_NO_GRAPHICSSVGITEM +#endif + +// QComboBox +#if !defined(QT_NO_COMBOBOX) && (defined(QT_NO_LINEEDIT) || defined(QT_NO_STANDARDITEMMODEL) || defined(QT_NO_LISTVIEW)) +#define QT_NO_COMBOBOX +#endif + +// QWorkSpace +#if !defined(QT_NO_WORKSPACE) && (defined(QT_NO_SCROLLBAR) || defined(QT_NO_MAINWINDOW) || defined(QT_NO_MENUBAR)) +#define QT_NO_WORKSPACE +#endif + +// QPrintPreviewWidget +#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_MAINWINDOW)) +#define QT_NO_PRINTPREVIEWWIDGET +#endif + +// QCalendarWidget +#if !defined(QT_NO_CALENDARWIDGET) && (defined(QT_NO_TABLEVIEW) || defined(QT_NO_MENU) || defined(QT_NO_TEXTDATE) || defined(QT_NO_SPINBOX) || defined(QT_NO_TOOLBUTTON)) +#define QT_NO_CALENDARWIDGET +#endif + +// QDateTimeEdit +#if !defined(QT_NO_DATETIMEEDIT) && (defined(QT_NO_CALENDARWIDGET) || defined(QT_NO_DATESTRING)) +#define QT_NO_DATETIMEEDIT +#endif + +// QInputDialog +#if !defined(QT_NO_INPUTDIALOG) && (defined(QT_NO_COMBOBOX) || defined(QT_NO_SPINBOX) || defined(QT_NO_STACKEDWIDGET)) +#define QT_NO_INPUTDIALOG +#endif + +// Phonon::EffectWidget +#if !defined(QT_NO_PHONON_EFFECTWIDGET) && (defined(QT_NO_PHONON_EFFECT) || defined(QT_NO_COMBOBOX) || defined(QT_NO_SPINBOX)) +#define QT_NO_PHONON_EFFECTWIDGET +#endif + +// QFontComboBox +#if !defined(QT_NO_FONTCOMBOBOX) && (defined(QT_NO_COMBOBOX) || defined(QT_NO_STRINGLISTMODEL)) +#define QT_NO_FONTCOMBOBOX +#endif + +// QFontDialog +#if !defined(QT_NO_FONTDIALOG) && (defined(QT_NO_STRINGLISTMODEL) || defined(QT_NO_COMBOBOX) || defined(QT_NO_VALIDATOR) || defined(QT_NO_GROUPBOX)) +#define QT_NO_FONTDIALOG +#endif + +// QPrintDialog +#if !defined(QT_NO_PRINTDIALOG) && (defined(QT_NO_PRINTER) || defined(QT_NO_COMBOBOX) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_SPINBOX) || defined(QT_NO_TREEVIEW) || defined(QT_NO_TABWIDGET)) +#define QT_NO_PRINTDIALOG +#endif + +// QFileDialog +#if !defined(QT_NO_FILEDIALOG) && (defined(QT_NO_DIRMODEL) || defined(QT_NO_TREEVIEW) || defined(QT_NO_COMBOBOX) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_TOOLTIP) || defined(QT_NO_SPLITTER) || defined(QT_NO_STACKEDWIDGET) || defined(QT_NO_PROXYMODEL)) +#define QT_NO_FILEDIALOG +#endif + +// QPrintPreviewDialog +#if !defined(QT_NO_PRINTPREVIEWDIALOG) && (defined(QT_NO_PRINTPREVIEWWIDGET) || defined(QT_NO_PRINTDIALOG) || defined(QT_NO_TOOLBAR)) +#define QT_NO_PRINTPREVIEWDIALOG +#endif + diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt new file mode 100644 index 0000000000..6b861d4d17 --- /dev/null +++ b/src/corelib/global/qfeatures.txt @@ -0,0 +1,1487 @@ +# Kernel + +Feature: PROPERTIES +Description: Supports scripting Qt-based applications. +Section: Kernel +Requires: +Name: Properties +SeeAlso: ??? + +Feature: TEXTHTMLPARSER +Description: Parser for HTML +Section: Kernel +Requires: +Name: HtmlParser +SeeAlso: ??? + +Feature: TEXTODFWRITER +Description: Provides an ODF writer +Section: Kernel +Requires: XMLSTREAMWRITER +Name: OdfWriter +SeeAlso: ??? + +Feature: CSSPARSER +Description: Parser for Style Sheets +Section: Kernel +Requires: +Name: CssParser +SeeAlso: ??? + +Feature: CONCURRENT +Description: Provides a high-level multi-threaded APIs +Section: Kernel +Requires: +Name: QtConcurrent +SeeAlso: ??? + +Feature: DRAGANDDROP +Description: Supports the drag and drop mechansim. +Section: Kernel +Requires: QWS_PROPERTIES IMAGEFORMAT_XPM +Name: Drag and drop +SeeAlso: ??? + +Feature: SESSIONMANAGER +Description: Supports session management. +Section: Kernel +Requires: +Name: Session Manager +SeeAlso: ??? + +Feature: SHORTCUT +Description: Supports keyboard accelerators and shortcuts. +Section: Kernel +Requires: +Name: QShortcut +SeeAlso: ??? + +Feature: ACTION +Description: Supports widget actions. +Section: Kernel +Requires: +Name: QAction +SeeAlso: ??? + +Feature: SOFTKEYMANAGER +Description: Supports softkeys. +Section: Gui +Requires: ACTION +Name: QSoftKeyManager +SeeAlso: ??? + +Feature: CURSOR +Description: Supports mouse cursors. +Section: Kernel +Requires: +Name: QCursor +SeeAlso: ??? + +Feature: CLIPBOARD +Description: Supports cut and paste operations. +Section: Kernel +Requires: QWS_PROPERTIES +Name: QClipboard +SeeAlso: ??? + +Feature: WHEELEVENT +Description: Supports wheel events. +Section: Kernel +Requires: +Name: QWheelEvent +SeeAlso: ??? + +Feature: TABLETEVENT +Description: Supports tablet events. +Section: Kernel +Requires: +Name: QTabletEvent +SeeAlso: ??? + +Feature: SOUND +Description: Supports playing audio files. +Section: Kernel +Requires: +Name: Sounds +SeeAlso: ??? + +Feature: EFFECTS +Description: Supports special widget effects (e.g. fading and scrolling). +Section: Kernel +Requires: +Name: Effects +SeeAlso: ??? + +Feature: SHAREDMEMORY +Description: Provides access to a shared memory segment. +Section: Kernel +Requires: +Name: QSharedMemory +SeeAlso: ??? + +Feature: SYSTEMSEMAPHORE +Description: Provides a general counting system semaphore. +Section: Kernel +Requires: +Name: QSystemSemaphore +SeeAlso: ??? + +Feature: XMLSTREAM +Description: Provides a simple streaming API for XML. +Section: Kernel +Requires: +Name: +SeeAlso: ??? + +Feature: XMLSTREAMREADER +Description: Provides a well-formed XML parser with a simple streaming API. +Section: Kernel +Requires: XMLSTREAM +Name: QXmlStreamReader +SeeAlso: ??? + +Feature: XMLSTREAMWRITER +Description: Provides a XML writer with a simple streaming API. +Section: Kernel +Requires: XMLSTREAM +Name: QXmlStreamWriter +SeeAlso: ??? + +Feature: IM +Description: Inputmethods with QInputContext +Section: Kernel +Requires: LIBRARY +Name: QInputContext +SeeAlso: ??? +# Data structures + +Feature: STL +Description: Supports standard template library compatiblity. +Section: Data structures +Requires: +Name: Standard Template Library +SeeAlso: ??? + +Feature: QUUID_STRING +Description: Supports convertion between UUID and strings. +Section: Data structures +Requires: +Name: Universally Unique Identifier Convertion +SeeAlso: ??? + +Feature: TEXTDATE +Description: Supports month and day names in dates. +Section: Data structures +Requires: +Name: Text Date +SeeAlso: ??? + +Feature: DATESTRING +Description: Supports convertion between dates and strings. +Section: Data structures +Requires: TEXTDATE +Name: QDate/QTime/QDateTime +SeeAlso: ??? + +# File I/O + +Feature: PROCESS +Description: Supports external process invocation. +Section: File I/O +Requires: +Name: QProcess +SeeAlso: ??? + +Feature: TEXTSTREAM +Description: Supports reading and writing of text. +Section: File I/O +Requires: +Name: QTextStream +SeeAlso: ??? + +Feature: TEMPORARYFILE +Description: Provides an I/O device that operates on temporary files. +Section: File I/O +Requires: +Name: QTemporaryFile +SeeAlso: ??? + +Feature: LIBRARY +Description: Supports a shared library wrapper. +Section: File I/O +Requires: SETTINGS +Name: QLibrary +SeeAlso: ??? + +Feature: SETTINGS +Description: Supports persistent application settings. +Section: File I/O +Requires: +Name: QSettings +SeeAlso: ??? + +Feature: DOM +Description: Supports the Document Object Model. +Section: File I/O +Requires: +Name: Document Object Model +SeeAlso: ??? + +Feature: FILESYSTEMMODEL +Description: Provides a data model for the local filesystem. +Section: File I/O +Requires: FILESYSTEMWATCHER +Name: QFileSystemModel +SeeAlso: ??? + +Feature: FILESYSTEMWATCHER +Description: Provides an interface for monitoring files and directories +for modications. +Section: File I/O +Requires: +Name: QFileSystemWatcher +SeeAlso: ??? + +Feature: FILESYSTEMITERATOR +Description: Provides fast file-system iteration. +for modications. +Section: File I/O +Requires: +Name: QFileSystemIterator +SeeAlso: ??? + +# Widgets + +Feature: TREEWIDGET +Description: Supports views using tree models. +Section: Widgets +Requires: TREEVIEW +Name: QTreeWidget +SeeAlso: ??? + +Feature: LISTWIDGET +Description: Supports item-based list widgets. +Section: Widgets +Requires: LISTVIEW +Name: QListWidget +SeeAlso: ??? + +Feature: TABLEWIDGET +Description: Supports item-based table views. +Section: Widgets +Requires: TABLEVIEW +Name: QTableWidget +SeeAlso: ??? + +Feature: DATETIMEEDIT +Description: Supports editing dates and times. +Section: Widgets +Requires: CALENDARWIDGET DATESTRING +Name: QDateTimeEdit +SeeAlso: ??? + +Feature: STACKEDWIDGET +Description: Supports stacked widgets. +Section: Widgets +Requires: +Name: QStackedWidget +SeeAlso: ??? + +Feature: TEXTBROWSER +Description: Supports HTML document browsing. +Section: Widgets +Requires: TEXTEDIT +Name: QTextBrowser +SeeAlso: ??? + +Feature: SPLASHSCREEN +Description: Supports splash screens that can be shown during application startup. +Section: Widgets +Requires: +Name: Splash screen widget +SeeAlso: ??? + +Feature: SPLITTER +Description: Supports user controlled splitter widgets. +Section: Widgets +Requires: RUBBERBAND +Name: QSplitter +SeeAlso: ??? + +Feature: LCDNUMBER +Description: Supports LCD-like digits. +Section: Widgets +Requires: +Name: QLCDNumber +SeeAlso: ??? + +Feature: MENU +Description: Supports popup-menus. +Section: Widgets +Requires: ACTION +Name: QMenu +SeeAlso: ??? + +Feature: LINEEDIT +Description: Supports single-line edits. +Section: Widgets +Requires: +Name: QLineEdit +SeeAlso: ??? + +Feature: SPINBOX +Description: Supports spin boxes handling integers and discrete sets of values. +Section: Widgets +Requires: SPINWIDGET LINEEDIT VALIDATOR +Name: QSpinBox +SeeAlso: ??? + +Feature: TABBAR +Description: Supports tab bars, e.g. for use in tabbed dialogs. +Section: Widgets +Requires: TOOLBUTTON +Name: QTabBar +SeeAlso: ??? + +Feature: TABWIDGET +Description: Supports stacking tabbed widgets. +Section: Widgets +Requires: TABBAR STACKEDWIDGET +Name: QTabWidget +SeeAlso: ??? + +Feature: COMBOBOX +Description: Supports comboboxes presenting a list of options to the user. +Section: Widgets +Requires: LINEEDIT STANDARDITEMMODEL LISTVIEW +Name: QComboBox +SeeAlso: ??? + +Feature: FONTCOMBOBOX +Description: Supports a combobox that lets the user select a font family. +Section: Widgets +Requires: COMBOBOX STRINGLISTMODEL +Name: QFontComboBox +SeeAlso: ??? + +Feature: TOOLBUTTON +Description: Supports quick-access buttons to commands and options. +Section: Widgets +Requires: ACTION +Name: QToolButton +SeeAlso: ??? + +Feature: TOOLBAR +Description: Supports movable panels containing a set of controls. +Section: Widgets +Requires: MAINWINDOW +Name: QToolBar +SeeAlso: ??? + +Feature: TOOLBOX +Description: Supports columns of tabbed widget items. +Section: Widgets +Requires: TOOLBUTTON SCROLLAREA +Name: QToolBox +SeeAlso: ??? + +Feature: GROUPBOX +Description: Supports group box frames. +Section: Widgets +Requires: +Name: QGroupBox +SeeAlso: ??? + +Feature: BUTTONGROUP +Description: Supports organizing groups of button widgets. +Section: Widgets +Requires: GROUPBOX +Name: QButtonGroup +SeeAlso: ??? + +Feature: MAINWINDOW +Description: Supports main application windows. +Section: Widgets +Requires: MENU RESIZEHANDLER TOOLBUTTON +Name: QMainWindow +SeeAlso: ??? + +Feature: DOCKWIDGET +Description: Supports docking widgets inside a QMainWindow or floated as +a top-level window on the desktop. +Section: Widgets +Requires: RUBBERBAND MAINWINDOW +Name: QDockwidget +SeeAlso: ??? + +Feature: WORKSPACE +Description: Supports workspace windows, e.g. used in an MDI application. +Section: Widgets +Requires: SCROLLBAR MAINWINDOW MENUBAR +Name: QWorkSpace +SeeAlso: ??? + +Feature: MDIAREA +Description: Provides an area in which MDI windows are displayed. +Section: Widgets +Requires: SCROLLAREA +Name: QMdiArea +SeeAlso: ??? + +Feature: RESIZEHANDLER +Description: Supports an internal resize handler. +Section: Widgets +Requires: +Name: Resize Handler +SeeAlso: ??? + +Feature: STATUSBAR +Description: Supports presentation of status information. +Section: Widgets +Requires: +Name: QStatusBar +SeeAlso: ??? + +Feature: MENUBAR +Description: Supports pull-down menu items. +Section: Widgets +Requires: MENU TOOLBUTTON +Name: QMenuBar +SeeAlso: ??? + +Feature: CONTEXTMENU +Description: Supports pop-up menus on right mouse click +Section: Widgets +Requires: MENU +Name: Context menu +SeeeAlso: ??? + +Feature: PROGRESSBAR +Description: Supports presentation of operation progress. +Section: Widgets +Requires: +Name: QProgressBar +SeeAlso: ??? + +Feature: SLIDER +Description: Supports sliders controlling a bounded value. +Section: Widgets +Requires: +Name: QSlider +SeeAlso: ??? + +Feature: SCROLLBAR +Description: Supports scrollbars allowing the user access parts of a +document that is larger than the widget used to display it. +Section: Widgets +Requires: SLIDER +Name: QScrollBar +SeeAlso: ??? + +Feature: DIAL +Description: Supports rounded range control, e.g. like a speedometer. +Section: Widgets +Requires: SLIDER +Name: QDial +SeeAlso: ??? + +Feature: SCROLLAREA +Description: Supports scrolling views onto widgets. +Section: Widgets +Requires: SCROLLBAR +Name: QScrollArea +SeeAlso: ??? + +Feature: GRAPHICSVIEW +Description: Supports the graphicsview classes. +Section: Widgets +Requires: SCROLLAREA +Name: QGraphicsView +SeeAlso: ??? + +Feature: GRAPHICSEFFECT +Description: Supports the graphicseffect classes. +Section: Widgets +Requires: GRAPHICSVIEW +Name: QGraphicsEffect +SeeAlso: ??? + +Feature: SPINWIDGET +Description: Supports spinbox control widgets. +Section: Widgets +Requires: +Name: Spin Widget +SeeAlso: ??? + +Feature: TEXTEDIT +Description: Supports rich text editing. +Section: Widgets +Requires: SCROLLAREA PROPERTIES +Name: QTextEdit +SeeAlso: ??? + +Feature: SYNTAXHIGHLIGHTER +Description: Supports custom syntax highlighting. +Section: Widgets +Requires: TEXTEDIT +Name: QSyntaxHighlighter +SeeAlso: ??? + +Feature: RUBBERBAND +Description: Supports using rubberbands to indicate selections and boundaries. +Section: Widgets +Requires: +Name: QRubberBand +SeeAlso: ??? + +Feature: TOOLTIP +Description: Supports presentation of tooltips. +Section: Widgets +Requires: +Name: QToolTip +SeeAlso: ??? + +Feature: STATUSTIP +Description: Supports status tip functionality and events. +Section: Widgets +Requires: +Name: Status Tip +SeeAlso: ??? + +Feature: SIGNALMAPPER +Description: Supports bundling of signals from identifiable senders. +Section: Widgets +Requires: +Name: QSignalMapper +SeeAlso: ??? + +Feature: WHATSTHIS +Description: Supports displaying "What's this" help. +Section: Widgets +Requires: TOOLBUTTON +Name: QWhatsThis +SeeAlso: ??? + +Feature: VALIDATOR +Description: Supports validation of input text. +Section: Widgets +Requires: +Name: QValidator +SeeAlso: ??? + +Feature: SIZEGRIP +Description: Supports corner-grips for resizing a top-level windows. +Section: Widgets +Requires: +Name: QSizeGrip +SeeAlso: ??? + +Feature: CALENDARWIDGET +Description: Provides a monthly based calendar widget allowing the user to select +a date. +Section: Widgets +Requires: TABLEVIEW MENU TEXTDATE SPINBOX TOOLBUTTON +Name: QCalendarWidget +SeeAlso: ??? + +Feature: PRINTPREVIEWWIDGET +Description: Provides a widget for previewing page layouts for printer output. +a date. +Section: Widgets +Requires: GRAPHICSVIEW PRINTER MAINWINDOW +Name: QPrintPreviewWidget +SeeAlso: ??? + +# Dialogs + +Feature: MESSAGEBOX +Description: Supports message boxes displaying +informative messages and simple questions. +Section: Dialogs +Requires: +Name: QMessageBox +SeeAlso: ??? + +Feature: COLORDIALOG +Description: Supports a dialog widget for specifying colors. +Section: Dialogs +Requires: SPINBOX +Name: QColorDialog +SeeAlso: ??? + +Feature: FILEDIALOG +Description: Supports a dialog widget for selecting files or directories. +Section: Dialogs +Requires: DIRMODEL TREEVIEW COMBOBOX TOOLBUTTON BUTTONGROUP TOOLTIP SPLITTER STACKEDWIDGET PROXYMODEL +Name: QFileDialog +SeeAlso: ??? + +Feature: FONTDIALOG +Description: Supports a dialog widget for selecting fonts. +Section: Dialogs +Requires: STRINGLISTMODEL COMBOBOX VALIDATOR GROUPBOX +Name: QFontDialog +SeeAlso: ??? + +Feature: PRINTDIALOG +Description: Supports a dialog widget for specifying printer configuration. +Section: Dialogs +Requires: PRINTER COMBOBOX BUTTONGROUP SPINBOX TREEVIEW TABWIDGET +Name: QPrintDialog +SeeAlso: ??? + +Feature: PRINTPREVIEWDIALOG +Description: Provides a dialog for previewing and configuring page layouts for printer output. +Section: Dialogs +Requires: PRINTPREVIEWWIDGET PRINTDIALOG TOOLBAR +Name: QPrintPreviewDialog +SeeAlso: ??? + +Feature: PROGRESSDIALOG +Description: Supports feedback on the progress of a slow operation. +Section: Dialogs +Requires: PROGRESSBAR +Name: QProgressDialog +SeeAlso: ??? + +Feature: INPUTDIALOG +Description: Supports a simple convenience dialog to get a single value from the user. +Section: Dialogs +Requires: COMBOBOX SPINBOX STACKEDWIDGET +Name: QInputDialog +SeeAlso: ??? + +Feature: TABDIALOG +Description: Supports a stack of tabbed widgets. +Section: Dialogs +Requires: TABBAR +Name: Q3TabDialog +SeeAlso: ??? + +Feature: ERRORMESSAGE +Description: Supports an error message display dialog. +Section: Dialogs +Requires: TEXTEDIT +Name: QErrorMessage +SeeAlso: ??? + +Feature: WIZARD +Description: Provides a framework for wizards. +Section: Dialogs +Requires: PROPERTIES +Name: QWizard +SeeAlso: ??? + +# ItemViews + +Feature: ITEMVIEWS +Description: Supports the model/view architecture managing the relationship +between data and the way it is presented to the user. +Section: ItemViews +Requires: RUBBERBAND SCROLLAREA +Name: The Model/View Framework +SeeAlso: ??? + +Feature: DIRMODEL +Description: Supports a data model for the local filesystem. +Section: ItemViews +Requires: ITEMVIEWS FILESYSTEMMODEL +Name: QDirModel +SeeAlso: ??? + +Feature: STANDARDITEMMODEL +Description: Supports a generic model for storing custom data. +Section: ItemViews +Requires: ITEMVIEWS +Name: QStandardItemModel +SeeAlso: ??? + +Feature: PROXYMODEL +Description: Supports processing of data passed between another model and a view. +Section: ItemViews +Requires: ITEMVIEWS +Name: QAbstractProxyModel +SeeAlso: ??? + +Feature: SORTFILTERPROXYMODEL +Description: Supports sorting and filtering of data passed between +another model and a view. +Section: ItemViews +Requires: PROXYMODEL +Name: QSortFilterProxyModel +SeeAlso: ??? + +Feature: STRINGLISTMODEL +Description: Supports a model that supplies strings to views. +Section: ItemViews +Requires: ITEMVIEWS +Name: QStringListModel +SeeAlso: ??? + +Feature: LISTVIEW +Description: Supports a list or icon view onto a model. +Section: ItemViews +Requires: ITEMVIEWS +Name: QListView +SeeAlso: ??? + +Feature: TABLEVIEW +Description: Supports a default model/view implementation of a table view. +Section: ItemViews +Requires: ITEMVIEWS +Name: QTableView +SeeAlso: ??? + +Feature: TREEVIEW +Description: Supports a default model/view implementation of a tree view. +Section: ItemViews +Requires: ITEMVIEWS +Name: QTreeView +SeeAlso: ??? + +Feature: DATAWIDGETMAPPER +Description: Provides mapping between a section of a data model to widgets. +Section: ItemViews +Requires: ITEMVIEWS PROPERTIES +Name: QDataWidgetMapper +SeeAlso: ??? + +Feature: COLUMNVIEW +Description: Provides a model/view implementation of a column view. +Section: ItemViews +Requires: LISTVIEW +Name: QColumnView +SeeAlso: ??? + +# Styles + +Feature: STYLE_WINDOWS +Description: Supports a Microsoft Windows-like look and feel. +Section: Styles +Requires: +Name: QWindowsStyle +SeeAlso: ??? + +Feature: STYLE_MOTIF +Description: Supports a Motif look and feel. +Section: Styles +Requires: +Name: QMotifStyle +SeeAlso: ??? + +Feature: STYLE_CDE +Description: Supports a CDE look and feel. +Section: Styles +Requires: STYLE_MOTIF +Name: QCDEStyle +SeeAlso: ??? + +Feature: STYLE_PLASTIQUE +Description: Supports a widget style similar to the Plastik style available in KDE. +Section: Styles +Requires: STYLE_WINDOWS IMAGEFORMAT_XPM +Name: QPlastiqueStyle +SeeAlso: ??? + +Feature: STYLE_WINDOWSXP +Description: Supports a Microsoft WindowsXP-like look and feel. +Section: Styles +Requires: STYLE_WINDOWS +Name: QWindowsXPStyle +SeeAlso: ??? + +Feature: STYLE_WINDOWSVISTA +Description: Supports a Microsoft WindowsVista-like look and feel. +Section: Styles +Requires: STYLE_WINDOWSXP +Name: QWindowsVistaStyle +SeeAlso: ??? + +Feature: STYLE_CLEANLOOKS +Description: Supports a Gnome CleanLooks-like look and feel. +Section: Styles +Requires: STYLE_WINDOWS IMAGEFORMAT_XPM +Name: QCleanLooksStyle +SeeAlso: ??? + +Feature: STYLE_WINDOWSCE +Description: WindowsCE look and feel +Section: Styles +Requires: STYLE_WINDOWS IMAGEFORMAT_XPM +Name: QWindowsCEStyle +SeeAlso: ??? + +Feature: STYLE_WINDOWSMOBILE +Description: WindowsMobile look and feel +Section: Styles +Requires: STYLE_WINDOWS IMAGEFORMAT_XPM +Name: QWindowsMobileStyle +SeeAlso: ??? + +Feature: STYLE_STYLESHEET +Description: +Section: Styles +Requires: STYLE_WINDOWS PROPERTIES CSSPARSER +Name: QStyleSheetStyle +SeeAlso: ??? + +# Images + +Feature: IMAGEFORMATPLUGIN +Description: Supports writing an image format plugin. +Section: Images +Requires: +Name: QImageIOPlugin +SeeAlso: ??? + +Feature: MOVIE +Description: Supports animated images. +Section: Images +Requires: +Name: QMovie +SeeAlso: ??? + +Feature: IMAGEFORMAT_BMP +Description: Supports Microsoft's Bitmap image file format. +Section: Images +Requires: +Name: BMP Image Format +SeeAlso: ??? + +Feature: IMAGEFORMAT_PPM +Description: Supports the Portable Pixmap image file format. +Section: Images +Requires: +Name: PPM Image Format +SeeAlso: ??? + +Feature: IMAGEFORMAT_XBM +Description: Supports the X11 Bitmap image file format. +Section: Images +Requires: +Name: XBM Image Format +SeeAlso: ??? + +Feature: IMAGEFORMAT_XPM +Description: Supports the X11 Pixmap image file format. +Section: Images +Requires: TEXTSTREAM +Name: XPM Image Format +SeeAlso: ??? + +Feature: IMAGEFORMAT_PNG +Description: Supports the Portable Network Graphics image file format. +Section: Images +Requires: +Name: PNG Image Format +SeeAlso: ??? + +Feature: IMAGEFORMAT_JPEG +Description: Supports the Joint Photographic Experts Group image file format. +Section: Images +Requires: +Name: JPEG Image Format +SeeAlso: ??? + +Feature: IMAGE_HEURISTIC_MASK +Description: Supports creating a 1-bpp heuristic mask for images. +Section: Images +Requires: +Name: QImage::createHeuristicMask() +SeeAlso: ??? + +Feature: IMAGE_TEXT +Description: Supports image file text strings. +Section: Images +Requires: +Name: Image Text +SeeAlso: ??? + +# Painting + +Feature: DIRECTPAINTER +Description: Supports direct access to the video hardware. +Section: Painting +Requires: +Name: QDirectPainter +SeeAlso: ??? + +Feature: PICTURE +Description: Supports recording and replaying QPainter commands. +Section: Painting +Requires: +Name: QPicture +SeeAlso: ??? + +Feature: COLORNAMES +Description: Supports color names such as "red", used by QColor +and by some HTML documents. +Section: Painting +Requires: +Name: Color Names +SeeAlso: ??? + +Feature: PRINTER +Description: Supports printing +Section: Painting +Requires: TEXTSTREAM PICTURE TEMPORARYFILE +Name: QPrinter +SeeAlso: ??? + +Feature: CUPS +Description Supports the Common UNIX Printing System +Section: Painting +Requires: PRINTER LIBRARY +Name: Common UNIX Printing System +SeeAlso: ??? + +Feature: PAINTONSCREEN +Description: Supports the Qt::WA_PaintOnScreen widget attribute. +Section: Painting +Requires: +Name: Qt::WA_PaintOnScreen +SeeAlso: ??? + +Feature: PAINT_DEBUG +Description: Debug painting with the environment variables QT_FLUSH_UPDATE and QT_FLUSH_PAINT +Section: Painting +Requires: +Name: Painting Debug Utilities +SeeAlso: ??? + +Feature: RASTERCALLBACKS +Description: Supports subclassing the QPaintEngineRaster with callback functions. +Section: Painting +Requires: +Name: Raster Paint Engine callback functions +SeeAlso: ??? + +# Fonts + +Feature: FREETYPE +Description: Supports the FreeType 2 font engine (and its supported font formats). +Section: Fonts +Requires: +Name: Freetype Font Engine +SeeAlso: ??? + +Feature: QWS_QPF +Description: Supports Qt's pre-rendered fonts, a light-weight non-scalable font format +specific to Qt for Embedded Linux. +Section: Fonts +Requires: +Name: Qt Prerendered Font Format +SeeAlso: ??? + +Feature: QWS_QPF2 +Description: Supports Qt's second generation of pre-rendered fonts, a light-weight +non-scalable font format specific to Qt for Embedded Linux. +Section: Fonts +Requires: +Name: Qt Prerendered Font Format 2 +SeeAlso: ??? + +# Internationalization + +Feature: TEXTCODECPLUGIN +Description: Supports custom text codecs that can be loaded dynamically into applications. +Section: Internationalization +Requires: TEXTCODEC LIBRARY +Name: QTextCodecPlugin +SeeAlso: ??? + +Feature: TRANSLATION +Description: Supports translations using QObject::tr(). +Section: Internationalization +Requires: +Name: Translation +SeeAlso: ??? + +Feature: TRANSLATION_UTF8 +Description: Supports translations using QObject::trUtf8(). +Section: Internationalization +Requires: TRANSLATION TEXTCODEC +Name: Translation (UTF-8 representation) +SeeAlso: ??? + +Feature: TEXTCODEC +Description: Supports conversions between text encodings. +Section: Internationalization +Requires: +Name: QTextCodec +SeeAlso: ??? + +Feature: CODECS +Description: Supports non-unicode text conversions. +Section: Internationalization +Requires: TEXTCODEC +Name: Codecs +SeeAlso: ??? + +Feature: BIG_CODECS +Description: Supports big codecs, e.g. CJK. +Section: Internationalization +Requires: +Name: Big Codecs +SeeAlso: ??? + +Feature: QWS_INPUTMETHODS +Description: Supports international input methods. +Section: Internationalization +Requires: IM +Name: QWSInputMethod +SeeAlso: ??? + +# Networking + +Feature: URLINFO +Description: Supports storage of URL information. +Section: Networking +Requires: +Name: QUrlInfo +SeeAlso: ??? + +Feature: HOSTINFO +Description: Supports host name lookups. +Section: Networking +Requires: TEXTSTREAM +Name: QHostInfo +SeeAlso: ??? + +Feature: FTP +Description: Supports FTP file access. +Section: Networking +Requires: URLINFO TEXTDATE +Name: File Transfer Protocol +SeeAlso: ??? + +Feature: HTTP +Description: Supports HTTP file access. +Section: Networking +Requires: HOSTINFO +Name: Hyper Text Transfer Protocol +SeeAlso: ??? + +Feature: UDPSOCKET +Description: Supports User Datagram Protocol sockets. +Section: Networking +Requires: +Name: QUdpSocket +SeeAlso: ??? + +Feature: NETWORKPROXY +Description: Supports configuring network layer proxy support to the Qt network classes. +Section: Networking +Requires: +Name: QNetworkProxy +SeeAlso: ??? + +Feature: SOCKS5 +Description: Supports SOCKS v5 network proxy. +Section: Networking +Requires: NETWORKPROXY +Name: SOCKS5 +SeeAlso: ??? + +Feature: COP +Description: Supports the QCOP protocol, which is a many-to-many +communication protocol for transferring messages on various +channels, and Inter Process Communications (IPC). +Section: Networking +Requires: +Name: QCopChannel +SeeAlso: ??? + +Feature: NETWORKINTERFACE +Description: Supports listing the host's IP addresses and network interfaces +Section: Networking +Requires: +Name: QNetworkInterface +SeeAlso: ??? + +Feature: NETWORKDISKCACHE +Description: Supports a disk cache for network resources +Section: Networking +Requires: TEMPORARYFILE +Name: QNetworkDiskCache +SeeAlso: ??? + +Feature: BEARERMANAGEMENT +Description: Provides bearer management support +Section: Networking +Requires: LIBRARY +Name: Bearer Management +SeeAlso: ??? + + +# Utilities + +Feature: COMPLETER +Description: Provides completions based on an item model. +Section: Utilities +Requires: PROXYMODEL +Name: QCompleter +SeeAlso: ??? + +Feature: FSCOMPLETER +Description: Provides completions based on an item model. +Section: Utilities +Requires: FILESYSTEMMODEL COMPLETER +Name: QCompleter +SeeAlso: ??? + +Feature: DESKTOPSERVICES +Description: Provides methods for accessing common desktop services. +Section: Utilities +Requires: +Name: QDesktopServices +SeeAlso: ??? + +Feature: SYSTEMTRAYICON +Description: Provides an icon for an application in the system tray. +Section: Utilities +Requires: +Name: QSystemTrayIcon +SeeAlso: ??? + +Feature: UNDOCOMMAND +Description: Applies (redo or) undo of a single change in a document. +Section: Utilities +Requires: +Name: QUndoCommand +SeeAlso: ??? + +Feature: UNDOSTACK +Description: Provides the ability to (redo or) undo a list of changes in a document. +Section: Utilities +Requires: UNDOCOMMAND +Name: QUndoStack +SeeAlso: ??? + +Feature: UNDOGROUP +Description: +Section: Utilities +Requires: UNDOSTACK +Name: QUndoGroup +SeeAlso: ??? + +Feature: UNDOVIEW +Description: A widget which shows the contents of an undo stack. +Section: Utilities +Requires: UNDOSTACK LISTVIEW +Name: QUndoView +SeeAlso: ??? + +Feature: ACCESSIBILITY +Description: Provides accessibility support. +Section: Utilities +Requires: PROPERTIES MENUBAR +Name: Accessibility +SeeAlso: ??? + +Feature: ANIMATION +Description: Provides a framework for animations. +Section: Utilities +Requires: PROPERTIES +Name: Animation +SeeAlso: ??? + +Feature: STATEMACHINE +Description: Provides hierarchical finite state machines. +Section: Utilities +Requires: PROPERTIES +Name: State machine +SeeAlso: ??? + +Feature: GESTURES +Description: Provides a framework for gestures. +Section: Utilities +Requires: +Name: Gesture +SeeAlso: ??? + +# SVG + +Feature: SVG +Description: Provides classes for displaying the contents of SVG files. +Section: SVG +Requires: XMLSTREAMREADER CSSPARSER +Name: QtSvg module +SeeAlso: ??? + +Feature: GRAPHICSSVGITEM +Description: Provides a QGraphicsItem that can be used to render the contents of SVG files. +Section: SVG +Requires: SVGRENDERER GRAPHICSVIEW +Name: QGraphicsSvgItem +SeeAlso: ??? + +Feature: SVGGENERATOR +Description: Provides a paint device that is used to create SVG drawings. +Section: SVG +Requires: SVG +Name: QSvgGenerator +SeeAlso: ??? + +Feature: SVGRENDERER +Description: Provides a class used to draw the contents of SVG files onto paint devices. +Section: SVG +Requires: SVG +Name: QSvgRenderer +SeeAlso: ??? + +Feature: SVGWIDGET +Description: Provides a widget that is used to display the contents of SVG files. +Section: SVG +Requires: SVGRENDERER +Name: QSvgWidget +SeeAlso: ??? + + +# Qt for Embedded Linux + +Feature: QWS_SOUNDSERVER +Description: Supports servers playing sounds. +Section: Qt for Embedded Linux +Requires: SOUND HOSTINFO QWS_MULTIPROCESS +Name: Sound Server +SeeAlso: ??? + +Feature: QWS_MULTIPROCESS +Description: Supports multi-process architecture. +Section: Qt for Embedded Linux +Requires: +Name: Multi-Process +SeeAlso: ??? + +Feature: QWS_KEYBOARD +Description: Supports the console keyboard. +Section: Qt for Embedded Linux +Requires: +Name: Keyboard +SeeAlso: ??? + +Feature: QWS_CURSOR +Description: Supports visible cursors. +Section: Qt for Embedded Linux +Requires: CURSOR +Name: Cursor +SeeAlso: ??? + +Feature: QWS_ALPHA_CURSOR +Description: Supports alpha-blended cursors. +Section: Qt for Embedded Linux +Requires: +Name: Alpha Cursor +SeeAlso: ??? + +Feature: QWS_MANAGER +Description: Supports the window manager. +Section: Qt for Embedded Linux +Requires: QWS_DECORATION_DEFAULT +Name: Manager +SeeAlso: ??? + +Feature: QWS_DECORATION_DEFAULT +Description: Supports default decoration of the top level windows. +Section: Qt for Embedded Linux +Requires: +Name: Decoration +SeeAlso: ??? + +Feature: QWS_DECORATION_WINDOWS +Description: Supports a "Windows" style decoration of the top level windows. +Section: Qt for Embedded Linux +Requires: QWS_DECORATION_DEFAULT +Name: Decoration (Windows Style) +SeeAlso: ??? + +Feature: QWS_DECORATION_STYLED +Description: Supports styled decoration of the top level windows. +Section: Qt for Embedded Linux +Requires: QWS_DECORATION_DEFAULT +Name: Decoration (Styled) +SeeAlso: ??? + +Feature: QWS_MOUSE +Description: Supports mouse drivers. +Section: Qt for Embedded Linux +Requires: +Name: Mouse +SeeAlso: ??? + +Feature: QWS_MOUSE_AUTO +Description: Supports auto-detected mouse drivers. +Section: Qt for Embedded Linux +Requires: +Name: Mouse (Auto) +SeeAlso: ??? + +Feature: QWS_MOUSE_MANUAL +Description: Supports non-autodetected mouse drivers. +Section: Qt for Embedded Linux +Requires: +Name: Mouse (Non-Auto) +SeeAlso: ??? + +Feature: QWS_PROPERTIES +Description: Supports window system properties. +Section: Qt for Embedded Linux +Requires: +Name: Properties +SeeAlso: ??? + +Feature: SXE +Description: Supports Safe Execution Environment (experimental). +Section: Qt for Embedded Linux +Requires: QWS_MULTIPROCESS +Name: SXE +SeeAlso: ??? + +Feature: QWSEMBEDWIDGET +Description: Provides embedding of a top-level window. +Section: Qt for Embedded Linux +Requires: +Name: QWSEmbedWidget +SeeAlso: ??? + +Feature: QWS_PROXYSCREEN +Description: Provides a proxy helper class used by some screen drivers. +Section: Qt for Embedded Linux +Requires: +Name: QProxyScreen +SeeAlso: ??? + +Feature: QWS_VNC +Description: Provides VNC screen driver +Section: Qt for Embedded Linux +Requires: QWS_PROXYSCREEN +Name: QVncScreen +SeeAlso: ??? + +Feature: QWS_TRANSFORMED +Description: Provides Transformed screen driver +Section: Qt for Embedded Linux +Requires: QWS_PROXYSCREEN +Name: QVncTransformed +SeeAlso: ??? + +Feature: QWS_DYNAMICSCREENTRANSFORMATION +Description: Enables dynamic setting of screen transformation/rotation. +Section: Qt for Embedded Linux +Requires: QWS_PROXYSCREEN +Name: Dynamic screen transformation. +SeeAlso: ??? + +# Windows + +Feature: WIN_ACTIVEQT +Description: Support for ActiveQt +Section: Windows +Requires: PROPERTIES +Name: ActiveQt +SeeAlso: ??? + +# D-Bus + +Feature: DBUS +Description: Provides classes for D-Bus. +Section: D-Bus +Requires: PROPERTIES DOM +Name: QtDBus module +SeeAlso: ??? + +# Phonon + +Feature: PHONON_PLATFORMPLUGIN +Description: Support for platform plugin +Section: Phonon +Requires: LIBRARY +Name: Phonon::PlatformPlugin +SeeAlso: ??? + +Feature: PHONON_EFFECT +Description: Support for Audio Effect +Section: Phonon +Requires: +Name: Phonon::Effect +SeeAlso: ??? + +Feature: PHONON_AUDIOCAPTURE +Description: Support for Audio Capture +Section: Phonon +Requires: +Name: Support for Audio Capture +SeeAlso: ??? + +Feature: PHONON_EFFECTWIDGET +Description: Support for Audio Effect Widget +Section: Phonon +Requires: PHONON_EFFECT COMBOBOX SPINBOX +Name: Phonon::EffectWidget +SeeAlso: ??? + +Feature: PHONON_VOLUMEFADEREFFECT +Description: Support for Volume Fader Effect class +Section: Phonon +Requires: PHONON_EFFECT +Name: Phonon::VolumeFaderEffect +SeeAlso: ??? + + +Feature: PHONON_OBJECTDESCRIPTIONMODEL +Description: Support for Object Description Model +Section: Phonon +Requires: +Name: Phonon::ObjectDescriptionModel +SeeAlso: ??? + +Feature: PHONON_VIDEO +Description: Support for Video +Section: Phonon +Requires: +Name: Phonon::VideoWidget +SeeAlso: ??? + +Feature: PHONON_VIDEOPLAYER +Description: Support for the Video Player class +Section: Phonon +Requires: PHONON_VIDEO +Name: Phonon::VideoPlayer +SeeAlso: ??? + + +Feature: PHONON_SEEKSLIDER +Description: Support for the Seek Slider class +Section: Phonon +Requires: SLIDER +Name: Phonon::SeekSlider +SeeAlso: ??? + +Feature: PHONON_VOLUMESLIDER +Description: Support for the Volume Slider class +Section: Phonon +Requires: SLIDER TOOLBUTTON +Name: Phonon::VolumeSlider +SeeAlso: ??? + +Feature: PHONON_MEDIACONTROLLER +Description: Support for the MediaController class +Section: Phonon +Requires: +Name: Phonon::MediaController +SeeAlso: ??? + +Feature: PHONON_ABSTRACTMEDIASTREAM +Description: Support for streaming of raw data (QIODevice...) +Section: Phonon +Requires: +Name: Phonon::AbstractMediaStream +SeeAlso: ??? + +Feature: PHONON_SETTINGSGROUP +Description: Phonon settingsgroup +Section: Phonon +Requires: SETTINGS +Name: Phonon::AbstractMediaStream +SeeAlso: ??? diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp new file mode 100644 index 0000000000..a6b9bddcc4 --- /dev/null +++ b/src/corelib/global/qglobal.cpp @@ -0,0 +1,3653 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qplatformdefs.h" +#include "qstring.h" +#include "qvector.h" +#include "qlist.h" +#include "qthreadstorage.h" +#include "qdir.h" +#include "qstringlist.h" +#include "qdatetime.h" + +#ifndef QT_NO_QOBJECT +#include +#endif + +#include +#include +#include +#include +#include + +#ifndef QT_NO_EXCEPTIONS +# include +# include +#endif + +#if !defined(Q_OS_WINCE) +# include +# if defined(Q_CC_MSVC) +# include +# endif +#endif + +#if defined(Q_OS_VXWORKS) +# include +#endif + +#if defined(Q_OS_MACX) && !defined(QT_NO_CORESERVICES) +#include +#endif + +#if defined(Q_OS_SYMBIAN) +#include +#include +#include +#include +# include "private/qcore_symbian_p.h" + +_LIT(qt_S60Filter, "Series60v?.*.sis"); +_LIT(qt_symbianSystemInstallDir, "z:\\system\\install\\"); +#endif + +QT_BEGIN_NAMESPACE + + +/*! + \class QFlag + \brief The QFlag class is a helper data type for QFlags. + + It is equivalent to a plain \c int, except with respect to + function overloading and type conversions. You should never need + to use this class in your applications. + + \sa QFlags +*/ + +/*! + \fn QFlag::QFlag(int value) + + Constructs a QFlag object that stores the given \a value. +*/ + +/*! + \fn QFlag::operator int() const + + Returns the value stored by the QFlag object. +*/ + +/*! + \class QFlags + \brief The QFlags class provides a type-safe way of storing + OR-combinations of enum values. + + + \ingroup tools + + The QFlags class is a template class, where Enum is an enum + type. QFlags is used throughout Qt for storing combinations of + enum values. + + The traditional C++ approach for storing OR-combinations of enum + values is to use an \c int or \c uint variable. The inconvenience + with this approach is that there's no type checking at all; any + enum value can be OR'd with any other enum value and passed on to + a function that takes an \c int or \c uint. + + Qt uses QFlags to provide type safety. For example, the + Qt::Alignment type is simply a typedef for + QFlags. QLabel::setAlignment() takes a + Qt::Alignment parameter, which means that any combination of + Qt::AlignmentFlag values,or 0, is legal: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 0 + + If you try to pass a value from another enum or just a plain + integer other than 0, the compiler will report an error. If you + need to cast integer values to flags in a untyped fashion, you can + use the explicit QFlags constructor as cast operator. + + If you want to use QFlags for your own enum types, use + the Q_DECLARE_FLAGS() and Q_DECLARE_OPERATORS_FOR_FLAGS(). + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 1 + + You can then use the \c MyClass::Options type to store + combinations of \c MyClass::Option values. + + \section1 Flags and the Meta-Object System + + The Q_DECLARE_FLAGS() macro does not expose the flags to the meta-object + system, so they cannot be used by Qt Script or edited in Qt Designer. + To make the flags available for these purposes, the Q_FLAGS() macro must + be used: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp meta-object flags + + \section1 Naming Convention + + A sensible naming convention for enum types and associated QFlags + types is to give a singular name to the enum type (e.g., \c + Option) and a plural name to the QFlags type (e.g., \c Options). + When a singular name is desired for the QFlags type (e.g., \c + Alignment), you can use \c Flag as the suffix for the enum type + (e.g., \c AlignmentFlag). + + \sa QFlag +*/ + +/*! + \typedef QFlags::enum_type + + Typedef for the Enum template type. +*/ + +/*! + \fn QFlags::QFlags(const QFlags &other) + + Constructs a copy of \a other. +*/ + +/*! + \fn QFlags::QFlags(Enum flag) + + Constructs a QFlags object storing the given \a flag. +*/ + +/*! + \fn QFlags::QFlags(Zero zero) + + Constructs a QFlags object with no flags set. \a zero must be a + literal 0 value. +*/ + +/*! + \fn QFlags::QFlags(QFlag value) + + Constructs a QFlags object initialized with the given integer \a + value. + + The QFlag type is a helper type. By using it here instead of \c + int, we effectively ensure that arbitrary enum values cannot be + cast to a QFlags, whereas untyped enum values (i.e., \c int + values) can. +*/ + +/*! + \fn QFlags &QFlags::operator=(const QFlags &other) + + Assigns \a other to this object and returns a reference to this + object. +*/ + +/*! + \fn QFlags &QFlags::operator&=(int mask) + + Performs a bitwise AND operation with \a mask and stores the + result in this QFlags object. Returns a reference to this object. + + \sa operator&(), operator|=(), operator^=() +*/ + +/*! + \fn QFlags &QFlags::operator&=(uint mask) + + \overload +*/ + +/*! + \fn QFlags &QFlags::operator|=(QFlags other) + + Performs a bitwise OR operation with \a other and stores the + result in this QFlags object. Returns a reference to this object. + + \sa operator|(), operator&=(), operator^=() +*/ + +/*! + \fn QFlags &QFlags::operator|=(Enum other) + + \overload +*/ + +/*! + \fn QFlags &QFlags::operator^=(QFlags other) + + Performs a bitwise XOR operation with \a other and stores the + result in this QFlags object. Returns a reference to this object. + + \sa operator^(), operator&=(), operator|=() +*/ + +/*! + \fn QFlags &QFlags::operator^=(Enum other) + + \overload +*/ + +/*! + \fn QFlags::operator int() const + + Returns the value stored in the QFlags object as an integer. +*/ + +/*! + \fn QFlags QFlags::operator|(QFlags other) const + + Returns a QFlags object containing the result of the bitwise OR + operation on this object and \a other. + + \sa operator|=(), operator^(), operator&(), operator~() +*/ + +/*! + \fn QFlags QFlags::operator|(Enum other) const + + \overload +*/ + +/*! + \fn QFlags QFlags::operator^(QFlags other) const + + Returns a QFlags object containing the result of the bitwise XOR + operation on this object and \a other. + + \sa operator^=(), operator&(), operator|(), operator~() +*/ + +/*! + \fn QFlags QFlags::operator^(Enum other) const + + \overload +*/ + +/*! + \fn QFlags QFlags::operator&(int mask) const + + Returns a QFlags object containing the result of the bitwise AND + operation on this object and \a mask. + + \sa operator&=(), operator|(), operator^(), operator~() +*/ + +/*! + \fn QFlags QFlags::operator&(uint mask) const + + \overload +*/ + +/*! + \fn QFlags QFlags::operator&(Enum mask) const + + \overload +*/ + +/*! + \fn QFlags QFlags::operator~() const + + Returns a QFlags object that contains the bitwise negation of + this object. + + \sa operator&(), operator|(), operator^() +*/ + +/*! + \fn bool QFlags::operator!() const + + Returns true if no flag is set (i.e., if the value stored by the + QFlags object is 0); otherwise returns false. +*/ + +/*! + \fn bool QFlags::testFlag(Enum flag) const + \since 4.2 + + Returns true if the \a flag is set, otherwise false. +*/ + +/*! + \macro Q_DISABLE_COPY(Class) + \relates QObject + + Disables the use of copy constructors and assignment operators + for the given \a Class. + + Instances of subclasses of QObject should not be thought of as + values that can be copied or assigned, but as unique identities. + This means that when you create your own subclass of QObject + (director or indirect), you should \e not give it a copy constructor + or an assignment operator. However, it may not enough to simply + omit them from your class, because, if you mistakenly write some code + that requires a copy constructor or an assignment operator (it's easy + to do), your compiler will thoughtfully create it for you. You must + do more. + + The curious user will have seen that the Qt classes derived + from QObject typically include this macro in a private section: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 43 + + It declares a copy constructor and an assignment operator in the + private section, so that if you use them by mistake, the compiler + will report an error. + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 44 + + But even this might not catch absolutely every case. You might be + tempted to do something like this: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 45 + + First of all, don't do that. Most compilers will generate code that + uses the copy constructor, so the privacy violation error will be + reported, but your C++ compiler is not required to generate code for + this statement in a specific way. It could generate code using + \e{neither} the copy constructor \e{nor} the assignment operator we + made private. In that case, no error would be reported, but your + application would probably crash when you called a member function + of \c{w}. +*/ + +/*! + \macro Q_DECLARE_FLAGS(Flags, Enum) + \relates QFlags + + The Q_DECLARE_FLAGS() macro expands to + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 2 + + \a Enum is the name of an existing enum type, whereas \a Flags is + the name of the QFlags<\e{Enum}> typedef. + + See the QFlags documentation for details. + + \sa Q_DECLARE_OPERATORS_FOR_FLAGS() +*/ + +/*! + \macro Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) + \relates QFlags + + The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global \c + operator|() functions for \a Flags, which is of type QFlags. + + See the QFlags documentation for details. + + \sa Q_DECLARE_FLAGS() +*/ + +/*! + \headerfile + \title Global Qt Declarations + \ingroup funclists + + \brief The header file includes the fundamental global + declarations. It is included by most other Qt header files. + + The global declarations include \l{types}, \l{functions} and + \l{macros}. + + The type definitions are partly convenience definitions for basic + types (some of which guarantee certain bit-sizes on all platforms + supported by Qt), partly types related to Qt message handling. The + functions are related to generating messages, Qt version handling + and comparing and adjusting object values. And finally, some of + the declared macros enable programmers to add compiler or platform + specific code to their applications, while others are convenience + macros for larger operations. + + \section1 Types + + The header file declares several type definitions that guarantee a + specified bit-size on all platforms supported by Qt for various + basic types, for example \l qint8 which is a signed char + guaranteed to be 8-bit on all platforms supported by Qt. The + header file also declares the \l qlonglong type definition for \c + {long long int } (\c __int64 on Windows). + + Several convenience type definitions are declared: \l qreal for \c + double, \l uchar for \c unsigned char, \l uint for \c unsigned + int, \l ulong for \c unsigned long and \l ushort for \c unsigned + short. + + Finally, the QtMsgType definition identifies the various messages + that can be generated and sent to a Qt message handler; + QtMsgHandler is a type definition for a pointer to a function with + the signature \c {void myMsgHandler(QtMsgType, const char *)}. + + \section1 Functions + + The header file contains several functions comparing + and adjusting an object's value. These functions take a template + type as argument: You can retrieve the absolute value of an object + using the qAbs() function, and you can bound a given object's + value by given minimum and maximum values using the qBound() + 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. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 3 + + 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. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 4 + + The remaining functions are qRound() and qRound64(), which both + accept a \l qreal value as their argument returning the value + rounded up to the nearest integer and 64-bit integer respectively, + the qInstallMsgHandler() function which installs the given + QtMsgHandler, and the qVersion() function which returns the + version number of Qt at run-time as a string. + + \section1 Macros + + The header file provides a range of macros (Q_CC_*) + that are defined if the application is compiled using the + specified platforms. For example, the Q_CC_SUN macro is defined if + the application is compiled using Forte Developer, or Sun Studio + C++. The header file also declares a range of macros (Q_OS_*) + that are defined for the specified platforms. For example, + Q_OS_X11 which is defined for the X Window System. + + The purpose of these macros is to enable programmers to add + compiler or platform specific code to their application. + + The remaining macros are convenience macros for larger operations: + The QT_TRANSLATE_NOOP() and QT_TR_NOOP() macros provide the + possibility of marking text for dynamic translation, + i.e. translation without changing the stored source text. The + Q_ASSERT() and Q_ASSERT_X() enables warning messages of various + level of refinement. The Q_FOREACH() and foreach() macros + implement Qt's foreach loop. + + The Q_INT64_C() and Q_UINT64_C() macros wrap signed and unsigned + 64-bit integer literals in a platform-independent way. The + Q_CHECK_PTR() macro prints a warning containing the source code's + file name and line number, saying that the program ran out of + memory, if the pointer is 0. The qPrintable() macro represent an + easy way of printing text. + + Finally, the QT_POINTER_SIZE macro expands to the size of a + pointer in bytes, and the QT_VERSION and QT_VERSION_STR macros + expand to a numeric value or a string, respectively, specifying + Qt's version number, i.e the version the application is compiled + against. + + \sa , QSysInfo +*/ + +/*! + \typedef qreal + \relates + + Typedef for \c double on all platforms except for those using CPUs with + ARM architectures. + On ARM-based platforms, \c qreal is a typedef for \c float for performance + reasons. +*/ + +/*! \typedef uchar + \relates + + Convenience typedef for \c{unsigned char}. +*/ + +/*! + \fn qt_set_sequence_auto_mnemonic(bool on) + \relates + + Enables automatic mnemonics on Mac if \a on is true; otherwise + this feature is disabled. + + Note that this function is only available on Mac where mnemonics + are disabled by default. + + To access to this function, use an extern declaration: + extern void qt_set_sequence_auto_mnemonic(bool b); + + \sa {QShortcut#mnemonic}{QShortcut} +*/ + +/*! \typedef ushort + \relates + + Convenience typedef for \c{unsigned short}. +*/ + +/*! \typedef uint + \relates + + Convenience typedef for \c{unsigned int}. +*/ + +/*! \typedef ulong + \relates + + Convenience typedef for \c{unsigned long}. +*/ + +/*! \typedef qint8 + \relates + + Typedef for \c{signed char}. This type is guaranteed to be 8-bit + on all platforms supported by Qt. +*/ + +/*! + \typedef quint8 + \relates + + Typedef for \c{unsigned char}. This type is guaranteed to + be 8-bit on all platforms supported by Qt. +*/ + +/*! \typedef qint16 + \relates + + Typedef for \c{signed short}. This type is guaranteed to be + 16-bit on all platforms supported by Qt. +*/ + +/*! + \typedef quint16 + \relates + + Typedef for \c{unsigned short}. This type is guaranteed to + be 16-bit on all platforms supported by Qt. +*/ + +/*! \typedef qint32 + \relates + + Typedef for \c{signed int}. This type is guaranteed to be 32-bit + on all platforms supported by Qt. +*/ + +/*! + \typedef quint32 + \relates + + Typedef for \c{unsigned int}. This type is guaranteed to + be 32-bit on all platforms supported by Qt. +*/ + +/*! \typedef qint64 + \relates + + Typedef for \c{long long int} (\c __int64 on Windows). This type + is guaranteed to be 64-bit on all platforms supported by Qt. + + Literals of this type can be created using the Q_INT64_C() macro: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 5 + + \sa Q_INT64_C(), quint64, qlonglong +*/ + +/*! + \typedef quint64 + \relates + + Typedef for \c{unsigned long long int} (\c{unsigned __int64} on + Windows). This type is guaranteed to be 64-bit on all platforms + supported by Qt. + + Literals of this type can be created using the Q_UINT64_C() + macro: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 6 + + \sa Q_UINT64_C(), qint64, qulonglong +*/ + +/*! + \typedef quintptr + \relates + + Integral type for representing a pointers (useful for hashing, + etc.). + + Typedef for either quint32 or quint64. This type is guaranteed to + be the same size as a pointer on all platforms supported by Qt. On + a system with 32-bit pointers, quintptr is a typedef for quint32; + on a system with 64-bit pointers, quintptr is a typedef for + quint64. + + Note that quintptr is unsigned. Use qptrdiff for signed values. + + \sa qptrdiff, quint32, quint64 +*/ + +/*! + \typedef qptrdiff + \relates + + Integral type for representing pointer differences. + + Typedef for either qint32 or qint64. This type is guaranteed to be + the same size as a pointer on all platforms supported by Qt. On a + system with 32-bit pointers, quintptr is a typedef for quint32; on + a system with 64-bit pointers, quintptr is a typedef for quint64. + + Note that qptrdiff is signed. Use quintptr for unsigned values. + + \sa quintptr, qint32, qint64 +*/ + +/*! + \typedef QtMsgHandler + \relates + + This is a typedef for a pointer to a function with the following + signature: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 7 + + \sa QtMsgType, qInstallMsgHandler() +*/ + +/*! + \enum QtMsgType + \relates + + This enum describes the messages that can be sent to a message + handler (QtMsgHandler). You can use the enum to identify and + associate the various message types with the appropriate + actions. + + \value QtDebugMsg + A message generated by the qDebug() function. + \value QtWarningMsg + A message generated by the qWarning() function. + \value QtCriticalMsg + A message generated by the qCritical() function. + \value QtFatalMsg + A message generated by the qFatal() function. + \value QtSystemMsg + + + \sa QtMsgHandler, qInstallMsgHandler() +*/ + +/*! \macro qint64 Q_INT64_C(literal) + \relates + + Wraps the signed 64-bit integer \a literal in a + platform-independent way. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 8 + + \sa qint64, Q_UINT64_C() +*/ + +/*! \macro quint64 Q_UINT64_C(literal) + \relates + + Wraps the unsigned 64-bit integer \a literal in a + platform-independent way. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 9 + + \sa quint64, Q_INT64_C() +*/ + +/*! \typedef qlonglong + \relates + + Typedef for \c{long long int} (\c __int64 on Windows). This is + the same as \l qint64. + + \sa qulonglong, qint64 +*/ + +/*! + \typedef qulonglong + \relates + + Typedef for \c{unsigned long long int} (\c{unsigned __int64} on + Windows). This is the same as \l quint64. + + \sa quint64, qlonglong +*/ + +/*! \fn const T &qAbs(const T &value) + \relates + + 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 +*/ + +/*! \fn int qRound(qreal value) + \relates + + Rounds \a value to the nearest integer. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 11 +*/ + +/*! \fn qint64 qRound64(qreal value) + \relates + + Rounds \a value to the nearest 64-bit integer. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 12 +*/ + +/*! \fn const T &qMin(const T &value1, const T &value2) + \relates + + Returns the minimum of \a value1 and \a value2. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 13 + + \sa qMax(), qBound() +*/ + +/*! \fn const T &qMax(const T &value1, const T &value2) + \relates + + Returns the maximum of \a value1 and \a value2. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 14 + + \sa qMin(), qBound() +*/ + +/*! \fn const T &qBound(const T &min, const T &value, const T &max) + \relates + + Returns \a value bounded by \a min and \a max. This is equivalent + to qMax(\a min, qMin(\a value, \a max)). + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 15 + + \sa qMin(), qMax() +*/ + +/*! + \typedef Q_INT8 + \relates + \compat + + Use \l qint8 instead. +*/ + +/*! + \typedef Q_UINT8 + \relates + \compat + + Use \l quint8 instead. +*/ + +/*! + \typedef Q_INT16 + \relates + \compat + + Use \l qint16 instead. +*/ + +/*! + \typedef Q_UINT16 + \relates + \compat + + Use \l quint16 instead. +*/ + +/*! + \typedef Q_INT32 + \relates + \compat + + Use \l qint32 instead. +*/ + +/*! + \typedef Q_UINT32 + \relates + \compat + + Use \l quint32 instead. +*/ + +/*! + \typedef Q_INT64 + \relates + \compat + + Use \l qint64 instead. +*/ + +/*! + \typedef Q_UINT64 + \relates + \compat + + Use \l quint64 instead. +*/ + +/*! + \typedef Q_LLONG + \relates + \compat + + Use \l qint64 instead. +*/ + +/*! + \typedef Q_ULLONG + \relates + \compat + + Use \l quint64 instead. +*/ + +/*! + \typedef Q_LONG + \relates + \compat + + Use \c{void *} instead. +*/ + +/*! + \typedef Q_ULONG + \relates + \compat + + Use \c{void *} instead. +*/ + +/*! \fn bool qSysInfo(int *wordSize, bool *bigEndian) + \relates + + Use QSysInfo::WordSize and QSysInfo::ByteOrder instead. +*/ + +/*! + \fn bool qt_winUnicode() + \relates + + This function always returns true. + + \sa QSysInfo +*/ + +/*! + \fn int qWinVersion() + \relates + + Use QSysInfo::WindowsVersion instead. + + \sa QSysInfo +*/ + +/*! + \fn int qMacVersion() + \relates + + Use QSysInfo::MacintoshVersion instead. + + \sa QSysInfo +*/ + +/*! + \macro QT_VERSION_CHECK + \relates + + Turns the major, minor and patch numbers of a version into an + integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can + be compared with another similarly processed version id. + + \sa QT_VERSION +*/ + +/*! + \macro QT_VERSION + \relates + + This macro expands a numeric value of the form 0xMMNNPP (MM = + major, NN = minor, PP = patch) that specifies Qt's version + number. For example, if you compile your application against Qt + 4.1.2, the QT_VERSION macro will expand to 0x040102. + + You can use QT_VERSION to use the latest Qt features where + available. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 16 + + \sa QT_VERSION_STR, qVersion() +*/ + +/*! + \macro QT_VERSION_STR + \relates + + This macro expands to a string that specifies Qt's version number + (for example, "4.1.2"). This is the version against which the + application is compiled. + + \sa qVersion(), QT_VERSION +*/ + +/*! + \relates + + Returns the version number of Qt at run-time as a string (for + example, "4.1.2"). This may be a different version than the + version the application was compiled against. + + \sa QT_VERSION_STR +*/ + +const char *qVersion() +{ + return QT_VERSION_STR; +} + +bool qSharedBuild() +{ +#ifdef QT_SHARED + return true; +#else + return false; +#endif +} + +/***************************************************************************** + System detection routines + *****************************************************************************/ + +/*! + \class QSysInfo + \brief The QSysInfo class provides information about the system. + + \list + \o \l WordSize specifies the size of a pointer for the platform + on which the application is compiled. + \o \l ByteOrder specifies whether the platform is big-endian or + little-endian. + \o \l WindowsVersion specifies the version of the Windows operating + system on which the application is run (Windows only) + \o \l MacintoshVersion specifies the version of the Macintosh + operating system on which the application is run (Mac only). + \endlist + + Some constants are defined only on certain platforms. You can use + the preprocessor symbols Q_WS_WIN and Q_WS_MAC to test that + the application is compiled under Windows or Mac. + + \sa QLibraryInfo +*/ + +/*! + \enum QSysInfo::Sizes + + This enum provides platform-specific information about the sizes of data + structures used by the underlying architecture. + + \value WordSize The size in bits of a pointer for the platform on which + the application is compiled (32 or 64). +*/ + +/*! + \variable QSysInfo::WindowsVersion + \brief the version of the Windows operating system on which the + application is run (Windows only) +*/ + +/*! + \fn QSysInfo::WindowsVersion QSysInfo::windowsVersion() + \since 4.4 + + Returns the version of the Windows operating system on which the + application is run (Windows only). +*/ + +/*! + \variable QSysInfo::MacintoshVersion + \brief the version of the Macintosh operating system on which + the application is run (Mac only). +*/ + +/*! + \fn QSysInfo::SymbianVersion QSysInfo::symbianVersion() + \since 4.6 + + Returns the version of the Symbian operating system on which the + application is run (Symbian only). +*/ + +/*! + \fn QSysInfo::S60Version QSysInfo::s60Version() + \since 4.6 + + Returns the version of the S60 SDK system on which the + application is run (S60 only). +*/ + +/*! + \enum QSysInfo::Endian + + \value BigEndian Big-endian byte order (also called Network byte order) + \value LittleEndian Little-endian byte order + \value ByteOrder Equals BigEndian or LittleEndian, depending on + the platform's byte order. +*/ + +/*! + \enum QSysInfo::WinVersion + + This enum provides symbolic names for the various versions of the + Windows operating system. On Windows, the + QSysInfo::WindowsVersion variable gives the version of the system + on which the application is run. + + MS-DOS-based versions: + + \value WV_32s Windows 3.1 with Win 32s + \value WV_95 Windows 95 + \value WV_98 Windows 98 + \value WV_Me Windows Me + + NT-based versions (note that each operating system version is only represented once rather than each Windows edition): + + \value WV_NT Windows NT (operating system version 4.0) + \value WV_2000 Windows 2000 (operating system version 5.0) + \value WV_XP Windows XP (operating system version 5.1) + \value WV_2003 Windows Server 2003, Windows Server 2003 R2, Windows Home Server, Windows XP Professional x64 Edition (operating system version 5.2) + \value WV_VISTA Windows Vista, Windows Server 2008 (operating system version 6.0) + \value WV_WINDOWS7 Windows 7, Windows Server 2008 R2 (operating system version 6.1) + + Alternatively, you may use the following macros which correspond directly to the Windows operating system version number: + + \value WV_4_0 Operating system version 4.0, corresponds to Windows NT + \value WV_5_0 Operating system version 5.0, corresponds to Windows 2000 + \value WV_5_1 Operating system version 5.1, corresponds to Windows XP + \value WV_5_2 Operating system version 5.2, corresponds to Windows Server 2003, Windows Server 2003 R2, Windows Home Server, and Windows XP Professional x64 Edition + \value WV_6_0 Operating system version 6.0, corresponds to Windows Vista and Windows Server 2008 + \value WV_6_1 Operating system version 6.1, corresponds to Windows 7 and Windows Server 2008 R2 + + CE-based versions: + + \value WV_CE Windows CE + \value WV_CENET Windows CE .NET + \value WV_CE_5 Windows CE 5.x + \value WV_CE_6 Windows CE 6.x + + The following masks can be used for testing whether a Windows + version is MS-DOS-based, NT-based, or CE-based: + + \value WV_DOS_based MS-DOS-based version of Windows + \value WV_NT_based NT-based version of Windows + \value WV_CE_based CE-based version of Windows + + \sa MacVersion, SymbianVersion +*/ + +/*! + \enum QSysInfo::MacVersion + + This enum provides symbolic names for the various versions of the + Macintosh operating system. On Mac, the + QSysInfo::MacintoshVersion variable gives the version of the + system on which the application is run. + + \value MV_9 Mac OS 9 (unsupported) + \value MV_10_0 Mac OS X 10.0 (unsupported) + \value MV_10_1 Mac OS X 10.1 (unsupported) + \value MV_10_2 Mac OS X 10.2 (unsupported) + \value MV_10_3 Mac OS X 10.3 + \value MV_10_4 Mac OS X 10.4 + \value MV_10_5 Mac OS X 10.5 + \value MV_10_6 Mac OS X 10.6 + \value MV_10_7 Mac OS X 10.7 + \value MV_Unknown An unknown and currently unsupported platform + + \value MV_CHEETAH Apple codename for MV_10_0 + \value MV_PUMA Apple codename for MV_10_1 + \value MV_JAGUAR Apple codename for MV_10_2 + \value MV_PANTHER Apple codename for MV_10_3 + \value MV_TIGER Apple codename for MV_10_4 + \value MV_LEOPARD Apple codename for MV_10_5 + \value MV_SNOWLEOPARD Apple codename for MV_10_6 + \value MV_LION Apple codename for MV_10_7 + + \sa WinVersion, SymbianVersion +*/ + +/*! + \enum QSysInfo::SymbianVersion + + This enum provides symbolic names for the various versions of the + Symbian operating system. On Symbian, the + QSysInfo::symbianVersion() function gives the version of the + system on which the application is run. + + \value SV_9_2 Symbian OS v9.2 + \value SV_9_3 Symbian OS v9.3 + \value SV_9_4 Symbian OS v9.4 + \value SV_SF_1 S60 5th Edition (Symbian^1) + \value SV_SF_2 Symbian^2 + \value SV_SF_3 Symbian^3 or Symbian Anna + \value SV_SF_4 \e{This enum value is deprecated.} + \value SV_API_5_3 Symbian/S60 API version 5.3 release + \value SV_API_5_4 Symbian/S60 API version 5.4 release + \value SV_Unknown An unknown and currently unsupported platform + + \sa S60Version, WinVersion, MacVersion +*/ + +/*! + \enum QSysInfo::S60Version + + This enum provides symbolic names for the various versions of the + S60 SDK. On S60, the + QSysInfo::s60Version() function gives the version of the + SDK on which the application is run. + + \value SV_S60_3_1 S60 3rd Edition Feature Pack 1 + \value SV_S60_3_2 S60 3rd Edition Feature Pack 2 + \value SV_S60_5_0 S60 5th Edition + \value SV_S60_5_1 \e{This enum value is deprecated.} + \value SV_S60_5_2 Symbian^3 and Symbian Anna + \value SV_S60_5_3 Symbian/S60 API version 5.3 release + \value SV_S60_5_4 Symbian/S60 API version 5.4 release + \value SV_S60_Unknown An unknown and currently unsupported platform + \omitvalue SV_S60_None + + \sa SymbianVersion, WinVersion, MacVersion +*/ + +/*! + \macro Q_WS_MAC + \relates + + Defined on Mac OS X. + + \sa Q_WS_WIN, Q_WS_X11, Q_WS_QWS, Q_WS_QPA, Q_WS_S60 +*/ + +/*! + \macro Q_WS_WIN + \relates + + Defined on Windows. + + \sa Q_WS_MAC, Q_WS_X11, Q_WS_QWS, Q_WS_QPA, Q_WS_S60 +*/ + +/*! + \macro Q_WS_X11 + \relates + + Defined on X11. + + \sa Q_WS_MAC, Q_WS_WIN, Q_WS_QWS, Q_WS_QPA, Q_WS_S60 +*/ + +/*! + \macro Q_WS_QWS + \relates + + Defined on Qt for Embedded Linux. + + \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11, Q_WS_QPA, Q_WS_S60 +*/ + +/*! + \macro Q_WS_QPA + \relates + + Defined on Qt for Embedded Linux, Lite version. + + \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11, Q_WS_QWS, Q_WS_S60 +*/ + +/*! + \macro Q_OS_DARWIN + \relates + + Defined on Darwin OS (synonym for Q_OS_MAC). +*/ + +/*! + \macro Q_OS_MSDOS + \relates + + Defined on MS-DOS and Windows. +*/ + +/*! + \macro Q_OS_OS2 + \relates + + Defined on OS/2. +*/ + +/*! + \macro Q_OS_OS2EMX + \relates + + Defined on XFree86 on OS/2 (not PM). +*/ + +/*! + \macro Q_OS_WIN32 + \relates + + Defined on all supported versions of Windows. +*/ + +/*! + \macro Q_OS_WINCE + \relates + + Defined on Windows CE. +*/ + +/*! + \macro Q_OS_CYGWIN + \relates + + Defined on Cygwin. +*/ + +/*! + \macro Q_OS_SOLARIS + \relates + + Defined on Sun Solaris. +*/ + +/*! + \macro Q_OS_HPUX + \relates + + Defined on HP-UX. +*/ + +/*! + \macro Q_OS_ULTRIX + \relates + + Defined on DEC Ultrix. +*/ + +/*! + \macro Q_OS_LINUX + \relates + + Defined on Linux. +*/ + +/*! + \macro Q_OS_FREEBSD + \relates + + Defined on FreeBSD. +*/ + +/*! + \macro Q_OS_NETBSD + \relates + + Defined on NetBSD. +*/ + +/*! + \macro Q_OS_OPENBSD + \relates + + Defined on OpenBSD. +*/ + +/*! + \macro Q_OS_BSDI + \relates + + Defined on BSD/OS. +*/ + +/*! + \macro Q_OS_IRIX + \relates + + Defined on SGI Irix. +*/ + +/*! + \macro Q_OS_OSF + \relates + + Defined on HP Tru64 UNIX. +*/ + +/*! + \macro Q_OS_SCO + \relates + + Defined on SCO OpenServer 5. +*/ + +/*! + \macro Q_OS_UNIXWARE + \relates + + Defined on UnixWare 7, Open UNIX 8. +*/ + +/*! + \macro Q_OS_AIX + \relates + + Defined on AIX. +*/ + +/*! + \macro Q_OS_HURD + \relates + + Defined on GNU Hurd. +*/ + +/*! + \macro Q_OS_DGUX + \relates + + Defined on DG/UX. +*/ + +/*! + \macro Q_OS_RELIANT + \relates + + Defined on Reliant UNIX. +*/ + +/*! + \macro Q_OS_DYNIX + \relates + + Defined on DYNIX/ptx. +*/ + +/*! + \macro Q_OS_QNX + \relates + + Defined on QNX Neutrino. +*/ + +/*! + \macro Q_OS_LYNX + \relates + + Defined on LynxOS. +*/ + +/*! + \macro Q_OS_BSD4 + \relates + + Defined on Any BSD 4.4 system. +*/ + +/*! + \macro Q_OS_UNIX + \relates + + Defined on Any UNIX BSD/SYSV system. +*/ + +/*! + \macro Q_CC_SYM + \relates + + Defined if the application is compiled using Digital Mars C/C++ + (used to be Symantec C++). +*/ + +/*! + \macro Q_CC_MWERKS + \relates + + Defined if the application is compiled using Metrowerks + CodeWarrior. +*/ + +/*! + \macro Q_CC_MSVC + \relates + + Defined if the application is compiled using Microsoft Visual + C/C++, Intel C++ for Windows. +*/ + +/*! + \macro Q_CC_BOR + \relates + + Defined if the application is compiled using Borland/Turbo C++. +*/ + +/*! + \macro Q_CC_WAT + \relates + + Defined if the application is compiled using Watcom C++. +*/ + +/*! + \macro Q_CC_GNU + \relates + + Defined if the application is compiled using GNU C++. +*/ + +/*! + \macro Q_CC_COMEAU + \relates + + Defined if the application is compiled using Comeau C++. +*/ + +/*! + \macro Q_CC_EDG + \relates + + Defined if the application is compiled using Edison Design Group + C++. +*/ + +/*! + \macro Q_CC_OC + \relates + + Defined if the application is compiled using CenterLine C++. +*/ + +/*! + \macro Q_CC_SUN + \relates + + Defined if the application is compiled using Forte Developer, or + Sun Studio C++. +*/ + +/*! + \macro Q_CC_MIPS + \relates + + Defined if the application is compiled using MIPSpro C++. +*/ + +/*! + \macro Q_CC_DEC + \relates + + Defined if the application is compiled using DEC C++. +*/ + +/*! + \macro Q_CC_HPACC + \relates + + Defined if the application is compiled using HP aC++. +*/ + +/*! + \macro Q_CC_USLC + \relates + + Defined if the application is compiled using SCO OUDK and UDK. +*/ + +/*! + \macro Q_CC_CDS + \relates + + Defined if the application is compiled using Reliant C++. +*/ + +/*! + \macro Q_CC_KAI + \relates + + Defined if the application is compiled using KAI C++. +*/ + +/*! + \macro Q_CC_INTEL + \relates + + Defined if the application is compiled using Intel C++ for Linux, + Intel C++ for Windows. +*/ + +/*! + \macro Q_CC_HIGHC + \relates + + Defined if the application is compiled using MetaWare High C/C++. +*/ + +/*! + \macro Q_CC_PGI + \relates + + Defined if the application is compiled using Portland Group C++. +*/ + +/*! + \macro Q_CC_GHS + \relates + + Defined if the application is compiled using Green Hills + Optimizing C++ Compilers. +*/ + +/*! + \macro Q_OS_MAC + \relates + + Defined on MAC OS (synonym for Darwin). + */ + +/*! + \macro Q_OS_SYMBIAN + \relates + + Defined on Symbian. + */ + +/*! + \macro Q_WS_S60 + \relates + + Defined on S60 with the Avkon UI framework. + + \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11, Q_WS_QWS + */ + +#if defined(QT_BUILD_QMAKE) +// needed to bootstrap qmake +static const unsigned int qt_one = 1; +const int QSysInfo::ByteOrder = ((*((unsigned char *) &qt_one) == 0) ? BigEndian : LittleEndian); +#endif + +#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) + +QT_BEGIN_INCLUDE_NAMESPACE +#include "private/qcore_mac_p.h" +#include "qnamespace.h" +QT_END_INCLUDE_NAMESPACE + +Q_CORE_EXPORT OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref) +{ + return FSPathMakeRef(reinterpret_cast(file.toUtf8().constData()), fsref, 0); +} + +// Don't use this function, it won't work in 10.5 (Leopard) and up +Q_CORE_EXPORT OSErr qt_mac_create_fsspec(const QString &file, FSSpec *spec) +{ + FSRef fsref; + OSErr ret = qt_mac_create_fsref(file, &fsref); + if (ret == noErr) + ret = FSGetCatalogInfo(&fsref, kFSCatInfoNone, 0, 0, spec, 0); + return ret; +} + +Q_CORE_EXPORT void qt_mac_to_pascal_string(QString s, Str255 str, TextEncoding encoding=0, int len=-1) +{ + if(len == -1) + len = s.length(); +#if 0 + UnicodeMapping mapping; + mapping.unicodeEncoding = CreateTextEncoding(kTextEncodingUnicodeDefault, + kTextEncodingDefaultVariant, + kUnicode16BitFormat); + mapping.otherEncoding = (encoding ? encoding : ); + mapping.mappingVersion = kUnicodeUseLatestMapping; + + UnicodeToTextInfo info; + OSStatus err = CreateUnicodeToTextInfo(&mapping, &info); + if(err != noErr) { + qDebug("Qt: internal: Unable to create pascal string '%s'::%d [%ld]", + s.left(len).latin1(), (int)encoding, err); + return; + } + const int unilen = len * 2; + const UniChar *unibuf = (UniChar *)s.unicode(); + ConvertFromUnicodeToPString(info, unilen, unibuf, str); + DisposeUnicodeToTextInfo(&info); +#else + Q_UNUSED(encoding); + CFStringGetPascalString(QCFString(s), str, 256, CFStringGetSystemEncoding()); +#endif +} + +Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr) { + return QCFString(CFStringCreateWithPascalString(0, pstr, CFStringGetSystemEncoding())); +} +#endif //!defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) + +#if !defined(QWS) && defined(Q_OS_MAC) + +static QSysInfo::MacVersion macVersion() +{ +#ifndef QT_NO_CORESERVICES + SInt32 gestalt_version; + if (Gestalt(gestaltSystemVersion, &gestalt_version) == noErr) { + return QSysInfo::MacVersion(((gestalt_version & 0x00F0) >> 4) + 2); + } +#endif + return QSysInfo::MV_Unknown; +} +const QSysInfo::MacVersion QSysInfo::MacintoshVersion = macVersion(); + +#elif defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINCE) + +QT_BEGIN_INCLUDE_NAMESPACE +#include "qt_windows.h" +QT_END_INCLUDE_NAMESPACE + +QSysInfo::WinVersion QSysInfo::windowsVersion() +{ +#ifndef VER_PLATFORM_WIN32s +#define VER_PLATFORM_WIN32s 0 +#endif +#ifndef VER_PLATFORM_WIN32_WINDOWS +#define VER_PLATFORM_WIN32_WINDOWS 1 +#endif +#ifndef VER_PLATFORM_WIN32_NT +#define VER_PLATFORM_WIN32_NT 2 +#endif +#ifndef VER_PLATFORM_WIN32_CE +#define VER_PLATFORM_WIN32_CE 3 +#endif + + static QSysInfo::WinVersion winver; + if (winver) + return winver; + winver = QSysInfo::WV_NT; + OSVERSIONINFO osver; + osver.dwOSVersionInfoSize = sizeof(osver); + GetVersionEx(&osver); +#ifdef Q_OS_WINCE + DWORD qt_cever = 0; + qt_cever = osver.dwMajorVersion * 100; + qt_cever += osver.dwMinorVersion * 10; +#endif + switch (osver.dwPlatformId) { + case VER_PLATFORM_WIN32s: + winver = QSysInfo::WV_32s; + break; + case VER_PLATFORM_WIN32_WINDOWS: + // We treat Windows Me (minor 90) the same as Windows 98 + if (osver.dwMinorVersion == 90) + winver = QSysInfo::WV_Me; + else if (osver.dwMinorVersion == 10) + winver = QSysInfo::WV_98; + else + winver = QSysInfo::WV_95; + break; +#ifdef Q_OS_WINCE + case VER_PLATFORM_WIN32_CE: + if (qt_cever >= 600) + winver = QSysInfo::WV_CE_6; + if (qt_cever >= 500) + winver = QSysInfo::WV_CE_5; + else if (qt_cever >= 400) + winver = QSysInfo::WV_CENET; + else + winver = QSysInfo::WV_CE; + break; +#endif + default: // VER_PLATFORM_WIN32_NT + if (osver.dwMajorVersion < 5) { + winver = QSysInfo::WV_NT; + } else if (osver.dwMajorVersion == 5 && osver.dwMinorVersion == 0) { + winver = QSysInfo::WV_2000; + } else if (osver.dwMajorVersion == 5 && osver.dwMinorVersion == 1) { + winver = QSysInfo::WV_XP; + } else if (osver.dwMajorVersion == 5 && osver.dwMinorVersion == 2) { + winver = QSysInfo::WV_2003; + } else if (osver.dwMajorVersion == 6 && osver.dwMinorVersion == 0) { + winver = QSysInfo::WV_VISTA; + } else if (osver.dwMajorVersion == 6 && osver.dwMinorVersion == 1) { + winver = QSysInfo::WV_WINDOWS7; + } else { + qWarning("Qt: Untested Windows version %d.%d detected!", + int(osver.dwMajorVersion), int(osver.dwMinorVersion)); + winver = QSysInfo::WV_NT_based; + } + } + +#ifdef QT_DEBUG + { + QByteArray override = qgetenv("QT_WINVER_OVERRIDE"); + if (override.isEmpty()) + return winver; + + if (override == "Me") + winver = QSysInfo::WV_Me; + if (override == "95") + winver = QSysInfo::WV_95; + else if (override == "98") + winver = QSysInfo::WV_98; + else if (override == "NT") + winver = QSysInfo::WV_NT; + else if (override == "2000") + winver = QSysInfo::WV_2000; + else if (override == "2003") + winver = QSysInfo::WV_2003; + else if (override == "XP") + winver = QSysInfo::WV_XP; + else if (override == "VISTA") + winver = QSysInfo::WV_VISTA; + else if (override == "WINDOWS7") + winver = QSysInfo::WV_WINDOWS7; + } +#endif + + return winver; +} + +const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion(); + +#endif + +#ifdef Q_OS_SYMBIAN +static QSysInfo::SymbianVersion cachedSymbianVersion = QSysInfo::SymbianVersion(-1); +static QSysInfo::S60Version cachedS60Version = QSysInfo::S60Version(-1); + +static void symbianInitVersions() +{ + // Use pure Symbian code, because if done using QDir, there will be a call back + // to this method, resulting doing this expensive operation twice before the cache kicks in. + // Pure Symbian code also makes this method ~10x faster, speeding up the application launch. + RFs rfs = qt_s60GetRFs(); + TFindFile fileFinder(rfs); + CDir* contents; + + // Check for platform version + TInt err = fileFinder.FindWildByDir(qt_S60Filter, qt_symbianSystemInstallDir, contents); + if (err == KErrNone) { + QScopedPointer contentsDeleter(contents); + err = contents->Sort(EDescending|ESortByName); + if (err == KErrNone && contents->Count() > 0 && (*contents)[0].iName.Length() >= 12) { + TInt major = (*contents)[0].iName[9] - '0'; + TInt minor = (*contents)[0].iName[11] - '0'; + if (major == 3) { + if (minor == 1) { + cachedS60Version = QSysInfo::SV_S60_3_1; + cachedSymbianVersion = QSysInfo::SV_9_2; + } else if (minor == 2) { + cachedS60Version = QSysInfo::SV_S60_3_2; + cachedSymbianVersion = QSysInfo::SV_9_3; + } + } else if (major == 5) { + if (minor == 0) { + cachedS60Version = QSysInfo::SV_S60_5_0; + cachedSymbianVersion = QSysInfo::SV_9_4; + } else if (minor == 1) { + cachedS60Version = QSysInfo::SV_S60_5_1; + cachedSymbianVersion = QSysInfo::SV_SF_2; + } else if (minor == 2) { + cachedS60Version = QSysInfo::SV_S60_5_2; + cachedSymbianVersion = QSysInfo::SV_SF_3; + } else if (minor == 3) { + cachedS60Version = QSysInfo::SV_S60_5_3; + cachedSymbianVersion = QSysInfo::SV_API_5_3; + } else if (minor >= 4) { + cachedS60Version = QSysInfo::SV_S60_5_4; + cachedSymbianVersion = QSysInfo::SV_API_5_4; + } + } + } + } + +# ifdef Q_CC_NOKIAX86 + if (cachedS60Version == -1) { + // Some emulator environments may not contain the version specific .sis files, so + // simply hardcode the version on those environments. Note that can't use + // S60_VERSION_* defines for S60 3.x/5.0 platforms, as they do not define them + // right anyway in case .sis files are not found. +# if defined(__SERIES60_31__) + cachedS60Version = QSysInfo::SV_S60_3_1; + cachedSymbianVersion = QSysInfo::SV_9_2; +# elif defined(__S60_32__) + cachedS60Version = QSysInfo::SV_S60_3_2; + cachedSymbianVersion = QSysInfo::SV_9_3; +# elif defined(__S60_50__) + cachedS60Version = QSysInfo::SV_S60_5_0; + cachedSymbianVersion = QSysInfo::SV_9_4; +# elif defined(S60_VERSION_5_2) + cachedS60Version = QSysInfo::SV_S60_5_2; + cachedSymbianVersion = QSysInfo::SV_SF_3; +# elif defined(S60_VERSION_5_3) + cachedS60Version = QSysInfo::SV_S60_5_3; + cachedSymbianVersion = QSysInfo::SV_API_5_3; +# elif defined(S60_VERSION_5_4) + cachedS60Version = QSysInfo::SV_S60_5_4; + cachedSymbianVersion = QSysInfo::SV_API_5_4; +# endif + } +# endif + + if (cachedS60Version == -1) { + //If reaching here, it was not possible to determine the version + cachedS60Version = QSysInfo::SV_S60_Unknown; + cachedSymbianVersion = QSysInfo::SV_Unknown; + } +} + +QSysInfo::SymbianVersion QSysInfo::symbianVersion() +{ + if (cachedSymbianVersion == -1) + symbianInitVersions(); + + return cachedSymbianVersion; +} + +QSysInfo::S60Version QSysInfo::s60Version() +{ + if (cachedS60Version == -1) + symbianInitVersions(); + + return cachedS60Version; +} +#endif // ifdef Q_OS_SYMBIAN + +/*! + \macro void Q_ASSERT(bool test) + \relates + + Prints a warning message containing the source code file name and + line number if \a test is false. + + Q_ASSERT() is useful for testing pre- and post-conditions + during development. It does nothing if \c QT_NO_DEBUG was defined + during compilation. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 17 + + If \c b is zero, the Q_ASSERT statement will output the following + message using the qFatal() function: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 18 + + \sa Q_ASSERT_X(), qFatal(), {Debugging Techniques} +*/ + +/*! + \macro void Q_ASSERT_X(bool test, const char *where, const char *what) + \relates + + Prints the message \a what together with the location \a where, + the source file name and line number if \a test is false. + + Q_ASSERT_X is useful for testing pre- and post-conditions during + development. It does nothing if \c QT_NO_DEBUG was defined during + compilation. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 19 + + If \c b is zero, the Q_ASSERT_X statement will output the following + message using the qFatal() function: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 20 + + \sa Q_ASSERT(), qFatal(), {Debugging Techniques} +*/ + +/*! + \macro void Q_CHECK_PTR(void *pointer) + \relates + + If \a pointer is 0, prints a warning message containing the source + code's file name and line number, saying that the program ran out + of memory. + + Q_CHECK_PTR does nothing if \c QT_NO_DEBUG was defined during + compilation. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 21 + + \sa qWarning(), {Debugging Techniques} +*/ + +/*! + \fn T *q_check_ptr(T *pointer) + \relates + + Users Q_CHECK_PTR on \a pointer, then returns \a pointer. + + This can be used as an inline version of Q_CHECK_PTR. +*/ + +/*! + \macro const char* Q_FUNC_INFO() + \relates + + Expands to a string that describe the function the macro resides in. How this string looks + more specifically is compiler dependent. With GNU GCC it is typically the function signature, + while with other compilers it might be the line and column number. + + Q_FUNC_INFO can be conveniently used with qDebug(). For example, this function: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 22 + + when instantiated with the integer type, will with the GCC compiler produce: + + \tt{const TInputType& myMin(const TInputType&, const TInputType&) [with TInputType = int] was called with value1: 3 value2: 4} + + If this macro is used outside a function, the behavior is undefined. + */ + +/* + The Q_CHECK_PTR macro calls this function if an allocation check + fails. +*/ +void qt_check_pointer(const char *n, int l) +{ + qFatal("In file %s, line %d: Out of memory", n, l); +} + +/* \internal + Allows you to throw an exception without including + 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. +*/ +void qt_assert(const char *assertion, const char *file, int line) +{ + qFatal("ASSERT: \"%s\" in file %s, line %d", assertion, file, line); +} + +/* + The Q_ASSERT_X macro calls this function when the test fails. +*/ +void qt_assert_x(const char *where, const char *what, const char *file, int line) +{ + qFatal("ASSERT failure in %s: \"%s\", file %s, line %d", where, what, file, line); +} + + +/* + Dijkstra's bisection algorithm to find the square root of an integer. + Deliberately not exported as part of the Qt API, but used in both + qsimplerichtext.cpp and qgfxraster_qws.cpp +*/ +Q_CORE_EXPORT unsigned int qt_int_sqrt(unsigned int n) +{ + // n must be in the range 0...UINT_MAX/2-1 + if (n >= (UINT_MAX>>2)) { + unsigned int r = 2 * qt_int_sqrt(n / 4); + unsigned int r2 = r + 1; + return (n >= r2 * r2) ? r2 : r; + } + uint h, p= 0, q= 1, r= n; + while (q <= n) + q <<= 2; + while (q != 1) { + q >>= 2; + h= p + q; + p >>= 1; + if (r >= h) { + p += q; + r -= h; + } + } + return p; +} + +#if defined(qMemCopy) +# undef qMemCopy +#endif +#if defined(qMemSet) +# undef qMemSet +#endif + +void *qMemCopy(void *dest, const void *src, size_t n) { return memcpy(dest, src, n); } +void *qMemSet(void *dest, int c, size_t n) { return memset(dest, c, n); } + +static QtMsgHandler handler = 0; // pointer to debug handler + +#if defined(Q_CC_MWERKS) && defined(Q_OS_MACX) +extern bool qt_is_gui_used; +static void mac_default_handler(const char *msg) +{ + if (qt_is_gui_used) { + Str255 pmsg; + qt_mac_to_pascal_string(msg, pmsg); + DebugStr(pmsg); + } else { + fprintf(stderr, msg); + } +} +#endif // Q_CC_MWERKS && Q_OS_MACX + +#if !defined(Q_OS_WIN) && !defined(QT_NO_THREAD) && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_QNX) && \ + defined(_POSIX_THREAD_SAFE_FUNCTIONS) && _POSIX_VERSION >= 200112L +namespace { + // There are two incompatible versions of strerror_r: + // a) the XSI/POSIX.1 version, which returns an int, + // indicating success or not + // b) the GNU version, which returns a char*, which may or may not + // be the beginning of the buffer we used + // The GNU libc manpage for strerror_r says you should use the the XSI + // version in portable code. However, it's impossible to do that if + // _GNU_SOURCE is defined so we use C++ overloading to decide what to do + // depending on the return type + static inline QString fromstrerror_helper(int, const QByteArray &buf) + { + return QString::fromLocal8Bit(buf); + } + static inline QString fromstrerror_helper(const char *str, const QByteArray &) + { + return QString::fromLocal8Bit(str); + } +} +#endif + +QString qt_error_string(int errorCode) +{ + const char *s = 0; + QString ret; + if (errorCode == -1) { +#if defined(Q_OS_WIN) + errorCode = GetLastError(); +#else + errorCode = errno; +#endif + } + switch (errorCode) { + case 0: + break; + case EACCES: + s = QT_TRANSLATE_NOOP("QIODevice", "Permission denied"); + break; + case EMFILE: + s = QT_TRANSLATE_NOOP("QIODevice", "Too many open files"); + break; + case ENOENT: + s = QT_TRANSLATE_NOOP("QIODevice", "No such file or directory"); + break; + case ENOSPC: + s = QT_TRANSLATE_NOOP("QIODevice", "No space left on device"); + break; + default: { +#ifdef Q_OS_WIN + wchar_t *string = 0; + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + errorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPWSTR)&string, + 0, + NULL); + ret = QString::fromWCharArray(string); + LocalFree((HLOCAL)string); + + if (ret.isEmpty() && errorCode == ERROR_MOD_NOT_FOUND) + ret = QString::fromLatin1("The specified module could not be found."); +#elif !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && _POSIX_VERSION >= 200112L && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_QNX) + QByteArray buf(1024, '\0'); + ret = fromstrerror_helper(strerror_r(errorCode, buf.data(), buf.size()), buf); +#else + ret = QString::fromLocal8Bit(strerror(errorCode)); +#endif + break; } + } + if (s) + // ######## this breaks moc build currently +// ret = QCoreApplication::translate("QIODevice", s); + ret = QString::fromLatin1(s); + return ret.trimmed(); +} + + +/*! + \fn QtMsgHandler qInstallMsgHandler(QtMsgHandler handler) + \relates + + Installs a Qt message \a handler which has been defined + previously. Returns a pointer to the previous message handler + (which may be 0). + + The message handler is a function that prints out debug messages, + warnings, critical and fatal error messages. The Qt library (debug + mode) contains hundreds of warning messages that are printed + when internal errors (usually invalid function arguments) + occur. Qt built in release mode also contains such warnings unless + QT_NO_WARNING_OUTPUT and/or QT_NO_DEBUG_OUTPUT have been set during + compilation. If you implement your own message handler, you get total + control of these messages. + + The default message handler prints the message to the standard + output under X11 or to the debugger under Windows. If it is a + fatal message, the application aborts immediately. + + Only one message handler can be defined, since this is usually + done on an application-wide basis to control debug output. + + To restore the message handler, call \c qInstallMsgHandler(0). + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 23 + + \sa qDebug(), qWarning(), qCritical(), qFatal(), QtMsgType, + {Debugging Techniques} +*/ +#if defined(Q_OS_WIN) && defined(QT_BUILD_CORE_LIB) +extern bool usingWinMain; +extern Q_CORE_EXPORT void qWinMsgHandler(QtMsgType t, const char* str); +#endif + +QtMsgHandler qInstallMsgHandler(QtMsgHandler h) +{ + QtMsgHandler old = handler; + handler = h; +#if defined(Q_OS_WIN) && defined(QT_BUILD_CORE_LIB) + if (!handler && usingWinMain) + handler = qWinMsgHandler; +#endif + return old; +} + +/*! + \internal +*/ +void qt_message_output(QtMsgType msgType, const char *buf) +{ + if (handler) { + (*handler)(msgType, buf); + } else { +#if defined(Q_CC_MWERKS) && defined(Q_OS_MACX) + mac_default_handler(buf); +#elif defined(Q_OS_WINCE) + QString fstr = QString::fromLatin1(buf); + fstr += QLatin1Char('\n'); + OutputDebugString(reinterpret_cast (fstr.utf16())); +#elif defined(Q_OS_SYMBIAN) + // RDebug::Print has a cap of 256 characters so break it up + _LIT(format, "[Qt Message] %S"); + const int maxBlockSize = 256 - ((const TDesC &)format).Length(); + const TPtrC8 ptr(reinterpret_cast(buf)); + HBufC* hbuffer = HBufC::New(qMin(maxBlockSize, ptr.Length())); + Q_CHECK_PTR(hbuffer); + for (int i = 0; i < ptr.Length(); i += hbuffer->Length()) { + hbuffer->Des().Copy(ptr.Mid(i, qMin(maxBlockSize, ptr.Length()-i))); + RDebug::Print(format, hbuffer); + } + delete hbuffer; +#else + fprintf(stderr, "%s\n", buf); + fflush(stderr); +#endif + } + + if (msgType == QtFatalMsg + || (msgType == QtWarningMsg + && (!qgetenv("QT_FATAL_WARNINGS").isNull())) ) { + +#if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR) + // get the current report mode + int reportMode = _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_WNDW); + _CrtSetReportMode(_CRT_ERROR, reportMode); +#if !defined(Q_OS_WINCE) + int ret = _CrtDbgReport(_CRT_ERROR, __FILE__, __LINE__, QT_VERSION_STR, buf); +#else + int ret = _CrtDbgReportW(_CRT_ERROR, _CRT_WIDE(__FILE__), + __LINE__, _CRT_WIDE(QT_VERSION_STR), reinterpret_cast (QString::fromLatin1(buf).utf16())); +#endif + if (ret == 0 && reportMode & _CRTDBG_MODE_WNDW) + return; // ignore + else if (ret == 1) + _CrtDbgBreak(); +#endif + +#if defined(Q_OS_SYMBIAN) + __DEBUGGER(); // on the emulator, get the debugger to kick in if there's one around + TBuf<256> tmp; + TPtrC8 ptr(reinterpret_cast(buf)); + TInt len = Min(tmp.MaxLength(), ptr.Length()); + tmp.Copy(ptr.Left(len)); + // Panic the current thread. We don't use real panic codes, so 0 has no special meaning. + User::Panic(tmp, 0); +#elif (defined(Q_OS_UNIX) || defined(Q_CC_MINGW)) + abort(); // trap; generates core dump +#else + exit(1); // goodbye cruel world +#endif + } +} + +#if !defined(QT_NO_EXCEPTIONS) +/*! + \internal + Uses a local buffer to output the message. Not locale safe + cuts off + everything after character 255, 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 + + Calls the message handler with the debug message \a msg. If no + message handler has been installed, the message is printed to + stderr. Under Windows, the message is sent to the console, if it is a + console application; otherwise, it is sent to the debugger. This + function does nothing if \c QT_NO_DEBUG_OUTPUT was defined + during compilation. + + If you pass the function a format string and a list of arguments, + it works in similar way to the C printf() function. The format + should be a Latin-1 string. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 24 + + If you include \c , a more convenient syntax is also + available: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 25 + + With this syntax, the function returns a QDebug object that is + configured to use the QtDebugMsg message type. It automatically + puts a single space between each item, and outputs a newline at + the end. It supports many C++ and Qt types. + + To suppress the output at run-time, install your own message handler + with qInstallMsgHandler(). + + \sa qWarning(), qCritical(), qFatal(), qInstallMsgHandler(), + {Debugging Techniques} +*/ +void qDebug(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); // use variable arg list + qt_message(QtDebugMsg, msg, ap); + va_end(ap); +} + +#undef qWarning +/*! + \relates + + Calls the message handler with the warning message \a msg. If no + message handler has been installed, the message is printed to + stderr. Under Windows, the message is sent to the debugger. This + function does nothing if \c QT_NO_WARNING_OUTPUT was defined + during compilation; it exits if the environment variable \c + QT_FATAL_WARNINGS is defined. + + This function takes a format string and a list of arguments, + similar to the C printf() function. The format should be a Latin-1 + string. + + Example: + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 26 + + If you include , a more convenient syntax is + also available: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 27 + + This syntax inserts a space between each item, and + appends a newline at the end. + + To suppress the output at runtime, install your own message handler + with qInstallMsgHandler(). + + \sa qDebug(), qCritical(), qFatal(), qInstallMsgHandler(), + {Debugging Techniques} +*/ +void qWarning(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); // use variable arg list + qt_message(QtWarningMsg, msg, ap); + va_end(ap); +} + +/*! + \relates + + Calls the message handler with the critical message \a msg. If no + message handler has been installed, the message is printed to + stderr. Under Windows, the message is sent to the debugger. + + This function takes a format string and a list of arguments, + similar to the C printf() function. The format should be a Latin-1 + string. + + Example: + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 28 + + If you include , a more convenient syntax is + also available: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 29 + + A space is inserted between the items, and a newline is + appended at the end. + + To suppress the output at runtime, install your own message handler + with qInstallMsgHandler(). + + \sa qDebug(), qWarning(), qFatal(), qInstallMsgHandler(), + {Debugging Techniques} +*/ +void qCritical(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); // use variable arg list + qt_message(QtCriticalMsg, msg, ap); + va_end(ap); +} + +#ifdef QT3_SUPPORT +void qSystemWarning(const char *msg, int code) + { qCritical("%s (%s)", msg, qt_error_string(code).toLocal8Bit().constData()); } +#endif // QT3_SUPPORT + +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); + if (msg) + buf.vsprintf(msg, ap); + va_end(ap); + + qCritical("%s (%s)", buf.toLocal8Bit().constData(), qt_error_string(-1).toLocal8Bit().constData()); +} + +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); + if (msg) + buf.vsprintf(msg, ap); + va_end(ap); + + qCritical("%s (%s)", buf.toLocal8Bit().constData(), qt_error_string(code).toLocal8Bit().constData()); +} + +/*! + \relates + + Calls the message handler with the fatal message \a msg. If no + message handler has been installed, the message is printed to + stderr. Under Windows, the message is sent to the debugger. + + If you are using the \bold{default message handler} this function will + abort on Unix systems to create a core dump. On Windows, for debug builds, + this function will report a _CRT_ERROR enabling you to connect a debugger + to the application. + + This function takes a format string and a list of arguments, + similar to the C printf() function. + + Example: + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 30 + + To suppress the output at runtime, install your own message handler + with qInstallMsgHandler(). + + \sa qDebug(), qCritical(), qWarning(), qInstallMsgHandler(), + {Debugging Techniques} +*/ +void qFatal(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); // use variable arg list + qt_message(QtFatalMsg, msg, ap); + va_end(ap); +} + +// getenv is declared as deprecated in VS2005. This function +// makes use of the new secure getenv function. +/*! + \relates + + Returns the value of the environment variable with name \a + varName. To get the variable string, use QByteArray::constData(). + + \note qgetenv() was introduced because getenv() from the standard + C library was deprecated in VC2005 (and later versions). qgetenv() + uses the new replacement function in VC, and calls the standard C + library's implementation on all other platforms. + + \sa qputenv() +*/ +QByteArray qgetenv(const char *varName) +{ +#if defined(_MSC_VER) && _MSC_VER >= 1400 + size_t requiredSize = 0; + QByteArray buffer; + getenv_s(&requiredSize, 0, 0, varName); + if (requiredSize == 0) + return buffer; + buffer.resize(int(requiredSize)); + getenv_s(&requiredSize, buffer.data(), requiredSize, varName); + // requiredSize includes the terminating null, which we don't want. + Q_ASSERT(buffer.endsWith('\0')); + buffer.chop(1); + return buffer; +#else + return QByteArray(::getenv(varName)); +#endif +} + +/*! + \relates + + This function sets the \a value of the environment variable named + \a varName. It will create the variable if it does not exist. It + returns 0 if the variable could not be set. + + \note qputenv() was introduced because putenv() from the standard + C library was deprecated in VC2005 (and later versions). qputenv() + uses the replacement function in VC, and calls the standard C + library's implementation on all other platforms. + + \sa qgetenv() +*/ +bool qputenv(const char *varName, const QByteArray& value) +{ +#if defined(_MSC_VER) && _MSC_VER >= 1400 + return _putenv_s(varName, value.constData()) == 0; +#else + QByteArray buffer(varName); + buffer += '='; + buffer += value; + char* envVar = qstrdup(buffer.constData()); + int result = putenv(envVar); + if (result != 0) // error. we have to delete the string. + delete[] envVar; + return result == 0; +#endif +} + +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_THREAD) + +# if defined(Q_OS_INTEGRITY) && defined(__GHS_VERSION_NUMBER) && (__GHS_VERSION_NUMBER < 500) +// older versions of INTEGRITY used a long instead of a uint for the seed. +typedef long SeedStorageType; +# else +typedef uint SeedStorageType; +# endif + +typedef QThreadStorage SeedStorage; +Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value + +#endif + +/*! + \relates + \since 4.2 + + Thread-safe version of the standard C++ \c srand() function. + + Sets the argument \a seed to be used to generate a new random number sequence of + pseudo random integers to be returned by qrand(). + + The sequence of random numbers generated is deterministic per thread. For example, + if two threads call qsrand(1) and subsequently calls qrand(), the threads will get + the same random number sequence. + + \sa qrand() +*/ +void qsrand(uint seed) +{ +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_THREAD) + SeedStorage *seedStorage = randTLS(); + if (seedStorage) { + SeedStorageType *pseed = seedStorage->localData(); + if (!pseed) + seedStorage->setLocalData(pseed = new SeedStorageType); + *pseed = seed; + } else { + //global static seed storage should always exist, + //except after being deleted by QGlobalStaticDeleter. + //But since it still can be called from destructor of another + //global static object, fallback to srand(seed) + srand(seed); + } +#else + // On Windows and Symbian srand() and rand() already use Thread-Local-Storage + // to store the seed between calls + // this is also valid for QT_NO_THREAD + srand(seed); +#endif +} + +/*! + \relates + \since 4.2 + + Thread-safe version of the standard C++ \c rand() function. + + Returns a value between 0 and \c RAND_MAX (defined in \c and + \c ), the next number in the current sequence of pseudo-random + integers. + + Use \c qsrand() to initialize the pseudo-random number generator with + a seed value. + + \sa qsrand() +*/ +int qrand() +{ +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_THREAD) + SeedStorage *seedStorage = randTLS(); + if (seedStorage) { + SeedStorageType *pseed = seedStorage->localData(); + if (!pseed) { + seedStorage->setLocalData(pseed = new SeedStorageType); + *pseed = 1; + } + return rand_r(pseed); + } else { + //global static seed storage should always exist, + //except after being deleted by QGlobalStaticDeleter. + //But since it still can be called from destructor of another + //global static object, fallback to rand() + return rand(); + } +#else + // On Windows and Symbian srand() and rand() already use Thread-Local-Storage + // to store the seed between calls + // this is also valid for QT_NO_THREAD + return rand(); +#endif +} + +/*! + \macro forever + \relates + + This macro is provided for convenience for writing infinite + loops. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 31 + + It is equivalent to \c{for (;;)}. + + If you're worried about namespace pollution, you can disable this + macro by adding the following line to your \c .pro file: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 32 + + \sa Q_FOREVER +*/ + +/*! + \macro Q_FOREVER + \relates + + Same as \l{forever}. + + This macro is available even when \c no_keywords is specified + using the \c .pro file's \c CONFIG variable. + + \sa foreach() +*/ + +/*! + \macro foreach(variable, container) + \relates + + This macro is used to implement Qt's \c foreach loop. The \a + variable parameter is a variable name or variable definition; the + \a container parameter is a Qt container whose value type + corresponds to the type of the variable. See \l{The foreach + Keyword} for details. + + If you're worried about namespace pollution, you can disable this + macro by adding the following line to your \c .pro file: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 33 + + \sa Q_FOREACH() +*/ + +/*! + \macro Q_FOREACH(variable, container) + \relates + + Same as foreach(\a variable, \a container). + + This macro is available even when \c no_keywords is specified + using the \c .pro file's \c CONFIG variable. + + \sa foreach() +*/ + +/*! + \macro QT_TR_NOOP(sourceText) + \relates + + Marks the string literal \a sourceText for dynamic translation in + the current context (class), i.e the stored \a sourceText will not + be altered. + + The macro expands to \a sourceText. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 34 + + The macro QT_TR_NOOP_UTF8() is identical except that it tells lupdate + that the source string is encoded in UTF-8. Corresponding variants + exist in the QT_TRANSLATE_NOOP() family of macros, too. Note that + using these macros is not required if \c CODECFORTR is already set to + UTF-8 in the qmake project file. + + \sa QT_TRANSLATE_NOOP(), {Internationalization with Qt} +*/ + +/*! + \macro QT_TRANSLATE_NOOP(context, sourceText) + \relates + + Marks the string literal \a sourceText for dynamic translation in + the given \a context; i.e, the stored \a sourceText will not be + altered. The \a context is typically a class and also needs to + be specified as string literal. + + The macro expands to \a sourceText. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 35 + + \sa QT_TR_NOOP(), QT_TRANSLATE_NOOP3(), {Internationalization with Qt} +*/ + +/*! + \macro QT_TRANSLATE_NOOP3(context, sourceText, comment) + \relates + \since 4.4 + + Marks the string literal \a sourceText for dynamic translation in the + given \a context and with \a comment, i.e the stored \a sourceText will + not be altered. The \a context is typically a class and also needs to + be specified as string literal. The string literal \a comment + will be available for translators using e.g. Qt Linguist. + + The macro expands to anonymous struct of the two string + literals passed as \a sourceText and \a comment. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 36 + + \sa QT_TR_NOOP(), QT_TRANSLATE_NOOP(), {Internationalization with Qt} +*/ + +/*! + \fn QString qtTrId(const char *id, int n = -1) + \relates + \reentrant + \since 4.6 + + \brief The qtTrId function finds and returns a translated string. + + Returns a translated string identified by \a id. + If no matching string is found, the id itself is returned. This + should not happen under normal conditions. + + If \a n >= 0, all occurrences of \c %n in the resulting string + are replaced with a decimal representation of \a n. In addition, + depending on \a n's value, the translation text may vary. + + Meta data and comments can be passed as documented for QObject::tr(). + In addition, it is possible to supply a source string template like that: + + \tt{//% } + + or + + \tt{\begincomment% \endcomment} + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp qttrid + + Creating QM files suitable for use with this function requires passing + the \c -idbased option to the \c lrelease tool. + + \warning This method is reentrant only if all translators are + installed \e before calling this method. Installing or removing + translators while performing translations is not supported. Doing + so will probably result in crashes or other undesirable behavior. + + \sa QObject::tr(), QCoreApplication::translate(), {Internationalization with Qt} +*/ + +/*! + \macro QT_TRID_NOOP(id) + \relates + \since 4.6 + + \brief The QT_TRID_NOOP macro marks an id for dynamic translation. + + The only purpose of this macro is to provide an anchor for attaching + meta data like to qtTrId(). + + The macro expands to \a id. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp qttrid_noop + + \sa qtTrId(), {Internationalization with Qt} +*/ + +/*! + \macro Q_LIKELY(expr) + \relates + \since 4.8 + + \brief Hints the compiler that the enclosed condition is likely to evaluate + to \c true. + + Use of this macro can help the compiler to optimize the code. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp qlikely + + \sa Q_UNLIKELY() +*/ + +/*! + \macro Q_UNLIKELY(expr) + \relates + \since 4.8 + + \brief Hints the compiler that the enclosed condition is likely to evaluate + to \c false. + + Use of this macro can help the compiler to optimize the code. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp qunlikely + + \sa Q_LIKELY() +*/ + +/*! + \macro QT_POINTER_SIZE + \relates + + Expands to the size of a pointer in bytes (4 or 8). This is + equivalent to \c sizeof(void *) but can be used in a preprocessor + directive. +*/ + +/*! + \macro TRUE + \relates + \obsolete + + Synonym for \c true. + + \sa FALSE +*/ + +/*! + \macro FALSE + \relates + \obsolete + + Synonym for \c false. + + \sa TRUE +*/ + +/*! + \macro QABS(n) + \relates + \obsolete + + Use qAbs(\a n) instead. + + \sa QMIN(), QMAX() +*/ + +/*! + \macro QMIN(x, y) + \relates + \obsolete + + Use qMin(\a x, \a y) instead. + + \sa QMAX(), QABS() +*/ + +/*! + \macro QMAX(x, y) + \relates + \obsolete + + Use qMax(\a x, \a y) instead. + + \sa QMIN(), QABS() +*/ + +/*! + \macro const char *qPrintable(const QString &str) + \relates + + Returns \a str as a \c{const char *}. This is equivalent to + \a{str}.toLocal8Bit().constData(). + + The char pointer will be invalid after the statement in which + qPrintable() is used. This is because the array returned by + toLocal8Bit() will fall out of scope. + + Example: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 37 + + + \sa qDebug(), qWarning(), qCritical(), qFatal() +*/ + +/*! + \macro Q_DECLARE_TYPEINFO(Type, Flags) + \relates + + You can use this macro to specify information about a custom type + \a Type. With accurate type information, Qt's \l{Container Classes} + {generic containers} can choose appropriate storage methods and + algorithms. + + \a Flags can be one of the following: + + \list + \o \c Q_PRIMITIVE_TYPE specifies that \a Type is a POD (plain old + data) type with no constructor or destructor. + \o \c Q_MOVABLE_TYPE specifies that \a Type has a constructor + and/or a destructor but can be moved in memory using \c + memcpy(). + \o \c Q_COMPLEX_TYPE (the default) specifies that \a Type has + constructors and/or a destructor and that it may not be moved + in memory. + \endlist + + Example of a "primitive" type: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 38 + + Example of a movable type: + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 39 +*/ + +/*! + \macro Q_UNUSED(name) + \relates + + Indicates to the compiler that the parameter with the specified + \a name is not used in the body of a function. This can be used to + suppress compiler warnings while allowing functions to be defined + with meaningful parameter names in their signatures. +*/ + +#if defined(QT3_SUPPORT) && !defined(QT_NO_SETTINGS) +QT_BEGIN_INCLUDE_NAMESPACE +#include +QT_END_INCLUDE_NAMESPACE + +static const char *qInstallLocation(QLibraryInfo::LibraryLocation loc) +{ + static QByteArray ret; + ret = QLibraryInfo::location(loc).toLatin1(); + return ret.constData(); +} +const char *qInstallPath() +{ + return qInstallLocation(QLibraryInfo::PrefixPath); +} +const char *qInstallPathDocs() +{ + return qInstallLocation(QLibraryInfo::DocumentationPath); +} +const char *qInstallPathHeaders() +{ + return qInstallLocation(QLibraryInfo::HeadersPath); +} +const char *qInstallPathLibs() +{ + return qInstallLocation(QLibraryInfo::LibrariesPath); +} +const char *qInstallPathBins() +{ + return qInstallLocation(QLibraryInfo::BinariesPath); +} +const char *qInstallPathPlugins() +{ + return qInstallLocation(QLibraryInfo::PluginsPath); +} +const char *qInstallPathData() +{ + return qInstallLocation(QLibraryInfo::DataPath); +} +const char *qInstallPathTranslations() +{ + return qInstallLocation(QLibraryInfo::TranslationsPath); +} +const char *qInstallPathSysconf() +{ + return qInstallLocation(QLibraryInfo::SettingsPath); +} +#endif + +struct QInternal_CallBackTable { + QVector > callbacks; +}; + +Q_GLOBAL_STATIC(QInternal_CallBackTable, global_callback_table) + +bool QInternal::registerCallback(Callback cb, qInternalCallback callback) +{ + if (cb >= 0 && cb < QInternal::LastCallback) { + QInternal_CallBackTable *cbt = global_callback_table(); + cbt->callbacks.resize(cb + 1); + cbt->callbacks[cb].append(callback); + return true; + } + return false; +} + +bool QInternal::unregisterCallback(Callback cb, qInternalCallback callback) +{ + if (cb >= 0 && cb < QInternal::LastCallback) { + QInternal_CallBackTable *cbt = global_callback_table(); + return (bool) cbt->callbacks[cb].removeAll(callback); + } + return false; +} + +bool QInternal::activateCallbacks(Callback cb, void **parameters) +{ + Q_ASSERT_X(cb >= 0, "QInternal::activateCallback()", "Callback id must be a valid id"); + + QInternal_CallBackTable *cbt = global_callback_table(); + if (cbt && cb < cbt->callbacks.size()) { + QList callbacks = cbt->callbacks[cb]; + bool ret = false; + for (int i=0; i= 0, + "QInternal::callFunction()", "Callback id must be a valid id"); +#ifndef QT_NO_QOBJECT + switch (func) { +#ifndef QT_NO_THREAD + case QInternal::CreateThreadForAdoption: + *args = QAdoptedThread::createThreadForAdoption(); + return true; +#endif + case QInternal::RefAdoptedThread: + QThreadData::get2((QThread *) *args)->ref(); + return true; + case QInternal::DerefAdoptedThread: + QThreadData::get2((QThread *) *args)->deref(); + return true; + case QInternal::SetCurrentThreadToMainThread: + qt_set_current_thread_to_main_thread(); + return true; + case QInternal::SetQObjectSender: { + QObject *receiver = (QObject *) args[0]; + QObjectPrivate::Sender *sender = new QObjectPrivate::Sender; + sender->sender = (QObject *) args[1]; + sender->signal = *(int *) args[2]; + sender->ref = 1; + + // Store the old sender as "return value" + args[3] = QObjectPrivate::setCurrentSender(receiver, sender); + args[4] = sender; + return true; + } + case QInternal::GetQObjectSender: { + QObject *receiver = (QObject *) args[0]; + QObjectPrivate *d = QObjectPrivate::get(receiver); + args[1] = d->currentSender ? d->currentSender->sender : 0; + return true; + } + case QInternal::ResetQObjectSender: { + QObject *receiver = (QObject *) args[0]; + QObjectPrivate::Sender *oldSender = (QObjectPrivate::Sender *) args[1]; + QObjectPrivate::Sender *sender = (QObjectPrivate::Sender *) args[2]; + QObjectPrivate::resetCurrentSender(receiver, sender, oldSender); + delete sender; + return true; + } + + default: + break; + } +#else + Q_UNUSED(args); + Q_UNUSED(func); +#endif + + return false; +} + +/*! + \macro Q_BYTE_ORDER + \relates + + This macro can be used to determine the byte order your system + uses for storing data in memory. i.e., whether your system is + little-endian or big-endian. It is set by Qt to one of the macros + Q_LITTLE_ENDIAN or Q_BIG_ENDIAN. You normally won't need to worry + about endian-ness, but you might, for example if you need to know + which byte of an integer or UTF-16 character is stored in the + lowest address. Endian-ness is important in networking, where + computers with different values for Q_BYTE_ORDER must pass data + back and forth. + + Use this macro as in the following examples. + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 40 + + \sa Q_BIG_ENDIAN, Q_LITTLE_ENDIAN +*/ + +/*! + \macro Q_LITTLE_ENDIAN + \relates + + This macro represents a value you can compare to the macro + Q_BYTE_ORDER to determine the endian-ness of your system. In a + little-endian system, the least significant byte is stored at the + lowest address. The other bytes follow in increasing order of + significance. + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 41 + + \sa Q_BYTE_ORDER, Q_BIG_ENDIAN +*/ + +/*! + \macro Q_BIG_ENDIAN + \relates + + This macro represents a value you can compare to the macro + Q_BYTE_ORDER to determine the endian-ness of your system. In a + big-endian system, the most significant byte is stored at the + lowest address. The other bytes follow in decreasing order of + significance. + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 42 + + \sa Q_BYTE_ORDER, Q_LITTLE_ENDIAN +*/ + +/*! + \macro Q_GLOBAL_STATIC(type, name) + \internal + + Declares a global static variable with the given \a type and \a name. + + Use this macro to instantiate an object in a thread-safe way, creating + a global pointer that can be used to refer to it. + + \warning This macro is subject to a race condition that can cause the object + to be constructed twice. However, if this occurs, the second instance will + be immediately deleted. + + See also + \l{http://www.aristeia.com/publications.html}{"C++ and the perils of Double-Checked Locking"} + by Scott Meyers and Andrei Alexandrescu. +*/ + +/*! + \macro Q_GLOBAL_STATIC_WITH_ARGS(type, name, arguments) + \internal + + Declares a global static variable with the specified \a type and \a name. + + Use this macro to instantiate an object using the \a arguments specified + in a thread-safe way, creating a global pointer that can be used to refer + to it. + + \warning This macro is subject to a race condition that can cause the object + to be constructed twice. However, if this occurs, the second instance will + be immediately deleted. + + See also + \l{http://www.aristeia.com/publications.html}{"C++ and the perils of Double-Checked Locking"} + by Scott Meyers and Andrei Alexandrescu. +*/ + +/*! + \macro QT_NAMESPACE + \internal + + If this macro is defined to \c ns all Qt classes are put in a namespace + called \c ns. Also, moc will output code putting metaobjects etc. + into namespace \c ns. + + \sa QT_BEGIN_NAMESPACE, QT_END_NAMESPACE, + QT_PREPEND_NAMESPACE, QT_USE_NAMESPACE, + QT_BEGIN_INCLUDE_NAMESPACE, QT_END_INCLUDE_NAMESPACE, + QT_BEGIN_MOC_NAMESPACE, QT_END_MOC_NAMESPACE, +*/ + +/*! + \macro QT_PREPEND_NAMESPACE(identifier) + \internal + + This macro qualifies \a identifier with the full namespace. + It expands to \c{::QT_NAMESPACE::identifier} if \c QT_NAMESPACE is defined + and only \a identifier otherwise. + + \sa QT_NAMESPACE +*/ + +/*! + \macro QT_USE_NAMESPACE + \internal + + This macro expands to using QT_NAMESPACE if QT_NAMESPACE is defined + and nothing otherwise. + + \sa QT_NAMESPACE +*/ + +/*! + \macro QT_BEGIN_NAMESPACE + \internal + + This macro expands to + + \snippet snippets/code/src_corelib_global_qglobal.cpp begin namespace macro + + if \c QT_NAMESPACE is defined and nothing otherwise. If should always + appear in the file-level scope and be followed by \c QT_END_NAMESPACE + at the same logical level with respect to preprocessor conditionals + in the same file. + + As a rule of thumb, \c QT_BEGIN_NAMESPACE should appear in all Qt header + and Qt source files after the last \c{#include} line and before the first + declaration. In Qt headers using \c QT_BEGIN_HEADER, \c QT_BEGIN_NAMESPACE + follows \c QT_BEGIN_HEADER immediately. + + If that rule can't be followed because, e.g., \c{#include} lines and + declarations are wildly mixed, place \c QT_BEGIN_NAMESPACE before + the first declaration and wrap the \c{#include} lines in + \c QT_BEGIN_INCLUDE_NAMESPACE and \c QT_END_INCLUDE_NAMESPACE. + + When using the \c QT_NAMESPACE feature in user code + (e.g., when building plugins statically linked to Qt) where + the user code is not intended to go into the \c QT_NAMESPACE + namespace, all forward declarations of Qt classes need to + be wrapped in \c QT_BEGIN_NAMESPACE and \c QT_END_NAMESPACE. + After that, a \c QT_USE_NAMESPACE should follow. + No further changes should be needed. + + \sa QT_NAMESPACE +*/ + +/*! + \macro QT_END_NAMESPACE + \internal + + This macro expands to + + \snippet snippets/code/src_corelib_global_qglobal.cpp end namespace macro + + if \c QT_NAMESPACE is defined and nothing otherwise. It is used to cancel + the effect of \c QT_BEGIN_NAMESPACE. + + If a source file ends with a \c{#include} directive that includes a moc file, + \c QT_END_NAMESPACE should be placed before that \c{#include}. + + \sa QT_NAMESPACE +*/ + +/*! + \macro QT_BEGIN_INCLUDE_NAMESPACE + \internal + + This macro is equivalent to \c QT_END_NAMESPACE. + It only serves as syntactic sugar and is intended + to be used before #include lines within a + \c QT_BEGIN_NAMESPACE ... \c QT_END_NAMESPACE block. + + \sa QT_NAMESPACE +*/ + +/*! + \macro QT_END_INCLUDE_NAMESPACE + \internal + + This macro is equivalent to \c QT_BEGIN_NAMESPACE. + It only serves as syntactic sugar and is intended + to be used after #include lines within a + \c QT_BEGIN_NAMESPACE ... \c QT_END_NAMESPACE block. + + \sa QT_NAMESPACE +*/ + +/*! + \macro QT_BEGIN_MOC_NAMESPACE + \internal + + This macro is output by moc at the beginning of + moc files. It is equivalent to \c QT_USE_NAMESPACE. + + \sa QT_NAMESPACE +*/ + +/*! + \macro QT_END_MOC_NAMESPACE + \internal + + This macro is output by moc at the beginning of + moc files. It expands to nothing. + + \sa QT_NAMESPACE +*/ + +/*! + \fn bool qFuzzyCompare(double p1, double p2) + \relates + \since 4.4 + \threadsafe + + Compares the floating point value \a p1 and \a p2 and + returns \c true if they are considered equal, otherwise \c false. + + Note that comparing values where either \a p1 or \a p2 is 0.0 will not work. + The solution to this is to compare against values greater than or equal to 1.0. + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 46 + + The two numbers are compared in a relative way, where the + exactness is stronger the smaller the numbers are. + */ + +/*! + \fn bool qFuzzyCompare(float p1, float p2) + \relates + \since 4.4 + \threadsafe + + Compares the floating point value \a p1 and \a p2 and + returns \c true if they are considered equal, otherwise \c false. + + The two numbers are compared in a relative way, where the + exactness is stronger the smaller the numbers are. + */ + +/*! + \macro QT_REQUIRE_VERSION(int argc, char **argv, const char *version) + \relates + + This macro can be used to ensure that the application is run + against a recent enough version of Qt. This is especially useful + if your application depends on a specific bug fix introduced in a + bug-fix release (e.g., 4.0.2). + + The \a argc and \a argv parameters are the \c main() function's + \c argc and \c argv parameters. The \a version parameter is a + string literal that specifies which version of Qt the application + requires (e.g., "4.0.2"). + + Example: + + \snippet doc/src/snippets/code/src_gui_dialogs_qmessagebox.cpp 4 +*/ + +/*! + \macro Q_DECL_EXPORT + \relates + + This macro marks a symbol for shared library export (see + \l{sharedlibrary.html}{Creating Shared Libraries}). + + \sa Q_DECL_IMPORT +*/ + +/*! + \macro Q_DECL_IMPORT + \relates + + This macro declares a symbol to be an import from a shared library (see + \l{sharedlibrary.html}{Creating Shared Libraries}). + + \sa Q_DECL_EXPORT +*/ + +#if defined(Q_OS_SYMBIAN) + +#include + +/*! \macro QT_TRAP_THROWING(function) + \relates + \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_TRAP_THROWING(titlePane->SetTextL(captionPtr)); + } + \endcode + + \sa QT_TRYCATCH_ERROR(), QT_TRYCATCH_LEAVING() +*/ + +/*! \macro QT_TRYCATCH_ERROR(error, function) + \relates + \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_TRYCATCH_ERROR(err, name.Set(qt_QString2TPtrC(serverName))); + if (err != KErrNone) + return err; + return iServer.Connect(name); + } + \endcode +} + + \sa QT_TRYCATCH_LEAVING(), QT_TRAP_THROWING() +*/ + +/*! \macro QT_TRYCATCH_LEAVING(function) + \relates + \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_TRYCATCH_LEAVING(m_dispatcher->wakeUpWasCalled()); + } + \endcode + + \sa QT_TRAP_THROWING(), QT_TRYCATCH_ERROR() +*/ + +#include + +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 + \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_symbian_exception2LeaveL(), qt_symbian_exception2Error() +*/ +void qt_symbian_throwIfError(int error) +{ + if (error >= KErrNone) + return; // do nothing - not an exception + switch (error) { + case KErrNoMemory: + throw std::bad_alloc(); + case KErrArgument: + throw std::invalid_argument("from Symbian error"); + case KErrOverflow: + throw std::overflow_error("from Symbian error"); + case KErrUnderflow: + throw std::underflow_error("from Symbian error"); + default: + throw QSymbianLeaveException(error); + } +} + +/*! \relates + \ingroup qts60 + + Convert a caught standard C++ exception \a aThrow to a Symbian leave + + \warning This function is only available on Symbian. + + \sa qt_symbian_throwIfError(), qt_symbian_exception2Error() +*/ +void qt_symbian_exception2LeaveL(const std::exception& aThrow) +{ + User::Leave(qt_symbian_exception2Error(aThrow)); +} + +/*! \relates + \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_symbian_throwIfError(), qt_symbian_exception2LeaveL() +*/ +int qt_symbian_exception2Error(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(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; + qWarning("translation from std exception \"%s\" to %d", aThrow.what(), err); + } + + return err; +} +#endif + +QT_END_NAMESPACE diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h new file mode 100644 index 0000000000..9434eb29f7 --- /dev/null +++ b/src/corelib/global/qglobal.h @@ -0,0 +1,2767 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QGLOBAL_H +#define QGLOBAL_H + +#include + +#define QT_VERSION_STR "4.8.0" +/* + QT_VERSION is (major << 16) + (minor << 8) + patch. +*/ +#define QT_VERSION 0x040800 +/* + can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0)) +*/ +#define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) + +#define QT_PACKAGEDATE_STR "YYYY-MM-DD" + +#define QT_PACKAGE_TAG "" + +#if !defined(QT_BUILD_MOC) +#include +#endif + +#ifdef __cplusplus + +#ifndef QT_NO_STL +#include +#endif + +#ifndef QT_NAMESPACE /* user namespace */ + +# define QT_PREPEND_NAMESPACE(name) ::name +# define QT_USE_NAMESPACE +# define QT_BEGIN_NAMESPACE +# define QT_END_NAMESPACE +# define QT_BEGIN_INCLUDE_NAMESPACE +# define QT_END_INCLUDE_NAMESPACE +# define QT_BEGIN_MOC_NAMESPACE +# define QT_END_MOC_NAMESPACE +# define QT_FORWARD_DECLARE_CLASS(name) class name; +# define QT_FORWARD_DECLARE_STRUCT(name) struct name; +# define QT_MANGLE_NAMESPACE(name) name + +#else /* user namespace */ + +# define QT_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name +# define QT_USE_NAMESPACE using namespace ::QT_NAMESPACE; +# define QT_BEGIN_NAMESPACE namespace QT_NAMESPACE { +# define QT_END_NAMESPACE } +# define QT_BEGIN_INCLUDE_NAMESPACE } +# define QT_END_INCLUDE_NAMESPACE namespace QT_NAMESPACE { +# define QT_BEGIN_MOC_NAMESPACE QT_USE_NAMESPACE +# define QT_END_MOC_NAMESPACE +# define QT_FORWARD_DECLARE_CLASS(name) \ + QT_BEGIN_NAMESPACE class name; QT_END_NAMESPACE \ + using QT_PREPEND_NAMESPACE(name); + +# define QT_FORWARD_DECLARE_STRUCT(name) \ + QT_BEGIN_NAMESPACE struct name; QT_END_NAMESPACE \ + using QT_PREPEND_NAMESPACE(name); + +# define QT_MANGLE_NAMESPACE0(x) x +# define QT_MANGLE_NAMESPACE1(a, b) a##_##b +# define QT_MANGLE_NAMESPACE2(a, b) QT_MANGLE_NAMESPACE1(a,b) +# define QT_MANGLE_NAMESPACE(name) QT_MANGLE_NAMESPACE2( \ + QT_MANGLE_NAMESPACE0(name), QT_MANGLE_NAMESPACE0(QT_NAMESPACE)) + +namespace QT_NAMESPACE {} + +# ifndef QT_BOOTSTRAPPED +# ifndef QT_NO_USING_NAMESPACE + /* + This expands to a "using QT_NAMESPACE" also in _header files_. + It is the only way the feature can be used without too much + pain, but if people _really_ do not want it they can add + DEFINES += QT_NO_USING_NAMESPACE to their .pro files. + */ + QT_USE_NAMESPACE +# endif +# endif + +#endif /* user namespace */ + +#else /* __cplusplus */ + +# define QT_BEGIN_NAMESPACE +# define QT_END_NAMESPACE +# define QT_USE_NAMESPACE +# define QT_BEGIN_INCLUDE_NAMESPACE +# define QT_END_INCLUDE_NAMESPACE + +#endif /* __cplusplus */ + +#if defined(Q_OS_MAC) && !defined(Q_CC_INTEL) +#define QT_BEGIN_HEADER extern "C++" { +#define QT_END_HEADER } +#define QT_BEGIN_INCLUDE_HEADER } +#define QT_END_INCLUDE_HEADER extern "C++" { +#else +#define QT_BEGIN_HEADER +#define QT_END_HEADER +#define QT_BEGIN_INCLUDE_HEADER +#define QT_END_INCLUDE_HEADER extern "C++" +#endif + +/* + The operating system, must be one of: (Q_OS_x) + + DARWIN - Darwin OS (synonym for Q_OS_MAC) + SYMBIAN - Symbian + MSDOS - MS-DOS and Windows + OS2 - OS/2 + OS2EMX - XFree86 on OS/2 (not PM) + WIN32 - Win32 (Windows 2000/XP/Vista/7 and Windows Server 2003/2008) + WINCE - WinCE (Windows CE 5.0) + CYGWIN - Cygwin + SOLARIS - Sun Solaris + HPUX - HP-UX + ULTRIX - DEC Ultrix + LINUX - Linux + FREEBSD - FreeBSD + NETBSD - NetBSD + OPENBSD - OpenBSD + BSDI - BSD/OS + IRIX - SGI Irix + OSF - HP Tru64 UNIX + SCO - SCO OpenServer 5 + UNIXWARE - UnixWare 7, Open UNIX 8 + AIX - AIX + HURD - GNU Hurd + DGUX - DG/UX + RELIANT - Reliant UNIX + DYNIX - DYNIX/ptx + QNX - QNX + QNX6 - QNX RTP 6.1 + LYNX - LynxOS + BSD4 - Any BSD 4.4 system + UNIX - Any UNIX BSD/SYSV system +*/ + +#if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__)) +# define Q_OS_DARWIN +# define Q_OS_BSD4 +# ifdef __LP64__ +# define Q_OS_DARWIN64 +# else +# define Q_OS_DARWIN32 +# endif +#elif defined(__SYMBIAN32__) || defined(SYMBIAN) +# define Q_OS_SYMBIAN +# define Q_NO_POSIX_SIGNALS +# define QT_NO_GETIFADDRS +#elif defined(__CYGWIN__) +# define Q_OS_CYGWIN +#elif defined(MSDOS) || defined(_MSDOS) +# define Q_OS_MSDOS +#elif defined(__OS2__) +# if defined(__EMX__) +# define Q_OS_OS2EMX +# else +# define Q_OS_OS2 +# endif +#elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) +# define Q_OS_WIN32 +# define Q_OS_WIN64 +#elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) +# if defined(WINCE) || defined(_WIN32_WCE) +# define Q_OS_WINCE +# else +# define Q_OS_WIN32 +# endif +#elif defined(__MWERKS__) && defined(__INTEL__) +# define Q_OS_WIN32 +#elif defined(__sun) || defined(sun) +# define Q_OS_SOLARIS +#elif defined(hpux) || defined(__hpux) +# define Q_OS_HPUX +#elif defined(__ultrix) || defined(ultrix) +# define Q_OS_ULTRIX +#elif defined(sinix) +# define Q_OS_RELIANT +#elif defined(__native_client__) +# define Q_OS_NACL +#elif defined(__linux__) || defined(__linux) +# define Q_OS_LINUX +#elif defined(__FreeBSD__) || defined(__DragonFly__) +# define Q_OS_FREEBSD +# define Q_OS_BSD4 +#elif defined(__NetBSD__) +# define Q_OS_NETBSD +# define Q_OS_BSD4 +#elif defined(__OpenBSD__) +# define Q_OS_OPENBSD +# define Q_OS_BSD4 +#elif defined(__bsdi__) +# define Q_OS_BSDI +# define Q_OS_BSD4 +#elif defined(__sgi) +# define Q_OS_IRIX +#elif defined(__osf__) +# define Q_OS_OSF +#elif defined(_AIX) +# define Q_OS_AIX +#elif defined(__Lynx__) +# define Q_OS_LYNX +#elif defined(__GNU__) +# define Q_OS_HURD +#elif defined(__DGUX__) +# define Q_OS_DGUX +#elif defined(__QNXNTO__) +# define Q_OS_QNX +#elif defined(_SEQUENT_) +# define Q_OS_DYNIX +#elif defined(_SCO_DS) /* SCO OpenServer 5 + GCC */ +# define Q_OS_SCO +#elif defined(__USLC__) /* all SCO platforms + UDK or OUDK */ +# define Q_OS_UNIXWARE +#elif defined(__svr4__) && defined(i386) /* Open UNIX 8 + GCC */ +# define Q_OS_UNIXWARE +#elif defined(__INTEGRITY) +# define Q_OS_INTEGRITY +#elif defined(VXWORKS) /* there is no "real" VxWorks define - this has to be set in the mkspec! */ +# define Q_OS_VXWORKS +#elif defined(__MAKEDEPEND__) +#else +# error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com" +#endif + +#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) || defined(Q_OS_WINCE) +# define Q_OS_WIN +#endif + +#if defined(Q_OS_DARWIN) +# define Q_OS_MAC /* Q_OS_MAC is mostly for compatibility, but also more clear */ +# define Q_OS_MACX /* Q_OS_MACX is only for compatibility.*/ +# if defined(Q_OS_DARWIN64) +# define Q_OS_MAC64 +# elif defined(Q_OS_DARWIN32) +# define Q_OS_MAC32 +# endif +#endif + +#ifdef QT_AUTODETECT_COCOA +# ifdef Q_OS_MAC64 +# define QT_MAC_USE_COCOA 1 +# define QT_BUILD_KEY QT_BUILD_KEY_COCOA +# else +# define QT_BUILD_KEY QT_BUILD_KEY_CARBON +# endif +#endif + +#if defined(Q_WS_MAC64) && !defined(QT_MAC_USE_COCOA) && !defined(QT_BUILD_QMAKE) && !defined(QT_BOOTSTRAPPED) +#error "You are building a 64-bit application, but using a 32-bit version of Qt. Check your build configuration." +#endif + +#if defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN) +# undef Q_OS_UNIX +#elif !defined(Q_OS_UNIX) +# define Q_OS_UNIX +#endif + +#if defined(Q_OS_DARWIN) && !defined(QT_LARGEFILE_SUPPORT) +# define QT_LARGEFILE_SUPPORT 64 +#endif + +#ifdef Q_OS_DARWIN +# ifdef MAC_OS_X_VERSION_MIN_REQUIRED +# undef MAC_OS_X_VERSION_MIN_REQUIRED +# endif +# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4 +# include +# if !defined(MAC_OS_X_VERSION_10_3) +# define MAC_OS_X_VERSION_10_3 MAC_OS_X_VERSION_10_2 + 1 +# endif +# if !defined(MAC_OS_X_VERSION_10_4) +# define MAC_OS_X_VERSION_10_4 MAC_OS_X_VERSION_10_3 + 1 +# endif +# if !defined(MAC_OS_X_VERSION_10_5) +# define MAC_OS_X_VERSION_10_5 MAC_OS_X_VERSION_10_4 + 1 +# endif +# if !defined(MAC_OS_X_VERSION_10_6) +# define MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_5 + 1 +# endif +# if !defined(MAC_OS_X_VERSION_10_7) +# define MAC_OS_X_VERSION_10_7 MAC_OS_X_VERSION_10_6 + 1 +# endif +# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_7) +# warning "This version of Mac OS X is unsupported" +# endif +#endif + +#ifdef __LSB_VERSION__ +# if __LSB_VERSION__ < 40 +# error "This version of the Linux Standard Base is unsupported" +# endif +#ifndef QT_LINUXBASE +# define QT_LINUXBASE +#endif +#endif + +/* + The compiler, must be one of: (Q_CC_x) + + SYM - Digital Mars C/C++ (used to be Symantec C++) + MWERKS - Metrowerks CodeWarrior + MSVC - Microsoft Visual C/C++, Intel C++ for Windows + BOR - Borland/Turbo C++ + WAT - Watcom C++ + GNU - GNU C++ + COMEAU - Comeau C++ + EDG - Edison Design Group C++ + OC - CenterLine C++ + SUN - Forte Developer, or Sun Studio C++ + MIPS - MIPSpro C++ + DEC - DEC C++ + HPACC - HP aC++ + USLC - SCO OUDK and UDK + CDS - Reliant C++ + KAI - KAI C++ + INTEL - Intel C++ for Linux, Intel C++ for Windows + HIGHC - MetaWare High C/C++ + PGI - Portland Group C++ + GHS - Green Hills Optimizing C++ Compilers + GCCE - GCCE (Symbian GCCE builds) + RVCT - ARM Realview Compiler Suite + NOKIAX86 - Nokia x86 (Symbian WINSCW builds) + CLANG - C++ front-end for the LLVM compiler + + + Should be sorted most to least authoritative. +*/ + +#if defined(__ghs) +# define Q_OUTOFLINE_TEMPLATE inline + +/* the following are necessary because the GHS C++ name mangling relies on __*/ +# define Q_CONSTRUCTOR_FUNCTION0(AFUNC) \ + static const int AFUNC ## _init_variable_ = AFUNC(); +# define Q_CONSTRUCTOR_FUNCTION(AFUNC) Q_CONSTRUCTOR_FUNCTION0(AFUNC) +# define Q_DESTRUCTOR_FUNCTION0(AFUNC) \ + class AFUNC ## _dest_class_ { \ + public: \ + inline AFUNC ## _dest_class_() { } \ + inline ~ AFUNC ## _dest_class_() { AFUNC(); } \ + } AFUNC ## _dest_instance_; +# define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC) + +#endif + +/* Symantec C++ is now Digital Mars */ +#if defined(__DMC__) || defined(__SC__) +# define Q_CC_SYM +/* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */ +# if defined(__SC__) && __SC__ < 0x750 +# define Q_NO_EXPLICIT_KEYWORD +# endif +# define Q_NO_USING_KEYWORD + +#elif defined(__MWERKS__) +# define Q_CC_MWERKS +# if defined(__EMU_SYMBIAN_OS__) +# define Q_CC_NOKIAX86 +# endif +/* "explicit" recognized since 4.0d1 */ + +#elif defined(_MSC_VER) +# define Q_CC_MSVC +# define Q_CC_MSVC_NET +# define Q_CANNOT_DELETE_CONSTANT +# define Q_OUTOFLINE_TEMPLATE inline +# define Q_NO_TEMPLATE_FRIENDS +# define Q_ALIGNOF(type) __alignof(type) +# define Q_DECL_ALIGN(n) __declspec(align(n)) +/* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */ +# if defined(__INTEL_COMPILER) +# define Q_CC_INTEL +# endif +/* MSVC does not support SSE/MMX on x64 */ +# if (defined(Q_CC_MSVC) && defined(_M_X64)) +# undef QT_HAVE_SSE +# undef QT_HAVE_MMX +# undef QT_HAVE_3DNOW +# endif + +#if defined(Q_CC_MSVC) && _MSC_VER >= 1600 +# define Q_COMPILER_RVALUE_REFS +# define Q_COMPILER_INITIALIZER_LISTS +# define Q_COMPILER_AUTO_TYPE +# define Q_COMPILER_LAMBDA +//# define Q_COMPILER_VARIADIC_TEMPLATES +//# define Q_COMPILER_CLASS_ENUM +//# define Q_COMPILER_DEFAULT_DELETE_MEMBERS +//# define Q_COMPILER_UNICODE_STRINGS +//# define Q_COMPILER_EXTERN_TEMPLATES +# endif + + +#elif defined(__BORLANDC__) || defined(__TURBOC__) +# define Q_CC_BOR +# define Q_INLINE_TEMPLATE +# if __BORLANDC__ < 0x502 +# define Q_NO_BOOL_TYPE +# define Q_NO_EXPLICIT_KEYWORD +# endif +# define Q_NO_USING_KEYWORD + +#elif defined(__WATCOMC__) +# define Q_CC_WAT + +/* Symbian GCCE */ +#elif defined(__GCCE__) +# define Q_CC_GCCE +# define QT_VISIBILITY_AVAILABLE +# if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) +# define QT_HAVE_ARMV6 +# endif + +/* ARM Realview Compiler Suite + RVCT compiler also defines __EDG__ and __GNUC__ (if --gnu flag is given), + so check for it before that */ +#elif defined(__ARMCC__) || defined(__CC_ARM) +# define Q_CC_RVCT +# if __TARGET_ARCH_ARM >= 6 +# define QT_HAVE_ARMV6 +# endif +/* work-around for missing compiler intrinsics */ +# define __is_empty(X) false +# define __is_pod(X) false +#elif defined(__GNUC__) +# define Q_CC_GNU +# define Q_C_CALLBACKS +# if defined(__MINGW32__) +# define Q_CC_MINGW +# endif +# if defined(__INTEL_COMPILER) +/* Intel C++ also masquerades as GCC 3.2.0 */ +# define Q_CC_INTEL +# endif +# if defined(__clang__) +/* Clang also masquerades as GCC 4.2.1 */ +# define Q_CC_CLANG +# endif +# ifdef __APPLE__ +# define Q_NO_DEPRECATED_CONSTRUCTORS +# endif +# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7 +# define Q_FULL_TEMPLATE_INSTANTIATION +# endif +/* GCC 2.95 knows "using" but does not support it correctly */ +# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95 +# define Q_NO_USING_KEYWORD +# define QT_NO_STL_WCHAR +# endif +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define Q_ALIGNOF(type) __alignof__(type) +# define Q_TYPEOF(expr) __typeof__(expr) +# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) +# endif +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define Q_LIKELY(expr) __builtin_expect(!!(expr), true) +# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false) +# endif +/* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */ +# if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1 +# define Q_WRONG_SB_CTYPE_MACROS +# endif +/* GCC <= 3.3 cannot handle template friends */ +# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ <= 3) +# define Q_NO_TEMPLATE_FRIENDS +# endif +/* Apple's GCC 3.1 chokes on our streaming qDebug() */ +# if defined(Q_OS_DARWIN) && __GNUC__ == 3 && (__GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 3) +# define Q_BROKEN_DEBUG_STREAM +# endif +# if (defined(Q_CC_GNU) || defined(Q_CC_INTEL)) && !defined(QT_MOC_CPP) +# define Q_PACKED __attribute__ ((__packed__)) +# define Q_NO_PACKED_REFERENCE +# ifndef __ARM_EABI__ +# define QT_NO_ARM_EABI +# endif +# endif +# if defined(__GXX_EXPERIMENTAL_CXX0X__) +# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403 + /* C++0x features supported in GCC 4.3: */ +# define Q_COMPILER_RVALUE_REFS +# endif +# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 + /* C++0x features supported in GCC 4.4: */ +# define Q_COMPILER_VARIADIC_TEMPLATES +# define Q_COMPILER_AUTO_TYPE +# define Q_COMPILER_EXTERN_TEMPLATES +# define Q_COMPILER_DEFAULT_DELETE_MEMBERS +# define Q_COMPILER_CLASS_ENUM +# define Q_COMPILER_INITIALIZER_LISTS +# endif +# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 + /* C++0x features supported in GCC 4.5: */ +# define Q_COMPILER_LAMBDA +# define Q_COMPILER_UNICODE_STRINGS +# endif +# endif + +/* IBM compiler versions are a bit messy. There are actually two products: + the C product, and the C++ product. The C++ compiler is always packaged + with the latest version of the C compiler. Version numbers do not always + match. This little table (I'm not sure it's accurate) should be helpful: + + C++ product C product + + C Set 3.1 C Compiler 3.0 + ... ... + C++ Compiler 3.6.6 C Compiler 4.3 + ... ... + Visual Age C++ 4.0 ... + ... ... + Visual Age C++ 5.0 C Compiler 5.0 + ... ... + Visual Age C++ 6.0 C Compiler 6.0 + + Now: + __xlC__ is the version of the C compiler in hexadecimal notation + is only an approximation of the C++ compiler version + __IBMCPP__ is the version of the C++ compiler in decimal notation + but it is not defined on older compilers like C Set 3.1 */ +#elif defined(__xlC__) +# define Q_CC_XLC +# define Q_FULL_TEMPLATE_INSTANTIATION +# if __xlC__ < 0x400 +# define Q_NO_BOOL_TYPE +# define Q_NO_EXPLICIT_KEYWORD +# define Q_NO_USING_KEYWORD +# define Q_TYPENAME +# define Q_OUTOFLINE_TEMPLATE inline +# define Q_BROKEN_TEMPLATE_SPECIALIZATION +# define Q_CANNOT_DELETE_CONSTANT +# elif __xlC__ >= 0x0600 +# define Q_ALIGNOF(type) __alignof__(type) +# define Q_TYPEOF(expr) __typeof__(expr) +# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) +# define Q_PACKED __attribute__((__packed__)) +# endif + +/* Older versions of DEC C++ do not define __EDG__ or __EDG - observed + on DEC C++ V5.5-004. New versions do define __EDG__ - observed on + Compaq C++ V6.3-002. + This compiler is different enough from other EDG compilers to handle + it separately anyway. */ +#elif defined(__DECCXX) || defined(__DECC) +# define Q_CC_DEC +/* Compaq C++ V6 compilers are EDG-based but I'm not sure about older + DEC C++ V5 compilers. */ +# if defined(__EDG__) +# define Q_CC_EDG +# endif +/* Compaq have disabled EDG's _BOOL macro and use _BOOL_EXISTS instead + - observed on Compaq C++ V6.3-002. + In any case versions prior to Compaq C++ V6.0-005 do not have bool. */ +# if !defined(_BOOL_EXISTS) +# define Q_NO_BOOL_TYPE +# endif +/* Spurious (?) error messages observed on Compaq C++ V6.5-014. */ +# define Q_NO_USING_KEYWORD +/* Apply to all versions prior to Compaq C++ V6.0-000 - observed on + DEC C++ V5.5-004. */ +# if __DECCXX_VER < 60060000 +# define Q_TYPENAME +# define Q_BROKEN_TEMPLATE_SPECIALIZATION +# define Q_CANNOT_DELETE_CONSTANT +# endif +/* avoid undefined symbol problems with out-of-line template members */ +# define Q_OUTOFLINE_TEMPLATE inline + +/* The Portland Group C++ compiler is based on EDG and does define __EDG__ + but the C compiler does not */ +#elif defined(__PGI) +# define Q_CC_PGI +# if defined(__EDG__) +# define Q_CC_EDG +# endif + +/* Compilers with EDG front end are similar. To detect them we test: + __EDG documented by SGI, observed on MIPSpro 7.3.1.1 and KAI C++ 4.0b + __EDG__ documented in EDG online docs, observed on Compaq C++ V6.3-002 + and PGI C++ 5.2-4 */ +#elif !defined(Q_OS_HPUX) && (defined(__EDG) || defined(__EDG__)) +# define Q_CC_EDG +/* From the EDG documentation (does not seem to apply to Compaq C++): + _BOOL + Defined in C++ mode when bool is a keyword. The name of this + predefined macro is specified by a configuration flag. _BOOL + is the default. + __BOOL_DEFINED + Defined in Microsoft C++ mode when bool is a keyword. */ +# if !defined(_BOOL) && !defined(__BOOL_DEFINED) +# define Q_NO_BOOL_TYPE +# endif + +/* The Comeau compiler is based on EDG and does define __EDG__ */ +# if defined(__COMO__) +# define Q_CC_COMEAU +# define Q_C_CALLBACKS + +/* The `using' keyword was introduced to avoid KAI C++ warnings + but it's now causing KAI C++ errors instead. The standard is + unclear about the use of this keyword, and in practice every + compiler is using its own set of rules. Forget it. */ +# elif defined(__KCC) +# define Q_CC_KAI +# define Q_NO_USING_KEYWORD + +/* Using the `using' keyword avoids Intel C++ for Linux warnings */ +# elif defined(__INTEL_COMPILER) +# define Q_CC_INTEL + +/* Uses CFront, make sure to read the manual how to tweak templates. */ +# elif defined(__ghs) +# define Q_CC_GHS + +# elif defined(__DCC__) +# define Q_CC_DIAB +# undef Q_NO_BOOL_TYPE +# if !defined(__bool) +# define Q_NO_BOOL_TYPE +# endif + +/* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */ +# elif defined(__USLC__) && defined(__SCO_VERSION__) +# define Q_CC_USLC +/* The latest UDK 7.1.1b does not need this, but previous versions do */ +# if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010) +# define Q_OUTOFLINE_TEMPLATE inline +# endif +# define Q_NO_USING_KEYWORD /* ### check "using" status */ + +/* Never tested! */ +# elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER) +# define Q_CC_OC +# define Q_NO_USING_KEYWORD + +/* CDS++ defines __EDG__ although this is not documented in the Reliant + documentation. It also follows conventions like _BOOL and this documented */ +# elif defined(sinix) +# define Q_CC_CDS +# define Q_NO_USING_KEYWORD + +/* The MIPSpro compiler defines __EDG */ +# elif defined(__sgi) +# define Q_CC_MIPS +# define Q_NO_USING_KEYWORD /* ### check "using" status */ +# define Q_NO_TEMPLATE_FRIENDS +# if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 740) +# define Q_OUTOFLINE_TEMPLATE inline +# pragma set woff 3624,3625,3649 /* turn off some harmless warnings */ +# endif +# endif + +/* VxWorks' DIAB toolchain has an additional EDG type C++ compiler + (see __DCC__ above). This one is for C mode files (__EDG is not defined) */ +#elif defined(_DIAB_TOOL) +# define Q_CC_DIAB + +/* Never tested! */ +#elif defined(__HIGHC__) +# define Q_CC_HIGHC + +#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C) +# define Q_CC_SUN +/* 5.0 compiler or better + 'bool' is enabled by default but can be disabled using -features=nobool + in which case _BOOL is not defined + this is the default in 4.2 compatibility mode triggered by -compat=4 */ +# if __SUNPRO_CC >= 0x500 +# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS + /* see http://developers.sun.com/sunstudio/support/Ccompare.html */ +# if __SUNPRO_CC >= 0x590 +# define Q_ALIGNOF(type) __alignof__(type) +# define Q_TYPEOF(expr) __typeof__(expr) +# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) +# endif +# if __SUNPRO_CC >= 0x550 +# define Q_DECL_EXPORT __global +# endif +# if __SUNPRO_CC < 0x5a0 +# define Q_NO_TEMPLATE_FRIENDS +# endif +# if !defined(_BOOL) +# define Q_NO_BOOL_TYPE +# endif +# if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4) +# define Q_NO_USING_KEYWORD +# endif +# define Q_C_CALLBACKS +/* 4.2 compiler or older */ +# else +# define Q_NO_BOOL_TYPE +# define Q_NO_EXPLICIT_KEYWORD +# define Q_NO_USING_KEYWORD +# endif + +/* CDS++ does not seem to define __EDG__ or __EDG according to Reliant + documentation but nevertheless uses EDG conventions like _BOOL */ +#elif defined(sinix) +# define Q_CC_EDG +# define Q_CC_CDS +# if !defined(_BOOL) +# define Q_NO_BOOL_TYPE +# endif +# define Q_BROKEN_TEMPLATE_SPECIALIZATION + +#elif defined(Q_OS_HPUX) +/* __HP_aCC was not defined in first aCC releases */ +# if defined(__HP_aCC) || __cplusplus >= 199707L +# define Q_NO_TEMPLATE_FRIENDS +# define Q_CC_HPACC +# if __HP_aCC-0 < 060000 +# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS +# define Q_DECL_EXPORT __declspec(dllexport) +# define Q_DECL_IMPORT __declspec(dllimport) +# endif +# if __HP_aCC-0 >= 061200 +# define Q_DECL_ALIGN(n) __attribute__((aligned(n))) +# endif +# if __HP_aCC-0 >= 062000 +# define Q_DECL_EXPORT __attribute__((visibility("default"))) +# define Q_DECL_HIDDEN __attribute__((visibility("hidden"))) +# define Q_DECL_IMPORT Q_DECL_EXPORT +# endif +# else +# define Q_CC_HP +# define Q_NO_BOOL_TYPE +# define Q_FULL_TEMPLATE_INSTANTIATION +# define Q_BROKEN_TEMPLATE_SPECIALIZATION +# define Q_NO_EXPLICIT_KEYWORD +# endif +# define Q_NO_USING_KEYWORD /* ### check "using" status */ + +#elif defined(__WINSCW__) && !defined(Q_CC_NOKIAX86) +# define Q_CC_NOKIAX86 + +#else +# error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com" +#endif + + +#ifdef Q_CC_INTEL +# if __INTEL_COMPILER < 1200 +# define Q_NO_TEMPLATE_FRIENDS +# endif +# if defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__) +# if __INTEL_COMPILER >= 1100 +# define Q_COMPILER_RVALUE_REFS +# define Q_COMPILER_EXTERN_TEMPLATES +# elif __INTEL_COMPILER >= 1200 +# define Q_COMPILER_VARIADIC_TEMPLATES +# define Q_COMPILER_AUTO_TYPE +# define Q_COMPILER_DEFAULT_DELETE_MEMBERS +# define Q_COMPILER_CLASS_ENUM +# define Q_COMPILER_LAMBDA +# endif +# endif +#endif + +#ifndef Q_PACKED +# define Q_PACKED +# undef Q_NO_PACKED_REFERENCE +#endif + +#ifndef Q_LIKELY +# define Q_LIKELY(x) (x) +#endif +#ifndef Q_UNLIKELY +# define Q_UNLIKELY(x) (x) +#endif + +#ifndef Q_CONSTRUCTOR_FUNCTION +# define Q_CONSTRUCTOR_FUNCTION0(AFUNC) \ + static const int AFUNC ## __init_variable__ = AFUNC(); +# define Q_CONSTRUCTOR_FUNCTION(AFUNC) Q_CONSTRUCTOR_FUNCTION0(AFUNC) +#endif + +#ifndef Q_DESTRUCTOR_FUNCTION +# define Q_DESTRUCTOR_FUNCTION0(AFUNC) \ + class AFUNC ## __dest_class__ { \ + public: \ + inline AFUNC ## __dest_class__() { } \ + inline ~ AFUNC ## __dest_class__() { AFUNC(); } \ + } AFUNC ## __dest_instance__; +# define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC) +#endif + +#ifndef Q_REQUIRED_RESULT +# if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) +# define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result)) +# else +# define Q_REQUIRED_RESULT +# endif +#endif + +#ifndef Q_COMPILER_MANGLES_RETURN_TYPE +# if defined(Q_CC_MSVC) +# define Q_COMPILER_MANGLES_RETURN_TYPE +# endif +#endif + +/* + The window system, must be one of: (Q_WS_x) + + MACX - Mac OS X + MAC9 - Mac OS 9 + QWS - Qt for Embedded Linux + WIN32 - Windows + X11 - X Window System + S60 - Symbian S60 + PM - unsupported + WIN16 - unsupported +*/ + +#if defined(Q_OS_MSDOS) +# define Q_WS_WIN16 +# error "Qt requires Win32 and does not work with Windows 3.x" +#elif defined(_WIN32_X11_) +# define Q_WS_X11 +#elif defined(Q_OS_WIN32) +# define Q_WS_WIN32 +# if defined(Q_OS_WIN64) +# define Q_WS_WIN64 +# endif +#elif defined(Q_OS_WINCE) +# define Q_WS_WIN32 +# define Q_WS_WINCE +# if defined(Q_OS_WINCE_WM) +# define Q_WS_WINCE_WM +# endif +#elif defined(Q_OS_OS2) +# define Q_WS_PM +# error "Qt does not work with OS/2 Presentation Manager or Workplace Shell" +#elif defined(Q_OS_UNIX) +# if defined(Q_OS_MAC) && !defined(__USE_WS_X11__) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA) +# define Q_WS_MAC +# define Q_WS_MACX +# if defined(Q_OS_MAC64) +# define Q_WS_MAC64 +# elif defined(Q_OS_MAC32) +# define Q_WS_MAC32 +# endif +# elif defined(Q_OS_SYMBIAN) +# if !defined(QT_NO_S60) +# define Q_WS_S60 +# endif +# elif !defined(Q_WS_QWS) && !defined(Q_WS_QPA) +# define Q_WS_X11 +# endif +#endif + +#if defined(Q_WS_WIN16) || defined(Q_WS_WIN32) || defined(Q_WS_WINCE) +# define Q_WS_WIN +#endif + +QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE + +/* + Size-dependent types (architechture-dependent byte order) + + Make sure to update QMetaType when changing these typedefs +*/ + +typedef signed char qint8; /* 8 bit signed */ +typedef unsigned char quint8; /* 8 bit unsigned */ +typedef short qint16; /* 16 bit signed */ +typedef unsigned short quint16; /* 16 bit unsigned */ +typedef int qint32; /* 32 bit signed */ +typedef unsigned int quint32; /* 32 bit unsigned */ +#if defined(Q_OS_WIN) && !defined(Q_CC_GNU) && !defined(Q_CC_MWERKS) +# define Q_INT64_C(c) c ## i64 /* signed 64 bit constant */ +# define Q_UINT64_C(c) c ## ui64 /* unsigned 64 bit constant */ +typedef __int64 qint64; /* 64 bit signed */ +typedef unsigned __int64 quint64; /* 64 bit unsigned */ +#else +# define Q_INT64_C(c) static_cast(c ## LL) /* signed 64 bit constant */ +# define Q_UINT64_C(c) static_cast(c ## ULL) /* unsigned 64 bit constant */ +typedef long long qint64; /* 64 bit signed */ +typedef unsigned long long quint64; /* 64 bit unsigned */ +#endif + +typedef qint64 qlonglong; +typedef quint64 qulonglong; + +#ifndef QT_POINTER_SIZE +# if defined(Q_OS_WIN64) +# define QT_POINTER_SIZE 8 +# elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) +# define QT_POINTER_SIZE 4 +# endif +#endif + +#define Q_INIT_RESOURCE_EXTERN(name) \ + extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); + +#define Q_INIT_RESOURCE(name) \ + do { extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); \ + QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); } while (0) +#define Q_CLEANUP_RESOURCE(name) \ + do { extern int QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); \ + QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); } while (0) + +#if defined(__cplusplus) + +/* + quintptr and qptrdiff is guaranteed to be the same size as a pointer, i.e. + + sizeof(void *) == sizeof(quintptr) + && sizeof(void *) == sizeof(qptrdiff) +*/ +template struct QIntegerForSize; +template <> struct QIntegerForSize<1> { typedef quint8 Unsigned; typedef qint8 Signed; }; +template <> struct QIntegerForSize<2> { typedef quint16 Unsigned; typedef qint16 Signed; }; +template <> struct QIntegerForSize<4> { typedef quint32 Unsigned; typedef qint32 Signed; }; +template <> struct QIntegerForSize<8> { typedef quint64 Unsigned; typedef qint64 Signed; }; +template struct QIntegerForSizeof: QIntegerForSize { }; +typedef QIntegerForSizeof::Unsigned quintptr; +typedef QIntegerForSizeof::Signed qptrdiff; + +/* + Useful type definitions for Qt +*/ + +QT_BEGIN_INCLUDE_NAMESPACE +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned int uint; +typedef unsigned long ulong; +QT_END_INCLUDE_NAMESPACE + +#if defined(Q_NO_BOOL_TYPE) +#error "Compiler doesn't support the bool type" +#endif + +/* + Constant bool values +*/ + +#ifndef QT_LINUXBASE /* the LSB defines TRUE and FALSE for us */ +/* Symbian OS defines TRUE = 1 and FALSE = 0, +redefine to built-in booleans to make autotests work properly */ +#ifdef Q_OS_SYMBIAN + #include /* Symbian OS defines */ + + #undef TRUE + #undef FALSE +#endif +# ifndef TRUE +# define TRUE true +# define FALSE false +# endif +#endif + +/* + Proper for-scoping in MIPSpro CC +*/ +#ifndef QT_NO_KEYWORDS +# if defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64)) +# define for if(0){}else for +# endif +#endif + +/* + Workaround for static const members on MSVC++. +*/ + +#if defined(Q_CC_MSVC) +# define QT_STATIC_CONST static +# define QT_STATIC_CONST_IMPL +#else +# define QT_STATIC_CONST static const +# define QT_STATIC_CONST_IMPL const +#endif + +/* + Warnings and errors when using deprecated methods +*/ +#if defined(Q_MOC_RUN) +# define Q_DECL_DEPRECATED Q_DECL_DEPRECATED +#elif (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))) || defined(Q_CC_RVCT) +# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__)) +#elif defined(Q_CC_MSVC) +# define Q_DECL_DEPRECATED __declspec(deprecated) +# if defined (Q_CC_INTEL) +# define Q_DECL_VARIABLE_DEPRECATED +# else +# endif +#else +# define Q_DECL_DEPRECATED +#endif +#ifndef Q_DECL_VARIABLE_DEPRECATED +# define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED +#endif +#ifndef Q_DECL_CONSTRUCTOR_DEPRECATED +# if defined(Q_MOC_RUN) +# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED +# elif defined(Q_NO_DEPRECATED_CONSTRUCTORS) +# define Q_DECL_CONSTRUCTOR_DEPRECATED +# else +# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED +# endif +#endif + +#if defined(QT_NO_DEPRECATED) +/* disable Qt3 support as well */ +# undef QT3_SUPPORT_WARNINGS +# undef QT3_SUPPORT +# undef QT_DEPRECATED +# undef QT_DEPRECATED_VARIABLE +# undef QT_DEPRECATED_CONSTRUCTOR +#elif defined(QT_DEPRECATED_WARNINGS) +# ifdef QT3_SUPPORT +/* enable Qt3 support warnings as well */ +# undef QT3_SUPPORT_WARNINGS +# define QT3_SUPPORT_WARNINGS +# endif +# undef QT_DEPRECATED +# define QT_DEPRECATED Q_DECL_DEPRECATED +# undef QT_DEPRECATED_VARIABLE +# define QT_DEPRECATED_VARIABLE Q_DECL_VARIABLE_DEPRECATED +# undef QT_DEPRECATED_CONSTRUCTOR +# define QT_DEPRECATED_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED +#else +# undef QT_DEPRECATED +# define QT_DEPRECATED +# undef QT_DEPRECATED_VARIABLE +# define QT_DEPRECATED_VARIABLE +# undef QT_DEPRECATED_CONSTRUCTOR +# define QT_DEPRECATED_CONSTRUCTOR +#endif + +#if defined(QT3_SUPPORT_WARNINGS) +# if !defined(QT_COMPAT_WARNINGS) /* also enable compat */ +# define QT_COMPAT_WARNINGS +# endif +# undef QT3_SUPPORT +# define QT3_SUPPORT Q_DECL_DEPRECATED +# undef QT3_SUPPORT_VARIABLE +# define QT3_SUPPORT_VARIABLE Q_DECL_VARIABLE_DEPRECATED +# undef QT3_SUPPORT_CONSTRUCTOR +# define QT3_SUPPORT_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED +#elif defined(QT3_SUPPORT) /* define back to nothing */ +# if !defined(QT_COMPAT) /* also enable qt3 support */ +# define QT_COMPAT +# endif +# undef QT3_SUPPORT +# define QT3_SUPPORT +# undef QT3_SUPPORT_VARIABLE +# define QT3_SUPPORT_VARIABLE +# undef QT3_SUPPORT_CONSTRUCTOR +# define QT3_SUPPORT_CONSTRUCTOR explicit +#endif + +/* moc compats (signals/slots) */ +#ifndef QT_MOC_COMPAT +# if defined(QT3_SUPPORT) +# define QT_MOC_COMPAT QT3_SUPPORT +# else +# define QT_MOC_COMPAT +# endif +#else +# undef QT_MOC_COMPAT +# define QT_MOC_COMPAT +#endif + +#ifdef QT_ASCII_CAST_WARNINGS +# define QT_ASCII_CAST_WARN Q_DECL_DEPRECATED +# if defined(Q_CC_GNU) && __GNUC__ < 4 + /* gcc < 4 doesn't like Q_DECL_DEPRECATED in front of constructors */ +# define QT_ASCII_CAST_WARN_CONSTRUCTOR +# else +# define QT_ASCII_CAST_WARN_CONSTRUCTOR Q_DECL_CONSTRUCTOR_DEPRECATED +# endif +#else +# define QT_ASCII_CAST_WARN +# define QT_ASCII_CAST_WARN_CONSTRUCTOR +#endif + +#if defined(__i386__) || defined(_WIN32) || defined(_WIN32_WCE) +# if defined(Q_CC_GNU) +#if !defined(Q_CC_INTEL) && ((100*(__GNUC__ - 0) + 10*(__GNUC_MINOR__ - 0) + __GNUC_PATCHLEVEL__) >= 332) +# define QT_FASTCALL __attribute__((regparm(3))) +#else +# define QT_FASTCALL +#endif +# elif defined(Q_CC_MSVC) +# define QT_FASTCALL __fastcall +# else +# define QT_FASTCALL +# endif +#else +# define QT_FASTCALL +#endif + +//defines the type for the WNDPROC on windows +//the alignment needs to be forced for sse2 to not crash with mingw +#if defined(Q_WS_WIN) +# if defined(Q_CC_MINGW) +# define QT_ENSURE_STACK_ALIGNED_FOR_SSE __attribute__ ((force_align_arg_pointer)) +# else +# define QT_ENSURE_STACK_ALIGNED_FOR_SSE +# endif +# define QT_WIN_CALLBACK CALLBACK QT_ENSURE_STACK_ALIGNED_FOR_SSE +#endif + +typedef int QNoImplicitBoolCast; + +#if defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_MIPS) && (defined(Q_WS_QWS) || defined(Q_WS_QPA) || defined(Q_OS_WINCE))) || defined(QT_ARCH_SH) || defined(QT_ARCH_SH4A) +#define QT_NO_FPU +#endif + +// This logic must match the one in qmetatype.h +#if defined(QT_COORD_TYPE) +typedef QT_COORD_TYPE qreal; +#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN) +typedef float qreal; +#else +typedef double qreal; +#endif + +/* + Utility macros and inline functions +*/ + +template +inline T qAbs(const T &t) { return t >= 0 ? t : -t; } + +inline int qRound(qreal d) +{ return d >= qreal(0.0) ? int(d + qreal(0.5)) : int(d - int(d-1) + qreal(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 - qreal(qint64(d-1)) + 0.5) + qint64(d-1); } +#else +inline qint64 qRound64(qreal d) +{ return d >= qreal(0.0) ? qint64(d + qreal(0.5)) : qint64(d - qreal(qint64(d-1)) + qreal(0.5)) + qint64(d-1); } +#endif + +template +inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; } +template +inline const T &qMax(const T &a, const T &b) { if (a < b) return b; return a; } +template +inline const T &qBound(const T &min, const T &val, const T &max) +{ return qMax(min, qMin(max, val)); } + +#ifdef QT3_SUPPORT +typedef qint8 Q_INT8; +typedef quint8 Q_UINT8; +typedef qint16 Q_INT16; +typedef quint16 Q_UINT16; +typedef qint32 Q_INT32; +typedef quint32 Q_UINT32; +typedef qint64 Q_INT64; +typedef quint64 Q_UINT64; + +typedef qint64 Q_LLONG; +typedef quint64 Q_ULLONG; +#if defined(Q_OS_WIN64) +typedef __int64 Q_LONG; /* word up to 64 bit signed */ +typedef unsigned __int64 Q_ULONG; /* word up to 64 bit unsigned */ +#else +typedef long Q_LONG; /* word up to 64 bit signed */ +typedef unsigned long Q_ULONG; /* word up to 64 bit unsigned */ +#endif + +# define QABS(a) qAbs(a) +# define QMAX(a, b) qMax((a), (b)) +# define QMIN(a, b) qMin((a), (b)) +#endif + +/* + Data stream functions are provided by many classes (defined in qdatastream.h) +*/ + +class QDataStream; + +#ifndef QT_BUILD_KEY +#define QT_BUILD_KEY "unspecified" +#endif + +#if defined(Q_WS_MAC) +# ifndef QMAC_QMENUBAR_NO_EVENT +# define QMAC_QMENUBAR_NO_EVENT +# endif +#endif + +#if !defined(Q_WS_QWS) && !defined(QT_NO_COP) +# define QT_NO_COP +#endif + +#if defined(Q_OS_VXWORKS) +# define QT_NO_CRASHHANDLER // no popen +# define QT_NO_PROCESS // no exec*, no fork +# define QT_NO_LPR +# define QT_NO_SHAREDMEMORY // only POSIX, no SysV and in the end... +# define QT_NO_SYSTEMSEMAPHORE // not needed at all in a flat address space +# define QT_NO_QWS_MULTIPROCESS // no processes +#endif + +# include + +#define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE)) + +#if defined(Q_OS_LINUX) && defined(Q_CC_RVCT) +# define Q_DECL_EXPORT __attribute__((visibility("default"))) +# define Q_DECL_IMPORT __attribute__((visibility("default"))) +# define Q_DECL_HIDDEN __attribute__((visibility("hidden"))) +#endif + +#ifndef Q_DECL_EXPORT +# if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT) +# define Q_DECL_EXPORT __declspec(dllexport) +# elif defined(QT_VISIBILITY_AVAILABLE) +# define Q_DECL_EXPORT __attribute__((visibility("default"))) +# define Q_DECL_HIDDEN __attribute__((visibility("hidden"))) +# endif +# ifndef Q_DECL_EXPORT +# define Q_DECL_EXPORT +# endif +#endif +#ifndef Q_DECL_IMPORT +# if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT) +# define Q_DECL_IMPORT __declspec(dllimport) +# else +# define Q_DECL_IMPORT +# endif +#endif +#ifndef Q_DECL_HIDDEN +# define Q_DECL_HIDDEN +#endif + + +/* + Create Qt DLL if QT_DLL is defined (Windows and Symbian only) +*/ + +#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) +# if defined(QT_NODLL) +# undef QT_MAKEDLL +# undef QT_DLL +# elif defined(QT_MAKEDLL) /* create a Qt DLL library */ +# if defined(QT_DLL) +# undef QT_DLL +# endif +# if defined(QT_BUILD_CORE_LIB) +# define Q_CORE_EXPORT Q_DECL_EXPORT +# else +# define Q_CORE_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_GUI_LIB) +# define Q_GUI_EXPORT Q_DECL_EXPORT +# else +# define Q_GUI_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_SQL_LIB) +# define Q_SQL_EXPORT Q_DECL_EXPORT +# else +# define Q_SQL_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_NETWORK_LIB) +# define Q_NETWORK_EXPORT Q_DECL_EXPORT +# else +# define Q_NETWORK_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_SVG_LIB) +# define Q_SVG_EXPORT Q_DECL_EXPORT +# else +# define Q_SVG_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_DECLARATIVE_LIB) +# define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT +# else +# define Q_DECLARATIVE_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_OPENGL_LIB) +# define Q_OPENGL_EXPORT Q_DECL_EXPORT +# else +# define Q_OPENGL_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_MULTIMEDIA_LIB) +# define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT +# else +# define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_OPENVG_LIB) +# define Q_OPENVG_EXPORT Q_DECL_EXPORT +# else +# define Q_OPENVG_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_XML_LIB) +# define Q_XML_EXPORT Q_DECL_EXPORT +# else +# define Q_XML_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_XMLPATTERNS_LIB) +# define Q_XMLPATTERNS_EXPORT Q_DECL_EXPORT +# else +# define Q_XMLPATTERNS_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_SCRIPT_LIB) +# define Q_SCRIPT_EXPORT Q_DECL_EXPORT +# else +# define Q_SCRIPT_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_SCRIPTTOOLS_LIB) +# define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT +# else +# define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_CANVAS_LIB) +# define Q_CANVAS_EXPORT Q_DECL_EXPORT +# else +# define Q_CANVAS_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_COMPAT_LIB) +# define Q_COMPAT_EXPORT Q_DECL_EXPORT +# else +# define Q_COMPAT_EXPORT Q_DECL_IMPORT +# endif +# if defined(QT_BUILD_DBUS_LIB) +# define Q_DBUS_EXPORT Q_DECL_EXPORT +# else +# define Q_DBUS_EXPORT Q_DECL_IMPORT +# endif +# define Q_TEMPLATEDLL +# elif defined(QT_DLL) /* use a Qt DLL library */ +# define Q_CORE_EXPORT Q_DECL_IMPORT +# define Q_GUI_EXPORT Q_DECL_IMPORT +# define Q_SQL_EXPORT Q_DECL_IMPORT +# define Q_NETWORK_EXPORT Q_DECL_IMPORT +# define Q_SVG_EXPORT Q_DECL_IMPORT +# define Q_DECLARATIVE_EXPORT Q_DECL_IMPORT +# define Q_CANVAS_EXPORT Q_DECL_IMPORT +# define Q_OPENGL_EXPORT Q_DECL_IMPORT +# define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT +# define Q_OPENVG_EXPORT Q_DECL_IMPORT +# define Q_XML_EXPORT Q_DECL_IMPORT +# define Q_XMLPATTERNS_EXPORT Q_DECL_IMPORT +# define Q_SCRIPT_EXPORT Q_DECL_IMPORT +# define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT +# define Q_COMPAT_EXPORT Q_DECL_IMPORT +# define Q_DBUS_EXPORT Q_DECL_IMPORT +# define Q_TEMPLATEDLL +# endif +# define Q_NO_DECLARED_NOT_DEFINED +#else +# if defined(Q_OS_LINUX) && defined(Q_CC_BOR) +# define Q_TEMPLATEDLL +# define Q_NO_DECLARED_NOT_DEFINED +# endif +# undef QT_MAKEDLL /* ignore these for other platforms */ +# undef QT_DLL +#endif + +#if !defined(Q_CORE_EXPORT) +# if defined(QT_SHARED) +# define Q_CORE_EXPORT Q_DECL_EXPORT +# define Q_GUI_EXPORT Q_DECL_EXPORT +# define Q_SQL_EXPORT Q_DECL_EXPORT +# define Q_NETWORK_EXPORT Q_DECL_EXPORT +# define Q_SVG_EXPORT Q_DECL_EXPORT +# define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT +# define Q_OPENGL_EXPORT Q_DECL_EXPORT +# define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT +# define Q_OPENVG_EXPORT Q_DECL_EXPORT +# define Q_XML_EXPORT Q_DECL_EXPORT +# define Q_XMLPATTERNS_EXPORT Q_DECL_EXPORT +# define Q_SCRIPT_EXPORT Q_DECL_EXPORT +# define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT +# define Q_COMPAT_EXPORT Q_DECL_EXPORT +# define Q_DBUS_EXPORT Q_DECL_EXPORT +# else +# define Q_CORE_EXPORT +# define Q_GUI_EXPORT +# define Q_SQL_EXPORT +# define Q_NETWORK_EXPORT +# define Q_SVG_EXPORT +# define Q_DECLARATIVE_EXPORT +# define Q_OPENGL_EXPORT +# define Q_MULTIMEDIA_EXPORT +# define Q_XML_EXPORT +# define Q_XMLPATTERNS_EXPORT +# define Q_SCRIPT_EXPORT +# define Q_SCRIPTTOOLS_EXPORT +# define Q_COMPAT_EXPORT +# define Q_DBUS_EXPORT +# endif +#endif + +// Functions marked as Q_GUI_EXPORT_INLINE were exported and inlined by mistake. +// Compilers like MinGW complain that the import attribute is ignored. +#if defined(Q_CC_MINGW) +# if defined(QT_BUILD_CORE_LIB) +# define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline +# else +# define Q_CORE_EXPORT_INLINE inline +# endif +# if defined(QT_BUILD_GUI_LIB) +# define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline +# else +# define Q_GUI_EXPORT_INLINE inline +# endif +# if defined(QT_BUILD_COMPAT_LIB) +# define Q_COMPAT_EXPORT_INLINE Q_COMPAT_EXPORT inline +# else +# define Q_COMPAT_EXPORT_INLINE inline +# endif +#elif defined(Q_CC_RVCT) +// we force RVCT not to export inlines by passing --visibility_inlines_hidden +// so we need to just inline it, rather than exporting and inlining +// note: this affects the contents of the DEF files (ie. these functions do not appear) +# define Q_CORE_EXPORT_INLINE inline +# define Q_GUI_EXPORT_INLINE inline +# define Q_COMPAT_EXPORT_INLINE inline +#else +# define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline +# define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline +# define Q_COMPAT_EXPORT_INLINE Q_COMPAT_EXPORT inline +#endif + +/* + No, this is not an evil backdoor. QT_BUILD_INTERNAL just exports more symbols + for Qt's internal unit tests. If you want slower loading times and more + symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL. +*/ +#if defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_MAKEDLL) +# define Q_AUTOTEST_EXPORT Q_DECL_EXPORT +#elif defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_DLL) +# define Q_AUTOTEST_EXPORT Q_DECL_IMPORT +#elif defined(QT_BUILD_INTERNAL) && !(defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_SHARED) +# define Q_AUTOTEST_EXPORT Q_DECL_EXPORT +#else +# define Q_AUTOTEST_EXPORT +#endif + +inline void qt_noop(void) {} + +/* 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 +#if !defined(QT_NO_EXCEPTIONS) && defined(Q_CC_GNU) && !defined (__EXCEPTIONS) && !defined(Q_MOC_RUN) +# 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 +*/ + +class QString; +class Q_CORE_EXPORT QSysInfo { +public: + enum Sizes { + WordSize = (sizeof(void *)<<3) + }; + +#if defined(QT_BUILD_QMAKE) + enum Endian { + BigEndian, + LittleEndian + }; + /* needed to bootstrap qmake */ + static const int ByteOrder; +#elif defined(Q_BYTE_ORDER) + enum Endian { + BigEndian, + LittleEndian + +# ifdef qdoc + , ByteOrder = +# elif Q_BYTE_ORDER == Q_BIG_ENDIAN + , ByteOrder = BigEndian +# elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN + , ByteOrder = LittleEndian +# else +# error "Undefined byte order" +# endif + }; +#else +# error "Qt not configured correctly, please run configure" +#endif +#if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN) + enum WinVersion { + WV_32s = 0x0001, + WV_95 = 0x0002, + WV_98 = 0x0003, + WV_Me = 0x0004, + WV_DOS_based= 0x000f, + + /* codenames */ + WV_NT = 0x0010, + WV_2000 = 0x0020, + WV_XP = 0x0030, + WV_2003 = 0x0040, + WV_VISTA = 0x0080, + WV_WINDOWS7 = 0x0090, + WV_NT_based = 0x00f0, + + /* version numbers */ + WV_4_0 = WV_NT, + WV_5_0 = WV_2000, + WV_5_1 = WV_XP, + WV_5_2 = WV_2003, + WV_6_0 = WV_VISTA, + WV_6_1 = WV_WINDOWS7, + + WV_CE = 0x0100, + WV_CENET = 0x0200, + WV_CE_5 = 0x0300, + WV_CE_6 = 0x0400, + WV_CE_based = 0x0f00 + }; + static const WinVersion WindowsVersion; + static WinVersion windowsVersion(); + +#endif +#ifdef Q_OS_MAC + enum MacVersion { + MV_Unknown = 0x0000, + + /* version */ + MV_9 = 0x0001, + MV_10_0 = 0x0002, + MV_10_1 = 0x0003, + MV_10_2 = 0x0004, + MV_10_3 = 0x0005, + MV_10_4 = 0x0006, + MV_10_5 = 0x0007, + MV_10_6 = 0x0008, + MV_10_7 = 0x0009, + + /* codenames */ + MV_CHEETAH = MV_10_0, + MV_PUMA = MV_10_1, + MV_JAGUAR = MV_10_2, + MV_PANTHER = MV_10_3, + MV_TIGER = MV_10_4, + MV_LEOPARD = MV_10_5, + MV_SNOWLEOPARD = MV_10_6, + MV_LION = MV_10_7 + }; + static const MacVersion MacintoshVersion; +#endif +#ifdef Q_OS_SYMBIAN + enum SymbianVersion { + SV_Unknown = 1000000, // Assume unknown is something newer than what is supported + //These are the Symbian Ltd versions 9.2-9.4 + SV_9_2 = 10, + SV_9_3 = 20, + SV_9_4 = 30, + //Following values are the symbian foundation versions, i.e. Symbian^1 == SV_SF_1 + SV_SF_1 = SV_9_4, + SV_SF_2 = 40, + SV_SF_3 = 50, + SV_SF_4 = 60, // Deprecated + SV_API_5_3 = 70, + SV_API_5_4 = 80 + }; + static SymbianVersion symbianVersion(); + enum S60Version { + SV_S60_None = 0, + SV_S60_Unknown = SV_Unknown, + SV_S60_3_1 = SV_9_2, + SV_S60_3_2 = SV_9_3, + SV_S60_5_0 = SV_9_4, + SV_S60_5_1 = SV_SF_2, // Deprecated + SV_S60_5_2 = SV_SF_3, + SV_S60_5_3 = SV_API_5_3, + SV_S60_5_4 = SV_API_5_4 + }; + static S60Version s60Version(); +#endif +}; + +Q_CORE_EXPORT const char *qVersion(); +Q_CORE_EXPORT bool qSharedBuild(); + +#if defined(Q_OS_MAC) +inline int qMacVersion() { return QSysInfo::MacintoshVersion; } +#endif + +#ifdef QT3_SUPPORT +inline QT3_SUPPORT bool qSysInfo(int *wordSize, bool *bigEndian) +{ + *wordSize = QSysInfo::WordSize; + *bigEndian = (QSysInfo::ByteOrder == QSysInfo::BigEndian); + return true; +} +#endif + +#if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN) +#if defined(QT3_SUPPORT) +inline QT3_SUPPORT bool qt_winUnicode() { return true; } +inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; } +#endif + +// ### Qt 5: remove Win9x support macros QT_WA and QT_WA_INLINE. +#define QT_WA(unicode, ansi) unicode +#define QT_WA_INLINE(unicode, ansi) (unicode) + +#endif /* Q_WS_WIN */ + +#ifndef Q_OUTOFLINE_TEMPLATE +# define Q_OUTOFLINE_TEMPLATE +#endif +#ifndef Q_INLINE_TEMPLATE +# define Q_INLINE_TEMPLATE inline +#endif + +#ifndef Q_TYPENAME +# define Q_TYPENAME typename +#endif + +/* + Avoid "unused parameter" warnings +*/ + +#if defined(Q_CC_INTEL) && !defined(Q_OS_WIN) || defined(Q_CC_RVCT) +template +inline void qUnused(T &x) { (void)x; } +# define Q_UNUSED(x) qUnused(x); +#else +# define Q_UNUSED(x) (void)x; +#endif + +/* + Debugging and error handling +*/ + +/* + On Symbian we do not know beforehand whether we are compiling in + release or debug mode, so check the Symbian build define here, + and set the QT_NO_DEBUG define appropriately. +*/ +#if defined(Q_OS_SYMBIAN) && defined(NDEBUG) && !defined(QT_NO_DEBUG) +# define QT_NO_DEBUG +#endif + +#if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG) +# define QT_DEBUG +#endif + +#ifndef qPrintable +# define qPrintable(string) QString(string).toLocal8Bit().constData() +#endif + +Q_CORE_EXPORT void qDebug(const char *, ...) /* print debug message */ +#if defined(Q_CC_GNU) && !defined(__INSURE__) + __attribute__ ((format (printf, 1, 2))) +#endif +; + +Q_CORE_EXPORT void qWarning(const char *, ...) /* print warning message */ +#if defined(Q_CC_GNU) && !defined(__INSURE__) + __attribute__ ((format (printf, 1, 2))) +#endif +; + +class QString; +Q_CORE_EXPORT QString qt_error_string(int errorCode = -1); +Q_CORE_EXPORT void qCritical(const char *, ...) /* print critical message */ +#if defined(Q_CC_GNU) && !defined(__INSURE__) + __attribute__ ((format (printf, 1, 2))) +#endif +; +Q_CORE_EXPORT void qFatal(const char *, ...) /* print fatal message and exit */ +#if defined(Q_CC_GNU) && !defined(__INSURE__) + __attribute__ ((format (printf, 1, 2))) +#endif +; + +#ifdef QT3_SUPPORT +Q_CORE_EXPORT QT3_SUPPORT void qSystemWarning(const char *msg, int code = -1); +#endif /* QT3_SUPPORT */ +Q_CORE_EXPORT void qErrnoWarning(int code, const char *msg, ...); +Q_CORE_EXPORT void qErrnoWarning(const char *msg, ...); + +#if (defined(QT_NO_DEBUG_OUTPUT) || defined(QT_NO_TEXTSTREAM)) && !defined(QT_NO_DEBUG_STREAM) +#define QT_NO_DEBUG_STREAM +#endif + +/* + Forward declarations only. + + In order to use the qDebug() stream, you must #include +*/ +class QDebug; +class QNoDebug; +#ifndef QT_NO_DEBUG_STREAM +Q_CORE_EXPORT_INLINE QDebug qDebug(); +Q_CORE_EXPORT_INLINE QDebug qWarning(); +Q_CORE_EXPORT_INLINE QDebug qCritical(); +#else +inline QNoDebug qDebug(); +#endif + +#define QT_NO_QDEBUG_MACRO while (false) qDebug +#ifdef QT_NO_DEBUG_OUTPUT +# define qDebug QT_NO_QDEBUG_MACRO +#endif +#define QT_NO_QWARNING_MACRO while (false) qWarning +#ifdef QT_NO_WARNING_OUTPUT +# define qWarning QT_NO_QWARNING_MACRO +#endif + + +Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line); + +#if !defined(Q_ASSERT) +# ifndef QT_NO_DEBUG +# define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop()) +# else +# define Q_ASSERT(cond) qt_noop() +# endif +#endif + +#if defined(QT_NO_DEBUG) && !defined(QT_PAINT_DEBUG) +#define QT_NO_PAINT_DEBUG +#endif + +Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *file, int line); + +#if !defined(Q_ASSERT_X) +# ifndef QT_NO_DEBUG +# define Q_ASSERT_X(cond, where, what) ((!(cond)) ? qt_assert_x(where, what,__FILE__,__LINE__) : qt_noop()) +# else +# define Q_ASSERT_X(cond, where, what) qt_noop() +# endif +#endif + +Q_CORE_EXPORT void qt_check_pointer(const char *, int); +Q_CORE_EXPORT void qBadAlloc(); + +#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) do { if (!(p)) qBadAlloc(); } while (0) +#endif + +template +inline T *q_check_ptr(T *p) { Q_CHECK_PTR(p); return p; } + +#if (defined(Q_CC_GNU) && !defined(Q_OS_SOLARIS)) || defined(Q_CC_HPACC) || defined(Q_CC_DIAB) +# define Q_FUNC_INFO __PRETTY_FUNCTION__ +#elif defined(_MSC_VER) +# define Q_FUNC_INFO __FUNCSIG__ +#else +# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN) +# define Q_FUNC_INFO __FILE__ "(line number unavailable)" +# else + /* These two macros makes it possible to turn the builtin line expander into a + * string literal. */ +# define QT_STRINGIFY2(x) #x +# define QT_STRINGIFY(x) QT_STRINGIFY2(x) +# define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__) +# endif + /* The MIPSpro and RVCT compilers postpones macro expansion, + and therefore macros must be in scope when being used. */ +# if !defined(Q_CC_MIPS) && !defined(Q_CC_RVCT) && !defined(Q_CC_NOKIAX86) +# undef QT_STRINGIFY2 +# undef QT_STRINGIFY +# endif +#endif + +enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg = QtCriticalMsg }; + +Q_CORE_EXPORT void qt_message_output(QtMsgType, const char *buf); + +typedef void (*QtMsgHandler)(QtMsgType, const char *); +Q_CORE_EXPORT QtMsgHandler qInstallMsgHandler(QtMsgHandler); + +#ifdef QT3_SUPPORT +inline QT3_SUPPORT void qSuppressObsoleteWarnings(bool = true) {} +inline QT3_SUPPORT void qObsolete(const char *, const char * = 0, const char * = 0) {} +#endif + +#if defined(QT_NO_THREAD) + +template +class QGlobalStatic +{ +public: + T *pointer; + inline QGlobalStatic(T *p) : pointer(p) { } + inline ~QGlobalStatic() { pointer = 0; } +}; + +#define Q_GLOBAL_STATIC(TYPE, NAME) \ + static TYPE *NAME() \ + { \ + static TYPE thisVariable; \ + static QGlobalStatic thisGlobalStatic(&thisVariable); \ + return thisGlobalStatic.pointer; \ + } + +#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \ + static TYPE *NAME() \ + { \ + static TYPE thisVariable ARGS; \ + static QGlobalStatic thisGlobalStatic(&thisVariable); \ + return thisGlobalStatic.pointer; \ + } + +#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \ + static TYPE *NAME() \ + { \ + static TYPE thisVariable; \ + static QGlobalStatic thisGlobalStatic(0); \ + if (!thisGlobalStatic.pointer) { \ + TYPE *x = thisGlobalStatic.pointer = &thisVariable; \ + INITIALIZER; \ + } \ + return thisGlobalStatic.pointer; \ + } + +#else + +// forward declaration, since qatomic.h needs qglobal.h +template class QBasicAtomicPointer; + +// POD for Q_GLOBAL_STATIC +template +class QGlobalStatic +{ +public: + QBasicAtomicPointer pointer; + bool destroyed; +}; + +// Created as a function-local static to delete a QGlobalStatic +template +class QGlobalStaticDeleter +{ +public: + QGlobalStatic &globalStatic; + QGlobalStaticDeleter(QGlobalStatic &_globalStatic) + : globalStatic(_globalStatic) + { } + + inline ~QGlobalStaticDeleter() + { + delete globalStatic.pointer; + globalStatic.pointer = 0; + globalStatic.destroyed = true; + } +}; + +#define Q_GLOBAL_STATIC(TYPE, NAME) \ + static TYPE *NAME() \ + { \ + static QGlobalStatic thisGlobalStatic \ + = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \ + if (!thisGlobalStatic.pointer && !thisGlobalStatic.destroyed) { \ + TYPE *x = new TYPE; \ + if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) \ + delete x; \ + else \ + static QGlobalStaticDeleter cleanup(thisGlobalStatic); \ + } \ + return thisGlobalStatic.pointer; \ + } + +#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \ + static TYPE *NAME() \ + { \ + static QGlobalStatic thisGlobalStatic \ + = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \ + if (!thisGlobalStatic.pointer && !thisGlobalStatic.destroyed) { \ + TYPE *x = new TYPE ARGS; \ + if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) \ + delete x; \ + else \ + static QGlobalStaticDeleter cleanup(thisGlobalStatic); \ + } \ + return thisGlobalStatic.pointer; \ + } + +#define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \ + static TYPE *NAME() \ + { \ + static QGlobalStatic thisGlobalStatic \ + = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \ + if (!thisGlobalStatic.pointer && !thisGlobalStatic.destroyed) { \ + QScopedPointer x(new TYPE); \ + INITIALIZER; \ + if (thisGlobalStatic.pointer.testAndSetOrdered(0, x.data())) { \ + static QGlobalStaticDeleter cleanup(thisGlobalStatic); \ + x.take(); \ + } \ + } \ + return thisGlobalStatic.pointer; \ + } + +#endif + +class QBool +{ + bool b; + +public: + inline explicit QBool(bool B) : b(B) {} + inline operator const void *() const + { return b ? static_cast(this) : static_cast(0); } +}; + +inline bool operator==(QBool b1, bool b2) { return !b1 == !b2; } +inline bool operator==(bool b1, QBool b2) { return !b1 == !b2; } +inline bool operator==(QBool b1, QBool b2) { return !b1 == !b2; } +inline bool operator!=(QBool b1, bool b2) { return !b1 != !b2; } +inline bool operator!=(bool b1, QBool b2) { return !b1 != !b2; } +inline bool operator!=(QBool b1, QBool b2) { return !b1 != !b2; } + +static inline bool qFuzzyCompare(double p1, double p2) +{ + return (qAbs(p1 - p2) <= 0.000000000001 * qMin(qAbs(p1), qAbs(p2))); +} + +static inline bool qFuzzyCompare(float p1, float p2) +{ + return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2))); +} + +/*! + \internal +*/ +static inline bool qFuzzyIsNull(double d) +{ + return qAbs(d) <= 0.000000000001; +} + +/*! + \internal +*/ +static inline bool qFuzzyIsNull(float f) +{ + return qAbs(f) <= 0.00001f; +} + +/* + This function tests a double for a null value. It doesn't + check whether the actual value is 0 or close to 0, but whether + it is binary 0. +*/ +static inline bool qIsNull(double d) +{ + union U { + double d; + quint64 u; + }; + U val; + val.d = d; + return val.u == quint64(0); +} + +/* + This function tests a float for a null value. It doesn't + check whether the actual value is 0 or close to 0, but whether + it is binary 0. +*/ +static inline bool qIsNull(float f) +{ + union U { + float f; + quint32 u; + }; + U val; + val.f = f; + return val.u == 0u; +} + +/* + Compilers which follow outdated template instantiation rules + require a class to have a comparison operator to exist when + a QList of this type is instantiated. It's not actually + used in the list, though. Hence the dummy implementation. + Just in case other code relies on it we better trigger a warning + mandating a real implementation. +*/ + +#ifdef Q_FULL_TEMPLATE_INSTANTIATION +# define Q_DUMMY_COMPARISON_OPERATOR(C) \ + bool operator==(const C&) const { \ + qWarning(#C"::operator==(const "#C"&) was called"); \ + return false; \ + } +#else +# define Q_DUMMY_COMPARISON_OPERATOR(C) +#endif + + +/* + QTypeInfo - type trait functionality + qIsDetached - data sharing functionality +*/ + +/* + The catch-all template. +*/ + +template inline bool qIsDetached(T &) { return true; } + +template +class QTypeInfo +{ +public: + enum { + isPointer = false, + isComplex = true, + isStatic = true, + isLarge = (sizeof(T)>sizeof(void*)), + isDummy = false + }; +}; + +template +class QTypeInfo +{ +public: + enum { + isPointer = true, + isComplex = false, + isStatic = false, + isLarge = false, + isDummy = false + }; +}; + +/* + Specialize a specific type with: + + Q_DECLARE_TYPEINFO(type, flags); + + where 'type' is the name of the type to specialize and 'flags' is + logically-OR'ed combination of the flags below. +*/ +enum { /* TYPEINFO flags */ + Q_COMPLEX_TYPE = 0, + Q_PRIMITIVE_TYPE = 0x1, + Q_STATIC_TYPE = 0, + Q_MOVABLE_TYPE = 0x2, + Q_DUMMY_TYPE = 0x4 +}; + +#define Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS) \ +class QTypeInfo \ +{ \ +public: \ + enum { \ + isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0), \ + isStatic = (((FLAGS) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), \ + isLarge = (sizeof(TYPE)>sizeof(void*)), \ + isPointer = false, \ + isDummy = (((FLAGS) & Q_DUMMY_TYPE) != 0) \ + }; \ + static inline const char *name() { return #TYPE; } \ +} + +#define Q_DECLARE_TYPEINFO(TYPE, FLAGS) \ +template<> \ +Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS) + + +template +inline void qSwap(T &value1, T &value2) +{ +#ifdef QT_NO_STL + const T t = value1; + value1 = value2; + value2 = t; +#else + using std::swap; + swap(value1, value2); +#endif +} + +/* + Specialize a shared type with: + + Q_DECLARE_SHARED(type); + + where 'type' is the name of the type to specialize. NOTE: shared + types must declare a 'bool isDetached(void) const;' member for this + to work. +*/ +#ifdef QT_NO_STL +#define Q_DECLARE_SHARED_STL(TYPE) +#else +#define Q_DECLARE_SHARED_STL(TYPE) \ +QT_END_NAMESPACE \ +namespace std { \ + template<> inline void swap(QT_PREPEND_NAMESPACE(TYPE) &value1, QT_PREPEND_NAMESPACE(TYPE) &value2) \ + { swap(value1.data_ptr(), value2.data_ptr()); } \ +} \ +QT_BEGIN_NAMESPACE +#endif + +#define Q_DECLARE_SHARED(TYPE) \ +template <> inline bool qIsDetached(TYPE &t) { return t.isDetached(); } \ +template <> inline void qSwap(TYPE &value1, TYPE &value2) \ +{ qSwap(value1.data_ptr(), value2.data_ptr()); } \ +Q_DECLARE_SHARED_STL(TYPE) + +/* + QTypeInfo primitive specializations +*/ +Q_DECLARE_TYPEINFO(bool, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(char, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(signed char, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(uchar, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(short, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(ushort, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(int, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(uint, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(long, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(ulong, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(qint64, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(quint64, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(float, Q_PRIMITIVE_TYPE); +Q_DECLARE_TYPEINFO(double, Q_PRIMITIVE_TYPE); +#ifndef Q_OS_DARWIN +Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE); +#endif + +/* + These functions make it possible to use standard C++ functions with + a similar name from Qt header files (especially template classes). +*/ +Q_CORE_EXPORT void *qMalloc(size_t size); +Q_CORE_EXPORT void qFree(void *ptr); +Q_CORE_EXPORT void *qRealloc(void *ptr, size_t size); +Q_CORE_EXPORT void *qMallocAligned(size_t size, size_t alignment); +Q_CORE_EXPORT void *qReallocAligned(void *ptr, size_t size, size_t oldsize, size_t alignment); +Q_CORE_EXPORT void qFreeAligned(void *ptr); +Q_CORE_EXPORT void *qMemCopy(void *dest, const void *src, size_t n); +Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n); + + +/* + Avoid some particularly useless warnings from some stupid compilers. + To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out + the line "#define QT_NO_WARNINGS". +*/ +#if !defined(QT_CC_WARNINGS) +# define QT_NO_WARNINGS +#endif +#if defined(QT_NO_WARNINGS) +# if defined(Q_CC_MSVC) +# pragma warning(disable: 4251) /* class 'A' needs to have dll interface for to be used by clients of class 'B'. */ +# pragma warning(disable: 4244) /* 'conversion' conversion from 'type1' to 'type2', possible loss of data */ +# pragma warning(disable: 4275) /* non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' */ +# pragma warning(disable: 4514) /* unreferenced inline/local function has been removed */ +# pragma warning(disable: 4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */ +# pragma warning(disable: 4097) /* typedef-name 'identifier1' used as synonym for class-name 'identifier2' */ +# pragma warning(disable: 4706) /* assignment within conditional expression */ +# pragma warning(disable: 4786) /* truncating debug info after 255 characters */ +# pragma warning(disable: 4660) /* template-class specialization 'identifier' is already instantiated */ +# pragma warning(disable: 4355) /* 'this' : used in base member initializer list */ +# pragma warning(disable: 4231) /* nonstandard extension used : 'extern' before template explicit instantiation */ +# pragma warning(disable: 4710) /* function not inlined */ +# pragma warning(disable: 4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify -GX */ +# elif defined(Q_CC_BOR) +# pragma option -w-inl +# pragma option -w-aus +# pragma warn -inl +# pragma warn -pia +# pragma warn -ccc +# pragma warn -rch +# pragma warn -sig +# endif +#endif + +class Q_CORE_EXPORT QFlag +{ + int i; +public: + inline QFlag(int i); + inline operator int() const { return i; } +}; + +inline QFlag::QFlag(int ai) : i(ai) {} + +class Q_CORE_EXPORT QIncompatibleFlag +{ + int i; +public: + inline explicit QIncompatibleFlag(int i); + inline operator int() const { return i; } +}; + +inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {} + + +#ifndef Q_NO_TYPESAFE_FLAGS + +template +class QFlags +{ + typedef void **Zero; + int i; +public: + typedef Enum enum_type; + inline QFlags(const QFlags &f) : i(f.i) {} + inline QFlags(Enum f) : i(f) {} + inline QFlags(Zero = 0) : i(0) {} + inline QFlags(QFlag f) : i(f) {} + + inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; } + inline QFlags &operator&=(int mask) { i &= mask; return *this; } + inline QFlags &operator&=(uint mask) { i &= mask; return *this; } + inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; } + inline QFlags &operator|=(Enum f) { i |= f; return *this; } + inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; } + inline QFlags &operator^=(Enum f) { i ^= f; return *this; } + + inline operator int() const { return i; } + + inline QFlags operator|(QFlags f) const { QFlags g; g.i = i | f.i; return g; } + inline QFlags operator|(Enum f) const { QFlags g; g.i = i | f; return g; } + inline QFlags operator^(QFlags f) const { QFlags g; g.i = i ^ f.i; return g; } + inline QFlags operator^(Enum f) const { QFlags g; g.i = i ^ f; return g; } + inline QFlags operator&(int mask) const { QFlags g; g.i = i & mask; return g; } + inline QFlags operator&(uint mask) const { QFlags g; g.i = i & mask; return g; } + inline QFlags operator&(Enum f) const { QFlags g; g.i = i & f; return g; } + inline QFlags operator~() const { QFlags g; g.i = ~i; return g; } + + inline bool operator!() const { return !i; } + + inline bool testFlag(Enum f) const { return (i & f) == f && (f != 0 || i == int(f) ); } +}; + +#define Q_DECLARE_FLAGS(Flags, Enum)\ +typedef QFlags Flags; + +#define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \ +inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) \ +{ return QIncompatibleFlag(int(f1) | f2); } + +#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \ +inline QFlags operator|(Flags::enum_type f1, Flags::enum_type f2) \ +{ return QFlags(f1) | f2; } \ +inline QFlags operator|(Flags::enum_type f1, QFlags f2) \ +{ return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) + + +#else /* Q_NO_TYPESAFE_FLAGS */ + +#define Q_DECLARE_FLAGS(Flags, Enum)\ +typedef uint Flags; +#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) + +#endif /* Q_NO_TYPESAFE_FLAGS */ + +#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT) +/* make use of typeof-extension */ +template +class QForeachContainer { +public: + inline QForeachContainer(const T& t) : c(t), brk(0), i(c.begin()), e(c.end()) { } + const T c; + int brk; + typename T::const_iterator i, e; +}; + +#define Q_FOREACH(variable, container) \ +for (QForeachContainer<__typeof__(container)> _container_(container); \ + !_container_.brk && _container_.i != _container_.e; \ + __extension__ ({ ++_container_.brk; ++_container_.i; })) \ + for (variable = *_container_.i;; __extension__ ({--_container_.brk; break;})) + +#else + +struct QForeachContainerBase {}; + +template +class QForeachContainer : public QForeachContainerBase { +public: + inline QForeachContainer(const T& t): c(t), brk(0), i(c.begin()), e(c.end()){}; + const T c; + mutable int brk; + mutable typename T::const_iterator i, e; + inline bool condition() const { return (!brk++ && i != e); } +}; + +template inline T *qForeachPointer(const T &) { return 0; } + +template inline QForeachContainer qForeachContainerNew(const T& t) +{ return QForeachContainer(t); } + +template +inline const QForeachContainer *qForeachContainer(const QForeachContainerBase *base, const T *) +{ return static_cast *>(base); } + +#if defined(Q_CC_MIPS) +/* + Proper for-scoping in MIPSpro CC +*/ +# define Q_FOREACH(variable,container) \ + if(0){}else \ + for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \ + qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->condition(); \ + ++qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i) \ + for (variable = *qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i; \ + qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk; \ + --qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk) + +#elif defined(Q_CC_DIAB) +// VxWorks DIAB generates unresolvable symbols, if container is a function call +# define Q_FOREACH(variable,container) \ + if(0){}else \ + for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \ + qForeachContainer(&_container_, (__typeof__(container) *) 0)->condition(); \ + ++qForeachContainer(&_container_, (__typeof__(container) *) 0)->i) \ + for (variable = *qForeachContainer(&_container_, (__typeof__(container) *) 0)->i; \ + qForeachContainer(&_container_, (__typeof__(container) *) 0)->brk; \ + --qForeachContainer(&_container_, (__typeof__(container) *) 0)->brk) + +#else +# define Q_FOREACH(variable, container) \ + for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \ + qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->condition(); \ + ++qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i) \ + for (variable = *qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i; \ + qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk; \ + --qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk) +#endif // MSVC6 || MIPSpro + +#endif + +#define Q_FOREVER for(;;) +#ifndef QT_NO_KEYWORDS +# ifndef foreach +# define foreach Q_FOREACH +# endif +# ifndef forever +# define forever Q_FOREVER +# endif +#endif + +#if 0 +/* tell gcc to use its built-in methods for some common functions */ +#if defined(QT_NO_DEBUG) && defined(Q_CC_GNU) +# define qMemCopy __builtin_memcpy +# define qMemSet __builtin_memset +#endif +#endif + +template static inline T *qGetPtrHelper(T *ptr) { return ptr; } +template static inline typename Wrapper::pointer qGetPtrHelper(const Wrapper &p) { return p.data(); } + +#define Q_DECLARE_PRIVATE(Class) \ + inline Class##Private* d_func() { return reinterpret_cast(qGetPtrHelper(d_ptr)); } \ + inline const Class##Private* d_func() const { return reinterpret_cast(qGetPtrHelper(d_ptr)); } \ + friend class Class##Private; + +#define Q_DECLARE_PRIVATE_D(Dptr, Class) \ + inline Class##Private* d_func() { return reinterpret_cast(Dptr); } \ + inline const Class##Private* d_func() const { return reinterpret_cast(Dptr); } \ + friend class Class##Private; + +#define Q_DECLARE_PUBLIC(Class) \ + inline Class* q_func() { return static_cast(q_ptr); } \ + inline const Class* q_func() const { return static_cast(q_ptr); } \ + friend class Class; + +#define Q_D(Class) Class##Private * const d = d_func() +#define Q_Q(Class) Class * const q = q_func() + +#define QT_TR_NOOP(x) (x) +#define QT_TR_NOOP_UTF8(x) (x) +#define QT_TRANSLATE_NOOP(scope, x) (x) +#define QT_TRANSLATE_NOOP_UTF8(scope, x) (x) +#define QT_TRANSLATE_NOOP3(scope, x, comment) {x, comment} +#define QT_TRANSLATE_NOOP3_UTF8(scope, x, comment) {x, comment} + +#ifndef QT_NO_TRANSLATION // ### This should enclose the NOOPs above + +// Defined in qcoreapplication.cpp +// The better name qTrId() is reserved for an upcoming function which would +// return a much more powerful QStringFormatter instead of a QString. +Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1); + +#define QT_TRID_NOOP(id) id + +#endif // QT_NO_TRANSLATION + +#define QDOC_PROPERTY(text) + +/* + When RTTI is not available, define this macro to force any uses of + dynamic_cast to cause a compile failure. +*/ + +#ifdef QT_NO_DYNAMIC_CAST +# define dynamic_cast QT_PREPEND_NAMESPACE(qt_dynamic_cast_check) + + template + T qt_dynamic_cast_check(X, T* = 0) + { return T::dynamic_cast_will_always_fail_because_rtti_is_disabled; } +#endif + +/* + Some classes do not permit copies to be made of an object. These + classes contains a private copy constructor and assignment + operator to disable copying (the compiler gives an error message). +*/ +#define Q_DISABLE_COPY(Class) \ + Class(const Class &); \ + Class &operator=(const Class &); + +class QByteArray; +Q_CORE_EXPORT QByteArray qgetenv(const char *varName); +Q_CORE_EXPORT bool qputenv(const char *varName, const QByteArray& value); + +inline int qIntCast(double f) { return int(f); } +inline int qIntCast(float f) { return int(f); } + +/* + Reentrant versions of basic rand() functions for random number generation +*/ +Q_CORE_EXPORT void qsrand(uint seed); +Q_CORE_EXPORT int qrand(); + +/* + Compat functions that were generated by configure +*/ +#ifdef QT3_SUPPORT +#ifndef QT_PRODUCT_LICENSEE +# define QT_PRODUCT_LICENSEE QLibraryInfo::licensee() +#endif +#ifndef QT_PRODUCT_LICENSE +# define QT_PRODUCT_LICENSE QLibraryInfo::licensedProducts() +#endif +QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPath(); +QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathDocs(); +QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathHeaders(); +QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathLibs(); +QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathBins(); +QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathPlugins(); +QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathData(); +QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathTranslations(); +QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); +#endif + +#if defined(Q_OS_SYMBIAN) + +#ifdef SYMBIAN_BUILD_GCE +#define Q_SYMBIAN_SUPPORTS_SURFACES +//RWsPointerCursor is fixed, so don't use low performance sprites +#define Q_SYMBIAN_FIXED_POINTER_CURSORS +#define Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE +#define Q_SYMBIAN_WINDOW_SIZE_CACHE +#define QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER + +//enabling new graphics resources +#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE +# define QT_SYMBIAN_SUPPORTS_SGIMAGE +#endif + +#ifdef SYMBIAN_GRAPHICS_SET_SURFACE_TRANSPARENCY_AVAILABLE +# define Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE +#endif + +#ifdef SYMBIAN_GRAPHICS_TRANSITION_EFFECTS_SIGNALING_AVAILABLE +# define Q_SYMBIAN_TRANSITION_EFFECTS +#endif +#endif + +#ifdef SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS +#define Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS +#endif + +#ifdef SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION +#define Q_SYMBIAN_SUPPORTS_FIXNATIVEORIENTATION +#endif + +//Symbian does not support data imports from a DLL +#define Q_NO_DATA_RELOCATION + +QT_END_NAMESPACE +// forward declare std::exception +#ifdef __cplusplus +namespace std { class exception; } +#endif +QT_BEGIN_NAMESPACE +Q_CORE_EXPORT void qt_symbian_throwIfError(int error); +Q_CORE_EXPORT void qt_symbian_exception2LeaveL(const std::exception& ex); +Q_CORE_EXPORT int qt_symbian_exception2Error(const std::exception& ex); + +#define QT_TRAP_THROWING(_f) \ + { \ + TInt ____error; \ + TRAP(____error, _f); \ + qt_symbian_throwIfError(____error); \ + } + +#define QT_TRYCATCH_ERROR(_err, _f) \ + { \ + _err = KErrNone; \ + try { \ + _f; \ + } catch (const std::exception &____ex) { \ + _err = qt_symbian_exception2Error(____ex); \ + } \ + } + +#define QT_TRYCATCH_LEAVING(_f) \ + { \ + TInt ____err; \ + QT_TRYCATCH_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. +*/ + +/* Qt modules */ +#define QT_MODULE_CORE 0x00001 +#define QT_MODULE_GUI 0x00002 +#define QT_MODULE_NETWORK 0x00004 +#define QT_MODULE_OPENGL 0x00008 +#define QT_MODULE_SQL 0x00010 +#define QT_MODULE_XML 0x00020 +#define QT_MODULE_QT3SUPPORTLIGHT 0x00040 +#define QT_MODULE_QT3SUPPORT 0x00080 +#define QT_MODULE_SVG 0x00100 +#define QT_MODULE_ACTIVEQT 0x00200 +#define QT_MODULE_GRAPHICSVIEW 0x00400 +#define QT_MODULE_SCRIPT 0x00800 +#define QT_MODULE_XMLPATTERNS 0x01000 +#define QT_MODULE_HELP 0x02000 +#define QT_MODULE_TEST 0x04000 +#define QT_MODULE_DBUS 0x08000 +#define QT_MODULE_SCRIPTTOOLS 0x10000 +#define QT_MODULE_OPENVG 0x20000 +#define QT_MODULE_MULTIMEDIA 0x40000 +#define QT_MODULE_DECLARATIVE 0x80000 + +/* Qt editions */ +#define QT_EDITION_CONSOLE (QT_MODULE_CORE \ + | QT_MODULE_NETWORK \ + | QT_MODULE_SQL \ + | QT_MODULE_SCRIPT \ + | QT_MODULE_MULTIMEDIA \ + | QT_MODULE_XML \ + | QT_MODULE_XMLPATTERNS \ + | QT_MODULE_TEST \ + | QT_MODULE_DBUS) +#define QT_EDITION_DESKTOPLIGHT (QT_MODULE_CORE \ + | QT_MODULE_GUI \ + | QT_MODULE_QT3SUPPORTLIGHT \ + | QT_MODULE_TEST \ + | QT_MODULE_DBUS) +#define QT_EDITION_OPENSOURCE (QT_MODULE_CORE \ + | QT_MODULE_GUI \ + | QT_MODULE_NETWORK \ + | QT_MODULE_OPENGL \ + | QT_MODULE_OPENVG \ + | QT_MODULE_SQL \ + | QT_MODULE_MULTIMEDIA \ + | QT_MODULE_XML \ + | QT_MODULE_XMLPATTERNS \ + | QT_MODULE_SCRIPT \ + | QT_MODULE_SCRIPTTOOLS \ + | QT_MODULE_QT3SUPPORTLIGHT \ + | QT_MODULE_QT3SUPPORT \ + | QT_MODULE_SVG \ + | QT_MODULE_DECLARATIVE \ + | QT_MODULE_GRAPHICSVIEW \ + | QT_MODULE_HELP \ + | QT_MODULE_TEST \ + | QT_MODULE_DBUS \ + | QT_MODULE_ACTIVEQT) +#define QT_EDITION_DESKTOP (QT_EDITION_OPENSOURCE) +#define QT_EDITION_UNIVERSAL QT_EDITION_DESKTOP +#define QT_EDITION_ACADEMIC QT_EDITION_DESKTOP +#define QT_EDITION_EDUCATIONAL QT_EDITION_DESKTOP +#define QT_EDITION_EVALUATION QT_EDITION_DESKTOP + +/* Determine which modules can be used */ +#ifndef QT_EDITION +# ifdef QT_BUILD_QMAKE +# define QT_EDITION QT_EDITION_DESKTOP +# else +# error "Qt not configured correctly, please run configure" +# endif +#endif + +#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 +#if (QT_EDITION & QT_MODULE_GUI) +QT_LICENSED_MODULE(Gui) +#endif +#if (QT_EDITION & QT_MODULE_NETWORK) +QT_LICENSED_MODULE(Network) +#endif +#if (QT_EDITION & QT_MODULE_OPENGL) +QT_LICENSED_MODULE(OpenGL) +#endif +#if (QT_EDITION & QT_MODULE_OPENVG) +QT_LICENSED_MODULE(OpenVG) +#endif +#if (QT_EDITION & QT_MODULE_SQL) +QT_LICENSED_MODULE(Sql) +#endif +#if (QT_EDITION & QT_MODULE_MULTIMEDIA) +QT_LICENSED_MODULE(Multimedia) +#endif +#if (QT_EDITION & QT_MODULE_XML) +QT_LICENSED_MODULE(Xml) +#endif +#if (QT_EDITION & QT_MODULE_XMLPATTERNS) +QT_LICENSED_MODULE(XmlPatterns) +#endif +#if (QT_EDITION & QT_MODULE_HELP) +QT_LICENSED_MODULE(Help) +#endif +#if (QT_EDITION & QT_MODULE_SCRIPT) || defined(QT_BUILD_QMAKE) +QT_LICENSED_MODULE(Script) +#endif +#if (QT_EDITION & QT_MODULE_SCRIPTTOOLS) +QT_LICENSED_MODULE(ScriptTools) +#endif +#if (QT_EDITION & QT_MODULE_QT3SUPPORTLIGHT) +QT_LICENSED_MODULE(Qt3SupportLight) +#endif +#if (QT_EDITION & QT_MODULE_QT3SUPPORT) +QT_LICENSED_MODULE(Qt3Support) +#endif +#if (QT_EDITION & QT_MODULE_SVG) +QT_LICENSED_MODULE(Svg) +#endif +#if (QT_EDITION & QT_MODULE_DECLARATIVE) +QT_LICENSED_MODULE(Declarative) +#endif +#if (QT_EDITION & QT_MODULE_ACTIVEQT) +QT_LICENSED_MODULE(ActiveQt) +#endif +#if (QT_EDITION & QT_MODULE_TEST) +QT_LICENSED_MODULE(Test) +#endif +#if (QT_EDITION & QT_MODULE_DBUS) +QT_LICENSED_MODULE(DBus) +#endif + +#define QT_MODULE(x) \ + typedef QtValidLicenseFor##x##Module Qt##x##Module; + +#ifdef QT_NO_CONCURRENT +# define QT_NO_QFUTURE +#endif + +// gcc 3 version has problems with some of the +// map/filter overloads. +#if defined(Q_CC_GNU) && (__GNUC__ < 4) +# define QT_NO_CONCURRENT_MAP +# define QT_NO_CONCURRENT_FILTER +#endif + +#ifdef Q_OS_QNX +// QNX doesn't have SYSV style shared memory. Multiprocess QWS apps, +// shared fonts and QSystemSemaphore + QSharedMemory are not available +# define QT_NO_QWS_MULTIPROCESS +# define QT_NO_QWS_SHARE_FONTS +# define QT_NO_SYSTEMSEMAPHORE +# define QT_NO_SHAREDMEMORY +// QNX currently doesn't support forking in a thread, so disable QProcess +# define QT_NO_PROCESS +#endif + +#if defined (__ELF__) +# if defined (Q_OS_LINUX) || defined (Q_OS_SOLARIS) || defined (Q_OS_FREEBSD) || defined (Q_OS_OPENBSD) || defined (Q_OS_IRIX) +# define Q_OF_ELF +# endif +#endif + +#if !(defined(Q_WS_WIN) && !defined(Q_WS_WINCE)) \ + && !(defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)) \ + && !(defined(Q_WS_X11) && !defined(QT_NO_FREETYPE)) +# define QT_NO_RAWFONT +#endif + +QT_END_NAMESPACE +QT_END_HEADER + +#endif /* __cplusplus */ + +#endif /* QGLOBAL_H */ diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp new file mode 100644 index 0000000000..aca1cb1db6 --- /dev/null +++ b/src/corelib/global/qlibraryinfo.cpp @@ -0,0 +1,555 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdir.h" +#include "qfile.h" +#include "qconfig.h" +#include "qsettings.h" +#include "qlibraryinfo.h" +#include "qscopedpointer.h" + +#if defined(QT_BUILD_QMAKE) || defined(QT_BOOTSTRAPPED) +# define BOOTSTRAPPING +#endif + +#ifdef BOOTSTRAPPING +QT_BEGIN_NAMESPACE +extern QString qmake_libraryInfoFile(); +QT_END_NAMESPACE +#else +# include "qcoreapplication.h" +#endif + +#ifdef Q_OS_MAC +# include "private/qcore_mac_p.h" +#endif + +#ifdef QLIBRARYINFO_EPOCROOT +# include "symbian/epocroot_p.h" +#endif + +#include "qconfig.cpp" + +QT_BEGIN_NAMESPACE + +extern void qDumpCPUFeatures(); // in qsimd.cpp + +#ifndef QT_NO_SETTINGS + +struct QLibrarySettings +{ + QLibrarySettings(); + QScopedPointer settings; +}; +Q_GLOBAL_STATIC(QLibrarySettings, qt_library_settings) + +class QLibraryInfoPrivate +{ +public: + static QSettings *findConfiguration(); + static void cleanup() + { + QLibrarySettings *ls = qt_library_settings(); + if (ls) + ls->settings.reset(0); + } + static QSettings *configuration() + { + QLibrarySettings *ls = qt_library_settings(); + return ls ? ls->settings.data() : 0; + } +}; + +QLibrarySettings::QLibrarySettings() + : settings(QLibraryInfoPrivate::findConfiguration()) +{ +#ifndef BOOTSTRAPPING + qAddPostRoutine(QLibraryInfoPrivate::cleanup); +#endif +} + +QSettings *QLibraryInfoPrivate::findConfiguration() +{ + QString qtconfig = QLatin1String(":/qt/etc/qt.conf"); +#ifdef BOOTSTRAPPING + if(!QFile::exists(qtconfig)) + qtconfig = qmake_libraryInfoFile(); +#else + if (!QFile::exists(qtconfig) && QCoreApplication::instance()) { +#ifdef Q_OS_MAC + CFBundleRef bundleRef = CFBundleGetMainBundle(); + if (bundleRef) { + QCFType urlRef = CFBundleCopyResourceURL(bundleRef, + QCFString(QLatin1String("qt.conf")), + 0, + 0); + if (urlRef) { + QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle); + qtconfig = QDir::cleanPath(path); + } + } + if (qtconfig.isEmpty()) +#endif + { + QDir pwd(QCoreApplication::applicationDirPath()); + qtconfig = pwd.filePath(QLatin1String("qt.conf")); + } + } +#endif + if (QFile::exists(qtconfig)) + return new QSettings(qtconfig, QSettings::IniFormat); + return 0; //no luck +} + +/*! + \class QLibraryInfo + \brief The QLibraryInfo class provides information about the Qt library. + + Many pieces of information are established when Qt is configured. + Installation paths, license information, and even a unique build + key. This class provides an abstraction for accessing this + information. + + \table + \header \o Function \o Return value + \row \o buildKey() \o A string that identifies the Qt version and + the configuration. This key is used to ensure + that \l{plugins} link against the same version + of Qt as the application. + \row \o location() \o The path to a certain Qt + component (e.g., documentation, header files). + \row \o licensee(), + licensedProducts() \o Licensing information. + \endtable + + You can also use a \c qt.conf file to override the hard-coded paths + that are compiled into the Qt library. For more information, see + the \l {Using qt.conf} documentation. + + \sa QSysInfo, {Using qt.conf} +*/ + +/*! \internal + + You cannot create a QLibraryInfo, instead only the static functions are available to query + information. +*/ + +QLibraryInfo::QLibraryInfo() +{ } + +/*! + Returns the person to whom this build of Qt is licensed. + + \sa licensedProducts() +*/ + +QString +QLibraryInfo::licensee() +{ + const char *str = QT_CONFIGURE_LICENSEE; + return QString::fromLocal8Bit(str); +} + +/*! + Returns the products that the license for this build of Qt has access to. + + \sa licensee() +*/ + +QString +QLibraryInfo::licensedProducts() +{ + const char *str = QT_CONFIGURE_LICENSED_PRODUCTS; + return QString::fromLatin1(str); +} + +/*! + Returns a unique key identifying this build of Qt and its + configurations. This key is not globally unique, rather only useful + for establishing of two configurations are compatible. This can be + used to compare with the \c QT_BUILD_KEY preprocessor symbol. + + \sa location() +*/ + +QString +QLibraryInfo::buildKey() +{ + return QString::fromLatin1(QT_BUILD_KEY); +} + +/*! + \since 4.6 + Returns the installation date for this build of Qt. The install date will + usually be the last time that Qt sources were configured. +*/ +#ifndef QT_NO_DATESTRING +QDate +QLibraryInfo::buildDate() +{ + return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate); +} +#endif //QT_NO_DATESTRING + +/*! + Returns the location specified by \a loc. + +*/ + +QString +QLibraryInfo::location(LibraryLocation loc) +{ + QString ret; + if(!QLibraryInfoPrivate::configuration()) { + const char *path = 0; + switch (loc) { +#ifdef QT_CONFIGURE_PREFIX_PATH + case PrefixPath: + path = QT_CONFIGURE_PREFIX_PATH; + break; +#endif +#ifdef QT_CONFIGURE_DOCUMENTATION_PATH + case DocumentationPath: + path = QT_CONFIGURE_DOCUMENTATION_PATH; + break; +#endif +#ifdef QT_CONFIGURE_HEADERS_PATH + case HeadersPath: + path = QT_CONFIGURE_HEADERS_PATH; + break; +#endif +#ifdef QT_CONFIGURE_LIBRARIES_PATH + case LibrariesPath: + path = QT_CONFIGURE_LIBRARIES_PATH; + break; +#endif +#ifdef QT_CONFIGURE_BINARIES_PATH + case BinariesPath: + path = QT_CONFIGURE_BINARIES_PATH; + break; +#endif +#ifdef QT_CONFIGURE_PLUGINS_PATH + case PluginsPath: + path = QT_CONFIGURE_PLUGINS_PATH; + break; +#endif +#ifdef QT_CONFIGURE_IMPORTS_PATH + case ImportsPath: + path = QT_CONFIGURE_IMPORTS_PATH; + break; +#endif +#ifdef QT_CONFIGURE_DATA_PATH + case DataPath: + path = QT_CONFIGURE_DATA_PATH; + break; +#endif +#ifdef QT_CONFIGURE_TRANSLATIONS_PATH + case TranslationsPath: + path = QT_CONFIGURE_TRANSLATIONS_PATH; + break; +#endif +#ifdef QT_CONFIGURE_SETTINGS_PATH + case SettingsPath: + path = QT_CONFIGURE_SETTINGS_PATH; + break; +#endif +#ifdef QT_CONFIGURE_EXAMPLES_PATH + case ExamplesPath: + path = QT_CONFIGURE_EXAMPLES_PATH; + break; +#endif +#ifdef QT_CONFIGURE_DEMOS_PATH + case DemosPath: + path = QT_CONFIGURE_DEMOS_PATH; + break; +#endif + default: + break; + } + + if (path) + ret = QString::fromLocal8Bit(path); + } else { + QString key; + QString defaultValue; + switch(loc) { + case PrefixPath: + key = QLatin1String("Prefix"); + break; + case DocumentationPath: + key = QLatin1String("Documentation"); + defaultValue = QLatin1String("doc"); + break; + case HeadersPath: + key = QLatin1String("Headers"); + defaultValue = QLatin1String("include"); + break; + case LibrariesPath: + key = QLatin1String("Libraries"); + defaultValue = QLatin1String("lib"); + break; + case BinariesPath: + key = QLatin1String("Binaries"); + defaultValue = QLatin1String("bin"); + break; + case PluginsPath: + key = QLatin1String("Plugins"); + defaultValue = QLatin1String("plugins"); + break; + case ImportsPath: + key = QLatin1String("Imports"); + defaultValue = QLatin1String("imports"); + break; + case DataPath: + key = QLatin1String("Data"); + break; + case TranslationsPath: + key = QLatin1String("Translations"); + defaultValue = QLatin1String("translations"); + break; + case SettingsPath: + key = QLatin1String("Settings"); + break; + case ExamplesPath: + key = QLatin1String("Examples"); + break; + case DemosPath: + key = QLatin1String("Demos"); + break; + default: + break; + } + + if(!key.isNull()) { + QSettings *config = QLibraryInfoPrivate::configuration(); + config->beginGroup(QLatin1String("Paths")); + + QString subKey; + { + /* + find the child group whose version number is closest + to the library version. for example and we have the + following groups: + + Paths + Paths/4.0 + Paths/4.1.2 + Paths/4.2.5 + Paths/5 + + if QT_VERSION is 4.0.1, then we use 'Paths/4.0' + if QT_VERSION is 4.1.5, then we use 'Paths/4.1.2' + if QT_VERSION is 4.6.3, then we use 'Paths/4.2.5' + if QT_VERSION is 6.0.2, then we use 'Paths/5' + + note: any of the trailing version numbers may be + omitted (in which case, they default to zero), + i.e. 4 == 4.0.0, 4.1 == 4.1.0, and so on + */ + enum { + QT_MAJOR = ((QT_VERSION >> 16) & 0xFF), + QT_MINOR = ((QT_VERSION >> 8) & 0xFF), + QT_PATCH = (QT_VERSION & 0xFF) + }; + int maj = 0, min = 0, pat = 0; + QStringList children = config->childGroups(); + for(int child = 0; child < children.size(); ++child) { + QString cver = children.at(child); + QStringList cver_list = cver.split(QLatin1Char('.')); + if(cver_list.size() > 0 && cver_list.size() < 4) { + bool ok; + int cmaj = -1, cmin = -1, cpat = -1; + cmaj = cver_list[0].toInt(&ok); + if(!ok || cmaj < 0) + continue; + if(cver_list.size() >= 2) { + cmin = cver_list[1].toInt(&ok); + if(!ok) + continue; + if(cmin < 0) + cmin = -1; + } + if(cver_list.size() >= 3) { + cpat = cver_list[2].toInt(&ok); + if(!ok) + continue; + if(cpat < 0) + cpat = -1; + } + if((cmaj >= maj && cmaj <= QT_MAJOR) && + (cmin == -1 || (cmin >= min && cmin <= QT_MINOR)) && + (cpat == -1 || (cpat >= pat && cpat <= QT_PATCH)) && + config->contains(cver + QLatin1Char('/') + key)) { + subKey = cver + QLatin1Char('/'); + maj = cmaj; + min = cmin; + pat = cpat; + } + } + } + } + ret = config->value(subKey + key, defaultValue).toString(); + // expand environment variables in the form $(ENVVAR) + int rep; + QRegExp reg_var(QLatin1String("\\$\\(.*\\)")); + reg_var.setMinimal(true); + while((rep = reg_var.indexIn(ret)) != -1) { + ret.replace(rep, reg_var.matchedLength(), + QString::fromLocal8Bit(qgetenv(ret.mid(rep + 2, + reg_var.matchedLength() - 3).toLatin1().constData()).constData())); + } + +#ifdef QLIBRARYINFO_EPOCROOT + // $${EPOCROOT} is a special case, resolve it similarly to qmake. + QRegExp epocrootMatcher(QLatin1String("\\$\\$\\{EPOCROOT\\}")); + if ((rep = epocrootMatcher.indexIn(ret)) != -1) + ret.replace(rep, epocrootMatcher.matchedLength(), qt_epocRoot()); +#endif + + config->endGroup(); + } + } + + if (QDir::isRelativePath(ret)) { + if (loc == PrefixPath) { + // we make the prefix path absolute to the executable's directory +#ifdef BOOTSTRAPPING + return QFileInfo(qmake_libraryInfoFile()).absolutePath(); +#else + if (QCoreApplication::instance()) { +#ifdef Q_OS_MAC + CFBundleRef bundleRef = CFBundleGetMainBundle(); + if (bundleRef) { + QCFType urlRef = CFBundleCopyBundleURL(bundleRef); + if (urlRef) { + QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle); + return QDir::cleanPath(QString(path) + QLatin1String("/Contents/") + ret); + } + } +#endif + return QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(ret); + } else { + return QDir::current().absoluteFilePath(ret); + } +#endif + } else { + // we make any other path absolute to the prefix directory + return QDir(location(PrefixPath)).absoluteFilePath(ret); + } + } + return ret; +} + +/*! + \enum QLibraryInfo::LibraryLocation + + \keyword library location + + This enum type is used to specify a specific location + specifier: + + \value PrefixPath The default prefix for all paths. + \value DocumentationPath The location for documentation upon install. + \value HeadersPath The location for all headers. + \value LibrariesPath The location of installed libraries. + \value BinariesPath The location of installed Qt binaries (tools and applications). + \value PluginsPath The location of installed Qt plugins. + \value ImportsPath The location of installed QML extensions to import. + \value DataPath The location of general Qt data. + \value TranslationsPath The location of translation information for Qt strings. + \value SettingsPath The location for Qt settings. + \value ExamplesPath The location for examples upon install. + \value DemosPath The location for demos upon install. + + \sa location() +*/ + +#endif // QT_NO_SETTINGS + +QT_END_NAMESPACE + +#if defined(Q_CC_GNU) && defined(ELF_INTERPRETER) +# include +# include + +extern const char qt_core_interpreter[] __attribute__((section(".interp"))) + = ELF_INTERPRETER; + +extern "C" void qt_core_boilerplate(); +void qt_core_boilerplate() +{ + printf("This is the QtCore library version " QT_VERSION_STR "\n" + "Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).\n" + "Contact: Nokia Corporation (qt-info@nokia.com)\n" + "\n" + "Build key: " QT_BUILD_KEY "\n" + "Compat build key: " +#ifdef QT_BUILD_KEY_COMPAT + "| " QT_BUILD_KEY_COMPAT " " +#endif +#ifdef QT_BUILD_KEY_COMPAT2 + "| " QT_BUILD_KEY_COMPAT2 " " +#endif +#ifdef QT_BUILD_KEY_COMPAT3 + "| " QT_BUILD_KEY_COMPAT3 " " +#endif + "|\n" + "Build date: %s\n" + "Installation prefix: %s\n" + "Library path: %s\n" + "Include path: %s\n", + qt_configure_installation + 12, + qt_configure_prefix_path_str + 12, + qt_configure_libraries_path_str + 12, + qt_configure_headers_path_str + 12); + + QT_PREPEND_NAMESPACE(qDumpCPUFeatures)(); + +#ifdef QT_EVAL + extern void qt_core_eval_init(uint); + qt_core_eval_init(1); +#endif + + exit(0); +} + +#endif diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h new file mode 100644 index 0000000000..8ed64affad --- /dev/null +++ b/src/corelib/global/qlibraryinfo.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QLIBRARYINFO_H +#define QLIBRARYINFO_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +#ifndef QT_NO_SETTINGS + +class Q_CORE_EXPORT QLibraryInfo +{ +public: + static QString licensee(); + static QString licensedProducts(); + + static QString buildKey(); +#ifndef QT_NO_DATESTRING + static QDate buildDate(); +#endif //QT_NO_DATESTRING + + enum LibraryLocation + { + PrefixPath, + DocumentationPath, + HeadersPath, + LibrariesPath, + BinariesPath, + PluginsPath, + DataPath, + TranslationsPath, + SettingsPath, + DemosPath, + ExamplesPath, + ImportsPath + }; + static QString location(LibraryLocation); // ### Qt 5: consider renaming it to path() + +private: + QLibraryInfo(); +}; + +#endif /* QT_NO_SETTINGS */ + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QLIBRARYINFO_H diff --git a/src/corelib/global/qmalloc.cpp b/src/corelib/global/qmalloc.cpp new file mode 100644 index 0000000000..a12b0ba242 --- /dev/null +++ b/src/corelib/global/qmalloc.cpp @@ -0,0 +1,127 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qplatformdefs.h" + +#include + +/* + Define the container allocation functions in a separate file, so that our + users can easily override them. +*/ + +QT_BEGIN_NAMESPACE + +void *qMalloc(size_t size) +{ + return ::malloc(size); +} + +void qFree(void *ptr) +{ + ::free(ptr); +} + +void *qRealloc(void *ptr, size_t size) +{ + return ::realloc(ptr, size); +} + +void *qMallocAligned(size_t size, size_t alignment) +{ + return qReallocAligned(0, size, 0, alignment); +} + +void *qReallocAligned(void *oldptr, size_t newsize, size_t oldsize, size_t alignment) +{ + // fake an aligned allocation + Q_UNUSED(oldsize); + + void *actualptr = oldptr ? static_cast(oldptr)[-1] : 0; + if (alignment <= sizeof(void*)) { + // special, fast case + void **newptr = static_cast(qRealloc(actualptr, newsize + sizeof(void*))); + if (!newptr) + return 0; + if (newptr == actualptr) { + // realloc succeeded without reallocating + return oldptr; + } + + *newptr = newptr; + return newptr + 1; + } + + // qMalloc returns pointers aligned at least at sizeof(size_t) boundaries + // but usually more (8- or 16-byte boundaries). + // So we overallocate by alignment-sizeof(size_t) bytes, so we're guaranteed to find a + // somewhere within the first alignment-sizeof(size_t) that is properly aligned. + + // However, we need to store the actual pointer, so we need to allocate actually size + + // alignment anyway. + + void *real = qRealloc(actualptr, newsize + alignment); + if (!real) + return 0; + + quintptr faked = reinterpret_cast(real) + alignment; + faked &= ~(alignment - 1); + + void **faked_ptr = reinterpret_cast(faked); + + // now save the value of the real pointer at faked-sizeof(void*) + // by construction, alignment > sizeof(void*) and is a power of 2, so + // faked-sizeof(void*) is properly aligned for a pointer + faked_ptr[-1] = real; + + return faked_ptr; +} + +void qFreeAligned(void *ptr) +{ + if (!ptr) + return; + void **ptr2 = static_cast(ptr); + free(ptr2[-1]); +} + +QT_END_NAMESPACE + diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h new file mode 100644 index 0000000000..75ce68afbf --- /dev/null +++ b/src/corelib/global/qnamespace.h @@ -0,0 +1,1882 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNAMESPACE_H +#define QNAMESPACE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +#ifndef Q_MOC_RUN +namespace +#else +class Q_CORE_EXPORT +#endif +Qt { + +#if defined(Q_MOC_RUN) + Q_OBJECT +#endif + +#if (defined(Q_MOC_RUN) || defined(QT_JAMBI_RUN)) + // NOTE: Generally, do not add Q_ENUMS if a corresponding Q_FLAGS exists. + Q_ENUMS(ScrollBarPolicy FocusPolicy ContextMenuPolicy) + Q_ENUMS(ArrowType ToolButtonStyle PenStyle PenCapStyle PenJoinStyle BrushStyle) + Q_ENUMS(FillRule MaskMode BGMode ClipOperation SizeMode) + Q_ENUMS(BackgroundMode) // Qt3 + Q_ENUMS(Axis Corner LayoutDirection SizeHint Orientation DropAction) + Q_FLAGS(Alignment Orientations DropActions) + Q_FLAGS(DockWidgetAreas ToolBarAreas) + Q_ENUMS(DockWidgetArea ToolBarArea) + Q_ENUMS(TextFormat) + Q_ENUMS(TextElideMode) + Q_ENUMS(DateFormat TimeSpec DayOfWeek) + Q_ENUMS(CursorShape GlobalColor) + Q_ENUMS(AspectRatioMode TransformationMode) + Q_FLAGS(ImageConversionFlags) + Q_ENUMS(Key ShortcutContext) + Q_ENUMS(TextInteractionFlag) + Q_FLAGS(TextInteractionFlags) + Q_ENUMS(ItemSelectionMode) + Q_FLAGS(ItemFlags) + Q_ENUMS(CheckState) + Q_ENUMS(SortOrder CaseSensitivity) + Q_FLAGS(MatchFlags) + Q_FLAGS(KeyboardModifiers MouseButtons) + Q_ENUMS(WindowType WindowState WindowModality WidgetAttribute ApplicationAttribute) + Q_ENUMS(InputMethodHint) + Q_FLAGS(WindowFlags WindowStates InputMethodHints) + Q_ENUMS(ConnectionType) +#ifndef QT_NO_GESTURES + Q_ENUMS(GestureState) + Q_ENUMS(GestureType) +#endif +#endif // (defined(Q_MOC_RUN) || defined(QT_JAMBI_RUN)) + +#if defined(Q_MOC_RUN) +public: +#endif + + enum GlobalColor { + color0, + color1, + black, + white, + darkGray, + gray, + lightGray, + red, + green, + blue, + cyan, + magenta, + yellow, + darkRed, + darkGreen, + darkBlue, + darkCyan, + darkMagenta, + darkYellow, + transparent + }; + + enum KeyboardModifier { + NoModifier = 0x00000000, + ShiftModifier = 0x02000000, + ControlModifier = 0x04000000, + AltModifier = 0x08000000, + MetaModifier = 0x10000000, + KeypadModifier = 0x20000000, + GroupSwitchModifier = 0x40000000, + // Do not extend the mask to include 0x01000000 + KeyboardModifierMask = 0xfe000000 + }; + Q_DECLARE_FLAGS(KeyboardModifiers, KeyboardModifier) + + //shorter names for shortcuts + enum Modifier { + META = Qt::MetaModifier, + SHIFT = Qt::ShiftModifier, + CTRL = Qt::ControlModifier, + ALT = Qt::AltModifier, + MODIFIER_MASK = KeyboardModifierMask, + UNICODE_ACCEL = 0x00000000 + }; + + enum MouseButton { + NoButton = 0x00000000, + LeftButton = 0x00000001, + RightButton = 0x00000002, + MidButton = 0x00000004, // ### Qt 5: remove me + MiddleButton = MidButton, + XButton1 = 0x00000008, + XButton2 = 0x00000010, + MouseButtonMask = 0x000000ff + }; + Q_DECLARE_FLAGS(MouseButtons, MouseButton) + +#ifdef QT3_SUPPORT + enum ButtonState_enum { + ShiftButton = Qt::ShiftModifier, + ControlButton = Qt::ControlModifier, + AltButton = Qt::AltModifier, + MetaButton = Qt::MetaModifier, + Keypad = Qt::KeypadModifier, + KeyButtonMask = Qt::KeyboardModifierMask + }; + typedef int ButtonState; +#endif + + enum Orientation { + Horizontal = 0x1, + Vertical = 0x2 + }; + + Q_DECLARE_FLAGS(Orientations, Orientation) + + enum FocusPolicy { + NoFocus = 0, + TabFocus = 0x1, + ClickFocus = 0x2, + StrongFocus = TabFocus | ClickFocus | 0x8, + WheelFocus = StrongFocus | 0x4 + }; + + enum SortOrder { + AscendingOrder, + DescendingOrder +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + ,Ascending = AscendingOrder, + Descending = DescendingOrder +#endif + }; + + enum TileRule { + StretchTile, + RepeatTile, + RoundTile + }; + + // Text formatting flags for QPainter::drawText and QLabel. + // The following two enums can be combined to one integer which + // is passed as 'flags' to drawText and qt_format_text. + + enum AlignmentFlag { + AlignLeft = 0x0001, + AlignLeading = AlignLeft, + AlignRight = 0x0002, + AlignTrailing = AlignRight, + AlignHCenter = 0x0004, + AlignJustify = 0x0008, + AlignAbsolute = 0x0010, + AlignHorizontal_Mask = AlignLeft | AlignRight | AlignHCenter | AlignJustify | AlignAbsolute, + + AlignTop = 0x0020, + AlignBottom = 0x0040, + AlignVCenter = 0x0080, + AlignVertical_Mask = AlignTop | AlignBottom | AlignVCenter, + + AlignCenter = AlignVCenter | AlignHCenter +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + , AlignAuto = AlignLeft +#endif + }; + + Q_DECLARE_FLAGS(Alignment, AlignmentFlag) + + enum TextFlag { + TextSingleLine = 0x0100, + TextDontClip = 0x0200, + TextExpandTabs = 0x0400, + TextShowMnemonic = 0x0800, + TextWordWrap = 0x1000, + TextWrapAnywhere = 0x2000, + TextDontPrint = 0x4000, + TextIncludeTrailingSpaces = 0x08000000, + TextHideMnemonic = 0x8000, + TextJustificationForced = 0x10000, + TextForceLeftToRight = 0x20000, + TextForceRightToLeft = 0x40000, + TextLongestVariant = 0x80000, + TextBypassShaping = 0x100000 + +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + ,SingleLine = TextSingleLine, + DontClip = TextDontClip, + ExpandTabs = TextExpandTabs, + ShowPrefix = TextShowMnemonic, + WordBreak = TextWordWrap, + BreakAnywhere = TextWrapAnywhere, + DontPrint = TextDontPrint, + IncludeTrailingSpaces = TextIncludeTrailingSpaces, + NoAccel = TextHideMnemonic +#endif + }; +#ifdef QT3_SUPPORT + typedef TextFlag TextFlags; +#endif + + enum TextElideMode { + ElideLeft, + ElideRight, + ElideMiddle, + ElideNone + }; + + enum WindowType { + Widget = 0x00000000, + Window = 0x00000001, + Dialog = 0x00000002 | Window, + Sheet = 0x00000004 | Window, + Drawer = 0x00000006 | Window, + Popup = 0x00000008 | Window, + Tool = 0x0000000a | Window, + ToolTip = 0x0000000c | Window, + SplashScreen = 0x0000000e | Window, + Desktop = 0x00000010 | Window, + SubWindow = 0x00000012, + + WindowType_Mask = 0x000000ff, + MSWindowsFixedSizeDialogHint = 0x00000100, + MSWindowsOwnDC = 0x00000200, + X11BypassWindowManagerHint = 0x00000400, + FramelessWindowHint = 0x00000800, + WindowTitleHint = 0x00001000, + WindowSystemMenuHint = 0x00002000, + WindowMinimizeButtonHint = 0x00004000, + WindowMaximizeButtonHint = 0x00008000, + WindowMinMaxButtonsHint = WindowMinimizeButtonHint | WindowMaximizeButtonHint, + WindowContextHelpButtonHint = 0x00010000, + WindowShadeButtonHint = 0x00020000, + WindowStaysOnTopHint = 0x00040000, + // reserved for Qt3Support: + // WMouseNoMask = 0x00080000, + // WDestructiveClose = 0x00100000, + // WStaticContents = 0x00200000, + // WGroupLeader = 0x00400000, + // WShowModal = 0x00800000, + // WNoMousePropagation = 0x01000000, + CustomizeWindowHint = 0x02000000, + WindowStaysOnBottomHint = 0x04000000, + WindowCloseButtonHint = 0x08000000, + MacWindowToolBarButtonHint = 0x10000000, + BypassGraphicsProxyWidget = 0x20000000, + WindowOkButtonHint = 0x00080000, + WindowCancelButtonHint = 0x00100000, + WindowSoftkeysVisibleHint = 0x40000000, + WindowSoftkeysRespondHint = 0x80000000 + +#ifdef QT3_SUPPORT + , + WMouseNoMask = 0x00080000, + WDestructiveClose = 0x00100000, + WStaticContents = 0x00200000, + WGroupLeader = 0x00400000, + WShowModal = 0x00800000, + WNoMousePropagation = 0x01000000, + + WType_TopLevel = Window, + WType_Dialog = Dialog, + WType_Popup = Popup, + WType_Desktop = Desktop, + WType_Mask = WindowType_Mask, + + WStyle_Customize = 0, + WStyle_NormalBorder = 0, + WStyle_DialogBorder = MSWindowsFixedSizeDialogHint, + WStyle_NoBorder = FramelessWindowHint, + WStyle_Title = WindowTitleHint, + WStyle_SysMenu = WindowSystemMenuHint, + WStyle_Minimize = WindowMinimizeButtonHint, + WStyle_Maximize = WindowMaximizeButtonHint, + WStyle_MinMax = WStyle_Minimize | WStyle_Maximize, + WStyle_Tool = Tool, + WStyle_StaysOnTop = WindowStaysOnTopHint, + WStyle_ContextHelp = WindowContextHelpButtonHint, + + // misc flags + WPaintDesktop = 0, + WPaintClever = 0, + + WX11BypassWM = X11BypassWindowManagerHint, + WWinOwnDC = MSWindowsOwnDC, + WMacSheet = Sheet, + WMacDrawer = Drawer, + + WStyle_Splash = SplashScreen, + + WNoAutoErase = 0, + WRepaintNoErase = 0, + WNorthWestGravity = WStaticContents, + WType_Modal = Dialog | WShowModal, + WStyle_Dialog = Dialog, + WStyle_NoBorderEx = FramelessWindowHint, + WResizeNoErase = 0, + WMacNoSheet = 0 +#endif + + }; + + Q_DECLARE_FLAGS(WindowFlags, WindowType) + + enum WindowState { + WindowNoState = 0x00000000, + WindowMinimized = 0x00000001, + WindowMaximized = 0x00000002, + WindowFullScreen = 0x00000004, + WindowActive = 0x00000008 + }; + + Q_DECLARE_FLAGS(WindowStates, WindowState) + + enum WidgetAttribute { + WA_Disabled = 0, + WA_UnderMouse = 1, + WA_MouseTracking = 2, + WA_ContentsPropagated = 3, // ## deprecated + WA_OpaquePaintEvent = 4, + WA_NoBackground = WA_OpaquePaintEvent, // ## deprecated + WA_StaticContents = 5, + WA_LaidOut = 7, + WA_PaintOnScreen = 8, + WA_NoSystemBackground = 9, + WA_UpdatesDisabled = 10, + WA_Mapped = 11, + WA_MacNoClickThrough = 12, // Mac only + WA_PaintOutsidePaintEvent = 13, + WA_InputMethodEnabled = 14, + WA_WState_Visible = 15, + WA_WState_Hidden = 16, + + WA_ForceDisabled = 32, + WA_KeyCompression = 33, + WA_PendingMoveEvent = 34, + WA_PendingResizeEvent = 35, + WA_SetPalette = 36, + WA_SetFont = 37, + WA_SetCursor = 38, + WA_NoChildEventsFromChildren = 39, + WA_WindowModified = 41, + WA_Resized = 42, + WA_Moved = 43, + WA_PendingUpdate = 44, + WA_InvalidSize = 45, + WA_MacBrushedMetal = 46, // Mac only + WA_MacMetalStyle = WA_MacBrushedMetal, // obsolete + WA_CustomWhatsThis = 47, + WA_LayoutOnEntireRect = 48, + WA_OutsideWSRange = 49, + WA_GrabbedShortcut = 50, + WA_TransparentForMouseEvents = 51, + WA_PaintUnclipped = 52, + WA_SetWindowIcon = 53, + WA_NoMouseReplay = 54, + WA_DeleteOnClose = 55, + WA_RightToLeft = 56, + WA_SetLayoutDirection = 57, + WA_NoChildEventsForParent = 58, + WA_ForceUpdatesDisabled = 59, + + WA_WState_Created = 60, + WA_WState_CompressKeys = 61, + WA_WState_InPaintEvent = 62, + WA_WState_Reparented = 63, + WA_WState_ConfigPending = 64, + WA_WState_Polished = 66, + WA_WState_DND = 67, // ## deprecated + WA_WState_OwnSizePolicy = 68, + WA_WState_ExplicitShowHide = 69, + + WA_ShowModal = 70, // ## deprecated + WA_MouseNoMask = 71, + WA_GroupLeader = 72, // ## deprecated + WA_NoMousePropagation = 73, // ## for now, might go away. + WA_Hover = 74, + WA_InputMethodTransparent = 75, // Don't reset IM when user clicks on this (for virtual keyboards on embedded) + WA_QuitOnClose = 76, + + WA_KeyboardFocusChange = 77, + + WA_AcceptDrops = 78, + WA_DropSiteRegistered = 79, // internal + WA_ForceAcceptDrops = WA_DropSiteRegistered, // ## deprecated + + WA_WindowPropagation = 80, + + WA_NoX11EventCompression = 81, + WA_TintedBackground = 82, + WA_X11OpenGLOverlay = 83, + WA_AlwaysShowToolTips = 84, + WA_MacOpaqueSizeGrip = 85, + WA_SetStyle = 86, + + WA_SetLocale = 87, + WA_MacShowFocusRect = 88, + + WA_MacNormalSize = 89, // Mac only + WA_MacSmallSize = 90, // Mac only + WA_MacMiniSize = 91, // Mac only + + WA_LayoutUsesWidgetRect = 92, + WA_StyledBackground = 93, // internal + WA_MSWindowsUseDirect3D = 94, // Win only + WA_CanHostQMdiSubWindowTitleBar = 95, // Internal + + WA_MacAlwaysShowToolWindow = 96, // Mac only + + WA_StyleSheet = 97, // internal + + WA_ShowWithoutActivating = 98, + + WA_X11BypassTransientForHint = 99, + + WA_NativeWindow = 100, + WA_DontCreateNativeAncestors = 101, + + WA_MacVariableSize = 102, // Mac only + + WA_DontShowOnScreen = 103, + + // window types from http://standards.freedesktop.org/wm-spec/ + WA_X11NetWmWindowTypeDesktop = 104, + WA_X11NetWmWindowTypeDock = 105, + WA_X11NetWmWindowTypeToolBar = 106, + WA_X11NetWmWindowTypeMenu = 107, + WA_X11NetWmWindowTypeUtility = 108, + WA_X11NetWmWindowTypeSplash = 109, + WA_X11NetWmWindowTypeDialog = 110, + WA_X11NetWmWindowTypeDropDownMenu = 111, + WA_X11NetWmWindowTypePopupMenu = 112, + WA_X11NetWmWindowTypeToolTip = 113, + WA_X11NetWmWindowTypeNotification = 114, + WA_X11NetWmWindowTypeCombo = 115, + WA_X11NetWmWindowTypeDND = 116, + + WA_MacFrameworkScaled = 117, + + WA_SetWindowModality = 118, + WA_WState_WindowOpacitySet = 119, // internal + WA_TranslucentBackground = 120, + + WA_AcceptTouchEvents = 121, + WA_WState_AcceptedTouchBeginEvent = 122, + WA_TouchPadAcceptSingleTouchEvents = 123, + + WA_MergeSoftkeys = 124, + WA_MergeSoftkeysRecursively = 125, + +#if 0 // these values are reserved for Maemo5 - do not re-use them + WA_Maemo5NonComposited = 126, + WA_Maemo5StackedWindow = 127, +#endif + + WA_LockPortraitOrientation = 128, + WA_LockLandscapeOrientation = 129, + WA_AutoOrientation = 130, + +#if 0 // these values are reserved for Maemo5 - do not re-use them + WA_Maemo5PortraitOrientation = WA_LockPortraitOrientation, + WA_Maemo5LandscapeOrientation = WA_LockLandscapeOrientation, + WA_Maemo5AutoOrientation = WA_AutoOrientation, + WA_Maemo5ShowProgressIndicator = 131, +#endif + + WA_X11DoNotAcceptFocus = 132, + WA_SymbianNoSystemRotation = 133, + WA_MacNoShadow = 134, + + // Add new attributes before this line + WA_AttributeCount + }; + + enum ApplicationAttribute + { + AA_ImmediateWidgetCreation = 0, + AA_MSWindowsUseDirect3DByDefault = 1, // Win only + AA_DontShowIconsInMenus = 2, + AA_NativeWindows = 3, + AA_DontCreateNativeWidgetSiblings = 4, + AA_MacPluginApplication = 5, + AA_DontUseNativeMenuBar = 6, + AA_MacDontSwapCtrlAndMeta = 7, + AA_S60DontConstructApplicationPanes = 8, + AA_S60DisablePartialScreenInputMode = 9, + AA_X11InitThreads = 10, + + // Add new attributes before this line + AA_AttributeCount + }; + + + // Image conversion flags. The unusual ordering is caused by + // compatibility and default requirements. + + enum ImageConversionFlag { + ColorMode_Mask = 0x00000003, + AutoColor = 0x00000000, + ColorOnly = 0x00000003, + MonoOnly = 0x00000002, + // Reserved = 0x00000001, + + AlphaDither_Mask = 0x0000000c, + ThresholdAlphaDither = 0x00000000, + OrderedAlphaDither = 0x00000004, + DiffuseAlphaDither = 0x00000008, + NoAlpha = 0x0000000c, // Not supported + + Dither_Mask = 0x00000030, + DiffuseDither = 0x00000000, + OrderedDither = 0x00000010, + ThresholdDither = 0x00000020, + // ReservedDither = 0x00000030, + + DitherMode_Mask = 0x000000c0, + AutoDither = 0x00000000, + PreferDither = 0x00000040, + AvoidDither = 0x00000080, + + NoOpaqueDetection = 0x00000100, + NoFormatConversion = 0x00000200 + }; + Q_DECLARE_FLAGS(ImageConversionFlags, ImageConversionFlag) + + enum BGMode { + TransparentMode, + OpaqueMode + }; + +#ifdef QT3_SUPPORT + enum PaintUnit { // paint unit + PixelUnit, + LoMetricUnit, // obsolete + HiMetricUnit, // obsolete + LoEnglishUnit, // obsolete + HiEnglishUnit, // obsolete + TwipsUnit // obsolete + }; + + enum GUIStyle { + MacStyle, + WindowsStyle, + Win3Style, + PMStyle, + MotifStyle + }; +#endif + + enum Key { + Key_Escape = 0x01000000, // misc keys + Key_Tab = 0x01000001, + Key_Backtab = 0x01000002, +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + Key_BackTab = Key_Backtab, +#endif + Key_Backspace = 0x01000003, +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + Key_BackSpace = Key_Backspace, +#endif + Key_Return = 0x01000004, + Key_Enter = 0x01000005, + Key_Insert = 0x01000006, + Key_Delete = 0x01000007, + Key_Pause = 0x01000008, + Key_Print = 0x01000009, + Key_SysReq = 0x0100000a, + Key_Clear = 0x0100000b, + Key_Home = 0x01000010, // cursor movement + Key_End = 0x01000011, + Key_Left = 0x01000012, + Key_Up = 0x01000013, + Key_Right = 0x01000014, + Key_Down = 0x01000015, + Key_PageUp = 0x01000016, +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + Key_Prior = Key_PageUp, +#endif + Key_PageDown = 0x01000017, +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + Key_Next = Key_PageDown, +#endif + Key_Shift = 0x01000020, // modifiers + Key_Control = 0x01000021, + Key_Meta = 0x01000022, + Key_Alt = 0x01000023, + Key_CapsLock = 0x01000024, + Key_NumLock = 0x01000025, + Key_ScrollLock = 0x01000026, + Key_F1 = 0x01000030, // function keys + Key_F2 = 0x01000031, + Key_F3 = 0x01000032, + Key_F4 = 0x01000033, + Key_F5 = 0x01000034, + Key_F6 = 0x01000035, + Key_F7 = 0x01000036, + Key_F8 = 0x01000037, + Key_F9 = 0x01000038, + Key_F10 = 0x01000039, + Key_F11 = 0x0100003a, + Key_F12 = 0x0100003b, + Key_F13 = 0x0100003c, + Key_F14 = 0x0100003d, + Key_F15 = 0x0100003e, + Key_F16 = 0x0100003f, + Key_F17 = 0x01000040, + Key_F18 = 0x01000041, + Key_F19 = 0x01000042, + Key_F20 = 0x01000043, + Key_F21 = 0x01000044, + Key_F22 = 0x01000045, + Key_F23 = 0x01000046, + Key_F24 = 0x01000047, + Key_F25 = 0x01000048, // F25 .. F35 only on X11 + Key_F26 = 0x01000049, + Key_F27 = 0x0100004a, + Key_F28 = 0x0100004b, + Key_F29 = 0x0100004c, + Key_F30 = 0x0100004d, + Key_F31 = 0x0100004e, + Key_F32 = 0x0100004f, + Key_F33 = 0x01000050, + Key_F34 = 0x01000051, + Key_F35 = 0x01000052, + Key_Super_L = 0x01000053, // extra keys + Key_Super_R = 0x01000054, + Key_Menu = 0x01000055, + Key_Hyper_L = 0x01000056, + Key_Hyper_R = 0x01000057, + Key_Help = 0x01000058, + Key_Direction_L = 0x01000059, + Key_Direction_R = 0x01000060, + Key_Space = 0x20, // 7 bit printable ASCII + Key_Any = Key_Space, + Key_Exclam = 0x21, + Key_QuoteDbl = 0x22, + Key_NumberSign = 0x23, + Key_Dollar = 0x24, + Key_Percent = 0x25, + Key_Ampersand = 0x26, + Key_Apostrophe = 0x27, + Key_ParenLeft = 0x28, + Key_ParenRight = 0x29, + Key_Asterisk = 0x2a, + Key_Plus = 0x2b, + Key_Comma = 0x2c, + Key_Minus = 0x2d, + Key_Period = 0x2e, + Key_Slash = 0x2f, + Key_0 = 0x30, + Key_1 = 0x31, + Key_2 = 0x32, + Key_3 = 0x33, + Key_4 = 0x34, + Key_5 = 0x35, + Key_6 = 0x36, + Key_7 = 0x37, + Key_8 = 0x38, + Key_9 = 0x39, + Key_Colon = 0x3a, + Key_Semicolon = 0x3b, + Key_Less = 0x3c, + Key_Equal = 0x3d, + Key_Greater = 0x3e, + Key_Question = 0x3f, + Key_At = 0x40, + Key_A = 0x41, + Key_B = 0x42, + Key_C = 0x43, + Key_D = 0x44, + Key_E = 0x45, + Key_F = 0x46, + Key_G = 0x47, + Key_H = 0x48, + Key_I = 0x49, + Key_J = 0x4a, + Key_K = 0x4b, + Key_L = 0x4c, + Key_M = 0x4d, + Key_N = 0x4e, + Key_O = 0x4f, + Key_P = 0x50, + Key_Q = 0x51, + Key_R = 0x52, + Key_S = 0x53, + Key_T = 0x54, + Key_U = 0x55, + Key_V = 0x56, + Key_W = 0x57, + Key_X = 0x58, + Key_Y = 0x59, + Key_Z = 0x5a, + Key_BracketLeft = 0x5b, + Key_Backslash = 0x5c, + Key_BracketRight = 0x5d, + Key_AsciiCircum = 0x5e, + Key_Underscore = 0x5f, + Key_QuoteLeft = 0x60, + Key_BraceLeft = 0x7b, + Key_Bar = 0x7c, + Key_BraceRight = 0x7d, + Key_AsciiTilde = 0x7e, + + Key_nobreakspace = 0x0a0, + Key_exclamdown = 0x0a1, + Key_cent = 0x0a2, + Key_sterling = 0x0a3, + Key_currency = 0x0a4, + Key_yen = 0x0a5, + Key_brokenbar = 0x0a6, + Key_section = 0x0a7, + Key_diaeresis = 0x0a8, + Key_copyright = 0x0a9, + Key_ordfeminine = 0x0aa, + Key_guillemotleft = 0x0ab, // left angle quotation mark + Key_notsign = 0x0ac, + Key_hyphen = 0x0ad, + Key_registered = 0x0ae, + Key_macron = 0x0af, + Key_degree = 0x0b0, + Key_plusminus = 0x0b1, + Key_twosuperior = 0x0b2, + Key_threesuperior = 0x0b3, + Key_acute = 0x0b4, + Key_mu = 0x0b5, + Key_paragraph = 0x0b6, + Key_periodcentered = 0x0b7, + Key_cedilla = 0x0b8, + Key_onesuperior = 0x0b9, + Key_masculine = 0x0ba, + Key_guillemotright = 0x0bb, // right angle quotation mark + Key_onequarter = 0x0bc, + Key_onehalf = 0x0bd, + Key_threequarters = 0x0be, + Key_questiondown = 0x0bf, + Key_Agrave = 0x0c0, + Key_Aacute = 0x0c1, + Key_Acircumflex = 0x0c2, + Key_Atilde = 0x0c3, + Key_Adiaeresis = 0x0c4, + Key_Aring = 0x0c5, + Key_AE = 0x0c6, + Key_Ccedilla = 0x0c7, + Key_Egrave = 0x0c8, + Key_Eacute = 0x0c9, + Key_Ecircumflex = 0x0ca, + Key_Ediaeresis = 0x0cb, + Key_Igrave = 0x0cc, + Key_Iacute = 0x0cd, + Key_Icircumflex = 0x0ce, + Key_Idiaeresis = 0x0cf, + Key_ETH = 0x0d0, + Key_Ntilde = 0x0d1, + Key_Ograve = 0x0d2, + Key_Oacute = 0x0d3, + Key_Ocircumflex = 0x0d4, + Key_Otilde = 0x0d5, + Key_Odiaeresis = 0x0d6, + Key_multiply = 0x0d7, + Key_Ooblique = 0x0d8, + Key_Ugrave = 0x0d9, + Key_Uacute = 0x0da, + Key_Ucircumflex = 0x0db, + Key_Udiaeresis = 0x0dc, + Key_Yacute = 0x0dd, + Key_THORN = 0x0de, + Key_ssharp = 0x0df, +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + Key_agrave = Key_Agrave, + Key_aacute = Key_Aacute, + Key_acircumflex = Key_Acircumflex, + Key_atilde = Key_Atilde, + Key_adiaeresis = Key_Adiaeresis, + Key_aring = Key_Aring, + Key_ae = Key_AE, + Key_ccedilla = Key_Ccedilla, + Key_egrave = Key_Egrave, + Key_eacute = Key_Eacute, + Key_ecircumflex = Key_Ecircumflex, + Key_ediaeresis = Key_Ediaeresis, + Key_igrave = Key_Igrave, + Key_iacute = Key_Iacute, + Key_icircumflex = Key_Icircumflex, + Key_idiaeresis = Key_Idiaeresis, + Key_eth = Key_ETH, + Key_ntilde = Key_Ntilde, + Key_ograve = Key_Ograve, + Key_oacute = Key_Oacute, + Key_ocircumflex = Key_Ocircumflex, + Key_otilde = Key_Otilde, + Key_odiaeresis = Key_Odiaeresis, +#endif + Key_division = 0x0f7, +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + Key_oslash = Key_Ooblique, + Key_ugrave = Key_Ugrave, + Key_uacute = Key_Uacute, + Key_ucircumflex = Key_Ucircumflex, + Key_udiaeresis = Key_Udiaeresis, + Key_yacute = Key_Yacute, + Key_thorn = Key_THORN, +#endif + Key_ydiaeresis = 0x0ff, + + // International input method support (X keycode - 0xEE00, the + // definition follows Qt/Embedded 2.3.7) Only interesting if + // you are writing your own input method + + // International & multi-key character composition + Key_AltGr = 0x01001103, + Key_Multi_key = 0x01001120, // Multi-key character compose + Key_Codeinput = 0x01001137, + Key_SingleCandidate = 0x0100113c, + Key_MultipleCandidate = 0x0100113d, + Key_PreviousCandidate = 0x0100113e, + + // Misc Functions + Key_Mode_switch = 0x0100117e, // Character set switch + //Key_script_switch = 0x0100117e, // Alias for mode_switch + + // Japanese keyboard support + Key_Kanji = 0x01001121, // Kanji, Kanji convert + Key_Muhenkan = 0x01001122, // Cancel Conversion + //Key_Henkan_Mode = 0x01001123, // Start/Stop Conversion + Key_Henkan = 0x01001123, // Alias for Henkan_Mode + Key_Romaji = 0x01001124, // to Romaji + Key_Hiragana = 0x01001125, // to Hiragana + Key_Katakana = 0x01001126, // to Katakana + Key_Hiragana_Katakana = 0x01001127, // Hiragana/Katakana toggle + Key_Zenkaku = 0x01001128, // to Zenkaku + Key_Hankaku = 0x01001129, // to Hankaku + Key_Zenkaku_Hankaku = 0x0100112a, // Zenkaku/Hankaku toggle + Key_Touroku = 0x0100112b, // Add to Dictionary + Key_Massyo = 0x0100112c, // Delete from Dictionary + Key_Kana_Lock = 0x0100112d, // Kana Lock + Key_Kana_Shift = 0x0100112e, // Kana Shift + Key_Eisu_Shift = 0x0100112f, // Alphanumeric Shift + Key_Eisu_toggle = 0x01001130, // Alphanumeric toggle + //Key_Kanji_Bangou = 0x01001137, // Codeinput + //Key_Zen_Koho = 0x0100113d, // Multiple/All Candidate(s) + //Key_Mae_Koho = 0x0100113e, // Previous Candidate + + // Korean keyboard support + // + // In fact, many Korean users need only 2 keys, Key_Hangul and + // Key_Hangul_Hanja. But rest of the keys are good for future. + + Key_Hangul = 0x01001131, // Hangul start/stop(toggle) + Key_Hangul_Start = 0x01001132, // Hangul start + Key_Hangul_End = 0x01001133, // Hangul end, English start + Key_Hangul_Hanja = 0x01001134, // Start Hangul->Hanja Conversion + Key_Hangul_Jamo = 0x01001135, // Hangul Jamo mode + Key_Hangul_Romaja = 0x01001136, // Hangul Romaja mode + //Key_Hangul_Codeinput = 0x01001137, // Hangul code input mode + Key_Hangul_Jeonja = 0x01001138, // Jeonja mode + Key_Hangul_Banja = 0x01001139, // Banja mode + Key_Hangul_PreHanja = 0x0100113a, // Pre Hanja conversion + Key_Hangul_PostHanja = 0x0100113b, // Post Hanja conversion + //Key_Hangul_SingleCandidate = 0x0100113c, // Single candidate + //Key_Hangul_MultipleCandidate = 0x0100113d, // Multiple candidate + //Key_Hangul_PreviousCandidate = 0x0100113e, // Previous candidate + Key_Hangul_Special = 0x0100113f, // Special symbols + //Key_Hangul_switch = 0x0100117e, // Alias for mode_switch + + // dead keys (X keycode - 0xED00 to avoid the conflict) + Key_Dead_Grave = 0x01001250, + Key_Dead_Acute = 0x01001251, + Key_Dead_Circumflex = 0x01001252, + Key_Dead_Tilde = 0x01001253, + Key_Dead_Macron = 0x01001254, + Key_Dead_Breve = 0x01001255, + Key_Dead_Abovedot = 0x01001256, + Key_Dead_Diaeresis = 0x01001257, + Key_Dead_Abovering = 0x01001258, + Key_Dead_Doubleacute = 0x01001259, + Key_Dead_Caron = 0x0100125a, + Key_Dead_Cedilla = 0x0100125b, + Key_Dead_Ogonek = 0x0100125c, + Key_Dead_Iota = 0x0100125d, + Key_Dead_Voiced_Sound = 0x0100125e, + Key_Dead_Semivoiced_Sound = 0x0100125f, + Key_Dead_Belowdot = 0x01001260, + Key_Dead_Hook = 0x01001261, + Key_Dead_Horn = 0x01001262, + + // multimedia/internet keys - ignored by default - see QKeyEvent c'tor + Key_Back = 0x01000061, + Key_Forward = 0x01000062, + Key_Stop = 0x01000063, + Key_Refresh = 0x01000064, + Key_VolumeDown = 0x01000070, + Key_VolumeMute = 0x01000071, + Key_VolumeUp = 0x01000072, + Key_BassBoost = 0x01000073, + Key_BassUp = 0x01000074, + Key_BassDown = 0x01000075, + Key_TrebleUp = 0x01000076, + Key_TrebleDown = 0x01000077, + Key_MediaPlay = 0x01000080, + Key_MediaStop = 0x01000081, + Key_MediaPrevious = 0x01000082, +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + Key_MediaPrev = Key_MediaPrevious, +#endif + Key_MediaNext = 0x01000083, + Key_MediaRecord = 0x01000084, + Key_MediaPause = 0x1000085, + Key_MediaTogglePlayPause = 0x1000086, + Key_HomePage = 0x01000090, + Key_Favorites = 0x01000091, + Key_Search = 0x01000092, + Key_Standby = 0x01000093, + Key_OpenUrl = 0x01000094, + Key_LaunchMail = 0x010000a0, + Key_LaunchMedia = 0x010000a1, + Key_Launch0 = 0x010000a2, + Key_Launch1 = 0x010000a3, + Key_Launch2 = 0x010000a4, + Key_Launch3 = 0x010000a5, + Key_Launch4 = 0x010000a6, + Key_Launch5 = 0x010000a7, + Key_Launch6 = 0x010000a8, + Key_Launch7 = 0x010000a9, + Key_Launch8 = 0x010000aa, + Key_Launch9 = 0x010000ab, + Key_LaunchA = 0x010000ac, + Key_LaunchB = 0x010000ad, + Key_LaunchC = 0x010000ae, + Key_LaunchD = 0x010000af, + Key_LaunchE = 0x010000b0, + Key_LaunchF = 0x010000b1, + Key_MonBrightnessUp = 0x010000b2, + Key_MonBrightnessDown = 0x010000b3, + Key_KeyboardLightOnOff = 0x010000b4, + Key_KeyboardBrightnessUp = 0x010000b5, + Key_KeyboardBrightnessDown = 0x010000b6, + Key_PowerOff = 0x010000b7, + Key_WakeUp = 0x010000b8, + Key_Eject = 0x010000b9, + Key_ScreenSaver = 0x010000ba, + Key_WWW = 0x010000bb, + Key_Memo = 0x010000bc, + Key_LightBulb = 0x010000bd, + Key_Shop = 0x010000be, + Key_History = 0x010000bf, + Key_AddFavorite = 0x010000c0, + Key_HotLinks = 0x010000c1, + Key_BrightnessAdjust = 0x010000c2, + Key_Finance = 0x010000c3, + Key_Community = 0x010000c4, + Key_AudioRewind = 0x010000c5, + Key_BackForward = 0x010000c6, + Key_ApplicationLeft = 0x010000c7, + Key_ApplicationRight = 0x010000c8, + Key_Book = 0x010000c9, + Key_CD = 0x010000ca, + Key_Calculator = 0x010000cb, + Key_ToDoList = 0x010000cc, + Key_ClearGrab = 0x010000cd, + Key_Close = 0x010000ce, + Key_Copy = 0x010000cf, + Key_Cut = 0x010000d0, + Key_Display = 0x010000d1, + Key_DOS = 0x010000d2, + Key_Documents = 0x010000d3, + Key_Excel = 0x010000d4, + Key_Explorer = 0x010000d5, + Key_Game = 0x010000d6, + Key_Go = 0x010000d7, + Key_iTouch = 0x010000d8, + Key_LogOff = 0x010000d9, + Key_Market = 0x010000da, + Key_Meeting = 0x010000db, + Key_MenuKB = 0x010000dc, + Key_MenuPB = 0x010000dd, + Key_MySites = 0x010000de, + Key_News = 0x010000df, + Key_OfficeHome = 0x010000e0, + Key_Option = 0x010000e1, + Key_Paste = 0x010000e2, + Key_Phone = 0x010000e3, + Key_Calendar = 0x010000e4, + Key_Reply = 0x010000e5, + Key_Reload = 0x010000e6, + Key_RotateWindows = 0x010000e7, + Key_RotationPB = 0x010000e8, + Key_RotationKB = 0x010000e9, + Key_Save = 0x010000ea, + Key_Send = 0x010000eb, + Key_Spell = 0x010000ec, + Key_SplitScreen = 0x010000ed, + Key_Support = 0x010000ee, + Key_TaskPane = 0x010000ef, + Key_Terminal = 0x010000f0, + Key_Tools = 0x010000f1, + Key_Travel = 0x010000f2, + Key_Video = 0x010000f3, + Key_Word = 0x010000f4, + Key_Xfer = 0x010000f5, + Key_ZoomIn = 0x010000f6, + Key_ZoomOut = 0x010000f7, + Key_Away = 0x010000f8, + Key_Messenger = 0x010000f9, + Key_WebCam = 0x010000fa, + Key_MailForward = 0x010000fb, + Key_Pictures = 0x010000fc, + Key_Music = 0x010000fd, + Key_Battery = 0x010000fe, + Key_Bluetooth = 0x010000ff, + Key_WLAN = 0x01000100, + Key_UWB = 0x01000101, + Key_AudioForward = 0x01000102, + Key_AudioRepeat = 0x01000103, + Key_AudioRandomPlay = 0x01000104, + Key_Subtitle = 0x01000105, + Key_AudioCycleTrack = 0x01000106, + Key_Time = 0x01000107, + Key_Hibernate = 0x01000108, + Key_View = 0x01000109, + Key_TopMenu = 0x0100010a, + Key_PowerDown = 0x0100010b, + Key_Suspend = 0x0100010c, + Key_ContrastAdjust = 0x0100010d, + + Key_LaunchG = 0x0100010e, + Key_LaunchH = 0x0100010f, + + Key_MediaLast = 0x0100ffff, + + // Keypad navigation keys + Key_Select = 0x01010000, + Key_Yes = 0x01010001, + Key_No = 0x01010002, + + // Newer misc keys + Key_Cancel = 0x01020001, + Key_Printer = 0x01020002, + Key_Execute = 0x01020003, + Key_Sleep = 0x01020004, + Key_Play = 0x01020005, // Not the same as Key_MediaPlay + Key_Zoom = 0x01020006, + //Key_Jisho = 0x01020007, // IME: Dictionary key + //Key_Oyayubi_Left = 0x01020008, // IME: Left Oyayubi key + //Key_Oyayubi_Right = 0x01020009, // IME: Right Oyayubi key + + // Device keys + Key_Context1 = 0x01100000, + Key_Context2 = 0x01100001, + Key_Context3 = 0x01100002, + Key_Context4 = 0x01100003, + Key_Call = 0x01100004, // set absolute state to in a call (do not toggle state) + Key_Hangup = 0x01100005, // set absolute state to hang up (do not toggle state) + Key_Flip = 0x01100006, + Key_ToggleCallHangup = 0x01100007, // a toggle key for answering, or hanging up, based on current call state + Key_VoiceDial = 0x01100008, + Key_LastNumberRedial = 0x01100009, + + Key_Camera = 0x01100020, + Key_CameraFocus = 0x01100021, + + Key_unknown = 0x01ffffff + }; + + enum ArrowType { + NoArrow, + UpArrow, + DownArrow, + LeftArrow, + RightArrow + }; + + enum PenStyle { // pen style + NoPen, + SolidLine, + DashLine, + DotLine, + DashDotLine, + DashDotDotLine, + CustomDashLine +#ifndef Q_MOC_RUN + , MPenStyle = 0x0f +#endif + }; + + enum PenCapStyle { // line endcap style + FlatCap = 0x00, + SquareCap = 0x10, + RoundCap = 0x20, + MPenCapStyle = 0x30 + }; + + enum PenJoinStyle { // line join style + MiterJoin = 0x00, + BevelJoin = 0x40, + RoundJoin = 0x80, + SvgMiterJoin = 0x100, + MPenJoinStyle = 0x1c0 + }; + + enum BrushStyle { // brush style + NoBrush, + SolidPattern, + Dense1Pattern, + Dense2Pattern, + Dense3Pattern, + Dense4Pattern, + Dense5Pattern, + Dense6Pattern, + Dense7Pattern, + HorPattern, + VerPattern, + CrossPattern, + BDiagPattern, + FDiagPattern, + DiagCrossPattern, + LinearGradientPattern, + RadialGradientPattern, + ConicalGradientPattern, + TexturePattern = 24 +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + , CustomPattern = TexturePattern +#endif + }; + + enum SizeMode { + AbsoluteSize, + RelativeSize + }; + +#if defined(QT3_SUPPORT) +#if defined(Q_OS_MAC) +#ifndef qdoc + typedef int MacintoshVersion; + + enum +#else + enum MacintoshVersion +#endif + { + //Unknown + MV_Unknown = 0x0000, + + //Version numbers + MV_9 = QSysInfo::MV_9, + MV_10_DOT_0 = QSysInfo::MV_10_0, + MV_10_DOT_1 = QSysInfo::MV_10_1, + MV_10_DOT_2 = QSysInfo::MV_10_2, + MV_10_DOT_3 = QSysInfo::MV_10_3, + MV_10_DOT_4 = QSysInfo::MV_10_4, + + //Code names + MV_CHEETAH = QSysInfo::MV_CHEETAH, + MV_PUMA = QSysInfo::MV_PUMA, + MV_JAGUAR = QSysInfo::MV_JAGUAR, + MV_PANTHER = QSysInfo::MV_PANTHER, + MV_TIGER = QSysInfo::MV_TIGER + }; +#endif // Q_OS_MAC + +#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) +#ifndef qdoc + typedef int WindowsVersion; + + enum +#else + enum WindowsVersion +#endif + { + WV_32s = QSysInfo::WV_32s, + WV_95 = QSysInfo::WV_95, + WV_98 = QSysInfo::WV_98, + WV_Me = QSysInfo::WV_Me, + WV_DOS_based= QSysInfo::WV_DOS_based, + + WV_NT = QSysInfo::WV_NT, + WV_2000 = QSysInfo::WV_2000, + WV_XP = QSysInfo::WV_XP, + WV_2003 = QSysInfo::WV_2003, + WV_NT_based = QSysInfo::WV_NT_based, + + WV_CE = QSysInfo::WV_CE, + WV_CENET = QSysInfo::WV_CENET, + WV_CE_5 = QSysInfo::WV_CE_5, + WV_CE_6 = QSysInfo::WV_CE_6, + WV_CE_based = QSysInfo::WV_CE_based + }; +#endif // Q_OS_WIN +#endif // QT3_SUPPORT + + enum UIEffect { + UI_General, + UI_AnimateMenu, + UI_FadeMenu, + UI_AnimateCombo, + UI_AnimateTooltip, + UI_FadeTooltip, + UI_AnimateToolBox + }; + + enum CursorShape { + ArrowCursor, + UpArrowCursor, + CrossCursor, + WaitCursor, + IBeamCursor, + SizeVerCursor, + SizeHorCursor, + SizeBDiagCursor, + SizeFDiagCursor, + SizeAllCursor, + BlankCursor, + SplitVCursor, + SplitHCursor, + PointingHandCursor, + ForbiddenCursor, + WhatsThisCursor, + BusyCursor, + OpenHandCursor, + ClosedHandCursor, + DragCopyCursor, + DragMoveCursor, + DragLinkCursor, + LastCursor = DragLinkCursor, + BitmapCursor = 24, + CustomCursor = 25 + +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + , + arrowCursor = ArrowCursor, + upArrowCursor = UpArrowCursor, + crossCursor = CrossCursor, + waitCursor = WaitCursor, + ibeamCursor = IBeamCursor, + sizeVerCursor = SizeVerCursor, + sizeHorCursor = SizeHorCursor, + sizeBDiagCursor = SizeBDiagCursor, + sizeFDiagCursor = SizeFDiagCursor, + sizeAllCursor = SizeAllCursor, + blankCursor = BlankCursor, + splitVCursor = SplitVCursor, + splitHCursor = SplitHCursor, + pointingHandCursor = PointingHandCursor, + forbiddenCursor = ForbiddenCursor, + whatsThisCursor = WhatsThisCursor +#endif + }; + + enum TextFormat { + PlainText, + RichText, + AutoText, + LogText + }; + + enum AspectRatioMode { + IgnoreAspectRatio, + KeepAspectRatio, + KeepAspectRatioByExpanding +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + , ScaleFree = IgnoreAspectRatio, + ScaleMin = KeepAspectRatio, + ScaleMax = KeepAspectRatioByExpanding +#endif + }; +#ifdef QT3_SUPPORT + typedef AspectRatioMode ScaleMode; +#endif + + // This is for Q3TextEdit only, actually. + enum AnchorAttribute { + AnchorName, + AnchorHref + }; + + enum DockWidgetArea { + LeftDockWidgetArea = 0x1, + RightDockWidgetArea = 0x2, + TopDockWidgetArea = 0x4, + BottomDockWidgetArea = 0x8, + + DockWidgetArea_Mask = 0xf, + AllDockWidgetAreas = DockWidgetArea_Mask, + NoDockWidgetArea = 0 + }; + enum DockWidgetAreaSizes { + NDockWidgetAreas = 4 + }; + + Q_DECLARE_FLAGS(DockWidgetAreas, DockWidgetArea) + + enum ToolBarArea { + LeftToolBarArea = 0x1, + RightToolBarArea = 0x2, + TopToolBarArea = 0x4, + BottomToolBarArea = 0x8, + + ToolBarArea_Mask = 0xf, + AllToolBarAreas = ToolBarArea_Mask, + NoToolBarArea = 0 + }; + + enum ToolBarAreaSizes { + NToolBarAreas = 4 + }; + + Q_DECLARE_FLAGS(ToolBarAreas, ToolBarArea) + +#ifdef QT3_SUPPORT + enum Dock { + DockUnmanaged, + DockTornOff, + DockTop, + DockBottom, + DockRight, + DockLeft, + DockMinimized + , + Unmanaged = DockUnmanaged, + TornOff = DockTornOff, + Top = DockTop, + Bottom = DockBottom, + Right = DockRight, + Left = DockLeft, + Minimized = DockMinimized + }; + // compatibility + typedef Dock ToolBarDock; +#endif + + enum DateFormat { + TextDate, // default Qt + ISODate, // ISO 8601 + SystemLocaleDate, // deprecated + LocalDate = SystemLocaleDate, // deprecated + LocaleDate, // deprecated + SystemLocaleShortDate, + SystemLocaleLongDate, + DefaultLocaleShortDate, + DefaultLocaleLongDate + }; + + enum TimeSpec { + LocalTime, + UTC, + OffsetFromUTC + }; + + enum DayOfWeek { + Monday = 1, + Tuesday = 2, + Wednesday = 3, + Thursday = 4, + Friday = 5, + Saturday = 6, + Sunday = 7 + }; + + enum ScrollBarPolicy { + ScrollBarAsNeeded, + ScrollBarAlwaysOff, + ScrollBarAlwaysOn + }; + +#ifdef QT3_SUPPORT + enum BackgroundMode { + FixedColor, + FixedPixmap, + NoBackground, + PaletteForeground, + PaletteButton, + PaletteLight, + PaletteMidlight, + PaletteDark, + PaletteMid, + PaletteText, + PaletteBrightText, + PaletteBase, + PaletteBackground, + PaletteShadow, + PaletteHighlight, + PaletteHighlightedText, + PaletteButtonText, + PaletteLink, + PaletteLinkVisited, + X11ParentRelative + }; +#endif + + enum CaseSensitivity { + CaseInsensitive, + CaseSensitive + }; + + enum Corner { + TopLeftCorner = 0x00000, + TopRightCorner = 0x00001, + BottomLeftCorner = 0x00002, + BottomRightCorner = 0x00003 +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + ,TopLeft = TopLeftCorner, + TopRight = TopRightCorner, + BottomLeft = BottomLeftCorner, + BottomRight = BottomRightCorner +#endif + }; + + enum ConnectionType { + AutoConnection, + DirectConnection, + QueuedConnection, + AutoCompatConnection, + BlockingQueuedConnection, + UniqueConnection = 0x80 + }; + + enum ShortcutContext { + WidgetShortcut, + WindowShortcut, + ApplicationShortcut, + WidgetWithChildrenShortcut + }; + + enum FillRule { + OddEvenFill, + WindingFill + }; + + enum MaskMode { + MaskInColor, + MaskOutColor + }; + + enum ClipOperation { + NoClip, + ReplaceClip, + IntersectClip, + UniteClip + }; + + // Shape = 0x1, BoundingRect = 0x2 + enum ItemSelectionMode { + ContainsItemShape = 0x0, + IntersectsItemShape = 0x1, + ContainsItemBoundingRect = 0x2, + IntersectsItemBoundingRect = 0x3 + }; + + enum TransformationMode { + FastTransformation, + SmoothTransformation + }; + + enum Axis { + XAxis, + YAxis, + ZAxis + }; + + enum FocusReason { + MouseFocusReason, + TabFocusReason, + BacktabFocusReason, + ActiveWindowFocusReason, + PopupFocusReason, + ShortcutFocusReason, + MenuBarFocusReason, + OtherFocusReason, + NoFocusReason + }; + + enum ContextMenuPolicy { + NoContextMenu, + DefaultContextMenu, + ActionsContextMenu, + CustomContextMenu, + PreventContextMenu + }; + + enum InputMethodQuery { + ImMicroFocus, + ImFont, + ImCursorPosition, + ImSurroundingText, + ImCurrentSelection, + ImMaximumTextLength, + ImAnchorPosition + }; + + enum InputMethodHint { + ImhNone = 0x0, + ImhHiddenText = 0x1, + ImhNoAutoUppercase = 0x2, + ImhPreferNumbers = 0x4, + ImhPreferUppercase = 0x8, + ImhPreferLowercase = 0x10, + ImhNoPredictiveText = 0x20, + + ImhDigitsOnly = 0x10000, + ImhFormattedNumbersOnly = 0x20000, + ImhUppercaseOnly = 0x40000, + ImhLowercaseOnly = 0x80000, + ImhDialableCharactersOnly = 0x100000, + ImhEmailCharactersOnly = 0x200000, + ImhUrlCharactersOnly = 0x400000, + + ImhExclusiveInputMask = 0xffff0000 + }; + Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint) + + enum ToolButtonStyle { + ToolButtonIconOnly, + ToolButtonTextOnly, + ToolButtonTextBesideIcon, + ToolButtonTextUnderIcon, + ToolButtonFollowStyle + }; + + enum LayoutDirection { + LeftToRight, + RightToLeft, + LayoutDirectionAuto + }; + + enum AnchorPoint { + AnchorLeft = 0, + AnchorHorizontalCenter, + AnchorRight, + AnchorTop, + AnchorVerticalCenter, + AnchorBottom + }; + + + + enum DropAction { + CopyAction = 0x1, + MoveAction = 0x2, + LinkAction = 0x4, + ActionMask = 0xff, + TargetMoveAction = 0x8002, + IgnoreAction = 0x0 + }; + Q_DECLARE_FLAGS(DropActions, DropAction) + + enum CheckState { + Unchecked, + PartiallyChecked, + Checked + }; + + enum ItemDataRole { + DisplayRole = 0, + DecorationRole = 1, + EditRole = 2, + ToolTipRole = 3, + StatusTipRole = 4, + WhatsThisRole = 5, + // Metadata + FontRole = 6, + TextAlignmentRole = 7, + BackgroundColorRole = 8, + BackgroundRole = 8, + TextColorRole = 9, + ForegroundRole = 9, + CheckStateRole = 10, + // Accessibility + AccessibleTextRole = 11, + AccessibleDescriptionRole = 12, + // More general purpose + SizeHintRole = 13, + InitialSortOrderRole = 14, + // Internal UiLib roles. Start worrying when public roles go that high. + DisplayPropertyRole = 27, + DecorationPropertyRole = 28, + ToolTipPropertyRole = 29, + StatusTipPropertyRole = 30, + WhatsThisPropertyRole = 31, + // Reserved + UserRole = 32 + }; + + enum ItemFlag { + NoItemFlags = 0, + ItemIsSelectable = 1, + ItemIsEditable = 2, + ItemIsDragEnabled = 4, + ItemIsDropEnabled = 8, + ItemIsUserCheckable = 16, + ItemIsEnabled = 32, + ItemIsTristate = 64 + }; + Q_DECLARE_FLAGS(ItemFlags, ItemFlag) + + enum MatchFlag { + MatchExactly = 0, + MatchContains = 1, + MatchStartsWith = 2, + MatchEndsWith = 3, + MatchRegExp = 4, + MatchWildcard = 5, + MatchFixedString = 8, + MatchCaseSensitive = 16, + MatchWrap = 32, + MatchRecursive = 64 + }; + Q_DECLARE_FLAGS(MatchFlags, MatchFlag) + +#if defined(Q_WS_MAC) + typedef void * HANDLE; +#elif defined(Q_WS_WIN) + typedef void *HANDLE; +#elif defined(Q_WS_X11) + typedef unsigned long HANDLE; +#elif defined(Q_WS_QWS) || defined(Q_WS_QPA) + typedef void * HANDLE; +#elif defined(Q_OS_SYMBIAN) + typedef unsigned long int HANDLE; // equivalent to TUint32 +#endif + typedef WindowFlags WFlags; + + enum WindowModality { + NonModal, + WindowModal, + ApplicationModal + }; + + enum TextInteractionFlag { + NoTextInteraction = 0, + TextSelectableByMouse = 1, + TextSelectableByKeyboard = 2, + LinksAccessibleByMouse = 4, + LinksAccessibleByKeyboard = 8, + TextEditable = 16, + + TextEditorInteraction = TextSelectableByMouse | TextSelectableByKeyboard | TextEditable, + TextBrowserInteraction = TextSelectableByMouse | LinksAccessibleByMouse | LinksAccessibleByKeyboard + }; + Q_DECLARE_FLAGS(TextInteractionFlags, TextInteractionFlag) + + enum EventPriority { + HighEventPriority = 1, + NormalEventPriority = 0, + LowEventPriority = -1 + }; + + enum SizeHint { + MinimumSize, + PreferredSize, + MaximumSize, + MinimumDescent, + NSizeHints + }; + + enum WindowFrameSection { + NoSection, + LeftSection, // For resize + TopLeftSection, + TopSection, + TopRightSection, + RightSection, + BottomRightSection, + BottomSection, + BottomLeftSection, + TitleBarArea // For move + }; + + enum Initialization { + Uninitialized + }; + + enum CoordinateSystem { + DeviceCoordinates, + LogicalCoordinates + }; + + enum TouchPointState { + TouchPointPressed = 0x01, + TouchPointMoved = 0x02, + TouchPointStationary = 0x04, + TouchPointReleased = 0x08, + TouchPointStateMask = 0x0f, + + TouchPointPrimary = 0x10 + }; + Q_DECLARE_FLAGS(TouchPointStates, TouchPointState) + +#ifndef QT_NO_GESTURES + enum GestureState + { + NoGesture, + GestureStarted = 1, + GestureUpdated = 2, + GestureFinished = 3, + GestureCanceled = 4 + }; + + enum GestureType + { + TapGesture = 1, + TapAndHoldGesture = 2, + PanGesture = 3, + PinchGesture = 4, + SwipeGesture = 5, + + CustomGesture = 0x0100, + + LastGestureType = ~0u + }; + + enum GestureFlag + { + DontStartGestureOnChildren = 0x01, + ReceivePartialGestures = 0x02, + IgnoredGesturesPropagateToParent = 0x04 + }; + Q_DECLARE_FLAGS(GestureFlags, GestureFlag) +#endif // QT_NO_GESTURES + + enum NavigationMode + { + NavigationModeNone, + NavigationModeKeypadTabOrder, + NavigationModeKeypadDirectional, + NavigationModeCursorAuto, + NavigationModeCursorForceVisible + }; +} +#ifdef Q_MOC_RUN + ; +#endif + +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MouseButtons) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::Orientations) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::KeyboardModifiers) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::WindowFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::Alignment) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::ImageConversionFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::DockWidgetAreas) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::ToolBarAreas) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::WindowStates) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::DropActions) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::ItemFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MatchFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TextInteractionFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::InputMethodHints) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TouchPointStates) +#ifndef QT_NO_GESTURES +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::GestureFlags) +#endif + +typedef bool (*qInternalCallback)(void **); + +class Q_CORE_EXPORT QInternal { +public: + enum PaintDeviceFlags { + UnknownDevice = 0x00, + Widget = 0x01, + Pixmap = 0x02, + Image = 0x03, + Printer = 0x04, + Picture = 0x05, + Pbuffer = 0x06, // GL pbuffer + FramebufferObject = 0x07, // GL framebuffer object + CustomRaster = 0x08, + MacQuartz = 0x09, + PaintBuffer = 0x0a, + OpenGL = 0x0b + }; + enum RelayoutType { + RelayoutNormal, + RelayoutDragging, + RelayoutDropped + }; + + + enum Callback { + ConnectCallback, + DisconnectCallback, + AdoptCurrentThread, + EventNotifyCallback, + LastCallback + }; + + enum InternalFunction { + CreateThreadForAdoption, + RefAdoptedThread, + DerefAdoptedThread, + SetCurrentThreadToMainThread, + SetQObjectSender, + GetQObjectSender, + ResetQObjectSender, + LastInternalFunction + }; + + enum DockPosition { + LeftDock, + RightDock, + TopDock, + BottomDock, + DockCount + }; + + static bool registerCallback(Callback, qInternalCallback); + static bool unregisterCallback(Callback, qInternalCallback); + + static bool activateCallbacks(Callback, void **); + static bool callFunction(InternalFunction func, void **); +}; + +#ifdef QT3_SUPPORT +typedef qint32 QCOORD; // coordinate type +enum { + QCOORD_MAX = 2147483647, + QCOORD_MIN = -QCOORD_MAX - 1 +}; +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QNAMESPACE_H diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc new file mode 100644 index 0000000000..7cc0814e9c --- /dev/null +++ b/src/corelib/global/qnamespace.qdoc @@ -0,0 +1,3008 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of this +** file. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \namespace Qt + \inmodule QtCore + \target Qt Namespace + + \brief The Qt namespace contains miscellaneous identifiers + used throughout the Qt library. +*/ + +/*! + \enum Qt::Orientation + + This type is used to signify an object's orientation. + + \value Horizontal + \value Vertical + + Orientation is used with QScrollBar for example. +*/ + +/*! + \enum Qt::AlignmentFlag + + This enum type is used to describe alignment. It contains + horizontal and vertical flags that can be combined to produce + the required effect. + + The \l{TextElideMode} enum can also be used in many situations + to fine-tune the appearance of aligned text. + + The horizontal flags are: + + \value AlignLeft Aligns with the left edge. + \value AlignRight Aligns with the right edge. + \value AlignHCenter Centers horizontally in the available space. + \value AlignJustify Justifies the text in the available space. + \omitvalue AlignAuto + + The vertical flags are: + + \value AlignTop Aligns with the top. + \value AlignBottom Aligns with the bottom. + \value AlignVCenter Centers vertically in the available space. + + You can use only one of the horizontal flags at a time. There is + one two-dimensional flag: + + \value AlignCenter Centers in both dimensions. + + You can use at most one horizontal and one vertical flag at a + time. Qt::AlignCenter counts as both horizontal and vertical. + + Three enum values are useful in applications that can be run in + right-to-left mode: + + \value AlignAbsolute If the widget's layout direction is + Qt::RightToLeft (instead of Qt::LeftToRight, the default), + Qt::AlignLeft refers to the \e right edge and Qt::AlignRight + to the \e left edge. This is normally the desired behavior. + If you want Qt::AlignLeft to always mean "left" and + Qt::AlignRight to always mean "right", combine the flag with + Qt::AlignAbsolute. + \value AlignLeading Synonym for Qt::AlignLeft. + \value AlignTrailing Synonym for Qt::AlignRight. + + Masks: + + \value AlignHorizontal_Mask + \value AlignVertical_Mask + + Conflicting combinations of flags have undefined meanings. +*/ + +/*! + \enum Qt::ApplicationAttribute + + This enum describes attributes that change the behavior of + application-wide features. These are enabled and disabled using + QCoreApplication::setAttribute(), and can be tested for with + QCoreApplication::testAttribute(). + + \value AA_ImmediateWidgetCreation Ensures that widgets are created + as soon as they are constructed. By default, resources for + widgets are allocated on demand to improve efficiency and + minimize resource usage. Setting or clearing this attribute + affects widgets constructed after the change. Setting it + tells Qt to create toplevel windows immediately. + Therefore, if it is important to minimize resource + consumption, do not set this attribute. + + \value AA_MSWindowsUseDirect3DByDefault This value is obsolete and + has no effect. + + \value AA_DontShowIconsInMenus Actions with the Icon property won't be + shown in any menus unless specifically set by the + QAction::iconVisibleInMenu property. + Menus that are currently open or menus already created in the native + Mac OS X menubar \e{may not} pick up a change in this attribute. Changes + in the QAction::iconVisibleInMenu property will always be picked up. + + \value AA_NativeWindows Ensures that widgets have native windows. + + \value AA_DontCreateNativeWidgetSiblings Ensures that siblings of native + widgets stay non-native unless specifically set by the + Qt::WA_NativeWindow attribute. + + \value AA_MacPluginApplication Stops the Qt mac application from doing + specific initializations that do not necessarily make sense when using Qt + to author a plugin. This includes avoiding loading our nib for the main + menu and not taking possession of the native menu bar. When setting this + attribute to true will also set the AA_DontUseNativeMenuBar attribute + to true. + + \value AA_DontUseNativeMenuBar All menubars created while this attribute is + set to true won't be used as a native menubar (e.g, the menubar at + the top of the main screen on Mac OS X or at the bottom in Windows CE). + + \value AA_MacDontSwapCtrlAndMeta On Mac OS X by default, Qt swaps the + Control and Meta (Command) keys (i.e., whenever Control is pressed, Qt + sends Meta, and whenever Meta is pressed Control is sent). When this + attribute is true, Qt will not do the flip. QKeySequence::StandardShortcuts + will also flip accordingly (i.e., QKeySequence::Copy will be + Command+C on the keyboard regardless of the value set, though what is output for + QKeySequence::toString(QKeySequence::PortableText) will be different). + + \value AA_S60DontConstructApplicationPanes Stops Qt from initializing the S60 status + pane and softkey pane on Symbian. This is useful to save memory and reduce + startup time for applications that will run in fullscreen mode during their + whole lifetime. This attribute must be set before QApplication is + constructed. + + \omitvalue AA_S60DisablePartialScreenInputMode By default in Symbian^3, + a separate editing window is opened on top of an application. This is exactly + like editing on previous versions of Symbian behave. When this attribute + is true, a virtual keyboard window is shown on top of application and it + is ensured that the focused text widget is visible. This is only supported in + Symbian^3. (internal) + + \value AA_X11InitThreads Calls XInitThreads() as part of the QApplication + construction in order to make Xlib calls thread-safe. This + attribute must be set before QApplication is constructed. + + \omitvalue AA_AttributeCount +*/ + +/*! + \enum Qt::MouseButton + + This enum type describes the different mouse buttons. + + \value NoButton The button state does not refer to any + button (see QMouseEvent::button()). + \value LeftButton The left button is pressed, or an event refers + to the left button. (The left button may be the right button on + left-handed mice.) + \value RightButton The right button. + \value MidButton The middle button. + \value MiddleButton The middle button. + \value XButton1 The first X button. + \value XButton2 The second X button. + + \omitvalue MouseButtonMask + + \sa KeyboardModifier Modifier +*/ + +/*! + \enum Qt::KeyboardModifier + + This enum describes the modifier keys. + + \value NoModifier No modifier key is pressed. + \value ShiftModifier A Shift key on the keyboard is pressed. + \value ControlModifier A Ctrl key on the keyboard is pressed. + \value AltModifier An Alt key on the keyboard is pressed. + \value MetaModifier A Meta key on the keyboard is pressed. + \value KeypadModifier A keypad button is pressed. + \value GroupSwitchModifier X11 only. A Mode_switch key on the keyboard is pressed. + + \omitvalue KeyboardModifierMask + + \note On Mac OS X, the \c ControlModifier value corresponds to + the Command keys on the Macintosh keyboard, and the \c MetaModifier value + corresponds to the Control keys. The \c KeypadModifier value will also be set + when an arrow key is pressed as the arrow keys are considered part of the + keypad. + + \note On Windows Keyboards, Qt::MetaModifier and Qt::Key_Meta are mapped + to the Windows key. + + \sa MouseButton Modifier +*/ + +/*! + \enum Qt::Modifier + + This enum provides shorter names for the keyboard modifier keys + supported by Qt. + + \bold{Note:} On Mac OS X, the \c CTRL value corresponds to + the Command keys on the Macintosh keyboard, and the \c META value + corresponds to the Control keys. + + \value SHIFT The Shift keys provided on all standard keyboards. + \value META The Meta keys. + \value CTRL The Ctrl keys. + \value ALT The normal Alt keys, but not keys like AltGr. + \value UNICODE_ACCEL The shortcut is specified as a Unicode code + point, not as a Qt Key. + \omitvalue MODIFIER_MASK + + \sa KeyboardModifier MouseButton +*/ + +/*! + \enum Qt::GlobalColor + + Qt's predefined QColor objects: + + \value white \span {id="color-white"} {White (#ffffff) } + \value black \span {id="color-black"} {Black (#000000) } + \value red \span {id="color-red"} {Red (#ff0000) } + \value darkRed \span {id="color-darkRed"} {Dark red (#800000) } + \value green \span {id="color-green"} {Green (#00ff00) } + \value darkGreen \span {id="color-darkGreen"} {Dark green (#008000) } + \value blue \span {id="color-blue"} {Blue (#0000ff) } + \value darkBlue \span {id="color-darkBlue"} {Dark blue (#000080) } + \value cyan \span {id="color-cyan"} {Cyan (#00ffff) } + \value darkCyan \span {id="color-darkCyan"} {Dark cyan (#008080) } + \value magenta \span {id="color-magenta"} {Magenta (#ff00ff) } + \value darkMagenta \span {id="color-darkMagenta"} {Dark magenta (#800080) } + \value yellow \span {id="color-yellow"} {Yellow (#ffff00) } + \value darkYellow \span {id="color-darkYellow"} {Dark yellow (#808000) } + \value gray \span {id="color-gray"} {Gray (#a0a0a4) } + \value darkGray \span {id="color-darkGray"} {Dark gray (#808080) } + \value lightGray \span {id="color-lightGray"} {Light gray (#c0c0c0) } + \value transparent a transparent black value (i.e., QColor(0, 0, 0, 0)) + \value color0 0 pixel value (for bitmaps) + \value color1 1 pixel value (for bitmaps) + + \sa QColor + +*/ + +/*! + \enum Qt::PenStyle + + This enum type defines the pen styles that can be drawn using + QPainter. The styles are: + + \table + \row + \o \inlineimage qpen-solid.png + \o \inlineimage qpen-dash.png + \o \inlineimage qpen-dot.png + \row + \o Qt::SolidLine + \o Qt::DashLine + \o Qt::DotLine + \row + \o \inlineimage qpen-dashdot.png + \o \inlineimage qpen-dashdotdot.png + \o \inlineimage qpen-custom.png + \row + \o Qt::DashDotLine + \o Qt::DashDotDotLine + \o Qt::CustomDashLine + \endtable + + \value NoPen no line at all. For example, QPainter::drawRect() + fills but does not draw any boundary line. + + \value SolidLine A plain line. + \value DashLine Dashes separated by a few pixels. + \value DotLine Dots separated by a few pixels. + \value DashDotLine Alternate dots and dashes. + \value DashDotDotLine One dash, two dots, one dash, two dots. + \value CustomDashLine A custom pattern defined using + QPainterPathStroker::setDashPattern(). + + \omitvalue MPenStyle + + \sa QPen +*/ + +/*! + \enum Qt::PenCapStyle + + This enum type defines the pen cap styles supported by Qt, i.e. + the line end caps that can be drawn using QPainter. + + \table + \row + \o \inlineimage qpen-square.png + \o \inlineimage qpen-flat.png + \o \inlineimage qpen-roundcap.png + \row + \o Qt::SquareCap + \o Qt::FlatCap + \o Qt::RoundCap + \endtable + + \value FlatCap a square line end that does not cover the end + point of the line. + \value SquareCap a square line end that covers the end point and + extends beyond it by half the line width. + \value RoundCap a rounded line end. + \omitvalue MPenCapStyle + + \sa QPen +*/ + +/*! + \enum Qt::PenJoinStyle + + This enum type defines the pen join styles supported by Qt, i.e. + which joins between two connected lines can be drawn using + QPainter. + + \table + \row + \o \inlineimage qpen-bevel.png + \o \inlineimage qpen-miter.png + \o \inlineimage qpen-roundjoin.png + \row + \o Qt::BevelJoin + \o Qt::MiterJoin + \o Qt::RoundJoin + \endtable + + \value MiterJoin The outer edges of the lines are extended to + meet at an angle, and this area is filled. + \value BevelJoin The triangular notch between the two lines is filled. + \value RoundJoin A circular arc between the two lines is filled. + \value SvgMiterJoin A miter join corresponding to the definition of + a miter join in the \l{SVG 1.2 Tiny} specification. + \omitvalue MPenJoinStyle + + \sa QPen +*/ + +/*! + \enum Qt::BrushStyle + + This enum type defines the brush styles supported by Qt, i.e. the + fill pattern of shapes drawn using QPainter. + + \image brush-styles.png Brush Styles + + \value NoBrush No brush pattern. + \value SolidPattern Uniform color. + \value Dense1Pattern Extremely dense brush pattern. + \value Dense2Pattern Very dense brush pattern. + \value Dense3Pattern Somewhat dense brush pattern. + \value Dense4Pattern Half dense brush pattern. + \value Dense5Pattern Somewhat sparse brush pattern. + \value Dense6Pattern Very sparse brush pattern. + \value Dense7Pattern Extremely sparse brush pattern. + \value HorPattern Horizontal lines. + \value VerPattern Vertical lines. + \value CrossPattern Crossing horizontal and vertical lines. + \value BDiagPattern Backward diagonal lines. + \value FDiagPattern Forward diagonal lines. + \value DiagCrossPattern Crossing diagonal lines. + \value LinearGradientPattern Linear gradient (set using a dedicated QBrush constructor). + \value ConicalGradientPattern Conical gradient (set using a dedicated QBrush constructor). + \value RadialGradientPattern Radial gradient (set using a dedicated QBrush constructor). + \value TexturePattern Custom pattern (see QBrush::setTexture()). + + \omitvalue CustomPattern + + \sa QBrush +*/ + +/*! + \enum Qt::TextFlag + + This enum type is used to define some modifier flags. Some of + these flags only make sense in the context of printing: + + \value TextSingleLine Treats all whitespace as spaces and prints just + one line. + \value TextDontClip If it's impossible to stay within the given bounds, + it prints outside. + \value TextExpandTabs Makes the U+0009 (ASCII tab) character move to + the next tab stop. + \value TextShowMnemonic Displays the string "\&P" as \underline{P} + (see QButton for an example). For an ampersand, use "\&\&". + \value TextWordWrap Breaks lines at appropriate points, e.g. at word + boundaries. + \value TextWrapAnywhere Breaks lines anywhere, even within words. + \value TextHideMnemonic Same as Qt::TextShowMnemonic but doesn't draw + the underlines. + \value TextDontPrint Treat this text as "hidden" and don't print it. + \value IncludeTrailingSpaces When this option is set, + QTextLine::naturalTextWidth() and naturalTextRect() will + return a value that includes the width of trailing spaces in the + text; otherwise this width is excluded. + \value TextIncludeTrailingSpaces Same as IncludeTrailingSpaces + \value TextJustificationForced Ensures that text lines are justified. + + \omitvalue TextLongestVariant Ensures that the longest variant is always used + when computing the size of a multi-variant string. (Internal) + \omitvalue TextBypassShaping + \omitvalue BreakAnywhere + \omitvalue DontClip + \omitvalue DontPrint + \omitvalue ExpandTabs + \omitvalue IncludeTrailingSpaces + \omitvalue NoAccel + \omitvalue ShowPrefix + \omitvalue SingleLine + \omitvalue WordBreak + \omitvalue TextForceLeftToRight + \omitvalue TextForceRightToLeft + + You can use as many modifier flags as you want, except that + Qt::TextSingleLine and Qt::TextWordWrap cannot be combined. + + Flags that are inappropriate for a given use are generally + ignored. +*/ + +/*! + \enum Qt::BGMode + + Background mode: + + \value TransparentMode + \value OpaqueMode +*/ + +/*! + \enum Qt::ConnectionType + + This enum describes the types of connection that can be used + between signals and slots. In particular, it determines whether a + particular signal is delivered to a slot immediately or queued for + delivery at a later time. + + \value AutoConnection + (default) If the signal is emitted from a different thread than the + receiving object, the signal is queued, behaving as + Qt::QueuedConnection. Otherwise, the slot is invoked directly, + behaving as Qt::DirectConnection. The type of connection is + determined when the signal is emitted. + + \value DirectConnection + The slot is invoked immediately, when the signal is + emitted. + + \value QueuedConnection + The slot is invoked when control returns to the event loop + of the receiver's thread. The slot is executed in the + receiver's thread. + + \value BlockingQueuedConnection + Same as QueuedConnection, except the current thread blocks + until the slot returns. This connection type should only be + used where the emitter and receiver are in different + threads. \note Violating this rule can cause your + application to deadlock. + + \value UniqueConnection + Same as AutoConnection, but the connection is made only if + it does not duplicate an existing connection. i.e., if the + same signal is already connected to the same slot for the + same pair of objects, then the connection will fail. This + connection type was introduced in Qt 4.6. + + \value AutoCompatConnection + The default type when Qt 3 support is enabled. Same as + AutoConnection but will also cause warnings to be output in + certain situations. See \l{Porting to Qt 4#Compatibility + Signals and Slots}{Compatibility Signals and Slots} for + further information. + + With queued connections, the parameters must be of types that are + known to Qt's meta-object system, because Qt needs to copy the + arguments to store them in an event behind the scenes. If you try + to use a queued connection and get the error message: + + \snippet doc/src/snippets/code/doc_src_qnamespace.qdoc 0 + + Call qRegisterMetaType() to register the data type before you + establish the connection. + + When using signals and slots with multiple threads, see \l{Signals and Slots Across Threads}. + + \sa {Thread Support in Qt}, QObject::connect(), qRegisterMetaType() +*/ + +/*! + \enum Qt::DateFormat + + \value TextDate The default Qt format, which includes the day and month name, + the day number in the month, and the year in full. The day and month names will + be short, localized names. This is basically equivalent to using the date format + string, "ddd MMM d yyyy". See QDate::toString() for more information. + + \value ISODate \l{ISO 8601} extended format: either \c{YYYY-MM-DD} for dates or + \c{YYYY-MM-DDTHH:MM:SS}, \c{YYYY-MM-DDTHH:MM:SSTZD} (e.g., 1997-07-16T19:20:30+01:00) + for combined dates and times. + + \value SystemLocaleShortDate The \l{QLocale::ShortFormat}{short format} used + by the \l{QLocale::system()}{operating system}. + + \value SystemLocaleLongDate The \l{QLocale::LongFormat}{long format} used + by the \l{QLocale::system()}{operating system}. + + \value DefaultLocaleShortDate The \l{QLocale::ShortFormat}{short format} specified + by the \l{QLocale::setDefault()}{application's locale}. + + \value DefaultLocaleLongDate The \l{QLocale::LongFormat}{long format} used + by the \l{QLocale::setDefault()}{application's locale}. + + \value SystemLocaleDate \e{This enum value is deprecated.} Use Qt::SystemLocaleShortDate + instead (or Qt::SystemLocaleLongDate if you want long dates). + + \value LocaleDate \e{This enum value is deprecated.} Use Qt::DefaultLocaleShortDate + instead (or Qt::DefaultLocaleLongDate if you want long dates). + + \value LocalDate \e{This enum value is deprecated.} Use Qt::SystemLocaleShortDate + instead (or Qt::SystemLocaleLongDate if you want long dates). + + \note For \c ISODate formats, each \c Y, \c M and \c D represents a single digit + of the year, month and day used to specify the date. Each \c H, \c M and \c S + represents a single digit of the hour, minute and second used to specify the time. + The presence of a literal \c T character is used to separate the date and time when + both are specified. +*/ + + +/*! + \enum Qt::TimeSpec + + \value LocalTime Locale dependent time (Timezones and Daylight Savings Time). + \value UTC Coordinated Universal Time, replaces Greenwich Mean Time. + \value OffsetFromUTC An offset in seconds from Coordinated Universal Time. +*/ + +/*! + \enum Qt::DayOfWeek + + \value Monday + \value Tuesday + \value Wednesday + \value Thursday + \value Friday + \value Saturday + \value Sunday +*/ + +/*! + \enum Qt::CaseSensitivity + + \value CaseInsensitive + \value CaseSensitive +*/ + +/*! + \enum Qt::ToolBarArea + + \value LeftToolBarArea + \value RightToolBarArea + \value TopToolBarArea + \value BottomToolBarArea + \value AllToolBarAreas + \value NoToolBarArea + + \omitvalue ToolBarArea_Mask +*/ + +/*! + \enum Qt::DockWidgetArea + + \value LeftDockWidgetArea + \value RightDockWidgetArea + \value TopDockWidgetArea + \value BottomDockWidgetArea + \value AllDockWidgetAreas + \value NoDockWidgetArea + + \omitvalue DockWidgetArea_Mask +*/ + +/*! + \enum Qt::BackgroundMode + + \compat + + \value FixedColor + \value FixedPixmap + \value NoBackground + \value PaletteForeground + \value PaletteButton + \value PaletteLight + \value PaletteMidlight + \value PaletteDark + \value PaletteMid + \value PaletteText + \value PaletteBrightText + \value PaletteBase + \value PaletteBackground + \value PaletteShadow + \value PaletteHighlight + \value PaletteHighlightedText + \value PaletteButtonText + \value PaletteLink + \value PaletteLinkVisited + \value X11ParentRelative +*/ + +/*! + \enum Qt::ImageConversionFlag + + The options marked "(default)" are set if no other values from + the list are included (since the defaults are zero): + + Color/Mono preference (ignored for QBitmap): + + \value AutoColor (default) - If the image has \link + QImage::depth() depth\endlink 1 and contains only + black and white pixels, the pixmap becomes monochrome. + \value ColorOnly The pixmap is dithered/converted to the + \link QPixmap::defaultDepth() native display depth\endlink. + \value MonoOnly The pixmap becomes monochrome. If necessary, + it is dithered using the chosen dithering algorithm. + + Dithering mode preference for RGB channels: + + \value DiffuseDither (default) - A high-quality dither. + \value OrderedDither A faster, more ordered dither. + \value ThresholdDither No dithering; closest color is used. + + Dithering mode preference for alpha channel: + + \value ThresholdAlphaDither (default) - No dithering. + \value OrderedAlphaDither A faster, more ordered dither. + \value DiffuseAlphaDither A high-quality dither. + \omitvalue NoAlpha + + Color matching versus dithering preference: + + \value PreferDither (default when converting to a pixmap) - Always dither + 32-bit images when the image is converted to 8 bits. + \value AvoidDither (default when converting for the purpose of saving to + file) - Dither 32-bit images only if the image has more than 256 + colors and it is being converted to 8 bits. + \omitvalue AutoDither + + \omitvalue ColorMode_Mask + \omitvalue Dither_Mask + \omitvalue AlphaDither_Mask + \omitvalue DitherMode_Mask + + \value NoOpaqueDetection Do not check whether the image contains non-opaque + pixels. Use this if you know that the image is semi-transparent and + you want to avoid the overhead of checking the pixels in the image + until a non-opaque pixel is found, or if you want the pixmap to + retain an alpha channel for some other reason. If the image has no + alpha channel this flag has no effect. + + \omitvalue NoFormatConversion Don't do any format conversions on the image. + Can be useful when converting a QImage to a QPixmap for a one-time + rendering operation for example. +*/ + +/*! \enum Qt::GUIStyle + + \compat + + \value WindowsStyle + \value MotifStyle + \value MacStyle + \value Win3Style + \value PMStyle +*/ + +/*! + \enum Qt::UIEffect + + This enum describes the available UI effects. + + By default, Qt will try to use the platform specific desktop + settings for each effect. Use the + QApplication::setDesktopSettingsAware() function (passing \c false + as argument) to prevent this, and the + QApplication::setEffectEnabled() to enable or disable a particular + effect. + + Note that all effects are disabled on screens running at less than + 16-bit color depth. + + \omitvalue UI_General + + \value UI_AnimateMenu Show animated menus. + \value UI_FadeMenu Show faded menus. + \value UI_AnimateCombo Show animated comboboxes. + \value UI_AnimateTooltip Show tooltip animations. + \value UI_FadeTooltip Show tooltip fading effects. + \value UI_AnimateToolBox Reserved + + \sa QApplication::setEffectEnabled(), QApplication::setDesktopSettingsAware() +*/ + +/*! \enum Qt::AspectRatioMode + + This enum type defines what happens to the aspect ratio when + scaling an rectangle. + + \image qimage-scaling.png + + \value IgnoreAspectRatio The size is scaled freely. The aspect + ratio is not preserved. + \value KeepAspectRatio The size is scaled to a rectangle as + large as possible inside a given + rectangle, preserving the aspect ratio. + \value KeepAspectRatioByExpanding The size is scaled to a + rectangle as small as possible + outside a given rectangle, + preserving the aspect ratio. + + \omitvalue ScaleFree + \omitvalue ScaleMin + \omitvalue ScaleMax + + \sa QSize::scale(), QImage::scaled() +*/ + +/*! \typedef Qt::ScaleMode + \compat + + Use Qt::AspectRatioMode instead. + + The enum values have been renamed as follows: + + \table + \row \i Old enum value \i New enum value + \row \i Qt::ScaleFree \i Qt::IgnoreAspectRatio + \row \i Qt::ScaleMin \i Qt::KeepAspectRatio + \row \i Qt::ScaleMax \i Qt::KeepAspectRatioByExpanding + \endtable +*/ + +/*! \enum Qt::TransformationMode + + This enum type defines whether image transformations (e.g., + scaling) should be smooth or not. + + \value FastTransformation The transformation is performed + quickly, with no smoothing. + \value SmoothTransformation The resulting image is transformed + using bilinear filtering. + + \sa QImage::scaled() +*/ + +/*! \enum Qt::Axis + + This enum type defines three values to represent the three + axes in the cartesian coordinate system. + + \value XAxis The X axis. + \value YAxis The Y axis. + \value ZAxis The Z axis. + + \sa QTransform::rotate(), QTransform::rotateRadians() + */ + +/*! + \enum Qt::WidgetAttribute + + \keyword widget attributes + + This enum type is used to specify various widget attributes. + Attributes are set and cleared with QWidget::setAttribute(), and + queried with QWidget::testAttribute(), although some have special + convenience functions which are mentioned below. + + \value WA_AcceptDrops Allows data from drag and drop operations + to be dropped onto the widget (see QWidget::setAcceptDrops()). + + \value WA_AlwaysShowToolTips Enables tooltips for inactive windows. + + \value WA_ContentsPropagated This flag is superfluous and + obsolete; it no longer has any effect. Since Qt 4.1, all widgets + that do not set WA_PaintOnScreen propagate their contents. + + \value WA_CustomWhatsThis Indicates that the widget wants to + continue operating normally in "What's This?" mode. This is set by the + widget's author. + + \value WA_DeleteOnClose Makes Qt delete this widget when the + widget has accepted the close event (see QWidget::closeEvent()). + + \value WA_Disabled Indicates that the widget is disabled, i.e. + it does not receive any mouse or keyboard events. There is also a + getter functions QWidget::isEnabled(). This is set/cleared by the + Qt kernel. + + \value WA_DontShowOnScreen Indicates that the widget is hidden or is + not a part of the viewable Desktop. + + \omitvalue WA_DropSiteRegistered + \omitvalue WA_ForceAcceptDrops + + \value WA_ForceDisabled Indicates that the widget is + explicitly disabled, i.e. it will remain disabled even when all + its ancestors are set to the enabled state. This implies + WA_Disabled. This is set/cleared by QWidget::setEnabled() and + QWidget::setDisabled(). + + \value WA_ForceUpdatesDisabled Indicates that updates are + explicitly disabled for the widget; i.e. it will remain disabled + even when all its ancestors are set to the updates-enabled state. + This implies WA_UpdatesDisabled. This is set/cleared by + QWidget::setUpdatesEnabled(). + + \value WA_GroupLeader + \e{This attribute has been deprecated.} Use QWidget::windowModality + instead. + + \value WA_Hover Forces Qt to generate paint events when the mouse + enters or leaves the widget. This feature is typically used when + implementing custom styles; see the \l{widgets/styles}{Styles} + example for details. + + \value WA_InputMethodEnabled Enables input methods for Asian languages. + Must be set when creating custom text editing widgets. + On Windows CE and Symbian this flag can be used in addition to + QApplication::autoSipEnabled to automatically display the SIP when + entering a widget. + + \value WA_KeyboardFocusChange Set on a toplevel window when + the users changes focus with the keyboard (tab, backtab, or shortcut). + + \value WA_KeyCompression Enables key event compression if set, + and disables it if not set. By default key compression is off, so + widgets receive one key press event for each key press (or more, + since autorepeat is usually on). If you turn it on and your + program doesn't keep up with key input, Qt may try to compress key + events so that more than one character can be processed in each + event. + For example, a word processor widget might receive 2, 3 or more + characters in each QKeyEvent::text(), if the layout recalculation + takes too long for the CPU. + If a widget supports multiple character unicode input, it is + always safe to turn the compression on. + Qt performs key event compression only for printable characters. + Qt::Modifier keys, cursor movement keys, function keys and + miscellaneous action keys (e.g. Escape, Enter, Backspace, + PrintScreen) will stop key event compression, even if there are + more compressible key events available. + Platforms other than Mac and X11 do not support this compression, + in which case turning it on will have no effect. + This is set/cleared by the widget's author. + + \value WA_LayoutOnEntireRect Indicates that the widget + wants QLayout to operate on the entire QWidget::rect(), not only + on QWidget::contentsRect(). This is set by the widget's author. + + \value WA_LayoutUsesWidgetRect Ignore the layout item rect from the style + when laying out this widget with QLayout. This makes a difference in + QMacStyle and QPlastiqueStyle for some widgets. + + \value WA_MacNoClickThrough When a widget that has this attribute set + is clicked, and its window is inactive, the click will make the window + active but won't be seen by the widget. Typical use of this attribute + is on widgets with "destructive" actions, such as a "Delete" button. + WA_MacNoClickThrough also applies to all child widgets of the widget + that has it set. + + \value WA_MacOpaqueSizeGrip Indicates that the native Carbon size grip + should be opaque instead of transparent (the default). This attribute + is only applicable to Mac OS X and is set by the widget's author. + + \value WA_MacShowFocusRect Indicates that this widget should get a + QFocusFrame around it. Some widgets draw their own focus halo + regardless of this attribute. Not that the QWidget::focusPolicy + also plays the main role in whether something is given focus or + not, this only controls whether or not this gets the focus + frame. This attribute is only applicable to Mac OS X. + + \value WA_MacNormalSize Indicates the widget should have the + normal size for widgets in Mac OS X. This attribute is only + applicable to Mac OS X. + + \value WA_MacSmallSize Indicates the widget should have the small + size for widgets in Mac OS X. This attribute is only applicable to + Mac OS X. + + \value WA_MacMiniSize Indicates the widget should have the mini + size for widgets in Mac OS X. This attribute is only applicable to + Mac OS X. + + \value WA_MacVariableSize Indicates the widget can choose between + alternative sizes for widgets to avoid clipping. + This attribute is only applicable to Mac OS X. + + \value WA_MacBrushedMetal Indicates the widget should be drawn in + the brushed metal style as supported by the windowing system. This + attribute is only applicable to Mac OS X. + + \omitvalue WA_MacMetalStyle + + \value WA_Mapped Indicates that the widget is mapped on screen. + This is set/cleared by the Qt kernel. + + \value WA_MouseNoMask Makes the widget receive mouse events for + the entire widget regardless of the currently set mask, + overriding QWidget::setMask(). This is not applicable for + top-level windows. + + \value WA_MouseTracking Indicates that the widget has mouse + tracking enabled. See QWidget::mouseTracking. + + \value WA_Moved Indicates that the widget has an explicit + position. This is set/cleared by QWidget::move() and + by QWidget::setGeometry(). + + \value WA_MSWindowsUseDirect3D This value is obsolete and has no + effect. + + \value WA_NoBackground This value is obsolete. Use + WA_OpaquePaintEvent instead. + + \value WA_NoChildEventsForParent Indicates that the widget does + not want ChildAdded or ChildRemoved events sent to its + parent. This is rarely necessary but can help to avoid automatic + insertion widgets like splitters and layouts. This is set by a + widget's author. + + \value WA_NoChildEventsFromChildren Indicates that the widget does + not want to receive ChildAdded or ChildRemoved events sent from its + children. This is set by a widget's author. + + \value WA_NoMouseReplay Used for pop-up widgets. Indicates that the most + recent mouse press event should not be replayed when the pop-up widget + closes. The flag is set by the widget's author and cleared by the Qt kernel + every time the widget receives a new mouse event. + + \value WA_NoMousePropagation Prohibits mouse events from being propagated + to the widget's parent. This attribute is disabled by default. + + \value WA_TransparentForMouseEvents When enabled, this attribute disables + the delivery of mouse events to the widget and its children. Mouse events + are delivered to other widgets as if the widget and its children were not + present in the widget hierarchy; mouse clicks and other events effectively + "pass through" them. This attribute is disabled by default. + + \value WA_NoSystemBackground Indicates that the widget has no background, + i.e. when the widget receives paint events, the background is not + automatically repainted. \note Unlike WA_OpaquePaintEvent, newly exposed + areas are \bold never filled with the background (e.g., after showing a + window for the first time the user can see "through" it until the + application processes the paint events). This flag is set or cleared by the + widget's author. + + \value WA_OpaquePaintEvent Indicates that the widget paints all its pixels + when it receives a paint event. Thus, it is not required for operations + like updating, resizing, scrolling and focus changes to erase the widget + before generating paint events. The use of WA_OpaquePaintEvent provides a + small optimization by helping to reduce flicker on systems that do not + support double buffering and avoiding computational cycles necessary to + erase the background prior to painting. \note Unlike + WA_NoSystemBackground, WA_OpaquePaintEvent makes an effort to avoid + transparent window backgrounds. This flag is set or cleared by the widget's + author. + + \value WA_OutsideWSRange Indicates that the widget is outside + the valid range of the window system's coordinate system. A widget + outside the valid range cannot be mapped on screen. This is + set/cleared by the Qt kernel. + + \value WA_PaintOnScreen Indicates that the widget wants to draw directly + onto the screen. Widgets with this attribute set do not participate in + composition management, i.e. they cannot be semi-transparent or shine + through semi-transparent overlapping widgets. \note This flag is only + supported on X11 and it disables double buffering. On Qt for Embedded + Linux, the flag only works when set on a top-level widget and it relies on + support from the active screen driver. This flag is set or cleared by the + widget's author. To render outside of Qt's paint system, e.g., if you + require native painting primitives, you need to reimplement + QWidget::paintEngine() to return 0 and set this flag. + + \value WA_PaintOutsidePaintEvent Makes it possible to use QPainter to + paint on the widget outside \l{QWidget::paintEvent()}{paintEvent()}. This + flag is not supported on Windows, Mac OS X or Embedded Linux. We recommend + that you use it only when porting Qt 3 code to Qt 4. + + \value WA_PaintUnclipped Makes all painters operating on this widget + unclipped. Children of this widget or other widgets in front of it do not + clip the area the painter can paint on. This flag is only supported for + widgets with the WA_PaintOnScreen flag set. The preferred way to do this in + a cross platform way is to create a transparent widget that lies in front + of the other widgets. + + \value WA_PendingMoveEvent Indicates that a move event is pending, e.g., + when a hidden widget was moved. This flag is set or cleared by the Qt + kernel. + + \value WA_PendingResizeEvent Indicates that a resize event is pending, + e.g., when a hidden widget was resized. This flag is set or cleared by the + Qt kernel. + + \value WA_QuitOnClose Makes Qt quit the application when the last widget + with the attribute set has accepted closeEvent(). This behavior can be + modified with the QApplication::quitOnLastWindowClosed property. By default + this attribute is set for all widgets of type Qt::Window. + + \value WA_Resized Indicates that the widget has an explicit size. This flag + is set or cleared by QWidget::resize() and QWidget::setGeometry(). + + \value WA_RightToLeft Indicates that the layout direction for the widget + is right to left. + + \value WA_SetCursor Indicates that the widget has a cursor of its own. This + flag is set or cleared by QWidget::setCursor() and QWidget::unsetCursor(). + + \value WA_SetFont Indicates that the widget has a font of its own. This + flag is set or cleared by QWidget::setFont(). + + \value WA_SetPalette Indicates that the widget has a palette of its own. + This flag is set or cleared by QWidget::setPalette(). + + \value WA_SetStyle Indicates that the widget has a style of its own. This + flag is set or cleared by QWidget::setStyle(). + + \value WA_ShowModal \e{This attribute has been deprecated.} Use + QWidget::windowModality instead. + + \value WA_StaticContents Indicates that the widget contents are north-west + aligned and static. On resize, such a widget will receive paint events only + for parts of itself that are newly visible. This flag is set or cleared by + the widget's author. + + \value WA_StyleSheet Indicates that the widget is styled using a + \l{Qt Style Sheets}{style sheet}. + + \value WA_TranslucentBackground Indicates that the widget should have a + translucent background, i.e., any non-opaque regions of the widgets will be + translucent because the widget will have an alpha channel. Setting this + flag causes WA_NoSystemBackground to be set. On Windows the + widget also needs the Qt::FramelessWindowHint window flag to be set. + This flag is set or cleared by the widget's author. + + \value WA_UnderMouse Indicates that the widget is under the mouse cursor. + The value is not updated correctly during drag and drop operations. There + is also a getter function, QWidget::underMouse(). This flag is set or + cleared by the Qt kernel. + + \value WA_UpdatesDisabled Indicates that updates are blocked (including the + system background). This flag is set or cleared by the Qt kernel. + \warning This flag must \e never be set or cleared by the widget's author. + + \value WA_WindowModified Indicates that the window is marked as modified. + On some platforms this flag will do nothing, on others (including Mac OS X + and Windows) the window will take a modified appearance. This flag is set + or cleared by QWidget::setWindowModified(). + + \value WA_WindowPropagation Makes a toplevel window inherit font and + palette from its parent. + + \value WA_MacAlwaysShowToolWindow On Mac OS X, show the tool window even + when the application is not active. By default, all tool windows are + hidden when the application is inactive. + + \value WA_SetLocale Indicates the locale should be taken into consideration + in the widget. + + \value WA_StyledBackground Indicates the widget should be drawn using a + styled background. + + \value WA_ShowWithoutActivating Show the widget without making it active. + + \value WA_NativeWindow Indicates that a native window is created for the + widget. Enabling this flag will also force a native window for the widget's + ancestors unless Qt::WA_DontCreateNativeAncestors is set. + + \value WA_DontCreateNativeAncestors Indicates that the widget's ancestors + are kept non-native even though the widget itself is native. + + \value WA_X11NetWmWindowTypeDesktop Adds _NET_WM_WINDOW_TYPE_DESKTOP to the + window's _NET_WM_WINDOW_TYPE X11 window property. See + http://standards.freedesktop.org/wm-spec/ for more details. This attribute + has no effect on non-X11 platforms. + + \value WA_X11NetWmWindowTypeDock Adds _NET_WM_WINDOW_TYPE_DOCK to the + window's _NET_WM_WINDOW_TYPE X11 window property. See + http://standards.freedesktop.org/wm-spec/ for more details. This attribute + has no effect on non-X11 platforms. + + \value WA_X11NetWmWindowTypeToolBar Adds _NET_WM_WINDOW_TYPE_TOOLBAR to the + window's _NET_WM_WINDOW_TYPE X11 window property. See + http://standards.freedesktop.org/wm-spec/ for more details. This attribute + has no effect on non-X11 platforms. \note Qt automaticaly sets this + attribute for QToolBar. + + \value WA_X11NetWmWindowTypeMenu Adds _NET_WM_WINDOW_TYPE_MENU to the + window's _NET_WM_WINDOW_TYPE X11 window property. See + http://standards.freedesktop.org/wm-spec/ for more details. This attribute + has no effect on non-X11 platforms. \note Qt automatically sets this + attribute for QMenu when torn-off. + + \value WA_X11NetWmWindowTypeUtility Adds _NET_WM_WINDOW_TYPE_UTILITY to the + window's _NET_WM_WINDOW_TYPE X11 window property. See + http://standards.freedesktop.org/wm-spec/ for more details. This attribute + has no effect on non-X11 platforms. \note Qt automatically sets this + attribute for the Qt::Tool window type. + + \value WA_X11NetWmWindowTypeSplash Adds _NET_WM_WINDOW_TYPE_SPLASH to the + window's _NET_WM_WINDOW_TYPE X11 window property. See + http://standards.freedesktop.org/wm-spec/ for more details. This attribute + has no effect on non-X11 platforms. \note Qt automatically sets this + attribute for the Qt::SplashScreen window type. + + \value WA_X11NetWmWindowTypeDialog Adds _NET_WM_WINDOW_TYPE_DIALOG + to the window's _NET_WM_WINDOW_TYPE X11 window property. See + http://standards.freedesktop.org/wm-spec/ for more details. This + attribute has no effect on non-X11 platforms. \note Qt automatically sets + this attribute for the Qt::Dialog and Qt::Sheet window types. + + \value WA_X11NetWmWindowTypeDropDownMenu Adds + _NET_WM_WINDOW_TYPE_DROPDOWN_MENU to the window's + _NET_WM_WINDOW_TYPE X11 window property. See + http://standards.freedesktop.org/wm-spec/ for more details. This + attribute has no effect on non-X11 platforms. \note Qt + automatically sets this attribute for QMenus added to a QMenuBar. + + \value WA_X11NetWmWindowTypePopupMenu Adds _NET_WM_WINDOW_TYPE_POPUP_MENU + to the window's _NET_WM_WINDOW_TYPE X11 window property. See + http://standards.freedesktop.org/wm-spec/ for more details. This attribute + has no effect on non-X11 platforms. \note Qt automatically sets this + attribute for QMenu. + + \value WA_X11NetWmWindowTypeToolTip Adds _NET_WM_WINDOW_TYPE_TOOLTIP to the + window's _NET_WM_WINDOW_TYPE X11 window property. See + http://standards.freedesktop.org/wm-spec/ for more details. This attribute + has no effect on non-X11 platforms. \note Qt automatically sets this + attribute for the Qt::ToolTip window type. + + \value WA_X11NetWmWindowTypeNotification Adds + _NET_WM_WINDOW_TYPE_NOTIFICATION to the window's _NET_WM_WINDOW_TYPE X11 + window property. See http://standards.freedesktop.org/wm-spec/ for more + details. This attribute has no effect on non-X11 platforms. + + \value WA_X11NetWmWindowTypeCombo Adds _NET_WM_WINDOW_TYPE_COMBO + to the window's _NET_WM_WINDOW_TYPE X11 window property. See + http://standards.freedesktop.org/wm-spec/ for more details. This attribute + has no effect on non-X11 platforms. \note Qt automatically sets this + attribute for the QComboBox pop-up. + + \value WA_X11NetWmWindowTypeDND Adds _NET_WM_WINDOW_TYPE_DND to + the window's _NET_WM_WINDOW_TYPE X11 window property. See + http://standards.freedesktop.org/wm-spec/ for more details. This attribute + has no effect on non-X11 platforms. \note Qt automatically sets this + attribute on the feedback widget used during a drag. + + \value WA_MacFrameworkScaled Enables resolution independence aware mode + on Mac when using Carbon. This attribute has no effect on Cocoa. + The attribute is off by default and can be enabled on a per-window basis. + + \value WA_AcceptTouchEvents Allows touch events (see QTouchEvent) + to be sent to the widget. Must be set on all widgets that can + handle touch events. Without this attribute set, events from a + touch device will be sent as mouse events. + + \value WA_TouchPadAcceptSingleTouchEvents Allows touchpad single + touch events to be sent to the widget. + + \value WA_MergeSoftkeys Allows widget to merge softkeys with parent widget, + i.e. widget can set only one softkeys and request softkey implementation + to take rest of the softkeys from the parent. Note parents are traversed until + WA_MergeSoftkeys is not set. See also Qt::WA_MergeSoftkeysRecursively + This attribute currently has effect only on Symbian platforms + + \value WA_MergeSoftkeysRecursively Allows widget to merge softkeys recursively + with all parents. If this attribute is set, the widget parents are traversed until + window boundary (widget without parent or dialog) is found. + This attribute currently has effect only on Symbian platforms + + \value WA_X11DoNotAcceptFocus Asks the window manager to not give focus + to this top level window. This attribute has no effect on non-X11 + platforms. + + \value WA_LockPortraitOrientation Locks the widget to a portrait orientation, + ignoring changes to the display's orientation with respect to the user. + \value WA_LockLandscapeOrientation Locks the widget to a landscape orientation, + ignoring changes to the display's orientation with respect to the user. + \value WA_AutoOrientation Causes the widget to change orientation whenever the + display changes orientation with respect to the user. + + \value WA_MacNoShadow Since Qt 4.8, this attribute disables drop shadows + for this top level window. Only affects Cocoa builds of Qt for Mac OS X. + + \omitvalue WA_SetLayoutDirection + \omitvalue WA_InputMethodTransparent + \omitvalue WA_WState_CompressKeys + \omitvalue WA_WState_ConfigPending + \omitvalue WA_WState_Created + \omitvalue WA_WState_DND + \omitvalue WA_WState_ExplicitShowHide + \omitvalue WA_WState_Hidden + \omitvalue WA_WState_InPaintEvent + \omitvalue WA_WState_OwnSizePolicy + \omitvalue WA_WState_Polished + \omitvalue WA_WState_Reparented + \omitvalue WA_WState_Visible + \omitvalue WA_SetWindowIcon + \omitvalue WA_PendingUpdate + \omitvalue WA_LaidOut + \omitvalue WA_GrabbedShortcut + \omitvalue WA_DontShowOnScreen + \omitvalue WA_InvalidSize + \omitvalue WA_ForceUpdatesDisabled + \omitvalue WA_NoX11EventCompression + \omitvalue WA_TintedBackground + \omitvalue WA_X11OpenGLOverlay + \omitvalue WA_CanHostQMdiSubWindowTitleBar + \omitvalue WA_AttributeCount + \omitvalue WA_StyleSheet + \omitvalue WA_X11BypassTransientForHint + \omitvalue WA_SetWindowModality + \omitvalue WA_WState_WindowOpacitySet + \omitvalue WA_WState_AcceptedTouchBeginEvent + \omitvalue WA_SymbianNoSystemRotation +*/ + +/*! \typedef Qt::HANDLE + + Platform-specific handle type for system objects. This is + equivalent to \c{void *} on Mac OS X and embedded Linux, + and to \c{unsigned long} on X11. On Windows it is the + DWORD returned by the Win32 function getCurrentThreadId(). + + \warning Using this type is not portable. +*/ + +/*! + \enum Qt::Key + + The key names used by Qt. + + \value Key_Escape + \value Key_Tab + \value Key_Backtab + \omitvalue Key_BackTab + \value Key_Backspace + \omitvalue Key_BackSpace + \value Key_Return + \value Key_Enter Typically located on the keypad. + \value Key_Insert + \value Key_Delete + \value Key_Pause The Pause/Break key (\note Not anything to do with pausing media) + \value Key_Print + \value Key_SysReq + \value Key_Clear + \value Key_Home + \value Key_End + \value Key_Left + \value Key_Up + \value Key_Right + \value Key_Down + \value Key_PageUp + \omitvalue Key_Prior + \value Key_PageDown + \omitvalue Key_Next + \value Key_Shift + \value Key_Control On Mac OS X, this corresponds to the Command keys. + \value Key_Meta On Mac OS X, this corresponds to the Control keys. + On Windows keyboards, this key is mapped to the + Windows key. + \value Key_Alt + \value Key_AltGr On Windows, when the KeyDown event for this key is + sent, the Ctrl+Alt modifiers are also set. + \value Key_CapsLock + \value Key_NumLock + \value Key_ScrollLock + \value Key_F1 + \value Key_F2 + \value Key_F3 + \value Key_F4 + \value Key_F5 + \value Key_F6 + \value Key_F7 + \value Key_F8 + \value Key_F9 + \value Key_F10 + \value Key_F11 + \value Key_F12 + \value Key_F13 + \value Key_F14 + \value Key_F15 + \value Key_F16 + \value Key_F17 + \value Key_F18 + \value Key_F19 + \value Key_F20 + \value Key_F21 + \value Key_F22 + \value Key_F23 + \value Key_F24 + \value Key_F25 + \value Key_F26 + \value Key_F27 + \value Key_F28 + \value Key_F29 + \value Key_F30 + \value Key_F31 + \value Key_F32 + \value Key_F33 + \value Key_F34 + \value Key_F35 + \value Key_Super_L + \value Key_Super_R + \value Key_Menu + \value Key_Hyper_L + \value Key_Hyper_R + \value Key_Help + \value Key_Direction_L + \value Key_Direction_R + \value Key_Space + \value Key_Any + \value Key_Exclam + \value Key_QuoteDbl + \value Key_NumberSign + \value Key_Dollar + \value Key_Percent + \value Key_Ampersand + \value Key_Apostrophe + \value Key_ParenLeft + \value Key_ParenRight + \value Key_Asterisk + \value Key_Plus + \value Key_Comma + \value Key_Minus + \value Key_Period + \value Key_Slash + \value Key_0 + \value Key_1 + \value Key_2 + \value Key_3 + \value Key_4 + \value Key_5 + \value Key_6 + \value Key_7 + \value Key_8 + \value Key_9 + \value Key_Colon + \value Key_Semicolon + \value Key_Less + \value Key_Equal + \value Key_Greater + \value Key_Question + \value Key_At + \value Key_A + \value Key_B + \value Key_C + \value Key_D + \value Key_E + \value Key_F + \value Key_G + \value Key_H + \value Key_I + \value Key_J + \value Key_K + \value Key_L + \value Key_M + \value Key_N + \value Key_O + \value Key_P + \value Key_Q + \value Key_R + \value Key_S + \value Key_T + \value Key_U + \value Key_V + \value Key_W + \value Key_X + \value Key_Y + \value Key_Z + \value Key_BracketLeft + \value Key_Backslash + \value Key_BracketRight + \value Key_AsciiCircum + \value Key_Underscore + \value Key_QuoteLeft + \value Key_BraceLeft + \value Key_Bar + \value Key_BraceRight + \value Key_AsciiTilde + \value Key_nobreakspace + \value Key_exclamdown + \value Key_cent + \value Key_sterling + \value Key_currency + \value Key_yen + \value Key_brokenbar + \value Key_section + \value Key_diaeresis + \value Key_copyright + \value Key_ordfeminine + \value Key_guillemotleft + \value Key_notsign + \value Key_hyphen + \value Key_registered + \value Key_macron + \value Key_degree + \value Key_plusminus + \value Key_twosuperior + \value Key_threesuperior + \value Key_acute + \value Key_mu + \value Key_paragraph + \value Key_periodcentered + \value Key_cedilla + \value Key_onesuperior + \value Key_masculine + \value Key_guillemotright + \value Key_onequarter + \value Key_onehalf + \value Key_threequarters + \value Key_questiondown + \value Key_Agrave + \value Key_Aacute + \value Key_Acircumflex + \value Key_Atilde + \value Key_Adiaeresis + \value Key_Aring + \value Key_AE + \value Key_Ccedilla + \value Key_Egrave + \value Key_Eacute + \value Key_Ecircumflex + \value Key_Ediaeresis + \value Key_Igrave + \value Key_Iacute + \value Key_Icircumflex + \value Key_Idiaeresis + \value Key_ETH + \value Key_Ntilde + \value Key_Ograve + \value Key_Oacute + \value Key_Ocircumflex + \value Key_Otilde + \value Key_Odiaeresis + \value Key_multiply + \value Key_Ooblique + \value Key_Ugrave + \value Key_Uacute + \value Key_Ucircumflex + \value Key_Udiaeresis + \value Key_Yacute + \value Key_THORN + \value Key_ssharp + \omitvalue Key_agrave + \omitvalue Key_aacute + \omitvalue Key_acircumflex + \omitvalue Key_atilde + \omitvalue Key_adiaeresis + \omitvalue Key_aring + \omitvalue Key_ae + \omitvalue Key_ccedilla + \omitvalue Key_egrave + \omitvalue Key_eacute + \omitvalue Key_ecircumflex + \omitvalue Key_ediaeresis + \omitvalue Key_igrave + \omitvalue Key_iacute + \omitvalue Key_icircumflex + \omitvalue Key_idiaeresis + \omitvalue Key_eth + \omitvalue Key_ntilde + \omitvalue Key_ograve + \omitvalue Key_oacute + \omitvalue Key_ocircumflex + \omitvalue Key_otilde + \omitvalue Key_odiaeresis + \value Key_division + \omitvalue Key_oslash + \omitvalue Key_ugrave + \omitvalue Key_uacute + \omitvalue Key_ucircumflex + \omitvalue Key_udiaeresis + \omitvalue Key_yacute + \omitvalue Key_thorn + \value Key_ydiaeresis + \value Key_Multi_key + \value Key_Codeinput + \value Key_SingleCandidate + \value Key_MultipleCandidate + \value Key_PreviousCandidate + \value Key_Mode_switch + \value Key_Kanji + \value Key_Muhenkan + \value Key_Henkan + \value Key_Romaji + \value Key_Hiragana + \value Key_Katakana + \value Key_Hiragana_Katakana + \value Key_Zenkaku + \value Key_Hankaku + \value Key_Zenkaku_Hankaku + \value Key_Touroku + \value Key_Massyo + \value Key_Kana_Lock + \value Key_Kana_Shift + \value Key_Eisu_Shift + \value Key_Eisu_toggle + \value Key_Hangul + \value Key_Hangul_Start + \value Key_Hangul_End + \value Key_Hangul_Hanja + \value Key_Hangul_Jamo + \value Key_Hangul_Romaja + \value Key_Hangul_Jeonja + \value Key_Hangul_Banja + \value Key_Hangul_PreHanja + \value Key_Hangul_PostHanja + \value Key_Hangul_Special + \value Key_Dead_Grave + \value Key_Dead_Acute + \value Key_Dead_Circumflex + \value Key_Dead_Tilde + \value Key_Dead_Macron + \value Key_Dead_Breve + \value Key_Dead_Abovedot + \value Key_Dead_Diaeresis + \value Key_Dead_Abovering + \value Key_Dead_Doubleacute + \value Key_Dead_Caron + \value Key_Dead_Cedilla + \value Key_Dead_Ogonek + \value Key_Dead_Iota + \value Key_Dead_Voiced_Sound + \value Key_Dead_Semivoiced_Sound + \value Key_Dead_Belowdot + \value Key_Dead_Hook + \value Key_Dead_Horn + \value Key_Back + \value Key_Forward + \value Key_Stop + \value Key_Refresh + \value Key_VolumeDown + \value Key_VolumeMute + \value Key_VolumeUp + \value Key_BassBoost + \value Key_BassUp + \value Key_BassDown + \value Key_TrebleUp + \value Key_TrebleDown + \value Key_MediaPlay A key setting the state of the media player to play + \value Key_MediaStop A key setting the state of the media player to stop + \value Key_MediaPrevious + \omitvalue Key_MediaPrev + \value Key_MediaNext + \value Key_MediaRecord + \value Key_MediaPause A key setting the state of the media player to pause (\note not the pause/break key) + \value Key_MediaTogglePlayPause A key to toggle the play/pause state in the media player (rather than setting an absolute state) + \value Key_HomePage + \value Key_Favorites + \value Key_Search + \value Key_Standby + \value Key_OpenUrl + \value Key_LaunchMail + \value Key_LaunchMedia + \value Key_Launch0 On X11 this key is mapped to "My Computer" (XF86XK_MyComputer) key for legacy reasons. + \value Key_Launch1 On X11 this key is mapped to "Calculator" (XF86XK_Calculator) key for legacy reasons. + \value Key_Launch2 On X11 this key is mapped to XF86XK_Launch0 key for legacy reasons. + \value Key_Launch3 On X11 this key is mapped to XF86XK_Launch1 key for legacy reasons. + \value Key_Launch4 On X11 this key is mapped to XF86XK_Launch2 key for legacy reasons. + \value Key_Launch5 On X11 this key is mapped to XF86XK_Launch3 key for legacy reasons. + \value Key_Launch6 On X11 this key is mapped to XF86XK_Launch4 key for legacy reasons. + \value Key_Launch7 On X11 this key is mapped to XF86XK_Launch5 key for legacy reasons. + \value Key_Launch8 On X11 this key is mapped to XF86XK_Launch6 key for legacy reasons. + \value Key_Launch9 On X11 this key is mapped to XF86XK_Launch7 key for legacy reasons. + \value Key_LaunchA On X11 this key is mapped to XF86XK_Launch8 key for legacy reasons. + \value Key_LaunchB On X11 this key is mapped to XF86XK_Launch9 key for legacy reasons. + \value Key_LaunchC On X11 this key is mapped to XF86XK_LaunchA key for legacy reasons. + \value Key_LaunchD On X11 this key is mapped to XF86XK_LaunchB key for legacy reasons. + \value Key_LaunchE On X11 this key is mapped to XF86XK_LaunchC key for legacy reasons. + \value Key_LaunchF On X11 this key is mapped to XF86XK_LaunchD key for legacy reasons. + \value Key_LaunchG On X11 this key is mapped to XF86XK_LaunchE key for legacy reasons. + \value Key_LaunchH On X11 this key is mapped to XF86XK_LaunchF key for legacy reasons. + \value Key_MonBrightnessUp + \value Key_MonBrightnessDown + \value Key_KeyboardLightOnOff + \value Key_KeyboardBrightnessUp + \value Key_KeyboardBrightnessDown + \value Key_PowerOff + \value Key_WakeUp + \value Key_Eject + \value Key_ScreenSaver + \value Key_WWW + \value Key_Memo + \value Key_LightBulb + \value Key_Shop + \value Key_History + \value Key_AddFavorite + \value Key_HotLinks + \value Key_BrightnessAdjust + \value Key_Finance + \value Key_Community + \value Key_AudioRewind + \value Key_BackForward + \value Key_ApplicationLeft + \value Key_ApplicationRight + \value Key_Book + \value Key_CD + \value Key_Calculator On X11 this key is not mapped for legacy reasons. Use Qt::Key_Launch1 instead. + \value Key_ToDoList + \value Key_ClearGrab + \value Key_Close + \value Key_Copy + \value Key_Cut + \value Key_Display + \value Key_DOS + \value Key_Documents + \value Key_Excel + \value Key_Explorer + \value Key_Game + \value Key_Go + \value Key_iTouch + \value Key_LogOff + \value Key_Market + \value Key_Meeting + \value Key_MenuKB + \value Key_MenuPB + \value Key_MySites + \value Key_News + \value Key_OfficeHome + \value Key_Option + \value Key_Paste + \value Key_Phone + \value Key_Calendar + \value Key_Reply + \value Key_Reload + \value Key_RotateWindows + \value Key_RotationPB + \value Key_RotationKB + \value Key_Save + \value Key_Send + \value Key_Spell + \value Key_SplitScreen + \value Key_Support + \value Key_TaskPane + \value Key_Terminal + \value Key_Tools + \value Key_Travel + \value Key_Video + \value Key_Word + \value Key_Xfer + \value Key_ZoomIn + \value Key_ZoomOut + \value Key_Away + \value Key_Messenger + \value Key_WebCam + \value Key_MailForward + \value Key_Pictures + \value Key_Music + \value Key_Battery + \value Key_Bluetooth + \value Key_WLAN + \value Key_UWB + \value Key_AudioForward + \value Key_AudioRepeat + \value Key_AudioRandomPlay + \value Key_Subtitle + \value Key_AudioCycleTrack + \value Key_Time + \value Key_Hibernate + \value Key_View + \value Key_TopMenu + \value Key_PowerDown + \value Key_Suspend + \value Key_ContrastAdjust + \value Key_MediaLast + \value Key_unknown + + \value Key_Call A key to answer or initiate a call (see Qt::Key_ToggleCallHangup for a key to toggle current call state) + \value Key_Camera A key to activate the camera shutter + \value Key_CameraFocus A key to focus the camera + \value Key_Context1 + \value Key_Context2 + \value Key_Context3 + \value Key_Context4 + \value Key_Flip + \value Key_Hangup A key to end an ongoing call (see Qt::Key_ToggleCallHangup for a key to toggle current call state) + \value Key_No + \value Key_Select + \value Key_Yes + \value Key_ToggleCallHangup A key to toggle the current call state (ie. either answer, or hangup) depending on current call state + \value Key_VoiceDial + \value Key_LastNumberRedial + + \value Key_Execute + \value Key_Printer + \value Key_Play + \value Key_Sleep + \value Key_Zoom + \value Key_Cancel + + \sa QKeyEvent::key() +*/ + +/*! + \enum Qt::HitTestAccuracy + + This enum contains the types of accuracy that can be used by the + QTextDocument class when testing for mouse clicks on text documents. + + \value ExactHit The point at which input occurred must coincide + exactly with input-sensitive parts of the document. + \value FuzzyHit The point at which input occurred can lie close to + input-sensitive parts of the document. + + This enum is defined in the \c header file. +*/ + +/*! + \enum Qt::WhiteSpaceMode + + This enum describes the types of whitespace mode that are used by + the QTextDocument class to meet the requirements of different kinds + of textual information. + + \value WhiteSpaceNormal The whitespace mode used to display + normal word wrapped text in paragraphs. + \value WhiteSpacePre A preformatted text mode in which + whitespace is reproduced exactly. + \value WhiteSpaceNoWrap + + \omitvalue WhiteSpaceModeUndefined + + This enum is defined in the \c header file. +*/ + +/*! + \enum Qt::ButtonState_enum + \compat + \value ShiftButton + \value ControlButton + \value AltButton + \value MetaButton + \value Keypad + \value KeyButtonMask + + Use Qt::KeyboardModifier instead. +*/ + +/*! + \typedef Qt::ButtonState + \compat + + Use Qt::KeyboardModifier instead. +*/ + +/*! + \enum Qt::CheckState + + This enum describes the state of checkable items, controls, and widgets. + + \value Unchecked The item is unchecked. + \value PartiallyChecked The item is partially checked. Items in hierarchical models + may be partially checked if some, but not all, of their + children are checked. + \value Checked The item is checked. + + \sa QCheckBox, Qt::ItemFlags, Qt::ItemDataRole +*/ + + +/*! + \enum Qt::ToolButtonStyle + + The style of the tool button, describing how the button's text and + icon should be displayed. + + \value ToolButtonIconOnly Only display the icon. + \value ToolButtonTextOnly Only display the text. + \value ToolButtonTextBesideIcon The text appears beside the icon. + \value ToolButtonTextUnderIcon The text appears under the icon. + \value ToolButtonFollowStyle Follow the \l{QStyle::SH_ToolButtonStyle}{style}. +*/ + +/*! + \enum Qt::Corner + + This enum type specifies a corner in a rectangle: + + \value TopLeftCorner The top-left corner of the rectangle. + \value TopRightCorner The top-right corner of the rectangle. + \value BottomLeftCorner The bottom-left corner of the rectangle. + \value BottomRightCorner The bottom-right corner of the rectangle. + + \omitvalue TopLeft + \omitvalue TopRight + \omitvalue BottomLeft + \omitvalue BottomRight +*/ + +/*! + \enum Qt::ScrollBarPolicy + + This enum type describes the various modes of QAbstractScrollArea's scroll + bars. + + \value ScrollBarAsNeeded QAbstractScrollArea shows a scroll bar when the + content is too large to fit and not otherwise. This is the + default. + + \value ScrollBarAlwaysOff QAbstractScrollArea never shows a scroll bar. + + \value ScrollBarAlwaysOn QAbstractScrollArea always shows a scroll bar. + + (The modes for the horizontal and vertical scroll bars are + independent.) +*/ + +/*! + \enum Qt::ArrowType + + \value NoArrow + \value UpArrow + \value DownArrow + \value LeftArrow + \value RightArrow +*/ + +/*! + \enum Qt::FocusReason + + This enum specifies why the focus changed. It will be passed + through QWidget::setFocus and can be retrieved in the QFocusEvent + sent to the widget upon focus change. + + \value MouseFocusReason A mouse action occurred. + \value TabFocusReason The Tab key was pressed. + \value BacktabFocusReason A Backtab occurred. The input for this may + include the Shift or Control keys; + e.g. Shift+Tab. + \value ActiveWindowFocusReason The window system made this window either + active or inactive. + \value PopupFocusReason The application opened/closed a pop-up that + grabbed/released the keyboard focus. + \value ShortcutFocusReason The user typed a label's buddy shortcut + \value MenuBarFocusReason The menu bar took focus. + \value OtherFocusReason Another reason, usually application-specific. + + \omitvalue NoFocusReason + + \sa {Keyboard Focus} +*/ + +/*! + \enum Qt::WindowState + + \keyword window state + + This enum type is used to specify the current state of a top-level + window. + + The states are + + \value WindowNoState The window has no state set (in normal state). + \value WindowMinimized The window is minimized (i.e. iconified). + \value WindowMaximized The window is maximized with a frame around it. + \value WindowFullScreen The window fills the entire screen without any frame around it. + \value WindowActive The window is the active window, i.e. it has keyboard focus. + +*/ + +/*! + \enum Qt::ContextMenuPolicy + + This enum type defines the various policies a widget can have with + respect to showing a context menu. + + \value NoContextMenu the widget does not feature a context menu, + context menu handling is deferred to the widget's parent. + \value PreventContextMenu the widget does not feature a context + menu, and in contrast to \c NoContextMenu, the handling is \e not + deferred to the widget's parent. This means that all right mouse + button events are guaranteed to be delivered to the widget itself + through mousePressEvent(), and mouseReleaseEvent(). + \value DefaultContextMenu the widget's QWidget::contextMenuEvent() handler is called. + \value ActionsContextMenu the widget displays its QWidget::actions() as context menu. + \value CustomContextMenu the widget emits the QWidget::customContextMenuRequested() signal. +*/ + +/*! + \enum Qt::FocusPolicy + + This enum type defines the various policies a widget can have with + respect to acquiring keyboard focus. + + \value TabFocus the widget accepts focus by tabbing. + \value ClickFocus the widget accepts focus by clicking. + \value StrongFocus the widget accepts focus by both tabbing + and clicking. On Mac OS X this will also + be indicate that the widget accepts tab focus + when in 'Text/List focus mode'. + \value WheelFocus like Qt::StrongFocus plus the widget accepts + focus by using the mouse wheel. + \value NoFocus the widget does not accept focus. + +*/ + +/*! + \enum Qt::ShortcutContext + + For a QEvent::Shortcut event to occur, the shortcut's key sequence + must be entered by the user in a context where the shortcut is + active. The possible contexts are these: + + \value WidgetShortcut The shortcut is active when its + parent widget has focus. + \value WidgetWithChildrenShortcut The shortcut is active + when its parent widget, or any of its children has focus. + Children which are top-level widgets, except pop-ups, are + not affected by this shortcut context. + \value WindowShortcut The shortcut is active when its + parent widget is a logical subwidget of the + active top-level window. + \value ApplicationShortcut The shortcut is active when one of + the applications windows are active. +*/ + +/*! + \typedef Qt::WFlags + + Synonym for Qt::WindowFlags. +*/ + +/*! + \enum Qt::WindowType + + \keyword window flag + + This enum type is used to specify various window-system properties + for the widget. They are fairly unusual but necessary in a few + cases. Some of these flags depend on whether the underlying window + manager supports them. + + The main types are + + \value Widget This is the default type for QWidget. Widgets of + this type are child widgets if they have a parent, + and independent windows if they have no parent. + See also Qt::Window and Qt::SubWindow. + + \value Window Indicates that the widget is a window, usually + with a window system frame and a title bar, + irrespective of whether the widget has a parent or + not. Note that it is not possible to unset this + flag if the widget does not have a parent. + + \value Dialog Indicates that the widget is a window that should + be decorated as a dialog (i.e., typically no + maximize or minimize buttons in the title bar). + This is the default type for QDialog. If you want + to use it as a modal dialog, it should be launched + from another window, or have a parent and used + with the QWidget::windowModality property. If you make + it modal, the dialog will prevent other top-level + windows in the application from getting any input. + We refer to a top-level window that has a parent + as a \e secondary window. + + \value Sheet Indicates that the window is a Macintosh sheet. Since + using a sheet implies window modality, the recommended + way is to use QWidget::setWindowModality(), or + QDialog::open(), instead. + + \value Drawer Indicates that the widget is a Macintosh drawer. + + \value Popup Indicates that the widget is a pop-up top-level + window, i.e. that it is modal, but has a window + system frame appropriate for pop-up menus. + + \value Tool Indicates that the widget is a tool window. A tool + window is often a small window with a smaller than + usual title bar and decoration, typically used for + collections of tool buttons. If there is a parent, + the tool window will always be kept on top of it. + If there isn't a parent, you may consider using + Qt::WindowStaysOnTopHint as well. If the window + system supports it, a tool window can be decorated + with a somewhat lighter frame. It can also be + combined with Qt::FramelessWindowHint. + \br + \br + On Mac OS X, tool windows correspond to the + \l{http://developer.apple.com/documentation/Carbon/Conceptual/HandlingWindowsControls/hitb-wind_cont_concept/chapter_2_section_2.html}{Floating} + class of windows. This means that the window lives on a + level above normal windows; it impossible to put a normal + window on top of it. By default, tool windows will disappear + when the application is inactive. This can be controlled by + the Qt::WA_MacAlwaysShowToolWindow attribute. + + \value ToolTip Indicates that the widget is a tooltip. This is + used internally to implement + \l{QWidget::toolTip}{tooltips}. + + \value SplashScreen Indicates that the window is a splash screen. + This is the default type for QSplashScreen. + + \value Desktop Indicates that this widget is the desktop. This + is the type for QDesktopWidget. + + \value SubWindow Indicates that this widget is a sub-window, such + as a QMdiSubWindow widget. + + There are also a number of flags which you can use to customize + the appearance of top-level windows. These have no effect on other + windows: + + \value MSWindowsFixedSizeDialogHint Gives the window a thin dialog border on Windows. + This style is traditionally used for fixed-size dialogs. + + \value MSWindowsOwnDC Gives the window its own display + context on Windows. + + \value X11BypassWindowManagerHint Bypass the window + manager completely. This results in a borderless window + that is not managed at all (i.e., no keyboard input unless + you call QWidget::activateWindow() manually). + + \value FramelessWindowHint Produces a borderless window. + The user cannot move or resize a borderless window via the window + system. On X11, the result of the flag is dependent on the window manager and its + ability to understand Motif and/or NETWM hints. Most existing + modern window managers can handle this. + + The \c CustomizeWindowHint flag is used to enable customization of + the window controls. This flag must be set to allow the \c + WindowTitleHint, \c WindowSystemMenuHint, \c + WindowMinimizeButtonHint, \c WindowMaximizeButtonHint and \c + WindowCloseButtonHint flags to be changed. + + \value CustomizeWindowHint Turns off the default window title hints. + + \value WindowTitleHint Gives the window a title bar. + + \value WindowSystemMenuHint Adds a window system menu, and + possibly a close button (for example on Mac). If you need to hide + or show a close button, it is more portable to use \c + WindowCloseButtonHint. + + \value WindowMinimizeButtonHint Adds a minimize button. On + some platforms this implies Qt::WindowSystemMenuHint for it to work. + + \value WindowMaximizeButtonHint Adds a maximize button. On + some platforms this implies Qt::WindowSystemMenuHint for it to work. + + \value WindowMinMaxButtonsHint Adds a minimize and a maximize + button. On some platforms this implies Qt::WindowSystemMenuHint for it to work. + + \value WindowCloseButtonHint Adds a close button. On + some platforms this implies Qt::WindowSystemMenuHint for it + to work. + + \value WindowContextHelpButtonHint Adds a context help button to dialogs. + On some platforms this implies Qt::WindowSystemMenuHint for it to work. + + \value MacWindowToolBarButtonHint On Mac OS X adds a tool bar button (i.e., + the oblong button that is on the top right of windows that have toolbars). + + \value BypassGraphicsProxyWidget Prevents the window and its children from + automatically embedding themselves into a QGraphicsProxyWidget if the + parent widget is already embedded. You can set this flag if you + want your widget to always be a toplevel widget on the desktop, + regardless of whether the parent widget is embedded in a scene or + not. + + \value WindowShadeButtonHint + + \value WindowStaysOnTopHint Informs the window system that the + window should stay on top of all other windows. Note that + on some window managers on X11 you also have to pass + Qt::X11BypassWindowManagerHint for this flag to work + correctly. + + \value WindowStaysOnBottomHint Informs the window system that the + window should stay on bottom of all other windows. Note + that on X11 this hint will work only in window managers + that support _NET_WM_STATE_BELOW atom. If a window always + on the bottom has a parent, the parent will also be left on + the bottom. This window hint is currently not implemented + for Mac OS X. + + \value WindowOkButtonHint Adds an OK button to the window decoration of a dialog. + Only supported for Windows CE. + + \value WindowCancelButtonHint Adds a Cancel button to the window decoration of a dialog. + Only supported for Windows CE. + + \value WindowSoftkeysVisibleHint Makes softkeys visible when widget is fullscreen. + Only supported for Symbian. + + \value WindowSoftkeysRespondHint Makes softkeys to receive key events even + when invisible. With this hint the softkey actions are triggered + even the softkeys are invisible i.e. the window is displayed with + \c showFullscreen(). Only supported for Symbian. + + \value WindowType_Mask A mask for extracting the window type + part of the window flags. + + Obsolete flags: + + \value WMouseNoMask Use Qt::WA_MouseNoMask instead. + \value WDestructiveClose Use Qt::WA_DeleteOnClose instead. + \value WStaticContents Use Qt::WA_StaticContents instead. + \value WGroupLeader No longer needed. + \value WShowModal Use QWidget::windowModality instead. + \value WNoMousePropagation Use Qt::WA_NoMousePropagation instead. + \value WType_TopLevel Use Qt::Window instead. + \value WType_Dialog Use Qt::Dialog instead. + \value WType_Popup Use Qt::Popup instead. + \value WType_Desktop Use Qt::Desktop instead. + \value WType_Mask Use Qt::WindowType_Mask instead. + + \value WStyle_Customize No longer needed. + \value WStyle_NormalBorder No longer needed. + \value WStyle_DialogBorder Use Qt::MSWindowsFixedSizeDialogHint instead. + \value WStyle_NoBorder Use Qt::FramelessWindowHint instead. + \value WStyle_Title Use Qt::WindowTitleHint instead. + \value WStyle_SysMenu Use Qt::WindowSystemMenuHint instead. + \value WStyle_Minimize Use Qt::WindowMinimizeButtonHint instead. + \value WStyle_Maximize Use Qt::WindowMaximizeButtonHint instead. + \value WStyle_MinMax Use Qt::WindowMinMaxButtonsHint instead. + \value WStyle_Tool Use Qt::Tool instead. + \value WStyle_StaysOnTop Use Qt::WindowStaysOnTopHint instead. + \value WStyle_ContextHelp Use Qt::WindowContextHelpButtonHint instead. + + \value WPaintDesktop No longer needed. + \value WPaintClever No longer needed. + + \value WX11BypassWM Use Qt::X11BypassWindowManagerHint instead. + \value WWinOwnDC Use Qt::MSWindowsOwnDC instead. + \value WMacSheet Use Qt::Sheet instead. + \value WMacDrawer Use Qt::Drawer instead. + + \value WStyle_Splash Use Qt::SplashScreen instead. + + \value WNoAutoErase No longer needed. + \value WRepaintNoErase No longer needed. + \value WNorthWestGravity Use Qt::WA_StaticContents instead. + \value WType_Modal Use Qt::Dialog and QWidget::windowModality instead. + \value WStyle_Dialog Use Qt::Dialog instead. + \value WStyle_NoBorderEx Use Qt::FramelessWindowHint instead. + \value WResizeNoErase No longer needed. + \value WMacNoSheet No longer needed. + + \sa QWidget::windowFlags, {Window Flags Example} +*/ + +/*! + \enum Qt::DropAction + + \value CopyAction Copy the data to the target. + \value MoveAction Move the data from the source to the target. + \value LinkAction Create a link from the source to the target. + \value ActionMask + \value IgnoreAction Ignore the action (do nothing with the data). + \value TargetMoveAction On Windows, this value is used when the ownership of the D&D data + should be taken over by the target application, + i.e., the source application should not delete + the data. + \br + On X11 this value is used to do a move. + \br + TargetMoveAction is not used on the Mac. +*/ + +#if defined(Q_OS_WIN) && defined(QT3_SUPPORT) +/*! + \enum Qt::WindowsVersion + \compat + + \value WV_32s + \value WV_95 + \value WV_98 + \value WV_Me + \value WV_DOS_based + \value WV_NT + \value WV_2000 + \value WV_XP + \value WV_2003 + \value WV_NT_based + \value WV_CE + \value WV_CENET + \value WV_CE_based + \value WV_CE_5 + \value WV_CE_6 +*/ +#endif + +#if defined(Q_OS_MAC) && defined(QT3_SUPPORT) +/*! + \enum Qt::MacintoshVersion + \compat + + \value MV_Unknown Use QSysInfo::MV_Unknown instead. + \value MV_9 Use QSysInfo::MV_9 instead. + \value MV_10_DOT_0 Use QSysInfo::MV_10_0 instead. + \value MV_10_DOT_1 Use QSysInfo::MV_10_1 instead. + \value MV_10_DOT_2 Use QSysInfo::MV_10_2 instead. + \value MV_10_DOT_3 Use QSysInfo::MV_10_3 instead. + \value MV_10_DOT_4 Use QSysInfo::MV_10_4 instead. + + \value MV_CHEETAH Use QSysInfo::MV_10_0 instead. + \value MV_PUMA Use QSysInfo::MV_10_1 instead. + \value MV_JAGUAR Use QSysInfo::MV_10_2 instead. + \value MV_PANTHER Use QSysInfo::MV_10_3 instead. + \value MV_TIGER Use QSysInfo::MV_10_4 instead. + + \sa QSysInfo::MacVersion +*/ +#endif + +/*! \typedef Qt::ToolBarDock + \compat + + Use Qt::Dock instead. +*/ + +/*! + \enum Qt::Dock + \compat + + Each dock window can be in one of the following positions: + + \value DockUnmanaged not managed by a Q3MainWindow. + + \value DockTornOff the dock window floats as its own top level + window which always stays on top of the main window. + + \value DockTop above the central widget, below the menu bar. + + \value DockBottom below the central widget, above the status bar. + + \value DockRight to the right of the central widget. + + \value DockLeft to the left of the central widget. + + \value DockMinimized the dock window is not shown (this is + effectively a 'hidden' dock area); the handles of all minimized + dock windows are drawn in one row below the menu bar. + + \omitvalue Bottom + \omitvalue Left + \omitvalue Minimized + \omitvalue Right + \omitvalue Top + \omitvalue TornOff + \omitvalue Unmanaged +*/ + +/*! + \enum Qt::AnchorAttribute + + An anchor has one or more of the following attributes: + + \value AnchorName the name attribute of the anchor. This attribute is + used when scrolling to an anchor in the document. + + \value AnchorHref the href attribute of the anchor. This attribute is + used when a link is clicked to determine what content to load. +*/ + +/*! + \enum Qt::SortOrder + + This enum describes how the items in a widget are sorted. + + \value AscendingOrder The items are sorted ascending e.g. starts with + 'AAA' ends with 'ZZZ' in Latin-1 locales + + \value DescendingOrder The items are sorted descending e.g. starts with + 'ZZZ' ends with 'AAA' in Latin-1 locales + + \omitvalue Ascending + \omitvalue Descending +*/ + +/*! + \enum Qt::ClipOperation + + \value NoClip This operation turns clipping off. + + \value ReplaceClip Replaces the current clip path/rect/region with + the one supplied in the function call. + + \value IntersectClip Intersects the current clip path/rect/region + with the one supplied in the function call. + + \value UniteClip Unites the current clip path/rect/region with the + one supplied in the function call. +*/ + +/*! + \enum Qt::ItemSelectionMode + + This enum is used in QGraphicsItem, QGraphicsScene and QGraphicsView to + specify how items are selected, or how to determine if a shapes and items + collide. + + \value ContainsItemShape The output list contains only items whose + \l{QGraphicsItem::shape()}{shape} is fully contained inside the + selection area. Items that intersect with the area's outline are + not included. + + \value IntersectsItemShape The output list contains both items whose + \l{QGraphicsItem::shape()}{shape} is fully contained inside the + selection area, and items that intersect with the area's + outline. This is a common mode for rubber band selection. + + \value ContainsItemBoundingRect The output list contains only items whose + \l{QGraphicsItem::boundingRect()}{bounding rectangle} is fully + contained inside the selection area. Items that intersect with the + area's outline are not included. + + \value IntersectsItemBoundingRect The output list contains both items + whose \l{QGraphicsItem::boundingRect()}{bounding rectangle} is + fully contained inside the selection area, and items that intersect + with the area's outline. This method is commonly used for + determining areas that need redrawing. + + \sa QGraphicsScene::items(), QGraphicsScene::collidingItems(), + QGraphicsView::items(), QGraphicsItem::collidesWithItem(), + QGraphicsItem::collidesWithPath() +*/ + +/*! + \enum Qt::FillRule + + Specifies which method should be used to fill the paths and polygons. + + \value OddEvenFill Specifies that the region is filled using the + odd even fill rule. With this rule, we determine whether a point + is inside the shape by using the following method. + Draw a horizontal line from the point to a location outside the shape, + and count the number of intersections. If the number of intersections + is an odd number, the point is inside the shape. This mode is the + default. + + \value WindingFill Specifies that the region is filled using the + non zero winding rule. With this rule, we determine whether a + point is inside the shape by using the following method. + Draw a horizontal line from the point to a location outside the shape. + Determine whether the direction of the line at each intersection point + is up or down. The winding number is determined by summing the + direction of each intersection. If the number is non zero, the point + is inside the shape. This fill mode can also in most cases be considered + as the intersection of closed shapes. +*/ + +/*! + \enum Qt::PaintUnit + + \compat + + \value PixelUnit + \value LoMetricUnit Obsolete + \value HiMetricUnit Obsolete + \value LoEnglishUnit Obsolete + \value HiEnglishUnit Obsolete + \value TwipsUnit Obsolete +*/ + +/*! + \enum Qt::TextFormat + + This enum is used in widgets that can display both plain text and + rich text, e.g. QLabel. It is used for deciding whether a text + string should be interpreted as one or the other. This is normally + done by passing one of the enum values to a setTextFormat() + function. + + \value PlainText The text string is interpreted as a plain text + string. + + \value RichText The text string is interpreted as a rich text + string. + + \value AutoText The text string is interpreted as for + Qt::RichText if Qt::mightBeRichText() returns true, otherwise + as Qt::PlainText. + + \value LogText A special, limited text format which is only used + by Q3TextEdit in an optimized mode. +*/ + +/*! + \enum Qt::CursorShape + + This enum type defines the various cursors that can be used. + + The standard arrow cursor is the default for widgets in a normal state. + + \value ArrowCursor \inlineimage cursor-arrow.png + The standard arrow cursor. + \value UpArrowCursor \inlineimage cursor-uparrow.png + An arrow pointing upwards toward the top of the screen. + \value CrossCursor \inlineimage cursor-cross.png + A crosshair cursor, typically used to help the + user accurately select a point on the screen. + \value WaitCursor \inlineimage cursor-wait.png + An hourglass or watch cursor, usually shown during + operations that prevent the user from interacting with + the application. + \value IBeamCursor \inlineimage cursor-ibeam.png + A caret or ibeam cursor, indicating that a widget can + accept and display text input. + \value SizeVerCursor \inlineimage cursor-sizev.png + A cursor used for elements that are used to vertically + resize top-level windows. + \value SizeHorCursor \inlineimage cursor-sizeh.png + A cursor used for elements that are used to horizontally + resize top-level windows. + \value SizeBDiagCursor \inlineimage cursor-sizeb.png + A cursor used for elements that are used to diagonally + resize top-level windows at their top-right and + bottom-left corners. + \value SizeFDiagCursor \inlineimage cursor-sizef.png + A cursor used for elements that are used to diagonally + resize top-level windows at their top-left and + bottom-right corners. + \value SizeAllCursor \inlineimage cursor-sizeall.png + A cursor used for elements that are used to resize + top-level windows in any direction. + \value BlankCursor A blank/invisible cursor, typically used when the cursor + shape needs to be hidden. + \value SplitVCursor \inlineimage cursor-vsplit.png + A cursor used for vertical splitters, indicating that + a handle can be dragged horizontally to adjust the use + of available space. + \value SplitHCursor \inlineimage cursor-hsplit.png + A cursor used for horizontal splitters, indicating that + a handle can be dragged vertically to adjust the use + of available space. + \value PointingHandCursor \inlineimage cursor-hand.png + A pointing hand cursor that is typically used for + clickable elements such as hyperlinks. + \value ForbiddenCursor \inlineimage cursor-forbidden.png + A slashed circle cursor, typically used during drag + and drop operations to indicate that dragged content + cannot be dropped on particular widgets or inside + certain regions. + \value OpenHandCursor \inlineimage cursor-openhand.png + A cursor representing an open hand, typically used to + indicate that the area under the cursor is the visible + part of a canvas that the user can click and drag in + order to scroll around. + \value ClosedHandCursor \inlineimage cursor-closedhand.png + A cursor representing a closed hand, typically used to + indicate that a dragging operation is in progress that + involves scrolling. + \value WhatsThisCursor \inlineimage cursor-whatsthis.png + An arrow with a question mark, typically used to indicate + the presence of What's This? help for a widget. + \value BusyCursor \inlineimage cursor-wait.png + An hourglass or watch cursor, usually shown during + operations that allow the user to interact with + the application while they are performed in the + background. + \value DragMoveCursor + A cursor that is usually used when dragging an item. + \value DragCopyCursor + A cursor that is usually used when dragging an item + to copy it. + \value DragLinkCursor + A cursor that is usually used when dragging an item + to make a link to it. + + \value BitmapCursor + \omitvalue LastCursor + \omitvalue CustomCursor + + \omitvalue arrowCursor + \omitvalue upArrowCursor + \omitvalue crossCursor + \omitvalue waitCursor + \omitvalue ibeamCursor + \omitvalue sizeVerCursor + \omitvalue sizeHorCursor + \omitvalue sizeBDiagCursor + \omitvalue sizeFDiagCursor + \omitvalue sizeAllCursor + \omitvalue blankCursor + \omitvalue splitVCursor + \omitvalue splitHCursor + \omitvalue pointingHandCursor + \omitvalue forbiddenCursor + \omitvalue whatsThisCursor +*/ + +/*! + \typedef Qt::TextFlags + \compat + + Use Qt::TextFlag instead. +*/ + +/*! + \enum Qt::LayoutDirection + + Specifies the direction of Qt's layouts and text handling. + + \value LeftToRight Left-to-right layout. + \value RightToLeft Right-to-left layout. + \value LayoutDirectionAuto Automatic layout. + + Right-to-left layouts are necessary for certain languages, + notably Arabic and Hebrew. + + LayoutDirectionAuto serves two purposes. When used in conjunction with widgets and layouts, it + will imply to use the layout direction set on the parent widget or QApplication. This + has the same effect as QWidget::unsetLayoutDirection(). + + When LayoutDirectoinAuto is used in conjunction with text layouting, it will imply that the text + directionality is determined from the content of the string to be layouted. + + \sa QApplication::setLayoutDirection(), QWidget::setLayoutDirection(), QTextOption::setTextDirection(), QString::isRightToLeft() +*/ + +/*! + \enum Qt::AnchorPoint + + Specifies a side of a layout item that can be anchored. This is used by + QGraphicsAnchorLayout. + + \value AnchorLeft The left side of a layout item. + \value AnchorHorizontalCenter A "virtual" side that is centered between the left and the + right side of a layout item. + \value AnchorRight The right side of a layout item. + \value AnchorTop The top side of a layout item. + \value AnchorVerticalCenter A "virtual" side that is centered between the top and the + bottom side of a layout item. + \value AnchorBottom The bottom side of a layout item. + + \sa QGraphicsAnchorLayout +*/ + +/*! + \enum Qt::InputMethodHint + + \value ImhNone No hints. + + Flags that alter the behavior: + + \value ImhHiddenText Characters should be hidden, as is typically used when entering passwords. + This is automatically set when setting QLineEdit::echoMode to \c Password. + \value ImhNoAutoUppercase The input method should not try to automatically switch to upper case + when a sentence ends. + \value ImhPreferNumbers Numbers are preferred (but not required). + \value ImhPreferUppercase Upper case letters are preferred (but not required). + \value ImhPreferLowercase Lower case letters are preferred (but not required). + \value ImhNoPredictiveText Do not use predictive text (i.e. dictionary lookup) while typing. + + Flags that restrict input (exclusive flags): + + \value ImhDigitsOnly Only digits are allowed. + \value ImhFormattedNumbersOnly Only number input is allowed. This includes decimal point and minus sign. + \value ImhUppercaseOnly Only upper case letter input is allowed. + \value ImhLowercaseOnly Only lower case letter input is allowed. + \value ImhDialableCharactersOnly Only characters suitable for phone dialling are allowed. + \value ImhEmailCharactersOnly Only characters suitable for email addresses are allowed. + \value ImhUrlCharactersOnly Only characters suitable for URLs are allowed. + + Masks: + + \value ImhExclusiveInputMask This mask yields nonzero if any of the exclusive flags are used. + + \note If several exclusive flags 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. + + \sa QGraphicsItem::inputMethodHints() +*/ + +/*! + \enum Qt::InputMethodQuery + + \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 \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. +*/ + +/*! + \enum Qt::ItemDataRole + + Each item in the model has a set of data elements associated with + it, each with its own role. The roles are used by the view to indicate + to the model which type of data it needs. Custom models should return + data in these types. + + The general purpose roles (and the associated types) are: + + \value DisplayRole The key data to be rendered in the form of text. (QString) + \value DecorationRole The data to be rendered as a decoration in the form + of an icon. (QColor, QIcon or QPixmap) + \value EditRole The data in a form suitable for editing in an + editor. (QString) + \value ToolTipRole The data displayed in the item's tooltip. (QString) + \value StatusTipRole The data displayed in the status bar. (QString) + \value WhatsThisRole The data displayed for the item in "What's This?" + mode. (QString) + \value SizeHintRole The size hint for the item that will be supplied + to views. (QSize) + + Roles describing appearance and meta data (with associated types): + + \value FontRole The font used for items rendered with the default + delegate. (QFont) + \value TextAlignmentRole The alignment of the text for items rendered with the + default delegate. (Qt::AlignmentFlag) + \value BackgroundRole The background brush used for items rendered with + the default delegate. (QBrush) + \value BackgroundColorRole This role is obsolete. Use BackgroundRole instead. + \value ForegroundRole The foreground brush (text color, typically) + used for items rendered with the default delegate. + (QBrush) + \value TextColorRole This role is obsolete. Use ForegroundRole instead. + \value CheckStateRole This role is used to obtain the checked state of + an item. (Qt::CheckState) + \value InitialSortOrderRole This role is used to obtain the initial sort order + of a header view section. (Qt::SortOrder). This + role was introduced in Qt 4.8. + + Accessibility roles (with associated types): + + \value AccessibleTextRole The text to be used by accessibility + extensions and plugins, such as screen + readers. (QString) + \value AccessibleDescriptionRole A description of the item for accessibility + purposes. (QString) + + User roles: + + \value UserRole The first role that can be used for application-specific purposes. + + \omitvalue DisplayPropertyRole + \omitvalue DecorationPropertyRole + \omitvalue ToolTipPropertyRole + \omitvalue StatusTipPropertyRole + \omitvalue WhatsThisPropertyRole + + For user roles, it is up to the developer to decide which types to use and ensure that + components use the correct types when accessing and setting data. +*/ + +/*! + \enum Qt::ItemFlag + + This enum describes the properties of an item: + + \value NoItemFlags It does not have any properties set. + \value ItemIsSelectable It can be selected. + \value ItemIsEditable It can be edited. + \value ItemIsDragEnabled It can be dragged. + \value ItemIsDropEnabled It can be used as a drop target. + \value ItemIsUserCheckable It can be checked or unchecked by the user. + \value ItemIsEnabled The user can interact with the item. + \value ItemIsTristate The item is checkable with three separate states. + + Note that checkable items need to be given both a suitable set of flags + and an initial state, indicating whether the item is checked or not. + This is handled automatically for model/view components, but needs + to be explicitly set for instances of QListWidgetItem, QTableWidgetItem, + and QTreeWidgetItem. + + \sa QAbstractItemModel +*/ + +/*! + \enum Qt::MatchFlag + + This enum describes the type of matches that can be used when searching + for items in a model. + + \value MatchExactly Performs QVariant-based matching. + \value MatchFixedString Performs string-based matching. + String-based comparisons are case-insensitive unless the + \c MatchCaseSensitive flag is also specified. + \value MatchContains The search term is contained in the item. + \value MatchStartsWith The search term matches the start of the item. + \value MatchEndsWith The search term matches the end of the item. + \value MatchCaseSensitive The search is case sensitive. + \value MatchRegExp Performs string-based matching using a regular + expression as the search term. + \value MatchWildcard Performs string-based matching using a string with + wildcards as the search term. + \value MatchWrap Perform a search that wraps around, so that when + the search reaches the last item in the model, it begins again at + the first item and continues until all items have been examined. + \value MatchRecursive Searches the entire hierarchy. + + \sa QString::compare(), QRegExp +*/ + +/*! + \enum Qt::TextElideMode + + This enum specifies where the ellipsis should appear when + displaying texts that don't fit: + + \value ElideLeft The ellipsis should appear at the beginning of the text. + \value ElideRight The ellipsis should appear at the end of the text. + \value ElideMiddle The ellipsis should appear in the middle of the text. + \value ElideNone Ellipsis should NOT appear in the text. + + Qt::ElideMiddle is normally the most appropriate choice for URLs (e.g., + "\l{http://bugreports.qt.nokia.com/browse/QTWEBSITE-13}{http://bugreports.qt.../QTWEBSITE-13/}"), + whereas Qt::ElideRight is appropriate + for other strings (e.g., + "\l{http://qt.nokia.com/doc/qq/qq09-mac-deployment.html}{Deploying Applications on Ma...}"). + + \sa QAbstractItemView::textElideMode, QFontMetrics::elidedText(), AlignmentFlag QTabBar::elideMode +*/ + +/*! + \enum Qt::WindowModality + + \keyword modal + + This enum specifies the behavior of a modal window. A modal window + is one that blocks input to other windows. Note that windows that + are children of a modal window are not blocked. + + The values are: + \value NonModal The window is not modal and does not block input to other windows. + \value WindowModal The window is modal to a single window hierarchy and blocks input to its parent window, all grandparent windows, and all siblings of its parent and grandparent windows. + \value ApplicationModal The window is modal to the application and blocks input to all windows. + + \sa QWidget::windowModality, QDialog +*/ + +/*! + \enum Qt::TextInteractionFlag + + This enum specifies how a text displaying widget reacts to user input. + + \value NoTextInteraction No interaction with the text is possible. + \value TextSelectableByMouse Text can be selected with the mouse and copied to the clipboard using + a context menu or standard keyboard shortcuts. + \value TextSelectableByKeyboard Text can be selected with the cursor keys on the keyboard. A text cursor is shown. + \value LinksAccessibleByMouse Links can be highlighted and activated with the mouse. + \value LinksAccessibleByKeyboard Links can be focused using tab and activated with enter. + \value TextEditable The text is fully editable. + + \value TextEditorInteraction The default for a text editor. + \value TextBrowserInteraction The default for QTextBrowser. +*/ + +/*! + \enum Qt::MaskMode + + This enum specifies the behavior of the + QPixmap::createMaskFromColor() and QImage::createMaskFromColor() + functions. + + \value MaskInColor Creates a mask where all pixels matching the given color are opaque. + \value MaskOutColor Creates a mask where all pixels matching the given color are transparent. +*/ + +/*! + \enum Qt::DockWidgetAreaSizes + \internal +*/ + +/*! + \enum Qt::ToolBarAreaSizes + \internal +*/ + +/*! + \enum Qt::EventPriority + + This enum can be used to specify event priorities. + + \value HighEventPriority Events with this priority are sent before + events with NormalEventPriority or LowEventPriority. + + \value NormalEventPriority Events with this priority are sent + after events with HighEventPriority, but before events with + LowEventPriority. + + \value LowEventPriority Events with this priority are sent after + events with HighEventPriority or NormalEventPriority. + + Note that these values are provided purely for convenience, since + event priorities can be any value between \c INT_MAX and \c + INT_MIN, inclusive. For example, you can define custom priorities + as being relative to each other: + + \snippet doc/src/snippets/code/doc_src_qnamespace.cpp 1 + + \sa QCoreApplication::postEvent() +*/ +/*! + \enum Qt::SizeHint + \since 4.4 + + This enum is used by QGraphicsLayoutItem::sizeHint() + + \value MinimumSize is used to specify the minimum size of a graphics layout item. + \value PreferredSize is used to specify the preferred size of a graphics layout item. + \value MaximumSize is used to specify the maximum size of a graphics layout item. + \value MinimumDescent is used to specify the minimum descent of a text string in a graphics layout item. + \omitvalue NSizeHints + + \sa QGraphicsLayoutItem::sizeHint() +*/ + +/*! + \enum Qt::SizeMode + \since 4.4 + + This enum is used by QPainter::drawRoundedRect() and QPainterPath::addRoundedRect() + functions to specify the radii of rectangle corners with respect to the dimensions + of the bounding rectangles specified. + + \value AbsoluteSize Specifies the size using absolute measurements. + \value RelativeSize Specifies the size relative to the bounding rectangle, + typically using percentage measurements. +*/ + +/*! + \enum Qt::WindowFrameSection + \since 4.4 + + This enum is used to describe parts of a window frame. It is returned by + QGraphicsWidget::windowFrameSectionAt() to describe what section of the window + frame is under the mouse. + + \value NoSection + \value LeftSection + \value TopLeftSection + \value TopSection + \value TopRightSection + \value RightSection + \value BottomRightSection + \value BottomSection + \value BottomLeftSection + \value TitleBarArea + + \sa QGraphicsWidget::windowFrameEvent() + \sa QGraphicsWidget::paintWindowFrame() + \sa QGraphicsWidget::windowFrameSectionAt() + +*/ + +/*! + \enum Qt::TileRule + \since 4.6 + + This enum describes how to repeat or stretch the parts of an image + when drawing. + + \value StretchTile Scale the image to fit to the available area. + + \value RepeatTile Repeat the image until there is no more space. May + crop the last image. + + \value RoundTile Similar to Repeat, but scales the image down to + ensure that the last tile is not cropped. +*/ + +/*! + \enum Qt::Initialization + \internal +*/ + +/*! + \enum Qt::CoordinateSystem + \since 4.6 + + This enum specifies the coordinate system. + + \value DeviceCoordinates Coordinates are relative to the upper-left corner + of the object's paint device. + + \value LogicalCoordinates Coordinates are relative to the upper-left corner + of the object. +*/ + +/*! + \enum Qt::GestureState + \since 4.6 + + This enum type describes the state of a gesture. + + \value GestureStarted A continuous gesture has started. + \value GestureUpdated A gesture continues. + \value GestureFinished A gesture has finished. + \value GestureCanceled A gesture was canceled. + \omitvalue NoGesture + + \sa QGesture +*/ + +/*! + \enum Qt::GestureType + \since 4.6 + + This enum type describes the standard gestures. + + \value TapGesture A Tap gesture. + \value TapAndHoldGesture A Tap-And-Hold (Long-Tap) gesture. + \value PanGesture A Pan gesture. + \value PinchGesture A Pinch gesture. + \value SwipeGesture A Swipe gesture. + \value CustomGesture A flag that can be used to test if the gesture is a + user-defined gesture ID. + \omitvalue LastGestureType + + User-defined gestures are registered with the + QGestureRecognizer::registerRecognizer() function which generates a custom + gesture ID with the Qt::CustomGesture flag set. + + \sa QGesture, QWidget::grabGesture(), QGraphicsObject::grabGesture() +*/ + +/*! + \enum Qt::GestureFlag + \since 4.6 + + This enum type describes additional flags that can be used when subscribing + to a gesture. + + \value DontStartGestureOnChildren By default gestures can start on the + widget or over any of its children. Use this flag to disable this and allow + a gesture to start on the widget only. + + \value ReceivePartialGestures Allows any ignored gesture events to be + propagated to parent widgets which have specified this hint. By default + only gestures that are in the Qt::GestureStarted state are propagated and + the widget always gets the full gesture sequence starting with a gesture in + the Qt::GestureStarted state and ending with a gesture in the + Qt::GestureFinished or Qt::GestureCanceled states. + + \value IgnoredGesturesPropagateToParent Since Qt 4.7, this flag allows you + to fine-tune gesture event propagation. By setting the flag when + \l{QGraphicsObject::grabGesture()}{grabbing} a gesture all ignored partial + gestures will propagate to their parent items. + + \sa QWidget::grabGesture(), QGraphicsObject::grabGesture() +*/ + +/*! + \enum Qt::NavigationMode + \since 4.6 + + This enum type describes the mode for moving focus. + + \value NavigationModeNone Only the touch screen is used. + \value NavigationModeKeypadTabOrder Qt::Key_Up and Qt::Key_Down are used to change focus. + \value NavigationModeKeypadDirectional Qt::Key_Up, Qt::Key_Down, Qt::Key_Left and Qt::Key_Right are used to change focus. + \value NavigationModeCursorAuto The mouse cursor is used to change focus, + it is displayed only on non touchscreen devices. + The keypad is used to implement a virtual cursor, unless + the device has an analog mouse type of input device (e.g. touchpad). + This is the recommended setting for an application such as a web browser that + needs pointer control on both touch and non-touch devices. + \value NavigationModeCursorForceVisible The mouse cursor is used to change focus, + it is displayed regardless of device type. + The keypad is used to implement a virtual cursor, unless + the device has an analog mouse type of input device (e.g. touchpad) + + \note: in 4.6, cursor navigation is only implemented for Symbian OS. + On other platforms, it behaves as NavigationModeNone. + \sa QApplication::setNavigationMode() + \sa QApplication::navigationMode() +*/ diff --git a/src/corelib/global/qnumeric.cpp b/src/corelib/global/qnumeric.cpp new file mode 100644 index 0000000000..b602158d4f --- /dev/null +++ b/src/corelib/global/qnumeric.cpp @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qnumeric.h" +#include "qnumeric_p.h" + +QT_BEGIN_NAMESPACE + +/*! + Returns true if the double \a {d} is equivalent to infinity. +*/ +Q_CORE_EXPORT bool qIsInf(double d) { return qt_is_inf(d); } + +/*! + Returns true if the double \a {d} is not a number (NaN). +*/ +Q_CORE_EXPORT bool qIsNaN(double d) { return qt_is_nan(d); } + +/*! + Returns true if the double \a {d} is a finite number. +*/ +Q_CORE_EXPORT bool qIsFinite(double d) { return qt_is_finite(d); } + +/*! + Returns true if the float \a {f} is equivalent to infinity. +*/ +Q_CORE_EXPORT bool qIsInf(float f) { return qt_is_inf(f); } + +/*! + Returns true if the float \a {f} is not a number (NaN). +*/ +Q_CORE_EXPORT bool qIsNaN(float f) { return qt_is_nan(f); } + +/*! + Returns true if the float \a {f} is a finite number. +*/ +Q_CORE_EXPORT bool qIsFinite(float f) { return qt_is_finite(f); } + +/*! + Returns the bit pattern of a signalling NaN as a double. +*/ +Q_CORE_EXPORT double qSNaN() { return qt_snan(); } + +/*! + Returns the bit pattern of a quiet NaN as a double. +*/ +Q_CORE_EXPORT double qQNaN() { return qt_qnan(); } + +/*! + Returns the bit pattern for an infinite number as a double. +*/ +Q_CORE_EXPORT double qInf() { return qt_inf(); } + + +QT_END_NAMESPACE diff --git a/src/corelib/global/qnumeric.h b/src/corelib/global/qnumeric.h new file mode 100644 index 0000000000..281fc0107a --- /dev/null +++ b/src/corelib/global/qnumeric.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNUMERIC_H +#define QNUMERIC_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +Q_CORE_EXPORT bool qIsInf(double d); +Q_CORE_EXPORT bool qIsNaN(double d); +Q_CORE_EXPORT bool qIsFinite(double d); +Q_CORE_EXPORT bool qIsInf(float f); +Q_CORE_EXPORT bool qIsNaN(float f); +Q_CORE_EXPORT bool qIsFinite(float f); +Q_CORE_EXPORT double qSNaN(); +Q_CORE_EXPORT double qQNaN(); +Q_CORE_EXPORT double qInf(); + +#define Q_INFINITY (QT_PREPEND_NAMESPACE(qInf)()) +#define Q_SNAN (QT_PREPEND_NAMESPACE(qSNaN)()) +#define Q_QNAN (QT_PREPEND_NAMESPACE(qQNaN)()) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QNUMERIC_H diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h new file mode 100644 index 0000000000..d4aa6587f3 --- /dev/null +++ b/src/corelib/global/qnumeric_p.h @@ -0,0 +1,243 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNUMERIC_P_H +#define QNUMERIC_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/qglobal.h" + +QT_BEGIN_NAMESPACE + +#if !defined(Q_CC_MIPS) + +static const union { unsigned char c[8]; double d; } qt_be_inf_bytes = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } }; +static const union { unsigned char c[8]; double d; } qt_le_inf_bytes = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } }; +static const union { unsigned char c[8]; double d; } qt_armfpa_inf_bytes = { { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 } }; +static inline double qt_inf() +{ +#ifdef QT_ARMFPA + return qt_armfpa_inf_bytes.d; +#else + return (QSysInfo::ByteOrder == QSysInfo::BigEndian + ? qt_be_inf_bytes.d + : qt_le_inf_bytes.d); +#endif +} + +// Signaling NAN +static const union { unsigned char c[8]; double d; } qt_be_snan_bytes = { { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 } }; +static const union { unsigned char c[8]; double d; } qt_le_snan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f } }; +static const union { unsigned char c[8]; double d; } qt_armfpa_snan_bytes = { { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 } }; +static inline double qt_snan() +{ +#ifdef QT_ARMFPA + return qt_armfpa_snan_bytes.d; +#else + return (QSysInfo::ByteOrder == QSysInfo::BigEndian + ? qt_be_snan_bytes.d + : qt_le_snan_bytes.d); +#endif +} + +// Quiet NAN +static const union { unsigned char c[8]; double d; } qt_be_qnan_bytes = { { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 } }; +static const union { unsigned char c[8]; double d; } qt_le_qnan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0xff } }; +static const union { unsigned char c[8]; double d; } qt_armfpa_qnan_bytes = { { 0, 0, 0xf8, 0xff, 0, 0, 0, 0 } }; +static inline double qt_qnan() +{ +#ifdef QT_ARMFPA + return qt_armfpa_qnan_bytes.d; +#else + return (QSysInfo::ByteOrder == QSysInfo::BigEndian + ? qt_be_qnan_bytes.d + : qt_le_qnan_bytes.d); +#endif +} + +#else // Q_CC_MIPS + +static const unsigned char qt_be_inf_bytes[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }; +static const unsigned char qt_le_inf_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }; +static const unsigned char qt_armfpa_inf_bytes[] = { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 }; +static inline double qt_inf() +{ + const unsigned char *bytes; +#ifdef QT_ARMFPA + bytes = qt_armfpa_inf_bytes; +#else + bytes = (QSysInfo::ByteOrder == QSysInfo::BigEndian + ? qt_be_inf_bytes + : qt_le_inf_bytes); +#endif + + union { unsigned char c[8]; double d; } returnValue; + qMemCopy(returnValue.c, bytes, sizeof(returnValue.c)); + return returnValue.d; +} + +// Signaling NAN +static const unsigned char qt_be_snan_bytes[] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 }; +static const unsigned char qt_le_snan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }; +static const unsigned char qt_armfpa_snan_bytes[] = { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 }; +static inline double qt_snan() +{ + const unsigned char *bytes; +#ifdef QT_ARMFPA + bytes = qt_armfpa_snan_bytes; +#else + bytes = (QSysInfo::ByteOrder == QSysInfo::BigEndian + ? qt_be_snan_bytes + : qt_le_snan_bytes); +#endif + + union { unsigned char c[8]; double d; } returnValue; + qMemCopy(returnValue.c, bytes, sizeof(returnValue.c)); + return returnValue.d; +} + +// Quiet NAN +static const unsigned char qt_be_qnan_bytes[] = { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 }; +static const unsigned char qt_le_qnan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0xff }; +static const unsigned char qt_armfpa_qnan_bytes[] = { 0, 0, 0xf8, 0xff, 0, 0, 0, 0 }; +static inline double qt_qnan() +{ + const unsigned char *bytes; +#ifdef QT_ARMFPA + bytes = qt_armfpa_qnan_bytes; +#else + bytes = (QSysInfo::ByteOrder == QSysInfo::BigEndian + ? qt_be_qnan_bytes + : qt_le_qnan_bytes); +#endif + + union { unsigned char c[8]; double d; } returnValue; + qMemCopy(returnValue.c, bytes, sizeof(returnValue.c)); + return returnValue.d; +} + +#endif // Q_CC_MIPS + +static inline bool qt_is_inf(double d) +{ + uchar *ch = (uchar *)&d; +#ifdef QT_ARMFPA + return (ch[3] & 0x7f) == 0x7f && ch[2] == 0xf0; +#else + if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { + return (ch[0] & 0x7f) == 0x7f && ch[1] == 0xf0; + } else { + return (ch[7] & 0x7f) == 0x7f && ch[6] == 0xf0; + } +#endif +} + +static inline bool qt_is_nan(double d) +{ + uchar *ch = (uchar *)&d; +#ifdef QT_ARMFPA + return (ch[3] & 0x7f) == 0x7f && ch[2] > 0xf0; +#else + if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { + return (ch[0] & 0x7f) == 0x7f && ch[1] > 0xf0; + } else { + return (ch[7] & 0x7f) == 0x7f && ch[6] > 0xf0; + } +#endif +} + +static inline bool qt_is_finite(double d) +{ + uchar *ch = (uchar *)&d; +#ifdef QT_ARMFPA + return (ch[3] & 0x7f) != 0x7f || (ch[2] & 0xf0) != 0xf0; +#else + if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { + return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0xf0) != 0xf0; + } else { + return (ch[7] & 0x7f) != 0x7f || (ch[6] & 0xf0) != 0xf0; + } +#endif +} + +static inline bool qt_is_inf(float d) +{ + uchar *ch = (uchar *)&d; + if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { + return (ch[0] & 0x7f) == 0x7f && ch[1] == 0x80; + } else { + return (ch[3] & 0x7f) == 0x7f && ch[2] == 0x80; + } +} + +static inline bool qt_is_nan(float d) +{ + uchar *ch = (uchar *)&d; + if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { + return (ch[0] & 0x7f) == 0x7f && ch[1] > 0x80; + } else { + return (ch[3] & 0x7f) == 0x7f && ch[2] > 0x80; + } +} + +static inline bool qt_is_finite(float d) +{ + uchar *ch = (uchar *)&d; + if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { + return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0x80) != 0x80; + } else { + return (ch[3] & 0x7f) != 0x7f || (ch[2] & 0x80) != 0x80; + } +} + +QT_END_NAMESPACE + +#endif // QNUMERIC_P_H diff --git a/src/corelib/global/qt_pch.h b/src/corelib/global/qt_pch.h new file mode 100644 index 0000000000..8a1004d1cb --- /dev/null +++ b/src/corelib/global/qt_pch.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + * This is a precompiled header file for use in Xcode / Mac GCC / + * GCC >= 3.4 / VC to greatly speed the building of Qt. It may also be + * of use to people developing their own project, but it is probably + * better to define your own header. Use of this header is currently + * UNSUPPORTED. + */ + + +#if defined __cplusplus +#include +#ifdef Q_WS_WIN +# define _POSIX_ +# include +# undef _POSIX_ +#endif +#include +#include +#include /* All moc genereated code has this include */ +#include +#include +#include +#include +#include +#include +#endif diff --git a/src/corelib/global/qt_windows.h b/src/corelib/global/qt_windows.h new file mode 100644 index 0000000000..ee6a272ed7 --- /dev/null +++ b/src/corelib/global/qt_windows.h @@ -0,0 +1,151 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the 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 Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT_WINDOWS_H +#define QT_WINDOWS_H + +#if defined(Q_CC_BOR) +// Borland's windows.h does not set these correctly, resulting in +// unusable WinSDK standard dialogs +#ifndef WINVER +#define WINVER 0x400 +#endif +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x400 +#endif +#endif + +#if defined(Q_CC_MINGW) +// mingw's windows.h does not set _WIN32_WINNT, resulting breaking compilation +#ifndef WINVER +#define WINVER 0x500 +#endif +#endif + +#include + +#ifdef _WIN32_WCE +#include +#endif + +// already defined when compiled with WINVER >= 0x0500 +#ifndef SPI_SETMENUANIMATION +#define SPI_SETMENUANIMATION 0x1003 +#endif +#ifndef SPI_SETMENUFADE +#define SPI_SETMENUFADE 0x1013 +#endif +#ifndef SPI_SETCOMBOBOXANIMATION +#define SPI_SETCOMBOBOXANIMATION 0x1005 +#endif +#ifndef SPI_SETTOOLTIPANIMATION +#define SPI_SETTOOLTIPANIMATION 0x1017 +#endif +#ifndef SPI_SETTOOLTIPFADE +#define SPI_SETTOOLTIPFADE 0x1019 +#endif +#ifndef SPI_SETUIEFFECTS +#define SPI_SETUIEFFECTS 0x103F +#endif +#ifndef SPI_GETMENUANIMATION +#define SPI_GETMENUANIMATION 0x1002 +#endif +#ifndef SPI_GETMENUFADE +#define SPI_GETMENUFADE 0x1012 +#endif +#ifndef SPI_GETCOMBOBOXANIMATION +#define SPI_GETCOMBOBOXANIMATION 0x1004 +#endif +#ifndef SPI_GETTOOLTIPANIMATION +#define SPI_GETTOOLTIPANIMATION 0x1016 +#endif +#ifndef SPI_GETTOOLTIPFADE +#define SPI_GETTOOLTIPFADE 0x1018 +#endif +#ifndef SPI_GETUIEFFECTS +#define SPI_GETUIEFFECTS 0x103E +#endif +#ifndef SPI_GETKEYBOARDCUES +#define SPI_GETKEYBOARDCUES 0x100A +#endif +#ifndef SPI_GETGRADIENTCAPTIONS +#define SPI_GETGRADIENTCAPTIONS 0x1008 +#endif +#ifndef IDC_HAND +#define IDC_HAND MAKEINTRESOURCE(32649) +#endif +#ifndef WM_MOUSEWHEEL +#define WM_MOUSEWHEEL 0x020A +#endif +#ifndef WM_MOUSEHWHEEL +#define WM_MOUSEHWHEEL 0x020E +#endif +#ifndef ETO_PDY +#define ETO_PDY 0x2000 +#endif +#ifndef COLOR_GRADIENTACTIVECAPTION +#define COLOR_GRADIENTACTIVECAPTION 27 +#endif +#ifndef COLOR_GRADIENTINACTIVECAPTION +#define COLOR_GRADIENTINACTIVECAPTION 28 +#endif + +// already defined when compiled with WINVER >= 0x0600 +#ifndef SPI_GETFLATMENU +#define SPI_GETFLATMENU 0x1022 +#endif +#ifndef CS_DROPSHADOW +#define CS_DROPSHADOW 0x00020000 +#endif +#ifndef CLEARTYPE_QUALITY +#define CLEARTYPE_QUALITY 5 +#endif + +#ifdef Q_WS_WINCE +#ifndef LR_DEFAULTSIZE +#define LR_DEFAULTSIZE 0 +#endif +#ifndef LR_SHARED +#define LR_SHARED 0 +#endif +#endif // Q_WS_WINCE + +#endif // QT_WINDOWS_H -- cgit v1.2.3