Merge pull request #723 from IBSYSLevi/feature/cabinet-layout

Added width/height/depth properties to elements
This commit is contained in:
ispyisail
2026-09-16 18:51:34 +12:00
committed by GitHub
6 changed files with 109 additions and 12 deletions
@@ -20,7 +20,6 @@
#include "../../qetapp.h"
#include "../../qetinformation.h"
#include "ui_elementpropertieseditorwidget.h"
#include "../../qetinformation.h"
#include <QItemDelegate>
#include <QComboBox>
@@ -45,6 +44,7 @@
#include <QSplitter>
#include <QShortcut>
#include <QMenu>
#include <QRegularExpressionValidator>
/**
@brief The EditorDelegate class
@@ -64,9 +64,20 @@ class EditorDelegate : public QItemDelegate
{
if(index.column() == 1)
{
return QItemDelegate::createEditor(parent,
option,
index);
const QString key = index.sibling(index.row(), 0)
.data(Qt::UserRole).toString();
if (key == QETInformation::ELMT_WIDTH || key == QETInformation::ELMT_HEIGHT || key == QETInformation::ELMT_DEPTH)
{
auto *line_edit = new QLineEdit(parent);
auto *validator = new QETInformation::NumericInfoValidator(line_edit);
line_edit->setValidator(validator);
line_edit->setPlaceholderText(tr("ex. 80.5"));
line_edit->setToolTip(tr("Nombre décimal avec un point comme séparateur (ex. 80.5)"));
return line_edit;
}
return QItemDelegate::createEditor(parent, option, index);
}
return nullptr;
}