[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [marble/qt5] src: make marble-touch compile with qt5
From: Michael Zanetti <michael_zanetti () gmx ! net>
Date: 2013-09-17 20:46:02
Message-ID: E1VM29q-0000pq-7h () scm ! kde ! org
[Download RAW message or body]
Git commit 82ea552688ecdcfbad1d9b583f6d88a4551ad755 by Michael Zanetti.
Committed on 17/09/2013 at 20:44.
Pushed by mzanetti into branch 'qt5'.
make marble-touch compile with qt5
M +2 -2 src/CMakeLists.txt
M +9 -2 src/qt-components/marble-touch/CMakeLists.txt
M +10 -2 src/qt-components/marble-touch/main.cpp
http://commits.kde.org/marble/82ea552688ecdcfbad1d9b583f6d88a4551ad755
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 385acb3..fe0f12b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -43,9 +43,9 @@ add_subdirectory( lib )
add_subdirectory( plugins )
add_subdirectory( bindings )
=
-if( QT_QTDECLARATIVE_FOUND )
+if( QT_QTDECLARATIVE_FOUND OR Qt5Quick_FOUND )
add_subdirectory( qt-components )
-endif( QT_QTDECLARATIVE_FOUND )
+endif( QT_QTDECLARATIVE_FOUND OR Qt5Quick_FOUND )
=
if( NOT QTONLY AND KDE4_PLASMA_LIBS ) # don't try to build this against =
kdelibs < 4.2
add_subdirectory( plasmoid )
diff --git a/src/qt-components/marble-touch/CMakeLists.txt b/src/qt-compone=
nts/marble-touch/CMakeLists.txt
index 374b1c6..3536e99 100644
--- a/src/qt-components/marble-touch/CMakeLists.txt
+++ b/src/qt-components/marble-touch/CMakeLists.txt
@@ -4,8 +4,15 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${QT_INCLUDE_DIR}
+
+ if( NOT QT4_FOUND )
+ ${Qt5Qml_INCLUDE_DIRS}
+ ${Qt5Quick_INCLUDE_DIRS}
+ endif()
)
-INCLUDE(${QT_USE_FILE})
+if( QT4_FOUND)
+ INCLUDE(${QT_USE_FILE})
+endif()
=
set( my_SRCS
main.cpp
@@ -14,7 +21,7 @@ set( my_SRCS
FILE (GLOB QML_FILES *.qml activities/*.qml plasma/*.qml harmattan/*.qml)
marble_add_project_resources(${QML_FILES})
=
-qt4_add_resources(my_SRCS meego.qrc)
+qt_add_resources(my_SRCS meego.qrc)
marble_qt4_automoc( ${my_SRCS} )
add_executable( marble-touch ${my_SRCS} )
target_link_libraries( marble-touch ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRAR=
Y} ${QT_QTMAIN_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} marblewidget )
diff --git a/src/qt-components/marble-touch/main.cpp b/src/qt-components/ma=
rble-touch/main.cpp
index 9c60e3a..11783ad 100644
--- a/src/qt-components/marble-touch/main.cpp
+++ b/src/qt-components/marble-touch/main.cpp
@@ -9,7 +9,13 @@
// A QML-interface of Marble for the Meego operating system.
=
#include <QApplication>
-#include <QtDeclarative>
+#if QT_VERSION < 0x050000
+ #include <QtDeclarative>
+ typedef QtDeclarativeView QQuickView;
+#else
+ #include <QQuickView>
+ #include <QtQml/qqml.h>
+#endif
#include "MarbleDebug.h"
#include "MarbleGlobal.h"
=
@@ -72,7 +78,7 @@ int main( int argc, char *argv[] )
MarbleGlobal::getInstance()->setProfiles( profiles );
=
// Create main window based on QML.
- QDeclarativeView view;
+ QQuickView view;
view.setSource( QUrl( "qrc:/main.qml" ) );
=
#ifdef __arm__
@@ -81,7 +87,9 @@ int main( int argc, char *argv[] )
#else
if ( portraitMode ) {
view.resize( view.initialSize().height(), view.initialSize().width=
() );
+#if QT_VERSION < 0x050000
view.setTransform( QTransform().rotate( 90 ) );
+#endif
} else {
view.resize( view.initialSize().width(), view.initialSize().height=
() );
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic