PDA

View Full Version : Qwt Installation Help



darkblackcorner
10th May 2011, 18:31
Hi, I've been using QtCreator for a while and recently discovered a need to create plots graphs and charts in a particular application. I was originally going to do this from scratch using QGraphicsView, but I heard Qwt was a good option.

Anyway, to get to the point, I have so far followed the instructions in the INSTALL file, including building the examples (which work fine).
I'm currently trying to work out how to include it in my own applications, as well as placing the widgets in the GUI.

Can anyone help?

Thanks.

Uwe
10th May 2011, 21:00
When you are using qmake project files for your application add "CONFIG += qwt" to it. Of course you need to configure qmake before - but this all is explained in the INSTALL file.

Uwe

darkblackcorner
11th May 2011, 12:03
Thanks, I did miss the final step!

Ok so I know I can access the qwt files now (the autocomplete works!), but I still can't place widgets in the UI editor. Is there a way to get this working?

Uwe
11th May 2011, 19:09
"make install" also installs the designer plugin - all you need to do is to tell the Creator how to find it. Look at the end of the INSTALL file about how to do it.

A common source of problems on Windows is, when you are using a binary package of the Creator, that has been build with a different compiler than the one you have used for building Qwt ( MinGW, MSVC ). Also you can't load a debug Qwt plugin into a Qt Creator, that has been buit in release mode ( and v.v ).

Uwe

darkblackcorner
11th May 2011, 20:02
Ok, so I've tried copying the plugin files to the plugin directory but to no avail. Nevermind.

Should I try something like this in the Qt command line?

qmake -set QT_PLUGIN_PATH "C:\qwt-6.0.0\plugins\designer"
qmake -set LD_LIBRARY_PATH "C:\qwt-6.0.0\lib"
Or should it only appear in the *.pro file where I want to use it?

Thanks

Uwe
13th May 2011, 17:41
QT_PLUGIN_PATH is an environment variable ( like PATH ) and LD_LIBRARY_PATH is for Linux systems - on Windows it is PATH.

Uwe

darkblackcorner
14th May 2011, 14:59
Ok, to summarise I've done the following steps:


Unzip Qwt to "C:\Qt\qwt-6.0.0"
Edit qwtconfig.pri: uncomment QwtExamples, comment QwtDll, set win32 install prefix to C:/qwt-$$QWT_VERSION
Open Qt command line and use the commands:
qmake qwt.pro
mingw32-make
mingw32-make install
qmake -set QMAKEFEATURES "C:\Qt\qwt-6.0.0"

So the next step is to open WinXP system properties>environment variables and add:
"QT_PLUGIN_PATH = C:\Qt\qwt-6.0.0\plugins\designer"
right?
Would it be easier if I move the qwt files to the relevant places within the qt directory?
What exactly do I need to do?

Troudhyl
14th May 2011, 15:55
Isn't it qmake -set QMAKEFEATURES "C:\qwt-6.0.0\features" ? (your install folder).

Then you copy qwt.dll to %QTDIR%\bin and qwt_designer_plugin.dll to %QTDIR%\plugins\designer to have Qwt in Designer.

darkblackcorner
14th May 2011, 16:29
I'm not sure. The INSTALL file said to set it to find qwt.prf which for me is in C:\Qt\qwt-6.0.0\
That got it working for the "include" headers anyway, but no widgets available in creator UI editor.

Do you have it working? What did you do?

Troudhyl
14th May 2011, 16:43
It is the same thing in fact, because qwtconfig.pri is at the 2 places and contains absolute paths... But if you want to use qwtmathml, it is only in installfolder/features.


