From 377ef06aefd66c67c8d65d9e3cb3137b506c6014 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 30 Sep 2014 17:04:41 +0200 Subject: Doc: fix misleading documentation of QProcess::set[Process]Environment The example suggested that QProcess searches the PATH variable to find the executable for the child process. That's not true. The environment that's passed with setProcessEnvironment is just passed to the child process. Removed the misleading example and fixed the function's description. Task-number: QTBUG-7321 Change-Id: I8ac4b6b02002eb0a99686f09bcf45f9bc677c8e2 Reviewed-by: Oswald Buddenhagen Reviewed-by: Leena Miettinen --- src/corelib/doc/snippets/qprocess-environment/main.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/corelib/doc/snippets') diff --git a/src/corelib/doc/snippets/qprocess-environment/main.cpp b/src/corelib/doc/snippets/qprocess-environment/main.cpp index d858746889..2e078eea6d 100644 --- a/src/corelib/doc/snippets/qprocess-environment/main.cpp +++ b/src/corelib/doc/snippets/qprocess-environment/main.cpp @@ -47,7 +47,6 @@ void startProcess() QProcess process; QStringList env = QProcess::systemEnvironment(); env << "TMPDIR=C:\\MyApp\\temp"; // Add an environment variable -env.replaceInStrings(QRegExp("^PATH=(.*)", Qt::CaseInsensitive), "PATH=\\1;C:\\Bin"); process.setEnvironment(env); process.start("myapp"); //! [0] @@ -58,7 +57,6 @@ process.start("myapp"); QProcess process; QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); env.insert("TMPDIR", "C:\\MyApp\\temp"); // Add an environment variable -env.insert("PATH", env.value("Path") + ";C:\\Bin"); process.setProcessEnvironment(env); process.start("myapp"); //! [1] -- cgit v1.2.3 From 0edf68120bc72d35d5fe29c84467f5afeacb0585 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 24 Jun 2014 11:54:56 +0200 Subject: Doc: Clarify QBitArray::fill() documentation Fix a minor mistake in the the function parameter documentation, and add a code snippet. Task-number: QTBUG-39782 Change-Id: Ia5d88a983ad683ae5bde9f332d51adc4afda77a8 Reviewed-by: Thiago Macieira Reviewed-by: Alex Blasche --- src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/corelib/doc/snippets') diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp index 4b2916a619..7fe4ea191d 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp @@ -174,3 +174,10 @@ a[0] = 1; a[1] = 0; a[2] = 1; // a: [ 1, 0, 1 ] b[0] = 1; b[1] = 1; // b: [ 1, 1 ] c = a ^ b; // c: [ 0, 1, 1 ] //! [14] + +//! [15] +QBitArray ba(4); +ba.fill(true, 1, 2); // ba: [ 0, 1, 0, 0 ] +ba.fill(true, 1, 3); // ba: [ 0, 1, 1, 0 ] +ba.fill(true, 1, 4); // ba: [ 0, 1, 1, 1 ] +//! [15] -- cgit v1.2.3 From ded6514de8b9975f1afd4f63b852c732e0125551 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Fri, 3 Oct 2014 13:57:51 +0200 Subject: Doc: deletion plugin-howtos.qdoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document is moved to qtdoc/doc/src/howtos Including snippet files. Task-number: QTBUG-38412 Change-Id: Iba15689ad63e17c370c21c9ee5a1fff40c79fcec Reviewed-by: Topi Reiniƶ Reviewed-by: Martin Smith --- .../doc/snippets/code/doc_src_plugins-howto.cpp | 67 ------------ .../doc/snippets/code/doc_src_plugins-howto.pro | 61 ----------- .../doc/snippets/code/doc_src_plugins-howto.qdoc | 43 -------- .../doc/snippets/plugins/extrafiltersplugin.h | 65 ------------ src/corelib/doc/snippets/plugins/interfaces.h | 114 --------------------- 5 files changed, 350 deletions(-) delete mode 100644 src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp delete mode 100644 src/corelib/doc/snippets/code/doc_src_plugins-howto.pro delete mode 100644 src/corelib/doc/snippets/code/doc_src_plugins-howto.qdoc delete mode 100644 src/corelib/doc/snippets/plugins/extrafiltersplugin.h delete mode 100644 src/corelib/doc/snippets/plugins/interfaces.h (limited to 'src/corelib/doc/snippets') diff --git a/src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp b/src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp deleted file mode 100644 index b86f0bbf68..0000000000 --- a/src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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] -class MyStylePlugin : public QStylePlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "mystyleplugin.json") -public: - QStyle *create(const QString &key); -}; -//! [0] - - -//! [1] -#include "mystyleplugin.h" - -QStyle *MyStylePlugin::create(const QString &key) -{ - if (key.toLower() == "mystyle") - return new MyStyle; - return 0; -} - -//! [1] - - -//! [2] -QApplication::setStyle(QStyleFactory::create("MyStyle")); -//! [2] diff --git a/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro b/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro deleted file mode 100644 index dc75c1d9d7..0000000000 --- a/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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$ -** -****************************************************************************/ - -#! [3] -CONFIG += release -#! [3] - -#! [4] -QTPLUGIN.platforms = qminimal -#! [4] - -#! [5] -QTPLUGIN += qjpeg \ - qgif \ - qkrcodecs -#! [5] - -#! [6] -QTPLUGIN.platforms = - -#! [6] - -#! [7] -CONFIG -= import_plugins -#! [7] diff --git a/src/corelib/doc/snippets/code/doc_src_plugins-howto.qdoc b/src/corelib/doc/snippets/code/doc_src_plugins-howto.qdoc deleted file mode 100644 index 46b8245ba6..0000000000 --- a/src/corelib/doc/snippets/code/doc_src_plugins-howto.qdoc +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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$ -** -****************************************************************************/ - -//! [6] -{ "Keys": [ "mystyleplugin" ] } -//! [6] diff --git a/src/corelib/doc/snippets/plugins/extrafiltersplugin.h b/src/corelib/doc/snippets/plugins/extrafiltersplugin.h deleted file mode 100644 index 7add7abb53..0000000000 --- a/src/corelib/doc/snippets/plugins/extrafiltersplugin.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples 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 EXTRAFILTERSPLUGIN_H -#define EXTRAFILTERSPLUGIN_H - -//! [0] -#include -#include -#include -#include - -#include - -class ExtraFiltersPlugin : public QObject, public FilterInterface -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface" FILE "extrafilters.json") - Q_INTERFACES(FilterInterface) - -public: - QStringList filters() const; - QImage filterImage(const QString &filter, const QImage &image, - QWidget *parent); -}; -//! [0] - -#endif diff --git a/src/corelib/doc/snippets/plugins/interfaces.h b/src/corelib/doc/snippets/plugins/interfaces.h deleted file mode 100644 index b2261a1eb2..0000000000 --- a/src/corelib/doc/snippets/plugins/interfaces.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples 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 INTERFACES_H -#define INTERFACES_H - -#include - -QT_BEGIN_NAMESPACE -class QImage; -class QPainter; -class QWidget; -class QPainterPath; -class QPoint; -class QRect; -class QString; -class QStringList; -QT_END_NAMESPACE - -//! [0] -class BrushInterface -{ -public: - virtual ~BrushInterface() {} - - virtual QStringList brushes() const = 0; - virtual QRect mousePress(const QString &brush, QPainter &painter, - const QPoint &pos) = 0; - virtual QRect mouseMove(const QString &brush, QPainter &painter, - const QPoint &oldPos, const QPoint &newPos) = 0; - virtual QRect mouseRelease(const QString &brush, QPainter &painter, - const QPoint &pos) = 0; -}; -//! [0] - -//! [1] -class ShapeInterface -{ -public: - virtual ~ShapeInterface() {} - - virtual QStringList shapes() const = 0; - virtual QPainterPath generateShape(const QString &shape, - QWidget *parent) = 0; -}; -//! [1] - -//! [2] -class FilterInterface -{ -public: - virtual ~FilterInterface() {} - - virtual QStringList filters() const = 0; - virtual QImage filterImage(const QString &filter, const QImage &image, - QWidget *parent) = 0; -}; -//! [2] - -QT_BEGIN_NAMESPACE -//! [3] //! [4] -#define BrushInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface" - -Q_DECLARE_INTERFACE(BrushInterface, BrushInterface_iid) -//! [3] - -#define ShapeInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.ShapeInterface" - -Q_DECLARE_INTERFACE(ShapeInterface, ShapeInterface_iid) -//! [5] -#define FilterInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface" - -Q_DECLARE_INTERFACE(FilterInterface, FilterInterface_iid) -//! [4] //! [5] -QT_END_NAMESPACE - -#endif -- cgit v1.2.3