mirror of
https://github.com/andre-wojtowicz/qt-sql-example.git
synced 2024-11-29 16:00:27 +01:00
Fixed table view Tab switch;
Fixed removing unused data model
This commit is contained in:
parent
7f285add6d
commit
810a6a5aa7
@ -166,6 +166,8 @@ void MainWindow::disconnectFromServerRequested()
|
||||
{
|
||||
ui->button_connect->setEnabled(false);
|
||||
|
||||
delete ui->tableView_database_table->model();
|
||||
|
||||
emit disconnectFromServer();
|
||||
}
|
||||
|
||||
@ -197,6 +199,8 @@ void MainWindow::showTableRequested()
|
||||
{
|
||||
ui->button_show_table->setEnabled(false);
|
||||
|
||||
delete ui->tableView_database_table->model(); // remove old model
|
||||
|
||||
QString table_name = ui->comboBox_table_name->currentText();
|
||||
|
||||
emit selectTable(table_name);
|
||||
|
@ -522,7 +522,29 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="4">
|
||||
<widget class="QTableView" name="tableView_database_table"/>
|
||||
<widget class="QTableView" name="tableView_database_table">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="tabKeyNavigation">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragDropOverwriteMode">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
Loading…
Reference in New Issue
Block a user