Working with file previews
Posted on May 2, 2008, under Tetzle
After a busy month, I have finally had some time to focus on Tetzle again. The first issue I decided to tackle was the “Add Image” dialog. There were a couple of things about it that bothered me, the biggest being that I could only preview one image at a time. Here is what the dialog looks like in the currently released version:
The hardest thing about solving the file preview issue was that I couldn’t figure out how to get a QDirModel to allow me to set the icon for each file after it was shown. I tried creating a QFileIconProvider that created previews from the files, but that blocks the interface while the previews are loading. Not good. After several unfruitful hours of searching for other solutions, I switched the file list to a QListWidget. It was so much easier to work with! I don’t understand how anyone can like the new Model-View classes, I find them incredibly annoying.
The other issues were a lot simpler to solve (as I was expecting), and I finished up the new dialog yesterday. Here is what it will look like in the next release: