Browse Source

Migrating to Qt6

Signed-off-by: Blagovest Petrov <blagovest@petrovs.info>
qt6
Blagovest Petrov 1 year ago
parent
commit
c6dc9ff631
  1. 0
      Assets/128-apps-org.petrovs_info.tangraplay.png
  2. 0
      Assets/16-apps-org.petrovs_info.tangraplay.png
  3. 0
      Assets/32-apps-org.petrovs_info.tangraplay.png
  4. 0
      Assets/48-apps-org.petrovs_info.tangraplay.png
  5. 0
      Assets/64-apps-org.petrovs_info.tangraplay.png
  6. 0
      Assets/KellySlab-Regular.ttf
  7. 0
      Assets/blago.png
  8. 0
      Assets/buuf-pause.png
  9. 0
      Assets/buuf-play.png
  10. 0
      Assets/dark_leather.png
  11. 0
      Assets/live.png
  12. 0
      Assets/logo.png
  13. 0
      Assets/menu-background.png
  14. 0
      Assets/menubtn-background.png
  15. 0
      Assets/news-icon.png
  16. 0
      Assets/news.png
  17. 0
      Assets/pause-button.svg
  18. 0
      Assets/play-button.svg
  19. 0
      Assets/playbtn-frame.png
  20. 0
      Assets/podcast.png
  21. 0
      Assets/stop-button.svg
  22. 0
      Assets/tangra.ico
  23. 111
      CMakeLists.txt
  24. 10
      Resources/CMakeLists.txt
  25. 38
      TangraPlay.pro
  26. 2
      main.cpp
  27. 28
      qml.qrc

0
Resources/128-apps-org.petrovs_info.tangraplay.png → Assets/128-apps-org.petrovs_info.tangraplay.png

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

0
Resources/16-apps-org.petrovs_info.tangraplay.png → Assets/16-apps-org.petrovs_info.tangraplay.png

Before

Width:  |  Height:  |  Size: 784 B

After

Width:  |  Height:  |  Size: 784 B

0
Resources/32-apps-org.petrovs_info.tangraplay.png → Assets/32-apps-org.petrovs_info.tangraplay.png

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

0
Resources/48-apps-org.petrovs_info.tangraplay.png → Assets/48-apps-org.petrovs_info.tangraplay.png

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
Resources/64-apps-org.petrovs_info.tangraplay.png → Assets/64-apps-org.petrovs_info.tangraplay.png

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

0
Resources/KellySlab-Regular.ttf → Assets/KellySlab-Regular.ttf

0
Resources/blago.png → Assets/blago.png

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

0
Resources/buuf-pause.png → Assets/buuf-pause.png

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

0
Resources/buuf-play.png → Assets/buuf-play.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
Resources/dark_leather.png → Assets/dark_leather.png

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

0
Resources/live.png → Assets/live.png

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

0
Resources/logo.png → Assets/logo.png

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

0
Resources/menu-background.png → Assets/menu-background.png

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

0
Resources/menubtn-background.png → Assets/menubtn-background.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
Resources/news-icon.png → Assets/news-icon.png

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

0
Resources/news.png → Assets/news.png

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

0
Resources/pause-button.svg → Assets/pause-button.svg

Before

Width:  |  Height:  |  Size: 991 B

After

Width:  |  Height:  |  Size: 991 B

0
Resources/play-button.svg → Assets/play-button.svg

Before

Width:  |  Height:  |  Size: 875 B

After

Width:  |  Height:  |  Size: 875 B

0
Resources/playbtn-frame.png → Assets/playbtn-frame.png

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

0
Resources/podcast.png → Assets/podcast.png

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

0
Resources/stop-button.svg → Assets/stop-button.svg

Before

Width:  |  Height:  |  Size: 712 B

After

Width:  |  Height:  |  Size: 712 B

0
Resources/tangra.ico → Assets/tangra.ico

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

111
CMakeLists.txt

