Results 1 to 3 of 3

Thread: tabSizeHint?

  1. #1
    Join Date
    Aug 2006
    Location
    troy, new york
    Posts
    24
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default tabSizeHint?

    i'm trying to change the size of the tab in a QTabBar, however this does nothing:

    class tbA: public QTabBar
    {
    public:
    tbA(QWidget *p=0) : QTabBar(p)
    {
    for (int i = 0; i < tbA::count(); ++i)
    tbA::tabSizeHint(i).setWidth(15);

    }
    };

    am i missing something? thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: tabSizeHint?

    I guess that count() == 0.

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: tabSizeHint?

    And it doesn't work that way anyway.

    You cannot set the hints like that, you should override QTabBar::tabSizeHint().
    Qt Code:
    1. class tbA: public QTabBar
    2. {
    3. ...
    4. protected:
    5. QSize tabSizeHint(int index) const;
    6. ...
    7. };
    8.  
    9. QSize tbA::tabSizeHint(int index) const
    10. {
    11. return QSize(...);
    12. }
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  4. The following user says thank you to jpn for this useful post:

    nikita (7th September 2006)

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.