summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <[email protected]>2015-07-12 01:02:19 +0200
committerAlbert Astals Cid <[email protected]>2015-07-12 01:02:19 +0200
commitb586ad546f6b0ad492d2e3c0e4729bd98a18cb2c (patch)
tree514670921c12ece14d7db09e70c47ca5305a04fc
parent915b6acb60258ef3f1971af217f6609f160b7644 (diff)
Bring back the print feature
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/kiriki.cpp8
3 files changed, 5 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 529513c..83f2316 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@ set (QT_MIN_VERSION "5.3.0")
find_package(ECM 1.7.0 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 Svg)
+find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg PrintSupport)
find_package(KF5 REQUIRED COMPONENTS
CoreAddons
Config
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fbaea01..4001e6b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,7 +21,7 @@ file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../icons/*-apps-kiriki.png")
ecm_add_app_icon(kiriki_SRCS ICONS ${ICONS_SRCS})
add_executable(kiriki ${kiriki_SRCS})
-target_link_libraries(kiriki KF5KDEGames KF5::XmlGui KF5::I18n KF5::IconThemes KF5::DBusAddons)
+target_link_libraries(kiriki KF5KDEGames KF5::XmlGui KF5::I18n KF5::IconThemes KF5::DBusAddons Qt5::PrintSupport)
install(TARGETS kiriki ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/src/kiriki.cpp b/src/kiriki.cpp
index baedeee..6020ec9 100644
--- a/src/kiriki.cpp
+++ b/src/kiriki.cpp
@@ -16,8 +16,8 @@
#include <QItemDelegate>
#include <QItemSelectionModel>
#include <QPainter>
-//#include <QPrintDialog>
-//#include <QPrinter>
+#include <QPrintDialog>
+#include <QPrinter>
#include <QStyledItemDelegate>
#include <QTimer>
#include <QTreeView>
@@ -348,17 +348,15 @@ void kiriki::showPreferences()
void kiriki::print()
{
-#if 0 //Port to QT5
QPrinter printer;
printer.setFullPage( true );
- QPrintDialog *printDialog = KdePrint::createPrintDialog(&printer, this);
+ QPrintDialog *printDialog = new QPrintDialog(&printer, this);
if (printDialog->exec())
{
QPainter painter(&printer);
m_scores->print(painter, printer.width(), printer.height());
}
delete printDialog;
-#endif
}
void kiriki::nextTurn()