git-svn-id: svn://db.shs.com.ru/libs@152 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2017-01-10 14:00:36 +00:00
parent 869862e96f
commit f7ad7696ef
5 changed files with 23 additions and 15 deletions

View File

@@ -456,6 +456,10 @@ void SQLTableWidget::setTableName(const QString & t) {
//((QSqlQueryModel * )model)->setQuery(QSqlQuery("SELECT id FROM " + table_ + ";"));
setTableVisible(checkTable());
updateTable();
foreach (const QString & wr, wait_rels) {
QStringList wrl = wr.split(";");
addRelation(wrl[0], wrl[1], wrl[2], wrl[3]);
}
}
@@ -819,6 +823,8 @@ void SQLTableWidget::setColumnVisible(int ind, bool visible) {
bool SQLTableWidget::addRelation(const QString & this_column, const QString & other_table, const QString & other_key, const QString & other_column) {
QString wr = this_column + ";" + other_table + ";" + other_key + ";" + other_column;
if (!wait_rels.contains(wr)) wait_rels << wr;
ColumnProperties * cp = const_cast<ColumnProperties * >(columnProperty(this_column));
if (cp == 0) return false;
cp->relation_table = other_table;