Results 1 to 3 of 3

Thread: Using Custom QTabBar with QTabWidget.

  1. #1
    Join Date
    Dec 2016
    Posts
    37
    Qt products
    Qt5
    Platforms
    Windows

    Default Using Custom QTabBar with QTabWidget.

    I have got an app with a QTabWidget. It has a few tabs across the top.
    I would like to change the mouse pointer to a different type for each tab.
    I've subclassed QTabBar and reimplemented mouseMoveEvent.
    I need to set this custom tab bar to QTabWidget using setTabBar.
    But this method takes a QTabBar as its argument, and the setTabBar method
    is protected.

    How do I get around this?

    Thanks.

    t

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Using Custom QTabBar with QTabWidget.

    Quote Originally Posted by tvj4218 View Post
    I've subclassed QTabBar and reimplemented mouseMoveEvent.
    ..... setTabBar method
    is protected.

    How do I get around this?...
    Subclass QTabWidget too
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3
    Join Date
    Jun 2008
    Location
    Boulder, Colorado, USA
    Posts
    70
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Using Custom QTabBar with QTabWidget.

    Quote Originally Posted by Santosh Reddy View Post
    Subclass QTabWidget too
    ... the point being, that gives you access to the QTabWidget::setTabBar (QTabBar*) protected method. Your QTabWidget subclass doesn't have to have much.

Similar Threads

  1. Replies: 7
    Last Post: 5th June 2011, 21:12
  2. QTabBar & QTabWidget
    By salmanmanekia in forum Newbie
    Replies: 1
    Last Post: 3rd June 2010, 12:24
  3. QTabBar and connect..also QTabWidget
    By salmanmanekia in forum Newbie
    Replies: 5
    Last Post: 2nd June 2010, 14:53
  4. QTabBar/QTabWidget problems on S60
    By ojai0217 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 25th October 2009, 02:30
  5. QTabBar and a QTabWidget-like frame
    By eelik in forum Newbie
    Replies: 2
    Last Post: 16th January 2008, 19:17

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.