Added build script of Debian
[qtrapids] / src / client / ColumnSelectorDialog.cpp
index 4e26acd..4fe9c30 100644 (file)
@@ -1,11 +1,9 @@
 /***************************************************************************
- *   Copyright (C) 2009 by Lassi Väätämöinen   *
- *   lassi.vaatamoinen@ixonos.com   *
+ *   Copyright (C) 2010 by Ixonos Plc   *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
+ *   the Free Software Foundation; version 2 of the License.               *
  *                                                                         *
  *   This program is distributed in the hope that it will be useful,       *
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
@@ -18,6 +16,7 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
+
 #include <QScrollArea>
 #include <QGroupBox>
 #include <QGridLayout>
 #include <QDialogButtonBox>
 #include <QAbstractButton>
 
+#ifdef Q_WS_MAEMO_5
+       #include <QAbstractKineticScroller>
+#endif
+
 #include "ColumnSelectorDialog.h"
 
 
 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_()
 {
        QScrollArea *scrollArea = new QScrollArea(this);
+
+#ifdef Q_WS_MAEMO_5
+       /// @todo Kineticscrolling (property "FingerScrollable" does not work in Qt 4.6, only in 4.5)   
+       scroller_ = scrollArea->property("kineticScroller").value<QAbstractKineticScroller*>();
+
+       if (!scroller_)                                                               
+               qFatal("This example only works with QMaemo5Style as the default style for all QAbstractScrollAreas"); 
+#endif
+
        scrollArea->setWidgetResizable(true);
        //scrollArea->setProperty("FingerScrollable", false);
        QBoxLayout *verticalBox = new QBoxLayout(QBoxLayout::TopToBottom);
        grid_ = new QGridLayout;
        QCheckBox *cbox = NULL;
 
-/// @TODO Kineticscrolling (Fingerscrollable does not work in Qt 4.6, only in 4.5)     
-#ifdef Q_WS_HILDON
-   //Specific hildon/Maemo5 code here 
-#endif
+
 
        // Create scrollable checkbox dialog to allow proper viewing on Maemo:
        verticalBox->addWidget(scrollArea);