Results 1 to 5 of 5

Thread: problems about QTabBar

  1. #1
    Join Date
    Oct 2006
    Posts
    15
    Qt products

    Default problems about QTabBar

    hi,all

    I have a problem about QTabBar. please help me.

    I want to subclass QTabBar and implement a tabbar like

    _____
    |__/__|

    thanks.

  2. #2
    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: problems about QTabBar

    Could you be more specific? Did you notice QTabBar::setShape(QTabBar::Triangular..)?
    J-P Nurmi

  3. #3
    Join Date
    Oct 2006
    Posts
    15
    Qt products

    Default Re: problems about QTabBar

    thanks for your reply.

    I've noticed the shape provided by QTabBar. and i just want to design the shape of the tab nonrectangle, like the above image.

  4. #4
    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: problems about QTabBar

    I would probably go with implementing a custom style. It's possible to change the appearance by overriding QTabBar::paintEvent(), but if you draw the tabs with different geometries than the normal implementation assumes, most functionality with the tab bar will most probably be broken.
    Last edited by jpn; 10th October 2006 at 09:36. Reason: Disabled smilies
    J-P Nurmi

  5. #5
    Join Date
    Oct 2006
    Posts
    15
    Qt products

    Default Re: problems about QTabBar

    thanks.

    i found it really difficult to set the tabs different geometry. i give it up.

    i have another question.

    sometimes i just want to rearrange the layout the widgets, but QT mostly designs the layout funtion private or uses d-pointer in it. so it is impossible to subclass the widgets to override the layout funtions.


    for example,I tried to modify QSpinBox to place the buttons on the left and right of the text area instead of on the right above one another.
    The layout function is private. so i had to copy the entire class into my project and revise it instead of simply subclassing it.

Similar Threads

  1. QGLWidget Problems
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 2nd October 2006, 22:06
  2. QT4 Plugins - problems, problems
    By NormanDunbar in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 15:39
  3. [Win32/VC++ 8.0] Strange problems with qrc_*.cpp files
    By mloskot in forum Installation and Deployment
    Replies: 6
    Last Post: 6th March 2006, 10:28
  4. QTAbBar not displaying
    By Dune in forum Qt Programming
    Replies: 17
    Last Post: 9th February 2006, 18:25

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.