PDA

View Full Version : On QWT installing on Windows XP with open source QT SDK. Some usefull howto's.



freely
27th July 2010, 10:58
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

Lykurg
27th July 2010, 11:01
Hi pavel,

it's nice that you wrote a howto, but really, you only have to post it once, not in all forums. (Especially not in the Jobs forum) Also our wiki might be a better place for them.

Lykurg

freely
28th July 2010, 07:51
Hi man
What's wrong with placing my posts at JOBS?
Why Can't I post my messages and jobs place?
It is cool possibility to get connected with jobs providers man
How can I write at weeky?

Lykurg
28th July 2010, 08:00
What's wrong with placing my posts at JOBS?
Why Can't I post my messages and jobs place?
It is cool possibility to get connected with jobs providers man
For the jobs forum it is stated that

Here you can post your job offers.
And your post is surely no offer or job searching post. And people do read the whole forum, so normally people who post the same text in all "subforums" annoy the readers, and I think that's not what you are intending.

freely
28th July 2010, 09:01
As I've said I'm providing here more one howto
How to build attach and use to youre QT application in Qt 4.6.3 ( latest ) External serial port classes:
1. Download qextserialport-1.2win-alpha archive
2. Unpack the archive to <serport classes path>
3. Open .pro file that in the unpacked folder
4. Make it next:

PROJECT = qextserialport
TEMPLATE = lib

CONFIG += debug_and_release

CONFIG += qt
CONFIG += warn_on
CONFIG += thread

CONFIG += dll
CONFIG += staticlib

QT -= gui

OBJECTS_DIR = build/obj
MOC_DIR = build/moc
DEPENDDIR = .
INCLUDEDIR = .
HEADERS = qextserialbase.h \
qextserialport.h \
qextserialenumerator.h
SOURCES = qextserialbase.cpp \
qextserialport.cpp \
qextserialenumerator.cpp

unix:HEADERS += posix_qextserialport.h
unix:SOURCES += posix_qextserialport.cpp
unix:DEFINES += _TTY_POSIX_


win32:HEADERS += win_qextserialport.h
win32:SOURCES += win_qextserialport.cpp
win32:DEFINES += _TTY_WIN_

win32:LIBS += -lsetupapi


DESTDIR = build
DESTDIR = examples/enumerator/debug
DESTDIR = examples/qespta/debug
DESTDIR = examples/event/debug

CONFIG(debug, debug|release) {
TARGET = qextserialportd
} else {
TARGET = qextserialport
}

unix:VERSION = 1.2.0

5. build the serial port classes project assosiated with the .pro file in debug and in release mode
6. building process should produce next files: qextserialportd.dll, qextserialport.dll,libqextserialport.a in /build directory of the project
7. Each time you create new Qt project add next lines to the .pro file:

INCLUDEPATH += <serport classes path>qextserialport-1.2win-alpha
QMAKE_LIBDIR += <serport classes path>qextserialport-build-desktop\build
CONFIG(debug, debug|release):LIBS += -lqextserialportd
else:LIBS += -lqextserialport
unix:DEFINES = _TTY_POSIX_
win32:DEFINES = _TTY_WIN_

in appropriated positions in your application .pro file

8. Enjoy using RS232 with Qt
Pavel
pmazniker@gmail.com

freely
28th July 2010, 11:08
The next howto:
about using serial communication in Qt
How to Build integrated library for QSerial Device http://qt-apps.org/content/show.php/QSerialDevice?content=112039

1. Download archive with QSerialDevice classes and examples
2. unpack archive to <qserdev path>
3. open BuildIntegratedLibrary.pro, see the pro file, uncomment nessesary features in it build the project in release and debug
4. You should have in your build < build of built integrated library path> directory of previous project nessessary library files ( I've got at
C:\PavelWork\DEV\SERIAL_PORT\BuildIntegratedLibrar y-build-desktop\build\lib\qintegratedserialdevice\release\ .a format files)
5. When you are about to use the classses in your application add the next lines to you .pro project file:
INCLUDEPATH +=<qserdev path>\qserialdevice-qserialdevice\qserialdevicewatcher or another subfolder that contains nessesary classes
QMAKE_LIBDIR += < build of built integrated library path>\build\lib\qintegratedserialdevice\release
6. Use serial port communications with Qt!
Pavel
pmazniker@gmail.com

freely
28th July 2010, 11:20
Lykurg!
I've tried to post my CV at resume section of JOBS forum but it had not proceed
Please tell me why I can not post threads in resume section?
Thanks
Best regards I won't violate this forum guidelines