Thursday, July 22, 2010

GSOC update - buttons

As someone commented on my last post, the buttons needed a bit of a touch up, so thought I'd show you guys the new buttons. :-)

Default buttons

Refresh button while getting updates

I'm using a "Qt Resource Collection" (qrc) file for storing the button images, which is quite handy. This way, the images get stored in the program's executable.

The images can easily be accessed through code after adding them to the resource file. I created a prefix called "desktopwidget" in my resource file, and have a folder called "images", so to access "cross.png", I only need to add ":/desktopwidget/images/cross.png" to wherever I want to use the image, as seen below:

     QPushButton:disabled {
          border-image: url(:/desktopwidget/images/cross.png) -3 -20 -3 -20;

That's it for now, but I'll hopefully be back shortly!


  1. Why don't use the maemo icons ?

    try QIcon::fromTheme("keyboard_move_up");

    Icons List:

  2. Didn't realise they were available! Will have to take a look at that :) Thanks!

  3. Using icons in the way you describe makes it harder (atleast AFAIK) to theme them. Meaning in a theme where those icons wouldn't work well, they couldn't be themed to work better...