Results 1 to 4 of 4

Thread: Created a custom widget in wizard, how to get it in designer

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2012
    Posts
    98
    Thanks
    11
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Created a custom widget in wizard, how to get it in designer

    First, I mean the plugin approach. I don't mean to be rude, but I *did* mention that I was trying to get a plugin to work in designer in the first post.

    Second, NO. That tut was not helpful in figuring out WHY it won't show up in designer. I don't wish to write another 200 lines of code to have it *maybe* work when that hasn't worked two times before. I used the wizard to avoid that mess assuming that something that was completely automated to do *only* that task would work, built a wrapper around a QPushButton and I still see no "TestButton", if you will.

    There seems to be some obvious step these tut's don't go out of their way to explain. I don't know what hoop you have to jump through to get the files in the right spot that it'll be happy about it. If it matters:

    -I'm on Windows
    -Latest release of Qt, using Qt Creator
    -The code builds and works (for the button anyway) but does not get the object into designer. I would really like to figure out why it won't appear in my list

  2. #2
    Join Date
    Mar 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Created a custom widget in wizard, how to get it in designer

    There are two ways of doing that.

    Adding a similar widget and Promoting this widget
    1. Add the similar widget to your desing (for example a QTextEdit)
    2. Copy and past the *.cpp and the *.h document to your project file
    3. Add those documents to your project
    4. On the Ui designer, Right Click over your widget
    5. Press Promote to...
    6. In the textbox Promote class name put the name of the class that you are going to add ("CodeEditor" for example, it is case sensitive).
    7. Press Add Button
    8. Press Promote Button

    Watch this video

    Last edited by luisvt; 10th August 2012 at 01:16.

Similar Threads

  1. Creating custom qt widget + not appearing in wizard
    By kewal.deshpande in forum Qt Programming
    Replies: 1
    Last Post: 4th March 2012, 04:26
  2. Replies: 0
    Last Post: 19th September 2011, 16:10
  3. Replies: 1
    Last Post: 23rd June 2011, 23:09
  4. Replies: 4
    Last Post: 8th April 2011, 22:17
  5. Subclassing a widget created in Qt Designer
    By dmginc in forum Qt Programming
    Replies: 2
    Last Post: 19th January 2011, 06:30

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.