Results 1 to 3 of 3

Thread: Qt QSS help

  1. #1
    Join Date
    Jun 2010
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt QSS help

    Hi,

    I have like a million of questions regarding Qt but I'm trying to figure out most of them by googling however I'm having problem finding a couple of things:

    1) Is it possible to add a vertical alignment to QGridLayout, I'm trying to add a layout like this:
    my_label - input
    ............... - input2

    but the my_label will be vertically aligned to the middle.

    2) I read that you cant apply styles to subclasses but is it possible to add a style name to your widget (like a class in HTML)? How else would you style specific widgets?

    3) I would like to add a settings window to my application with a couple of tabs, should I declare a new QTabWidget and use my_tabs.show() or is there a better to add an external windows.
    Last edited by dennis; 14th June 2010 at 22:40.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Qt QSS help

    Quote Originally Posted by dennis View Post
    1) Is it possible to add a vertical alignment to QGridLayout, I'm trying to add a layout like this:
    my_label - input
    ............... - input2

    but the my_label will be vertically aligned to the middle.
    If you don't want to allign the lable in the midle, you want to use a vertical spacer below the lable.

    2) I read that you cant apply styles to subclasses but is it possible to add a style name to your widget (like a class in HTML)? How else would you style specific widgets?
    Both a QStyle subclass and stylesheets are able to style individual widgets based on their properties. Example, if you have a button with the name "destroy", you can then use the name to set the background to red for example.

    3) I would like to add a settings window to my application with a couple of tabs, should I declare a new QTabWidget and use my_tabs.show() or is there a better to add an external windows.
    You can but you should always try to create a dialog and add the widgets to the dialog because a dialog lets you handle modality.

  3. #3
    Join Date
    Jun 2010
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt QSS help

    1) How do you use the vertical spacer? This is what i got so far, my previous illustration didn't show the problem so good.



    3) What do you mean with handling modality?

    So I would want to use QDialog -> QTabWidget -> and then QWidget for the actual form?
    Last edited by dennis; 15th June 2010 at 22:41.

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.