Results 1 to 2 of 2

Thread: Can't add an object derived from QWidget in a layout.

  1. #1
    Join Date
    Sep 2009
    Posts
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Can't add an object derived from QWidget in a layout.

    Hi, i have one widget defined lik this:

    Qt Code:
    1. class TestWidget: public QWidget, private Ui::TestWidget
    To copy to clipboard, switch view to plain text mode 

    I thougt that is it is derived from QWidget, can be added in a layout using ->addWidget().

    Is this wrong? How can I put it in the MainWindow?

    Thanks

  2. #2
    Join Date
    Sep 2009
    Posts
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Can't add an object derived from QWidget in a layout.

    If i use a cast to QWidget i can insert it, but why i can addWidget(QSpinBox) and cannot addWidget(QSpinBox) ??

Similar Threads

  1. Problem with Size Policy of derived QWidget
    By eehmke in forum Qt Programming
    Replies: 6
    Last Post: 12th November 2008, 13:43
  2. Use QWidget derived class in Dialog
    By qtneuling in forum Qt Tools
    Replies: 2
    Last Post: 17th May 2008, 23:29
  3. QWidget-derived Application Plugins
    By SnarlCat in forum Qt Programming
    Replies: 2
    Last Post: 25th March 2008, 18:25
  4. How to call QValidator derived object
    By bruccutler in forum Qt Programming
    Replies: 2
    Last Post: 23rd March 2007, 17:07
  5. Replies: 1
    Last Post: 2nd May 2006, 21:11

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.