Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 165 → Rev 166

/trunk/ClassEditor/mymodel.cpp
110,10 → 110,31
 
case Qt::SizeHintRole:
{
// QSize size(200,100);
 
int height = value.toSize().height();
int widht = value.toSize().width();
if(index.column() == 5) {
QVariant currentImage = QSqlTableModel::data(index, 0);
QByteArray bytes = currentImage.toByteArray();
QPixmap pxmp;
 
 
if (currentImage.isValid()) {
pxmp.loadFromData(bytes);
if (height < pxmp.height()) height = pxmp.height() +10;
if (widht < pxmp.width()) widht = pxmp.width() +10;
return QVariant(QSize(widht, height));
 
}
else return value;
 
}
 
 
// QSize size(200,100);
 
return value;
// return QVariant(size);
// return QVariant(size);
}
 
case Qt::DecorationRole: {
/trunk/ClassEditor/classeditor.cpp
529,6 → 529,9
/////ClassEditor::addNewClass();
ClassEditor::addNewClass_new();
mymodel->select();
ui->tableView->resizeColumnsToContents();
ui->tableView->resizeRowsToContents();
 
//ui->tableView->setModel(mymodel);
 
}
623,7 → 626,8
}
mymodel->submitAll();
ClassEditor::modelForDescription->select();
 
ui->tableView->resizeColumnsToContents();
ui->tableView->resizeRowsToContents();
}
 
void ClassEditor::on_pushButton_3_clicked(){ // îáðàáîò÷èê íàæàòèÿ êíîïêè "Íîâîå ïîëå"
801,6 → 805,7
 
ok = mymodel->setData(mymodel->index(currIndexOfClassesTable.row(), 5), QVariant (bytes), Qt::EditRole);
mymodel->submitAll();
 
}
 
 
1137,8 → 1142,8
mymodel->setHeaderData(5, Qt::Horizontal, tr("Èêîíêà"));
ui->tableView->setModel(mymodel);
ui->tableView->setAlternatingRowColors(true);
// ui->tableView->resizeColumnsToContents();
 
ui->tableView->resizeColumnsToContents();
ui->tableView->resizeRowsToContents();
ui->tableView->hideColumn(0);
ui->tableView->hideColumn(3);
ui->tableView->hideColumn(2);