author | kergoth <kergoth> | 2003-05-13 20:36:48 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-05-13 20:36:48 (UTC) |
commit | ddc141f1e33ccb4c415b4dc6bc1842127db1d78b (patch) (unidiff) | |
tree | 1145775d7c53b80817b508ff864088c48e07961c /core/apps/taboapp/main.cpp | |
parent | 2c26bb12add88b531ef49f725d0c48f421cb4d83 (diff) | |
download | opie-ddc141f1e33ccb4c415b4dc6bc1842127db1d78b.zip opie-ddc141f1e33ccb4c415b4dc6bc1842127db1d78b.tar.gz opie-ddc141f1e33ccb4c415b4dc6bc1842127db1d78b.tar.bz2 |
*extremely* minimal tabbed interface. Doesnt install the translations, etc.
For testing and development purposes.
-rw-r--r-- | core/apps/taboapp/main.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/core/apps/taboapp/main.cpp b/core/apps/taboapp/main.cpp new file mode 100644 index 0000000..497e29f --- a/dev/null +++ b/core/apps/taboapp/main.cpp | |||
@@ -0,0 +1,42 @@ | |||
1 | #include <qdir.h> | ||
2 | |||
3 | #include <qpe/global.h> | ||
4 | #include <qpe/qpeapplication.h> | ||
5 | #include <qpe/qlibrary.h> | ||
6 | #include <oappinterface.h> | ||
7 | #include <oappplugin.h> | ||
8 | |||
9 | #include <opie/otabwidget.h> | ||
10 | |||
11 | int main( int argc, char **argv ) | ||
12 | { | ||
13 | QPEApplication a( argc, argv ); | ||
14 | int ret = 0; | ||
15 | |||
16 | OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); | ||
17 | |||
18 | QString path = QPEApplication::qpeDir() + "/plugins/app"; | ||
19 | QDir dir( path, "lib*.so" ); | ||
20 | |||
21 | QStringList list = dir.entryList(); | ||
22 | QStringList::Iterator it; | ||
23 | |||
24 | QInterfacePtr<OAppInterface> iface; | ||
25 | for ( it = list.begin(); it != list.end(); ++it ) { | ||
26 | QLibrary *lib = new QLibrary( path + "/" + *it ); | ||
27 | |||
28 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); | ||
29 | if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | ||
30 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); | ||
31 | |||
32 | QList<QWidget> list = iface->widgets(); | ||
33 | |||
34 | QWidget *widget; | ||
35 | for ( widget = list.first(); widget != 0; widget = list.next() ) | ||
36 | tabwidget->addTab(widget, QString(*it), QString(*it)); | ||
37 | } | ||
38 | } | ||
39 | |||
40 | a.showMainDocumentWidget(tabwidget); | ||
41 | return a.exec(); | ||
42 | } | ||