Results 1 to 4 of 4

Thread: add items to QtabWidget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2016
    Location
    Venice, California
    Posts
    87
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default add items to QtabWidget

    ive created a QtabWidget() with 2 tabs.
    i also have a scroll area set inside a gridlayout.

    I'm trying to add the scrollarea to tab1 of the tabWidget.

    i tried using .setlayout, but that doesnt seem to work. My scroll area just sits on top of the tabs. How do I add items to Tab1?

    Qt Code:
    1. self.myTab = QTabWidget()
    2. self.tab1 = QWidget()
    3. self.tab2 = QWidget()
    4.  
    5. self.myTab.addTab(self.tab1, "TAB1")
    6. self.myTab.addTab(self.tab2, "TAB2")
    7.  
    8. self.myScrollArea = QScrollArea()
    9. self.myScrollArea_Container = QWidget()
    10. self.myScrollArea_GridLayout = QGridLayout()
    11.  
    12. self.myScrollArea_Container.setLayout(gridlayout with some stuff)
    13. self.myScrollArea.setWidget(self.myScrollArea_Container)
    14. self.myScrollArea_GridLayout.addWidget(self.myScrollArea)
    15.  
    16. self.myTab.setLayout(self.myScrollArea_GridLayout)
    To copy to clipboard, switch view to plain text mode 

    In the attached pic, you can see the issue where the scrollArea isnt inside, but sitting ontop of the tabs
    Attached Images Attached Images

Similar Threads

  1. Replies: 6
    Last Post: 21st August 2013, 12:53
  2. How to iterate through GraphicsScene items using items()
    By MercyYuen in forum Qt Programming
    Replies: 5
    Last Post: 10th October 2012, 15:51
  3. Replies: 0
    Last Post: 15th April 2011, 19:04
  4. Replies: 2
    Last Post: 20th August 2010, 05:18
  5. Replies: 1
    Last Post: 27th February 2010, 11:39

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.