Dear visitor, welcome to QtForum.org.
If this is your first visit here, please read the Help. It explains in detail how this page works.
To use all features of this page, you should consider registering.
Please use the registration form, to register here or read more information about the registration process.
If you are already registered, please login here.
Hi iam using Qt4.3.3 with VS2005. I am trying to plot a graph with the values pre defined but i am getting this error. And how should i print the system time for every One second on the AxisTitle QwtPlot::xBottom axis. I tried the Qwt Example CPU Plot but i din't understand it properly.
Source code
1
error C3867: 'QWidget::x': function call missing argument list; use '&QWidget::x' to create a pointer to member
also, 'm_curve = new QwtPlotCurve();' and 'QwtPlotGrid *gridy = new QwtPlotGrid();' must be in your constructor: now you 'new' everytime the timer signal fires, and you never delete. If your program runs for a few days, you'll be out of memory.
Hi pls tell me about this i din't understand it. I will be very thank full to you.
What do i have to delete every time the timer signal is fired. I was clueless about it until now. Hey and how do i print the time stamp on the Bottom X axis of the Qwt Plot Widget.
Source code
1
2
3
4
5
6
7
8
9
10
11
void PlottingGraph::draw()
{
m_curve = new QwtPlotCurve();
m_curve->setPen(QPen(Qt::red));
m_curve->setData(x, y1, 3); // ----> Error here
QwtPlotGrid *gridy = new QwtPlotGrid();
gridy->attach(myPlot);
m_curve->attach(myPlot);
}
Hi thank You so much for the reply. Hey but once i change the x to z i get a new
error undeclared identifier. !! Hey and i tried modifying the Digital clock program to invoke the system time and print but i get some error's. You have any example code to Time Stamp the systems time on to the Qwt Plot Widget Bottom Axis. It will be very helpfull for me.
Hi Stinos i tried the QTime::currentTime().toString(); but i get a error. I am trying to get a System Time stamp on the Bottom X axis like the Qwt example Cpu Plot.
Hi Stinos i changed the setAxisTitle to setAxisScale . I got no errors when i debugged the program but the Time is not displayed on the Bottom Axis. I wanted the time to be updated like the Cpu Plot program. But no luck here.
Hi stinos Thanks a lot for the reply. Finally i see time which is on the title but that is not exactly what i wanted. I wanted the time to be displayed every 2 seconds on the Scale. The Plot will be real time so the Graph Plot keeps updating and i will have to update the scale every 2 seconds. I have attached output screen shot i am getting right now (Present Output.bmp) . I wanted the time to be Stamped like this (Required Output.bmp).
well then you'll need setAxisScale and setAxisScaleDraw. Study the CpuPlot example code to see how they do it; I would guess they override QwtScaleDraw with a custom class that turns samples into time values