Results 1 to 11 of 11

Thread: qwt problem

  1. #1
    Join Date
    May 2011
    Posts
    39
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default qwt problem

    I am trying out a simple random graph plot just to check the working of my library qwt.......
    my code looks like following and I am getting error saying "C:\Qt\2010.05\qwt-build-desktop\debug\qwt.exe exited with code -1073741511"
    please help me....my code is simple:::
    Qt Code:
    1. #include "mainwindow.h"
    2. #include "ui_mainwindow.h"
    3. #include "qwt.h"
    4. #include "qwt_plot.h"
    5. #include <QFileSystemWatcher>
    6. #include "qwt_knob.h"
    7. #include "cmath"
    8. #include "qwt_curve_fitter.h"
    9. #include "qwt_plot_curve.h"
    10. #include "qwt_text.h"
    11.  
    12.  
    13. MainWindow::MainWindow(QWidget *parent) :
    14. QMainWindow(parent),
    15. ui(new Ui::MainWindow)
    16. {
    17. ui->setupUi(this);
    18.  
    19. }
    20.  
    21. MainWindow::~MainWindow()
    22. {
    23. delete ui;
    24. }
    25.  
    26. void MainWindow::on_pushButton_clicked()
    27. {
    28. double xval[5]={10,20,30,40.4,50};
    29. double yval[5]={1,2.2,3,4,5};
    30. QwtPlot plot(QwtText("CppQwtExample1"));
    31. plot.setTitle("first plot");
    32. plot.setTitle("first_plot");
    33. plot.setAxisTitle(QwtPlot::xBottom, " System time [h:m:s]");
    34. plot.setAxisScale(QwtPlot::xBottom, 0,60 );
    35. plot.setAxisTitle(QwtPlot::yLeft, "Degree");
    36. plot.setAxisScale(QwtPlot::yLeft, -60,60 );
    37. plot.setAutoReplot(true);
    38. QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
    39. curve1->setPen(QPen(Qt::blue));
    40. curve1->setRawSamples(xval,yval,5);
    41. curve1->attach(&plot);
    42. plot.replot();
    43. plot.show();
    44.  
    45. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    May 2011
    Posts
    39
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qwt problem

    seems like no one has the solution ....
    please help me.....

  3. #3
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: qwt problem

    According to The Internet, you're linking against the wrong DLLs. Most likely, you're trying to run a debug version against non-debug DLLs, or vice-versa.

  4. The following user says thank you to SixDegrees for this useful post:

    robotics (15th June 2011)

  5. #4
    Join Date
    May 2011
    Posts
    39
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qwt problem

    Is my code correct.....
    please give me some sample code to check whether i have sucessfully built the library or not

  6. #5
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qwt problem

    Two comments re your code:

    1) What do you think happens to "plot" when on_pushButton_clicked() ends?
    2) Using setRawSamples() presents the same problem as item 1. From the Qwt docs:
    setRawSamples is provided for efficiency. It is important to keep the pointers during the lifetime of the underlying QwtCPointerData class.

  7. The following user says thank you to norobro for this useful post:

    robotics (16th June 2011)

  8. #6
    Join Date
    May 2011
    Posts
    39
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qwt problem

    please provide me simple example of how to make a simple plot only consisting of axes only..........
    I just want to check my qwt ...
    please help me..

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

    Default Re: qwt problem

    can you compile the examples delivered with qwt?

  10. #8
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qwt problem

    As FelixB says, compiling the examples is the best test.

    However, by creating "plot" on the heap and using setSamples() in lieu of setRawSamples() your code works for me (Qwt 6.0.0-rc3):
    Qt Code:
    1. void MainWindow::on_pushButton_clicked()
    2. {
    3. double xval[5]={10,20,30,40.4,50};
    4. double yval[5]={1,2.2,3,4,5};
    5. QwtPlot *plot = new QwtPlot(QwtText("CppQwtExample1"));
    6. // plot->setTitle("first plot");
    7. plot->setTitle("first_plot");
    8. plot->setAxisTitle(QwtPlot::xBottom, " System time [h:m:s]");
    9. plot->setAxisScale(QwtPlot::xBottom, 0,60 );
    10. plot->setAxisTitle(QwtPlot::yLeft, "Degree");
    11. plot->setAxisScale(QwtPlot::yLeft, -60,60 );
    12. plot->setAutoReplot(true); // not needed
    13. QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
    14. curve1->setPen(QPen(Qt::blue));
    15. curve1->setSamples(xval,yval,5);
    16. curve1->attach(plot);
    17. plot->replot(); // not needed
    18. plot->show();
    19. }
    To copy to clipboard, switch view to plain text mode 

  11. #9
    Join Date
    May 2011
    Posts
    39
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qwt problem

    please provide me some examples..........and .pro file if you can........
    that would be very helpful for me..
    I am not been able to start
    I am stuck here in my project.....
    your help shall be highly appreciated...

  12. #10
    Join Date
    Jun 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qwt problem

    C:\Qt\2010.05\qwt-build-desktop\debug\qwt.exe exited with code -1073741511
    We can get a lot more information if you actually use the debugger to find your errors. A problem like the above with -no other data- occurs 99% of the time without a debugger.

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

    Default Re: qwt problem

    Quote Originally Posted by robotics View Post
    please provide me some examples..........and .pro file if you can........
    that would be very helpful for me..
    you downloaded the qwt sources, didn't you? then you already have examples. these are in a directory called "examples" (surprisingly, isn't it?) in your qwt directory...

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.