diff options
Diffstat (limited to 'touchy/main.cpp')
-rw-r--r-- | touchy/main.cpp | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/touchy/main.cpp b/touchy/main.cpp deleted file mode 100644 index 732f67c..0000000 --- a/touchy/main.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include <QtGui> -#include "qscrollareakineticscroller.h" - -#include "settingswidget.h" -#include "plotwidget.h" - -int main(int argc, char **argv) -{ - QApplication a(argc, argv); - - QListWidget *list = new QListWidget(); - - for (int i = 0; i < 1000; ++i) - new QListWidgetItem(QString("Oa dsjfhdk jhdsjk hfdskj k %1").arg(i), list); - - QScrollAreaKineticScroller *s = new QScrollAreaKineticScroller(); - s->setWidget(list); - -#if defined(Q_WS_MAEMO_5) || defined(Q_WS_S60) || defined(Q_WS_WINCE) - bool smallScreen = true; -#else - bool smallScreen = false; -#endif - - QWidget *settings = new SettingsWidget(s, smallScreen); - QWidget *plot = new PlotWidget(s); - - if (smallScreen) { - QMainWindow *top = new QMainWindow(); - QStackedWidget *stack = new QStackedWidget(); - stack->addWidget(list); - stack->addWidget(settings); - stack->addWidget(plot); - top->setCentralWidget(stack); - - QActionGroup *pages = new QActionGroup(top); - pages->setExclusive(true); - QSignalMapper *mapper = new QSignalMapper(top); - QObject::connect(mapper, SIGNAL(mapped(int)), stack, SLOT(setCurrentIndex(int))); - - QAction *a = new QAction(QLatin1String("List"), pages); - a->setCheckable(true); - a->setChecked(true); - mapper->setMapping(a, 0); - QObject::connect(a, SIGNAL(toggled(bool)), mapper, SLOT(map())); - - a = new QAction(QLatin1String("Config"), pages); - a->setCheckable(true); - a->setChecked(false); - a->setMenuRole(QAction::NoRole); - mapper->setMapping(a, 1); - QObject::connect(a, SIGNAL(toggled(bool)), mapper, SLOT(map())); - - a = new QAction(QLatin1String("Plot"), pages); - a->setCheckable(true); - a->setChecked(false); - mapper->setMapping(a, 2); - QObject::connect(a, SIGNAL(toggled(bool)), mapper, SLOT(map())); - - top->menuBar()->addMenu("Pages")->addActions(pages->actions()); - top->showMaximized(); - } else { - QSplitter *split = new QSplitter(); - split->addWidget(list); - split->addWidget(settings); - split->addWidget(plot); - split->show(); -#if defined(Q_WS_MAC) - split->raise(); -#endif - } - - return a.exec(); -} |