Hi Radek,
I think I have something which is pretty much what I've wanted. Here's how it looks like:
CurrentView.png
So, when I double click on an item from my QListView, the related item will be displayed on my central label. The Up and Down buttons will be deleted from the UI since there is no need of them (you can navigate through the QListWidget using its scroolBar).
Here's my code
"E:\\Personal\\TestImageLoaderQt",
tr("Images (*.jpg"));
//get the pixList
for(int i = 0; i < listaPics.size(); i ++)
{
pixList.append(imgPixmap);
}
for (int i = 0; i < pixList.size(); ++i)
{
listWindgetItemImage->setIcon(*iconImage);
ui.listWidgetImage->addItem(listWindgetItemImage);
ui.
listWidgetImage->setIconSize
(QSize(70,
80));
}
QStringList listaPics = QFileDialog::getOpenFileNames(this, tr("Open File"),
"E:\\Personal\\TestImageLoaderQt",
tr("Images (*.jpg"));
//get the pixList
for(int i = 0; i < listaPics.size(); i ++)
{
QPixmap imgPixmap (listaPics[i]);
pixList.append(imgPixmap);
}
for (int i = 0; i < pixList.size(); ++i)
{
QPixmap pix(pixList[i]);
QIcon *iconImage = new QIcon(pix);
QListWidgetItem *listWindgetItemImage = new QListWidgetItem;
listWindgetItemImage->setIcon(*iconImage);
ui.listWidgetImage->addItem(listWindgetItemImage);
ui.listWidgetImage->setIconSize(QSize(70, 80));
}
To copy to clipboard, switch view to plain text mode
When an item is doubleClicked(), I update my central Qlabel which display the image in a preview mode. Unfortunately, I need somehow to scale my label which holds my image in order to be properly displayed (not the image to be scaled in order to fit in my QLabel. The QLabel needs to be scaled upon the image sizes).
Have any tips about this?
Bookmarks