Results 1 to 2 of 2

Thread: Can I change titlebar height and frame width using stylesheet?

  1. #1
    Join Date
    Jul 2012
    Posts
    23
    Thanks
    3

    Unhappy Can I change titlebar height and frame width using stylesheet?

    I can change titlebar hegiht and frame width using qstyle like this :

    Qt Code:
    1. int MyStyle::pixelMetric(PixelMetric which, const QStyleOption *option, const QWidget *widget) const
    2. {
    3. switch (which)
    4. {
    5. case PM_DefaultFrameWidth:
    6. return 5;
    7. case PM_TitleBarHeight:
    8. return 50;
    9. default:
    10. return QWindowsStyle::pixelMetric(which, option, widget);
    11. }
    12. }
    To copy to clipboard, switch view to plain text mode 

    but I want to change them using style sheet.

    Is it possible?
    I search method to change them using style sheet some hours, but I can't find.

    Can I change titlebar height and frame width only using qstyle??

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Can I change titlebar height and frame width using stylesheet?

    AFAIK you can't style top level window title bars with style sheets.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 1
    Last Post: 20th March 2012, 16:09
  2. Replies: 2
    Last Post: 21st March 2010, 08:20
  3. QPushButton set width and height from StyleSheet
    By AL in forum Qt Programming
    Replies: 3
    Last Post: 19th March 2010, 14:33
  4. Replies: 1
    Last Post: 18th February 2009, 08:34
  5. Increase the height of titlebar, ...
    By vql in forum Qt Programming
    Replies: 2
    Last Post: 23rd March 2008, 11:28

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.