Merge branch 'newdocs'

Added prepare_docs to qt_build_config.prf (it was added
directly in configure in the source branch)

Conflicts:
	configure
	tools/configure/configureapp.cpp

Change-Id: I1337c69fc62b1c934e3e39b4409e4857440c9db8
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2012-11-20 10:08:29 +01:00
commit 0dc61c4216
182 changed files with 7906 additions and 804 deletions

4
configure vendored
View File

@ -1901,7 +1901,7 @@ while [ "$#" -gt 0 ]; do
fi
;;
javascript-jit)
if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then
if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then
CFG_JAVASCRIPTCORE_JIT="$VAL"
else
UNKNOWN_OPT=yes
@ -5209,7 +5209,7 @@ if [ "$CFG_ALSA" = "auto" ]; then
fi
fi
if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
if [ "$CFG_ARCH" = "arm" ]; then
compileTest unix/javascriptcore-jit "javascriptcore-jit"
if [ $? != "0" ]; then

View File

@ -0,0 +1,11 @@
alias.include = input
macro.0 = "\\\\0"
macro.n = "\\\\n"
macro.r = "\\\\r"
macro.img = "\\image"
macro.endquote = "\\endquotation"
macro.relatesto = "\\relates"
spurious = "Missing comma in .*" \
"Missing pattern .*"

View File

@ -0,0 +1,479 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\externalpage http://www.freedesktop.org/
\title freedesktop.org
*/
/*!
\externalpage http://www.freedesktop.org/Standards/xembed-spec
\title XEmbed Specification
*/
/*!
\externalpage http://www.freedesktop.org/Standards/icon-theme-spec
\title Icon Themes Specification
*/
/*!
\externalpage http://www.cups.org/
\title Common Unix Printing System (CUPS)
\keyword CUPS
*/
/*!
\externalpage http://www.freedesktop.org/wiki/Standards_2fdesktop_2dentry_2dspec
\title Desktop Entry Specification
*/
/*!
\externalpage http://www.kde.org/
\title The K Desktop Environment
\keyword KDE
*/
/*!
\externalpage http://www.cmake.org/cmake/help/documentation.html
\title CMake Documentation
*/
/*!
\externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#command:find_package
\title CMake find_package Documentation
*/
/*!
\externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#prop_tgt:AUTOMOC
\title CMake AUTOMOC Documentation
*/
/*!
\externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#prop_tgt:LOCATION
\title CMake LOCATION Documentation
*/
/*!
\externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#prop_tgt:POSITION_INDEPENDENT_CODE
\title CMake POSITION_INDEPENDENT_CODE Documentation
*/
/*!
\externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#command:target_link_libraries
\title CMake target_link_libraries Documentation
*/
/*!
\externalpage http://www.gnome.org/
\title GNOME
*/
/*!
\externalpage http://www.gnu.org/software/emacs/
\title GNU Emacs
*/
/*!
\externalpage http://gnuwin32.sourceforge.net/packages.html
\title GnuWin32 Project
*/
/*!
\externalpage http://www.w3.org/Graphics/SVG/About.html
\title About SVG
\keyword Scalable Vector Graphics
*/
/*!
\externalpage http://www.w3.org/TR/SVG/types.html#ColorKeywords
\title SVG color keyword names
*/
/*!
\externalpage http://www.w3.org/Graphics/SVG/
\title SVG Working Group
*/
/*!
\externalpage http://www.w3.org/TR/SVGMobile/
\title Mobile SVG Profiles
\omit
Mobile SVG Profiles: SVG Tiny and SVG Basic
\endomit
*/
/*!
\externalpage http://www.w3.org/TR/SVGMobile12/
\title SVG 1.2 Tiny
*/
/*!
\externalpage http://www.w3.org/Graphics/SVG/feature/1.2/#SVG-static
\title SVG 1.2 Tiny Static Features
*/
/*!
\externalpage http://tdm-gcc.tdragon.net/
\title TDM-GCC
*/
/*!
\externalpage http://www.dependencywalker.com/
\title Dependency Walker
*/
/*!
\externalpage http://webkit.org/
\title WebKit Open Source Project
*/
/*!
\externalpage http://www.informit.com/store/product.aspx?isbn=0132354160
\title C++ GUI Programming with Qt 4, 2nd Edition
*/
/*!
\externalpage http://www.openssl.org/
\title OpenSSL Toolkit
*/
/*!
\externalpage http://arora-browser.org/
\title Arora Browser
*/
/*!
\externalpage http://www.activestate.com/Products/activeperl/index.mhtml
\title ActivePerl
*/
/*!
\externalpage http://code.google.com/p/angleproject/
\title ANGLE
*/
/*!
\externalpage http://msdn.microsoft.com/en-us/directx/default.aspx
\title Direct X SDK
*/
/*!
\externalpage http://www.w3.org/TR/html401/
\title HTML 4
*/
/*!
\externalpage http://www.w3.org/TR/html5/
\title HTML 5
*/
/*!
\externalpage http://site.icu-project.org/
\title ICU
*/
/*!
\externalpage http://www.mingw.org/
\title MinGW
*/
/*!
\externalpage http://www.python.org/
\title Python
*/
/*!
\externalpage http://pyxml.sourceforge.net/topics/xbel/
\title XML Bookmark Exchange Language Resource Page
*/
/*!
\externalpage http://www.w3.org/TR/xquery/#errors
\title error handling in the XQuery language
*/
/*!
\externalpage http://xaos.sourceforge.net/
\title XaoS
*/
/*!
\externalpage http://www.unixodbc.org
\title http://www.unixodbc.org
*/
/*!
\externalpage http://www.postgresql.org
\title http://www.postgresql.org
*/
/*!
\externalpage http://www.postgresql.org/docs/current/static/installation-platform-notes.html#INSTALLATION-NOTES-MINGW
\title PostgreSQL MinGW/Native Windows
*/
/*!
\externalpage http://www.freetds.org
\title http://www.freetds.org
*/
/*!
\externalpage http://www.sybase.com
\title http://www.sybase.com
*/
/*!
\externalpage http://linux.sybase.com
\title http://linux.sybase.com
*/
/*!
\externalpage http://www.sqlite.org
\title http://www.sqlite.org
*/
/*!
\externalpage http://www.amazon.com/exec/obidos/ASIN/0134436989/trolltech/t
\title Threads Primer: A Guide to Multithreaded Programming
*/
/*!
\externalpage http://www.amazon.com/exec/obidos/ASIN/0131900676/trolltech/t
\title Thread Time: The Multithreaded Programming Guide
*/
/*!
\externalpage http://www.amazon.com/exec/obidos/ASIN/1565921151/trolltech/t
\title Pthreads Programming: A POSIX Standard for Better Multiprocessing
*/
/*!
\externalpage http://www.amazon.com/exec/obidos/ASIN/1565922964/trolltech/t
\title Win32 Multithreaded Programming
*/
/*!
\externalpage http://www.phptr.com/content/images/0131872494/samplechapter/blanchette_ch10.pdf
\title "Item View Classes" Chapter of C++ GUI Programming with Qt 4
*/
/*!
\externalpage https://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html
\title Mac OS X Aqua
*/
/*!
\externalpage http://www.kdedevelopers.org/node/2345
\title KDE applications
*/
/*!
\externalpage http://cgi.netscape.com/newsref/std/cookie_spec.html
\title Netscape Cookie Specification
*/
/*!
\externalpage http://msdn.microsoft.com/en-us/library/ms533046(VS.85).aspx
\title Mitigating Cross-site Scripting With HTTP-only Cookies
*/
/*!
\externalpage http://en.tldp.org/HOWTO/Framebuffer-HOWTO.html
\title Framebuffer HOWTO
*/
/*!
\externalpage http://wap.trafikanten.no
\title Trafikanten
*/
/*!
\externalpage http://www.w3.org/TR/scxml/
\title State Chart XML: State Machine Notation for Control Abstraction
*/
/*!
\externalpage http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Statecharts.pdf
\title Statecharts: A visual formalism for complex systems
*/
/*!
\externalpage http://www.gnu.org/licenses/gpl.html
\title GNU General Public License
*/
/*!
\externalpage http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
\title GNU Lesser General Public License, version 2.1
*/
/*!
\externalpage http://developers.sun.com/sunstudio/downloads/patches/index.jsp
\title Sun Studio Patches
*/
/*!
\externalpage http://www.qtcentre.org
\title Qt Centre
*/
/*!
\externalpage http://www.kde.org
\title KDE
*/
/*!
\externalpage http://www.directfb.org/index.php?path=Main%2FDownloads&page=1
\title DirectFB - df_window example
*/
/*!
\externalpage http://www.directfb.org/docs/DirectFB_Reference_1_4/IDirectFBPalette.html
\title DirectFB - IDirectFBPalette
*/
/*!
\externalpage http://www.cplusplus.com/reference/clibrary/cstring/memcpy/
\title C++ Reference - memcpy
*/
/*!
\externalpage http://www.directfb.org/docs/DirectFB_Reference_1_4/IDirectFB_CreateInputEventBuffer.html
\title DirectFB - CreateInputEventBuffer
*/
/*!
\externalpage http://www.directfb.org/docs/DirectFB_Reference_1_4/types.html#DFBSurfaceBlittingFlags
\title DirectFB - DFBSurfaceBlittingFlags
*/
/*!
\externalpage http://directfb.org/docs/DirectFB_Reference_1_4/IDirectFBImageProvider.html
\title DirectFB - IDirectFBImageProvider
*/
/*!
\externalpage http://www.directfb.org/docs/DirectFB_Reference_1_4/IDirectFBSurface.html
\title DirectFB - IDirectFBSurface
*/
/*!
\externalpage http://www.directfb.org/docs/DirectFB_Reference_1_4/IDirectFBWindow
\title DirectFB - IDirectFBWindow
*/
/*!
\externalpage http://www.directfb.org/docs/DirectFB_Reference_1_4/types.html#DFBSurfaceDescription
\title DirectFB - DFBSurfaceDescription
*/
/*!
\externalpage http://www.w3.org/TR/REC-CSS2/selector.html#q1
\title Standard CSS2 selector
*/
/*!
\externalpage http://www.w3.org/XML/Schema
\title XML Schema
*/
/*!
\externalpage http://opensource.org/licenses/bsd-license.php
\title New and Modified BSD Licenses
*/
/*!
\externalpage http://www.ecma-international.org/publications/standards/Ecma-262.htm
\title ECMAScript Language Specification
*/
/*!
\externalpage https://developer.mozilla.org/en/JavaScript
\title JavaScript Resources
*/
/*!
\externalpage https://developer.mozilla.org/en/JavaScript/Guide
\title JavaScript Guide
*/
/*!
\externalpage https://developer.mozilla.org/en/JavaScript/About_JavaScript
\title About JavaScript
*/
/*!
\externalpage http://www.libusb.org/
\title libusb
*/
/*!
\externalpage https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words
\title JavaScript Reserved Words
*/
/*!
\externalpage http://publicsuffix.org/
\title publicsuffix.org
*/
/*!
\externalpage http://wiki.forum.nokia.com/
\title Forum Nokia Wiki
*/
/*!
\externalpage http://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/_accessible_event_i_d_8idl.html
\title AccessibleEventID.idl File Reference
*/
/*!
\externalpage http://msdn.microsoft.com/en-us/library/dd318066.aspx
\title Microsoft Active Accessibility Event Constants
*/
/*!
\externalpage ftp://ftp.qt.nokia.com/pub/qt/solutions/lgpl/qtmotifextension-2.7_1-opensource.tar.gz
\title Motif Extension
*/
/*!
\externalpage http://www.opengl.org/registry/
\title OpenGL Registry
*/
/*!
\externalpage http://www.khronos.org/registry/gles/
\title Khronos OpenGL ES API Registry
*/
/*!
\externalpage http://git.iksaif.net/?p=qsslkey-p11.git
\title qsslkey example
*/

