Results 1 to 9 of 9

Thread: Installing (or using?) Qwt without compiling the Qt Creator

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2016
    Posts
    57
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Question Installing (or using?) Qwt without compiling the Qt Creator

    Is there any way for me to use the Qwt without compiling the Qt Creator?

    And by the way my Qt Creator is: Based on Qt 5.7.0 (MSVC 2013, 32 bit)

    And even if I still must build Qwt in order to use it, can it be done by building it from Qt Creator itself?

    Again, all I want is to be able to generate plots inside my program, if I do not get those drag/drop Qwt controls (which I do not need anyway) I am perfectly fine with it.
    I just need to be able to call Qwt functions to plot data inside my window widgets (and also plot using OpenGL)

    I even tried this, I extracted the qwt-6.1.3 folder, and opened its .pro file with my Qt Creator, built it. then created a simple gui project in QtCreator, and:

    .pro file:
    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2016-08-09T16:55:09
    4. #
    5. #-------------------------------------------------
    6.  
    7. QT += core gui
    8. CONFIG += qwt
    9. QWT_LOCATION = C:\Qwt-6.1.3
    10. INCLUDEPATH += $${QWT_LOCATION}/src
    11. LIBS = -L$${QWT_LOCATION}/lib \
    12. -lqwt
    13.  
    14.  
    15. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    16.  
    17. TARGET = QwtTest2
    18. TEMPLATE = app
    19.  
    20.  
    21. SOURCES += main.cpp
    22.  
    23. HEADERS +=
    24.  
    25. FORMS +=
    To copy to clipboard, switch view to plain text mode 

    And here is the main.cpp (some code I took as example from some of the threads in here)
    Qt Code:
    1. #include <qapplication.h>
    2. #include <qwt_plot.h>
    3. #include <qwt_plot_curve.h>
    4. #include <qwt_plot_grid.h>
    5. #include <qwt_symbol.h>
    6. #include <qwt_legend.h>
    7.  
    8. int main( int argc, char **argv )
    9. {
    10. QApplication a( argc, argv );
    11.  
    12. QwtPlot plot;
    13. plot.setTitle( "Plot Demo" );
    14. plot.setCanvasBackground( Qt::white );
    15. plot.setAxisScale( QwtPlot::yLeft, 0.0, 10.0 );
    16. plot.insertLegend( new QwtLegend() );
    17.  
    18. QwtPlotGrid *grid = new QwtPlotGrid();
    19. grid->attach( &plot );
    20.  
    21. QwtPlotCurve *curve = new QwtPlotCurve();
    22. curve->setTitle( "Some Points" );
    23. curve->setPen( Qt::blue, 4 ),
    24. curve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
    25.  
    26. QwtSymbol *symbol = new QwtSymbol( QwtSymbol::Ellipse,
    27. QBrush( Qt::yellow ), QPen( Qt::red, 2 ), QSize( 8, 8 ) );
    28. curve->setSymbol( symbol );
    29.  
    30. QPolygonF points;
    31. points << QPointF( 0.0, 4.4 ) << QPointF( 1.0, 3.0 )
    32. << QPointF( 2.0, 4.5 ) << QPointF( 3.0, 6.8 )
    33. << QPointF( 4.0, 7.9 ) << QPointF( 5.0, 7.1 );
    34. curve->setSamples( points );
    35.  
    36. curve->attach( &plot );
    37.  
    38. plot.resize( 600, 400 );
    39. plot.show();
    40.  
    41. return a.exec();
    42. }
    To copy to clipboard, switch view to plain text mode 

    It compiles without error, but when I run it it shows this in Application Output:
    QWidget: Must construct a QApplication before a QWidget
    ANy ideas how can I get it to work?
    Last edited by r2com; 9th August 2016 at 22:50.

Similar Threads

  1. installing QT creator 5
    By crisHerald in forum Newbie
    Replies: 14
    Last Post: 24th May 2013, 02:30
  2. Problems installing Qt Creator 5 and Qt 4
    By u04245822 in forum Qt Tools
    Replies: 0
    Last Post: 22nd April 2013, 10:10
  3. Replies: 1
    Last Post: 17th October 2011, 09:53
  4. Installing FANN lib in Qt creator!
    By Abeer in forum Newbie
    Replies: 6
    Last Post: 10th July 2011, 08:51
  5. Matplotlib widget installing on Qt Creator
    By soulz9 in forum Newbie
    Replies: 0
    Last Post: 15th April 2010, 06:57

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.