Results 1 to 3 of 3

Thread: how to plot graph using qwt ?

  1. #1
    Join Date
    Mar 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default how to plot graph using qwt ?

    Hi,

    I am new to qt -creator. I have installed the library "libqwt-dev" from synaptics (i am using Ubuntu 9.10). But when i try to "make" the examples of qwt, i get error in it.
    Can you please let me know how to plot a graph in qt-creator. If possible could you provide any project related to that ?

    Please help me

    Regards,

    sunit

  2. #2
    Join Date
    Apr 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to plot graph using qwt ?

    I recommend that you download qwt sources and it compile on your OS.

    http://sourceforge.net/projects/qwt/

    first copy the download file for example in your home folder, in /home/user, and extract there the files.
    into this folder you have to choose the correct options for the compilation, to compile the examples and create all good

    make the following changes in /home/user/qwt-5.2/qwtconfig.pri file

    Qt Code:
    1. ######################################################################
    2. # Install paths
    3. ######################################################################
    4.  
    5. VER_MAJ = 5
    6. VER_MIN = 2
    7. VER_PAT = 1
    8. VERSION = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
    9.  
    10. unix {
    11. INSTALLBASE = /usr/local/qwt-$$VERSION-svn
    12. }
    13.  
    14. win32 {
    15. INSTALLBASE = C:/Qwt-$$VERSION-svn
    16. }
    17.  
    18. target.path = $$INSTALLBASE/lib
    19. headers.path = $$INSTALLBASE/include
    20. doc.path = $$INSTALLBASE/doc
    21.  
    22. ######################################################################
    23. # qmake internal options
    24. ######################################################################
    25.  
    26. CONFIG += qt # Also for Qtopia Core!
    27. CONFIG += warn_on
    28. CONFIG += thread
    29. CONFIG += silent
    30.  
    31. ######################################################################
    32. # release/debug mode
    33. # If you want to build both DEBUG_SUFFIX and RELEASE_SUFFIX
    34. # have to differ to avoid, that they overwrite each other.
    35. ######################################################################
    36.  
    37. VVERSION = $$[QT_VERSION]
    38. isEmpty(VVERSION) {
    39.  
    40. # Qt 3
    41. CONFIG += debug # release/debug
    42. }
    43. else {
    44. # Qt 4
    45. win32 {
    46. # On Windows you can't mix release and debug libraries.
    47. # The designer is built in release mode. If you like to use it
    48. # you need a release version. For your own application development you
    49. # might need a debug version.
    50. # Enable debug_and_release + build_all if you want to build both.
    51.  
    52. #CONFIG += debug # release/debug/debug_and_release
    53. #CONFIG += debug_and_release
    54. CONFIG += build_all
    55. }
    56. else {
    57. CONFIG += debug # release/debug
    58. }
    59. }
    60.  
    61. ######################################################################
    62. # If you want to have different names for the debug and release
    63. # versions you can add a suffix rule below.
    64. ######################################################################
    65.  
    66. DEBUG_SUFFIX = d
    67. RELEASE_SUFFIX = r
    68.  
    69. win32 {
    70. DEBUG_SUFFIX = d
    71. }
    72.  
    73. ######################################################################
    74. # Build the static/shared libraries.
    75. # If QwtDll is enabled, a shared library is built, otherwise
    76. # it will be a static library.
    77. ######################################################################
    78.  
    79. CONFIG += QwtDll
    80.  
    81. ######################################################################
    82. # QwtPlot enables all classes, that are needed to use the QwtPlot
    83. # widget.
    84. ######################################################################
    85.  
    86. CONFIG += QwtPlot
    87.  
    88. ######################################################################
    89. # QwtWidgets enables all classes, that are needed to use the all other
    90. # widgets (sliders, dials, ...), beside QwtPlot.
    91. ######################################################################
    92.  
    93. CONFIG += QwtWidgets
    94.  
    95. ######################################################################
    96. # If you want to display svg imageson the plot canvas, enable the
    97. # line below. Note that Qwt needs the svg+xml, when enabling
    98. # QwtSVGItem.
    99. ######################################################################
    100.  
    101. #CONFIG += QwtSVGItem
    102.  
    103. ######################################################################
    104. # You can use the MathML renderer of the Qt solutions package to
    105. # enable MathML support in Qwt. # If you want this, copy
    106. # qtmmlwidget.h + qtmmlwidget.cpp to # textengines/mathml and enable
    107. # the line below.
    108. ######################################################################
    109.  
    110. #CONFIG += QwtMathML
    111.  
    112. ######################################################################
    113. # If you want to build the Qwt designer plugin,
    114. # enable the line below.
    115. # Otherwise you have to build it from the designer directory.
    116. ######################################################################
    117.  
    118. CONFIG += QwtDesigner
    119.  
    120. ######################################################################
    121. # If you want to auto build the examples, enable the line below
    122. # Otherwise you have to build them from the examples directory.
    123. ######################################################################
    124.  
    125. CONFIG += QwtExamples
    To copy to clipboard, switch view to plain text mode 

    then open a terminal and install with ./conficure, make and make install, remember you must be root to perform the make install.

    the make install create this folder /usr/local/qwt-5.2.1-svn, and there, you have other two folders /includes and /libs.

    finally to view the qwt examples you have to introduce the qwt libs in a environment variable -> LD_LIBRARY_PATH, with this command in a terminal or in the profile file.

    export LD_LIBRARY_PATH=$LD_LIBARRY_PATH:/usr/local/qwt-5.2.1-svn/lib

    you can see the examples that provides qwt.

    cd /home/user/qwt-5.2/examples/bind
    and there, you can execute all the different examples like ./cpuplot

    the last option that you can do is introduce the qwt plugin into a qt creator , only you have copy /home/user/qwt-5.2/designer/plugins/designer/libqwt_designer_plugind.so here /home/user/qtsdk-2009.04/lib/qtcreator.

    When you create your application you have to introduce those commands in the .pro file
    INCLUDEPATH += /usr/local/qwt-5.2.1-svn/include
    LIBS += /usr/local/qwt-5.2.1-svn/lib/libqwtd.so.5

    if you do not understand any thing , ask me.
    I hope to help you and sorry because my English is not very good

  3. #3
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to plot graph using qwt ?

    @qtprgrmr

    i did as u said but when i run the qt creator, i am getting the following error :
    Error while loading shared libraries: libqwt.so.5: cannot open shared object file: No such file or directory

    /root/graphs/graphs/graphs exited with code 127

Similar Threads

  1. Plot a graph without Qwt
    By abghosh in forum Qwt
    Replies: 2
    Last Post: 17th August 2010, 10:33
  2. Plot Graph in tooltip
    By abghosh in forum Qt Programming
    Replies: 4
    Last Post: 1st March 2010, 04:10
  3. how to plot scatter graph?
    By rambo83 in forum Qwt
    Replies: 0
    Last Post: 25th February 2010, 12:24
  4. Replies: 1
    Last Post: 22nd May 2008, 15:10
  5. How to plot a graph in Qt ?
    By vinod in forum Qt Programming
    Replies: 2
    Last Post: 27th April 2006, 13:44

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.