mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
fix "fail to build from source" with Qt < 5.7, and in the same occasion fix a memory leak
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5424 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -92,6 +92,13 @@ DiagramView::DiagramView(Diagram *diagram, QWidget *parent) :
|
||||
MultiPasteDialog d(this->m_diagram, this);
|
||||
d.exec();
|
||||
});
|
||||
|
||||
//setup three separators, to be use in context menu
|
||||
for(int i=0 ; i<3 ; ++i)
|
||||
{
|
||||
m_separators << new QAction(this);
|
||||
m_separators.last()->setSeparator(true);
|
||||
}
|
||||
|
||||
connect(m_diagram, SIGNAL(showDiagram(Diagram*)), this, SIGNAL(showDiagram(Diagram*)));
|
||||
connect(m_diagram, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
|
||||
@@ -1019,8 +1026,7 @@ QList<QAction *> DiagramView::contextMenuActions() const
|
||||
if (m_diagram->selectedItems().isEmpty())
|
||||
{
|
||||
list << m_paste_here;
|
||||
list << new QAction;
|
||||
list.last()->setSeparator(true);
|
||||
list << m_separators.at(0);
|
||||
list << qde->m_edit_diagram_properties;
|
||||
list << qde->m_row_column_actions_group.actions();
|
||||
}
|
||||
@@ -1029,14 +1035,11 @@ QList<QAction *> DiagramView::contextMenuActions() const
|
||||
list << qde->m_cut;
|
||||
list << qde->m_copy;
|
||||
list << m_multi_paste;
|
||||
list << new QAction();
|
||||
list.last()->setSeparator(true);
|
||||
list << m_separators.at(0);
|
||||
list << qde->m_conductor_reset;
|
||||
list << new QAction();
|
||||
list.last()->setSeparator(true);
|
||||
list << m_separators.at(1);
|
||||
list << qde->m_selection_actions_group.actions();
|
||||
list << new QAction();
|
||||
list.last()->setSeparator(true);
|
||||
list << m_separators.at(2);
|
||||
list << qde->m_depth_action_group->actions();
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ class DiagramView : public QGraphicsView
|
||||
QPointF m_rubber_band_origin;
|
||||
bool m_fresh_focus_in,
|
||||
m_first_activation = true;
|
||||
QList<QAction *> m_separators;
|
||||
public:
|
||||
QString title() const;
|
||||
void editDiagramProperties();
|
||||
|
||||
Reference in New Issue
Block a user