View File

@ -0,0 +1,95 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\externalpage http://doc.qt.digia.com/qtcreator/creator-qml-application.html
\title external: Developing Qt Quick Applications with Creator
*/
/*!
\externalpage http://doc.qt.digia.com/qtcreator/creator-visual-editor.html
\title external: Developing Qt Quick Applications
*/
/*!
\externalpage http://doc.qt.digia.com/qtcreator/creator-publish-ovi.html
\title external: Publishing Applications to Ovi Store
*/
/*!
\externalpage http://doc.qt.digia.com/qtcreator/index.html
\title external: Qt Creator Manual
*/
/*!
\externalpage http://doc.qt.digia.com/qtmobility/index.html
\title external: Qt Mobility Manual
*/
/*!
\externalpage http://doc.qt.digia.com/qtmobility/qml-plugins.html
\title external: Qt Mobility QML Plugins
*/
/*!
\externalpage http://qt-project.org/doc/qtcreator/creator-project-managing.html
\title external: Creating Qt Projects in Creator
*/
/*!
\externalpage http://qt-project.org/doc/qtcreator/creator-building-running.html
\title external: Building and Running Applications in Creator
*/
/*!
\externalpage http://qt-project.org/doc/qtcreator/creator-running-targets.html
\title external: Set Compiler Targets in Creator
*/
/*!
\externalpage http://qt-project.org/doc/qtcreator/creator-build-settings.html
\title external: Build Settings in Creator
*/
/*!
\externalpage http://qt-project.org/doc/qtcreator/creator-run-settings.html
\title external: Run Settings in Creator
*/
/*!
\externalpage http://qt-project.org/doc/qtcreator/creator-using-qt-designer.html
\title external: Designer in Creator
*/
/*!
\externalpage http://qt-project.org/doc/qtcreator/creator-debugging.html
\title external: Debugging Applications in Creator
*/
/*!
\externalpage http://doc.qt.digia.com/qtmobility/multimedia.html
\title external: Mobility Multimedia
*/
/*!
\externalpage http://doc.qt.digia.com/qtmobility/location-overview.html
\title external: Mobility Location
*/
/*!
\externalpage http://doc.qt.digia.com/qtmobility/all-examples.html
\title external: Qt Mobility Examples
*/
/*!
\externalpage http://doc-snapshot.qt-project.org/qtcreator-2.6/creator-overview.html
\title external: Qt Creator Overview
*/

View File

@ -0,0 +1,92 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\externalpage http://qt-project.org/
\title Qt Homepage
*/
/*!
\externalpage http://bugreports.qt-project.org
\title Qt Bug Tracker
*/
/*!
\externalpage http://qt.digia.com/downloads
\title Downloads
*/
/*!
\externalpage http://qt.digia.com/products/licensing/
\title Qt Licensing Overview
*/
/*!
\externalpage http://doc.qt.digia.com/qq/
\title Qt Quarterly
*/
/*!
\externalpage http://doc.qt.digia.com/qq/qq19-plurals.html
\title Qt Quarterly: Plural Form in Translation
*/
/*!
\externalpage http://qt.gitorious.org
\title Public Qt Repository
*/
/*!
\externalpage http://qt.gitorious.org/qt-labs/qtestlib-tools
\title qtestlib-tools
*/
/*!
\externalpage http://qt-project.org/wiki/Qt_Coding_Style
\title Qt Coding Style
*/
/*!
\externalpage http://doc.qt.digia.com/qt-eclipse-1.6/index.html
\title Eclipse Plugin
*/
/*!
\externalpage http://doc.qt.digia.com/qq/qq11-events.html
\title Qt Quarterly: Another Look at Events
*/
/*!
\externalpage http://qt-project.org/videos/watch/livecoding-video-effects-with-qt5
\title Livecoding video effects with Qt5
*/
/*!
\externalpage http://blog.qt.digia.com/2012/02/29/pimp-my-video-shader-effects-and-multimedia/
\title Pimp my video
*/
/*!
\externalpage http://qt-project.org/wiki/QtMediaHub
\title QtMediaHub
*/
/*!
\externalpage http://qt-project.org/wiki/Qt-RaspberryPi
\title QtonPi
*/
/*!
\externalpage http://qt-project.org/wiki/jom
\title jom
*/

View File

@ -0,0 +1,79 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\externalpage http://www.ietf.org/rfc/rfc1179.txt
\title RFC 1179
\keyword lpr
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc1738.txt
\title RFC 1738
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc1928.txt
\title RFC 1928
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc1929.txt
\title RFC 1929
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc2045.txt
\title RFC 2045
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc2109.txt
\title RFC 2109
HTTP State Management Mechanism
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc2965.txt
\title RFC 2965
HTTP State Management Mechanism
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc3174.txt
\title RFC 3174
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc3491.txt
\title RFC 3491
*/
/*!
\externalpage http://www.rfc-editor.org/rfc/rfc3986.txt
\title RFC 3986
*/

View File

@ -0,0 +1,37 @@
macro.aacute.HTML = "á"
macro.Aring.HTML = "Å"
macro.aring.HTML = "å"
macro.Auml.HTML = "Ä"
macro.author = "\\b{Author:}"
macro.br.HTML = "<br />"
macro.BR.HTML = "<br />"
macro.copyright.HTML = "&copy;"
macro.eacute.HTML = "&eacute;"
macro.gui = "\\b"
macro.hr.HTML = "<hr />"
macro.iacute.HTML = "&iacute;"
macro.key = "\\b"
macro.menu = "\\b"
macro.oslash.HTML = "&oslash;"
macro.ouml.HTML = "&ouml;"
macro.QA = "\\e{Qt Assistant}"
macro.QD = "\\e{Qt Designer}"
macro.QL = "\\e{Qt Linguist}"
macro.QQV = "\\e{Qt QML Viewer}"
macro.param = "\\e"
macro.raisedaster.HTML = "<sup>*</sup>"
macro.rarrow.HTML = "&rarr;"
macro.reg.HTML = "<sup>&reg;</sup>"
macro.return = "Returns"
macro.starslash = "\\c{*/}"
macro.begincomment = "\\c{/*}"
macro.endcomment = "\\c{*/}"
macro.uuml.HTML = "&uuml;"
macro.mdash.HTML = "&mdash;"
macro.pi.HTML = "&Pi;"
macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
macro.endfloat.HTML = "</div>"
macro.clearfloat.HTML = "<br style=\"clear: both\" />"
macro.emptyspan.HTML = "<span></span>"

View File

@ -0,0 +1,116 @@
Cpp.ignoretokens += \
PHONON_EXPORT \
Q_AUTOTEST_EXPORT \
Q_BLUETOOTH_EXPORT \
Q_COMPAT_EXPORT \
Q_CORE_EXPORT \
Q_CORE_EXPORT_INLINE \
Q_DBUS_EXPORT \
Q_DECL_CONSTEXPR \
Q_DECL_NOEXCEPT \
Q_DECL_NOTHROW \
Q_DECLARATIVE_EXPORT \
Q_EXPLICIT \
Q_EXPORT \
Q_EXPORT_CODECS_CN \
Q_EXPORT_CODECS_JP \
Q_EXPORT_CODECS_KR \
Q_EXPORT_PLUGIN \
Q_EXPORT_PLUGIN2 \
Q_GADGET \
Q_GFX_INLINE \
Q_GUI_EXPORT \
Q_GUI_EXPORT_INLINE \
Q_GUI_EXPORT_STYLE_CDE \
Q_GUI_EXPORT_STYLE_COMPACT \
Q_GUI_EXPORT_STYLE_MAC \
Q_GUI_EXPORT_STYLE_MOTIF \
Q_GUI_EXPORT_STYLE_MOTIFPLUS \
Q_GUI_EXPORT_STYLE_PLATINUM \
Q_GUI_EXPORT_STYLE_POCKETPC \
Q_GUI_EXPORT_STYLE_SGI \
Q_GUI_EXPORT_STYLE_WINDOWS \
Q_GUI_EXPORT_STYLE_WINDOWSXP \
Q_INLINE_TEMPLATE \
Q_INTERNAL_WIN_NO_THROW \
Q_INVOKABLE \
Q_LOCATION_EXPORT \
Q_MULTIMEDIA_EXPORT \
Q_NETWORK_EXPORT \
Q_OPENGL_EXPORT \
Q_OPENVG_EXPORT \
Q_OUTOFLINE_TEMPLATE \
Q_PRINTSUPPORT_EXPORT \
Q_SCRIPT_EXPORT \
Q_SCRIPTTOOLS_EXPORT \
Q_SQL_EXPORT \
Q_SVG_EXPORT \
Q_TESTLIB_EXPORT \
Q_TYPENAME \
Q_WIDGETS_EXPORT \
Q_XML_EXPORT \
Q_XMLPATTERNS_EXPORT \
Q_XMLSTREAM_EXPORT \
QAXFACTORY_EXPORT \
QDBUS_EXPORT \
QDESIGNER_COMPONENTS_LIBRARY \
QDESIGNER_EXTENSION_LIBRARY \
QDESIGNER_SDK_LIBRARY \
QDESIGNER_SHARED_LIBRARY \
QDESIGNER_UILIB_LIBRARY \
QHELP_EXPORT \
QM_AUTOTEST_EXPORT \
QM_EXPORT_CANVAS \
QM_EXPORT_DNS \
QM_EXPORT_DOM \
QM_EXPORT_FTP \
QM_EXPORT_HTTP \
QM_EXPORT_ICONVIEW \
QM_EXPORT_NETWORK \
QM_EXPORT_OPENGL \
QM_EXPORT_OPENVG \
QM_EXPORT_SQL \
QM_EXPORT_TABLE \
QM_EXPORT_WORKSPACE \
QM_EXPORT_XML \
QT_ASCII_CAST_WARN \
QT_ASCII_CAST_WARN_CONSTRUCTOR \
QT_BEGIN_HEADER \
QT_BEGIN_INCLUDE_NAMESPACE \
QT_BEGIN_NAMESPACE \
QT_BOOTSTRAPPED \
QT_DESIGNER_STATIC \
QT_END_HEADER \
QT_END_INCLUDE_NAMESPACE \
QT_END_NAMESPACE \
QT_FASTCALL \
QT_WIDGET_PLUGIN_EXPORT \
QTBLUETOOTH_BEGIN_NAMESPACE \
QTBLUETOOTH_END_NAMESAPCE \
QTNFC_BEGIN_NAMESPACE \
QTNFC_END_NAMESPACE \
QWEBKIT_EXPORT
Cpp.ignoredirectives = \
__attribute__ \
K_DECLARE_PRIVATE \
PHONON_HEIR \
PHONON_OBJECT \
Q_CLASSINFO \
Q_DECLARE_INTERFACE \
Q_DECLARE_METATYPE \
Q_DECLARE_OPERATORS_FOR_FLAGS \
Q_DECLARE_PRIVATE \
Q_DECLARE_PRIVATE_D \
Q_DECLARE_PUBLIC \
Q_DECLARE_SHARED \
Q_DECLARE_TR_FUNCTIONS \
Q_DECLARE_TYPEINFO \
Q_DISABLE_COPY \
Q_DUMMY_COMPARISON_OPERATOR \
Q_ENUMS \
Q_FLAGS \
Q_INTERFACES \
Q_PRIVATE_PROPERTY \
QT_FORWARD_DECLARE_CLASS \
Q_DECLARE_HANDLE

