summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-11-16 14:28:58 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-19 08:36:42 +0100
commit2fe214ca90cfda68126bf6e83e876a3a00635521 (patch)
tree7befbad6fae99e9973d92ef2e19b900ce4169fca
parent435fac3bc7d12771a3c80556e748a2388e914cf7 (diff)
Provide missing documentation for QAxSelect
Task-number: QTBUG-27776 Change-Id: Ic67c8fdeb797e5c9867822a21dc788b781dd24a5 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
-rw-r--r--doc/src/snippets/code/src_activeqt_container_qaxselect.cpp48
-rw-r--r--src/activeqt/container/qaxselect.cpp31
-rw-r--r--src/activeqt/container/qaxselect.h2
3 files changed, 78 insertions, 3 deletions
diff --git a/doc/src/snippets/code/src_activeqt_container_qaxselect.cpp b/doc/src/snippets/code/src_activeqt_container_qaxselect.cpp
new file mode 100644
index 0000000..25e8599
--- /dev/null
+++ b/doc/src/snippets/code/src_activeqt_container_qaxselect.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** 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]
+QAxSelect select;
+if (select.exec()) {
+ QAxWidget *container = new QAxWidget;
+ container->setControl(select.clsid());
+ container->show();
+}
+//! [0]
diff --git a/src/activeqt/container/qaxselect.cpp b/src/activeqt/container/qaxselect.cpp
index 1797fe9..b8f87ee 100644
--- a/src/activeqt/container/qaxselect.cpp
+++ b/src/activeqt/container/qaxselect.cpp
@@ -120,8 +120,27 @@ QVariant ControlList::data(const QModelIndex &index, int role) const
return QVariant();
}
-QAxSelect::QAxSelect(QWidget *parent, Qt::WindowFlags f)
-: QDialog(parent, f), selectUi(new Ui::QAxSelect)
+/*!
+ \class QAxSelect
+ \brief The QAxSelect class provides a selection dialog for registered COM components.
+
+ \inmodule QAxContainer
+
+ QAxSelect dialog can be used to provide users with a way to browse the registered COM
+ components of the system and select one. The CLSID of the selected component can
+ then be used in the application to e.g. initialize a QAxWidget:
+
+ \snippet doc/src/snippets/code/src_activeqt_container_qaxselect.cpp 0
+
+ \sa QAxWidget, {ActiveQt Framework}
+*/
+
+/*!
+ Constructs a QAxSelect object. Dialog parent widget and window flags can be
+ optionally specified with \a parent and \a flags parameters, respectively.
+*/
+QAxSelect::QAxSelect(QWidget *parent, Qt::WindowFlags flags)
+: QDialog(parent, flags), selectUi(new Ui::QAxSelect)
{
#ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(Qt::WaitCursor);
@@ -139,10 +158,18 @@ QAxSelect::QAxSelect(QWidget *parent, Qt::WindowFlags f)
connect(selectUi->buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
}
+/*!
+ Destroys the QAxSelect object.
+*/
QAxSelect::~QAxSelect()
{
}
+/*!
+ \fn QString QAxSelect::clsid() const
+
+ Returns the CLSID of the selected COM component.
+*/
QString QAxSelect::clsid() const
{
return selectUi->ActiveX->text();
diff --git a/src/activeqt/container/qaxselect.h b/src/activeqt/container/qaxselect.h
index b07b8a4..3124dfa 100644
--- a/src/activeqt/container/qaxselect.h
+++ b/src/activeqt/container/qaxselect.h
@@ -58,7 +58,7 @@ class QAxSelect : public QDialog
{
Q_OBJECT
public:
- QAxSelect(QWidget *parent = 0, Qt::WindowFlags f = 0);
+ QAxSelect(QWidget *parent = 0, Qt::WindowFlags flags = 0);
~QAxSelect();
QString clsid() const;