Using QTableWidgetItem to open an image
Hi I'm new to this but I'm trying to use QTableWidgetItem in relation to opening an image with it I would like it to once clicked on the file in the table you press open and opens the image on a different window.
So far I have to it to open a blank new window when you press open file but how do you get it to read the image file and display it?
http://i175.photobucket.com/albums/w...owde/image.png
This is for displaying the files in the folder its looking in
Code:
{
for (int i = 0; i < files.size(); ++i) {
QFile file(directory.
absoluteFilePath(files
[i
]));
int row = filesTable->rowCount();
filesTable->insertRow(row);
filesTable->setItem(row, 0, fileNameItem);
filesTable->setItem(row, 1, sizeItem);
}
}
This is what I've got for the open button for the monent
Code:
void Window::open()
{
img->show();
}
Any help is appreciated I've been going nuts trying to do this
Thanks in advance
P.S
Also I've been looking at these
QTableWidgetItem::isSelected ()
QTableWidgetItem::write ( QDataStream & out )
QTableWidgetItem::read ( QDataStream & in )