Results 1 to 2 of 2

Thread: How to get the size of a QWidget in QTabWidget

  1. #1
    Join Date
    Dec 2010
    Posts
    12
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Question How to get the size of a QWidget in QTabWidget

    Hi,I have a QTableView in a QTableWidget
    Qt Code:
    1. addTab(new MyTableView,tr("what"));
    To copy to clipboard, switch view to plain text mode 
    How can I get the viewport of the QTableWidget.
    Who is the parent of the QTableView.
    Thanks

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

    Default Re: How to get the size of a QWidget in QTabWidget

    Quote Originally Posted by xiangxw View Post
    Hi,I have a QTableView in a QTableWidget
    Qt Code:
    1. addTab(new MyTableView,tr("what"));
    To copy to clipboard, switch view to plain text mode 
    You mean a table view inside a tab widget?

    How can I get the viewport of the QTableWidget.
    If you ask about QTableWidget then use its viewport() method. If you ask about the tab widget then it doesn't have a viewport.

    Who is the parent of the QTableView.
    If you mean your code snippet then the direct parent will be the stacked widget inside QTabWidget.
    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. The following user says thank you to wysota for this useful post:

    xiangxw (4th May 2011)

Similar Threads

  1. Qmainwindow QWidget size
    By seltra in forum Newbie
    Replies: 1
    Last Post: 3rd October 2010, 19:46
  2. Set size when insert a QWidget into a QGridLayout
    By Tondog in forum Qt Programming
    Replies: 3
    Last Post: 4th June 2010, 07:35
  3. Replies: 0
    Last Post: 30th March 2010, 15:49
  4. QTabWidget adjust internal Widget to fit full size
    By ^NyAw^ in forum Qt Programming
    Replies: 4
    Last Post: 25th December 2009, 02:20
  5. changing the size of the tab width: QTabWidget
    By nikita in forum Qt Programming
    Replies: 2
    Last Post: 29th August 2006, 09:31

Tags for this Thread

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.