/trunk/ClassEditor/classeditor.cpp |
---|
215,6 → 215,7 |
mymodel->setHeaderData(2, Qt::Horizontal, tr("Ïñåâäîíèì êëàññà")); |
mymodel->setHeaderData(4, Qt::Horizontal, tr("Êîìåíòàðèé")); |
//ui->tableView->setModel(model); |
ui->tableView->setModel(mymodel); |
//tableForDescription = new QTableView(); |
226,13 → 227,17 |
ui->tableView->setAlternatingRowColors(true); |
ui->tableView->resizeColumnsToContents(); |
ui->tableView->hideColumn(0); |
ui->tableView->hideColumn(3); |
ui->tableView->hideColumn(2); |
/* |
ui->tableView_2->hideColumn(0); |
ui->tableView_2->hideColumn(5); |
ui->tableView_2->hideColumn(2); |
*/ |
ui->tableView_2->setItemDelegateForColumn(3, &classTableDelegate); |
currIndexOfClassesTable = modelForDescription->index(0, 1); |
QModelIndex index_temp; |
254,7 → 259,10 |
//connect(ui->tableView, SIGNAL(clicked(const QModelIndex)), this, SLOT(on_tableView_clicked(const QModelIndex))); |
connect(mymodel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_myModel_dataChanged(QModelIndex,QModelIndex))); |
connect(modelForDescription, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_modelForDescription_dataChanged(QModelIndex,QModelIndex))); |
connect(ui->newClassAction, SIGNAL(triggered(bool)), this, SLOT(on_pushButton_clicked(bool))); |
connect(ui->action_ID, SIGNAL(triggered(bool)), this, SLOT(on_action_ID_triggered(bool))); |
connect(ui->action_showAlias, SIGNAL(triggered(bool)), this, SLOT(on_action_showAlias_triggered(bool))); |
connect(ui->action_showInstance, SIGNAL(triggered(bool)), this, SLOT(on_action_showInstance_triggered(bool))); |
} |
457,3 → 465,21 |
void ClassEditor::on_modelForDescription_dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ){ |
ui->tableView_2->resizeColumnsToContents(); |
} |
void ClassEditor::on_action_ID_triggered(bool is_checked){ // îáðàáàòûâàåì âûáîð â ìåíþ "Ïîêàçûâàòü ID" |
if (is_checked) ui->tableView->showColumn(0); |
else ui->tableView->hideColumn(0); |
ui->tableView->resizeColumnsToContents(); |
} |
void ClassEditor::on_action_showAlias_triggered(bool is_checked){ // îáðàáàòûâàåì âûáîð â ìåíþ "Ïîêàçûâàòü ïñåâäîíèì" |
if (is_checked) ui->tableView->showColumn(2); |
else ui->tableView->hideColumn(2); |
ui->tableView->resizeColumnsToContents(); |
} |
void ClassEditor::on_action_showInstance_triggered(bool is_checked){ |
if (is_checked) ui->tableView->showColumn(3); |
else ui->tableView->hideColumn(3); |
ui->tableView->resizeColumnsToContents(); |
} |
/trunk/ClassEditor/classeditor.h |
---|
5,6 → 5,7 |
#include "mysql.h" |
#include "mymodel.h" |
#include "modelfordescriptiontable.h" |
#include "delegateforclassestable.h" |
#include <QTreeView> |
38,6 → 39,8 |
QTableView* tableForDescription; |
MyModel* mymodel; |
DelegateForClassesTable classTableDelegate; |
void addNewClass(); // äîáàâèì íîâûé êëàññ |
void addNewClass_new(); |
void addNewField(); // äîáàâëÿåì íîâîå ïîëå ê êëàññó |
49,6 → 52,9 |
void on_pushButton_3_clicked(); // îáðàáîò÷èê íàæàòèÿ êíîïêè "Íîâîå ïîëå" |
void on_pushButton_4_clicked(); // îáðàáîò÷èê íàæàòèÿ êíîïêè "Óäàëèòü ïîëå" |
void on_pushButton_5_clicked(); // îáðàáîò÷èê íàæàòèÿ êíîïêè "Óäàëèòü âñå ïîëÿ" |
void on_action_ID_triggered(bool is_checked); // îáðàáàòûâàåì âûáîð â ìåíþ "Ïîêàçûâàòü ID" |
void on_action_showAlias_triggered(bool is_checked); // îáðàáàòûâàåì âûáîð â ìåíþ "Ïîêàçûâàòü ïñåâäîíèì" |
void on_action_showInstance_triggered(bool is_checked); // ... ïîêàçûâàòü õðàíèëèùà îáúåêòîâ |
void on_tableView_clicked(const QModelIndex & index ); |
void on_myModel_dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ); |
void on_modelForDescription_dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ); |
/trunk/ClassEditor/ClassEditor.pro |
---|
20,7 → 20,9 |
tablefield.cpp \ |
sqltable.cpp \ |
mymodel.cpp \ |
modelfordescriptiontable.cpp |
delegate.cpp \ |
modelfordescriptiontable.cpp \ |
delegateforclassestable.cpp |
HEADERS += classeditor.h \ |
mysql.h \ |
settingsdialog.h \ |
27,6 → 29,8 |
tablefield.h \ |
sqltable.h \ |
mymodel.h \ |
modelfordescriptiontable.h |
delegate.h \ |
modelfordescriptiontable.h \ |
delegateforclassestable.h |
FORMS += classeditor.ui \ |
settingsdialog.ui |
/trunk/ClassEditor/classeditor.ui |
---|
152,9 → 152,47 |
<x>0</x> |
<y>0</y> |
<width>983</width> |
<height>27</height> |
<height>25</height> |
</rect> |
</property> |
<widget class="QMenu" name="menu"> |
<property name="title"> |
<string>Класс</string> |
</property> |
<widget class="QMenu" name="menu_3"> |
<property name="title"> |
<string>Удалить классы</string> |
</property> |
<addaction name="action_3"/> |
<addaction name="separator"/> |
<addaction name="action_4"/> |
</widget> |
<addaction name="newClassAction"/> |
<addaction name="separator"/> |
<addaction name="menu_3"/> |
<addaction name="separator"/> |
<addaction name="action_ID"/> |
<addaction name="action_showAlias"/> |
<addaction name="action_showInstance"/> |
</widget> |
<widget class="QMenu" name="menu_2"> |
<property name="title"> |
<string>Поле</string> |
</property> |
<widget class="QMenu" name="menu_4"> |
<property name="title"> |
<string>Удалить поля</string> |
</property> |
<addaction name="action_11"/> |
<addaction name="separator"/> |
<addaction name="action_13"/> |
</widget> |
<addaction name="action_8"/> |
<addaction name="separator"/> |
<addaction name="menu_4"/> |
</widget> |
<addaction name="menu"/> |
<addaction name="menu_2"/> |
</widget> |
<widget class="QToolBar" name="mainToolBar"> |
<attribute name="toolBarArea"> |
165,6 → 203,60 |
</attribute> |
</widget> |
<widget class="QStatusBar" name="statusBar"/> |
<action name="newClassAction"> |
<property name="text"> |
<string>Новый класс</string> |
</property> |
</action> |
<action name="action_3"> |
<property name="text"> |
<string>Удалить все классы</string> |
</property> |
</action> |
<action name="action_4"> |
<property name="text"> |
<string>Удалить выбранные классы</string> |
</property> |
</action> |
<action name="action_8"> |
<property name="text"> |
<string>Новое поле</string> |
</property> |
</action> |
<action name="action_11"> |
<property name="text"> |
<string>Удалить все поля</string> |
</property> |
</action> |
<action name="action_13"> |
<property name="text"> |
<string>Удалить выделенные поля</string> |
</property> |
</action> |
<action name="action_ID"> |
<property name="checkable"> |
<bool>true</bool> |
</property> |
<property name="text"> |
<string>Показывать ID</string> |
</property> |
</action> |
<action name="action_showAlias"> |
<property name="checkable"> |
<bool>true</bool> |
</property> |
<property name="text"> |
<string>Показывать псевдоним</string> |
</property> |
</action> |
<action name="action_showInstance"> |
<property name="checkable"> |
<bool>true</bool> |
</property> |
<property name="text"> |
<string>Показывать хранилища объектов</string> |
</property> |
</action> |
</widget> |
<layoutdefault spacing="6" margin="11"/> |
<resources/> |