From a2e6610762ee1f77d70492cfa1ec27911b226593 Mon Sep 17 00:00:00 2001 From: Arindam Chaudhuri Date: Sat, 12 Jun 2021 07:09:03 +0530 Subject: [PATCH] added : Qt5 compatibility --- .gitignore | 2 +- README.md | 4 ++-- src/colors/grayscale-local/grayscale-local.pro | 2 ++ src/colors/grayscale-local/grayscale_local.cpp | 4 +++- src/colors/grayscale-local/grayscale_local.h | 3 +++ src/colors/invert/invert.cpp | 5 +++-- src/colors/invert/invert.h | 3 +++ src/colors/invert/invert.pro | 2 ++ src/colors/stretch-histogram/stretch-histogram.pro | 2 ++ src/colors/stretch-histogram/stretch_histogram.cpp | 4 +++- src/colors/stretch-histogram/stretch_histogram.h | 3 +++ src/colors/unalpha/unalpha.cpp | 5 +++-- src/colors/unalpha/unalpha.h | 3 +++ src/colors/unalpha/unalpha.pro | 2 ++ src/decorate/photo-frame/photo-frame.pro | 2 ++ src/decorate/photo-frame/photo_frame.cpp | 5 ++++- src/decorate/photo-frame/photo_frame.h | 3 +++ src/effects/kuwahara/kuwahara.cpp | 4 +++- src/effects/kuwahara/kuwahara.h | 3 +++ src/effects/kuwahara/kuwahara.pro | 2 ++ src/effects/tone-mapping/tone-mapping.pro | 2 ++ src/effects/tone-mapping/tone_mapping.cpp | 4 +++- src/effects/tone-mapping/tone_mapping.h | 3 +++ src/plugin.h | 3 ++- src/threshold/bimodal-adaptive/bimodal-adaptive.pro | 2 ++ src/threshold/bimodal-adaptive/bimodal_adaptive.cpp | 5 +++-- src/threshold/bimodal-adaptive/bimodal_adaptive.h | 3 +++ src/threshold/bimodal-threshold/bimodal-threshold.pro | 2 ++ src/threshold/bimodal-threshold/bimodal_thresh.cpp | 5 +++-- src/threshold/bimodal-threshold/bimodal_thresh.h | 3 +++ src/threshold/dalg/dalg.cpp | 5 +++-- src/threshold/dalg/dalg.h | 3 +++ src/threshold/dalg/dalg.pro | 2 ++ src/threshold/dither/dither.cpp | 5 +++-- src/threshold/dither/dither.h | 3 +++ src/threshold/dither/dither.pro | 2 ++ src/threshold/quant/quant.cpp | 5 +++-- src/threshold/quant/quant.h | 3 +++ src/threshold/quant/quant.pro | 2 ++ src/threshold/threshold-bg-scale/threshold-bg-scale.pro | 2 ++ src/threshold/threshold-bg-scale/threshold_bg_scale.cpp | 4 +++- src/threshold/threshold-bg-scale/threshold_bg_scale.h | 3 +++ src/tools/histogram-viewer/histogram-viewer.pro | 2 ++ src/tools/histogram-viewer/histogram_viewer.cpp | 4 +++- src/tools/histogram-viewer/histogram_viewer.h | 3 +++ src/transform/deskew/deskew.cpp | 5 +++-- src/transform/deskew/deskew.h | 3 +++ src/transform/deskew/deskew.pro | 2 ++ src/transform/geoconformal/geoconformal.cpp | 5 +++-- src/transform/geoconformal/geoconformal.h | 3 +++ src/transform/geoconformal/geoconformal.pro | 2 ++ src/transform/pixart-scaler/pixart-scaler.pro | 2 ++ src/transform/pixart-scaler/pixart_scaler.cpp | 4 +++- src/transform/pixart-scaler/pixart_scaler.h | 3 +++ src/transform/ris-scaler/ris-scaler.pro | 2 ++ src/transform/ris-scaler/ris_scaler.cpp | 4 +++- src/transform/ris-scaler/ris_scaler.h | 3 +++ 57 files changed, 150 insertions(+), 31 deletions(-) diff --git a/.gitignore b/.gitignore index a146957..15102b3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ # Auto-genereated files Makefile -moc_*.cpp +.qmake.stash build/ TODO diff --git a/README.md b/README.md index bcbdefa..ff162bf 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,11 @@ A set of plugins for the viewer [photoquick](https://github.com/ImageProcessing- * libgomp1 ### Build - +It can be built with either Qt4 or Qt5 #### Linux Install dependencies... **Build dependencies ...** - * libqt4-dev + * libqt4-dev or qtbase5-dev To build this program, extract the source code zip. Open terminal and change directory to src/ diff --git a/src/colors/grayscale-local/grayscale-local.pro b/src/colors/grayscale-local/grayscale-local.pro index 6aa62b7..cc64f5b 100644 --- a/src/colors/grayscale-local/grayscale-local.pro +++ b/src/colors/grayscale-local/grayscale-local.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 QMAKE_LFLAGS += -s LIBS += +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/colors/grayscale-local/grayscale_local.cpp b/src/colors/grayscale-local/grayscale_local.cpp index aeae05a..25dcd24 100644 --- a/src/colors/grayscale-local/grayscale_local.cpp +++ b/src/colors/grayscale-local/grayscale_local.cpp @@ -9,7 +9,9 @@ #define PLUGIN_NAME "GrayScale (Local)" #define PLUGIN_VERSION "1.0" -Q_EXPORT_PLUGIN2(grayscale-local, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(grayscale-local, FilterPlugin); +#endif QImage color2gray(QImage &image, int radius, int samples, int iterations, bool enhance_shadows); diff --git a/src/colors/grayscale-local/grayscale_local.h b/src/colors/grayscale-local/grayscale_local.h index 7406dc4..2922327 100644 --- a/src/colors/grayscale-local/grayscale_local.h +++ b/src/colors/grayscale-local/grayscale_local.h @@ -12,6 +12,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/colors/invert/invert.cpp b/src/colors/invert/invert.cpp index 53eaf78..250f039 100644 --- a/src/colors/invert/invert.cpp +++ b/src/colors/invert/invert.cpp @@ -4,8 +4,9 @@ #define PLUGIN_MENU "Filters/Color/Invert%Negative" #define PLUGIN_VERSION "4.3.3" -// first parameter is name of plugin, usually same as the library file name -Q_EXPORT_PLUGIN2(invert, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(invert, FilterPlugin); +#endif //********* ---------- Invert Colors or Negate --------- ********** // void invert(QImage &img) diff --git a/src/colors/invert/invert.h b/src/colors/invert/invert.h index c48a8a7..b38f812 100644 --- a/src/colors/invert/invert.h +++ b/src/colors/invert/invert.h @@ -5,6 +5,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/colors/invert/invert.pro b/src/colors/invert/invert.pro index 192b093..871bb3d 100644 --- a/src/colors/invert/invert.pro +++ b/src/colors/invert/invert.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 QMAKE_LFLAGS += -s LIBS += +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/colors/stretch-histogram/stretch-histogram.pro b/src/colors/stretch-histogram/stretch-histogram.pro index 23791e9..1d3c445 100644 --- a/src/colors/stretch-histogram/stretch-histogram.pro +++ b/src/colors/stretch-histogram/stretch-histogram.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 QMAKE_LFLAGS += -s LIBS += +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/colors/stretch-histogram/stretch_histogram.cpp b/src/colors/stretch-histogram/stretch_histogram.cpp index d400067..6c57b20 100644 --- a/src/colors/stretch-histogram/stretch_histogram.cpp +++ b/src/colors/stretch-histogram/stretch_histogram.cpp @@ -7,7 +7,9 @@ #define PLUGIN_MENU "Filters/Color/Histogram Equalize" #define PLUGIN_VERSION "1.0" -Q_EXPORT_PLUGIN2(stretch-histogram, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(stretch-histogram, FilterPlugin); +#endif //*********** ------------ Stretch Histogram ----------- ************ // /* This filter gives same effect as GIMP Colors->Auto->Equalize diff --git a/src/colors/stretch-histogram/stretch_histogram.h b/src/colors/stretch-histogram/stretch_histogram.h index c48a8a7..b38f812 100644 --- a/src/colors/stretch-histogram/stretch_histogram.h +++ b/src/colors/stretch-histogram/stretch_histogram.h @@ -5,6 +5,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/colors/unalpha/unalpha.cpp b/src/colors/unalpha/unalpha.cpp index 837d764..c700da4 100644 --- a/src/colors/unalpha/unalpha.cpp +++ b/src/colors/unalpha/unalpha.cpp @@ -4,8 +4,9 @@ #define PLUGIN_MENU "Filters/Color/UnAlpha" #define PLUGIN_VERSION "1.0" -// first parameter is name of plugin, usually same as the library file name -Q_EXPORT_PLUGIN2(unalpha, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(unalpha, FilterPlugin); +#endif // ********************** Unalpha ********************* diff --git a/src/colors/unalpha/unalpha.h b/src/colors/unalpha/unalpha.h index c48a8a7..b38f812 100644 --- a/src/colors/unalpha/unalpha.h +++ b/src/colors/unalpha/unalpha.h @@ -5,6 +5,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/colors/unalpha/unalpha.pro b/src/colors/unalpha/unalpha.pro index f540cab..2e5cd61 100644 --- a/src/colors/unalpha/unalpha.pro +++ b/src/colors/unalpha/unalpha.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 QMAKE_LFLAGS += -s LIBS += +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/decorate/photo-frame/photo-frame.pro b/src/decorate/photo-frame/photo-frame.pro index 1c07ab5..a39ecc2 100644 --- a/src/decorate/photo-frame/photo-frame.pro +++ b/src/decorate/photo-frame/photo-frame.pro @@ -12,6 +12,8 @@ QMAKE_CXXFLAGS = -std=c++11 QMAKE_LFLAGS += -s LIBS += +QT += widgets + UI_DIR = $$DESTDIR/build MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/decorate/photo-frame/photo_frame.cpp b/src/decorate/photo-frame/photo_frame.cpp index 14922d2..15a5ff7 100644 --- a/src/decorate/photo-frame/photo_frame.cpp +++ b/src/decorate/photo-frame/photo_frame.cpp @@ -2,12 +2,15 @@ Copyright (C) 2021 Arindam Chaudhuri */ #include "photo_frame.h" +#include #define PLUGIN_NAME "Photo Frame" #define PLUGIN_MENU "Decorate/Add Photo Frame" #define PLUGIN_VERSION "1.0" -Q_EXPORT_PLUGIN2(photo-frame, ToolPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(photo-frame, ToolPlugin); +#endif #define MIN(a,b) ((a)<(b) ? (a):(b)) diff --git a/src/decorate/photo-frame/photo_frame.h b/src/decorate/photo-frame/photo_frame.h index 29d058d..b0334e7 100644 --- a/src/decorate/photo-frame/photo_frame.h +++ b/src/decorate/photo-frame/photo_frame.h @@ -15,6 +15,9 @@ class ToolPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/effects/kuwahara/kuwahara.cpp b/src/effects/kuwahara/kuwahara.cpp index 07e7b20..c23c9a5 100644 --- a/src/effects/kuwahara/kuwahara.cpp +++ b/src/effects/kuwahara/kuwahara.cpp @@ -4,7 +4,9 @@ #define PLUGIN_MENU "Filters/Effects/Kuwahara Filter" #define PLUGIN_VERSION "1.0" -Q_EXPORT_PLUGIN2(kuwahara, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(kuwahara, FilterPlugin); +#endif // takes 4 pixels and a floating point coordinate, returns bilinear interpolated pixel QRgb interpolateBilinear(float x, float y, QRgb p00, QRgb p01, QRgb p10, QRgb p11) diff --git a/src/effects/kuwahara/kuwahara.h b/src/effects/kuwahara/kuwahara.h index c7b230d..585cb5b 100644 --- a/src/effects/kuwahara/kuwahara.h +++ b/src/effects/kuwahara/kuwahara.h @@ -7,6 +7,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/effects/kuwahara/kuwahara.pro b/src/effects/kuwahara/kuwahara.pro index 4e58278..806fcb5 100644 --- a/src/effects/kuwahara/kuwahara.pro +++ b/src/effects/kuwahara/kuwahara.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 -fopenmp QMAKE_LFLAGS += -s LIBS += -lgomp +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/effects/tone-mapping/tone-mapping.pro b/src/effects/tone-mapping/tone-mapping.pro index 099e2d0..471590e 100644 --- a/src/effects/tone-mapping/tone-mapping.pro +++ b/src/effects/tone-mapping/tone-mapping.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 -fopenmp QMAKE_LFLAGS += -s -lgomp LIBS += +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/effects/tone-mapping/tone_mapping.cpp b/src/effects/tone-mapping/tone_mapping.cpp index 1c37fae..0b7918b 100644 --- a/src/effects/tone-mapping/tone_mapping.cpp +++ b/src/effects/tone-mapping/tone_mapping.cpp @@ -6,7 +6,9 @@ #define PLUGIN_NAME "Tone Mapping" #define PLUGIN_VERSION "1.0" -Q_EXPORT_PLUGIN2(tone-mapping, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(tone-mapping, FilterPlugin); +#endif void toneMapping_mantiuk06(QImage &img, float contrast=0.1, float saturation=0.8); diff --git a/src/effects/tone-mapping/tone_mapping.h b/src/effects/tone-mapping/tone_mapping.h index 2cefbfa..d83a679 100644 --- a/src/effects/tone-mapping/tone_mapping.h +++ b/src/effects/tone-mapping/tone_mapping.h @@ -11,6 +11,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/plugin.h b/src/plugin.h index 3771b4f..3aed41e 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -71,7 +71,8 @@ class Plugin virtual void sendNotification(QString title, QString message) = 0; }; +#define Plugin_iid "photoquick.Plugin/1.0" -Q_DECLARE_INTERFACE(Plugin, "photoquick.Plugin"); +Q_DECLARE_INTERFACE(Plugin, Plugin_iid); #endif /* __PHOTOQUIK_PLUGIN */ diff --git a/src/threshold/bimodal-adaptive/bimodal-adaptive.pro b/src/threshold/bimodal-adaptive/bimodal-adaptive.pro index 6ead305..1663f3f 100644 --- a/src/threshold/bimodal-adaptive/bimodal-adaptive.pro +++ b/src/threshold/bimodal-adaptive/bimodal-adaptive.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 -fopenmp QMAKE_LFLAGS += -s LIBS += -lgomp +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/threshold/bimodal-adaptive/bimodal_adaptive.cpp b/src/threshold/bimodal-adaptive/bimodal_adaptive.cpp index 01fc3c9..6e3f8d1 100644 --- a/src/threshold/bimodal-adaptive/bimodal_adaptive.cpp +++ b/src/threshold/bimodal-adaptive/bimodal_adaptive.cpp @@ -4,8 +4,9 @@ #define PLUGIN_MENU "Filters/Threshold/Bimodal adaptive" #define PLUGIN_VERSION "4.4.3" -// first parameter is name of plugin, usually same as the library file name -Q_EXPORT_PLUGIN2(adaptive_bimodal, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(adaptive_bimodal, FilterPlugin); +#endif int SelectChannelPixel(QRgb pix, int channel) { diff --git a/src/threshold/bimodal-adaptive/bimodal_adaptive.h b/src/threshold/bimodal-adaptive/bimodal_adaptive.h index 675440d..9135768 100644 --- a/src/threshold/bimodal-adaptive/bimodal_adaptive.h +++ b/src/threshold/bimodal-adaptive/bimodal_adaptive.h @@ -19,6 +19,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/threshold/bimodal-threshold/bimodal-threshold.pro b/src/threshold/bimodal-threshold/bimodal-threshold.pro index 538f734..90fa172 100644 --- a/src/threshold/bimodal-threshold/bimodal-threshold.pro +++ b/src/threshold/bimodal-threshold/bimodal-threshold.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 -fopenmp QMAKE_LFLAGS += -s LIBS += -lgomp +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/threshold/bimodal-threshold/bimodal_thresh.cpp b/src/threshold/bimodal-threshold/bimodal_thresh.cpp index dbd8543..7ba708e 100644 --- a/src/threshold/bimodal-threshold/bimodal_thresh.cpp +++ b/src/threshold/bimodal-threshold/bimodal_thresh.cpp @@ -4,8 +4,9 @@ #define PLUGIN_MENU "Filters/Threshold/Bimodal" #define PLUGIN_VERSION "1.1" -// first parameter is name of plugin, usually same as the library file name -Q_EXPORT_PLUGIN2(bimodal_thresh, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(bimodal_thresh, FilterPlugin); +#endif // ********************** Bimodal Threshold ********************* int histogram_darkest(long long hist[]) diff --git a/src/threshold/bimodal-threshold/bimodal_thresh.h b/src/threshold/bimodal-threshold/bimodal_thresh.h index 315d6b9..5a56b80 100644 --- a/src/threshold/bimodal-threshold/bimodal_thresh.h +++ b/src/threshold/bimodal-threshold/bimodal_thresh.h @@ -11,6 +11,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/threshold/dalg/dalg.cpp b/src/threshold/dalg/dalg.cpp index 559c577..13f12b1 100644 --- a/src/threshold/dalg/dalg.cpp +++ b/src/threshold/dalg/dalg.cpp @@ -4,8 +4,9 @@ #define PLUGIN_MENU "Filters/Threshold/Dalg" #define PLUGIN_VERSION "1.0" -// first parameter is name of plugin, usually same as the library file name -Q_EXPORT_PLUGIN2(dalg_thresh, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(dalg_thresh, FilterPlugin); +#endif // **** D-algoritm dither **** void dalg(QImage &img, unsigned tcount, int tdelta) diff --git a/src/threshold/dalg/dalg.h b/src/threshold/dalg/dalg.h index 3b044bf..ff0a05c 100644 --- a/src/threshold/dalg/dalg.h +++ b/src/threshold/dalg/dalg.h @@ -10,6 +10,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/threshold/dalg/dalg.pro b/src/threshold/dalg/dalg.pro index 053045a..fc6b4c5 100644 --- a/src/threshold/dalg/dalg.pro +++ b/src/threshold/dalg/dalg.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 -fopenmp QMAKE_LFLAGS += -s LIBS += -lgomp +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/threshold/dither/dither.cpp b/src/threshold/dither/dither.cpp index 97e9899..8fd0081 100644 --- a/src/threshold/dither/dither.cpp +++ b/src/threshold/dither/dither.cpp @@ -4,8 +4,9 @@ #define PLUGIN_MENU "Filters/Threshold/Dither" #define PLUGIN_VERSION "1.0" -// first parameter is name of plugin, usually same as the library file name -Q_EXPORT_PLUGIN2(dither_thresh, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(dither_thresh, FilterPlugin); +#endif // **** Dither of D.E.Knuth "Computer Typesetting" **** void dither(QImage &img, unsigned tcount, int tdelta, int kpg) diff --git a/src/threshold/dither/dither.h b/src/threshold/dither/dither.h index b868981..c182562 100644 --- a/src/threshold/dither/dither.h +++ b/src/threshold/dither/dither.h @@ -10,6 +10,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/threshold/dither/dither.pro b/src/threshold/dither/dither.pro index 6fc4717..550bc68 100644 --- a/src/threshold/dither/dither.pro +++ b/src/threshold/dither/dither.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 -fopenmp QMAKE_LFLAGS += -s LIBS += -lgomp +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/threshold/quant/quant.cpp b/src/threshold/quant/quant.cpp index 3fd5027..2a7e649 100644 --- a/src/threshold/quant/quant.cpp +++ b/src/threshold/quant/quant.cpp @@ -4,8 +4,9 @@ #define PLUGIN_MENU "Filters/Threshold/Quant" #define PLUGIN_VERSION "1.0" -// first parameter is name of plugin, usually same as the library file name -Q_EXPORT_PLUGIN2(quant, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(quant, FilterPlugin); +#endif // ********************** Quant Simple ********************* diff --git a/src/threshold/quant/quant.h b/src/threshold/quant/quant.h index abc7f6b..28ced2e 100644 --- a/src/threshold/quant/quant.h +++ b/src/threshold/quant/quant.h @@ -10,6 +10,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/threshold/quant/quant.pro b/src/threshold/quant/quant.pro index 82c3a0b..d854ee9 100644 --- a/src/threshold/quant/quant.pro +++ b/src/threshold/quant/quant.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 -fopenmp QMAKE_LFLAGS += -s LIBS += -lgomp +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/threshold/threshold-bg-scale/threshold-bg-scale.pro b/src/threshold/threshold-bg-scale/threshold-bg-scale.pro index f837042..fc6da69 100644 --- a/src/threshold/threshold-bg-scale/threshold-bg-scale.pro +++ b/src/threshold/threshold-bg-scale/threshold-bg-scale.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 QMAKE_LFLAGS += -s LIBS += +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/threshold/threshold-bg-scale/threshold_bg_scale.cpp b/src/threshold/threshold-bg-scale/threshold_bg_scale.cpp index 2706674..b8598e0 100644 --- a/src/threshold/threshold-bg-scale/threshold_bg_scale.cpp +++ b/src/threshold/threshold-bg-scale/threshold_bg_scale.cpp @@ -4,7 +4,9 @@ #define PLUGIN_MENU "Filters/Threshold/BG Scale" #define PLUGIN_VERSION "1.0" -Q_EXPORT_PLUGIN2(threshold-bg-scale, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(threshold-bg-scale, FilterPlugin); +#endif //***** ------ Threshold by difference from Blurred Background ----- ***** // void thresholdBgScale(QImage &img, int thresh, int scaledW) diff --git a/src/threshold/threshold-bg-scale/threshold_bg_scale.h b/src/threshold/threshold-bg-scale/threshold_bg_scale.h index 6e88563..a80bc52 100644 --- a/src/threshold/threshold-bg-scale/threshold_bg_scale.h +++ b/src/threshold/threshold-bg-scale/threshold_bg_scale.h @@ -10,6 +10,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/tools/histogram-viewer/histogram-viewer.pro b/src/tools/histogram-viewer/histogram-viewer.pro index 99eec2e..b7bdddc 100644 --- a/src/tools/histogram-viewer/histogram-viewer.pro +++ b/src/tools/histogram-viewer/histogram-viewer.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 QMAKE_LFLAGS += -s LIBS += +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/tools/histogram-viewer/histogram_viewer.cpp b/src/tools/histogram-viewer/histogram_viewer.cpp index 1e36e4c..0f28298 100644 --- a/src/tools/histogram-viewer/histogram_viewer.cpp +++ b/src/tools/histogram-viewer/histogram_viewer.cpp @@ -7,7 +7,9 @@ #define PLUGIN_MENU "Info/Histogram Viewer" #define PLUGIN_VERSION "1.0" -Q_EXPORT_PLUGIN2(histogram-viewer, ToolPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(histogram-viewer, ToolPlugin); +#endif //********* ---------- Histogram Viewer --------- ********** // diff --git a/src/tools/histogram-viewer/histogram_viewer.h b/src/tools/histogram-viewer/histogram_viewer.h index d16f9cc..eb008ad 100644 --- a/src/tools/histogram-viewer/histogram_viewer.h +++ b/src/tools/histogram-viewer/histogram_viewer.h @@ -12,6 +12,9 @@ class ToolPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/transform/deskew/deskew.cpp b/src/transform/deskew/deskew.cpp index 595389b..48386f9 100644 --- a/src/transform/deskew/deskew.cpp +++ b/src/transform/deskew/deskew.cpp @@ -4,8 +4,9 @@ #define PLUGIN_MENU "Transform/Geometry/DeSkew" #define PLUGIN_VERSION "4.4.3" -// first parameter is name of plugin, usually same as the library file name -Q_EXPORT_PLUGIN2(deskew, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(deskew, FilterPlugin); +#endif // ---------------------------------------------------------- diff --git a/src/transform/deskew/deskew.h b/src/transform/deskew/deskew.h index 9c78f31..23c86bf 100644 --- a/src/transform/deskew/deskew.h +++ b/src/transform/deskew/deskew.h @@ -12,6 +12,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/transform/deskew/deskew.pro b/src/transform/deskew/deskew.pro index 91372ad..8f1eb1f 100644 --- a/src/transform/deskew/deskew.pro +++ b/src/transform/deskew/deskew.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 -fopenmp QMAKE_LFLAGS += -s LIBS += -lgomp +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/transform/geoconformal/geoconformal.cpp b/src/transform/geoconformal/geoconformal.cpp index 260b877..d9475b0 100644 --- a/src/transform/geoconformal/geoconformal.cpp +++ b/src/transform/geoconformal/geoconformal.cpp @@ -5,8 +5,9 @@ #define PLUGIN_MENU "Transform/Geometry/GeoConformal" #define PLUGIN_VERSION "0.20210416" -// first parameter is name of plugin, usually same as the library file name -Q_EXPORT_PLUGIN2(geoconformal, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(geoconformal, FilterPlugin); +#endif // ********************** Geo Conformal ********************* diff --git a/src/transform/geoconformal/geoconformal.h b/src/transform/geoconformal/geoconformal.h index 15c5aae..cc16f6b 100644 --- a/src/transform/geoconformal/geoconformal.h +++ b/src/transform/geoconformal/geoconformal.h @@ -12,6 +12,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/transform/geoconformal/geoconformal.pro b/src/transform/geoconformal/geoconformal.pro index 2f38ec2..b56af8d 100644 --- a/src/transform/geoconformal/geoconformal.pro +++ b/src/transform/geoconformal/geoconformal.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 -fopenmp QMAKE_LFLAGS += -s LIBS += -lgomp +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/transform/pixart-scaler/pixart-scaler.pro b/src/transform/pixart-scaler/pixart-scaler.pro index 2476d86..ab3501f 100644 --- a/src/transform/pixart-scaler/pixart-scaler.pro +++ b/src/transform/pixart-scaler/pixart-scaler.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 QMAKE_LFLAGS += -s LIBS += +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/transform/pixart-scaler/pixart_scaler.cpp b/src/transform/pixart-scaler/pixart_scaler.cpp index 52638e8..3d1b56b 100644 --- a/src/transform/pixart-scaler/pixart_scaler.cpp +++ b/src/transform/pixart-scaler/pixart_scaler.cpp @@ -7,7 +7,9 @@ #define PLUGIN_MENU "Transform/Upscale Icon" #define PLUGIN_VERSION "1.2" -Q_EXPORT_PLUGIN2(pixart-scaler, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(pixart-scaler, FilterPlugin); +#endif void FilterPlugin:: UpcaleX(int method, int n/*factor*/) { diff --git a/src/transform/pixart-scaler/pixart_scaler.h b/src/transform/pixart-scaler/pixart_scaler.h index a763731..53f8f25 100644 --- a/src/transform/pixart-scaler/pixart_scaler.h +++ b/src/transform/pixart-scaler/pixart_scaler.h @@ -13,6 +13,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem(); diff --git a/src/transform/ris-scaler/ris-scaler.pro b/src/transform/ris-scaler/ris-scaler.pro index 5ad9b5d..99c61f2 100644 --- a/src/transform/ris-scaler/ris-scaler.pro +++ b/src/transform/ris-scaler/ris-scaler.pro @@ -11,6 +11,8 @@ QMAKE_CXXFLAGS = -std=c++11 QMAKE_LFLAGS += -s LIBS += +QT += widgets + MOC_DIR = $$DESTDIR/build OBJECTS_DIR = $$DESTDIR/build diff --git a/src/transform/ris-scaler/ris_scaler.cpp b/src/transform/ris-scaler/ris_scaler.cpp index 05177af..3840e2b 100644 --- a/src/transform/ris-scaler/ris_scaler.cpp +++ b/src/transform/ris-scaler/ris_scaler.cpp @@ -4,7 +4,9 @@ #define PLUGIN_MENU "Transform/RIS" #define PLUGIN_VERSION "1.0" -Q_EXPORT_PLUGIN2(ris-scaler, FilterPlugin); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + Q_EXPORT_PLUGIN2(ris-scaler, FilterPlugin); +#endif void FilterPlugin:: filterHRISX(int n/*factor*/) { diff --git a/src/transform/ris-scaler/ris_scaler.h b/src/transform/ris-scaler/ris_scaler.h index 2f33814..5a84d87 100644 --- a/src/transform/ris-scaler/ris_scaler.h +++ b/src/transform/ris-scaler/ris_scaler.h @@ -13,6 +13,9 @@ class FilterPlugin : public QObject, Plugin { Q_OBJECT Q_INTERFACES(Plugin) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + Q_PLUGIN_METADATA(IID Plugin_iid) +#endif public: QString menuItem();