/trunk/ClassEditor/mymodel.cpp |
---|
40,11 → 40,18 |
} |
*/ |
lResult = QSqlTableModel::setData(index, value, role); |
// if (index.column() == 5) return lResult; |
if (lResult) { |
QModelIndex newindex; |
QSqlRecord rec = record(index.row()); |
rec.setValue(index.column(), value); |
if (value.isNull()) { |
rec.setNull(index.column()); |
} |
else rec.setValue(index.column(), value); |
rec.setGenerated(index.column(), true); |
/* |
67,9 → 74,11 |
lResult = updateRowInTable(index.row(), rec); |
/// QSqlTableModel::setData(newindex, QVariant(str_tmp), Qt::EditRole); |
// submitAll(); |
// this->select(); |
} |
emit dataChanged(index, index);; |
return lResult; |
} |
/trunk/ClassEditor/qrc_pic.cpp |
---|
1,7 → 1,7 |
/**************************************************************************** |
** Resource object code |
** |
** Created: Mon Dec 27 09:10:57 2010 |
** Created: Tue Dec 28 16:23:18 2010 |
** by: The Resource Compiler for Qt version 4.6.2 |
** |
** WARNING! All changes made in this file will be lost! |
/trunk/ClassEditor/iconform.h |
---|
26,8 → 26,8 |
private slots: |
void on_pushButton_clicked(); // îáðàáîò÷èê íàæàòèÿ êíîïêè "Ïîìåíÿòü èêîíêó" |
void on_pushButton_2_clicked(); // îáðàáîò÷èê íàæàòèÿ êíîïêè "Ïîìåíÿòü èêîíêó" |
}; |
#endif // ICONFORM_H |
/trunk/ClassEditor/delegate.cpp |
---|
325,6 → 325,7 |
IconForm *icnFrm = static_cast<IconForm*>(editor); |
if (!(icnFrm->dataIsChanged())) return; |
if (!(icnFrm->pixmap().isNull())){ // åñëè íå óäàëèëè èêîíêó |
m_pxPicture = icnFrm->pixmap(); |
QImage currentImage = m_pxPicture.toImage(); |
QByteArray bytes; |
341,10 → 342,13 |
// int heigh = m_pxPicture.height(); |
// tblView->setRowHeight(index.row(), heigh + 10); |
// model->submitAll(); |
} |
else { // èêîíêó óäàëèëè |
QVariant val_null; |
model->setData(index, val_null, Qt::EditRole); |
} |
// model->setData(index, value); |
} |
376,7 → 380,6 |
QVariant currentImage = model->data(index,0); |
QByteArray bytes = currentImage.toByteArray(); |
// QImage image; |
// image.loadFromData(bytes); |
387,6 → 390,8 |
} |
else { |
int i; |
i++; |
//QItemDelegate::paint(painter, option, index); |
return; |
} |
/trunk/ClassEditor/iconform.cpp |
---|
43,7 → 43,18 |
// IconForm::close(); |
} |
void IconForm::on_pushButton_2_clicked(){ // îáðàáîò÷èê íàæàòèÿ êíîïêè "Óäàëèòü èêîíêó" |
QPixmap pix_tmp; |
Pixmap = pix_tmp; |
ui->label->setPixmap(Pixmap); |
IconForm::fdataIsChanged = true; |
} |
void IconForm::setPixmap (QPixmap newPixmap){ |
Pixmap = newPixmap; |
ui->label->setPixmap(Pixmap); |