Results 1 to 6 of 6

Thread: add Widgets in widgets

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default add Widgets in widgets

    Hi,
    my problem is to insert some widgets in one "main" widget (not MainWindow!).
    I built a widget by using Qt designer (e.g. widget1) and created a class (widget2) to implement some functions for widget1.
    In the next step I created a new widget (widget3) which has only a tableWidget inside.

    My Problem is, if I create another widget (widget4) in which I want to place those two widgets (wiget2, widget3) there is nothing to see in widget4.

    Here is my code of widget4:
    Qt Code:
    1. require 'Qt4'
    2. require 'Widget2'
    3. require 'Widget3'
    4.  
    5. class Widget4 < Qt::Widget
    6. def initialize()
    7. super()
    8.  
    9. @layout = Qt::VBoxLayout.new()
    10.  
    11. @widget2 = Widget2.new
    12. @widget3 = Widget3.new
    13. @layout.addWidget(@widget2)
    14. @layout.addWidget(@widget3)
    15.  
    16. setLayout(@layout)
    17. size = Qt::Size.new(500, 500)
    18. size = size.expandedTo(minimumSizeHint())
    19. resize(size)
    20. end
    21. end
    To copy to clipboard, switch view to plain text mode 

    Hope u can help me,

    THX
    WingMan
    Last edited by jacek; 31st August 2008 at 16:41. Reason: changed [qtclass] to [code]

Similar Threads

  1. Qt3 - Multiple transparent widgets
    By bythesea in forum Qt Programming
    Replies: 4
    Last Post: 11th September 2009, 11:24
  2. Replies: 2
    Last Post: 16th May 2008, 14:39
  3. widgets behind hidden widgets not working
    By bpetty in forum Newbie
    Replies: 13
    Last Post: 7th September 2007, 20:23
  4. Performance in hiding/showing widgets
    By Paalrammer in forum Newbie
    Replies: 12
    Last Post: 14th February 2007, 18:57
  5. Creating Widgets
    By hylke in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2006, 08:37

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
  •  
Qt is a trademark of The Qt Company.