Results 1 to 9 of 9

Thread: Can I use "Promote to..." with Qwt?

  1. #1
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    231
    Thanks
    118
    Thanked 18 Times in 10 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Can I use "Promote to..." with Qwt?

    Hello!

    Sorry for my English in advance

    I will have class "Graph" in the file "Graph.h". I want to have a widget which I can "Promote to ..." from Qt Designer, like in the picture:
    279.png

    Must I inherit QwtPlot and QWidget? How to show the plot?
    Qt Code:
    1. #ifndef GRAPH_H
    2. #define GRAPH_H
    3.  
    4. #include <QWidget>
    5. #include <qwt_plot.h>
    6.  
    7. class Graph : public QWidget, QwtPlot
    8. {
    9. public:
    10. Graph()
    11. {
    12.  
    13. }
    14. };
    15.  
    16. #endif // GRAPH_H
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Can I use "Promote to..." with Qwt?

    QwtPlot is already derived from QWidget ( your code above doesn't make much sense ) and you can do with it, what you can do with any other QWidget.

    Note that you could also install the Qwt designer plugin to customize QwtPlot widgets from the designer or creator.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    8Observer8 (15th August 2014)

  4. #3
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    231
    Thanks
    118
    Thanked 18 Times in 10 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Can I use "Promote to..." with Qwt?

    Thank you! I will install plugin later

    I cannot run my application. I receive this message in the "Application Output":
    Starting D:\Qt\QwtExamples\0007_Line\build-Line-Desktop_Qt_5_3_1_MinGW_32bit-Debug\debug\Line.exe...
    The program has unexpectedly finished.
    D:\Qt\QwtExamples\0007_Line\build-Line-Desktop_Qt_5_3_1_MinGW_32bit-Debug\debug\Line.exe crashed
    Qt Code:
    1. #ifndef GRAPH_H
    2. #define GRAPH_H
    3.  
    4. #include <qwt_plot.h>
    5.  
    6. class Graph : public QwtPlot
    7. {
    8. public:
    9. Graph( QWidget *widget = 0 ) :
    10. QwtPlot( widget )
    11. {
    12.  
    13. }
    14. };
    15.  
    16. #endif // GRAPH_H
    To copy to clipboard, switch view to plain text mode 

  5. #4
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    231
    Thanks
    118
    Thanked 18 Times in 10 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Can I use "Promote to..." with Qwt?

    What must I show? I don't have more code in this project

  6. #5
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    231
    Thanks
    118
    Thanked 18 Times in 10 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Can I use "Promote to..." with Qwt?

    Please, it is very important. How to show a graph?

  7. #6
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    231
    Thanks
    118
    Thanked 18 Times in 10 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Can I use "Promote to..." with Qwt?

    Please, help me! This is my steps:

    - I created a MainWindow application
    - I added in the .pro file this code:
    Qt Code:
    1. QWT_LOCATION = c:/Qwt-6.1.0
    2. INCLUDEPATH += $${QWT_LOCATION}/include
    3. LIBS = -L$${QWT_LOCATION}/lib \
    4. -lqwtd
    To copy to clipboard, switch view to plain text mode 

    - I create the class "Plot":

    Plot.h
    Qt Code:
    1. #ifndef PLOT_H
    2. #define PLOT_H
    3.  
    4. #include "qwt_plot.h"
    5.  
    6. class Plot : public QwtPlot
    7. {
    8. public:
    9. Plot( QWidget *parent = 0 );
    10. };
    11.  
    12. #endif // PLOT_H
    To copy to clipboard, switch view to plain text mode 

    Plot.cpp
    Qt Code:
    1. #include "Plot.h"
    2.  
    3. Plot::Plot( QWidget *parent ) :
    4. QwtPlot( parent )
    5. {
    6. }
    To copy to clipboard, switch view to plain text mode 

    - I opened the file "MainWindow.ui" and I put on the form the widget "Widget"
    - I promoted the "Widget" to "Plot"
    - I ran my application and received this message:
    The program has unexpectedly finished.

  8. #7
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    231
    Thanks
    118
    Thanked 18 Times in 10 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Can I use "Promote to..." with Qwt?

    This application doesn't work too:

    VerySimple.pro
    Qt Code:
    1. QT += widgets
    2.  
    3. INCLUDEPATH += "C:/Qwt-6.1.0/include"
    4. LIBS += "C:/Qwt-6.1.0/lib/libqwtd.a"
    5.  
    6. SOURCES += \
    7. main.cpp
    To copy to clipboard, switch view to plain text mode 

    main.cpp
    Qt Code:
    1. #include <QApplication>
    2. #include "qwt_plot.h"
    3.  
    4. int main( int argc, char *argv[] )
    5. {
    6. QApplication app( argc, argv );
    7.  
    8. QwtPlot plot;
    9.  
    10. plot.show();
    11.  
    12. app.exec();
    13. }
    To copy to clipboard, switch view to plain text mode 

    Output:
    The program has unexpectedly finished.

    Added after 16 minutes:


    I set breakpoint on the line "QApplication app( argc, argv );" I see:
    300.png
    Last edited by 8Observer8; 27th August 2014 at 12:27.

  9. #8
    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: Can I use "Promote to..." with Qwt?

    Please do a search on the forum for "0xc0000135".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. The following user says thank you to wysota for this useful post:

    8Observer8 (28th August 2014)

  11. #9
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    231
    Thanks
    118
    Thanked 18 Times in 10 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Can I use "Promote to..." with Qwt?

    I think it is because I built Qwt in Qt5.1.1 and I try to use it in Qt5.3.1

Similar Threads

  1. Replies: 1
    Last Post: 7th April 2010, 22:46
  2. Replies: 3
    Last Post: 15th February 2010, 18:27
  3. Replies: 3
    Last Post: 8th July 2008, 20:37
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 16:58

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.