mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 01:51:49 +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> >
|
||||
{
|
||||
public:
|
||||
typedef QList<QPair<double, QRgb> > ListType;
|
||||
JKQTPPaletteList(): ListType() {};
|
||||
JKQTPPaletteList(qsizetype size): ListType(size) {};
|
||||
JKQTPPaletteList(qsizetype size, ListType::parameter_type value): ListType(size, value) {};
|
||||
typedef QPair<double, QRgb> parameter_type;
|
||||
typedef QList<parameter_type> ListType;
|
||||
inline JKQTPPaletteList(): ListType() {};
|
||||
#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>
|
||||
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>
|
||||
JKQTPPaletteList(InputIterator first, InputIterator last): ListType(first, last) {};
|
||||
JKQTPPaletteList(ListType &&other):ListType(std::forward<ListType>(other)) {};
|
||||
JKQTPPaletteList(const ListType &other):ListType(other) {};
|
||||
inline JKQTPPaletteList(InputIterator first, InputIterator last): ListType(first, last) {};
|
||||
inline JKQTPPaletteList(ListType &&other):ListType(std::forward<ListType>(other)) {};
|
||||
inline JKQTPPaletteList(const ListType &other):ListType(other) {};
|
||||
|
||||
using ListType::push_back;
|
||||
inline void push_back(QRgb rgb) {
|
||||
@ -1066,7 +1069,7 @@ public:
|
||||
}
|
||||
|
||||
/** \brief returns the minimum value of the double-component */
|
||||
double getMinPosition() const {
|
||||
inline double getMinPosition() const {
|
||||
double mi=0;
|
||||
bool first=true;
|
||||
for (const auto& c: *this) {
|
||||
@ -1080,7 +1083,7 @@ public:
|
||||
return mi;
|
||||
}
|
||||
/** \brief returns the maximum value of the double-component */
|
||||
double getMaxPosition() const {
|
||||
inline double getMaxPosition() const {
|
||||
double ma=0;
|
||||
bool first=true;
|
||||
for (const auto& c: *this) {
|
||||
@ -1094,7 +1097,7 @@ public:
|
||||
return ma;
|
||||
}
|
||||
/** \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;
|
||||
bool first=true;
|
||||
for (const auto& c: *this) {
|
||||
|
@ -752,12 +752,12 @@ QColor jkqtp_String2QColor(QString color)
|
||||
if (rxColMod.exactMatch(color)) {
|
||||
QColor col(Qt::black);
|
||||
const QString name=rxColMod.cap(1);
|
||||
const int v1=valPercToInt(rxColMod.cap(2), rxColMod.cap(3));
|
||||
const int h1=valUnitToInt(mColMod.captured(2), mColMod.captured(3), INT_MAX);
|
||||
const int v2=valPercToInt(rxColMod.cap(4), rxColMod.cap(5));
|
||||
const int a2=valPercToAInt(rxColMod.cap(4), rxColMod.cap(5));
|
||||
const int v3=valPercToInt(rxColMod.cap(6), rxColMod.cap(7));
|
||||
const int a4=valPercToAInt(rxColMod.cap(8), rxColMod.cap(9));
|
||||
const int v1=valUnitToInt(rxColMod.cap(2), rxColMod.cap(3));
|
||||
const int h1=valUnitToInt(rxColMod.cap(2), rxColMod.cap(3), INT_MAX);
|
||||
const int v2=valUnitToInt(rxColMod.cap(4), rxColMod.cap(5));
|
||||
const int a2=valUnitToAlphaInt(rxColMod.cap(4), rxColMod.cap(5));
|
||||
const int v3=valUnitToInt(rxColMod.cap(6), rxColMod.cap(7));
|
||||
const int a4=valUnitToAlphaInt(rxColMod.cap(8), rxColMod.cap(9));
|
||||
if (name=="gray"||name=="grey") {
|
||||
if (v2<0) col.setRgb(v1,v1,v1);
|
||||
else col.setRgb(v1,v1,v1,a2);
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "jkqtplotter.h"
|
||||
|
||||
|
||||
std::atomic<int> JKQTPlotter::jkqtp_RESIZE_DELAY = 100;
|
||||
std::atomic<int> JKQTPlotter::jkqtp_RESIZE_DELAY(100);
|
||||
|
||||
void JKQTPlotter::setGlobalResizeDelay(int delayMS)
|
||||
{
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include <atomic>
|
||||
|
||||
#include "jkqtplotter/jkqtpbaseplotter.h"
|
||||
#include "jkqtplotter/jkqtplotterstyle.h"
|
||||
|
@ -677,8 +677,13 @@ JKQTPColorDerivationMode JKQTPColorDerivationMode::fromString(const QString &mod
|
||||
return rx4;
|
||||
}();
|
||||
#endif
|
||||
for (QString p: parts) {
|
||||
p=p.removeIf([](QChar c) { return c.isSpace()||c=='\t';}).trimmed();
|
||||
for (QString pin: parts) {
|
||||
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;
|
||||
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 arg1=m1arg.captured(2).trimmed();
|
||||
#else
|
||||
if (rx1arg.indexIn(slt[i])>=0) {
|
||||
if (rx1arg.indexIn(p)>=0) {
|
||||
const QString instr=rx1arg.cap(1).trimmed();
|
||||
const QString arg1=rx1arg.cap(2).trimmed();
|
||||
#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