View File

@ -0,0 +1,17 @@
versionsym = QT_VERSION_STR
defines += Q_QDOC \
QT_.*_SUPPORT \
QT_.*_LIB \
QT_COMPAT \
QT_KEYPAD_NAVIGATION \
QT_NO_EGL \
QT3_SUPPORT \
Q_WS_.* \
Q_OS_.* \
Q_BYTE_ORDER \
QT_DEPRECATED \
QT_DEPRECATED_* \
Q_NO_USING_KEYWORD \
__cplusplus \
Q_COMPILER_INITIALIZER_LISTS

View File

@ -1,14 +1,21 @@
HTML.nobreadcrumbs = "true"
HTML.stylesheets = global/style/offline.css
HTML.stylesheets = template/style/offline.css
HTML.headerstyles = \
" <link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline.css\" />\n"
HTML.endheader = \
"</head>\n" \
"<body>\n" \
"<div class=\"content\">\n" \
"<div class=\"line\">\n" \
"<div class=\"content mainContent\">\n" \
HTML.footer = \
"</div>\n" \
"</div>\n" \
"</div>\n" \
"<div class=\"footer\">\n" \
" <p>\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2012 Digia Plc and/or its\n" \
@ -29,4 +36,3 @@ HTML.footer = \
" of their respective owners. <a title=\"Privacy Policy\"\n" \
" href=\"http://en.gitorious.org/privacy_policy/\">Privacy Policy</a></p>\n" \
"</div>\n" \

View File

@ -0,0 +1,95 @@
HTML.nobreadcrumbs = "true"
HTML.stylesheets = template/style/online.css
HTML.extraimages = template/images/btn_next_green.png \
template/images/box_bg.png \
template/images/page.png \
template/images/arrow_down.png \
template/images/btn_prev.png \
template/images/blu_dot.png \
template/images/ico_note_attention.png \
template/images/btn_prev_green.png \
template/images/bg_ll_blank.png \
template/images/btn_next.png \
template/images/bg_l_blank.png \
template/images/ico_note.png \
template/images/home.png \
template/images/ico_out.png \
template/images/header_bg.png \
template/images/page_bg.png \
template/images/bg_l.png \
template/images/bg_r.png \
template/images/breadcrumb.png \
template/images/bullet_dn.png \
template/images/feedbackground.png \
template/images/bullet_gt.png \
template/images/arrow.png \
template/images/bullet_sq.png \
template/images/bullet_up.png \
template/images/sprites-combined.png \
template/images/horBar.png \
template/images/bg_ul_blank.png \
template/images/bgrContent.png \
HTML.headerstyles = \
" <link rel=\"stylesheet\" type=\"text/css\" href=\"style/online.css\" />\n"
HTML.endheader = \
"</head>\n" \
"<body>\n" \
" <header>\n" \
" <div class=\"nav\">\n" \
" <a href=\"http://qt-project.org/\">Qt Home</a>\n" \
" <a href=\"https://bugreports.qt-project.org/\">Bug Tracker</a>\n" \
" <a href=\"https://codereview.qt-project.org/\">Code Review</a>\n" \
" </div>\n" \
" <a href=\"http://qt-project.org/\">\n" \
" <img src=\"http://doc-snapshot.qt-project.org/images/logo.png\" alt=\"Qt\"></img>\n" \
" </a>\n" \
" <div class=\"nav-title\">\n" \
" <h1 >Qt Documentation Snapshots</h1>\n" \
" <div class=\"nav-subtitle\">\n" \
" --snapshots of unreleased Qt documentation\n" \
" </div>\n" \
" </div>\n" \
" <div class=\"nav-main\">\n" \
" <div class=\"nav-main-content\">\n" \
" <a href=\"http://doc-snapshot.qt-project.org\">All Modules</a>\n" \
" </div>\n" \
" <div class=\"nav-main-content\">\n" \
" <a href=\"http://qt-project.org/doc\">Qt Releases</a>\n" \
" </div>\n" \
" <div class=\"nav-main-content\">\n" \
" <a href=\"http://doc.qt.digia.com\">Archives</a>\n" \
" </div>\n" \
" </div>\n" \
"</header>\n" \
"<div class=\"content\">\n" \
" <div class=\"line\">\n" \
" <div class=\"content mainContent\">\n" \
HTML.footer = \
" </div>\n" \
" </div>\n" \
"</div>\n" \
"<div class=\"footer\">\n" \
" <p>\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2012 Digia Plc and/or its\n" \
" subsidiaries. Documentation contributions included herein are the copyrights of\n" \
" their respective owners.</p>\n" \
" <br />\n" \
" <p>\n" \
" The documentation provided herein is licensed under the terms of the\n" \
" <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU Free Documentation\n" \
" License version 1.3</a> as published by the Free Software Foundation.</p>\n" \
" <p>\n" \
" Documentation sources may be obtained from <a href=\"http://www.qt-project.org\">\n" \
" www.qt-project.org</a>.</p>\n" \
" <br />\n" \
" <p>\n" \
" Digia, Qt and their respective logos are trademarks of Digia Plc \n" \
" in Finland and/or other countries worldwide. All other trademarks are property\n" \
" of their respective owners. <a title=\"Privacy Policy\"\n" \
" href=\"http://en.gitorious.org/privacy_policy/\">Privacy Policy</a></p>\n" \
"</div>\n" \

View File

@ -0,0 +1,32 @@
include(macros.qdocconf)
include(qt-cpp-ignore.qdocconf)
include(qt-defines.qdocconf)
include(qt-html-templates-online.qdocconf)
include(compat.qdocconf)
dita.metadata.default.author = Qt Project
dita.metadata.default.permissions = all
dita.metadata.default.publisher = Qt Project
dita.metadata.default.copyryear = 2012
dita.metadata.default.copyrholder = Digia Plc
dita.metadata.default.audience = programmer
naturallanguage = en_US
outputencoding = UTF-8
sourceencoding = UTF-8
examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml *.css"
examples.imageextensions = "*.png *.jpg *.gif"
headers.fileextensions = "*.ch *.h *.h++ *.hh *.hpp *.hxx"
sources.fileextensions = "*.c++ *.cc *.cpp *.cxx *.mm *.qml *.qdoc"
versionsym = QT_VERSION_STR
macro.raisedaster.HTML = "<sup>*</sup>"
#for including files into the qch file
qhp.extraFiles += template/style/online.css
#include the external websites
sourcedirs += externalsites

View File

@ -1,80 +1,8 @@
codeindent = 1
Cpp.ignoretokens = \
QDBUS_EXPORT \
QT_ASCII_CAST_WARN \
QT_ASCII_CAST_WARN_CONSTRUCTOR \
QT_BEGIN_HEADER \
QT_BEGIN_INCLUDE_NAMESPACE \
QT_BEGIN_NAMESPACE \
QT_BOOTSTRAPPED \
QT_DESIGNER_STATIC \
QT_END_HEADER \
QT_END_INCLUDE_NAMESPACE \
QT_END_NAMESPACE \
QT_FASTCALL \
Q_AUTOTEST_EXPORT \
Q_COMPAT_EXPORT \
Q_CORE_EXPORT \
Q_CORE_EXPORT_INLINE \
Q_DBUS_EXPORT \
Q_DECL_CONSTEXPR \
Q_DECL_NOEXCEPT \
Q_DECL_NOTHROW \
Q_EXPORT \
Q_EXPORT_PLUGIN \
Q_EXPORT_PLUGIN2 \
Q_GADGET \
Q_GUI_EXPORT \
Q_GUI_EXPORT_INLINE \
Q_INLINE_TEMPLATE \
Q_INVOKABLE \
Q_NETWORK_EXPORT \
Q_OPENGL_EXPORT \
Q_OPENVG_EXPORT \
Q_OUTOFLINE_TEMPLATE \
Q_PRINTSUPPORT_EXPORT \
Q_SQL_EXPORT \
Q_SVG_EXPORT \
Q_SCRIPT_EXPORT \
Q_SCRIPTTOOLS_EXPORT \
Q_WIDGETS_EXPORT \
Q_XML_EXPORT \
Q_XMLPATTERNS_EXPORT
Cpp.ignoredirectives = \
__attribute__ \
QT_FORWARD_DECLARE_CLASS \
Q_CLASSINFO \
Q_DECLARE_INTERFACE \
Q_DECLARE_METATYPE \
Q_DECLARE_OPERATORS_FOR_FLAGS \
Q_DECLARE_PRIVATE \
Q_DECLARE_PUBLIC \
Q_DECLARE_PRIVATE_D \
Q_DECLARE_SHARED \
Q_DECLARE_TR_FUNCTIONS \
Q_DECLARE_TYPEINFO \
Q_DISABLE_COPY \
Q_DUMMY_COMPARISON_OPERATOR \
Q_ENUMS \
Q_FLAGS \
Q_INTERFACES \
Q_PRIVATE_PROPERTY
defines = Q_QDOC \
QT_.*_SUPPORT \
QT_.*_LIB \
QT_COMPAT \
QT_KEYPAD_NAVIGATION \
QT_NO_EGL \
Q_OS_.* \
Q_BYTE_ORDER \
QT_DEPRECATED \
QT_DEPRECATED_* \
Q_NO_USING_KEYWORD \
__cplusplus \
Q_COMPILER_INITIALIZER_LISTS
include(macros.qdocconf)
include(qt-cpp-ignore.qdocconf)
include(qt-defines.qdocconf)
include(qt-html-templates-offline.qdocconf)
include(compat.qdocconf)
dita.metadata.default.author = Qt Project
dita.metadata.default.permissions = all
@ -95,3 +23,10 @@ sources.fileextensions = "*.c++ *.cc *.cpp *.cxx *.mm *.qml *.qdoc"
versionsym = QT_VERSION_STR
macro.raisedaster.HTML = "<sup>*</sup>"
#for including files into the qch file
qhp.extraFiles += template/style/offline.css
#include the external websites
sourcedirs += externalsites

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

