QT5 -- remove old qwt
6
qwt/.gitignore
vendored
@@ -1,6 +0,0 @@
|
||||
lib
|
||||
qwtconfig.pri
|
||||
*.so
|
||||
moc*.cpp
|
||||
*.obj
|
||||
*.o
|
||||
510
qwt/CHANGES
@@ -1,510 +0,0 @@
|
||||
Release 6.0.1
|
||||
===================
|
||||
|
||||
Changes
|
||||
-------
|
||||
1) Incompatibilities with Qt < 4.6.1 fixed
|
||||
2) Reduce warnings with pedantic compiler options
|
||||
3) Examples fixed
|
||||
4) Legend identifiers of with symbol and line fixed
|
||||
|
||||
Release 6.0.0
|
||||
===================
|
||||
|
||||
Changes
|
||||
-------
|
||||
1) Qt3 support dropped
|
||||
2) QwtPlot layout/render code ported from int to double
|
||||
Exported/printed documents in scalable formats like SVG or PDF
|
||||
are 100% scalable now.
|
||||
3) Template base classes introduced for curve and curve data
|
||||
to be reusable in all plot items displaying series of samples.
|
||||
4) New plot items
|
||||
- QwtPlotHistogram
|
||||
- QwtPlotIntervalCurve ( error bars or displaying the area between 2 curves )
|
||||
- QwtPlotSpectroCurve ( mapping the z value to a color )
|
||||
5) Raster items
|
||||
- QwtMatrixRasterData introduced
|
||||
- More accurate rendering
|
||||
- Several API changes
|
||||
- Thread support for rendering spectrograms
|
||||
6) QwtPlot::print moved to QwtPlotRenderer
|
||||
7) Other new classes
|
||||
QwtColumnSymbol
|
||||
QwtDoublePoint3D
|
||||
QwtIntervalSymbol
|
||||
QwtPlotDirectPainter
|
||||
QwtSamplingThread
|
||||
QwtSystemClock
|
||||
8) QwtPicker and friends reorganized,
|
||||
QwtPickerTrackerMachine added for displaying a rubberband for
|
||||
mouse moves. Enter/Leave added to events, that are handled
|
||||
by the picker machines.
|
||||
9) QwtScaleWidget::LayoutFlag added
|
||||
Introduced to control the direction of vertical axis titles.
|
||||
10)QwtWeedingCurveFitter added
|
||||
QwtWeedingCurveFitter is an implementation of the Douglas/Peuker
|
||||
algorithm, that can be used to reduce the number of curve points.
|
||||
It can be very useful to improve the performance of painting
|
||||
curves of many lines ( f.e. by implementing different level of details ).
|
||||
11)Legend code update for representing different pixmaps for different
|
||||
types of plot items.
|
||||
12)Copy operators removed, using pointers instead
|
||||
13)QwtPolarPoint from qwtpolar added
|
||||
14)QwtThermo
|
||||
Optional QwtColorMaps added
|
||||
15)Interfaces and code of all sliders/dials cleaned up.
|
||||
QApplication::globalStrut(), styled backgrounds ...
|
||||
|
||||
|
||||
Release 5.2.2
|
||||
===================
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
1) QwtSplineCurveFitter
|
||||
Rounding to integers values removed
|
||||
2) QwtPlot
|
||||
initial size of 200x200
|
||||
3) QwtPlotPrintFilter, QwtPlot::print
|
||||
handling of background color in QwtPlot::print
|
||||
4) QwtPlotPrintFilter
|
||||
Problem with colored plot titles fixed
|
||||
5) QwtPlotItem
|
||||
Crash fixed, when changing the z order of attached items
|
||||
6) QwtLinearScaleEngine, QwtLog10ScaleEngine
|
||||
Several minor fixes
|
||||
|
||||
Release 5.2.1
|
||||
===================
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
1) Export declarations removed from qwt_valuelist.h to avoid
|
||||
compiler errors with Qt 4.6 + certain compilers on Windows.
|
||||
2) QwtScaleDraw
|
||||
Wrong border dist hints for unregular scale divisions fixed
|
||||
Layout calculation for the tick labels fixed.
|
||||
The layout was wrong by 1 pixel for top/left/bottom axes.
|
||||
On a left axis without a title the labels were sometimes cut off.
|
||||
3) QwtPainter
|
||||
Splits polylines for all pens to avoid a bottleneck of the
|
||||
raster paint engine.
|
||||
4) QwtScaleWidget
|
||||
Calculation of the colorbar position fixed ( spacing/margin )
|
||||
5) QwtPlotCurve
|
||||
Wrong clipping rect fixed
|
||||
6) QwtPicker
|
||||
QwtPicker::setTrackerFont() fixed.
|
||||
Recursion on the Mac, when constructing the rubberband fixed.
|
||||
Workaround for a Qt3 bug added that is responsible for left aligning
|
||||
all tracker texts to the canvas.
|
||||
|
||||
Changes
|
||||
-------
|
||||
1) Project files adopted for symbian
|
||||
2) qwt.pro
|
||||
CONFIG += ordered added for using make -j
|
||||
CONFIG += silent added
|
||||
|
||||
Release 5.2.0
|
||||
===================
|
||||
|
||||
Changes
|
||||
-------
|
||||
1) Ported to Qt 4.5.x
|
||||
2) Scaling of non cosmetic pens (for printing to devices in high resolution)
|
||||
3) Clipping of polygons for SVG rendering
|
||||
4) QwtRect removed
|
||||
use QwtClipper instead
|
||||
5) QwtPlotRescaler
|
||||
Introduced
|
||||
6) QwtDoubleInterval
|
||||
BorderMode introduced
|
||||
7) QwtPlotCurve
|
||||
Performance of incremental curve painting ( = draw(from, to) ) improved.
|
||||
8) QwtLegendItem
|
||||
setIdentfierMode renamed to setIdentifierMode
|
||||
9) QwtPlotCanvas::replot() introduced
|
||||
code from QwtPlot::replot shifted
|
||||
10)QwtPlot
|
||||
drawCanvas(), updateAxes() changed from protected to public
|
||||
11)QwtScaleEngine
|
||||
loMargin/hiMargin renamed to lowerMargin/upperMargin
|
||||
12)QwtScaleDiv
|
||||
lBound/hBound renamed to lowerBound/upperBound
|
||||
13)QwtSpline
|
||||
cofficientA/B/C introduced
|
||||
14)QwtDial
|
||||
counter clockwise scales introduced
|
||||
15)QwtPlotMarker
|
||||
Vertical text labels
|
||||
16)doc/qwt-5.2.0.qch added foe browsing the Qwt docs in the Qt assistant
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
1) QwtLinearScaleEngine
|
||||
Rounding problems fixed
|
||||
2) Again some print layout problems fixed
|
||||
3) QwtPlotScaleItem: 1 pixel offset fixed
|
||||
4) QwtPlotSpectrogram, clipping of contour lines
|
||||
against the bounding rect
|
||||
5) QwtPlotZoomer::setZoomStack for stacks with unlimited depth
|
||||
6) Printing of rotated tick labels
|
||||
|
||||
|
||||
Release 5.1.1
|
||||
===================
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
1) Several compiler incompatibilities fixed
|
||||
2) DBL_EPSILON removed
|
||||
Using DBL_EPSILON in the calculations of the dials/sliders and the
|
||||
scale engines leads to problems with the inaccuracy of floating points.
|
||||
The behaviour has been reverted to 5.0.x.
|
||||
3) QwtSlider/QwtKnob
|
||||
setScaleDraw() fixed.
|
||||
4) QwtRect
|
||||
Pointless private declaration removed
|
||||
|
||||
Release 5.1.0
|
||||
===================
|
||||
|
||||
Changes
|
||||
-------
|
||||
1) QwtSymbol::copy introduced
|
||||
Now it is possible to use derived symbol classes for curves
|
||||
2) QwtPlotScaleItem introduced
|
||||
A new type of plot item for displaying axes on the canvas
|
||||
3) QwtClipper added
|
||||
A collection of clipping algos
|
||||
4) Using DBL_EPSILON
|
||||
This change allows smaller intervals for sliders/dials
|
||||
5) QwtPanner
|
||||
setOrientation() added.
|
||||
6) QwtPlot
|
||||
axisStepSize() added
|
||||
clear is virtual now
|
||||
7) QwtPlotPrintFilter
|
||||
PrintCanvasBackground splitted into PrintBackground, PrintFrameWithScales
|
||||
8) QwtPlotZoomer
|
||||
setZoomStack() added
|
||||
9) Changes for the QwtPolar package
|
||||
QwtLegendItemManager introduced
|
||||
QwtMagnifier introduced
|
||||
10)Suffix rules added in qwtconfig.pri for different targets for
|
||||
debug/release builds.
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
1. QwtAbstractScaleDraw::setAbstractScaleDraw
|
||||
Reinitialization problem fixed
|
||||
2. QwtLegendItem
|
||||
key event handlers fixed
|
||||
3. QwtPicker
|
||||
solaris-cc compiler problem fixed
|
||||
4. Inaccurate mapping of scale to widget coordinates fixed
|
||||
5. QwtPlotCurve::draw
|
||||
Updates for Qt 4.3 added
|
||||
6. QwtPlotLayout
|
||||
AlignToCanvas layout calculation fixed
|
||||
7. QwtPlot::print
|
||||
Workaround for a QPen initialization problem,
|
||||
when printing to Pdf, added
|
||||
8. QwtText
|
||||
Layout of rich text documents fixed
|
||||
9. Designer
|
||||
Handling of QwtScaleWidget fixed
|
||||
10. realtime example
|
||||
Qt::WA_PaintOutsidePaintEvent added, ScrollZoomer fixed
|
||||
11. Several others I have forgotten
|
||||
|
||||
Release 5.0.2
|
||||
===================
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
1. QwtPlotCurve::Xfy curve type fixed
|
||||
2. Memory leak in QwtLegend fixed
|
||||
3. Vertical alignment of rich texts fixed
|
||||
4. Workaround for a Qt4 bug added, that produces horrible performance
|
||||
when painting curves with a pen width > 1.
|
||||
5. Background for the tracker text of QwtPickers fixed.
|
||||
Improved (faster + better rendered texts) implementation of
|
||||
painting tracker texts, using capabilities of Qt >= 4.3.
|
||||
6. QwtArrowButton/QwtCounter: workaround for layout bug ( Qt < 4.3 )
|
||||
of the Cleanlook style added.
|
||||
7. A couple of minor fixes
|
||||
|
||||
Changes
|
||||
-------
|
||||
1. QSvgGenerator added to the bode example
|
||||
|
||||
Release 5.0.1
|
||||
===================
|
||||
|
||||
Changes
|
||||
-------
|
||||
1. A couple of problems, when building Qwt fixed.
|
||||
2. Displaying Rich Text with Qt 4.x fixed
|
||||
|
||||
Release 5.0.0
|
||||
===================
|
||||
|
||||
Platforms
|
||||
---------
|
||||
Support of Qt3 and Qt4. Qt2 is not supported any longer.
|
||||
|
||||
Key features
|
||||
------------
|
||||
1. Redesign of plot items. Makes it much easier to develop
|
||||
individual items.
|
||||
2. Redesign of the scale classes. All calculations are
|
||||
collected in scale engines, where the application can
|
||||
implement it´s own (f.e log2, or date scales). Now it´s
|
||||
also possible to have individual and completely irregular scales
|
||||
3. Redesign of the QwtText classes. The MathML renderer of
|
||||
the Qt4 solutions package is embedded.
|
||||
work for all expressions/situations.
|
||||
4. New classes for navigating: QwtPanner, QwtMaginfier
|
||||
5. Spectrogram/Contour plots and other classes for displaying
|
||||
raster data added.
|
||||
|
||||
Changes
|
||||
-------
|
||||
5.0.0 is by far the release with the most changes in the history of Qwt
|
||||
- too many to make list.
|
||||
|
||||
|
||||
Release 4.2.0/0.4.2
|
||||
===================
|
||||
|
||||
License
|
||||
--------
|
||||
A couple of exceptions to the LGPL with the intention to allow static
|
||||
linking with commercial applications. See COPYING.
|
||||
|
||||
Key features:
|
||||
-------------
|
||||
1. Designer plugin
|
||||
2. Rich Text support ( f.e. E = m * c<sup>2</sup> ) added.
|
||||
3. QwtDial class family added (QwtDial, QwtCompass, QwtAnalogClock, ...)
|
||||
4. QwtPicker class family added. Includes QwtPlotZoomer, a complete
|
||||
implementation of recursive zooming.
|
||||
5. Device metrics independent printing of QwtPlot. (QPrinter::HighResolution)
|
||||
6. QwtPlot::setCurveBrush(), QwtCurve::setBrush() added. The area
|
||||
between curve and baseline will be filled with this brush.
|
||||
7. Rotation of axis tick labels added. Very useful for axis with long
|
||||
labels like time scales ...
|
||||
8. Added a new abstract QwtData class to plot data from almost any type of
|
||||
container class.
|
||||
9. QwtDoublePoint, QwtDoubleSize, QwtDoubleRect double counterparts
|
||||
for QPoint, QSize, QRect.
|
||||
10. First steps to support Qtopia. All examples can be compiled and started
|
||||
in the qvfb emulator.
|
||||
|
||||
|
||||
Changes:
|
||||
---------
|
||||
1. Rewrite of QwtLegend/QwtLegendItem (no QTable anymore)
|
||||
2. Each plot item will be painted, even if one of the axis it is
|
||||
attached to is disabled. (like in all other releases beside 0.4.1)
|
||||
3. Code for double buffering moved to a new class QwtPaintBuffer.
|
||||
Double buffering can be enabled/disabled now.
|
||||
4. QwtPainter, QwtMetricsMap, QwtLayoutMetrics added
|
||||
Hide paint device metrics dependencies.
|
||||
5. Layout code rewritten and moved to a new class QwtPlotLayout
|
||||
New layout options canvasMargin(), alignCanvasToScales()
|
||||
6. QwtPlot: sizeHint() != minimumSizeHint()
|
||||
9. Internal plot data are private again. A couple of get methods
|
||||
added instead.
|
||||
10. canvas repaints triggered by paint events. Enables event filtering
|
||||
11. QwtPlot::drawCanvasItems added. In opposite to QwtPlot::drawCanvas
|
||||
it is used by the printing code too.
|
||||
12. qwtMax, qwtMin, qwtInt mapped to QMAX, QMIN, qRound from qglobal.h
|
||||
13. operator= for plot item classes changed.
|
||||
14. readOnly property added for sliders.
|
||||
15. valid flag added for QwtDblRange
|
||||
16. QwtCounter wrap around policy: a counter under- or overflow sets
|
||||
focus to the smallest up/down button and disables counting.
|
||||
A space bar keypress release event re-enables counting.
|
||||
17. QwtPushButton added. A class that adds rich text and alignments
|
||||
features to QPushButton, like they are used in QLabel
|
||||
18. Clipped painting code moved from QwtCurve to QwtPainter/QwtRect
|
||||
19. Canvas cache added to optimize trivial repaints.
|
||||
20. QwtPlot::drawCurve added for incremental curve data
|
||||
21. QwtSliderBase, readOnly, isValid added
|
||||
22. Added filtering of the colors of the title and scales to QwtPrintFilter.
|
||||
23. Support of QT_NO_CAST_ASII and QT_NO_COMPAT added
|
||||
24. Batch file added for generating Visual Studio project files
|
||||
25. QwtPlotCurve, QwtPlotMarker, QwtPlotGrid: more methods public
|
||||
26. QwtPlot::setLegendPosition added
|
||||
27. A lot of changes I don't remember, ... sorry.
|
||||
|
||||
Bugfixes:
|
||||
---------
|
||||
1. Autodetection of painter redirection. QPixmap::grabWidget() works
|
||||
with Qwt Widgets again.
|
||||
2. QwtSlider: Rounding double->int conversions instead of simple casts.
|
||||
3. Bad additional line, connected to the first curve point, when zooming
|
||||
deep, fixed.
|
||||
4. QwtMarker: Painting of symbols with width != height fixed
|
||||
5. QwtPlot::plotMouseXXX/canvasMap pixel coordinates synced.
|
||||
Now both include the canvas frame.
|
||||
6. Layout fixed for QwtScaleDraws without tick labels
|
||||
8. Tab focus chains fixed, focus indications added.
|
||||
9. Support QwtAutoScale::Inverted when autoScale is off also.
|
||||
10. Keyboard control, focus indications added.
|
||||
11. Improved QStyle awareness.
|
||||
12. Printing of plots with disabled axes
|
||||
|
||||
Examples
|
||||
--------
|
||||
1. New example linux/cpustat added. Runs also on non linux boxes
|
||||
with dummy values. Beside showing a couple of features that
|
||||
are new with 0.4.1 and 0.4.2, it shows how to extend and customize
|
||||
a QwtPlots.
|
||||
2. Added new example event_filter to demonstrate event filtering.
|
||||
This example shows how to add additional controls to the scales,
|
||||
how to translate mouse clicks on the scales into signals and
|
||||
how to move points on the canvas.
|
||||
3. realtime example shows how to use scrollbars when zooming
|
||||
|
||||
Release 0.4.1
|
||||
============
|
||||
|
||||
Changes:
|
||||
---------
|
||||
1. Platform independent project files. makefiles directory removed.
|
||||
2. RPM spec file template added.
|
||||
3. __declspec formalism added for Win32 DLLs. Requires
|
||||
'DEFINES += QWT_DLL' in the .pro file.
|
||||
4. QString used for visible texts.
|
||||
5. Code for error curves removed. These type of features should be
|
||||
implemented in derived curve classes.
|
||||
6. A lot of Qt 1.2 related code removed/replaced.
|
||||
7. QwtColorFilter, QwtPixFrame removed. QwtPlotPixFrame renamed
|
||||
to QwtPlotCanvas.
|
||||
8. qmodules.h aware. Skips QwtLegend in case of !QT_MODULE_TABLE
|
||||
9. All Widgets including QwtPlot optimized to reduce flicker
|
||||
during resize/repaint.
|
||||
10. QwtPlot curves/markers can be disabled/enabled to hide/show individual
|
||||
curves without removing the curves from the plot.
|
||||
11. Internal maps removed from QwtCurve. QwtCurve::setMap, QwtCurve::setRect,
|
||||
QwtCurve::setRange removed.
|
||||
|
||||
Feature additions:
|
||||
------------------
|
||||
1. Printing
|
||||
QwtPlot::print prints to any type of QPaintDevice now.
|
||||
Hardcoded printer attributes margin, creator and document title have
|
||||
been removed and must/can be set by the applications now.
|
||||
Printing of background and legends added. QwtColorFilter replaced
|
||||
by QwtPlotPrintFilter.
|
||||
2. Layout
|
||||
Many layout fixes and additions. Now all Widgets behave well in
|
||||
QLayouts and provide sensible sizeHints. QwtPlot::setMargin(int) added.
|
||||
Fieldwidth added for QwtPlot::setAxisFormat for application that need
|
||||
range independent width. Title and axis title are Qt:Alignment aware.
|
||||
Qt::WordBreak or multiline titles are possible.
|
||||
3. Legend
|
||||
En/Disabling of single curves in the legend added.
|
||||
QwtPlot::setAutoLegend added.
|
||||
4. Extensibility
|
||||
QwtPlot::insertCurve + QwtPlot::insertMarker added. Now derived
|
||||
classes of QwtPlotCurve and QwtPlotMarker can be added. Virtual
|
||||
methods provided by QwtPlotCurve for sub-classing.
|
||||
QwtScale::setScaleDraw + QwtPlot::setAxisScaleDraw + some virtual
|
||||
methods for QwtScaleDraw added. Application can implement individual
|
||||
axis labels now.
|
||||
5. Sliders
|
||||
QWheelEvent added. The MouseWheel stepsize is controlled by the
|
||||
Scroll Page Size. QwtWheel::setWheelWidth added. QwtKnob::setSymbol,
|
||||
QwtKnob::symbol added.
|
||||
|
||||
Bugfixes:
|
||||
---------
|
||||
1. Workaround for spontanous curves resulting from overruns
|
||||
when zooming too deep.
|
||||
2. Wrong QColorGroup::ColorRole for background colors fixed.
|
||||
Necessary for several non default QStyles.
|
||||
3. QwtWheel fixed for vertical wheels. Better color support.
|
||||
4. QwtSlider fixed.
|
||||
5. Many forgotten others
|
||||
|
||||
Release 0.4.0
|
||||
============
|
||||
|
||||
Bugfixes:
|
||||
---------
|
||||
1. A few occurences of the boolean literal \c false were changed into macro
|
||||
\c FALSE for cross compiler compatibility.
|
||||
2. A few local variables in member functions were renamed to suppress
|
||||
warnings issued by really picky compilers about global/class variables
|
||||
being hidden.
|
||||
3. In qwt_legend.h, a fully qualified name was used in a class declaration.
|
||||
The HPUX compiler chokes on this (and it's ugly), so it was fixed.
|
||||
4. Macro M_2PI is now only defined is this hasn't already been done by the
|
||||
system's clib.
|
||||
|
||||
Feature additions:
|
||||
------------------
|
||||
1. Qwt now works with Qt3.0. In order to achieve this, QwtLegend now no
|
||||
longer derives from QTableView, but from QTable. This seems to have had
|
||||
quite a few consequences. Kudo's to Uwe Rathmann for uploading this nice
|
||||
fix to the CVS tree.
|
||||
2. Getters for a plot's title and title font have been added.
|
||||
|
||||
Release 0.3.0
|
||||
============
|
||||
|
||||
License:
|
||||
--------
|
||||
1. The license has changed from GPL to LGPL.
|
||||
|
||||
Bugfixes:
|
||||
---------
|
||||
1. The makefiles for win32 caused object files to have extension .o instead of
|
||||
.obj. The 'propagate' file was changed to fix this, using tmake's target
|
||||
platform flag.
|
||||
2. There were problems with rint() on win32 platforms. rint() is a BSD call,
|
||||
not even available on all unices. All calls to rint(x) have been replaced
|
||||
by floor(x+.5).
|
||||
3. Some static class data members were initialized with the value of other
|
||||
static class data members (from Qt). This caused programs depend on the
|
||||
initialization order of class members. This is now fixed by replacing the
|
||||
static properties by static signleton factories.
|
||||
4. When a plot was zoomed and then printed, curves and markers laying outside
|
||||
the plot's scale were still printed. The print() function now uses clipping.
|
||||
|
||||
Feature additions:
|
||||
------------------
|
||||
1. Multi-line plot titles are now supported: the PostScript document name is
|
||||
not the plot title, with "\n" characters replaced by "--". Geometry
|
||||
management has been changed to support multi-line titles.
|
||||
2. In the mailinglist, there were often feature requests for features that
|
||||
were in fact implemented, but not available through QwtPlot's API. Many
|
||||
private members have been made protected or even public, to give users
|
||||
more control. This is poor design, but Qwt will be refactored anyway.
|
||||
3. Qwt always displayed floats with 5 digits. This was insufficient for many
|
||||
applications. QwtPlot, QwtScale, QwtAutoScale got some methods to set the
|
||||
label format. This is a printf like format for the numbers at the scales,
|
||||
consisting of 'f' and a precision, or 'g' and the significance.
|
||||
|
||||
Build system:
|
||||
-------------
|
||||
1. The 'makefiles' directory was removed from the cvs tree, and is now only
|
||||
generated for releases. CVS users should have tmake installed, to generate
|
||||
the makefiles themselves.
|
||||
2. The 'examples' directory now uses tmake's 'subdirs' template, to iterate
|
||||
over all subdirectories and build all examples with one command. There was
|
||||
allready a makefile for this, but now the process is automated by tmake.
|
||||
3. Under unix, the library now gets a proper version number. Current version
|
||||
is 0.3.0.
|
||||
|
||||
Documentation:
|
||||
--------------
|
||||
1. All documentation is converted to the Doxygen documentation system. The
|
||||
release contains two settings files, 'Doxygen' and 'Doxygen.users',
|
||||
generating a developer's and user's manual, respectively.
|
||||
543
qwt/COPYING
@@ -1,543 +0,0 @@
|
||||
Qwt License
|
||||
Version 1.0, January 1, 2003
|
||||
|
||||
The Qwt library and included programs are provided under the terms
|
||||
of the GNU LESSER GENERAL PUBLIC LICENSE (LGPL) with the following
|
||||
exceptions:
|
||||
|
||||
1. Widgets that are subclassed from Qwt widgets do not
|
||||
constitute a derivative work.
|
||||
|
||||
2. Static linking of applications and widgets to the
|
||||
Qwt library does not constitute a derivative work
|
||||
and does not require the author to provide source
|
||||
code for the application or widget, use the shared
|
||||
Qwt libraries, or link their applications or
|
||||
widgets against a user-supplied version of Qwt.
|
||||
|
||||
If you link the application or widget to a modified
|
||||
version of Qwt, then the changes to Qwt must be
|
||||
provided under the terms of the LGPL in sections
|
||||
1, 2, and 4.
|
||||
|
||||
3. You do not have to provide a copy of the Qwt license
|
||||
with programs that are linked to the Qwt library, nor
|
||||
do you have to identify the Qwt license in your
|
||||
program or documentation as required by section 6
|
||||
of the LGPL.
|
||||
|
||||
|
||||
However, programs must still identify their use of Qwt.
|
||||
The following example statement can be included in user
|
||||
documentation to satisfy this requirement:
|
||||
|
||||
[program/widget] is based in part on the work of
|
||||
the Qwt project (http://qwt.sf.net).
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
164
qwt/INSTALL
@@ -1,164 +0,0 @@
|
||||
Introduction
|
||||
============
|
||||
|
||||
Qwt uses qmake to build all its components and examples.
|
||||
qmake is part of a Qt distribution.
|
||||
|
||||
qmake reads project files, that contain the options and rules how to
|
||||
build a certain project. A project file ends with the suffix "*.pro".
|
||||
Files that end with the suffix "*.pri" are included by the project
|
||||
files and contain definitions, that are common for several project files.
|
||||
|
||||
qwtconfig.pri and qwtbuild.pri are read by all project files of the Qwt
|
||||
package. qwtconfig.pri is also read by qwt.prf, when building your
|
||||
application. So the first step is to edit the *.pri files to adjust
|
||||
them to your needs.
|
||||
|
||||
The subdirs template of qmake is known to be buggy when using spaces
|
||||
in path names. So better don't build Qwt below a path name with spaces.
|
||||
( Otherwise you might have to run qmake in all subdirs manually ).
|
||||
|
||||
Documentation
|
||||
==========================
|
||||
|
||||
Qwt includes a class documentation, that is available in various formats:
|
||||
|
||||
- Html files
|
||||
- PDF document
|
||||
- Qt Compressed Help (*.qch ) for the Qt assistant or creator.
|
||||
You can load it "Edit Preferences" -> "Documentation" -> "Add..."
|
||||
- Man pages ( UNIX only )
|
||||
|
||||
Building Qwt
|
||||
==========================
|
||||
|
||||
The easiest way to build Qwt is from the command line - but you insist on
|
||||
using an IDE don't forget the "make install" step.
|
||||
|
||||
A) Unix
|
||||
--------
|
||||
|
||||
qmake
|
||||
make
|
||||
make install
|
||||
|
||||
If you have installed a shared library it's path has to be known to
|
||||
the run-time linker of your operating system. On Linux systems read
|
||||
"man ldconfig" ( or google for it ). Another option is to use
|
||||
the LD_LIBRARY_PATH (on some systems LIBPATH is used instead, on MacOSX
|
||||
it is called DYLD_LIBRARY_PATH) environment variable.
|
||||
|
||||
If you only want to check the Qwt examples without installing something,
|
||||
you can set the LD_LIBRARY_PATH to the lib directory
|
||||
of your local build.
|
||||
|
||||
If you didn't enable autobuilding of the examples in qwtconfig.pri
|
||||
you have to build the examples this way:
|
||||
|
||||
cd examples
|
||||
qmake
|
||||
make
|
||||
|
||||
|
||||
B) Win32/MSVC
|
||||
--------
|
||||
|
||||
Check that your Qt version has been built with MSVC - not with MinGW !
|
||||
|
||||
Please read the qmake documentation how to convert
|
||||
your *.pro files into your development environment.
|
||||
|
||||
F.e MSVC with nmake:
|
||||
qmake qwt.pro
|
||||
nmake
|
||||
nmake install
|
||||
|
||||
If you didn't enable autobuilding of the examples in qwtconfig.pri
|
||||
you have to build the examples this way:
|
||||
|
||||
cd examples
|
||||
qmake examples.pro
|
||||
nmake
|
||||
|
||||
Windows doesn't like mixing of debug and release binaries. Most
|
||||
of the problems with using the Qwt designer plugin are because
|
||||
of trying to load a Qwt debug library into a designer release
|
||||
executable.
|
||||
|
||||
It's not possible to load a plugin, that has been built with MinGW
|
||||
into a Qt Designer/Creator, that has been built with MSVC ( and v.v ).
|
||||
This is a common reason for problems, when working with prebuild
|
||||
binaries of the Qt Creator.
|
||||
|
||||
C) Win32/MinGW
|
||||
--------
|
||||
|
||||
Check that your Qt version has been built with MinGW - not with MSVC !
|
||||
|
||||
Start a Shell, where Qt4 is initialized. ( F.e. with
|
||||
"Programs->Qt by Trolltech ...->Qt 4.x.x Command Prompt" ).
|
||||
Check if you can execute "make" or something like "mingw32-make".
|
||||
|
||||
qmake qwt.pro
|
||||
make
|
||||
make install
|
||||
|
||||
If you didn't enable autobuilding of the examples in qwtconfig.pri
|
||||
you have to build the examples this way:
|
||||
|
||||
cd examples
|
||||
qmake examples.pro
|
||||
make
|
||||
|
||||
Windows doesn't like mixing of debug and release binaries. Most
|
||||
of the problems with using the Qwt designer plugin are because
|
||||
of trying to load a Qwt debug library into a designer release
|
||||
executable.
|
||||
|
||||
Don't forget to tell qmake where to find qwt.prf:
|
||||
qmake -set QMAKEFEATURES ...
|
||||
|
||||
D) MacOSX
|
||||
--------
|
||||
|
||||
Well, the Mac is only another Unix system. So read the instructions in A).
|
||||
|
||||
In the recent Qt4 releases the default target of qmake is to generate
|
||||
XCode project files instead of makefiles. So you might need to do the
|
||||
following:
|
||||
|
||||
qmake -spec macx-g++
|
||||
...
|
||||
|
||||
D) Qt Embedded
|
||||
--------
|
||||
|
||||
I only tested Qwt with Qt Embedded in qvfb (Virtual Framebuffer Devivce)
|
||||
Emulator on my Linux box. To build Qwt for the emulator was as simple as
|
||||
for a regular Unix build.
|
||||
|
||||
F) Symbian
|
||||
--------
|
||||
|
||||
I never tried this platform myself.
|
||||
|
||||
Using Qwt
|
||||
===========
|
||||
|
||||
For building a Qwt application with qmake use the Qwt configuration features
|
||||
file, that has been installed by "make install". When qmake is able to find
|
||||
it ( http://doc.qt.nokia.com/4.7/qmake-advanced-usage.html#adding-new-configuration-features )
|
||||
you can simply add "CONFIG += qwt" to your application project file.
|
||||
|
||||
If you don't use qmake you have to add the include path to find the Qwt
|
||||
headers to your compiler flags and the Qwt library to your linker list.
|
||||
Don't forget to add QWT_DLL to the compiler flags, when you work with a
|
||||
Qwt-DLLs on Windows.
|
||||
|
||||
For using the designer plugin you have to configure the Qt designer/creator
|
||||
where to look for plugins. This can be done by setting the QT_PLUGIN_PATH or
|
||||
using a qt.conf file ( see http://doc.qt.nokia.com/4.7/deployment-plugins.html ).
|
||||
Beside the plugin the Qwt library itsself also needs to be known to the Designer/Creator
|
||||
( see LD_LIBRARY_PATH, PATH ... above ).
|
||||
|
||||
Good luck !
|
||||
33
qwt/README
@@ -1,33 +0,0 @@
|
||||
|
||||
The Qwt Widget Library
|
||||
----------------------
|
||||
|
||||
Qwt is an extension to the Qt GUI library from Troll Tech AS.
|
||||
The Qwt library contains widgets and components which are
|
||||
primarily useful for technical and scientifical purposes.
|
||||
It includes a 2-D plotting widget, different kinds of sliders,
|
||||
and much more.
|
||||
|
||||
Qwt is hosted at http://qwt.sf.net
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Read INSTALL how to build and install Qwt.
|
||||
|
||||
Copyright
|
||||
---------
|
||||
|
||||
Qwt Widget Library
|
||||
Copyright (C) 1997 Josef Wilgen
|
||||
Copyright (C) 2002 Uwe Rathmann
|
||||
|
||||
Qwt is published under the Qwt License, Version 1.0.
|
||||
You should have received a copy of this licence in the file
|
||||
COPYING.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
################################################################
|
||||
|
||||
QWT_ROOT = $${PWD}/..
|
||||
|
||||
include ( $${QWT_ROOT}/qwtconfig.pri )
|
||||
include ( $${QWT_ROOT}/qwtbuild.pri )
|
||||
|
||||
contains(QWT_CONFIG, QwtDesigner) {
|
||||
|
||||
CONFIG += qt designer plugin
|
||||
CONFIG += warn_on
|
||||
|
||||
TEMPLATE = lib
|
||||
TARGET = qwt_designer_plugin
|
||||
|
||||
DESTDIR = plugins/designer
|
||||
|
||||
INCLUDEPATH += $${QWT_ROOT}/src
|
||||
DEPENDPATH += $${QWT_ROOT}/src
|
||||
|
||||
contains(QWT_CONFIG, QwtFramework) {
|
||||
|
||||
LIBS += -F$${QWT_ROOT}/lib
|
||||
}
|
||||
else {
|
||||
|
||||
LIBS += -L$${QWT_ROOT}/lib
|
||||
}
|
||||
|
||||
IPATH = $${INCLUDEPATH}
|
||||
qtAddLibrary(qwt)
|
||||
INCLUDEPATH = $${IPATH}
|
||||
|
||||
contains(QWT_CONFIG, QwtDll) {
|
||||
|
||||
win32 {
|
||||
DEFINES += QT_DLL QWT_DLL
|
||||
}
|
||||
}
|
||||
|
||||
!contains(QWT_CONFIG, QwtPlot) {
|
||||
DEFINES += NO_QWT_PLOT
|
||||
}
|
||||
|
||||
!contains(QWT_CONFIG, QwtWidgets) {
|
||||
DEFINES += NO_QWT_WIDGETS
|
||||
}
|
||||
|
||||
HEADERS += qwt_designer_plugin.h
|
||||
SOURCES += qwt_designer_plugin.cpp
|
||||
|
||||
contains(QWT_CONFIG, QwtPlot) {
|
||||
|
||||
HEADERS += qwt_designer_plotdialog.h
|
||||
SOURCES += qwt_designer_plotdialog.cpp
|
||||
}
|
||||
|
||||
RESOURCES += qwt_designer_plugin.qrc
|
||||
|
||||
target.path = $${QWT_INSTALL_PLUGINS}
|
||||
INSTALLS += target
|
||||
}
|
||||
else {
|
||||
TEMPLATE = subdirs # do nothing
|
||||
}
|
||||
|
Before Width: | Height: | Size: 422 B |
|
Before Width: | Height: | Size: 992 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 433 B |
|
Before Width: | Height: | Size: 807 B |
|
Before Width: | Height: | Size: 543 B |
|
Before Width: | Height: | Size: 373 B |
|
Before Width: | Height: | Size: 452 B |
|
Before Width: | Height: | Size: 580 B |
|
Before Width: | Height: | Size: 298 B |
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,41 +0,0 @@
|
||||
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
|
||||
* Qwt Widget Library
|
||||
* Copyright (C) 1997 Josef Wilgen
|
||||
* Copyright (C) 2002 Uwe Rathmann
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Qwt License, Version 1.0
|
||||
*****************************************************************************/
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QTabWidget>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
#include "qwt_designer_plotdialog.h"
|
||||
|
||||
using namespace QwtDesignerPlugin;
|
||||
|
||||
PlotDialog::PlotDialog(const QString &properties, QWidget *parent):
|
||||
QDialog(parent)
|
||||
{
|
||||
setWindowTitle("Plot Properties");
|
||||
|
||||
QLineEdit *lineEdit = new QLineEdit(properties);
|
||||
connect(lineEdit, SIGNAL(textChanged(const QString &)),
|
||||
SIGNAL(edited(const QString &)));
|
||||
|
||||
QTabWidget *tabWidget = new QTabWidget(this);
|
||||
tabWidget->addTab(lineEdit, "General");
|
||||
|
||||
QPushButton *closeButton = new QPushButton("Close");
|
||||
connect(closeButton, SIGNAL(clicked()), this, SLOT(accept()));
|
||||
|
||||
QHBoxLayout *buttonLayout = new QHBoxLayout;
|
||||
buttonLayout->addStretch(1);
|
||||
buttonLayout->addWidget(closeButton);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
mainLayout->addWidget(tabWidget);
|
||||
mainLayout->addLayout(buttonLayout);
|
||||
setLayout(mainLayout);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
|
||||
* Qwt Widget Library
|
||||
* Copyright (C) 1997 Josef Wilgen
|
||||
* Copyright (C) 2002 Uwe Rathmann
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Qwt License, Version 1.0
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef QWT_DESIGNER_PLOTDIALOG_H
|
||||
#define QWT_DESIGNER_PLOTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace QwtDesignerPlugin
|
||||
{
|
||||
|
||||
class PlotDialog: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PlotDialog(const QString &properties, QWidget *parent = NULL);
|
||||
|
||||
Q_SIGNALS:
|
||||
void edited(const QString&);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,512 +0,0 @@
|
||||
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
|
||||
* Qwt Widget Library
|
||||
* Copyright (C) 1997 Josef Wilgen
|
||||
* Copyright (C) 2002 Uwe Rathmann
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Qwt License, Version 1.0
|
||||
*****************************************************************************/
|
||||
|
||||
#if defined(_MSC_VER) /* MSVC Compiler */
|
||||
#pragma warning ( disable : 4786 )
|
||||
#endif
|
||||
|
||||
#include <qglobal.h>
|
||||
#include <qaction.h>
|
||||
#include <QtPlugin>
|
||||
#include <QDesignerFormEditorInterface>
|
||||
#include <QDesignerFormWindowInterface>
|
||||
#include <QDesignerFormWindowCursorInterface>
|
||||
#include <QExtensionManager>
|
||||
#include <QErrorMessage>
|
||||
|
||||
#include "qwt_designer_plugin.h"
|
||||
|
||||
#ifndef NO_QWT_PLOT
|
||||
#include "qwt_designer_plotdialog.h"
|
||||
#include "qwt_plot.h"
|
||||
#include "qwt_scale_widget.h"
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
#include "qwt_counter.h"
|
||||
#include "qwt_wheel.h"
|
||||
#include "qwt_thermo.h"
|
||||
#include "qwt_knob.h"
|
||||
#include "qwt_slider.h"
|
||||
#include "qwt_analog_clock.h"
|
||||
#include "qwt_compass.h"
|
||||
#endif
|
||||
|
||||
#include "qwt_text_label.h"
|
||||
|
||||
using namespace QwtDesignerPlugin;
|
||||
|
||||
CustomWidgetInterface::CustomWidgetInterface(QObject *parent):
|
||||
QObject(parent),
|
||||
d_isInitialized(false)
|
||||
{
|
||||
}
|
||||
|
||||
bool CustomWidgetInterface::isContainer() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CustomWidgetInterface::isInitialized() const
|
||||
{
|
||||
return d_isInitialized;
|
||||
}
|
||||
|
||||
QIcon CustomWidgetInterface::icon() const
|
||||
{
|
||||
return d_icon;
|
||||
}
|
||||
|
||||
QString CustomWidgetInterface::codeTemplate() const
|
||||
{
|
||||
return d_codeTemplate;
|
||||
}
|
||||
|
||||
QString CustomWidgetInterface::domXml() const
|
||||
{
|
||||
return d_domXml;
|
||||
}
|
||||
|
||||
QString CustomWidgetInterface::group() const
|
||||
{
|
||||
return "Qwt Widgets";
|
||||
}
|
||||
|
||||
QString CustomWidgetInterface::includeFile() const
|
||||
{
|
||||
return d_include;
|
||||
}
|
||||
|
||||
QString CustomWidgetInterface::name() const
|
||||
{
|
||||
return d_name;
|
||||
}
|
||||
|
||||
QString CustomWidgetInterface::toolTip() const
|
||||
{
|
||||
return d_toolTip;
|
||||
}
|
||||
|
||||
QString CustomWidgetInterface::whatsThis() const
|
||||
{
|
||||
return d_whatsThis;
|
||||
}
|
||||
|
||||
void CustomWidgetInterface::initialize(
|
||||
QDesignerFormEditorInterface *formEditor)
|
||||
{
|
||||
if ( d_isInitialized )
|
||||
return;
|
||||
|
||||
QExtensionManager *manager = formEditor->extensionManager();
|
||||
if ( manager )
|
||||
{
|
||||
manager->registerExtensions(new TaskMenuFactory(manager),
|
||||
Q_TYPEID(QDesignerTaskMenuExtension));
|
||||
}
|
||||
|
||||
d_isInitialized = true;
|
||||
}
|
||||
|
||||
#ifndef NO_QWT_PLOT
|
||||
|
||||
PlotInterface::PlotInterface(QObject *parent):
|
||||
CustomWidgetInterface(parent)
|
||||
{
|
||||
d_name = "QwtPlot";
|
||||
d_include = "qwt_plot.h";
|
||||
d_icon = QPixmap(":/pixmaps/qwtplot.png");
|
||||
d_domXml =
|
||||
"<widget class=\"QwtPlot\" name=\"qwtPlot\">\n"
|
||||
" <property name=\"geometry\">\n"
|
||||
" <rect>\n"
|
||||
" <x>0</x>\n"
|
||||
" <y>0</y>\n"
|
||||
" <width>400</width>\n"
|
||||
" <height>200</height>\n"
|
||||
" </rect>\n"
|
||||
" </property>\n"
|
||||
"</widget>\n";
|
||||
}
|
||||
|
||||
QWidget *PlotInterface::createWidget(QWidget *parent)
|
||||
{
|
||||
return new QwtPlot(parent);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
|
||||
AnalogClockInterface::AnalogClockInterface(QObject *parent):
|
||||
CustomWidgetInterface(parent)
|
||||
{
|
||||
d_name = "QwtAnalogClock";
|
||||
d_include = "qwt_analog_clock.h";
|
||||
d_icon = QPixmap(":/pixmaps/qwtanalogclock.png");
|
||||
d_domXml =
|
||||
"<widget class=\"QwtAnalogClock\" name=\"AnalogClock\">\n"
|
||||
" <property name=\"geometry\">\n"
|
||||
" <rect>\n"
|
||||
" <x>0</x>\n"
|
||||
" <y>0</y>\n"
|
||||
" <width>200</width>\n"
|
||||
" <height>200</height>\n"
|
||||
" </rect>\n"
|
||||
" </property>\n"
|
||||
" <property name=\"lineWidth\">\n"
|
||||
" <number>4</number>\n"
|
||||
" </property>\n"
|
||||
"</widget>\n";
|
||||
}
|
||||
|
||||
QWidget *AnalogClockInterface::createWidget(QWidget *parent)
|
||||
{
|
||||
return new QwtAnalogClock(parent);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
|
||||
CompassInterface::CompassInterface(QObject *parent):
|
||||
CustomWidgetInterface(parent)
|
||||
{
|
||||
d_name = "QwtCompass";
|
||||
d_include = "qwt_compass.h";
|
||||
d_icon = QPixmap(":/pixmaps/qwtcompass.png");
|
||||
d_domXml =
|
||||
"<widget class=\"QwtCompass\" name=\"Compass\">\n"
|
||||
" <property name=\"geometry\">\n"
|
||||
" <rect>\n"
|
||||
" <x>0</x>\n"
|
||||
" <y>0</y>\n"
|
||||
" <width>200</width>\n"
|
||||
" <height>200</height>\n"
|
||||
" </rect>\n"
|
||||
" </property>\n"
|
||||
" <property name=\"lineWidth\">\n"
|
||||
" <number>4</number>\n"
|
||||
" </property>\n"
|
||||
"</widget>\n";
|
||||
}
|
||||
|
||||
QWidget *CompassInterface::createWidget(QWidget *parent)
|
||||
{
|
||||
return new QwtCompass(parent);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
|
||||
CounterInterface::CounterInterface(QObject *parent):
|
||||
CustomWidgetInterface(parent)
|
||||
{
|
||||
d_name = "QwtCounter";
|
||||
d_include = "qwt_counter.h";
|
||||
d_icon = QPixmap(":/pixmaps/qwtcounter.png");
|
||||
d_domXml =
|
||||
"<widget class=\"QwtCounter\" name=\"Counter\">\n"
|
||||
"</widget>\n";
|
||||
}
|
||||
|
||||
QWidget *CounterInterface::createWidget(QWidget *parent)
|
||||
{
|
||||
return new QwtCounter(parent);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
|
||||
DialInterface::DialInterface(QObject *parent):
|
||||
CustomWidgetInterface(parent)
|
||||
{
|
||||
d_name = "QwtDial";
|
||||
d_include = "qwt_dial.h";
|
||||
d_icon = QPixmap(":/pixmaps/qwtdial.png");
|
||||
d_domXml =
|
||||
"<widget class=\"QwtDial\" name=\"Dial\">\n"
|
||||
" <property name=\"geometry\">\n"
|
||||
" <rect>\n"
|
||||
" <x>0</x>\n"
|
||||
" <y>0</y>\n"
|
||||
" <width>200</width>\n"
|
||||
" <height>200</height>\n"
|
||||
" </rect>\n"
|
||||
" </property>\n"
|
||||
" <property name=\"lineWidth\">\n"
|
||||
" <number>4</number>\n"
|
||||
" </property>\n"
|
||||
"</widget>\n";
|
||||
}
|
||||
|
||||
QWidget *DialInterface::createWidget(QWidget *parent)
|
||||
{
|
||||
return new QwtDial(parent);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
|
||||
KnobInterface::KnobInterface(QObject *parent):
|
||||
CustomWidgetInterface(parent)
|
||||
{
|
||||
d_name = "QwtKnob";
|
||||
d_include = "qwt_knob.h";
|
||||
d_icon = QPixmap(":/pixmaps/qwtknob.png");
|
||||
d_domXml =
|
||||
"<widget class=\"QwtKnob\" name=\"Knob\">\n"
|
||||
" <property name=\"geometry\">\n"
|
||||
" <rect>\n"
|
||||
" <x>0</x>\n"
|
||||
" <y>0</y>\n"
|
||||
" <width>100</width>\n"
|
||||
" <height>100</height>\n"
|
||||
" </rect>\n"
|
||||
" </property>\n"
|
||||
"</widget>\n";
|
||||
}
|
||||
|
||||
QWidget *KnobInterface::createWidget(QWidget *parent)
|
||||
{
|
||||
return new QwtKnob(parent);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_PLOT
|
||||
|
||||
ScaleWidgetInterface::ScaleWidgetInterface(QObject *parent):
|
||||
CustomWidgetInterface(parent)
|
||||
{
|
||||
d_name = "QwtScaleWidget";
|
||||
d_include = "qwt_scale_widget.h";
|
||||
d_icon = QPixmap(":/pixmaps/qwtscale.png");
|
||||
d_domXml =
|
||||
"<widget class=\"QwtScaleWidget\" name=\"ScaleWidget\">\n"
|
||||
"</widget>\n";
|
||||
}
|
||||
|
||||
QWidget *ScaleWidgetInterface::createWidget(QWidget *parent)
|
||||
{
|
||||
return new QwtScaleWidget(QwtScaleDraw::LeftScale, parent);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
|
||||
SliderInterface::SliderInterface(QObject *parent):
|
||||
CustomWidgetInterface(parent)
|
||||
{
|
||||
d_name = "QwtSlider";
|
||||
d_include = "qwt_slider.h";
|
||||
d_icon = QPixmap(":/pixmaps/qwtslider.png");
|
||||
d_domXml =
|
||||
"<widget class=\"QwtSlider\" name=\"Slider\">\n"
|
||||
" <property name=\"geometry\">\n"
|
||||
" <rect>\n"
|
||||
" <x>0</x>\n"
|
||||
" <y>0</y>\n"
|
||||
" <width>200</width>\n"
|
||||
" <height>60</height>\n"
|
||||
" </rect>\n"
|
||||
" </property>\n"
|
||||
"</widget>\n";
|
||||
}
|
||||
|
||||
QWidget *SliderInterface::createWidget(QWidget *parent)
|
||||
{
|
||||
QwtSlider *slider = new QwtSlider(parent);
|
||||
#if 0
|
||||
slider->setScalePosition(QwtSlider::Bottom);
|
||||
slider->setRange(0.0, 10.0, 1.0, 0);
|
||||
slider->setValue(3.0);
|
||||
#endif
|
||||
return slider;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
TextLabelInterface::TextLabelInterface(QObject *parent):
|
||||
CustomWidgetInterface(parent)
|
||||
{
|
||||
d_name = "QwtTextLabel";
|
||||
d_include = "qwt_text_label.h";
|
||||
|
||||
d_icon = QPixmap(":/pixmaps/qwtwidget.png");
|
||||
d_domXml =
|
||||
"<widget class=\"QwtTextLabel\" name=\"TextLabel\">\n"
|
||||
" <property name=\"geometry\">\n"
|
||||
" <rect>\n"
|
||||
" <x>0</x>\n"
|
||||
" <y>0</y>\n"
|
||||
" <width>100</width>\n"
|
||||
" <height>20</height>\n"
|
||||
" </rect>\n"
|
||||
" </property>\n"
|
||||
"</widget>\n";
|
||||
}
|
||||
|
||||
QWidget *TextLabelInterface::createWidget(QWidget *parent)
|
||||
{
|
||||
return new QwtTextLabel(parent);
|
||||
}
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
|
||||
ThermoInterface::ThermoInterface(QObject *parent):
|
||||
CustomWidgetInterface(parent)
|
||||
{
|
||||
d_name = "QwtThermo";
|
||||
d_include = "qwt_thermo.h";
|
||||
d_icon = QPixmap(":/pixmaps/qwtthermo.png");
|
||||
d_domXml =
|
||||
"<widget class=\"QwtThermo\" name=\"Thermo\">\n"
|
||||
"</widget>\n";
|
||||
}
|
||||
|
||||
QWidget *ThermoInterface::createWidget(QWidget *parent)
|
||||
{
|
||||
return new QwtThermo(parent);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
|
||||
WheelInterface::WheelInterface(QObject *parent):
|
||||
CustomWidgetInterface(parent)
|
||||
{
|
||||
d_name = "QwtWheel";
|
||||
d_include = "qwt_wheel.h";
|
||||
d_icon = QPixmap(":/pixmaps/qwtwheel.png");
|
||||
d_domXml =
|
||||
"<widget class=\"QwtWheel\" name=\"Wheel\">\n"
|
||||
"</widget>\n";
|
||||
}
|
||||
|
||||
QWidget *WheelInterface::createWidget(QWidget *parent)
|
||||
{
|
||||
return new QwtWheel(parent);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
CustomWidgetCollectionInterface::CustomWidgetCollectionInterface(
|
||||
QObject *parent):
|
||||
QObject(parent)
|
||||
{
|
||||
#ifndef NO_QWT_PLOT
|
||||
d_plugins.append(new PlotInterface(this));
|
||||
d_plugins.append(new ScaleWidgetInterface(this));
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
d_plugins.append(new AnalogClockInterface(this));
|
||||
d_plugins.append(new CompassInterface(this));
|
||||
d_plugins.append(new CounterInterface(this));
|
||||
d_plugins.append(new DialInterface(this));
|
||||
d_plugins.append(new KnobInterface(this));
|
||||
d_plugins.append(new SliderInterface(this));
|
||||
d_plugins.append(new ThermoInterface(this));
|
||||
d_plugins.append(new WheelInterface(this));
|
||||
#endif
|
||||
|
||||
d_plugins.append(new TextLabelInterface(this));
|
||||
}
|
||||
|
||||
QList<QDesignerCustomWidgetInterface*>
|
||||
CustomWidgetCollectionInterface::customWidgets(void) const
|
||||
{
|
||||
return d_plugins;
|
||||
}
|
||||
|
||||
TaskMenuFactory::TaskMenuFactory(QExtensionManager *parent):
|
||||
QExtensionFactory(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QObject *TaskMenuFactory::createExtension(
|
||||
QObject *object, const QString &iid, QObject *parent) const
|
||||
{
|
||||
if (iid == Q_TYPEID(QDesignerTaskMenuExtension))
|
||||
{
|
||||
#ifndef NO_QWT_PLOT
|
||||
if (QwtPlot *plot = qobject_cast<QwtPlot*>(object))
|
||||
return new TaskMenuExtension(plot, parent);
|
||||
#endif
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
if (QwtDial *dial = qobject_cast<QwtDial*>(object))
|
||||
return new TaskMenuExtension(dial, parent);
|
||||
#endif
|
||||
}
|
||||
|
||||
return QExtensionFactory::createExtension(object, iid, parent);
|
||||
}
|
||||
|
||||
|
||||
TaskMenuExtension::TaskMenuExtension(QWidget *widget, QObject *parent):
|
||||
QObject(parent),
|
||||
d_widget(widget)
|
||||
{
|
||||
d_editAction = new QAction(tr("Edit Qwt Attributes ..."), this);
|
||||
connect(d_editAction, SIGNAL(triggered()),
|
||||
this, SLOT(editProperties()));
|
||||
}
|
||||
|
||||
QList<QAction *> TaskMenuExtension::taskActions() const
|
||||
{
|
||||
QList<QAction *> list;
|
||||
list.append(d_editAction);
|
||||
return list;
|
||||
}
|
||||
|
||||
QAction *TaskMenuExtension::preferredEditAction() const
|
||||
{
|
||||
return d_editAction;
|
||||
}
|
||||
|
||||
void TaskMenuExtension::editProperties()
|
||||
{
|
||||
const QVariant v = d_widget->property("propertiesDocument");
|
||||
if ( v.type() != QVariant::String )
|
||||
return;
|
||||
|
||||
#ifndef NO_QWT_PLOT
|
||||
QString properties = v.toString();
|
||||
|
||||
if ( qobject_cast<QwtPlot*>(d_widget) )
|
||||
{
|
||||
PlotDialog dialog(properties);
|
||||
connect(&dialog, SIGNAL(edited(const QString&)),
|
||||
SLOT(applyProperties(const QString &)));
|
||||
(void)dialog.exec();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
static QErrorMessage *errorMessage = NULL;
|
||||
if ( errorMessage == NULL )
|
||||
errorMessage = new QErrorMessage();
|
||||
errorMessage->showMessage("Not implemented yet.");
|
||||
}
|
||||
|
||||
void TaskMenuExtension::applyProperties(const QString &properties)
|
||||
{
|
||||
QDesignerFormWindowInterface *formWindow
|
||||
= QDesignerFormWindowInterface::findFormWindow(d_widget);
|
||||
if ( formWindow && formWindow->cursor() )
|
||||
formWindow->cursor()->setProperty("propertiesDocument", properties);
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN2(QwtDesignerPlugin, CustomWidgetCollectionInterface)
|
||||
@@ -1,234 +0,0 @@
|
||||
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
|
||||
* Qwt Widget Library
|
||||
* Copyright (C) 1997 Josef Wilgen
|
||||
* Copyright (C) 2002 Uwe Rathmann
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Qwt License, Version 1.0
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef QWT_DESIGNER_PLUGIN_H
|
||||
#define QWT_DESIGNER_PLUGIN_H
|
||||
|
||||
#include <QDesignerCustomWidgetInterface>
|
||||
#include <QDesignerTaskMenuExtension>
|
||||
#include <QExtensionFactory>
|
||||
|
||||
namespace QwtDesignerPlugin
|
||||
{
|
||||
|
||||
class CustomWidgetInterface: public QObject,
|
||||
public QDesignerCustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
CustomWidgetInterface(QObject *parent);
|
||||
|
||||
virtual bool isContainer() const;
|
||||
virtual bool isInitialized() const;
|
||||
virtual QIcon icon() const;
|
||||
virtual QString codeTemplate() const;
|
||||
virtual QString domXml() const;
|
||||
virtual QString group() const;
|
||||
virtual QString includeFile() const;
|
||||
virtual QString name() const;
|
||||
virtual QString toolTip() const;
|
||||
virtual QString whatsThis() const;
|
||||
virtual void initialize(QDesignerFormEditorInterface *);
|
||||
|
||||
protected:
|
||||
QString d_name;
|
||||
QString d_include;
|
||||
QString d_toolTip;
|
||||
QString d_whatsThis;
|
||||
QString d_domXml;
|
||||
QString d_codeTemplate;
|
||||
QIcon d_icon;
|
||||
|
||||
private:
|
||||
bool d_isInitialized;
|
||||
};
|
||||
|
||||
class CustomWidgetCollectionInterface: public QObject,
|
||||
public QDesignerCustomWidgetCollectionInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
|
||||
|
||||
public:
|
||||
CustomWidgetCollectionInterface(QObject *parent = NULL);
|
||||
|
||||
virtual QList<QDesignerCustomWidgetInterface*> customWidgets() const;
|
||||
|
||||
private:
|
||||
QList<QDesignerCustomWidgetInterface*> d_plugins;
|
||||
};
|
||||
|
||||
#ifndef NO_QWT_PLOT
|
||||
class PlotInterface: public CustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
PlotInterface(QObject *parent);
|
||||
virtual QWidget *createWidget(QWidget *parent);
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
class AnalogClockInterface: public CustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
AnalogClockInterface(QObject *parent);
|
||||
virtual QWidget *createWidget(QWidget *parent);
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
class CompassInterface: public CustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
CompassInterface(QObject *parent);
|
||||
virtual QWidget *createWidget(QWidget *parent);
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
class CounterInterface: public CustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
CounterInterface(QObject *parent);
|
||||
virtual QWidget *createWidget(QWidget *parent);
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
class DialInterface: public CustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
DialInterface(QObject *parent);
|
||||
virtual QWidget *createWidget(QWidget *parent);
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
class KnobInterface: public CustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
KnobInterface(QObject *parent);
|
||||
virtual QWidget *createWidget(QWidget *parent);
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_PLOT
|
||||
class ScaleWidgetInterface: public CustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
ScaleWidgetInterface(QObject *parent);
|
||||
virtual QWidget *createWidget(QWidget *parent);
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
class SliderInterface: public CustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
SliderInterface(QObject *parent);
|
||||
virtual QWidget *createWidget(QWidget *parent);
|
||||
};
|
||||
#endif
|
||||
|
||||
class TextLabelInterface: public CustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
TextLabelInterface(QObject *parent);
|
||||
virtual QWidget *createWidget(QWidget *parent);
|
||||
};
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
class ThermoInterface: public CustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
ThermoInterface(QObject *parent);
|
||||
virtual QWidget *createWidget(QWidget *parent);
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef NO_QWT_WIDGETS
|
||||
class WheelInterface: public CustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
WheelInterface(QObject *parent);
|
||||
virtual QWidget *createWidget(QWidget *parent);
|
||||
};
|
||||
#endif
|
||||
|
||||
class TaskMenuFactory: public QExtensionFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskMenuFactory(QExtensionManager *parent = 0);
|
||||
|
||||
protected:
|
||||
QObject *createExtension(QObject *object,
|
||||
const QString &iid, QObject *parent) const;
|
||||
};
|
||||
|
||||
class TaskMenuExtension: public QObject,
|
||||
public QDesignerTaskMenuExtension
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerTaskMenuExtension)
|
||||
|
||||
public:
|
||||
TaskMenuExtension(QWidget *widget, QObject *parent);
|
||||
|
||||
QAction *preferredEditAction() const;
|
||||
QList<QAction *> taskActions() const;
|
||||
|
||||
private Q_SLOTS:
|
||||
void editProperties();
|
||||
void applyProperties(const QString &);
|
||||
|
||||
private:
|
||||
QAction *d_editAction;
|
||||
QWidget *d_widget;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,15 +0,0 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>pixmaps/qwtplot.png</file>
|
||||
<file>pixmaps/qwtanalogclock.png</file>
|
||||
<file>pixmaps/qwtcounter.png</file>
|
||||
<file>pixmaps/qwtcompass.png</file>
|
||||
<file>pixmaps/qwtdial.png</file>
|
||||
<file>pixmaps/qwtknob.png</file>
|
||||
<file>pixmaps/qwtscale.png</file>
|
||||
<file>pixmaps/qwtslider.png</file>
|
||||
<file>pixmaps/qwtthermo.png</file>
|
||||
<file>pixmaps/qwtwheel.png</file>
|
||||
<file>pixmaps/qwtwidget.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -1,615 +0,0 @@
|
||||
/****************************************************************************
|
||||
** Resource object code
|
||||
**
|
||||
** Created: Thu Feb 2 22:55:24 2012
|
||||
** by: The Resource Compiler for Qt version 4.7.4
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
static const unsigned char qt_resource_data[] = {
|
||||
// /Users/grauser/Documents/DEV/Qt/qwt-6.0.1/designer/pixmaps/qwtslider.png
|
||||
0x0,0x0,0x1,0xc4,
|
||||
0x89,
|
||||
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
|
||||
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b,
|
||||
0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd2,0xa,0x9,0x13,0xa,0x30,0x66,
|
||||
0xcc,0x85,0xa0,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,
|
||||
0x0,0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,
|
||||
0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,0x1,0x53,0x49,0x44,0x41,0x54,
|
||||
0x78,0xda,0x63,0x60,0x18,0x5,0xc3,0xf,0xfc,0x47,0x2,0x75,0x4b,0xba,0xfe,0x93,
|
||||
0xaa,0x9f,0x9,0x9f,0xe4,0xa7,0x6f,0x9f,0x18,0x8e,0x5c,0x3e,0x2,0x66,0xfb,0x54,
|
||||
0x5,0x92,0x64,0x38,0x13,0x29,0x8a,0x7,0x85,0xc1,0x2c,0x30,0x6,0xa3,0x3,0xdb,
|
||||
0xff,0xff,0xc,0xff,0x21,0x76,0x31,0x62,0x2a,0x3c,0x7d,0xed,0x24,0x3,0x83,0x23,
|
||||
0x3b,0xee,0xe0,0x60,0x62,0x66,0xe0,0x16,0x55,0x64,0xf8,0xba,0xe2,0x2a,0x23,0xdc,
|
||||
0x60,0x26,0xa0,0xa1,0xff,0x18,0x99,0x18,0xf8,0x85,0x14,0x18,0xd8,0xd8,0x79,0x19,
|
||||
0x18,0x81,0x8a,0xb0,0x1,0x31,0x69,0x43,0x1c,0xa6,0x32,0x32,0x30,0xb1,0xb0,0x31,
|
||||
0xbc,0xf8,0xf0,0x88,0x41,0xa2,0x2a,0xe1,0xff,0x8b,0xb6,0x5,0x8c,0x60,0x83,0xff,
|
||||
0x31,0x32,0x32,0x8,0x89,0xaa,0x32,0x18,0x5a,0xa7,0x30,0xe8,0x2a,0x6a,0x3,0x2d,
|
||||
0x67,0xc1,0xd0,0xca,0x2d,0xac,0xcc,0x10,0x10,0xd4,0x8c,0xdd,0xb1,0x40,0x87,0xbc,
|
||||
0xff,0xf5,0x9f,0xe1,0xee,0xc5,0x5,0xc,0x92,0x2,0x22,0xc,0xcb,0x61,0x2e,0xe6,
|
||||
0x16,0x53,0x66,0x78,0xf7,0xf3,0x13,0xc3,0xb1,0xb3,0x8b,0x19,0x98,0xbf,0x1a,0x33,
|
||||
0xb0,0xb3,0xb0,0x32,0x30,0x78,0xd9,0xa3,0x68,0xfe,0xfa,0xe9,0x29,0xc3,0xed,0xab,
|
||||
0x6b,0xb0,0x1a,0xcc,0xc9,0xce,0xc1,0xa0,0x2c,0x2e,0xcb,0xe0,0xe0,0x18,0xc8,0x20,
|
||||
0x22,0x2a,0x7,0x34,0xb8,0xb,0x62,0xf0,0xd7,0x95,0xd7,0x18,0x25,0x2a,0xe3,0xfe,
|
||||
0x4b,0xfc,0xfb,0xce,0x20,0x21,0x20,0xcc,0xc0,0xce,0xca,0x86,0xa1,0x99,0x9d,0x95,
|
||||
0x9d,0x41,0x42,0x50,0x4,0xab,0xc1,0x1c,0x40,0x39,0x61,0x1e,0x7e,0x6,0x69,0x49,
|
||||
0x25,0x6,0x27,0x15,0x6d,0x46,0x48,0xe0,0xe0,0x0,0xa0,0x8c,0x1,0x4a,0xc7,0x97,
|
||||
0xee,0x5e,0x62,0xd8,0x7d,0xe9,0x38,0xc3,0xb9,0x6b,0xc7,0x19,0xb6,0xb4,0xad,0xc7,
|
||||
0xa9,0x1e,0x23,0x78,0x88,0x55,0x48,0x2a,0xa0,0x7d,0x3a,0x46,0x7,0x69,0x53,0x2b,
|
||||
0x28,0x32,0x18,0x6f,0x98,0xa1,0x97,0xf,0xa4,0x84,0xf1,0x28,0x80,0x3,0x0,0xb9,
|
||||
0xf0,0x60,0x59,0x7a,0xd9,0xd8,0x20,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,
|
||||
0x42,0x60,0x82,
|
||||
// /Users/grauser/Documents/DEV/Qt/qwt-6.0.1/designer/pixmaps/qwtdial.png
|
||||
0x0,0x0,0x1,0xb1,
|
||||
0x89,
|
||||
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
|
||||
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x2,0x0,0x0,0x0,0x4b,0xd6,0xfb,0x6c,
|
||||
0x0,0x0,0x1,0x78,0x49,0x44,0x41,0x54,0x78,0x9c,0x9d,0x94,0x31,0x8e,0xc2,0x30,
|
||||
0x10,0x45,0x7,0x67,0x63,0x8d,0x81,0x2b,0x50,0x86,0x3,0xa4,0xa6,0xe2,0x0,0xf4,
|
||||
0x5c,0x82,0x9e,0x1b,0x70,0x83,0xb4,0x91,0xb8,0x41,0x2a,0x9a,0x70,0x84,0xa4,0x81,
|
||||
0xa,0x21,0x21,0x51,0x50,0x50,0x23,0x41,0x50,0xa4,0x2d,0x7e,0xd6,0xc,0xe,0xc9,
|
||||
0x66,0xf7,0x57,0x96,0x3d,0xff,0x79,0x3c,0xc9,0x4c,0x2f,0xcb,0x32,0x12,0x3a,0x1c,
|
||||
0xe,0xd4,0xaa,0x20,0x8,0x9c,0x9d,0xaf,0x8f,0xfe,0x3c,0xcf,0x99,0xd9,0x18,0xe3,
|
||||
0x79,0x9e,0xc,0x18,0x8d,0x46,0x88,0x91,0xa0,0x9e,0xcd,0x2,0x67,0x69,0x9a,0x6a,
|
||||
0xad,0x8d,0x31,0xf3,0xf9,0xdc,0xb9,0x6d,0xbb,0xdd,0x5a,0x90,0xa4,0x54,0x8,0xf8,
|
||||
0x93,0x24,0xf1,0x7d,0x7f,0xb1,0x58,0x48,0x67,0x18,0x86,0xf2,0xb1,0x0,0x49,0x8a,
|
||||
0xb2,0xfe,0xf5,0x7a,0x5d,0x14,0x5,0xfc,0x61,0x18,0x5a,0x8f,0x53,0xac,0xe9,0x74,
|
||||
0x4a,0x44,0xe7,0xf3,0xd9,0x1a,0x15,0xe,0xa2,0x28,0x2a,0x8a,0x62,0xb9,0x5c,0x3a,
|
||||
0xb6,0x44,0xb0,0x2c,0xd7,0xa1,0x28,0x90,0xca,0xb2,0x5c,0xad,0x56,0xd4,0x2a,0x99,
|
||||
0xe,0x28,0x90,0x22,0xa2,0x38,0x8e,0x8d,0x31,0x4e,0xfe,0x2d,0x42,0x98,0xd6,0xfa,
|
||||
0x7a,0xbd,0x56,0x8,0x63,0xc,0x52,0x70,0x9e,0xdd,0x9e,0xce,0x64,0x32,0xc1,0xc5,
|
||||
0x15,0xa2,0x29,0x7a,0x96,0x65,0x49,0x73,0x6a,0xcc,0x5c,0x21,0x7c,0xdf,0xef,0x72,
|
||||
0x79,0x5d,0x30,0x2a,0x22,0x1a,0xe,0x87,0xd4,0xb9,0x10,0x10,0x82,0x7,0x83,0x41,
|
||||
0x85,0xd0,0x5a,0x53,0x73,0x21,0x66,0x9f,0xf6,0x11,0xc,0xe3,0x2f,0xb5,0x68,0xd7,
|
||||
0xab,0x16,0xcc,0xbc,0xd9,0x6c,0xfe,0x81,0x78,0x7d,0x91,0xf1,0x78,0x8c,0x94,0xfe,
|
||||
0xea,0x3f,0x1e,0x8f,0x64,0x7f,0x70,0x12,0x8d,0xd8,0x51,0x65,0x59,0x62,0xa1,0xd0,
|
||||
0x6d,0xe8,0xbc,0x8e,0x94,0xdb,0xed,0xf6,0x7c,0x3e,0xf7,0xfb,0x3d,0x11,0x5,0x41,
|
||||
0xa0,0xe8,0xa7,0x67,0x3b,0x52,0x2e,0x97,0xcb,0xfd,0x7e,0x3f,0x9d,0x4e,0xd6,0xe8,
|
||||
0x8e,0x1c,0xf4,0x1f,0xbd,0x37,0x12,0xb4,0xdb,0xed,0x98,0x59,0x6b,0xfd,0x78,0x3c,
|
||||
0xa8,0x3e,0x72,0x24,0x45,0x82,0x20,0xcf,0xf3,0x98,0x99,0x99,0xfb,0xfd,0x3e,0x76,
|
||||
0xe4,0xe0,0x7b,0x9b,0x9d,0xf5,0xd1,0x5a,0x57,0x3d,0xe6,0x1b,0xf1,0xc5,0xa7,0x36,
|
||||
0x5f,0xe6,0x63,0x88,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
|
||||
|
||||
// /Users/grauser/Documents/DEV/Qt/qwt-6.0.1/designer/pixmaps/qwtwheel.png
|
||||
0x0,0x0,0x1,0x2a,
|
||||
0x89,
|
||||
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
|
||||
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x3,0x0,0x0,0x0,0xf3,0x6a,0x9c,0x9,
|
||||
0x0,0x0,0x0,0x2a,0x74,0x45,0x58,0x74,0x43,0x72,0x65,0x61,0x74,0x69,0x6f,0x6e,
|
||||
0x20,0x54,0x69,0x6d,0x65,0x0,0x4d,0x69,0x20,0x39,0x20,0x4f,0x6b,0x74,0x20,0x32,
|
||||
0x30,0x30,0x32,0x20,0x32,0x32,0x3a,0x35,0x33,0x3a,0x30,0x30,0x20,0x2b,0x30,0x31,
|
||||
0x30,0x30,0x8a,0x59,0x4f,0x7f,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd2,
|
||||
0xa,0x9,0x14,0x38,0x1c,0xbc,0x2b,0xab,0xb7,0x0,0x0,0x0,0x9,0x70,0x48,0x59,
|
||||
0x73,0x0,0x0,0xe,0xc3,0x0,0x0,0xe,0xc3,0x1,0xc7,0x6f,0xa8,0x64,0x0,0x0,
|
||||
0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,
|
||||
0x0,0x27,0x50,0x4c,0x54,0x45,0xfb,0xb3,0x8,0xfb,0xfb,0xfb,0x75,0x75,0x75,0xd7,
|
||||
0xd7,0xd7,0xe1,0xe1,0xe1,0xf2,0xf2,0xf2,0xea,0xea,0xea,0xc6,0xc6,0xc6,0xbd,0xbd,
|
||||
0xbd,0xb3,0xb3,0xb3,0xa1,0xa1,0xa1,0x86,0x86,0x86,0x7d,0x7d,0x7d,0xab,0xa1,0x7c,
|
||||
0x5d,0x0,0x0,0x0,0x1,0x74,0x52,0x4e,0x53,0x0,0x40,0xe6,0xd8,0x66,0x0,0x0,
|
||||
0x0,0x43,0x49,0x44,0x41,0x54,0x78,0xda,0xcd,0x8f,0x37,0xe,0x0,0x20,0x10,0xc3,
|
||||
0xc8,0xd1,0xcb,0xff,0xdf,0x4b,0x13,0x4c,0x61,0x3,0x9,0xf,0x1e,0x9c,0x29,0x4a,
|
||||
0xdd,0x40,0x18,0xa0,0x19,0x3d,0x83,0x30,0xf3,0x98,0xe6,0x2e,0x2b,0x6b,0x6d,0x4,
|
||||
0xd6,0x35,0xf9,0x10,0x93,0x20,0x97,0xcf,0xf2,0xf8,0xb5,0xd5,0x8d,0xf3,0x79,0xd0,
|
||||
0xf3,0xe0,0xf9,0x21,0x15,0xd5,0x8b,0x3,0xae,0x41,0xc3,0x32,0xc9,0x0,0x0,0x0,
|
||||
0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
|
||||
// /Users/grauser/Documents/DEV/Qt/qwt-6.0.1/designer/pixmaps/qwtplot.png
|
||||
0x0,0x0,0x2,0x1f,
|
||||
0x89,
|
||||
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
|
||||
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b,
|
||||
0x0,0x0,0x0,0x2a,0x74,0x45,0x58,0x74,0x43,0x72,0x65,0x61,0x74,0x69,0x6f,0x6e,
|
||||
0x20,0x54,0x69,0x6d,0x65,0x0,0x4d,0x69,0x20,0x39,0x20,0x4f,0x6b,0x74,0x20,0x32,
|
||||
0x30,0x30,0x32,0x20,0x32,0x31,0x3a,0x32,0x34,0x3a,0x33,0x30,0x20,0x2b,0x30,0x31,
|
||||
0x30,0x30,0x72,0xfb,0x2a,0xa8,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd2,
|
||||
0xa,0x9,0x13,0x21,0x1,0x41,0x62,0x78,0xf3,0x0,0x0,0x0,0x9,0x70,0x48,0x59,
|
||||
0x73,0x0,0x0,0xa,0xf0,0x0,0x0,0xa,0xf0,0x1,0x42,0xac,0x34,0x98,0x0,0x0,
|
||||
0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,
|
||||
0x1,0x78,0x49,0x44,0x41,0x54,0x78,0xda,0x63,0x60,0x18,0x5,0x74,0x5,0x1a,0x62,
|
||||
0x5c,0xff,0xa9,0x65,0x16,0x23,0x36,0x43,0x6f,0xbc,0xfa,0xc6,0x48,0x9e,0x71,0x8,
|
||||
0xc0,0x34,0x28,0x82,0xe2,0x8c,0x28,0x13,0xb,0x10,0xf3,0x82,0x68,0xaa,0xb9,0x18,
|
||||
0x68,0x98,0x12,0xab,0x84,0xd4,0x46,0x16,0x11,0xb1,0xb,0x2c,0xc2,0x22,0x1b,0x81,
|
||||
0x7c,0x1d,0x8a,0xd,0x6,0x1a,0xc2,0xc5,0x22,0x2e,0x39,0x8b,0x4d,0x5e,0xc9,0x41,
|
||||
0xaa,0x7b,0x9a,0x12,0xbb,0xba,0xb6,0x3d,0xd0,0x82,0x79,0x40,0x71,0x41,0x8a,0x82,
|
||||
0xe2,0x82,0x96,0xa4,0xf7,0x39,0x25,0x81,0x9f,0x6f,0x76,0x6f,0xfb,0xff,0xfd,0xfb,
|
||||
0xf7,0xff,0x1f,0x2e,0x9e,0xfb,0x7f,0x41,0x53,0xe2,0xfb,0x5,0xd,0xf1,0x2c,0x8a,
|
||||
0x5c,0xcc,0xc8,0xce,0x9e,0xc0,0xa1,0xaa,0xc9,0xc4,0x69,0x60,0x2,0xe6,0xb3,0xab,
|
||||
0x6a,0x30,0xf0,0xfb,0x87,0xb2,0x32,0x30,0x31,0x65,0x2,0x5d,0xcd,0x47,0x96,0xc1,
|
||||
0xa0,0xc8,0xfa,0xff,0xeb,0x97,0x9,0xaf,0x87,0x1f,0xb,0x13,0xf,0x2f,0xd4,0x26,
|
||||
0x46,0x6,0x81,0xe0,0x28,0xe6,0xff,0x3f,0x7f,0xa8,0x30,0x71,0xf3,0xb8,0x92,0x65,
|
||||
0x30,0xb3,0xa0,0x50,0x0,0x23,0xb,0x8b,0x18,0xaf,0x93,0x3b,0x8a,0x38,0xbb,0xba,
|
||||
0x16,0x3,0xb7,0x8d,0x23,0x33,0xb3,0xa0,0x70,0x2e,0xd0,0x72,0x36,0xa2,0xd,0x6,
|
||||
0x29,0x3e,0x2b,0xcd,0xe1,0xf3,0xff,0xf7,0xef,0xe,0x7e,0xbf,0x50,0x66,0x90,0xf7,
|
||||
0x51,0x82,0x87,0x95,0x8d,0x41,0x24,0xbd,0x80,0x95,0x91,0x91,0xd1,0x8c,0x55,0x5a,
|
||||
0xb6,0x10,0xdd,0x70,0x26,0x2c,0x6,0x32,0x9e,0x95,0x64,0xb3,0x7,0x25,0x29,0x26,
|
||||
0xe,0xce,0xe5,0x40,0x43,0x85,0x45,0xf3,0x2a,0xd8,0x41,0xde,0x47,0x7,0x9c,0x86,
|
||||
0xa6,0x3f,0x84,0x92,0xb3,0x19,0xff,0x7d,0xf9,0x5c,0xcf,0xa6,0xa8,0xd2,0xf,0xd4,
|
||||
0xcb,0xc,0x93,0xc3,0x96,0xd0,0x99,0x19,0xd9,0xd8,0x4d,0x59,0xa5,0x64,0xdf,0x9,
|
||||
0x84,0xc7,0xf5,0xf3,0x79,0xf8,0x3d,0x65,0xe2,0xe1,0xf9,0x85,0xc3,0x63,0xf,0xf9,
|
||||
0xdc,0x7d,0x3f,0xfe,0xb8,0x7c,0x5e,0xe7,0xef,0xfb,0x77,0x4f,0xf5,0x4e,0xdd,0xfa,
|
||||
0x8b,0x55,0x15,0x25,0x85,0x10,0x48,0x2f,0xb2,0x7e,0x46,0x74,0x49,0x72,0xd,0x46,
|
||||
0x6,0xd4,0x28,0xc4,0x70,0xba,0x78,0xe8,0x1,0x0,0x3e,0x3c,0x69,0x30,0x7,0xb3,
|
||||
0x24,0xc3,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
|
||||
// /Users/grauser/Documents/DEV/Qt/qwt-6.0.1/designer/pixmaps/qwtscale.png
|
||||
0x0,0x0,0x1,0x75,
|
||||
0x89,
|
||||
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
|
||||
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b,
|
||||
0x0,0x0,0x0,0x2b,0x74,0x45,0x58,0x74,0x43,0x72,0x65,0x61,0x74,0x69,0x6f,0x6e,
|
||||
0x20,0x54,0x69,0x6d,0x65,0x0,0x53,0x6f,0x20,0x32,0x37,0x20,0x4f,0x6b,0x74,0x20,
|
||||
0x32,0x30,0x30,0x32,0x20,0x31,0x36,0x3a,0x31,0x33,0x3a,0x32,0x32,0x20,0x2b,0x30,
|
||||
0x31,0x30,0x30,0x8c,0x3a,0x78,0x7b,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,
|
||||
0xd2,0xa,0x1b,0x11,0x10,0x23,0xab,0xcb,0x75,0xdf,0x0,0x0,0x0,0x9,0x70,0x48,
|
||||
0x59,0x73,0x0,0x0,0xa,0xf0,0x0,0x0,0xa,0xf0,0x1,0x42,0xac,0x34,0x98,0x0,
|
||||
0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,
|
||||
0x0,0x0,0xcd,0x49,0x44,0x41,0x54,0x78,0xda,0x63,0x64,0xc0,0x3,0x74,0xf4,0xa6,
|
||||
0x54,0x2,0x29,0x6f,0x1c,0xd2,0x6c,0x40,0xfc,0x13,0x88,0x23,0xaf,0x5c,0xca,0x79,
|
||||
0x82,0x2e,0xc9,0xc2,0x80,0x1f,0xf4,0x3,0xf1,0x14,0x5c,0xf6,0x2,0xf1,0x5a,0x20,
|
||||
0x16,0x2,0x62,0xd2,0xc,0x6,0xba,0xe4,0x7,0x90,0xfa,0x81,0xc3,0x37,0x5f,0x81,
|
||||
0xd4,0x7f,0x5c,0x7a,0x99,0x18,0x68,0x4,0x8,0x5,0x5,0xc8,0x65,0x32,0x50,0xef,
|
||||
0xa2,0x3,0x35,0x20,0x66,0x26,0xdb,0x60,0x68,0xc4,0x3c,0x29,0x29,0xbb,0x73,0x64,
|
||||
0xc7,0x8e,0x1d,0xc8,0x52,0xdc,0x40,0xcc,0x49,0x89,0x8b,0x39,0x80,0x14,0x2b,0xd0,
|
||||
0x50,0x4f,0x74,0x29,0x6,0x48,0xe4,0x91,0xed,0x62,0xac,0x11,0x38,0x2,0x23,0xf,
|
||||
0x8,0x62,0x19,0xb0,0xe7,0x3e,0xca,0x22,0x8f,0x1,0x77,0xee,0x1b,0x8d,0x3c,0x38,
|
||||
0xa0,0x4e,0xce,0xeb,0xe9,0xfb,0x72,0x64,0xc1,0x82,0x5,0xc8,0x52,0x78,0x23,0x8f,
|
||||
0x91,0x8,0x17,0x83,0x73,0x1e,0x36,0x29,0x6,0x48,0xe4,0x79,0x0,0x2d,0xbf,0x44,
|
||||
0x8e,0x8b,0x87,0x50,0xe4,0xe1,0x89,0x38,0x10,0xa0,0x28,0xf2,0x70,0xe5,0x3a,0x10,
|
||||
0xa0,0x28,0xe7,0xe1,0xab,0xf3,0x4,0x80,0xd8,0x1e,0x88,0x1f,0x63,0x93,0x4,0x0,
|
||||
0xa7,0x60,0x4a,0x2f,0x7f,0x4f,0xa0,0xf9,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,
|
||||
0xae,0x42,0x60,0x82,
|
||||
// /Users/grauser/Documents/DEV/Qt/qwt-6.0.1/designer/pixmaps/qwtanalogclock.png
|
||||
0x0,0x0,0x1,0xa6,
|
||||
0x89,
|
||||
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
|
||||
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x2,0x0,0x0,0x0,0x4b,0xd6,0xfb,0x6c,
|
||||
0x0,0x0,0x1,0x6d,0x49,0x44,0x41,0x54,0x78,0x9c,0x9d,0x54,0x31,0x8e,0xc2,0x40,
|
||||
0xc,0x34,0x4b,0x58,0xb1,0x8f,0xd8,0x32,0x1d,0x95,0x85,0x44,0x8b,0xb6,0xa3,0x47,
|
||||
0xe2,0x7,0x54,0x48,0x34,0x3c,0x3,0xf1,0x3,0x5a,0xa4,0x48,0xf4,0x14,0x91,0x22,
|
||||
0x5e,0xe0,0x8a,0xce,0x65,0x5e,0xc0,0xf,0xae,0xf0,0x9d,0x65,0x36,0x90,0xcb,0xdd,
|
||||
0x54,0x6b,0xed,0xce,0x78,0xec,0x38,0x1e,0x11,0x11,0x18,0x30,0x33,0x0,0x3c,0x1e,
|
||||
0xf,0xef,0x7d,0x8,0xc1,0x5e,0xc5,0x18,0x1,0xa0,0x2c,0x4b,0x78,0x45,0x91,0xf1,
|
||||
0xef,0xf7,0x7b,0x8,0x61,0xb1,0x58,0xe8,0x53,0x44,0x94,0x34,0x4d,0xd3,0xe8,0x4b,
|
||||
0x2b,0xe4,0x2c,0xff,0x76,0xbb,0x2d,0x97,0xcb,0xd3,0xe9,0xd4,0x4d,0x5,0x0,0x29,
|
||||
0xa5,0x94,0x52,0xdb,0xb6,0x6a,0xf6,0x45,0x82,0x99,0xaf,0xd7,0xeb,0x6a,0xb5,0x7a,
|
||||
0x4b,0x56,0x20,0x62,0x57,0xc5,0x49,0x70,0x3e,0x9f,0xd7,0xeb,0xb5,0xf0,0x89,0x8,
|
||||
0x11,0x95,0x96,0x35,0x4b,0xec,0x58,0x95,0x11,0x11,0xed,0xf7,0xfb,0xdd,0x6e,0xf7,
|
||||
0x29,0xbf,0xc8,0x89,0xae,0x95,0x6b,0x9a,0x46,0x1a,0xec,0x98,0xd9,0x7b,0xbf,0xd9,
|
||||
0x6c,0x6c,0xe6,0xb7,0xc8,0xec,0x1c,0xe,0x87,0xef,0x42,0x2e,0x97,0xcb,0x76,0xbb,
|
||||
0x25,0xa2,0xcc,0x7f,0xf,0x10,0x51,0x1c,0x3d,0x9f,0x4f,0x0,0x28,0xbc,0xf7,0x5a,
|
||||
0x42,0xb7,0xec,0x7e,0x3b,0xf3,0xf9,0x9c,0x99,0xdd,0x74,0x3a,0x1d,0x42,0xeb,0x81,
|
||||
0xcb,0x46,0xf0,0x1f,0x28,0x42,0x8,0xda,0x82,0x9e,0x42,0xb2,0xcf,0xac,0x61,0x55,
|
||||
0x55,0x45,0x8,0x61,0x60,0xb,0x2c,0x94,0xc2,0xcc,0xc5,0x64,0x32,0x19,0xf8,0xfa,
|
||||
0x13,0xdc,0x6c,0x36,0xab,0xeb,0xfa,0x4f,0x16,0xb4,0xa,0x99,0x4e,0x7,0x0,0xe3,
|
||||
0xf1,0x38,0xbb,0xfb,0xd5,0x97,0x8c,0x86,0x84,0x5,0x0,0xc4,0x18,0x75,0x8a,0x7,
|
||||
0x1a,0x21,0x22,0xfd,0xcd,0x46,0x1a,0xb4,0x6d,0x9b,0x52,0xea,0xf7,0x6f,0xbb,0x28,
|
||||
0x87,0xb2,0x2c,0x1d,0xfc,0xec,0x8f,0x18,0xa3,0x2e,0x15,0x5b,0x91,0xfd,0xe4,0x72,
|
||||
0xb6,0x7c,0xd0,0x7d,0xd1,0x55,0xf9,0x84,0x8c,0xf,0x76,0x6b,0xa9,0xa,0x22,0x1e,
|
||||
0x8f,0xc7,0xb7,0xe4,0xaa,0xaa,0x32,0x3e,0x48,0x2f,0x7a,0x52,0x75,0xd1,0x5d,0x2b,
|
||||
0x5f,0xb,0x0,0xbe,0xfd,0x70,0x63,0x0,0x15,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,
|
||||
0x44,0xae,0x42,0x60,0x82,
|
||||
// /Users/grauser/Documents/DEV/Qt/qwt-6.0.1/designer/pixmaps/qwtcounter.png
|
||||
0x0,0x0,0x4,0x2,
|
||||
0x89,
|
||||
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
|
||||
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b,
|
||||
0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd2,0xa,0x9,0x15,0x9,0x2d,0x2a,
|
||||
0x6a,0xc6,0x8,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,
|
||||
0x0,0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,
|
||||
0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,0x3,0x91,0x49,0x44,0x41,0x54,
|
||||
0x78,0xda,0xad,0x95,0x5b,0x68,0x13,0x59,0x1c,0xc6,0xbf,0x5c,0x6d,0x6a,0xd2,0x34,
|
||||
0x69,0x2e,0xbd,0xc5,0x34,0x49,0xa1,0x46,0xbc,0x81,0x14,0x53,0x44,0xc5,0xdb,0x52,
|
||||
0x16,0xca,0xb2,0xb,0x22,0xfa,0x24,0xcb,0xae,0x3e,0x6d,0x1f,0x7c,0x13,0x65,0x97,
|
||||
0x85,0x45,0x41,0x45,0xc4,0xdb,0x83,0x88,0xa,0x8a,0xa2,0x20,0x8a,0xdd,0x15,0x41,
|
||||
0x1f,0x54,0x76,0xdb,0x2e,0x1b,0xb7,0xd5,0xd6,0x5a,0x35,0xb1,0x35,0x6d,0xc5,0x71,
|
||||
0x9a,0x9b,0x69,0x26,0xe9,0x34,0x33,0xc7,0x39,0x27,0xda,0x26,0x8a,0x9a,0x8a,0x1f,
|
||||
0x4c,0x38,0x27,0x9c,0xfc,0xe6,0x3b,0xdf,0xff,0x9f,0x73,0x54,0x28,0x90,0xb9,0x65,
|
||||
0x3d,0x49,0xf2,0x1c,0xbe,0x44,0x66,0xbb,0x13,0xc9,0xae,0x5b,0xaa,0x77,0x73,0x2d,
|
||||
0xfd,0x68,0xd8,0xb4,0x8d,0xc,0xdf,0xeb,0x42,0x4b,0xad,0x15,0x96,0x26,0x17,0xaa,
|
||||
0x8c,0x73,0x67,0x5,0x8d,0x4e,0xa4,0x21,0xa9,0xb5,0xb8,0xc4,0x2f,0x22,0xd,0xcb,
|
||||
0x5a,0x30,0x7c,0xf1,0x84,0x2a,0xff,0x86,0xc6,0x45,0xa4,0x75,0x89,0x1f,0x8d,0x35,
|
||||
0xe,0xf8,0xfd,0x7e,0xb8,0x5c,0x2e,0x98,0x4c,0xa6,0x92,0xa0,0x6a,0xb5,0x1a,0x84,
|
||||
0x10,0xe8,0xf5,0x7a,0x4,0x7,0x9f,0xa2,0x7d,0xcf,0x1,0x20,0xd4,0xa7,0xd2,0xd2,
|
||||
0xed,0x53,0xa7,0x14,0xda,0xd6,0xd6,0x86,0xe6,0xe6,0x66,0x18,0x8d,0x46,0xe8,0x74,
|
||||
0xba,0xcf,0x42,0x25,0x99,0x28,0x6e,0x27,0x91,0x11,0x73,0x70,0x56,0xcc,0x41,0x20,
|
||||
0x10,0x80,0xd3,0xe9,0xc4,0xb6,0x3f,0xe,0x10,0x35,0xcd,0xd4,0x62,0x9a,0xb,0xaf,
|
||||
0xd7,0xcb,0xa0,0x16,0x8b,0xa5,0x24,0x28,0x55,0x42,0x10,0x71,0xae,0x33,0x82,0xed,
|
||||
0xa7,0x83,0x18,0x78,0x36,0x8a,0x6c,0x36,0x8b,0xf9,0x3e,0xf,0x28,0x93,0x65,0x4c,
|
||||
0x33,0xad,0xaf,0xaf,0x67,0x4e,0x4b,0x15,0x75,0x1b,0x4f,0x4f,0x82,0x4f,0x65,0x71,
|
||||
0xff,0xf9,0x38,0xfe,0xed,0x49,0xc1,0x66,0xd4,0x63,0x81,0xcf,0x3b,0x53,0x3c,0xaa,
|
||||
0x52,0xb7,0x5f,0xe8,0xf6,0xc6,0x3,0xe,0x2f,0x92,0x79,0xf8,0xd1,0x8e,0x3e,0x78,
|
||||
0x6b,0x6d,0xb0,0x56,0x9a,0xf3,0xd9,0x17,0x2f,0x9e,0xc2,0xc9,0x3b,0x43,0x1f,0x1,
|
||||
0x4d,0xa1,0xfd,0x7c,0x2f,0xfa,0x46,0x93,0x6f,0xb3,0xcd,0x62,0x2c,0x91,0xc1,0x33,
|
||||
0x5e,0x80,0x24,0xc9,0xe0,0x26,0xa6,0xf0,0x30,0x34,0x8c,0x58,0x3c,0x1,0xa5,0x9a,
|
||||
0xc5,0xe0,0x5f,0xaf,0x3e,0xc4,0xce,0xcb,0xfd,0x1f,0x40,0xcf,0x77,0x8f,0x60,0xe3,
|
||||
0xf1,0x6e,0xdc,0x1e,0xe4,0xb1,0x72,0xef,0x1d,0x56,0xb0,0x53,0x77,0x9f,0xe3,0x7a,
|
||||
0x3f,0x87,0xbf,0xfb,0xc2,0x40,0x3c,0x82,0x44,0x22,0x89,0x93,0xd7,0xfe,0xc1,0xa3,
|
||||
0x70,0x84,0x81,0xb5,0x85,0x80,0xc3,0x5b,0x96,0xe2,0x82,0x2,0x79,0x5f,0x5b,0x2,
|
||||
0x2e,0xac,0x68,0xac,0x82,0xdb,0x56,0x8e,0x85,0xbb,0x6f,0xb2,0x2e,0xe8,0x1c,0x18,
|
||||
0x41,0x74,0xe0,0x3f,0x38,0x5e,0xd,0x41,0x16,0x5,0x20,0x37,0x9,0xe8,0xcb,0x11,
|
||||
0x8f,0x45,0x15,0xb0,0x5c,0xc,0xfe,0x94,0x28,0x74,0xed,0xbe,0xbb,0x4a,0xa1,0xf5,
|
||||
0xac,0xb5,0xe,0x6d,0x5e,0x88,0x70,0xa8,0xc,0xb1,0xe8,0x7c,0x48,0xb9,0x9c,0xb2,
|
||||
0x42,0xe9,0x65,0xa5,0x46,0x75,0xe,0x6b,0x71,0xf1,0x3e,0x96,0x6b,0x65,0xf9,0x4c,
|
||||
0x41,0x7f,0x5a,0xe5,0xc1,0x8f,0xa7,0x82,0x78,0x99,0x14,0xe1,0x9f,0xe7,0x40,0x5d,
|
||||
0x65,0x19,0x32,0x99,0x4c,0xd1,0x6f,0xc,0x6,0x3,0xfd,0xd7,0x7c,0x1a,0x5c,0x8,
|
||||
0x7d,0x17,0xc9,0x9e,0x3f,0x7,0x11,0x4b,0x8b,0xe8,0xe8,0x1d,0xc7,0xcb,0xd7,0x59,
|
||||
0xf0,0xca,0xf3,0x3a,0x9b,0xc3,0x53,0x6e,0x2,0x9a,0x34,0x8f,0x63,0x5b,0x97,0x7f,
|
||||
0xe8,0x98,0x3a,0xcc,0x49,0x64,0x7a,0x6e,0xfb,0xa5,0x3,0xe3,0x47,0xda,0xd8,0xf8,
|
||||
0xe7,0x33,0xf7,0xb0,0xcc,0x6d,0x41,0x85,0x41,0xab,0x44,0xa1,0x47,0x88,0x4b,0x61,
|
||||
0x24,0x41,0x5b,0x4d,0x44,0xff,0x58,0x12,0xa9,0xa1,0x1e,0xf8,0x75,0x3c,0x5e,0x44,
|
||||
0x1c,0x80,0x2c,0x17,0x77,0x45,0x77,0x28,0x8a,0xdf,0xbf,0x5f,0xc0,0x5a,0x8a,0x75,
|
||||
0xc9,0x77,0x7e,0x1c,0xbe,0x15,0x62,0xe3,0xe5,0x1e,0x2b,0x22,0x31,0x1,0x9d,0xbb,
|
||||
0xd6,0xb0,0x9c,0xbf,0x69,0x32,0xe1,0xf1,0x58,0xc,0xdd,0xe1,0x28,0x12,0xe1,0xff,
|
||||
0x61,0xe6,0x82,0xf8,0x76,0xb1,0x13,0x86,0xb7,0x56,0x8b,0x1c,0xb7,0x2e,0xae,0x46,
|
||||
0x6b,0xc1,0xbc,0x7d,0x7d,0xe3,0x4c,0xbe,0xab,0x3d,0xd3,0xe3,0x39,0x3a,0x2d,0x7c,
|
||||
0x35,0x16,0x58,0xd,0x3a,0x90,0xc9,0x28,0x34,0x89,0x8,0x2c,0xda,0x1c,0x5c,0xb5,
|
||||
0xd5,0xa8,0x76,0x2a,0x8e,0x55,0xea,0x62,0xc7,0xa5,0x4a,0xa5,0x1c,0x8a,0x6e,0x7b,
|
||||
0x5,0x76,0x6c,0x98,0x7,0x9b,0x36,0x83,0x4a,0x95,0x80,0x1f,0x36,0x4,0xe0,0x6b,
|
||||
0x50,0xe6,0x36,0x1b,0x5d,0x90,0x77,0x4c,0xcf,0xd3,0x9c,0xd2,0x32,0x92,0x24,0x41,
|
||||
0xa3,0xd1,0x94,0x4,0x2f,0xd3,0xeb,0xd0,0x54,0x57,0x85,0x6,0x23,0x81,0x60,0x35,
|
||||
0xc2,0xe3,0x76,0xa3,0xae,0xb6,0x6,0x23,0xaf,0xf8,0x3c,0x98,0x9e,0xfc,0xf1,0x54,
|
||||
0x9a,0x9d,0xa9,0xa2,0x28,0xe6,0xdb,0xa5,0x44,0xd7,0x1e,0xa7,0x19,0x47,0xb6,0xaf,
|
||||
0xc3,0x68,0xc4,0x7,0x5b,0x45,0x39,0xec,0x76,0x3b,0x6e,0x7,0x7b,0xd8,0x6d,0x92,
|
||||
0x97,0x72,0xd0,0xff,0xb6,0xff,0x20,0x99,0xad,0x64,0x59,0x26,0x82,0x20,0x10,0x8e,
|
||||
0xe3,0xd8,0x73,0xf6,0xca,0x35,0x42,0x59,0xd3,0x6f,0xa7,0x57,0x13,0xfd,0xe2,0xe2,
|
||||
0x5f,0x37,0xc8,0x83,0xc7,0x4f,0x66,0xd,0xef,0x1d,0x78,0x44,0x2e,0x74,0x5c,0x67,
|
||||
0xc,0x7a,0x71,0xb0,0x1d,0x15,0x6e,0xef,0x6b,0x5e,0xa6,0x6f,0x0,0x1e,0x59,0xe5,
|
||||
0x15,0x7,0x8d,0xbc,0x11,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,
|
||||
0x82,
|
||||
// /Users/grauser/Documents/DEV/Qt/qwt-6.0.1/designer/pixmaps/qwtcompass.png
|
||||
0x0,0x0,0x3,0xe0,
|
||||
0x89,
|
||||
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
|
||||
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x2,0x0,0x0,0x0,0x4b,0xd6,0xfb,0x6c,
|
||||
0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0,0xb,0x12,
|
||||
0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd3,0x4,
|
||||
0xe,0xd,0x34,0x33,0x41,0x3,0x14,0x60,0x0,0x0,0x3,0x7f,0x49,0x44,0x41,0x54,
|
||||
0x78,0x9c,0x6d,0x54,0xcb,0x6e,0xdb,0x46,0x14,0xbd,0xf3,0x20,0x45,0x72,0xc4,0x21,
|
||||
0xf4,0x82,0x64,0x4b,0xb5,0x90,0x8,0x96,0x83,0x78,0x55,0x67,0xdb,0xae,0xbc,0xc9,
|
||||
0xa6,0x5d,0x7,0x68,0x7f,0x21,0x9b,0x16,0x8,0xb2,0xce,0xb2,0xfd,0x85,0x7c,0x41,
|
||||
0x11,0x20,0x7f,0x11,0x78,0x99,0x38,0x80,0x5b,0x38,0x80,0x1d,0x55,0xb6,0x1e,0x21,
|
||||
0x44,0x4a,0x91,0xf8,0x18,0x92,0xc3,0xe9,0x82,0x82,0x22,0x5b,0xbd,0x2b,0xf2,0xc,
|
||||
0xef,0xb9,0xe7,0xde,0x73,0x39,0xe8,0xcd,0x5f,0x6f,0xe0,0x6e,0xe4,0x79,0xbe,0x58,
|
||||
0x2c,0xa2,0x38,0xd2,0x4b,0xba,0x6d,0xdb,0x94,0x50,0x95,0x2b,0x40,0x40,0x30,0x41,
|
||||
0x8,0xc1,0x4e,0xd0,0xed,0x17,0xa5,0xd4,0xcd,0xed,0x4d,0xae,0xf2,0x7e,0xbf,0xdf,
|
||||
0x6c,0x35,0x9,0x21,0xdb,0x47,0x61,0x18,0x6,0x41,0x90,0xc6,0x69,0x92,0x24,0xff,
|
||||
0x4f,0x91,0x24,0xc9,0xc5,0xe5,0xc5,0x93,0x93,0x27,0x7,0x7,0x7,0x1b,0xf0,0xfa,
|
||||
0xfa,0x1a,0x0,0x1e,0x3c,0x78,0x80,0x10,0x62,0x8c,0x31,0xc6,0xd2,0x24,0xd,0x56,
|
||||
0xc1,0x62,0xbe,0xc8,0xf3,0xfc,0xe,0x45,0x92,0x24,0x97,0x57,0x97,0xa7,0xa7,0xa7,
|
||||
0xdc,0xe6,0x5,0x22,0xa5,0x14,0x42,0x58,0x96,0x65,0x18,0xc6,0x72,0xb9,0xb4,0x6d,
|
||||
0xbb,0xc0,0x35,0x5d,0x73,0x2a,0xe,0x63,0x6c,0x3c,0x1a,0x4b,0x29,0x1,0x0,0x17,
|
||||
0x22,0x2f,0x2e,0x2f,0xf6,0xf7,0xf6,0xbd,0x99,0xb7,0x5a,0xae,0xf2,0x3c,0xf7,0x3c,
|
||||
0x2f,0x8a,0x22,0x8c,0x71,0xb3,0xd9,0x74,0x1c,0x87,0x52,0xea,0xfb,0x7e,0x71,0x34,
|
||||
0x99,0x4c,0xae,0xae,0xae,0xe2,0x24,0xee,0x74,0x3a,0xc5,0x68,0x28,0x0,0xc,0x86,
|
||||
0x83,0x93,0xef,0x4f,0xb2,0x2c,0x33,0x4d,0x53,0x8,0x21,0x73,0x59,0xad,0x56,0xb7,
|
||||
0xbb,0x35,0x4d,0xd3,0x34,0x4d,0x4a,0xe9,0x6a,0xb5,0x32,0xc,0x63,0x36,0x9b,0x61,
|
||||
0x8c,0x35,0x43,0xab,0x37,0xea,0xee,0x17,0x17,0x4b,0x29,0x65,0x2e,0xbb,0xdd,0x6e,
|
||||
0xaf,0xd7,0x6b,0x34,0x1a,0x54,0xa3,0x9c,0xf3,0xdd,0xb1,0x6b,0x9a,0xf6,0xe8,0xe8,
|
||||
0x51,0xa5,0x52,0x1,0x80,0xe3,0xe3,0x63,0xc6,0x98,0x94,0x72,0x7f,0x6f,0x9f,0x10,
|
||||
0x82,0x7d,0xdf,0xef,0xf7,0xfb,0xc5,0x77,0xf3,0xf9,0xdc,0x71,0x9c,0x5d,0xe7,0x30,
|
||||
0xc6,0xbd,0x87,0xbd,0xe9,0x97,0x69,0x14,0x45,0x8e,0xe3,0xf8,0xbe,0x5f,0xe0,0xa9,
|
||||
0x4c,0x6b,0xb5,0x1a,0x8e,0xa2,0xa8,0xdd,0x6e,0x17,0xf3,0xd3,0x75,0x7d,0xb7,0x3e,
|
||||
0x0,0x74,0xf,0xba,0x61,0x18,0xba,0xae,0xb,0x0,0x8,0x21,0x4a,0xa9,0x52,0xa,
|
||||
0x0,0x62,0x11,0xb7,0x5a,0x2d,0xac,0x95,0xb4,0xc2,0x7f,0x21,0x4,0xa5,0xf4,0x5e,
|
||||
0xb2,0x69,0x9a,0xed,0x76,0x9b,0x52,0x3a,0xbc,0x19,0x6e,0x40,0x84,0x50,0x9a,0xa6,
|
||||
0x85,0xf,0xe5,0x72,0x19,0x33,0xc6,0xd2,0x34,0x1d,0xc,0x6,0x93,0xc9,0xc4,0x30,
|
||||
0x8c,0x3b,0xf9,0x9f,0x3e,0xb5,0xfe,0xfe,0x27,0x11,0xc9,0xe7,0xc1,0xe7,0xa2,0x6c,
|
||||
0x11,0xba,0xae,0xbb,0xae,0x3b,0xfc,0x77,0x8,0x0,0x80,0x0,0xeb,0xba,0xae,0x69,
|
||||
0x1a,0x21,0xa4,0x56,0xab,0xdd,0x93,0xa0,0x8f,0xc7,0xe1,0x8b,0x17,0xf2,0xf5,0xeb,
|
||||
0x2c,0xcb,0xb6,0x71,0x42,0x88,0x65,0x59,0xdc,0xe1,0x6b,0xa,0x99,0x49,0x0,0xe8,
|
||||
0x74,0x3a,0x18,0xe3,0x28,0x8a,0xbe,0x59,0xe0,0xba,0xdf,0xfd,0xf1,0x67,0xfc,0xfc,
|
||||
0xb9,0xff,0xf3,0x4f,0xdb,0x12,0x0,0x20,0x8,0x2,0xd3,0x34,0x1d,0xc7,0x1,0x0,
|
||||
0x82,0x9,0x6,0x80,0x62,0x55,0x6d,0xdb,0x8e,0xe3,0x78,0x6d,0x41,0x14,0x3f,0xfc,
|
||||
0xed,0xf7,0xe9,0xaf,0xbf,0x2c,0x7e,0xfc,0x41,0x61,0x7c,0x4f,0x9d,0x94,0xb2,0x68,
|
||||
0xb9,0xa8,0x8a,0x4b,0x7a,0x29,0x8,0x82,0x75,0x65,0xaa,0x15,0x74,0xdd,0x57,0xaf,
|
||||
0xa2,0xa3,0xbe,0xfb,0xec,0xd9,0xae,0x3b,0x52,0x4a,0x4d,0xd3,0x8a,0x67,0x6e,0xf3,
|
||||
0xe9,0x74,0x8a,0x9,0x21,0xcb,0xaf,0xcb,0x2,0xb2,0x98,0xb5,0x5c,0x2e,0xab,0x6f,
|
||||
0xdf,0x52,0xcf,0x1b,0xbe,0x7c,0xb9,0x9b,0x9f,0x65,0x59,0x10,0x4,0xe5,0x72,0x79,
|
||||
0x4d,0xc1,0xf9,0x78,0x34,0xa6,0x0,0x90,0x88,0x24,0x8e,0xe3,0xd1,0x68,0x4,0xa,
|
||||
0xca,0x76,0x79,0xf8,0xf8,0xb1,0xff,0xf4,0xa9,0xda,0x31,0x58,0x4a,0x19,0x86,0x61,
|
||||
0x18,0x86,0x83,0xc1,0xa0,0xd7,0xeb,0xed,0xb5,0xf6,0x6e,0x6f,0x6e,0xb3,0x2c,0xa3,
|
||||
0x0,0xa0,0x72,0xb5,0xfa,0xba,0xb2,0x2c,0xcb,0x34,0x4d,0x84,0x10,0x3b,0x3a,0xf2,
|
||||
0x7c,0x9f,0x66,0x19,0x42,0x48,0xd7,0x75,0x42,0x48,0x10,0x4,0x85,0x7e,0xce,0xb9,
|
||||
0xa6,0x69,0x42,0x8,0xc6,0x58,0x99,0x95,0xcf,0xdf,0x9f,0xc3,0xe6,0x67,0x5f,0xad,
|
||||
0x56,0x8d,0x7a,0x83,0xd9,0xc,0x10,0x0,0x40,0xa5,0x52,0x51,0x4a,0xa5,0x69,0xea,
|
||||
0xfb,0xbe,0x61,0x18,0xa5,0x52,0x69,0xb3,0x32,0xa6,0x69,0x1e,0x1e,0x1e,0xb6,0x9a,
|
||||
0xad,0xb3,0x77,0x67,0xc5,0xe0,0xd6,0xd3,0x56,0xb9,0x9a,0xcd,0x66,0x22,0x16,0x18,
|
||||
0xad,0x91,0x42,0x2,0xa5,0x54,0x8,0xb1,0xbd,0x72,0xe,0x77,0x1a,0xb5,0xc6,0xd9,
|
||||
0xbb,0x33,0x21,0x44,0x81,0x7c,0x6b,0x58,0x4a,0x39,0x1e,0x8d,0x2b,0x95,0x4a,0xa3,
|
||||
0xd5,0xc0,0x80,0x45,0x2a,0x94,0x52,0x9b,0x7d,0xc3,0x18,0x73,0x9b,0x73,0xce,0x6f,
|
||||
0x6f,0x6e,0xcf,0xdf,0x9f,0x6f,0xae,0x2c,0xd8,0xbd,0x3b,0x3d,0xcf,0x9b,0xcf,0xe7,
|
||||
0xd5,0x6a,0xb5,0x5e,0xaf,0x73,0x9b,0x3,0x1,0x4a,0x28,0x21,0x24,0x8a,0xa2,0xe9,
|
||||
0x74,0xfa,0xf1,0xc3,0xc7,0x7b,0x9b,0xa,0x0,0xff,0x1,0xeb,0xd6,0xb9,0xfd,0x35,
|
||||
0x6a,0x40,0xa3,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
|
||||
// /Users/grauser/Documents/DEV/Qt/qwt-6.0.1/designer/pixmaps/qwtknob.png
|
||||
0x0,0x0,0x3,0x27,
|
||||
0x89,
|
||||
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
|
||||
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x2,0x0,0x0,0x0,0x4b,0xd6,0xfb,0x6c,
|
||||
0x0,0x0,0x0,0x2a,0x74,0x45,0x58,0x74,0x43,0x72,0x65,0x61,0x74,0x69,0x6f,0x6e,
|
||||
0x20,0x54,0x69,0x6d,0x65,0x0,0x4d,0x69,0x20,0x39,0x20,0x4f,0x6b,0x74,0x20,0x32,
|
||||
0x30,0x30,0x32,0x20,0x32,0x33,0x3a,0x31,0x32,0x3a,0x30,0x37,0x20,0x2b,0x30,0x31,
|
||||
0x30,0x30,0xcd,0x73,0xb0,0xc8,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd2,
|
||||
0xa,0x9,0x15,0xf,0x9,0x40,0x33,0x85,0x5f,0x0,0x0,0x0,0x9,0x70,0x48,0x59,
|
||||
0x73,0x0,0x0,0xe,0xc3,0x0,0x0,0xe,0xc3,0x1,0xc7,0x6f,0xa8,0x64,0x0,0x0,
|
||||
0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,
|
||||
0x2,0x80,0x49,0x44,0x41,0x54,0x78,0xda,0xad,0x54,0x6b,0x6b,0xd3,0x50,0x18,0x6e,
|
||||
0xd3,0x5b,0xd6,0x26,0xdd,0xb2,0x5e,0xd2,0x76,0x75,0x75,0x17,0x10,0xc6,0xaa,0x93,
|
||||
0xb5,0x9b,0x88,0x96,0x21,0x88,0xfe,0x6,0x61,0xf8,0x41,0xf0,0x8f,0x88,0x1f,0xfc,
|
||||
0xf,0xc2,0x44,0xf0,0xb3,0x82,0xb8,0x31,0xd1,0x8f,0x7e,0xd0,0x8d,0x2a,0xeb,0x6c,
|
||||
0xb3,0xae,0xdd,0x4c,0xb7,0x5e,0xd7,0xa4,0xcd,0x65,0x4d,0xba,0x66,0xa9,0x6f,0x8d,
|
||||
0xc,0x7b,0x5b,0x95,0xf9,0xe4,0x25,0x9c,0xf3,0x9c,0xf7,0x3d,0x3c,0xef,0x73,0x4e,
|
||||
0xa2,0xdf,0xf8,0xf4,0x5e,0x77,0x31,0x20,0x17,0xac,0x7,0x18,0xbb,0xa9,0x7d,0x9a,
|
||||
0x96,0xe5,0xba,0x7f,0xcc,0x87,0x63,0xd8,0x9f,0xfc,0x6e,0x7a,0x4f,0xae,0xc9,0x6e,
|
||||
0xb7,0x8b,0x24,0x5d,0x3,0x54,0xac,0xbc,0x78,0xc5,0x32,0x6c,0x3c,0x41,0x75,0xf0,
|
||||
0xf1,0xef,0x9,0x2a,0x99,0xfc,0x91,0xa1,0x3b,0x78,0x7d,0xb7,0x17,0x95,0x2a,0x97,
|
||||
0xcb,0xe5,0xa6,0x26,0xa7,0x50,0xd4,0xc,0xd3,0x83,0xc3,0xec,0x25,0xff,0x18,0xc,
|
||||
0xa8,0x64,0xca,0x68,0x44,0x46,0x9,0x2,0x62,0x40,0x23,0xc4,0xc8,0xb0,0xdd,0x8e,
|
||||
0x47,0xa3,0xdf,0x30,0x1c,0xe3,0x79,0x9e,0xa6,0x33,0x62,0x70,0xd6,0x64,0x32,0x3b,
|
||||
0x46,0x9,0x97,0xd3,0xf1,0x57,0x5e,0x0,0x58,0xb6,0x22,0x49,0x72,0x78,0xf1,0x86,
|
||||
0xd3,0xe9,0x86,0x69,0xb9,0x5c,0x5a,0x5b,0x5d,0xd,0xcd,0x5f,0xef,0x99,0xdc,0xd9,
|
||||
0x88,0x20,0x8a,0x5b,0x5b,0xdb,0x5e,0x9f,0xef,0x76,0xe4,0xe,0x5b,0x2e,0x4a,0x35,
|
||||
0x1,0xc8,0x21,0x2b,0x3e,0xea,0x24,0x3f,0x7e,0x58,0x67,0x18,0x66,0x7a,0x6a,0x82,
|
||||
0x74,0xbb,0x3a,0x55,0x9c,0xaa,0xaa,0xd2,0x50,0x9a,0x4d,0x15,0x45,0x51,0x9b,0xcd,
|
||||
0x66,0x36,0x99,0x6f,0xde,0x8a,0x64,0x33,0xa9,0xb3,0x24,0xd8,0xe8,0x80,0xe6,0x8f,
|
||||
0xa5,0xba,0xc1,0x80,0xb8,0x5c,0x4e,0x8d,0xac,0xc9,0x32,0xbc,0xad,0x28,0x6a,0x78,
|
||||
0xfc,0x68,0x99,0xe3,0xf8,0xe7,0x2b,0x2f,0x25,0xb9,0x95,0x51,0xc8,0x17,0x83,0xd7,
|
||||
0xe6,0x4e,0x4f,0xea,0x8a,0xd2,0x68,0x53,0xab,0xd7,0x83,0xbb,0x8a,0xa2,0x82,0x10,
|
||||
0x49,0x96,0x4a,0xc5,0xa3,0xd7,0x6f,0xde,0x6e,0xc5,0xe2,0xa1,0xf9,0xb9,0xd6,0xa1,
|
||||
0x32,0x2c,0x33,0x17,0x9c,0x1d,0xb1,0x3,0xf0,0x58,0x3c,0xe1,0x26,0xbd,0xb2,0x5c,
|
||||
0xeb,0xee,0x19,0x5c,0x56,0x55,0x5d,0x2c,0xb6,0x6d,0x34,0x1a,0x31,0x3b,0x36,0x33,
|
||||
0x73,0x25,0x30,0xee,0xff,0xdd,0xc8,0xf4,0xe4,0x24,0x84,0x96,0xa7,0xb1,0x1a,0xa0,
|
||||
0xc1,0x6a,0x85,0x73,0x38,0xda,0x8e,0x30,0x10,0x18,0xf7,0x79,0x3c,0x30,0xf0,0x92,
|
||||
0x64,0xef,0xab,0x55,0x2e,0x33,0xa5,0x62,0x1e,0x45,0xad,0x50,0xff,0xe4,0xe9,0x33,
|
||||
0x5e,0xe0,0xcf,0x96,0xaa,0x1c,0x8f,0x20,0xad,0x84,0x8e,0x92,0xb6,0x2d,0xc0,0xa1,
|
||||
0x85,0x70,0x28,0x1a,0xdd,0x1c,0x71,0xba,0x3f,0x7f,0xd9,0x7c,0xb8,0xfc,0x60,0xe2,
|
||||
0x72,0x40,0x5b,0x52,0x9b,0xcd,0x7d,0xfa,0x50,0x14,0xf8,0xa5,0xa5,0x8,0xc3,0x54,
|
||||
0xfa,0xde,0xb,0xb0,0x17,0xa2,0xa1,0x34,0xbe,0x6e,0x6e,0x20,0x6,0xb,0x86,0xdb,
|
||||
0xa1,0xf2,0x97,0x59,0xd5,0xf4,0x5e,0xc6,0xef,0x6b,0x9d,0xa5,0x6d,0x68,0x8,0xa2,
|
||||
0xaf,0xa,0xd,0xc,0xc3,0xda,0x71,0x6c,0x21,0x74,0xf5,0xf8,0x58,0x4a,0x50,0x69,
|
||||
0x8,0x18,0xc0,0xd4,0xeb,0xf5,0x14,0x4b,0x47,0xd0,0xe0,0x80,0xab,0xf5,0x6e,0x6d,
|
||||
0xfd,0xfe,0xbd,0xbb,0x6,0xa4,0xf7,0x4f,0x0,0xea,0xf3,0x85,0x42,0x36,0x9b,0x13,
|
||||
0x45,0x11,0xc3,0xb0,0xc5,0x70,0xa8,0x87,0xa,0x6a,0x27,0xd5,0xaf,0x1e,0x0,0x4b,
|
||||
0x4,0x41,0x24,0x12,0x3b,0x14,0xb5,0xcb,0x71,0x42,0x6f,0x15,0x9c,0x20,0xc,0xe3,
|
||||
0xb8,0xae,0x3f,0xc0,0x9d,0xc6,0x9,0x3c,0xd,0xb5,0xa9,0x6a,0x99,0x9d,0x9f,0xd9,
|
||||
0xf9,0xf5,0x2d,0xd9,0x7a,0xbd,0xc5,0x62,0x86,0x38,0xcf,0xce,0x7f,0xc5,0x7f,0xd8,
|
||||
0xe2,0x27,0x25,0x35,0x22,0x3,0x9a,0x52,0xcb,0xd9,0x0,0x0,0x0,0x0,0x49,0x45,
|
||||
0x4e,0x44,0xae,0x42,0x60,0x82,
|
||||
// /Users/grauser/Documents/DEV/Qt/qwt-6.0.1/designer/pixmaps/qwtthermo.png
|
||||
0x0,0x0,0x2,0x44,
|
||||
0x89,
|
||||
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
|
||||
0x0,0x0,0xd,0x0,0x0,0x0,0x16,0x8,0x2,0x0,0x0,0x0,0x94,0x98,0x81,0x73,
|
||||
0x0,0x0,0x0,0x2a,0x74,0x45,0x58,0x74,0x43,0x72,0x65,0x61,0x74,0x69,0x6f,0x6e,
|
||||
0x20,0x54,0x69,0x6d,0x65,0x0,0x4d,0x69,0x20,0x39,0x20,0x4f,0x6b,0x74,0x20,0x32,
|
||||
0x30,0x30,0x32,0x20,0x32,0x33,0x3a,0x30,0x33,0x3a,0x31,0x31,0x20,0x2b,0x30,0x31,
|
||||
0x30,0x30,0x4c,0x45,0x31,0x92,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd2,
|
||||
0xa,0x1b,0xf,0x2,0x6,0x8e,0x83,0x5f,0x31,0x0,0x0,0x0,0x9,0x70,0x48,0x59,
|
||||
0x73,0x0,0x0,0xe,0x74,0x0,0x0,0xe,0x74,0x1,0x6b,0x24,0xb3,0xd6,0x0,0x0,
|
||||
0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,
|
||||
0x1,0x9d,0x49,0x44,0x41,0x54,0x78,0xda,0x8d,0x53,0xd9,0x6a,0xc2,0x50,0x10,0xcd,
|
||||
0xe6,0x52,0x12,0x22,0x62,0x44,0x51,0x7c,0xd0,0x44,0x83,0xa2,0xe2,0x77,0xb4,0x8f,
|
||||
0xfd,0x64,0x5f,0x84,0x56,0x2b,0x42,0xab,0xf,0x22,0x28,0xa6,0x5a,0x97,0x98,0xa8,
|
||||
0x91,0xba,0xd2,0xa3,0x57,0x34,0xca,0x6d,0xe9,0x81,0x84,0x99,0x9b,0x99,0x33,0xe7,
|
||||
0xce,0x4c,0xd8,0x72,0xb9,0xcc,0xfc,0x3,0x2,0x9e,0x6a,0xb5,0x2a,0x49,0xd2,0xf2,
|
||||
0x4,0x4d,0xd3,0xe2,0xf1,0xf8,0x62,0xb1,0xc0,0xf9,0x6e,0xb7,0xeb,0xf5,0x7a,0xb9,
|
||||
0x5c,0xce,0xe3,0xf1,0x70,0xf0,0x39,0x8e,0x5b,0xad,0x56,0xfb,0xfd,0x5e,0x10,0x84,
|
||||
0xd9,0x6c,0x86,0x93,0xd1,0x68,0xd4,0x6c,0x36,0x2b,0x95,0x4a,0x24,0x12,0x51,0x55,
|
||||
0xf5,0xcc,0x87,0xc,0xbc,0xd7,0x27,0x84,0xc3,0x61,0xd8,0xa2,0x28,0xb6,0x5a,0x2d,
|
||||
0xe4,0x5f,0xea,0x1e,0x2d,0x9f,0xcf,0x77,0x38,0x1c,0xc0,0x87,0x42,0xe4,0x34,0x1a,
|
||||
0x8d,0xa2,0xfa,0xbd,0x3e,0x0,0xd9,0x96,0x65,0xf9,0xfd,0xfe,0xc9,0x64,0x52,0x28,
|
||||
0x14,0xea,0xf5,0xfa,0xdd,0x3d,0xce,0xcc,0x28,0x14,0x8,0x4,0xb6,0xdb,0x6d,0x28,
|
||||
0x14,0x82,0x5b,0x2a,0x95,0xc8,0x79,0xa7,0x63,0x2d,0x97,0x9b,0x2b,0x5f,0x26,0x93,
|
||||
0x71,0x67,0xf,0x87,0x43,0xc7,0x61,0xde,0x3f,0xe4,0xd7,0x97,0x37,0x5d,0x2f,0x22,
|
||||
0xf7,0xcc,0x67,0x18,0x46,0xbb,0xdd,0xae,0xd5,0x6a,0xb6,0x6d,0x13,0x7d,0xdf,0x6b,
|
||||
0xc6,0xf8,0x7c,0x60,0x39,0xfe,0xa6,0x6e,0x7,0x5,0x2c,0x8b,0x65,0x59,0x18,0x70,
|
||||
0x7f,0xd5,0x97,0xcd,0x66,0x15,0x45,0xf1,0x7a,0xbd,0x30,0xe0,0xa2,0xdb,0xe6,0x74,
|
||||
0x4a,0xb9,0xaf,0x72,0x82,0xfb,0x83,0x2c,0xcb,0x94,0xb8,0xf1,0x78,0xc,0x7d,0x64,
|
||||
0x6e,0xc9,0x64,0x72,0x30,0x18,0xd0,0xeb,0x9a,0xa6,0x9,0x7d,0xe8,0xf6,0x66,0x73,
|
||||
0xec,0x42,0x2c,0x16,0xa3,0xec,0x1,0xa0,0xeb,0x7a,0x3a,0x9d,0x46,0x1c,0x46,0xc,
|
||||
0x17,0x7b,0xc0,0xba,0x86,0x76,0xe5,0x9b,0xcf,0xe7,0xe8,0x19,0x2e,0x8b,0xe9,0x91,
|
||||
0xbe,0xf0,0x3c,0x4f,0x89,0x3,0xba,0xdd,0xae,0xe3,0x38,0x8d,0x46,0xe3,0xaf,0xbe,
|
||||
0x60,0xcf,0xb0,0x29,0xd8,0x97,0x44,0x22,0xe1,0x9e,0xdb,0xbd,0xbe,0x7c,0x3e,0x4f,
|
||||
0xda,0x76,0x99,0x1b,0x9d,0x8f,0x0,0x8b,0x89,0x6,0x11,0x7d,0x74,0x3e,0x2,0x2c,
|
||||
0x62,0xbf,0xdf,0x87,0x0,0xe8,0x93,0x44,0xe6,0xe9,0x31,0xa8,0xa9,0xcf,0xa9,0x54,
|
||||
0xd0,0xb6,0xbf,0x6e,0xe2,0xf0,0x97,0x90,0x2d,0x77,0xeb,0x43,0x10,0xde,0x3f,0x4,
|
||||
0xb,0xc6,0xcd,0x1c,0x98,0xbd,0xf5,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,
|
||||
0x42,0x60,0x82,
|
||||
// /Users/grauser/Documents/DEV/Qt/qwt-6.0.1/designer/pixmaps/qwtwidget.png
|
||||
0x0,0x0,0x4,0x36,
|
||||
0x89,
|
||||
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
|
||||
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x3,0x0,0x0,0x0,0xf3,0x6a,0x9c,0x9,
|
||||
0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd2,0xa,0x9,0x12,0x32,0xe,0xb1,
|
||||
0xf0,0x4e,0xc7,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,
|
||||
0x0,0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,
|
||||
0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,0x3,0x0,0x50,0x4c,0x54,0x45,
|
||||
0xf7,0x0,0x0,0xf7,0x8,0x8,0xf7,0x10,0x10,0xff,0x10,0x10,0xff,0x18,0x18,0xff,
|
||||
0x21,0x21,0xff,0x29,0x29,0xff,0x31,0x31,0xff,0x39,0x39,0xff,0x42,0x42,0xff,0x52,
|
||||
0x52,0xff,0x5a,0x5a,0xff,0x63,0x63,0xff,0x6b,0x6b,0xff,0x73,0x73,0xff,0x7b,0x7b,
|
||||
0xff,0x84,0x84,0xff,0x8c,0x8c,0xff,0x94,0x94,0xff,0x9c,0x9c,0xff,0xa5,0xa5,0xff,
|
||||
0xad,0xad,0xff,0xb5,0xb5,0xff,0xbd,0xbd,0xff,0xc6,0xc6,0xff,0xce,0xce,0xff,0xd6,
|
||||
0xd6,0xff,0xde,0xde,0xff,0xe7,0xe7,0xff,0xef,0xef,0xff,0xf7,0xf7,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0x21,0x6a,0xf5,0x10,0x0,0x0,0x0,0x20,0x74,0x52,0x4e,0x53,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x5c,0x5c,0x1b,0xed,
|
||||
0x0,0x0,0x0,0x8d,0x49,0x44,0x41,0x54,0x78,0xda,0xbd,0x90,0xdd,0xa,0xc3,0x20,
|
||||
0xc,0x85,0x8d,0xd0,0xfa,0x53,0xb3,0xb6,0xae,0x15,0x5b,0xd4,0xf3,0xfe,0x6f,0xb9,
|
||||
0xb8,0xab,0x6d,0xf4,0x72,0x5b,0x8,0xe4,0xf0,0x41,0x38,0x39,0x51,0xb8,0x2c,0xf5,
|
||||
0x53,0xdc,0xa2,0xd1,0xa1,0x7d,0xe2,0xe6,0xb8,0xb6,0x99,0xdf,0x20,0x43,0xad,0x93,
|
||||
0xcc,0xaa,0x5f,0x60,0x9,0x9,0xca,0xe4,0x2e,0x9,0xd0,0x94,0x61,0xf,0xc,0x22,
|
||||
0x8,0x8a,0x3a,0xcd,0xa3,0x6c,0xc,0x28,0x1a,0xad,0xf7,0x9,0xa5,0xab,0x60,0xbf,
|
||||
0x0,0x5b,0xc0,0xea,0xb1,0x33,0x92,0x15,0xcb,0x69,0x6e,0x95,0x9d,0x5c,0x12,0xf6,
|
||||
0x64,0xe3,0x61,0x2a,0xf8,0x2e,0xb8,0x38,0x1a,0xe3,0xd3,0x5e,0xc7,0x8d,0xec,0x9,
|
||||
0xdc,0x68,0xe9,0x71,0xa8,0x94,0x7a,0x91,0x92,0xc9,0x97,0xff,0x7e,0xf0,0xb,0xf8,
|
||||
0x1,0x79,0x65,0x34,0x9a,0xd3,0x83,0x54,0x7c,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,
|
||||
0x44,0xae,0x42,0x60,0x82,
|
||||
|
||||
};
|
||||
|
||||
static const unsigned char qt_resource_name[] = {
|
||||
// pixmaps
|
||||
0x0,0x7,
|
||||
0x7,0xf,0x38,0x93,
|
||||
0x0,0x70,
|
||||
0x0,0x69,0x0,0x78,0x0,0x6d,0x0,0x61,0x0,0x70,0x0,0x73,
|
||||
// qwtslider.png
|
||||
0x0,0xd,
|
||||
0xb,0x12,0x13,0x47,
|
||||
0x0,0x71,
|
||||
0x0,0x77,0x0,0x74,0x0,0x73,0x0,0x6c,0x0,0x69,0x0,0x64,0x0,0x65,0x0,0x72,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
|
||||
// qwtdial.png
|
||||
0x0,0xb,
|
||||
0xf,0x8e,0x82,0x7,
|
||||
0x0,0x71,
|
||||
0x0,0x77,0x0,0x74,0x0,0x64,0x0,0x69,0x0,0x61,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
|
||||
// qwtwheel.png
|
||||
0x0,0xc,
|
||||
0x4,0xa2,0x2c,0x87,
|
||||
0x0,0x71,
|
||||
0x0,0x77,0x0,0x74,0x0,0x77,0x0,0x68,0x0,0x65,0x0,0x65,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
|
||||
// qwtplot.png
|
||||
0x0,0xb,
|
||||
0x3,0x96,0x81,0xa7,
|
||||
0x0,0x71,
|
||||
0x0,0x77,0x0,0x74,0x0,0x70,0x0,0x6c,0x0,0x6f,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
|
||||
// qwtscale.png
|
||||
0x0,0xc,
|
||||
0xb,0x3d,0x24,0x67,
|
||||
0x0,0x71,
|
||||
0x0,0x77,0x0,0x74,0x0,0x73,0x0,0x63,0x0,0x61,0x0,0x6c,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
|
||||
// qwtanalogclock.png
|
||||
0x0,0x12,
|
||||
0x3,0xcf,0x42,0x7,
|
||||
0x0,0x71,
|
||||
0x0,0x77,0x0,0x74,0x0,0x61,0x0,0x6e,0x0,0x61,0x0,0x6c,0x0,0x6f,0x0,0x67,0x0,0x63,0x0,0x6c,0x0,0x6f,0x0,0x63,0x0,0x6b,0x0,0x2e,0x0,0x70,0x0,0x6e,
|
||||
0x0,0x67,
|
||||
// qwtcounter.png
|
||||
0x0,0xe,
|
||||
0x7,0x91,0x99,0xc7,
|
||||
0x0,0x71,
|
||||
0x0,0x77,0x0,0x74,0x0,0x63,0x0,0x6f,0x0,0x75,0x0,0x6e,0x0,0x74,0x0,0x65,0x0,0x72,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
|
||||
// qwtcompass.png
|
||||
0x0,0xe,
|
||||
0x5,0xf2,0x81,0xa7,
|
||||
0x0,0x71,
|
||||
0x0,0x77,0x0,0x74,0x0,0x63,0x0,0x6f,0x0,0x6d,0x0,0x70,0x0,0x61,0x0,0x73,0x0,0x73,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
|
||||
// qwtknob.png
|
||||
0x0,0xb,
|
||||
0x5,0xa4,0x81,0x7,
|
||||
0x0,0x71,
|
||||
0x0,0x77,0x0,0x74,0x0,0x6b,0x0,0x6e,0x0,0x6f,0x0,0x62,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
|
||||
// qwtthermo.png
|
||||
0x0,0xd,
|
||||
0x9,0x19,0xb,0x27,
|
||||
0x0,0x71,
|
||||
0x0,0x77,0x0,0x74,0x0,0x74,0x0,0x68,0x0,0x65,0x0,0x72,0x0,0x6d,0x0,0x6f,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
|
||||
// qwtwidget.png
|
||||
0x0,0xd,
|
||||
0xc,0x10,0xe9,0xe7,
|
||||
0x0,0x71,
|
||||
0x0,0x77,0x0,0x74,0x0,0x77,0x0,0x69,0x0,0x64,0x0,0x67,0x0,0x65,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
|
||||
|
||||
};
|
||||
|
||||
static const unsigned char qt_resource_struct[] = {
|
||||
// :
|
||||
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
|
||||
// :/pixmaps
|
||||
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0xb,0x0,0x0,0x0,0x2,
|
||||
// :/pixmaps/qwtplot.png
|
||||
0x0,0x0,0x0,0x6e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x4,0xab,
|
||||
// :/pixmaps/qwtanalogclock.png
|
||||
0x0,0x0,0x0,0xa8,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x8,0x47,
|
||||
// :/pixmaps/qwtwheel.png
|
||||
0x0,0x0,0x0,0x50,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x3,0x7d,
|
||||
// :/pixmaps/qwtknob.png
|
||||
0x0,0x0,0x1,0x16,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x11,0xdb,
|
||||
// :/pixmaps/qwtcompass.png
|
||||
0x0,0x0,0x0,0xf4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xd,0xf7,
|
||||
// :/pixmaps/qwtcounter.png
|
||||
0x0,0x0,0x0,0xd2,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x9,0xf1,
|
||||
// :/pixmaps/qwtthermo.png
|
||||
0x0,0x0,0x1,0x32,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x15,0x6,
|
||||
// :/pixmaps/qwtslider.png
|
||||
0x0,0x0,0x0,0x14,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
|
||||
// :/pixmaps/qwtscale.png
|
||||
0x0,0x0,0x0,0x8a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x6,0xce,
|
||||
// :/pixmaps/qwtwidget.png
|
||||
0x0,0x0,0x1,0x52,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x17,0x4e,
|
||||
// :/pixmaps/qwtdial.png
|
||||
0x0,0x0,0x0,0x34,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1,0xc8,
|
||||
|
||||
};
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
extern Q_CORE_EXPORT bool qRegisterResourceData
|
||||
(int, const unsigned char *, const unsigned char *, const unsigned char *);
|
||||
|
||||
extern Q_CORE_EXPORT bool qUnregisterResourceData
|
||||
(int, const unsigned char *, const unsigned char *, const unsigned char *);
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
||||
int QT_MANGLE_NAMESPACE(qInitResources_qwt_designer_plugin)()
|
||||
{
|
||||
QT_PREPEND_NAMESPACE(qRegisterResourceData)
|
||||
(0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_qwt_designer_plugin))
|
||||
|
||||
int QT_MANGLE_NAMESPACE(qCleanupResources_qwt_designer_plugin)()
|
||||
{
|
||||
QT_PREPEND_NAMESPACE(qUnregisterResourceData)
|
||||
(0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Q_DESTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qCleanupResources_qwt_designer_plugin))
|
||||
@@ -1,23 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
################################################################
|
||||
|
||||
include( $${PWD}/../examples.pri )
|
||||
|
||||
TARGET = bode
|
||||
|
||||
HEADERS = \
|
||||
mainwindow.h \
|
||||
plot.h \
|
||||
complexnumber.h \
|
||||
pixmaps.h
|
||||
|
||||
SOURCES = \
|
||||
plot.cpp \
|
||||
mainwindow.cpp \
|
||||
main.cpp
|
||||
@@ -1,83 +0,0 @@
|
||||
#ifndef _COMPLEX_NUMBER_H_
|
||||
#define _COMPLEX_NUMBER_H_
|
||||
|
||||
#include <math.h>
|
||||
|
||||
class ComplexNumber
|
||||
{
|
||||
public:
|
||||
ComplexNumber() ;
|
||||
ComplexNumber(double r, double i = 0.0);
|
||||
|
||||
double real() const;
|
||||
double imag() const;
|
||||
|
||||
friend ComplexNumber operator*(
|
||||
const ComplexNumber &, const ComplexNumber &);
|
||||
|
||||
friend ComplexNumber operator+(
|
||||
const ComplexNumber &, const ComplexNumber &);
|
||||
|
||||
friend ComplexNumber operator-(
|
||||
const ComplexNumber &, const ComplexNumber &);
|
||||
friend ComplexNumber operator/(
|
||||
const ComplexNumber &, const ComplexNumber &);
|
||||
|
||||
private:
|
||||
double d_real;
|
||||
double d_imag;
|
||||
};
|
||||
|
||||
inline ComplexNumber::ComplexNumber():
|
||||
d_real(0.0),
|
||||
d_imag(-0.0)
|
||||
{
|
||||
}
|
||||
|
||||
inline ComplexNumber::ComplexNumber(double re, double im):
|
||||
d_real(re),
|
||||
d_imag(im)
|
||||
{
|
||||
}
|
||||
|
||||
inline double ComplexNumber::real() const
|
||||
{
|
||||
return d_real;
|
||||
}
|
||||
|
||||
inline double ComplexNumber::imag() const
|
||||
{
|
||||
return d_imag;
|
||||
}
|
||||
|
||||
inline ComplexNumber operator+(
|
||||
const ComplexNumber &x1, const ComplexNumber &x2)
|
||||
{
|
||||
return ComplexNumber(x1.d_real + x2.d_real, x1.d_imag + x2.d_imag);
|
||||
}
|
||||
|
||||
inline ComplexNumber operator-(
|
||||
const ComplexNumber &x1, const ComplexNumber &x2)
|
||||
{
|
||||
return ComplexNumber(x1.d_real - x2.d_real, x1.d_imag - x2.d_imag);
|
||||
}
|
||||
|
||||
inline ComplexNumber operator*(
|
||||
const ComplexNumber &x1, const ComplexNumber &x2)
|
||||
{
|
||||
return ComplexNumber(x1.d_real * x2.d_real - x1.d_imag * x2.d_imag,
|
||||
x1.d_real * x2.d_imag + x2.d_real * x1.d_imag);
|
||||
}
|
||||
|
||||
inline ComplexNumber operator/(
|
||||
const ComplexNumber &x1, const ComplexNumber &x2)
|
||||
{
|
||||
double denom = x2.d_real * x2.d_real + x2.d_imag * x2.d_imag;
|
||||
|
||||
return ComplexNumber(
|
||||
(x1.d_real * x2.d_real + x1.d_imag * x2.d_imag) / denom,
|
||||
(x1.d_imag * x2.d_real - x2.d_imag * x1.d_real) / denom
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,13 +0,0 @@
|
||||
#include <qapplication.h>
|
||||
#include "mainwindow.h"
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
MainWindow w;
|
||||
w.resize(540,400);
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@@ -1,276 +0,0 @@
|
||||
#include <qregexp.h>
|
||||
#include <qtoolbar.h>
|
||||
#include <qtoolbutton.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlayout.h>
|
||||
#include <qstatusbar.h>
|
||||
#include <qprinter.h>
|
||||
#include <qpicture.h>
|
||||
#include <qpainter.h>
|
||||
#include <qfiledialog.h>
|
||||
#include <qimagewriter.h>
|
||||
#include <qprintdialog.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qwt_counter.h>
|
||||
#include <qwt_picker_machine.h>
|
||||
#include <qwt_plot_zoomer.h>
|
||||
#include <qwt_plot_panner.h>
|
||||
#include <qwt_plot_renderer.h>
|
||||
#include <qwt_text.h>
|
||||
#include <qwt_math.h>
|
||||
#include "pixmaps.h"
|
||||
#include "plot.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
class Zoomer: public QwtPlotZoomer
|
||||
{
|
||||
public:
|
||||
Zoomer(int xAxis, int yAxis, QwtPlotCanvas *canvas):
|
||||
QwtPlotZoomer(xAxis, yAxis, canvas)
|
||||
{
|
||||
setTrackerMode(QwtPicker::AlwaysOff);
|
||||
setRubberBand(QwtPicker::NoRubberBand);
|
||||
|
||||
// RightButton: zoom out by 1
|
||||
// Ctrl+RightButton: zoom out to full size
|
||||
|
||||
setMousePattern(QwtEventPattern::MouseSelect2,
|
||||
Qt::RightButton, Qt::ControlModifier);
|
||||
setMousePattern(QwtEventPattern::MouseSelect3,
|
||||
Qt::RightButton);
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
//
|
||||
// bode.cpp -- A demo program featuring QwtPlot and QwtCounter
|
||||
//
|
||||
// This example demonstrates the mapping of different curves
|
||||
// to different axes in a QwtPlot widget. It also shows how to
|
||||
// display the cursor position and how to implement zooming.
|
||||
//
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent):
|
||||
QMainWindow(parent)
|
||||
{
|
||||
d_plot = new Plot(this);
|
||||
|
||||
const int margin = 5;
|
||||
d_plot->setContentsMargins( margin, margin, margin, 0 );
|
||||
|
||||
setContextMenuPolicy(Qt::NoContextMenu);
|
||||
|
||||
d_zoomer[0] = new Zoomer( QwtPlot::xBottom, QwtPlot::yLeft,
|
||||
d_plot->canvas());
|
||||
d_zoomer[0]->setRubberBand(QwtPicker::RectRubberBand);
|
||||
d_zoomer[0]->setRubberBandPen(QColor(Qt::green));
|
||||
d_zoomer[0]->setTrackerMode(QwtPicker::ActiveOnly);
|
||||
d_zoomer[0]->setTrackerPen(QColor(Qt::white));
|
||||
|
||||
d_zoomer[1] = new Zoomer(QwtPlot::xTop, QwtPlot::yRight,
|
||||
d_plot->canvas());
|
||||
|
||||
d_panner = new QwtPlotPanner(d_plot->canvas());
|
||||
d_panner->setMouseButton(Qt::MidButton);
|
||||
|
||||
d_picker = new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft,
|
||||
QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOn,
|
||||
d_plot->canvas());
|
||||
d_picker->setStateMachine(new QwtPickerDragPointMachine());
|
||||
d_picker->setRubberBandPen(QColor(Qt::green));
|
||||
d_picker->setRubberBand(QwtPicker::CrossRubberBand);
|
||||
d_picker->setTrackerPen(QColor(Qt::white));
|
||||
|
||||
setCentralWidget(d_plot);
|
||||
|
||||
QToolBar *toolBar = new QToolBar(this);
|
||||
|
||||
QToolButton *btnZoom = new QToolButton(toolBar);
|
||||
btnZoom->setText("Zoom");
|
||||
btnZoom->setIcon(QIcon(zoom_xpm));
|
||||
btnZoom->setCheckable(true);
|
||||
btnZoom->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
||||
toolBar->addWidget(btnZoom);
|
||||
connect(btnZoom, SIGNAL(toggled(bool)), SLOT(enableZoomMode(bool)));
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
QToolButton *btnPrint = new QToolButton(toolBar);
|
||||
btnPrint->setText("Print");
|
||||
btnPrint->setIcon(QIcon(print_xpm));
|
||||
btnPrint->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
||||
toolBar->addWidget(btnPrint);
|
||||
connect(btnPrint, SIGNAL(clicked()), SLOT(print()));
|
||||
#endif
|
||||
|
||||
QToolButton *btnExport = new QToolButton(toolBar);
|
||||
btnExport->setText("Export");
|
||||
btnExport->setIcon(QIcon(print_xpm));
|
||||
btnExport->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
||||
toolBar->addWidget(btnExport);
|
||||
connect(btnExport, SIGNAL(clicked()), SLOT(exportDocument()));
|
||||
|
||||
toolBar->addSeparator();
|
||||
|
||||
QWidget *hBox = new QWidget(toolBar);
|
||||
|
||||
QHBoxLayout *layout = new QHBoxLayout(hBox);
|
||||
layout->setSpacing(0);
|
||||
layout->addWidget(new QWidget(hBox), 10); // spacer
|
||||
layout->addWidget(new QLabel("Damping Factor", hBox), 0);
|
||||
layout->addSpacing(10);
|
||||
|
||||
QwtCounter *cntDamp = new QwtCounter(hBox);
|
||||
cntDamp->setRange(0.0, 5.0, 0.01);
|
||||
cntDamp->setValue(0.0);
|
||||
|
||||
layout->addWidget(cntDamp, 0);
|
||||
|
||||
(void)toolBar->addWidget(hBox);
|
||||
|
||||
addToolBar(toolBar);
|
||||
#ifndef QT_NO_STATUSBAR
|
||||
(void)statusBar();
|
||||
#endif
|
||||
|
||||
enableZoomMode(false);
|
||||
showInfo();
|
||||
|
||||
connect(cntDamp, SIGNAL(valueChanged(double)),
|
||||
d_plot, SLOT(setDamp(double)));
|
||||
|
||||
connect(d_picker, SIGNAL(moved(const QPoint &)),
|
||||
SLOT(moved(const QPoint &)));
|
||||
connect(d_picker, SIGNAL(selected(const QPolygon &)),
|
||||
SLOT(selected(const QPolygon &)));
|
||||
}
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
void MainWindow::print()
|
||||
{
|
||||
QPrinter printer(QPrinter::HighResolution);
|
||||
|
||||
QString docName = d_plot->title().text();
|
||||
if ( !docName.isEmpty() )
|
||||
{
|
||||
docName.replace (QRegExp (QString::fromLatin1 ("\n")), tr (" -- "));
|
||||
printer.setDocName (docName);
|
||||
}
|
||||
|
||||
printer.setCreator("Bode example");
|
||||
printer.setOrientation(QPrinter::Landscape);
|
||||
|
||||
QPrintDialog dialog(&printer);
|
||||
if ( dialog.exec() )
|
||||
{
|
||||
QwtPlotRenderer renderer;
|
||||
|
||||
if ( printer.colorMode() == QPrinter::GrayScale )
|
||||
{
|
||||
renderer.setDiscardFlag(QwtPlotRenderer::DiscardCanvasBackground);
|
||||
renderer.setLayoutFlag(QwtPlotRenderer::FrameWithScales);
|
||||
}
|
||||
|
||||
renderer.renderTo(d_plot, printer);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void MainWindow::exportDocument()
|
||||
{
|
||||
#ifndef QT_NO_PRINTER
|
||||
QString fileName = "bode.pdf";
|
||||
#else
|
||||
QString fileName = "bode.png";
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_FILEDIALOG
|
||||
const QList<QByteArray> imageFormats =
|
||||
QImageWriter::supportedImageFormats();
|
||||
|
||||
QStringList filter;
|
||||
filter += "PDF Documents (*.pdf)";
|
||||
#ifndef QWT_NO_SVG
|
||||
filter += "SVG Documents (*.svg)";
|
||||
#endif
|
||||
filter += "Postscript Documents (*.ps)";
|
||||
|
||||
if ( imageFormats.size() > 0 )
|
||||
{
|
||||
QString imageFilter("Images (");
|
||||
for ( int i = 0; i < imageFormats.size(); i++ )
|
||||
{
|
||||
if ( i > 0 )
|
||||
imageFilter += " ";
|
||||
imageFilter += "*.";
|
||||
imageFilter += imageFormats[i];
|
||||
}
|
||||
imageFilter += ")";
|
||||
|
||||
filter += imageFilter;
|
||||
}
|
||||
|
||||
fileName = QFileDialog::getSaveFileName(
|
||||
this, "Export File Name", fileName,
|
||||
filter.join(";;"), NULL, QFileDialog::DontConfirmOverwrite);
|
||||
#endif
|
||||
|
||||
if ( !fileName.isEmpty() )
|
||||
{
|
||||
QwtPlotRenderer renderer;
|
||||
|
||||
// flags to make the document look like the widget
|
||||
renderer.setDiscardFlag(QwtPlotRenderer::DiscardBackground, false);
|
||||
renderer.setLayoutFlag(QwtPlotRenderer::KeepFrames, true);
|
||||
|
||||
renderer.renderDocument(d_plot, fileName, QSizeF(300, 200), 85);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::enableZoomMode(bool on)
|
||||
{
|
||||
d_panner->setEnabled(on);
|
||||
|
||||
d_zoomer[0]->setEnabled(on);
|
||||
d_zoomer[0]->zoom(0);
|
||||
|
||||
d_zoomer[1]->setEnabled(on);
|
||||
d_zoomer[1]->zoom(0);
|
||||
|
||||
d_picker->setEnabled(!on);
|
||||
|
||||
showInfo();
|
||||
}
|
||||
|
||||
void MainWindow::showInfo(QString text)
|
||||
{
|
||||
if ( text == QString::null )
|
||||
{
|
||||
if ( d_picker->rubberBand() )
|
||||
text = "Cursor Pos: Press left mouse button in plot region";
|
||||
else
|
||||
text = "Zoom: Press mouse button and drag";
|
||||
}
|
||||
|
||||
#ifndef QT_NO_STATUSBAR
|
||||
statusBar()->showMessage(text);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::moved(const QPoint &pos)
|
||||
{
|
||||
QString info;
|
||||
info.sprintf("Freq=%g, Ampl=%g, Phase=%g",
|
||||
d_plot->invTransform(QwtPlot::xBottom, pos.x()),
|
||||
d_plot->invTransform(QwtPlot::yLeft, pos.y()),
|
||||
d_plot->invTransform(QwtPlot::yRight, pos.y())
|
||||
);
|
||||
showInfo(info);
|
||||
}
|
||||
|
||||
void MainWindow::selected(const QPolygon &)
|
||||
{
|
||||
showInfo();
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
#include <qmainwindow.h>
|
||||
|
||||
class QwtPlotZoomer;
|
||||
class QwtPlotPicker;
|
||||
class QwtPlotPanner;
|
||||
class Plot;
|
||||
class QPolygon;
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget *parent = 0);
|
||||
|
||||
private Q_SLOTS:
|
||||
void moved(const QPoint &);
|
||||
void selected(const QPolygon &);
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
void print();
|
||||
#endif
|
||||
|
||||
void exportDocument();
|
||||
void enableZoomMode(bool);
|
||||
|
||||
private:
|
||||
void showInfo(QString text = QString::null);
|
||||
|
||||
Plot *d_plot;
|
||||
|
||||
QwtPlotZoomer *d_zoomer[2];
|
||||
QwtPlotPicker *d_picker;
|
||||
QwtPlotPanner *d_panner;
|
||||
};
|
||||
@@ -1,95 +0,0 @@
|
||||
#ifndef PIXMAPS_H
|
||||
#define PIXMAPS_H
|
||||
|
||||
static const char *print_xpm[]={
|
||||
"32 32 12 1",
|
||||
"a c #ffffff",
|
||||
"h c #ffff00",
|
||||
"c c #ffffff",
|
||||
"f c #dcdcdc",
|
||||
"b c #c0c0c0",
|
||||
"j c #a0a0a4",
|
||||
"e c #808080",
|
||||
"g c #808000",
|
||||
"d c #585858",
|
||||
"i c #00ff00",
|
||||
"# c #000000",
|
||||
". c None",
|
||||
"................................",
|
||||
"................................",
|
||||
"...........###..................",
|
||||
"..........#abb###...............",
|
||||
".........#aabbbbb###............",
|
||||
".........#ddaaabbbbb###.........",
|
||||
"........#ddddddaaabbbbb###......",
|
||||
".......#deffddddddaaabbbbb###...",
|
||||
"......#deaaabbbddddddaaabbbbb###",
|
||||
".....#deaaaaaaabbbddddddaaabbbb#",
|
||||
"....#deaaabbbaaaa#ddedddfggaaad#",
|
||||
"...#deaaaaaaaaaa#ddeeeeafgggfdd#",
|
||||
"..#deaaabbbaaaa#ddeeeeabbbbgfdd#",
|
||||
".#deeefaaaaaaa#ddeeeeabbhhbbadd#",
|
||||
"#aabbbeeefaaa#ddeeeeabbbbbbaddd#",
|
||||
"#bbaaabbbeee#ddeeeeabbiibbadddd#",
|
||||
"#bbbbbaaabbbeeeeeeabbbbbbaddddd#",
|
||||
"#bjbbbbbbaaabbbbeabbbbbbadddddd#",
|
||||
"#bjjjjbbbbbbaaaeabbbbbbaddddddd#",
|
||||
"#bjaaajjjbbbbbbaaabbbbadddddddd#",
|
||||
"#bbbbbaaajjjbbbbbbaaaaddddddddd#",
|
||||
"#bjbbbbbbaaajjjbbbbbbddddddddd#.",
|
||||
"#bjjjjbbbbbbaaajjjbbbdddddddd#..",
|
||||
"#bjaaajjjbbbbbbjaajjbddddddd#...",
|
||||
"#bbbbbaaajjjbbbjbbaabdddddd#....",
|
||||
"###bbbbbbaaajjjjbbbbbddddd#.....",
|
||||
"...###bbbbbbaaajbbbbbdddd#......",
|
||||
"......###bbbbbbjbbbbbddd#.......",
|
||||
".........###bbbbbbbbbdd#........",
|
||||
"............###bbbbbbd#.........",
|
||||
"...............###bbb#..........",
|
||||
"..................###..........."};
|
||||
|
||||
|
||||
static const char *zoom_xpm[]={
|
||||
"32 32 8 1",
|
||||
"# c #000000",
|
||||
"b c #c0c0c0",
|
||||
"a c #ffffff",
|
||||
"e c #585858",
|
||||
"d c #a0a0a4",
|
||||
"c c #0000ff",
|
||||
"f c #00ffff",
|
||||
". c None",
|
||||
"..######################........",
|
||||
".#a#baaaaaaaaaaaaaaaaaa#........",
|
||||
"#aa#baaaaaaaaaaaaaccaca#........",
|
||||
"####baaaaaaaaaaaaaaaaca####.....",
|
||||
"#bbbbaaaaaaaaaaaacccaaa#da#.....",
|
||||
"#aaaaaaaaaaaaaaaacccaca#da#.....",
|
||||
"#aaaaaaaaaaaaaaaaaccaca#da#.....",
|
||||
"#aaaaaaaaaabe###ebaaaaa#da#.....",
|
||||
"#aaaaaaaaa#########aaaa#da#.....",
|
||||
"#aaaaaaaa###dbbbb###aaa#da#.....",
|
||||
"#aaaaaaa###aaaaffb###aa#da#.....",
|
||||
"#aaaaaab##aaccaaafb##ba#da#.....",
|
||||
"#aaaaaae#daaccaccaad#ea#da#.....",
|
||||
"#aaaaaa##aaaaaaccaab##a#da#.....",
|
||||
"#aaaaaa##aacccaaaaab##a#da#.....",
|
||||
"#aaaaaa##aaccccaccab##a#da#.....",
|
||||
"#aaaaaae#daccccaccad#ea#da#.....",
|
||||
"#aaaaaab##aacccaaaa##da#da#.....",
|
||||
"#aaccacd###aaaaaaa###da#da#.....",
|
||||
"#aaaaacad###daaad#####a#da#.....",
|
||||
"#acccaaaad##########da##da#.....",
|
||||
"#acccacaaadde###edd#eda#da#.....",
|
||||
"#aaccacaaaabdddddbdd#eda#a#.....",
|
||||
"#aaaaaaaaaaaaaaaaaadd#eda##.....",
|
||||
"#aaaaaaaaaaaaaaaaaaadd#eda#.....",
|
||||
"#aaaaaaaccacaaaaaaaaadd#eda#....",
|
||||
"#aaaaaaaaaacaaaaaaaaaad##eda#...",
|
||||
"#aaaaaacccaaaaaaaaaaaaa#d#eda#..",
|
||||
"########################dd#eda#.",
|
||||
"...#dddddddddddddddddddddd##eda#",
|
||||
"...#aaaaaaaaaaaaaaaaaaaaaa#.####",
|
||||
"...########################..##."};
|
||||
|
||||
#endif
|
||||
@@ -1,186 +0,0 @@
|
||||
#include <qwt_math.h>
|
||||
#include <qwt_scale_engine.h>
|
||||
#include <qwt_symbol.h>
|
||||
#include <qwt_plot_grid.h>
|
||||
#include <qwt_plot_marker.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_legend.h>
|
||||
#include <qwt_text.h>
|
||||
#include <qmath.h>
|
||||
#include "complexnumber.h"
|
||||
#include "plot.h"
|
||||
|
||||
#if QT_VERSION < 0x040601
|
||||
#define qExp(x) ::exp(x)
|
||||
#define qAtan2(y, x) ::atan2(y, x)
|
||||
#endif
|
||||
|
||||
static void logSpace(double *array, int size, double xmin, double xmax)
|
||||
{
|
||||
if ((xmin <= 0.0) || (xmax <= 0.0) || (size <= 0))
|
||||
return;
|
||||
|
||||
const int imax = size -1;
|
||||
|
||||
array[0] = xmin;
|
||||
array[imax] = xmax;
|
||||
|
||||
const double lxmin = log(xmin);
|
||||
const double lxmax = log(xmax);
|
||||
const double lstep = (lxmax - lxmin) / double(imax);
|
||||
|
||||
for (int i = 1; i < imax; i++)
|
||||
array[i] = qExp(lxmin + double(i) * lstep);
|
||||
}
|
||||
|
||||
Plot::Plot(QWidget *parent):
|
||||
QwtPlot(parent)
|
||||
{
|
||||
setAutoReplot(false);
|
||||
|
||||
setTitle("Frequency Response of a Second-Order System");
|
||||
|
||||
setCanvasBackground(QColor(Qt::darkBlue));
|
||||
|
||||
// legend
|
||||
QwtLegend *legend = new QwtLegend;
|
||||
insertLegend(legend, QwtPlot::BottomLegend);
|
||||
|
||||
// grid
|
||||
QwtPlotGrid *grid = new QwtPlotGrid;
|
||||
grid->enableXMin(true);
|
||||
grid->setMajPen(QPen(Qt::white, 0, Qt::DotLine));
|
||||
grid->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
|
||||
grid->attach(this);
|
||||
|
||||
// axes
|
||||
enableAxis(QwtPlot::yRight);
|
||||
setAxisTitle(QwtPlot::xBottom, "Normalized Frequency");
|
||||
setAxisTitle(QwtPlot::yLeft, "Amplitude [dB]");
|
||||
setAxisTitle(QwtPlot::yRight, "Phase [deg]");
|
||||
|
||||
setAxisMaxMajor(QwtPlot::xBottom, 6);
|
||||
setAxisMaxMinor(QwtPlot::xBottom, 10);
|
||||
setAxisScaleEngine(QwtPlot::xBottom, new QwtLog10ScaleEngine);
|
||||
|
||||
// curves
|
||||
d_curve1 = new QwtPlotCurve("Amplitude");
|
||||
d_curve1->setRenderHint(QwtPlotItem::RenderAntialiased);
|
||||
d_curve1->setPen(QPen(Qt::yellow));
|
||||
d_curve1->setLegendAttribute(QwtPlotCurve::LegendShowLine);
|
||||
d_curve1->setYAxis(QwtPlot::yLeft);
|
||||
d_curve1->attach(this);
|
||||
|
||||
d_curve2 = new QwtPlotCurve("Phase");
|
||||
d_curve2->setRenderHint(QwtPlotItem::RenderAntialiased);
|
||||
d_curve2->setPen(QPen(Qt::cyan));
|
||||
d_curve2->setLegendAttribute(QwtPlotCurve::LegendShowLine);
|
||||
d_curve2->setYAxis(QwtPlot::yRight);
|
||||
d_curve2->attach(this);
|
||||
|
||||
// marker
|
||||
d_marker1 = new QwtPlotMarker();
|
||||
d_marker1->setValue(0.0, 0.0);
|
||||
d_marker1->setLineStyle(QwtPlotMarker::VLine);
|
||||
d_marker1->setLabelAlignment(Qt::AlignRight | Qt::AlignBottom);
|
||||
d_marker1->setLinePen(QPen(Qt::green, 0, Qt::DashDotLine));
|
||||
d_marker1->attach(this);
|
||||
|
||||
d_marker2 = new QwtPlotMarker();
|
||||
d_marker2->setLineStyle(QwtPlotMarker::HLine);
|
||||
d_marker2->setLabelAlignment(Qt::AlignRight | Qt::AlignBottom);
|
||||
d_marker2->setLinePen(QPen(QColor(200,150,0), 0, Qt::DashDotLine));
|
||||
d_marker2->setSymbol( new QwtSymbol(QwtSymbol::Diamond,
|
||||
QColor(Qt::yellow), QColor(Qt::green), QSize(7,7)));
|
||||
d_marker2->attach(this);
|
||||
|
||||
setDamp(0.0);
|
||||
|
||||
setAutoReplot(true);
|
||||
}
|
||||
|
||||
void Plot::showData(const double *frequency, const double *amplitude,
|
||||
const double *phase, int count)
|
||||
{
|
||||
d_curve1->setSamples(frequency, amplitude, count);
|
||||
d_curve2->setSamples(frequency, phase, count);
|
||||
}
|
||||
|
||||
void Plot::showPeak(double freq, double amplitude)
|
||||
{
|
||||
QString label;
|
||||
label.sprintf("Peak: %.3g dB", amplitude);
|
||||
|
||||
QwtText text(label);
|
||||
text.setFont(QFont("Helvetica", 10, QFont::Bold));
|
||||
text.setColor(QColor(200,150,0));
|
||||
|
||||
d_marker2->setValue(freq, amplitude);
|
||||
d_marker2->setLabel(text);
|
||||
}
|
||||
|
||||
void Plot::show3dB(double freq)
|
||||
{
|
||||
QString label;
|
||||
label.sprintf("-3 dB at f = %.3g", freq);
|
||||
|
||||
QwtText text(label);
|
||||
text.setFont(QFont("Helvetica", 10, QFont::Bold));
|
||||
text.setColor(Qt::green);
|
||||
|
||||
d_marker1->setValue(freq, 0.0);
|
||||
d_marker1->setLabel(text);
|
||||
}
|
||||
|
||||
//
|
||||
// re-calculate frequency response
|
||||
//
|
||||
void Plot::setDamp(double damping)
|
||||
{
|
||||
const bool doReplot = autoReplot();
|
||||
setAutoReplot(false);
|
||||
|
||||
const int ArraySize = 200;
|
||||
|
||||
double frequency[ArraySize];
|
||||
double amplitude[ArraySize];
|
||||
double phase[ArraySize];
|
||||
|
||||
// build frequency vector with logarithmic division
|
||||
logSpace(frequency, ArraySize, 0.01, 100);
|
||||
|
||||
int i3 = 1;
|
||||
double fmax = 1;
|
||||
double amax = -1000.0;
|
||||
|
||||
for (int i = 0; i < ArraySize; i++)
|
||||
{
|
||||
double f = frequency[i];
|
||||
const ComplexNumber g =
|
||||
ComplexNumber(1.0) / ComplexNumber(1.0 - f * f, 2.0 * damping * f);
|
||||
|
||||
amplitude[i] = 20.0 * log10(qSqrt( g.real() * g.real() + g.imag() * g.imag()));
|
||||
phase[i] = qAtan2(g.imag(), g.real()) * (180.0 / M_PI);
|
||||
|
||||
if ((i3 <= 1) && (amplitude[i] < -3.0))
|
||||
i3 = i;
|
||||
if (amplitude[i] > amax)
|
||||
{
|
||||
amax = amplitude[i];
|
||||
fmax = frequency[i];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
double f3 = frequency[i3] -
|
||||
(frequency[i3] - frequency[i3 - 1])
|
||||
/ (amplitude[i3] - amplitude[i3 -1]) * (amplitude[i3] + 3);
|
||||
|
||||
showPeak(fmax, amax);
|
||||
show3dB(f3);
|
||||
showData(frequency, amplitude, phase, ArraySize);
|
||||
|
||||
setAutoReplot(doReplot);
|
||||
|
||||
replot();
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
#ifndef _PLOT_H_
|
||||
#define _PLOT_H_
|
||||
|
||||
#include <qwt_plot.h>
|
||||
|
||||
class QwtPlotCurve;
|
||||
class QwtPlotMarker;
|
||||
|
||||
class Plot: public QwtPlot
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Plot(QWidget *parent);
|
||||
|
||||
public Q_SLOTS:
|
||||
void setDamp(double damping);
|
||||
|
||||
private:
|
||||
void showData(const double *frequency, const double *amplitude,
|
||||
const double *phase, int count);
|
||||
void showPeak(double freq, double amplitude);
|
||||
void show3dB(double freq);
|
||||
|
||||
QwtPlotCurve *d_curve1;
|
||||
QwtPlotCurve *d_curve2;
|
||||
QwtPlotMarker *d_marker1;
|
||||
QwtPlotMarker *d_marker2;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,54 +0,0 @@
|
||||
#include <qpainter.h>
|
||||
#include <qwt_scale_map.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include "cpuplot.h"
|
||||
#include "cpupiemarker.h"
|
||||
|
||||
CpuPieMarker::CpuPieMarker()
|
||||
{
|
||||
setZ(1000);
|
||||
setRenderHint(QwtPlotItem::RenderAntialiased, true);
|
||||
}
|
||||
|
||||
int CpuPieMarker::rtti() const
|
||||
{
|
||||
return QwtPlotItem::Rtti_PlotUserItem;
|
||||
}
|
||||
|
||||
void CpuPieMarker::draw(QPainter *p,
|
||||
const QwtScaleMap &, const QwtScaleMap &,
|
||||
const QRectF &rect) const
|
||||
{
|
||||
const CpuPlot *cpuPlot = (CpuPlot *)plot();
|
||||
|
||||
const QwtScaleMap yMap = cpuPlot->canvasMap(QwtPlot::yLeft);
|
||||
|
||||
const int margin = 5;
|
||||
|
||||
QRect pieRect;
|
||||
pieRect.setX(rect.x() + margin);
|
||||
pieRect.setY(rect.y() + margin);
|
||||
pieRect.setHeight( qRound(yMap.transform(80.0)) );
|
||||
pieRect.setWidth( pieRect.height() );
|
||||
|
||||
const int dataType[] = { CpuPlot::User, CpuPlot::System, CpuPlot::Idle };
|
||||
|
||||
int angle = (int)(5760 * 0.75);
|
||||
for ( unsigned int i = 0;
|
||||
i < sizeof(dataType) / sizeof(dataType[0]); i++ )
|
||||
{
|
||||
const QwtPlotCurve *curve = cpuPlot->cpuCurve(dataType[i]);
|
||||
if ( curve->dataSize() > 0 )
|
||||
{
|
||||
const int value = (int)(5760 * curve->sample(0).y() / 100.0);
|
||||
|
||||
p->save();
|
||||
p->setBrush(QBrush(curve->pen().color(), Qt::SolidPattern));
|
||||
if ( value != 0 )
|
||||
p->drawPie(pieRect, -angle, -value);
|
||||
p->restore();
|
||||
|
||||
angle += value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
//-----------------------------------------------------------------
|
||||
// This class shows how to extend QwtPlotItems. It displays a
|
||||
// pie chart of user/total/idle cpu usage in percent.
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
#include <qwt_plot_item.h>
|
||||
|
||||
class CpuPieMarker: public QwtPlotItem
|
||||
{
|
||||
public:
|
||||
CpuPieMarker();
|
||||
|
||||
virtual int rtti() const;
|
||||
|
||||
virtual void draw(QPainter *p,
|
||||
const QwtScaleMap &, const QwtScaleMap &,
|
||||
const QRectF &rect) const;
|
||||
};
|
||||
@@ -1,233 +0,0 @@
|
||||
#include <qapplication.h>
|
||||
#include <qlayout.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpainter.h>
|
||||
#include <qwt_plot_layout.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_scale_draw.h>
|
||||
#include <qwt_scale_widget.h>
|
||||
#include <qwt_legend.h>
|
||||
#include <qwt_legend_item.h>
|
||||
#include <qwt_plot_canvas.h>
|
||||
#include "cpupiemarker.h"
|
||||
#include "cpuplot.h"
|
||||
|
||||
class TimeScaleDraw: public QwtScaleDraw
|
||||
{
|
||||
public:
|
||||
TimeScaleDraw(const QTime &base):
|
||||
baseTime(base)
|
||||
{
|
||||
}
|
||||
virtual QwtText label(double v) const
|
||||
{
|
||||
QTime upTime = baseTime.addSecs((int)v);
|
||||
return upTime.toString();
|
||||
}
|
||||
private:
|
||||
QTime baseTime;
|
||||
};
|
||||
|
||||
class Background: public QwtPlotItem
|
||||
{
|
||||
public:
|
||||
Background()
|
||||
{
|
||||
setZ(0.0);
|
||||
}
|
||||
|
||||
virtual int rtti() const
|
||||
{
|
||||
return QwtPlotItem::Rtti_PlotUserItem;
|
||||
}
|
||||
|
||||
virtual void draw(QPainter *painter,
|
||||
const QwtScaleMap &, const QwtScaleMap &yMap,
|
||||
const QRectF &rect) const
|
||||
{
|
||||
QColor c(Qt::white);
|
||||
QRectF r = rect;
|
||||
|
||||
for ( int i = 100; i > 0; i -= 10 )
|
||||
{
|
||||
r.setBottom(yMap.transform(i - 10));
|
||||
r.setTop(yMap.transform(i));
|
||||
painter->fillRect(r, c);
|
||||
|
||||
c = c.dark(110);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class CpuCurve: public QwtPlotCurve
|
||||
{
|
||||
public:
|
||||
CpuCurve(const QString &title):
|
||||
QwtPlotCurve(title)
|
||||
{
|
||||
setRenderHint(QwtPlotItem::RenderAntialiased);
|
||||
}
|
||||
|
||||
void setColor(const QColor &color)
|
||||
{
|
||||
QColor c = color;
|
||||
c.setAlpha(150);
|
||||
|
||||
setPen(c);
|
||||
setBrush(c);
|
||||
}
|
||||
};
|
||||
|
||||
CpuPlot::CpuPlot(QWidget *parent):
|
||||
QwtPlot(parent),
|
||||
dataCount(0)
|
||||
{
|
||||
setAutoReplot(false);
|
||||
|
||||
canvas()->setBorderRadius( 10 );
|
||||
|
||||
plotLayout()->setAlignCanvasToScales(true);
|
||||
|
||||
QwtLegend *legend = new QwtLegend;
|
||||
legend->setItemMode(QwtLegend::CheckableItem);
|
||||
insertLegend(legend, QwtPlot::RightLegend);
|
||||
|
||||
setAxisTitle(QwtPlot::xBottom, " System Uptime [h:m:s]");
|
||||
setAxisScaleDraw(QwtPlot::xBottom,
|
||||
new TimeScaleDraw(cpuStat.upTime()));
|
||||
setAxisScale(QwtPlot::xBottom, 0, HISTORY);
|
||||
setAxisLabelRotation(QwtPlot::xBottom, -50.0);
|
||||
setAxisLabelAlignment(QwtPlot::xBottom, Qt::AlignLeft | Qt::AlignBottom);
|
||||
|
||||
/*
|
||||
In situations, when there is a label at the most right position of the
|
||||
scale, additional space is needed to display the overlapping part
|
||||
of the label would be taken by reducing the width of scale and canvas.
|
||||
To avoid this "jumping canvas" effect, we add a permanent margin.
|
||||
We don't need to do the same for the left border, because there
|
||||
is enough space for the overlapping label below the left scale.
|
||||
*/
|
||||
|
||||
QwtScaleWidget *scaleWidget = axisWidget(QwtPlot::xBottom);
|
||||
const int fmh = QFontMetrics(scaleWidget->font()).height();
|
||||
scaleWidget->setMinBorderDist(0, fmh / 2);
|
||||
|
||||
setAxisTitle(QwtPlot::yLeft, "Cpu Usage [%]");
|
||||
setAxisScale(QwtPlot::yLeft, 0, 100);
|
||||
|
||||
Background *bg = new Background();
|
||||
bg->attach(this);
|
||||
|
||||
CpuPieMarker *pie = new CpuPieMarker();
|
||||
pie->attach(this);
|
||||
|
||||
CpuCurve *curve;
|
||||
|
||||
curve = new CpuCurve("System");
|
||||
curve->setColor(Qt::red);
|
||||
curve->attach(this);
|
||||
data[System].curve = curve;
|
||||
|
||||
curve = new CpuCurve("User");
|
||||
curve->setColor(Qt::blue);
|
||||
curve->setZ(curve->z() - 1);
|
||||
curve->attach(this);
|
||||
data[User].curve = curve;
|
||||
|
||||
curve = new CpuCurve("Total");
|
||||
curve->setColor(Qt::black);
|
||||
curve->setZ(curve->z() - 2);
|
||||
curve->attach(this);
|
||||
data[Total].curve = curve;
|
||||
|
||||
curve = new CpuCurve("Idle");
|
||||
curve->setColor(Qt::darkCyan);
|
||||
curve->setZ(curve->z() - 3);
|
||||
curve->attach(this);
|
||||
data[Idle].curve = curve;
|
||||
|
||||
showCurve(data[System].curve, true);
|
||||
showCurve(data[User].curve, true);
|
||||
showCurve(data[Total].curve, false);
|
||||
showCurve(data[Idle].curve, false);
|
||||
|
||||
for ( int i = 0; i < HISTORY; i++ )
|
||||
timeData[HISTORY - 1 - i] = i;
|
||||
|
||||
(void)startTimer(1000); // 1 second
|
||||
|
||||
connect(this, SIGNAL(legendChecked(QwtPlotItem *, bool)),
|
||||
SLOT(showCurve(QwtPlotItem *, bool)));
|
||||
}
|
||||
|
||||
void CpuPlot::timerEvent(QTimerEvent *)
|
||||
{
|
||||
for ( int i = dataCount; i > 0; i-- )
|
||||
{
|
||||
for ( int c = 0; c < NCpuData; c++ )
|
||||
{
|
||||
if ( i < HISTORY )
|
||||
data[c].data[i] = data[c].data[i-1];
|
||||
}
|
||||
}
|
||||
|
||||
cpuStat.statistic(data[User].data[0], data[System].data[0]);
|
||||
|
||||
data[Total].data[0] = data[User].data[0] +
|
||||
data[System].data[0];
|
||||
data[Idle].data[0] = 100.0 - data[Total].data[0];
|
||||
|
||||
if ( dataCount < HISTORY )
|
||||
dataCount++;
|
||||
|
||||
for ( int j = 0; j < HISTORY; j++ )
|
||||
timeData[j]++;
|
||||
|
||||
setAxisScale(QwtPlot::xBottom,
|
||||
timeData[HISTORY - 1], timeData[0]);
|
||||
|
||||
for ( int c = 0; c < NCpuData; c++ )
|
||||
{
|
||||
data[c].curve->setRawSamples(
|
||||
timeData, data[c].data, dataCount);
|
||||
}
|
||||
|
||||
replot();
|
||||
}
|
||||
|
||||
void CpuPlot::showCurve(QwtPlotItem *item, bool on)
|
||||
{
|
||||
item->setVisible(on);
|
||||
QWidget *w = legend()->find(item);
|
||||
if ( w && w->inherits("QwtLegendItem") )
|
||||
((QwtLegendItem *)w)->setChecked(on);
|
||||
|
||||
replot();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
QWidget vBox;
|
||||
vBox.setWindowTitle("Cpu Plot");
|
||||
|
||||
CpuPlot *plot = new CpuPlot(&vBox);
|
||||
plot->setTitle("History");
|
||||
|
||||
const int margin = 5;
|
||||
plot->setContentsMargins(margin, margin, margin, margin);
|
||||
|
||||
QString info("Press the legend to en/disable a curve");
|
||||
|
||||
QLabel *label = new QLabel(info, &vBox);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(&vBox);
|
||||
layout->addWidget(plot);
|
||||
layout->addWidget(label);
|
||||
|
||||
vBox.resize(600,400);
|
||||
vBox.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
#include <qwt_plot.h>
|
||||
#include "cpustat.h"
|
||||
|
||||
#define HISTORY 60 // seconds
|
||||
|
||||
class QwtPlotCurve;
|
||||
|
||||
class CpuPlot : public QwtPlot
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum CpuData
|
||||
{
|
||||
User,
|
||||
System,
|
||||
Total,
|
||||
Idle,
|
||||
|
||||
NCpuData
|
||||
};
|
||||
|
||||
CpuPlot(QWidget * = 0);
|
||||
const QwtPlotCurve *cpuCurve(int id) const
|
||||
{ return data[id].curve; }
|
||||
|
||||
protected:
|
||||
void timerEvent(QTimerEvent *e);
|
||||
|
||||
private Q_SLOTS:
|
||||
void showCurve(QwtPlotItem *, bool on);
|
||||
|
||||
private:
|
||||
struct
|
||||
{
|
||||
QwtPlotCurve *curve;
|
||||
double data[HISTORY];
|
||||
} data[NCpuData];
|
||||
double timeData[HISTORY];
|
||||
|
||||
int dataCount;
|
||||
CpuStat cpuStat;
|
||||
};
|
||||
@@ -1,22 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
################################################################
|
||||
|
||||
include( $${PWD}/../examples.pri )
|
||||
|
||||
TARGET = cpuplot
|
||||
|
||||
HEADERS = \
|
||||
cpuplot.h \
|
||||
cpustat.h \
|
||||
cpupiemarker.h
|
||||
|
||||
SOURCES = \
|
||||
cpuplot.cpp \
|
||||
cpustat.cpp \
|
||||
cpupiemarker.cpp
|
||||
@@ -1,218 +0,0 @@
|
||||
#include <qstringlist.h>
|
||||
#include <qfile.h>
|
||||
#include <qtextstream.h>
|
||||
#include "cpustat.h"
|
||||
|
||||
CpuStat::CpuStat()
|
||||
{
|
||||
lookUp(procValues);
|
||||
}
|
||||
|
||||
QTime CpuStat::upTime() const
|
||||
{
|
||||
QTime t;
|
||||
for ( int i = 0; i < NValues; i++ )
|
||||
t = t.addSecs(int(procValues[i] / 100));
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
void CpuStat::statistic(double &user, double &system)
|
||||
{
|
||||
double values[NValues];
|
||||
|
||||
lookUp(values);
|
||||
|
||||
double userDelta = values[User] + values[Nice]
|
||||
- procValues[User] - procValues[Nice];
|
||||
double systemDelta = values[System] - procValues[System];
|
||||
|
||||
double totalDelta = 0;
|
||||
for ( int i = 0; i < NValues; i++ )
|
||||
totalDelta += values[i] - procValues[i];
|
||||
|
||||
user = userDelta / totalDelta * 100.0;
|
||||
system = systemDelta / totalDelta * 100.0;
|
||||
|
||||
for ( int j = 0; j < NValues; j++ )
|
||||
procValues[j] = values[j];
|
||||
}
|
||||
|
||||
void CpuStat::lookUp(double values[NValues]) const
|
||||
{
|
||||
QFile file("/proc/stat");
|
||||
if ( !file.open(QIODevice::ReadOnly) )
|
||||
{
|
||||
static double dummyValues[][NValues] =
|
||||
{
|
||||
{ 103726, 0, 23484, 819556 },
|
||||
{ 103783, 0, 23489, 819604 },
|
||||
{ 103798, 0, 23490, 819688 },
|
||||
{ 103820, 0, 23490, 819766 },
|
||||
{ 103840, 0, 23493, 819843 },
|
||||
{ 103875, 0, 23499, 819902 },
|
||||
{ 103917, 0, 23504, 819955 },
|
||||
{ 103950, 0, 23508, 820018 },
|
||||
{ 103987, 0, 23510, 820079 },
|
||||
{ 104020, 0, 23513, 820143 },
|
||||
{ 104058, 0, 23514, 820204 },
|
||||
{ 104099, 0, 23520, 820257 },
|
||||
{ 104121, 0, 23525, 820330 },
|
||||
{ 104159, 0, 23530, 820387 },
|
||||
{ 104176, 0, 23534, 820466 },
|
||||
{ 104215, 0, 23538, 820523 },
|
||||
{ 104245, 0, 23541, 820590 },
|
||||
{ 104267, 0, 23545, 820664 },
|
||||
{ 104311, 0, 23555, 820710 },
|
||||
{ 104355, 0, 23565, 820756 },
|
||||
{ 104367, 0, 23567, 820842 },
|
||||
{ 104383, 0, 23572, 820921 },
|
||||
{ 104396, 0, 23577, 821003 },
|
||||
{ 104413, 0, 23579, 821084 },
|
||||
{ 104446, 0, 23588, 821142 },
|
||||
{ 104521, 0, 23594, 821161 },
|
||||
{ 104611, 0, 23604, 821161 },
|
||||
{ 104708, 0, 23607, 821161 },
|
||||
{ 104804, 0, 23611, 821161 },
|
||||
{ 104895, 0, 23620, 821161 },
|
||||
{ 104993, 0, 23622, 821161 },
|
||||
{ 105089, 0, 23626, 821161 },
|
||||
{ 105185, 0, 23630, 821161 },
|
||||
{ 105281, 0, 23634, 821161 },
|
||||
{ 105379, 0, 23636, 821161 },
|
||||
{ 105472, 0, 23643, 821161 },
|
||||
{ 105569, 0, 23646, 821161 },
|
||||
{ 105666, 0, 23649, 821161 },
|
||||
{ 105763, 0, 23652, 821161 },
|
||||
{ 105828, 0, 23661, 821187 },
|
||||
{ 105904, 0, 23666, 821206 },
|
||||
{ 105999, 0, 23671, 821206 },
|
||||
{ 106094, 0, 23676, 821206 },
|
||||
{ 106184, 0, 23686, 821206 },
|
||||
{ 106273, 0, 23692, 821211 },
|
||||
{ 106306, 0, 23700, 821270 },
|
||||
{ 106341, 0, 23703, 821332 },
|
||||
{ 106392, 0, 23709, 821375 },
|
||||
{ 106423, 0, 23715, 821438 },
|
||||
{ 106472, 0, 23721, 821483 },
|
||||
{ 106531, 0, 23727, 821517 },
|
||||
{ 106562, 0, 23732, 821582 },
|
||||
{ 106597, 0, 23736, 821643 },
|
||||
{ 106633, 0, 23737, 821706 },
|
||||
{ 106666, 0, 23742, 821768 },
|
||||
{ 106697, 0, 23744, 821835 },
|
||||
{ 106730, 0, 23748, 821898 },
|
||||
{ 106765, 0, 23751, 821960 },
|
||||
{ 106799, 0, 23754, 822023 },
|
||||
{ 106831, 0, 23758, 822087 },
|
||||
{ 106862, 0, 23761, 822153 },
|
||||
{ 106899, 0, 23763, 822214 },
|
||||
{ 106932, 0, 23766, 822278 },
|
||||
{ 106965, 0, 23768, 822343 },
|
||||
{ 107009, 0, 23771, 822396 },
|
||||
{ 107040, 0, 23775, 822461 },
|
||||
{ 107092, 0, 23780, 822504 },
|
||||
{ 107143, 0, 23787, 822546 },
|
||||
{ 107200, 0, 23795, 822581 },
|
||||
{ 107250, 0, 23803, 822623 },
|
||||
{ 107277, 0, 23810, 822689 },
|
||||
{ 107286, 0, 23810, 822780 },
|
||||
{ 107313, 0, 23817, 822846 },
|
||||
{ 107325, 0, 23818, 822933 },
|
||||
{ 107332, 0, 23818, 823026 },
|
||||
{ 107344, 0, 23821, 823111 },
|
||||
{ 107357, 0, 23821, 823198 },
|
||||
{ 107368, 0, 23823, 823284 },
|
||||
{ 107375, 0, 23824, 823377 },
|
||||
{ 107386, 0, 23825, 823465 },
|
||||
{ 107396, 0, 23826, 823554 },
|
||||
{ 107422, 0, 23830, 823624 },
|
||||
{ 107434, 0, 23831, 823711 },
|
||||
{ 107456, 0, 23835, 823785 },
|
||||
{ 107468, 0, 23838, 823870 },
|
||||
{ 107487, 0, 23840, 823949 },
|
||||
{ 107515, 0, 23843, 824018 },
|
||||
{ 107528, 0, 23846, 824102 },
|
||||
{ 107535, 0, 23851, 824190 },
|
||||
{ 107548, 0, 23853, 824275 },
|
||||
{ 107562, 0, 23857, 824357 },
|
||||
{ 107656, 0, 23863, 824357 },
|
||||
{ 107751, 0, 23868, 824357 },
|
||||
{ 107849, 0, 23870, 824357 },
|
||||
{ 107944, 0, 23875, 824357 },
|
||||
{ 108043, 0, 23876, 824357 },
|
||||
{ 108137, 0, 23882, 824357 },
|
||||
{ 108230, 0, 23889, 824357 },
|
||||
{ 108317, 0, 23902, 824357 },
|
||||
{ 108412, 0, 23907, 824357 },
|
||||
{ 108511, 0, 23908, 824357 },
|
||||
{ 108608, 0, 23911, 824357 },
|
||||
{ 108704, 0, 23915, 824357 },
|
||||
{ 108801, 0, 23918, 824357 },
|
||||
{ 108891, 0, 23928, 824357 },
|
||||
{ 108987, 0, 23932, 824357 },
|
||||
{ 109072, 0, 23943, 824361 },
|
||||
{ 109079, 0, 23943, 824454 },
|
||||
{ 109086, 0, 23944, 824546 },
|
||||
{ 109098, 0, 23950, 824628 },
|
||||
{ 109108, 0, 23955, 824713 },
|
||||
{ 109115, 0, 23957, 824804 },
|
||||
{ 109122, 0, 23958, 824896 },
|
||||
{ 109132, 0, 23959, 824985 },
|
||||
{ 109142, 0, 23961, 825073 },
|
||||
{ 109146, 0, 23962, 825168 },
|
||||
{ 109153, 0, 23964, 825259 },
|
||||
{ 109162, 0, 23966, 825348 },
|
||||
{ 109168, 0, 23969, 825439 },
|
||||
{ 109176, 0, 23971, 825529 },
|
||||
{ 109185, 0, 23974, 825617 },
|
||||
{ 109193, 0, 23977, 825706 },
|
||||
{ 109198, 0, 23978, 825800 },
|
||||
{ 109206, 0, 23978, 825892 },
|
||||
{ 109212, 0, 23981, 825983 },
|
||||
{ 109219, 0, 23981, 826076 },
|
||||
{ 109225, 0, 23981, 826170 },
|
||||
{ 109232, 0, 23984, 826260 },
|
||||
{ 109242, 0, 23984, 826350 },
|
||||
{ 109255, 0, 23986, 826435 },
|
||||
{ 109268, 0, 23987, 826521 },
|
||||
{ 109283, 0, 23990, 826603 },
|
||||
{ 109288, 0, 23991, 826697 },
|
||||
{ 109295, 0, 23993, 826788 },
|
||||
{ 109308, 0, 23994, 826874 },
|
||||
{ 109322, 0, 24009, 826945 },
|
||||
{ 109328, 0, 24011, 827037 },
|
||||
{ 109338, 0, 24012, 827126 },
|
||||
{ 109347, 0, 24012, 827217 },
|
||||
{ 109354, 0, 24017, 827305 },
|
||||
{ 109367, 0, 24017, 827392 },
|
||||
{ 109371, 0, 24019, 827486 },
|
||||
};
|
||||
static int counter = 0;
|
||||
|
||||
for ( int i = 0; i < NValues; i++ )
|
||||
values[i] = dummyValues[counter][i];
|
||||
|
||||
counter = (counter + 1)
|
||||
% (sizeof(dummyValues) / sizeof(dummyValues[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
QTextStream textStream(&file);
|
||||
do {
|
||||
QString line = textStream.readLine();
|
||||
line = line.trimmed();
|
||||
if ( line.startsWith("cpu ") )
|
||||
{
|
||||
const QStringList valueList =
|
||||
line.split(" ", QString::SkipEmptyParts);
|
||||
if ( valueList.count() >= 5 )
|
||||
{
|
||||
for ( int i = 0; i < NValues; i++ )
|
||||
values[i] = valueList[i+1].toDouble();
|
||||
}
|
||||
break;
|
||||
}
|
||||
} while(!textStream.atEnd());
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
#include <qdatetime.h>
|
||||
|
||||
class CpuStat
|
||||
{
|
||||
public:
|
||||
CpuStat();
|
||||
void statistic(double &user, double &system);
|
||||
QTime upTime() const;
|
||||
|
||||
enum Value
|
||||
{
|
||||
User,
|
||||
Nice,
|
||||
System,
|
||||
Idle,
|
||||
|
||||
NValues
|
||||
};
|
||||
|
||||
private:
|
||||
void lookUp(double[NValues]) const;
|
||||
double procValues[NValues];
|
||||
};
|
||||
@@ -1,202 +0,0 @@
|
||||
|
||||
#include <qwt_scale_map.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_symbol.h>
|
||||
#include <qwt_math.h>
|
||||
#include <qcolor.h>
|
||||
#include <qpainter.h>
|
||||
#include <qapplication.h>
|
||||
#include <qframe.h>
|
||||
|
||||
//------------------------------------------------------------
|
||||
// curvdemo1
|
||||
//
|
||||
// This example program features some of the different
|
||||
// display styles of the QwtPlotCurve class
|
||||
//------------------------------------------------------------
|
||||
|
||||
|
||||
//
|
||||
// Array Sizes
|
||||
//
|
||||
const int Size = 27;
|
||||
const int CurvCnt = 6;
|
||||
|
||||
//
|
||||
// Arrays holding the values
|
||||
//
|
||||
double xval[Size];
|
||||
double yval[Size];
|
||||
QwtScaleMap xMap;
|
||||
QwtScaleMap yMap;
|
||||
|
||||
class MainWin : public QFrame
|
||||
{
|
||||
public:
|
||||
MainWin();
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent *);
|
||||
void drawContents(QPainter *p);
|
||||
|
||||
private:
|
||||
void shiftDown(QRect &rect, int offset) const;
|
||||
|
||||
QwtPlotCurve d_curves[CurvCnt];
|
||||
};
|
||||
|
||||
MainWin::MainWin()
|
||||
{
|
||||
int i;
|
||||
|
||||
xMap.setScaleInterval(-0.5, 10.5);
|
||||
yMap.setScaleInterval(-1.1, 1.1);
|
||||
|
||||
//
|
||||
// Frame style
|
||||
//
|
||||
setFrameStyle(QFrame::Box|QFrame::Raised);
|
||||
setLineWidth(2);
|
||||
setMidLineWidth(3);
|
||||
|
||||
//
|
||||
// Calculate values
|
||||
//
|
||||
for(i=0; i<Size;i++)
|
||||
{
|
||||
xval[i] = double(i) * 10.0 / double(Size - 1);
|
||||
yval[i] = qSin(xval[i]) * qCos(2.0 * xval[i]);
|
||||
}
|
||||
|
||||
//
|
||||
// define curve styles
|
||||
//
|
||||
i = 0;
|
||||
|
||||
d_curves[i].setSymbol(new QwtSymbol(QwtSymbol::Cross, Qt::NoBrush,
|
||||
QPen(Qt::black), QSize(5, 5) ) );
|
||||
d_curves[i].setPen(QColor(Qt::darkGreen));
|
||||
d_curves[i].setStyle(QwtPlotCurve::Lines);
|
||||
d_curves[i].setCurveAttribute(QwtPlotCurve::Fitted);
|
||||
i++;
|
||||
|
||||
d_curves[i].setSymbol(new QwtSymbol(QwtSymbol::Ellipse, Qt::yellow,
|
||||
QPen(Qt::blue), QSize(5, 5) ) );
|
||||
d_curves[i].setPen(QColor(Qt::red));
|
||||
d_curves[i].setStyle(QwtPlotCurve::Sticks);
|
||||
i++;
|
||||
|
||||
d_curves[i].setPen(QColor(Qt::darkBlue));
|
||||
d_curves[i].setStyle(QwtPlotCurve::Lines);
|
||||
i++;
|
||||
|
||||
d_curves[i].setPen(QColor(Qt::darkBlue));
|
||||
d_curves[i].setStyle(QwtPlotCurve::Lines);
|
||||
d_curves[i].setRenderHint(QwtPlotItem::RenderAntialiased);
|
||||
i++;
|
||||
|
||||
d_curves[i].setPen(QColor(Qt::darkCyan));
|
||||
d_curves[i].setStyle(QwtPlotCurve::Steps);
|
||||
i++;
|
||||
|
||||
d_curves[i].setSymbol(new QwtSymbol(QwtSymbol::XCross, Qt::NoBrush,
|
||||
QPen(Qt::darkMagenta), QSize(5, 5) ) );
|
||||
d_curves[i].setStyle(QwtPlotCurve::NoCurve);
|
||||
i++;
|
||||
|
||||
|
||||
//
|
||||
// attach data
|
||||
//
|
||||
for(i=0;i<CurvCnt;i++)
|
||||
d_curves[i].setRawSamples(xval, yval, Size);
|
||||
}
|
||||
|
||||
void MainWin::shiftDown(QRect &rect, int offset) const
|
||||
{
|
||||
rect.translate(0, offset);
|
||||
}
|
||||
|
||||
void MainWin::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QFrame::paintEvent(event);
|
||||
|
||||
QPainter painter(this);
|
||||
painter.setClipRect(contentsRect());
|
||||
drawContents(&painter);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// REDRAW CONTENTS
|
||||
//
|
||||
void MainWin::drawContents(QPainter *painter)
|
||||
{
|
||||
int deltay,i;
|
||||
|
||||
QRect r = contentsRect();
|
||||
|
||||
deltay = r.height() / CurvCnt - 1;
|
||||
|
||||
r.setHeight(deltay);
|
||||
|
||||
//
|
||||
// draw curves
|
||||
//
|
||||
for (i=0;i<CurvCnt;i++)
|
||||
{
|
||||
xMap.setPaintInterval(r.left(), r.right());
|
||||
yMap.setPaintInterval(r.top(), r.bottom());
|
||||
|
||||
painter->setRenderHint(QPainter::Antialiasing,
|
||||
d_curves[i].testRenderHint(QwtPlotItem::RenderAntialiased) );
|
||||
d_curves[i].draw(painter, xMap, yMap, r);
|
||||
|
||||
shiftDown(r, deltay);
|
||||
}
|
||||
|
||||
//
|
||||
// draw titles
|
||||
//
|
||||
r = contentsRect(); // reset r
|
||||
painter->setFont(QFont("Helvetica", 8));
|
||||
|
||||
const int alignment = Qt::AlignTop|Qt::AlignHCenter;
|
||||
|
||||
painter->setPen(Qt::black);
|
||||
|
||||
painter->drawText(0,r.top(),r.width(), painter->fontMetrics().height(),
|
||||
alignment, "Style: Line/Fitted, Symbol: Cross");
|
||||
shiftDown(r, deltay);
|
||||
|
||||
painter->drawText(0,r.top(),r.width(), painter->fontMetrics().height(),
|
||||
alignment, "Style: Sticks, Symbol: Ellipse");
|
||||
shiftDown(r, deltay);
|
||||
|
||||
painter->drawText(0 ,r.top(),r.width(), painter->fontMetrics().height(),
|
||||
alignment, "Style: Lines, Symbol: None");
|
||||
shiftDown(r, deltay);
|
||||
|
||||
painter->drawText(0 ,r.top(),r.width(), painter->fontMetrics().height(),
|
||||
alignment, "Style: Lines, Symbol: None, Antialiased");
|
||||
shiftDown(r, deltay);
|
||||
|
||||
painter->drawText(0, r.top(),r.width(), painter->fontMetrics().height(),
|
||||
alignment, "Style: Steps, Symbol: None");
|
||||
shiftDown(r, deltay);
|
||||
|
||||
painter->drawText(0,r.top(),r.width(), painter->fontMetrics().height(),
|
||||
alignment, "Style: NoCurve, Symbol: XCross");
|
||||
}
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
MainWin w;
|
||||
|
||||
w.resize(300,600);
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
################################################################
|
||||
|
||||
include( $${PWD}/../examples.pri )
|
||||
|
||||
TARGET = curvdemo1
|
||||
|
||||
SOURCES = \
|
||||
curvdemo1.cpp
|
||||
@@ -1,214 +0,0 @@
|
||||
#include <qapplication.h>
|
||||
#include <qpainter.h>
|
||||
#include <qwt_math.h>
|
||||
#include <qwt_symbol.h>
|
||||
#include <qwt_curve_fitter.h>
|
||||
#include "curvdemo2.h"
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
// curvdemo2
|
||||
//
|
||||
// This example shows a simple animation featuring
|
||||
// with several QwtPlotCurves
|
||||
//
|
||||
//------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Array Sizes
|
||||
//
|
||||
const int Size = 15;
|
||||
const int USize = 13;
|
||||
|
||||
//
|
||||
// Arrays holding the values
|
||||
//
|
||||
double xval[Size];
|
||||
double yval[Size];
|
||||
double zval[Size];
|
||||
double uval[USize];
|
||||
double vval[USize];
|
||||
|
||||
|
||||
//
|
||||
// CONSTRUCT MAIN WINDOW
|
||||
//
|
||||
MainWin::MainWin():
|
||||
QFrame()
|
||||
{
|
||||
setFrameStyle(QFrame::Box|QFrame::Raised);
|
||||
setLineWidth(2);
|
||||
setMidLineWidth(3);
|
||||
|
||||
const QColor bgColor(30,30,50);
|
||||
|
||||
QPalette p = palette();
|
||||
p.setColor(backgroundRole(), bgColor);
|
||||
setPalette(p);
|
||||
|
||||
QwtSplineCurveFitter* curveFitter;
|
||||
|
||||
//
|
||||
// curve 1
|
||||
//
|
||||
int i = 0;
|
||||
xMap[i].setScaleInterval(-1.5, 1.5);
|
||||
yMap[i].setScaleInterval(0.0, 6.28);
|
||||
|
||||
curve[i].setPen(QPen(QColor(150,150,200),2));
|
||||
curve[i].setStyle(QwtPlotCurve::Lines);
|
||||
curve[i].setCurveAttribute(QwtPlotCurve::Fitted, true);
|
||||
curveFitter = new QwtSplineCurveFitter();
|
||||
curveFitter->setSplineSize(150);
|
||||
curve[i].setCurveFitter(curveFitter);
|
||||
|
||||
QwtSymbol *symbol = new QwtSymbol(QwtSymbol::XCross);
|
||||
symbol->setPen(QPen(Qt::yellow,2));
|
||||
symbol->setSize(7);
|
||||
|
||||
curve[i].setSymbol(symbol);
|
||||
|
||||
curve[i].setRawSamples(yval,xval,Size);
|
||||
|
||||
//
|
||||
// curve 2
|
||||
//
|
||||
i++;
|
||||
xMap[i].setScaleInterval(0.0, 6.28);
|
||||
yMap[i].setScaleInterval(-3.0, 1.1);
|
||||
curve[i].setPen(QPen(QColor(200,150,50)));
|
||||
curve[i].setStyle(QwtPlotCurve::Sticks);
|
||||
curve[i].setSymbol(new QwtSymbol(QwtSymbol::Ellipse,
|
||||
QColor(Qt::blue), QColor(Qt::yellow), QSize(5,5)));
|
||||
|
||||
curve[i].setRawSamples(xval,zval,Size);
|
||||
|
||||
|
||||
//
|
||||
// curve 3
|
||||
//
|
||||
i++;
|
||||
xMap[i].setScaleInterval(-1.1, 3.0);
|
||||
yMap[i].setScaleInterval(-1.1, 3.0);
|
||||
curve[i].setStyle(QwtPlotCurve::Lines);
|
||||
curve[i].setCurveAttribute(QwtPlotCurve::Fitted, true);
|
||||
curve[i].setPen(QColor(100,200,150));
|
||||
curveFitter = new QwtSplineCurveFitter();
|
||||
curveFitter->setFitMode(QwtSplineCurveFitter::ParametricSpline);
|
||||
curveFitter->setSplineSize(200);
|
||||
curve[i].setCurveFitter(curveFitter);
|
||||
|
||||
curve[i].setRawSamples(yval,zval,Size);
|
||||
|
||||
|
||||
//
|
||||
// curve 4
|
||||
//
|
||||
i++;
|
||||
xMap[i].setScaleInterval(-5, 1.1);
|
||||
yMap[i].setScaleInterval(-1.1, 5.0);
|
||||
curve[i].setStyle(QwtPlotCurve::Lines);
|
||||
curve[i].setCurveAttribute(QwtPlotCurve::Fitted, true);
|
||||
curve[i].setPen(QColor(Qt::red));
|
||||
curveFitter = new QwtSplineCurveFitter();
|
||||
curveFitter->setSplineSize(200);
|
||||
curve[i].setCurveFitter(curveFitter);
|
||||
|
||||
curve[i].setRawSamples(uval,vval,USize);
|
||||
|
||||
//
|
||||
// initialize values
|
||||
//
|
||||
double base = 2.0 * M_PI / double(USize - 1);
|
||||
double toggle = 1.0;
|
||||
for (i = 0; i < USize; i++)
|
||||
{
|
||||
uval[i] = toggle * qCos( double(i) * base);
|
||||
vval[i] = toggle * qSin( double(i) * base);
|
||||
|
||||
if (toggle == 1.0)
|
||||
toggle = 0.5;
|
||||
else
|
||||
toggle = 1.0;
|
||||
}
|
||||
|
||||
newValues();
|
||||
|
||||
//
|
||||
// start timer
|
||||
//
|
||||
(void)startTimer(250);
|
||||
}
|
||||
|
||||
void MainWin::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QFrame::paintEvent(event);
|
||||
|
||||
QPainter painter(this);
|
||||
painter.setClipRect(contentsRect());
|
||||
drawContents(&painter);
|
||||
}
|
||||
|
||||
void MainWin::drawContents(QPainter *painter)
|
||||
{
|
||||
const QRect &r = contentsRect();
|
||||
|
||||
for ( int i = 0; i < curveCount; i++ )
|
||||
{
|
||||
xMap[i].setPaintInterval(r.left(), r.right());
|
||||
yMap[i].setPaintInterval(r.top(), r.bottom());
|
||||
curve[i].draw(painter, xMap[i], yMap[i], r);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// TIMER EVENT
|
||||
//
|
||||
void MainWin::timerEvent(QTimerEvent *)
|
||||
{
|
||||
newValues();
|
||||
repaint();
|
||||
}
|
||||
|
||||
//
|
||||
// RE-CALCULATE VALUES
|
||||
//
|
||||
void MainWin::newValues()
|
||||
{
|
||||
int i;
|
||||
static double phs = 0.0;
|
||||
double s,c,u;
|
||||
|
||||
for (i=0;i<Size;i++)
|
||||
{
|
||||
xval[i] = 6.28 * double(i) / double(Size -1);
|
||||
yval[i] = qSin(xval[i] - phs);
|
||||
zval[i] = qCos(3.0 * (xval[i] + phs));
|
||||
}
|
||||
|
||||
s = 0.25 * qSin(phs);
|
||||
c = qSqrt(1.0 - s*s);
|
||||
for (i=0; i<USize;i++)
|
||||
{
|
||||
u = uval[i];
|
||||
uval[i] = uval[i] * c - vval[i] * s;
|
||||
vval[i] = vval[i] * c + u * s;
|
||||
}
|
||||
|
||||
phs += 0.0628;
|
||||
if (phs > 6.28)
|
||||
phs = 0.0;
|
||||
|
||||
}
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
MainWin w;
|
||||
|
||||
w.resize(300,300);
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
#include <qframe.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_scale_map.h>
|
||||
|
||||
class MainWin : public QFrame
|
||||
{
|
||||
public:
|
||||
enum { curveCount = 4 };
|
||||
|
||||
QwtScaleMap xMap[curveCount];
|
||||
QwtScaleMap yMap[curveCount];
|
||||
QwtPlotCurve curve[curveCount];
|
||||
|
||||
public:
|
||||
MainWin();
|
||||
|
||||
protected:
|
||||
virtual void timerEvent(QTimerEvent *t);
|
||||
virtual void paintEvent(QPaintEvent *);
|
||||
virtual void drawContents(QPainter *);
|
||||
|
||||
private:
|
||||
void newValues();
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
################################################################
|
||||
|
||||
include( $${PWD}/../examples.pri )
|
||||
|
||||
TARGET = curvdemo2
|
||||
|
||||
HEADERS = \
|
||||
curvdemo2.h
|
||||
|
||||
SOURCES = \
|
||||
curvdemo2.cpp
|
||||
@@ -1,125 +0,0 @@
|
||||
#include "attitude_indicator.h"
|
||||
#include <qwt_point_polar.h>
|
||||
#include <qevent.h>
|
||||
#include <qpainter.h>
|
||||
#include <qpolygon.h>
|
||||
|
||||
AttitudeIndicatorNeedle::AttitudeIndicatorNeedle(const QColor &c)
|
||||
{
|
||||
QPalette palette;
|
||||
for ( int i = 0; i < QPalette::NColorGroups; i++ )
|
||||
{
|
||||
palette.setColor((QPalette::ColorGroup)i,
|
||||
QPalette::Text, c);
|
||||
}
|
||||
setPalette(palette);
|
||||
}
|
||||
|
||||
void AttitudeIndicatorNeedle::drawNeedle(QPainter *painter,
|
||||
double length, QPalette::ColorGroup colorGroup) const
|
||||
{
|
||||
double triangleSize = length * 0.1;
|
||||
double pos = length - 2.0;
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo( pos, 0 );
|
||||
path.lineTo( pos - 2 * triangleSize, triangleSize );
|
||||
path.lineTo( pos - 2 * triangleSize, -triangleSize );
|
||||
path.closeSubpath();
|
||||
|
||||
painter->setBrush( palette().brush(colorGroup, QPalette::Text ) );
|
||||
painter->drawPath( path );
|
||||
|
||||
double l = length - 2;
|
||||
painter->setPen( QPen(palette().color( colorGroup, QPalette::Text ), 3) );
|
||||
painter->drawLine( 0, -l, 0, l );
|
||||
}
|
||||
|
||||
AttitudeIndicator::AttitudeIndicator(
|
||||
QWidget *parent):
|
||||
QwtDial(parent),
|
||||
d_gradient(0.0)
|
||||
{
|
||||
setMode(RotateScale);
|
||||
setWrapping(true);
|
||||
|
||||
setOrigin(270.0);
|
||||
setScaleComponents( QwtAbstractScaleDraw::Ticks );
|
||||
setScale(0, 0, 30.0);
|
||||
|
||||
const QColor color = palette().color(QPalette::Text);
|
||||
setNeedle(new AttitudeIndicatorNeedle(color));
|
||||
}
|
||||
|
||||
void AttitudeIndicator::setGradient(double gradient)
|
||||
{
|
||||
if ( gradient < -1.0 )
|
||||
gradient = -1.0;
|
||||
else if ( gradient > 1.0 )
|
||||
gradient = 1.0;
|
||||
|
||||
if ( d_gradient != gradient )
|
||||
{
|
||||
d_gradient = gradient;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void AttitudeIndicator::drawScale(QPainter *painter, const QPointF ¢er,
|
||||
double radius, double origin, double minArc, double maxArc) const
|
||||
{
|
||||
// counter clockwise, radian
|
||||
|
||||
const double dir = (360.0 - origin) * M_PI / 180.0;
|
||||
const double offset = 4.0;
|
||||
|
||||
const QPointF p0 = qwtPolar2Pos( center, offset, dir + M_PI );
|
||||
|
||||
const double w = innerRect().width();
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo( qwtPolar2Pos( p0, w, dir - M_PI_2 ) );
|
||||
path.lineTo( qwtPolar2Pos( path.currentPosition(), 2 * w, dir + M_PI_2 ) );
|
||||
path.lineTo( qwtPolar2Pos( path.currentPosition(), w, dir ) );
|
||||
path.lineTo( qwtPolar2Pos( path.currentPosition(), w, dir - M_PI_2 ) );
|
||||
|
||||
painter->save();
|
||||
painter->setClipPath( path ); // swallow 180 - 360 degrees
|
||||
|
||||
QwtDial::drawScale(painter,
|
||||
center, radius, origin, minArc, maxArc);
|
||||
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
void AttitudeIndicator::drawScaleContents(QPainter *painter,
|
||||
const QPointF &, double) const
|
||||
{
|
||||
int dir = 360 - qRound(origin() - value()); // counter clockwise
|
||||
int arc = 90 + qRound(gradient() * 90);
|
||||
|
||||
const QColor skyColor(38, 151, 221);
|
||||
|
||||
painter->save();
|
||||
painter->setBrush(skyColor);
|
||||
painter->drawChord(scaleInnerRect(),
|
||||
(dir - arc) * 16, 2 * arc * 16 );
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
void AttitudeIndicator::keyPressEvent(QKeyEvent *e)
|
||||
{
|
||||
switch(e->key())
|
||||
{
|
||||
case Qt::Key_Plus:
|
||||
setGradient(gradient() + 0.05);
|
||||
break;
|
||||
|
||||
case Qt::Key_Minus:
|
||||
setGradient(gradient() - 0.05);
|
||||
break;
|
||||
|
||||
default:
|
||||
QwtDial::keyPressEvent(e);
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
#include <qwt_dial.h>
|
||||
#include <qwt_dial_needle.h>
|
||||
|
||||
class AttitudeIndicatorNeedle: public QwtDialNeedle
|
||||
{
|
||||
public:
|
||||
AttitudeIndicatorNeedle(const QColor &);
|
||||
|
||||
protected:
|
||||
virtual void drawNeedle(QPainter *,
|
||||
double length, QPalette::ColorGroup) const;
|
||||
};
|
||||
|
||||
class AttitudeIndicator: public QwtDial
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AttitudeIndicator(QWidget *parent = NULL);
|
||||
|
||||
double angle() const { return value(); }
|
||||
double gradient() const { return d_gradient; }
|
||||
|
||||
public Q_SLOTS:
|
||||
void setGradient(double);
|
||||
void setAngle(double angle) { setValue(angle); }
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent(QKeyEvent *);
|
||||
|
||||
virtual void drawScale(QPainter *, const QPointF ¢er,
|
||||
double radius, double origin, double arcMin, double arcMax) const;
|
||||
|
||||
virtual void drawScaleContents(QPainter *painter,
|
||||
const QPointF ¢er, double radius) const;
|
||||
|
||||
private:
|
||||
double d_gradient;
|
||||
};
|
||||
@@ -1,193 +0,0 @@
|
||||
#include <qlayout.h>
|
||||
#include <qtimer.h>
|
||||
#include <qwt_analog_clock.h>
|
||||
#include "attitude_indicator.h"
|
||||
#include "speedo_meter.h"
|
||||
#include "cockpit_grid.h"
|
||||
|
||||
CockpitGrid::CockpitGrid(QWidget *parent):
|
||||
QFrame(parent)
|
||||
{
|
||||
setAutoFillBackground(true);
|
||||
|
||||
setPalette(colorTheme(QColor(Qt::darkGray).dark(150)));
|
||||
|
||||
QGridLayout *layout = new QGridLayout(this);
|
||||
layout->setSpacing(5);
|
||||
layout->setMargin(0);
|
||||
|
||||
int i;
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
QwtDial *dial = createDial(i);
|
||||
layout->addWidget(dial, 0, i);
|
||||
}
|
||||
|
||||
for ( i = 0; i < layout->columnCount(); i++ )
|
||||
layout->setColumnStretch(i, 1);
|
||||
}
|
||||
|
||||
QwtDial *CockpitGrid::createDial(int pos)
|
||||
{
|
||||
QwtDial *dial = NULL;
|
||||
switch(pos)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
d_clock = new QwtAnalogClock(this);
|
||||
|
||||
const QColor knobColor = QColor(Qt::gray).light(130);
|
||||
|
||||
for ( int i = 0; i < QwtAnalogClock::NHands; i++)
|
||||
{
|
||||
QColor handColor = QColor(Qt::gray).light(150);
|
||||
int width = 8;
|
||||
|
||||
if ( i == QwtAnalogClock::SecondHand )
|
||||
{
|
||||
handColor = Qt::gray;
|
||||
width = 5;
|
||||
}
|
||||
|
||||
QwtDialSimpleNeedle *hand = new QwtDialSimpleNeedle(
|
||||
QwtDialSimpleNeedle::Arrow, true, handColor, knobColor);
|
||||
hand->setWidth(width);
|
||||
|
||||
d_clock->setHand((QwtAnalogClock::Hand)i, hand);
|
||||
}
|
||||
|
||||
QTimer *timer = new QTimer(d_clock);
|
||||
timer->connect(timer, SIGNAL(timeout()),
|
||||
d_clock, SLOT(setCurrentTime()));
|
||||
timer->start(1000);
|
||||
|
||||
dial = d_clock;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
d_speedo = new SpeedoMeter(this);
|
||||
d_speedo->setRange(0.0, 240.0);
|
||||
d_speedo->setScale(-1, 2, 20);
|
||||
|
||||
QTimer *timer = new QTimer(d_speedo);
|
||||
timer->connect(timer, SIGNAL(timeout()),
|
||||
this, SLOT(changeSpeed()));
|
||||
timer->start(50);
|
||||
|
||||
dial = d_speedo;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
d_ai = new AttitudeIndicator(this);
|
||||
|
||||
QTimer *gradientTimer = new QTimer(d_ai);
|
||||
gradientTimer->connect(gradientTimer, SIGNAL(timeout()),
|
||||
this, SLOT(changeGradient()));
|
||||
gradientTimer->start(100);
|
||||
|
||||
QTimer *angleTimer = new QTimer(d_ai);
|
||||
angleTimer->connect(angleTimer, SIGNAL(timeout()),
|
||||
this, SLOT(changeAngle()));
|
||||
angleTimer->start(100);
|
||||
|
||||
dial = d_ai;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( dial )
|
||||
{
|
||||
dial->setReadOnly(true);
|
||||
dial->scaleDraw()->setPenWidth(3);
|
||||
dial->setLineWidth(4);
|
||||
dial->setFrameShadow(QwtDial::Sunken);
|
||||
}
|
||||
return dial;
|
||||
}
|
||||
|
||||
QPalette CockpitGrid::colorTheme(const QColor &base) const
|
||||
{
|
||||
const QColor background = base.dark(150);
|
||||
const QColor foreground = base.dark(200);
|
||||
|
||||
const QColor mid = base.dark(110);
|
||||
const QColor dark = base.dark(170);
|
||||
const QColor light = base.light(170);
|
||||
const QColor text = foreground.light(800);
|
||||
|
||||
QPalette palette;
|
||||
for ( int i = 0; i < QPalette::NColorGroups; i++ )
|
||||
{
|
||||
QPalette::ColorGroup cg = (QPalette::ColorGroup)i;
|
||||
|
||||
palette.setColor(cg, QPalette::Base, base);
|
||||
palette.setColor(cg, QPalette::Window, background);
|
||||
palette.setColor(cg, QPalette::Mid, mid);
|
||||
palette.setColor(cg, QPalette::Light, light);
|
||||
palette.setColor(cg, QPalette::Dark, dark);
|
||||
palette.setColor(cg, QPalette::Text, text);
|
||||
palette.setColor(cg, QPalette::WindowText, foreground);
|
||||
}
|
||||
|
||||
return palette;
|
||||
}
|
||||
|
||||
void CockpitGrid::changeSpeed()
|
||||
{
|
||||
static double offset = 0.8;
|
||||
|
||||
double speed = d_speedo->value();
|
||||
|
||||
if ( (speed < 40.0 && offset < 0.0 ) ||
|
||||
(speed > 160.0 && offset > 0.0) )
|
||||
{
|
||||
offset = -offset;
|
||||
}
|
||||
|
||||
static int counter = 0;
|
||||
switch(counter++ % 12 )
|
||||
{
|
||||
case 0:
|
||||
case 2:
|
||||
case 7:
|
||||
case 8:
|
||||
break;
|
||||
default:
|
||||
d_speedo->setValue(speed + offset);
|
||||
}
|
||||
}
|
||||
|
||||
void CockpitGrid::changeAngle()
|
||||
{
|
||||
static double offset = 0.05;
|
||||
|
||||
double angle = d_ai->angle();
|
||||
if ( angle > 180.0 )
|
||||
angle -= 360.0;
|
||||
|
||||
if ( (angle < -5.0 && offset < 0.0 ) ||
|
||||
(angle > 5.0 && offset > 0.0) )
|
||||
{
|
||||
offset = -offset;
|
||||
}
|
||||
|
||||
d_ai->setAngle(angle + offset);
|
||||
}
|
||||
|
||||
void CockpitGrid::changeGradient()
|
||||
{
|
||||
static double offset = 0.005;
|
||||
|
||||
double gradient = d_ai->gradient();
|
||||
|
||||
if ( (gradient < -0.05 && offset < 0.0 ) ||
|
||||
(gradient > 0.05 && offset > 0.0) )
|
||||
{
|
||||
offset = -offset;
|
||||
}
|
||||
|
||||
d_ai->setGradient(gradient + offset);
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
#include <qframe.h>
|
||||
#include <qpalette.h>
|
||||
|
||||
class QwtDial;
|
||||
class QwtAnalogClock;
|
||||
class SpeedoMeter;
|
||||
class AttitudeIndicator;
|
||||
|
||||
class CockpitGrid: public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CockpitGrid(QWidget *parent = NULL);
|
||||
|
||||
private Q_SLOTS:
|
||||
void changeSpeed();
|
||||
void changeGradient();
|
||||
void changeAngle();
|
||||
|
||||
private:
|
||||
QPalette colorTheme(const QColor &) const;
|
||||
QwtDial *createDial(int pos);
|
||||
|
||||
QwtAnalogClock *d_clock;
|
||||
SpeedoMeter *d_speedo;
|
||||
AttitudeIndicator *d_ai;
|
||||
};
|
||||
@@ -1,202 +0,0 @@
|
||||
#include <qlayout.h>
|
||||
#include <qwt_compass.h>
|
||||
#include <qwt_compass_rose.h>
|
||||
#include <qwt_dial_needle.h>
|
||||
#include "compass_grid.h"
|
||||
|
||||
CompassGrid::CompassGrid(QWidget *parent):
|
||||
QFrame(parent)
|
||||
{
|
||||
QPalette p = palette();
|
||||
p.setColor(backgroundRole(), Qt::gray);
|
||||
setPalette(p);
|
||||
|
||||
setAutoFillBackground(true);
|
||||
|
||||
QGridLayout *layout = new QGridLayout(this);
|
||||
layout->setSpacing(5);
|
||||
layout->setMargin(0);
|
||||
|
||||
int i;
|
||||
for ( i = 0; i < 6; i++ )
|
||||
{
|
||||
QwtCompass *compass = createCompass(i);
|
||||
layout->addWidget(compass, i / 3, i % 3);
|
||||
}
|
||||
|
||||
for ( i = 0; i < layout->columnCount(); i++ )
|
||||
layout->setColumnStretch(i, 1);
|
||||
}
|
||||
|
||||
QwtCompass *CompassGrid::createCompass(int pos)
|
||||
{
|
||||
int c;
|
||||
|
||||
QPalette colorGroup;
|
||||
for ( c = 0; c < QPalette::NColorRoles; c++ )
|
||||
colorGroup.setColor((QPalette::ColorRole)c, QColor());
|
||||
|
||||
colorGroup.setColor(QPalette::Base,
|
||||
palette().color(backgroundRole()).light(120));
|
||||
colorGroup.setColor(QPalette::WindowText,
|
||||
colorGroup.color(QPalette::Base));
|
||||
|
||||
QwtCompass *compass = new QwtCompass(this);
|
||||
compass->setLineWidth(4);
|
||||
compass->setFrameShadow(
|
||||
pos <= 2 ? QwtCompass::Sunken : QwtCompass::Raised);
|
||||
|
||||
switch(pos)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
/*
|
||||
A compass with a rose and no needle. Scale and rose are
|
||||
rotating.
|
||||
*/
|
||||
compass->setMode(QwtCompass::RotateScale);
|
||||
|
||||
QwtSimpleCompassRose *rose = new QwtSimpleCompassRose(16, 2);
|
||||
rose->setWidth(0.15);
|
||||
|
||||
compass->setRose(rose);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
/*
|
||||
A windrose, with a scale indicating the main directions only
|
||||
*/
|
||||
QMap<double, QString> map;
|
||||
map.insert(0.0, "N");
|
||||
map.insert(90.0, "E");
|
||||
map.insert(180.0, "S");
|
||||
map.insert(270.0, "W");
|
||||
|
||||
compass->setLabelMap(map);
|
||||
|
||||
QwtSimpleCompassRose *rose = new QwtSimpleCompassRose(4, 1);
|
||||
compass->setRose(rose);
|
||||
|
||||
compass->setNeedle(
|
||||
new QwtCompassWindArrow(QwtCompassWindArrow::Style2));
|
||||
compass->setValue(60.0);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
/*
|
||||
A compass with a rotating needle in darkBlue. Shows
|
||||
a ticks for each degree.
|
||||
*/
|
||||
|
||||
colorGroup.setColor(QPalette::Base, Qt::darkBlue);
|
||||
colorGroup.setColor(QPalette::WindowText,
|
||||
QColor(Qt::darkBlue).dark(120));
|
||||
colorGroup.setColor(QPalette::Text, Qt::white);
|
||||
|
||||
compass->setScaleComponents(
|
||||
QwtAbstractScaleDraw::Ticks | QwtAbstractScaleDraw::Labels);
|
||||
compass->setScaleTicks(1, 1, 3);
|
||||
compass->setScale(36, 5, 0);
|
||||
|
||||
compass->setNeedle(
|
||||
new QwtCompassMagnetNeedle(QwtCompassMagnetNeedle::ThinStyle));
|
||||
compass->setValue(220.0);
|
||||
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
/*
|
||||
A compass without a frame, showing numbers as tick labels.
|
||||
The origin is at 220.0
|
||||
*/
|
||||
colorGroup.setColor(QPalette::Base,
|
||||
palette().color(backgroundRole()));
|
||||
colorGroup.setColor(QPalette::WindowText, Qt::blue);
|
||||
|
||||
compass->setLineWidth(0);
|
||||
|
||||
compass->setScaleComponents( QwtAbstractScaleDraw::Backbone |
|
||||
QwtAbstractScaleDraw::Ticks | QwtAbstractScaleDraw::Labels );
|
||||
compass->setScaleTicks(0, 0, 3);
|
||||
|
||||
QMap<double, QString> map;
|
||||
for ( double d = 0.0; d < 360.0; d += 60.0 )
|
||||
{
|
||||
QString label;
|
||||
label.sprintf("%.0f", d);
|
||||
map.insert(d, label);
|
||||
}
|
||||
compass->setLabelMap(map);
|
||||
compass->setScale(36, 5, 0);
|
||||
|
||||
compass->setNeedle(new QwtDialSimpleNeedle(QwtDialSimpleNeedle::Ray,
|
||||
true, Qt::white));
|
||||
compass->setOrigin(220.0);
|
||||
compass->setValue(20.0);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
/*
|
||||
A compass showing another needle
|
||||
*/
|
||||
compass->setScaleComponents(
|
||||
QwtAbstractScaleDraw::Ticks | QwtAbstractScaleDraw::Labels );
|
||||
compass->setScaleTicks(0, 0, 3);
|
||||
|
||||
compass->setNeedle(new QwtCompassMagnetNeedle(
|
||||
QwtCompassMagnetNeedle::TriangleStyle, Qt::white, Qt::red));
|
||||
compass->setValue(220.0);
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
/*
|
||||
A compass with a yellow on black ray
|
||||
*/
|
||||
colorGroup.setColor(QPalette::WindowText, Qt::black);
|
||||
|
||||
compass->setNeedle(new QwtDialSimpleNeedle(QwtDialSimpleNeedle::Ray,
|
||||
false, Qt::yellow));
|
||||
compass->setValue(315.0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QPalette newPalette = compass->palette();
|
||||
for ( c = 0; c < QPalette::NColorRoles; c++ )
|
||||
{
|
||||
if ( colorGroup.color((QPalette::ColorRole)c).isValid() )
|
||||
{
|
||||
for ( int cg = 0; cg < QPalette::NColorGroups; cg++ )
|
||||
{
|
||||
newPalette.setColor(
|
||||
(QPalette::ColorGroup)cg,
|
||||
(QPalette::ColorRole)c,
|
||||
colorGroup.color((QPalette::ColorRole)c));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( int i = 0; i < QPalette::NColorGroups; i++ )
|
||||
{
|
||||
QPalette::ColorGroup cg = (QPalette::ColorGroup)i;
|
||||
|
||||
const QColor light =
|
||||
newPalette.color(cg, QPalette::Base).light(170);
|
||||
const QColor dark = newPalette.color(cg, QPalette::Base).dark(170);
|
||||
const QColor mid = compass->frameShadow() == QwtDial::Raised
|
||||
? newPalette.color(cg, QPalette::Base).dark(110)
|
||||
: newPalette.color(cg, QPalette::Base).light(110);
|
||||
|
||||
newPalette.setColor(cg, QPalette::Dark, dark);
|
||||
newPalette.setColor(cg, QPalette::Mid, mid);
|
||||
newPalette.setColor(cg, QPalette::Light, light);
|
||||
}
|
||||
compass->setPalette(newPalette);
|
||||
|
||||
return compass;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
#include <qframe.h>
|
||||
class QwtCompass;
|
||||
|
||||
class CompassGrid: public QFrame
|
||||
{
|
||||
public:
|
||||
CompassGrid(QWidget *parent = NULL);
|
||||
|
||||
private:
|
||||
QwtCompass *createCompass(int pos);
|
||||
};
|
||||
@@ -1,23 +0,0 @@
|
||||
#include <qapplication.h>
|
||||
#include <qtabwidget.h>
|
||||
#include "compass_grid.h"
|
||||
#include "cockpit_grid.h"
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
//
|
||||
// dials.cpp -- A demo program featuring QwtDial and friends
|
||||
//
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
QTabWidget tabWidget;
|
||||
tabWidget.addTab(new CompassGrid, "Compass");
|
||||
tabWidget.addTab(new CockpitGrid, "Cockpit");
|
||||
|
||||
tabWidget.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
################################################################
|
||||
|
||||
include( $${PWD}/../examples.pri )
|
||||
|
||||
TARGET = dials
|
||||
|
||||
HEADERS = \
|
||||
attitude_indicator.h \
|
||||
speedo_meter.h \
|
||||
cockpit_grid.h \
|
||||
compass_grid.h
|
||||
|
||||
SOURCES = \
|
||||
attitude_indicator.cpp \
|
||||
speedo_meter.cpp \
|
||||
cockpit_grid.cpp \
|
||||
compass_grid.cpp \
|
||||
dials.cpp
|
||||
@@ -1,48 +0,0 @@
|
||||
#include <qpainter.h>
|
||||
#include <qwt_dial_needle.h>
|
||||
#include "speedo_meter.h"
|
||||
|
||||
SpeedoMeter::SpeedoMeter(QWidget *parent):
|
||||
QwtDial(parent),
|
||||
d_label("km/h")
|
||||
{
|
||||
setWrapping(false);
|
||||
setReadOnly(true);
|
||||
|
||||
setOrigin(135.0);
|
||||
setScaleArc(0.0, 270.0);
|
||||
scaleDraw()->setSpacing(8);
|
||||
|
||||
QwtDialSimpleNeedle *needle = new QwtDialSimpleNeedle(
|
||||
QwtDialSimpleNeedle::Arrow, true, Qt::red,
|
||||
QColor(Qt::gray).light(130));
|
||||
setNeedle(needle);
|
||||
|
||||
setScaleComponents(
|
||||
QwtAbstractScaleDraw::Ticks | QwtAbstractScaleDraw::Labels);
|
||||
setScaleTicks(0, 4, 8);
|
||||
}
|
||||
|
||||
void SpeedoMeter::setLabel(const QString &label)
|
||||
{
|
||||
d_label = label;
|
||||
update();
|
||||
}
|
||||
|
||||
QString SpeedoMeter::label() const
|
||||
{
|
||||
return d_label;
|
||||
}
|
||||
|
||||
void SpeedoMeter::drawScaleContents(QPainter *painter,
|
||||
const QPointF ¢er, double radius) const
|
||||
{
|
||||
QRectF rect( 0.0, 0.0, 2.0 * radius, 2.0 * radius - 10.0);
|
||||
rect.moveCenter(center);
|
||||
|
||||
const QColor color = palette().color(QPalette::Text);
|
||||
painter->setPen(color);
|
||||
|
||||
const int flags = Qt::AlignBottom | Qt::AlignHCenter;
|
||||
painter->drawText(rect, flags, d_label);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
#include <qstring.h>
|
||||
#include <qwt_dial.h>
|
||||
|
||||
class SpeedoMeter: public QwtDial
|
||||
{
|
||||
public:
|
||||
SpeedoMeter(QWidget *parent = NULL);
|
||||
|
||||
void setLabel(const QString &);
|
||||
QString label() const;
|
||||
|
||||
protected:
|
||||
virtual void drawScaleContents(QPainter *painter,
|
||||
const QPointF ¢er, double radius) const;
|
||||
|
||||
private:
|
||||
QString d_label;
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
QwtPlot is a composite widget consisting of a title label,
|
||||
the canvas, the scales and a legend. Although all components
|
||||
should be exchangable some day, the current design isn´t ready for it.
|
||||
|
||||
In this situation event filtering is the mechanism to extend the behaviour
|
||||
of the plot components. event_filter shows 3 examples how to use it:
|
||||
|
||||
1) CanvasPicker
|
||||
|
||||
The CanvasPicker implements a solution, how to move points on the canvas
|
||||
with mouse and keyboard.
|
||||
|
||||
2) ScalePicker
|
||||
|
||||
The ScalePicker translates the position of mouse clicks on the scales
|
||||
and emits them as signals.
|
||||
|
||||
3) Plot: ColorBar, QSlider
|
||||
|
||||
The Plot class shows how to add widgets to the scales. In this example
|
||||
there is no filter class. The derived plot widget filters its components.
|
||||
|
||||
|
||||
Please note that CanvasPicker and ScalePicker are standalone classes
|
||||
that could be connected with your QwtPlot as well.
|
||||
|
||||
Uwe
|
||||
@@ -1,328 +0,0 @@
|
||||
#include <qapplication.h>
|
||||
#include <qevent.h>
|
||||
#include <qwhatsthis.h>
|
||||
#include <qpainter.h>
|
||||
#include <qwt_plot.h>
|
||||
#include <qwt_symbol.h>
|
||||
#include <qwt_scale_map.h>
|
||||
#include <qwt_plot_canvas.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_plot_directpainter.h>
|
||||
#include "canvaspicker.h"
|
||||
|
||||
CanvasPicker::CanvasPicker(QwtPlot *plot):
|
||||
QObject(plot),
|
||||
d_selectedCurve(NULL),
|
||||
d_selectedPoint(-1)
|
||||
{
|
||||
QwtPlotCanvas *canvas = plot->canvas();
|
||||
|
||||
canvas->installEventFilter(this);
|
||||
|
||||
// We want the focus, but no focus rect. The
|
||||
// selected point will be highlighted instead.
|
||||
|
||||
canvas->setFocusPolicy(Qt::StrongFocus);
|
||||
#ifndef QT_NO_CURSOR
|
||||
canvas->setCursor(Qt::PointingHandCursor);
|
||||
#endif
|
||||
canvas->setFocusIndicator(QwtPlotCanvas::ItemFocusIndicator);
|
||||
canvas->setFocus();
|
||||
|
||||
const char *text =
|
||||
"All points can be moved using the left mouse button "
|
||||
"or with these keys:\n\n"
|
||||
"- Up:\t\tSelect next curve\n"
|
||||
"- Down:\t\tSelect previous curve\n"
|
||||
"- Left, ´-´:\tSelect next point\n"
|
||||
"- Right, ´+´:\tSelect previous point\n"
|
||||
"- 7, 8, 9, 4, 6, 1, 2, 3:\tMove selected point";
|
||||
canvas->setWhatsThis(text);
|
||||
|
||||
shiftCurveCursor(true);
|
||||
}
|
||||
|
||||
bool CanvasPicker::event(QEvent *e)
|
||||
{
|
||||
if ( e->type() == QEvent::User )
|
||||
{
|
||||
showCursor(true);
|
||||
return true;
|
||||
}
|
||||
return QObject::event(e);
|
||||
}
|
||||
|
||||
bool CanvasPicker::eventFilter(QObject *object, QEvent *e)
|
||||
{
|
||||
if ( object != (QObject *)plot()->canvas() )
|
||||
return false;
|
||||
|
||||
switch(e->type())
|
||||
{
|
||||
case QEvent::FocusIn:
|
||||
showCursor(true);
|
||||
case QEvent::FocusOut:
|
||||
showCursor(false);
|
||||
|
||||
case QEvent::Paint:
|
||||
{
|
||||
QApplication::postEvent(this, new QEvent(QEvent::User));
|
||||
break;
|
||||
}
|
||||
case QEvent::MouseButtonPress:
|
||||
{
|
||||
select(((QMouseEvent *)e)->pos());
|
||||
return true;
|
||||
}
|
||||
case QEvent::MouseMove:
|
||||
{
|
||||
move(((QMouseEvent *)e)->pos());
|
||||
return true;
|
||||
}
|
||||
case QEvent::KeyPress:
|
||||
{
|
||||
const int delta = 5;
|
||||
switch(((const QKeyEvent *)e)->key())
|
||||
{
|
||||
case Qt::Key_Up:
|
||||
shiftCurveCursor(true);
|
||||
return true;
|
||||
|
||||
case Qt::Key_Down:
|
||||
shiftCurveCursor(false);
|
||||
return true;
|
||||
|
||||
case Qt::Key_Right:
|
||||
case Qt::Key_Plus:
|
||||
if ( d_selectedCurve )
|
||||
shiftPointCursor(true);
|
||||
else
|
||||
shiftCurveCursor(true);
|
||||
return true;
|
||||
|
||||
case Qt::Key_Left:
|
||||
case Qt::Key_Minus:
|
||||
if ( d_selectedCurve )
|
||||
shiftPointCursor(false);
|
||||
else
|
||||
shiftCurveCursor(true);
|
||||
return true;
|
||||
|
||||
// The following keys represent a direction, they are
|
||||
// organized on the keyboard.
|
||||
|
||||
case Qt::Key_1:
|
||||
moveBy(-delta, delta);
|
||||
break;
|
||||
case Qt::Key_2:
|
||||
moveBy(0, delta);
|
||||
break;
|
||||
case Qt::Key_3:
|
||||
moveBy(delta, delta);
|
||||
break;
|
||||
case Qt::Key_4:
|
||||
moveBy(-delta, 0);
|
||||
break;
|
||||
case Qt::Key_6:
|
||||
moveBy(delta, 0);
|
||||
break;
|
||||
case Qt::Key_7:
|
||||
moveBy(-delta, -delta);
|
||||
break;
|
||||
case Qt::Key_8:
|
||||
moveBy(0, -delta);
|
||||
break;
|
||||
case Qt::Key_9:
|
||||
moveBy(delta, -delta);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return QObject::eventFilter(object, e);
|
||||
}
|
||||
|
||||
// Select the point at a position. If there is no point
|
||||
// deselect the selected point
|
||||
|
||||
void CanvasPicker::select(const QPoint &pos)
|
||||
{
|
||||
QwtPlotCurve *curve = NULL;
|
||||
double dist = 10e10;
|
||||
int index = -1;
|
||||
|
||||
const QwtPlotItemList& itmList = plot()->itemList();
|
||||
for ( QwtPlotItemIterator it = itmList.begin();
|
||||
it != itmList.end(); ++it )
|
||||
{
|
||||
if ( (*it)->rtti() == QwtPlotItem::Rtti_PlotCurve )
|
||||
{
|
||||
QwtPlotCurve *c = (QwtPlotCurve*)(*it);
|
||||
|
||||
double d;
|
||||
int idx = c->closestPoint(pos, &d);
|
||||
if ( d < dist )
|
||||
{
|
||||
curve = c;
|
||||
index = idx;
|
||||
dist = d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
showCursor(false);
|
||||
d_selectedCurve = NULL;
|
||||
d_selectedPoint = -1;
|
||||
|
||||
if ( curve && dist < 10 ) // 10 pixels tolerance
|
||||
{
|
||||
d_selectedCurve = curve;
|
||||
d_selectedPoint = index;
|
||||
showCursor(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Move the selected point
|
||||
void CanvasPicker::moveBy(int dx, int dy)
|
||||
{
|
||||
if ( dx == 0 && dy == 0 )
|
||||
return;
|
||||
|
||||
if ( !d_selectedCurve )
|
||||
return;
|
||||
|
||||
const QPointF sample =
|
||||
d_selectedCurve->sample(d_selectedPoint);
|
||||
|
||||
const double x = plot()->transform(
|
||||
d_selectedCurve->xAxis(), sample.x());
|
||||
const double y = plot()->transform(
|
||||
d_selectedCurve->yAxis(), sample.y());
|
||||
|
||||
move( QPoint(qRound(x + dx), qRound(y + dy)) );
|
||||
}
|
||||
|
||||
// Move the selected point
|
||||
void CanvasPicker::move(const QPoint &pos)
|
||||
{
|
||||
if ( !d_selectedCurve )
|
||||
return;
|
||||
|
||||
QVector<double> xData(d_selectedCurve->dataSize());
|
||||
QVector<double> yData(d_selectedCurve->dataSize());
|
||||
|
||||
for ( int i = 0; i < (int)d_selectedCurve->dataSize(); i++ )
|
||||
{
|
||||
if ( i == d_selectedPoint )
|
||||
{
|
||||
xData[i] = plot()->invTransform(
|
||||
d_selectedCurve->xAxis(), pos.x());
|
||||
yData[i] = plot()->invTransform(
|
||||
d_selectedCurve->yAxis(), pos.y());
|
||||
}
|
||||
else
|
||||
{
|
||||
const QPointF sample = d_selectedCurve->sample(i);
|
||||
xData[i] = sample.x();
|
||||
yData[i] = sample.y();
|
||||
}
|
||||
}
|
||||
d_selectedCurve->setSamples(xData, yData);
|
||||
|
||||
/*
|
||||
Enable QwtPlotCanvas::ImmediatePaint, so that the canvas has been
|
||||
updated before we paint the cursor on it.
|
||||
*/
|
||||
plot()->canvas()->setPaintAttribute( QwtPlotCanvas::ImmediatePaint, true);
|
||||
plot()->replot();
|
||||
plot()->canvas()->setPaintAttribute( QwtPlotCanvas::ImmediatePaint, false);
|
||||
|
||||
showCursor(true);
|
||||
}
|
||||
|
||||
// Hightlight the selected point
|
||||
void CanvasPicker::showCursor(bool showIt)
|
||||
{
|
||||
if ( !d_selectedCurve )
|
||||
return;
|
||||
|
||||
QwtSymbol *symbol = const_cast<QwtSymbol *>( d_selectedCurve->symbol() );
|
||||
|
||||
const QBrush brush = symbol->brush();
|
||||
if ( showIt )
|
||||
symbol->setBrush(symbol->brush().color().dark(180));
|
||||
|
||||
QwtPlotDirectPainter directPainter;
|
||||
directPainter.drawSeries(d_selectedCurve, d_selectedPoint, d_selectedPoint);
|
||||
|
||||
if ( showIt )
|
||||
symbol->setBrush(brush); // reset brush
|
||||
}
|
||||
|
||||
// Select the next/previous curve
|
||||
void CanvasPicker::shiftCurveCursor(bool up)
|
||||
{
|
||||
QwtPlotItemIterator it;
|
||||
|
||||
const QwtPlotItemList &itemList = plot()->itemList();
|
||||
|
||||
QwtPlotItemList curveList;
|
||||
for ( it = itemList.begin(); it != itemList.end(); ++it )
|
||||
{
|
||||
if ( (*it)->rtti() == QwtPlotItem::Rtti_PlotCurve )
|
||||
curveList += *it;
|
||||
}
|
||||
if ( curveList.isEmpty() )
|
||||
return;
|
||||
|
||||
it = curveList.begin();
|
||||
|
||||
if ( d_selectedCurve )
|
||||
{
|
||||
for ( it = curveList.begin(); it != curveList.end(); ++it )
|
||||
{
|
||||
if ( d_selectedCurve == *it )
|
||||
break;
|
||||
}
|
||||
if ( it == curveList.end() ) // not found
|
||||
it = curveList.begin();
|
||||
|
||||
if ( up )
|
||||
{
|
||||
++it;
|
||||
if ( it == curveList.end() )
|
||||
it = curveList.begin();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( it == curveList.begin() )
|
||||
it = curveList.end();
|
||||
--it;
|
||||
}
|
||||
}
|
||||
|
||||
showCursor(false);
|
||||
d_selectedPoint = 0;
|
||||
d_selectedCurve = (QwtPlotCurve *)*it;
|
||||
showCursor(true);
|
||||
}
|
||||
|
||||
// Select the next/previous neighbour of the selected point
|
||||
void CanvasPicker::shiftPointCursor(bool up)
|
||||
{
|
||||
if ( !d_selectedCurve )
|
||||
return;
|
||||
|
||||
int index = d_selectedPoint + (up ? 1 : -1);
|
||||
index = (index + d_selectedCurve->dataSize()) % d_selectedCurve->dataSize();
|
||||
|
||||
if ( index != d_selectedPoint )
|
||||
{
|
||||
showCursor(false);
|
||||
d_selectedPoint = index;
|
||||
showCursor(true);
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#include <qobject.h>
|
||||
|
||||
class QPoint;
|
||||
class QCustomEvent;
|
||||
class QwtPlot;
|
||||
class QwtPlotCurve;
|
||||
|
||||
class CanvasPicker: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CanvasPicker(QwtPlot *plot);
|
||||
virtual bool eventFilter(QObject *, QEvent *);
|
||||
|
||||
virtual bool event(QEvent *);
|
||||
|
||||
private:
|
||||
void select(const QPoint &);
|
||||
void move(const QPoint &);
|
||||
void moveBy(int dx, int dy);
|
||||
|
||||
void release();
|
||||
|
||||
void showCursor(bool enable);
|
||||
void shiftPointCursor(bool up);
|
||||
void shiftCurveCursor(bool up);
|
||||
|
||||
QwtPlot *plot() { return (QwtPlot *)parent(); }
|
||||
const QwtPlot *plot() const { return (QwtPlot *)parent(); }
|
||||
|
||||
QwtPlotCurve *d_selectedCurve;
|
||||
int d_selectedPoint;
|
||||
};
|
||||
@@ -1,111 +0,0 @@
|
||||
#include <qevent.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qimage.h>
|
||||
#include <qpainter.h>
|
||||
#include "colorbar.h"
|
||||
|
||||
ColorBar::ColorBar(Qt::Orientation o, QWidget *parent):
|
||||
QWidget(parent),
|
||||
d_orientation(o),
|
||||
d_light(Qt::white),
|
||||
d_dark(Qt::black)
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
setCursor(Qt::PointingHandCursor);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ColorBar::setOrientation(Qt::Orientation o)
|
||||
{
|
||||
d_orientation = o;
|
||||
update();
|
||||
}
|
||||
|
||||
void ColorBar::setLight(const QColor &light)
|
||||
{
|
||||
d_light = light;
|
||||
update();
|
||||
}
|
||||
|
||||
void ColorBar::setDark(const QColor &dark)
|
||||
{
|
||||
d_dark = dark;
|
||||
update();
|
||||
}
|
||||
|
||||
void ColorBar::setRange(const QColor &light, const QColor &dark)
|
||||
{
|
||||
d_light = light;
|
||||
d_dark = dark;
|
||||
update();
|
||||
}
|
||||
|
||||
void ColorBar::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
if( e->button() == Qt::LeftButton )
|
||||
{
|
||||
// emit the color of the position where the mouse click
|
||||
// happened
|
||||
|
||||
const QPixmap pm = QPixmap::grabWidget(this);
|
||||
const QRgb rgb = pm.toImage().pixel(e->x(), e->y());
|
||||
|
||||
Q_EMIT selected(QColor(rgb));
|
||||
e->accept();
|
||||
}
|
||||
}
|
||||
|
||||
void ColorBar::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter(this);
|
||||
drawColorBar(&painter, rect());
|
||||
}
|
||||
|
||||
void ColorBar::drawColorBar(QPainter *painter, const QRect &rect) const
|
||||
{
|
||||
int h1, s1, v1;
|
||||
int h2, s2, v2;
|
||||
|
||||
d_light.getHsv(&h1, &s1, &v1);
|
||||
d_dark.getHsv(&h2, &s2, &v2);
|
||||
|
||||
painter->save();
|
||||
painter->setClipRect(rect);
|
||||
painter->setClipping(true);
|
||||
|
||||
painter->fillRect(rect, d_dark);
|
||||
|
||||
const int sectionSize = 2;
|
||||
|
||||
int numIntervalls;
|
||||
if ( d_orientation == Qt::Horizontal )
|
||||
numIntervalls = rect.width() / sectionSize;
|
||||
else
|
||||
numIntervalls = rect.height() / sectionSize;
|
||||
|
||||
for ( int i = 0; i < numIntervalls; i++ )
|
||||
{
|
||||
QRect section;
|
||||
if ( d_orientation == Qt::Horizontal )
|
||||
{
|
||||
section.setRect(rect.x() + i * sectionSize, rect.y(),
|
||||
sectionSize, rect.height());
|
||||
}
|
||||
else
|
||||
{
|
||||
section.setRect(rect.x(), rect.y() + i * sectionSize,
|
||||
rect.width(), sectionSize);
|
||||
}
|
||||
|
||||
const double ratio = i / (double)numIntervalls;
|
||||
|
||||
QColor c;
|
||||
c.setHsv( h1 + qRound(ratio * (h2 - h1)),
|
||||
s1 + qRound(ratio * (s2 - s1)),
|
||||
v1 + qRound(ratio * (v2 - v1)) );
|
||||
|
||||
painter->fillRect(section, c);
|
||||
}
|
||||
|
||||
painter->restore();
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
#include <qwidget.h>
|
||||
|
||||
class ColorBar: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ColorBar(Qt::Orientation = Qt::Horizontal,
|
||||
QWidget * = NULL);
|
||||
|
||||
virtual void setOrientation(Qt::Orientation o);
|
||||
Qt::Orientation orientation() const { return d_orientation; }
|
||||
|
||||
void setRange(const QColor &light, const QColor &dark);
|
||||
void setLight(const QColor &light);
|
||||
void setDark(const QColor &dark);
|
||||
|
||||
QColor light() const { return d_light; }
|
||||
QColor dark() const { return d_dark; }
|
||||
|
||||
Q_SIGNALS:
|
||||
void selected(const QColor &);
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent(QMouseEvent *);
|
||||
virtual void paintEvent(QPaintEvent *);
|
||||
|
||||
void drawColorBar(QPainter *, const QRect &) const;
|
||||
|
||||
private:
|
||||
Qt::Orientation d_orientation;
|
||||
QColor d_light;
|
||||
QColor d_dark;
|
||||
};
|
||||
@@ -1,51 +0,0 @@
|
||||
//-----------------------------------------------------------------
|
||||
// A demo program showing how to use event filtering
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qmainwindow.h>
|
||||
#include <qwhatsthis.h>
|
||||
#include <qtoolbar.h>
|
||||
#include <qtoolbutton.h>
|
||||
#include "plot.h"
|
||||
#include "canvaspicker.h"
|
||||
#include "scalepicker.h"
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
QMainWindow mainWindow;
|
||||
QToolBar *toolBar = new QToolBar(&mainWindow);
|
||||
QAction *action = QWhatsThis::createAction(toolBar);
|
||||
toolBar->addAction(action);
|
||||
mainWindow.addToolBar(toolBar);
|
||||
|
||||
Plot *plot = new Plot(&mainWindow);
|
||||
|
||||
// The canvas picker handles all mouse and key
|
||||
// events on the plot canvas
|
||||
|
||||
(void) new CanvasPicker(plot);
|
||||
|
||||
// The scale picker translates mouse clicks
|
||||
// int o clicked() signals
|
||||
|
||||
ScalePicker *scalePicker = new ScalePicker(plot);
|
||||
a.connect(scalePicker, SIGNAL(clicked(int, double)),
|
||||
plot, SLOT(insertCurve(int, double)));
|
||||
|
||||
mainWindow.setCentralWidget(plot);
|
||||
|
||||
mainWindow.resize(540, 400);
|
||||
mainWindow.show();
|
||||
|
||||
const char *text =
|
||||
"An useless plot to demonstrate how to use event filtering.\n\n"
|
||||
"You can click on the color bar, the scales or move the wheel.\n"
|
||||
"All points can be moved using the mouse or the keyboard.";
|
||||
plot->setWhatsThis(text);
|
||||
|
||||
int rv = a.exec();
|
||||
return rv;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
################################################################
|
||||
|
||||
include( $${PWD}/../examples.pri )
|
||||
|
||||
TARGET = event_filter
|
||||
|
||||
HEADERS = \
|
||||
colorbar.h \
|
||||
scalepicker.h \
|
||||
canvaspicker.h \
|
||||
plot.h
|
||||
|
||||
SOURCES = \
|
||||
colorbar.cpp \
|
||||
scalepicker.cpp \
|
||||
canvaspicker.cpp \
|
||||
plot.cpp \
|
||||
event_filter.cpp
|
||||
@@ -1,176 +0,0 @@
|
||||
#include "plot.h"
|
||||
#include "colorbar.h"
|
||||
#include <qevent.h>
|
||||
#include <qwt_plot_layout.h>
|
||||
#include <qwt_plot_canvas.h>
|
||||
#include <qwt_plot_grid.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_symbol.h>
|
||||
#include <qwt_scale_widget.h>
|
||||
#include <qwt_wheel.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
Plot::Plot(QWidget *parent):
|
||||
QwtPlot(parent)
|
||||
{
|
||||
setTitle("Interactive Plot");
|
||||
|
||||
setCanvasColor(Qt::darkCyan);
|
||||
|
||||
QwtPlotGrid *grid = new QwtPlotGrid;
|
||||
grid->setMajPen(QPen(Qt::white, 0, Qt::DotLine));
|
||||
grid->attach(this);
|
||||
|
||||
// axes
|
||||
|
||||
setAxisScale(QwtPlot::xBottom, 0.0, 100.0);
|
||||
setAxisScale(QwtPlot::yLeft, 0.0, 100.0);
|
||||
|
||||
// Avoid jumping when label with 3 digits
|
||||
// appear/disappear when scrolling vertically
|
||||
|
||||
QwtScaleDraw *sd = axisScaleDraw(QwtPlot::yLeft);
|
||||
sd->setMinimumExtent( sd->extent(axisWidget(QwtPlot::yLeft)->font()));
|
||||
|
||||
plotLayout()->setAlignCanvasToScales(true);
|
||||
|
||||
insertCurve(Qt::Vertical, Qt::blue, 30.0);
|
||||
insertCurve(Qt::Vertical, Qt::magenta, 70.0);
|
||||
insertCurve(Qt::Horizontal, Qt::yellow, 30.0);
|
||||
insertCurve(Qt::Horizontal, Qt::white, 70.0);
|
||||
|
||||
replot();
|
||||
|
||||
// ------------------------------------
|
||||
// We add a color bar to the left axis
|
||||
// ------------------------------------
|
||||
|
||||
QwtScaleWidget *scaleWidget = (QwtScaleWidget *)axisWidget(yLeft);
|
||||
scaleWidget->setMargin(10); // area for the color bar
|
||||
d_colorBar = new ColorBar(Qt::Vertical, scaleWidget);
|
||||
d_colorBar->setRange(Qt::red, Qt::darkBlue);
|
||||
d_colorBar->setFocusPolicy(Qt::TabFocus);
|
||||
|
||||
connect(d_colorBar, SIGNAL(selected(const QColor &)),
|
||||
SLOT(setCanvasColor(const QColor &)));
|
||||
|
||||
// we need the resize events, to lay out the color bar
|
||||
scaleWidget->installEventFilter(this);
|
||||
|
||||
// ------------------------------------
|
||||
// We add a wheel to the canvas
|
||||
// ------------------------------------
|
||||
|
||||
d_wheel = new QwtWheel(canvas());
|
||||
d_wheel->setOrientation(Qt::Vertical);
|
||||
d_wheel->setRange(-100, 100);
|
||||
d_wheel->setValue(0.0);
|
||||
d_wheel->setMass(0.2);
|
||||
d_wheel->setTotalAngle(4 * 360.0);
|
||||
|
||||
connect(d_wheel, SIGNAL(valueChanged(double)),
|
||||
SLOT(scrollLeftAxis(double)));
|
||||
|
||||
// we need the resize events, to lay out the wheel
|
||||
canvas()->installEventFilter(this);
|
||||
|
||||
d_colorBar->setWhatsThis(
|
||||
"Selecting a color will change the background of the plot.");
|
||||
scaleWidget->setWhatsThis(
|
||||
"Selecting a value at the scale will insert a new curve.");
|
||||
d_wheel->setWhatsThis(
|
||||
"With the wheel you can move the visible area.");
|
||||
axisWidget(xBottom)->setWhatsThis(
|
||||
"Selecting a value at the scale will insert a new curve.");
|
||||
}
|
||||
|
||||
void Plot::setCanvasColor(const QColor &c)
|
||||
{
|
||||
setCanvasBackground(c);
|
||||
replot();
|
||||
}
|
||||
|
||||
void Plot::scrollLeftAxis(double value)
|
||||
{
|
||||
setAxisScale(yLeft, value, value + 100.0);
|
||||
replot();
|
||||
}
|
||||
|
||||
bool Plot::eventFilter(QObject *object, QEvent *e)
|
||||
{
|
||||
if ( e->type() == QEvent::Resize )
|
||||
{
|
||||
const QSize &size = ((QResizeEvent *)e)->size();
|
||||
if ( object == (QObject *)axisWidget(yLeft) )
|
||||
{
|
||||
const QwtScaleWidget *scaleWidget = axisWidget(yLeft);
|
||||
|
||||
const int margin = 2;
|
||||
|
||||
// adjust the color bar to the scale backbone
|
||||
const int x = size.width() - scaleWidget->margin() + margin;
|
||||
const int w = scaleWidget->margin() - 2 * margin;
|
||||
const int y = scaleWidget->startBorderDist();
|
||||
const int h = size.height() -
|
||||
scaleWidget->startBorderDist() - scaleWidget->endBorderDist();
|
||||
|
||||
d_colorBar->setGeometry(x, y, w, h);
|
||||
}
|
||||
if ( object == canvas() )
|
||||
{
|
||||
const int w = 16;
|
||||
const int h = 50;
|
||||
const int margin = 2;
|
||||
|
||||
const QRect cr = canvas()->contentsRect();
|
||||
d_wheel->setGeometry(
|
||||
cr.right() - margin - w, cr.center().y() - h / 2, w, h);
|
||||
}
|
||||
}
|
||||
|
||||
return QwtPlot::eventFilter(object, e);
|
||||
}
|
||||
|
||||
void Plot::insertCurve(int axis, double base)
|
||||
{
|
||||
Qt::Orientation o;
|
||||
if ( axis == yLeft || axis == yRight )
|
||||
o = Qt::Horizontal;
|
||||
else
|
||||
o = Qt::Vertical;
|
||||
|
||||
QRgb rgb = (uint)rand();
|
||||
insertCurve(o, QColor(rgb), base);
|
||||
replot();
|
||||
}
|
||||
|
||||
void Plot::insertCurve(Qt::Orientation o,
|
||||
const QColor &c, double base)
|
||||
{
|
||||
QwtPlotCurve *curve = new QwtPlotCurve();
|
||||
|
||||
curve->setPen(c);
|
||||
curve->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,
|
||||
Qt::gray, c, QSize(8, 8)));
|
||||
|
||||
double x[10];
|
||||
double y[sizeof(x) / sizeof(x[0])];
|
||||
|
||||
for ( uint i = 0; i < sizeof(x) / sizeof(x[0]); i++ )
|
||||
{
|
||||
double v = 5.0 + i * 10.0;
|
||||
if ( o == Qt::Horizontal )
|
||||
{
|
||||
x[i] = v;
|
||||
y[i] = base;
|
||||
}
|
||||
else
|
||||
{
|
||||
x[i] = base;
|
||||
y[i] = v;
|
||||
}
|
||||
}
|
||||
|
||||
curve->setSamples(x, y, sizeof(x) / sizeof(x[0]));
|
||||
curve->attach(this);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#include <qwt_plot.h>
|
||||
|
||||
class ColorBar;
|
||||
class QwtWheel;
|
||||
|
||||
class Plot: public QwtPlot
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Plot(QWidget *parent = NULL);
|
||||
virtual bool eventFilter(QObject *, QEvent *);
|
||||
|
||||
public Q_SLOTS:
|
||||
void setCanvasColor(const QColor &);
|
||||
void insertCurve(int axis, double base);
|
||||
|
||||
private Q_SLOTS:
|
||||
void scrollLeftAxis(double);
|
||||
|
||||
private:
|
||||
void insertCurve(Qt::Orientation, const QColor &, double base);
|
||||
|
||||
ColorBar *d_colorBar;
|
||||
QwtWheel *d_wheel;
|
||||
};
|
||||
@@ -1,114 +0,0 @@
|
||||
#include <qevent.h>
|
||||
#include <qwt_plot.h>
|
||||
#include <qwt_scale_widget.h>
|
||||
#include "scalepicker.h"
|
||||
|
||||
ScalePicker::ScalePicker(QwtPlot *plot):
|
||||
QObject(plot)
|
||||
{
|
||||
for ( uint i = 0; i < QwtPlot::axisCnt; i++ )
|
||||
{
|
||||
QwtScaleWidget *scaleWidget = (QwtScaleWidget *)plot->axisWidget(i);
|
||||
if ( scaleWidget )
|
||||
scaleWidget->installEventFilter(this);
|
||||
}
|
||||
}
|
||||
|
||||
bool ScalePicker::eventFilter(QObject *object, QEvent *e)
|
||||
{
|
||||
if ( object->inherits("QwtScaleWidget") &&
|
||||
e->type() == QEvent::MouseButtonPress )
|
||||
{
|
||||
mouseClicked((const QwtScaleWidget *)object,
|
||||
((QMouseEvent *)e)->pos());
|
||||
return true;
|
||||
}
|
||||
|
||||
return QObject::eventFilter(object, e);
|
||||
}
|
||||
|
||||
void ScalePicker::mouseClicked(const QwtScaleWidget *scale, const QPoint &pos)
|
||||
{
|
||||
QRect rect = scaleRect(scale);
|
||||
|
||||
int margin = 10; // 10 pixels tolerance
|
||||
rect.setRect(rect.x() - margin, rect.y() - margin,
|
||||
rect.width() + 2 * margin, rect.height() + 2 * margin);
|
||||
|
||||
if ( rect.contains(pos) ) // No click on the title
|
||||
{
|
||||
// translate the position in a value on the scale
|
||||
|
||||
double value = 0.0;
|
||||
int axis = -1;
|
||||
|
||||
const QwtScaleDraw *sd = scale->scaleDraw();
|
||||
switch(scale->alignment())
|
||||
{
|
||||
case QwtScaleDraw::LeftScale:
|
||||
{
|
||||
value = sd->scaleMap().invTransform(pos.y());
|
||||
axis = QwtPlot::yLeft;
|
||||
break;
|
||||
}
|
||||
case QwtScaleDraw::RightScale:
|
||||
{
|
||||
value = sd->scaleMap().invTransform(pos.y());
|
||||
axis = QwtPlot::yRight;
|
||||
break;
|
||||
}
|
||||
case QwtScaleDraw::BottomScale:
|
||||
{
|
||||
value = sd->scaleMap().invTransform(pos.x());
|
||||
axis = QwtPlot::xBottom;
|
||||
break;
|
||||
}
|
||||
case QwtScaleDraw::TopScale:
|
||||
{
|
||||
value = sd->scaleMap().invTransform(pos.x());
|
||||
axis = QwtPlot::xTop;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Q_EMIT clicked(axis, value);
|
||||
}
|
||||
}
|
||||
|
||||
// The rect of a scale without the title
|
||||
QRect ScalePicker::scaleRect(const QwtScaleWidget *scale) const
|
||||
{
|
||||
const int bld = scale->margin();
|
||||
const int mjt = scale->scaleDraw()->maxTickLength();
|
||||
const int sbd = scale->startBorderDist();
|
||||
const int ebd = scale->endBorderDist();
|
||||
|
||||
QRect rect;
|
||||
switch(scale->alignment())
|
||||
{
|
||||
case QwtScaleDraw::LeftScale:
|
||||
{
|
||||
rect.setRect(scale->width() - bld - mjt, sbd,
|
||||
mjt, scale->height() - sbd - ebd);
|
||||
break;
|
||||
}
|
||||
case QwtScaleDraw::RightScale:
|
||||
{
|
||||
rect.setRect(bld, sbd,
|
||||
mjt, scale->height() - sbd - ebd);
|
||||
break;
|
||||
}
|
||||
case QwtScaleDraw::BottomScale:
|
||||
{
|
||||
rect.setRect(sbd, bld,
|
||||
scale->width() - sbd - ebd, mjt);
|
||||
break;
|
||||
}
|
||||
case QwtScaleDraw::TopScale:
|
||||
{
|
||||
rect.setRect(sbd, scale->height() - bld - mjt,
|
||||
scale->width() - sbd - ebd, mjt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rect;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#include <qobject.h>
|
||||
#include <qrect.h>
|
||||
|
||||
class QwtPlot;
|
||||
class QwtScaleWidget;
|
||||
|
||||
class ScalePicker: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScalePicker(QwtPlot *plot);
|
||||
virtual bool eventFilter(QObject *, QEvent *);
|
||||
|
||||
Q_SIGNALS:
|
||||
void clicked(int axis, double value);
|
||||
|
||||
private:
|
||||
void mouseClicked(const QwtScaleWidget *, const QPoint &);
|
||||
QRect scaleRect(const QwtScaleWidget *) const;
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
###################################################################
|
||||
|
||||
QWT_ROOT = $${PWD}/..
|
||||
include( $${QWT_ROOT}/qwtconfig.pri )
|
||||
include( $${QWT_ROOT}/qwtbuild.pri )
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
INCLUDEPATH += $${QWT_ROOT}/src
|
||||
DEPENDPATH += $${QWT_ROOT}/src
|
||||
DESTDIR = $${QWT_ROOT}/examples/bin
|
||||
|
||||
QMAKE_RPATHDIR *= $${QWT_ROOT}/lib
|
||||
|
||||
contains(QWT_CONFIG, QwtFramework) {
|
||||
|
||||
LIBS += -F$${QWT_ROOT}/lib
|
||||
}
|
||||
else {
|
||||
|
||||
LIBS += -L$${QWT_ROOT}/lib
|
||||
}
|
||||
|
||||
IPATH = $${INCLUDEPATH}
|
||||
qtAddLibrary(qwt)
|
||||
INCLUDEPATH = $${IPATH}
|
||||
|
||||
contains(QWT_CONFIG, QwtSvg) {
|
||||
|
||||
QT += svg
|
||||
}
|
||||
else {
|
||||
|
||||
DEFINES += QWT_NO_SVG
|
||||
}
|
||||
|
||||
|
||||
win32 {
|
||||
contains(QWT_CONFIG, QwtDll) {
|
||||
DEFINES += QT_DLL QWT_DLL
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
################################################################
|
||||
|
||||
include( $${PWD}/../qwtconfig.pri )
|
||||
|
||||
TEMPLATE = subdirs
|
||||
|
||||
contains(QWT_CONFIG, QwtPlot) {
|
||||
|
||||
SUBDIRS += \
|
||||
cpuplot \
|
||||
curvdemo1 \
|
||||
curvdemo2 \
|
||||
friedberg \
|
||||
sinusplot \
|
||||
realtime \
|
||||
refreshtest \
|
||||
navigation \
|
||||
plotmatrix \
|
||||
spectrogram \
|
||||
rasterview \
|
||||
tvplot
|
||||
|
||||
contains(QWT_CONFIG, QwtWidgets) {
|
||||
|
||||
SUBDIRS += \
|
||||
bode \
|
||||
event_filter \
|
||||
oscilloscope
|
||||
}
|
||||
|
||||
contains(QWT_CONFIG, QwtSvg) {
|
||||
|
||||
SUBDIRS += \
|
||||
svgmap
|
||||
}
|
||||
}
|
||||
|
||||
contains(QWT_CONFIG, QwtWidgets) {
|
||||
|
||||
SUBDIRS += \
|
||||
sysinfo \
|
||||
radio \
|
||||
dials \
|
||||
sliders
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
################################################################
|
||||
|
||||
include( $${PWD}/../examples.pri )
|
||||
|
||||
TARGET = friedberg
|
||||
|
||||
HEADERS = \
|
||||
plot.h \
|
||||
friedberg2007.h
|
||||
|
||||
SOURCES = \
|
||||
friedberg2007.cpp \
|
||||
plot.cpp \
|
||||
main.cpp
|
||||
@@ -1,384 +0,0 @@
|
||||
#include "friedberg2007.h"
|
||||
|
||||
// Temperature 2007 from Friedberg somewhere in Germany
|
||||
// See: http://wetter61169.de
|
||||
|
||||
Temperature friedberg2007[] =
|
||||
{
|
||||
/* 01.01 */ Temperature( 2.6, 9.8, 7.07862 ),
|
||||
/* 02.01 */ Temperature( 0.8, 5.8, 3.6993 ),
|
||||
/* 03.01 */ Temperature( 2, 7, 5.02388 ),
|
||||
/* 04.01 */ Temperature( 5.3, 7.8, 6.37778 ),
|
||||
/* 05.01 */ Temperature( 5.6, 7.7, 6.83149 ),
|
||||
/* 06.01 */ Temperature( 7.2, 8.9, 8.0816 ),
|
||||
/* 07.01 */ Temperature( 4.2, 9.9, 7.54704 ),
|
||||
/* 08.01 */ Temperature( 3.5, 8.9, 6.71951 ),
|
||||
/* 09.01 */ Temperature( 8.2, 12.9, 10.8594 ),
|
||||
/* 10.01 */ Temperature( 6.3, 11.9, 9.76424 ),
|
||||
/* 11.01 */ Temperature( 3.9, 9.2, 6.18223 ),
|
||||
/* 12.01 */ Temperature( 6.9, 9.7, 8.44236 ),
|
||||
/* 13.01 */ Temperature( 9, 12.3, 10.6649 ),
|
||||
/* 14.01 */ Temperature( 1.8, 10.8, 7.23438 ),
|
||||
/* 15.01 */ Temperature( -2.8, 1.8, -0.518403 ),
|
||||
/* 16.01 */ Temperature( -0.6, 4.5, 2.39479 ),
|
||||
/* 17.01 */ Temperature( 4.3, 10.2, 7.23472 ),
|
||||
/* 18.01 */ Temperature( 9.1, 13.6, 10.9316 ),
|
||||
/* 19.01 */ Temperature( 6.9, 12.4, 9.4128 ),
|
||||
/* 20.01 */ Temperature( 7.1, 13.3, 10.5083 ),
|
||||
/* 21.01 */ Temperature( 3.5, 9.6, 6.10871 ),
|
||||
/* 22.01 */ Temperature( -1.8, 6, 2.89028 ),
|
||||
/* 23.01 */ Temperature( -5.4, 1.7, -2.46678 ),
|
||||
/* 24.01 */ Temperature( -5.3, -1.3, -3.71483 ),
|
||||
/* 25.01 */ Temperature( -7.5, 3.3, -3.36736 ),
|
||||
/* 26.01 */ Temperature( -11.1, 0.3, -5.50662 ),
|
||||
/* 27.01 */ Temperature( 0.2, 3.2, 1.95345 ),
|
||||
/* 28.01 */ Temperature( 1.9, 5.2, 3.43633 ),
|
||||
/* 29.01 */ Temperature( 4.4, 9.1, 6.24236 ),
|
||||
/* 30.01 */ Temperature( 2.3, 11.5, 6.03114 ),
|
||||
/* 31.01 */ Temperature( 4.6, 10.2, 6.04192 ),
|
||||
|
||||
/* 01.02 */ Temperature( 4.8, 13.8, 7.87674 ),
|
||||
/* 02.02 */ Temperature( 5.7, 10, 7.28646 ),
|
||||
/* 03.02 */ Temperature( 2.9, 8.2, 5.71771 ),
|
||||
/* 04.02 */ Temperature( -1.5, 7.2, 4.71319 ),
|
||||
/* 05.02 */ Temperature( -2.6, 4.4, 1.23542 ),
|
||||
/* 06.02 */ Temperature( 0.3, 9.2, 2.59965 ),
|
||||
/* 07.02 */ Temperature( -0.4, 2.4, 0.641667 ),
|
||||
/* 08.02 */ Temperature( -1.7, 3.8, 0.811458 ),
|
||||
/* 09.02 */ Temperature( 0.7, 7, 3.58328 ),
|
||||
/* 10.02 */ Temperature( 1, 6, 3.51181 ),
|
||||
/* 11.02 */ Temperature( 4.7, 9.6, 6.14913 ),
|
||||
/* 12.02 */ Temperature( 5.3, 8.7, 6.80552 ),
|
||||
/* 13.02 */ Temperature( 4.4, 10.3, 6.84552 ),
|
||||
/* 14.02 */ Temperature( 2.6, 6.5, 4.58681 ),
|
||||
/* 15.02 */ Temperature( -0.8, 13.4, 6.38542 ),
|
||||
/* 16.02 */ Temperature( -3, 14.4, 4.11336 ),
|
||||
/* 17.02 */ Temperature( 0.5, 13, 5.87457 ),
|
||||
/* 18.02 */ Temperature( -2.2, 14.1, 4.36528 ),
|
||||
/* 19.02 */ Temperature( 3.9, 5.6, 4.63737 ),
|
||||
/* 20.02 */ Temperature( -0.4, 9.2, 4.37014 ),
|
||||
/* 21.02 */ Temperature( -1.9, 5.5, 1.85675 ),
|
||||
/* 22.02 */ Temperature( 1, 13.1, 5.41176 ),
|
||||
/* 23.02 */ Temperature( 1.9, 13.9, 7.74251 ),
|
||||
/* 24.02 */ Temperature( 3.8, 9.6, 7.19306 ),
|
||||
/* 25.02 */ Temperature( 5.8, 10.8, 7.80312 ),
|
||||
/* 26.02 */ Temperature( 5.2, 10.4, 6.79481 ),
|
||||
/* 27.02 */ Temperature( 3.2, 7.4, 5.22986 ),
|
||||
/* 28.02 */ Temperature( 6.4, 13.4, 9.13356 ),
|
||||
|
||||
/* 01.03 */ Temperature( 4.6, 11.4, 7.70554 ),
|
||||
/* 02.03 */ Temperature( 3.4, 10.9, 5.98408 ),
|
||||
/* 03.03 */ Temperature( 2.9, 10.5, 5.45675 ),
|
||||
/* 04.03 */ Temperature( -0.7, 16.8, 7.29585 ),
|
||||
/* 05.03 */ Temperature( 4.2, 13.4, 8.35862 ),
|
||||
/* 06.03 */ Temperature( 3, 13, 7.76644 ),
|
||||
/* 07.03 */ Temperature( 2, 13.3, 8.24618 ),
|
||||
/* 08.03 */ Temperature( -0.8, 15, 6.11765 ),
|
||||
/* 09.03 */ Temperature( -0.7, 11, 5.7568 ),
|
||||
/* 10.03 */ Temperature( 1.2, 14.4, 6.61389 ),
|
||||
/* 11.03 */ Temperature( -1.7, 18, 6.66146 ),
|
||||
/* 12.03 */ Temperature( -0.6, 21.9, 8.9816 ),
|
||||
/* 13.03 */ Temperature( -0.9, 19.6, 9.08299 ),
|
||||
/* 14.03 */ Temperature( 5.3, 18.9, 10.5562 ),
|
||||
/* 15.03 */ Temperature( 2, 20.5, 9.65156 ),
|
||||
/* 16.03 */ Temperature( 0.2, 16.7, 7.8699 ),
|
||||
/* 17.03 */ Temperature( 4.5, 10.6, 7.87535 ),
|
||||
/* 18.03 */ Temperature( 2.7, 9.7, 6.71806 ),
|
||||
/* 19.03 */ Temperature( 0.4, 10.9, 3.92404 ),
|
||||
/* 20.03 */ Temperature( -2, 12.7, 4.01359 ),
|
||||
/* 21.03 */ Temperature( 0.3, 6.8, 3.00382 ),
|
||||
/* 22.03 */ Temperature( 0.9, 4.2, 2.2816 ),
|
||||
/* 23.03 */ Temperature( 2, 5.7, 3.39233 ),
|
||||
/* 24.03 */ Temperature( 3.9, 9.3, 6.41076 ),
|
||||
/* 25.03 */ Temperature( 4.2, 19.1, 9.92182 ),
|
||||
/* 26.03 */ Temperature( 2.3, 22, 12.5716 ),
|
||||
/* 27.03 */ Temperature( 4.9, 20.6, 13.4568 ),
|
||||
/* 28.03 */ Temperature( 0.3, 22.8, 10.755 ),
|
||||
/* 29.03 */ Temperature( 1.8, 17.2, 9.43924 ),
|
||||
/* 30.03 */ Temperature( 1.9, 19.8, 10.25 ),
|
||||
/* 31.03 */ Temperature( 6.7, 17, 11.1324 ),
|
||||
|
||||
/* 01.04 */ Temperature( 5.7, 22, 12.8457 ),
|
||||
/* 02.04 */ Temperature( 6.4, 22.1, 13.3847 ),
|
||||
/* 03.04 */ Temperature( 5.8, 17.5, 10.5614 ),
|
||||
/* 04.04 */ Temperature( 2.8, 16.2, 8.06574 ),
|
||||
/* 05.04 */ Temperature( -0.6, 20.8, 9.18062 ),
|
||||
/* 06.04 */ Temperature( 2.1, 24, 13.0069 ),
|
||||
/* 07.04 */ Temperature( 5.3, 16.2, 10.2771 ),
|
||||
/* 08.04 */ Temperature( 0.1, 20.7, 9.79861 ),
|
||||
/* 09.04 */ Temperature( 0.3, 18.9, 10.0087 ),
|
||||
/* 10.04 */ Temperature( 4, 16.4, 11.4208 ),
|
||||
/* 11.04 */ Temperature( 2.3, 23.4, 13.083 ),
|
||||
/* 12.04 */ Temperature( 7, 29.4, 16.5826 ),
|
||||
/* 13.04 */ Temperature( 10.6, 31.5, 19.2249 ),
|
||||
/* 14.04 */ Temperature( 11.8, 34, 21.441 ),
|
||||
/* 15.04 */ Temperature( 11.6, 33.8, 21.0201 ),
|
||||
/* 16.04 */ Temperature( 8.7, 31.1, 18.7885 ),
|
||||
/* 17.04 */ Temperature( 5.5, 27.2, 16.1432 ),
|
||||
/* 18.04 */ Temperature( 6.1, 17.2, 10.6688 ),
|
||||
/* 19.04 */ Temperature( -0.6, 21.3, 10.4806 ),
|
||||
/* 20.04 */ Temperature( 5.9, 21.6, 12.6257 ),
|
||||
/* 21.04 */ Temperature( 2.1, 21.6, 11.0858 ),
|
||||
/* 22.04 */ Temperature( 3.9, 25.9, 14.2108 ),
|
||||
/* 23.04 */ Temperature( 3.1, 27.8, 15.7111 ),
|
||||
/* 24.04 */ Temperature( 13.7, 29, 19.6397 ),
|
||||
/* 25.04 */ Temperature( 9.8, 31.6, 19.601 ),
|
||||
/* 26.04 */ Temperature( 8.2, 32.4, 20.0389 ),
|
||||
/* 27.04 */ Temperature( 11.8, 32.1, 21.0726 ),
|
||||
/* 28.04 */ Temperature( 12.6, 33.3, 21.6993 ),
|
||||
/* 29.04 */ Temperature( 10.5, 27.4, 19.1206 ),
|
||||
/* 30.04 */ Temperature( 5.3, 26.4, 15.0972 ),
|
||||
|
||||
/* 01.05 */ Temperature( 6.9, 25.3, 15.2802 ),
|
||||
/* 02.05 */ Temperature( 4.3, 26.2, 14.8401 ),
|
||||
/* 03.05 */ Temperature( 7.1, 28.5, 17.2145 ),
|
||||
/* 04.05 */ Temperature( 11, 28.5, 18.537 ),
|
||||
/* 05.05 */ Temperature( 12, 28, 18.1672 ),
|
||||
/* 06.05 */ Temperature( 10.4, 29, 18.3844 ),
|
||||
/* 07.05 */ Temperature( 13, 18.1, 15.0028 ),
|
||||
/* 08.05 */ Temperature( 10.7, 18.3, 13.2014 ),
|
||||
/* 09.05 */ Temperature( 10.8, 14.4, 12.5208 ),
|
||||
/* 10.05 */ Temperature( 11.9, 23.5, 16.9632 ),
|
||||
/* 11.05 */ Temperature( 9.8, 16.9, 15.0795 ),
|
||||
/* 12.05 */ Temperature( 9.2, 19.6, 13.8521 ),
|
||||
/* 13.05 */ Temperature( 8.9, 26.3, 16.2028 ),
|
||||
/* 14.05 */ Temperature( 11.1, 17.5, 13.2934 ),
|
||||
/* 15.05 */ Temperature( 6.5, 17, 11.7743 ),
|
||||
/* 16.05 */ Temperature( 4.9, 13.6, 9.75625 ),
|
||||
/* 17.05 */ Temperature( 6.8, 16.6, 9.96701 ),
|
||||
/* 18.05 */ Temperature( 2.4, 21.2, 11.4311 ),
|
||||
/* 19.05 */ Temperature( 8.2, 24.4, 15.4188 ),
|
||||
/* 20.05 */ Temperature( 14.1, 31.7, 21.3303 ),
|
||||
/* 21.05 */ Temperature( 11, 30.9, 21.5359 ),
|
||||
/* 22.05 */ Temperature( 13.8, 31, 21.5177 ),
|
||||
/* 23.05 */ Temperature( 16, 27.8, 21.0271 ),
|
||||
/* 24.05 */ Temperature( 15, 34, 23.4142 ),
|
||||
/* 25.05 */ Temperature( 14.3, 31.8, 22.8903 ),
|
||||
/* 26.05 */ Temperature( 13.6, 33.1, 22.6156 ),
|
||||
/* 27.05 */ Temperature( 11.2, 23.4, 16.6192 ),
|
||||
/* 28.05 */ Temperature( 9.6, 13.1, 11.3222 ),
|
||||
/* 29.05 */ Temperature( 8.3, 11.2, 10.3529 ),
|
||||
/* 30.05 */ Temperature( 4.2, 20.8, 12.6218 ),
|
||||
/* 31.05 */ Temperature( 9.2, 23.6, 15.1073 ),
|
||||
|
||||
/* 01.06 */ Temperature( 10.8, 24.4, 16.3205 ),
|
||||
/* 02.06 */ Temperature( 13, 26.5, 18.9649 ),
|
||||
/* 03.06 */ Temperature( 14, 25.1, 18.5398 ),
|
||||
/* 04.06 */ Temperature( 13, 28, 20.2139 ),
|
||||
/* 05.06 */ Temperature( 14, 28.8, 20.438 ),
|
||||
/* 06.06 */ Temperature( 14, 30.4, 21.7821 ),
|
||||
/* 07.06 */ Temperature( 17, 34.8, 25.3087 ),
|
||||
/* 08.06 */ Temperature( 17.9, 35.7, 25.7872 ),
|
||||
/* 09.06 */ Temperature( 17.8, 31.6, 22.0788 ),
|
||||
/* 10.06 */ Temperature( 15.5, 33.4, 22.4458 ),
|
||||
/* 11.06 */ Temperature( 16.6, 28.3, 19.8797 ),
|
||||
/* 12.06 */ Temperature( 14, 27.3, 20.2566 ),
|
||||
/* 13.06 */ Temperature( 13.2, 28.2, 19.4233 ),
|
||||
/* 14.06 */ Temperature( 12.7, 30, 20.1427 ),
|
||||
/* 15.06 */ Temperature( 15.2, 22.6, 18.5917 ),
|
||||
/* 16.06 */ Temperature( 13.2, 24, 17.7014 ),
|
||||
/* 17.06 */ Temperature( 11.7, 27.9, 19.8229 ),
|
||||
/* 18.06 */ Temperature( 15.9, 27.2, 20.3358 ),
|
||||
/* 19.06 */ Temperature( 12.6, 33.7, 22.2427 ),
|
||||
/* 20.06 */ Temperature( 15.7, 30.8, 23.7507 ),
|
||||
/* 21.06 */ Temperature( 14.8, 22.6, 18.2538 ),
|
||||
/* 22.06 */ Temperature( 12.4, 21.3, 15.9969 ),
|
||||
/* 23.06 */ Temperature( 12.6, 21.6, 15.8149 ),
|
||||
/* 24.06 */ Temperature( 13, 26, 18.4176 ),
|
||||
/* 25.06 */ Temperature( 12.9, 24.4, 17.1299 ),
|
||||
/* 26.06 */ Temperature( 10.8, 18.8, 13.2913 ),
|
||||
/* 27.06 */ Temperature( 9.9, 18.8, 13.5465 ),
|
||||
/* 28.06 */ Temperature( 12, 19.8, 14.8434 ),
|
||||
/* 29.06 */ Temperature( 12, 19, 15.155 ),
|
||||
/* 30.06 */ Temperature( 12.4, 22.4, 17.1354 ),
|
||||
|
||||
/* 01.07 */ Temperature( 12.1, 24.9, 19.1639 ),
|
||||
/* 02.07 */ Temperature( 15.7, 24.3, 18.4554 ),
|
||||
/* 03.07 */ Temperature( 12.7, 17.2, 14.6564 ),
|
||||
/* 04.07 */ Temperature( 11.2, 19, 13.9529 ),
|
||||
/* 05.07 */ Temperature( 11.5, 19, 14.6422 ),
|
||||
/* 06.07 */ Temperature( 12.4, 22, 16.6146 ),
|
||||
/* 07.07 */ Temperature( 11.6, 24, 17.666 ),
|
||||
/* 08.07 */ Temperature( 9, 28, 19.1351 ),
|
||||
/* 09.07 */ Temperature( 11.3, 21.5, 16.5271 ),
|
||||
/* 10.07 */ Temperature( 11.3, 20.2, 14.2326 ),
|
||||
/* 11.07 */ Temperature( 10.2, 19.2, 14.0649 ),
|
||||
/* 12.07 */ Temperature( 13.2, 23.1, 16.6346 ),
|
||||
/* 13.07 */ Temperature( 15, 27, 19.6844 ),
|
||||
/* 14.07 */ Temperature( 13.4, 32.4, 23.845 ),
|
||||
/* 15.07 */ Temperature( 15, 38.2, 26.8559 ),
|
||||
/* 16.07 */ Temperature( 16.1, 36.5, 26.4483 ),
|
||||
/* 17.07 */ Temperature( 19.7, 30.5, 24.189 ),
|
||||
/* 18.07 */ Temperature( 14.2, 29.3, 22.1363 ),
|
||||
/* 19.07 */ Temperature( 16.4, 25.9, 19.0819 ),
|
||||
/* 20.07 */ Temperature( 16.2, 30.8, 22.151 ),
|
||||
/* 21.07 */ Temperature( 14, 24.3, 18.6573 ),
|
||||
/* 22.07 */ Temperature( 13.2, 24.5, 18.3301 ),
|
||||
/* 23.07 */ Temperature( 10.6, 23.4, 16.6903 ),
|
||||
/* 24.07 */ Temperature( 13.2, 20.8, 16.2743 ),
|
||||
/* 25.07 */ Temperature( 12.2, 25.8, 18.8267 ),
|
||||
/* 26.07 */ Temperature( 11.9, 28.9, 20.5522 ),
|
||||
/* 27.07 */ Temperature( 17.6, 25.8, 21.5691 ),
|
||||
/* 28.07 */ Temperature( 16.6, 24.6, 19.2295 ),
|
||||
/* 29.07 */ Temperature( 13, 19, 15.9021 ),
|
||||
/* 30.07 */ Temperature( 9.6, 19.7, 13.875 ),
|
||||
/* 31.07 */ Temperature( 8, 22, 14.5284 ),
|
||||
|
||||
/* 01.08 */ Temperature( 7.6, 27.5, 17.5684 ),
|
||||
/* 02.08 */ Temperature( 9.2, 22.2, 16.1035 ),
|
||||
/* 03.08 */ Temperature( 12.7, 25.3, 18.2958 ),
|
||||
/* 04.08 */ Temperature( 8.6, 31.3, 19.7941 ),
|
||||
/* 05.08 */ Temperature( 10.3, 32.7, 21.492 ),
|
||||
/* 06.08 */ Temperature( 10, 33.4, 22.4431 ),
|
||||
/* 07.08 */ Temperature( 16.8, 22.6, 19.5583 ),
|
||||
/* 08.08 */ Temperature( 13.5, 16.7, 15.0264 ),
|
||||
/* 09.08 */ Temperature( 13.2, 18.8, 15.6003 ),
|
||||
/* 10.08 */ Temperature( 14.6, 27.9, 18.8292 ),
|
||||
/* 11.08 */ Temperature( 16.3, 26.4, 20.3837 ),
|
||||
/* 12.08 */ Temperature( 12.1, 28.7, 19.9892 ),
|
||||
/* 13.08 */ Temperature( 15, 27.4, 19.7542 ),
|
||||
/* 14.08 */ Temperature( 11.3, 28.3, 20.5656 ),
|
||||
/* 15.08 */ Temperature( 18.6, 28.4, 23.1215 ),
|
||||
/* 16.08 */ Temperature( 16, 23.6, 19.491 ),
|
||||
/* 17.08 */ Temperature( 12.6, 22, 17.0437 ),
|
||||
/* 18.08 */ Temperature( 8.5, 25.7, 16.5589 ),
|
||||
/* 19.08 */ Temperature( 13.4, 25.8, 18.0543 ),
|
||||
/* 20.08 */ Temperature( 10.9, 21.5, 16.1306 ),
|
||||
/* 21.08 */ Temperature( 10.6, 19.2, 14.6177 ),
|
||||
/* 22.08 */ Temperature( 14, 24.6, 17.3841 ),
|
||||
/* 23.08 */ Temperature( 13.8, 30.4, 20.6125 ),
|
||||
/* 24.08 */ Temperature( 12.3, 30.3, 20.7622 ),
|
||||
/* 25.08 */ Temperature( 12.8, 30.2, 21.6736 ),
|
||||
/* 26.08 */ Temperature( 15, 29.3, 21.266 ),
|
||||
/* 27.08 */ Temperature( 12.9, 25.9, 18.791 ),
|
||||
/* 28.08 */ Temperature( 9.3, 24.6, 16.2833 ),
|
||||
/* 29.08 */ Temperature( 10.8, 25, 16.8459 ),
|
||||
/* 30.08 */ Temperature( 8.2, 24.4, 15.9267 ),
|
||||
/* 31.08 */ Temperature( 14.1, 20.5, 16.6128 ),
|
||||
|
||||
/* 01.09 */ Temperature( 13.4, 21.9, 16.2205 ),
|
||||
/* 02.09 */ Temperature( 12, 20.7, 16.0882 ),
|
||||
/* 03.09 */ Temperature( 10.8, 21.3, 14.7913 ),
|
||||
/* 04.09 */ Temperature( 7.8, 18.2, 12.2747 ),
|
||||
/* 05.09 */ Temperature( 8.1, 22.2, 12.9406 ),
|
||||
/* 06.09 */ Temperature( 10, 23.8, 13.8785 ),
|
||||
/* 07.09 */ Temperature( 10.7, 21.2, 15.4823 ),
|
||||
/* 08.09 */ Temperature( 12.4, 21, 15.8194 ),
|
||||
/* 09.09 */ Temperature( 12.7, 16.9, 14.7212 ),
|
||||
/* 10.09 */ Temperature( 10.3, 17.7, 12.9271 ),
|
||||
/* 11.09 */ Temperature( 10.6, 20.8, 14.4788 ),
|
||||
/* 12.09 */ Temperature( 10.8, 21.9, 15.0184 ),
|
||||
/* 13.09 */ Temperature( 6.9, 24.6, 14.5222 ),
|
||||
/* 14.09 */ Temperature( 8.1, 24, 15.6583 ),
|
||||
/* 15.09 */ Temperature( 8.8, 22.8, 15.941 ),
|
||||
/* 16.09 */ Temperature( 3.1, 24.5, 14.1486 ),
|
||||
/* 17.09 */ Temperature( 12.4, 21.2, 16.0497 ),
|
||||
/* 18.09 */ Temperature( 7.8, 16.1, 12.024 ),
|
||||
/* 19.09 */ Temperature( 5.3, 18.1, 10.3003 ),
|
||||
/* 20.09 */ Temperature( 6.4, 20.3, 12.3177 ),
|
||||
/* 21.09 */ Temperature( 6, 23.8, 13.6247 ),
|
||||
/* 22.09 */ Temperature( 5.7, 27, 14.6847 ),
|
||||
/* 23.09 */ Temperature( 7.8, 28, 16.6238 ),
|
||||
/* 24.09 */ Temperature( 9.6, 24.9, 16.7191 ),
|
||||
/* 25.09 */ Temperature( 8.4, 17.6, 12.636 ),
|
||||
/* 26.09 */ Temperature( 4.3, 18.9, 10.0809 ),
|
||||
/* 27.09 */ Temperature( 9.4, 11.2, 10.3344 ),
|
||||
/* 28.09 */ Temperature( 7.7, 12.6, 10.5337 ),
|
||||
/* 29.09 */ Temperature( 9.8, 15.3, 11.9306 ),
|
||||
/* 30.09 */ Temperature( 9.6, 21.1, 13.6635 ),
|
||||
|
||||
/* 01.10 */ Temperature( 8.9, 24.5, 14.8163 ),
|
||||
/* 02.10 */ Temperature( 13.5, 20.2, 16.1628 ),
|
||||
/* 03.10 */ Temperature( 12.5, 18, 15.4691 ),
|
||||
/* 04.10 */ Temperature( 13.8, 25, 17.2073 ),
|
||||
/* 05.10 */ Temperature( 9.1, 23.2, 14.6181 ),
|
||||
/* 06.10 */ Temperature( 6.4, 23.4, 12.8625 ),
|
||||
/* 07.10 */ Temperature( 4.6, 22.1, 11.0052 ),
|
||||
/* 08.10 */ Temperature( 2, 22.2, 10.1677 ),
|
||||
/* 09.10 */ Temperature( 7.8, 21.6, 12.2139 ),
|
||||
/* 10.10 */ Temperature( 7.1, 22.7, 13.0115 ),
|
||||
/* 11.10 */ Temperature( 6.1, 21.2, 11.4333 ),
|
||||
/* 12.10 */ Temperature( 4.3, 15.2, 10.6104 ),
|
||||
/* 13.10 */ Temperature( 5.8, 23, 12.8875 ),
|
||||
/* 14.10 */ Temperature( 1, 23, 9.72986 ),
|
||||
/* 15.10 */ Temperature( 1, 19.3, 9.33021 ),
|
||||
/* 16.10 */ Temperature( 8.5, 20.4, 13.2639 ),
|
||||
/* 17.10 */ Temperature( 6.8, 17.3, 11.8174 ),
|
||||
/* 18.10 */ Temperature( 5.2, 15.6, 9.06076 ),
|
||||
/* 19.10 */ Temperature( 2.7, 13.5, 7.1309 ),
|
||||
/* 20.10 */ Temperature( -0.2, 15.8, 6.01667 ),
|
||||
/* 21.10 */ Temperature( 2.6, 6.1, 4.9441 ),
|
||||
/* 22.10 */ Temperature( -0.8, 13.2, 4.50694 ),
|
||||
/* 23.10 */ Temperature( -0.4, 13.3, 4.71007 ),
|
||||
/* 24.10 */ Temperature( 2.9, 8.1, 5.96979 ),
|
||||
/* 25.10 */ Temperature( 6.3, 10.5, 8.01206 ),
|
||||
/* 26.10 */ Temperature( 7, 10.8, 8.14965 ),
|
||||
/* 27.10 */ Temperature( 6.6, 9.7, 7.7809 ),
|
||||
/* 28.10 */ Temperature( 1.7, 10.8, 6.95728 ),
|
||||
/* 29.10 */ Temperature( 2.2, 9.9, 6.62917 ),
|
||||
/* 30.10 */ Temperature( 5.8, 15, 8.76181 ),
|
||||
/* 31.10 */ Temperature( 0.7, 15, 6.01528 ),
|
||||
|
||||
/* 01.11 */ Temperature( -0.2, 9.7, 3.75842 ),
|
||||
/* 02.11 */ Temperature( 6.4, 9.6, 8.00138 ),
|
||||
/* 03.11 */ Temperature( 8.7, 13.1, 10.5676 ),
|
||||
/* 04.11 */ Temperature( 8, 11.8, 9.54306 ),
|
||||
/* 05.11 */ Temperature( 5.8, 15.9, 8.52345 ),
|
||||
/* 06.11 */ Temperature( 5.5, 10.8, 7.16493 ),
|
||||
/* 07.11 */ Temperature( 5.5, 8.9, 7.30172 ),
|
||||
/* 08.11 */ Temperature( 7, 11.7, 8.96701 ),
|
||||
/* 09.11 */ Temperature( 2.5, 8.4, 4.86528 ),
|
||||
/* 10.11 */ Temperature( 3.7, 9, 5.20828 ),
|
||||
/* 11.11 */ Temperature( 2.8, 10.6, 6.80756 ),
|
||||
/* 12.11 */ Temperature( 2.7, 9.5, 5.07647 ),
|
||||
/* 13.11 */ Temperature( 0.1, 5.4, 3.3945 ),
|
||||
/* 14.11 */ Temperature( -0.7, 7.9, 2.02234 ),
|
||||
/* 15.11 */ Temperature( -1.8, 6.5, 1.07778 ),
|
||||
/* 16.11 */ Temperature( -4.4, 5.1, -0.693772 ),
|
||||
/* 17.11 */ Temperature( -0.3, 3.4, 1.33229 ),
|
||||
/* 18.11 */ Temperature( -0.4, 4.3, 2.4622 ),
|
||||
/* 19.11 */ Temperature( 1.8, 3.6, 2.78282 ),
|
||||
/* 20.11 */ Temperature( 1.3, 5.6, 2.95979 ),
|
||||
/* 21.11 */ Temperature( 1.6, 5.7, 3.62284 ),
|
||||
/* 22.11 */ Temperature( 3.1, 7.3, 5.60277 ),
|
||||
/* 23.11 */ Temperature( 4.2, 7.7, 6.28166 ),
|
||||
/* 24.11 */ Temperature( -0.5, 11.5, 3.25931 ),
|
||||
/* 25.11 */ Temperature( -1, 8.8, 2.86505 ),
|
||||
/* 26.11 */ Temperature( 1.2, 6.8, 3.09414 ),
|
||||
/* 27.11 */ Temperature( -0.8, 7.5, 3.17805 ),
|
||||
/* 28.11 */ Temperature( -2.8, 3.1, -0.920139 ),
|
||||
/* 29.11 */ Temperature( -2.6, 1.7, -0.491696 ),
|
||||
/* 30.11 */ Temperature( 1.3, 6.5, 3.85 ),
|
||||
|
||||
/* 01.12 */ Temperature( 4.1, 8.7, 5.88924 ),
|
||||
/* 02.12 */ Temperature( 4.8, 9, 6.81667 ),
|
||||
/* 03.12 */ Temperature( 3.5, 8.5, 6.23633 ),
|
||||
/* 04.12 */ Temperature( 2.7, 6.6, 4.63045 ),
|
||||
/* 05.12 */ Temperature( 4.3, 8.6, 6.85993 ),
|
||||
/* 06.12 */ Temperature( 5.5, 9.3, 7.79201 ),
|
||||
/* 07.12 */ Temperature( 3.1, 13.4, 8.79444 ),
|
||||
/* 08.12 */ Temperature( 2.6, 6.3, 4.67093 ),
|
||||
/* 09.12 */ Temperature( 3, 10.4, 5.75724 ),
|
||||
/* 10.12 */ Temperature( 4.1, 6.8, 5.31834 ),
|
||||
/* 11.12 */ Temperature( 4.1, 7.4, 5.28993 ),
|
||||
/* 12.12 */ Temperature( 3.9, 6.4, 4.64479 ),
|
||||
/* 13.12 */ Temperature( 1.7, 9.1, 4.15363 ),
|
||||
/* 14.12 */ Temperature( 0.4, 1.8, 0.934602 ),
|
||||
/* 15.12 */ Temperature( -4.5, 2.1, -1.17292 ),
|
||||
/* 16.12 */ Temperature( -5, 4.8, -2.17431 ),
|
||||
/* 17.12 */ Temperature( -5.6, 6.1, -1.35448 ),
|
||||
/* 18.12 */ Temperature( -4.9, 6.4, -1.25502 ),
|
||||
/* 19.12 */ Temperature( -4.4, 6.6, -1.02396 ),
|
||||
/* 20.12 */ Temperature( -7.3, 5.2, -2.63854 ),
|
||||
/* 21.12 */ Temperature( -8.5, 5.7, -3.58333 ),
|
||||
/* 22.12 */ Temperature( -7.9, -5.3, -6.13438 ),
|
||||
/* 23.12 */ Temperature( -6.1, -4.4, -5.23472 ),
|
||||
/* 24.12 */ Temperature( -4.6, -3.3, -3.84291 ),
|
||||
/* 25.12 */ Temperature( -4.9, -2.8, -3.9066 ),
|
||||
/* 26.12 */ Temperature( -4.7, -1.9, -3.10379 ),
|
||||
/* 27.12 */ Temperature( -1.9, -0.2, -0.679791 ),
|
||||
/* 28.12 */ Temperature( -1.8, 0.5, -0.521875 ),
|
||||
/* 29.12 */ Temperature( -2.2, 2.3, -0.430796 ),
|
||||
/* 30.12 */ Temperature( 0.9, 5.2, 2.83437 ),
|
||||
/* 31.12 */ Temperature( -1, 8.3, 2.27093 )
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
#ifndef _FRIEDBERG_2007_H_
|
||||
#define _FRIEDBERG_2007_H_
|
||||
|
||||
class Temperature
|
||||
{
|
||||
public:
|
||||
Temperature():
|
||||
minValue( 0.0 ),
|
||||
maxValue( 0.0 ),
|
||||
averageValue( 0.0 )
|
||||
{
|
||||
}
|
||||
|
||||
Temperature( double min, double max, double average ):
|
||||
minValue( min ),
|
||||
maxValue( max ),
|
||||
averageValue( average )
|
||||
{
|
||||
}
|
||||
|
||||
double minValue;
|
||||
double maxValue;
|
||||
double averageValue;
|
||||
};
|
||||
|
||||
extern Temperature friedberg2007[];
|
||||
|
||||
#endif
|
||||
@@ -1,57 +0,0 @@
|
||||
#include <qapplication.h>
|
||||
#include <qmainwindow.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtextstream.h>
|
||||
#include <qtoolbar.h>
|
||||
#include <qtoolbutton.h>
|
||||
#include "plot.h"
|
||||
|
||||
class MainWindow: public QMainWindow
|
||||
{
|
||||
public:
|
||||
MainWindow( QWidget * = NULL );
|
||||
|
||||
private:
|
||||
Plot *d_plot;
|
||||
};
|
||||
|
||||
MainWindow::MainWindow( QWidget *parent ):
|
||||
QMainWindow( parent )
|
||||
{
|
||||
d_plot = new Plot( this );
|
||||
setCentralWidget( d_plot );
|
||||
|
||||
QToolBar *toolBar = new QToolBar( this );
|
||||
|
||||
QComboBox *typeBox = new QComboBox( toolBar );
|
||||
typeBox->addItem( "Bars" );
|
||||
typeBox->addItem( "Tube" );
|
||||
typeBox->setCurrentIndex( 1 );
|
||||
typeBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
|
||||
|
||||
QToolButton *btnExport = new QToolButton( toolBar );
|
||||
btnExport->setText( "Export" );
|
||||
btnExport->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );
|
||||
connect( btnExport, SIGNAL( clicked() ), d_plot, SLOT( exportPlot() ) );
|
||||
|
||||
toolBar->addWidget( typeBox );
|
||||
toolBar->addWidget( btnExport );
|
||||
addToolBar( toolBar );
|
||||
|
||||
d_plot->setMode( typeBox->currentIndex() );
|
||||
connect( typeBox, SIGNAL( currentIndexChanged( int ) ),
|
||||
d_plot, SLOT( setMode( int ) ) );
|
||||
}
|
||||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
QApplication a( argc, argv );
|
||||
|
||||
MainWindow w;
|
||||
w.setObjectName( "MainWindow" );
|
||||
w.resize( 600, 400 );
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@@ -1,252 +0,0 @@
|
||||
#include "plot.h"
|
||||
#include "friedberg2007.h"
|
||||
#include <qwt_plot_zoomer.h>
|
||||
#include <qwt_plot_panner.h>
|
||||
#include <qwt_plot_marker.h>
|
||||
#include <qwt_plot_grid.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_plot_intervalcurve.h>
|
||||
#include <qwt_legend.h>
|
||||
#include <qwt_interval_symbol.h>
|
||||
#include <qwt_symbol.h>
|
||||
#include <qwt_series_data.h>
|
||||
#include <qwt_text.h>
|
||||
#include <qwt_scale_draw.h>
|
||||
#include <qwt_plot_renderer.h>
|
||||
#include <qdatetime.h>
|
||||
#include <qfiledialog.h>
|
||||
#include <qimagewriter.h>
|
||||
#include <qprintdialog.h>
|
||||
#include <qfileinfo.h>
|
||||
|
||||
class Grid: public QwtPlotGrid
|
||||
{
|
||||
public:
|
||||
Grid()
|
||||
{
|
||||
enableXMin( true );
|
||||
setMajPen( QPen( Qt::white, 0, Qt::DotLine ) );
|
||||
setMinPen( QPen( Qt::gray, 0 , Qt::DotLine ) );
|
||||
}
|
||||
|
||||
virtual void updateScaleDiv( const QwtScaleDiv &xMap,
|
||||
const QwtScaleDiv &yMap )
|
||||
{
|
||||
QList<double> ticks[QwtScaleDiv::NTickTypes];
|
||||
|
||||
ticks[QwtScaleDiv::MajorTick] =
|
||||
xMap.ticks( QwtScaleDiv::MediumTick );
|
||||
ticks[QwtScaleDiv::MinorTick] =
|
||||
xMap.ticks( QwtScaleDiv::MinorTick );
|
||||
|
||||
QwtPlotGrid::updateScaleDiv(
|
||||
QwtScaleDiv( xMap.lowerBound(), xMap.upperBound(), ticks ),
|
||||
yMap );
|
||||
}
|
||||
};
|
||||
|
||||
class YearScaleDraw: public QwtScaleDraw
|
||||
{
|
||||
public:
|
||||
YearScaleDraw()
|
||||
{
|
||||
setTickLength( QwtScaleDiv::MajorTick, 0 );
|
||||
setTickLength( QwtScaleDiv::MinorTick, 0 );
|
||||
setTickLength( QwtScaleDiv::MediumTick, 6 );
|
||||
|
||||
setLabelRotation( -60.0 );
|
||||
setLabelAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
|
||||
setSpacing( 15 );
|
||||
}
|
||||
|
||||
virtual QwtText label( double value ) const
|
||||
{
|
||||
return QDate::longMonthName( int( value / 30 ) + 1 );
|
||||
}
|
||||
};
|
||||
|
||||
Plot::Plot( QWidget *parent ):
|
||||
QwtPlot( parent )
|
||||
{
|
||||
setObjectName( "FriedbergPlot" );
|
||||
setTitle( "Temperature of Friedberg/Germany" );
|
||||
|
||||
setAxisTitle( QwtPlot::xBottom, "2007" );
|
||||
setAxisScaleDiv( QwtPlot::xBottom, yearScaleDiv() );
|
||||
setAxisScaleDraw( QwtPlot::xBottom, new YearScaleDraw() );
|
||||
|
||||
setAxisTitle( QwtPlot::yLeft,
|
||||
QString( "Temperature [%1C]" ).arg( QChar( 0x00B0 ) ) );
|
||||
|
||||
// grid
|
||||
QwtPlotGrid *grid = new Grid;
|
||||
grid->attach( this );
|
||||
|
||||
insertLegend( new QwtLegend(), QwtPlot::RightLegend );
|
||||
|
||||
const int numDays = 365;
|
||||
QVector<QPointF> averageData( numDays );
|
||||
QVector<QwtIntervalSample> rangeData( numDays );
|
||||
|
||||
for ( int i = 0; i < numDays; i++ )
|
||||
{
|
||||
const Temperature &t = friedberg2007[i];
|
||||
averageData[i] = QPointF( double( i ), t.averageValue );
|
||||
rangeData[i] = QwtIntervalSample( double( i ),
|
||||
QwtInterval( t.minValue, t.maxValue ) );
|
||||
}
|
||||
|
||||
insertCurve( "Average", averageData, Qt::black );
|
||||
insertErrorBars( "Range", rangeData, Qt::blue );
|
||||
|
||||
// LeftButton for the zooming
|
||||
// MidButton for the panning
|
||||
// RightButton: zoom out by 1
|
||||
// Ctrl+RighButton: zoom out to full size
|
||||
|
||||
QwtPlotZoomer* zoomer = new QwtPlotZoomer( canvas() );
|
||||
zoomer->setRubberBandPen( QColor( Qt::black ) );
|
||||
zoomer->setTrackerPen( QColor( Qt::black ) );
|
||||
zoomer->setMousePattern( QwtEventPattern::MouseSelect2,
|
||||
Qt::RightButton, Qt::ControlModifier );
|
||||
zoomer->setMousePattern( QwtEventPattern::MouseSelect3,
|
||||
Qt::RightButton );
|
||||
|
||||
QwtPlotPanner *panner = new QwtPlotPanner( canvas() );
|
||||
panner->setMouseButton( Qt::MidButton );
|
||||
|
||||
canvas()->setPalette( Qt::darkGray );
|
||||
canvas()->setBorderRadius( 10 );
|
||||
}
|
||||
|
||||
QwtScaleDiv Plot::yearScaleDiv() const
|
||||
{
|
||||
const int days[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
|
||||
QList<double> ticks[QwtScaleDiv::NTickTypes];
|
||||
|
||||
QList<double> &mediumTicks = ticks[QwtScaleDiv::MediumTick];
|
||||
mediumTicks += 0.0;
|
||||
for ( uint i = 0; i < sizeof( days ) / sizeof( days[0] ); i++ )
|
||||
mediumTicks += mediumTicks.last() + days[i];
|
||||
|
||||
QList<double> &minorTicks = ticks[QwtScaleDiv::MinorTick];
|
||||
for ( int i = 1; i <= 365; i += 7 )
|
||||
minorTicks += i;
|
||||
|
||||
QList<double> &majorTicks = ticks[QwtScaleDiv::MajorTick];
|
||||
for ( int i = 0; i < 12; i++ )
|
||||
majorTicks += i * 30 + 15;
|
||||
|
||||
QwtScaleDiv scaleDiv( mediumTicks.first(), mediumTicks.last() + 1, ticks );
|
||||
return scaleDiv;
|
||||
}
|
||||
|
||||
void Plot::insertCurve( const QString& title,
|
||||
const QVector<QPointF>& samples, const QColor &color )
|
||||
{
|
||||
d_curve = new QwtPlotCurve( title );
|
||||
d_curve->setRenderHint( QwtPlotItem::RenderAntialiased );
|
||||
d_curve->setStyle( QwtPlotCurve::NoCurve );
|
||||
d_curve->setLegendAttribute( QwtPlotCurve::LegendShowSymbol );
|
||||
|
||||
QwtSymbol *symbol = new QwtSymbol( QwtSymbol::XCross );
|
||||
symbol->setSize( 4 );
|
||||
symbol->setPen( QPen( color ) );
|
||||
d_curve->setSymbol( symbol );
|
||||
|
||||
d_curve->setSamples( samples );
|
||||
d_curve->attach( this );
|
||||
}
|
||||
|
||||
void Plot::insertErrorBars(
|
||||
const QString &title,
|
||||
const QVector<QwtIntervalSample>& samples,
|
||||
const QColor &color )
|
||||
{
|
||||
d_intervalCurve = new QwtPlotIntervalCurve( title );
|
||||
d_intervalCurve->setRenderHint( QwtPlotItem::RenderAntialiased );
|
||||
d_intervalCurve->setPen( QPen( Qt::white ) );
|
||||
|
||||
QColor bg( color );
|
||||
bg.setAlpha( 150 );
|
||||
d_intervalCurve->setBrush( QBrush( bg ) );
|
||||
d_intervalCurve->setStyle( QwtPlotIntervalCurve::Tube );
|
||||
|
||||
d_intervalCurve->setSamples( samples );
|
||||
d_intervalCurve->attach( this );
|
||||
}
|
||||
|
||||
void Plot::setMode( int style )
|
||||
{
|
||||
if ( style == Tube )
|
||||
{
|
||||
d_intervalCurve->setStyle( QwtPlotIntervalCurve::Tube );
|
||||
d_intervalCurve->setSymbol( NULL );
|
||||
d_intervalCurve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
|
||||
}
|
||||
else
|
||||
{
|
||||
d_intervalCurve->setStyle( QwtPlotIntervalCurve::NoCurve );
|
||||
|
||||
QColor c( d_intervalCurve->brush().color().rgb() ); // skip alpha
|
||||
|
||||
QwtIntervalSymbol *errorBar =
|
||||
new QwtIntervalSymbol( QwtIntervalSymbol::Bar );
|
||||
errorBar->setWidth( 8 ); // should be something even
|
||||
errorBar->setPen( c );
|
||||
|
||||
d_intervalCurve->setSymbol( errorBar );
|
||||
d_intervalCurve->setRenderHint( QwtPlotItem::RenderAntialiased, false );
|
||||
}
|
||||
|
||||
replot();
|
||||
}
|
||||
|
||||
void Plot::exportPlot()
|
||||
{
|
||||
#ifndef QT_NO_PRINTER
|
||||
QString fileName = "friedberg.pdf";
|
||||
#else
|
||||
QString fileName = "friedberg.png";
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_FILEDIALOG
|
||||
const QList<QByteArray> imageFormats =
|
||||
QImageWriter::supportedImageFormats();
|
||||
|
||||
QStringList filter;
|
||||
filter += "PDF Documents (*.pdf)";
|
||||
#ifndef QWT_NO_SVG
|
||||
filter += "SVG Documents (*.svg)";
|
||||
#endif
|
||||
filter += "Postscript Documents (*.ps)";
|
||||
|
||||
if ( imageFormats.size() > 0 )
|
||||
{
|
||||
QString imageFilter("Images (");
|
||||
for ( int i = 0; i < imageFormats.size(); i++ )
|
||||
{
|
||||
if ( i > 0 )
|
||||
imageFilter += " ";
|
||||
imageFilter += "*.";
|
||||
imageFilter += imageFormats[i];
|
||||
}
|
||||
imageFilter += ")";
|
||||
|
||||
filter += imageFilter;
|
||||
}
|
||||
|
||||
fileName = QFileDialog::getSaveFileName(
|
||||
this, "Export File Name", fileName,
|
||||
filter.join(";;"), NULL, QFileDialog::DontConfirmOverwrite);
|
||||
#endif
|
||||
if ( !fileName.isEmpty() )
|
||||
{
|
||||
QwtPlotRenderer renderer;
|
||||
renderer.setDiscardFlag(QwtPlotRenderer::DiscardBackground, false);
|
||||
|
||||
renderer.renderDocument(this, fileName, QSizeF(300, 200), 85);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
#ifndef _PLOT_H_
|
||||
#define _PLOT_H_
|
||||
|
||||
#include <qwt_plot.h>
|
||||
#include <qwt_scale_div.h>
|
||||
#include <qwt_series_data.h>
|
||||
|
||||
class QwtPlotCurve;
|
||||
class QwtPlotIntervalCurve;
|
||||
|
||||
class Plot: public QwtPlot
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Mode
|
||||
{
|
||||
Bars,
|
||||
Tube
|
||||
};
|
||||
|
||||
Plot( QWidget * = NULL );
|
||||
|
||||
public Q_SLOTS:
|
||||
void setMode( int );
|
||||
void exportPlot();
|
||||
|
||||
private:
|
||||
void insertCurve( const QString &title,
|
||||
const QVector<QPointF> &, const QColor & );
|
||||
|
||||
void insertErrorBars( const QString &title,
|
||||
const QVector<QwtIntervalSample> &,
|
||||
const QColor &color );
|
||||
|
||||
|
||||
QwtScaleDiv yearScaleDiv() const;
|
||||
|
||||
QwtPlotIntervalCurve *d_intervalCurve;
|
||||
QwtPlotCurve *d_curve;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,14 +0,0 @@
|
||||
#include <qapplication.h>
|
||||
#include "mainwindow.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
MainWindow mainWindow;
|
||||
|
||||
mainWindow.resize(800,600);
|
||||
mainWindow.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
#include <cstdlib>
|
||||
#include <qgroupbox.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qstatusbar.h>
|
||||
#include <qlabel.h>
|
||||
#include <qwt_plot.h>
|
||||
#include <qwt_plot_rescaler.h>
|
||||
#include <qwt_scale_div.h>
|
||||
#include "plot.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
MainWindow::MainWindow()
|
||||
{
|
||||
QFrame *w = new QFrame(this);
|
||||
|
||||
QWidget *panel = createPanel(w);
|
||||
panel->setFixedWidth(2 * panel->sizeHint().width());
|
||||
d_plot = createPlot(w);
|
||||
|
||||
QHBoxLayout *layout = new QHBoxLayout(w);
|
||||
layout->setMargin(0);
|
||||
layout->addWidget(panel, 0);
|
||||
layout->addWidget(d_plot, 10);
|
||||
|
||||
setCentralWidget(w);
|
||||
|
||||
setRescaleMode(0);
|
||||
setMouseMode(0);
|
||||
|
||||
(void)statusBar();
|
||||
}
|
||||
|
||||
QWidget *MainWindow::createPanel(QWidget *parent)
|
||||
{
|
||||
QGroupBox *panel = new QGroupBox("Navigation Panel", parent);
|
||||
|
||||
QComboBox *navigationBox = new QComboBox(panel);
|
||||
navigationBox->setEditable(false);
|
||||
navigationBox->insertItem(Tracking, "Tracking");
|
||||
navigationBox->insertItem(Zooming, "Zooming");
|
||||
navigationBox->insertItem(Panning, "Panning");
|
||||
|
||||
connect(navigationBox, SIGNAL(activated(int)), SLOT(setMouseMode(int)));
|
||||
|
||||
d_navigationInfo = new QLabel(panel);
|
||||
d_navigationInfo->setSizePolicy(
|
||||
QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
d_navigationInfo->setWordWrap(true);
|
||||
|
||||
QComboBox *rescaleBox = new QComboBox(panel);
|
||||
rescaleBox->setEditable(false);
|
||||
rescaleBox->insertItem(KeepScales, "None");
|
||||
rescaleBox->insertItem(Fixed, "Fixed");
|
||||
rescaleBox->insertItem(Expanding, "Expanding");
|
||||
rescaleBox->insertItem(Fitting, "Fitting");
|
||||
|
||||
connect(rescaleBox, SIGNAL(activated(int)), SLOT(setRescaleMode(int)));
|
||||
|
||||
d_rescaleInfo = new QLabel(panel);
|
||||
d_rescaleInfo->setSizePolicy(
|
||||
QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
d_rescaleInfo->setWordWrap(true);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(panel);
|
||||
layout->addWidget(navigationBox);
|
||||
layout->addWidget(d_navigationInfo);
|
||||
layout->addWidget(rescaleBox);
|
||||
layout->addWidget(d_rescaleInfo);
|
||||
layout->addStretch(10);
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
Plot *MainWindow::createPlot(QWidget *parent)
|
||||
{
|
||||
Plot *plot = new Plot(parent, QwtInterval(0.0, 1000.0));
|
||||
plot->replot();
|
||||
|
||||
d_rescaler = new QwtPlotRescaler(plot->canvas());
|
||||
d_rescaler->setReferenceAxis(QwtPlot::xBottom);
|
||||
d_rescaler->setAspectRatio(QwtPlot::yLeft, 1.0);
|
||||
d_rescaler->setAspectRatio(QwtPlot::yRight, 0.0);
|
||||
d_rescaler->setAspectRatio(QwtPlot::xTop, 0.0);
|
||||
|
||||
for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
|
||||
d_rescaler->setIntervalHint(axis, QwtInterval(0.0, 1000.0));
|
||||
|
||||
connect(plot, SIGNAL(resized(double, double)),
|
||||
SLOT(showRatio(double, double)));
|
||||
return plot;
|
||||
}
|
||||
|
||||
void MainWindow::setMouseMode(int mode)
|
||||
{
|
||||
switch(mode)
|
||||
{
|
||||
case Tracking:
|
||||
{
|
||||
d_navigationInfo->setText("Tracking");
|
||||
break;
|
||||
}
|
||||
case Zooming:
|
||||
{
|
||||
d_navigationInfo->setText("Zooming");
|
||||
break;
|
||||
}
|
||||
case Panning:
|
||||
{
|
||||
d_navigationInfo->setText("Panning");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setRescaleMode(int mode)
|
||||
{
|
||||
bool doEnable = true;
|
||||
QString info;
|
||||
QRectF rectOfInterest;
|
||||
QwtPlotRescaler::ExpandingDirection direction = QwtPlotRescaler::ExpandUp;
|
||||
|
||||
switch(mode)
|
||||
{
|
||||
case KeepScales:
|
||||
{
|
||||
doEnable = false;
|
||||
info = "All scales remain unchanged, when the plot is resized";
|
||||
break;
|
||||
}
|
||||
case Fixed:
|
||||
{
|
||||
d_rescaler->setRescalePolicy(QwtPlotRescaler::Fixed);
|
||||
info = "The scale of the bottom axis remains unchanged, "
|
||||
"when the plot is resized. All other scales are changed, "
|
||||
"so that a pixel on screen means the same distance for"
|
||||
"all scales.";
|
||||
break;
|
||||
}
|
||||
case Expanding:
|
||||
{
|
||||
d_rescaler->setRescalePolicy(QwtPlotRescaler::Expanding);
|
||||
info = "The scales of all axis are shrinked/expanded, when "
|
||||
"resizing the plot, keeping the distance that is represented "
|
||||
"by one pixel.";
|
||||
d_rescaleInfo->setText("Expanding");
|
||||
break;
|
||||
}
|
||||
case Fitting:
|
||||
{
|
||||
d_rescaler->setRescalePolicy(QwtPlotRescaler::Fitting);
|
||||
const QwtInterval xIntv =
|
||||
d_rescaler->intervalHint(QwtPlot::xBottom);
|
||||
const QwtInterval yIntv =
|
||||
d_rescaler->intervalHint(QwtPlot::yLeft);
|
||||
|
||||
rectOfInterest = QRectF( xIntv.minValue(), yIntv.minValue(),
|
||||
xIntv.width(), yIntv.width());
|
||||
direction = QwtPlotRescaler::ExpandBoth;
|
||||
|
||||
info = "Fitting";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
d_plot->setRectOfInterest(rectOfInterest);
|
||||
|
||||
d_rescaleInfo->setText(info);
|
||||
d_rescaler->setEnabled(doEnable);
|
||||
for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
|
||||
d_rescaler->setExpandingDirection(direction);
|
||||
|
||||
if ( doEnable )
|
||||
d_rescaler->rescale();
|
||||
else
|
||||
d_plot->replot();
|
||||
}
|
||||
|
||||
void MainWindow::showRatio(double xRatio, double yRatio)
|
||||
{
|
||||
const QString msg = QString("%1, %2").arg(xRatio).arg(yRatio);
|
||||
statusBar()->showMessage(msg);
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
#ifndef _MAINWINDOW_H_
|
||||
#define _MAINWINDOW_H_ 1
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qmainwindow.h>
|
||||
|
||||
class QwtPlotRescaler;
|
||||
class QLabel;
|
||||
class Plot;
|
||||
|
||||
class MainWindow: public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum MouseMode
|
||||
{
|
||||
Tracking,
|
||||
Zooming,
|
||||
Panning
|
||||
};
|
||||
|
||||
enum RescaleMode
|
||||
{
|
||||
KeepScales,
|
||||
Fixed,
|
||||
Expanding,
|
||||
Fitting
|
||||
};
|
||||
|
||||
MainWindow();
|
||||
|
||||
private Q_SLOTS:
|
||||
void setMouseMode(int);
|
||||
void setRescaleMode(int);
|
||||
void showRatio(double, double);
|
||||
|
||||
private:
|
||||
QWidget *createPanel(QWidget *);
|
||||
Plot *createPlot(QWidget *);
|
||||
|
||||
QwtPlotRescaler *d_rescaler;
|
||||
QLabel *d_navigationInfo;
|
||||
QLabel *d_rescaleInfo;
|
||||
|
||||
Plot *d_plot;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,21 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
################################################################
|
||||
|
||||
include( $${PWD}/../examples.pri )
|
||||
|
||||
TARGET = navigation
|
||||
|
||||
HEADERS = \
|
||||
mainwindow.h \
|
||||
plot.h
|
||||
|
||||
SOURCES = \
|
||||
mainwindow.cpp \
|
||||
plot.cpp \
|
||||
main.cpp
|
||||
@@ -1,146 +0,0 @@
|
||||
#include "plot.h"
|
||||
#include <qglobal.h>
|
||||
#include <qpainter.h>
|
||||
#include <qwt_plot_grid.h>
|
||||
#include <qwt_plot_canvas.h>
|
||||
#include <qwt_plot_layout.h>
|
||||
#include <qwt_interval.h>
|
||||
#include <qwt_painter.h>
|
||||
#include <qwt_plot_item.h>
|
||||
|
||||
class RectItem: public QwtPlotItem
|
||||
{
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
Rect,
|
||||
Ellipse
|
||||
};
|
||||
|
||||
RectItem(Type type):
|
||||
d_type(type)
|
||||
{
|
||||
}
|
||||
|
||||
void setPen(const QPen &pen)
|
||||
{
|
||||
if ( pen != d_pen )
|
||||
{
|
||||
d_pen = pen;
|
||||
itemChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void setBrush(const QBrush &brush)
|
||||
{
|
||||
if ( brush != d_brush )
|
||||
{
|
||||
d_brush = brush;
|
||||
itemChanged();
|
||||
}
|
||||
}
|
||||
void setRect(const QRectF &rect)
|
||||
{
|
||||
if ( d_rect != rect )
|
||||
{
|
||||
d_rect = rect;
|
||||
itemChanged();
|
||||
}
|
||||
}
|
||||
|
||||
virtual QRectF boundingRect() const
|
||||
{
|
||||
return d_rect;
|
||||
}
|
||||
|
||||
virtual void draw(QPainter *painter,
|
||||
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
|
||||
const QRectF &) const
|
||||
{
|
||||
if ( d_rect.isValid() )
|
||||
{
|
||||
const QRectF rect = QwtScaleMap::transform(
|
||||
xMap, yMap, d_rect);
|
||||
painter->setPen(d_pen);
|
||||
painter->setBrush(d_brush);
|
||||
if ( d_type == Ellipse )
|
||||
QwtPainter::drawEllipse(painter, rect);
|
||||
else
|
||||
QwtPainter::drawRect(painter, rect);
|
||||
}
|
||||
}
|
||||
private:
|
||||
QPen d_pen;
|
||||
QBrush d_brush;
|
||||
QRectF d_rect;
|
||||
Type d_type;
|
||||
};
|
||||
|
||||
Plot::Plot(QWidget *parent, const QwtInterval &interval):
|
||||
QwtPlot(parent)
|
||||
{
|
||||
for ( int axis = 0; axis < QwtPlot::axisCnt; axis ++ )
|
||||
setAxisScale(axis, interval.minValue(), interval.maxValue());
|
||||
|
||||
setCanvasBackground(QColor(Qt::darkBlue));
|
||||
plotLayout()->setAlignCanvasToScales(true);
|
||||
|
||||
// grid
|
||||
QwtPlotGrid *grid = new QwtPlotGrid;
|
||||
//grid->enableXMin(true);
|
||||
grid->setMajPen(QPen(Qt::white, 0, Qt::DotLine));
|
||||
grid->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
|
||||
grid->attach(this);
|
||||
|
||||
const int numEllipses = 10;
|
||||
|
||||
for ( int i = 0; i < numEllipses; i++ )
|
||||
{
|
||||
const double x = interval.minValue() +
|
||||
qrand() % qRound(interval.width());
|
||||
const double y = interval.minValue() +
|
||||
qrand() % qRound(interval.width());
|
||||
const double r = interval.minValue() +
|
||||
qrand() % qRound(interval.width() / 6);
|
||||
|
||||
const QRectF area(x - r, y - r , 2 * r, 2 * r);
|
||||
|
||||
RectItem *item = new RectItem(RectItem::Ellipse);
|
||||
item->setRenderHint(QwtPlotItem::RenderAntialiased, true);
|
||||
item->setRect(area);
|
||||
item->setPen(QPen(Qt::yellow));
|
||||
item->attach(this);
|
||||
}
|
||||
|
||||
|
||||
d_rectOfInterest = new RectItem(RectItem::Rect);
|
||||
d_rectOfInterest->setPen(Qt::NoPen);
|
||||
QColor c = Qt::gray;
|
||||
c.setAlpha(100);
|
||||
d_rectOfInterest->setBrush(QBrush(c));
|
||||
d_rectOfInterest->attach(this);
|
||||
}
|
||||
|
||||
void Plot::updateLayout()
|
||||
{
|
||||
QwtPlot::updateLayout();
|
||||
|
||||
const QwtScaleMap xMap = canvasMap(QwtPlot::xBottom);
|
||||
const QwtScaleMap yMap = canvasMap(QwtPlot::yLeft);
|
||||
|
||||
const QRect cr = canvas()->contentsRect();
|
||||
const double x1 = xMap.invTransform(cr.left());
|
||||
const double x2 = xMap.invTransform(cr.right());
|
||||
const double y1 = yMap.invTransform(cr.bottom());
|
||||
const double y2 = yMap.invTransform(cr.top());
|
||||
|
||||
const double xRatio = (x2 - x1) / cr.width();
|
||||
const double yRatio = (y2 - y1) / cr.height();
|
||||
|
||||
Q_EMIT resized(xRatio, yRatio);
|
||||
}
|
||||
|
||||
void Plot::setRectOfInterest(const QRectF &rect)
|
||||
{
|
||||
d_rectOfInterest->setRect(rect);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#ifndef _PLOT_H_
|
||||
#define _PLOT_H_ 1
|
||||
|
||||
#include <qwt_plot.h>
|
||||
|
||||
class RectItem;
|
||||
class QwtInterval;
|
||||
|
||||
class Plot: public QwtPlot
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Plot(QWidget *parent, const QwtInterval &);
|
||||
virtual void updateLayout();
|
||||
|
||||
void setRectOfInterest(const QRectF &);
|
||||
|
||||
Q_SIGNALS:
|
||||
void resized(double xRatio, double yRatio);
|
||||
|
||||
private:
|
||||
RectItem *d_rectOfInterest;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,27 +0,0 @@
|
||||
#include "curvedata.h"
|
||||
#include "signaldata.h"
|
||||
|
||||
const SignalData &CurveData::values() const
|
||||
{
|
||||
return SignalData::instance();
|
||||
}
|
||||
|
||||
SignalData &CurveData::values()
|
||||
{
|
||||
return SignalData::instance();
|
||||
}
|
||||
|
||||
QPointF CurveData::sample(size_t i) const
|
||||
{
|
||||
return SignalData::instance().value(i);
|
||||
}
|
||||
|
||||
size_t CurveData::size() const
|
||||
{
|
||||
return SignalData::instance().size();
|
||||
}
|
||||
|
||||
QRectF CurveData::boundingRect() const
|
||||
{
|
||||
return SignalData::instance().boundingRect();
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
#include <qwt_series_data.h>
|
||||
#include <qpointer.h>
|
||||
|
||||
class SignalData;
|
||||
|
||||
class CurveData: public QwtSeriesData<QPointF>
|
||||
{
|
||||
public:
|
||||
const SignalData &values() const;
|
||||
SignalData &values();
|
||||
|
||||
virtual QPointF sample(size_t i) const;
|
||||
virtual size_t size() const;
|
||||
|
||||
virtual QRectF boundingRect() const;
|
||||
};
|
||||
@@ -1,86 +0,0 @@
|
||||
#include "knob.h"
|
||||
#include <qwt_math.h>
|
||||
#include <qpen.h>
|
||||
#include <qwt_knob.h>
|
||||
#include <qwt_round_scale_draw.h>
|
||||
#include <qwt_scale_engine.h>
|
||||
#include <qlabel.h>
|
||||
#include <qevent.h>
|
||||
|
||||
Knob::Knob(const QString &title, double min, double max, QWidget *parent):
|
||||
QWidget(parent)
|
||||
{
|
||||
QFont font("Helvetica", 10);
|
||||
|
||||
d_knob = new QwtKnob(this);
|
||||
d_knob->setFont(font);
|
||||
d_knob->setRange(min, max);
|
||||
|
||||
QwtScaleDiv scaleDiv =
|
||||
d_knob->scaleEngine()->divideScale(min, max, 5, 3);
|
||||
|
||||
QList<double> ticks = scaleDiv.ticks(QwtScaleDiv::MajorTick);
|
||||
if ( ticks.size() > 0 && ticks[0] > min )
|
||||
{
|
||||
if ( ticks.first() > min )
|
||||
ticks.prepend(min);
|
||||
if ( ticks.last() < max )
|
||||
ticks.append(max);
|
||||
}
|
||||
scaleDiv.setTicks(QwtScaleDiv::MajorTick, ticks);
|
||||
d_knob->setScale(scaleDiv);
|
||||
|
||||
d_knob->setKnobWidth(50);
|
||||
|
||||
font.setBold(true);
|
||||
d_label = new QLabel(title, this);
|
||||
d_label->setFont(font);
|
||||
d_label->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
|
||||
|
||||
setSizePolicy(QSizePolicy::MinimumExpanding,
|
||||
QSizePolicy::MinimumExpanding);
|
||||
|
||||
connect(d_knob, SIGNAL(valueChanged(double)),
|
||||
this, SIGNAL(valueChanged(double)));
|
||||
}
|
||||
|
||||
QSize Knob::sizeHint() const
|
||||
{
|
||||
QSize sz1 = d_knob->sizeHint();
|
||||
QSize sz2 = d_label->sizeHint();
|
||||
|
||||
const int w = qMax(sz1.width(), sz2.width());
|
||||
const int h = sz1.height() + sz2.height();
|
||||
|
||||
int off = d_knob->scaleDraw()->extent(d_knob->font());
|
||||
off -= 10; // spacing
|
||||
|
||||
return QSize(w, h - off);
|
||||
}
|
||||
|
||||
void Knob::setValue(double value)
|
||||
{
|
||||
d_knob->setValue(value);
|
||||
}
|
||||
|
||||
double Knob::value() const
|
||||
{
|
||||
return d_knob->value();
|
||||
}
|
||||
|
||||
void Knob::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
const QSize sz = e->size();
|
||||
|
||||
int h = d_label->sizeHint().height();
|
||||
|
||||
d_label->setGeometry(0, sz.height() - h,
|
||||
sz.width(), h);
|
||||
|
||||
h = d_knob->sizeHint().height();
|
||||
int off = d_knob->scaleDraw()->extent(d_knob->font());
|
||||
off -= 10; // spacing
|
||||
|
||||
d_knob->setGeometry(0, d_label->pos().y() - h + off,
|
||||
sz.width(), h);
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#ifndef _KNOB_H_
|
||||
#define _KNOB_H_
|
||||
|
||||
#include <qwidget.h>
|
||||
|
||||
class QwtKnob;
|
||||
class QLabel;
|
||||
|
||||
class Knob: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Knob(const QString &title,
|
||||
double min, double max, QWidget *parent = NULL);
|
||||
|
||||
virtual QSize sizeHint() const;
|
||||
|
||||
void setValue(double value);
|
||||
double value() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
double valueChanged(double);
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent(QResizeEvent *);
|
||||
|
||||
private:
|
||||
QwtKnob *d_knob;
|
||||
QLabel *d_label;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,35 +0,0 @@
|
||||
#include <qapplication.h>
|
||||
#include "mainwindow.h"
|
||||
#include "samplingthread.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
MainWindow window;
|
||||
window.resize(800,400);
|
||||
|
||||
SamplingThread samplingThread;
|
||||
samplingThread.setFrequency(window.frequency());
|
||||
samplingThread.setAmplitude(window.amplitude());
|
||||
samplingThread.setInterval(window.signalInterval());
|
||||
|
||||
window.connect(&window, SIGNAL(frequencyChanged(double)),
|
||||
&samplingThread, SLOT(setFrequency(double)));
|
||||
window.connect(&window, SIGNAL(amplitudeChanged(double)),
|
||||
&samplingThread, SLOT(setAmplitude(double)));
|
||||
window.connect(&window, SIGNAL(signalIntervalChanged(double)),
|
||||
&samplingThread, SLOT(setInterval(double)));
|
||||
|
||||
window.show();
|
||||
|
||||
samplingThread.start();
|
||||
window.start();
|
||||
|
||||
bool ok = app.exec();
|
||||
|
||||
samplingThread.stop();
|
||||
samplingThread.wait(1000);
|
||||
|
||||
return ok;
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
#include "mainwindow.h"
|
||||
#include "plot.h"
|
||||
#include "knob.h"
|
||||
#include "wheelbox.h"
|
||||
#include <qwt_scale_engine.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlayout.h>
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent):
|
||||
QWidget(parent)
|
||||
{
|
||||
const double intervalLength = 10.0; // seconds
|
||||
|
||||
d_plot = new Plot(this);
|
||||
d_plot->setIntervalLength(intervalLength);
|
||||
|
||||
d_amplitudeKnob = new Knob("Amplitude", 0.0, 200.0, this);
|
||||
d_amplitudeKnob->setValue(160.0);
|
||||
|
||||
d_frequencyKnob = new Knob("Frequency [Hz]", 0.1, 20.0, this);
|
||||
d_frequencyKnob->setValue(17.8);
|
||||
|
||||
d_intervalWheel = new WheelBox("Displayed [s]", 1.0, 100.0, 1.0, this);
|
||||
d_intervalWheel->setValue(intervalLength);
|
||||
|
||||
d_timerWheel = new WheelBox("Sample Interval [ms]", 0.0, 20.0, 0.1, this);
|
||||
d_timerWheel->setValue(10.0);
|
||||
|
||||
QVBoxLayout* vLayout1 = new QVBoxLayout();
|
||||
vLayout1->addWidget(d_intervalWheel);
|
||||
vLayout1->addWidget(d_timerWheel);
|
||||
vLayout1->addStretch(10);
|
||||
vLayout1->addWidget(d_amplitudeKnob);
|
||||
vLayout1->addWidget(d_frequencyKnob);
|
||||
|
||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
||||
layout->addWidget(d_plot, 10);
|
||||
layout->addLayout(vLayout1);
|
||||
|
||||
connect(d_amplitudeKnob, SIGNAL(valueChanged(double)),
|
||||
SIGNAL(amplitudeChanged(double)));
|
||||
connect(d_frequencyKnob, SIGNAL(valueChanged(double)),
|
||||
SIGNAL(frequencyChanged(double)));
|
||||
connect(d_timerWheel, SIGNAL(valueChanged(double)),
|
||||
SIGNAL(signalIntervalChanged(double)));
|
||||
|
||||
connect(d_intervalWheel, SIGNAL(valueChanged(double)),
|
||||
d_plot, SLOT(setIntervalLength(double)) );
|
||||
}
|
||||
|
||||
void MainWindow::start()
|
||||
{
|
||||
d_plot->start();
|
||||
}
|
||||
|
||||
double MainWindow::frequency() const
|
||||
{
|
||||
return d_frequencyKnob->value();
|
||||
}
|
||||
|
||||
double MainWindow::amplitude() const
|
||||
{
|
||||
return d_amplitudeKnob->value();
|
||||
}
|
||||
|
||||
double MainWindow::signalInterval() const
|
||||
{
|
||||
return d_timerWheel->value();
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
#include <qwidget.h>
|
||||
|
||||
class Plot;
|
||||
class Knob;
|
||||
class WheelBox;
|
||||
|
||||
class MainWindow : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget * = NULL);
|
||||
|
||||
void start();
|
||||
|
||||
double amplitude() const;
|
||||
double frequency() const;
|
||||
double signalInterval() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void amplitudeChanged(double);
|
||||
void frequencyChanged(double);
|
||||
void signalIntervalChanged(double);
|
||||
|
||||
private:
|
||||
Knob *d_frequencyKnob;
|
||||
Knob *d_amplitudeKnob;
|
||||
WheelBox *d_timerWheel;
|
||||
WheelBox *d_intervalWheel;
|
||||
|
||||
Plot *d_plot;
|
||||
};
|
||||
@@ -1,31 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
################################################################
|
||||
|
||||
include( $${PWD}/../examples.pri )
|
||||
|
||||
TARGET = oscilloscope
|
||||
|
||||
HEADERS = \
|
||||
signaldata.h \
|
||||
plot.h \
|
||||
knob.h \
|
||||
wheelbox.h \
|
||||
samplingthread.h \
|
||||
curvedata.h \
|
||||
mainwindow.h
|
||||
|
||||
SOURCES = \
|
||||
signaldata.cpp \
|
||||
plot.cpp \
|
||||
knob.cpp \
|
||||
wheelbox.cpp \
|
||||
samplingthread.cpp \
|
||||
curvedata.cpp \
|
||||
mainwindow.cpp \
|
||||
main.cpp
|
||||
@@ -1,232 +0,0 @@
|
||||
#include "plot.h"
|
||||
#include "curvedata.h"
|
||||
#include "signaldata.h"
|
||||
#include <qwt_plot_grid.h>
|
||||
#include <qwt_plot_layout.h>
|
||||
#include <qwt_plot_canvas.h>
|
||||
#include <qwt_plot_marker.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_plot_directpainter.h>
|
||||
#include <qwt_curve_fitter.h>
|
||||
#include <qwt_painter.h>
|
||||
#include <qevent.h>
|
||||
|
||||
Plot::Plot(QWidget *parent):
|
||||
QwtPlot(parent),
|
||||
d_paintedPoints(0),
|
||||
d_interval(0.0, 10.0),
|
||||
d_timerId(-1)
|
||||
{
|
||||
d_directPainter = new QwtPlotDirectPainter();
|
||||
|
||||
setAutoReplot(false);
|
||||
|
||||
// The backing store is important, when working with widget
|
||||
// overlays ( f.e rubberbands for zooming ).
|
||||
// Here we don't have them and the internal
|
||||
// backing store of QWidget is good enough.
|
||||
|
||||
canvas()->setPaintAttribute(QwtPlotCanvas::BackingStore, false);
|
||||
|
||||
|
||||
#if defined(Q_WS_X11)
|
||||
// Even if not recommended by TrollTech, Qt::WA_PaintOutsidePaintEvent
|
||||
// works on X11. This has a nice effect on the performance.
|
||||
|
||||
canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, true);
|
||||
|
||||
// Disabling the backing store of Qt improves the performance
|
||||
// for the direct painter even more, but the canvas becomes
|
||||
// a native window of the window system, receiving paint events
|
||||
// for resize and expose operations. Those might be expensive
|
||||
// when there are many points and the backing store of
|
||||
// the canvas is disabled. So in this application
|
||||
// we better don't both backing stores.
|
||||
|
||||
if ( canvas()->testPaintAttribute( QwtPlotCanvas::BackingStore ) )
|
||||
{
|
||||
canvas()->setAttribute(Qt::WA_PaintOnScreen, true);
|
||||
canvas()->setAttribute(Qt::WA_NoSystemBackground, true);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
initGradient();
|
||||
|
||||
plotLayout()->setAlignCanvasToScales(true);
|
||||
|
||||
setAxisTitle(QwtPlot::xBottom, "Time [s]");
|
||||
setAxisScale(QwtPlot::xBottom, d_interval.minValue(), d_interval.maxValue());
|
||||
setAxisScale(QwtPlot::yLeft, -200.0, 200.0);
|
||||
|
||||
QwtPlotGrid *grid = new QwtPlotGrid();
|
||||
grid->setPen(QPen(Qt::gray, 0.0, Qt::DotLine));
|
||||
grid->enableX(true);
|
||||
grid->enableXMin(true);
|
||||
grid->enableY(true);
|
||||
grid->enableYMin(false);
|
||||
grid->attach(this);
|
||||
|
||||
d_origin = new QwtPlotMarker();
|
||||
d_origin->setLineStyle(QwtPlotMarker::Cross);
|
||||
d_origin->setValue(d_interval.minValue() + d_interval.width() / 2.0, 0.0);
|
||||
d_origin->setLinePen(QPen(Qt::gray, 0.0, Qt::DashLine));
|
||||
d_origin->attach(this);
|
||||
|
||||
d_curve = new QwtPlotCurve();
|
||||
d_curve->setStyle(QwtPlotCurve::Lines);
|
||||
d_curve->setPen(QPen(Qt::green));
|
||||
#if 1
|
||||
d_curve->setRenderHint(QwtPlotItem::RenderAntialiased, true);
|
||||
#endif
|
||||
#if 1
|
||||
d_curve->setPaintAttribute(QwtPlotCurve::ClipPolygons, false);
|
||||
#endif
|
||||
d_curve->setData(new CurveData());
|
||||
d_curve->attach(this);
|
||||
}
|
||||
|
||||
Plot::~Plot()
|
||||
{
|
||||
delete d_directPainter;
|
||||
}
|
||||
|
||||
void Plot::initGradient()
|
||||
{
|
||||
QPalette pal = canvas()->palette();
|
||||
|
||||
#if QT_VERSION >= 0x040400
|
||||
QLinearGradient gradient( 0.0, 0.0, 1.0, 0.0 );
|
||||
gradient.setCoordinateMode( QGradient::StretchToDeviceMode );
|
||||
gradient.setColorAt(0.0, QColor( 0, 49, 110 ) );
|
||||
gradient.setColorAt(1.0, QColor( 0, 87, 174 ) );
|
||||
|
||||
pal.setBrush(QPalette::Window, QBrush(gradient));
|
||||
#else
|
||||
pal.setBrush(QPalette::Window, QBrush( color ));
|
||||
#endif
|
||||
|
||||
canvas()->setPalette(pal);
|
||||
}
|
||||
|
||||
void Plot::start()
|
||||
{
|
||||
d_clock.start();
|
||||
d_timerId = startTimer(10);
|
||||
}
|
||||
|
||||
void Plot::replot()
|
||||
{
|
||||
CurveData *data = (CurveData *)d_curve->data();
|
||||
data->values().lock();
|
||||
|
||||
QwtPlot::replot();
|
||||
d_paintedPoints = data->size();
|
||||
|
||||
data->values().unlock();
|
||||
}
|
||||
|
||||
void Plot::setIntervalLength(double interval)
|
||||
{
|
||||
if ( interval > 0.0 && interval != d_interval.width() )
|
||||
{
|
||||
d_interval.setMaxValue(d_interval.minValue() + interval);
|
||||
setAxisScale(QwtPlot::xBottom,
|
||||
d_interval.minValue(), d_interval.maxValue());
|
||||
|
||||
replot();
|
||||
}
|
||||
}
|
||||
|
||||
void Plot::updateCurve()
|
||||
{
|
||||
CurveData *data = (CurveData *)d_curve->data();
|
||||
data->values().lock();
|
||||
|
||||
const int numPoints = data->size();
|
||||
if ( numPoints > d_paintedPoints )
|
||||
{
|
||||
const bool doClip = !canvas()->testAttribute( Qt::WA_PaintOnScreen );
|
||||
if ( doClip )
|
||||
{
|
||||
/*
|
||||
Depending on the platform setting a clip might be an important
|
||||
performance issue. F.e. for Qt Embedded this reduces the
|
||||
part of the backing store that has to be copied out - maybe
|
||||
to an unaccelerated frame buffer device.
|
||||
*/
|
||||
|
||||
const QwtScaleMap xMap = canvasMap( d_curve->xAxis() );
|
||||
const QwtScaleMap yMap = canvasMap( d_curve->yAxis() );
|
||||
|
||||
QRectF br = qwtBoundingRect( *data,
|
||||
d_paintedPoints - 1, numPoints - 1 );
|
||||
|
||||
const QRect clipRect = QwtScaleMap::transform( xMap, yMap, br ).toRect();
|
||||
d_directPainter->setClipRegion( clipRect );
|
||||
}
|
||||
|
||||
d_directPainter->drawSeries(d_curve,
|
||||
d_paintedPoints - 1, numPoints - 1);
|
||||
d_paintedPoints = numPoints;
|
||||
}
|
||||
|
||||
data->values().unlock();
|
||||
}
|
||||
|
||||
void Plot::incrementInterval()
|
||||
{
|
||||
d_interval = QwtInterval(d_interval.maxValue(),
|
||||
d_interval.maxValue() + d_interval.width());
|
||||
|
||||
CurveData *data = (CurveData *)d_curve->data();
|
||||
data->values().clearStaleValues(d_interval.minValue());
|
||||
|
||||
// To avoid, that the grid is jumping, we disable
|
||||
// the autocalculation of the ticks and shift them
|
||||
// manually instead.
|
||||
|
||||
QwtScaleDiv scaleDiv = *axisScaleDiv(QwtPlot::xBottom);
|
||||
scaleDiv.setInterval(d_interval);
|
||||
|
||||
for ( int i = 0; i < QwtScaleDiv::NTickTypes; i++ )
|
||||
{
|
||||
QList<double> ticks = scaleDiv.ticks(i);
|
||||
for ( int j = 0; j < ticks.size(); j++ )
|
||||
ticks[j] += d_interval.width();
|
||||
scaleDiv.setTicks(i, ticks);
|
||||
}
|
||||
setAxisScaleDiv(QwtPlot::xBottom, scaleDiv);
|
||||
|
||||
d_origin->setValue(d_interval.minValue() + d_interval.width() / 2.0, 0.0);
|
||||
|
||||
d_paintedPoints = 0;
|
||||
replot();
|
||||
}
|
||||
|
||||
void Plot::timerEvent(QTimerEvent *event)
|
||||
{
|
||||
if ( event->timerId() == d_timerId )
|
||||
{
|
||||
updateCurve();
|
||||
|
||||
const double elapsed = d_clock.elapsed() / 1000.0;
|
||||
if ( elapsed > d_interval.maxValue() )
|
||||
incrementInterval();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
QwtPlot::timerEvent(event);
|
||||
}
|
||||
|
||||
void Plot::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
d_directPainter->reset();
|
||||
QwtPlot::resizeEvent(event);
|
||||
}
|
||||
|
||||
void Plot::showEvent( QShowEvent * )
|
||||
{
|
||||
replot();
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
#include <qwt_plot.h>
|
||||
#include <qwt_interval.h>
|
||||
#include <qwt_system_clock.h>
|
||||
|
||||
class QwtPlotCurve;
|
||||
class QwtPlotMarker;
|
||||
class QwtPlotDirectPainter;
|
||||
|
||||
class Plot: public QwtPlot
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Plot(QWidget * = NULL);
|
||||
virtual ~Plot();
|
||||
|
||||
void start();
|
||||
virtual void replot();
|
||||
|
||||
public Q_SLOTS:
|
||||
void setIntervalLength(double);
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent *);
|
||||
virtual void resizeEvent(QResizeEvent *);
|
||||
virtual void timerEvent(QTimerEvent *);
|
||||
|
||||
private:
|
||||
void initGradient();
|
||||
|
||||
void updateCurve();
|
||||
void incrementInterval();
|
||||
|
||||
QwtPlotMarker *d_origin;
|
||||
QwtPlotCurve *d_curve;
|
||||
int d_paintedPoints;
|
||||
|
||||
QwtPlotDirectPainter *d_directPainter;
|
||||
|
||||
QwtInterval d_interval;
|
||||
int d_timerId;
|
||||
|
||||
QwtSystemClock d_clock;
|
||||
};
|
||||
@@ -1,54 +0,0 @@
|
||||
#include "samplingthread.h"
|
||||
#include "signaldata.h"
|
||||
#include <qwt_math.h>
|
||||
#include <math.h>
|
||||
|
||||
#if QT_VERSION < 0x040600
|
||||
#define qFastSin(x) ::sin(x)
|
||||
#endif
|
||||
|
||||
SamplingThread::SamplingThread(QObject *parent):
|
||||
QwtSamplingThread(parent),
|
||||
d_frequency(5.0),
|
||||
d_amplitude(20.0)
|
||||
{
|
||||
}
|
||||
|
||||
void SamplingThread::setFrequency(double frequency)
|
||||
{
|
||||
d_frequency = frequency;
|
||||
}
|
||||
|
||||
double SamplingThread::frequency() const
|
||||
{
|
||||
return d_frequency;
|
||||
}
|
||||
|
||||
void SamplingThread::setAmplitude(double amplitude)
|
||||
{
|
||||
d_amplitude = amplitude;
|
||||
}
|
||||
|
||||
double SamplingThread::amplitude() const
|
||||
{
|
||||
return d_amplitude;
|
||||
}
|
||||
|
||||
void SamplingThread::sample(double elapsed)
|
||||
{
|
||||
if ( d_frequency > 0.0 )
|
||||
{
|
||||
const QPointF s(elapsed, value(elapsed));
|
||||
SignalData::instance().append(s);
|
||||
}
|
||||
}
|
||||
|
||||
double SamplingThread::value(double timeStamp) const
|
||||
{
|
||||
const double period = 1.0 / d_frequency;
|
||||
|
||||
const double x = ::fmod(timeStamp, period);
|
||||
const double v = d_amplitude * qFastSin(x / period * 2 * M_PI);
|
||||
|
||||
return v;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#include <qwt_sampling_thread.h>
|
||||
|
||||
class SamplingThread: public QwtSamplingThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SamplingThread(QObject *parent = NULL);
|
||||
|
||||
double frequency() const;
|
||||
double amplitude() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void setAmplitude(double);
|
||||
void setFrequency(double);
|
||||
|
||||
protected:
|
||||
virtual void sample(double elapsed);
|
||||
|
||||
private:
|
||||
virtual double value(double timeStamp) const;
|
||||
|
||||
double d_frequency;
|
||||
double d_amplitude;
|
||||
};
|
||||
@@ -1,133 +0,0 @@
|
||||
#include "signaldata.h"
|
||||
#include <qvector.h>
|
||||
#include <qmutex.h>
|
||||
#include <qreadwritelock.h>
|
||||
|
||||
class SignalData::PrivateData
|
||||
{
|
||||
public:
|
||||
PrivateData():
|
||||
boundingRect(1.0, 1.0, -2.0, -2.0) // invalid
|
||||
{
|
||||
values.reserve(1000);
|
||||
}
|
||||
|
||||
inline void append(const QPointF &sample)
|
||||
{
|
||||
values.append(sample);
|
||||
|
||||
// adjust the bounding rectangle
|
||||
|
||||
if ( boundingRect.width() < 0 || boundingRect.height() < 0 )
|
||||
{
|
||||
boundingRect.setRect(sample.x(), sample.y(), 0.0, 0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
boundingRect.setRight(sample.x());
|
||||
|
||||
if ( sample.y() > boundingRect.bottom() )
|
||||
boundingRect.setBottom(sample.y());
|
||||
|
||||
if ( sample.y() < boundingRect.top() )
|
||||
boundingRect.setTop(sample.y());
|
||||
}
|
||||
}
|
||||
|
||||
QReadWriteLock lock;
|
||||
|
||||
QVector<QPointF> values;
|
||||
QRectF boundingRect;
|
||||
|
||||
QMutex mutex; // protecting pendingValues
|
||||
QVector<QPointF> pendingValues;
|
||||
};
|
||||
|
||||
SignalData::SignalData()
|
||||
{
|
||||
d_data = new PrivateData();
|
||||
}
|
||||
|
||||
SignalData::~SignalData()
|
||||
{
|
||||
delete d_data;
|
||||
}
|
||||
|
||||
int SignalData::size() const
|
||||
{
|
||||
return d_data->values.size();
|
||||
}
|
||||
|
||||
QPointF SignalData::value(int index) const
|
||||
{
|
||||
return d_data->values[index];
|
||||
}
|
||||
|
||||
QRectF SignalData::boundingRect() const
|
||||
{
|
||||
return d_data->boundingRect;
|
||||
}
|
||||
|
||||
void SignalData::lock()
|
||||
{
|
||||
d_data->lock.lockForRead();
|
||||
}
|
||||
|
||||
void SignalData::unlock()
|
||||
{
|
||||
d_data->lock.unlock();
|
||||
}
|
||||
|
||||
void SignalData::append(const QPointF &sample)
|
||||
{
|
||||
d_data->mutex.lock();
|
||||
d_data->pendingValues += sample;
|
||||
|
||||
const bool isLocked = d_data->lock.tryLockForWrite();
|
||||
if ( isLocked )
|
||||
{
|
||||
const int numValues = d_data->pendingValues.size();
|
||||
const QPointF *pendingValues = d_data->pendingValues.data();
|
||||
|
||||
for ( int i = 0; i < numValues; i++ )
|
||||
d_data->append(pendingValues[i]);
|
||||
|
||||
d_data->pendingValues.clear();
|
||||
|
||||
d_data->lock.unlock();
|
||||
}
|
||||
|
||||
d_data->mutex.unlock();
|
||||
}
|
||||
|
||||
void SignalData::clearStaleValues(double limit)
|
||||
{
|
||||
d_data->lock.lockForWrite();
|
||||
|
||||
d_data->boundingRect = QRectF(1.0, 1.0, -2.0, -2.0); // invalid
|
||||
|
||||
const QVector<QPointF> values = d_data->values;
|
||||
d_data->values.clear();
|
||||
d_data->values.reserve(values.size());
|
||||
|
||||
int index;
|
||||
for ( index = values.size() - 1; index >= 0; index-- )
|
||||
{
|
||||
if ( values[index].x() < limit )
|
||||
break;
|
||||
}
|
||||
|
||||
if ( index > 0 )
|
||||
d_data->append(values[index++]);
|
||||
|
||||
while ( index < values.size() - 1 )
|
||||
d_data->append(values[index++]);
|
||||
|
||||
d_data->lock.unlock();
|
||||
}
|
||||
|
||||
SignalData &SignalData::instance()
|
||||
{
|
||||
static SignalData valueVector;
|
||||
return valueVector;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#ifndef _SIGNAL_DATA_H_
|
||||
#define _SIGNAL_DATA_H_ 1
|
||||
|
||||
#include <qrect.h>
|
||||
|
||||
class SignalData
|
||||
{
|
||||
public:
|
||||
static SignalData &instance();
|
||||
|
||||
void append(const QPointF &pos);
|
||||
void clearStaleValues(double min);
|
||||
|
||||
int size() const;
|
||||
QPointF value(int index) const;
|
||||
|
||||
QRectF boundingRect() const;
|
||||
|
||||
void lock();
|
||||
void unlock();
|
||||
|
||||
private:
|
||||
SignalData();
|
||||
SignalData(const SignalData &);
|
||||
SignalData &operator=( const SignalData & );
|
||||
|
||||
virtual ~SignalData();
|
||||
|
||||
class PrivateData;
|
||||
PrivateData *d_data;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,90 +0,0 @@
|
||||
#include "wheelbox.h"
|
||||
#include <qwt_wheel.h>
|
||||
#include <qlcdnumber.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlayout.h>
|
||||
#include <qevent.h>
|
||||
#include <qapplication.h>
|
||||
|
||||
class Wheel: public QwtWheel
|
||||
{
|
||||
public:
|
||||
Wheel(WheelBox *parent):
|
||||
QwtWheel(parent)
|
||||
{
|
||||
setFocusPolicy(Qt::WheelFocus);
|
||||
parent->installEventFilter(this);
|
||||
}
|
||||
|
||||
virtual bool eventFilter(QObject *object, QEvent *ev)
|
||||
{
|
||||
if ( ev->type() == QEvent::Wheel )
|
||||
{
|
||||
QWheelEvent *we = (QWheelEvent *)ev;
|
||||
|
||||
QWheelEvent wheelEvent(QPoint(5, 5), we->delta(),
|
||||
we->buttons(), we->modifiers(),
|
||||
we->orientation());
|
||||
|
||||
QApplication::sendEvent(this, &wheelEvent);
|
||||
return true;
|
||||
}
|
||||
return QwtWheel::eventFilter(object, ev);
|
||||
}
|
||||
};
|
||||
|
||||
WheelBox::WheelBox(const QString &title,
|
||||
double min, double max, double stepSize, QWidget *parent):
|
||||
QWidget(parent)
|
||||
{
|
||||
|
||||
d_number = new QLCDNumber(this);
|
||||
d_number->setSegmentStyle(QLCDNumber::Filled);
|
||||
d_number->setAutoFillBackground(true);
|
||||
d_number->setFixedHeight(d_number->sizeHint().height() * 2 );
|
||||
d_number->setFocusPolicy(Qt::WheelFocus);
|
||||
|
||||
QPalette pal(Qt::black);
|
||||
pal.setColor(QPalette::WindowText, Qt::green);
|
||||
d_number->setPalette(pal);
|
||||
|
||||
d_wheel = new Wheel(this);
|
||||
d_wheel->setOrientation(Qt::Vertical);
|
||||
d_wheel->setRange(min, max, stepSize);
|
||||
d_wheel->setFixedSize(
|
||||
qRound(d_number->height() / 2.5), d_number->height());
|
||||
|
||||
d_number->setFocusProxy(d_wheel);
|
||||
|
||||
QFont font("Helvetica", 10);
|
||||
font.setBold(true);
|
||||
|
||||
d_label = new QLabel(title, this);
|
||||
d_label->setFont(font);
|
||||
|
||||
QHBoxLayout *hLayout = new QHBoxLayout;
|
||||
hLayout->setContentsMargins(0, 0, 0, 0);
|
||||
hLayout->setSpacing(2);
|
||||
hLayout->addWidget(d_number, 10);
|
||||
hLayout->addWidget(d_wheel);
|
||||
|
||||
QVBoxLayout *vLayout = new QVBoxLayout(this);
|
||||
vLayout->addLayout(hLayout, 10);
|
||||
vLayout->addWidget(d_label, 0, Qt::AlignTop | Qt::AlignHCenter);
|
||||
|
||||
connect(d_wheel, SIGNAL(valueChanged(double)),
|
||||
d_number, SLOT(display(double)));
|
||||
connect(d_wheel, SIGNAL(valueChanged(double)),
|
||||
this, SIGNAL(valueChanged(double)));
|
||||
}
|
||||
|
||||
void WheelBox::setValue(double value)
|
||||
{
|
||||
d_wheel->setValue(value);
|
||||
d_number->display(value);
|
||||
}
|
||||
|
||||
double WheelBox::value() const
|
||||
{
|
||||
return d_wheel->value();
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
#ifndef _WHEELBOX_H_
|
||||
#define _WHEELBOX_H_
|
||||
|
||||
#include <qwidget.h>
|
||||
|
||||
class QwtWheel;
|
||||
class QLabel;
|
||||
class QLCDNumber;
|
||||
|
||||
class WheelBox: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
WheelBox(const QString &title,
|
||||
double min, double max, double stepSize,
|
||||
QWidget *parent = NULL);
|
||||
|
||||
void setUnit(const QString &);
|
||||
QString unit() const;
|
||||
|
||||
void setValue(double value);
|
||||
double value() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
double valueChanged(double);
|
||||
|
||||
private:
|
||||
QLCDNumber *d_number;
|
||||
QwtWheel *d_wheel;
|
||||
QLabel *d_label;
|
||||
|
||||
QString d_unit;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,59 +0,0 @@
|
||||
#include <qapplication.h>
|
||||
#include <qpen.h>
|
||||
#include <qwt_plot_grid.h>
|
||||
#include "plotmatrix.h"
|
||||
|
||||
class MainWindow: public PlotMatrix
|
||||
{
|
||||
public:
|
||||
MainWindow();
|
||||
};
|
||||
|
||||
MainWindow::MainWindow():
|
||||
PlotMatrix(3, 4)
|
||||
{
|
||||
enableAxis(QwtPlot::yLeft);
|
||||
enableAxis(QwtPlot::yRight);
|
||||
enableAxis(QwtPlot::xBottom);
|
||||
|
||||
for ( int row = 0; row < numRows(); row++ )
|
||||
{
|
||||
const double v = qPow(10.0, row);
|
||||
setAxisScale(QwtPlot::yLeft, row, -v, v);
|
||||
setAxisScale(QwtPlot::yRight, row, -v, v);
|
||||
}
|
||||
|
||||
for ( int col = 0; col < numColumns(); col++ )
|
||||
{
|
||||
const double v = qPow(10.0, col);
|
||||
setAxisScale(QwtPlot::xBottom, col, -v, v);
|
||||
setAxisScale(QwtPlot::xTop, col, -v, v);
|
||||
}
|
||||
|
||||
for ( int row = 0; row < numRows(); row++ )
|
||||
{
|
||||
for ( int col = 0; col < numColumns(); col++ )
|
||||
{
|
||||
QwtPlot *plt = plot(row, col);
|
||||
plt->setCanvasBackground(QColor(Qt::darkBlue));
|
||||
|
||||
QwtPlotGrid *grid = new QwtPlotGrid();
|
||||
grid->enableXMin(true);
|
||||
grid->setMajPen(QPen(Qt::white, 0, Qt::DotLine));
|
||||
grid->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
|
||||
grid->attach(plt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
MainWindow mainWindow;
|
||||
|
||||
mainWindow.resize(800,600);
|
||||
mainWindow.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@@ -1,293 +0,0 @@
|
||||
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
|
||||
* Qwt Widget Library
|
||||
* Copyright (C) 1997 Josef Wilgen
|
||||
* Copyright (C) 2002 Uwe Rathmann
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Qwt License, Version 1.0
|
||||
*****************************************************************************/
|
||||
|
||||
// vim: expandtab
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qpen.h>
|
||||
#include <qwt_plot.h>
|
||||
#include <qwt_scale_widget.h>
|
||||
#include <qwt_scale_draw.h>
|
||||
#include "plotmatrix.h"
|
||||
|
||||
class PlotMatrix::PrivateData
|
||||
{
|
||||
public:
|
||||
PrivateData():
|
||||
inScaleSync(false)
|
||||
{
|
||||
isAxisEnabled[QwtPlot::xBottom] = true;
|
||||
isAxisEnabled[QwtPlot::xTop] = false;
|
||||
isAxisEnabled[QwtPlot::yLeft] = true;
|
||||
isAxisEnabled[QwtPlot::yRight] = false;
|
||||
}
|
||||
|
||||
bool isAxisEnabled[QwtPlot::axisCnt];
|
||||
QVector<QwtPlot *> plotWidgets;
|
||||
mutable bool inScaleSync;
|
||||
};
|
||||
|
||||
PlotMatrix::PlotMatrix( int numRows, int numColumns, QWidget *parent):
|
||||
QFrame(parent)
|
||||
{
|
||||
d_data = new PrivateData();
|
||||
d_data->plotWidgets.resize(numRows * numColumns);
|
||||
|
||||
QGridLayout *layout = new QGridLayout(this);
|
||||
for ( int row = 0; row < numRows; row++ )
|
||||
{
|
||||
for ( int col = 0; col < numColumns; col++ )
|
||||
{
|
||||
QwtPlot *plot = new QwtPlot(this);
|
||||
layout->addWidget(plot, row, col);
|
||||
|
||||
for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
|
||||
{
|
||||
connect(plot->axisWidget(axis),
|
||||
SIGNAL(scaleDivChanged()), SLOT(scaleDivChanged()) );
|
||||
}
|
||||
d_data->plotWidgets[row * numColumns + col] = plot;
|
||||
}
|
||||
}
|
||||
|
||||
updateLayout();
|
||||
}
|
||||
|
||||
PlotMatrix::~PlotMatrix()
|
||||
{
|
||||
delete d_data;
|
||||
}
|
||||
|
||||
int PlotMatrix::numRows() const
|
||||
{
|
||||
const QGridLayout *l = qobject_cast<const QGridLayout *>(layout());
|
||||
if ( l )
|
||||
return l->rowCount();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int PlotMatrix::numColumns() const
|
||||
{
|
||||
const QGridLayout *l = qobject_cast<const QGridLayout *>(layout());
|
||||
if ( l )
|
||||
return l->columnCount();
|
||||
return 0;
|
||||
}
|
||||
|
||||
QwtPlot* PlotMatrix::plot(int row, int column)
|
||||
{
|
||||
const int index = row * numColumns() + column;
|
||||
if ( index < (int)d_data->plotWidgets.size() )
|
||||
return d_data->plotWidgets[index];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const QwtPlot* PlotMatrix::plot(int row, int column) const
|
||||
{
|
||||
const int index = row * numColumns() + column;
|
||||
if ( index < (int)d_data->plotWidgets.size() )
|
||||
return d_data->plotWidgets[index];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void PlotMatrix::enableAxis(int axis, bool tf)
|
||||
{
|
||||
if ( axis >= 0 && axis < QwtPlot::axisCnt )
|
||||
{
|
||||
if ( tf != d_data->isAxisEnabled[axis] )
|
||||
{
|
||||
d_data->isAxisEnabled[axis] = tf;
|
||||
updateLayout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool PlotMatrix::axisEnabled(int axis) const
|
||||
{
|
||||
if ( axis >= 0 && axis < QwtPlot::axisCnt )
|
||||
return d_data->isAxisEnabled[axis];
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void PlotMatrix::setAxisScale(int axis, int rowOrColumn,
|
||||
double min, double max, double step)
|
||||
{
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
|
||||
if ( axis == QwtPlot::xBottom || axis == QwtPlot::xTop )
|
||||
col = rowOrColumn;
|
||||
else
|
||||
row = rowOrColumn;
|
||||
|
||||
QwtPlot *plt = plot(row, col);
|
||||
if ( plt )
|
||||
{
|
||||
plt->setAxisScale(axis, min, max, step);
|
||||
plt->updateAxes();
|
||||
}
|
||||
}
|
||||
|
||||
void PlotMatrix::scaleDivChanged()
|
||||
{
|
||||
if ( d_data->inScaleSync )
|
||||
return;
|
||||
|
||||
d_data->inScaleSync = true;
|
||||
|
||||
QwtPlot *plt = NULL;
|
||||
int axisId = -1;
|
||||
int rowOrColumn = -1;
|
||||
|
||||
// find the changed axis
|
||||
for ( int row = 0; row < numRows(); row++ )
|
||||
{
|
||||
for ( int col = 0; col < numColumns(); col++ )
|
||||
{
|
||||
QwtPlot *p = plot(row, col);
|
||||
if ( p )
|
||||
{
|
||||
for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
|
||||
{
|
||||
if ( p->axisWidget(axis) == sender() )
|
||||
{
|
||||
plt = p;
|
||||
axisId = axis;
|
||||
if ( axisId == QwtPlot::xBottom || axisId == QwtPlot::xTop )
|
||||
rowOrColumn = col;
|
||||
else
|
||||
rowOrColumn = row;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( plt )
|
||||
{
|
||||
|
||||
// synchronize the axes
|
||||
if ( axisId == QwtPlot::xBottom || axisId == QwtPlot::xTop )
|
||||
{
|
||||
for ( int row = 0; row < numRows(); row++ )
|
||||
{
|
||||
QwtPlot *p = plot(row, rowOrColumn);
|
||||
if ( p != plt )
|
||||
p->setAxisScaleDiv(axisId, *plt->axisScaleDiv(axisId));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( int col = 0; col < numColumns(); col++ )
|
||||
{
|
||||
QwtPlot *p = plot(rowOrColumn, col);
|
||||
if ( p != plt )
|
||||
p->setAxisScaleDiv(axisId, *plt->axisScaleDiv(axisId));
|
||||
}
|
||||
}
|
||||
|
||||
updateLayout();
|
||||
}
|
||||
|
||||
d_data->inScaleSync = false;
|
||||
}
|
||||
|
||||
void PlotMatrix::updateLayout()
|
||||
{
|
||||
for ( int row = 0; row < numRows(); row++ )
|
||||
{
|
||||
for ( int col = 0; col < numColumns(); col++ )
|
||||
{
|
||||
QwtPlot *p = plot(row, col);
|
||||
if ( p )
|
||||
{
|
||||
bool showAxis[QwtPlot::axisCnt];
|
||||
showAxis[QwtPlot::xBottom] =
|
||||
axisEnabled(QwtPlot::xBottom) && row == numRows() - 1;
|
||||
showAxis[QwtPlot::xTop] =
|
||||
axisEnabled(QwtPlot::xTop) && row == 0;
|
||||
showAxis[QwtPlot::yLeft] =
|
||||
axisEnabled(QwtPlot::yLeft) && col == 0;
|
||||
showAxis[QwtPlot::yRight] =
|
||||
axisEnabled(QwtPlot::yRight) && col == numColumns() - 1;
|
||||
|
||||
for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
|
||||
{
|
||||
if ( axis == QwtPlot::xBottom || axis == QwtPlot::xTop )
|
||||
p->enableAxis(axis, showAxis[axis]);
|
||||
else
|
||||
{
|
||||
p->enableAxis(axis, true);
|
||||
|
||||
QwtScaleDraw *sd = p->axisScaleDraw(axis);
|
||||
sd->enableComponent(
|
||||
QwtScaleDraw::Backbone, showAxis[axis]);
|
||||
sd->enableComponent(
|
||||
QwtScaleDraw::Ticks, showAxis[axis]);
|
||||
sd->enableComponent(
|
||||
QwtScaleDraw::Labels, showAxis[axis]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( int col = 0; col < numColumns(); col++ )
|
||||
{
|
||||
alignVAxes(col, QwtPlot::yLeft);
|
||||
alignVAxes(col, QwtPlot::yRight);
|
||||
}
|
||||
|
||||
for ( int row = 0; row < numRows(); row++ )
|
||||
{
|
||||
for ( int col = 0; col < numColumns(); col++ )
|
||||
{
|
||||
QwtPlot *p = plot(row, col);
|
||||
if ( p )
|
||||
p->replot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PlotMatrix::alignVAxes(int col, int axis)
|
||||
{
|
||||
if ( axis != QwtPlot::yLeft && axis != QwtPlot::yRight )
|
||||
return;
|
||||
|
||||
int maxExtent = 0;
|
||||
for ( int row = 0; row < numRows(); row++ )
|
||||
{
|
||||
QwtPlot *p = plot(row, col);
|
||||
if ( p )
|
||||
{
|
||||
QwtScaleWidget *scaleWidget = p->axisWidget(axis);
|
||||
|
||||
QwtScaleDraw *sd = scaleWidget->scaleDraw();
|
||||
sd->setMinimumExtent(0);
|
||||
|
||||
const int extent = sd->extent( scaleWidget->font() );
|
||||
if ( extent > maxExtent )
|
||||
maxExtent = extent;
|
||||
}
|
||||
}
|
||||
for ( int row = 0; row < numRows(); row++ )
|
||||
{
|
||||
QwtPlot *p = plot(row, col);
|
||||
if ( p )
|
||||
{
|
||||
QwtScaleWidget *scaleWidget = p->axisWidget(axis);
|
||||
scaleWidget->scaleDraw()->setMinimumExtent(maxExtent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
#ifndef _PLOT_MATRIX_H_
|
||||
#define _PLOT_MATRIX_H_
|
||||
|
||||
#include <qframe.h>
|
||||
#include <qwt_plot.h>
|
||||
|
||||
class PlotMatrix: public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PlotMatrix( int rows, int columns, QWidget * parent = NULL);
|
||||
virtual ~PlotMatrix();
|
||||
|
||||
int numRows() const;
|
||||
int numColumns() const;
|
||||
|
||||
QwtPlot* plot(int row, int column);
|
||||
const QwtPlot* plot(int row, int column) const;
|
||||
|
||||
void enableAxis(int axisId, bool tf = true);
|
||||
bool axisEnabled(int axisId) const;
|
||||
|
||||
void setAxisScale(int axisId, int rowOrColumn,
|
||||
double min, double max, double step = 0);
|
||||
|
||||
private Q_SLOTS:
|
||||
void scaleDivChanged();
|
||||
|
||||
private:
|
||||
void updateLayout();
|
||||
void alignVAxes(int col, int axis);
|
||||
|
||||
class PrivateData;
|
||||
PrivateData *d_data;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,19 +0,0 @@
|
||||
################################################################
|
||||
# Qwt Widget Library
|
||||
# Copyright (C) 1997 Josef Wilgen
|
||||
# Copyright (C) 2002 Uwe Rathmann
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the Qwt License, Version 1.0
|
||||
################################################################
|
||||
|
||||
include( $${PWD}/../examples.pri )
|
||||
|
||||
TARGET = plotmatrix
|
||||
|
||||
HEADERS = \
|
||||
plotmatrix.h
|
||||
|
||||
SOURCES = \
|
||||
plotmatrix.cpp \
|
||||
main.cpp
|
||||
@@ -1,201 +0,0 @@
|
||||
#include "ampfrm.h"
|
||||
#include <qwt_knob.h>
|
||||
#include <qwt_thermo.h>
|
||||
#include <qwt_round_scale_draw.h>
|
||||
#include <qwt_math.h>
|
||||
#include <qlayout.h>
|
||||
#include <qlabel.h>
|
||||
#include <qfont.h>
|
||||
#include <qpen.h>
|
||||
#include <qevent.h>
|
||||
|
||||
#if QT_VERSION < 0x040600
|
||||
#define qFastSin(x) ::sin(x)
|
||||
#define qFastCos(x) ::cos(x)
|
||||
#endif
|
||||
|
||||
class Knob: public QWidget
|
||||
{
|
||||
public:
|
||||
Knob(const QString &title, double min, double max, QWidget *parent):
|
||||
QWidget(parent)
|
||||
{
|
||||
d_knob = new QwtKnob(this);
|
||||
d_knob->setRange(min, max, 0,1);
|
||||
d_knob->setScaleMaxMajor(10);
|
||||
|
||||
d_knob->setKnobStyle(QwtKnob::Raised);
|
||||
d_knob->setKnobWidth(50);
|
||||
d_knob->setBorderWidth(2);
|
||||
d_knob->setMarkerStyle(QwtKnob::Notch);
|
||||
d_knob->setMarkerSize( 8 );
|
||||
|
||||
d_knob->scaleDraw()->setTickLength( QwtScaleDiv::MinorTick, 4 );
|
||||
d_knob->scaleDraw()->setTickLength( QwtScaleDiv::MediumTick, 4 );
|
||||
d_knob->scaleDraw()->setTickLength( QwtScaleDiv::MajorTick, 6 );
|
||||
|
||||
d_label = new QLabel(title, this);
|
||||
d_label->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
|
||||
|
||||
setSizePolicy(QSizePolicy::MinimumExpanding,
|
||||
QSizePolicy::MinimumExpanding);
|
||||
}
|
||||
|
||||
virtual QSize sizeHint() const
|
||||
{
|
||||
QSize sz1 = d_knob->sizeHint();
|
||||
QSize sz2 = d_label->sizeHint();
|
||||
|
||||
const int w = qMax(sz1.width(), sz2.width());
|
||||
const int h = sz1.height() + sz2.height();
|
||||
|
||||
int off = d_knob->scaleDraw()->extent(d_knob->font());
|
||||
off -= 10; // spacing
|
||||
|
||||
return QSize(w, h - off);
|
||||
}
|
||||
|
||||
void setValue( double value )
|
||||
{
|
||||
d_knob->setValue( value );
|
||||
}
|
||||
|
||||
double value() const
|
||||
{
|
||||
return d_knob->value();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
const QSize sz = e->size();
|
||||
|
||||
int h = d_label->sizeHint().height();
|
||||
|
||||
d_label->setGeometry(0, sz.height() - h,
|
||||
sz.width(), h);
|
||||
|
||||
h = d_knob->sizeHint().height();
|
||||
int off = d_knob->scaleDraw()->extent(d_knob->font());
|
||||
off -= 10; // spacing
|
||||
|
||||
d_knob->setGeometry(0, d_label->pos().y() - h + off,
|
||||
sz.width(), h);
|
||||
}
|
||||
|
||||
private:
|
||||
QwtKnob *d_knob;
|
||||
QLabel *d_label;
|
||||
};
|
||||
|
||||
class Thermo: public QWidget
|
||||
{
|
||||
public:
|
||||
Thermo(const QString &title, QWidget *parent):
|
||||
QWidget(parent)
|
||||
{
|
||||
d_thermo = new QwtThermo( this );
|
||||
d_thermo->setPipeWidth( 6 );
|
||||
d_thermo->setRange( -40, 10 );
|
||||
d_thermo->setFillBrush( Qt::green );
|
||||
d_thermo->setAlarmBrush( Qt::red );
|
||||
d_thermo->setAlarmLevel( 0.0 );
|
||||
d_thermo->setAlarmEnabled( true );
|
||||
|
||||
QLabel *label = new QLabel(title, this);
|
||||
label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(0);
|
||||
layout->addWidget(d_thermo, 10);
|
||||
layout->addWidget(label);
|
||||
}
|
||||
|
||||
void setValue(double value)
|
||||
{
|
||||
d_thermo->setValue(value);
|
||||
}
|
||||
|
||||
private:
|
||||
QwtThermo *d_thermo;
|
||||
};
|
||||
|
||||
AmpFrame::AmpFrame(QWidget *p):
|
||||
QFrame(p)
|
||||
{
|
||||
d_knbVolume = new Knob("Volume", 0.0, 10.0, this);
|
||||
d_knbBalance = new Knob("Balance", -10.0, 10.0, this);
|
||||
d_knbTreble = new Knob("Treble", -10.0, 10.0, this);
|
||||
d_knbBass = new Knob("Bass", -10.0, 10.0, this);
|
||||
|
||||
d_thmLeft = new Thermo("Left [dB]", this);
|
||||
d_thmRight = new Thermo("Right [dB]", this);
|
||||
|
||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
||||
layout->setSpacing(0);
|
||||
layout->setMargin(10);
|
||||
layout->addWidget(d_knbVolume);
|
||||
layout->addWidget(d_knbBalance);
|
||||
layout->addWidget(d_knbTreble);
|
||||
layout->addWidget(d_knbBass);
|
||||
layout->addSpacing(20);
|
||||
layout->addStretch(10);
|
||||
layout->addWidget(d_thmLeft);
|
||||
layout->addSpacing(10);
|
||||
layout->addWidget(d_thmRight);
|
||||
|
||||
d_knbVolume->setValue( 7.0 );
|
||||
(void)startTimer(50);
|
||||
}
|
||||
|
||||
void AmpFrame::timerEvent(QTimerEvent *)
|
||||
{
|
||||
static double phs = 0;
|
||||
|
||||
//
|
||||
// This amplifier generates its own input signal...
|
||||
//
|
||||
|
||||
const double sig_bass = (1.0 + 0.1 * d_knbBass->value())
|
||||
* qFastSin(13.0 * phs);
|
||||
const double sig_mid_l = qFastSin(17.0 * phs);
|
||||
const double sig_mid_r = qFastCos(17.5 * phs);
|
||||
const double sig_trbl_l = 0.5 * (1.0 + 0.1 * d_knbTreble->value())
|
||||
* qFastSin(35.0 * phs);
|
||||
const double sig_trbl_r = 0.5 * (1.0 + 0.1 * d_knbTreble->value())
|
||||
* qFastSin(34.0 * phs);
|
||||
|
||||
double sig_l = 0.05 * d_master * d_knbVolume->value()
|
||||
* qwtSqr(sig_bass + sig_mid_l + sig_trbl_l);
|
||||
double sig_r = 0.05 * d_master * d_knbVolume->value()
|
||||
* qwtSqr(sig_bass + sig_mid_r + sig_trbl_r);
|
||||
|
||||
double balance = 0.1 * d_knbBalance->value();
|
||||
if (balance > 0)
|
||||
sig_l *= (1.0 - balance);
|
||||
else
|
||||
sig_r *= (1.0 + balance);
|
||||
|
||||
if (sig_l > 0.01)
|
||||
sig_l = 20.0 * log10(sig_l);
|
||||
else
|
||||
sig_l = -40.0;
|
||||
|
||||
if (sig_r > 0.01)
|
||||
sig_r = 20.0 * log10(sig_r);
|
||||
else
|
||||
sig_r = - 40.0;
|
||||
|
||||
d_thmLeft->setValue(sig_l);
|
||||
d_thmRight->setValue(sig_r);
|
||||
|
||||
phs += M_PI / 100;
|
||||
if (phs > M_PI)
|
||||
phs = 0;
|
||||
}
|
||||
|
||||
void AmpFrame::setMaster(double v)
|
||||
{
|
||||
d_master = v;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#include <qframe.h>
|
||||
|
||||
class Knob;
|
||||
class Thermo;
|
||||
|
||||
class AmpFrame : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AmpFrame(QWidget *);
|
||||
|
||||
public Q_SLOTS:
|
||||
void setMaster(double v);
|
||||
|
||||
protected:
|
||||
void timerEvent(QTimerEvent *);
|
||||
|
||||
private:
|
||||
Knob *d_knbVolume;
|
||||
Knob *d_knbBalance;
|
||||
Knob *d_knbTreble;
|
||||
Knob *d_knbBass;
|
||||
Thermo *d_thmLeft;
|
||||
Thermo *d_thmRight;
|
||||
double d_master;
|
||||
};
|
||||