fixed several compile warnings

This commit is contained in:
jkriege2 2024-01-23 13:09:37 +01:00
parent 1c9557c0d8
commit 868d6dcdf4
37 changed files with 119 additions and 140 deletions

View File

@ -29,7 +29,7 @@ void doExample(JKQTPlotter& plot, const QString& title)
graph->setValueColumn(columnV); graph->setValueColumn(columnV);
// set TwoColor fill Mode // set TwoColor fill Mode
graph->setFillMode(JKQTPBarGraphBase::FillMode::FunctorFilling); graph->setFillMode(JKQTPBarGraphBase::FillMode::FunctorFilling);
graph->setFillBrushFunctor([](double key, double value) {return QBrush(QColor::fromHsvF(key/12.0, 1.0, 1.0)); }); graph->setFillBrushFunctor([](double key, double /*value*/) {return QBrush(QColor::fromHsvF(key/12.0, 1.0, 1.0)); });
plot.addGraph(graph); plot.addGraph(graph);
// 4 autoscale the plot so the graph is contained // 4 autoscale the plot so the graph is contained

View File

@ -42,13 +42,13 @@ protected:
std::function<JKQTPlotter*(void)> plotf; std::function<JKQTPlotter*(void)> plotf;
JKQTPlotter* p; JKQTPlotter* p;
inline Data(const std::function<void(void)>& f_): inline Data(const std::function<void(void)>& f_):
type(FunctorType), f(f_), p(nullptr), plotf() type(FunctorType), f(f_), plotf(), p(nullptr)
{} {}
inline Data(JKQTPlotter* p_): inline Data(JKQTPlotter* p_):
type(PlotterType), p(p_), f(), plotf() type(PlotterType), f(), plotf(), p(p_)
{} {}
inline Data(std::function<JKQTPlotter*(void)> p_): inline Data(std::function<JKQTPlotter*(void)> p_):
type(PlotterFunctorType), plotf(p_), f(), p(nullptr) type(PlotterFunctorType), f(), plotf(p_), p(nullptr)
{} {}
}; };
@ -56,5 +56,5 @@ protected:
void readCmdLine(); void readCmdLine();
QRect getBoundsWithoutColor(QImage qImage, const QColor &exclusionColor = Qt::white); QRect getBoundsWithoutColor(QImage qImage, const QColor &exclusionColor = Qt::white);
void saveWidget(QWidget* w, int iVisible);; void saveWidget(QWidget* w, int iVisible);
}; };

View File

@ -18,8 +18,8 @@ public:
QThread(parent), QThread(parent),
m_plotindex(plotindex), m_plotindex(plotindex),
m_runtimeNanoseconds(0), m_runtimeNanoseconds(0),
m_filenamepart(filenamepart),
m_filename(), m_filename(),
m_filenamepart(filenamepart),
m_NUM_GRAPHS(NUM_GRAPHS), m_NUM_GRAPHS(NUM_GRAPHS),
m_NUM_DATAPOINTS(NUM_DATAPOINTS), m_NUM_DATAPOINTS(NUM_DATAPOINTS),
m_labeltemplate(labeltemplate) m_labeltemplate(labeltemplate)

View File

