mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
change to run code with Qt5 & Qt6 as described in forum
This commit is contained in:
@@ -179,7 +179,7 @@ void DeleteQGraphicsItemCommand::setPotentialsOfRemovedElements()
|
||||
//If a conductor was already created between these two terminals
|
||||
//in this undo command, from another removed element, we do nothing
|
||||
bool exist_ = false;
|
||||
for (QPair<Terminal *, Terminal *> pair : m_connected_terminals)
|
||||
for (std::pair<Terminal *, Terminal *> pair : m_connected_terminals)
|
||||
{
|
||||
if (pair.first == hub_terminal && pair.second == t) {
|
||||
exist_ = true;
|
||||
@@ -192,14 +192,8 @@ void DeleteQGraphicsItemCommand::setPotentialsOfRemovedElements()
|
||||
|
||||
if (exist_ == false)
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||
m_connected_terminals.append(qMakePair<Terminal *, Terminal *>(hub_terminal, t));
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 6 or later")
|
||||
#endif
|
||||
qDebug()<<"Help code for QT 6 or later";
|
||||
#endif
|
||||
m_connected_terminals.append(std::make_pair<Terminal *, Terminal *>((Terminal *)hub_terminal, (Terminal *)t));
|
||||
qInfo() << "m_connected_terminals" << m_connected_terminals;
|
||||
Conductor *new_cond = new Conductor(hub_terminal, t);
|
||||
new_cond->setProperties(properties);
|
||||
new AddGraphicsObjectCommand(new_cond, t->diagram(), QPointF(), this);
|
||||
|
||||
@@ -52,7 +52,7 @@ class DeleteQGraphicsItemCommand : public QUndoCommand
|
||||
QHash <Element *, QList<Element *> > m_link_hash; /// keep linked element for each removed element linked to other element.
|
||||
QHash <DynamicElementTextItem *, Element *> m_elmt_text_hash; /// Keep the parent element of each deleted dynamic element text item
|
||||
QHash <DynamicElementTextItem *, ElementTextItemGroup *> m_grp_texts_hash; ///Keep the parent group of each deleted element text item
|
||||
QList <QPair<Terminal *, Terminal *>> m_connected_terminals;
|
||||
QList <std::pair<Terminal *, Terminal *>> m_connected_terminals;
|
||||
QHash <QetGraphicsTableItem *, QPointer<QGraphicsScene>> m_table_scene_hash;
|
||||
bool m_remove_linked_table = false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user