mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2026-01-12 07:35:55 +01:00
2020-05-21 Fred Gleason <fredg@paravelsystems.com>
* Added image size and type data to the 'View Image' dialog in rdadmin(1). Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -85,15 +85,17 @@ void RDImagePickerModel::update(int row)
|
||||
RDSqlQuery *q=NULL;
|
||||
|
||||
sql=QString("select ")+
|
||||
"DESCRIPTION,"+ // 00
|
||||
"WIDTH,"+ // 01
|
||||
"HEIGHT "+ // 02
|
||||
"DESCRIPTION,"+ // 00
|
||||
"FILE_EXTENSION,"+ // 01
|
||||
"WIDTH,"+ // 02
|
||||
"HEIGHT "+ // 03
|
||||
"from FEED_IMAGES where "+
|
||||
QString().sprintf("ID=%d",c_image_ids.at(row));
|
||||
q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
c_descriptions[row]=q->value(0).toString()+
|
||||
QString().sprintf("\n [%dx%d]",q->value(1).toInt(),q->value(2).toInt());
|
||||
c_descriptions[row]=q->value(0).toString()+"\n"+
|
||||
+"["+q->value(1).toString().toUpper()+", "+
|
||||
QString().sprintf("%dx%d]",q->value(2).toInt(),q->value(3).toInt());
|
||||
emit dataChanged(createIndex(row,0),createIndex(row,0));
|
||||
}
|
||||
delete q;
|
||||
@@ -178,11 +180,12 @@ void RDImagePickerModel::LoadRows(int cat_id,const QSize &img_size)
|
||||
// Load new data
|
||||
//
|
||||
sql=QString("select ")+
|
||||
"ID,"+ // 00
|
||||
"DESCRIPTION,"+ // 01
|
||||
"WIDTH,"+ // 02
|
||||
"HEIGHT,"+ // 03
|
||||
"DATA "+ // 04
|
||||
"ID,"+ // 00
|
||||
"DESCRIPTION,"+ // 01
|
||||
"FILE_EXTENSION,"+ // 02
|
||||
"WIDTH,"+ // 02
|
||||
"HEIGHT,"+ // 03
|
||||
"DATA "+ // 04
|
||||
"from "+c_table_name+" where "+
|
||||
c_category_column+QString().sprintf("=%d ",cat_id)+
|
||||
"order by DESCRIPTION";
|
||||
@@ -192,10 +195,11 @@ void RDImagePickerModel::LoadRows(int cat_id,const QSize &img_size)
|
||||
while(q->next()) {
|
||||
c_image_ids.push_back(q->value(0).toUInt());
|
||||
c_descriptions.
|
||||
push_back(q->value(1).toString()+
|
||||
QString().sprintf("\n [%dx%d]",
|
||||
q->value(2).toInt(),q->value(3).toInt()));
|
||||
img.loadFromData(q->value(4).toByteArray());
|
||||
push_back(q->value(1).toString()+"\n"+
|
||||
"["+q->value(2).toString().toUpper()+", "+
|
||||
QString().sprintf("%dx%d]",
|
||||
q->value(3).toInt(),q->value(4).toInt()));
|
||||
img.loadFromData(q->value(5).toByteArray());
|
||||
c_images.push_back(new QPixmap(QPixmap::fromImage(img.scaled(img_size,
|
||||
Qt::KeepAspectRatio,Qt::SmoothTransformation))));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user