@ -9,8 +9,10 @@
#include "jkqtplotter/graphs/jkqtpscatter.h" #include "jkqtplotter/graphs/jkqtpscatter.h"
#include "jkqtmath/jkqtpstatisticstools.h" #include "jkqtmath/jkqtpstatisticstools.h"
#define NUM_DATAPOINTS 500
SpeedTestPlot::SpeedTestPlot(): SpeedTestPlot::SpeedTestPlot():
JKQTPlotter(), NDATA(500), dx(1.0/500.0*4.0*JKQTPSTATISTICS_PI), x0(0) JKQTPlotter(), dx(1.0/static_cast<double>(NUM_DATAPOINTS)*4.0*JKQTPSTATISTICS_PI), x0(0), NDATA(NUM_DATAPOINTS)
{ {
X.fill(0); X.fill(0);
@ -127,7 +129,7 @@ SpeedTestPlot::SpeedTestPlot():
QAction* act=actGroup->addAction(QString::number(a)); QAction* act=actGroup->addAction(QString::number(a));
act->setCheckable(true); act->setCheckable(true);
act->setChecked(a==1.0); act->setChecked(a==1.0);
connect(act, &QAction::toggled, std::bind([](bool enabled,JKQTPXYLineGraph* g, JKQTPXYLineGraph* g2,SpeedTestPlot* p, double a){ connect(act, &QAction::toggled, std::bind([](bool /*enabled*/,JKQTPXYLineGraph* g, JKQTPXYLineGraph* g2,SpeedTestPlot* p, double a){
g->setNonvisibleLineCompressionAgressiveness(a); g->setNonvisibleLineCompressionAgressiveness(a);
g2->setNonvisibleLineCompressionAgressiveness(a); g2->setNonvisibleLineCompressionAgressiveness(a);
if (!p->actAnimation->isChecked()) p->redrawPlot(); if (!p->actAnimation->isChecked()) p->redrawPlot();

View File

@ -52,7 +52,7 @@ int main(int argc, char* argv[])
JKQTPXYLineGraph* graph=new JKQTPXYLineGraph(&plot); JKQTPXYLineGraph* graph=new JKQTPXYLineGraph(&plot);
// copy data into datastore and immediately set the yColumn // copy data into datastore and immediately set the yColumn
graph->setXColumn((symbolID<=JKQTPMaxSymbolID/2)?columnX1:columnX2); graph->setXColumn((symbolID<=static_cast<int>(JKQTPMaxSymbolID)/2)?columnX1:columnX2);
graph->setYColumn(ds->addCopiedColumn(Y, "y"+QString::number(symbolID))); graph->setYColumn(ds->addCopiedColumn(Y, "y"+QString::number(symbolID)));
// set symbol + pen style and color // set symbol + pen style and color

View File

@ -177,7 +177,7 @@ int main(int argc, char* argv[])
JKQTPlotter* plot1=showPlot<JKQTPViolinplotHorizontalElement,JKQTPSingleColumnSymbolsGraph::DataDirection::X>("1: JKQTPViolinplotHorizontalElement"); JKQTPlotter* plot1=showPlot<JKQTPViolinplotHorizontalElement,JKQTPSingleColumnSymbolsGraph::DataDirection::X>("1: JKQTPViolinplotHorizontalElement");
//plot1->resize(500,450); //plot1->resize(500,450);
plot1->getPlotter()->setKeyPosition(JKQTPKeyInsideTopLeft); plot1->getPlotter()->setKeyPosition(JKQTPKeyInsideTopLeft);
JKQTPlotter* plot2=showPlot<JKQTPViolinplotVerticalElement,JKQTPSingleColumnSymbolsGraph::DataDirection::Y>("2: JKQTPViolinplotVerticalElement"); /*JKQTPlotter* plot2=*/showPlot<JKQTPViolinplotVerticalElement,JKQTPSingleColumnSymbolsGraph::DataDirection::Y>("2: JKQTPViolinplotVerticalElement");
return app.exec(); return app.exec();

View File

@ -201,7 +201,7 @@ QMap<int, JKQTPImageTools::LUTData > JKQTPImageTools::getDefaultLUTs() {
{ {
const auto fR= [](float v) -> float { return ((v < 0.5) ? 128.0*sin(JKQTPSTATISTICS_PI*(2.0*v-0.5))+128.0 : 255.0)/255.0; }; const auto fR= [](float v) -> float { return ((v < 0.5) ? 128.0*sin(JKQTPSTATISTICS_PI*(2.0*v-0.5))+128.0 : 255.0)/255.0; };
const auto fG= [](float v) -> float { return ((v < 0.5) ? 512.0*v+128.0 : 512.0-512.0*v)/255.0; }; const auto fG= [](float v) -> float { return ((v < 0.5) ? 512.0*v+128.0 : 512.0-512.0*v)/255.0; };
const auto fB= [](float v) -> float { return 0.0; }; const auto fB= [](float ) -> float { return 0.0; };
const auto& normLUT=lutstore[JKQTPMathImageTRAFFICLIGHT]=JKQTPImageTools::LUTData(JKQTPBuildColorPaletteLUT(fR, fG, fB), "Trafficlight", QObject::tr("Trafficlight")); const auto& normLUT=lutstore[JKQTPMathImageTRAFFICLIGHT]=JKQTPImageTools::LUTData(JKQTPBuildColorPaletteLUT(fR, fG, fB), "Trafficlight", QObject::tr("Trafficlight"));
lutstore[JKQTPMathImageINVERTED_TRAFFICLIGHT]=JKQTPImageTools::LUTData(jkqtp_reversed(normLUT.lut), "invtrafficlight", QObject::tr("inv. Trafficlight")); lutstore[JKQTPMathImageINVERTED_TRAFFICLIGHT]=JKQTPImageTools::LUTData(jkqtp_reversed(normLUT.lut), "invtrafficlight", QObject::tr("inv. Trafficlight"));

View File

@ -1178,35 +1178,35 @@ public:
inline JKQTPPaletteList(): ListType() {}; inline JKQTPPaletteList(): ListType() {};
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) #if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
inline JKQTPPaletteList(qsizetype size): ListType(size) {}; inline JKQTPPaletteList(qsizetype size): ListType(size) {};
inline JKQTPPaletteList(qsizetype size, parameter_type value): ListType(size, value) {}; inline JKQTPPaletteList(qsizetype size, parameter_type value): ListType(size, value) {}
#endif #endif
template <class T> template <class T>
inline JKQTPPaletteList(std::initializer_list<QPair<double, QRgb>> args): ListType(args) {}; inline JKQTPPaletteList(std::initializer_list<QPair<double, QRgb>> args): ListType(args) {}
inline JKQTPPaletteList(std::initializer_list<QRgb> args): inline JKQTPPaletteList(std::initializer_list<QRgb> args):
ListType() ListType()
{ {
for(const auto& v: args) { for(const auto& v: args) {
push_back(v); push_back(v);
} }
}; }
inline JKQTPPaletteList(std::initializer_list<QColor> args): inline JKQTPPaletteList(std::initializer_list<QColor> args):
ListType() ListType()
{ {
for(const auto& v: args) { for(const auto& v: args) {
push_back(v); push_back(v);
} }
}; }
inline JKQTPPaletteList(std::initializer_list<QPair<double, QColor>> args): inline JKQTPPaletteList(std::initializer_list<QPair<double, QColor>> args):
ListType() ListType()
{ {
for(const auto& v: args) { for(const auto& v: args) {
push_back(v.first, v.second); push_back(v.first, v.second);
} }
}; }
template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true> template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
inline JKQTPPaletteList(InputIterator first, InputIterator last): ListType(first, last) {}; inline JKQTPPaletteList(InputIterator first, InputIterator last): ListType(first, last) {}
inline JKQTPPaletteList(ListType &&other):ListType(std::forward<ListType>(other)) {}; inline JKQTPPaletteList(ListType &&other):ListType(std::forward<ListType>(other)) {}
inline JKQTPPaletteList(const ListType &other):ListType(other) {}; inline JKQTPPaletteList(const ListType &other):ListType(other) {}
using ListType::push_back; using ListType::push_back;
inline void push_back(QRgb rgb) { inline void push_back(QRgb rgb) {

View File

@ -374,13 +374,13 @@ JKQTPCSSParser::Token::Token(TokenType type):
} }
JKQTPCSSParser::Token::Token(double num, const QString &unit_): JKQTPCSSParser::Token::Token(double num, const QString &unit_):
NumberValue(num), StringValue(unit_), type(NUMBER) type(NUMBER), StringValue(unit_), NumberValue(num)
{ {
} }
JKQTPCSSParser::Token::Token(const QString &str, TokenType type_): JKQTPCSSParser::Token::Token(const QString &str, TokenType type_):
StringValue(str), type(type_), NumberValue(0.0) type(type_), StringValue(str), NumberValue(0.0)
{ {
if (type_==NUMBER) NumberValue=str.toDouble(); if (type_==NUMBER) NumberValue=str.toDouble();
if (type_==HEXSTRING) NumberValue=str.toInt(nullptr,16); if (type_==HEXSTRING) NumberValue=str.toInt(nullptr,16);

View File

@ -81,32 +81,32 @@ typedef std::function<void(QPainter& p)> JKQTPCustomGraphSymbolFunctor;
struct JKQTPlotterDrawingTools { struct JKQTPlotterDrawingTools {
/** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color" in a certain context /** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color" in a certain context
* *
* \see JKQTPReplaceCurrentColor() * \see JKQTPReplaceCurrentColor() , JKQTFillStyleSummmary
*/ */
static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder; static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder;
/** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 10% transparency in a certain context /** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 10% transparency in a certain context
* *
* \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ... * \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ... , JKQTFillStyleSummmary
*/ */
static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans10; static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans10;
/** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 25% transparency in a certain context /** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 25% transparency in a certain context
* *
* \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder, ... * \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder, ... , JKQTFillStyleSummmary
*/ */
static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans25; static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans25;
/** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 50% transparency in a certain context /** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 50% transparency in a certain context
* *
* \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ... * \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ... , JKQTFillStyleSummmary
*/ */
static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans50; static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans50;
/** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 75% transparency in a certain context /** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 75% transparency in a certain context
* *
* \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ... * \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ... , JKQTFillStyleSummmary
*/ */
static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans75; static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans75;
/** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 90% transparency in a certain context /** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 90% transparency in a certain context
* *
* \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ... * \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ... , JKQTFillStyleSummmary
*/ */
static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans90; static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans90;
/** \brief smallest linewidth any line in JKQTPlotter/JKQTBasePlotter may have /** \brief smallest linewidth any line in JKQTPlotter/JKQTBasePlotter may have
@ -126,13 +126,13 @@ struct JKQTPlotterDrawingTools {
/*! \brief check whether \a col equals JKQTPlotterDrawingTools::CurrentColorPlaceholder (or one of its variants) and then replace it by \a currentColor /*! \brief check whether \a col equals JKQTPlotterDrawingTools::CurrentColorPlaceholder (or one of its variants) and then replace it by \a currentColor
\ingroup jkqtptools_drawing \ingroup jkqtptools_drawing
\see JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ... \see JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ... , JKQTFillStyleSummmary
*/ */
JKQTCOMMON_LIB_EXPORT void JKQTPReplaceCurrentColor(QColor& col, const QColor& currentColor); JKQTCOMMON_LIB_EXPORT void JKQTPReplaceCurrentColor(QColor& col, const QColor& currentColor);
/*! \brief check whether any color in \a grad equals JKQTPlotterDrawingTools::CurrentColorPlaceholder (or one of its variants) and then replace it by \a currentColor /*! \brief check whether any color in \a grad equals JKQTPlotterDrawingTools::CurrentColorPlaceholder (or one of its variants) and then replace it by \a currentColor
\ingroup jkqtptools_drawing \ingroup jkqtptools_drawing
\see JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ... \see JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ... , JKQTFillStyleSummmary
*/ */
JKQTCOMMON_LIB_EXPORT void JKQTPReplaceCurrentColor(QGradient& grad, const QColor& currentColor); JKQTCOMMON_LIB_EXPORT void JKQTPReplaceCurrentColor(QGradient& grad, const QColor& currentColor);

View File

@ -72,12 +72,12 @@ struct JKQTPExpected {
if (!m_hasValue) return m_error; if (!m_hasValue) return m_error;
throw std::runtime_error("error not available"); throw std::runtime_error("error not available");
} }
const bool has_value() const { return m_hasValue; } bool has_value() const { return m_hasValue; }
operator bool() const { return m_hasValue; } operator bool() const { return m_hasValue; }
private: private:
const bool m_hasValue; const bool m_hasValue;
const E m_error;
const T m_value; const T m_value;
const E m_error;
}; };

View File

@ -374,7 +374,7 @@ Qt::BrushStyle jkqtp_String2QBrushStyle(const QString& style) {
} }
Qt::BrushStyle jkqtp_String2QBrushStyleExt(const QString &style, QColor *color, QGradient *gradient, QPixmap *image, double* rotationAngleDeg) Qt::BrushStyle jkqtp_String2QBrushStyleExt(const QString &style, QGradient *gradient, QPixmap *image)
{ {
const QString s=style.toLower().trimmed().simplified(); const QString s=style.toLower().trimmed().simplified();
QStringList caps; QStringList caps;
@ -685,30 +685,6 @@ QColor jkqtp_String2QColor(QString color)
if (nameFound) return col; if (nameFound) return col;
} }
// declare som helper functors
static auto valUnitToInt=[](const QString& v, const QString& unit="", int intMax=255) {
if (v.isEmpty()) return -1;
if (unit=="%") {
return qBound<int>(0, QLocale::c().toDouble(v)/100.0*intMax, intMax);
} else if (unit=="deg") {
int vv=qBound<int>(0, QLocale::c().toDouble(v), intMax);;
if (vv<0) vv=vv+static_cast<int>(qCeil(static_cast<double>(-vv)/360.0)*360.0);
return vv;
}
return qBound<int>(0, QLocale::c().toDouble(v), intMax);
};
static auto valUnitToAlphaInt=[](const QString& v, const QString& unit="", int intMax=255) {
if (v.isEmpty()) return -1;
if (unit=="%") {
return intMax-qBound<int>(0, QLocale::c().toDouble(v)/100.0*intMax, intMax);
} else if (unit=="deg") {
int vv=qBound<int>(0, QLocale::c().toDouble(v), intMax);;
if (vv<0) vv=vv+static_cast<int>(qCeil(static_cast<double>(-vv)/360.0)*360.0);
return vv;
}
return qBound<int>(0, QLocale::c().toDouble(v), intMax);
};
// now we check for diverse special syntaxes // now we check for diverse special syntaxes
// P: "color,NN%" NN=TRANSPARENCY in percent // P: "color,NN%" NN=TRANSPARENCY in percent
// AP: "color,aNN\%" NN=ALPHA in percent // AP: "color,aNN\%" NN=ALPHA in percent

View File

@ -56,14 +56,13 @@ JKQTCOMMON_LIB_EXPORT Qt::BrushStyle jkqtp_String2QBrushStyle(const QString& sty
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
* *
* \param style the string to be parsed * \param style the string to be parsed
* \param[out] color output parameter for a parsed color
* \param[out] gradient output parameter for a parsed gradient * \param[out] gradient output parameter for a parsed gradient
* \param[out] image output parameter for a parsed image * \param[out] image output parameter for a parsed image
* \param[out] rotationAngleDeg output parameter for a parsed rotation angle of the pattern in degrees, where the direction equals the direction of a clock hand, i.e. 0=12o'clock, 180=6o'clock, ... * \param[out] rotationAngleDeg output parameter for a parsed rotation angle of the pattern in degrees, where the direction equals the direction of a clock hand, i.e. 0=12o'clock, 180=6o'clock, ...
* *
* \see jkqtp_String2QBrushStyle() * \see jkqtp_String2QBrushStyle()
*/ */
JKQTCOMMON_LIB_EXPORT Qt::BrushStyle jkqtp_String2QBrushStyleExt(const QString& style, QColor* color=nullptr, QGradient* gradient=nullptr, QPixmap* image=nullptr, double *rotationAngleDeg=nullptr); JKQTCOMMON_LIB_EXPORT Qt::BrushStyle jkqtp_String2QBrushStyleExt(const QString& style, QGradient* gradient=nullptr, QPixmap* image=nullptr);
/** \brief converts a Unicode codepoint into a UTF8-sequence /** \brief converts a Unicode codepoint into a UTF8-sequence

View File

@ -1316,7 +1316,7 @@ void JKQTMathText::draw(QPainter& painter, unsigned int flags, QRectF rect, bool
else if ((flags & Qt::AlignVCenter) != 0) y=y+(rect.height()-size.overallHeight)/2.0; else if ((flags & Qt::AlignVCenter) != 0) y=y+(rect.height()-size.overallHeight)/2.0;
// finally draw // finally draw
const double xend=getNodeTree()->draw(painter, x, y, ev); /*const double xend=*/getNodeTree()->draw(painter, x, y, ev);
} }
} }

View File

@ -118,7 +118,7 @@ void JKQTMathTextFontSpecifier::setFallbackSymbolsFontName(const QString &name)
m_fallbackSymbolFont=name; m_fallbackSymbolFont=name;
} }
QString JKQTMathTextFontSpecifier::transformFontName(const QString &fontName, bool mathmode) QString JKQTMathTextFontSpecifier::transformFontName(const QString &fontName, bool /*mathmode*/)
{ {
const QString fnt=fontName.trimmed().toLower(); const QString fnt=fontName.trimmed().toLower();
QFont testFnt; QFont testFnt;

View File

@ -193,7 +193,7 @@ JKQTMathTextNodeSize JKQTMathTextFracNode::getSizeInternal(QPainter& painter, JK
const double top_ascent=line_ascent; const double top_ascent=line_ascent;
const double newascent=size1.overallHeight+top_ascent; const double newascent=size1.overallHeight+top_ascent;
const double newdescent=qMax(size2.overallHeight-size2.baselineHeight, qheight-xheight); const double newdescent=qMax(size2.overallHeight-size2.baselineHeight, qheight-xheight);
const double deltaWidth=xwidth*((fracmode==JKQTMathTextFracNode::MTFMstfrac)?0.8:0.7); //const double deltaWidth=xwidth*((fracmode==JKQTMathTextFracNode::MTFMstfrac)?0.8:0.7);
size.width=size1.width+size2.width+xwidth*0.666; size.width=size1.width+size2.width+xwidth*0.666;
size.strikeoutPos=line_ascent; size.strikeoutPos=line_ascent;

View File

@ -90,7 +90,7 @@ double JKQTMathTextSimpleInstructionNode::draw(QPainter &painter, double x, doub
return x+bb.width(); return x+bb.width();
} }
bool JKQTMathTextSimpleInstructionNode::toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const bool JKQTMathTextSimpleInstructionNode::toHtml(QString &html, JKQTMathTextEnvironment /*currentEv*/, JKQTMathTextEnvironment /*defaultEv*/) const
{ {
const QString txt=executeInstruction(); const QString txt=executeInstruction();
html+=txt; html+=txt;

View File

@ -543,7 +543,7 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["normalfont"] = i; instructions["normalfont"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.bold=false; ev.bold=false;
ev.italic=false; ev.italic=false;
ev.insideMathForceDigitsUpright=false; ev.insideMathForceDigitsUpright=false;
@ -552,7 +552,7 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["mdseries"] = i; instructions["mdseries"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.bold=true; ev.bold=true;
ev.insideMathForceDigitsUpright=false; ev.insideMathForceDigitsUpright=false;
}, 0); }, 0);
@ -560,7 +560,7 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["bfseries"] = i; instructions["bfseries"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.italic=true; ev.italic=true;
ev.insideMathForceDigitsUpright=false; ev.insideMathForceDigitsUpright=false;
}, 0); }, 0);
@ -568,7 +568,7 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["itshape"] = i; instructions["itshape"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.italic=false; ev.italic=false;
ev.insideMathForceDigitsUpright=false; ev.insideMathForceDigitsUpright=false;
}, 0); }, 0);
@ -576,26 +576,26 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["upshape"] = i; instructions["upshape"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.italic=!ev.italic; ev.italic=!ev.italic;
}, 0); }, 0);
instructions["em"]= i; instructions["em"]= i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& parameters, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& parameters, const JKQTMathText* /*parentMathText*/) {
ev.color=jkqtp_String2QColor(parameters.value(0, ev.color.name())); ev.color=jkqtp_String2QColor(parameters.value(0, ev.color.name()));
}, 1); }, 1);
instructions["color"]= i; instructions["color"]= i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& parameters, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& parameters, const JKQTMathText* /*parentMathText*/) {
ev.customFontName=parameters.value(0, ""); ev.customFontName=parameters.value(0, "");
ev.font=MTECustomFont; ev.font=MTECustomFont;
}, 1); }, 1);
instructions["setfont"] = i; instructions["setfont"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.capitalization=QFont::SmallCaps; ev.capitalization=QFont::SmallCaps;
ev.insideMathForceDigitsUpright=false; ev.insideMathForceDigitsUpright=false;
}, 0); }, 0);
@ -603,7 +603,7 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["scshape"] = i; instructions["scshape"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.font=JKQTMathTextEnvironmentFont::MTEroman; ev.font=JKQTMathTextEnvironmentFont::MTEroman;
ev.italic=false; ev.italic=false;
}, 0); }, 0);
@ -611,7 +611,7 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["rmfamily"] = i; instructions["rmfamily"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.bold=true; ev.bold=true;
ev.italic=true; ev.italic=true;
ev.insideMathForceDigitsUpright=false; ev.insideMathForceDigitsUpright=false;
@ -619,14 +619,14 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["bfit"] = i; instructions["bfit"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.font=JKQTMathTextEnvironmentFont::MTEcaligraphic; ev.font=JKQTMathTextEnvironmentFont::MTEcaligraphic;
}, 0); }, 0);
instructions["cal"] = i; instructions["cal"] = i;
instructions["calfamily"] = i; instructions["calfamily"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.font=JKQTMathTextEnvironmentFont::MTEcaligraphic; ev.font=JKQTMathTextEnvironmentFont::MTEcaligraphic;
ev.bold=true; ev.bold=true;
ev.insideMathForceDigitsUpright=false; ev.insideMathForceDigitsUpright=false;
@ -634,21 +634,21 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["bbfcal"] = i; instructions["bbfcal"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.font=JKQTMathTextEnvironmentFont::MTEfraktur; ev.font=JKQTMathTextEnvironmentFont::MTEfraktur;
}, 0); }, 0);
instructions["frak"] = i; instructions["frak"] = i;
instructions["frakfamily"] = i; instructions["frakfamily"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.font=JKQTMathTextEnvironmentFont::MTEfraktur; ev.font=JKQTMathTextEnvironmentFont::MTEfraktur;
ev.bold=true; ev.bold=true;
}, 0); }, 0);
instructions["bffrak"] = i; instructions["bffrak"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.font=JKQTMathTextEnvironmentFont::MTEblackboard; ev.font=JKQTMathTextEnvironmentFont::MTEblackboard;
ev.italic=false; ev.italic=false;
ev.insideMathForceDigitsUpright=false; ev.insideMathForceDigitsUpright=false;
@ -657,28 +657,28 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["bbfamily"] = i; instructions["bbfamily"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.font=JKQTMathTextEnvironmentFont::MTEtypewriter; ev.font=JKQTMathTextEnvironmentFont::MTEtypewriter;
}, 0); }, 0);
instructions["tt"] = i; instructions["tt"] = i;
instructions["ttfamily"] = i; instructions["ttfamily"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.font=JKQTMathTextEnvironmentFont::MTEtypewriter; ev.font=JKQTMathTextEnvironmentFont::MTEtypewriter;
ev.bold=true; ev.bold=true;
}, 0); }, 0);
instructions["bftt"] = i; instructions["bftt"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.font=JKQTMathTextEnvironmentFont::MTEsans; ev.font=JKQTMathTextEnvironmentFont::MTEsans;
}, 0); }, 0);
instructions["sf"] = i; instructions["sf"] = i;
instructions["sffamily"] = i; instructions["sffamily"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.font=JKQTMathTextEnvironmentFont::MTEsans; ev.font=JKQTMathTextEnvironmentFont::MTEsans;
ev.italic=true; ev.italic=true;
ev.insideMathForceDigitsUpright=false; ev.insideMathForceDigitsUpright=false;
@ -686,7 +686,7 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["itsf"] = i; instructions["itsf"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.font=JKQTMathTextEnvironmentFont::MTEscript; ev.font=JKQTMathTextEnvironmentFont::MTEscript;
}, 0); }, 0);
instructions["script"] = i; instructions["script"] = i;
@ -695,7 +695,7 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["scrseries"] = i; instructions["scrseries"] = i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& /*parameters*/, const JKQTMathText* /*parentMathText*/) {
ev.font=JKQTMathTextEnvironmentFont::MTEscript; ev.font=JKQTMathTextEnvironmentFont::MTEscript;
ev.bold=true; ev.bold=true;
}, 0); }, 0);
@ -799,7 +799,7 @@ const QHash<QString, JKQTMathTextModifiedEnvironmentInstructionNode::Instruction
instructions["Huge"]= i; instructions["Huge"]= i;
} }
{ {
InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& parameters, const JKQTMathText* parentMathText) { InstructionProperties i([](JKQTMathTextEnvironment& ev, const QStringList& parameters, const JKQTMathText* /*parentMathText*/) {
ev.fontSize=parameters.value(0, QString::number(ev.fontSize)).toDouble(); ev.fontSize=parameters.value(0, QString::number(ev.fontSize)).toDouble();
ev.fontSizeUnit=JKQTMathTextEnvironment::POINTS; ev.fontSizeUnit=JKQTMathTextEnvironment::POINTS;
}, 1); }, 1);

