Results 1 to 4 of 4

Thread: get custom widget to inherit qwidget

  1. #1
    Join Date
    Oct 2007
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default get custom widget to inherit qwidget

    hi,

    can anyone tell me if i can get a custom widget in qt designer to inherit QWidget so i can later in code assign it to a QWidget var.

    cheers,
    Philly

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

    Default Re: get custom widget to inherit qwidget

    All widgets inherit QWidget, so basically if you have a widget, you can assign it to a QWidget pointer (pointer, not object as you can't copy widgets).

  3. #3
    Join Date
    Oct 2007
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: get custom widget to inherit qwidget

    hi wysota,

    ok iv just tryed pointing to Ui::mywidget but doing so just gives me a conversion error
    cannot convert from 'Ui::mywidget *' to 'QWidget *'

    thats using,
    QWidget *testwidget;
    testwidget = &Ui::mywidget;

    any ideas?

    cheers

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: get custom widget to inherit qwidget

    Hi. Read http://doc.trolltech.com/4.3/designe...component.html, please. Pay special attention to either single or multiple inheritance approach.
    J-P Nurmi

Similar Threads

  1. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 15:38
  2. Simple custom widget won't size properly
    By MrGarbage in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 13:12
  3. Custom tab widget question
    By PrimeCP in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2007, 11:17
  4. Problem applying setWindowOpacity to a custom Widget
    By yellowmat in forum Qt Programming
    Replies: 8
    Last Post: 1st November 2006, 10:05
  5. Replies: 4
    Last Post: 24th March 2006, 22: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.