Page 2 of 2 FirstFirst 12
Results 21 to 33 of 33

Thread: display a plot point by point

  1. #21
    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: display a plot point by point

    I suggest you improve your C++ skills a bit before taking on Qt.
    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.


  2. #22
    Join Date
    Mar 2009
    Location
    Tunisia
    Posts
    38
    Thanks
    12
    Platforms
    Windows

    Default Re: display a plot point by point

    hello ,
    i realized that my problem have no relation with my code.
    in fact a simple application like "simple_plot" works normally when i create a new project ,move sources and modify *.pro ,but when i do the same for other example like "real_time plot" and try to build it , i have the same problem with a warning(exited with code -1073741819 ,no errors ,warning: #warning better use QwtData) and degugger don't works anymore .
    so it's a configuration problem .
    i downloaded qwt 5.2 from svn but it's the same problem !

    -each time i want to run my application from Qt console or from Qt creator i have to add qwtd5.dll to debug folder,everybody do that ?
    -i want to buid Qt in debug mode ,it takes time ,finally it generate errors related with visual studio 2008
    -why to build Qt in debug mode?
    -mingw's gdb isn't enough to debug Qt applications since we're using Qt's sources ?
    -what about .pri and .prf ? should i modify one ?
    -why debugger under Qt creator works(just for an application without macro Q_OBJECT) even if Qt isn't buit in debug mode ?

    please look up my .pro
    if my questions proves that i'm lost ,some links will be enough to stop annoying you .

    regards
    Last edited by oswalidos; 11th March 2009 at 19:55.

  3. #23
    Join Date
    Mar 2009
    Location
    Tunisia
    Posts
    38
    Thanks
    12
    Platforms
    Windows

    Default Re: display a plot point by point

    sorry ,my problem have no relation with c++ ,i didn't separate my files to .h and .cpp simply cuz i'm still testing qwt(that what makes you think i need to improve my c++ skills?) .
    i'm sure my c++'s skills allows me to use Qt,it doesn't need a c++ expert !
    anyway thanks for your help and advices .
    Last edited by oswalidos; 11th March 2009 at 20:43.

  4. #24
    Join Date
    Mar 2009
    Location
    Tunisia
    Posts
    38
    Thanks
    12
    Platforms
    Windows

    Default Re: display a plot point by point

    my .pro for the real_time_plot :
    Qt Code:
    1. TARGET = QDSQ
    2. TEMPLATE = app
    3. DEPENDPATH += .
    4. INCLUDEPATH += C:\Qwt-5.2.0-svn\include
    5. LIBS += C:\Qwt-5.2.0-svn\lib\qwtd5.dll
    6. CONFIG +=debug
    7.  
    8. HEADERS += scrollzoomer.h \
    9. scrollbar.h \
    10. randomplot.h \
    11. mainwindow.h \
    12. incrementalplot.h
    13. SOURCES += scrollzoomer.cpp \
    14. scrollbar.cpp \
    15. realtime.cpp \
    16. randomplot.cpp \
    17. mainwindow.cpp \
    18. incrementalplot.cpp
    19.  
    20. OTHER_FILES += start.xpm \
    21. clear.xp
    To copy to clipboard, switch view to plain text mode 

  5. #25
    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: display a plot point by point

    Quote Originally Posted by oswalidos View Post
    -each time i want to run my application from Qt console or from Qt creator i have to add qwtd5.dll to debug folder,everybody do that ?
    No, you can place the library in any place the dynamic linker will be looking for it. The directory where the application binary resides is one of those places but not the only one.

    -why to build Qt in debug mode?
    So that you can peek inside internal Qt library calls.

    -mingw's gdb isn't enough to debug Qt applications since we're using Qt's sources ?
    Yes, it is. But it won't tell you much without debugging symbols. Such an experienced C++ programmer as yourself should know that

    -what about .pri and .prf ? should i modify one ?
    What for?

    -why debugger under Qt creator works(just for an application without macro Q_OBJECT) even if Qt isn't buit in debug mode ?
    See the answer above.
    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.


  6. #26
    Join Date
    Mar 2009
    Location
    Tunisia
    Posts
    38
    Thanks
    12
    Platforms
    Windows

    Default Re: display a plot point by point

    Quote Originally Posted by wysota View Post
    No, you can place the library in any place the dynamic linker will be looking for it. The directory where the application binary resides is one of those places but not the only one.
    but if i move dll to other directory,i can't run executable ,error :exited with code -1073741819 .

    anyway,my problem is how to buid any application with no error ,the code of real_time_plot must work with no error !

    so could you tell me if there is a problem with my .pro ?
    i found here :
    Quote Originally Posted by Uwe
    If you are working with a DLL on Windows you also have to add:

    DEFINES += QWT_DLL

    The Qwt tarball also includes a qwt.prf file. When you have adjusted and installed it, it does the configurations lines above for you and you can simply write:

    CONFIG += qwt
    i can't do like he said , i can't got what he mean :
    -if you're working with dll
    - qwt tarball
    -qwt.prf

    thanks for your help

  7. #27
    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: display a plot point by point

    Quote Originally Posted by oswalidos View Post
    but if i move dll to other directory,i can't run executable ,error :exited with code -1073741819 .
    The application probably picks up another version of the library that resides somewhere in your system.

    anyway,my problem is how to buid any application with no error ,the code of real_time_plot must work with no error !
    Your application builds without error. It just doesn't run. That's two different things.

    so could you tell me if there is a problem with my .pro ?
    No, your pro is fine.

    i can't do like he said , i can't got what he mean :
    -if you're working with dll
    - qwt tarball
    -qwt.prf
    What do you mean you can't do it?
    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.


  8. #28
    Join Date
    Mar 2009
    Location
    Tunisia
    Posts
    38
    Thanks
    12
    Platforms
    Windows

    Default Re: display a plot point by point

    i installed Qt 4.4 and 4.5 and qwt 5.1.1 and 5.3 and 5.2 and visual studio 2008 and 2 or 3 mingw ,so my environnement can get confused ?
    Quote Originally Posted by wysota
    What do you mean you can't do it?
    i don't have :
    DEFINES += QWT_DLL
    CONFIG += qwt
    in my pro ,i can't do that cuz i don't understand why should i do that , in addition i tried but it makes other problems

    thanks again

  9. #29
    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: display a plot point by point

    Quote Originally Posted by oswalidos View Post
    i don't have :
    DEFINES += QWT_DLL
    CONFIG += qwt
    in my pro ,i can't do that cuz i don't understand why should i do that , in addition i tried but it makes other problems
    If the guy tells you to do it, then do it. If you have problems, it means you have to solve them. Those statements initialize the use of Qwt in your application.

    I suggest you uninstall everything and start from scratch slowly, without shooting blind. Install one development environment and one Qt version. Then install one version of Qwt (follow the install guide that comes with Qwt), add what's needed to your project file and then start developing software based on Qwt.
    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. #30
    Join Date
    Mar 2009
    Location
    Tunisia
    Posts
    38
    Thanks
    12
    Platforms
    Windows

    Default Re: display a plot point by point

    ok ,i'll restart everything ,by the way the guy didn't tell me,i found it somewhere
    thanks for your help

  11. #31
    Join Date
    Mar 2009
    Location
    Tunisia
    Posts
    38
    Thanks
    12
    Platforms
    Windows

    Default Re: display a plot point by point

    hi again ,
    i restart everything and my news :
    -able to debug my application with visual c++ debugger (given with Qt creator)
    -i downlaod mingw while i'm installing Qt 4.5 .
    -is it normal to don't use the mingw debugger ? (anyway it works)
    -i still have to copy qwtd5.dll to debug folder of my application ,otherwise with debugging i got a runtime error ! (can you help me for that ?)
    -i can back now to my problem : displaying point by point a curve .

    now the code i posted works with no error but the curve don't appear point by point ,first time no curve ,after some seconds i have to refresh the window to see the curve .

    i think if Qt run only one thread(i can see that in debugger) for my application i can't get what want ,i may should create a thread for the methode which call timer ,to get two parellel threads ,one to show the window and second takes care of the timer and giving data .

    am i right?

    thanks for your help

  12. #32
    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: display a plot point by point

    No, you are wrong. See the attachment.

    About the DLL - place it in your Windows\System32 folder or along other Qt DLL files.
    Attached Files Attached Files
    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.


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

    oswalidos (13th March 2009)

  14. #33
    Join Date
    Mar 2009
    Location
    Tunisia
    Posts
    38
    Thanks
    12
    Platforms
    Windows

    Default Re: display a plot point by point

    it was a nice conversation
    coping my dll under system32 solve the problem.
    about code i have just to put replot(); in the right places and it works :

    Qt Code:
    1. void Plot::onTimeout(){ //each timeout data will
    2. currentPointPosition++; // be added to the curve
    3. if(currentPointPosition>1000) currentPointPosition = 1;
    4. curve->setData(x, y, currentPointPosition);
    5. replot();
    6. }
    7.  
    8. void Plot::pointByPoint(){ //calling this method provoque painting curve "slowly"
    9. for(int i=0;i<1000;i++){
    10. timer->start(10);
    11. }
    12. }
    13.  
    14. //in constructor
    15. connect(timer, SIGNAL(timeout()), this, SLOT(onTimeout()));
    16. // add curves
    17. curve = new QwtPlotCurve("Vitesse");
    18. curve->setPen(QPen(Qt::green));
    19. curve->attach(this);
    20. currentPointPosition=1;
    21. curve->setData(x, y, currentPointPosition);
    22. replot();
    To copy to clipboard, switch view to plain text mode 
    think you so much for your help
    how to mark this thread as solved ?

Similar Threads

  1. Replies: 3
    Last Post: 20th April 2006, 11:21

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.