PDA

View Full Version : How I've setted environment in WinXP to work with Qwt in Qt Cr/Des open source lic



freely
27th July 2010, 11:54
1. Make sure you have installed >Qt 4 open source edition on you computer in <qt path> Download qwt archive with source codes
2. Unpack archive to <path of unpacked qwt >
3. Open qwt.pro in Qt Creator
4. edit configuration qwtconfig.pri file, make it next:


################################################## ####################
# Install paths
################################################## ####################

VER_MAJ = 5
VER_MIN = 2
VER_PAT = 1
VERSION = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}

unix {
INSTALLBASE = /usr/local/qwt-5.2.1
}

win32 {
INSTALLBASE = C:\Qwt-5.2.1
}

target.path = $$INSTALLBASE/lib
headers.path = $$INSTALLBASE/include
doc.path = $$INSTALLBASE/doc

################################################## ####################
# qmake internal options
################################################## ####################

CONFIG += qt # Also for Qtopia Core!
CONFIG += warn_on
CONFIG += thread
CONFIG += silent

################################################## ####################
# release/debug mode
# If you want to build both DEBUG_SUFFIX and RELEASE_SUFFIX
# have to differ to avoid, that they overwrite each other.
################################################## ####################

VVERSION = $$[QT_VERSION]
isEmpty(VVERSION) {

# Qt 3
CONFIG += release # release/debug
}
else {
# Qt 4
win32 {
# On Windows you can't mix release and debug libraries.
# The designer is built in release mode. If you like to use it
# you need a release version. For your own application development you
# might need a debug version.
# Enable debug_and_release + build_all if you want to build both.

#CONFIG += release # release/debug/debug_and_release
CONFIG += debug_and_release
CONFIG += build_all
}
else {
CONFIG += release # release/debug
}
}

################################################## ####################
# If you want to have different names for the debug and release
# versions you can add a suffix rule below.
################################################## ####################

DEBUG_SUFFIX =
RELEASE_SUFFIX =

win32 {
DEBUG_SUFFIX = d
}

################################################## ####################
# Build the static/shared libraries.
# If QwtDll is enabled, a shared library is built, otherwise
# it will be a static library.
################################################## ####################

CONFIG += QwtDll

################################################## ####################
# QwtPlot enables all classes, that are needed to use the QwtPlot
# widget.
################################################## ####################

CONFIG += QwtPlot

################################################## ####################
# QwtWidgets enables all classes, that are needed to use the all other
# widgets (sliders, dials, ...), beside QwtPlot.
################################################## ####################

CONFIG += QwtWidgets

################################################## ####################
# If you want to display svg imageson the plot canvas, enable the
# line below. Note that Qwt needs the svg+xml, when enabling
# QwtSVGItem.
################################################## ####################

CONFIG += QwtSVGItem

################################################## ####################
# You can use the MathML renderer of the Qt solutions package to
# enable MathML support in Qwt. # If you want this, copy
# qtmmlwidget.h + qtmmlwidget.cpp to # textengines/mathml and enable
# the line below.
################################################## ####################

#CONFIG += QwtMathML

################################################## ####################
# If you want to build the Qwt designer plugin,
# enable the line below.
# Otherwise you have to build it from the designer directory.
################################################## ####################

CONFIG += QwtDesigner

################################################## ####################
# If you want to auto build the examples, enable the line below
# Otherwise you have to build them from the examples directory.
################################################## ####################

#CONFIG += QwtExamples


5. build qwt project opened in QtCreator in release mode. Check that you have next libraries files in
directory:
<path of unpacked qwt>\qwt-5.2.1\qwt-5.2.1\lib\
files:
libqwt5.a,libqwt5d.a,qwt5.dll,qwt5d.dll l

with d at end of file name for debug and without d for release
directory:
<qwt path>\qwt-5.2.1\qwt-5.2.1\designer\plugins\designer\

files:
qwt_designer_plugin5.dll

6. add next environment variables
PATH:<path of unpacked qwt>\qwt-5.2.1\qwt-5.2.1\lib;<qt path>\2010.04\mingw\bin;<qt path>\2010.04\mingw\lib;<qt path>\2010.04\bin;<qt path>\2010.04\qt\bin;<qt path>\2010.04\qt\lib
QWTDIR
<path of unpacked qwt>\qwt-5.2.1\qwt-5.2.1\lib

7. copy next files to next directories:

to <qt path>\2010.04\bin\ copy qwt5.dll,qwt5d.dll,qwt_designer_plugin.dll
to <qt_path>\bin\designer\ copy qwt_designer_plugin5.dll
to <qt_path>\lib\qtcreator\plugins\Nokia\ copy qwt5.dll,qwt5d.dll,qwt_designer_plugin.dll

to <qt path>\2010.04\qt\bin\ copy qwt5.dll,qwt5d.dll,qwt_designer_plugin.dll libqwt5.a,libqwt5d.a

to <qt path>\qt\lib\ copy libqwt5.a,libqwt5d.a ,qwt_designer_plugin.dll

to <qt path>\qt\plugins\designer\ copy ibqwt5.a,libqwt5d.a ,qwt_designer_plugin.dll wt5.dll,qwt5d.dll

run install.exe in <qt path>\2010.04\qt\

8. reopen QtDesigner make shure you see additional widgets in left widgets panel

9. When you'll create new project with use of QWT library you must add in pro file next
rows:
for debug mode:
INCLUDEPATH += <qwt path>\qwt-5.2.1\qwt-5.2.1\src
LIBS += <qwt path>\qwt-5.2.1\qwt-5.2.1\lib\libqwtd5.a
or
for release mode:
INCLUDEPATH += <qwt path>\qwt-5.2.1\qwt-5.2.1\src
LIBS += <qwt path>\qwt-5.2.1\qwt-5.2.1\lib\libqwt5.a

10. You can build and use applications based on QWT widgets

Next time I'll write also how to install qtextserialport classes and use them with QWT in QT
Pavel Mazniker
pmazniker@gmail.com