diff --git a/CMakeLists.txt b/CMakeLists.txt index eb46263..8272b23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,82 +1,88 @@ project(klines) cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR) set (QT_MIN_VERSION "5.7.0") set (KF5_MIN_VERSION "5.30.0") find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Config Crash WidgetsAddons Config DBusAddons I18n ConfigWidgets XmlGui DocTools ) find_package(KF5KDEGames 4.9.0 REQUIRED) include(FeatureSummary) include(ECMAddAppIcon) include(ECMInstallIcons) include(KDEInstallDirs) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) +# workaround for https://bugreports.qt.io/browse/QTBUG-74665 (bug in qt5.13 reevaluate it) +if (${Qt5Widgets_VERSION} STREQUAL "5.13.0") + MESSAGE(STATUS "Qt version: ${Qt5Widgets_VERSION} DISABLE compile without deprecated methods. bug QTBUG-74665") +else() + add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000) +endif() add_subdirectory(themes) add_subdirectory(doc) ########### next target ############### set(klines_SRCS mwidget.cpp klines.cpp main.cpp scene.cpp renderer.cpp ballitem.cpp previewitem.cpp animator.cpp ) qt5_add_resources(klines_SRCS klines.qrc) kconfig_add_kcfg_files(klines_SRCS prefs.kcfgc) file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*-apps-klines.png") ecm_add_app_icon(klines_SRCS ICONS ${ICONS_SRCS}) add_executable(klines ${klines_SRCS}) target_link_libraries(klines KF5KDEGames KF5::Crash KF5::DBusAddons KF5::XmlGui ) install(TARGETS klines ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) ########### install files ############### install(PROGRAMS org.kde.klines.desktop DESTINATION ${KDE_INSTALL_APPDIR}) install(FILES klines.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR}) install(FILES org.kde.klines.appdata.xml DESTINATION ${CMAKE_INSTALL_METAINFODIR}) ecm_install_icons(ICONS 16-apps-klines.png 22-apps-klines.png 32-apps-klines.png 48-apps-klines.png 64-apps-klines.png 128-apps-klines.png DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor ) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/mwidget.cpp b/mwidget.cpp index 51f0691..e813ebe 100644 --- a/mwidget.cpp +++ b/mwidget.cpp @@ -1,67 +1,67 @@ /*************************************************************************** begin : Fri May 19 2000 copyright : (C) 2000 by Roman Merzlyakov email : roman@sbrf.barrt.ru copyright : (C) 2000 by Roman Razilov email : Roman.Razilov@gmx.de copyright : (C) 2006-2007 by Dmitry Suzdalev email : dimsuz@gmail.com ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #include "mwidget.h" #include "scene.h" #include #include #include MainWidget::MainWidget( QWidget* parent ) : QWidget( parent ) , m_scene( nullptr ) , m_next_label( nullptr ) { QBoxLayout *mainLay = new QHBoxLayout( this ); - mainLay->setMargin( 0 ); + mainLay->setContentsMargins( 0 , 0 , 0 , 0 ); m_scene = new KLinesScene(this); QGraphicsView* klview = new QGraphicsView( m_scene, this ); klview->setCacheMode( QGraphicsView::CacheBackground ); klview->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); klview->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); klview->setFrameStyle(QFrame::NoFrame); klview->setOptimizationFlags( QGraphicsView::DontClipPainter | QGraphicsView::DontSavePainterState | QGraphicsView::DontAdjustForAntialiasing ); mainLay->addWidget( klview ); setMinimumSize( 250, 250 ); } MainWidget::~MainWidget() { } void MainWidget::setShowNextColors(bool visible) { // add bonus score points if playing w/o preview m_scene->setBonusScorePoints( visible ? 0 : 1 ); m_scene->setPreviewZoneVisible( visible ); } void MainWidget::resizeEvent( QResizeEvent* ev) { m_scene->resizeScene( ev->size().width(), ev->size().height() ); }