From: lvaatamoinen Date: Tue, 19 Jan 2010 12:48:41 +0000 (+0000) Subject: - Fixed KineticScrolling due to Qt 4.6.1 changes. X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=commitdiff_plain;h=b9b88af21df2623d984784d007327c8e9733f7ae;ds=sidebyside - Fixed KineticScrolling due to Qt 4.6.1 changes. - MainWindow title set to QtRapids, on Maemo application name does not work. git-svn-id: file:///svnroot/qtrapids/trunk@67 42ac0dd5-4c8c-4c71-bb3e-ecdfe252ffda --- diff --git a/src/client/ColumnSelectorDialog.cpp b/src/client/ColumnSelectorDialog.cpp index 274b841..88f1dc4 100644 --- a/src/client/ColumnSelectorDialog.cpp +++ b/src/client/ColumnSelectorDialog.cpp @@ -28,7 +28,7 @@ #include #ifdef Q_WS_MAEMO_5 - #include + #include #endif #include "ColumnSelectorDialog.h" @@ -36,16 +36,20 @@ ColumnSelectorDialog::ColumnSelectorDialog(QTreeWidget *treewidget, QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f), // Superclass construct - dialogButtons_(0), - grid_(0), + dialogButtons_(NULL), + grid_(NULL), treeWidget_(treewidget), + scroller_(NULL) checkBoxes_() { - /// @TODO Kineticscrolling (Fingerscrollable does not work in Qt 4.6, only in 4.5) QScrollArea *scrollArea = new QScrollArea(this); #ifdef Q_WS_MAEMO_5 - new QMaemo5KineticScroller(scrollArea); + /// @todo Kineticscrolling (property "FingerScrollable" does not work in Qt 4.6, only in 4.5) + scroller_ = scrollArea->property("kineticScroller").value(); + + if (!scroller_) + qFatal("This example only works with QMaemo5Style as the default style for all QAbstractScrollAreas"); #endif scrollArea->setWidgetResizable(true); diff --git a/src/client/ColumnSelectorDialog.h b/src/client/ColumnSelectorDialog.h index d803f3a..ccc64ee 100644 --- a/src/client/ColumnSelectorDialog.h +++ b/src/client/ColumnSelectorDialog.h @@ -30,6 +30,8 @@ class QGridLayout; class QTreeWidget; class QCheckBox; class QAbstractButton; +class QAbstractKineticScroller; + /** @author Lassi Väätämöinen @@ -50,6 +52,7 @@ class ColumnSelectorDialog : public QDialog QDialogButtonBox *dialogButtons_; QGridLayout *grid_; QTreeWidget *treeWidget_; + QAbstractKineticScroller *scroller_; std::vector checkBoxes_; private: diff --git a/src/client/MainWindow.cpp b/src/client/MainWindow.cpp index 7e33bf4..b589dc3 100644 --- a/src/client/MainWindow.cpp +++ b/src/client/MainWindow.cpp @@ -66,6 +66,9 @@ MainWindow::MainWindow() : , "/qtrapids", QDBusConnection::sessionBus()) // torrentHandles_(), { + + setWindowTitle("QtRapids"); + // MENUBAR QMenuBar *menuBar = new QMenuBar(); QMenu *tempMenu = NULL; diff --git a/src/client/MainWindow.h b/src/client/MainWindow.h index 7c822e2..b84a655 100644 --- a/src/client/MainWindow.h +++ b/src/client/MainWindow.h @@ -69,6 +69,9 @@ public: , this , SLOT(on_alert(qtrapids::TorrentState , qtrapids::ParamsMap_t))); + // Request server state. + // NOTE: This call starts qtrapids-server automatically with the GUI, + // if the .service file is in /usr/share/dbus-1/services/ server_.getState(); }