Qwt - Plotting Problem
-
I add some codes to pro file, and I got "The program has unexpectedly finished." error when I try to compile. How to fix this?
@INCLUDEPATH += C:/QtSdk/qwt-6.0.0-rc4/src
win32:LIBS += C:/QtSdk/qwt-6.0.0-rc4/lib/libqwtd.a
win32:QMAKE_POST_LINK = copy /Y C:\QtSdk\qwt-6.0.0-rc4\lib\qwtd.dll $(DESTDIR)
CONFIG +=qwt@ -
[quote author="koahnig" date="1365845732"]Which did finish unexpectedly?
Probably you have rerun qmake. [/quote]I click the run button and I show that error message. Program.exe didn't open. How can i rerun qmake?
[quote author="franku" date="1365846514"]You are providing temporary objects a und b to curve1->setRawSamples(a, b, 5); They only live inside the constructur. Probably this could result into you problem. [/quote]
If I understand to you truly; I declare a and b variables in plot.h, a and b take values in constructor plot.cpp. Problem wasn't fixed.
-
[quote author="kingsta" date="1365847361"][quote author="koahnig" date="1365845732"]Which did finish unexpectedly?
Probably you have rerun qmake. [/quote]I click the run button and I show that error message. Program.exe didn't open. How can i rerun qmake?
[/quote]On left side there is the list with projects. Go to the project in question and press right mouse button. An entry with "run qmake" is there.
BTW if the problem from before still exists, this will not cure the problem. franku is right that the temporary declaration is the problem.
@
static double a[5] = { 1, -2, 30, -40, 5};
static double b[5] = { -13, 20, -30, 40, -50};
@will solve your problem for the time being in a very crude way.
Personally, I would recommend that you get a bit more familiarization with "C++ and pointers.":http://bit.ly/16TMY9C -
[quote author="koahnig" date="1365848437"][quote author="kingsta" date="1365847361"][quote author="koahnig" date="1365845732"]Which did finish unexpectedly?
Probably you have rerun qmake. [/quote]I click the run button and I show that error message. Program.exe didn't open. How can i rerun qmake?
[/quote]On left side there is the list with projects. Go to the project in question and press right mouse button. An entry with "run qmake" is there.
BTW if the problem from before still exists, this will not cure the problem. franku is right that the temporary declaration is the problem.
@
static double a[5] = { 1, -2, 30, -40, 5};
static double b[5] = { -13, 20, -30, 40, -50};
@will solve your problem for the time being in a very crude way.
Personally, I would recommend that you get a bit more familiarization with "C++ and pointers.":http://bit.ly/16TMY9C [/quote]I use static variable and there is a kind of weird problem.
There is no curve on display.
@
static double a1[] = { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
static double b1[] = { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100};curve2->setRawSamples(a1, b1, 10);
@Weird curve.
@
static double a1[] = { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
static double b1[] = { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100};curve2->setRawSamples(a1, b1, 11); // If I write a number is greater than 10, Display a wrong curve again
@
Qt plot the curve which is not my wish again.I add the pro file this code to compile this files. I know Its a bad thing.
@include( examples.pri )@Examples.pri, exaples.pro files are in Qwt Examples.
Examples.pri: http://svn.code.sf.net/p/qwt/code/branches/qwt-6.0/examples/examples.priNow I cant add "public slots" in header file.
my mainwindow.h file;
@#include <QMainWindow>class QStandardItemModel;
class QAction;
class QMenu;namespace Ui {
class MainWindow;
}class MainWindow : public QMainWindow
{
Q_OBJECTpublic:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
enum Mode {ImportingMode, AnalyzingeMode, FilteringMode};public slots: // line 23
void importData(); // line 24
...
@Line 23: error: expected ':' before 'slots'
Line 24: error: expected primary-expression before 'void'
Line 24: error: ISO C++ forbids declaration of 'slots' with no type
Line 24: error: expected ';' before 'void'I create plot.h, plot.cpp as you say
What should I do? -
example.pri is not meant to be included like you do it.
I think it's screwing up your own project.
-
[quote author="SGaist" date="1366615003"]example.pri is not meant to be included like you do it.
I think it's screwing up your own project.
[/quote]
You right. I should do by different way.
We use Q_SLOTS when we add some 3rd party library. It works.
@public Q_SLOTS:@I have a problem again. I can't remove the curve on screen. I write that code. When I run the program, Program is crushed.
header file
@Plot plot1;@Source file
@plot1->detachItems();@How can i remove only the curve?
-
Plot plot1 <= instance of Plot
plot1->detachItems() <= pointer to instance of Plot
Got a NULL pointer ?