Delete button is disable if no record selected.
This commit is contained in:
@@ -48,6 +48,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="btnEdit">
|
<widget class="QToolButton" name="btnEdit">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Edit record</string>
|
<string>Edit record</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -71,6 +74,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="btnDelete">
|
<widget class="QToolButton" name="btnDelete">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Delete record</string>
|
<string>Delete record</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -131,3 +131,12 @@ void IGridForm::on_btnFilter_toggled(bool checked)
|
|||||||
ui->filterWidget->setVisible(false);
|
ui->filterWidget->setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IGridForm::on_tableView_clicked(const QModelIndex &index)
|
||||||
|
{
|
||||||
|
if (ui->tableView->currentIndex().isValid())
|
||||||
|
{
|
||||||
|
ui->btnEdit->setEnabled(true);
|
||||||
|
ui->btnDelete->setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ private slots:
|
|||||||
|
|
||||||
void on_btnFilter_toggled(bool checked);
|
void on_btnFilter_toggled(bool checked);
|
||||||
|
|
||||||
|
void on_tableView_clicked(const QModelIndex &index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_pluginId;
|
QString m_pluginId;
|
||||||
IFormHandler *m_formHandler;
|
IFormHandler *m_formHandler;
|
||||||
|
|||||||
Reference in New Issue
Block a user