@ -620,3 +620,87 @@ border:none;}
.clearfix{
clear:both;}
/* start index box */
.indexbox
{
width: 100%;
display:inline-block;
}
.indexboxcont
{
display: block;
}
.indexboxcont .section
{
display: inline-block;
width: 49%;
*width:42%;
_width:42%;
padding:0 2% 0 1%;
vertical-align:top;
}
.indexboxcont .indexIcon
{
width: 11%;
*width:18%;
_width:18%;
overflow:hidden;
}
.indexboxcont .section {
float: left;
}
.indexboxcont .section p
{
padding-top: 20px;
padding-bottom: 20px;
}
.indexboxcont .sectionlist
{
display: inline-block;
vertical-align:top;
width: 32.5%;
padding: 0;
}
.indexboxcont .sectionlist ul
{
margin-bottom: 20px;
}
.indexboxcont .sectionlist ul li
{
line-height: 12px;
}
.content .indexboxcont li
{
font: normal bold 13px/1 Verdana;
}
.content .normallist li
{
font: normal 13px/1 Verdana;
}
.indexbox .indexIcon {
width: 11%;
}
.indexbox .indexIcon span
{
display: block;
}
.indexboxcont:after
{
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}

View File

@ -0,0 +1,749 @@
body{
font: normal 400 14px/1.2 Arial;
font-family: Arial, Helvetica;
color:#313131;
text-align:justify;
margin-left:5px;
margin-right:5px;
background: none repeat scroll 0% 0% rgb(230,231,232);
}
img{
-moz-box-shadow: 3px 3px 3px #ccc;
-webkit-box-shadow: 3px 3px 3px #ccc;
box-shadow: 3px 3px 3px #ccc;
border:#8E8D8D 2px solid;
margin-left:0px;
max-width: 800px;
height: auto
}
b{
font-weight:600;
}
.content{}
.descr{
margin-top:35px;
/*max-width: 75%;*/
margin-left:5px;
text-align:justify;
vertical-align:top;
}
.name{
max-width: 75%;
font-weight:100;
}
tt{
text-align:left;}
/*
-----------
links
-----------
*/
a:link{
color: #2C418D;
text-decoration: none;
text-align:left;
}
a:hover{
color: #869CD1;
text-decoration:underline;
text-align:left;
}
a:visited{
color: #869CD1;
text-decoration: none;
text-align:left;
}
a:visited:hover{
text-decoration:underline;
text-align:left;
}
.flags{
text-decoration:none;
text-height:24px;
}
/*
-------------------------------
NOTE styles
-------------------------------
*/
.notetitle, .tiptitle, .fastpathtitle{
font-weight:bold;
}
.attentiontitle,.cautiontitle,.dangertitle,.importanttitle,.remembertitle,.restrictiontitle{
font-weight:bold;
}
.note,.tip,.fastpath{
background: #F2F2F2 url(../images/ico_note.png);
background-repeat: no-repeat;
background-position: top left;
padding:5px;
padding-left:40px;
padding-bottom:10px;
border:#999 1px dotted;
color:#666666;
margin:5px;
}
.attention,.caution,.danger,.important,.remember,.restriction{
background: #F2F2F2 url(../images/ico_note_attention.png);
background-repeat:no-repeat;
background-position:top left;
padding:5px;
padding-left:40px;
padding-bottom:10px;
border:#999 1px dotted;
color:#666666;
margin:5px;
}
/*
-------------------------------
Top navigation
-------------------------------
*/
.nav{
text-align:right;
margin-right:9px;
}
.nav img{
box-shadow: none;
}
.nav-main{
margin-top:22px;
margin-left: 20px;
text-align:left
}
.nav-main-content{
font-weight:bold;
margin-right: 20px;
display:inline-block;
}
.nav-subtitle{
color: #869CD1;
margin-left: 220px;
}
.header{
height:1px;
padding:0px;
margin:0px;
}
header{
background: none repeat scroll 0% 0% rgb(255,255,255);
border-radius: 10px 10px 10px 10px;
padding: 10px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
}
header h1{
display:block;
line-height: 70px;
font-size: 30px;
margin-left: 223px;
}
header img{
box-shadow: none;
border: 0;
position: absolute;
left: 30px;
}
.qtref{
display: block;
position: relative;
top: -76px;
height:15px;
z-index: 1;
font-size:11px;
padding-right:10px;
float:right;
}
.naviNextPrevious{
display: block;
text-align: right;
float:right;
z-index:1;
padding-right:10px;
vertical-align:top;
}
.naviNextPrevious > a.prevPage {
background-image:url(../images/btn_prev.png);
background-repeat:no-repeat;
background-position:left;
padding-left:20px;
height:20px;
padding-left:20px;
}
.naviNextPrevious > a.nextPage {
background-image:url(../images/btn_next.png);
background-repeat:no-repeat;
background-position:right;
padding-right:20px;
height:20px;
margin-left:30px;
}
.breadcrumb{
display: block;
position: relative;
top:-20px;
/*border-top:2px solid #ffffff;*/
border-bottom: 1px solid #cecece;
background-color:#F2F2F2;
z-index:1;
height:20px;
padding:0px;
margin:0px;
padding-left:10px;
padding-top:2px;
margin-left:-5px;
margin-right:-5px;
}
.breadcrumb ul{
margin:0px;
padding:0px;
}
.breadcrumb ul li{
background-color:#F2F2F2;
list-style-type:none;
padding:0;
margin:0;
height:20px;
}
.breadcrumb li{
float:left;
}
.breadcrumb .first {
background:url(../images/home.png);
background-position:left;
background-repeat:no-repeat;
padding-left:20px;
}
.breadcrumb li a{
color:#2C418D;
display:block;
text-decoration:none;
background:url(../images/arrow.png);
background-repeat:no-repeat;
background-position:right;
padding-right:25px;
padding-left:10px;
}
.breadcrumb li a:hover{
color:#909090;
display:block;
text-decoration:none;
background:url(../images/arrow.png);
background-repeat:no-repeat;
background-position:right;
padding-right:20px;
padding-left:10px;
}
/*
-----------
footer and license
-----------
*/
.footer{
text-align:center
}
/*
-----------
main content
-----------
*/
.line{
text-align: left;
background: none repeat scroll 0% 0% rgb(255,255,255);
border-radius: 10px 10px 10px 10px;
padding-left: 14px;
padding-right: 14px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
margin-top: 10px;
padding-bottom: 35px;
}
/* table of content
no display
*/
/*
-----------
headers
-----------
*/
@media screen{
.title{
color:#313131;
font-size: 18px;
font-weight: normal;
left: 0;
padding-bottom: 20px;
padding-left: 10px;
padding-top: 20px;
border-bottom: 1px #CCC solid ;
font-weight:bold;
margin-left:0px;
margin-right:0px;
}
}
h1 {
margin: 0;
}
h2, p.h2 {
font: 500 16px/1.2 Arial;
font-weight:100;
background-color:#F2F3F4;
padding:4px;
padding-left:14px;
margin-bottom:30px;
margin-top:30px;
margin-left:-10px;
margin-right:-5px;
border-top:#E0E0DE 1px solid;
border-bottom: #E0E0DE 1px solid;
}
h3{
font: 500 14px/1.2 Arial;
font-weight:100;
text-decoration:underline;
margin-bottom:30px;
margin-top:30px;
}
h3.fn,span.fn{
border-width: 1px;
border-style: solid;
border-color: #E6E6E6;
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
word-spacing: 3px;
padding: 5px 5px;
text-decoration:none;
font-weight:bold;
max-width:75%;
font-size:14px;
margin:0px;
margin-top:30px;
}
.name{
color:#1A1A1A;
}
.type{
color:#808080;
}
@media print {
.title {
color:#0066CB;
font-family:Arial, Helvetica;
font-size: 32px;
font-weight: normal;
left: 0;
position: absolute;
right: 0;
top: 0;
}
}
/*
-----------------
table styles
-----------------
*/
.table img {
border:none;
margin-left:0px;
-moz-box-shadow:0px 0px 0px #fff;
-webkit-box-shadow: 0px 0px 0px #fff;
box-shadow: 0px 0px 0px #fff;
}
/* table with border alternative colours*/
table,pre{
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
border: 1px solid #E6E6E6;
border-collapse: separate;
font-size: 12px;
line-height: 1.2;
margin-bottom: 25px;
margin-left: 15px;
font-size: 12px;
line-height: 1.2;
margin-bottom: 25px;
margin-left: 15px;
}
table th{
text-align:left;
padding-left:20px;
}
table td {
padding: 3px 15px 3px 20px;
border-bottom:#CCC dotted 1px;
}
table p { margin:0px;}
table tr.even {
background-color: white;
color: #66666E;
}
table tr.odd {
background-color: #F6F6F6;
color: #66666E;
}
table thead {
text-align:left;
padding-left:20px;
background-color:#e1e0e0;
border-left:none;
border-right:none;
}
table thead th {
padding-top:5px;
padding-left:10px;
padding-bottom:5px;
border-bottom: 2px solid #D1D1D1;
padding-right:10px;
}
/* table bodless & white*/
.borderless {
border-radius: 0px 0px 0px 0px;
background-color: #fff;
border: 1px solid #fff;
}
.borderless tr {
background-color: #FFF;
color: #66666E;
}
.borderless td {
border:none;
border-bottom:#fff dotted 1px;
}
/*
-----------
List
-----------
*/
ul{
padding-bottom:2px;
}
li {
margin-bottom: 10px;
padding-left: 8px;
list-style:outside;
list-style-type:square;
text-align:left;
}
ol{
margin:10px;
padding:0;
}
ol > li{
margin-left: 30px;
padding-left:8px;
list-style:decimal;
}
.centerAlign{
text-align: left;
}
.cpp{
display: block;
margin: 10;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
padding: 20px 0 20px 0;
}
.footer{
margin-top: 50px;
padding-left:5px;
margin-bottom: 10px;
font-size:10px;
border-top: 1px solid #999;
padding-top:11px;
}
.footerNavi{
width:auto;
text-align:right;
margin-top:50px;
z-index:1;
}
.memItemLeft{
padding-right: 3px;
}
.memItemRight{
padding: 3px 15px 3px 0;
}
.qml{
display: block;
margin: 10;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
padding: 20px 0 20px 0;
}
.qmldefault{
padding-left: 5px;
float: right;
color: red;
}
.qmlreadonly{
padding-left: 5px;
float: right;
color: #254117;
}
.rightAlign{
padding: 3px 5px 3px 10px;
text-align: right;
}
/*
-----------
Content table
-----------
*/
@media print{
.toc {
float: right;
padding-bottom: 10px;
padding-top: 50px;
width: 100%;
background-image:url(../images/bgrContent.png);
background-position:top;
background-repeat:no-repeat;
}
}
@media screen{
.toc{
clear:both;
float:right;
vertical-align:top;
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
background:#FFF url(../images/bgrContent.png);
background-position:top;
background-repeat:repeat-x;
border: 1px solid #E6E6E6;
padding-left:5px;
padding-bottom:10px;
height: auto;
width: 200px;
text-align:left;
z-index:2;
margin-left:20px;
margin-right:20px;
margin-top:85px;
padding-top:0px;
}
}
.toc h3{
text-decoration:none;
}
.toc h3{font: 500 14px/1.2 Arial;
font-weight:100;
padding:0px;
margin:0px;
padding-top:5px;
padding-left:5px;
}
.toc ul{
width:160px;
padding-left:10px;
padding-right:5px;
padding-top:10px;
}
.toc ul li{
margin-left:20px;
list-style-image:url(../images/blu_dot.png);
list-style:outside;
}
.toc ul li a:link{
color: #2C418D;
text-decoration: none;
}
.toc ul li a:hover{
color: #869CD1;
text-decoration:underline;
}
.toc ul li a:visited{
color: #869CD1;
font-weight: bold;
}
.level1{
border:none;}
.clearfix{
clear:both;}
/* start index box */
.indexbox
{
width: 100%;
display:inline-block;
}
.indexboxcont
{
display: block;
}
.indexboxcont .section
{
display: inline-block;
width: 49%;
*width:42%;
_width:42%;
padding:0 2% 0 1%;
vertical-align:top;
}
.indexboxcont .indexIcon
{
width: 11%;
*width:18%;
_width:18%;
overflow:hidden;
}
.indexboxcont .section {
float: left;
}
.indexboxcont .section p
{
padding-top: 20px;
padding-bottom: 20px;
}
.indexboxcont .sectionlist
{
display: inline-block;
vertical-align:top;
width: 32.5%;
padding: 0;
}
.indexboxcont .sectionlist ul
{
margin-bottom: 20px;
}
.indexboxcont .sectionlist ul li
{
line-height: 12px;
}
.content .indexboxcont li
{
font: normal bold 13px/1 Verdana;
}
.content .normallist li
{
font: normal 13px/1 Verdana;
}
.indexbox .indexIcon {
width: 11%;
}
.indexbox .indexIcon span
{
display: block;
}
.indexboxcont:after
{
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}

