diff --git a/include/ui/gridsettings.h b/include/ui/gridsettings.h index 0a966e4c..807a0685 100644 --- a/include/ui/gridsettings.h +++ b/include/ui/gridsettings.h @@ -23,16 +23,16 @@ public: int offsetY = 0; Style style = Style::Solid; QColor color = Qt::black; - QList getHorizontalDashPattern() const { return this->getDashPattern(this->width); } - QList getVerticalDashPattern() const { return this->getDashPattern(this->height); } + QVector getHorizontalDashPattern() const { return this->getDashPattern(this->width); } + QVector getVerticalDashPattern() const { return this->getDashPattern(this->height); } static QString getStyleName(Style style); static GridSettings::Style getStyleFromName(const QString &name); private: static const QMap styleToName; - QList getCenteredDashPattern(uint length, qreal dashLength, qreal gapLength) const; - QList getDashPattern(uint length) const; + QVector getCenteredDashPattern(uint length, qreal dashLength, qreal gapLength) const; + QVector getDashPattern(uint length) const; }; inline bool operator==(const GridSettings &a, const GridSettings &b) { diff --git a/src/ui/gridsettings.cpp b/src/ui/gridsettings.cpp index 96494e83..b4e180af 100644 --- a/src/ui/gridsettings.cpp +++ b/src/ui/gridsettings.cpp @@ -22,7 +22,7 @@ GridSettings::Style GridSettings::getStyleFromName(const QString &name) { // We do some extra work here to A: try and center the dashes away from the intersections, and B: keep the dash pattern's total // length equal to the length of a grid square. This keeps the patterns looking reasonable regardless of the grid size. // Otherwise, the dashes can start to intersect in weird ways and create grid patterns that don't look like a rectangular grid. -QList GridSettings::getCenteredDashPattern(uint length, qreal dashLength, qreal gapLength) const { +QVector GridSettings::getCenteredDashPattern(uint length, qreal dashLength, qreal gapLength) const { const qreal minEdgesLength = 0.6*2; if (length <= dashLength + minEdgesLength) return {dashLength}; @@ -36,7 +36,7 @@ QList GridSettings::getCenteredDashPattern(uint length, qreal dashLength, const qreal edgeLength = (length - mainLength) / 2; // Fill the pattern - QList pattern = {0, edgeLength}; + QVector pattern = {0, edgeLength}; for (int i = 0; i < numDashes-1; i++) { pattern.append(dashLength); pattern.append(gapLength); @@ -47,7 +47,7 @@ QList GridSettings::getCenteredDashPattern(uint length, qreal dashLength, return pattern; } -QList GridSettings::getDashPattern(uint length) const { +QVector GridSettings::getDashPattern(uint length) const { switch (this->style) { // Equivalent to setting Qt::PenStyle::Solid with no dash pattern.