Results 1 to 8 of 8

Thread: QwtPlot - promote to custom widget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Location
    Warminster, England
    Posts
    31
    Thanks
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QwtPlot - promote to custom widget

    Quote Originally Posted by jord View Post
    I had the same problem. I just use a QWidget item in Qt Designer instead of a QwtPlot item. I then promote the QWidget item to my custom QwtPlot item. Works great.
    Apologies for adding to this old thread, Could someone provide an example of the correct syntax to promote the QWidget to my custom QwtPlot class?

  2. #2
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlot - promote to custom widget

    Quote Originally Posted by Carlton View Post
    Apologies for adding to this old thread, Could someone provide an example of the correct syntax to promote the QWidget to my custom QwtPlot class?
    thats easy:

    * in the qtdesigner, put a QWidget as placeholder on your widget (can be any class derived by qwidget, I usually take a QListView)
    * rightclick on this QWidget you'd like to promote
    * in the contextmenu, choose "promote to..."
    * fill in your custom class name (e.g. "MyCustomQwtPlot") and the header file your class is located in (e.g. "MyCustomQwtPlot.h")
    * press enter and the "Promote" button gets enabled
    * click this button and everything should work

  3. The following 2 users say thank you to FelixB for this useful post:

    Carlton (15th February 2011), Rufone (28th February 2011)

  4. #3
    Join Date
    Feb 2011
    Posts
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QwtPlot - promote to custom widget

    i have done this in following way:

    -manually edit *.ui file
    -find tag customwidgets
    -add sub tag
    <customwidget>
    <class>QwtPlotEx</class>
    <extends>QwtPlot</extends>
    <header>qwt_plotex.h</header>
    </customwidget>
    -save
    -open this file in "QT designer"
    -promote QwtPlot to QwtPlotEx !!
    -create qwt_plotex.h and qwt_plotex.cpp

  5. The following user says thank you to gbruti for this useful post:

    ken123 (20th October 2011)

Similar Threads

  1. Custom Shape Widget (resize)
    By PiXeL16 in forum Qt Programming
    Replies: 7
    Last Post: 12th February 2007, 07:00
  2. Replies: 1
    Last Post: 5th November 2006, 23:50
  3. Problem applying setWindowOpacity to a custom Widget
    By yellowmat in forum Qt Programming
    Replies: 8
    Last Post: 1st November 2006, 10:05
  4. Replies: 9
    Last Post: 8th May 2006, 14:21
  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
  •  
Qt is a trademark of The Qt Company.