Хранилища Subversion OpenInventory

Сравнить редакции

Не учитывать пробелы Редакция 64 → Редакция 65

/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();
}