Results 1 to 4 of 4

Thread: Core using a custom widget.....

  1. #1
    Join Date
    Oct 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Core using a custom widget.....

    Hi...i'm new using QT and this could be a silly question.....

    I created a widget using the assistand example, the timeclock, but only using a widget created with the designer, i have ui_my_widget.h, an my_widget inherit class and another class which uses the "QDesignerCustomWidgetInterface", and finally a .pro with the same estructure that the clock example. I do a "make install" and the designer finds it, but when a drag the widget on the form the designer crash........

    Someone Knows why this happend? or some tutorial step-by-step to add widget to the designer??

    Thanks..

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Core using a custom widget.....

    I think this is what you are looking for
    http://doc.trolltech.com/4.3/designe...m-widgets.html
    I'm a rebel in the S.D.G.

  3. #3
    Join Date
    Oct 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Unhappy Re: Core using a custom widget.....

    Yes , i readed the Qt documentation, and following the steps as the example says, but it crashes anyway........

    if someone creates a widget and it works i will appreciate some basic steps to create my own, because i don't know what the is the problem......

    even the core file have not symbols about the crash, my widget is compilled in debug mode....

    My steps where:

    1- create an "UI" with the designer, result a ui_my_widget.h
    2- create an inherit class my_widget.h from the previous ui.h using the QDESIGNER_WIDGET_EXPORT macro in the class definition as the example says.
    3- create another class inherint from QDesignerCustomWidgetInterface, with a new of may widget in the "createWidget" method and the Q_EXPORT_PLUGIN2 macro at the end of the file.
    4- create a .pro with the proper plugin and lib parameters and do a "make install", the paths and files are correctly created into the QT paths.
    5- The plugin appears in the designer but when i clicked over it there is only a blank box with the size of the XML method from the QDesignerCustomWidgetInterface inherit class.
    6- finally when i drag and drop the widget over a frame the designer crashes

    Maybe some step is wrong .....

    Some help on compilation or other example custom plugin will be great...

    Thanks....

  4. #4
    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: Core using a custom widget.....

    I'd say you have an uninitialized pointer somewhere. Your plugin is fine if the widget shows up in Designer.

Similar Threads

  1. Custom Widget - First Steps
    By sekatsim in forum Qt Programming
    Replies: 8
    Last Post: 26th June 2008, 17:19
  2. Replies: 5
    Last Post: 25th May 2008, 08:22
  3. Custom widget
    By zorro68 in forum Qt Programming
    Replies: 7
    Last Post: 28th January 2008, 14:06
  4. 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
  5. Custom tab widget question
    By PrimeCP in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2007, 11:17

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.