View File

@ -28,9 +28,9 @@
/*!
\example widgets/analogclock
\title Analog Clock Example
The Analog Clock example shows how to draw the contents of a custom
widget.
\ingroup examples-widgets
\brief The Analog Clock example shows how to draw the contents of a
custom widget.
\image analogclock-example.png Screenshot of the Analog Clock example

View File

@ -28,8 +28,8 @@
/*!
\example widgets/calculator
\title Calculator Example
The example shows how to use signals and slots to implement the
\ingroup examples-widgets
\brief The example shows how to use signals and slots to implement the
functionality of a calculator widget, and how to use QGridLayout
to place child widgets in a grid.

View File

@ -28,8 +28,8 @@
/*!
\title Calendar Widget Example
\example widgets/calendarwidget
The Calendar Widget example shows use of \c QCalendarWidget.
\ingroup examples-widgets
\brief The Calendar Widget example shows use of \c QCalendarWidget.
\image calendarwidgetexample.png

View File

@ -28,8 +28,8 @@
/*!
\example widgets/charactermap
\title Character Map Example
The Character Map example shows how to create a custom widget that can
\ingroup examples-widgets
\brief The Character Map example shows how to create a custom widget that can
both display its own content and respond to user input.
The example displays an array of characters which the user can click on

View File

@ -28,8 +28,8 @@
/*!
\example widgets/codeeditor
\title Code Editor Example
The Code Editor example shows how to create a simple editor that
\ingroup examples-widgets
\brief The Code Editor example shows how to create a simple editor that
has line numbers and that highlights the current line.
\image codeeditor-example.png

View File

@ -28,8 +28,8 @@
/*!
\example widgets/digitalclock
\title Digital Clock Example
The Digital Clock example shows how to use QLCDNumber to display a
\ingroup examples-widgets
\brief The Digital Clock example shows how to use QLCDNumber to display a
number with LCD-like digits.
\image digitalclock-example.png Screenshot of the Digital Clock example

View File

@ -28,8 +28,8 @@
/*!
\example widgets/groupbox
\title Group Box Example
The Group Box example shows how to use the different kinds of group
\ingroup examples-widgets
\brief The Group Box example shows how to use the different kinds of group
boxes in Qt.
Group boxes are container widgets that organize buttons into groups,

View File

@ -28,11 +28,13 @@
/*!
\example widgets/icons
\title Icons Example
\ingroup examples-widgets
\brief The Icons example shows how QIcon can generate pixmaps reflecting
an icon's state, mode and size.
The Icons example shows how QIcon can generate pixmaps reflecting
an icon's state, mode and size. These pixmaps are generated from
the set of pixmaps made available to the icon, and are used by Qt
widgets to show an icon representing a particular action.
These pixmaps are generated from the set of pixmaps made available to the
icon, and are used by Qt widgets to show an icon representing a particular
action.
\image icons-example.png Screenshot of the Icons example

View File

@ -28,9 +28,11 @@
/*!
\example widgets/imageviewer
\title Image Viewer Example
\ingroup examples-widgets
\brief The example shows how to combine QLabel and QScrollArea to
display an image.
The example shows how to combine QLabel and QScrollArea to
display an image. QLabel is typically used for displaying text,
QLabel is typically used for displaying text,
but it can also display an image. QScrollArea provides a
scrolling view around another widget. If the child widget exceeds
the size of the frame, QScrollArea automatically provides scroll

View File

@ -28,10 +28,11 @@
/*!
\example widgets/lineedits
\title Line Edits Example
\ingroup examples-widgets
\brief The Line Edits example demonstrates the many ways that QLineEdit
can be used, and shows the effects of various properties and validators
on the input and output supplied by the user.
The Line Edits example demonstrates the many ways that QLineEdit can be used, and
shows the effects of various properties and validators on the input and output
supplied by the user.
\image lineedits-example.png

View File

@ -28,9 +28,11 @@
/*!
\example widgets/movie
\title Movie Example
\ingroup examples-widgets
\brief The Movie example demonstrates how to use QMovie and QLabel to
display animations.
The Movie example demonstrates how to use QMovie and QLabel to
display animations. QMovie is mostly useful if one wants to play
QMovie is mostly useful if one wants to play
a simple animation without the added complexity of a multimedia
framework to install and deploy.

View File

@ -28,8 +28,8 @@
/*!
\example widgets/scribble
\title Scribble Example
The Scribble example shows how to reimplement some of QWidget's
\ingroup examples-widgets
\brief The Scribble example shows how to reimplement some of QWidget's
event handlers to receive the events generated for the
application's widgets.

View File

@ -28,8 +28,8 @@
/*!
\example widgets/shapedclock
\title Shaped Clock Example
The Shaped Clock example shows how to apply a widget mask to a top-level
\ingroup examples-widgets
\brief The Shaped Clock example shows how to apply a widget mask to a top-level
widget to produce a shaped window.
\image shapedclock-example.png

View File

@ -28,6 +28,9 @@
/*!
\example widgets/sliders
\title Sliders Example
\ingroup examples-widgets
\brief The Sliders example shows how to use the different types of sliders
available in Qt: QSlider, QScrollBar and QDial.
Qt provides three types of slider-like widgets: QSlider,
QScrollBar and QDial. They all inherit most of their

View File

@ -28,10 +28,10 @@
/*!
\example widgets/spinboxes
\title Spin Boxes Example
The Spin Boxes example shows how to use the many different types of spin boxes
available in Qt, from a simple QSpinBox widget to more complex editors like
the QDateTimeEdit widget.
\ingroup examples-widgets
\brief The Spin Boxes example shows how to use the many different types of
spin boxes available in Qt, from a simple QSpinBox widget to more complex
editors like the QDateTimeEdit widget.
\image spinboxes-example.png

View File

@ -28,8 +28,8 @@
/*!
\example widgets/styles
\title Styles Example
The Styles example illustrates how to create custom widget
\ingroup examples-widgets
\brief The Styles example illustrates how to create custom widget
drawing styles using Qt, and demonstrates Qt's predefined styles.
\image styles-enabledwood.png Screenshot of the Styles example

View File

@ -28,8 +28,8 @@
/*!
\example widgets/stylesheet
\title Style Sheet Example
The Style Sheet Example shows how to use style sheets.
\ingroup examples-widgets
\brief The Style Sheet Example shows how to use style sheets.
\image stylesheet-pagefold.png Screen Shot of the Pagefold style sheet
*/

View File

@ -28,8 +28,8 @@
/*!
\example widgets/tablet
\title Tablet Example
This example shows how to use a Wacom tablet in Qt applications.
\ingroup examples-widgets
\brief This example shows how to use a Wacom tablet in Qt applications.
\image tabletexample.png

View File

@ -28,8 +28,8 @@
/*!
\example widgets/tetrix
\title Tetrix Example
The Tetrix example is a Qt version of the classic Tetrix game.
\ingroup examples-widgets
\brief The Tetrix example is a Qt version of the classic Tetrix game.
\image tetrix-example.png

View File

@ -28,8 +28,8 @@
/*!
\example widgets/tooltips
\title Tool Tips Example
The Tool Tips example shows how to provide static and dynamic tool
\ingroup examples-widgets
\brief The Tool Tips example shows how to provide static and dynamic tool
tips for an application's widgets.
The simplest and most common way to set a widget's tool tip is by

View File

@ -0,0 +1,34 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\example widgets/validators
\title Validators Example
\ingroup examples-widgets
\brief The Validators example shows the signal emission behavior of input
validators.
*/

View File

