mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-07-30 07:44:13 +02:00
terminalstripdrawer.cpp: fix two Qt6 compile errors
- Add missing <QHash> include: QHash<QUuid, QVector<QPointF>> was
only forward-declared transitively under Qt5's heavier headers;
Qt6's leaner <QPainter> etc. no longer pull it in.
- Replace QPolygonF{points_} with QPolygonF(points_): under Qt6,
QPolygonF inherits QList<QPointF>'s constructors via 'using
QList<QPointF>::QList;', including the std::initializer_list<T>
one. Brace-init-list construction with a single argument first
considers only initializer-list constructors before falling
back to regular ones, which trips up overload resolution here
even though points_ is exactly a QList<QPointF> (QVector is a
plain alias for QList under Qt6). Plain parenthesised
construction sidesteps that resolution phase entirely and binds
directly to QPolygonF(const QList<QPointF>&).
This commit is contained in:
committed by
Laurent Trinques
parent
33013477ad
commit
ed1b6e9ba0
@@ -18,6 +18,7 @@
|
||||
#include "terminalstripdrawer.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QHash>
|
||||
|
||||
namespace TerminalStripDrawer {
|
||||
|
||||
@@ -271,7 +272,7 @@ void TerminalStripDrawer::paint(QPainter *painter)
|
||||
auto pen_{painter->pen()};
|
||||
pen_.setWidth(2);
|
||||
painter->setPen(pen_);
|
||||
painter->drawPolyline(QPolygonF{points_});
|
||||
painter->drawPolyline(QPolygonF(points_));
|
||||
painter->restore();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user