View File

@ -829,7 +829,7 @@ JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::NarrowMathOperat
return NarrowMathOperatorSymbolStd(symbol,symbol); return NarrowMathOperatorSymbolStd(symbol,symbol);
} }
JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::NarrowMathOperatorSymbolStd(const QString &symbol, const QString &symbolHTML) JKQTMathTextSymbolNode::SymbolFullProps JKQTMathTextSymbolNode::NarrowMathOperatorSymbolStd(const QString &symbol, const QString &/*symbolHTML*/)
{ {
return SymbolFullProps(MTFEStandard, SymbolProps(symbol, ItalicOff|BoldOff, 1.0, 0.0)).addHtml(symbol, ItalicOff|BoldOff, 1.0, 0.0).addGlobalFlags(SmallExtendWidthInMathmode|MakeWhitespaceHalf); return SymbolFullProps(MTFEStandard, SymbolProps(symbol, ItalicOff|BoldOff, 1.0, 0.0)).addHtml(symbol, ItalicOff|BoldOff, 1.0, 0.0).addGlobalFlags(SmallExtendWidthInMathmode|MakeWhitespaceHalf);
} }

View File

@ -142,7 +142,7 @@ JKQTMathTextTextNode::LayoutInfo JKQTMathTextTextNode::calcLayout(QPainter &pain
const QFont fUpright=JKQTMathTextGetNonItalic(f); const QFont fUpright=JKQTMathTextGetNonItalic(f);
const QFont fFallbackSym=currentEv.exchangedFontFor(MTEFallbackSymbols).getFont(parentMathText); const QFont fFallbackSym=currentEv.exchangedFontFor(MTEFallbackSymbols).getFont(parentMathText);
const QFont fRoman=currentEv.exchangedFontForRoman().getFont(parentMathText); const QFont fRoman=currentEv.exchangedFontForRoman().getFont(parentMathText);
const double sp=JKQTMathTextGetHorAdvance(f, " ", painter.device()); //const double sp=JKQTMathTextGetHorAdvance(f, " ", painter.device());
l.width=0; l.width=0;
double ascent=0; double ascent=0;
double descent=0; double descent=0;

View File

@ -287,7 +287,7 @@ QString JKQTMathTextEmptyBoxNode::getTypeName() const
return QString("JKQTMathTextEmptyBoxNode(%1%2 x %3%4)").arg(getWidth()).arg(JKQTMathTextEmptyBoxNode::Units2String(getWidthUnit())).arg(getHeight()).arg(JKQTMathTextEmptyBoxNode::Units2String(getHeightUnit())); return QString("JKQTMathTextEmptyBoxNode(%1%2 x %3%4)").arg(getWidth()).arg(JKQTMathTextEmptyBoxNode::Units2String(getWidthUnit())).arg(getHeight()).arg(JKQTMathTextEmptyBoxNode::Units2String(getHeightUnit()));
} }
bool JKQTMathTextEmptyBoxNode::toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const bool JKQTMathTextEmptyBoxNode::toHtml(QString &/*html*/, JKQTMathTextEnvironment /*currentEv*/, JKQTMathTextEnvironment /*defaultEv*/) const
{ {
return false; return false;
} }
@ -405,8 +405,7 @@ double JKQTMathTextPhantomNode::draw(QPainter& painter, double x, double y, JKQT
return x+s.width; return x+s.width;
} }
bool JKQTMathTextPhantomNode::toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const { bool JKQTMathTextPhantomNode::toHtml(QString &/*html*/, JKQTMathTextEnvironment /*currentEv*/, JKQTMathTextEnvironment /*defaultEv*/) const {
JKQTMathTextEnvironment ev=currentEv;
return "&nbsp;"; return "&nbsp;";
} }

