git-svn-id: svn://db.shs.com.ru/libs@152 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -284,6 +284,7 @@ private:
|
||||
QList<SQLNewEdit * > column_news;
|
||||
QList<SQLFilterEdit * > column_filters;
|
||||
QVector<int> column_indexes;
|
||||
QStringList wait_rels;
|
||||
QMenu popup_menu, popup_col, popup_filter;
|
||||
QTime tm;
|
||||
QActionGroup filters_group;
|
||||
|
||||
Reference in New Issue
Block a user