bugfixed parantheses for JKQTPCALTintslashfrac labels + some Codiga-Violations

This commit is contained in:
jkriege2 2022-09-28 01:46:19 +02:00
parent ce3f25e044
commit 7b715541e7
5 changed files with 8 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -574,7 +574,6 @@ QColor jkqtp_lookupQColorName(const QString &color) {
if (col=="text") return QGuiApplication::palette().color(QPalette::Text); if (col=="text") return QGuiApplication::palette().color(QPalette::Text);
if (col=="brightttext") return QGuiApplication::palette().color(QPalette::BrightText); if (col=="brightttext") return QGuiApplication::palette().color(QPalette::BrightText);
if (col=="base") return QGuiApplication::palette().color(QPalette::Base); if (col=="base") return QGuiApplication::palette().color(QPalette::Base);
if (col=="window") return QGuiApplication::palette().color(QPalette::Window);
if (col=="shadow") return QGuiApplication::palette().color(QPalette::Shadow); if (col=="shadow") return QGuiApplication::palette().color(QPalette::Shadow);
if (col=="highlight") return QGuiApplication::palette().color(QPalette::Highlight); if (col=="highlight") return QGuiApplication::palette().color(QPalette::Highlight);
if (col=="highlightedtext") return QGuiApplication::palette().color(QPalette::HighlightedText); if (col=="highlightedtext") return QGuiApplication::palette().color(QPalette::HighlightedText);

View File

@ -91,7 +91,7 @@
* \param mode if \c =='f' the mode \c std::fixed is used for output, otherwise \c std::scientific is used * \param mode if \c =='f' the mode \c std::fixed is used for output, otherwise \c std::scientific is used
*/ */
template <class T> template <class T>
inline void jkqtplinalgPrintMatrix(T* matrix, long L, long C, int width=9, int precision=3, char mode='f') { inline void jkqtplinalgPrintMatrix(const T* matrix, long L, long C, int width=9, int precision=3, char mode='f') {
for (long l=0; l<L; l++) { for (long l=0; l<L; l++) {
for (long c=0; c<C; c++) { for (long c=0; c<C; c++) {
if (c>0) std::cout<<", "; if (c>0) std::cout<<", ";

View File

@ -386,10 +386,9 @@ JKQTMathTextNode *JKQTMathTextLatexParser::parse(const QString &text, JKQTMathTe
{ {
initStaticStructures(); initStaticStructures();
JKQTMathTextNode* parsedNode=nullptr; JKQTMathTextNode* parsedNode=nullptr;
QString ntext; QString ntext=text;
if (options.testFlag(JKQTMathText::StartWithMathMode)) ntext=QString("$")+text+QString("$"); if (options.testFlag(JKQTMathText::StartWithMathMode)) ntext=QString("$")+ntext+QString("$");
if (options.testFlag(JKQTMathText::AddSpaceBeforeAndAfter)) ntext=QString("\\;")+text+QString("\\;"); if (options.testFlag(JKQTMathText::AddSpaceBeforeAndAfter)) ntext=QString("\\;")+ntext+QString("\\;");
else ntext=text;
parseString=ntext; parseString=ntext;

View File

@ -471,8 +471,10 @@ QString JKQTPCoordinateAxis::floattolabel(double data, int past_comma) const {
if (sign<0) res+="-"; if (sign<0) res+="-";
else res+="+"; else res+="+";
} }
if (axisStyle.tickLabelType==JKQTPCALTintslashfrac) if (axisStyle.tickLabelType==JKQTPCALTintslashfrac) {
res=addTickUnit("("+res+QString("%1/%2").arg(num).arg(denom)+")"); res+=QString("%1/%2").arg(num).arg(denom);
if (intpart!=0 && !tickUnitName.isEmpty()) res="("+res+")";
}
} }
} }
} else { } else {