I have a set of five buttons that I am trying to position in a qss file. The default position that I have set up in the ui file works for one of the layouts I need. However, I want to group the buttons differently in the other theme. I am new to qss files and have been experimenting, but cannot figure out if some things are possible. The "left" property is defined here: http://doc.qt.nokia.com/4.2/stylesheet.html#left-attr but nothing happens when I try to use it. margin-left actually moves the button, but only relationally. So, if the buttons are positioned in the ui file with a gap of 100 between them, a margin-left for the second button in the list is offset by 100.

I've figured out that I can change the position of the button by deriving a class from QPushButton and making a "GeomX" qproperty. This seems to work, but I am running into an odd issue now. When I first load my app, it draws the buttons as they are positioned on the ui file, seemingly ignoring the GeomX property. When I use the "change theme" option that I've coded, and select the currently loaded theme, it moves the buttons as I'd expect. However, resizing the app dumps them back to the ui positions and restarting also places them back in their ui positions. Is there a setting in the ui file that I could alter to get it to stop moving them? Is there a load-order issue that I need to address? Is it possible to even address this? What is going on?

Here is a sample of my qss file.

Qt Code:
  1. QPushButton#Button_1
  2. {
  3. min-width: 50;
  4. max-width: 50;
  5. min-height: 50;
  6. max-height: 50;
  7. qproperty-geomX:200;
  8. }
To copy to clipboard, switch view to plain text mode