author | kergoth <kergoth> | 2003-05-13 20:36:48 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-05-13 20:36:48 (UTC) |
commit | ddc141f1e33ccb4c415b4dc6bc1842127db1d78b (patch) (side-by-side diff) | |
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 @@ +#include <qdir.h> + +#include <qpe/global.h> +#include <qpe/qpeapplication.h> +#include <qpe/qlibrary.h> +#include <oappinterface.h> +#include <oappplugin.h> + +#include <opie/otabwidget.h> + +int main( int argc, char **argv ) +{ + QPEApplication a( argc, argv ); + int ret = 0; + + OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); + + QString path = QPEApplication::qpeDir() + "/plugins/app"; + QDir dir( path, "lib*.so" ); + + QStringList list = dir.entryList(); + QStringList::Iterator it; + + QInterfacePtr<OAppInterface> iface; + for ( it = list.begin(); it != list.end(); ++it ) { + QLibrary *lib = new QLibrary( path + "/" + *it ); + + qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); + if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) { + qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); + + QList<QWidget> list = iface->widgets(); + + QWidget *widget; + for ( widget = list.first(); widget != 0; widget = list.next() ) + tabwidget->addTab(widget, QString(*it), QString(*it)); + } + } + + a.showMainDocumentWidget(tabwidget); + return a.exec(); +} |