diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 9e67a1c7d3..df410da4e4 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -67,21 +67,50 @@ endif() if(JKQtPlotter_BUILD_EXAMPLES) # custom target that generates the images for the JKQTMathText documentation - set(JKQTPlotter_GenerateDocScreenshots_DefaultOptions --screenshotdir="${CMAKE_CURRENT_LIST_DIR}/../screenshots/" --screenshot --smallscreenshotplot) + set(JKQTPlotter_GenerateDocScreenshots_DefaultOptions --screenshotdir="${CMAKE_CURRENT_LIST_DIR}/../screenshots/" --screenshot --disablehighdpi ) + # list examples for which to save a screenshot + # the output basename equals the example name in this list, + # unless you specify the basenames by adding it/them after a slash '/' + # e.g. "barchart/barchart,barchart_hor" set(JKQTPlotter_GenerateDocScreenshots_From scatter + simpletest + barchart/barchart_hor,barchart + wiggleplots/wiggleplot_x,wiggleplot_y + advplotstyling/advancedlineandfillstyling + boxplot + contourplot + violinplot/violinplot_hor,violinplot_vert + errorbarstyles + dateaxes/dateaxes,dateaxes_timeaxis + distributionplot/test_distributionplot + evalcurve + filledgraphs + functionplot/functionplot,functionplot_fy + styledboxplot + test_multiplot ) add_custom_target(JKQTPlotter_GenerateDocScreenshots COMMENT "Building JKQTPlotter Documentation Screenshots ..." ) - foreach(example ${JKQTPlotter_GenerateDocScreenshots_From}) + foreach(ex ${JKQTPlotter_GenerateDocScreenshots_From}) + string(REGEX MATCH "(.+)/(.+)" dummy ${ex}) + if(CMAKE_MATCH_1 STREQUAL "" OR CMAKE_MATCH_2 STREQUAL "") + set(example ${ex}) + set(basename ${ex}) + else() + set(example ${CMAKE_MATCH_1}) + set(basename ${CMAKE_MATCH_2}) + endif() + set(loc_target_name JKQTPlotter_GenerateDocScreenshots_${example}) set(dep_name jkqtptest_${example}) + string(TOUPPER ${example} example_upper) add_custom_target(${loc_target_name} - COMMENT "Building JKQTPlotter Documentation Screenshot: ${loc_name_upper}" - COMMAND $ ${JKQTPlotter_GenerateDocScreenshots_DefaultOptions} --screenshotbasename=${example} + COMMENT "Building JKQTPlotter Documentation Screenshot: ${example_upper}" + COMMAND $ ${JKQTPlotter_GenerateDocScreenshots_DefaultOptions} --screenshotbasename=${basename} WORKING_DIRECTORY ${JKQtPlotter_QT_BINDIR} DEPENDS ${dep_name} ) @@ -90,6 +119,9 @@ if(JKQtPlotter_BUILD_EXAMPLES) unset(loc_target_name) unset(dep_name) + unset(example) + unset(example_upper) + unset(basename) endforeach() endif() diff --git a/doc/dox/examples_and_tutorials.dox b/doc/dox/examples_and_tutorials.dox index 00e02e28d9..5b7de6e646 100644 --- a/doc/dox/examples_and_tutorials.dox +++ b/doc/dox/examples_and_tutorials.dox @@ -13,7 +13,7 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
ScreenshotDescriptionNotes -
\image html jkqtplotter_simpletest1_small.png +
\image html simpletest_small.png \subpage JKQTPlotterSimpleTest `JKQTPXYLineGraph`
C++-style QVector arrays of data
\image html scatter_small.png diff --git a/doc/images/jkqtmathtext/jkqtmathtext_utf8.png b/doc/images/jkqtmathtext/jkqtmathtext_utf8.png index 86a2e74075..a2225b8c89 100644 Binary files a/doc/images/jkqtmathtext/jkqtmathtext_utf8.png and b/doc/images/jkqtmathtext/jkqtmathtext_utf8.png differ diff --git a/examples/README.md b/examples/README.md index 02fe34215d..8187d62ab5 100644 --- a/examples/README.md +++ b/examples/README.md @@ -7,7 +7,7 @@ All test-projects are Qt-projects that use qmake to build. You can load them int | Screenshot | Description | Notes | |:-------------:| ------------- | ------------- | -| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest1_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest/README.md) | [Very Basic Example (Line Graph)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest/README.md) | `JKQTPXYLineGraph`
C++-style QVector arrays of data | +| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/simpletest_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest/README.md) | [Very Basic Example (Line Graph)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest/README.md) | `JKQTPXYLineGraph`
C++-style QVector arrays of data | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/scatter_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/scatter/README.md) | [Very Basic Example (Scatter Graph)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/scatter/README.md) | `JKQTPXYScatterGraph`
Iterator-Interface for JKQTDatastore | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/speed_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/speed) | [Line Graph with Live Data / Speed Test](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/speed) | `JKQTPXYLineGraph`
external `std::array` data, not owned by datastore
live-data, measure plotting speed
tipps to increas plotting speed | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/symbols_and_styles_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/symbols_and_styles) | [Line Graph with Different Symbols and Line Styles](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/symbols_and_styles) | `JKQTPXYLineGraph`
C++ vector of data
setting line styles and symbol styles
automatic graph coloring | diff --git a/examples/advplotstyling/CMakeLists.txt b/examples/advplotstyling/CMakeLists.txt index cf7d6888cc..8d11bcad30 100644 --- a/examples/advplotstyling/CMakeLists.txt +++ b/examples/advplotstyling/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS advplotstyling.qrc ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/advplotstyling/advplotstyling.cpp b/examples/advplotstyling/advplotstyling.cpp index a5f7ef87cf..bff5097726 100644 --- a/examples/advplotstyling/advplotstyling.cpp +++ b/examples/advplotstyling/advplotstyling.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterAdvancedLineAndFillStyling, JKQTPXYLineGraph, JKQTPSpecialLineHorizontalGraph, JKQTPBarVerticalGraph */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -14,12 +15,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/barchart/CMakeLists.txt b/examples/barchart/CMakeLists.txt index 66aadcf290..d27cfa0ba6 100644 --- a/examples/barchart/CMakeLists.txt +++ b/examples/barchart/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/barchart/barchart.cpp b/examples/barchart/barchart.cpp index 8445cd7b89..f38042e3d6 100644 --- a/examples/barchart/barchart.cpp +++ b/examples/barchart/barchart.cpp @@ -4,10 +4,12 @@ * \ref JKQTPlotterBarcharts */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" #include "jkqtplotter/graphs/jkqtpbarchart.h" +#include "jkqtpexampleapplication.h" #define Ndata 5 @@ -103,12 +105,8 @@ void doExample() int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc,argv); + JKQTPExampleApplication app(argc, argv); doExample(); diff --git a/examples/boxplot/CMakeLists.txt b/examples/boxplot/CMakeLists.txt index a254705cf8..10700b4cf6 100644 --- a/examples/boxplot/CMakeLists.txt +++ b/examples/boxplot/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/boxplot/boxplot.cpp b/examples/boxplot/boxplot.cpp index 28088f9ac2..6d0a3a944b 100644 --- a/examples/boxplot/boxplot.cpp +++ b/examples/boxplot/boxplot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterBoxplotsGraphs */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -12,12 +13,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) @@ -118,7 +115,7 @@ int main(int argc, char* argv[]) // show plotter and make it a decent size plot.show(); - plot.resize(800,800); + plot.resize(600,600); return app.exec(); } diff --git a/examples/cmake_link_example/simpletest.cpp b/examples/cmake_link_example/simpletest.cpp index 5e0646a35f..dd37f07930 100644 --- a/examples/cmake_link_example/simpletest.cpp +++ b/examples/cmake_link_example/simpletest.cpp @@ -4,6 +4,7 @@ * \ref JKQTCMakeLinkExample */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" diff --git a/examples/contourplot/CMakeLists.txt b/examples/contourplot/CMakeLists.txt index 29bb2ed728..e593c6e255 100644 --- a/examples/contourplot/CMakeLists.txt +++ b/examples/contourplot/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS contourplotanimator.h ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/contourplot/contourplot.cpp b/examples/contourplot/contourplot.cpp index 9e2dacf5c9..674364c50f 100644 --- a/examples/contourplot/contourplot.cpp +++ b/examples/contourplot/contourplot.cpp @@ -4,10 +4,12 @@ * \ref JKQTPlotterContourPlot */ +#include "jkqtpexampleapplication.h" #include #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpcontour.h" +#include "jkqtpexampleapplication.h" // if deJKQTPSTATISTICS_PId, an animation is shown //#definJKQTPSTATISTICS_PIIMATE @@ -20,11 +22,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -13,12 +14,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/datastore_groupedstat/CMakeLists.txt b/examples/datastore_groupedstat/CMakeLists.txt index e43e530808..424581b7ba 100644 --- a/examples/datastore_groupedstat/CMakeLists.txt +++ b/examples/datastore_groupedstat/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/datastore_groupedstat/datastore_groupedstat.cpp b/examples/datastore_groupedstat/datastore_groupedstat.cpp index e216af5e21..9d18ee0ccf 100644 --- a/examples/datastore_groupedstat/datastore_groupedstat.cpp +++ b/examples/datastore_groupedstat/datastore_groupedstat.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterBasicJKQTPDatastoreStatisticsGroupedStat */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -19,12 +20,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); diff --git a/examples/datastore_iterators/CMakeLists.txt b/examples/datastore_iterators/CMakeLists.txt index 80648ad1e0..019c20774e 100644 --- a/examples/datastore_iterators/CMakeLists.txt +++ b/examples/datastore_iterators/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/datastore_iterators/datastore_iterators.cpp b/examples/datastore_iterators/datastore_iterators.cpp index 8224555e7b..bd1fc8db43 100644 --- a/examples/datastore_iterators/datastore_iterators.cpp +++ b/examples/datastore_iterators/datastore_iterators.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterBasicJKQTPDatastoreIterators */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -13,12 +14,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/datastore_regression/CMakeLists.txt b/examples/datastore_regression/CMakeLists.txt index 1075e3d220..263b7a9363 100644 --- a/examples/datastore_regression/CMakeLists.txt +++ b/examples/datastore_regression/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/datastore_regression/datastore_regression.cpp b/examples/datastore_regression/datastore_regression.cpp index eb819b15cd..fc005009bf 100644 --- a/examples/datastore_regression/datastore_regression.cpp +++ b/examples/datastore_regression/datastore_regression.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterBasicJKQTPDatastoreRegression */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtppeakstream.h" @@ -19,12 +20,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); diff --git a/examples/datastore_statistics/CMakeLists.txt b/examples/datastore_statistics/CMakeLists.txt index 97cf47fe4d..7f162ea38a 100644 --- a/examples/datastore_statistics/CMakeLists.txt +++ b/examples/datastore_statistics/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/datastore_statistics/datastore_statistics.cpp b/examples/datastore_statistics/datastore_statistics.cpp index 255db1d3d6..06998bc7ba 100644 --- a/examples/datastore_statistics/datastore_statistics.cpp +++ b/examples/datastore_statistics/datastore_statistics.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterBasicJKQTPDatastoreStatistics */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtppeakstream.h" @@ -19,12 +20,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); diff --git a/examples/datastore_statistics_2d/CMakeLists.txt b/examples/datastore_statistics_2d/CMakeLists.txt index 67e5871460..fcde3e9498 100644 --- a/examples/datastore_statistics_2d/CMakeLists.txt +++ b/examples/datastore_statistics_2d/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/datastore_statistics_2d/datastore_statistics_2d.cpp b/examples/datastore_statistics_2d/datastore_statistics_2d.cpp index a983e403e1..fc84d9dfe1 100644 --- a/examples/datastore_statistics_2d/datastore_statistics_2d.cpp +++ b/examples/datastore_statistics_2d/datastore_statistics_2d.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterBasicJKQTPDatastoreStatistics2D */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpimage.h" @@ -19,12 +20,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); QElapsedTimer timer; diff --git a/examples/dateaxes/CMakeLists.txt b/examples/dateaxes/CMakeLists.txt index 518f4f1b34..117a216f76 100644 --- a/examples/dateaxes/CMakeLists.txt +++ b/examples/dateaxes/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ${EXAMPLE_NAME}.qrc) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/dateaxes/dateaxes.cpp b/examples/dateaxes/dateaxes.cpp index af0597c996..98b34c1cd4 100644 --- a/examples/dateaxes/dateaxes.cpp +++ b/examples/dateaxes/dateaxes.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterDateTimeAxes */ +#include "jkqtpexampleapplication.h" #include #include #include @@ -162,26 +163,23 @@ void drawWithTimeAxis(JKQTPlotter& plot) { // 9. show plotter and make it a decent size plot.show(); - plot.resize(600,400); + plot.resize(400,300); plot.setWindowTitle("Time Axis"); } int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); JKQTPlotter plotDate; drawWithDateAxis(plotDate); - plotDate.move(100,100); + //plotDate.move(100,100); + JKQTPlotter plotTime; drawWithTimeAxis(plotTime); - plotTime.move(100,550); + //plotTime.move(100,550); return app.exec(); } diff --git a/examples/distributionplot/CMakeLists.txt b/examples/distributionplot/CMakeLists.txt index cc8f465a7d..d0aa7b3772 100644 --- a/examples/distributionplot/CMakeLists.txt +++ b/examples/distributionplot/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/distributionplot/test_distributionplot.cpp b/examples/distributionplot/test_distributionplot.cpp index 236e0be538..1912063cf5 100644 --- a/examples/distributionplot/test_distributionplot.cpp +++ b/examples/distributionplot/test_distributionplot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterDistributionPlot */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -18,12 +19,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) @@ -40,6 +37,7 @@ int main(int argc, char* argv[]) std::random_device rd; // random number generators: std::mt19937 gen{rd()}; + gen.seed(12345); // draw 301 random values from a gaussian distribution around 5 with width 3 const double th_mean=5; @@ -146,14 +144,14 @@ int main(int argc, char* argv[]) // 9. autoscale the plot so the graph is contained - plot.setXY(-6,16,-0.1,0.2); + plot.setXY(-6,16,-0.15,0.25); // 10. Move key to top-left plot.getPlotter()->setKeyPosition(JKQTPKeyInsideTopLeft); // 11. show plotter and make it a decent size plot.show(); - plot.resize(800,650); + plot.resize(600,550); return app.exec(); } diff --git a/examples/errorbarstyles/CMakeLists.txt b/examples/errorbarstyles/CMakeLists.txt index e4607c265d..e9cdbae96b 100644 --- a/examples/errorbarstyles/CMakeLists.txt +++ b/examples/errorbarstyles/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/errorbarstyles/errorbarstyles.cpp b/examples/errorbarstyles/errorbarstyles.cpp index e5727496f1..5d83dbe713 100644 --- a/examples/errorbarstyles/errorbarstyles.cpp +++ b/examples/errorbarstyles/errorbarstyles.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterErrorBarStyles */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -13,12 +14,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/evalcurve/CMakeLists.txt b/examples/evalcurve/CMakeLists.txt index fffd438bb5..3b3f39b883 100644 --- a/examples/evalcurve/CMakeLists.txt +++ b/examples/evalcurve/CMakeLists.txt @@ -13,6 +13,7 @@ set(RESOURCES ) set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/evalcurve/evalcurve.cpp b/examples/evalcurve/evalcurve.cpp index 62c3689b41..30b458373d 100644 --- a/examples/evalcurve/evalcurve.cpp +++ b/examples/evalcurve/evalcurve.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterEvalCurves */ +#include "jkqtpexampleapplication.h" #include #include #include @@ -14,12 +15,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a window that contains a line-edit to edit a function @@ -73,7 +70,7 @@ int main(int argc, char* argv[]) // show window and make it a decent size mainWin.show(); - mainWin.resize(800,800); + mainWin.resize(600,600); return app.exec(); } diff --git a/examples/filledgraphs/CMakeLists.txt b/examples/filledgraphs/CMakeLists.txt index e84b51a173..b9a0a0c7f7 100644 --- a/examples/filledgraphs/CMakeLists.txt +++ b/examples/filledgraphs/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES filledgraphs.qrc ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/filledgraphs/filledgraphs.cpp b/examples/filledgraphs/filledgraphs.cpp index dc1fe89721..8c281018f1 100644 --- a/examples/filledgraphs/filledgraphs.cpp +++ b/examples/filledgraphs/filledgraphs.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterFilledGraphs */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpfilledcurve.h" @@ -11,12 +12,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/functionplot/CMakeLists.txt b/examples/functionplot/CMakeLists.txt index 1920ee4a60..ed9cb0319d 100644 --- a/examples/functionplot/CMakeLists.txt +++ b/examples/functionplot/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/functionplot/functionplot.cpp b/examples/functionplot/functionplot.cpp index b8623a8b30..9dfd8773d1 100644 --- a/examples/functionplot/functionplot.cpp +++ b/examples/functionplot/functionplot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterFunctionPlots */ +#include "jkqtpexampleapplication.h" #include #include #include @@ -129,18 +130,14 @@ void drawExample(QApplication& app, const QString& name) { // show window and make it a decent size mainWin->show(); - mainWin->resize(800,800); + mainWin->resize(600,600); } int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); drawExample(app, "functionplot: JKQTPXFunctionLineGraph"); diff --git a/examples/geo_arrows/CMakeLists.txt b/examples/geo_arrows/CMakeLists.txt index 5299fc1b81..2e91f4167c 100644 --- a/examples/geo_arrows/CMakeLists.txt +++ b/examples/geo_arrows/CMakeLists.txt @@ -13,6 +13,7 @@ set(RESOURCES ) set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/geo_arrows/geo_arrows.cpp b/examples/geo_arrows/geo_arrows.cpp index d259b06ab0..da01c7c38d 100644 --- a/examples/geo_arrows/geo_arrows.cpp +++ b/examples/geo_arrows/geo_arrows.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterGeometricArrows */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpgeometric.h" @@ -13,12 +14,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window diff --git a/examples/geo_simple/CMakeLists.txt b/examples/geo_simple/CMakeLists.txt index 2559a2972a..343a5763c6 100644 --- a/examples/geo_simple/CMakeLists.txt +++ b/examples/geo_simple/CMakeLists.txt @@ -13,6 +13,7 @@ set(RESOURCES ) set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/geo_simple/geo_simple.cpp b/examples/geo_simple/geo_simple.cpp index a03a027982..00f01c87f6 100644 --- a/examples/geo_simple/geo_simple.cpp +++ b/examples/geo_simple/geo_simple.cpp @@ -3,6 +3,7 @@ * * \ref JKQTPlotterGeometricGraphsSimple */ +#include "jkqtpexampleapplication.h" #include #include #include @@ -85,12 +86,8 @@ void drawEllExample(JKQTPlotter* plot, double x0, double y0, double wid, double int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a Widget with a plotter and some control-elements diff --git a/examples/geometric/CMakeLists.txt b/examples/geometric/CMakeLists.txt index 7679b60b5f..d8a881eb33 100644 --- a/examples/geometric/CMakeLists.txt +++ b/examples/geometric/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/geometric/geometric.cpp b/examples/geometric/geometric.cpp index dbe58ea5fd..49e31db0b8 100644 --- a/examples/geometric/geometric.cpp +++ b/examples/geometric/geometric.cpp @@ -3,6 +3,7 @@ * * \ref JKQTPlotterGeometricGraphs */ +#include "jkqtpexampleapplication.h" #include #include #include @@ -13,12 +14,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a Widget with a plotter and some control-elements diff --git a/examples/imageplot/CMakeLists.txt b/examples/imageplot/CMakeLists.txt index eac98d207c..0ef6093353 100644 --- a/examples/imageplot/CMakeLists.txt +++ b/examples/imageplot/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/imageplot/imageplot.cpp b/examples/imageplot/imageplot.cpp index bf7c74a26e..e53f0011a2 100644 --- a/examples/imageplot/imageplot.cpp +++ b/examples/imageplot/imageplot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterImagePlot */ +#include "jkqtpexampleapplication.h" #include #include #include "jkqtplotter/jkqtplotter.h" @@ -13,12 +14,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); JKQTPlotter plot; diff --git a/examples/imageplot_cimg/CMakeLists.txt b/examples/imageplot_cimg/CMakeLists.txt index e7d854ca45..bf60067bca 100644 --- a/examples/imageplot_cimg/CMakeLists.txt +++ b/examples/imageplot_cimg/CMakeLists.txt @@ -16,6 +16,7 @@ if(CImg_FOUND) set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/imageplot_modifier/CMakeLists.txt b/examples/imageplot_modifier/CMakeLists.txt index ea10120441..1e0d7e67f1 100644 --- a/examples/imageplot_modifier/CMakeLists.txt +++ b/examples/imageplot_modifier/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/imageplot_modifier/imageplot_modifier.cpp b/examples/imageplot_modifier/imageplot_modifier.cpp index 24089e7bf4..8f55b77b37 100644 --- a/examples/imageplot_modifier/imageplot_modifier.cpp +++ b/examples/imageplot_modifier/imageplot_modifier.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterImagePlotModifier */ +#include "jkqtpexampleapplication.h" #include #include #include "jkqtplotter/jkqtplotter.h" @@ -12,12 +13,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); JKQTPlotter plot; diff --git a/examples/imageplot_nodatastore/CMakeLists.txt b/examples/imageplot_nodatastore/CMakeLists.txt index 6a86c8463d..0859622ace 100644 --- a/examples/imageplot_nodatastore/CMakeLists.txt +++ b/examples/imageplot_nodatastore/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/imageplot_nodatastore/imageplot_nodatastore.cpp b/examples/imageplot_nodatastore/imageplot_nodatastore.cpp index c9f5c36782..4fe3b33b07 100644 --- a/examples/imageplot_nodatastore/imageplot_nodatastore.cpp +++ b/examples/imageplot_nodatastore/imageplot_nodatastore.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterImagePlotNoDatastore */ +#include "jkqtpexampleapplication.h" #include #include #include "jkqtplotter/jkqtplotter.h" @@ -12,12 +13,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); JKQTPlotter plot; diff --git a/examples/imageplot_opencv/CMakeLists.txt b/examples/imageplot_opencv/CMakeLists.txt index a9e06fa894..46ab5c9043 100644 --- a/examples/imageplot_opencv/CMakeLists.txt +++ b/examples/imageplot_opencv/CMakeLists.txt @@ -15,7 +15,8 @@ if(OpenCV_FOUND) set(RESOURCES ) set(UIS ) - add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) + add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/imageplot_opencv/imageplot_opencv.cpp b/examples/imageplot_opencv/imageplot_opencv.cpp index 83583e833a..bb8677472a 100644 --- a/examples/imageplot_opencv/imageplot_opencv.cpp +++ b/examples/imageplot_opencv/imageplot_opencv.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterImagePlotOpenCV */ +#include "jkqtpexampleapplication.h" #include #include #include "jkqtplotter/jkqtplotter.h" diff --git a/examples/imageplot_userpal/CMakeLists.txt b/examples/imageplot_userpal/CMakeLists.txt index bd2c8ffea7..eafad4d17f 100644 --- a/examples/imageplot_userpal/CMakeLists.txt +++ b/examples/imageplot_userpal/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES imageplot_userpal.qrc ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/imageplot_userpal/imageplot_userpal.cpp b/examples/imageplot_userpal/imageplot_userpal.cpp index 0350bcd692..9d119f9e37 100644 --- a/examples/imageplot_userpal/imageplot_userpal.cpp +++ b/examples/imageplot_userpal/imageplot_userpal.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterImagePlot */ +#include "jkqtpexampleapplication.h" #include #include #include @@ -18,12 +19,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 0. tell the library where to find additional palettes. diff --git a/examples/impulsesplot/CMakeLists.txt b/examples/impulsesplot/CMakeLists.txt index 0c449a52b5..59ec9e598d 100644 --- a/examples/impulsesplot/CMakeLists.txt +++ b/examples/impulsesplot/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/impulsesplot/impulsesplot.cpp b/examples/impulsesplot/impulsesplot.cpp index 60c86ef990..ecd4d1174f 100644 --- a/examples/impulsesplot/impulsesplot.cpp +++ b/examples/impulsesplot/impulsesplot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterImpulsePlots */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpimpulses.h" @@ -14,12 +15,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/jkqtplot_test/CMakeLists.txt b/examples/jkqtplot_test/CMakeLists.txt index eedc02a215..6d10425487 100644 --- a/examples/jkqtplot_test/CMakeLists.txt +++ b/examples/jkqtplot_test/CMakeLists.txt @@ -29,8 +29,8 @@ if(JKQtPlotter_BUILD_STATIC_LIBS) elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - endif() +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) # precomiled headers to speed up compilation if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) diff --git a/examples/jkqtplot_test/jkqtplot_test.cpp b/examples/jkqtplot_test/jkqtplot_test.cpp index cf04590070..6a55143473 100644 --- a/examples/jkqtplot_test/jkqtplot_test.cpp +++ b/examples/jkqtplot_test/jkqtplot_test.cpp @@ -2,16 +2,13 @@ #include #include #include "testmain.h" +#include "jkqtpexampleapplication.h" int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); TestMain tab; diff --git a/examples/logaxes/CMakeLists.txt b/examples/logaxes/CMakeLists.txt index 023a4b8ec6..ce2e7b9608 100644 --- a/examples/logaxes/CMakeLists.txt +++ b/examples/logaxes/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/logaxes/logaxes.cpp b/examples/logaxes/logaxes.cpp index 3c6496737e..ebd4e7519a 100644 --- a/examples/logaxes/logaxes.cpp +++ b/examples/logaxes/logaxes.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterLogAxes */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -15,12 +16,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/mandelbrot/CMakeLists.txt b/examples/mandelbrot/CMakeLists.txt index aea208e6b6..cee2cfc7b8 100644 --- a/examples/mandelbrot/CMakeLists.txt +++ b/examples/mandelbrot/CMakeLists.txt @@ -14,6 +14,7 @@ set(RESOURCES ) set(UIS mandelbrotmainwindow.ui) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/mandelbrot/mandelbrot.cpp b/examples/mandelbrot/mandelbrot.cpp index ed4e0b3f73..c95a2872b9 100644 --- a/examples/mandelbrot/mandelbrot.cpp +++ b/examples/mandelbrot/mandelbrot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterMandelbrot */ +#include "jkqtpexampleapplication.h" #include #include #include "mandelbrotmainwindow.h" @@ -13,12 +14,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); MandelbrotMainWindow widMain; diff --git a/examples/multiplot/CMakeLists.txt b/examples/multiplot/CMakeLists.txt index 3ce2f55b6b..f7929748cf 100644 --- a/examples/multiplot/CMakeLists.txt +++ b/examples/multiplot/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS test_multiplot_ui.h) set(RESOURCES test_multiplot.qrc ) set(UIS test_multiplot_ui.ui ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/multiplot/test_multiplot.cpp b/examples/multiplot/test_multiplot.cpp index 76cbe66854..726becd85a 100644 --- a/examples/multiplot/test_multiplot.cpp +++ b/examples/multiplot/test_multiplot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterMultiPlotLayout */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -16,12 +17,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a widget diff --git a/examples/parametriccurve/CMakeLists.txt b/examples/parametriccurve/CMakeLists.txt index e9b7538d8c..c0dbe46e9d 100644 --- a/examples/parametriccurve/CMakeLists.txt +++ b/examples/parametriccurve/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/parametriccurve/parametriccurve.cpp b/examples/parametriccurve/parametriccurve.cpp index 07ac4f35b2..7dc5dd4299 100644 --- a/examples/parametriccurve/parametriccurve.cpp +++ b/examples/parametriccurve/parametriccurve.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterParametricCurves */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -12,12 +13,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create two plotter windows that share the same internal datastore (for convenience) diff --git a/examples/paramscatterplot/CMakeLists.txt b/examples/paramscatterplot/CMakeLists.txt index d05950c2c3..c5c2501093 100644 --- a/examples/paramscatterplot/CMakeLists.txt +++ b/examples/paramscatterplot/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/paramscatterplot/paramscatterplot.cpp b/examples/paramscatterplot/paramscatterplot.cpp index 1ed1eca51b..13c194e445 100644 --- a/examples/paramscatterplot/paramscatterplot.cpp +++ b/examples/paramscatterplot/paramscatterplot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterParamScatter */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -12,12 +13,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/paramscatterplot_image/CMakeLists.txt b/examples/paramscatterplot_image/CMakeLists.txt index 83c5f25a57..4ae11c4cc1 100644 --- a/examples/paramscatterplot_image/CMakeLists.txt +++ b/examples/paramscatterplot_image/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ${EXAMPLE_NAME}.qrc ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/paramscatterplot_image/paramscatterplot_image.cpp b/examples/paramscatterplot_image/paramscatterplot_image.cpp index ee406f7a94..3544c9fc1e 100644 --- a/examples/paramscatterplot_image/paramscatterplot_image.cpp +++ b/examples/paramscatterplot_image/paramscatterplot_image.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterParamScatterImage */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -13,12 +14,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/parsedfunctionplot/CMakeLists.txt b/examples/parsedfunctionplot/CMakeLists.txt index e17e1ef0ed..0ff9623339 100644 --- a/examples/parsedfunctionplot/CMakeLists.txt +++ b/examples/parsedfunctionplot/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/parsedfunctionplot/parsedfunctionplot.cpp b/examples/parsedfunctionplot/parsedfunctionplot.cpp index 3437b5edca..522e0fd812 100644 --- a/examples/parsedfunctionplot/parsedfunctionplot.cpp +++ b/examples/parsedfunctionplot/parsedfunctionplot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterParsedFunctionPlot */ +#include "jkqtpexampleapplication.h" #include #include #include @@ -18,12 +19,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a window that conatins a line-edit to edit a function diff --git a/examples/rgbimageplot/CMakeLists.txt b/examples/rgbimageplot/CMakeLists.txt index 8b666a0374..1b7e11f93a 100644 --- a/examples/rgbimageplot/CMakeLists.txt +++ b/examples/rgbimageplot/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/rgbimageplot/rgbimageplot.cpp b/examples/rgbimageplot/rgbimageplot.cpp index 115e43f7d7..6bfb6784a3 100644 --- a/examples/rgbimageplot/rgbimageplot.cpp +++ b/examples/rgbimageplot/rgbimageplot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterRGBImagePlot */ +#include "jkqtpexampleapplication.h" #include #include #include "jkqtplotter/jkqtplotter.h" @@ -14,12 +15,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); JKQTPlotter plot; diff --git a/examples/rgbimageplot_cimg/CMakeLists.txt b/examples/rgbimageplot_cimg/CMakeLists.txt index 5628cf643b..640b384283 100644 --- a/examples/rgbimageplot_cimg/CMakeLists.txt +++ b/examples/rgbimageplot_cimg/CMakeLists.txt @@ -16,6 +16,7 @@ if(CImg_FOUND) set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/rgbimageplot_opencv/CMakeLists.txt b/examples/rgbimageplot_opencv/CMakeLists.txt index 0fa4f0b3db..1ad38f04f7 100644 --- a/examples/rgbimageplot_opencv/CMakeLists.txt +++ b/examples/rgbimageplot_opencv/CMakeLists.txt @@ -15,7 +15,8 @@ if (OpenCV_FOUND) set(RESOURCES ) set(UIS ) - add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) + add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/rgbimageplot_opencv/rgbimageplot_opencv.cpp b/examples/rgbimageplot_opencv/rgbimageplot_opencv.cpp index 22f1e1c11a..701d811261 100644 --- a/examples/rgbimageplot_opencv/rgbimageplot_opencv.cpp +++ b/examples/rgbimageplot_opencv/rgbimageplot_opencv.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterImagePlotRGBOpenCV */ +#include "jkqtpexampleapplication.h" #include #include #include "jkqtplotter/jkqtplotter.h" diff --git a/examples/rgbimageplot_qt/CMakeLists.txt b/examples/rgbimageplot_qt/CMakeLists.txt index 325ccf9826..000f3309e3 100644 --- a/examples/rgbimageplot_qt/CMakeLists.txt +++ b/examples/rgbimageplot_qt/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ${EXAMPLE_NAME}.qrc ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/rgbimageplot_qt/rgbimageplot_qt.cpp b/examples/rgbimageplot_qt/rgbimageplot_qt.cpp index ece9cc3323..71bd70b7cf 100644 --- a/examples/rgbimageplot_qt/rgbimageplot_qt.cpp +++ b/examples/rgbimageplot_qt/rgbimageplot_qt.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterImagePlotQImageRGB */ +#include "jkqtpexampleapplication.h" #include #include #include "jkqtplotter/jkqtplotter.h" @@ -15,12 +16,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); JKQTPlotter plot; diff --git a/examples/scatter/CMakeLists.txt b/examples/scatter/CMakeLists.txt index 535f418076..06563dc6ee 100644 --- a/examples/scatter/CMakeLists.txt +++ b/examples/scatter/CMakeLists.txt @@ -13,6 +13,7 @@ set(RESOURCES ) set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) @@ -20,7 +21,6 @@ if(JKQtPlotter_BUILD_STATIC_LIBS) elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() -target_link_libraries(${EXENAME} JKQTPExampleToolsLib) # precomiled headers to speed up compilation target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) diff --git a/examples/scatter/scatter.cpp b/examples/scatter/scatter.cpp index a9dc0a8d9d..e779a471c5 100644 --- a/examples/scatter/scatter.cpp +++ b/examples/scatter/scatter.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterscatter */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -14,11 +15,7 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - + JKQTPAppSettingController highDPIController(argc,argv); JKQTPExampleApplication app(argc, argv); @@ -33,7 +30,7 @@ int main(int argc, char* argv[]) auto colYInserter=ds->backInserter(columnY); // 3. now we create data for a simple plot (a sine curve with random noise) - std::default_random_engine generator; + std::default_random_engine generator(123); std::normal_distribution distribution(0,0.5); const int Ndata=100; for (int i=0; i #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" +#include "jkqtpexampleapplication.h" int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - - -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc,argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) @@ -61,7 +52,7 @@ int main(int argc, char* argv[]) plot.zoomToFit(); // show plotter and make it a decent size - plot.getPlotter()->setPlotLabel(QObject::tr("Graph Title")); + plot.getPlotter()->setPlotLabel(QObject::tr("Simple Test")); plot.show(); plot.resize(600,400); diff --git a/examples/speed/CMakeLists.txt b/examples/speed/CMakeLists.txt index de90c2f608..32dd6f1e36 100644 --- a/examples/speed/CMakeLists.txt +++ b/examples/speed/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS speedtestplot.h) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/speed/speed.cpp b/examples/speed/speed.cpp index 3ed2f48352..78b7de795e 100644 --- a/examples/speed/speed.cpp +++ b/examples/speed/speed.cpp @@ -4,16 +4,13 @@ #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" #include "speedtestplot.h" +#include "jkqtpexampleapplication.h" int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/speed/speedtestplot.cpp b/examples/speed/speedtestplot.cpp index 430f66d926..e1269889d5 100644 --- a/examples/speed/speedtestplot.cpp +++ b/examples/speed/speedtestplot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterSpeedTest */ +#include "jkqtpexampleapplication.h" #include "speedtestplot.h" #include "jkqtplotter/graphs/jkqtpscatter.h" #include "jkqtcommon_statistics_and_math/jkqtpstatisticstools.h" diff --git a/examples/stackedbars/CMakeLists.txt b/examples/stackedbars/CMakeLists.txt index b4188224e2..60d9b9b288 100644 --- a/examples/stackedbars/CMakeLists.txt +++ b/examples/stackedbars/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/stackedbars/stackedbars.cpp b/examples/stackedbars/stackedbars.cpp index 297e75b696..e9738537d8 100644 --- a/examples/stackedbars/stackedbars.cpp +++ b/examples/stackedbars/stackedbars.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterStackedBarChart */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -103,12 +104,8 @@ void addGraph(JKQTPlotter& plot, bool swapXY) { int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); JKQTPlotter plotV; diff --git a/examples/stepplots/CMakeLists.txt b/examples/stepplots/CMakeLists.txt index 24e4d545fc..f4a91a7dbd 100644 --- a/examples/stepplots/CMakeLists.txt +++ b/examples/stepplots/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/stepplots/stepplots.cpp b/examples/stepplots/stepplots.cpp index f8af572e42..453ed341ba 100644 --- a/examples/stepplots/stepplots.cpp +++ b/examples/stepplots/stepplots.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterSpecialStepLinePlot */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -13,12 +14,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/stepplots/stepplots_vertical.cpp b/examples/stepplots/stepplots_vertical.cpp index dadfbdafdb..f627f4eaea 100644 --- a/examples/stepplots/stepplots_vertical.cpp +++ b/examples/stepplots/stepplots_vertical.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterSpecialStepLinePlot */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" diff --git a/examples/styledboxplot/CMakeLists.txt b/examples/styledboxplot/CMakeLists.txt index 7f12e3b207..a68626516f 100644 --- a/examples/styledboxplot/CMakeLists.txt +++ b/examples/styledboxplot/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/styledboxplot/test_styledboxplot.cpp b/examples/styledboxplot/test_styledboxplot.cpp index 8e8009d62f..79f036a79b 100644 --- a/examples/styledboxplot/test_styledboxplot.cpp +++ b/examples/styledboxplot/test_styledboxplot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterBoxplotStyling */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpboxplot.h" @@ -12,12 +13,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/styling/CMakeLists.txt b/examples/styling/CMakeLists.txt index 57f165c67c..f723f2289f 100644 --- a/examples/styling/CMakeLists.txt +++ b/examples/styling/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS test_styling.h jkqtpstyleplaintextedit.h ) set(RESOURCES ) set(UIS test_styling.ui ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/styling/test_styling_main.cpp b/examples/styling/test_styling_main.cpp index c75e9d8af2..a3b194f692 100644 --- a/examples/styling/test_styling_main.cpp +++ b/examples/styling/test_styling_main.cpp @@ -1,17 +1,14 @@ #include #include "test_styling.h" #include "jkqtplotter/jkqtplotterstyle.h" +#include "jkqtpexampleapplication.h" int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // you can set the system-wide default style properties early on diff --git a/examples/symbols_and_errors/CMakeLists.txt b/examples/symbols_and_errors/CMakeLists.txt index ce426d0701..b6cde70119 100644 --- a/examples/symbols_and_errors/CMakeLists.txt +++ b/examples/symbols_and_errors/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/symbols_and_errors/symbols_and_errors.cpp b/examples/symbols_and_errors/symbols_and_errors.cpp index be55322f33..38a2df90a0 100644 --- a/examples/symbols_and_errors/symbols_and_errors.cpp +++ b/examples/symbols_and_errors/symbols_and_errors.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterSymbolsErrors */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -14,12 +15,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/symbols_and_styles/CMakeLists.txt b/examples/symbols_and_styles/CMakeLists.txt index fa814529de..a6c511d62d 100644 --- a/examples/symbols_and_styles/CMakeLists.txt +++ b/examples/symbols_and_styles/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/symbols_and_styles/symbols_and_styles.cpp b/examples/symbols_and_styles/symbols_and_styles.cpp index 6112b57e9c..c862c43869 100644 --- a/examples/symbols_and_styles/symbols_and_styles.cpp +++ b/examples/symbols_and_styles/symbols_and_styles.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterSymbolsAndStyles */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" @@ -13,12 +14,8 @@ int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); // 1. create a plotter window and get a pointer to the internal datastore (for convenience) diff --git a/examples/ui/CMakeLists.txt b/examples/ui/CMakeLists.txt index facc8db5ce..18b165b061 100644 --- a/examples/ui/CMakeLists.txt +++ b/examples/ui/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS formwithjkqtplotter.h) set(RESOURCES ) set(UIS formwithjkqtplotter.ui ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/ui/formwithjkqtplotter.cpp b/examples/ui/formwithjkqtplotter.cpp index fc20ef84e4..1bd57082fc 100644 --- a/examples/ui/formwithjkqtplotter.cpp +++ b/examples/ui/formwithjkqtplotter.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterQtCreator */ +#include "jkqtpexampleapplication.h" #include "formwithjkqtplotter.h" #include "ui_formwithjkqtplotter.h" diff --git a/examples/ui/ui.cpp b/examples/ui/ui.cpp index bd85b1254e..a9ed4d076b 100644 --- a/examples/ui/ui.cpp +++ b/examples/ui/ui.cpp @@ -1,16 +1,13 @@ #include #include "formwithjkqtplotter.h" +#include "jkqtpexampleapplication.h" int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); FormWithJKQTPlotter plot; diff --git a/examples/user_interaction/CMakeLists.txt b/examples/user_interaction/CMakeLists.txt index dba74ae5b5..0fc00a0cf8 100644 --- a/examples/user_interaction/CMakeLists.txt +++ b/examples/user_interaction/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS test_user_interaction.h) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/user_interaction/test_user_interaction.cpp b/examples/user_interaction/test_user_interaction.cpp index b3c1b30092..85b2042b44 100644 --- a/examples/user_interaction/test_user_interaction.cpp +++ b/examples/user_interaction/test_user_interaction.cpp @@ -5,6 +5,7 @@ * \see \ref JKQTPLOTTER_USERINTERACTION */ +#include "jkqtpexampleapplication.h" #include "test_user_interaction.h" #include #include diff --git a/examples/user_interaction/test_user_interaction_main.cpp b/examples/user_interaction/test_user_interaction_main.cpp index b6d87d542d..ace081b653 100644 --- a/examples/user_interaction/test_user_interaction_main.cpp +++ b/examples/user_interaction/test_user_interaction_main.cpp @@ -1,16 +1,13 @@ #include #include "test_user_interaction.h" +#include "jkqtpexampleapplication.h" int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); TestUserInteraction win; diff --git a/examples/violinplot/CMakeLists.txt b/examples/violinplot/CMakeLists.txt index b6f9569d15..d939b63f28 100644 --- a/examples/violinplot/CMakeLists.txt +++ b/examples/violinplot/CMakeLists.txt @@ -12,7 +12,8 @@ set(HEADERS ) set(RESOURCES ) set(UIS ) -add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/violinplot/violinplot.cpp b/examples/violinplot/violinplot.cpp index 9f22ddac6e..37d6fed291 100644 --- a/examples/violinplot/violinplot.cpp +++ b/examples/violinplot/violinplot.cpp @@ -4,6 +4,7 @@ * \ref JKQTPlotterViolinplotGraphs */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpviolinplot.h" @@ -31,6 +32,7 @@ JKQTPlotter* showPlot() { size_t randomdatacol3=datastore1->addColumn("random data N(6,2)"); std::random_device rd; // random number generators: std::mt19937 gen{rd()}; + gen.seed(12345); std::uniform_int_distribution<> ddecide(0,1); std::normal_distribution<> d1{1,1}; std::normal_distribution<> d2{6,2}; @@ -156,7 +158,7 @@ JKQTPlotter* showPlot() { // show plotter and make it a decent size plot->show(); - plot->resize(800,600); + plot->resize(600,400); return plot; } @@ -164,12 +166,8 @@ JKQTPlotter* showPlot() { int main(int argc, char* argv[]) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) - - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); + JKQTPAppSettingController highDPIController(argc, argv); + JKQTPExampleApplication app(argc, argv); showPlot(); diff --git a/examples/wiggleplots/CMakeLists.txt b/examples/wiggleplots/CMakeLists.txt index e804beb311..2a460f6d06 100644 --- a/examples/wiggleplots/CMakeLists.txt +++ b/examples/wiggleplots/CMakeLists.txt @@ -13,6 +13,7 @@ set(RESOURCES ) set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) diff --git a/examples/wiggleplots/wiggleplots.cpp b/examples/wiggleplots/wiggleplots.cpp index 6da425fcb1..f0684a39fb 100644 --- a/examples/wiggleplots/wiggleplots.cpp +++ b/examples/wiggleplots/wiggleplots.cpp @@ -4,11 +4,13 @@ * \ref JKQTPlotterwiggleplots */ +#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpfilledcurve.h" #include "jkqtcommon/jkqtpmathtools.h" #include +#include "jkqtpexampleapplication.h" void drawRandomWalkX(JKQTPlotter& plot) { @@ -27,6 +29,7 @@ void drawRandomWalkX(JKQTPlotter& plot) { const double stepsize=1; std::random_device rd; // random number generators: std::mt19937 gen{rd()}; + gen.seed(12351); std::uniform_int_distribution dist(0,1); for (size_t t=0; t= QT_VERSION_CHECK(5,6,0) && QT_VERSION < QT_VERSION_CHECK(6,0,0) + JKQTPAppSettingController highDPIController(argc,argv); + JKQTPExampleApplication app(argc, argv); - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps -#endif - QApplication app(argc, argv); - - JKQTPlotter plotWalk, plotWavepackets; + JKQTPlotter plotWalk; drawRandomWalkX(plotWalk); + JKQTPlotter plotWavepackets; drawWavepacketsY(plotWavepackets); return app.exec(); diff --git a/lib/jkqtplotter/graphs/jkqtpviolinplotstylingmixins.cpp b/lib/jkqtplotter/graphs/jkqtpviolinplotstylingmixins.cpp index f907723f49..fba79400d4 100644 --- a/lib/jkqtplotter/graphs/jkqtpviolinplotstylingmixins.cpp +++ b/lib/jkqtplotter/graphs/jkqtpviolinplotstylingmixins.cpp @@ -60,10 +60,10 @@ void JKQTPGraphViolinplotStyleMixin::initViolinplotStyle(JKQTBasePlotter *parent { setFillStyle(Qt::SolidPattern); setFillColor(parent->getCurrentPlotterStyle().plotBackgroundBrush.color()); - initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Barchart); + initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Boxplot); if (parent) { // get style settings from parent object if (parentPlotStyle<0) parentPlotStyle=parent->getNextStyle(); - const JKQTBasePlotter::JKQTPPen pen=parent->getPlotStyle(parentPlotStyle, JKQTPPlotStyleType::Barchart); + const JKQTBasePlotter::JKQTPPen pen=parent->getPlotStyle(parentPlotStyle, JKQTPPlotStyleType::Boxplot); m_whiskerLinePen.setColor(pen.color()); m_whiskerLinePen.setStyle(pen.style()); whiskerLineWidth=pen.widthF(); diff --git a/lib/jkqtplotter/jkqtplotter.h b/lib/jkqtplotter/jkqtplotter.h index dc3835b47a..abee1272df 100644 --- a/lib/jkqtplotter/jkqtplotter.h +++ b/lib/jkqtplotter/jkqtplotter.h @@ -103,7 +103,7 @@ JKQTPLOTTER_LIB_EXPORT void initJKQTPlotterResources(); * * The result should look something like this: * - * \image html jkqtplotter_simpletest1.png + * \image html simpletest.png * * Starting from this basic example, you can observe several important principles: * # Data is stored in an (internal) instance of JKQTPDatastore, which is accessible through diff --git a/screenshots/advancedlineandfillstyling.png b/screenshots/advancedlineandfillstyling.png index fdeab6e39f..68d818fb86 100644 Binary files a/screenshots/advancedlineandfillstyling.png and b/screenshots/advancedlineandfillstyling.png differ diff --git a/screenshots/barchart_hor_small.png b/screenshots/barchart_hor_small.png new file mode 100644 index 0000000000..40d060a10f Binary files /dev/null and b/screenshots/barchart_hor_small.png differ diff --git a/screenshots/boxplot.png b/screenshots/boxplot.png index 2786aa119c..d861977b02 100644 Binary files a/screenshots/boxplot.png and b/screenshots/boxplot.png differ diff --git a/screenshots/contourplot.png b/screenshots/contourplot.png index 52da08896f..3c37e1983e 100644 Binary files a/screenshots/contourplot.png and b/screenshots/contourplot.png differ diff --git a/screenshots/errorbarstyles.png b/screenshots/errorbarstyles.png index f789454e1a..428b591e57 100644 Binary files a/screenshots/errorbarstyles.png and b/screenshots/errorbarstyles.png differ diff --git a/screenshots/evalcurve.png b/screenshots/evalcurve.png index 08ceef17a0..f8550c8548 100644 Binary files a/screenshots/evalcurve.png and b/screenshots/evalcurve.png differ diff --git a/screenshots/filledgraphs.png b/screenshots/filledgraphs.png index 38c4503779..7764a6f7fb 100644 Binary files a/screenshots/filledgraphs.png and b/screenshots/filledgraphs.png differ diff --git a/screenshots/jkqtplotter_simpletest1.png b/screenshots/jkqtplotter_simpletest1.png deleted file mode 100644 index 9604697332..0000000000 Binary files a/screenshots/jkqtplotter_simpletest1.png and /dev/null differ diff --git a/screenshots/jkqtplotter_simpletest1_small.png b/screenshots/jkqtplotter_simpletest1_small.png deleted file mode 100644 index 17058f26bd..0000000000 Binary files a/screenshots/jkqtplotter_simpletest1_small.png and /dev/null differ diff --git a/screenshots/scatter.png b/screenshots/scatter.png index 79798a438e..9319c81325 100644 Binary files a/screenshots/scatter.png and b/screenshots/scatter.png differ diff --git a/screenshots/scatter_small.png b/screenshots/scatter_small.png index ef7647e37c..0da4392773 100644 Binary files a/screenshots/scatter_small.png and b/screenshots/scatter_small.png differ diff --git a/screenshots/simpletest.png b/screenshots/simpletest.png new file mode 100644 index 0000000000..3fe04cce01 Binary files /dev/null and b/screenshots/simpletest.png differ diff --git a/screenshots/simpletest_small.png b/screenshots/simpletest_small.png new file mode 100644 index 0000000000..769d60848d Binary files /dev/null and b/screenshots/simpletest_small.png differ diff --git a/screenshots/test_distributionplot.png b/screenshots/test_distributionplot.png index 8892c00324..1f11c16420 100644 Binary files a/screenshots/test_distributionplot.png and b/screenshots/test_distributionplot.png differ diff --git a/screenshots/test_multiplot.png b/screenshots/test_multiplot.png index 79032773ea..f8dd418a6c 100644 Binary files a/screenshots/test_multiplot.png and b/screenshots/test_multiplot.png differ diff --git a/screenshots/violinplot_hor.png b/screenshots/violinplot_hor.png index dcb0ac1475..fafe647af2 100644 Binary files a/screenshots/violinplot_hor.png and b/screenshots/violinplot_hor.png differ diff --git a/screenshots/violinplot_vert.png b/screenshots/violinplot_vert.png index 9dd2a34115..e81059b5c7 100644 Binary files a/screenshots/violinplot_vert.png and b/screenshots/violinplot_vert.png differ diff --git a/tools/jkqtmathtext_render/CMakeLists.txt b/tools/jkqtmathtext_render/CMakeLists.txt index 4a59cc33ea..381618f7fc 100644 --- a/tools/jkqtmathtext_render/CMakeLists.txt +++ b/tools/jkqtmathtext_render/CMakeLists.txt @@ -15,6 +15,7 @@ set(RESOURCES ) set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) +target_link_libraries(${EXENAME} JKQTPExampleToolsLib) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTMathTextLib) diff --git a/tools/jkqtmathtext_render/jkqtmathtext_render.cpp b/tools/jkqtmathtext_render/jkqtmathtext_render.cpp index c0133eabc8..f0d4881c05 100644 --- a/tools/jkqtmathtext_render/jkqtmathtext_render.cpp +++ b/tools/jkqtmathtext_render/jkqtmathtext_render.cpp @@ -5,6 +5,7 @@ */ +#include "jkqtpexampleapplication.h" #include #include #include