diff options
Diffstat (limited to 'doc/src/snippets')
-rw-r--r-- | doc/src/snippets/code/doc_src_coordsys.cpp | 87 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_qt4-mainwindow.cpp | 110 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_resources.cpp | 54 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_resources.qdoc | 65 | ||||
-rw-r--r-- | doc/src/snippets/code/src_gui_embedded_qcopchannel_qws.cpp | 66 | ||||
-rw-r--r-- | doc/src/snippets/code/src_gui_embedded_qmouse_qws.cpp | 44 | ||||
-rw-r--r-- | doc/src/snippets/code/src_gui_embedded_qmousetslib_qws.cpp | 49 | ||||
-rw-r--r-- | doc/src/snippets/code/src_gui_embedded_qscreen_qws.cpp | 48 | ||||
-rw-r--r-- | doc/src/snippets/code/src_gui_embedded_qtransportauth_qws.cpp | 87 | ||||
-rw-r--r-- | doc/src/snippets/code/src_gui_embedded_qwindowsystem_qws.cpp | 85 | ||||
-rw-r--r-- | doc/src/snippets/dockwidgets/mainwindow.cpp | 122 | ||||
-rw-r--r-- | doc/src/snippets/widgets-tutorial/template.cpp | 56 |
12 files changed, 0 insertions, 873 deletions
diff --git a/doc/src/snippets/code/doc_src_coordsys.cpp b/doc/src/snippets/code/doc_src_coordsys.cpp deleted file mode 100644 index b677d28a50..0000000000 --- a/doc/src/snippets/code/doc_src_coordsys.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 Nokia Corporation 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] -QPainter painter(this); - -painter.setPen(Qt::darkGreen); -painter.drawRect(1, 2, 6, 4); -//! [0] - - -//! [1] -QPainter painter(this); - -painter.setPen(Qt::darkGreen); -painter.drawLine(2, 7, 6, 1); -//! [1] - - -//! [2] -QPainter painter(this); -painter.setRenderHint( - QPainter::Antialiasing); -painter.setPen(Qt::darkGreen); -painter.drawRect(1, 2, 6, 4); -//! [2] - - -//! [3] -QPainter painter(this); -painter.setRenderHint( - QPainter::Antialiasing); -painter.setPen(Qt::darkGreen); -painter.drawLine(2, 7, 6, 1); -//! [3] - - -//! [4] -QPainter painter(this); -painter.setWindow(QRect(-50, -50, 100, 100)); -//! [4] - - -//! [5] -int side = qMin(width(), height()) -int x = (width() - side / 2); -int y = (height() - side / 2); - -painter.setViewport(x, y, side, side); -//! [5] diff --git a/doc/src/snippets/code/doc_src_qt4-mainwindow.cpp b/doc/src/snippets/code/doc_src_qt4-mainwindow.cpp deleted file mode 100644 index ecbb5f5220..0000000000 --- a/doc/src/snippets/code/doc_src_qt4-mainwindow.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 Nokia Corporation 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] -MainWindow::MainWindow(QWidget *parent) - : QMainWindow(parent) -{ -//! [0] - - -//! [1] -fileToolbar->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea); -addToolBar(Qt::TopToolBarArea, fileToolbar); -//! [1] - - -//! [2] -setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); -setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); -setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea); -setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); -//! [2] - - -//! [3] -QWidget *centralWidget = new QWidget(this); -setCentralWidget(centralWidget); -//! [3] - - -//! [4] -QPopupMenu *fileMenu = new QPopupMenu(this); -openAction->addTo(fileMenu); -saveAction->addTo(fileMenu); -... -menuBar()->insertItem(tr("&File"), fileMenu); -//! [4] - - -//! [5] -QMenu *fileMenu = menuBar()->addMenu(tr("&File")); -fileMenu->addAction(openAction); -fileMenu->addAction(saveAction); -... -//! [5] - - -//! [6] -QToolBar *fileTools = new QToolBar(this, "file toolbar"); -openAction->addTo(fileTools); -saveAction->addTo(fileTools); -... -//! [6] - - -//! [7] -QToolBar *fileTools = addToolBar(tr("File Tool Bar")); -fileTools->addAction(openAction); -fileTools->addAction(saveAction); -... -//! [7] - - -//! [8] -QDockWidget *dockWidget = new QDockWidget(this); -mainWin->moveDockWidget(dockWidget, Qt::DockLeft); -//! [8] - - -//! [9] -QDockWidget *dockWidget = new QDockWidget(mainWindow); -mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dockWidget); -//! [9] diff --git a/doc/src/snippets/code/doc_src_resources.cpp b/doc/src/snippets/code/doc_src_resources.cpp deleted file mode 100644 index f401add728..0000000000 --- a/doc/src/snippets/code/doc_src_resources.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 Nokia Corporation 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$ -** -****************************************************************************/ - -//! [4] -QResource::registerResource("/path/to/myresource.rcc"); -//! [4] - - -//! [5] -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - Q_INIT_RESOURCE(graphlib); - ... - return app.exec(); -} -//! [5] diff --git a/doc/src/snippets/code/doc_src_resources.qdoc b/doc/src/snippets/code/doc_src_resources.qdoc deleted file mode 100644 index c51dbbcbf3..0000000000 --- a/doc/src/snippets/code/doc_src_resources.qdoc +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 Nokia Corporation 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] -<file alias="cut-img.png">images/cut.png</file> -//! [0] - - -//! [1] -<qresource prefix="/myresources"> - <file alias="cut-img.png">images/cut.png</file> -</qresource> -//! [1] - - -//! [2] -<qresource> - <file>cut.jpg</file> -</qresource> -<qresource lang="fr"> - <file alias="cut.jpg">cut_fr.jpg</file> -</qresource> -//! [2] - - -//! [3] -rcc -binary myresource.qrc -o myresource.rcc -//! [3] diff --git a/doc/src/snippets/code/src_gui_embedded_qcopchannel_qws.cpp b/doc/src/snippets/code/src_gui_embedded_qcopchannel_qws.cpp deleted file mode 100644 index 76b958dda3..0000000000 --- a/doc/src/snippets/code/src_gui_embedded_qcopchannel_qws.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 Nokia Corporation 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] -void MyClass::receive(const QString &message, const QByteArray &data) -{ - QDataStream in(data); - if (message == "execute(QString,QString)") { - QString cmd; - QString arg; - in >> cmd >> arg; - ... - } else if (message == "delete(QString)") { - QString fileName; - in >> fileName; - ... - } else { - ... - } -} -//! [0] - - -//! [1] -QByteArray data; -QDataStream out(&data, QIODevice::WriteOnly); -out << QString("cat") << QString("file.txt"); -QCopChannel::send("System/Shell", "execute(QString,QString)", data); -//! [1] diff --git a/doc/src/snippets/code/src_gui_embedded_qmouse_qws.cpp b/doc/src/snippets/code/src_gui_embedded_qmouse_qws.cpp deleted file mode 100644 index 8fc6140075..0000000000 --- a/doc/src/snippets/code/src_gui_embedded_qmouse_qws.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 Nokia Corporation 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] -s*Xs = a*Xd + b*Yd + c -s*Ys = d*Xd + e*Yd + f -//! [0] diff --git a/doc/src/snippets/code/src_gui_embedded_qmousetslib_qws.cpp b/doc/src/snippets/code/src_gui_embedded_qmousetslib_qws.cpp deleted file mode 100644 index 7a2eee142e..0000000000 --- a/doc/src/snippets/code/src_gui_embedded_qmousetslib_qws.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 Nokia Corporation 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] -configure -L <path to tslib library> -I <path to tslib headers> -//! [0] - - -//! [1] -module_raw input -module linear -//! [1] diff --git a/doc/src/snippets/code/src_gui_embedded_qscreen_qws.cpp b/doc/src/snippets/code/src_gui_embedded_qscreen_qws.cpp deleted file mode 100644 index 99be26133e..0000000000 --- a/doc/src/snippets/code/src_gui_embedded_qscreen_qws.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 Nokia Corporation 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] -[screen driver][:driver specific options][:display number] -//! [0] - - -//! [1] -Mach64:/dev/fb1:2 -//! [1] diff --git a/doc/src/snippets/code/src_gui_embedded_qtransportauth_qws.cpp b/doc/src/snippets/code/src_gui_embedded_qtransportauth_qws.cpp deleted file mode 100644 index e73ee2ed0a..0000000000 --- a/doc/src/snippets/code/src_gui_embedded_qtransportauth_qws.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 Nokia Corporation 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$ -** -****************************************************************************/ - - -void wrapInFunction() -{ - -//! [0] -QTransportAuth::Data *conData; -QTransportAuth *a = QTransportAuth::getInstance(); - -conData = a->connectTransport( - QTransportAuth::Trusted | QTransportAuth::UnixStreamSock, - socketDescriptor ); -//! [0] - - -//! [1] -// mySocket can be any QIODevice subclass -AuthDevice *ad = a->recvBuf( d, mySocket ); - -// proxy in the auth device where the socket would have gone -connect( ad, SIGNAL(readyRead()), this, SLOT(mySocketReadyRead())); -//! [1] - - -//! [2] -AuthDevice *ad = a->authBuf( d, mySocket ); - -ad->write( someData ); -//! [2] - - -//! [3] -policyCheck( QTransportAuth::Data &, const QString & ) -//! [3] - - -//! [4] -QTransportAuth::Result r = d.status & QTransportAuth::ErrMask; -qWarning( "error: %s", QTransportAuth::errorStrings[r] ); -//! [4] - - -//! [5] -MD5(K XOR opad, MD5(K XOR ipad, text)) -//! [5] - -} - diff --git a/doc/src/snippets/code/src_gui_embedded_qwindowsystem_qws.cpp b/doc/src/snippets/code/src_gui_embedded_qwindowsystem_qws.cpp deleted file mode 100644 index 66308f3405..0000000000 --- a/doc/src/snippets/code/src_gui_embedded_qwindowsystem_qws.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 Nokia Corporation 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] -bool MyScreenSaver::save( int level ) -{ - switch ( level ) { - case 0: - if ( dim_enabled ) { - // dim the screen - } - return true; - case 1: - if ( screenoff_enabled ) { - // turn off the screen - } - return true; - case 2: - if ( suspend_enabled ) { - // suspend - } - return true; - default: - return false; - } -} - -... - -int timings[4]; -timings[0] = 5000; // dim after 5 seconds -timings[1] = 10000; // light off after 15 seconds -timings[2] = 45000; // suspend after 60 seconds -timings[3] = 0; -QWSServer::setScreenSaverIntervals( timings ); - -// ignore the key/mouse event that turns on the screen -int blocklevel = 1; -if ( !screenoff_enabled ) { - // screenoff is disabled, ignore the key/mouse event that wakes from suspend - blocklevel = 2; - if ( !suspend_enabled ) { - // suspend is disabled, never ignore events - blocklevel = -1; - } -} -QWSServer::setScreenSaverBlockLevel( blocklevel ); -//! [0] diff --git a/doc/src/snippets/dockwidgets/mainwindow.cpp b/doc/src/snippets/dockwidgets/mainwindow.cpp deleted file mode 100644 index 882af70b64..0000000000 --- a/doc/src/snippets/dockwidgets/mainwindow.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 Nokia Corporation 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" - -MainWindow::MainWindow(QWidget *parent) - : QMainWindow(parent) -{ - setWindowTitle("Dock Widgets"); - - setupDockWindow(); - setupContents(); - setupMenus(); - - textBrowser = new QTextBrowser(this); - - connect(headingList, SIGNAL(itemClicked(QListWidgetItem *)), - this, SLOT(updateText(QListWidgetItem *))); - - updateText(headingList->item(0)); - headingList->setCurrentRow(0); - setCentralWidget(textBrowser); -} - -void MainWindow::setupContents() -{ - QFile titlesFile(":/Resources/titles.txt"); - titlesFile.open(QFile::ReadOnly); - int chapter = 0; - - do { - QString line = titlesFile.readLine().trimmed(); - QStringList parts = line.split("\t", QString::SkipEmptyParts); - if (parts.size() != 2) - break; - - QString chapterTitle = parts[0]; - QString fileName = parts[1]; - - QFile chapterFile(fileName); - - chapterFile.open(QFile::ReadOnly); - QListWidgetItem *item = new QListWidgetItem(chapterTitle, headingList); - item->setData(Qt::DisplayRole, chapterTitle); - item->setData(Qt::UserRole, chapterFile.readAll()); - item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); - chapterFile.close(); - - chapter++; - } while (titlesFile.isOpen()); - - titlesFile.close(); -} - -void MainWindow::setupDockWindow() -{ -//! [0] - contentsWindow = new QDockWidget(tr("Table of Contents"), this); - contentsWindow->setAllowedAreas(Qt::LeftDockWidgetArea - | Qt::RightDockWidgetArea); - addDockWidget(Qt::LeftDockWidgetArea, contentsWindow); - - headingList = new QListWidget(contentsWindow); - contentsWindow->setWidget(headingList); -//! [0] -} - -void MainWindow::setupMenus() -{ - QAction *exitAct = new QAction(tr("E&xit"), this); - exitAct->setShortcut(tr("Ctrl+Q")); - exitAct->setStatusTip(tr("Exit the application")); - connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows())); - - QMenu *fileMenu = menuBar()->addMenu(tr("&File")); - fileMenu->addAction(exitAct); -} - -void MainWindow::updateText(QListWidgetItem *item) -{ - QString text = item->data(Qt::UserRole).toString(); - textBrowser->setHtml(text); -} diff --git a/doc/src/snippets/widgets-tutorial/template.cpp b/doc/src/snippets/widgets-tutorial/template.cpp deleted file mode 100644 index 187952d44d..0000000000 --- a/doc/src/snippets/widgets-tutorial/template.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 Nokia Corporation 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$ -** -****************************************************************************/ - -//! [main.cpp body] -#include <QtGui> - -// Include header files for application components. -// ... - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - // Set up and show widgets. - // ... - - return app.exec(); -} -//! [main.cpp body] |