mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
Wrap code for better readability
This commit is contained in:
@@ -33,11 +33,15 @@ class EditorDelegate : public QItemDelegate
|
|||||||
QItemDelegate(parent)
|
QItemDelegate(parent)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
QWidget* createEditor(QWidget *parent,
|
||||||
|
const QStyleOptionViewItem &option,
|
||||||
|
const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
if(index.column() == 1)
|
if(index.column() == 1)
|
||||||
{
|
{
|
||||||
return QItemDelegate::createEditor(parent, option, index);
|
return QItemDelegate::createEditor(parent,
|
||||||
|
option,
|
||||||
|
index);
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -51,7 +55,11 @@ class EditorDelegate : public QItemDelegate
|
|||||||
@param elmt_info : the information of element (label, manufacturer etc...]
|
@param elmt_info : the information of element (label, manufacturer etc...]
|
||||||
@param parent : parent widget
|
@param parent : parent widget
|
||||||
*/
|
*/
|
||||||
ElementPropertiesEditorWidget::ElementPropertiesEditorWidget(QString &basic_type, DiagramContext &kind_info, DiagramContext &elmt_info, QWidget *parent) :
|
ElementPropertiesEditorWidget::ElementPropertiesEditorWidget(
|
||||||
|
QString &basic_type,
|
||||||
|
DiagramContext &kind_info,
|
||||||
|
DiagramContext &elmt_info,
|
||||||
|
QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::ElementPropertiesEditorWidget),
|
ui(new Ui::ElementPropertiesEditorWidget),
|
||||||
m_basic_type(basic_type),
|
m_basic_type(basic_type),
|
||||||
@@ -78,16 +86,24 @@ ElementPropertiesEditorWidget::~ElementPropertiesEditorWidget()
|
|||||||
*/
|
*/
|
||||||
void ElementPropertiesEditorWidget::upDateInterface()
|
void ElementPropertiesEditorWidget::upDateInterface()
|
||||||
{
|
{
|
||||||
ui->m_base_type_cb->setCurrentIndex(ui->m_base_type_cb->findData(QVariant(m_basic_type)));
|
ui->m_base_type_cb->setCurrentIndex(
|
||||||
|
ui->m_base_type_cb->findData(
|
||||||
|
QVariant(m_basic_type)));
|
||||||
|
|
||||||
if (m_basic_type == "slave")
|
if (m_basic_type == "slave")
|
||||||
{
|
{
|
||||||
ui->m_state_cb->setCurrentIndex(ui->m_state_cb->findData(m_kind_info["state"].toString()));
|
ui->m_state_cb->setCurrentIndex(
|
||||||
ui->m_type_cb->setCurrentIndex (ui->m_type_cb->findData(m_kind_info["type"].toString()));
|
ui->m_state_cb->findData(
|
||||||
|
m_kind_info["state"].toString()));
|
||||||
|
ui->m_type_cb->setCurrentIndex (
|
||||||
|
ui->m_type_cb->findData(
|
||||||
|
m_kind_info["type"].toString()));
|
||||||
ui->m_number_ctc->setValue(m_kind_info["number"].toInt());
|
ui->m_number_ctc->setValue(m_kind_info["number"].toInt());
|
||||||
}
|
}
|
||||||
else if (m_basic_type == "master") {
|
else if (m_basic_type == "master") {
|
||||||
ui->m_master_type_cb->setCurrentIndex(ui->m_master_type_cb->findData (m_kind_info["type"]));
|
ui->m_master_type_cb->setCurrentIndex(
|
||||||
|
ui->m_master_type_cb->findData (
|
||||||
|
m_kind_info["type"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
on_m_base_type_cb_currentIndexChanged(ui->m_base_type_cb->currentIndex());
|
on_m_base_type_cb_currentIndexChanged(ui->m_base_type_cb->currentIndex());
|
||||||
@@ -102,8 +118,10 @@ void ElementPropertiesEditorWidget::setUpInterface()
|
|||||||
ui->m_base_type_cb->addItem (tr("Simple"), QVariant("simple"));
|
ui->m_base_type_cb->addItem (tr("Simple"), QVariant("simple"));
|
||||||
ui->m_base_type_cb->addItem (tr("Maître"), QVariant("master"));
|
ui->m_base_type_cb->addItem (tr("Maître"), QVariant("master"));
|
||||||
ui->m_base_type_cb->addItem (tr("Esclave"), QVariant("slave"));
|
ui->m_base_type_cb->addItem (tr("Esclave"), QVariant("slave"));
|
||||||
ui->m_base_type_cb->addItem (tr("Renvoi de folio suivant"), QVariant("next_report"));
|
ui->m_base_type_cb->addItem (tr("Renvoi de folio suivant"),
|
||||||
ui->m_base_type_cb->addItem (tr("Renvoi de folio précédent"), QVariant("previous_report"));
|
QVariant("next_report"));
|
||||||
|
ui->m_base_type_cb->addItem (tr("Renvoi de folio précédent"),
|
||||||
|
QVariant("previous_report"));
|
||||||
ui->m_base_type_cb->addItem (tr("Bornier"), QVariant("terminal"));
|
ui->m_base_type_cb->addItem (tr("Bornier"), QVariant("terminal"));
|
||||||
|
|
||||||
// Slave option
|
// Slave option
|
||||||
@@ -114,12 +132,15 @@ void ElementPropertiesEditorWidget::setUpInterface()
|
|||||||
ui->m_type_cb->addItem(tr("Puissance"), QVariant("power"));
|
ui->m_type_cb->addItem(tr("Puissance"), QVariant("power"));
|
||||||
ui->m_type_cb->addItem(tr("Temporisé travail"), QVariant("delayOn"));
|
ui->m_type_cb->addItem(tr("Temporisé travail"), QVariant("delayOn"));
|
||||||
ui->m_type_cb->addItem(tr("Temporisé repos"), QVariant("delayOff"));
|
ui->m_type_cb->addItem(tr("Temporisé repos"), QVariant("delayOff"));
|
||||||
ui->m_type_cb->addItem(tr("Temporisé travail & repos"), QVariant("delayOnOff"));
|
ui->m_type_cb->addItem(tr("Temporisé travail & repos"),
|
||||||
|
QVariant("delayOnOff"));
|
||||||
|
|
||||||
//Master option
|
//Master option
|
||||||
ui->m_master_type_cb->addItem(tr("Bobine"), QVariant("coil"));
|
ui->m_master_type_cb->addItem(tr("Bobine"), QVariant("coil"));
|
||||||
ui->m_master_type_cb->addItem(tr("Organe de protection"), QVariant("protection"));
|
ui->m_master_type_cb->addItem(tr("Organe de protection"),
|
||||||
ui->m_master_type_cb->addItem(tr("Commutateur / bouton"), QVariant("commutator"));
|
QVariant("protection"));
|
||||||
|
ui->m_master_type_cb->addItem(tr("Commutateur / bouton"),
|
||||||
|
QVariant("commutator"));
|
||||||
|
|
||||||
//Disable the edition of the first column of the information tree
|
//Disable the edition of the first column of the information tree
|
||||||
//by this little workaround
|
//by this little workaround
|
||||||
@@ -130,7 +151,8 @@ void ElementPropertiesEditorWidget::setUpInterface()
|
|||||||
|
|
||||||
void ElementPropertiesEditorWidget::updateTree()
|
void ElementPropertiesEditorWidget::updateTree()
|
||||||
{
|
{
|
||||||
QString type = ui->m_base_type_cb->itemData(ui->m_base_type_cb->currentIndex()).toString();
|
QString type = ui->m_base_type_cb->itemData(
|
||||||
|
ui->m_base_type_cb->currentIndex()).toString();
|
||||||
|
|
||||||
if (type == "master")
|
if (type == "master")
|
||||||
ui->m_tree->setEnabled(true);
|
ui->m_tree->setEnabled(true);
|
||||||
@@ -152,13 +174,17 @@ void ElementPropertiesEditorWidget::updateTree()
|
|||||||
*/
|
*/
|
||||||
void ElementPropertiesEditorWidget::populateTree()
|
void ElementPropertiesEditorWidget::populateTree()
|
||||||
{
|
{
|
||||||
QStringList keys{"label", "plant", "comment", "description", "designation", "manufacturer", "manufacturer_reference", "supplier", "quantity", "unity", "machine_manufacturer_reference"};
|
QStringList keys{"label", "plant", "comment", "description",
|
||||||
|
"designation", "manufacturer",
|
||||||
|
"manufacturer_reference", "supplier", "quantity",
|
||||||
|
"unity", "machine_manufacturer_reference"};
|
||||||
|
|
||||||
for(const QString& key : keys)
|
for(const QString& key : keys)
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *qtwi = new QTreeWidgetItem(ui->m_tree);
|
QTreeWidgetItem *qtwi = new QTreeWidgetItem(ui->m_tree);
|
||||||
qtwi->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable);
|
qtwi->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable);
|
||||||
qtwi->setData(0, Qt::DisplayRole, QETApp::elementTranslatedInfoKey(key));
|
qtwi->setData(0, Qt::DisplayRole,
|
||||||
|
QETApp::elementTranslatedInfoKey(key));
|
||||||
qtwi->setData(0, Qt::UserRole, key);
|
qtwi->setData(0, Qt::UserRole, key);
|
||||||
qtwi->setText(1, m_elmt_info.value(key).toString());
|
qtwi->setText(1, m_elmt_info.value(key).toString());
|
||||||
}
|
}
|
||||||
@@ -170,14 +196,23 @@ void ElementPropertiesEditorWidget::populateTree()
|
|||||||
*/
|
*/
|
||||||
void ElementPropertiesEditorWidget::on_m_buttonBox_accepted()
|
void ElementPropertiesEditorWidget::on_m_buttonBox_accepted()
|
||||||
{
|
{
|
||||||
m_basic_type = ui -> m_base_type_cb -> itemData(ui -> m_base_type_cb -> currentIndex()).toString();
|
m_basic_type = ui->m_base_type_cb->itemData(
|
||||||
if (m_basic_type == "slave") {
|
ui->m_base_type_cb->currentIndex()).toString();
|
||||||
m_kind_info.addValue("state", ui -> m_state_cb -> itemData(ui -> m_state_cb -> currentIndex()));
|
if (m_basic_type == "slave")
|
||||||
m_kind_info.addValue("type", ui -> m_type_cb -> itemData(ui -> m_type_cb -> currentIndex()));
|
{
|
||||||
m_kind_info.addValue("number", QVariant(ui -> m_number_ctc -> value()));
|
m_kind_info.addValue("state",
|
||||||
|
ui->m_state_cb->itemData(
|
||||||
|
ui->m_state_cb->currentIndex()));
|
||||||
|
m_kind_info.addValue("type",
|
||||||
|
ui->m_type_cb->itemData(
|
||||||
|
ui->m_type_cb->currentIndex()));
|
||||||
|
m_kind_info.addValue("number",
|
||||||
|
QVariant(ui->m_number_ctc->value()));
|
||||||
}
|
}
|
||||||
else if(m_basic_type == "master") {
|
else if(m_basic_type == "master") {
|
||||||
m_kind_info.addValue("type", ui -> m_master_type_cb -> itemData(ui -> m_master_type_cb -> currentIndex()));
|
m_kind_info.addValue("type",
|
||||||
|
ui->m_master_type_cb->itemData(
|
||||||
|
ui->m_master_type_cb->currentIndex()));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (QTreeWidgetItem *qtwi : ui->m_tree->invisibleRootItem()->takeChildren())
|
for (QTreeWidgetItem *qtwi : ui->m_tree->invisibleRootItem()->takeChildren())
|
||||||
@@ -187,7 +222,8 @@ void ElementPropertiesEditorWidget::on_m_buttonBox_accepted()
|
|||||||
txt.remove("\r");
|
txt.remove("\r");
|
||||||
txt.remove("\n");
|
txt.remove("\n");
|
||||||
|
|
||||||
m_elmt_info.addValue(qtwi->data(0, Qt::UserRole).toString(), txt);
|
m_elmt_info.addValue(qtwi->data(0, Qt::UserRole).toString(),
|
||||||
|
txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->close();
|
this->close();
|
||||||
@@ -197,12 +233,15 @@ void ElementPropertiesEditorWidget::on_m_buttonBox_accepted()
|
|||||||
@brief ElementPropertiesEditorWidget::on_m_base_type_cb_currentIndexChanged
|
@brief ElementPropertiesEditorWidget::on_m_base_type_cb_currentIndexChanged
|
||||||
@param index : Action when combo-box base type index change
|
@param index : Action when combo-box base type index change
|
||||||
*/
|
*/
|
||||||
void ElementPropertiesEditorWidget::on_m_base_type_cb_currentIndexChanged(int index)
|
void ElementPropertiesEditorWidget::on_m_base_type_cb_currentIndexChanged(
|
||||||
|
int index)
|
||||||
{
|
{
|
||||||
bool slave = false , master = false;
|
bool slave = false , master = false;
|
||||||
|
|
||||||
if (ui->m_base_type_cb->itemData(index).toString() == "slave") slave = true;
|
if (ui->m_base_type_cb->itemData(index).toString() == "slave")
|
||||||
else if (ui->m_base_type_cb->itemData(index).toString() == "master") master = true;
|
slave = true;
|
||||||
|
else if (ui->m_base_type_cb->itemData(index).toString() == "master")
|
||||||
|
master = true;
|
||||||
|
|
||||||
ui->m_slave_gb->setVisible(slave);
|
ui->m_slave_gb->setVisible(slave);
|
||||||
ui->m_master_gb->setVisible(master);
|
ui->m_master_gb->setVisible(master);
|
||||||
|
|||||||
@@ -172,7 +172,9 @@ void QETProject::init()
|
|||||||
QETProject::ProjectState QETProject::openFile(QFile *file)
|
QETProject::ProjectState QETProject::openFile(QFile *file)
|
||||||
{
|
{
|
||||||
bool opened_here = file->isOpen() ? false : true;
|
bool opened_here = file->isOpen() ? false : true;
|
||||||
if (!file->isOpen() && !file->open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (!file->isOpen()
|
||||||
|
&& !file->open(QIODevice::ReadOnly
|
||||||
|
| QIODevice::Text)) {
|
||||||
return FileOpenFailed;
|
return FileOpenFailed;
|
||||||
}
|
}
|
||||||
QFileInfo fi(*file);
|
QFileInfo fi(*file);
|
||||||
@@ -1234,20 +1236,19 @@ void QETProject::readProjectXml(QDomDocument &xml_project)
|
|||||||
{
|
{
|
||||||
bool conv_ok;
|
bool conv_ok;
|
||||||
m_project_qet_version = root_elmt.attribute("version").toDouble(&conv_ok);
|
m_project_qet_version = root_elmt.attribute("version").toDouble(&conv_ok);
|
||||||
|
#pragma message("@TODO use of version convert")
|
||||||
if (conv_ok && QET::version.toDouble() < m_project_qet_version)
|
if (conv_ok && QET::version.toDouble() < m_project_qet_version)
|
||||||
{
|
{
|
||||||
int ret = QET::QetMessageBox::warning(
|
int ret = QET::QetMessageBox::warning(
|
||||||
nullptr,
|
nullptr,
|
||||||
tr("Avertissement", "message box title"),
|
tr("Avertissement",
|
||||||
tr(
|
"message box title"),
|
||||||
"Ce document semble avoir été enregistré avec "
|
tr("Ce document semble avoir été enregistré avec "
|
||||||
"une version ultérieure de QElectroTech. Il est "
|
"une version ultérieure de QElectroTech. Il est "
|
||||||
"possible que l'ouverture de tout ou partie de ce "
|
"possible que l'ouverture de tout ou partie de ce "
|
||||||
"document échoue.\n"
|
"document échoue.\n"
|
||||||
"Que désirez vous faire ?",
|
"Que désirez vous faire ?",
|
||||||
"message box content"
|
"message box content"),
|
||||||
),
|
|
||||||
QMessageBox::Open | QMessageBox::Cancel
|
QMessageBox::Open | QMessageBox::Cancel
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1290,6 +1291,7 @@ void QETProject::readProjectXml(QDomDocument &xml_project)
|
|||||||
*/
|
*/
|
||||||
void QETProject::readDiagramsXml(QDomDocument &xml_project)
|
void QETProject::readDiagramsXml(QDomDocument &xml_project)
|
||||||
{
|
{
|
||||||
|
#pragma message("@TODO try to solve a weird bug (dialog is black) since port to Qt5 with the DialogWaiting")
|
||||||
//@TODO try to solve a weird bug (dialog is black) since port to Qt5 with the DialogWaiting
|
//@TODO try to solve a weird bug (dialog is black) since port to Qt5 with the DialogWaiting
|
||||||
//show DialogWaiting
|
//show DialogWaiting
|
||||||
DialogWaiting *dlgWaiting = nullptr;
|
DialogWaiting *dlgWaiting = nullptr;
|
||||||
@@ -1317,11 +1319,16 @@ void QETProject::readDiagramsXml(QDomDocument &xml_project)
|
|||||||
|
|
||||||
if (diagram_nodes.at(i).isElement())
|
if (diagram_nodes.at(i).isElement())
|
||||||
{
|
{
|
||||||
QDomElement diagram_xml_element = diagram_nodes.at(i).toElement();
|
QDomElement diagram_xml_element = diagram_nodes
|
||||||
|
.at(i)
|
||||||
|
.toElement();
|
||||||
Diagram *diagram = new Diagram(this);
|
Diagram *diagram = new Diagram(this);
|
||||||
|
|
||||||
int diagram_order = -1;
|
int diagram_order = -1;
|
||||||
if (!QET::attributeIsAnInteger(diagram_xml_element, "order", &diagram_order)) diagram_order = 500000;
|
if (!QET::attributeIsAnInteger(diagram_xml_element,
|
||||||
|
"order",
|
||||||
|
&diagram_order))
|
||||||
|
diagram_order = 500000;
|
||||||
|
|
||||||
addDiagram(diagram, diagram_order-1);
|
addDiagram(diagram, diagram_order-1);
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,9 @@ typedef SearchAndReplaceWorker sarw;
|
|||||||
@param translated_key the string key translated
|
@param translated_key the string key translated
|
||||||
@param parent parent widget
|
@param parent parent widget
|
||||||
*/
|
*/
|
||||||
ElementInfoPartWidget::ElementInfoPartWidget(QString key, const QString& translated_key, QWidget *parent):
|
ElementInfoPartWidget::ElementInfoPartWidget(QString key,
|
||||||
|
const QString& translated_key,
|
||||||
|
QWidget *parent):
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::ElementInfoPartWidget),
|
ui(new Ui::ElementInfoPartWidget),
|
||||||
key_(std::move(key))
|
key_(std::move(key))
|
||||||
@@ -39,8 +41,10 @@ ElementInfoPartWidget::ElementInfoPartWidget(QString key, const QString& transla
|
|||||||
ui->label_->setText(translated_key);
|
ui->label_->setText(translated_key);
|
||||||
ui->m_erase_text->setVisible(false);
|
ui->m_erase_text->setVisible(false);
|
||||||
|
|
||||||
connect(ui->line_edit, &QLineEdit::textEdited, this, &ElementInfoPartWidget::textEdited);
|
connect(ui->line_edit, &QLineEdit::textEdited,
|
||||||
connect(ui->line_edit, &QLineEdit::textChanged, this, &ElementInfoPartWidget::textChanged);
|
this, &ElementInfoPartWidget::textEdited);
|
||||||
|
connect(ui->line_edit, &QLineEdit::textChanged,
|
||||||
|
this, &ElementInfoPartWidget::textChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,6 +56,15 @@ ElementInfoPartWidget::~ElementInfoPartWidget()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief ElementInfoPartWidget::text
|
||||||
|
@return the text in the line edit
|
||||||
|
*/
|
||||||
|
QString ElementInfoPartWidget::text() const
|
||||||
|
{
|
||||||
|
return (ui->line_edit->text());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief ElementInfoPartWidget::setText
|
@brief ElementInfoPartWidget::setText
|
||||||
Set text to line edit
|
Set text to line edit
|
||||||
@@ -66,19 +79,12 @@ void ElementInfoPartWidget::setText(const QString &txt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
@brief ElementInfoPartWidget::text
|
|
||||||
@return the text in the line edit
|
|
||||||
*/
|
|
||||||
QString ElementInfoPartWidget::text() const {
|
|
||||||
return (ui->line_edit->text());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief ElementInfoPartWidget::setPlaceHolderText
|
@brief ElementInfoPartWidget::setPlaceHolderText
|
||||||
@param text
|
@param text
|
||||||
*/
|
*/
|
||||||
void ElementInfoPartWidget::setPlaceHolderText(const QString &text) {
|
void ElementInfoPartWidget::setPlaceHolderText(const QString &text)
|
||||||
|
{
|
||||||
ui->line_edit->setPlaceholderText(text);
|
ui->line_edit->setPlaceholderText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +92,8 @@ void ElementInfoPartWidget::setPlaceHolderText(const QString &text) {
|
|||||||
@brief ElementInfoPartWidget::setFocusTolineEdit
|
@brief ElementInfoPartWidget::setFocusTolineEdit
|
||||||
Set the focus to the line edit
|
Set the focus to the line edit
|
||||||
*/
|
*/
|
||||||
void ElementInfoPartWidget::setFocusTolineEdit() {
|
void ElementInfoPartWidget::setFocusTolineEdit()
|
||||||
|
{
|
||||||
ui->line_edit->setFocus();
|
ui->line_edit->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +102,8 @@ void ElementInfoPartWidget::setFocusTolineEdit() {
|
|||||||
enable the line edit
|
enable the line edit
|
||||||
@param e
|
@param e
|
||||||
*/
|
*/
|
||||||
void ElementInfoPartWidget::setEnabled(bool e) {
|
void ElementInfoPartWidget::setEnabled(bool e)
|
||||||
|
{
|
||||||
ui->line_edit->setEnabled(e);
|
ui->line_edit->setEnabled(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +112,8 @@ void ElementInfoPartWidget::setEnabled(bool e) {
|
|||||||
disable the line edit
|
disable the line edit
|
||||||
@param d
|
@param d
|
||||||
*/
|
*/
|
||||||
void ElementInfoPartWidget::setDisabled(bool d) {
|
void ElementInfoPartWidget::setDisabled(bool d)
|
||||||
|
{
|
||||||
ui->line_edit->setDisabled(d);
|
ui->line_edit->setDisabled(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +121,8 @@ void ElementInfoPartWidget::setDisabled(bool d) {
|
|||||||
@brief ElementInfoPartWidget::setEraseTextVisible
|
@brief ElementInfoPartWidget::setEraseTextVisible
|
||||||
@param visible
|
@param visible
|
||||||
*/
|
*/
|
||||||
void ElementInfoPartWidget::setEraseTextVisible(bool visible) {
|
void ElementInfoPartWidget::setEraseTextVisible(bool visible)
|
||||||
|
{
|
||||||
ui->m_erase_text->setVisible(visible);
|
ui->m_erase_text->setVisible(visible);
|
||||||
m_show_erase = visible;
|
m_show_erase = visible;
|
||||||
}
|
}
|
||||||
@@ -121,7 +131,8 @@ void ElementInfoPartWidget::setEraseTextVisible(bool visible) {
|
|||||||
@brief ElementInfoPartWidget::setEraseTextChecked
|
@brief ElementInfoPartWidget::setEraseTextChecked
|
||||||
@param check
|
@param check
|
||||||
*/
|
*/
|
||||||
void ElementInfoPartWidget::setEraseTextChecked(bool check) {
|
void ElementInfoPartWidget::setEraseTextChecked(bool check)
|
||||||
|
{
|
||||||
ui->m_erase_text->setChecked(check);
|
ui->m_erase_text->setChecked(check);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,7 +140,8 @@ void ElementInfoPartWidget::setEraseTextChecked(bool check) {
|
|||||||
@brief ElementInfoPartWidget::EraseTextCheckState
|
@brief ElementInfoPartWidget::EraseTextCheckState
|
||||||
@return
|
@return
|
||||||
*/
|
*/
|
||||||
Qt::CheckState ElementInfoPartWidget::EraseTextCheckState() const {
|
Qt::CheckState ElementInfoPartWidget::EraseTextCheckState() const
|
||||||
|
{
|
||||||
return ui->m_erase_text->checkState();
|
return ui->m_erase_text->checkState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,18 +24,25 @@ namespace Ui {
|
|||||||
class ElementInfoPartWidget;
|
class ElementInfoPartWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief The ElementInfoPartWidget class
|
||||||
|
gebruikt bij schema editor
|
||||||
|
als men edit dit Element aanklikt
|
||||||
|
*/
|
||||||
class ElementInfoPartWidget : public QWidget
|
class ElementInfoPartWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
//METHODS
|
//METHODS
|
||||||
public:
|
public:
|
||||||
explicit ElementInfoPartWidget(QString key, const QString& translated_key, QWidget *parent = nullptr);
|
explicit ElementInfoPartWidget(QString key,
|
||||||
|
const QString& translated_key,
|
||||||
|
QWidget *parent = nullptr);
|
||||||
~ElementInfoPartWidget() override;
|
~ElementInfoPartWidget() override;
|
||||||
|
|
||||||
QString key () const {return key_;}
|
QString key () const {return key_;}
|
||||||
void setText (const QString &);
|
|
||||||
QString text () const;
|
QString text () const;
|
||||||
|
void setText (const QString &);
|
||||||
void setPlaceHolderText (const QString &text);
|
void setPlaceHolderText (const QString &text);
|
||||||
void setFocusTolineEdit();
|
void setFocusTolineEdit();
|
||||||
void setEnabled(bool e);
|
void setEnabled(bool e);
|
||||||
|
|||||||
Reference in New Issue
Block a user