@ -28,8 +28,8 @@
/*!
\example widgets/wiggly
\title Wiggly Example
The Wiggly example shows how to animate a widget using
\ingroup examples-widgets
\brief The Wiggly example shows how to animate a widget using
QBasicTimer and \l{QObject::timerEvent()}{timerEvent()}. In
addition, the example demonstrates how to use QFontMetrics to
determine the size of text on screen.

View File

@ -28,8 +28,8 @@
/*!
\example widgets/windowflags
\title Window Flags Example
The Window Flags example shows how to use the window flags
\ingroup examples-widgets
\brief The Window Flags example shows how to use the window flags
available in Qt.
A window flag is either a type or a hint. A type is used to

View File

@ -59,7 +59,13 @@ QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST
!contains(QMAKE_EXTRA_TARGETS, docs) {
contains(TEMPLATE, subdirs) {
prepareRecursiveTarget(docs)
prepare_docs {
prepareRecursiveTarget(prepare_docs)
prepareRecursiveTarget(generate_docs)
docs.commands = $(MAKE) -f $(MAKEFILE) prepare_docs && $(MAKE) -f $(MAKEFILE) generate_docs
} else {
prepareRecursiveTarget(docs)
}
} else {
# apps and libs only generate docs if QMAKE_DOCS is set
!isEmpty(QMAKE_DOCS) {
@ -68,10 +74,19 @@ QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST
for(index, QMAKE_DOCS_INDEX):QDOC_INDEX += -indexdir $$index
!isEmpty(QMAKE_DOCS_OUTPUTDIR):QMAKE_DOCS_OPTIONS += -outputdir $$QMAKE_DOCS_OUTPUTDIR
!isEmpty(QMAKE_DOCS_INSTALLDIR):QMAKE_DOCS_OPTIONS += -installdir $$QMAKE_DOCS_INSTALLDIR
docs.commands += $$QDOC $$QMAKE_DOCS_OPTIONS $$QDOC_INDEX $$QMAKE_DOCS
doc_command = $$QDOC $$QMAKE_DOCS_OPTIONS $$QDOC_INDEX $$QMAKE_DOCS
prepare_docs {
prepare_docs.commands += $$doc_command -prepare -no-link-errors
generate_docs.commands += $$doc_command -generate
docs.depends += generate_docs
} else {
docs.commands += $$doc_command
}
}
}
QMAKE_EXTRA_TARGETS += docs
prepare_docs: QMAKE_EXTRA_TARGETS += prepare_docs generate_docs
}
!contains(QMAKE_EXTRA_TARGETS, install_docs) {

View File

@ -25,7 +25,7 @@ mac {
}
}
CONFIG += create_prl link_prl no_private_qt_headers_warning QTDIR_build
CONFIG += create_prl link_prl prepare_docs no_private_qt_headers_warning QTDIR_build
# Qt modules get compiled without exceptions enabled by default.
# However, testcases should be still built with exceptions.

View File

@ -1,33 +1,27 @@
include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtConcurrent
description = Qt Concurrent Reference Documentation
url = http://qt-project.org/doc/qt-5.0/qtconcurrent
url = http://qt-project.org/doc/qtconcurrent
version = 5.0.0
qhp.projects = QtConcurrent
qhp.QtConcurrent.file = qtconcurrent.qhp
qhp.QtConcurrent.namespace = org.qt-project.qtconcurrent.500
qhp.QtConcurrent.virtualFolder = qdoc
qhp.QtConcurrent.indexTitle = Qt Concurrent Reference Documentation
qhp.QtConcurrent.virtualFolder = qtconcurrent
qhp.QtConcurrent.indexTitle = Qt Concurrent
qhp.QtConcurrent.indexRoot =
qhp.QtConcurrent.filterAttributes = qtconcurrent 5.0.0 qtrefdoc
qhp.QtConcurrent.customFilters.Qt.name = QtConcurrent 5.0.0
qhp.QtConcurrent.customFilters.Qt.filterAttributes = qtconcurrent 5.0.0
qhp.QtConcurrent.subprojects = classes overviews examples
qhp.QtConcurrent.subprojects.classes.title = Classes
qhp.QtConcurrent.subprojects.classes.indexTitle = Qt Concurrent's Classes
qhp.QtConcurrent.subprojects = classes
qhp.QtConcurrent.subprojects.classes.title = C++ Classes
qhp.QtConcurrent.subprojects.classes.indexTitle = Qt Concurrent C++ Classes
qhp.QtConcurrent.subprojects.classes.selectors = class fake:headerfile
qhp.QtConcurrent.subprojects.classes.sortPages = true
qhp.QtConcurrent.subprojects.overviews.title = Overviews
qhp.QtConcurrent.subprojects.overviews.indexTitle = All Overviews and HOWTOs
qhp.QtConcurrent.subprojects.overviews.selectors = fake:page,group,module
qhp.QtConcurrent.subprojects.examples.title = Qt Concurrent Examples
qhp.QtConcurrent.subprojects.examples.indexTitle = Qt Concurrent Examples
qhp.QtConcurrent.subprojects.examples.selectors = fake:example
tagfile = ../../../doc/qtconcurrent/qtconcurrent.tags

View File

@ -1,37 +1,30 @@
include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtCore
description = Qt Core Reference Documentation
url = http://qt-project.org/doc/qt-5.0/qtcore
url = http://qt-project.org/doc/qtcore
version = 5.0.0
qhp.projects = QtCore
qhp.QtCore.file = qtcore.qhp
qhp.QtCore.namespace = org.qt-project.qtcore.500
qhp.QtCore.virtualFolder = qdoc
qhp.QtCore.indexTitle = Qt Core Reference Documentation
qhp.QtCore.virtualFolder = qtcore
qhp.QtCore.indexTitle = Qt Core
qhp.QtCore.indexRoot =
qhp.QtCore.filterAttributes = qtcore 5.0.0 qtrefdoc
qhp.QtCore.customFilters.Qt.name = QtCore 5.0.0
qhp.QtCore.customFilters.Qt.filterAttributes = qtcore 5.0.0
qhp.QtCore.subprojects = classes overviews examples
qhp.QtCore.subprojects.classes.title = Classes
qhp.QtCore.subprojects.classes.indexTitle = Qt Core's Classes
qhp.QtCore.subprojects = classes
qhp.QtCore.subprojects.classes.title = C++ Classes
qhp.QtCore.subprojects.classes.indexTitle = Qt Core C++ Classes
qhp.QtCore.subprojects.classes.selectors = class fake:headerfile
qhp.QtCore.subprojects.classes.sortPages = true
qhp.QtCore.subprojects.overviews.title = Overviews
qhp.QtCore.subprojects.overviews.indexTitle = All Overviews and HOWTOs
qhp.QtCore.subprojects.overviews.selectors = fake:page,group,module
qhp.QtCore.subprojects.examples.title = Qt Core Examples
qhp.QtCore.subprojects.examples.indexTitle = Qt Core Examples
qhp.QtCore.subprojects.examples.selectors = fake:example
tagfile = ../../../doc/qtcore/qtcore.tags
depends += qtwidgets
depends += qtgui qtwidgets qtnetwork qtdoc
headerdirs += ..

View File

@ -0,0 +1,109 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\page io-functions.html
\title File and Datastream Functions
The QIODevice class is the base interface class of all I/O devices in
\l {Qt Core}. QIODevice provides both a common implementation and an
abstract interface for devices that support reading and writing of blocks
of data. The device can be a memory buffer, a file, or a datastream.
Some subclasses like QFile have been implemented using a memory buffer for
intermediate storing of data. This speeds up programs by reducing
read/write operations. Buffering makes functions like getChar() and putChar()
fast, as they can operate on the memory buffer instead of directly on the
device itself.
The QFile class provides functions for reading from and writing to files.
A QFile may be used by itself or, more conveniently, with a QTextStream or
QDataStream.
QBuffer allows you to access a QByteArray using the QIODevice interface.
The QByteArray is treated just as a standard random-accessed file.
An example:
QBuffer buffer;
char ch;
buffer.open(QBuffer::ReadWrite);
buffer.write("Qt rocks!");
buffer.seek(0);
buffer.getChar(&ch); // ch == 'Q'
buffer.getChar(&ch); // ch == 't'
buffer.getChar(&ch); // ch == ' '
buffer.getChar(&ch); // ch == 'r'
Call open() to open the buffer. Then call write() or putChar() to write to
the buffer, and read(), readLine(), readAll(), or getChar() to read from it.
size() returns the current size of the buffer, and you can seek to arbitrary
positions in the buffer by calling seek(). When you are done with accessing
the buffer, call close().
The QDataStream class provides serialization of binary data to a QIODevice.
A data stream is a binary stream of encoded information which is 100% inde-
pendent of the host computer's operating system, CPU or byte order. For
example, a data stream that is written by a PC under Windows can be read
by a Sun SPARC running Solaris. You can also use a data stream to read/write
raw unencoded binary data.
For more details on the datatypes that QDataStream can serialize, see
{Serializing Qt Data Types}.
The QTextStream class provides a convenient interface for reading and
writing text. QTextStream can operate on a QIODevice, a QByteArray or
a QString. Using QTextStream's streaming operators, you can conveniently read
and write words, lines and numbers. It's also common to use QTextStream to
read console input and write console output.
There are three general ways to use QTextStream when reading text files:
\list
\li Chunk by chunk, by calling readLine() or readAll().
\li Word by word. QTextStream supports streaming into QStrings, QByteArrays
and char* buffers. Words are delimited by space, and leading white space
is automatically skipped.
\li Character by character, by streaming into QChar or char types. This
method is often used for convenient input handling when parsing files,
independent of character encoding and end-of-line semantics. To skip
white space, call skipWhiteSpace().
\endlist
QByteArray can be used to store both raw bytes (including \c{\0}) and traditional
8-bit '\\0'-terminated strings. Using QByteArray is much more convenient
than using const char *. It always ensures that the data is followed by a '\\0'
terminator, and uses \l{Implicit Sharing}{implicitly shared classes} (copy-on-write)
to reduce memory usage and avoid needless copying of data.
In addition to QByteArray, Qt also provides the QString class to store string
data. For most purposes, QString is the most appropriate class to use. It stores
16-bit Unicode characters. It is, however, a good idea to use QByteArray when you
need to store raw binary data, and when memory conservation is critical (for
example, with Qt for Embedded Linux).
*/

View File

