This forum has been archived. All content is frozen. Please use KDE Discuss instead.

help with resources

Tags: None
(comma "," separated)
User avatar
scottpetrovic
Registered Member
Posts
520
Karma
4
OS

help with resources

Sat Sep 27, 2014 5:36 pm
I am working on a simple change, but not sure what direction I need to go from a coding standpoint. This is the result I have so far.

http://www.scottpetrovic.com/uploads/kr ... change.jpg

I just swapped out the "x" box appearance with an unlock/lock icon. The code still uses a QCheckbox widget, but I just added a stylesheet in code to change the display like this:

Code: Select all
boolWidth->setStyleSheet("QCheckBox::indicator { width: 16px; height: 16px; }"
                             "QCheckBox::indicator:unchecked { image: url(/home/scott/kde4/src/calligra/krita/pics/unlocked.png);  }"
                             "QCheckBox::indicator:checked   { image: url(/home/scott/kde4/src/calligra/krita/pics/locked.png);}");


Adding that bit is all that is needed. My questions...
1. Is this direction ok for styling checkboxes with different appearances?
2. What is the best way to reference the location of the image resources? Is the location stored somewhere?
User avatar
TheraHedwig
KDE Developer
Posts
1794
Karma
10
OS

Re: help with resources

Thu Oct 09, 2014 1:02 pm
We use KisIcon.h/KoIcon.h for retrieving images, you can find an example in the layers docker.

for example 'koIcon("locked").pixmap(16, 16);' gives the lock icon. These can be found in krita/pics.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Evergrowing, Google [Bot], rblackwell