mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 10:30:53 +01:00
Merge branch 'terminal_strip'
* terminal_strip: Terminal strip item can saved / loaded to .qet file See previous commit... Move terminal strip drawer class in is own file Fix wrong use of QStringLiteral and QLatin1String Double click a TerminalStripItem open the editor Minor change about checkable QAction of QetDiagramEditor Minor : corrects a minor aesthetic defect when unbridge terminals Revamp code Add and move terminal strip item are now managed by undo command TerminalStripItem : Draw terminal bridge Terminal strip item can be added to diagram Minor : add QGIUtility namespace
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
|
||||
#include "../UndoCommand/addterminalstripcommand.h"
|
||||
#include "freeterminaleditor.h"
|
||||
#include "../../qetapp.h"
|
||||
#include "../../qetdiagrameditor.h"
|
||||
#include "../../qetproject.h"
|
||||
#include "../realterminal.h"
|
||||
#include "../terminalstrip.h"
|
||||
@@ -27,6 +29,8 @@
|
||||
#include "terminalstripeditorwindow.h"
|
||||
#include "terminalstriptreedockwidget.h"
|
||||
|
||||
QPointer<TerminalStripEditorWindow> TerminalStripEditorWindow::window_;
|
||||
|
||||
static const int EMPTY_PAGE = 0;
|
||||
static const int FREE_TERMINAL_PAGE = 1;
|
||||
static const int TERMINAL_STRIP_PAGE = 2;
|
||||
@@ -35,6 +39,16 @@ static const int TERMINAL_STRIP_PAGE = 2;
|
||||
* @param project
|
||||
* @param parent
|
||||
*/
|
||||
void TerminalStripEditorWindow::edit(TerminalStrip *strip)
|
||||
{
|
||||
if (const auto project_ = strip->project())
|
||||
{
|
||||
auto editor_ = TerminalStripEditorWindow::instance(project_, QETApp::diagramEditor(project_));
|
||||
editor_->setCurrentStrip(strip);
|
||||
editor_->show();
|
||||
}
|
||||
}
|
||||
|
||||
TerminalStripEditorWindow::TerminalStripEditorWindow(QETProject *project, QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::TerminalStripEditorWindow),
|
||||
@@ -59,7 +73,11 @@ TerminalStripEditorWindow::TerminalStripEditorWindow(QETProject *project, QWidge
|
||||
*/
|
||||
TerminalStripEditorWindow::~TerminalStripEditorWindow()
|
||||
{
|
||||
delete ui;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TerminalStripEditorWindow::setCurrentStrip(TerminalStrip *strip) {
|
||||
m_tree_dock->setSelectedStrip(strip);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user