Results 1 to 2 of 2

Thread: [QTabWidget] Adding additional button

  1. #1
    Join Date
    Dec 2010
    Location
    Poland
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default [QTabWidget] Adding additional button

    Hello
    I wrote a subclass QTabWidget and create additional QPushButton in the constructor, but I do not know how to properly adjust its position. Currently it looks like this:



    I need to change the position of QPushButton when user create or delete a bookmark, but I do not know how to get the size and position of the last tab?

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

    Default Re: [QTabWidget] Adding additional button

    From a quick look at the docs, you might be able to use pTabWidget->tabBar()->tabRect(iIndex).x().
    ==========================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. Qt Designer Solved: Adding widgets to QTabWidget layout
    By koan in forum Qt Tools
    Replies: 1
    Last Post: 13th February 2011, 23:35
  2. QTabWidget + tab button color( how to set ? )
    By medved6 in forum Qt Programming
    Replies: 1
    Last Post: 10th September 2010, 09:53
  3. Qtabwidget - how to add a button to all tabs?
    By creep33 in forum Qt Programming
    Replies: 2
    Last Post: 22nd July 2010, 19:05
  4. Button on QTabWidget
    By winston2020 in forum Qt Programming
    Replies: 3
    Last Post: 24th October 2008, 07:45
  5. Adding QGroupBox to QTabWidget
    By mclark in forum Newbie
    Replies: 2
    Last Post: 17th January 2007, 16:27

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.