aboutsummaryrefslogtreecommitdiffstats
path: root/doc/codesnippets/doc/src/snippets/code
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-02-28 15:40:57 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:00 -0300
commit0a4573591e9d1a59b61167ed2b72a7ecc9181eab (patch)
tree2548dca0485ba999e3cc9bd2bdab304d7dddcf14 /doc/codesnippets/doc/src/snippets/code
parent905f660ab2c75ab6396b946869e07ed962845099 (diff)
Removed unused doc snippet files.
Diffstat (limited to 'doc/codesnippets/doc/src/snippets/code')
-rw-r--r--doc/codesnippets/doc/src/snippets/code/src_activeqt_container_qaxbase.cpp159
-rw-r--r--doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qvariant.cpp99
-rw-r--r--doc/codesnippets/doc/src/snippets/code/src_qdbus_qdbusargument.cpp151
-rw-r--r--doc/codesnippets/doc/src/snippets/code/src_qt3support_sql_q3sqlcursor.cpp100
4 files changed, 0 insertions, 509 deletions
diff --git a/doc/codesnippets/doc/src/snippets/code/src_activeqt_container_qaxbase.cpp b/doc/codesnippets/doc/src/snippets/code/src_activeqt_container_qaxbase.cpp
deleted file mode 100644
index 94b0da83f..000000000
--- a/doc/codesnippets/doc/src/snippets/code/src_activeqt_container_qaxbase.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-//! [0]
-connect(buttonBack, SIGNAL(clicked()), webBrowser, SLOT(GoBack()));
-//! [0]
-
-
-//! [1]
-activeX->setProperty("text", "some text");
-int value = activeX->property("value");
-//! [1]
-
-
-//! [2]
-webBrowser->dynamicCall("GoHome()");
-//! [2]
-
-
-//! [3]
-connect(webBrowser, SIGNAL(TitleChanged(QString)),
- this, SLOT(setCaption(QString)));
-//! [3]
-
-
-//! [4]
-dispinterface IControl
-{
-properties:
- [id(1)] BSTR text;
- [id(2)] IFontDisp *font;
-
-methods:
- [id(6)] void showColumn([in] int i);
- [id(3)] bool addColumn([in] BSTR t);
- [id(4)] int fillList([in, out] SAFEARRAY(VARIANT) *list);
- [id(5)] IDispatch *item([in] int i);
-};
-//! [4]
-
-
-//! [5]
-QAxObject object("<CLSID>");
-
-QString text = object.property("text").toString();
-object.setProperty("font", QFont("Times New Roman", 12));
-
-connect(this, SIGNAL(clicked(int)), &object, SLOT(showColumn(int)));
-bool ok = object.dynamicCall("addColumn(const QString&)", "Column 1").toBool();
-
-QList<QVariant> varlist;
-QList<QVariant> parameters;
-parameters << QVariant(varlist);
-int n = object.dynamicCall("fillList(QList<QVariant>&)", parameters).toInt();
-
-QAxObject *item = object.querySubItem("item(int)", 5);
-//! [5]
-
-
-//! [6]
-IUnknown *iface = 0;
-activeX->queryInterface(IID_IUnknown, (void**)&iface);
-if (iface) {
- // use the interface
- iface->Release();
-}
-//! [6]
-
-
-//! [7]
-ctrl->setControl("{8E27C92B-1264-101C-8A2F-040224009C02}");
-//! [7]
-
-
-//! [8]
-ctrl->setControl("MSCal.Calendar");
-//! [8]
-
-
-//! [9]
-ctrl->setControl("Calendar Control 9.0");
-//! [9]
-
-
-//! [10]
-ctrl->setControl("c:/files/file.doc");
-//! [10]
-
-
-//! [11]
-<domain/username>:<password>@server/{8E27C92B-1264-101C-8A2F-040224009C02}
-//! [11]
-
-
-//! [12]
-{8E27C92B-1264-101C-8A2F-040224009C02}:<LicenseKey>
-//! [12]
-
-
-//! [13]
-{8E27C92B-1264-101C-8A2F-040224009C02}&
-//! [13]
-
-
-//! [14]
-ctrl->setControl("DOMAIN/user:password@server/{8E27C92B-1264-101C-8A2F-040224009C02}:LicenseKey");
-//! [14]
-
-
-//! [15]
-activeX->dynamicCall("Navigate(const QString&)", "qtsoftware.com");
-//! [15]
-
-
-//! [16]
-activeX->dynamicCall("Navigate(\"qtsoftware.com\")");
-//! [16]
-
-
-//! [17]
-activeX->dynamicCall("Value", 5);
-QString text = activeX->dynamicCall("Text").toString();
-//! [17]
-
-
-//! [18]
-IWebBrowser2 *webBrowser = 0;
-activeX->queryInterface(IID_IWebBrowser2, (void **)&webBrowser);
-if (webBrowser) {
- webBrowser->Navigate2(pvarURL);
- webBrowser->Release();
-}
-//! [18]
-
-
-//! [19]
-QAxWidget outlook("Outlook.Application");
-QAxObject *session = outlook.querySubObject("Session");
-if (session) {
- QAxObject *defFolder = session->querySubObject(
- "GetDefaultFolder(OlDefaultFolders)",
- "olFolderContacts");
- //...
-}
-//! [19]
-
-
-//! [20]
-void Receiver::slot(const QString &name, int argc, void *argv)
-{
- VARIANTARG *params = (VARIANTARG*)argv;
- if (name.startsWith("BeforeNavigate2(")) {
- IDispatch *pDisp = params[argc-1].pdispVal;
- VARIANTARG URL = *params[argc-2].pvarVal;
- VARIANTARG Flags = *params[argc-3].pvarVal;
- VARIANTARG TargetFrameName = *params[argc-4].pvarVal;
- VARIANTARG PostData = *params[argc-5].pvarVal;
- VARIANTARG Headers = *params[argc-6].pvarVal;
- bool *Cancel = params[argc-7].pboolVal;
- }
-}
-//! [20]
diff --git a/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qvariant.cpp b/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qvariant.cpp
deleted file mode 100644
index d03b83e80..000000000
--- a/doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qvariant.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-//! [0]
-out = QDataStream(...)
-v = QVariant(123) // The variant now contains an int
-x = v.toInt() // x = 123
-out << v // Writes a type tag and an int to out
-v = QVariant("hello") // The variant now contains a QByteArray
-v = QVariant(tr("hello")) // The variant now contains a QString
-y = v.toInt() // y = 0 since v cannot be converted to an int
-s = v.toString() // s = tr("hello") (see QObject::tr())
-out << v // Writes a type tag and a QString to out
-...
-in = QDataStream(...) // (opening the previously written stream)
-in >> v // Reads an Int variant
-z = v.toInt() // z = 123
-print ("Type is %s", a v.typeName()) // prints "Type is int"
-v = v.toInt() + 100 // The variant now hold the value 223
-v = QVariant(QStringList())
-//! [0]
-
-
-//! [1]
-x = QVariant()
-y = QVariant(QString())
-z = QVariant(QString(""))
-x.convert(QVariant.Int)
-// x.isNull() == true
-// y.isNull() == true, z.isNull() == false
-// y.isEmpty() == true, z.isEmpty() == true
-//! [1]
-
-
-//! [2]
-variant = QVariant(some_qcolor)
-...
-color = QColor(variant)
-//! [2]
-
-
-//! [3]
-color = palette().background().color()
-variant = QVariant(color)
-//! [3]
-
-
-//! [4]
-v = QVariant()
-
-v.setValue(5) // Not supported by PySide
-int i = v.toInt() // i is now 5
-QString s = v.toString() // s is now "5"
-
-MyCustomStruct c
-v.setValue(c)
-
-...
-
-MyCustomStruct c2 = v.value<MyCustomStruct>()
-//! [4]
-
-
-//! [5]
-QVariant v
-
-MyCustomStruct c // canConvert not supported by PySide
-if (v.canConvert<MyCustomStruct>())
- c = v.value<MyCustomStruct>(v)
-
-v = 7
-int i = v.value<int>() // same as v.toInt()
-QString s = v.value<QString>() // same as v.toString(), s is now "7"
-MyCustomStruct c2 = v.value<MyCustomStruct>() // conversion failed, c2 is empty
-//! [5]
-
-
-//! [6]
-QVariant v = 42
-
-// canConvert not supported by PySide
-v.canConvert<int>() // returns true
-v.canConvert<QString>() // returns true
-
-MyCustomStruct s
-v.setValue(s)
-
-v.canConvert<int>() // returns false
-v.canConvert<MyCustomStruct>() // returns true
-//! [6]
-
-
-//! [7]
-MyCustomStruct s // fromValue not supported by PySide
-return QVariant::fromValue(s)
-//! [7]
-
-
-//! [8]
-QObject *object = getObjectFromSomewhere()
-QVariant data = qVariantFromValue(object) // not supported by PySide.
-//! [8]
diff --git a/doc/codesnippets/doc/src/snippets/code/src_qdbus_qdbusargument.cpp b/doc/codesnippets/doc/src/snippets/code/src_qdbus_qdbusargument.cpp
deleted file mode 100644
index efd54ac1b..000000000
--- a/doc/codesnippets/doc/src/snippets/code/src_qdbus_qdbusargument.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-//! [0]
-struct MyStructure
-{
- int count;
- QString name;
-};
-Q_DECLARE_METATYPE(MyStructure)
-
-// Marshall the MyStructure data into a D-Bus argument
-QDBusArgument &operator<<(QDBusArgument &argument, const MyStructure &mystruct)
-{
- argument.beginStructure();
- argument << mystruct.count << mystruct.name;
- argument.endStructure();
- return argument;
-}
-
-// Retrieve the MyStructure data from the D-Bus argument
-const QDBusArgument &operator>>(const QDBusArgument &argument, MyStructure &mystruct)
-{
- argument.beginStructure();
- argument >> mystruct.count >> mystruct.name;
- argument.endStructure();
- return argument;
-}
-//! [0]
-
-
-//! [1]
-qDBusRegisterMetaType<MyStructure>();
-//! [1]
-
-
-//! [2]
-MyType item = qdbus_cast<Type>(argument);
-//! [2]
-
-
-//! [3]
-MyType item;
-argument >> item;
-//! [3]
-
-
-//! [4]
-QDBusArgument &operator<<(QDBusArgument &argument, const MyStructure &mystruct)
-{
- argument.beginStructure();
- argument << mystruct.member1 << mystruct.member2 << ... ;
- argument.endStructure();
- return argument;
-}
-//! [4]
-
-
-//! [5]
-QDBusArgument &operator<<(QDBusArgument &argument, const MyStructure &mystruct)
-{
- argument.beginStructure();
- argument << mystruct.member1 << mystruct.member2;
-
- argument.beginStructure();
- argument << mystruct.member3.subMember1 << mystruct.member3.subMember2;
- argument.endStructure();
-
- argument << mystruct.member4;
- argument.endStructure();
- return argument;
-}
-//! [5]
-
-
-//! [6]
-// append an array of MyElement types
-QDBusArgument &operator<<(QDBusArgument &argument, const MyArray &myarray)
-{
- argument.beginArray( qMetaTypeId<MyElement>() );
- for ( int i = 0; i < myarray.length; ++i )
- argument << myarray.elements[i];
- argument.endArray();
- return argument;
-}
-//! [6]
-
-
-//! [7]
-// append a dictionary that associates ints to MyValue types
-QDBusArgument &operator<<(QDBusArgument &argument, const MyDictionary &mydict)
-{
- argument.beginMap( QVariant::Int, qMetaTypeId<MyValue>() );
- for ( int i = 0; i < mydict.length; ++i ) {
- argument.beginMapEntry();
- argument << mydict.data[i].key << mydict.data[i].value;
- argument.endMapEntry();
- }
- argument.endMap();
- return argument;
-}
-//! [7]
-
-
-//! [8]
-const QDBusArgument &operator>>(const QDBusArgument &argument, MyStructure &mystruct)
-{
- argument.beginStructure()
- argument >> mystruct.member1 >> mystruct.member2 >> mystruct.member3 >> ...;
- argument.endStructure();
- return argument;
-}
-//! [8]
-
-
-//! [9]
-// extract a MyArray array of MyElement elements
-const QDBusArgument &operator>>(const QDBusArgument &argument, MyArray &myarray)
-{
- argument.beginArray();
- myarray.clear();
-
- while ( !argument.atEnd() ) {
- MyElement element;
- argument >> element;
- myarray.append( element );
- }
-
- argument.endArray();
- return argument;
-}
-//! [9]
-
-
-//! [10]
-// extract a MyDictionary map that associates ints to MyValue elements
-const QDBusArgument &operator>>(const QDBusArgument &argument, MyDictionary &mydict)
-{
- argument.beginMap();
- mydict.clear();
-
- while ( !argMap.atEnd() ) {
- int key;
- MyValue value;
- argument.beginMapEntry();
- argument >> key >> value;
- argument.endMapEntry();
- mydict.append( key, value );
- }
-
- argument.endMap();
- return argument;
-}
-//! [10]
diff --git a/doc/codesnippets/doc/src/snippets/code/src_qt3support_sql_q3sqlcursor.cpp b/doc/codesnippets/doc/src/snippets/code/src_qt3support_sql_q3sqlcursor.cpp
deleted file mode 100644
index b3b643d96..000000000
--- a/doc/codesnippets/doc/src/snippets/code/src_qt3support_sql_q3sqlcursor.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-//! [0]
-Q3SqlCursor cur( "staff" ); // Specify the table/view name
-cur.select(); // We'll retrieve every record
-while ( cur.next() ) {
- qDebug( cur.value( "id" ).toString() + ": " +
- cur.value( "surname" ).toString() + ' ' +
- cur.value( "salary" ).toString() );
-}
-//! [0]
-
-
-//! [1]
-Q3SqlCursor cur( "prices" );
-cur.select( "id=202" );
-if ( cur.next() ) {
- QSqlRecord *buffer = cur.primeUpdate();
- double price = buffer->value( "price" ).toDouble();
- double newprice = price * 1.05;
- buffer->setValue( "price", newprice );
- cur.update();
-}
-//! [1]
-
-
-//! [2]
-Q3SqlCursor cur("Employee"); // Use the Employee table or view
-cur.select("deptno=10"); // select all records in department 10
-while(cur.next()) {
- ... // process data
-}
-...
-// select records in other departments, ordered by department number
-cur.select("deptno>10", cur.index("deptno"));
-...
-//! [2]
-
-
-//! [3]
-Q3SqlCursor cur("Employee");
-cur.select("deptno=10"); // select all records in department 10
-while(cur.next()) {
- ... // process data
-}
-...
-cur.select(); // re-selects all records in department 10
-...
-//! [3]
-
-
-//! [4]
-Q3SqlCursor cur("Employee");
-QSqlIndex pk = cur.primaryIndex();
-cur.setValue("id", 10);
-cur.select(pk, pk); // generates "SELECT ... FROM Employee WHERE id=10 ORDER BY id"
-...
-//! [4]
-
-
-//! [5]
-Q3SqlCursor cur("Employee");
-cur.setMode(Q3SqlCursor::Writable); // allow insert/update/delete
-...
-cur.setMode(Q3SqlCursor::Insert | Q3SqlCursor::Update); // allow inserts and updates only
-...
-cur.setMode(Q3SqlCursor::ReadOnly); // no inserts/updates/deletes allowed
-
-//! [5]
-
-
-//! [6]
-Q3SqlCursor cur("prices");
-QSqlRecord *buffer = cur.primeInsert();
-buffer->setValue("id", 53981);
-buffer->setValue("name", "Thingy");
-buffer->setValue("price", 105.75);
-cur.insert();
-//! [6]
-
-
-//! [7]
-Q3SqlCursor cur("prices");
-cur.select("id=202");
-if (cur.next()) {
- QSqlRecord *buffer = cur.primeUpdate();
- double price = buffer->value("price").toDouble();
- double newprice = price * 1.05;
- buffer->setValue("price", newprice);
- cur.update();
-}
-//! [7]
-
-
-//! [8]
-Q3SqlCursor cur("prices");
-cur.select("id=999");
-if (cur.next()) {
- cur.primeDelete();
- cur.del();
-}
-//! [8]