From 51f830068cb6b4847468aced1aa654932c39bf80 Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 27 Dec 2010 15:52:30 +0100 Subject: Made all icons in qresource available for UI Every registered icon can be chosen as Qt::DecorationRole for all models at once. Suitable icons must be added to SmGlobals::mIcons. Key is a descriptive text, value is the icon path. To make things easier SmTreeModel got two new member functions: -QIcon decorationIcon() returning the current Icon -void setDecorationIcon() to set the current Icon The current Icon is initialized in the constructor from QSettings - ui/iconfolder To update the TreeViews connected to the FileSystemModel a little hack is needed: Just set the QFileIconProvider again. This causes the Model to update connected views. --- smglobals.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'smglobals.cpp') diff --git a/smglobals.cpp b/smglobals.cpp index f163ac1..f0906f1 100644 --- a/smglobals.cpp +++ b/smglobals.cpp @@ -107,7 +107,21 @@ QSize SmGlobals::cursorSize() { return mCursorSize; } -SmGlobals::SmGlobals() : mPictureViewer(0), mFrameCache(0) {} +SmGlobals::SmGlobals() : mPictureViewer(0), mFrameCache(0){ + mIcons.insert("Dildo", ":/dildo.png"); + mIcons.insert("Dick to left", ":/back_dick.png"); + mIcons.insert("Dick pointing up", ":/up_dick.png"); + mIcons.insert("Chastity belt", ":/chastity_belt.png"); + mIcons.insert("Clitoris", ":/clitoris.png"); + mIcons.insert("Gaping ass", ":/gaping_ass.png"); + mIcons.insert("Nipple pointing up", ":/nipple_up.png"); + mIcons.insert("Bald pussy", ":/bald_pussy.png"); + mIcons.insert("Prince Albert", ":/prince_albert.png"); + mIcons.insert("Diaper", ":/diaper.png"); + mIcons.insert("High heels", ":/higheels.png"); + mIcons.insert("Ball gag", ":/ball_gag.png"); + mIcons.insert("French Maid Dress", ":/french_maid_dress.png"); +} //FrameCache SmGlobals::FrameCache::FrameCache(QObject *parent) : QObject(parent), mMagic(0xDEADBEEF), mCacheSubDir(".frameCache"), mCacheFileName("cache") { -- cgit v1.2.3-70-g09d2