QT6: QStyleOptionGraphicsItem

This commit is contained in:
Simon De Backer
2020-10-03 15:56:11 +02:00
parent a7920ea5fc
commit 0ab1b322d6

View File

@@ -33,6 +33,7 @@
#include "elementtextitemgroup.h" #include "elementtextitemgroup.h"
#include "elementpicturefactory.h" #include "elementpicturefactory.h"
#include "iostream" #include "iostream"
#include <QDomElement>
class ElementXmlRetroCompatibility class ElementXmlRetroCompatibility
{ {
@@ -210,7 +211,15 @@ void Element::paint(
drawHighlight(painter, options); drawHighlight(painter, options);
} }
if (options && options -> levelOfDetail < 1.0) { #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
if (options && options -> levelOfDetail < 1.0)
#else
#if TODO_LIST
#pragma message("@TODO remove code for QT 6 or later")
#endif
if (options && options->levelOfDetailFromTransform(painter->worldTransform()) < 1.0)
#endif
{
painter->drawPicture(0, 0, m_low_zoom_picture); painter->drawPicture(0, 0, m_low_zoom_picture);
} else { } else {
painter->drawPicture(0, 0, m_picture); painter->drawPicture(0, 0, m_picture);
@@ -762,8 +771,14 @@ bool Element::fromXml(
"links_uuids", "links_uuids",
"link_uuid"); "link_uuid");
foreach (QDomElement qdo, uuid_list) foreach (QDomElement qdo, uuid_list)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
tmp_uuids_link << qdo.attribute("uuid"); tmp_uuids_link << qdo.attribute("uuid");
#else
#if TODO_LIST
#pragma message("@TODO remove code for QT 6 or later")
#endif
qDebug()<<"Help code for QT 6 or later";
#endif
//uuid of this element //uuid of this element
m_uuid= QUuid(e.attribute("uuid", QUuid::createUuid().toString())); m_uuid= QUuid(e.attribute("uuid", QUuid::createUuid().toString()));