From: lvaatamoinen Date: Fri, 8 Jan 2010 12:14:05 +0000 (+0000) Subject: - ColumnSelectorDialog modified for Maemo5 Qt support, version 4.6 requires X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=commitdiff_plain;h=07781ac051e81a978b4a1b9b4af5433fc3c9e494 - ColumnSelectorDialog modified for Maemo5 Qt support, version 4.6 requires using QMaemo5KineticScroller - CMake build cnofiguration updated to check if we are compiling under Scratchbox git-svn-id: file:///svnroot/qtrapids/trunk@59 42ac0dd5-4c8c-4c71-bb3e-ecdfe252ffda --- diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index dccbcee..f5148b9 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -39,6 +39,20 @@ QT4_WRAP_CPP(SRC ${MOC_HEADERS}) ADD_EXECUTABLE(qtrapids ${SRC} ${MOC_HEADERS}) ADD_DEFINITIONS(-DQT_SHARED) + +set(QT_QTMAEMO5_LIBRARY -lQtMaemo5 -L${QT_LIBRARY_DIR}) + +# QT_QTMAEMO5_* variables are not defined by CMake +if(NOT QT_QTMAEMO5_INCLUDE_DIR) + FIND_PATH(QT_QTMAEMO5_INCLUDE_DIR QtMaemo5 + PATHS ${QT_HEADERS_DIR}/QtMaemo5 NO_DEFAULT_PATH) +endif(NOT QT_QTMAEMO5_INCLUDE_DIR) +if(NOT QT_QTMAEMO5_LIBRARY) + FIND_LIBRARY(QT_QTMAEMO5_LIBRARY QtMaemo5 + PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) +endif(NOT QT_QTMAEMO5_LIBRARY) + + TARGET_LINK_LIBRARIES(qtrapids ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} @@ -47,4 +61,18 @@ TARGET_LINK_LIBRARIES(qtrapids -lboost_system-mt ) +# Check if we are building under scratchbox and link with QtMaemo5 only in that case. +# Thus, we maintain desktop build-ability also +set (SCRATCHBOX_UNAME $ENV{SBOX_UNAME_MACHINE}) + +if (SCRATCHBOX_UNAME) + MESSAGE("Configuring for building under Scratchbox..") + TARGET_LINK_LIBRARIES(qtrapids ${QT_QTMAEMO5_LIBRARY}) +endif (SCRATCHBOX_UNAME) + +#MESSAGE(${CMAKE_HOST_SYSTEM_PROCESSOR}) +#CHECK_LIBRARY_EXISTS(QT_QTMAEMO5_LIBRARY) + + + ADD_DEPENDENCIES(qtrapids dbusapi) diff --git a/src/client/ColumnSelectorDialog.cpp b/src/client/ColumnSelectorDialog.cpp index 4e26acd..274b841 100644 --- a/src/client/ColumnSelectorDialog.cpp +++ b/src/client/ColumnSelectorDialog.cpp @@ -18,6 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ + #include #include #include @@ -26,6 +27,10 @@ #include #include +#ifdef Q_WS_MAEMO_5 + #include +#endif + #include "ColumnSelectorDialog.h" @@ -36,17 +41,20 @@ ColumnSelectorDialog::ColumnSelectorDialog(QTreeWidget *treewidget, QWidget* par treeWidget_(treewidget), 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); +#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);