From 46801067343b038c3375c3a8084db61e43137de1 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Sun, 2 Dec 2018 18:30:12 +0100 Subject: [PATCH] some bug-fixes (ressources from library were not loaded, compile order in projects was wrong) --- lib/jkqtmathtext/jkqtmathtext.cpp | 7 ++++++- lib/jkqtmathtext/jkqtmathtext.h | 4 ++++ lib/jkqtplotter/jkqtpbaseplotter.cpp | 13 +++++++++++++ lib/jkqtplotter/jkqtpbaseplotter.h | 5 ++++- lib/jkqtplotter/jkqtplotter.cpp | 10 ++++++++-- lib/jkqtplotter/jkqtplotter.h | 5 ++++- .../jkqtmathtext_simpletest_and_lib.pro | 4 ++-- .../jkqtmathtext_test/jkqtmathtext_test_and_lib.pro | 4 ++-- ...ter_simpletest_imageplot_nodatastore_and_lib.pro | 4 ++-- .../jkqtplotter_simpletest_and_lib.pro | 4 ++-- .../jkqtplotter_simpletest_barchart_and_lib.pro | 4 ++-- .../jkqtplotter_simpletest_dateaxes_and_lib.pro | 4 ++-- ...kqtplotter_simpletest_errorbarstyles_and_lib.pro | 4 ++-- .../jkqtplotter_simpletest_imageplot_and_lib.pro | 4 ++-- ...lotter_simpletest_imageplot_modifier_and_lib.pro | 4 ++-- ...ter_simpletest_imageplot_nodatastore_and_lib.pro | 4 ++-- .../jkqtplotter_simpletest_logaxes_and_lib.pro | 4 ++-- .../jkqtplotter_simpletest_stackedbars_and_lib.pro | 4 ++-- ...lotter_simpletest_symbols_and_errors_and_lib.pro | 4 ++-- ...lotter_simpletest_symbols_and_styles_and_lib.pro | 4 ++-- 20 files changed, 67 insertions(+), 33 deletions(-) diff --git a/lib/jkqtmathtext/jkqtmathtext.cpp b/lib/jkqtmathtext/jkqtmathtext.cpp index 0c8731611d..88b637c88b 100644 --- a/lib/jkqtmathtext/jkqtmathtext.cpp +++ b/lib/jkqtmathtext/jkqtmathtext.cpp @@ -3065,7 +3065,7 @@ bool JKQTmathText::MTsymbolNode::toHtml(QString &html, JKQTmathText::MTenvironme JKQTmathText::JKQTmathText(QObject* parent): QObject(parent) { - + Q_INIT_RESOURCE(xits); QFontDatabase fontdb; QString serifFont="Serif"; @@ -4270,3 +4270,8 @@ QString JKQTmathText::MTplainTextNode::textTransform(const QString &text, JKQTma { return text; } + +void initJKQtMathTextResources() +{ + Q_INIT_RESOURCE(xits); +} diff --git a/lib/jkqtmathtext/jkqtmathtext.h b/lib/jkqtmathtext/jkqtmathtext.h index 09108fa75f..5b96e905bc 100644 --- a/lib/jkqtmathtext/jkqtmathtext.h +++ b/lib/jkqtmathtext/jkqtmathtext.h @@ -72,6 +72,10 @@ */ #define JKQTMTPROPERTYload(settings, group, var, varname, varconvert) \ var=settings.value(group+varname, var).varconvert; + +/** \brief initialized Qt-ressources necessary for JKQtMathText */ +LIB_EXPORT void initJKQtMathTextResources(); + /*! \brief this class manages an enhanced text message (containing a subset of LaTeX markups) and allows to draw a representation \ingroup jkqtmathtext diff --git a/lib/jkqtplotter/jkqtpbaseplotter.cpp b/lib/jkqtplotter/jkqtpbaseplotter.cpp index 97e345f6cc..978b3f88e9 100644 --- a/lib/jkqtplotter/jkqtpbaseplotter.cpp +++ b/lib/jkqtplotter/jkqtpbaseplotter.cpp @@ -59,6 +59,18 @@ static QString globalUserSettigsPrefix=""; static QList jkqtpPaintDeviceAdapters; static QList jkqtpSaveDataAdapters; + +void initJKQtBasePlotterResources() +{ + Q_INIT_RESOURCE(jkqtpbaseplotter); + initJKQtMathTextResources(); +} + +JKQtBasePlotter::JKQtBasePlotter() +{ + initJKQtBasePlotterResources(); +} + void JKQtBasePlotter::setDefaultJKQtBasePrinterUserSettings(QString userSettigsFilename, QString userSettigsPrefix) { globalUserSettigsFilename=userSettigsFilename; @@ -420,6 +432,7 @@ void JKQtBasePlotter::initSettings() { + void JKQtBasePlotter::zoomIn(double factor) { //std::cout<<(double)event->delta()/120.0<<": "<(round(static_cast(plotWidth)/2.0-static_cast(plotWidth)/(2.0*factor)))); diff --git a/lib/jkqtplotter/jkqtpbaseplotter.h b/lib/jkqtplotter/jkqtpbaseplotter.h index 95b875e9e3..8c721a3068 100644 --- a/lib/jkqtplotter/jkqtpbaseplotter.h +++ b/lib/jkqtplotter/jkqtpbaseplotter.h @@ -70,6 +70,9 @@ class JKQTPPlotsModel; // forward +/** \brief initialized Qt-ressources necessary for JKQtBasePlotter */ +LIB_EXPORT void initJKQtBasePlotterResources(); + /** \brief base class for 2D plotter classes * \ingroup jkqtplotter @@ -445,7 +448,7 @@ class LIB_EXPORT JKQtBasePlotter: public QObject { /** \brief hidden default constructor */ - JKQtBasePlotter() {} + JKQtBasePlotter(); diff --git a/lib/jkqtplotter/jkqtplotter.cpp b/lib/jkqtplotter/jkqtplotter.cpp index d49e599730..0f3fd7e161 100644 --- a/lib/jkqtplotter/jkqtplotter.cpp +++ b/lib/jkqtplotter/jkqtplotter.cpp @@ -47,14 +47,15 @@ **************************************************************************************************************************/ JKQtPlotter::JKQtPlotter(bool datastore_internal, QWidget* parent, JKQTPdatastore* datast): QWidget(parent, Qt::Widget) -{ +{ + initJKQtPlotterResources(); init(datastore_internal, parent, datast); - } JKQtPlotter::JKQtPlotter(QWidget *parent): QWidget(parent, Qt::Widget) { + initJKQtPlotterResources(); init(true, parent, nullptr); } @@ -910,3 +911,8 @@ void JKQtPlotter::set_doDrawing(bool enable) //qDebug()<