@ -1,33 +1,27 @@
include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtDBus
description = Qt DBus Reference Documentation
url = http://qt-project.org/doc/qt-5.0/qtdbus
url = http://qt-project.org/doc/qtdbus
version = 5.0.0
qhp.projects = QtDBus
qhp.QtDBus.file = qtdbus.qhp
qhp.QtDBus.namespace = org.qt-project.qtdbus.500
qhp.QtDBus.virtualFolder = qdoc
qhp.QtDBus.indexTitle = Qt DBus Reference Documentation
qhp.QtDBus.virtualFolder = qtdbus
qhp.QtDBus.indexTitle = Qt D-Bus
qhp.QtDBus.indexRoot =
qhp.QtDBus.filterAttributes = qtdbus 5.0.0 qtrefdoc
qhp.QtDBus.customFilters.Qt.name = QtDBus 5.0.0
qhp.QtDBus.customFilters.Qt.filterAttributes = qtdbus 5.0.0
qhp.QtDBus.subprojects = classes overviews examples
qhp.QtDBus.subprojects.classes.title = Classes
qhp.QtDBus.subprojects.classes.indexTitle = Qt DBus' Classes
qhp.QtDBus.subprojects = classes
qhp.QtDBus.subprojects.classes.title = C++ Classes
qhp.QtDBus.subprojects.classes.indexTitle = Qt D-Bus C++ Classes
qhp.QtDBus.subprojects.classes.selectors = class fake:headerfile
qhp.QtDBus.subprojects.classes.sortPages = true
qhp.QtDBus.subprojects.overviews.title = Overviews
qhp.QtDBus.subprojects.overviews.indexTitle = All Overviews and HOWTOs
qhp.QtDBus.subprojects.overviews.selectors = fake:page,group,module
qhp.QtDBus.subprojects.examples.title = Qt DBus Examples
qhp.QtDBus.subprojects.examples.indexTitle = Qt DBus Examples
qhp.QtDBus.subprojects.examples.selectors = fake:example
tagfile = ../../../doc/qtdbus/qtdbus.tags

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@ -1,37 +1,39 @@
include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtGui
description = Qt GUI Reference Documentation
url = http://qt-project.org/doc/qt-5.0/qtgui
url = http://qt-project.org/doc/qtgui
version = 5.0.0
qhp.projects = QtGui
qhp.QtGui.file = qtgui.qhp
qhp.QtGui.namespace = org.qt-project.qtgui.500
qhp.QtGui.virtualFolder = qdoc
qhp.QtGui.indexTitle = Qt GUI Reference Documentation
qhp.QtGui.virtualFolder = qtgui
qhp.QtGui.indexTitle = Qt GUI
qhp.QtGui.indexRoot =
qhp.QtGui.filterAttributes = qtgui 5.0.0 qtrefdoc
qhp.QtGui.customFilters.Qt.name = Qtgui 5.0.0
qhp.QtGui.customFilters.Qt.filterAttributes = qtgui 5.0.0
qhp.QtGui.subprojects = classes overviews examples
qhp.QtGui.subprojects.classes.title = Classes
qhp.QtGui.subprojects.classes.indexTitle = Qt GUI's Classes
qhp.QtGui.subprojects = classes
qhp.QtGui.subprojects.classes.title = C++ Classes
qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ Classes
qhp.QtGui.subprojects.classes.selectors = class fake:headerfile
qhp.QtGui.subprojects.classes.sortPages = true
qhp.QtGui.subprojects.overviews.title = Overviews
qhp.QtGui.subprojects.overviews.indexTitle = All Overviews and HOWTOs
qhp.QtGui.subprojects.overviews.selectors = fake:page,group,module
qhp.QtGui.subprojects.examples.title = Qt GUI Examples
qhp.QtGui.subprojects.examples.indexTitle = Qt GUI Examples
qhp.QtGui.subprojects.examples.selectors = fake:example
tagfile = ../../../doc/qtgui/qtgui.tags
depends += qtcore
depends += \
qtcore \
qtnetwork \
qtopengl \
qtsvg \
qtqml \
qtquickt \
qtwidgets \
qtdoc
headerdirs += ..

View File

@ -0,0 +1,85 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
//! [0]
QTextDocument *newDocument = new QTextDocument;
//! [0]
//! [1]
QTextEdit *editor = new QTextEdit;
QTextDocument *editorDocument = editor->document();
//! [1]
//! [2]
QTextEdit *editor = new QTextEdit(parent);
editor->setHtml(aStringContainingHTMLtext);
editor->show();
//! [2]
//! [3]
QTextDocument *document = editor->document();
//! [3]
//! [4]
QTextCursor cursor = editor->textCursor();
//! [4]
//! [5]
editor->setTextCursor(cursor);
//! [5]
//! [6]
textEdit.show();
textCursor.beginEditBlock();
for (int i = 0; i < 1000; ++i) {
textCursor.insertBlock();
textCursor.insertText(paragraphText.at(i));
}
textCursor.endEditBlock();
//! [6]

View File

@ -0,0 +1,43 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
//! [7]
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
//! [7]

View File

@ -0,0 +1,52 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
#include "window.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window *window = new Window;
window->resize(337, 343);
window->show();
return app.exec();
}

View File

@ -0,0 +1,3 @@
HEADERS = window.h
SOURCES = main.cpp \
window.cpp

View File

@ -0,0 +1,108 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
#include <math.h>
#include "window.h"
Window::Window(QWidget *parent)
: QWidget(parent)
{
text = QString("Support for text rendering and layout in Qt 4 has been "
"redesigned around a system that allows textual content to "
"be represented in a more flexible way than was possible "
"with Qt 3. Qt 4 also provides a more convenient "
"programming interface for editing documents. These "
"improvements are made available through a reimplementation "
"of the existing text rendering engine, and the "
"introduction of several new classes. "
"See the relevant module overview for a detailed discussion "
"of this framework. The following sections provide a brief "
"overview of the main concepts behind Scribe.");
setWindowTitle(tr("Plain Text Layout"));
}
void Window::paintEvent(QPaintEvent *event)
{
//! [0]
QTextLayout textLayout(text, font);
qreal margin = 10;
qreal radius = qMin(width()/2.0, height()/2.0) - margin;
QFontMetrics fm(font);
qreal lineHeight = fm.height();
qreal y = 0;
textLayout.beginLayout();
while (1) {
// create a new line
QTextLine line = textLayout.createLine();
if (!line.isValid())
break;
qreal x1 = qMax(0.0, pow(pow(radius,2)-pow(radius-y,2), 0.5));
qreal x2 = qMax(0.0, pow(pow(radius,2)-pow(radius-(y+lineHeight),2), 0.5));
qreal x = qMax(x1, x2) + margin;
qreal lineWidth = (width() - margin) - x;
line.setLineWidth(lineWidth);
line.setPosition(QPointF(x, margin+y));
y += line.height();
}
textLayout.endLayout();
QPainter painter;
painter.begin(this);
painter.setRenderHint(QPainter::Antialiasing);
painter.fillRect(rect(), Qt::white);
painter.setBrush(QBrush(Qt::black));
painter.setPen(QPen(Qt::black));
textLayout.draw(&painter, QPoint(0,0));
painter.setBrush(QBrush(QColor("#a6ce39")));
painter.setPen(QPen(Qt::black));
painter.drawEllipse(QRectF(-radius, margin, 2*radius, 2*radius));
painter.end();
//! [0]
}

View File

@ -0,0 +1,61 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef WINDOW_H
#define WINDOW_H
#include <QWidget>
class Window : public QWidget
{
Q_OBJECT
public:
Window(QWidget *parent = 0);
protected:
void paintEvent(QPaintEvent *event);
private:
QFont font;
QString text;
};
#endif

View File

@ -0,0 +1,73 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
void mergeFormat(QTextEdit *edit)
{
//! [0]
QTextDocument *document = edit->document();
QTextCursor cursor(document);
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);
QTextCharFormat format;
format.setFontWeight(QFont::Bold);
cursor.mergeCharFormat(format);
//! [0]
}
int main(int argc, char *argv[])
{
QWidget *parent = 0;
QString aStringContainingHTMLtext("<h1>Scribe Overview</h1>");
QApplication app(argc, argv);
//! [1]
QTextEdit *editor = new QTextEdit(parent);
editor->setHtml(aStringContainingHTMLtext);
editor->show();
//! [1]
return app.exec();
}

View File

@ -0,0 +1 @@
SOURCES = main.cpp

View File

@ -0,0 +1,118 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
QString tr(const char *text)
{
return QApplication::translate(text, text);
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
//! [0]
QTextEdit *editor = new QTextEdit();
QTextCursor cursor(editor->textCursor());
//! [0]
cursor.movePosition(QTextCursor::Start);
QTextBlockFormat blockFormat = cursor.blockFormat();
blockFormat.setTopMargin(4);
blockFormat.setLeftMargin(4);
blockFormat.setRightMargin(4);
blockFormat.setBottomMargin(4);
cursor.setBlockFormat(blockFormat);
cursor.insertText(tr("This contains plain text inside a "
"text block with margins to keep it separate "
"from other parts of the document."));
cursor.insertBlock();
//! [1]
QTextBlockFormat backgroundFormat = blockFormat;
backgroundFormat.setBackground(QColor("lightGray"));
cursor.setBlockFormat(backgroundFormat);
//! [1]
cursor.insertText(tr("The background color of a text block can be "
"changed to highlight text."));
cursor.insertBlock();
QTextBlockFormat rightAlignedFormat = blockFormat;
rightAlignedFormat.setAlignment(Qt::AlignRight);
cursor.setBlockFormat(rightAlignedFormat);
cursor.insertText(tr("The alignment of the text within a block is "
"controlled by the alignment properties of "
"the block itself. This text block is "
"right-aligned."));
cursor.insertBlock();
QTextBlockFormat paragraphFormat = blockFormat;
paragraphFormat.setAlignment(Qt::AlignJustify);
paragraphFormat.setTextIndent(32);
cursor.setBlockFormat(paragraphFormat);
cursor.insertText(tr("Text can be formatted so that the first "
"line in a paragraph has its own margin. "
"This makes the text more readable."));
cursor.insertBlock();
QTextBlockFormat reverseFormat = blockFormat;
reverseFormat.setAlignment(Qt::AlignJustify);
reverseFormat.setTextIndent(32);
cursor.setBlockFormat(reverseFormat);
cursor.insertText(tr("The direction of the text can be reversed. "
"This is useful for right-to-left "
"languages."));
editor->setWindowTitle(tr("Text Block Formats"));
editor->resize(480, 480);
editor->show();
return app.exec();
}

View File

@ -0,0 +1,2 @@
QT += xml
SOURCES = main.cpp

View File

@ -0,0 +1,52 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow *window = new MainWindow;
window->resize(640, 480);
window->show();
return app.exec();
}

View File

