Results 1 to 4 of 4

Thread: QSS problem

  1. #1
    Join Date
    Jul 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Exclamation QSS problem

    Hey guys,

    I've been trying around all afternoon but I can't seem to solve this issue.
    I am creating an application and I want to give the users the possibility to modify the design to their heart's content.

    But I can't seem to be able to change the position/size of an object.

    For example we have this QPushButton named cmdStart.

    I could do "#cmdStart { color : blue; }" but trying to set size or position has failed miserably.
    I've browsed the web for hours and found examples where it set the position to absolute, then set top and left, but even that didn't work. I'm totally exhausted now and really need some help, I can't find the solution on my own. Thanks in advance.


    Regards,
    Sir Rogers

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSS problem

    I guess you need to mention the object type too..(not sure though)
    something like -
    "QPushButton#cmdStart { color : blue; }"

  3. #3
    Join Date
    Jul 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QSS problem

    Quote Originally Posted by aamer4yu View Post
    I guess you need to mention the object type too..(not sure though)
    something like -
    "QPushButton#cmdStart { color : blue; }"
    It doesn't matter, and yes I tried with and without. I can't get the right attribute to set size or position.

    I tried so many things from qproperty all the way down to the normal css attributes, none worked. Could someone please tell me the right attributes to use?

    The problem's driving me crazy.


    Regards,
    Sir Rogers

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QSS problem

    there is note in height/width properties in spec
    height:
    Warning: Unless otherwise specified, this property has no effect when set on widgets. If you want a widget with a fixed height, set the min-height and max-height to the same value.

    width:
    Unless otherwise specified, this property has no effect when set on widgets. If you want a widget with a fixed width, set the min-width and max-width to the same value.
    changing positions can be applied only for sub-controls.
    Last edited by spirit; 17th November 2009 at 07:12.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. The following user says thank you to spirit for this useful post:

    Sir Rogers (18th November 2009)

Similar Threads

  1. Problem with QAbstractListModel
    By eekhoorn12 in forum Qt Programming
    Replies: 3
    Last Post: 26th August 2009, 14:26
  2. Replies: 1
    Last Post: 23rd April 2009, 09:05
  3. Replies: 19
    Last Post: 3rd April 2009, 23:17
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.