diff --git a/katarakt.pro b/katarakt.pro
index da4cded2d2492b3f577678bccd52ab3f863772e0..3da73f5afe651357f2a73df1db8926d48dbc07b5 100644
--- a/katarakt.pro
+++ b/katarakt.pro
@@ -10,7 +10,6 @@ greaterThan(QT_MAJOR_VERSION, 4) {
     DEFINES += QT_DEPRECATED_WARNINGS
 }
 POPPLER = poppler-qt$$QT_MAJOR_VERSION
-DEFINES += POPPLER_QT=$$QT_MAJOR_VERSION
 
 unix {
     CONFIG += link_pkgconfig
diff --git a/src/kpage.h b/src/kpage.h
index 705cf24aa70178f48dac94892f22e6c662e19c14..edd348f0c86a4b03f50ddf767746d16196122c58 100644
--- a/src/kpage.h
+++ b/src/kpage.h
@@ -3,10 +3,10 @@
 
 #include <QImage>
 #include <QMutex>
-#if POPPLER_QT >= 5
-#include <poppler-qt5.h>
+#if QT_VERSION >= 0x050000
+#	include <poppler-qt5.h>
 #else
-#include <poppler-qt4.h>
+#	include <poppler-qt4.h>
 #endif
 
 
diff --git a/src/layout/layout.h b/src/layout/layout.h
index ad3d5423608730be642c62c49c41bd5a3b3c0f16..1d33530dbe34890fbef53dd168694cbb2161d92c 100644
--- a/src/layout/layout.h
+++ b/src/layout/layout.h
@@ -4,10 +4,10 @@
 #include <QPainter>
 #include <QList>
 #include <QClipboard>
-#if POPPLER_QT >= 5
-#include <poppler-qt5.h>
+#if QT_VERSION >= 0x050000
+#	include <poppler-qt5.h>
 #else
-#include <poppler-qt4.h>
+#	include <poppler-qt4.h>
 #endif
 #include <map>
 #include "../selection.h"
diff --git a/src/resourcemanager.h b/src/resourcemanager.h
index 916d633abc6dc89f8a94d20438d027fe8ab7bf28..6211aa363a3343a8c7b99ac381eaf94cd604b289 100644
--- a/src/resourcemanager.h
+++ b/src/resourcemanager.h
@@ -1,17 +1,17 @@
 #ifndef RESOURCEMANAGER_H
 #define RESOURCEMANAGER_H
 
-#if POPPLER_QT >= 5
-#include <poppler-qt5.h>
-#else
-#include <poppler-qt4.h>
-#endif
 #include <QObject>
 #include <QString>
 #include <QImage>
 #include <QThread>
 #include <QMutex>
 #include <QSemaphore>
+#if QT_VERSION >= 0x050000
+#	include <poppler-qt5.h>
+#else
+#	include <poppler-qt4.h>
+#endif
 #include <list>
 #include <set>
 
diff --git a/src/search.h b/src/search.h
index 2ac0fdbddb83564d6934f37ae261e276ace78f2c..48256158c84af09365bdfc4c1d80448fb1427158 100644
--- a/src/search.h
+++ b/src/search.h
@@ -1,11 +1,6 @@
 #ifndef SEARCH_H
 #define SEARCH_H
 
-#if POPPLER_QT >= 5
-#include <poppler-qt5.h>
-#else
-#include <poppler-qt4.h>
-#endif
 #include <QString>
 #include <QThread>
 #include <QMutex>
@@ -16,6 +11,11 @@
 #include <QRect>
 #include <QEvent>
 #include <QList>
+#if QT_VERSION >= 0x050000
+#	include <poppler-qt5.h>
+#else
+#	include <poppler-qt4.h>
+#endif
 
 
 class SearchBar;
diff --git a/src/selection.cpp b/src/selection.cpp
index 24b17620f05bb7c0ad8f83c127d31ab37d2a99b5..7896f165149c4ece656847150c964b6666a3cc1b 100644
--- a/src/selection.cpp
+++ b/src/selection.cpp
@@ -59,11 +59,7 @@ QRectF SelectionLine::get_bbox() const {
 }
 
 void SelectionLine::sort() {
-#if QT_VERSION >= 0x050000
-	std::stable_sort(parts.begin(), parts.end(), selection_less_x);
-#else
-	qStableSort(parts.begin(), parts.end(), selection_less_x);
-#endif
+	stable_sort(parts.begin(), parts.end(), selection_less_x);
 }
 
 bool selection_less_x(const SelectionPart *a, const SelectionPart *b) {
diff --git a/src/selection.h b/src/selection.h
index e0debb6f93bd6683889207f22414d74185fb9afe..2dbb0309091960ab5d5ec4bdd8d6d8d839c8b9b3 100644
--- a/src/selection.h
+++ b/src/selection.h
@@ -1,12 +1,12 @@
 #ifndef SELECTIONPART_H
 #define SELECTIONPART_H
 
-#if POPPLER_QT >= 5
-#include <poppler-qt5.h>
+#include <QRectF>
+#if QT_VERSION >= 0x050000
+#	include <poppler-qt5.h>
 #else
-#include <poppler-qt4.h>
+#	include <poppler-qt4.h>
 #endif
-#include <QRectF>
 
 
 namespace Selection {
diff --git a/src/worker.cpp b/src/worker.cpp
index 51cb940529c00cfdc3d4934cf422e044611bb0ea..48beafaadd1fe5ae293a1bd4acf04923e69a4414 100644
--- a/src/worker.cpp
+++ b/src/worker.cpp
@@ -7,10 +7,10 @@
 #include "config.h"
 #include <list>
 #include <iostream>
-#if POPPLER_QT >= 5
-#include <poppler-qt5.h>
+#if QT_VERSION >= 0x050000
+#	include <poppler-qt5.h>
 #else
-#include <poppler-qt4.h>
+#	include <poppler-qt4.h>
 #endif
 
 using namespace std;
@@ -195,11 +195,7 @@ void Worker::run() {
 			}
 
 			// sort by y coordinate
-#if QT_VERSION >= 0x050000
-			std::stable_sort(selection_parts.begin(), selection_parts.end(), selection_less_y);
-#else
-			qStableSort(selection_parts.begin(), selection_parts.end(), selection_less_y);
-#endif
+			stable_sort(selection_parts.begin(), selection_parts.end(), selection_less_y);
 
 			QRectF line_box;
 			QList<SelectionLine *> *lines = new QList<SelectionLine *>();