View Single Post
Berserk's Avatar
Posts: 199 | Thanked: 156 times | Joined on May 2010 @ Holland
#5
Thanks for that visible-flag tip I will try something with that, not that I know a lot about flags, but I'll figure it out.


This is how it adds new items to the QListWidget:
- Put all .desktop files from /home/user/MyDocs/.images/ in a QStringList
- Open all of them
--- Check if it contains "Type=Background Image", if it does, next step:
--- Take filename, X-File1=, X-File2=, X-File3=, X-File4=, Name= from the file and put it in a second QStringList, [0] to [5]
--- Then add values from that second QStringList (the "clean" one) to the QListWidget, like this:
Code:
itemList.append(new QListWidgetItem(QIcon(imageSetList[i][1]), QFileInfo(imageSetList[i][0]).fileName(), ui->fileList));
That all goes blazingly fast, except for the QIcon, taken from the X-File1= value.
(A previous version didn't have the icons, it was LOTS faster..)







This is the slot that creates/shows the new window:
Code:
void wallPaeper::manBtnClicked() {
    manWin = new wpManager(this);
    manWin->setAttribute(Qt::WA_Maemo5StackedWindow);
    manWin->setAttribute(Qt::WA_DeleteOnClose);
    manWin->show();
}
By the way, it seems to open multiple windows simultaneously. So I can't do an existing-check in between, because every window is building at the same time as it seems
__________________
Wallpaeper - Desktop background manager (in Extras!)
Config Reader - Export all Gconf to an HTML file + compare feature (Extras-testing)
Even though these programs are available for free, I would appreciate any donations

Last edited by Berserk; 2010-09-27 at 16:42.