Results 1 to 4 of 4

Thread: Widget not showing

  1. #1
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Widget not showing

    Hi,

    I have a template class
    Qt Code:
    1. template< class WIDGET >
    2. class WidgetItem : public WIDGET, public QGraphicsItem
    To copy to clipboard, switch view to plain text mode 

    it can accept any widget as parameter... Now i pass MyWidget class derived from QWidget as a parameter. Now it should treat MyWidget as a widget...
    But ... All other widgets like... QPushButton, QLabel etc are shown but MyWidget is not shown...

    I have tried doing brute force debuging by setting wait cursor on my widget..
    The cursor is changed tp wait cursot but the widget is not shown...


    Please help..
    Last edited by jpn; 24th July 2008 at 10:17. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2008
    Location
    Finland /Pakistan
    Posts
    216
    Thanks
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Widget not showing

    i am not sure about it,but give this a try when you want to pass QWidget derived class as your WIDGET.
    Qt Code:
    1. template< class WIDGET >
    2. class WidgetItem : public QGraphicsItem,public WIDGET
    To copy to clipboard, switch view to plain text mode 
    Hope it helps...!!
    Last edited by jpn; 24th July 2008 at 10:18. Reason: missing [code] tags

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Widget not showing

    Why are you creating such a template ??

    Wont there be ambiguity between WIDGET and QGraphicsItem functions ?? say mousePressEvent ??

  4. #4
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Widget not showing

    This is a legacy code...and i have to live with it...
    Ambugity is resolved by using scope resolutiion....
    But why is this problem.....of not showing the widget...?

Similar Threads

  1. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  2. ‎a lightweight text showing widget
    By jacum in forum Qt Programming
    Replies: 1
    Last Post: 22nd August 2007, 14:44
  3. Showing the output from cmake on my widget
    By jsmax in forum Qt Programming
    Replies: 3
    Last Post: 18th May 2007, 20:17
  4. Open FileDialog showing Back of the Widget in Mac
    By shyam prasad in forum Qt Programming
    Replies: 1
    Last Post: 19th April 2007, 06:33
  5. Replies: 1
    Last Post: 5th November 2006, 23:50

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.