View File

@ -862,7 +862,7 @@ JKQTMathTextNode* JKQTMathTextLatexParser::parseLatexString(bool get, JKQTMathTe
bool first=true; bool first=true;
bool firstLine=true; bool firstLine=true;
QVector<JKQTMathTextNode*> line; QVector<JKQTMathTextNode*> line;
size_t colCount=0; qsizetype colCount=0;
//std::cout<<"found \\begin{matrix}\n"; //std::cout<<"found \\begin{matrix}\n";
while (first || currentToken==MTTampersand || currentToken==MTTinstructionNewline) { while (first || currentToken==MTTampersand || currentToken==MTTinstructionNewline) {
while (getToken()==MTTwhitespace) ; // eat whitespace while (getToken()==MTTwhitespace) ; // eat whitespace
@ -908,10 +908,10 @@ JKQTMathTextNode* JKQTMathTextLatexParser::parseLatexString(bool get, JKQTMathTe
line.append(it); line.append(it);
} }
if (currentToken==MTTinstructionNewline || line.size()>0) { if (currentToken==MTTinstructionNewline || line.size()>0) {
colCount=qMax(colCount, static_cast<size_t>(line.size())); colCount=qMax(colCount, static_cast<qsizetype>(line.size()));
if (line.size()==0 || (line.size()>1 && line.size()==colCount)) { if (line.size()==0 || (line.size()>1 && static_cast<qsizetype>(line.size())==colCount)) {
items.append(line); items.append(line);
} else if (line.size()>1 && line.size()!=colCount) { } else if (line.size()>1 && static_cast<qsizetype>(line.size())!=colCount) {
addToErrorList(tr("error @ ch. %1: wrong number of entries widthin '\\begin{%2}...\\end{%2}'").arg(currentTokenID).arg(envname)); addToErrorList(tr("error @ ch. %1: wrong number of entries widthin '\\begin{%2}...\\end{%2}'").arg(currentTokenID).arg(envname));
} }
} }
@ -974,7 +974,7 @@ JKQTMathTextNode* JKQTMathTextLatexParser::parseLatexString(bool get, JKQTMathTe
return simplifyJKQTMathTextNode(nl); return simplifyJKQTMathTextNode(nl);
} }
JKQTMathTextVerticalListNode *JKQTMathTextLatexParser::parseMultilineLatexString(bool get, const QString &quitOnEnvironmentEnd, JKQTMathTextHorizontalAlignment _alignment, double _linespacingFactor, JKQTMathTextLineSpacingMode spacingMode_, JKQTMathTextVerticalOrientation _verticalOrientation) JKQTMathTextVerticalListNode *JKQTMathTextLatexParser::parseMultilineLatexString(bool /*get*/, const QString &quitOnEnvironmentEnd, JKQTMathTextHorizontalAlignment _alignment, double _linespacingFactor, JKQTMathTextLineSpacingMode spacingMode_, JKQTMathTextVerticalOrientation _verticalOrientation)
{ {
JKQTMathTextVerticalListNode* vlist = new JKQTMathTextVerticalListNode(parentMathText, _alignment, _linespacingFactor, spacingMode_, _verticalOrientation ); JKQTMathTextVerticalListNode* vlist = new JKQTMathTextVerticalListNode(parentMathText, _alignment, _linespacingFactor, spacingMode_, _verticalOrientation );
bool first=true; bool first=true;

View File

@ -36,12 +36,14 @@
JKQTPBarGraphBase::JKQTPBarGraphBase(JKQTBasePlotter* parent): JKQTPBarGraphBase::JKQTPBarGraphBase(JKQTBasePlotter* parent):
JKQTPXYBaselineGraph(parent), JKQTPXYBaselineGraph(parent),
width(0.9), shift(0), width(0.9),
shift(0),
rectRadiusAtValue(0),
rectRadiusAtBaseline(0),
m_drawBaseline(parent->getCurrentPlotterStyle().graphsStyle.barchartStyle.drawBaseline),
m_fillMode(FillMode::SingleFilling), m_fillMode(FillMode::SingleFilling),
m_useCustomDrawFunctor(false),
m_lineColorDerivationModeForSpecialFill(parent->getCurrentPlotterStyle().graphsStyle.barchartStyle.graphColorDerivationMode), m_lineColorDerivationModeForSpecialFill(parent->getCurrentPlotterStyle().graphsStyle.barchartStyle.graphColorDerivationMode),
rectRadiusAtBaseline(0),rectRadiusAtValue(0), m_useCustomDrawFunctor(false)
m_drawBaseline(parent->getCurrentPlotterStyle().graphsStyle.barchartStyle.drawBaseline)
{ {
initFillStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Barchart); initFillStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Barchart);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Barchart); initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Barchart);

View File

@ -732,12 +732,12 @@ std::function<QPointF (double)> JKQTPXFunctionLineGraph::buildErrorFunctorSpec()
return spec; return spec;
} }
bool JKQTPXFunctionLineGraph::getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) bool JKQTPXFunctionLineGraph::getXMinMax(double &/*minx*/, double &/*maxx*/, double &/*smallestGreaterZero*/)
{ {
return false; return false;
} }
bool JKQTPXFunctionLineGraph::getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) bool JKQTPXFunctionLineGraph::getYMinMax(double &/*miny*/, double &/*maxy*/, double &/*smallestGreaterZero*/)
{ {
return false; return false;
} }
@ -841,12 +841,12 @@ std::function<QPointF (double)> JKQTPYFunctionLineGraph::buildErrorFunctorSpec()
return spec; return spec;
} }
bool JKQTPYFunctionLineGraph::getXMinMax(double &miny, double &maxy, double &smallestGreaterZero) bool JKQTPYFunctionLineGraph::getXMinMax(double &/*miny*/, double &/*maxy*/, double &/*smallestGreaterZero*/)
{ {
return false; return false;
} }
bool JKQTPYFunctionLineGraph::getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) bool JKQTPYFunctionLineGraph::getYMinMax(double &/*miny*/, double &/*maxy*/, double &/*smallestGreaterZero*/)
{ {
return false; return false;
} }

