Results 1 to 7 of 7

Thread: QTabWidget align

  1. #1
    Join Date
    Jan 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTabWidget align

    Hi
    How to align the title in qtabwidget to the left.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTabWidget align

    Would you care to explain what you mean? The exact looks of the tab bar depend on the widget style you are using. The tab size tends to adjust to the contents so the title is always "left aligned" and "right aligned" and also "centered". Unless of course the style author decided otherwise.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTabWidget align

    Use setStyleSheet
    Qt Code:
    1. QString style = QString( "QTabBar::tab { height: 30px; width: 180 px;}" );
    2. setStyleSheet( style );
    To copy to clipboard, switch view to plain text mode 
    Now it looks like:

    be so

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTabWidget align

    Use a different widget style.
    Attached Images Attached Images
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTabWidget align

    Can control not regardless of widget styles?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTabWidget align

    Seems not.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Jul 2012
    Posts
    123
    Thanks
    4
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTabWidget align

    I have this problem too isn't other way how do it ??? for example StyleSheet???

Similar Threads

  1. QTextEdit align right.
    By bunjee in forum Qt Programming
    Replies: 6
    Last Post: 7th November 2009, 20:43
  2. QItemDelegate Align
    By aekilic in forum Qt Programming
    Replies: 43
    Last Post: 1st April 2009, 07:52
  3. how to align Qlabel with CHIbutton
    By kisha18d in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2008, 06:21
  4. QTableView and problems with align
    By mamyte03@gmail.com in forum Qt Programming
    Replies: 3
    Last Post: 12th November 2007, 07:10
  5. QTextTableCell vertical align
    By xgoan in forum Qt Programming
    Replies: 3
    Last Post: 10th July 2007, 09:50

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.