@ -0,0 +1,148 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
#include "mainwindow.h"
#include "xmlwriter.h"
MainWindow::MainWindow()
{
QMenu *fileMenu = new QMenu(tr("&File"));
QAction *saveAction = fileMenu->addAction(tr("&Save..."));
saveAction->setShortcut(tr("Ctrl+S"));
QAction *quitAction = fileMenu->addAction(tr("E&xit"));
quitAction->setShortcut(tr("Ctrl+Q"));
QMenu *insertMenu = new QMenu(tr("&Insert"));
QAction *calendarAction = insertMenu->addAction(tr("&Calendar"));
calendarAction->setShortcut(tr("Ctrl+I"));
menuBar()->addMenu(fileMenu);
menuBar()->addMenu(insertMenu);
editor = new QTextEdit(this);
connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile()));
connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
connect(calendarAction, SIGNAL(triggered()), this, SLOT(insertCalendar()));
setCentralWidget(editor);
setWindowTitle(tr("Text Document Writer"));
}
void MainWindow::saveFile()
{
QString fileName = QFileDialog::getSaveFileName(this,
tr("Save document as:"), "", tr("XML (*.xml)"));
if (!fileName.isEmpty()) {
if (writeXml(fileName))
setWindowTitle(fileName);
else
QMessageBox::warning(this, tr("Warning"),
tr("Failed to save the document."), QMessageBox::Cancel,
QMessageBox::NoButton);
}
}
void MainWindow::insertCalendar()
{
QTextCursor cursor(editor->textCursor());
cursor.movePosition(QTextCursor::Start);
QTextCharFormat format(cursor.charFormat());
format.setFontFamily("Courier");
QTextCharFormat boldFormat = format;
boldFormat.setFontWeight(QFont::Bold);
cursor.insertBlock();
cursor.insertText(" ", boldFormat);
QDate date = QDate::currentDate();
int year = date.year(), month = date.month();
for (int weekDay = 1; weekDay <= 7; ++weekDay) {
cursor.insertText(QString("%1 ").arg(QDate::shortDayName(weekDay), 3),
boldFormat);
}
cursor.insertBlock();
cursor.insertText(" ", format);
for (int column = 1; column < QDate(year, month, 1).dayOfWeek(); ++column) {
cursor.insertText(" ", format);
}
for (int day = 1; day <= date.daysInMonth(); ++day) {
int weekDay = QDate(year, month, day).dayOfWeek();
if (QDate(year, month, day) == date)
cursor.insertText(QString("%1 ").arg(day, 3), boldFormat);
else
cursor.insertText(QString("%1 ").arg(day, 3), format);
if (weekDay == 7) {
cursor.insertBlock();
cursor.insertText(" ", format);
}
}
}
bool MainWindow::writeXml(const QString &fileName)
{
XmlWriter documentWriter(editor->document());
QDomDocument *domDocument = documentWriter.toXml();
QFile file(fileName);
if (file.open(QFile::WriteOnly)) {
QTextStream textStream(&file);
textStream << domDocument->toByteArray(1);
return true;
}
else
return false;
}

View File

@ -0,0 +1,65 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef WINDOW_H
#define WINDOW_H
#include <QMainWindow>
class QTextEdit;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow();
public slots:
void insertCalendar();
void saveFile();
private:
bool writeXml(const QString &fileName);
QTextEdit *editor;
};
#endif

View File

@ -0,0 +1,6 @@
QT += xml
HEADERS = mainwindow.h \
xmlwriter.h
SOURCES = main.cpp \
mainwindow.cpp \
xmlwriter.cpp

View File

@ -0,0 +1,64 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef XMLWRITER_H
#define XMLWRITER_H
#include <QDomDocument>
class QTextDocument;
class XmlWriter
{
public:
XmlWriter(QTextDocument *document) : textDocument(document) {}
QDomDocument *toXml();
private:
void readFragment(const QTextBlock &currentBlock, QDomElement blockElement,
QDomDocument *document);
void processBlock(const QTextBlock &currentBlock);
void processFragment(const QTextFragment &currentFragment);
QDomDocument *document;
QTextDocument *textDocument;
};
#endif

View File

@ -0,0 +1,52 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow *window = new MainWindow;
window->resize(640, 480);
window->show();
return app.exec();
}

View File

@ -0,0 +1,156 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
#include "mainwindow.h"
#include "xmlwriter.h"
MainWindow::MainWindow()
{
QMenu *fileMenu = new QMenu(tr("&File"));
QAction *saveAction = fileMenu->addAction(tr("&Save..."));
saveAction->setShortcut(tr("Ctrl+S"));
QAction *quitAction = fileMenu->addAction(tr("E&xit"));
quitAction->setShortcut(tr("Ctrl+Q"));
QMenu *insertMenu = new QMenu(tr("&Insert"));
QAction *calendarAction = insertMenu->addAction(tr("&Calendar"));
calendarAction->setShortcut(tr("Ctrl+I"));
menuBar()->addMenu(fileMenu);
menuBar()->addMenu(insertMenu);
//! [0]
editor = new QTextEdit(this);
//! [0]
connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile()));
connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
connect(calendarAction, SIGNAL(triggered()), this, SLOT(insertCalendar()));
setCentralWidget(editor);
setWindowTitle(tr("Text Document Writer"));
}
void MainWindow::saveFile()
{
QString fileName = QFileDialog::getSaveFileName(this,
tr("Save document as:"), "", tr("XML (*.xml)"));
if (!fileName.isEmpty()) {
if (writeXml(fileName))
setWindowTitle(fileName);
else
QMessageBox::warning(this, tr("Warning"),
tr("Failed to save the document."), QMessageBox::Cancel,
QMessageBox::NoButton);
}
}
void MainWindow::insertCalendar()
{
//! [1]
QTextCursor cursor(editor->textCursor());
cursor.movePosition(QTextCursor::Start);
QTextCharFormat format(cursor.charFormat());
format.setFontFamily("Courier");
QTextCharFormat boldFormat = format;
boldFormat.setFontWeight(QFont::Bold);
cursor.insertBlock();
cursor.insertText(" ", boldFormat);
QDate date = QDate::currentDate();
int year = date.year(), month = date.month();
for (int weekDay = 1; weekDay <= 7; ++weekDay) {
cursor.insertText(QString("%1 ").arg(QDate::shortDayName(weekDay), 3),
boldFormat);
}
cursor.insertBlock();
cursor.insertText(" ", format);
for (int column = 1; column < QDate(year, month, 1).dayOfWeek(); ++column) {
cursor.insertText(" ", format);
}
for (int day = 1; day <= date.daysInMonth(); ++day) {
//! [1] //! [2]
int weekDay = QDate(year, month, day).dayOfWeek();
if (QDate(year, month, day) == date)
cursor.insertText(QString("%1 ").arg(day, 3), boldFormat);
else
cursor.insertText(QString("%1 ").arg(day, 3), format);
if (weekDay == 7) {
cursor.insertBlock();
cursor.insertText(" ", format);
}
//! [2] //! [3]
}
//! [3]
}
bool MainWindow::writeXml(const QString &fileName)
{
XmlWriter documentWriter(editor->document());
QDomDocument *domDocument = documentWriter.toXml();
QFile file(fileName);
if (file.open(QFile::WriteOnly)) {
QTextStream textStream(&file);
textStream.setCodec(QTextCodec::codecForName("UTF-8"));
textStream << domDocument->toString(1).toUtf8();
file.close();
return true;
}
else
return false;
}

View File

@ -0,0 +1,65 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef WINDOW_H
#define WINDOW_H
#include <QMainWindow>
class QTextEdit;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow();
public slots:
void insertCalendar();
void saveFile();
private:
bool writeXml(const QString &fileName);
QTextEdit *editor;
};
#endif

View File

@ -0,0 +1,6 @@
QT += xml
HEADERS = mainwindow.h \
xmlwriter.h
SOURCES = main.cpp \
mainwindow.cpp \
xmlwriter.cpp

View File

@ -0,0 +1,84 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
#include "xmlwriter.h"
QDomDocument *XmlWriter::toXml()
{
QDomImplementation implementation;
QDomDocumentType docType = implementation.createDocumentType(
"scribe-document", "scribe", "qt.nokia.com/scribe");
document = new QDomDocument(docType);
// ### This processing instruction is required to ensure that any kind
// of encoding is given when the document is written.
QDomProcessingInstruction process = document->createProcessingInstruction(
"xml", "version=\"1.0\" encoding=\"utf-8\"");
document->appendChild(process);
QDomElement documentElement = document->createElement("document");
document->appendChild(documentElement);
QTextBlock firstBlock = textDocument->begin();
createItems(documentElement, firstBlock);
return document;
}
void XmlWriter::createItems(QDomElement &parent, const QTextBlock &block)
{
QTextBlock currentBlock = block;
while (currentBlock.isValid()) {
QDomElement blockElement = document->createElement("block");
blockElement.setAttribute("length", currentBlock.length());
parent.appendChild(blockElement);
if (!(currentBlock.text().isNull())) {
QDomText textNode = document->createTextNode(currentBlock.text());
blockElement.appendChild(textNode);
}
currentBlock = currentBlock.next();
}
}

View File

@ -0,0 +1,61 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef XMLWRITER_H
#define XMLWRITER_H
#include <QDomDocument>
class QTextDocument;
class XmlWriter
{
public:
XmlWriter(QTextDocument *document) : textDocument(document) {}
QDomDocument *toXml();
private:
void createItems(QDomElement &parent, const QTextBlock &block);
QDomDocument *document;
QTextDocument *textDocument;
};
#endif

View File

@ -0,0 +1,92 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
QString tr(const char *text)
{
return QApplication::translate(text, text);
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QTextEdit *editor = new QTextEdit();
QTextCursor cursor(editor->textCursor());
cursor.movePosition(QTextCursor::Start);
QTextCharFormat plainFormat(cursor.charFormat());
QTextCharFormat headingFormat = plainFormat;
headingFormat.setFontWeight(QFont::Bold);
headingFormat.setFontPointSize(16);
QTextCharFormat emphasisFormat = plainFormat;
emphasisFormat.setFontItalic(true);
QTextCharFormat qtFormat = plainFormat;
qtFormat.setForeground(QColor("#990000"));
QTextCharFormat underlineFormat = plainFormat;
underlineFormat.setFontUnderline(true);
//! [0]
cursor.insertText(tr("Character formats"),
headingFormat);
cursor.insertBlock();
cursor.insertText(tr("Text can be displayed in a variety of "
"different character formats. "), plainFormat);
cursor.insertText(tr("We can emphasize text by "));
cursor.insertText(tr("making it italic"), emphasisFormat);
//! [0]
cursor.insertText(tr(", give it a "), plainFormat);
cursor.insertText(tr("different color "), qtFormat);
cursor.insertText(tr("to the default text color, "), plainFormat);
cursor.insertText(tr("underline it"), underlineFormat);
cursor.insertText(tr(", and use many other effects."), plainFormat);
editor->setWindowTitle(tr("Text Document Character Formats"));
editor->resize(320, 480);
editor->show();
return app.exec();
}

View File

@ -0,0 +1 @@
SOURCES = main.cpp

Some files were not shown because too many files have changed in this diff Show More