View File

@ -723,10 +723,10 @@ void JKQTPMathImage::initJKQTPMathImage() {
JKQTPMathImage::JKQTPMathImage(double x, double y, double width, double height, JKQTPMathImageDataType datatype, const void* data, int Nx, int Ny, JKQTPMathImageColorPalette palette, JKQTBasePlotter* parent): JKQTPMathImage::JKQTPMathImage(double x, double y, double width, double height, JKQTPMathImageDataType datatype, const void* data, int Nx, int Ny, JKQTPMathImageColorPalette palette, JKQTBasePlotter* parent):
JKQTPMathImageBase(x, y, width, height, datatype, data, Nx, Ny, parent), JKQTPMathImageBase(x, y, width, height, datatype, data, Nx, Ny, parent),
JKQTPColorPaletteWithModifierStyleAndToolsMixin(parent), JKQTPColorPaletteWithModifierStyleAndToolsMixin(parent),
actCopyImage(nullptr),
actSaveImage(nullptr), actSaveImage(nullptr),
actCopyPalette(nullptr), actCopyImage(nullptr),
actSavePalette(nullptr) actSavePalette(nullptr),
actCopyPalette(nullptr)
{ {
initJKQTPMathImage(); initJKQTPMathImage();
this->palette=palette; this->palette=palette;

View File

@ -36,7 +36,7 @@
JKQTPSingleColumnSymbolsGraph::JKQTPSingleColumnSymbolsGraph(JKQTBasePlotter *parent): JKQTPSingleColumnSymbolsGraph::JKQTPSingleColumnSymbolsGraph(JKQTBasePlotter *parent):
JKQTPSingleColumnGraph(parent), seedValue(123456), positionScatterStyle(NoScatter), position(0), width(1) JKQTPSingleColumnGraph(parent), position(0), width(1), positionScatterStyle(NoScatter), seedValue(123456)
{ {
parentPlotStyle=-1; parentPlotStyle=-1;

View File

@ -40,11 +40,11 @@ JKQTPViolinplotElementBase::JKQTPViolinplotElementBase(JKQTBasePlotter* parent):
pos(JKQTP_NAN), pos(JKQTP_NAN),
median(JKQTP_NAN), median(JKQTP_NAN),
mean(JKQTP_NAN), mean(JKQTP_NAN),
drawMean(false),
drawMedian(false),
drawMinMax(false),
min(JKQTP_NAN), min(JKQTP_NAN),
max(JKQTP_NAN), max(JKQTP_NAN),
drawMean(false),
drawMinMax(false),
drawMedian(false),
violinPositionColumn(-1), violinPositionColumn(-1),
violinFrequencyColumn(-1) violinFrequencyColumn(-1)
{ {

View File

@ -78,7 +78,7 @@ JKQTPSymbolComboBox::JKQTPSymbolComboBox(QWidget *parent):
{ {
clear(); clear();
setEditable(false); setEditable(false);
for (int i=0; i<=JKQTPMaxSymbolID; i++) { for (int i=0; i<=static_cast<int>(JKQTPMaxSymbolID); i++) {
addSymbol(static_cast<JKQTPGraphSymbols>(i), JKQTPGraphSymbols2NameString(static_cast<JKQTPGraphSymbols>(i))); addSymbol(static_cast<JKQTPGraphSymbols>(i), JKQTPGraphSymbols2NameString(static_cast<JKQTPGraphSymbols>(i)));
} }
setCurrentIndex(0); setCurrentIndex(0);

View File

@ -644,9 +644,9 @@ QRectF JKQTBasePlotter::calcPlotMarginRect(PlotMarginUse use, PlotMarginSide sid
if (internalPlotMargins.contains(use)) { if (internalPlotMargins.contains(use)) {
const double marginSize=internalPlotMargins[use].getMargin(side); const double marginSize=internalPlotMargins[use].getMargin(side);
const double allTop=internalPlotMargins.calcTop(); const double allTop=internalPlotMargins.calcTop();
const double allBottom=internalPlotMargins.calcBottom(); //const double allBottom=internalPlotMargins.calcBottom();
const double allLeft=internalPlotMargins.calcLeft(); const double allLeft=internalPlotMargins.calcLeft();
const double allRight=internalPlotMargins.calcRight(); //const double allRight=internalPlotMargins.calcRight();
const double allHeight=internalPlotBorderTop+internalPlotHeight+internalPlotBorderBottom; const double allHeight=internalPlotBorderTop+internalPlotHeight+internalPlotBorderBottom;
const double allWidth=internalPlotBorderLeft+internalPlotWidth+internalPlotBorderRight; const double allWidth=internalPlotBorderLeft+internalPlotWidth+internalPlotBorderRight;
if (marginSize>0.0) { if (marginSize>0.0) {
@ -3632,7 +3632,7 @@ bool JKQTBasePlotter::saveImage(const QString& filename, bool displayPreview) {
for (const auto& ext: jkqtpPaintDeviceAdapters.get()[i]->getFileExtension()) filterextensions.last()<<ext.toLower(); for (const auto& ext: jkqtpPaintDeviceAdapters.get()[i]->getFileExtension()) filterextensions.last()<<ext.toLower();
} }
} }
const bool isWithSpecialDeviceAdapter=(filterstrings.size()>filtersIndexFirstExporterPLugin); //const bool isWithSpecialDeviceAdapter=(filterstrings.size()>filtersIndexFirstExporterPLugin);
// add remaining QImageWriter exporters // add remaining QImageWriter exporters
const int filtersIndexFirstQtWriter=filterstrings.size(); const int filtersIndexFirstQtWriter=filterstrings.size();
const QList<QByteArray> writerformats=QImageWriter::supportedImageFormats(); const QList<QByteArray> writerformats=QImageWriter::supportedImageFormats();

View File

@ -1155,7 +1155,7 @@ void JKQTPCoordinateAxis::setColor(QColor c)
setTickLabelColor(c); setTickLabelColor(c);
} }
JKQTPCoordinateAxis::Axis0ElementsSizeDescription JKQTPCoordinateAxis::getSize0(JKQTPEnhancedPainter &painter) JKQTPCoordinateAxis::Axis0ElementsSizeDescription JKQTPCoordinateAxis::getSize0(JKQTPEnhancedPainter &/*painter*/)
{ {
return JKQTPCoordinateAxis::Axis0ElementsSizeDescription(); return JKQTPCoordinateAxis::Axis0ElementsSizeDescription();
} }
@ -2136,7 +2136,7 @@ double JKQTPVerticalIndependentAxis::getParentOtheraxisOffset() const {
} }
double JKQTPVerticalIndependentAxis::parentOtherAxisX2P(double x) const double JKQTPVerticalIndependentAxis::parentOtherAxisX2P(double /*x*/) const
{ {
return qQNaN(); return qQNaN();
} }
@ -2933,7 +2933,7 @@ double JKQTPHorizontalIndependentAxis::getParentOtheraxisOffset() const {
return otherAxisOffset; return otherAxisOffset;
} }
double JKQTPHorizontalIndependentAxis::parentOtherAxisX2P(double x) const double JKQTPHorizontalIndependentAxis::parentOtherAxisX2P(double /*x*/) const
{ {
return qQNaN(); return qQNaN();
} }

View File

@ -232,7 +232,7 @@ QVector<Qt::PenStyle> JKQTGraphsBaseStyle::getDefaultGraphPenStyles()
QVector<JKQTPGraphSymbols> JKQTGraphsBaseStyle::getDefaultGraphSymbols() QVector<JKQTPGraphSymbols> JKQTGraphsBaseStyle::getDefaultGraphSymbols()
{ {
QVector<JKQTPGraphSymbols> syms; QVector<JKQTPGraphSymbols> syms;
for (int i=2; i<=JKQTPMaxSymbolID; i++) syms.push_back(static_cast<JKQTPGraphSymbols>(i)); for (int i=2; i<=static_cast<int>(JKQTPMaxSymbolID); i++) syms.push_back(static_cast<JKQTPGraphSymbols>(i));
return syms; return syms;
} }
@ -444,7 +444,7 @@ JKQTBarchartSpecificStyleProperties::JKQTBarchartSpecificStyleProperties(const J
} }
JKQTBarchartSpecificStyleProperties::JKQTBarchartSpecificStyleProperties(const JKQTBasePlotterStyle& parent, const JKQTGraphsSpecificStyleProperties &other): JKQTBarchartSpecificStyleProperties::JKQTBarchartSpecificStyleProperties(const JKQTBasePlotterStyle& /*parent*/, const JKQTGraphsSpecificStyleProperties &other):
JKQTGraphsSpecificStyleProperties(JKQTPPlotStyleType::Barchart, other), JKQTGraphsSpecificStyleProperties(JKQTPPlotStyleType::Barchart, other),
defaultRectRadiusAtValue(0), defaultRectRadiusAtValue(0),
defaultRectRadiusAtBaseline(0), defaultRectRadiusAtBaseline(0),
@ -478,7 +478,7 @@ JKQTImpulseSpecificStyleProperties::JKQTImpulseSpecificStyleProperties(const JKQ
} }
JKQTImpulseSpecificStyleProperties::JKQTImpulseSpecificStyleProperties(const JKQTBasePlotterStyle& parent, const JKQTGraphsSpecificStyleProperties &other): JKQTImpulseSpecificStyleProperties::JKQTImpulseSpecificStyleProperties(const JKQTBasePlotterStyle& /*parent*/, const JKQTGraphsSpecificStyleProperties &other):
JKQTGraphsSpecificStyleProperties(JKQTPPlotStyleType::Impulses, other), JKQTGraphsSpecificStyleProperties(JKQTPPlotStyleType::Impulses, other),
drawBaseline(false) drawBaseline(false)
{ {
@ -500,8 +500,8 @@ void JKQTImpulseSpecificStyleProperties::saveSettings(QSettings &settings, const
JKQTFillStyleSummmary::JKQTFillStyleSummmary(Qt::BrushStyle style, const QGradient& grad, double rotAngleDeg): JKQTFillStyleSummmary::JKQTFillStyleSummmary(Qt::BrushStyle style, const QGradient& grad):
brushStyle(style), gradient(grad), rotationAngleDeg(rotAngleDeg) brushStyle(style), gradient(grad)
{ {
} }
@ -524,7 +524,7 @@ QBrush JKQTFillStyleSummmary::brush(const QColor &color) const
JKQTFillStyleSummmary JKQTFillStyleSummmary::fromString(const QString &style) JKQTFillStyleSummmary JKQTFillStyleSummmary::fromString(const QString &style)
{ {
JKQTFillStyleSummmary res; JKQTFillStyleSummmary res;
res.brushStyle=jkqtp_String2QBrushStyleExt(style, nullptr, &(res.gradient), &(res.texture), &(res.rotationAngleDeg)); res.brushStyle=jkqtp_String2QBrushStyleExt(style, &(res.gradient), &(res.texture));
return res; return res;
} }

View File

@ -49,13 +49,16 @@ class JKQTPLOTTER_LIB_EXPORT JKQTFillStyleSummmary {
Q_GADGET Q_GADGET
#endif #endif
public: public:
JKQTFillStyleSummmary(Qt::BrushStyle style=Qt::SolidPattern, const QGradient& grad=QGradient(), double rotAngleDeg=0.0); JKQTFillStyleSummmary(Qt::BrushStyle style=Qt::SolidPattern, const QGradient& grad=QGradient());
/** \brief a brushStyle (e.g. pattern) to use for filling */
Qt::BrushStyle brushStyle; Qt::BrushStyle brushStyle;
/** \brief a QGradient to use for filling */
QGradient gradient; QGradient gradient;
/** \brief a texture to use for filling */
QPixmap texture; QPixmap texture;
double rotationAngleDeg;
/** \brief constructs a QBrush from the data in this object, possibly using \a color to replace JKQTPlotterDrawingTools::CurrentColorPlaceholder color stops and a color for a pattern defined via e.g. \c brushStyle=Qt::BDiagPattern */
QBrush brush(const QColor& color) const; QBrush brush(const QColor& color) const;
/** \brief reads object contents from a string representation, e.g. as created by JKQTFillStyleSummmary::toCSSString() */ /** \brief reads object contents from a string representation, e.g. as created by JKQTFillStyleSummmary::toCSSString() */

View File

@ -315,7 +315,7 @@ QString JKQTPGraphSymbolStyleMixin::getSymbolFontName() const
double JKQTPGraphSymbolStyleMixin::getKeySymbolLineWidthPx(JKQTPEnhancedPainter& painter, const QRectF& keyRect, const JKQTBasePlotter *parent, double maxSymbolSizeFracton) const double JKQTPGraphSymbolStyleMixin::getKeySymbolLineWidthPx(JKQTPEnhancedPainter& painter, const QRectF& keyRect, const JKQTBasePlotter *parent, double maxSymbolSizeFracton) const
{ {
const double minSize=qMin(keyRect.width(), keyRect.height()); //const double minSize=qMin(keyRect.width(), keyRect.height());
double symbolWidth=parent->pt2px(painter, this->getSymbolLineWidth()*parent->getLineWidthMultiplier()); double symbolWidth=parent->pt2px(painter, this->getSymbolLineWidth()*parent->getLineWidthMultiplier());
double symbolSize=getKeySymbolSizePx(painter, keyRect, parent, maxSymbolSizeFracton); double symbolSize=getKeySymbolSizePx(painter, keyRect, parent, maxSymbolSizeFracton);
if (symbolWidth>0.3*symbolSize) symbolWidth=0.3*symbolSize; if (symbolWidth>0.3*symbolSize) symbolWidth=0.3*symbolSize;

View File

@ -189,7 +189,7 @@ JKQTPBaseKey::KeySizeDescription JKQTPBaseKey::getSize(JKQTPEnhancedPainter &pai
QFont kf(JKQTMathTextFontSpecifier::fromFontSpec(keyStyle().fontName).fontName(), keyStyle().fontSize); QFont kf(JKQTMathTextFontSpecifier::fromFontSpec(keyStyle().fontName).fontName(), keyStyle().fontSize);
kf.setPointSizeF(keyStyle().fontSize*getParent()->getFontSizeMultiplier()); kf.setPointSizeF(keyStyle().fontSize*getParent()->getFontSizeMultiplier());
const qreal Xwid=JKQTMathTextGetBoundingRect(kf,"X",painter.device()).width(); //const qreal Xwid=JKQTMathTextGetBoundingRect(kf,"X",painter.device()).width();
// calculate layout of the "table" of samples and labels // calculate layout of the "table" of samples and labels
const KeyLayoutDescription layout=getKeyLayout(painter); const KeyLayoutDescription layout=getKeyLayout(painter);
@ -235,7 +235,7 @@ void JKQTPBaseKey::modifySize(JKQTPEnhancedPainter &painter, KeySizeDescription
const auto lay=getLayout(); const auto lay=getLayout();
if (lay==JKQTPKeyLayoutMultiColumn || lay==JKQTPKeyLayoutMultiRow) { if (lay==JKQTPKeyLayoutMultiColumn || lay==JKQTPKeyLayoutMultiRow) {
std::function<bool(QSizeF, QSizeF)> fcmpSizeTooLarge=[](const QSizeF& requiredSize, const QSizeF& preliminaryPlotSize) { return true; }; std::function<bool(QSizeF, QSizeF)> fcmpSizeTooLarge=[](const QSizeF& /*requiredSize*/, const QSizeF& /*preliminaryPlotSize*/) { return true; };
bool increaseColumnCount=true; bool increaseColumnCount=true;
bool fillMaxMode=false; bool fillMaxMode=false;

View File

@ -40,8 +40,8 @@ JKQTPKeyStyle::JKQTPKeyStyle():
xOffset(1), xOffset(1),
yOffset(1), yOffset(1),
xSeparation(0.85), xSeparation(0.85),
columnSeparation(0.75),
ySeparation(0.35), ySeparation(0.35),
columnSeparation(0.75),
position(JKQTPKeyInsideTopRight), position(JKQTPKeyInsideTopRight),
layout(JKQTPKeyLayoutOneColumn) layout(JKQTPKeyLayoutOneColumn)
{ {

View File

@ -168,21 +168,19 @@ private slots:
Qt::BrushStyle bs; Qt::BrushStyle bs;
QGradient n, g; QGradient n, g;
QLinearGradient lg; QLinearGradient lg;
//QPixmap pix;
QColor col;
QVERIFY_THROWS_NO_EXCEPTION(bs=jkqtp_String2QBrushStyleExt("warmflame", &col, &n, nullptr)); QVERIFY_THROWS_NO_EXCEPTION(bs=jkqtp_String2QBrushStyleExt("warmflame", &n, nullptr));
g = QGradient(QGradient::WarmFlame); g = QGradient(QGradient::WarmFlame);
g.setCoordinateMode(QGradient::ObjectBoundingMode); g.setCoordinateMode(QGradient::ObjectBoundingMode);
QCOMPARE_EQ(n, g); QCOMPARE_EQ(n, g);
QCOMPARE_EQ(bs, Qt::LinearGradientPattern); QCOMPARE_EQ(bs, Qt::LinearGradientPattern);
QVERIFY_THROWS_NO_EXCEPTION(bs=jkqtp_String2QBrushStyleExt("d1", &col, &n, nullptr)); QVERIFY_THROWS_NO_EXCEPTION(bs=jkqtp_String2QBrushStyleExt("d1", &n, nullptr));
QCOMPARE_EQ(bs, Qt::Dense1Pattern); QCOMPARE_EQ(bs, Qt::Dense1Pattern);
QVERIFY_THROWS_NO_EXCEPTION(bs=jkqtp_String2QBrushStyleExt("linear-gradient(to left, red, blue)", &col, &n, nullptr)); QVERIFY_THROWS_NO_EXCEPTION(bs=jkqtp_String2QBrushStyleExt("linear-gradient(to left, red, blue)", &n, nullptr));
lg = QLinearGradient(1,0.5,0,0.5); lg = QLinearGradient(1,0.5,0,0.5);
lg.setCoordinateMode(QGradient::ObjectBoundingMode); lg.setCoordinateMode(QGradient::ObjectBoundingMode);
lg.setStops({QGradientStop(0, QColor("red")), QGradientStop(1, QColor("blue"))}); lg.setStops({QGradientStop(0, QColor("red")), QGradientStop(1, QColor("blue"))});

View File

@ -148,7 +148,7 @@ void doListPalettes(const QDir& outputDir, QSize iconsize) {
} }
void doListErrorIndicators(const QDir& outputDir, int iconsize, QColor backgroundColor) { void doListErrorIndicators(const QDir& outputDir, int /*iconsize*/, QColor /*backgroundColor*/) {
JKQTBasePlotter plot(true); JKQTBasePlotter plot(true);
JKQTPDatastore* ds=plot.getDatastore(); JKQTPDatastore* ds=plot.getDatastore();
size_t cx=ds->addCopiedColumn(QVector<double>{-1.5,-0.5,0.5,1.5,2.5},"x"); size_t cx=ds->addCopiedColumn(QVector<double>{-1.5,-0.5,0.5,1.5,2.5},"x");
@ -211,7 +211,7 @@ void doListErrorIndicators(const QDir& outputDir, int iconsize, QColor backgroun
} }
} }
void doListAxisStyling(const QDir& outputDir, int iconsize, QColor backgroundColor) { void doListAxisStyling(const QDir& outputDir, int iconsize, QColor /*backgroundColor*/) {
JKQTBasePlotter plot(true); JKQTBasePlotter plot(true);
plot.setXY(0,1,0.9,110); plot.setXY(0,1,0.9,110);
@ -409,7 +409,7 @@ void doListAxisStyling(const QDir& outputDir, int iconsize, QColor backgroundCol
plot.grabPixelImage(QSize(plot.getWidth(),plot.getHeight()), false).copy(0,0,plot.getWidth(),plot.getHeight()).save(outputDir.absoluteFilePath("axis_unit_scaling_pi.png"), "png"); plot.grabPixelImage(QSize(plot.getWidth(),plot.getHeight()), false).copy(0,0,plot.getWidth(),plot.getHeight()).save(outputDir.absoluteFilePath("axis_unit_scaling_pi.png"), "png");
} }
void doListAxisTickLabelAngles(const QDir& outputDir, int iconsize, QColor backgroundColor) { void doListAxisTickLabelAngles(const QDir& outputDir, int iconsize, QColor /*backgroundColor*/) {
JKQTBasePlotter plot(true); JKQTBasePlotter plot(true);
plot.setXY(0,1000,0,1000); plot.setXY(0,1000,0,1000);
@ -439,7 +439,7 @@ void doListAxisTickLabelAngles(const QDir& outputDir, int iconsize, QColor backg
} }
} }
void doListLabelPosition(const QDir& outputDir, int iconsize, QColor backgroundColor) { void doListLabelPosition(const QDir& outputDir, int iconsize, QColor /*backgroundColor*/) {
JKQTBasePlotter plot(true); JKQTBasePlotter plot(true);
plot.setXY(0,100,0,100); plot.setXY(0,100,0,100);
@ -526,7 +526,7 @@ void plotStyle(const QSettings& style, QSize examplePlotSize, const QString& exa
void doListStyles(const QDir& outputDir, const QStringList& doctomodify, int iconsize, QColor backgroundColor) { void doListStyles(const QDir& outputDir, const QStringList& doctomodify, int iconsize, QColor /*backgroundColor*/) {
QDir dir(":/JKQTPlotter/styles/", "*.ini"); QDir dir(":/JKQTPlotter/styles/", "*.ini");
QString doc; QString doc;
{ {
@ -622,7 +622,7 @@ inline QString JKQTPKeyPosition2CPPString(JKQTPKeyPosition pos) {
} }
void doListKeyPositions(const QDir& outputDir, int iconsize, QColor backgroundColor) { void doListKeyPositions(const QDir& outputDir, int iconsize, QColor /*backgroundColor*/) {
JKQTBasePlotter plot(true); JKQTBasePlotter plot(true);
plot.setWidgetSize(iconsize,iconsize); plot.setWidgetSize(iconsize,iconsize);
@ -671,7 +671,7 @@ void doListKeyPositions(const QDir& outputDir, int iconsize, QColor backgroundCo
} }
} }
void doListKeyLayouts(const QDir& outputDir, int iconsize, QColor backgroundColor) { void doListKeyLayouts(const QDir& outputDir, int iconsize, QColor /*backgroundColor*/) {
JKQTBasePlotter plot(true); JKQTBasePlotter plot(true);
plot.setWidgetSize(iconsize*2.0,iconsize); plot.setWidgetSize(iconsize*2.0,iconsize);