Include Qwt widgets in qt designer



  • hi

    I have ubuntu 12.04, in this am installed QT2.7.1 version and qwt.6.1.0 but In my qt designer am not getting qwt widgets.

    how can I include this.



  • Did u install Qt SDK ?
    What version ?



  • The plugin and the corresponding lib needs to be compatible with the Qt version used by the Qt creator.

    With "Help->About" you can see the version of the Qt creator. With "ldd /usr/local/qwt-6.1.0/lib/libqwt.so" you can see the one Qwt had been built for. If they don't match ( f.e when using Qt5 for Qwt and your application and Qt4 for the creator ) you have to build and install Qwt twice at different places ( edit qwtconfig.pri )

    Next you have to check that the Qwt designer plugin finds the corresponding Qwt lib. Whith a proper installation this should be no problem as the lib has been compiled having the directory of the installed lib in its rpath. Again ldd is your friend: "ldd /usr/local/qwt-6.1.0/plugins/designer/libqwt_designer_plugin.so".

    Then you have to tell the creator where to look for plugins by setting QT_PLUGIN_PATH. Note that this has to be done in the same environment, where you start the creator ( f.e in the same shell ).

    Of course don't forget to read http://qwt.sourceforge.net/qwtinstall.html

    Uwe

    PS: note that the designer is part of Qt while the creator is an extra package. So when working with a Qt5/Qt4 combination you need different plugins for designer and creator.



  • With “Help->About” this

    my QT creator is 2.7.0 and based on QT 5.0.2

    with “ldd /home/username/qwt-6.1.0/lib/libqwt.so” this I didn't find any Qwt lib.
    and my QT is in /home/username/Qt5.0.2.

    but I install the qwt-6.1.0 as in this document
    "Qwt install": http://qwt.sourceforge.net/qwtinstall.html

    means is qwt installed or not?



  • when doing "make install" qwt gets installed to a directory you have specified in qwtconfig.pri. When you did not change anything the path is /usr/local/qwt-6.1.0. If you want to install below /home/username/qwt-6.1.0 you change this path into qwtconfig.pri and rebuild Qwt from scratch.

    Read qwtconfig.pri the options are explained there.

    Uwe

    PS: better use one of the official Qwt support channels - mentioned on the Qwt project page - I don't read here often.



  • My .pro file contains
    @
    #-------------------------------------------------

    Project created by QtCreator 2013-06-06T14:39:08

    #-------------------------------------------------

    QT += core gui
    TARGET = second
    TEMPLATE = app

    SOURCES += main.cpp
    f2.cpp
    HEADERS += f2.h
    FORMS += f2.ui
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/qwt-6.1.0/lib/ -lqwt

    INCLUDEPATH += $$PWD/../../../../usr/local/qwt-6.1.0/include
    DEPENDPATH += $$PWD/../../../../usr/local/qwt-6.1.0/include

    @

    while I am running my project i am getting error like

    bq. /home/akarshana/QT/second/second: error while loading shared libraries: libqwt.so.6: cannot open shared object file: No such file or directory
    /home/akarshana/QT/second/second exited with code 127

    where is the problem?



  • if I run the same program in another project

    it gives an error like

    *** glibc detected *** /home/akarshana/QT/plot/plot: realloc(): invalid pointer: 0x014cad1c ***
    ======= Backtrace: =========
    /lib/i386-linux-gnu/libc.so.6(+0x75ee2)[0xa19ee2]
    /lib/i386-linux-gnu/libc.so.6(realloc+0x25d)[0xa1e56d]
    /lib/i386-linux-gnu/libc.so.6(realloc+0x273)[0xa1e583]
    /home/akarshana/Qt5.0.2/5.0.2/gcc/lib/libQt5Core.so.5(_ZN9QListData7reallocEi+0x37)[0x1133657]
    /home/akarshana/Qt5.0.2/5.0.2/gcc/lib/libQt5Core.so.5(_ZN9QListData6appendEi+0x7c)[0x113373c]
    /home/akarshana/Qt5.0.2/5.0.2/gcc/lib/libQt5Core.so.5(_ZN9QListData6appendEv+0x23)[0x11337c3]
    /home/akarshana/Qt5.0.2/5.0.2/gcc/lib/libQt5Core.so.5(+0x1971ae)[0x12281ae]
    /home/akarshana/Qt5.0.2/5.0.2/gcc/lib/libQt5Core.so.5(Z21qRegisterResourceDataiPKhS0_S0+0x101)[0x1225a31]
    /usr/lib/i386-linux-gnu/libQtGui.so.4(+0x673759)[0x1b50759]
    /usr/lib/i386-linux-gnu/libQtGui.so.4(+0x127064)[0x1604064]
    /lib/ld-linux.so.2(+0xeeab)[0xc67eab]
    /lib/ld-linux.so.2(+0xef94)[0xc67f94]
    /lib/ld-linux.so.2(+0x120f)[0xc5a20f]
    ======= Memory map: ========
    00110000-00242000 r-xp 00000000 08:06 6865 /home/akarshana/Qt5.0.2/5.0.2/gcc/lib/libqwt.so.6
    00242000-00243000 ---p 00132000 08:06 6865 /home/akarshana/Qt5.0.2/5.0.2/gcc/lib/libqwt.so.6
    00243000-00248000 r--p 00132000 08:06 6865 /home/akarshana/Qt5.0.2/5.0.2/gcc/lib/libqwt.so.6
    00248000-0024b000 rw-p 00137000 08:06 6865 /home/akarshana/Qt5.0.2/5.0.2/gcc/lib/libqwt.so.6
    0024b000-00323000 r-xp 00000000 08:06 1444056 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
    00323000-00324000 ---p 000d8000 08:06 1444056 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
    00324000-00328000 r--p 000d8000 08:06 1444056 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
    00328000-00329000 rw-p 000dc000 08:06 1444056 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
    00329000-00330000 rw-p 00000000 00:00 0
    00c0c000-00c0f000 r-xp 00000000 08:06 286739 /lib/i386-linux-gnu/libdl-2.15.so
    00c0f000-00c10000 r--p 00002000 08:06 286739 /lib/i386-linux-gnu/libdl-2.15.so
    00c10000-00c11000 rw-p 00003000 08:06 286739 /lib/i386-linux-gnu/libdl-2.15.so
    00c1b000-00c1c000 r--p 00006000 08:06 286711 /lib/i386-linux-gnu/librt-2.15.so
    00c1c000-00c1d000 rw-p 00007000 08:06 286711 /lib/i386-linux-gnu/librt-2.15.so
    00c1d000-00c31000 r-xp 00000000 08:06 262670 /lib/i386-linux-gnu/libz.so.1.2.3.4
    00c3d000-00c54000 r-xp 00000000 08:06 1443594 /usr/lib/i386-linux-gnu/libaudio.so.2.4
    00c54000-00c55000 r--p 00016000 08:06 1443594 /usr/lib/i386-linux-gnu/libaudio.so.2.4
    00c55000-00c56000 rw-p 00017000 08:06 1443594 /usr/lib/i386-linux-gnu/libaudio.so.2.4
    00c59000-00c79000 r-xp 00000000 08:06 286733 /lib/i386-linux-gnu/ld-2.15.so
    00c79000-00c7a000 r--p 0001f000 08:06 286733 /lib/i386-linux-gnu/ld-2.15.so
    00c7a000-00c7b000 rw-p 00020000 08:06 286733 /lib/i386-linux-gnu/ld-2.15.so
    014dd000-01f87000 r-xp 00000000 08:06 1441091 /usr/lib/i386-linux-gnu/libQtGui.so.4.8.1
    01f87000-01fa9000 r--p 00aa9000 08:06 1441091 /usr/lib/i386-linux-gnu/libQtGui.so.4.8.1
    01fa9000-01fad000 rw-p 00acb000 08:06 1441091 /usr/lib/i386-linux-gnu/libQtGui.so.4.8.1
    0598e000-0598f000 r--p 00015000 08:06 1443474 /usr/lib/i386-linux-gnu/libICE.so.6.3.0
    0598f000-05990000 rw-p 00016000 08:06 1443474 /usr/lib/i386-linux-gnu/libICE.so.6.3.0
    059e2000-059f0000 r-xp 00000000 08:06 1441301 /usr/lib/i386-linux-gnu/libXi.so.6.1.0
    059f0000-059f1000 r--p 0000d000 08:06 1441301 /usr/lib/i386-linux-gnu/libXi.so.6.1.0
    059f1000-059f2000 rw-p 0000e000 08:06 1441301 /usr/lib/i386-linux-gnu/libXi.so.6.1.0
    06af5000-06afc000 r-xp 00000000 08:06 1443523 /usr/lib/i386-linux-gnu/libSM.so.6.0.1
    06afc000-06afd000 r--p 00006000 08:06 1443523 /usr/lib/i386-linux-gnu/libSM.so.6.0.1
    06afd000-06afe000 rw-p 00007000 08:06 1443523 /usr/lib/i386-linux-gnu/libSM.so.6.0.1
    07468000-0746d000 r-xp 00000000 08:06 1443714 /usr/lib/i386-linux-gnu/libffi.so.6.0.0
    0746d000-0746e000 r--p 00004000 08:06 1443714 /usr/lib/i386-linux-gnu/libffi.so.6.0.0
    0746e000-0746f000 rw-p 00005000 08:06 1443714 /usr/lib/i386-linux-gnu/libffi.so.6.0.0
    08048000-0804e000 r-xp 00000000 08:06 1363246 /home/akarshana/QT/plot/plot
    0804e000-0804f000 r--p 00005000 08:06 1363246 /home/akarshana/QT/plot/plot
    0804f000-08050000 rw-p 00006000 08:06 1363246 /home/akarshana/QT/plot/plot
    b66bc000-b77dc000 r--p 00000000 08:06 43383 /home/akarshana/Qt5.0.2/5.0.2/gcc/lib/libicudata.so.49.1.2
    b77dc000-b77dd000 rw-p 0111f000 08:06 43383 /home/akarshana/Qt5.0.2/5.0.2/gcc/lib/libicudata.so.49.1.2
    b77dd000-b77e5000 rw-p 00000000 00:00 0
    b77f6000-b77fa000 rw-p 00000000 00:00 0
    bf92c000-bf94d000 rw-p 00000000 00:00 0 [stack]
    The program has unexpectedly finished.
    /home/akarshana/QT/plot/plot exited with code 0



  • This is because you built qwt library with the qmake of version which is different from the one QTCreator uses.

    Usually, Ubuntu comes with built-in qt4 libraries in system, probably for GTK or something. Which is your default "qmake" in terminal.

    If you didn't compile QTCreator from source code like me, you're probably installed the binary version and was installed in, for example the default location:
    @/opt/QT5.1.0@

    which is a stand alone qt and has its own qmake and libraries that QTCreator based on. Check Tool->Options->Build&Run->QT Versions to see what qmake your QTCreator is using.

    In my case:

    @
    qmake -v
    QMake version 2.01a
    Using Qt version 4.8.1 in /usr/lib/x86_64-linux-gnu

    /opt/Qt5.1.0/5.1.0/gcc_64/bin/qmake -v
    QMake version 3.0
    Using Qt version 5.1.0 in /opt/Qt5.1.0//5.1.0/gcc_64/lib
    @

    So the way to solve this problem is recompile your qwt library with the same qmake QTCreator is using.

    And, DONOT use make clean, that somehow didn't clean qmake generated files. Please DELETE the qwt folder, extract a new one from qwt's source zip/tar.

    Then into it:
    @
    /opt/Qt5.1.0/5.1.0/gcc_64/bin/qmake qwt.pro
    make -j8
    sudo make install
    @

    It works for me and hope should be OK for you, too.

    [quote author="Swinetha" date="1370844021"]if I run the same program in another project

    it gives an error like

    *** glibc detected *** /home/akarshana/QT/plot/plot: realloc(): invalid pointer: 0x014cad1c ***
    ======= Backtrace: =========


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.