@ -1,60 +1,81 @@
project(tangraplay)
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(tangraplay VERSION 0.1 LANGUAGES CXX)
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(QT_MIN_VERSION "5.10.0")
set(KF5_DEP_VERSION "5.40.0")
#set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# We need some parts of the ECM CMake helpers.
find_package(ECM ${KF5_DEP_VERSION} QUIET REQUIRED NO_MODULE)
find_package(Qt6 6.2 REQUIRED COMPONENTS Quick Widgets Core QuickControls2 Widgets Gui Multimedia)
# We append to the module path so modules can be overridden from the command line.
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(QT_MIN_VERSION "5.10.0")
set(KF5_DEP_VERSION "5.40.0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Quick QuickControls2 Multimedia Widgets Gui )
include_directories(.)
include_directories(${Qt5Core_PRIVATE_INCLUDE_DIRS})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(ECMOptionalAddSubdirectory)
include(ECMAddAppIcon)
include(ECMInstallIcons)
add_subdirectory(Resources)
qt5_add_resources(RESOURCES qml.qrc)
SET(SOURCES
list(APPEND QML_ASSETS
Assets/pause-button.svg
Assets/logo.png
Assets/play-button.svg
Assets/menu-background.png
Assets/dark_leather.png
Assets/menubtn-background.png
Assets/blago.png
Assets/tangra.ico
Assets/KellySlab-Regular.ttf
Assets/news-icon.png
Assets/buuf-pause.png
Assets/buuf-play.png
Assets/playbtn-frame.png
Assets/live.png
Assets/news.png
Assets/podcast.png
)
qt_add_executable(apptangraplay
main.cpp
)
add_executable(tangraplay
${SOURCES}
${RESOURCES}
)
qt5_use_modules(tangraplay Quick QuickControls2 Core Multimedia )
target_link_libraries(tangraplay
Qt5::Quick
Qt5::QuickControls2
Qt5::Core
Qt5::Widgets
Qt5::Gui
Qt5::Multimedia )
install(TARGETS tangraplay DESTINATION ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS org.petrovs_info.tangraplay.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.petrovs_info.tangraplay.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
tangratray.h tangratray.cpp
)
qt_add_qml_module(apptangraplay
URI tangraplay
VERSION 1.0
QML_FILES ui/main.qml
ui/AboutProgram.qml
ui/AudioPlayer.qml
ui/MediaButton.qml
ui/MenuButton.qml
ui/MenuToolbar.qml
ui/PgLive.qml
ui/PgNews.qml
RESOURCES
${QML_ASSETS}
)
set_target_properties(apptangraplay PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER tangraplay.petrovs.info
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
target_link_libraries(apptangraplay PRIVATE
Qt6::Quick
Qt6::QuickControls2
Qt6::Core
Qt6::Widgets
Qt6::Gui
Qt6::Multimedia )
install(TARGETS apptangraplay
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

10
Resources/CMakeLists.txt

@ -1,10 +0,0 @@
ecm_install_icons(
ICONS
128-apps-org.petrovs_info.tangraplay.png
64-apps-org.petrovs_info.tangraplay.png
48-apps-org.petrovs_info.tangraplay.png
32-apps-org.petrovs_info.tangraplay.png
16-apps-org.petrovs_info.tangraplay.png
DESTINATION ${ICON_INSTALL_DIR}
)

38
TangraPlay.pro

@ -1,38 +0,0 @@
QT += quick gui core widgets
CONFIG += c++11
RC_ICONS = Resources/tangra.ico
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Refer to the documentation for the
# deprecated API to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
fetchshowid.cpp \
main.cpp \
tangratray.cpp
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
HEADERS += \
fetchshowid.h \
tangratray.h

2
main.cpp

@ -14,7 +14,7 @@ int main(int argc, char *argv[])
QQmlContext *context = engine.rootContext();
context->setContextProperty("tangraTray", tangratray);
const QUrl url(QStringLiteral("qrc:/ui/main.qml"));
const QUrl url(u"qrc:/tangraplay/qml/main.qml"_qs);
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)

28
qml.qrc

@ -1,28 +0,0 @@
<RCC>
<qresource prefix="/">
<file>ui/main.qml</file>
<file>ui/MenuToolbar.qml</file>
<file>ui/MenuButton.qml</file>
<file>ui/PgLive.qml</file>
<file>ui/PgNews.qml</file>
<file>ui/AboutProgram.qml</file>
<file>ui/AudioPlayer.qml</file>
<file>ui/MediaButton.qml</file>
<file>Resources/pause-button.svg</file>
<file>Resources/logo.png</file>
<file>Resources/play-button.svg</file>
<file>Resources/menu-background.png</file>
<file>Resources/dark_leather.png</file>
<file>Resources/menubtn-background.png</file>
<file>Resources/blago.png</file>
<file>Resources/tangra.ico</file>
<file>Resources/KellySlab-Regular.ttf</file>
<file>Resources/news-icon.png</file>
<file>Resources/buuf-pause.png</file>
<file>Resources/buuf-play.png</file>
<file>Resources/playbtn-frame.png</file>
<file>Resources/live.png</file>
<file>Resources/news.png</file>
<file>Resources/podcast.png</file>
</qresource>
</RCC>
Loading…
Cancel
Save