mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01:00
Element Autonumbering now has sequential variables and selectautonum widget. Renamed autonumbering variables.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4569 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -30,7 +30,7 @@ ElementAutonumberingW::ElementAutonumberingW(QWidget *parent) :
|
||||
|
||||
{
|
||||
ui->setupUi(this);
|
||||
applyEnable(false);
|
||||
setContext(formula_);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,6 +49,14 @@ void ElementAutonumberingW::setContext(QString formula) {
|
||||
ui->m_formula_le->insert(formula);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementAutonumberingW::clearContext
|
||||
* @param clear formula line edit text
|
||||
*/
|
||||
void ElementAutonumberingW::clearContext() {
|
||||
ui->m_formula_le->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementAutonumberingW::formula
|
||||
* @return formula to be stored into project
|
||||
@@ -61,32 +69,6 @@ QString ElementAutonumberingW::formula() {
|
||||
* @brief ElementAutonumberingW::on_m_formula_le_textChanged
|
||||
* Update Apply Button
|
||||
*/
|
||||
void ElementAutonumberingW::on_m_formula_le_textChanged() {
|
||||
if (!ui->m_formula_le->text().isEmpty())
|
||||
applyEnable(true);
|
||||
else applyEnable(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementAutonumberingW::on_buttonBox_clicked
|
||||
* Action on @buttonBox clicked
|
||||
*/
|
||||
void ElementAutonumberingW::on_buttonBox_clicked(QAbstractButton *button) {
|
||||
//transform button to int
|
||||
int answer = ui -> buttonBox -> buttonRole(button);
|
||||
|
||||
switch (answer) {
|
||||
case QDialogButtonBox::ApplyRole:
|
||||
applyEnable(true);
|
||||
emit applyPressed();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementAutonumberingW::applyEnable
|
||||
* enable/disable the apply button
|
||||
*/
|
||||
void ElementAutonumberingW::applyEnable(bool b) {
|
||||
ui -> buttonBox -> button(QDialogButtonBox::Apply) -> setEnabled(b);
|
||||
void ElementAutonumberingW::on_m_formula_le_textChanged(QString text) {
|
||||
emit (textChanged(text));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user