Then you copy qwt.dll to %QTDIR%\bin and qwt_designer_plugin.dll to %QTDIR%\plugins\designer to have Qwt in Designer.
Works for Designer but not QtCreator (I tried to do the same thing in QtCreator folder... maybe it is because of a different Qt version (4.7.1 vs 4.7.3 if you installed the QtSDK 1.1), or Qt Creator compilation ?
Edit : here it is... http://doc.qt.nokia.com/qtcreator-snapshot/adding-plugins.html#matching-build-keys

darkblackcorner
14th May 2011, 17:28
Yes, I'm using the SDK. I don't have MSVC and to be honest I'd rather just stick with Qt.
So should I start from scratch ie: install Qt, then build and install creator, then build and install qwt?

With regards to my progress installing qwt, do I just need to copy the .dll files to their respective locations, or is there more to it?

Troudhyl
14th May 2011, 17:52
Unzip Qwt to "C:\Qt\qwt-6.0.0"
Edit qwtconfig.pri: uncomment QwtExamples, comment QwtDll, set win32 install prefix to C:/qwt-$$QWT_VERSION
Open Qt command line and use the commands:
qmake qwt.pro
mingw32-make
mingw32-make install
qmake -set QMAKEFEATURES "C:/qwt-$$QWT_VERSION/features"

To add plugin to Designer:
copy C:/qwt-$$QWT_VERSION/lib/qwt.dll to %QTDIR%/bin
copy C:/qwt-$$QWT_VERSION/plugins/designer/qwt_designer_plugin.dll to %QTDIR%/plugins/designer

To add plugin to Qt Creator's Designer:
download Qt Creator sources and rebuild if it was not built with the same compiler as Qt
Copy the same things as above but in QtCreator directory instead of %QTDIR%

This should be in the INSTALL file to avoid a lot of questions... One way to configure which work and can be done by the most users, and advanced users will know if they prefer to do other.

darkblackcorner
14th May 2011, 18:01
Thanks, I'll give it a try next chance I get :)

21did21
15th May 2011, 10:58
hello, i have do this thing and now i have done one project:
http://imageshack.us/photo/my-images/688/qwttest.jpg/

this project don't work because it don't find the qwt_plot.h and others files...

==> so, i put all the qwt sources in my project and now i have this error during compilation:
http://imageshack.us/photo/my-images/42/newproblem.jpg/

can you explain me why ?

Troudhyl
15th May 2011, 11:11
Can you remove this useless copy of sources and just retype the GOOD command line to set QMAKEFEATURES (and then reboot QtCreator I think) ? Please.

Your project needs the include files, and the libs to link, that is the purpose of this command.

21did21
15th May 2011, 12:11
qmake -set QMAKEFEATURES "C:/qwt-$$QWT_VERSION/features"


this line ? i have already do this. But i still try, and i have already this error:
http://imageshack.us/photo/my-images/3/errorfco.jpg/

Troudhyl
15th May 2011, 12:23
qmake -query QMAKEFEATURES say what ? Of course you replace C:/qwt-$$QWT_VERSION/ with your install location.


Unzip Qwt to "C:\Qt\qwt-6.0.0"
Edit qwtconfig.pri: uncomment QwtExamples, comment QwtDll, set win32 install prefix to [THE-INSTALL-DIRECTORY-YOU-WANT]
Open Qt command line and use the commands:
qmake qwt.pro
mingw32-make
mingw32-make install
qmake -set QMAKEFEATURES "[THE-INSTALL-DIRECTORY-YOU-WANT]/features"

To add plugin to Designer:
copy [THE-INSTALL-DIRECTORY-YOU-WANT]/lib/qwt.dll to %QTDIR%/bin
copy [THE-INSTALL-DIRECTORY-YOU-WANT]/plugins/designer/qwt_designer_plugin.dll to %QTDIR%/plugins/designer

To add plugin to Qt Creator's Designer:
download Qt Creator sources and rebuild if it was not built with the same compiler as Qt
Copy the same things as above but in QtCreator directory instead of %QTDIR%

darkblackcorner
15th May 2011, 12:30
Try without "/features"

qmake -set QMAKEFEATURES "C:/qwt-6.0.0"
It worked for me previously.

21did21
15th May 2011, 12:35
qmake -query QMAKEFEATURES say what ?

it show:

unknows

darkblackcorner
15th May 2011, 14:17
YES! I now have qwt widgets available in designer, but not in creator for some reason... I'm guessing I can still edit UIs in designer, but I'd really like to get them in creator...

EDIT:Ok, I seem to be doing fine with designer, so I guess I'll just design my UIs there for now until I can get it added to creator. I think I just need to work out where to place the .dll files.

For future reference I've included all my steps to get it installed:

Unzip Qwt to "C:\Qt\qwt-6.0.0"
Edit qwtconfig.pri: uncomment QwtExamples, set win32 install prefix to C:/Qt/qwt-$$QWT_VERSION
Open Qt command line and use the commands:
qmake qwt.pro
mingw32-make
mingw32-make install
qmake -set QMAKEFEATURES "C:/Qt/qwt-6.0.0"

Include plugin in Designer:
copy [QWT DIRECTORY]\lib\qwt.dll to "C:\Qt\2010.05\qt\bin"
copy [QWT DIRECTORY]\plugins\designer\qwt_designer_plugin.dll to "C:\Qt\2010.05\qt\plugins\plugins\designer"

For each project add "CONFIG += qwt" in the project .pro file
Though the paths will be different depending on the locations of Qt and qwt.

Many thanks for all your help Uwe and Troudhyl!

21did21
15th May 2011, 15:29
if you find how to use QWT in the QtCreator can you explain this in this thread ?
thank you

Uwe
15th May 2011, 16:22
Unzip Qwt to "C:\Qt\qwt-6.0.0"
O.k.

Edit qwtconfig.pri: uncomment QwtExamples, set win32 install prefix to C:/Qt/qwt-$$QWT_VERSION
Uncommenting QwtExamples is only needed if you want to build the examples. For installing Qwt you don't need to do this.

Changing the install prefix is o.k., but of course not mandatory.


Open Qt command line and use the commands:
qmake qwt.pro
mingw32-make
mingw32-make install

O.k.

qmake -set QMAKEFEATURES "C:/Qt/qwt-6.0.0"

Wrong - it should be C:/Qt/qwt-6.0.0/features. Or where do you you have qwt.prf installed ?


copy [QWT DIRECTORY]\lib\qwt.dll to "C:\Qt\2010.05\qt\bin"

Very bad - use the PATH environment variable instead.

This is a basic mechanism - nothing Qt or Qwt special. If you don't know about it it's high time to learn.


copy [QWT DIRECTORY]\plugins\designer\qwt_designer_plugin.dll to "C:\Qt\2010.05\qt\plugins\plugins\designer"

Very bad - read http://doc.qt.nokia.com/4.7/deployment-plugins.html instead.


For each project add "CONFIG += qwt" in the project .pro file
O.k.

Guess the difference between designer and creator is, that you have built the designer yourself with mingw while you have downloaded a creator, that has been built by Nokia with MSVC. If true you need to recompile the creator with mingw too.

Uwe

Troudhyl
15th May 2011, 17:02
copy [QWT DIRECTORY]\lib\qwt.dll to "C:\Qt\2010.05\qt\bin"
Very bad - use the PATH environment variable instead.

This is a basic mechanism - nothing Qt or Qwt special. If you don't know about it it's high time to learn.


copy [QWT DIRECTORY]\plugins\designer\qwt_designer_plugin.dll to "C:\Qt\2010.05\qt\plugins\plugins\designer"

Very bad - read http://doc.qt.nokia.com/4.7/deployment-plugins.html instead.

Don't you think that it is useless and "very bad" for general performance, to increase the PATH just for 1 dll ? I understand when there is a lot of important things in the directory but here...
For your 2nd point, are you talking about qt.conf and QT_PLUGIN_PATH ? Again, for a Windows user, it is easier to copy/paste the dll, I don't see the disavantages of that, these 2 dll doesn't deserve to do all these efforts like studying a long English documentation and creating a lot of environment variables.

Uwe
15th May 2011, 17:17
Don't you think that it is useless and "very bad" for general performance, to increase the PATH just for 1 dll ?
No.


Again, for a Windows user, it is easier to copy/paste the dll, ...
No it isn't and in the long run you will have to pay a lot if you don't get used to organize your system in a proper way.

Uwe

darkblackcorner
15th May 2011, 21:06
Yes i did get the QMAKEFEATURE wrong there, but i did set it to the feature directory, so its an accidental ommision - sorry!