mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2025-01-12 17:00:32 +08:00
fixed some Qt5 compile errors
This commit is contained in:
parent
35cb8541da
commit
3e4f039efb
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.7 KiB |
@ -1035,16 +1035,19 @@ inline QRgb jkqtp_qRgbOpaque(QRgb col) {
|
|||||||
class JKQTCOMMON_LIB_EXPORT JKQTPPaletteList: public QList<QPair<double, QRgb> >
|
class JKQTCOMMON_LIB_EXPORT JKQTPPaletteList: public QList<QPair<double, QRgb> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef QList<QPair<double, QRgb> > ListType;
|
typedef QPair<double, QRgb> parameter_type;
|
||||||
JKQTPPaletteList(): ListType() {};
|
typedef QList<parameter_type> ListType;
|
||||||
JKQTPPaletteList(qsizetype size): ListType(size) {};
|
inline JKQTPPaletteList(): ListType() {};
|
||||||
JKQTPPaletteList(qsizetype size, ListType::parameter_type value): ListType(size, value) {};
|
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||||
|
inline JKQTPPaletteList(qsizetype size): ListType(size) {};
|
||||||
|
inline JKQTPPaletteList(qsizetype size, parameter_type value): ListType(size, value) {};
|
||||||
|
#endif
|
||||||
template <class T>
|
template <class T>
|
||||||
JKQTPPaletteList(std::initializer_list<QPair<double, QRgb>> args): ListType(args) {};
|
inline JKQTPPaletteList(std::initializer_list<QPair<double, QRgb>> args): ListType(args) {};
|
||||||
template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
|
template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
|
||||||
JKQTPPaletteList(InputIterator first, InputIterator last): ListType(first, last) {};
|
inline JKQTPPaletteList(InputIterator first, InputIterator last): ListType(first, last) {};
|
||||||
JKQTPPaletteList(ListType &&other):ListType(std::forward<ListType>(other)) {};
|
inline JKQTPPaletteList(ListType &&other):ListType(std::forward<ListType>(other)) {};
|
||||||
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) {
|
||||||
@ -1066,7 +1069,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** \brief returns the minimum value of the double-component */
|
/** \brief returns the minimum value of the double-component */
|
||||||
double getMinPosition() const {
|
inline double getMinPosition() const {
|
||||||
double mi=0;
|
double mi=0;
|
||||||
bool first=true;
|
bool first=true;
|
||||||
for (const auto& c: *this) {
|
for (const auto& c: *this) {
|
||||||
@ -1080,7 +1083,7 @@ public:
|
|||||||
return mi;
|
return mi;
|
||||||
}
|
}
|
||||||
/** \brief returns the maximum value of the double-component */
|
/** \brief returns the maximum value of the double-component */
|
||||||
double getMaxPosition() const {
|
inline double getMaxPosition() const {
|
||||||
double ma=0;
|
double ma=0;
|
||||||
bool first=true;
|
bool first=true;
|
||||||
for (const auto& c: *this) {
|
for (const auto& c: *this) {
|
||||||
@ -1094,7 +1097,7 @@ public:
|
|||||||
return ma;
|
return ma;
|
||||||
}
|
}
|
||||||
/** \brief returns the minimum and maximum value of the double-component, as well as the avg. increment between two such values */
|
/** \brief returns the minimum and maximum value of the double-component, as well as the avg. increment between two such values */
|
||||||
void getMinMaxPosition(double& mi, double& ma, double* avgDelta=nullptr) const {
|
inline void getMinMaxPosition(double& mi, double& ma, double* avgDelta=nullptr) const {
|
||||||
mi=ma=0;
|
mi=ma=0;
|
||||||
bool first=true;
|
bool first=true;
|
||||||
for (const auto& c: *this) {
|
for (const auto& c: *this) {
|
||||||
|
@ -752,12 +752,12 @@ QColor jkqtp_String2QColor(QString color)
|
|||||||
if (rxColMod.exactMatch(color)) {
|
if (rxColMod.exactMatch(color)) {
|
||||||
QColor col(Qt::black);
|
QColor col(Qt::black);
|
||||||
const QString name=rxColMod.cap(1);
|
const QString name=rxColMod.cap(1);
|
||||||
const int v1=valPercToInt(rxColMod.cap(2), rxColMod.cap(3));
|
const int v1=valUnitToInt(rxColMod.cap(2), rxColMod.cap(3));
|
||||||
const int h1=valUnitToInt(mColMod.captured(2), mColMod.captured(3), INT_MAX);
|
const int h1=valUnitToInt(rxColMod.cap(2), rxColMod.cap(3), INT_MAX);
|
||||||
const int v2=valPercToInt(rxColMod.cap(4), rxColMod.cap(5));
|
const int v2=valUnitToInt(rxColMod.cap(4), rxColMod.cap(5));
|
||||||
const int a2=valPercToAInt(rxColMod.cap(4), rxColMod.cap(5));
|
const int a2=valUnitToAlphaInt(rxColMod.cap(4), rxColMod.cap(5));
|
||||||
const int v3=valPercToInt(rxColMod.cap(6), rxColMod.cap(7));
|
const int v3=valUnitToInt(rxColMod.cap(6), rxColMod.cap(7));
|
||||||
const int a4=valPercToAInt(rxColMod.cap(8), rxColMod.cap(9));
|
const int a4=valUnitToAlphaInt(rxColMod.cap(8), rxColMod.cap(9));
|
||||||
if (name=="gray"||name=="grey") {
|
if (name=="gray"||name=="grey") {
|
||||||
if (v2<0) col.setRgb(v1,v1,v1);
|
if (v2<0) col.setRgb(v1,v1,v1);
|
||||||
else col.setRgb(v1,v1,v1,a2);
|
else col.setRgb(v1,v1,v1,a2);
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "jkqtplotter.h"
|
#include "jkqtplotter.h"
|
||||||
|
|
||||||
|
|
||||||
std::atomic<int> JKQTPlotter::jkqtp_RESIZE_DELAY = 100;
|
std::atomic<int> JKQTPlotter::jkqtp_RESIZE_DELAY(100);
|
||||||
|
|
||||||
void JKQTPlotter::setGlobalResizeDelay(int delayMS)
|
void JKQTPlotter::setGlobalResizeDelay(int delayMS)
|
||||||
{
|
{
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
#include "jkqtplotter/jkqtpbaseplotter.h"
|
#include "jkqtplotter/jkqtpbaseplotter.h"
|
||||||
#include "jkqtplotter/jkqtplotterstyle.h"
|
#include "jkqtplotter/jkqtplotterstyle.h"
|
||||||
|
@ -677,8 +677,13 @@ JKQTPColorDerivationMode JKQTPColorDerivationMode::fromString(const QString &mod
|
|||||||
return rx4;
|
return rx4;
|
||||||
}();
|
}();
|
||||||
#endif
|
#endif
|
||||||
for (QString p: parts) {
|
for (QString pin: parts) {
|
||||||
p=p.removeIf([](QChar c) { return c.isSpace()||c=='\t';}).trimmed();
|
QString p;
|
||||||
|
p.reserve(pin.size());
|
||||||
|
for (auto c: pin) {
|
||||||
|
if (!c.isSpace()&&c!='\t') p.append(c);
|
||||||
|
}
|
||||||
|
p=p.trimmed();
|
||||||
if (p=="same_color") res.colorModification=ColorChangeMode::SameColor;
|
if (p=="same_color") res.colorModification=ColorChangeMode::SameColor;
|
||||||
else if (p=="invert"||p=="inverted"||p=="inverted_color") res.colorModification=ColorChangeMode::InvertColor;
|
else if (p=="invert"||p=="inverted"||p=="inverted_color") res.colorModification=ColorChangeMode::InvertColor;
|
||||||
else if (p=="invert"||p=="inverted"||p=="inverted_color") res.colorModification=ColorChangeMode::InvertColor;
|
else if (p=="invert"||p=="inverted"||p=="inverted_color") res.colorModification=ColorChangeMode::InvertColor;
|
||||||
@ -694,7 +699,7 @@ JKQTPColorDerivationMode JKQTPColorDerivationMode::fromString(const QString &mod
|
|||||||
const QString instr=m1arg.captured(1).trimmed();
|
const QString instr=m1arg.captured(1).trimmed();
|
||||||
const QString arg1=m1arg.captured(2).trimmed();
|
const QString arg1=m1arg.captured(2).trimmed();
|
||||||
#else
|
#else
|
||||||
if (rx1arg.indexIn(slt[i])>=0) {
|
if (rx1arg.indexIn(p)>=0) {
|
||||||
const QString instr=rx1arg.cap(1).trimmed();
|
const QString instr=rx1arg.cap(1).trimmed();
|
||||||
const QString arg1=rx1arg.cap(2).trimmed();
|
const QString arg1=rx1arg.cap(2).trimmed();
|
||||||
#endif
|
#endif
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Loading…
Reference in New Issue
Block a user