├── 0001-ath9k-add-noise-floor-parameter-to-ath9k_hw_getchan_.patch ├── 0002-ath9k-add-HT40-spectral-scan-capability.patch ├── README ├── UI ├── ath9k_spectral.pro ├── athScan │ ├── athScan.pro │ ├── athscan.cpp │ ├── athscan.h │ ├── athscan.ui │ └── main.cpp └── qwt │ ├── COPYING │ ├── INSTALL │ ├── README │ ├── TODO │ ├── admin │ └── svn2package.sh │ ├── designer │ ├── designer.pro │ ├── pixmaps │ │ ├── qwtanalogclock.png │ │ ├── qwtcompass.png │ │ ├── qwtcounter.png │ │ ├── qwtdial.png │ │ ├── qwtknob.png │ │ ├── qwtplot.png │ │ ├── qwtscale.png │ │ ├── qwtslider.png │ │ ├── qwtthermo.png │ │ ├── qwtwheel.png │ │ └── qwtwidget.png │ ├── qwt_designer_plotdialog.cpp │ ├── qwt_designer_plotdialog.h │ ├── qwt_designer_plugin.cpp │ ├── qwt_designer_plugin.h │ └── qwt_designer_plugin.qrc │ ├── doc │ ├── Doxyfile │ ├── articles │ │ └── TODO │ ├── changes.dox │ ├── doc.pro │ ├── images │ │ ├── analogclock.png │ │ ├── cpuplot.png │ │ ├── curves.png │ │ ├── dials1.png │ │ ├── dials2.png │ │ ├── graph.png │ │ ├── histogram.png │ │ ├── knob.png │ │ ├── plot.png │ │ ├── radio.png │ │ ├── scatterplot.png │ │ ├── sinus.png │ │ ├── sliders.png │ │ ├── spectrogram1.png │ │ ├── spectrogram2.png │ │ ├── spectrogram3.png │ │ └── sysinfo.png │ ├── install.dox │ ├── qwt.dox │ └── tex │ │ ├── plotlayout.tex │ │ └── qwtplot.tex │ ├── examples │ ├── animation │ │ ├── animation.pro │ │ ├── main.cpp │ │ ├── plot.cpp │ │ └── plot.h │ ├── barchart │ │ ├── barchart.cpp │ │ ├── barchart.h │ │ ├── barchart.pro │ │ └── main.cpp │ ├── bode │ │ ├── bode.pro │ │ ├── complexnumber.h │ │ ├── main.cpp │ │ ├── mainwindow.cpp │ │ ├── mainwindow.h │ │ ├── pixmaps.h │ │ ├── plot.cpp │ │ └── plot.h │ ├── controls │ │ ├── controls.pro │ │ ├── dialbox.cpp │ │ ├── dialbox.h │ │ ├── dialtab.cpp │ │ ├── dialtab.h │ │ ├── knobbox.cpp │ │ ├── knobbox.h │ │ ├── knobtab.cpp │ │ ├── knobtab.h │ │ ├── main.cpp │ │ ├── sliderbox.cpp │ │ ├── sliderbox.h │ │ ├── slidertab.cpp │ │ ├── slidertab.h │ │ ├── wheelbox.cpp │ │ ├── wheelbox.h │ │ ├── wheeltab.cpp │ │ └── wheeltab.h │ ├── cpuplot │ │ ├── cpupiemarker.cpp │ │ ├── cpupiemarker.h │ │ ├── cpuplot.cpp │ │ ├── cpuplot.h │ │ ├── cpuplot.pro │ │ ├── cpustat.cpp │ │ └── cpustat.h │ ├── curvdemo1 │ │ ├── curvdemo1.cpp │ │ └── curvdemo1.pro │ ├── dials │ │ ├── attitude_indicator.cpp │ │ ├── attitude_indicator.h │ │ ├── cockpit_grid.cpp │ │ ├── cockpit_grid.h │ │ ├── compass_grid.cpp │ │ ├── compass_grid.h │ │ ├── dials.cpp │ │ ├── dials.pro │ │ ├── speedo_meter.cpp │ │ └── speedo_meter.h │ ├── distrowatch │ │ ├── barchart.cpp │ │ ├── barchart.h │ │ ├── distrowatch.pro │ │ └── main.cpp │ ├── event_filter │ │ ├── README │ │ ├── canvaspicker.cpp │ │ ├── canvaspicker.h │ │ ├── colorbar.cpp │ │ ├── colorbar.h │ │ ├── event_filter.cpp │ │ ├── event_filter.pro │ │ ├── plot.cpp │ │ ├── plot.h │ │ ├── scalepicker.cpp │ │ └── scalepicker.h │ ├── examples.pri │ ├── examples.pro │ ├── friedberg │ │ ├── friedberg.pro │ │ ├── friedberg2007.cpp │ │ ├── friedberg2007.h │ │ ├── main.cpp │ │ ├── plot.cpp │ │ └── plot.h │ ├── itemeditor │ │ ├── editor.cpp │ │ ├── editor.h │ │ ├── itemeditor.pro │ │ ├── main.cpp │ │ ├── plot.cpp │ │ ├── plot.h │ │ ├── shapefactory.cpp │ │ └── shapefactory.h │ ├── legends │ │ ├── legends.pro │ │ ├── main.cpp │ │ ├── mainwindow.cpp │ │ ├── mainwindow.h │ │ ├── panel.cpp │ │ ├── panel.h │ │ ├── plot.cpp │ │ ├── plot.h │ │ └── settings.h │ ├── oscilloscope │ │ ├── curvedata.cpp │ │ ├── curvedata.h │ │ ├── knob.cpp │ │ ├── knob.h │ │ ├── main.cpp │ │ ├── mainwindow.cpp │ │ ├── mainwindow.h │ │ ├── osci.css │ │ ├── oscilloscope.pro │ │ ├── plot.cpp │ │ ├── plot.h │ │ ├── samplingthread.cpp │ │ ├── samplingthread.h │ │ ├── signaldata.cpp │ │ ├── signaldata.h │ │ ├── wheelbox.cpp │ │ └── wheelbox.h │ ├── radio │ │ ├── ampfrm.cpp │ │ ├── ampfrm.h │ │ ├── mainwindow.cpp │ │ ├── mainwindow.h │ │ ├── radio.cpp │ │ ├── radio.pro │ │ ├── tunerfrm.cpp │ │ └── tunerfrm.h │ ├── rasterview │ │ ├── main.cpp │ │ ├── plot.cpp │ │ ├── plot.h │ │ └── rasterview.pro │ ├── realtime │ │ ├── README │ │ ├── clear.xpm │ │ ├── incrementalplot.cpp │ │ ├── incrementalplot.h │ │ ├── main.cpp │ │ ├── mainwindow.cpp │ │ ├── mainwindow.h │ │ ├── randomplot.cpp │ │ ├── randomplot.h │ │ ├── realtime.pro │ │ ├── scrollbar.cpp │ │ ├── scrollbar.h │ │ ├── scrollzoomer.cpp │ │ ├── scrollzoomer.h │ │ └── start.xpm │ ├── refreshtest │ │ ├── circularbuffer.cpp │ │ ├── circularbuffer.h │ │ ├── main.cpp │ │ ├── mainwindow.cpp │ │ ├── mainwindow.h │ │ ├── panel.cpp │ │ ├── panel.h │ │ ├── plot.cpp │ │ ├── plot.h │ │ ├── refreshtest.pro │ │ └── settings.h │ ├── scatterplot │ │ ├── main.cpp │ │ ├── mainwindow.cpp │ │ ├── mainwindow.h │ │ ├── plot.cpp │ │ ├── plot.h │ │ └── scatterplot.pro │ ├── simpleplot │ │ ├── simpleplot.cpp │ │ └── simpleplot.pro │ ├── sinusplot │ │ ├── sinusplot.cpp │ │ └── sinusplot.pro │ ├── spectrogram │ │ ├── main.cpp │ │ ├── plot.cpp │ │ ├── plot.h │ │ └── spectrogram.pro │ ├── stockchart │ │ ├── griditem.cpp │ │ ├── griditem.h │ │ ├── legend.cpp │ │ ├── legend.h │ │ ├── main.cpp │ │ ├── plot.cpp │ │ ├── plot.h │ │ ├── quotefactory.cpp │ │ ├── quotefactory.h │ │ └── stockchart.pro │ ├── stylesheets │ │ ├── blue.css │ │ ├── choco.css │ │ ├── oily.css │ │ └── rosy.css │ ├── sysinfo │ │ ├── sysinfo.cpp │ │ └── sysinfo.pro │ └── tvplot │ │ ├── main.cpp │ │ ├── tvplot.cpp │ │ ├── tvplot.h │ │ └── tvplot.pro │ ├── lib │ ├── libqwt.so │ ├── libqwt.so.6 │ ├── libqwt.so.6.1 │ ├── libqwt.so.6.1.1 │ ├── libqwtmathml.so │ ├── libqwtmathml.so.6 │ ├── libqwtmathml.so.6.1 │ └── libqwtmathml.so.6.1.1 │ ├── playground │ ├── bin │ │ ├── curvetracker │ │ ├── graphicscale │ │ ├── plotmatrix │ │ ├── rescaler │ │ ├── scaleengine │ │ ├── shapes │ │ ├── svgmap │ │ ├── symbols │ │ └── timescale │ ├── curvetracker │ │ ├── curvetracker.cpp │ │ ├── curvetracker.h │ │ ├── curvetracker.pro │ │ ├── main.cpp │ │ ├── plot.cpp │ │ └── plot.h │ ├── graphicscale │ │ ├── canvas.cpp │ │ ├── canvas.h │ │ ├── graphicscale.pro │ │ ├── main.cpp │ │ ├── mainwindow.cpp │ │ └── mainwindow.h │ ├── playground.pri │ ├── playground.pro │ ├── plotmatrix │ │ ├── main.cpp │ │ ├── plotmatrix.cpp │ │ ├── plotmatrix.h │ │ └── plotmatrix.pro │ ├── rescaler │ │ ├── main.cpp │ │ ├── mainwindow.cpp │ │ ├── mainwindow.h │ │ ├── plot.cpp │ │ ├── plot.h │ │ └── rescaler.pro │ ├── scaleengine │ │ ├── mainwindow.cpp │ │ ├── mainwindow.h │ │ ├── plot.cpp │ │ ├── plot.h │ │ ├── scaleengine.cpp │ │ ├── scaleengine.pro │ │ ├── transformplot.cpp │ │ └── transformplot.h │ ├── shapes │ │ ├── shapes.cpp │ │ └── shapes.pro │ ├── svgmap │ │ ├── main.cpp │ │ ├── plot.cpp │ │ ├── plot.h │ │ └── svgmap.pro │ ├── symbols │ │ ├── symbols.cpp │ │ └── symbols.pro │ └── timescale │ │ ├── main.cpp │ │ ├── mainwindow.cpp │ │ ├── mainwindow.h │ │ ├── panel.cpp │ │ ├── panel.h │ │ ├── plot.cpp │ │ ├── plot.h │ │ ├── settings.h │ │ └── timescale.pro │ ├── qwt.prf │ ├── qwt.pro │ ├── qwt.pro.user │ ├── qwtbuild.pri │ ├── qwtconfig.pri │ ├── qwtfunctions.pri │ ├── src │ ├── qwt.h │ ├── qwt_abstract_legend.cpp │ ├── qwt_abstract_legend.h │ ├── qwt_abstract_scale.cpp │ ├── qwt_abstract_scale.h │ ├── qwt_abstract_scale_draw.cpp │ ├── qwt_abstract_scale_draw.h │ ├── qwt_abstract_slider.cpp │ ├── qwt_abstract_slider.h │ ├── qwt_analog_clock.cpp │ ├── qwt_analog_clock.h │ ├── qwt_arrow_button.cpp │ ├── qwt_arrow_button.h │ ├── qwt_clipper.cpp │ ├── qwt_clipper.h │ ├── qwt_color_map.cpp │ ├── qwt_color_map.h │ ├── qwt_column_symbol.cpp │ ├── qwt_column_symbol.h │ ├── qwt_compass.cpp │ ├── qwt_compass.h │ ├── qwt_compass_rose.cpp │ ├── qwt_compass_rose.h │ ├── qwt_compat.h │ ├── qwt_counter.cpp │ ├── qwt_counter.h │ ├── qwt_curve_fitter.cpp │ ├── qwt_curve_fitter.h │ ├── qwt_date.cpp │ ├── qwt_date.h │ ├── qwt_date_scale_draw.cpp │ ├── qwt_date_scale_draw.h │ ├── qwt_date_scale_engine.cpp │ ├── qwt_date_scale_engine.h │ ├── qwt_dial.cpp │ ├── qwt_dial.h │ ├── qwt_dial_needle.cpp │ ├── qwt_dial_needle.h │ ├── qwt_dyngrid_layout.cpp │ ├── qwt_dyngrid_layout.h │ ├── qwt_event_pattern.cpp │ ├── qwt_event_pattern.h │ ├── qwt_global.h │ ├── qwt_graphic.cpp │ ├── qwt_graphic.h │ ├── qwt_interval.cpp │ ├── qwt_interval.h │ ├── qwt_interval_symbol.cpp │ ├── qwt_interval_symbol.h │ ├── qwt_knob.cpp │ ├── qwt_knob.h │ ├── qwt_legend.cpp │ ├── qwt_legend.h │ ├── qwt_legend_data.cpp │ ├── qwt_legend_data.h │ ├── qwt_legend_label.cpp │ ├── qwt_legend_label.h │ ├── qwt_magnifier.cpp │ ├── qwt_magnifier.h │ ├── qwt_math.cpp │ ├── qwt_math.h │ ├── qwt_matrix_raster_data.cpp │ ├── qwt_matrix_raster_data.h │ ├── qwt_null_paintdevice.cpp │ ├── qwt_null_paintdevice.h │ ├── qwt_painter.cpp │ ├── qwt_painter.h │ ├── qwt_painter_command.cpp │ ├── qwt_painter_command.h │ ├── qwt_panner.cpp │ ├── qwt_panner.h │ ├── qwt_picker.cpp │ ├── qwt_picker.h │ ├── qwt_picker_machine.cpp │ ├── qwt_picker_machine.h │ ├── qwt_pixel_matrix.cpp │ ├── qwt_pixel_matrix.h │ ├── qwt_plot.cpp │ ├── qwt_plot.h │ ├── qwt_plot_abstract_barchart.cpp │ ├── qwt_plot_abstract_barchart.h │ ├── qwt_plot_axis.cpp │ ├── qwt_plot_barchart.cpp │ ├── qwt_plot_barchart.h │ ├── qwt_plot_canvas.cpp │ ├── qwt_plot_canvas.h │ ├── qwt_plot_curve.cpp │ ├── qwt_plot_curve.h │ ├── qwt_plot_dict.cpp │ ├── qwt_plot_dict.h │ ├── qwt_plot_directpainter.cpp │ ├── qwt_plot_directpainter.h │ ├── qwt_plot_glcanvas.cpp │ ├── qwt_plot_glcanvas.h │ ├── qwt_plot_grid.cpp │ ├── qwt_plot_grid.h │ ├── qwt_plot_histogram.cpp │ ├── qwt_plot_histogram.h │ ├── qwt_plot_intervalcurve.cpp │ ├── qwt_plot_intervalcurve.h │ ├── qwt_plot_item.cpp │ ├── qwt_plot_item.h │ ├── qwt_plot_layout.cpp │ ├── qwt_plot_layout.h │ ├── qwt_plot_legenditem.cpp │ ├── qwt_plot_legenditem.h │ ├── qwt_plot_magnifier.cpp │ ├── qwt_plot_magnifier.h │ ├── qwt_plot_marker.cpp │ ├── qwt_plot_marker.h │ ├── qwt_plot_multi_barchart.cpp │ ├── qwt_plot_multi_barchart.h │ ├── qwt_plot_panner.cpp │ ├── qwt_plot_panner.h │ ├── qwt_plot_picker.cpp │ ├── qwt_plot_picker.h │ ├── qwt_plot_rasteritem.cpp │ ├── qwt_plot_rasteritem.h │ ├── qwt_plot_renderer.cpp │ ├── qwt_plot_renderer.h │ ├── qwt_plot_rescaler.cpp │ ├── qwt_plot_rescaler.h │ ├── qwt_plot_scaleitem.cpp │ ├── qwt_plot_scaleitem.h │ ├── qwt_plot_seriesitem.cpp │ ├── qwt_plot_seriesitem.h │ ├── qwt_plot_shapeitem.cpp │ ├── qwt_plot_shapeitem.h │ ├── qwt_plot_spectrocurve.cpp │ ├── qwt_plot_spectrocurve.h │ ├── qwt_plot_spectrogram.cpp │ ├── qwt_plot_spectrogram.h │ ├── qwt_plot_svgitem.cpp │ ├── qwt_plot_svgitem.h │ ├── qwt_plot_textlabel.cpp │ ├── qwt_plot_textlabel.h │ ├── qwt_plot_tradingcurve.cpp │ ├── qwt_plot_tradingcurve.h │ ├── qwt_plot_xml.cpp │ ├── qwt_plot_zoneitem.cpp │ ├── qwt_plot_zoneitem.h │ ├── qwt_plot_zoomer.cpp │ ├── qwt_plot_zoomer.h │ ├── qwt_point_3d.cpp │ ├── qwt_point_3d.h │ ├── qwt_point_data.cpp │ ├── qwt_point_data.h │ ├── qwt_point_mapper.cpp │ ├── qwt_point_mapper.h │ ├── qwt_point_polar.cpp │ ├── qwt_point_polar.h │ ├── qwt_raster_data.cpp │ ├── qwt_raster_data.h │ ├── qwt_round_scale_draw.cpp │ ├── qwt_round_scale_draw.h │ ├── qwt_samples.h │ ├── qwt_sampling_thread.cpp │ ├── qwt_sampling_thread.h │ ├── qwt_scale_div.cpp │ ├── qwt_scale_div.h │ ├── qwt_scale_draw.cpp │ ├── qwt_scale_draw.h │ ├── qwt_scale_engine.cpp │ ├── qwt_scale_engine.h │ ├── qwt_scale_map.cpp │ ├── qwt_scale_map.h │ ├── qwt_scale_widget.cpp │ ├── qwt_scale_widget.h │ ├── qwt_series_data.cpp │ ├── qwt_series_data.h │ ├── qwt_series_store.h │ ├── qwt_slider.cpp │ ├── qwt_slider.h │ ├── qwt_spline.cpp │ ├── qwt_spline.h │ ├── qwt_symbol.cpp │ ├── qwt_symbol.h │ ├── qwt_system_clock.cpp │ ├── qwt_system_clock.h │ ├── qwt_text.cpp │ ├── qwt_text.h │ ├── qwt_text_engine.cpp │ ├── qwt_text_engine.h │ ├── qwt_text_label.cpp │ ├── qwt_text_label.h │ ├── qwt_thermo.cpp │ ├── qwt_thermo.h │ ├── qwt_transform.cpp │ ├── qwt_transform.h │ ├── qwt_wheel.cpp │ ├── qwt_wheel.h │ ├── qwt_widget_overlay.cpp │ ├── qwt_widget_overlay.h │ ├── src.pri │ └── src.pro │ └── textengines │ ├── mathml │ ├── mathml.pro │ ├── qtmmlwidget-license │ ├── qwt_mathml_text_engine.cpp │ ├── qwt_mathml_text_engine.h │ ├── qwt_mml_document.cpp │ ├── qwt_mml_document.h │ └── qwtmathml.prf │ ├── textengines.pri │ └── textengines.pro └── samples ├── 5220_HT40PLUS.log ├── 5240_HT20.log ├── 5300_HT40MINUS.log └── 5300_HT40MINUS.png /UI/ath9k_spectral.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += \ 4 | athScan qwt 5 | -------------------------------------------------------------------------------- /UI/athScan/athScan.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2013-09-21T18:33:53 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = athScan 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | athscan.cpp 17 | 18 | HEADERS += athscan.h 19 | 20 | FORMS += athscan.ui 21 | 22 | 23 | LIBS += -L$$PWD/../qwt/lib/ -lqwt 24 | INCLUDEPATH += $$PWD/../qwt/src 25 | DEPENDPATH += $$PWD/../qwt/src 26 | -------------------------------------------------------------------------------- /UI/athScan/main.cpp: -------------------------------------------------------------------------------- 1 | #include "athscan.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | AthScan w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /UI/qwt/INSTALL: -------------------------------------------------------------------------------- 1 | see doc/html/qwtinstall.html 2 | -------------------------------------------------------------------------------- /UI/qwt/README: -------------------------------------------------------------------------------- 1 | 2 | The Qwt Widget Library 3 | ---------------------- 4 | 5 | Qwt is an extension to the libraries of the Qt Project. 6 | 7 | The Qwt library contains widgets and components which are 8 | primarily useful for technical and scientifical purposes. 9 | It includes a 2-D plotting widget, different kinds of sliders, 10 | and much more. 11 | 12 | Qwt is hosted at http://qwt.sf.net 13 | 14 | Installation 15 | ------------ 16 | 17 | Read INSTALL how to build and install Qwt. 18 | 19 | Copyright 20 | --------- 21 | 22 | Qwt Widget Library 23 | Copyright (C) 1997 Josef Wilgen 24 | Copyright (C) 2002 Uwe Rathmann 25 | 26 | Qwt is published under the Qwt License, Version 1.0. 27 | You should have received a copy of this licence in the file 28 | COPYING. 29 | 30 | This library is distributed in the hope that it will be useful, 31 | but WITHOUT ANY WARRANTY; without even the implied warranty of 32 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 33 | 34 | 35 | -------------------------------------------------------------------------------- /UI/qwt/TODO: -------------------------------------------------------------------------------- 1 | Qwt TODO list 2 | 3 | Ideas 4 | ------ 5 | - Improve Documention 6 | - QAbstractModel -> QwtSeriesData 7 | - Box/Whisker plot item 8 | - QwtSeriesData + functors 9 | - QwtSeriesData/QwtPlotCurve + Level of details (Douglas Peucker) 10 | - Common zoom stack for all navigation objects 11 | - Watermark Item 12 | - Contour algorithm for vectors: http://apptree.net/conrec.htm 13 | - QwtPlotCanvas rendered via FBO, PBO 14 | - Time/Date scale engine 15 | - TeX texts 16 | - Grid of QwtPlots 17 | - Interval scale labels ( between 2 ticks ) 18 | - More than 4 axes 19 | - QwtIntervalSymbol + QPainterPath/... 20 | - QwtPlotScene + breaking composite architecture 21 | - Using QStaticText for markers ( and scales ? ) 22 | - Scales/Grid item like in QwtPolarGrid 23 | - Container for a 2D matrix 24 | - Waterfall plots 25 | - transform/invTransform for polygons and lines 26 | - cursor item 27 | - line marker with a line from the position to the axis 28 | - quadtree 29 | - QwtText supporting Qt::TextElideMode 30 | - Multitouch events 31 | - QwtKnob/QwtDial fixed contents size mode 32 | - controls ( f.e QwtWheel ) with a very dark palette 33 | 34 | Bugs/Change requests 35 | -------------------- 36 | - Remove QwtScaleTransformation::copy() 37 | - Reference value for QwtThermo 38 | - Transparent canvas background + backingstore 39 | -------------------------------------------------------------------------------- /UI/qwt/designer/pixmaps/qwtanalogclock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/designer/pixmaps/qwtanalogclock.png -------------------------------------------------------------------------------- /UI/qwt/designer/pixmaps/qwtcompass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/designer/pixmaps/qwtcompass.png -------------------------------------------------------------------------------- /UI/qwt/designer/pixmaps/qwtcounter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/designer/pixmaps/qwtcounter.png -------------------------------------------------------------------------------- /UI/qwt/designer/pixmaps/qwtdial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/designer/pixmaps/qwtdial.png -------------------------------------------------------------------------------- /UI/qwt/designer/pixmaps/qwtknob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/designer/pixmaps/qwtknob.png -------------------------------------------------------------------------------- /UI/qwt/designer/pixmaps/qwtplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/designer/pixmaps/qwtplot.png -------------------------------------------------------------------------------- /UI/qwt/designer/pixmaps/qwtscale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/designer/pixmaps/qwtscale.png -------------------------------------------------------------------------------- /UI/qwt/designer/pixmaps/qwtslider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/designer/pixmaps/qwtslider.png -------------------------------------------------------------------------------- /UI/qwt/designer/pixmaps/qwtthermo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/designer/pixmaps/qwtthermo.png -------------------------------------------------------------------------------- /UI/qwt/designer/pixmaps/qwtwheel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/designer/pixmaps/qwtwheel.png -------------------------------------------------------------------------------- /UI/qwt/designer/pixmaps/qwtwidget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/designer/pixmaps/qwtwidget.png -------------------------------------------------------------------------------- /UI/qwt/designer/qwt_designer_plotdialog.cpp: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "qwt_designer_plotdialog.h" 15 | 16 | using namespace QwtDesignerPlugin; 17 | 18 | PlotDialog::PlotDialog( const QString &properties, QWidget *parent ): 19 | QDialog( parent ) 20 | { 21 | setWindowTitle( "Plot Properties" ); 22 | 23 | QLineEdit *lineEdit = new QLineEdit( properties ); 24 | connect( lineEdit, SIGNAL( textChanged( const QString & ) ), 25 | SIGNAL( edited( const QString & ) ) ); 26 | 27 | QTabWidget *tabWidget = new QTabWidget( this ); 28 | tabWidget->addTab( lineEdit, "General" ); 29 | 30 | QPushButton *closeButton = new QPushButton( "Close" ); 31 | connect( closeButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); 32 | 33 | QHBoxLayout *buttonLayout = new QHBoxLayout; 34 | buttonLayout->addStretch( 1 ); 35 | buttonLayout->addWidget( closeButton ); 36 | 37 | QVBoxLayout *mainLayout = new QVBoxLayout; 38 | mainLayout->addWidget( tabWidget ); 39 | mainLayout->addLayout( buttonLayout ); 40 | setLayout( mainLayout ); 41 | } 42 | 43 | -------------------------------------------------------------------------------- /UI/qwt/designer/qwt_designer_plotdialog.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef QWT_DESIGNER_PLOTDIALOG_H 11 | #define QWT_DESIGNER_PLOTDIALOG_H 12 | 13 | #include 14 | 15 | namespace QwtDesignerPlugin 16 | { 17 | 18 | class PlotDialog: public QDialog 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | PlotDialog( const QString &properties, QWidget *parent = NULL ); 24 | 25 | Q_SIGNALS: 26 | void edited( const QString& ); 27 | }; 28 | 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /UI/qwt/designer/qwt_designer_plugin.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | pixmaps/qwtplot.png 4 | pixmaps/qwtanalogclock.png 5 | pixmaps/qwtcounter.png 6 | pixmaps/qwtcompass.png 7 | pixmaps/qwtdial.png 8 | pixmaps/qwtknob.png 9 | pixmaps/qwtscale.png 10 | pixmaps/qwtslider.png 11 | pixmaps/qwtthermo.png 12 | pixmaps/qwtwheel.png 13 | pixmaps/qwtwidget.png 14 | 15 | 16 | -------------------------------------------------------------------------------- /UI/qwt/doc/articles/TODO: -------------------------------------------------------------------------------- 1 | 1) Installation guides 2 | 2) QwtSeriesData + QAbstractModel 3 | 3) Navigation 4 | 4) Scales 5 | 5) Alive plots + sampling threads 6 | 6) Exporting + printing plots 7 | 7) Plot Items 8 | 8) Raster items 9 | -------------------------------------------------------------------------------- /UI/qwt/doc/doc.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | # qmake project file for installing the documentation 11 | 12 | QWT_ROOT = $${PWD}/.. 13 | include( $${QWT_ROOT}/qwtconfig.pri ) 14 | 15 | TEMPLATE = subdirs 16 | 17 | doc.files = $${QWT_ROOT}/doc/html 18 | unix:doc.files += $${QWT_ROOT}/doc/man 19 | doc.path = $${QWT_INSTALL_DOCS} 20 | 21 | INSTALLS = doc 22 | 23 | -------------------------------------------------------------------------------- /UI/qwt/doc/images/analogclock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/analogclock.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/cpuplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/cpuplot.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/curves.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/dials1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/dials1.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/dials2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/dials2.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/graph.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/histogram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/histogram.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/knob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/knob.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/plot.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/radio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/radio.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/scatterplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/scatterplot.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/sinus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/sinus.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/sliders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/sliders.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/spectrogram1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/spectrogram1.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/spectrogram2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/spectrogram2.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/spectrogram3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/spectrogram3.png -------------------------------------------------------------------------------- /UI/qwt/doc/images/sysinfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/doc/images/sysinfo.png -------------------------------------------------------------------------------- /UI/qwt/examples/animation/animation.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = animation 13 | 14 | HEADERS = \ 15 | plot.h 16 | 17 | SOURCES = \ 18 | plot.cpp \ 19 | main.cpp 20 | -------------------------------------------------------------------------------- /UI/qwt/examples/animation/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "plot.h" 3 | 4 | #ifndef QWT_NO_OPENGL 5 | #define USE_OPENGL 1 6 | #endif 7 | 8 | #if USE_OPENGL 9 | #include 10 | #include 11 | #else 12 | #include 13 | #endif 14 | 15 | int main ( int argc, char **argv ) 16 | { 17 | #if USE_OPENGL 18 | #if QT_VERSION >= 0x040600 && QT_VERSION < 0x050000 19 | // on my box QPaintEngine::OpenGL2 has serious problems, f.e: 20 | // the lines of a simple drawRect are wrong. 21 | 22 | QGL::setPreferredPaintEngine( QPaintEngine::OpenGL ); 23 | #endif 24 | #endif 25 | 26 | QApplication a( argc, argv ); 27 | 28 | Plot plot; 29 | 30 | #if USE_OPENGL 31 | QwtPlotGLCanvas *canvas = new QwtPlotGLCanvas(); 32 | canvas->setFrameStyle( QwtPlotGLCanvas::NoFrame ); 33 | #else 34 | QwtPlotCanvas *canvas = new QwtPlotCanvas(); 35 | canvas->setFrameStyle( QFrame::NoFrame ); 36 | canvas->setPaintAttribute( QwtPlotCanvas::BackingStore, false ); 37 | #endif 38 | 39 | plot.setCanvas( canvas ); 40 | plot.setCanvasBackground( QColor( 30, 30, 50 ) ); 41 | 42 | plot.resize( 400, 400 ); 43 | plot.show(); 44 | 45 | return a.exec(); 46 | } 47 | -------------------------------------------------------------------------------- /UI/qwt/examples/animation/plot.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class Curve; 5 | 6 | class Plot: public QwtPlot 7 | { 8 | public: 9 | Plot( QWidget * = NULL); 10 | 11 | protected: 12 | virtual void timerEvent( QTimerEvent * ); 13 | 14 | private: 15 | void updateCurves(); 16 | 17 | enum { CurveCount = 4 }; 18 | Curve *d_curves[CurveCount]; 19 | 20 | QTime d_time; 21 | }; 22 | -------------------------------------------------------------------------------- /UI/qwt/examples/barchart/barchart.h: -------------------------------------------------------------------------------- 1 | #ifndef _BAR_CHART_H_ 2 | 3 | #include 4 | 5 | class QwtPlotMultiBarChart; 6 | 7 | class BarChart: public QwtPlot 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | BarChart( QWidget * = NULL ); 13 | 14 | public Q_SLOTS: 15 | void setMode( int ); 16 | void setOrientation( int ); 17 | void exportChart(); 18 | 19 | private: 20 | void populate(); 21 | 22 | QwtPlotMultiBarChart *d_barChartItem; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /UI/qwt/examples/barchart/barchart.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = barchart 13 | 14 | SOURCES = \ 15 | barchart.cpp \ 16 | main.cpp 17 | 18 | HEADERS = \ 19 | barchart.h 20 | -------------------------------------------------------------------------------- /UI/qwt/examples/barchart/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "barchart.h" 7 | 8 | class MainWindow: public QMainWindow 9 | { 10 | public: 11 | MainWindow( QWidget * = NULL ); 12 | 13 | private: 14 | BarChart *d_chart; 15 | }; 16 | 17 | MainWindow::MainWindow( QWidget *parent ): 18 | QMainWindow( parent ) 19 | { 20 | d_chart = new BarChart( this ); 21 | setCentralWidget( d_chart ); 22 | 23 | QToolBar *toolBar = new QToolBar( this ); 24 | 25 | QComboBox *typeBox = new QComboBox( toolBar ); 26 | typeBox->addItem( "Grouped" ); 27 | typeBox->addItem( "Stacked" ); 28 | typeBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); 29 | 30 | QComboBox *orientationBox = new QComboBox( toolBar ); 31 | orientationBox->addItem( "Vertical" ); 32 | orientationBox->addItem( "Horizontal" ); 33 | orientationBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); 34 | 35 | QToolButton *btnExport = new QToolButton( toolBar ); 36 | btnExport->setText( "Export" ); 37 | btnExport->setToolButtonStyle( Qt::ToolButtonTextUnderIcon ); 38 | connect( btnExport, SIGNAL( clicked() ), d_chart, SLOT( exportChart() ) ); 39 | 40 | toolBar->addWidget( typeBox ); 41 | toolBar->addWidget( orientationBox ); 42 | toolBar->addWidget( btnExport ); 43 | addToolBar( toolBar ); 44 | 45 | d_chart->setMode( typeBox->currentIndex() ); 46 | connect( typeBox, SIGNAL( currentIndexChanged( int ) ), 47 | d_chart, SLOT( setMode( int ) ) ); 48 | 49 | d_chart->setOrientation( orientationBox->currentIndex() ); 50 | connect( orientationBox, SIGNAL( currentIndexChanged( int ) ), 51 | d_chart, SLOT( setOrientation( int ) ) ); 52 | } 53 | 54 | int main( int argc, char **argv ) 55 | { 56 | QApplication a( argc, argv ); 57 | 58 | MainWindow mainWindow; 59 | 60 | mainWindow.resize( 600, 400 ); 61 | mainWindow.show(); 62 | 63 | return a.exec(); 64 | } 65 | -------------------------------------------------------------------------------- /UI/qwt/examples/bode/bode.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = bode 13 | 14 | HEADERS = \ 15 | mainwindow.h \ 16 | plot.h \ 17 | complexnumber.h \ 18 | pixmaps.h 19 | 20 | SOURCES = \ 21 | plot.cpp \ 22 | mainwindow.cpp \ 23 | main.cpp 24 | -------------------------------------------------------------------------------- /UI/qwt/examples/bode/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | 4 | int main ( int argc, char **argv ) 5 | { 6 | QApplication a( argc, argv ); 7 | 8 | MainWindow w; 9 | w.resize( 540, 400 ); 10 | w.show(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /UI/qwt/examples/bode/mainwindow.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class QwtPlotZoomer; 4 | class QwtPlotPicker; 5 | class QwtPlotPanner; 6 | class Plot; 7 | class QPolygon; 8 | 9 | class MainWindow : public QMainWindow 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | MainWindow( QWidget *parent = 0 ); 15 | 16 | private Q_SLOTS: 17 | void moved( const QPoint & ); 18 | void selected( const QPolygon & ); 19 | 20 | #ifndef QT_NO_PRINTER 21 | void print(); 22 | #endif 23 | 24 | void exportDocument(); 25 | void enableZoomMode( bool ); 26 | 27 | private: 28 | void showInfo( QString text = QString::null ); 29 | 30 | Plot *d_plot; 31 | 32 | QwtPlotZoomer *d_zoomer[2]; 33 | QwtPlotPicker *d_picker; 34 | QwtPlotPanner *d_panner; 35 | }; 36 | -------------------------------------------------------------------------------- /UI/qwt/examples/bode/plot.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOT_H_ 2 | #define _PLOT_H_ 3 | 4 | #include 5 | 6 | class QwtPlotCurve; 7 | class QwtPlotMarker; 8 | 9 | class Plot: public QwtPlot 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | Plot( QWidget *parent ); 15 | 16 | public Q_SLOTS: 17 | void setDamp( double damping ); 18 | 19 | private: 20 | void showData( const double *frequency, const double *amplitude, 21 | const double *phase, int count ); 22 | void showPeak( double freq, double amplitude ); 23 | void show3dB( double freq ); 24 | 25 | QwtPlotCurve *d_curve1; 26 | QwtPlotCurve *d_curve2; 27 | QwtPlotMarker *d_marker1; 28 | QwtPlotMarker *d_marker2; 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/controls.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = controls 13 | 14 | HEADERS = \ 15 | sliderbox.h \ 16 | slidertab.h \ 17 | wheelbox.h \ 18 | wheeltab.h \ 19 | knobbox.h \ 20 | knobtab.h \ 21 | dialbox.h \ 22 | dialtab.h 23 | 24 | SOURCES = \ 25 | sliderbox.cpp \ 26 | slidertab.cpp \ 27 | wheelbox.cpp \ 28 | wheeltab.cpp \ 29 | knobbox.cpp \ 30 | knobtab.cpp \ 31 | dialbox.cpp \ 32 | dialtab.cpp \ 33 | main.cpp 34 | 35 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/dialbox.h: -------------------------------------------------------------------------------- 1 | #ifndef _DIAL_BOX_H_ 2 | #define _DIAL_BOX_H_ 3 | 4 | #include 5 | 6 | class QLabel; 7 | class QwtDial; 8 | 9 | class DialBox: public QWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | DialBox( QWidget *parent, int type ); 14 | 15 | private Q_SLOTS: 16 | void setNum( double v ); 17 | 18 | private: 19 | QwtDial *createDial( int type ) const; 20 | 21 | QwtDial *d_dial; 22 | QLabel *d_label; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/dialtab.cpp: -------------------------------------------------------------------------------- 1 | #include "dialtab.h" 2 | #include "dialbox.h" 3 | #include 4 | 5 | DialTab::DialTab( QWidget *parent ): 6 | QWidget( parent ) 7 | { 8 | QGridLayout *layout = new QGridLayout( this ); 9 | 10 | const int numRows = 3; 11 | for ( int i = 0; i < 2 * numRows; i++ ) 12 | { 13 | DialBox *dialBox = new DialBox( this, i ); 14 | layout->addWidget( dialBox, i / numRows, i % numRows ); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/dialtab.h: -------------------------------------------------------------------------------- 1 | #ifndef _DIAL_TAB_H 2 | #define _DIAL_TAB_H 1 3 | 4 | #include 5 | 6 | class DialTab: public QWidget 7 | { 8 | public: 9 | DialTab( QWidget *parent = NULL ); 10 | }; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/knobbox.h: -------------------------------------------------------------------------------- 1 | #ifndef _KNOB_BOX_H_ 2 | #define _KNOB_BOX_H_ 3 | 4 | #include 5 | 6 | class QLabel; 7 | class QwtKnob; 8 | 9 | class KnobBox: public QWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | KnobBox( QWidget *parent, int knobType ); 14 | 15 | private Q_SLOTS: 16 | void setNum( double v ); 17 | 18 | private: 19 | QwtKnob *createKnob( int knobType ) const; 20 | 21 | QwtKnob *d_knob; 22 | QLabel *d_label; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/knobtab.cpp: -------------------------------------------------------------------------------- 1 | #include "knobtab.h" 2 | #include "knobbox.h" 3 | #include 4 | 5 | KnobTab::KnobTab( QWidget *parent ): 6 | QWidget( parent ) 7 | { 8 | QGridLayout *layout = new QGridLayout( this ); 9 | 10 | const int numRows = 3; 11 | for ( int i = 0; i < 2 * numRows; i++ ) 12 | { 13 | KnobBox *knobBox = new KnobBox( this, i ); 14 | layout->addWidget( knobBox, i / numRows, i % numRows ); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/knobtab.h: -------------------------------------------------------------------------------- 1 | #ifndef _KNOB_TAB_H 2 | #define _KNOB_TAB_H 1 3 | 4 | #include 5 | 6 | class KnobTab: public QWidget 7 | { 8 | public: 9 | KnobTab( QWidget *parent = NULL ); 10 | }; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "slidertab.h" 4 | #include "wheeltab.h" 5 | #include "knobtab.h" 6 | #include "dialtab.h" 7 | 8 | 9 | int main ( int argc, char **argv ) 10 | { 11 | QApplication a( argc, argv ); 12 | 13 | QTabWidget tabWidget; 14 | 15 | SliderTab *sliderTab = new SliderTab(); 16 | sliderTab->setAutoFillBackground( true ); 17 | sliderTab->setPalette( QColor( "DimGray" ) ); 18 | 19 | WheelTab *wheelTab = new WheelTab(); 20 | wheelTab->setAutoFillBackground( true ); 21 | wheelTab->setPalette( QColor( "Silver" ) ); 22 | 23 | KnobTab *knobTab = new KnobTab(); 24 | knobTab->setAutoFillBackground( true ); 25 | knobTab->setPalette( Qt::darkGray ); 26 | 27 | DialTab *dialTab = new DialTab(); 28 | dialTab->setAutoFillBackground( true ); 29 | dialTab->setPalette( Qt::darkGray ); 30 | 31 | tabWidget.addTab( new SliderTab, "Slider" ); 32 | tabWidget.addTab( new WheelTab, "Wheel/Thermo" ); 33 | tabWidget.addTab( knobTab, "Knob" ); 34 | tabWidget.addTab( dialTab, "Dial" ); 35 | 36 | tabWidget.resize( 800, 600 ); 37 | tabWidget.show(); 38 | 39 | return a.exec(); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/sliderbox.h: -------------------------------------------------------------------------------- 1 | #ifndef _SLIDER_BOX_H_ 2 | #define _SLIDER_BOX_H_ 1 3 | 4 | #include 5 | 6 | class QLabel; 7 | class QwtSlider; 8 | 9 | class SliderBox: public QWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | SliderBox( int sliderType, QWidget *parent = NULL ); 14 | 15 | private Q_SLOTS: 16 | void setNum( double v ); 17 | 18 | private: 19 | QwtSlider *createSlider( int sliderType ) const; 20 | 21 | QwtSlider *d_slider; 22 | QLabel *d_label; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/slidertab.cpp: -------------------------------------------------------------------------------- 1 | #include "slidertab.h" 2 | #include "sliderbox.h" 3 | #include 4 | 5 | SliderTab::SliderTab( QWidget *parent ): 6 | QWidget( parent ) 7 | { 8 | int i; 9 | 10 | QBoxLayout *hLayout = createLayout( Qt::Vertical ); 11 | for ( i = 0; i < 4; i++ ) 12 | hLayout->addWidget( new SliderBox( i ) ); 13 | hLayout->addStretch(); 14 | 15 | QBoxLayout *vLayout = createLayout( Qt::Horizontal ); 16 | for ( ; i < 7; i++ ) 17 | vLayout->addWidget( new SliderBox( i ) ); 18 | 19 | QBoxLayout *mainLayout = createLayout( Qt::Horizontal, this ); 20 | mainLayout->addLayout( vLayout ); 21 | mainLayout->addLayout( hLayout, 10 ); 22 | } 23 | 24 | QBoxLayout *SliderTab::createLayout( 25 | Qt::Orientation orientation, QWidget *widget ) 26 | { 27 | QBoxLayout *layout = 28 | new QBoxLayout( QBoxLayout::LeftToRight, widget ); 29 | 30 | if ( orientation == Qt::Vertical ) 31 | layout->setDirection( QBoxLayout::TopToBottom ); 32 | 33 | layout->setSpacing( 20 ); 34 | layout->setMargin( 0 ); 35 | 36 | return layout; 37 | } 38 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/slidertab.h: -------------------------------------------------------------------------------- 1 | #ifndef _SLIDER_TAB_H 2 | #define _SLIDER_TAB_H 1 3 | 4 | #include 5 | 6 | class QBoxLayout; 7 | 8 | class SliderTab: public QWidget 9 | { 10 | public: 11 | SliderTab( QWidget *parent = NULL ); 12 | 13 | private: 14 | QBoxLayout *createLayout( Qt::Orientation, 15 | QWidget *widget = NULL ); 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/wheelbox.h: -------------------------------------------------------------------------------- 1 | #ifndef _WHEEL_BOX_H_ 2 | #define _WHEEL_BOX_H_ 1 3 | 4 | #include 5 | 6 | class QLabel; 7 | class QwtThermo; 8 | class QwtWheel; 9 | 10 | class WheelBox: public QWidget 11 | { 12 | Q_OBJECT 13 | public: 14 | WheelBox( Qt::Orientation, 15 | int type, QWidget *parent = NULL ); 16 | 17 | private Q_SLOTS: 18 | void setNum( double v ); 19 | 20 | private: 21 | QWidget *createBox( Qt::Orientation, int type ); 22 | 23 | private: 24 | QwtWheel *d_wheel; 25 | QwtThermo *d_thermo; 26 | QLabel *d_label; 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/wheeltab.cpp: -------------------------------------------------------------------------------- 1 | #include "wheeltab.h" 2 | #include "wheelbox.h" 3 | #include 4 | 5 | WheelTab::WheelTab( QWidget *parent ): 6 | QWidget( parent ) 7 | { 8 | const int numBoxes = 4; 9 | 10 | QGridLayout *layout1 = new QGridLayout(); 11 | for ( int i = 0; i < numBoxes; i++ ) 12 | { 13 | WheelBox *box = new WheelBox( Qt::Vertical, i ); 14 | layout1->addWidget( box, i / 2, i % 2 ); 15 | } 16 | 17 | QGridLayout *layout2 = new QGridLayout(); 18 | for ( int i = 0; i < numBoxes; i++ ) 19 | { 20 | WheelBox *box = new WheelBox( Qt::Horizontal, i + numBoxes ); 21 | layout2->addWidget( box, i / 2, i % 2 ); 22 | } 23 | 24 | QHBoxLayout *layout = new QHBoxLayout( this ); 25 | layout->addLayout( layout1, 2 ); 26 | layout->addLayout( layout2, 5 ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /UI/qwt/examples/controls/wheeltab.h: -------------------------------------------------------------------------------- 1 | #ifndef _WHEEL_TAB_H 2 | #define _WHEEL_TAB_H 1 3 | 4 | #include 5 | 6 | class WheelTab: public QWidget 7 | { 8 | public: 9 | WheelTab( QWidget *parent = NULL ); 10 | }; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /UI/qwt/examples/cpuplot/cpupiemarker.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "cpuplot.h" 5 | #include "cpupiemarker.h" 6 | 7 | CpuPieMarker::CpuPieMarker() 8 | { 9 | setZ( 1000 ); 10 | setRenderHint( QwtPlotItem::RenderAntialiased, true ); 11 | } 12 | 13 | int CpuPieMarker::rtti() const 14 | { 15 | return QwtPlotItem::Rtti_PlotUserItem; 16 | } 17 | 18 | void CpuPieMarker::draw( QPainter *painter, 19 | const QwtScaleMap &, const QwtScaleMap &, 20 | const QRectF &rect ) const 21 | { 22 | const CpuPlot *cpuPlot = static_cast ( plot() ); 23 | 24 | const QwtScaleMap yMap = cpuPlot->canvasMap( QwtPlot::yLeft ); 25 | 26 | const int margin = 5; 27 | 28 | QRectF pieRect; 29 | pieRect.setX( rect.x() + margin ); 30 | pieRect.setY( rect.y() + margin ); 31 | pieRect.setHeight( yMap.transform( 80.0 ) ); 32 | pieRect.setWidth( pieRect.height() ); 33 | 34 | const int dataType[] = { CpuPlot::User, CpuPlot::System, CpuPlot::Idle }; 35 | 36 | int angle = static_cast( 5760 * 0.75 ); 37 | for ( unsigned int i = 0; 38 | i < sizeof( dataType ) / sizeof( dataType[0] ); i++ ) 39 | { 40 | const QwtPlotCurve *curve = cpuPlot->cpuCurve( dataType[i] ); 41 | if ( curve->dataSize() > 0 ) 42 | { 43 | const int value = static_cast( 5760 * curve->sample( 0 ).y() / 100.0 ); 44 | 45 | painter->save(); 46 | painter->setBrush( QBrush( curve->pen().color(), Qt::SolidPattern ) ); 47 | if ( value != 0 ) 48 | painter->drawPie( pieRect, -angle, -value ); 49 | painter->restore(); 50 | 51 | angle += value; 52 | } 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /UI/qwt/examples/cpuplot/cpupiemarker.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------- 2 | // This class shows how to extend QwtPlotItems. It displays a 3 | // pie chart of user/total/idle cpu usage in percent. 4 | //----------------------------------------------------------------- 5 | 6 | #include 7 | 8 | class CpuPieMarker: public QwtPlotItem 9 | { 10 | public: 11 | CpuPieMarker(); 12 | 13 | virtual int rtti() const; 14 | 15 | virtual void draw( QPainter *, 16 | const QwtScaleMap &, const QwtScaleMap &, const QRectF & ) const; 17 | }; 18 | -------------------------------------------------------------------------------- /UI/qwt/examples/cpuplot/cpuplot.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "cpustat.h" 3 | 4 | #define HISTORY 60 // seconds 5 | 6 | class QwtPlotCurve; 7 | 8 | class CpuPlot : public QwtPlot 9 | { 10 | Q_OBJECT 11 | public: 12 | enum CpuData 13 | { 14 | User, 15 | System, 16 | Total, 17 | Idle, 18 | 19 | NCpuData 20 | }; 21 | 22 | CpuPlot( QWidget * = 0 ); 23 | const QwtPlotCurve *cpuCurve( int id ) const 24 | { 25 | return data[id].curve; 26 | } 27 | 28 | protected: 29 | void timerEvent( QTimerEvent *e ); 30 | 31 | private Q_SLOTS: 32 | void legendChecked( const QVariant &, bool on ); 33 | 34 | private: 35 | void showCurve( QwtPlotItem *, bool on ); 36 | 37 | struct 38 | { 39 | QwtPlotCurve *curve; 40 | double data[HISTORY]; 41 | } data[NCpuData]; 42 | 43 | double timeData[HISTORY]; 44 | 45 | int dataCount; 46 | CpuStat cpuStat; 47 | }; 48 | -------------------------------------------------------------------------------- /UI/qwt/examples/cpuplot/cpuplot.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = cpuplot 13 | 14 | HEADERS = \ 15 | cpuplot.h \ 16 | cpustat.h \ 17 | cpupiemarker.h 18 | 19 | SOURCES = \ 20 | cpuplot.cpp \ 21 | cpustat.cpp \ 22 | cpupiemarker.cpp 23 | -------------------------------------------------------------------------------- /UI/qwt/examples/cpuplot/cpustat.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class CpuStat 4 | { 5 | public: 6 | CpuStat(); 7 | void statistic( double &user, double &system ); 8 | QTime upTime() const; 9 | 10 | enum Value 11 | { 12 | User, 13 | Nice, 14 | System, 15 | Idle, 16 | 17 | NValues 18 | }; 19 | 20 | private: 21 | void lookUp( double[NValues] ) const; 22 | double procValues[NValues]; 23 | }; 24 | -------------------------------------------------------------------------------- /UI/qwt/examples/curvdemo1/curvdemo1.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = curvdemo1 13 | 14 | SOURCES = \ 15 | curvdemo1.cpp 16 | -------------------------------------------------------------------------------- /UI/qwt/examples/dials/attitude_indicator.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class AttitudeIndicatorNeedle: public QwtDialNeedle 5 | { 6 | public: 7 | AttitudeIndicatorNeedle( const QColor & ); 8 | 9 | protected: 10 | virtual void drawNeedle( QPainter *, 11 | double length, QPalette::ColorGroup ) const; 12 | }; 13 | 14 | class AttitudeIndicator: public QwtDial 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | AttitudeIndicator( QWidget *parent = NULL ); 20 | 21 | double angle() const { return value(); } 22 | double gradient() const { return d_gradient; } 23 | 24 | public Q_SLOTS: 25 | void setGradient( double ); 26 | void setAngle( double angle ) { setValue( angle ); } 27 | 28 | protected: 29 | virtual void keyPressEvent( QKeyEvent * ); 30 | 31 | virtual void drawScale( QPainter *, 32 | const QPointF ¢er, double radius ) const; 33 | 34 | virtual void drawScaleContents( QPainter *painter, 35 | const QPointF ¢er, double radius ) const; 36 | 37 | private: 38 | double d_gradient; 39 | }; 40 | -------------------------------------------------------------------------------- /UI/qwt/examples/dials/cockpit_grid.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class QwtDial; 5 | class QwtAnalogClock; 6 | class SpeedoMeter; 7 | class AttitudeIndicator; 8 | 9 | class CockpitGrid: public QFrame 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | CockpitGrid( QWidget *parent = NULL ); 15 | 16 | private Q_SLOTS: 17 | void changeSpeed(); 18 | void changeGradient(); 19 | void changeAngle(); 20 | 21 | private: 22 | QPalette colorTheme( const QColor & ) const; 23 | QwtDial *createDial( int pos ); 24 | 25 | QwtAnalogClock *d_clock; 26 | SpeedoMeter *d_speedo; 27 | AttitudeIndicator *d_ai; 28 | }; 29 | -------------------------------------------------------------------------------- /UI/qwt/examples/dials/compass_grid.h: -------------------------------------------------------------------------------- 1 | #include 2 | class QwtCompass; 3 | 4 | class CompassGrid: public QFrame 5 | { 6 | public: 7 | CompassGrid( QWidget *parent = NULL ); 8 | 9 | private: 10 | QwtCompass *createCompass( int pos ); 11 | }; 12 | -------------------------------------------------------------------------------- /UI/qwt/examples/dials/dials.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "compass_grid.h" 4 | #include "cockpit_grid.h" 5 | 6 | //----------------------------------------------------------------- 7 | // 8 | // dials.cpp -- A demo program featuring QwtDial and friends 9 | // 10 | //----------------------------------------------------------------- 11 | 12 | int main ( int argc, char **argv ) 13 | { 14 | QApplication a( argc, argv ); 15 | 16 | QTabWidget tabWidget; 17 | tabWidget.addTab( new CompassGrid, "Compass" ); 18 | tabWidget.addTab( new CockpitGrid, "Cockpit" ); 19 | 20 | tabWidget.show(); 21 | 22 | return a.exec(); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /UI/qwt/examples/dials/dials.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = dials 13 | 14 | HEADERS = \ 15 | attitude_indicator.h \ 16 | speedo_meter.h \ 17 | cockpit_grid.h \ 18 | compass_grid.h 19 | 20 | SOURCES = \ 21 | attitude_indicator.cpp \ 22 | speedo_meter.cpp \ 23 | cockpit_grid.cpp \ 24 | compass_grid.cpp \ 25 | dials.cpp 26 | 27 | -------------------------------------------------------------------------------- /UI/qwt/examples/dials/speedo_meter.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "speedo_meter.h" 5 | 6 | SpeedoMeter::SpeedoMeter( QWidget *parent ): 7 | QwtDial( parent ), 8 | d_label( "km/h" ) 9 | { 10 | QwtRoundScaleDraw *scaleDraw = new QwtRoundScaleDraw(); 11 | scaleDraw->setSpacing( 8 ); 12 | scaleDraw->enableComponent( QwtAbstractScaleDraw::Backbone, false ); 13 | scaleDraw->setTickLength( QwtScaleDiv::MinorTick, 0 ); 14 | scaleDraw->setTickLength( QwtScaleDiv::MediumTick, 4 ); 15 | scaleDraw->setTickLength( QwtScaleDiv::MajorTick, 8 ); 16 | setScaleDraw( scaleDraw ); 17 | 18 | setWrapping( false ); 19 | setReadOnly( true ); 20 | 21 | setOrigin( 135.0 ); 22 | setScaleArc( 0.0, 270.0 ); 23 | 24 | QwtDialSimpleNeedle *needle = new QwtDialSimpleNeedle( 25 | QwtDialSimpleNeedle::Arrow, true, Qt::red, 26 | QColor( Qt::gray ).light( 130 ) ); 27 | setNeedle( needle ); 28 | } 29 | 30 | void SpeedoMeter::setLabel( const QString &label ) 31 | { 32 | d_label = label; 33 | update(); 34 | } 35 | 36 | QString SpeedoMeter::label() const 37 | { 38 | return d_label; 39 | } 40 | 41 | void SpeedoMeter::drawScaleContents( QPainter *painter, 42 | const QPointF ¢er, double radius ) const 43 | { 44 | QRectF rect( 0.0, 0.0, 2.0 * radius, 2.0 * radius - 10.0 ); 45 | rect.moveCenter( center ); 46 | 47 | const QColor color = palette().color( QPalette::Text ); 48 | painter->setPen( color ); 49 | 50 | const int flags = Qt::AlignBottom | Qt::AlignHCenter; 51 | painter->drawText( rect, flags, d_label ); 52 | } 53 | -------------------------------------------------------------------------------- /UI/qwt/examples/dials/speedo_meter.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class SpeedoMeter: public QwtDial 5 | { 6 | public: 7 | SpeedoMeter( QWidget *parent = NULL ); 8 | 9 | void setLabel( const QString & ); 10 | QString label() const; 11 | 12 | protected: 13 | virtual void drawScaleContents( QPainter *painter, 14 | const QPointF ¢er, double radius ) const; 15 | 16 | private: 17 | QString d_label; 18 | }; 19 | -------------------------------------------------------------------------------- /UI/qwt/examples/distrowatch/barchart.h: -------------------------------------------------------------------------------- 1 | #ifndef _BAR_CHART_H_ 2 | 3 | #include 4 | #include 5 | 6 | class DistroChartItem; 7 | 8 | class BarChart: public QwtPlot 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | BarChart( QWidget * = NULL ); 14 | 15 | public Q_SLOTS: 16 | void setOrientation( int ); 17 | void exportChart(); 18 | 19 | private: 20 | void populate(); 21 | 22 | DistroChartItem *d_barChartItem; 23 | QStringList d_distros; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /UI/qwt/examples/distrowatch/distrowatch.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = distrowatch 13 | 14 | HEADERS = \ 15 | barchart.h 16 | 17 | SOURCES = \ 18 | barchart.cpp \ 19 | main.cpp 20 | -------------------------------------------------------------------------------- /UI/qwt/examples/distrowatch/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "barchart.h" 7 | 8 | class MainWindow: public QMainWindow 9 | { 10 | public: 11 | MainWindow( QWidget * = NULL ); 12 | 13 | private: 14 | BarChart *d_chart; 15 | }; 16 | 17 | MainWindow::MainWindow( QWidget *parent ): 18 | QMainWindow( parent ) 19 | { 20 | d_chart = new BarChart( this ); 21 | setCentralWidget( d_chart ); 22 | 23 | QToolBar *toolBar = new QToolBar( this ); 24 | 25 | QComboBox *orientationBox = new QComboBox( toolBar ); 26 | orientationBox->addItem( "Vertical" ); 27 | orientationBox->addItem( "Horizontal" ); 28 | orientationBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); 29 | 30 | QToolButton *btnExport = new QToolButton( toolBar ); 31 | btnExport->setText( "Export" ); 32 | btnExport->setToolButtonStyle( Qt::ToolButtonTextUnderIcon ); 33 | connect( btnExport, SIGNAL( clicked() ), d_chart, SLOT( exportChart() ) ); 34 | 35 | toolBar->addWidget( orientationBox ); 36 | toolBar->addWidget( btnExport ); 37 | addToolBar( toolBar ); 38 | 39 | d_chart->setOrientation( orientationBox->currentIndex() ); 40 | connect( orientationBox, SIGNAL( currentIndexChanged( int ) ), 41 | d_chart, SLOT( setOrientation( int ) ) ); 42 | } 43 | 44 | int main( int argc, char **argv ) 45 | { 46 | QApplication a( argc, argv ); 47 | 48 | MainWindow mainWindow; 49 | 50 | mainWindow.resize( 600, 400 ); 51 | mainWindow.show(); 52 | 53 | return a.exec(); 54 | } 55 | -------------------------------------------------------------------------------- /UI/qwt/examples/event_filter/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/examples/event_filter/README -------------------------------------------------------------------------------- /UI/qwt/examples/event_filter/canvaspicker.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/examples/event_filter/canvaspicker.cpp -------------------------------------------------------------------------------- /UI/qwt/examples/event_filter/canvaspicker.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class QPoint; 4 | class QCustomEvent; 5 | class QwtPlot; 6 | class QwtPlotCurve; 7 | 8 | class CanvasPicker: public QObject 9 | { 10 | Q_OBJECT 11 | public: 12 | CanvasPicker( QwtPlot *plot ); 13 | virtual bool eventFilter( QObject *, QEvent * ); 14 | 15 | virtual bool event( QEvent * ); 16 | 17 | private: 18 | void select( const QPoint & ); 19 | void move( const QPoint & ); 20 | void moveBy( int dx, int dy ); 21 | 22 | void release(); 23 | 24 | void showCursor( bool enable ); 25 | void shiftPointCursor( bool up ); 26 | void shiftCurveCursor( bool up ); 27 | 28 | QwtPlot *plot(); 29 | const QwtPlot *plot() const; 30 | 31 | QwtPlotCurve *d_selectedCurve; 32 | int d_selectedPoint; 33 | }; 34 | -------------------------------------------------------------------------------- /UI/qwt/examples/event_filter/colorbar.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class ColorBar: public QWidget 4 | { 5 | Q_OBJECT 6 | 7 | public: 8 | ColorBar( Qt::Orientation = Qt::Horizontal, QWidget * = NULL ); 9 | 10 | virtual void setOrientation( Qt::Orientation ); 11 | Qt::Orientation orientation() const { return d_orientation; } 12 | 13 | void setRange( const QColor &light, const QColor &dark ); 14 | void setLight( const QColor &light ); 15 | void setDark( const QColor &dark ); 16 | 17 | QColor light() const { return d_light; } 18 | QColor dark() const { return d_dark; } 19 | 20 | Q_SIGNALS: 21 | void selected( const QColor & ); 22 | 23 | protected: 24 | virtual void mousePressEvent( QMouseEvent * ); 25 | virtual void paintEvent( QPaintEvent * ); 26 | 27 | void drawColorBar( QPainter *, const QRect & ) const; 28 | 29 | private: 30 | Qt::Orientation d_orientation; 31 | QColor d_light; 32 | QColor d_dark; 33 | }; 34 | -------------------------------------------------------------------------------- /UI/qwt/examples/event_filter/event_filter.cpp: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------- 2 | // A demo program showing how to use event filtering 3 | //----------------------------------------------------------------- 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "plot.h" 11 | #include "canvaspicker.h" 12 | #include "scalepicker.h" 13 | 14 | int main ( int argc, char **argv ) 15 | { 16 | QApplication a( argc, argv ); 17 | 18 | QMainWindow mainWindow; 19 | QToolBar *toolBar = new QToolBar( &mainWindow ); 20 | QAction *action = QWhatsThis::createAction( toolBar ); 21 | toolBar->addAction( action ); 22 | mainWindow.addToolBar( toolBar ); 23 | 24 | Plot *plot = new Plot( &mainWindow ); 25 | 26 | // The canvas picker handles all mouse and key 27 | // events on the plot canvas 28 | 29 | ( void ) new CanvasPicker( plot ); 30 | 31 | // The scale picker translates mouse clicks 32 | // int o clicked() signals 33 | 34 | ScalePicker *scalePicker = new ScalePicker( plot ); 35 | a.connect( scalePicker, SIGNAL( clicked( int, double ) ), 36 | plot, SLOT( insertCurve( int, double ) ) ); 37 | 38 | mainWindow.setCentralWidget( plot ); 39 | 40 | mainWindow.resize( 540, 400 ); 41 | mainWindow.show(); 42 | 43 | const char *text = 44 | "An useless plot to demonstrate how to use event filtering.\n\n" 45 | "You can click on the color bar, the scales or move the wheel.\n" 46 | "All points can be moved using the mouse or the keyboard."; 47 | plot->setWhatsThis( text ); 48 | 49 | int rv = a.exec(); 50 | return rv; 51 | } 52 | -------------------------------------------------------------------------------- /UI/qwt/examples/event_filter/event_filter.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = event_filter 13 | 14 | HEADERS = \ 15 | colorbar.h \ 16 | scalepicker.h \ 17 | canvaspicker.h \ 18 | plot.h 19 | 20 | SOURCES = \ 21 | colorbar.cpp \ 22 | scalepicker.cpp \ 23 | canvaspicker.cpp \ 24 | plot.cpp \ 25 | event_filter.cpp 26 | -------------------------------------------------------------------------------- /UI/qwt/examples/event_filter/plot.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class ColorBar; 4 | class QwtWheel; 5 | 6 | class Plot: public QwtPlot 7 | { 8 | Q_OBJECT 9 | public: 10 | Plot( QWidget *parent = NULL ); 11 | virtual bool eventFilter( QObject *, QEvent * ); 12 | 13 | public Q_SLOTS: 14 | void setCanvasColor( const QColor & ); 15 | void insertCurve( int axis, double base ); 16 | 17 | private Q_SLOTS: 18 | void scrollLeftAxis( double ); 19 | 20 | private: 21 | void insertCurve( Qt::Orientation, const QColor &, double base ); 22 | 23 | ColorBar *d_colorBar; 24 | QwtWheel *d_wheel; 25 | }; 26 | -------------------------------------------------------------------------------- /UI/qwt/examples/event_filter/scalepicker.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class QwtPlot; 5 | class QwtScaleWidget; 6 | 7 | class ScalePicker: public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | ScalePicker( QwtPlot *plot ); 12 | virtual bool eventFilter( QObject *, QEvent * ); 13 | 14 | Q_SIGNALS: 15 | void clicked( int axis, double value ); 16 | 17 | private: 18 | void mouseClicked( const QwtScaleWidget *, const QPoint & ); 19 | QRect scaleRect( const QwtScaleWidget * ) const; 20 | }; 21 | -------------------------------------------------------------------------------- /UI/qwt/examples/examples.pri: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################### 9 | 10 | QWT_ROOT = $${PWD}/.. 11 | include( $${QWT_ROOT}/qwtconfig.pri ) 12 | include( $${QWT_ROOT}/qwtbuild.pri ) 13 | include( $${QWT_ROOT}/qwtfunctions.pri ) 14 | 15 | TEMPLATE = app 16 | 17 | INCLUDEPATH += $${QWT_ROOT}/src 18 | DEPENDPATH += $${QWT_ROOT}/src 19 | 20 | !debug_and_release { 21 | 22 | DESTDIR = $${QWT_ROOT}/examples/bin 23 | } 24 | else { 25 | CONFIG(debug, debug|release) { 26 | 27 | DESTDIR = $${QWT_ROOT}/examples/bin_debug 28 | } 29 | else { 30 | 31 | DESTDIR = $${QWT_ROOT}/examples/bin 32 | } 33 | } 34 | 35 | QMAKE_RPATHDIR *= $${QWT_ROOT}/lib 36 | 37 | contains(QWT_CONFIG, QwtFramework) { 38 | 39 | LIBS += -F$${QWT_ROOT}/lib 40 | } 41 | else { 42 | 43 | LIBS += -L$${QWT_ROOT}/lib 44 | } 45 | 46 | qwtAddLibrary(qwt) 47 | 48 | greaterThan(QT_MAJOR_VERSION, 4) { 49 | 50 | QT += printsupport 51 | QT += concurrent 52 | } 53 | 54 | contains(QWT_CONFIG, QwtOpenGL ) { 55 | 56 | QT += opengl 57 | } 58 | else { 59 | 60 | DEFINES += QWT_NO_OPENGL 61 | } 62 | 63 | contains(QWT_CONFIG, QwtSvg) { 64 | 65 | QT += svg 66 | } 67 | else { 68 | 69 | DEFINES += QWT_NO_SVG 70 | } 71 | 72 | 73 | win32 { 74 | contains(QWT_CONFIG, QwtDll) { 75 | DEFINES += QT_DLL QWT_DLL 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /UI/qwt/examples/examples.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../qwtconfig.pri ) 11 | 12 | TEMPLATE = subdirs 13 | 14 | contains(QWT_CONFIG, QwtPlot) { 15 | 16 | SUBDIRS += \ 17 | animation \ 18 | barchart \ 19 | cpuplot \ 20 | curvdemo1 \ 21 | distrowatch \ 22 | friedberg \ 23 | itemeditor \ 24 | legends \ 25 | stockchart \ 26 | simpleplot \ 27 | sinusplot \ 28 | realtime \ 29 | refreshtest \ 30 | scatterplot \ 31 | spectrogram \ 32 | rasterview \ 33 | tvplot 34 | 35 | contains(QWT_CONFIG, QwtWidgets) { 36 | 37 | SUBDIRS += \ 38 | bode \ 39 | event_filter \ 40 | oscilloscope 41 | } 42 | } 43 | 44 | contains(QWT_CONFIG, QwtWidgets) { 45 | 46 | SUBDIRS += \ 47 | sysinfo \ 48 | radio \ 49 | dials \ 50 | controls 51 | } 52 | -------------------------------------------------------------------------------- /UI/qwt/examples/friedberg/friedberg.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = friedberg 13 | 14 | HEADERS = \ 15 | plot.h \ 16 | friedberg2007.h 17 | 18 | SOURCES = \ 19 | friedberg2007.cpp \ 20 | plot.cpp \ 21 | main.cpp 22 | -------------------------------------------------------------------------------- /UI/qwt/examples/friedberg/friedberg2007.h: -------------------------------------------------------------------------------- 1 | #ifndef _FRIEDBERG_2007_H_ 2 | #define _FRIEDBERG_2007_H_ 3 | 4 | class Temperature 5 | { 6 | public: 7 | Temperature(): 8 | minValue( 0.0 ), 9 | maxValue( 0.0 ), 10 | averageValue( 0.0 ) 11 | { 12 | } 13 | 14 | Temperature( double min, double max, double average ): 15 | minValue( min ), 16 | maxValue( max ), 17 | averageValue( average ) 18 | { 19 | } 20 | 21 | double minValue; 22 | double maxValue; 23 | double averageValue; 24 | }; 25 | 26 | extern Temperature friedberg2007[]; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /UI/qwt/examples/friedberg/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "plot.h" 7 | 8 | class MainWindow: public QMainWindow 9 | { 10 | public: 11 | MainWindow( QWidget * = NULL ); 12 | 13 | private: 14 | Plot *d_plot; 15 | }; 16 | 17 | MainWindow::MainWindow( QWidget *parent ): 18 | QMainWindow( parent ) 19 | { 20 | d_plot = new Plot( this ); 21 | setCentralWidget( d_plot ); 22 | 23 | QToolBar *toolBar = new QToolBar( this ); 24 | 25 | QComboBox *typeBox = new QComboBox( toolBar ); 26 | typeBox->addItem( "Bars" ); 27 | typeBox->addItem( "Tube" ); 28 | typeBox->setCurrentIndex( 1 ); 29 | typeBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); 30 | 31 | QToolButton *btnExport = new QToolButton( toolBar ); 32 | btnExport->setText( "Export" ); 33 | btnExport->setToolButtonStyle( Qt::ToolButtonTextUnderIcon ); 34 | connect( btnExport, SIGNAL( clicked() ), d_plot, SLOT( exportPlot() ) ); 35 | 36 | toolBar->addWidget( typeBox ); 37 | toolBar->addWidget( btnExport ); 38 | addToolBar( toolBar ); 39 | 40 | d_plot->setMode( typeBox->currentIndex() ); 41 | connect( typeBox, SIGNAL( currentIndexChanged( int ) ), 42 | d_plot, SLOT( setMode( int ) ) ); 43 | } 44 | 45 | int main( int argc, char **argv ) 46 | { 47 | QApplication a( argc, argv ); 48 | 49 | MainWindow w; 50 | w.setObjectName( "MainWindow" ); 51 | w.resize( 600, 400 ); 52 | w.show(); 53 | 54 | return a.exec(); 55 | } 56 | -------------------------------------------------------------------------------- /UI/qwt/examples/friedberg/plot.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOT_H_ 2 | #define _PLOT_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class QwtPlotCurve; 9 | class QwtPlotIntervalCurve; 10 | 11 | class Plot: public QwtPlot 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | enum Mode 17 | { 18 | Bars, 19 | Tube 20 | }; 21 | 22 | Plot( QWidget * = NULL ); 23 | 24 | public Q_SLOTS: 25 | void setMode( int ); 26 | void exportPlot(); 27 | 28 | private: 29 | void insertCurve( const QString &title, 30 | const QVector &, const QColor & ); 31 | 32 | void insertErrorBars( const QString &title, 33 | const QVector &, 34 | const QColor &color ); 35 | 36 | 37 | QwtScaleDiv yearScaleDiv() const; 38 | 39 | QwtPlotIntervalCurve *d_intervalCurve; 40 | QwtPlotCurve *d_curve; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /UI/qwt/examples/itemeditor/editor.h: -------------------------------------------------------------------------------- 1 | #ifndef _EDITOR_H_ 2 | #define _EDITOR_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class QwtPlot; 10 | class QwtPlotShapeItem; 11 | class QPainter; 12 | class QPoint; 13 | 14 | class Editor: public QObject 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | enum Mode 20 | { 21 | NoMask, 22 | Mask, 23 | AlphaMask, 24 | AlphaMaskRedraw, 25 | AlphaMaskCopyMask 26 | }; 27 | 28 | Editor( QwtPlot * ); 29 | virtual ~Editor(); 30 | 31 | const QwtPlot *plot() const; 32 | QwtPlot *plot(); 33 | 34 | virtual void setEnabled( bool on ); 35 | bool isEnabled() const; 36 | 37 | void drawOverlay( QPainter * ) const; 38 | QRegion maskHint() const; 39 | 40 | virtual bool eventFilter( QObject *, QEvent *); 41 | 42 | void setMode( Mode mode ); 43 | Mode mode() const; 44 | 45 | private: 46 | bool pressed( const QPoint & ); 47 | bool moved( const QPoint & ); 48 | void released( const QPoint & ); 49 | 50 | QwtPlotShapeItem* itemAt( const QPoint& ) const; 51 | void raiseItem( QwtPlotShapeItem * ); 52 | 53 | QRegion maskHint( QwtPlotShapeItem * ) const; 54 | void setItemVisible( QwtPlotShapeItem *item, bool on ); 55 | 56 | bool d_isEnabled; 57 | QPointer d_overlay; 58 | 59 | // Mouse positions 60 | QPointF d_currentPos; 61 | QwtPlotShapeItem* d_editedItem; 62 | 63 | Mode d_mode; 64 | }; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /UI/qwt/examples/itemeditor/itemeditor.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = itemeditor 13 | 14 | HEADERS = \ 15 | editor.h \ 16 | shapefactory.h \ 17 | plot.h 18 | 19 | SOURCES = \ 20 | editor.cpp \ 21 | shapefactory.cpp \ 22 | plot.cpp \ 23 | main.cpp 24 | 25 | -------------------------------------------------------------------------------- /UI/qwt/examples/itemeditor/main.cpp: -------------------------------------------------------------------------------- 1 | #include "plot.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | class MainWindow: public QMainWindow 9 | { 10 | public: 11 | MainWindow( QWidget * = NULL ); 12 | }; 13 | 14 | MainWindow::MainWindow( QWidget *parent ): 15 | QMainWindow( parent ) 16 | { 17 | Plot *plot = new Plot( this ); 18 | setCentralWidget( plot ); 19 | 20 | QToolBar *toolBar = new QToolBar( this ); 21 | 22 | QComboBox *modeBox = new QComboBox( toolBar ); 23 | modeBox->addItem( "No Mask" ); 24 | modeBox->addItem( "Mask" ); 25 | modeBox->addItem( "Alpha Mask" ); 26 | modeBox->addItem( "Alpha Mask/Redraw" ); 27 | modeBox->addItem( "Alpha Mask/Copy Mask" ); 28 | modeBox->setCurrentIndex( 1 ); 29 | modeBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); 30 | 31 | connect( modeBox, SIGNAL( currentIndexChanged( int ) ), 32 | plot, SLOT( setMode( int ) ) ); 33 | 34 | QToolButton *btnExport = new QToolButton( toolBar ); 35 | btnExport->setText( "Export" ); 36 | btnExport->setToolButtonStyle( Qt::ToolButtonTextUnderIcon ); 37 | connect( btnExport, SIGNAL( clicked() ), plot, SLOT( exportPlot() ) ); 38 | 39 | toolBar->addWidget( modeBox ); 40 | toolBar->addWidget( btnExport ); 41 | addToolBar( toolBar ); 42 | 43 | } 44 | 45 | int main( int argc, char **argv ) 46 | { 47 | QApplication app( argc, argv ); 48 | 49 | MainWindow window; 50 | window.resize( 600, 400 ); 51 | window.show(); 52 | 53 | return app.exec(); 54 | } 55 | -------------------------------------------------------------------------------- /UI/qwt/examples/itemeditor/plot.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOT_H 2 | #define _PLOT_H 3 | 4 | #include 5 | #include "shapefactory.h" 6 | 7 | class QColor; 8 | class QSizeF; 9 | class QPointF; 10 | class Editor; 11 | 12 | class Plot: public QwtPlot 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | Plot( QWidget *parent = NULL ); 18 | 19 | public Q_SLOTS: 20 | void exportPlot(); 21 | void setMode( int ); 22 | 23 | private: 24 | void populate(); 25 | 26 | void addShape( const QString &title, 27 | ShapeFactory::Shape, const QColor &, 28 | const QPointF &, const QSizeF & ); 29 | 30 | Editor *d_editor; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /UI/qwt/examples/itemeditor/shapefactory.h: -------------------------------------------------------------------------------- 1 | #ifndef _SHAPE_FACTORY_H_ 2 | #define _SHAPE_FACTORY_H_ 3 | 4 | #include 5 | 6 | namespace ShapeFactory 7 | { 8 | enum Shape 9 | { 10 | Rect, 11 | Triangle, 12 | Ellipse, 13 | Ring, 14 | Star, 15 | Hexagon 16 | }; 17 | 18 | QPainterPath path( Shape, const QPointF &, const QSizeF & ); 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /UI/qwt/examples/legends/legends.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = legends 13 | 14 | HEADERS = \ 15 | mainwindow.h \ 16 | panel.h \ 17 | settings.h \ 18 | plot.h 19 | 20 | SOURCES = \ 21 | mainwindow.cpp \ 22 | panel.cpp \ 23 | plot.cpp \ 24 | main.cpp 25 | -------------------------------------------------------------------------------- /UI/qwt/examples/legends/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | 4 | int main ( int argc, char **argv ) 5 | { 6 | QApplication a( argc, argv ); 7 | a.setStyle( "Windows" ); 8 | 9 | MainWindow w; 10 | w.resize( 700, 500 ); 11 | w.show(); 12 | 13 | return a.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /UI/qwt/examples/legends/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "plot.h" 7 | #include "panel.h" 8 | #include "mainwindow.h" 9 | 10 | MainWindow::MainWindow( QWidget *parent ): 11 | QMainWindow( parent ) 12 | { 13 | d_plot = new Plot(); 14 | 15 | Settings settings; 16 | settings.legend.isEnabled = true; 17 | settings.legend.position = QwtPlot::BottomLegend; 18 | 19 | settings.legendItem.isEnabled = false; 20 | settings.legendItem.numColumns = 1; 21 | settings.legendItem.alignment = Qt::AlignRight | Qt::AlignVCenter; 22 | settings.legendItem.backgroundMode = 0; 23 | settings.legendItem.size = d_plot->canvas()->font().pointSize(); 24 | 25 | settings.curve.numCurves = 4; 26 | settings.curve.title = "Curve"; 27 | 28 | d_panel = new Panel(); 29 | d_panel->setSettings( settings ); 30 | 31 | QWidget *box = new QWidget( this ); 32 | QHBoxLayout *layout = new QHBoxLayout( box ); 33 | layout->addWidget( d_plot, 10 ); 34 | layout->addWidget( d_panel ); 35 | 36 | setCentralWidget( box ); 37 | 38 | QToolBar *toolBar = new QToolBar( this ); 39 | 40 | QToolButton *btnExport = new QToolButton( toolBar ); 41 | btnExport->setText( "Export" ); 42 | toolBar->addWidget( btnExport ); 43 | 44 | addToolBar( toolBar ); 45 | 46 | updatePlot(); 47 | 48 | connect( d_panel, SIGNAL( edited() ), SLOT( updatePlot() ) ); 49 | connect( btnExport, SIGNAL( clicked() ), SLOT( exportPlot() ) ); 50 | } 51 | 52 | void MainWindow::updatePlot() 53 | { 54 | d_plot->applySettings( d_panel->settings() ); 55 | } 56 | 57 | void MainWindow::exportPlot() 58 | { 59 | QwtPlotRenderer renderer; 60 | renderer.exportTo( d_plot, "legends.pdf" ); 61 | } 62 | -------------------------------------------------------------------------------- /UI/qwt/examples/legends/mainwindow.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class Plot; 4 | class Panel; 5 | 6 | class MainWindow : public QMainWindow 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MainWindow( QWidget *parent = 0 ); 12 | 13 | private Q_SLOTS: 14 | void updatePlot(); 15 | void exportPlot(); 16 | 17 | private: 18 | Plot *d_plot; 19 | Panel *d_panel; 20 | }; 21 | -------------------------------------------------------------------------------- /UI/qwt/examples/legends/panel.h: -------------------------------------------------------------------------------- 1 | #ifndef _PANEL_ 2 | #define _PANEL_ 3 | 4 | #include "settings.h" 5 | #include 6 | 7 | class QCheckBox; 8 | class QComboBox; 9 | class QSpinBox; 10 | class QLineEdit; 11 | 12 | class Panel: public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | Panel( QWidget *parent = NULL ); 18 | 19 | void setSettings( const Settings &); 20 | Settings settings() const; 21 | 22 | Q_SIGNALS: 23 | void edited(); 24 | 25 | private: 26 | struct 27 | { 28 | QCheckBox *checkBox; 29 | QComboBox *positionBox; 30 | 31 | } d_legend; 32 | 33 | struct 34 | { 35 | QCheckBox *checkBox; 36 | QSpinBox *numColumnsBox; 37 | QComboBox *hAlignmentBox; 38 | QComboBox *vAlignmentBox; 39 | QComboBox *backgroundBox; 40 | QSpinBox *sizeBox; 41 | 42 | } d_legendItem; 43 | 44 | struct 45 | { 46 | QSpinBox *numCurves; 47 | QLineEdit *title; 48 | 49 | } d_curve; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /UI/qwt/examples/legends/plot.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOT_H_ 2 | #define _PLOT_H_ 3 | 4 | #include 5 | 6 | class Settings; 7 | class LegendItem; 8 | class QwtLegend; 9 | 10 | class Plot: public QwtPlot 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Plot( QWidget *parent = NULL ); 16 | virtual ~Plot(); 17 | 18 | public Q_SLOTS: 19 | void applySettings( const Settings & ); 20 | 21 | public: 22 | virtual void replot(); 23 | 24 | private: 25 | void insertCurve(); 26 | 27 | QwtLegend *d_externalLegend; 28 | LegendItem *d_legendItem; 29 | bool d_isDirty; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /UI/qwt/examples/legends/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETTINGS_ 2 | #define _SETTINGS_ 3 | 4 | #include 5 | 6 | class Settings 7 | { 8 | public: 9 | Settings() 10 | { 11 | legend.isEnabled = false; 12 | legend.position = 0; 13 | 14 | legendItem.isEnabled = false; 15 | legendItem.numColumns = 0; 16 | legendItem.alignment = 0; 17 | legendItem.backgroundMode = 0; 18 | legendItem.size = 12; 19 | 20 | curve.numCurves = 0; 21 | curve.title = "Curve"; 22 | } 23 | 24 | struct 25 | { 26 | bool isEnabled; 27 | int position; 28 | } legend; 29 | 30 | struct 31 | { 32 | bool isEnabled; 33 | int numColumns; 34 | int alignment; 35 | int backgroundMode; 36 | int size; 37 | 38 | } legendItem; 39 | 40 | struct 41 | { 42 | int numCurves; 43 | QString title; 44 | } curve; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /UI/qwt/examples/oscilloscope/curvedata.cpp: -------------------------------------------------------------------------------- 1 | #include "curvedata.h" 2 | #include "signaldata.h" 3 | 4 | const SignalData &CurveData::values() const 5 | { 6 | return SignalData::instance(); 7 | } 8 | 9 | SignalData &CurveData::values() 10 | { 11 | return SignalData::instance(); 12 | } 13 | 14 | QPointF CurveData::sample( size_t i ) const 15 | { 16 | return SignalData::instance().value( i ); 17 | } 18 | 19 | size_t CurveData::size() const 20 | { 21 | return SignalData::instance().size(); 22 | } 23 | 24 | QRectF CurveData::boundingRect() const 25 | { 26 | return SignalData::instance().boundingRect(); 27 | } 28 | -------------------------------------------------------------------------------- /UI/qwt/examples/oscilloscope/curvedata.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class SignalData; 5 | 6 | class CurveData: public QwtSeriesData 7 | { 8 | public: 9 | const SignalData &values() const; 10 | SignalData &values(); 11 | 12 | virtual QPointF sample( size_t i ) const; 13 | virtual size_t size() const; 14 | 15 | virtual QRectF boundingRect() const; 16 | }; 17 | -------------------------------------------------------------------------------- /UI/qwt/examples/oscilloscope/knob.h: -------------------------------------------------------------------------------- 1 | #ifndef _KNOB_H_ 2 | #define _KNOB_H_ 3 | 4 | #include 5 | 6 | class QwtKnob; 7 | class QLabel; 8 | 9 | class Knob: public QWidget 10 | { 11 | Q_OBJECT 12 | 13 | Q_PROPERTY( QColor theme READ theme WRITE setTheme ) 14 | 15 | public: 16 | Knob( const QString &title, 17 | double min, double max, QWidget *parent = NULL ); 18 | 19 | virtual QSize sizeHint() const; 20 | 21 | void setValue( double value ); 22 | double value() const; 23 | 24 | void setTheme( const QColor & ); 25 | QColor theme() const; 26 | 27 | Q_SIGNALS: 28 | double valueChanged( double ); 29 | 30 | protected: 31 | virtual void resizeEvent( QResizeEvent * ); 32 | 33 | private: 34 | QwtKnob *d_knob; 35 | QLabel *d_label; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /UI/qwt/examples/oscilloscope/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | #include "samplingthread.h" 4 | 5 | int main( int argc, char **argv ) 6 | { 7 | QApplication app( argc, argv ); 8 | app.setPalette( Qt::darkGray ); 9 | 10 | MainWindow window; 11 | window.resize( 800, 400 ); 12 | 13 | SamplingThread samplingThread; 14 | samplingThread.setFrequency( window.frequency() ); 15 | samplingThread.setAmplitude( window.amplitude() ); 16 | samplingThread.setInterval( window.signalInterval() ); 17 | 18 | window.connect( &window, SIGNAL( frequencyChanged( double ) ), 19 | &samplingThread, SLOT( setFrequency( double ) ) ); 20 | window.connect( &window, SIGNAL( amplitudeChanged( double ) ), 21 | &samplingThread, SLOT( setAmplitude( double ) ) ); 22 | window.connect( &window, SIGNAL( signalIntervalChanged( double ) ), 23 | &samplingThread, SLOT( setInterval( double ) ) ); 24 | 25 | window.show(); 26 | 27 | samplingThread.start(); 28 | window.start(); 29 | 30 | bool ok = app.exec(); 31 | 32 | samplingThread.stop(); 33 | samplingThread.wait( 1000 ); 34 | 35 | return ok; 36 | } 37 | -------------------------------------------------------------------------------- /UI/qwt/examples/oscilloscope/mainwindow.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class Plot; 4 | class Knob; 5 | class WheelBox; 6 | 7 | class MainWindow : public QWidget 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | MainWindow( QWidget * = NULL ); 13 | 14 | void start(); 15 | 16 | double amplitude() const; 17 | double frequency() const; 18 | double signalInterval() const; 19 | 20 | Q_SIGNALS: 21 | void amplitudeChanged( double ); 22 | void frequencyChanged( double ); 23 | void signalIntervalChanged( double ); 24 | 25 | private: 26 | Knob *d_frequencyKnob; 27 | Knob *d_amplitudeKnob; 28 | WheelBox *d_timerWheel; 29 | WheelBox *d_intervalWheel; 30 | 31 | Plot *d_plot; 32 | }; 33 | -------------------------------------------------------------------------------- /UI/qwt/examples/oscilloscope/osci.css: -------------------------------------------------------------------------------- 1 | MainWindow 2 | { 3 | border: 1px solid white; 4 | border-radius: 20px; 5 | padding: 10px; 6 | background-color: qlineargradient( x1: 0, y1: 0, x2: 1, y2: 1, 7 | stop: 0 #31312C, stop: 0.5 #808080 stop: 1 #31312C ); 8 | } 9 | 10 | QwtPlotCanvas 11 | { 12 | border: 1px solid White; 13 | border-radius: 10px; 14 | background-color: #101010; 15 | color: yellow; /* used as curve color */ 16 | } 17 | 18 | QwtScaleWidget 19 | { 20 | color: white; 21 | } 22 | 23 | WheelBox 24 | { 25 | qproperty-theme: #878787; 26 | } 27 | 28 | QwtWheel 29 | { 30 | /* background-color: yellow; */ 31 | qproperty-mass: 0.0; 32 | qproperty-tickCount: 5; 33 | qproperty-wheelWidth: 15; 34 | qproperty-borderWidth: 2; 35 | qproperty-wheelBorderWidth: 2; 36 | qproperty-wrapping: true; 37 | } 38 | 39 | Knob 40 | { 41 | qproperty-theme: #606060; 42 | } 43 | 44 | QwtKnob 45 | { 46 | qproperty-knobStyle: Sunken; 47 | qproperty-markerStyle: Nub; 48 | qproperty-markerSize: 8; 49 | qproperty-borderWidth: 2; 50 | } 51 | 52 | QLCDNumber 53 | { 54 | color: yellow; 55 | } 56 | -------------------------------------------------------------------------------- /UI/qwt/examples/oscilloscope/oscilloscope.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = oscilloscope 13 | 14 | HEADERS = \ 15 | signaldata.h \ 16 | plot.h \ 17 | knob.h \ 18 | wheelbox.h \ 19 | samplingthread.h \ 20 | curvedata.h \ 21 | mainwindow.h 22 | 23 | SOURCES = \ 24 | signaldata.cpp \ 25 | plot.cpp \ 26 | knob.cpp \ 27 | wheelbox.cpp \ 28 | samplingthread.cpp \ 29 | curvedata.cpp \ 30 | mainwindow.cpp \ 31 | main.cpp 32 | -------------------------------------------------------------------------------- /UI/qwt/examples/oscilloscope/plot.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | class QwtPlotCurve; 6 | class QwtPlotMarker; 7 | class QwtPlotDirectPainter; 8 | 9 | class Plot: public QwtPlot 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | Plot( QWidget * = NULL ); 15 | virtual ~Plot(); 16 | 17 | void start(); 18 | virtual void replot(); 19 | 20 | virtual bool eventFilter( QObject *, QEvent * ); 21 | 22 | public Q_SLOTS: 23 | void setIntervalLength( double ); 24 | 25 | protected: 26 | virtual void showEvent( QShowEvent * ); 27 | virtual void resizeEvent( QResizeEvent * ); 28 | virtual void timerEvent( QTimerEvent * ); 29 | 30 | private: 31 | void updateCurve(); 32 | void incrementInterval(); 33 | 34 | QwtPlotMarker *d_origin; 35 | QwtPlotCurve *d_curve; 36 | int d_paintedPoints; 37 | 38 | QwtPlotDirectPainter *d_directPainter; 39 | 40 | QwtInterval d_interval; 41 | int d_timerId; 42 | 43 | QwtSystemClock d_clock; 44 | }; 45 | -------------------------------------------------------------------------------- /UI/qwt/examples/oscilloscope/samplingthread.cpp: -------------------------------------------------------------------------------- 1 | #include "samplingthread.h" 2 | #include "signaldata.h" 3 | #include 4 | #include 5 | 6 | #if QT_VERSION < 0x040600 7 | #define qFastSin(x) ::sin(x) 8 | #endif 9 | 10 | SamplingThread::SamplingThread( QObject *parent ): 11 | QwtSamplingThread( parent ), 12 | d_frequency( 5.0 ), 13 | d_amplitude( 20.0 ) 14 | { 15 | } 16 | 17 | void SamplingThread::setFrequency( double frequency ) 18 | { 19 | d_frequency = frequency; 20 | } 21 | 22 | double SamplingThread::frequency() const 23 | { 24 | return d_frequency; 25 | } 26 | 27 | void SamplingThread::setAmplitude( double amplitude ) 28 | { 29 | d_amplitude = amplitude; 30 | } 31 | 32 | double SamplingThread::amplitude() const 33 | { 34 | return d_amplitude; 35 | } 36 | 37 | void SamplingThread::sample( double elapsed ) 38 | { 39 | if ( d_frequency > 0.0 ) 40 | { 41 | const QPointF s( elapsed, value( elapsed ) ); 42 | SignalData::instance().append( s ); 43 | } 44 | } 45 | 46 | double SamplingThread::value( double timeStamp ) const 47 | { 48 | const double period = 1.0 / d_frequency; 49 | 50 | const double x = ::fmod( timeStamp, period ); 51 | const double v = d_amplitude * qFastSin( x / period * 2 * M_PI ); 52 | 53 | return v; 54 | } 55 | -------------------------------------------------------------------------------- /UI/qwt/examples/oscilloscope/samplingthread.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class SamplingThread: public QwtSamplingThread 4 | { 5 | Q_OBJECT 6 | 7 | public: 8 | SamplingThread( QObject *parent = NULL ); 9 | 10 | double frequency() const; 11 | double amplitude() const; 12 | 13 | public Q_SLOTS: 14 | void setAmplitude( double ); 15 | void setFrequency( double ); 16 | 17 | protected: 18 | virtual void sample( double elapsed ); 19 | 20 | private: 21 | virtual double value( double timeStamp ) const; 22 | 23 | double d_frequency; 24 | double d_amplitude; 25 | }; 26 | -------------------------------------------------------------------------------- /UI/qwt/examples/oscilloscope/signaldata.h: -------------------------------------------------------------------------------- 1 | #ifndef _SIGNAL_DATA_H_ 2 | #define _SIGNAL_DATA_H_ 1 3 | 4 | #include 5 | 6 | class SignalData 7 | { 8 | public: 9 | static SignalData &instance(); 10 | 11 | void append( const QPointF &pos ); 12 | void clearStaleValues( double min ); 13 | 14 | int size() const; 15 | QPointF value( int index ) const; 16 | 17 | QRectF boundingRect() const; 18 | 19 | void lock(); 20 | void unlock(); 21 | 22 | private: 23 | SignalData(); 24 | SignalData( const SignalData & ); 25 | SignalData &operator=( const SignalData & ); 26 | 27 | virtual ~SignalData(); 28 | 29 | class PrivateData; 30 | PrivateData *d_data; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /UI/qwt/examples/oscilloscope/wheelbox.h: -------------------------------------------------------------------------------- 1 | #ifndef _WHEELBOX_H_ 2 | #define _WHEELBOX_H_ 3 | 4 | #include 5 | 6 | class QwtWheel; 7 | class QLabel; 8 | class QLCDNumber; 9 | 10 | class WheelBox: public QWidget 11 | { 12 | Q_OBJECT 13 | Q_PROPERTY( QColor theme READ theme WRITE setTheme ) 14 | 15 | public: 16 | WheelBox( const QString &title, 17 | double min, double max, double stepSize, 18 | QWidget *parent = NULL ); 19 | 20 | void setTheme( const QColor & ); 21 | QColor theme() const; 22 | 23 | void setUnit( const QString & ); 24 | QString unit() const; 25 | 26 | void setValue( double value ); 27 | double value() const; 28 | 29 | Q_SIGNALS: 30 | double valueChanged( double ); 31 | 32 | private: 33 | QLCDNumber *d_number; 34 | QwtWheel *d_wheel; 35 | QLabel *d_label; 36 | 37 | QString d_unit; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /UI/qwt/examples/radio/ampfrm.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class Knob; 4 | class Thermo; 5 | 6 | class AmpFrame : public QFrame 7 | { 8 | Q_OBJECT 9 | public: 10 | AmpFrame( QWidget * ); 11 | 12 | public Q_SLOTS: 13 | void setMaster( double v ); 14 | 15 | protected: 16 | void timerEvent( QTimerEvent * ); 17 | 18 | private: 19 | Knob *d_knbVolume; 20 | Knob *d_knbBalance; 21 | Knob *d_knbTreble; 22 | Knob *d_knbBass; 23 | Thermo *d_thmLeft; 24 | Thermo *d_thmRight; 25 | double d_master; 26 | }; 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /UI/qwt/examples/radio/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "tunerfrm.h" 3 | #include "ampfrm.h" 4 | #include "mainwindow.h" 5 | 6 | MainWindow::MainWindow(): 7 | QWidget() 8 | { 9 | TunerFrame *frmTuner = new TunerFrame( this ); 10 | frmTuner->setFrameStyle( QFrame::Panel | QFrame::Raised ); 11 | 12 | AmpFrame *frmAmp = new AmpFrame( this ); 13 | frmAmp->setFrameStyle( QFrame::Panel | QFrame::Raised ); 14 | 15 | QVBoxLayout *layout = new QVBoxLayout( this ); 16 | layout->setMargin( 0 ); 17 | layout->setSpacing( 0 ); 18 | layout->addWidget( frmTuner ); 19 | layout->addWidget( frmAmp ); 20 | 21 | connect( frmTuner, SIGNAL( fieldChanged( double ) ), 22 | frmAmp, SLOT( setMaster( double ) ) ); 23 | 24 | frmTuner->setFreq( 90.0 ); 25 | 26 | setPalette( QPalette( QColor( 192, 192, 192 ) ) ); 27 | updateGradient(); 28 | } 29 | 30 | void MainWindow::resizeEvent( QResizeEvent * ) 31 | { 32 | // Qt 4.7.1: QGradient::StretchToDeviceMode is buggy on X11 33 | updateGradient(); 34 | } 35 | 36 | void MainWindow::updateGradient() 37 | { 38 | QPalette pal = palette(); 39 | 40 | const QColor buttonColor = pal.color( QPalette::Button ); 41 | const QColor midLightColor = pal.color( QPalette::Midlight ); 42 | 43 | QLinearGradient gradient( rect().topLeft(), rect().topRight() ); 44 | gradient.setColorAt( 0.0, midLightColor ); 45 | gradient.setColorAt( 0.7, buttonColor ); 46 | gradient.setColorAt( 1.0, buttonColor ); 47 | 48 | pal.setBrush( QPalette::Window, gradient ); 49 | setPalette( pal ); 50 | } 51 | -------------------------------------------------------------------------------- /UI/qwt/examples/radio/mainwindow.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class MainWindow : public QWidget 4 | { 5 | public: 6 | MainWindow(); 7 | 8 | protected: 9 | virtual void resizeEvent( QResizeEvent * ); 10 | 11 | private: 12 | void updateGradient(); 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /UI/qwt/examples/radio/radio.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | 4 | int main ( int argc, char **argv ) 5 | { 6 | QApplication a( argc, argv ); 7 | 8 | MainWindow w; 9 | w.show(); 10 | 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /UI/qwt/examples/radio/radio.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = radio 13 | 14 | HEADERS = \ 15 | mainwindow.h \ 16 | ampfrm.h \ 17 | tunerfrm.h 18 | 19 | SOURCES = \ 20 | mainwindow.cpp \ 21 | ampfrm.cpp \ 22 | tunerfrm.cpp \ 23 | radio.cpp 24 | -------------------------------------------------------------------------------- /UI/qwt/examples/radio/tunerfrm.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class QwtWheel; 4 | class QwtSlider; 5 | class TuningThermo; 6 | 7 | class TunerFrame : public QFrame 8 | { 9 | Q_OBJECT 10 | public: 11 | TunerFrame( QWidget *p ); 12 | 13 | Q_SIGNALS: 14 | void fieldChanged( double f ); 15 | 16 | public Q_SLOTS: 17 | void setFreq( double frq ); 18 | 19 | private Q_SLOTS: 20 | void adjustFreq( double frq ); 21 | 22 | private: 23 | QwtWheel *d_wheelFrequency; 24 | TuningThermo *d_thermoTune; 25 | QwtSlider *d_sliderFrequency; 26 | }; 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /UI/qwt/examples/rasterview/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "plot.h" 8 | 9 | class MainWindow: public QMainWindow 10 | { 11 | public: 12 | MainWindow( QWidget * = NULL ); 13 | }; 14 | 15 | MainWindow::MainWindow( QWidget *parent ): 16 | QMainWindow( parent ) 17 | { 18 | Plot *plot = new Plot( this ); 19 | setCentralWidget( plot ); 20 | 21 | QToolBar *toolBar = new QToolBar( this ); 22 | 23 | QComboBox *rasterBox = new QComboBox( toolBar ); 24 | rasterBox->addItem( "Wikipedia" ); 25 | 26 | toolBar->addWidget( new QLabel( "Data ", toolBar ) ); 27 | toolBar->addWidget( rasterBox ); 28 | toolBar->addSeparator(); 29 | 30 | QComboBox *modeBox = new QComboBox( toolBar ); 31 | modeBox->addItem( "Nearest Neighbour" ); 32 | modeBox->addItem( "Bilinear Interpolation" ); 33 | 34 | toolBar->addWidget( new QLabel( "Resampling ", toolBar ) ); 35 | toolBar->addWidget( modeBox ); 36 | 37 | toolBar->addSeparator(); 38 | 39 | QToolButton *btnExport = new QToolButton( toolBar ); 40 | btnExport->setText( "Export" ); 41 | btnExport->setToolButtonStyle( Qt::ToolButtonTextUnderIcon ); 42 | toolBar->addWidget( btnExport ); 43 | 44 | addToolBar( toolBar ); 45 | 46 | connect( modeBox, SIGNAL( activated( int ) ), plot, SLOT( setResampleMode( int ) ) ); 47 | connect( btnExport, SIGNAL( clicked() ), plot, SLOT( exportPlot() ) ); 48 | } 49 | 50 | int main( int argc, char **argv ) 51 | { 52 | QApplication a( argc, argv ); 53 | 54 | MainWindow mainWindow; 55 | mainWindow.resize( 600, 400 ); 56 | mainWindow.show(); 57 | 58 | return a.exec(); 59 | } 60 | -------------------------------------------------------------------------------- /UI/qwt/examples/rasterview/plot.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class Plot: public QwtPlot 5 | { 6 | Q_OBJECT 7 | 8 | public: 9 | Plot( QWidget * = NULL ); 10 | 11 | public Q_SLOTS: 12 | void exportPlot(); 13 | void setResampleMode( int ); 14 | 15 | private: 16 | QwtPlotSpectrogram *d_spectrogram; 17 | }; 18 | -------------------------------------------------------------------------------- /UI/qwt/examples/rasterview/rasterview.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = rasterview 13 | 14 | HEADERS = \ 15 | plot.h 16 | 17 | SOURCES = \ 18 | plot.cpp \ 19 | main.cpp 20 | -------------------------------------------------------------------------------- /UI/qwt/examples/realtime/README: -------------------------------------------------------------------------------- 1 | 1) Incremental plots 2 | 3 | IncrementalPlot shows an example how to implement a plot that 4 | displays growing data. 5 | 6 | The example produces random data when you push the start button. 7 | With 'Timer' you can adjust the intervall between the 8 | the generation of the points, with 'Points' you can set the number 9 | of points to be generated. 10 | 11 | Unfortunately in Qt4 incremental painting is not possible with QPaintEngines 12 | that doesn't support the QPaintEngine::PaintOutsidePaintEvent feature. 13 | ( These are all common paint engines beside the OpenGL engine, but this one 14 | is not supported by Qwt yet. ) 15 | That is the reason why you can see much faster repaints with Qt3. 16 | 17 | 2) Stacked Zooming with scrollbars 18 | 19 | ScrollZoomer adds scrollbars for zooming. There are a couple of 20 | reasons why the implementation is a hack and therefore the class 21 | is not part of the Qwt lib, but it should be working with all 22 | types of QwtPlots. Copy the code of scrollbar.[h|cpp] and 23 | scrollzoomer.[h|cpp] to the application code. 24 | 25 | Uwe 26 | -------------------------------------------------------------------------------- /UI/qwt/examples/realtime/clear.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char *clear_xpm[] = { 3 | /* width height num_colors chars_per_pixel */ 4 | " 32 32 12 1", 5 | /* colors */ 6 | ". c #000000", 7 | "# c #004040", 8 | "a c #303030", 9 | "b c #400000", 10 | "c c #404000", 11 | "d c #585858", 12 | "e c #808080", 13 | "f c #a0a0a4", 14 | "g c #bdbdbd", 15 | "h c #c0c0c0", 16 | "i c #dcdcdc", 17 | "j c #ffffff", 18 | /* pixels */ 19 | "gggggggggggggggggggggggggggggggg", 20 | "gggggggggggggg..gggggggggggggggg", 21 | "gggggggggg....ficggggggggggggggg", 22 | "ggggggg...fdad#ai......ggggggggg", 23 | "gggg...fhjjidfbc#f.fffe...gggggg", 24 | "ggg.fhjjjjihc#dhef.fhhhffe.ggggg", 25 | "ggg.#jjjjjihhhhhe..ehhhfff.ggggg", 26 | "ggg.#dffjjjjiihhcadehhfddd.ggggg", 27 | "ggg.iiiffhfjjjjjhhhfdddddd.ggggg", 28 | "ggg.#fjjiiffeeeeddddeeeddd.ggggg", 29 | "gggg.#eeiiiiifffffffeee...gggggg", 30 | "gggg.ffffffiifffffffddddd.gggggg", 31 | "gggg.fffjfffeeeeddddeed.d.gggggg", 32 | "gggg.fefiiiifhffeeeeded.d.gggggg", 33 | "gggg.fefijhfhifefff.ded.d.gggggg", 34 | "gggg.fefijeffifeefe.ded.d.gggggg", 35 | "gggg.fefijeffifeefe.ded.d.gggggg", 36 | "gggg.fefijeffifeefe.ded.d.gggggg", 37 | "gggg.fefijeffifeefe.ded.d.gggggg", 38 | "gggg.fefijeffifeefe.ded.d.gggggg", 39 | "gggg.fefijeffifeefe.ded.d.gggggg", 40 | "gggg.fefijeffifeefe.ded.d.gggggg", 41 | "gggg.fefijeffifeefe.ded.d.gggggg", 42 | "gggg.fefijeffifeefe.ded.d.gggggg", 43 | "gggg.fefijeffifeefe.ded.d.gggggg", 44 | "gggg.fefijeffifeefe.ded.d.gggggg", 45 | "gggg.fffijeffifeefe.deddd.gggggg", 46 | "gggg.ffiijeffifeefeddedd#.gggggg", 47 | "gggg.eiijjjeiifdffedded#..gggggg", 48 | "ggggg..fjjiiiiffffedddd..ggggggg", 49 | "ggggggg...fhhfffffdd...ggggggggg", 50 | "gggggggggg..........gggggggggggg" 51 | }; 52 | -------------------------------------------------------------------------------- /UI/qwt/examples/realtime/incrementalplot.h: -------------------------------------------------------------------------------- 1 | #ifndef _INCREMENTALPLOT_H_ 2 | #define _INCREMENTALPLOT_H_ 1 3 | 4 | #include 5 | 6 | class QwtPlotCurve; 7 | class QwtPlotDirectPainter; 8 | 9 | class IncrementalPlot : public QwtPlot 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | IncrementalPlot( QWidget *parent = NULL ); 15 | virtual ~IncrementalPlot(); 16 | 17 | void appendPoint( const QPointF & ); 18 | void clearPoints(); 19 | 20 | public Q_SLOTS: 21 | void showSymbols( bool ); 22 | 23 | private: 24 | QwtPlotCurve *d_curve; 25 | QwtPlotDirectPainter *d_directPainter; 26 | }; 27 | 28 | #endif // _INCREMENTALPLOT_H_ 29 | -------------------------------------------------------------------------------- /UI/qwt/examples/realtime/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | 4 | int main( int argc, char **argv ) 5 | { 6 | QApplication a( argc, argv ); 7 | 8 | MainWindow w; 9 | w.show(); 10 | 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /UI/qwt/examples/realtime/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef _MAINWINDOW_H_ 2 | #define _MAINWINDOW_H_ 1 3 | 4 | #include 5 | #include 6 | 7 | class QSpinBox; 8 | class QPushButton; 9 | class RandomPlot; 10 | class Counter; 11 | class QCheckBox; 12 | 13 | class MainWindow: public QMainWindow 14 | { 15 | Q_OBJECT 16 | public: 17 | MainWindow(); 18 | 19 | private Q_SLOTS: 20 | void showRunning( bool ); 21 | void appendPoints( bool ); 22 | void showElapsed( int ); 23 | 24 | private: 25 | QToolBar *toolBar(); 26 | void initWhatsThis(); 27 | 28 | private: 29 | Counter *d_randomCount; 30 | Counter *d_timerCount; 31 | QCheckBox *d_symbolType; 32 | QAction *d_startAction; 33 | QAction *d_clearAction; 34 | RandomPlot *d_plot; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /UI/qwt/examples/realtime/randomplot.h: -------------------------------------------------------------------------------- 1 | #ifndef _RANDOMPLOT_H_ 2 | #define _RANDOMPLOT_H_ 1 3 | 4 | #include "incrementalplot.h" 5 | #include 6 | 7 | class QTimer; 8 | 9 | class RandomPlot: public IncrementalPlot 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | RandomPlot( QWidget *parent ); 15 | 16 | virtual QSize sizeHint() const; 17 | 18 | Q_SIGNALS: 19 | void running( bool ); 20 | void elapsed( int ms ); 21 | 22 | public Q_SLOTS: 23 | void clear(); 24 | void stop(); 25 | void append( int timeout, int count ); 26 | 27 | private Q_SLOTS: 28 | void appendPoint(); 29 | 30 | private: 31 | void initCurve(); 32 | 33 | QTimer *d_timer; 34 | int d_timerCount; 35 | 36 | QTime d_timeStamp; 37 | }; 38 | 39 | #endif // _RANDOMPLOT_H_ 40 | -------------------------------------------------------------------------------- /UI/qwt/examples/realtime/realtime.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = realtime 13 | 14 | HEADERS = \ 15 | mainwindow.h \ 16 | scrollzoomer.h \ 17 | scrollbar.h \ 18 | incrementalplot.h \ 19 | randomplot.h 20 | 21 | SOURCES = \ 22 | main.cpp \ 23 | mainwindow.cpp \ 24 | scrollzoomer.cpp \ 25 | scrollbar.cpp \ 26 | incrementalplot.cpp \ 27 | randomplot.cpp 28 | 29 | -------------------------------------------------------------------------------- /UI/qwt/examples/realtime/scrollbar.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCROLLBAR_H 2 | #define _SCROLLBAR_H 1 3 | 4 | #include 5 | 6 | class ScrollBar: public QScrollBar 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | ScrollBar( QWidget *parent = NULL ); 12 | ScrollBar( Qt::Orientation, QWidget *parent = NULL ); 13 | ScrollBar( double minBase, double maxBase, 14 | Qt::Orientation o, QWidget *parent = NULL ); 15 | 16 | void setInverted( bool ); 17 | bool isInverted() const; 18 | 19 | double minBaseValue() const; 20 | double maxBaseValue() const; 21 | 22 | double minSliderValue() const; 23 | double maxSliderValue() const; 24 | 25 | int extent() const; 26 | 27 | Q_SIGNALS: 28 | void sliderMoved( Qt::Orientation, double, double ); 29 | void valueChanged( Qt::Orientation, double, double ); 30 | 31 | public Q_SLOTS: 32 | virtual void setBase( double min, double max ); 33 | virtual void moveSlider( double min, double max ); 34 | 35 | protected: 36 | void sliderRange( int value, double &min, double &max ) const; 37 | int mapToTick( double ) const; 38 | double mapFromTick( int ) const; 39 | 40 | private Q_SLOTS: 41 | void catchValueChanged( int value ); 42 | void catchSliderMoved( int value ); 43 | 44 | private: 45 | void init(); 46 | 47 | bool d_inverted; 48 | double d_minBase; 49 | double d_maxBase; 50 | int d_baseTicks; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /UI/qwt/examples/realtime/scrollzoomer.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCROLLZOOMER_H 2 | #define _SCROLLZOOMER_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class ScrollData; 9 | class ScrollBar; 10 | 11 | class ScrollZoomer: public QwtPlotZoomer 12 | { 13 | Q_OBJECT 14 | public: 15 | enum ScrollBarPosition 16 | { 17 | AttachedToScale, 18 | OppositeToScale 19 | }; 20 | 21 | ScrollZoomer( QWidget * ); 22 | virtual ~ScrollZoomer(); 23 | 24 | ScrollBar *horizontalScrollBar() const; 25 | ScrollBar *verticalScrollBar() const; 26 | 27 | void setHScrollBarMode( Qt::ScrollBarPolicy ); 28 | void setVScrollBarMode( Qt::ScrollBarPolicy ); 29 | 30 | Qt::ScrollBarPolicy vScrollBarMode () const; 31 | Qt::ScrollBarPolicy hScrollBarMode () const; 32 | 33 | void setHScrollBarPosition( ScrollBarPosition ); 34 | void setVScrollBarPosition( ScrollBarPosition ); 35 | 36 | ScrollBarPosition hScrollBarPosition() const; 37 | ScrollBarPosition vScrollBarPosition() const; 38 | 39 | QWidget* cornerWidget() const; 40 | virtual void setCornerWidget( QWidget * ); 41 | 42 | virtual bool eventFilter( QObject *, QEvent * ); 43 | 44 | virtual void rescale(); 45 | 46 | protected: 47 | virtual ScrollBar *scrollBar( Qt::Orientation ); 48 | virtual void updateScrollBars(); 49 | virtual void layoutScrollBars( const QRect & ); 50 | 51 | private Q_SLOTS: 52 | void scrollBarMoved( Qt::Orientation o, double min, double max ); 53 | 54 | private: 55 | bool needScrollBar( Qt::Orientation ) const; 56 | int oppositeAxis( int ) const; 57 | 58 | QWidget *d_cornerWidget; 59 | 60 | ScrollData *d_hScrollData; 61 | ScrollData *d_vScrollData; 62 | 63 | bool d_inZoom; 64 | bool d_alignCanvasToScales[ QwtPlot::axisCnt ]; 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /UI/qwt/examples/refreshtest/circularbuffer.cpp: -------------------------------------------------------------------------------- 1 | #include "circularbuffer.h" 2 | #include 3 | 4 | CircularBuffer::CircularBuffer( double interval, size_t numPoints ): 5 | d_y( NULL ), 6 | d_referenceTime( 0.0 ), 7 | d_startIndex( 0 ), 8 | d_offset( 0.0 ) 9 | { 10 | fill( interval, numPoints ); 11 | } 12 | 13 | void CircularBuffer::fill( double interval, size_t numPoints ) 14 | { 15 | if ( interval <= 0.0 || numPoints < 2 ) 16 | return; 17 | 18 | d_values.resize( numPoints ); 19 | d_values.fill( 0.0 ); 20 | 21 | if ( d_y ) 22 | { 23 | d_step = interval / ( numPoints - 2 ); 24 | for ( size_t i = 0; i < numPoints; i++ ) 25 | d_values[i] = d_y( i * d_step ); 26 | } 27 | 28 | d_interval = interval; 29 | } 30 | 31 | void CircularBuffer::setFunction( double( *y )( double ) ) 32 | { 33 | d_y = y; 34 | } 35 | 36 | void CircularBuffer::setReferenceTime( double timeStamp ) 37 | { 38 | d_referenceTime = timeStamp; 39 | 40 | const double startTime = ::fmod( d_referenceTime, d_values.size() * d_step ); 41 | 42 | d_startIndex = int( startTime / d_step ); // floor 43 | d_offset = ::fmod( startTime, d_step ); 44 | } 45 | 46 | double CircularBuffer::referenceTime() const 47 | { 48 | return d_referenceTime; 49 | } 50 | 51 | size_t CircularBuffer::size() const 52 | { 53 | return d_values.size(); 54 | } 55 | 56 | QPointF CircularBuffer::sample( size_t i ) const 57 | { 58 | const int size = d_values.size(); 59 | 60 | int index = d_startIndex + i; 61 | if ( index >= size ) 62 | index -= size; 63 | 64 | const double x = i * d_step - d_offset - d_interval; 65 | const double y = d_values.data()[index]; 66 | 67 | return QPointF( x, y ); 68 | } 69 | 70 | QRectF CircularBuffer::boundingRect() const 71 | { 72 | return QRectF( -1.0, -d_interval, 2.0, d_interval ); 73 | } -------------------------------------------------------------------------------- /UI/qwt/examples/refreshtest/circularbuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef _CIRCULAR_BUFFER_H_ 2 | #define _CIRCULAR_BUFFER_H_ 3 | 4 | #include 5 | #include 6 | 7 | class CircularBuffer: public QwtSeriesData 8 | { 9 | public: 10 | CircularBuffer( double interval = 10.0, size_t numPoints = 1000 ); 11 | void fill( double interval, size_t numPoints ); 12 | 13 | void setReferenceTime( double ); 14 | double referenceTime() const; 15 | 16 | virtual size_t size() const; 17 | virtual QPointF sample( size_t i ) const; 18 | 19 | virtual QRectF boundingRect() const; 20 | 21 | void setFunction( double( *y )( double ) ); 22 | 23 | private: 24 | double ( *d_y )( double ); 25 | 26 | double d_referenceTime; 27 | double d_interval; 28 | QVector d_values; 29 | 30 | double d_step; 31 | int d_startIndex; 32 | double d_offset; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /UI/qwt/examples/refreshtest/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | #ifndef QWT_NO_OPENGL 5 | #if QT_VERSION >= 0x040600 && QT_VERSION < 0x050000 6 | #define USE_OPENGL 1 7 | #endif 8 | #endif 9 | 10 | #if USE_OPENGL 11 | #include 12 | #endif 13 | 14 | int main( int argc, char **argv ) 15 | { 16 | #if USE_OPENGL 17 | // on my box QPaintEngine::OpenGL2 has serious problems, f.e: 18 | // the lines of a simple drawRect are wrong. 19 | 20 | QGL::setPreferredPaintEngine( QPaintEngine::OpenGL ); 21 | #endif 22 | 23 | QApplication a( argc, argv ); 24 | 25 | MainWindow mainWindow; 26 | mainWindow.resize( 600, 400 ); 27 | mainWindow.show(); 28 | 29 | return a.exec(); 30 | } 31 | -------------------------------------------------------------------------------- /UI/qwt/examples/refreshtest/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "panel.h" 8 | #include "plot.h" 9 | #include "mainwindow.h" 10 | 11 | MainWindow::MainWindow( QWidget *parent ): 12 | QMainWindow( parent ) 13 | { 14 | QWidget *w = new QWidget( this ); 15 | 16 | d_panel = new Panel( w ); 17 | 18 | d_plot = new Plot( w ); 19 | 20 | QHBoxLayout *hLayout = new QHBoxLayout( w ); 21 | hLayout->addWidget( d_panel ); 22 | hLayout->addWidget( d_plot, 10 ); 23 | 24 | setCentralWidget( w ); 25 | 26 | d_frameCount = new QLabel( this ); 27 | statusBar()->addWidget( d_frameCount, 10 ); 28 | 29 | applySettings( d_panel->settings() ); 30 | 31 | connect( d_panel, SIGNAL( settingsChanged( const Settings & ) ), 32 | this, SLOT( applySettings( const Settings & ) ) ); 33 | } 34 | 35 | bool MainWindow::eventFilter( QObject *object, QEvent *event ) 36 | { 37 | if ( object == d_plot->canvas() && event->type() == QEvent::Paint ) 38 | { 39 | static int counter; 40 | static QTime timeStamp; 41 | 42 | if ( !timeStamp.isValid() ) 43 | { 44 | timeStamp.start(); 45 | counter = 0; 46 | } 47 | else 48 | { 49 | counter++; 50 | 51 | const double elapsed = timeStamp.elapsed() / 1000.0; 52 | if ( elapsed >= 1 ) 53 | { 54 | QString fps; 55 | fps.setNum( qRound( counter / elapsed ) ); 56 | fps += " Fps"; 57 | 58 | d_frameCount->setText( fps ); 59 | 60 | counter = 0; 61 | timeStamp.start(); 62 | } 63 | } 64 | } 65 | 66 | return QMainWindow::eventFilter( object, event ); 67 | } 68 | 69 | void MainWindow::applySettings( const Settings &settings ) 70 | { 71 | d_plot->setSettings( settings ); 72 | 73 | // the canvas might have been recreated 74 | d_plot->canvas()->removeEventFilter( this ); 75 | d_plot->canvas()->installEventFilter( this ); 76 | } 77 | -------------------------------------------------------------------------------- /UI/qwt/examples/refreshtest/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef _MAIN_WINDOW_H_ 2 | #define _MAIN_WINDOW_H_ 3 | 4 | #include 5 | 6 | class Plot; 7 | class Panel; 8 | class QLabel; 9 | class Settings; 10 | 11 | class MainWindow: public QMainWindow 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | MainWindow( QWidget *parent = NULL ); 17 | virtual bool eventFilter( QObject *, QEvent * ); 18 | 19 | private Q_SLOTS: 20 | void applySettings( const Settings & ); 21 | 22 | private: 23 | Plot *d_plot; 24 | Panel *d_panel; 25 | QLabel *d_frameCount; 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /UI/qwt/examples/refreshtest/panel.h: -------------------------------------------------------------------------------- 1 | #ifndef _PANEL_H_ 2 | #define _PANEL_H_ 1 3 | 4 | #include "settings.h" 5 | #include 6 | 7 | class QComboBox; 8 | class SpinBox; 9 | class CheckBox; 10 | 11 | class Panel: public QTabWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | Panel( QWidget * = NULL ); 17 | 18 | Settings settings() const; 19 | void setSettings( const Settings & ); 20 | 21 | Q_SIGNALS: 22 | void settingsChanged( const Settings & ); 23 | 24 | private Q_SLOTS: 25 | void edited(); 26 | 27 | private: 28 | QWidget *createPlotTab( QWidget * ); 29 | QWidget *createCanvasTab( QWidget * ); 30 | QWidget *createCurveTab( QWidget * ); 31 | 32 | SpinBox *d_numPoints; 33 | SpinBox *d_updateInterval; 34 | QComboBox *d_updateType; 35 | 36 | QComboBox *d_gridStyle; 37 | CheckBox *d_paintCache; 38 | CheckBox *d_paintOnScreen; 39 | CheckBox *d_immediatePaint; 40 | #ifndef QWT_NO_OPENGL 41 | CheckBox *d_openGL; 42 | #endif 43 | 44 | QComboBox *d_curveType; 45 | CheckBox *d_curveAntialiasing; 46 | CheckBox *d_curveClipping; 47 | CheckBox *d_curveFiltering; 48 | CheckBox *d_lineSplitting; 49 | SpinBox *d_curveWidth; 50 | QComboBox *d_curvePen; 51 | CheckBox *d_curveFilled; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /UI/qwt/examples/refreshtest/plot.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOT_H_ 2 | #define _PLOT_H_ 1 3 | 4 | #include 5 | #include 6 | #include "settings.h" 7 | 8 | class QwtPlotGrid; 9 | class QwtPlotCurve; 10 | 11 | class Plot: public QwtPlot 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | Plot( QWidget* = NULL ); 17 | 18 | public Q_SLOTS: 19 | void setSettings( const Settings & ); 20 | 21 | protected: 22 | virtual void timerEvent( QTimerEvent *e ); 23 | 24 | private: 25 | void alignScales(); 26 | 27 | QwtPlotGrid *d_grid; 28 | QwtPlotCurve *d_curve; 29 | 30 | QwtSystemClock d_clock; 31 | double d_interval; 32 | 33 | int d_timerId; 34 | 35 | Settings d_settings; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /UI/qwt/examples/refreshtest/refreshtest.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = refreshtest 13 | 14 | HEADERS = \ 15 | settings.h \ 16 | circularbuffer.h \ 17 | panel.h \ 18 | plot.h \ 19 | mainwindow.h 20 | 21 | SOURCES = \ 22 | circularbuffer.cpp \ 23 | panel.cpp \ 24 | plot.cpp \ 25 | mainwindow.cpp \ 26 | main.cpp 27 | 28 | -------------------------------------------------------------------------------- /UI/qwt/examples/refreshtest/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETTINGS_H_ 2 | #define _SETTINGS_H_ 3 | 4 | #include 5 | #include 6 | 7 | class Settings 8 | { 9 | public: 10 | enum FunctionType 11 | { 12 | NoFunction = -1, 13 | 14 | Wave, 15 | Noise 16 | }; 17 | 18 | enum UpdateType 19 | { 20 | RepaintCanvas, 21 | Replot 22 | }; 23 | 24 | Settings() 25 | { 26 | grid.pen = Qt::NoPen; 27 | grid.pen.setCosmetic( true ); 28 | 29 | curve.brush = Qt::NoBrush; 30 | curve.numPoints = 1000; 31 | curve.functionType = Wave; 32 | curve.paintAttributes = 0; 33 | curve.renderHint = 0; 34 | curve.lineSplitting = true; 35 | 36 | canvas.useBackingStore = false; 37 | canvas.paintOnScreen = false; 38 | canvas.immediatePaint = true; 39 | #ifndef QWT_NO_OPENGL 40 | canvas.openGL = false; 41 | #endif 42 | 43 | updateType = RepaintCanvas; 44 | updateInterval = 20; 45 | } 46 | 47 | struct gridSettings 48 | { 49 | QPen pen; 50 | } grid; 51 | 52 | struct curveSettings 53 | { 54 | QPen pen; 55 | QBrush brush; 56 | uint numPoints; 57 | FunctionType functionType; 58 | int paintAttributes; 59 | int renderHint; 60 | bool lineSplitting; 61 | } curve; 62 | 63 | struct canvasSettings 64 | { 65 | bool useBackingStore; 66 | bool paintOnScreen; 67 | bool immediatePaint; 68 | 69 | #ifndef QWT_NO_OPENGL 70 | bool openGL; 71 | #endif 72 | } canvas; 73 | 74 | UpdateType updateType; 75 | int updateInterval; 76 | }; 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /UI/qwt/examples/scatterplot/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | 4 | int main( int argc, char **argv ) 5 | { 6 | QApplication a( argc, argv ); 7 | 8 | MainWindow w; 9 | w.resize( 800, 600 ); 10 | w.show(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /UI/qwt/examples/scatterplot/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "plot.h" 3 | #include 4 | 5 | static double randomValue() 6 | { 7 | // a number between [ 0.0, 1.0 ] 8 | return ( qrand() % 100000 ) / 100000.0; 9 | } 10 | 11 | MainWindow::MainWindow() 12 | { 13 | d_plot = new Plot( this ); 14 | d_plot->setTitle( "Scatter Plot" ); 15 | setCentralWidget( d_plot ); 16 | 17 | // a million points 18 | setSamples( 100000 ); 19 | } 20 | 21 | void MainWindow::setSamples( int numPoints ) 22 | { 23 | QPolygonF samples; 24 | 25 | for ( int i = 0; i < numPoints; i++ ) 26 | { 27 | const double x = randomValue() * 24.0 + 1.0; 28 | const double y = ::log( 10.0 * ( x - 1.0 ) + 1.0 ) 29 | * ( randomValue() * 0.5 + 0.9 ); 30 | 31 | samples += QPointF( x, y ); 32 | } 33 | 34 | d_plot->setSamples( samples ); 35 | } 36 | -------------------------------------------------------------------------------- /UI/qwt/examples/scatterplot/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef _MAINWINDOW_H_ 2 | #define _MAINWINDOW_H_ 1 3 | 4 | #include 5 | 6 | class Plot; 7 | 8 | class MainWindow: public QMainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | MainWindow(); 14 | 15 | private: 16 | void setSamples( int samples ); 17 | 18 | private: 19 | Plot *d_plot; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /UI/qwt/examples/scatterplot/plot.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOT_H_ 2 | #define _PLOT_H_ 1 3 | 4 | #include 5 | 6 | class QwtPlotCurve; 7 | class QwtSymbol; 8 | 9 | class Plot : public QwtPlot 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | Plot( QWidget *parent = NULL ); 15 | 16 | void setSymbol( QwtSymbol * ); 17 | void setSamples( const QVector &samples ); 18 | 19 | private: 20 | QwtPlotCurve *d_curve; 21 | }; 22 | 23 | #endif // _PLOT_H_ 24 | -------------------------------------------------------------------------------- /UI/qwt/examples/scatterplot/scatterplot.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = scatterplot 13 | 14 | HEADERS = \ 15 | mainwindow.h \ 16 | plot.h 17 | 18 | SOURCES = \ 19 | main.cpp \ 20 | mainwindow.cpp \ 21 | plot.cpp 22 | 23 | -------------------------------------------------------------------------------- /UI/qwt/examples/simpleplot/simpleplot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int main( int argc, char **argv ) 9 | { 10 | QApplication a( argc, argv ); 11 | 12 | QwtPlot plot; 13 | plot.setTitle( "Plot Demo" ); 14 | plot.setCanvasBackground( Qt::white ); 15 | plot.setAxisScale( QwtPlot::yLeft, 0.0, 10.0 ); 16 | plot.insertLegend( new QwtLegend() ); 17 | 18 | QwtPlotGrid *grid = new QwtPlotGrid(); 19 | grid->attach( &plot ); 20 | 21 | QwtPlotCurve *curve = new QwtPlotCurve(); 22 | curve->setTitle( "Some Points" ); 23 | curve->setPen( Qt::blue, 4 ), 24 | curve->setRenderHint( QwtPlotItem::RenderAntialiased, true ); 25 | 26 | QwtSymbol *symbol = new QwtSymbol( QwtSymbol::Ellipse, 27 | QBrush( Qt::yellow ), QPen( Qt::red, 2 ), QSize( 8, 8 ) ); 28 | curve->setSymbol( symbol ); 29 | 30 | QPolygonF points; 31 | points << QPointF( 0.0, 4.4 ) << QPointF( 1.0, 3.0 ) 32 | << QPointF( 2.0, 4.5 ) << QPointF( 3.0, 6.8 ) 33 | << QPointF( 4.0, 7.9 ) << QPointF( 5.0, 7.1 ); 34 | curve->setSamples( points ); 35 | 36 | curve->attach( &plot ); 37 | 38 | plot.resize( 600, 400 ); 39 | plot.show(); 40 | 41 | return a.exec(); 42 | } 43 | -------------------------------------------------------------------------------- /UI/qwt/examples/simpleplot/simpleplot.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = simpleplot 13 | 14 | SOURCES = \ 15 | simpleplot.cpp 16 | 17 | -------------------------------------------------------------------------------- /UI/qwt/examples/sinusplot/sinusplot.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = sinusplot 13 | 14 | SOURCES = \ 15 | sinusplot.cpp 16 | 17 | -------------------------------------------------------------------------------- /UI/qwt/examples/spectrogram/plot.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class Plot: public QwtPlot 5 | { 6 | Q_OBJECT 7 | 8 | public: 9 | Plot( QWidget * = NULL ); 10 | 11 | public Q_SLOTS: 12 | void showContour( bool on ); 13 | void showSpectrogram( bool on ); 14 | void setAlpha( int ); 15 | 16 | #ifndef QT_NO_PRINTER 17 | void printPlot(); 18 | #endif 19 | 20 | private: 21 | QwtPlotSpectrogram *d_spectrogram; 22 | }; 23 | -------------------------------------------------------------------------------- /UI/qwt/examples/spectrogram/spectrogram.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = spectrogram 13 | 14 | HEADERS = \ 15 | plot.h 16 | 17 | SOURCES = \ 18 | plot.cpp \ 19 | main.cpp 20 | -------------------------------------------------------------------------------- /UI/qwt/examples/stockchart/griditem.h: -------------------------------------------------------------------------------- 1 | #ifndef _GRID_ITEM_H_ 2 | #define _GRID_ITEM_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class GridItem: public QwtPlotItem 9 | { 10 | public: 11 | enum GridAttribute 12 | { 13 | AutoUpdate = 0x01, 14 | FillCanvas = 0x02 15 | }; 16 | 17 | typedef QFlags GridAttributes; 18 | 19 | explicit GridItem(); 20 | virtual ~GridItem(); 21 | 22 | virtual int rtti() const; 23 | 24 | void setGridAttribute( GridAttribute, bool on = true ); 25 | bool testGridAttribute( GridAttribute ) const; 26 | 27 | void setOrientations( Qt::Orientations ); 28 | Qt::Orientations orientations() const; 29 | 30 | void enableXMin( bool ); 31 | bool isXMinEnabled() const; 32 | 33 | void enableYMin( bool ); 34 | bool isYMinEnabled() const; 35 | 36 | void setXDiv( const QwtScaleDiv &sx ); 37 | const QwtScaleDiv &xScaleDiv() const; 38 | 39 | void setYDiv( const QwtScaleDiv &sy ); 40 | const QwtScaleDiv &yScaleDiv() const; 41 | 42 | void setPalette( const QPalette & ); 43 | QPalette palette() const; 44 | 45 | virtual void draw( QPainter *p, 46 | const QwtScaleMap &xMap, const QwtScaleMap &yMap, 47 | const QRectF &rect ) const; 48 | 49 | virtual void updateScaleDiv( 50 | const QwtScaleDiv &xMap, const QwtScaleDiv &yMap ); 51 | 52 | protected: 53 | virtual QBrush brush( int row, int column, const QRectF & ) const; 54 | 55 | private: 56 | Qt::Orientations m_orientations; 57 | GridAttributes m_gridAttributes; 58 | 59 | QwtScaleDiv m_xScaleDiv; 60 | QwtScaleDiv m_yScaleDiv; 61 | 62 | bool m_isXMinEnabled; 63 | bool m_isYMinEnabled; 64 | 65 | QPalette m_palette; 66 | }; 67 | 68 | Q_DECLARE_OPERATORS_FOR_FLAGS( GridItem::GridAttributes ) 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /UI/qwt/examples/stockchart/legend.h: -------------------------------------------------------------------------------- 1 | #ifndef _LEGEND_H_ 2 | #define _LEGEND_H_ 3 | 4 | #include 5 | 6 | class LegendTreeView; 7 | class QStandardItem; 8 | class QModelIndex; 9 | class QwtPlotItem; 10 | 11 | class Legend : public QwtAbstractLegend 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit Legend( QWidget *parent = NULL ); 17 | virtual ~Legend(); 18 | 19 | virtual void renderLegend( QPainter *, 20 | const QRectF &, bool fillBackground ) const; 21 | 22 | virtual bool isEmpty() const; 23 | 24 | virtual int scrollExtent( Qt::Orientation ) const; 25 | 26 | Q_SIGNALS: 27 | void checked( QwtPlotItem *plotItem, bool on, int index ); 28 | 29 | public Q_SLOTS: 30 | virtual void updateLegend( const QVariant &, 31 | const QList & ); 32 | 33 | private Q_SLOTS: 34 | void handleClick( const QModelIndex & ); 35 | 36 | private: 37 | void updateItem( QStandardItem *, const QwtLegendData & ); 38 | 39 | LegendTreeView *d_treeView; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /UI/qwt/examples/stockchart/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "plot.h" 7 | 8 | class MainWindow: public QMainWindow 9 | { 10 | public: 11 | MainWindow( QWidget * = NULL ); 12 | 13 | private: 14 | Plot *d_plot; 15 | }; 16 | 17 | MainWindow::MainWindow( QWidget *parent ): 18 | QMainWindow( parent ) 19 | { 20 | d_plot = new Plot( this ); 21 | setCentralWidget( d_plot ); 22 | 23 | QToolBar *toolBar = new QToolBar( this ); 24 | 25 | QComboBox *typeBox = new QComboBox( toolBar ); 26 | typeBox->addItem( "Bars" ); 27 | typeBox->addItem( "CandleSticks" ); 28 | typeBox->setCurrentIndex( 1 ); 29 | typeBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); 30 | 31 | QToolButton *btnExport = new QToolButton( toolBar ); 32 | btnExport->setText( "Export" ); 33 | btnExport->setToolButtonStyle( Qt::ToolButtonTextUnderIcon ); 34 | connect( btnExport, SIGNAL( clicked() ), d_plot, SLOT( exportPlot() ) ); 35 | 36 | toolBar->addWidget( typeBox ); 37 | toolBar->addWidget( btnExport ); 38 | addToolBar( toolBar ); 39 | 40 | d_plot->setMode( typeBox->currentIndex() ); 41 | connect( typeBox, SIGNAL( currentIndexChanged( int ) ), 42 | d_plot, SLOT( setMode( int ) ) ); 43 | } 44 | 45 | int main( int argc, char **argv ) 46 | { 47 | QApplication a( argc, argv ); 48 | 49 | MainWindow w; 50 | w.resize( 600, 400 ); 51 | w.show(); 52 | 53 | return a.exec(); 54 | } 55 | -------------------------------------------------------------------------------- /UI/qwt/examples/stockchart/plot.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOT_H_ 2 | #define _PLOT_H_ 3 | 4 | #include 5 | 6 | class Plot: public QwtPlot 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Plot( QWidget * = NULL ); 12 | 13 | public Q_SLOTS: 14 | void setMode( int ); 15 | void exportPlot(); 16 | 17 | private Q_SLOTS: 18 | void showItem( QwtPlotItem *, bool on ); 19 | 20 | private: 21 | void populate(); 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /UI/qwt/examples/stockchart/quotefactory.h: -------------------------------------------------------------------------------- 1 | #ifndef _QUOTE_FACTORY_H_ 2 | #define _QUOTE_FACTORY_H_ 3 | 4 | #include 5 | 6 | class QuoteFactory 7 | { 8 | public: 9 | enum Stock 10 | { 11 | BMW, 12 | Daimler, 13 | Porsche, 14 | 15 | NumStocks 16 | }; 17 | 18 | static QVector samples2010( Stock ); 19 | static QString title( Stock ); 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /UI/qwt/examples/stockchart/stockchart.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = stockchart 13 | 14 | HEADERS = \ 15 | legend.h \ 16 | griditem.h \ 17 | plot.h \ 18 | quotefactory.h 19 | 20 | SOURCES = \ 21 | legend.cpp \ 22 | griditem.cpp \ 23 | quotefactory.cpp \ 24 | plot.cpp \ 25 | main.cpp 26 | -------------------------------------------------------------------------------- /UI/qwt/examples/stylesheets/blue.css: -------------------------------------------------------------------------------- 1 | QwtPlot 2 | { 3 | border: 1px solid white; 4 | border-radius: 10px; 5 | padding: 10px; 6 | background-color: qlineargradient( x1: 0, y1: 0, x2: 0, y2: 1, 7 | stop: 0 #657383, stop: 0.4 #8395AA, stop: 1 #657383 ); 8 | background-color: qlineargradient( x1: 0, y1: 0, x2: 0, y2: 1, 9 | stop: 0 #657383, stop: 1 #8395AA ); 10 | background-color: qlineargradient( x1: 0, y1: 0, x2: 1, y2: 1, 11 | stop: 0 #8395AA, stop: 1 #657383 ); 12 | background-color: qlineargradient( x1: 0, y1: 0, x2: 1, y2: 1, 13 | stop: 0 #8395AA, stop: 0.4 #657383 stop: 1 #8395AA ); 14 | background-color: qlineargradient( x1: 0, y1: 0, x2: 1, y2: 1, 15 | stop: 0 #7C8DA0, stop: 0.4 #657383 stop: 1 #7C8DA0 ); 16 | background-color: qlineargradient( x1: 0, y1: 0, x2: 1, y2: 1, 17 | stop: 0 #657383, stop: 0.25 #7C8DA0 stop: 0.55 #7C8DA0 stop: 1 #657383 ); 18 | background-color: qlineargradient( x1: 0, y1: 0, x2: 1, y2: 1, 19 | stop: 0 #8FA3B9, stop: 0.25 #7C8DA0 stop: 0.55 #7C8DA0 stop: 1 #8FA3B9 ); 20 | background-color: qlineargradient( x1: 0, y1: 0, x2: 1, y2: 1, 21 | stop: 0 #7C8DA0, stop: 0.4 #8FA3B9 stop: 0.55 #8FA3B9 stop: 1 #7C8DA0 ); 22 | background-color: qlineargradient( x1: 0, y1: 0, x2: 1, y2: 1, 23 | stop: 0 #7C8DA0, stop: 0.4 #8395AA stop: 0.55 #8395AA stop: 1 #7C8DA0 ); 24 | } 25 | 26 | QwtPlotCanvas 27 | { 28 | border: 1px solid white; 29 | border-radius: 10px; 30 | background-color: #616d7e; 31 | } 32 | 33 | QwtPlotGLCanvas 34 | { 35 | border: 1px solid white; 36 | background-color: #616d7e; 37 | } 38 | 39 | QwtScaleWidget 40 | { 41 | color: white; 42 | } 43 | 44 | QwtTextLabel#QwtPlotTitle 45 | { 46 | color: white; 47 | } 48 | 49 | QwtTextLabel#QwtPlotFooter 50 | { 51 | color: white; 52 | } 53 | 54 | QwtLegend 55 | { 56 | border: 1px solid white; 57 | border-radius: 10px; 58 | padding: 2px; 59 | background: #616d7e; 60 | } 61 | 62 | QwtLegendLabel 63 | { 64 | color: white; 65 | } 66 | 67 | -------------------------------------------------------------------------------- /UI/qwt/examples/stylesheets/choco.css: -------------------------------------------------------------------------------- 1 | QwtPlot 2 | { 3 | border: 1px solid white; 4 | border-radius: 10px; 5 | padding: 10px; 6 | background-color: qlineargradient( x1: 0, y1: 0, x2: 0, y2: 1, 7 | stop: 0 Brown, stop: 0.5 Chocolate, stop: 1 Brown ); 8 | } 9 | 10 | QwtPlotCanvas 11 | { 12 | border: 1px solid White; 13 | border-radius: 10px; 14 | background-color: Tan; 15 | } 16 | 17 | QwtPlotGLCanvas 18 | { 19 | border: 1px solid White; 20 | background-color: Tan; 21 | } 22 | 23 | QwtScaleWidget 24 | { 25 | color: white; 26 | } 27 | 28 | QwtTextLabel#QwtPlotTitle 29 | { 30 | color: white; 31 | } 32 | 33 | QwtTextLabel#QwtPlotFooter 34 | { 35 | color: white; 36 | } 37 | 38 | QwtLegend 39 | { 40 | border: 1px solid white; 41 | border-radius: 10px; 42 | padding: 2px; 43 | background: brown; 44 | } 45 | 46 | QwtLegendLabel 47 | { 48 | color: white; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /UI/qwt/examples/stylesheets/oily.css: -------------------------------------------------------------------------------- 1 | QwtPlot 2 | { 3 | border: 1px solid white; 4 | border-radius: 10px; 5 | padding: 10px; 6 | background-color: qlineargradient( x1: 0, y1: 0, x2: 1, y2: 1, 7 | stop: 0 #31312C, stop: 1 #808080 ); 8 | } 9 | 10 | QwtPlotCanvas 11 | { 12 | border: 1px solid White; 13 | border-radius: 10px; 14 | background-color: #101010; 15 | } 16 | 17 | QwtPlotGLCanvas 18 | { 19 | border: 1px solid White; 20 | background-color: #101010; 21 | } 22 | 23 | QwtScaleWidget 24 | { 25 | color: white; 26 | } 27 | 28 | QwtTextLabel#QwtPlotTitle 29 | { 30 | color: white; 31 | } 32 | 33 | QwtTextLabel#QwtPlotFooter 34 | { 35 | color: white; 36 | } 37 | 38 | QwtLegend 39 | { 40 | border: 1px solid white; 41 | border-radius: 10px; 42 | padding: 2px; 43 | background-color: qlineargradient( x1: 0, y1: 0, x2: 1, y2: 1, 44 | stop: 0 #808080, stop: 1 #31312C ); 45 | } 46 | 47 | QwtLegendLabel 48 | { 49 | color: white; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /UI/qwt/examples/stylesheets/rosy.css: -------------------------------------------------------------------------------- 1 | QwtPlot 2 | { 3 | border: 1px solid white; 4 | border-radius: 10px; 5 | padding: 10px; 6 | background-color: qlineargradient( x1: 0, y1: 0, x2: 0, y2: 1, 7 | stop: 0 #7e354d, stop: 0.5 #7f5a58, stop: 1 #7e354d ); 8 | } 9 | 10 | QwtPlotCanvas 11 | { 12 | border: 1px solid White; 13 | border-radius: 10px; 14 | background-color: #7f5a58; 15 | } 16 | 17 | QwtPlotGLCanvas 18 | { 19 | border: 1px solid White; 20 | background-color: #7f5a58; 21 | } 22 | 23 | QwtScaleWidget 24 | { 25 | color: white; 26 | } 27 | 28 | QwtTextLabel#QwtPlotTitle 29 | { 30 | color: white; 31 | } 32 | 33 | QwtTextLabel#QwtPlotFooter 34 | { 35 | color: white; 36 | } 37 | 38 | QwtLegend 39 | { 40 | border: 1px solid white; 41 | border-radius: 10px; 42 | padding: 2px; 43 | background: #7f5a58; 44 | } 45 | 46 | QwtLegendLabel 47 | { 48 | color: white; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /UI/qwt/examples/sysinfo/sysinfo.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = sysinfo 13 | 14 | SOURCES = \ 15 | sysinfo.cpp 16 | -------------------------------------------------------------------------------- /UI/qwt/examples/tvplot/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "tvplot.h" 7 | 8 | class MainWindow: public QMainWindow 9 | { 10 | public: 11 | MainWindow( QWidget * = NULL ); 12 | 13 | private: 14 | TVPlot *d_plot; 15 | }; 16 | 17 | MainWindow::MainWindow( QWidget *parent ): 18 | QMainWindow( parent ) 19 | { 20 | d_plot = new TVPlot( this ); 21 | setCentralWidget( d_plot ); 22 | 23 | QToolBar *toolBar = new QToolBar( this ); 24 | 25 | QComboBox *typeBox = new QComboBox( toolBar ); 26 | typeBox->addItem( "Outline" ); 27 | typeBox->addItem( "Columns" ); 28 | typeBox->addItem( "Lines" ); 29 | typeBox->addItem( "Column Symbol" ); 30 | typeBox->setCurrentIndex( typeBox->count() - 1 ); 31 | typeBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); 32 | 33 | QToolButton *btnExport = new QToolButton( toolBar ); 34 | btnExport->setText( "Export" ); 35 | btnExport->setToolButtonStyle( Qt::ToolButtonTextUnderIcon ); 36 | connect( btnExport, SIGNAL( clicked() ), d_plot, SLOT( exportPlot() ) ); 37 | 38 | toolBar->addWidget( typeBox ); 39 | toolBar->addWidget( btnExport ); 40 | addToolBar( toolBar ); 41 | 42 | d_plot->setMode( typeBox->currentIndex() ); 43 | connect( typeBox, SIGNAL( currentIndexChanged( int ) ), 44 | d_plot, SLOT( setMode( int ) ) ); 45 | } 46 | 47 | int main( int argc, char **argv ) 48 | { 49 | QApplication a( argc, argv ); 50 | 51 | MainWindow mainWindow; 52 | 53 | mainWindow.resize( 600, 400 ); 54 | mainWindow.show(); 55 | 56 | return a.exec(); 57 | } 58 | -------------------------------------------------------------------------------- /UI/qwt/examples/tvplot/tvplot.h: -------------------------------------------------------------------------------- 1 | #ifndef _TV_PLOT_H_ 2 | 3 | #include 4 | 5 | class TVPlot: public QwtPlot 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | TVPlot( QWidget * = NULL ); 11 | 12 | public Q_SLOTS: 13 | void setMode( int ); 14 | void exportPlot(); 15 | 16 | private: 17 | void populate(); 18 | 19 | private Q_SLOTS: 20 | void showItem( const QVariant &, bool on ); 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /UI/qwt/examples/tvplot/tvplot.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../examples.pri ) 11 | 12 | TARGET = tvplot 13 | 14 | SOURCES = \ 15 | tvplot.cpp \ 16 | main.cpp 17 | 18 | HEADERS = \ 19 | tvplot.h 20 | -------------------------------------------------------------------------------- /UI/qwt/lib/libqwt.so: -------------------------------------------------------------------------------- 1 | libqwt.so.6.1.1 -------------------------------------------------------------------------------- /UI/qwt/lib/libqwt.so.6: -------------------------------------------------------------------------------- 1 | libqwt.so.6.1.1 -------------------------------------------------------------------------------- /UI/qwt/lib/libqwt.so.6.1: -------------------------------------------------------------------------------- 1 | libqwt.so.6.1.1 -------------------------------------------------------------------------------- /UI/qwt/lib/libqwt.so.6.1.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/lib/libqwt.so.6.1.1 -------------------------------------------------------------------------------- /UI/qwt/lib/libqwtmathml.so: -------------------------------------------------------------------------------- 1 | libqwtmathml.so.6.1.1 -------------------------------------------------------------------------------- /UI/qwt/lib/libqwtmathml.so.6: -------------------------------------------------------------------------------- 1 | libqwtmathml.so.6.1.1 -------------------------------------------------------------------------------- /UI/qwt/lib/libqwtmathml.so.6.1: -------------------------------------------------------------------------------- 1 | libqwtmathml.so.6.1.1 -------------------------------------------------------------------------------- /UI/qwt/lib/libqwtmathml.so.6.1.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/lib/libqwtmathml.so.6.1.1 -------------------------------------------------------------------------------- /UI/qwt/playground/bin/curvetracker: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/playground/bin/curvetracker -------------------------------------------------------------------------------- /UI/qwt/playground/bin/graphicscale: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/playground/bin/graphicscale -------------------------------------------------------------------------------- /UI/qwt/playground/bin/plotmatrix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/playground/bin/plotmatrix -------------------------------------------------------------------------------- /UI/qwt/playground/bin/rescaler: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/playground/bin/rescaler -------------------------------------------------------------------------------- /UI/qwt/playground/bin/scaleengine: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/playground/bin/scaleengine -------------------------------------------------------------------------------- /UI/qwt/playground/bin/shapes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/playground/bin/shapes -------------------------------------------------------------------------------- /UI/qwt/playground/bin/svgmap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/playground/bin/svgmap -------------------------------------------------------------------------------- /UI/qwt/playground/bin/symbols: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/playground/bin/symbols -------------------------------------------------------------------------------- /UI/qwt/playground/bin/timescale: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/UI/qwt/playground/bin/timescale -------------------------------------------------------------------------------- /UI/qwt/playground/curvetracker/curvetracker.h: -------------------------------------------------------------------------------- 1 | #ifndef _CURVE_TRACKER_ 2 | #define _CURVE_TRACKER_H_ 3 | 4 | #include 5 | 6 | class QwtPlotCurve; 7 | 8 | class CurveTracker: public QwtPlotPicker 9 | { 10 | public: 11 | CurveTracker( QWidget * ); 12 | 13 | protected: 14 | virtual QwtText trackerTextF( const QPointF & ) const; 15 | virtual QRect trackerRect( const QFont & ) const; 16 | 17 | private: 18 | QString curveInfoAt( const QwtPlotCurve *, const QPointF & ) const; 19 | QLineF curveLineAt( const QwtPlotCurve *, double x ) const; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /UI/qwt/playground/curvetracker/curvetracker.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../playground.pri ) 11 | 12 | TARGET = curvetracker 13 | 14 | HEADERS = \ 15 | curvetracker.h \ 16 | plot.h 17 | 18 | SOURCES = \ 19 | curvetracker.cpp \ 20 | plot.cpp \ 21 | main.cpp 22 | 23 | -------------------------------------------------------------------------------- /UI/qwt/playground/curvetracker/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "plot.h" 3 | 4 | int main( int argc, char **argv ) 5 | { 6 | QApplication a( argc, argv ); 7 | 8 | Plot plot; 9 | plot.resize( 600, 400 ); 10 | plot.show(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /UI/qwt/playground/curvetracker/plot.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOT_H_ 2 | #define _PLOT_H_ 3 | 4 | #include 5 | 6 | class QPolygonF; 7 | 8 | class Plot: public QwtPlot 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Plot( QWidget * = NULL ); 14 | 15 | private: 16 | void insertCurve( const QString &title, 17 | const QColor &, const QPolygonF & ); 18 | }; 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /UI/qwt/playground/graphicscale/canvas.cpp: -------------------------------------------------------------------------------- 1 | #include "canvas.h" 2 | #include 3 | #include 4 | 5 | Canvas::Canvas( Mode mode, QWidget *parent ): 6 | QWidget( parent ), 7 | d_mode( mode ) 8 | { 9 | const int m = 10; 10 | setContentsMargins( m, m, m, m ); 11 | 12 | if ( d_mode == Svg ) 13 | d_renderer = new QSvgRenderer( this ); 14 | else 15 | d_graphic = new QwtGraphic(); 16 | } 17 | 18 | Canvas::~Canvas() 19 | { 20 | if ( d_mode == VectorGraphic ) 21 | delete d_graphic; 22 | } 23 | 24 | void Canvas::setSvg( const QByteArray &data ) 25 | { 26 | if ( d_mode == VectorGraphic ) 27 | { 28 | d_graphic->reset(); 29 | 30 | QSvgRenderer renderer; 31 | renderer.load( data ); 32 | 33 | QPainter p( d_graphic ); 34 | renderer.render( &p, renderer.viewBoxF() ); 35 | p.end(); 36 | } 37 | else 38 | { 39 | d_renderer->load( data ); 40 | } 41 | 42 | update(); 43 | } 44 | 45 | void Canvas::paintEvent( QPaintEvent * ) 46 | { 47 | QPainter painter( this ); 48 | 49 | painter.save(); 50 | 51 | painter.setPen( Qt::black ); 52 | painter.setBrush( Qt::white ); 53 | painter.drawRect( contentsRect().adjusted( 0, 0, -1, -1 ) ); 54 | 55 | painter.restore(); 56 | 57 | painter.setPen( Qt::NoPen ); 58 | painter.setBrush( Qt::NoBrush ); 59 | render( &painter, contentsRect() ); 60 | } 61 | 62 | void Canvas::render( QPainter *painter, const QRect &rect ) const 63 | { 64 | if ( d_mode == Svg ) 65 | { 66 | d_renderer->render( painter, rect ); 67 | } 68 | else 69 | { 70 | d_graphic->render( painter, rect ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /UI/qwt/playground/graphicscale/canvas.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class QByteArray; 4 | class QSvgRenderer; 5 | class QwtGraphic; 6 | 7 | class Canvas: public QWidget 8 | { 9 | public: 10 | enum Mode 11 | { 12 | Svg, 13 | VectorGraphic 14 | }; 15 | 16 | Canvas( Mode, QWidget *parent = NULL ); 17 | virtual ~Canvas(); 18 | 19 | void setSvg( const QByteArray & ); 20 | 21 | protected: 22 | virtual void paintEvent( QPaintEvent * ); 23 | 24 | private: 25 | void render( QPainter *, const QRect & ) const; 26 | 27 | const Mode d_mode; 28 | union 29 | { 30 | QSvgRenderer *d_renderer; 31 | QwtGraphic *d_graphic; 32 | }; 33 | }; 34 | -------------------------------------------------------------------------------- /UI/qwt/playground/graphicscale/graphicscale.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../playground.pri ) 11 | 12 | TARGET = graphicscale 13 | QT += svg 14 | 15 | HEADERS = \ 16 | canvas.h \ 17 | mainwindow.h 18 | 19 | SOURCES = \ 20 | canvas.cpp \ 21 | mainwindow.cpp \ 22 | main.cpp 23 | 24 | -------------------------------------------------------------------------------- /UI/qwt/playground/graphicscale/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | 4 | int main( int argc, char **argv ) 5 | { 6 | QApplication a( argc, argv ); 7 | 8 | MainWindow w; 9 | w.resize( 600, 400 ); 10 | w.show(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /UI/qwt/playground/graphicscale/mainwindow.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class Canvas; 4 | class QPainterPath; 5 | 6 | class MainWindow: public QMainWindow 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MainWindow(); 12 | virtual ~MainWindow(); 13 | 14 | private Q_SLOTS: 15 | void loadSVG(); 16 | 17 | private: 18 | void loadSVG( const QString & ); 19 | void loadPath( const QPainterPath & ); 20 | 21 | Canvas *d_canvas[2]; 22 | }; 23 | -------------------------------------------------------------------------------- /UI/qwt/playground/playground.pri: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################### 9 | 10 | QWT_ROOT = $${PWD}/.. 11 | include( $${QWT_ROOT}/qwtconfig.pri ) 12 | include( $${QWT_ROOT}/qwtbuild.pri ) 13 | include( $${QWT_ROOT}/qwtfunctions.pri ) 14 | 15 | TEMPLATE = app 16 | 17 | INCLUDEPATH += $${QWT_ROOT}/src 18 | DEPENDPATH += $${QWT_ROOT}/src 19 | 20 | !debug_and_release { 21 | 22 | DESTDIR = $${QWT_ROOT}/playground/bin 23 | } 24 | else { 25 | CONFIG(debug, debug|release) { 26 | 27 | DESTDIR = $${QWT_ROOT}/playground/bin_debug 28 | } 29 | else { 30 | 31 | DESTDIR = $${QWT_ROOT}/playground/bin 32 | } 33 | } 34 | 35 | 36 | QMAKE_RPATHDIR *= $${QWT_ROOT}/lib 37 | 38 | contains(QWT_CONFIG, QwtFramework) { 39 | 40 | LIBS += -F$${QWT_ROOT}/lib 41 | } 42 | else { 43 | 44 | LIBS += -L$${QWT_ROOT}/lib 45 | } 46 | 47 | qwtAddLibrary(qwt) 48 | 49 | greaterThan(QT_MAJOR_VERSION, 4) { 50 | 51 | QT += printsupport 52 | QT += concurrent 53 | } 54 | 55 | contains(QWT_CONFIG, QwtOpenGL ) { 56 | 57 | QT += opengl 58 | } 59 | else { 60 | 61 | DEFINES += QWT_NO_OPENGL 62 | } 63 | 64 | contains(QWT_CONFIG, QwtSvg) { 65 | 66 | QT += svg 67 | } 68 | else { 69 | 70 | DEFINES += QWT_NO_SVG 71 | } 72 | 73 | 74 | win32 { 75 | contains(QWT_CONFIG, QwtDll) { 76 | DEFINES += QT_DLL QWT_DLL 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /UI/qwt/playground/playground.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../qwtconfig.pri ) 11 | 12 | TEMPLATE = subdirs 13 | 14 | contains(QWT_CONFIG, QwtPlot) { 15 | 16 | SUBDIRS += \ 17 | plotmatrix \ 18 | timescale \ 19 | scaleengine \ 20 | graphicscale \ 21 | rescaler \ 22 | shapes \ 23 | curvetracker \ 24 | symbols 25 | 26 | contains(QWT_CONFIG, QwtSvg) { 27 | 28 | SUBDIRS += \ 29 | svgmap 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /UI/qwt/playground/plotmatrix/main.cpp: -------------------------------------------------------------------------------- 1 | #include "plotmatrix.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | class MainWindow: public PlotMatrix 9 | { 10 | public: 11 | MainWindow(); 12 | }; 13 | 14 | MainWindow::MainWindow(): 15 | PlotMatrix( 3, 4 ) 16 | { 17 | enableAxis( QwtPlot::yLeft ); 18 | enableAxis( QwtPlot::yRight ); 19 | enableAxis( QwtPlot::xBottom ); 20 | 21 | for ( int row = 0; row < numRows(); row++ ) 22 | { 23 | const double v = qPow( 10.0, row ); 24 | setAxisScale( QwtPlot::yLeft, row, -v, v ); 25 | setAxisScale( QwtPlot::yRight, row, -v, v ); 26 | } 27 | 28 | for ( int col = 0; col < numColumns(); col++ ) 29 | { 30 | const double v = qPow( 10.0, col ); 31 | setAxisScale( QwtPlot::xBottom, col, -v, v ); 32 | setAxisScale( QwtPlot::xTop, col, -v, v ); 33 | } 34 | 35 | for ( int row = 0; row < numRows(); row++ ) 36 | { 37 | for ( int col = 0; col < numColumns(); col++ ) 38 | { 39 | QwtPlot *plot = plotAt( row, col ); 40 | plot->setCanvasBackground( QColor( Qt::darkGray ) ); 41 | 42 | QwtPlotGrid *grid = new QwtPlotGrid(); 43 | grid->enableXMin( true ); 44 | grid->setMajorPen( Qt::white, 0, Qt::DotLine ); 45 | grid->setMinorPen( Qt::gray, 0 , Qt::DotLine ); 46 | grid->attach( plot ); 47 | } 48 | } 49 | 50 | plotAt( 1, 0 )->axisWidget( QwtPlot::yLeft )->setLabelRotation( 45 ); 51 | plotAt( 1, numColumns() - 1 )->axisWidget( QwtPlot::yRight )->setLabelRotation( -45 ); 52 | 53 | updateLayout(); 54 | } 55 | 56 | int main( int argc, char **argv ) 57 | { 58 | QApplication a( argc, argv ); 59 | 60 | MainWindow mainWindow; 61 | 62 | mainWindow.resize( 800, 600 ); 63 | mainWindow.show(); 64 | 65 | return a.exec(); 66 | } 67 | -------------------------------------------------------------------------------- /UI/qwt/playground/plotmatrix/plotmatrix.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOT_MATRIX_H_ 2 | #define _PLOT_MATRIX_H_ 3 | 4 | #include 5 | #include 6 | 7 | class PlotMatrix: public QFrame 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | PlotMatrix( int rows, int columns, QWidget * parent = NULL ); 13 | virtual ~PlotMatrix(); 14 | 15 | int numRows() const; 16 | int numColumns() const; 17 | 18 | QwtPlot* plotAt( int row, int column ); 19 | const QwtPlot* plotAt( int row, int column ) const; 20 | 21 | void enableAxis( int axisId, bool tf = true ); 22 | bool axisEnabled( int axisId ) const; 23 | 24 | void setAxisScale( int axisId, int rowOrColumn, 25 | double min, double max, double step = 0 ); 26 | 27 | protected: 28 | void updateLayout(); 29 | 30 | private Q_SLOTS: 31 | void scaleDivChanged(); 32 | 33 | private: 34 | void alignAxes( int rowOrColumn, int axis ); 35 | void alignScaleBorder( int rowOrColumn, int axis ); 36 | 37 | class PrivateData; 38 | PrivateData *d_data; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /UI/qwt/playground/plotmatrix/plotmatrix.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../playground.pri ) 11 | 12 | TARGET = plotmatrix 13 | 14 | HEADERS = \ 15 | plotmatrix.h 16 | 17 | SOURCES = \ 18 | plotmatrix.cpp \ 19 | main.cpp 20 | -------------------------------------------------------------------------------- /UI/qwt/playground/rescaler/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | 4 | int main( int argc, char **argv ) 5 | { 6 | QApplication a( argc, argv ); 7 | 8 | MainWindow mainWindow; 9 | 10 | mainWindow.resize( 800, 600 ); 11 | mainWindow.show(); 12 | 13 | return a.exec(); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /UI/qwt/playground/rescaler/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef _MAINWINDOW_H_ 2 | #define _MAINWINDOW_H_ 1 3 | 4 | #include 5 | 6 | class QwtPlotRescaler; 7 | class QLabel; 8 | class Plot; 9 | 10 | class MainWindow: public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | enum RescaleMode 16 | { 17 | KeepScales, 18 | Fixed, 19 | Expanding, 20 | Fitting 21 | }; 22 | 23 | MainWindow(); 24 | 25 | private Q_SLOTS: 26 | void setRescaleMode( int ); 27 | void showRatio( double, double ); 28 | 29 | private: 30 | QWidget *createPanel( QWidget * ); 31 | Plot *createPlot( QWidget * ); 32 | 33 | QwtPlotRescaler *d_rescaler; 34 | QLabel *d_rescaleInfo; 35 | 36 | Plot *d_plot; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /UI/qwt/playground/rescaler/plot.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOT_H_ 2 | #define _PLOT_H_ 1 3 | 4 | #include 5 | 6 | class RectItem; 7 | class QwtInterval; 8 | 9 | class Plot: public QwtPlot 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | Plot( QWidget *parent, const QwtInterval & ); 15 | virtual void updateLayout(); 16 | 17 | void setRectOfInterest( const QRectF & ); 18 | 19 | Q_SIGNALS: 20 | void resized( double xRatio, double yRatio ); 21 | 22 | private: 23 | RectItem *d_rectOfInterest; 24 | }; 25 | 26 | #endif 27 | 28 | 29 | -------------------------------------------------------------------------------- /UI/qwt/playground/rescaler/rescaler.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../playground.pri ) 11 | 12 | TARGET = rescaler 13 | 14 | HEADERS = \ 15 | mainwindow.h \ 16 | plot.h 17 | 18 | SOURCES = \ 19 | mainwindow.cpp \ 20 | plot.cpp \ 21 | main.cpp 22 | 23 | -------------------------------------------------------------------------------- /UI/qwt/playground/scaleengine/mainwindow.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class Plot; 4 | class TransformPlot; 5 | 6 | class MainWindow : public QMainWindow 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MainWindow( QWidget *parent = 0 ); 12 | 13 | private: 14 | Plot *d_plot; 15 | TransformPlot *d_transformPlot; 16 | }; 17 | -------------------------------------------------------------------------------- /UI/qwt/playground/scaleengine/plot.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOT_H_ 2 | #define _PLOT_H_ 3 | 4 | #include 5 | 6 | class QwtTransform; 7 | 8 | class Plot: public QwtPlot 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Plot( QWidget *parent = NULL ); 14 | 15 | public Q_SLOTS: 16 | void setTransformation( QwtTransform * ); 17 | 18 | private: 19 | void populate(); 20 | }; 21 | 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /UI/qwt/playground/scaleengine/scaleengine.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | 4 | int main(int argc, char **argv) 5 | { 6 | QApplication a(argc, argv); 7 | 8 | MainWindow window; 9 | window.resize(800,600); 10 | window.show(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /UI/qwt/playground/scaleengine/scaleengine.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../playground.pri ) 11 | 12 | TARGET = scaleengine 13 | 14 | HEADERS = \ 15 | transformplot.h \ 16 | plot.h \ 17 | mainwindow.h 18 | 19 | SOURCES = \ 20 | transformplot.cpp \ 21 | plot.cpp \ 22 | mainwindow.cpp \ 23 | scaleengine.cpp 24 | 25 | -------------------------------------------------------------------------------- /UI/qwt/playground/scaleengine/transformplot.h: -------------------------------------------------------------------------------- 1 | #ifndef _TRANSFORM_PLOT_H_ 2 | #define _TRANSFORM_PLOT_H_ 3 | 4 | #include 5 | 6 | class TransformPlot: public QwtPlot 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | TransformPlot( QWidget *parent = NULL ); 12 | void insertTransformation( const QString &, 13 | const QColor &, QwtTransform * ); 14 | 15 | void setLegendChecked( QwtPlotItem * ); 16 | 17 | Q_SIGNALS: 18 | void selected( QwtTransform * ); 19 | 20 | private Q_SLOTS: 21 | void legendChecked( const QVariant &, bool on ); 22 | 23 | private: 24 | }; 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /UI/qwt/playground/shapes/shapes.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../playground.pri ) 11 | 12 | TARGET = shapes 13 | 14 | SOURCES = \ 15 | shapes.cpp 16 | 17 | -------------------------------------------------------------------------------- /UI/qwt/playground/svgmap/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "plot.h" 6 | 7 | class MainWindow: public QMainWindow 8 | { 9 | public: 10 | MainWindow( const QString &fileName ) 11 | { 12 | Plot *plot = new Plot( this ); 13 | if ( !fileName.isEmpty() ) 14 | plot->loadSVG( fileName ); 15 | 16 | setCentralWidget( plot ); 17 | 18 | #ifndef QT_NO_FILEDIALOG 19 | 20 | QToolBar *toolBar = new QToolBar( this ); 21 | 22 | QToolButton *btnLoad = new QToolButton( toolBar ); 23 | 24 | btnLoad->setText( "Load SVG" ); 25 | btnLoad->setToolButtonStyle( Qt::ToolButtonTextUnderIcon ); 26 | toolBar->addWidget( btnLoad ); 27 | 28 | addToolBar( toolBar ); 29 | 30 | connect( btnLoad, SIGNAL( clicked() ), plot, SLOT( loadSVG() ) ); 31 | #endif 32 | } 33 | }; 34 | 35 | int main( int argc, char **argv ) 36 | { 37 | QApplication a( argc, argv ); 38 | 39 | QString fileName; 40 | if ( argc > 1 ) 41 | fileName = argv[1]; 42 | 43 | MainWindow w( fileName ); 44 | w.resize( 600, 400 ); 45 | w.show(); 46 | 47 | int rv = a.exec(); 48 | return rv; 49 | } 50 | -------------------------------------------------------------------------------- /UI/qwt/playground/svgmap/plot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "plot.h" 9 | 10 | Plot::Plot( QWidget *parent ): 11 | QwtPlot( parent ), 12 | d_mapItem( NULL ), 13 | d_mapRect( 0.0, 0.0, 100.0, 100.0 ) // something 14 | { 15 | #if 1 16 | /* 17 | d_mapRect is only a reference for zooming, but 18 | the ranges are nothing useful for the user. So we 19 | hide the axes. 20 | */ 21 | plotLayout()->setCanvasMargin( 0 ); 22 | for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ ) 23 | enableAxis( axis, false ); 24 | #else 25 | QwtPlotGrid *grid = new QwtPlotGrid(); 26 | grid->attach( this ); 27 | #endif 28 | 29 | /* 30 | Navigation: 31 | 32 | Left Mouse Button: Panning 33 | Mouse Wheel: Zooming In/Out 34 | Right Mouse Button: Reset to initial 35 | */ 36 | 37 | ( void )new QwtPlotPanner( canvas() ); 38 | ( void )new QwtPlotMagnifier( canvas() ); 39 | 40 | canvas()->setFocusPolicy( Qt::WheelFocus ); 41 | rescale(); 42 | } 43 | 44 | #ifndef QT_NO_FILEDIALOG 45 | 46 | void Plot::loadSVG() 47 | { 48 | QString dir; 49 | const QString fileName = QFileDialog::getOpenFileName( NULL, 50 | "Load a Scaleable Vector Graphic (SVG) Map", 51 | dir, "SVG Files (*.svg)" ); 52 | 53 | if ( !fileName.isEmpty() ) 54 | loadSVG( fileName ); 55 | } 56 | 57 | #endif 58 | 59 | void Plot::loadSVG( const QString &fileName ) 60 | { 61 | if ( d_mapItem == NULL ) 62 | { 63 | d_mapItem = new QwtPlotSvgItem(); 64 | d_mapItem->attach( this ); 65 | } 66 | 67 | d_mapItem->loadFile( d_mapRect, fileName ); 68 | rescale(); 69 | 70 | replot(); 71 | } 72 | 73 | void Plot::rescale() 74 | { 75 | setAxisScale( QwtPlot::xBottom, 76 | d_mapRect.left(), d_mapRect.right() ); 77 | setAxisScale( QwtPlot::yLeft, 78 | d_mapRect.top(), d_mapRect.bottom() ); 79 | } 80 | -------------------------------------------------------------------------------- /UI/qwt/playground/svgmap/plot.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class QwtPlotSvgItem; 5 | 6 | class Plot: public QwtPlot 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Plot( QWidget * = NULL ); 12 | 13 | public Q_SLOTS: 14 | 15 | #ifndef QT_NO_FILEDIALOG 16 | void loadSVG(); 17 | #endif 18 | 19 | void loadSVG( const QString & ); 20 | 21 | private: 22 | void rescale(); 23 | 24 | QwtPlotSvgItem *d_mapItem; 25 | const QRectF d_mapRect; 26 | }; 27 | -------------------------------------------------------------------------------- /UI/qwt/playground/svgmap/svgmap.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../playground.pri ) 11 | 12 | !contains(QWT_CONFIG, QwtSvg) { 13 | 14 | message(Are you trying to build Qwt with the Qt Creator as Shadow Build ?) 15 | error(Qwt is configured without SVG support !) 16 | } 17 | 18 | TARGET = svgmap 19 | QT += svg 20 | 21 | HEADERS = \ 22 | plot.h 23 | 24 | SOURCES = \ 25 | plot.cpp \ 26 | main.cpp 27 | -------------------------------------------------------------------------------- /UI/qwt/playground/symbols/symbols.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../playground.pri ) 11 | 12 | TARGET = symbols 13 | 14 | SOURCES = \ 15 | symbols.cpp 16 | 17 | -------------------------------------------------------------------------------- /UI/qwt/playground/timescale/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | 4 | int main( int argc, char **argv ) 5 | { 6 | QApplication a( argc, argv ); 7 | 8 | MainWindow window; 9 | window.resize( 800, 600 ); 10 | window.show(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /UI/qwt/playground/timescale/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "plot.h" 2 | #include "panel.h" 3 | #include "mainwindow.h" 4 | #include 5 | #include 6 | #include 7 | 8 | MainWindow::MainWindow( QWidget *parent ): 9 | QMainWindow( parent ) 10 | { 11 | Settings settings; 12 | #if 1 13 | settings.startDateTime = QDateTime( QDate( 2012, 10, 27 ), QTime( 18, 5, 0, 0 ) ); 14 | settings.endDateTime = QDateTime( QDate( 2012, 10, 28 ), QTime( 12, 12, 0, 0 ) ); 15 | #else 16 | settings.startDateTime = QDateTime( QDate( 2011, 5, 3 ), QTime( 0, 6, 0, 0 ) ); 17 | settings.endDateTime = QDateTime( QDate( 2012, 3, 10 ), QTime( 0, 5, 0, 0 ) ); 18 | #endif 19 | settings.maxMajorSteps = 10; 20 | settings.maxMinorSteps = 8; 21 | settings.maxWeeks = -1; 22 | 23 | d_plot = new Plot(); 24 | d_panel = new Panel(); 25 | d_panel->setSettings( settings ); 26 | 27 | QWidget *box = new QWidget( this ); 28 | 29 | QHBoxLayout *layout = new QHBoxLayout( box ); 30 | layout->addWidget( d_plot, 10 ); 31 | layout->addWidget( d_panel ); 32 | 33 | setCentralWidget( box ); 34 | 35 | updatePlot(); 36 | 37 | connect( d_panel, SIGNAL( edited() ), SLOT( updatePlot() ) ); 38 | connect( d_plot->axisWidget( QwtPlot::yLeft ), 39 | SIGNAL( scaleDivChanged() ), SLOT( updatePanel() ) ); 40 | } 41 | 42 | void MainWindow::updatePlot() 43 | { 44 | d_plot->blockSignals( true ); 45 | d_plot->applySettings( d_panel->settings() ); 46 | d_plot->blockSignals( false ); 47 | } 48 | 49 | void MainWindow::updatePanel() 50 | { 51 | const QwtScaleDiv scaleDiv = d_plot->axisScaleDiv( QwtPlot::yLeft ); 52 | 53 | Settings settings = d_panel->settings(); 54 | settings.startDateTime = QwtDate::toDateTime( scaleDiv.lowerBound(), Qt::LocalTime ); 55 | settings.endDateTime = QwtDate::toDateTime( scaleDiv.upperBound(), Qt::LocalTime ); 56 | 57 | d_panel->setSettings( settings ); 58 | } 59 | -------------------------------------------------------------------------------- /UI/qwt/playground/timescale/mainwindow.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class Plot; 4 | class Panel; 5 | 6 | class MainWindow : public QMainWindow 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MainWindow( QWidget *parent = 0 ); 12 | 13 | private Q_SLOTS: 14 | void updatePlot(); 15 | void updatePanel(); 16 | 17 | private: 18 | Plot *d_plot; 19 | Panel *d_panel; 20 | }; 21 | -------------------------------------------------------------------------------- /UI/qwt/playground/timescale/panel.h: -------------------------------------------------------------------------------- 1 | #ifndef _PANEL_ 2 | #define _PANEL_ 3 | 4 | #include "settings.h" 5 | #include 6 | 7 | class QDateTimeEdit; 8 | class QSpinBox; 9 | 10 | class Panel: public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Panel( QWidget *parent = NULL ); 16 | 17 | void setSettings( const Settings &); 18 | Settings settings() const; 19 | 20 | Q_SIGNALS: 21 | void edited(); 22 | 23 | private: 24 | QDateTimeEdit* d_startDateTime; 25 | QDateTimeEdit* d_endDateTime; 26 | 27 | QSpinBox *d_maxMajorSteps; 28 | QSpinBox *d_maxMinorSteps; 29 | QSpinBox *d_maxWeeks; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /UI/qwt/playground/timescale/plot.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLOT_H_ 2 | #define _PLOT_H_ 3 | 4 | #include 5 | 6 | class Settings; 7 | 8 | class Plot: public QwtPlot 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Plot( QWidget *parent = NULL ); 14 | 15 | public Q_SLOTS: 16 | void applySettings( const Settings & ); 17 | 18 | private: 19 | void initAxis( int axis, const QString& title, Qt::TimeSpec ); 20 | void applyAxisSettings( int axis, const Settings & ); 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /UI/qwt/playground/timescale/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETTINGS_H_ 2 | #define _SETTINGS_H_ 1 3 | 4 | #include 5 | 6 | class Settings 7 | { 8 | public: 9 | Settings(): 10 | maxMajorSteps( 10 ), 11 | maxMinorSteps( 5 ), 12 | maxWeeks( -1 ) 13 | { 14 | }; 15 | 16 | QDateTime startDateTime; 17 | QDateTime endDateTime; 18 | 19 | int maxMajorSteps; 20 | int maxMinorSteps; 21 | 22 | int maxWeeks; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /UI/qwt/playground/timescale/timescale.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../playground.pri ) 11 | 12 | TARGET = timescale 13 | 14 | HEADERS = \ 15 | panel.h \ 16 | plot.h \ 17 | mainwindow.h 18 | 19 | SOURCES = \ 20 | panel.cpp \ 21 | plot.cpp \ 22 | mainwindow.cpp \ 23 | main.cpp 24 | 25 | -------------------------------------------------------------------------------- /UI/qwt/qwt.prf: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include ( ./qwtconfig.pri ) 11 | include ( ./qwtfunctions.pri ) 12 | 13 | contains(QWT_CONFIG, QwtDll) { 14 | 15 | DEFINES *= QWT_DLL 16 | } 17 | 18 | contains(QWT_CONFIG, QwtSvg) { 19 | 20 | QT *= svg 21 | } 22 | else { 23 | 24 | DEFINES *= QWT_NO_SVG 25 | } 26 | 27 | contains(QWT_CONFIG, QwtFramework) { 28 | 29 | INCLUDEPATH *= $${QWT_INSTALL_LIBS}/qwt.framework/Headers 30 | LIBS *= -F$${QWT_INSTALL_LIBS} 31 | } 32 | else { 33 | 34 | INCLUDEPATH *= $${QWT_INSTALL_HEADERS} 35 | LIBS *= -L$${QWT_INSTALL_LIBS} 36 | } 37 | 38 | qwtAddLibrary(qwt) 39 | -------------------------------------------------------------------------------- /UI/qwt/qwt.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( qwtconfig.pri ) 11 | 12 | TEMPLATE = subdirs 13 | CONFIG += ordered 14 | 15 | SUBDIRS = \ 16 | src \ 17 | textengines \ 18 | doc 19 | 20 | contains(QWT_CONFIG, QwtDesigner ) { 21 | SUBDIRS += designer 22 | } 23 | 24 | contains(QWT_CONFIG, QwtExamples ) { 25 | SUBDIRS += examples 26 | } 27 | 28 | contains(QWT_CONFIG, QwtPlayground ) { 29 | SUBDIRS += playground 30 | } 31 | 32 | qwtspec.files = qwtconfig.pri qwtfunctions.pri qwt.prf 33 | qwtspec.path = $${QWT_INSTALL_FEATURES} 34 | 35 | INSTALLS += qwtspec 36 | 37 | -------------------------------------------------------------------------------- /UI/qwt/qwtfunctions.pri: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | # Copied and modified from qt_functions.prf 11 | 12 | defineReplace(qwtLibraryTarget) { 13 | 14 | unset(LIBRARY_NAME) 15 | LIBRARY_NAME = $$1 16 | 17 | mac:contains(QWT_CONFIG, QwtFramework) { 18 | 19 | QMAKE_FRAMEWORK_BUNDLE_NAME = $$LIBRARY_NAME 20 | export(QMAKE_FRAMEWORK_BUNDLE_NAME) 21 | } 22 | 23 | contains(TEMPLATE, .*lib):CONFIG(debug, debug|release) { 24 | 25 | !debug_and_release|build_pass { 26 | 27 | mac:RET = $$member(LIBRARY_NAME, 0)_debug 28 | win32:RET = $$member(LIBRARY_NAME, 0)d 29 | } 30 | } 31 | 32 | isEmpty(RET):RET = $$LIBRARY_NAME 33 | return($$RET) 34 | } 35 | 36 | defineTest(qwtAddLibrary) { 37 | 38 | LIB_NAME = $$1 39 | 40 | unset(LINKAGE) 41 | 42 | mac:contains(QWT_CONFIG, QwtFramework) { 43 | 44 | LINKAGE = -framework $${LIB_NAME} 45 | } 46 | 47 | isEmpty(LINKAGE) { 48 | 49 | if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { 50 | 51 | mac:LINKAGE = -l$${LIB_NAME}_debug 52 | win32:LINKAGE = -l$${LIB_NAME}d 53 | } 54 | } 55 | 56 | isEmpty(LINKAGE) { 57 | 58 | LINKAGE = -l$${LIB_NAME} 59 | } 60 | 61 | !isEmpty(QMAKE_LSB) { 62 | 63 | QMAKE_LFLAGS *= --lsb-shared-libs=$${LIB_NAME} 64 | } 65 | 66 | LIBS += $$LINKAGE 67 | export(LIBS) 68 | export(QMAKE_LFLAGS) 69 | 70 | return(true) 71 | } 72 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef QWT_H 11 | #define QWT_H 12 | 13 | #include "qwt_global.h" 14 | 15 | /*! 16 | Some constants for use within Qwt. 17 | */ 18 | namespace Qwt 19 | { 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_abstract_legend.cpp: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #include "qwt_abstract_legend.h" 11 | 12 | /*! 13 | Constructor 14 | 15 | \param parent Parent widget 16 | */ 17 | QwtAbstractLegend::QwtAbstractLegend( QWidget *parent ): 18 | QFrame( parent ) 19 | { 20 | } 21 | 22 | //! Destructor 23 | QwtAbstractLegend::~QwtAbstractLegend() 24 | { 25 | } 26 | 27 | /*! 28 | Return the extent, that is needed for elements to scroll 29 | the legend ( usually scrollbars ), 30 | 31 | \param orientation Orientation 32 | \return Extent of the corresponding scroll element 33 | */ 34 | int QwtAbstractLegend::scrollExtent( Qt::Orientation orientation ) const 35 | { 36 | Q_UNUSED( orientation ); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_arrow_button.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef QWT_ARROW_BUTTON_H 11 | #define QWT_ARROW_BUTTON_H 12 | 13 | #include "qwt_global.h" 14 | #include 15 | 16 | /*! 17 | \brief Arrow Button 18 | 19 | A push button with one or more filled triangles on its front. 20 | An Arrow button can have 1 to 3 arrows in a row, pointing 21 | up, down, left or right. 22 | */ 23 | class QWT_EXPORT QwtArrowButton : public QPushButton 24 | { 25 | public: 26 | explicit QwtArrowButton ( int num, Qt::ArrowType, QWidget *parent = NULL ); 27 | virtual ~QwtArrowButton(); 28 | 29 | Qt::ArrowType arrowType() const; 30 | int num() const; 31 | 32 | virtual QSize sizeHint() const; 33 | virtual QSize minimumSizeHint() const; 34 | 35 | protected: 36 | virtual void paintEvent( QPaintEvent *event ); 37 | 38 | virtual void drawButtonLabel( QPainter *p ); 39 | virtual void drawArrow( QPainter *, 40 | const QRect &, Qt::ArrowType ) const; 41 | virtual QRect labelRect() const; 42 | virtual QSize arrowSize( Qt::ArrowType, 43 | const QSize &boundingSize ) const; 44 | 45 | virtual void keyPressEvent( QKeyEvent * ); 46 | 47 | private: 48 | class PrivateData; 49 | PrivateData *d_data; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_clipper.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef QWT_CLIPPER_H 11 | #define QWT_CLIPPER_H 12 | 13 | #include "qwt_global.h" 14 | #include "qwt_interval.h" 15 | #include 16 | #include 17 | 18 | class QRect; 19 | class QRectF; 20 | 21 | /*! 22 | \brief Some clipping algorithms 23 | */ 24 | 25 | class QWT_EXPORT QwtClipper 26 | { 27 | public: 28 | static QPolygon clipPolygon( const QRect &, 29 | const QPolygon &, bool closePolygon = false ); 30 | static QPolygon clipPolygon( const QRectF &, 31 | const QPolygon &, bool closePolygon = false ); 32 | 33 | static QPolygonF clipPolygonF( const QRectF &, 34 | const QPolygonF &, bool closePolygon = false ); 35 | 36 | static QVector clipCircle( 37 | const QRectF &, const QPointF &, double radius ); 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_compat.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef _QWT_COMPAT_H_ 11 | #define _QWT_COMPAT_H_ 12 | 13 | #include "qwt_global.h" 14 | #include "qwt_interval.h" 15 | #include "qwt_point_3d.h" 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | // A couple of definition for Qwt5 compatibility 24 | 25 | #define qwtMax qMax 26 | #define qwtMin qMin 27 | #define qwtAbs qAbs 28 | #define qwtRound qRound 29 | 30 | #define QwtArray QVector 31 | 32 | typedef QList QwtValueList; 33 | typedef QPointF QwtDoublePoint; 34 | typedef QSizeF QwtDoubleSize; 35 | typedef QRectF QwtDoubleRect; 36 | 37 | typedef QPolygon QwtPolygon; 38 | typedef QPolygonF QwtPolygonF; 39 | typedef QwtInterval QwtDoubleInterval; 40 | typedef QwtPoint3D QwtDoublePoint3D; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_date_scale_draw.h: -------------------------------------------------------------------------------- 1 | #ifndef _QWT_DATE_SCALE_DRAW_H_ 2 | #define _QWT_DATE_SCALE_DRAW_H_ 1 3 | 4 | #include "qwt_global.h" 5 | #include "qwt_scale_draw.h" 6 | #include "qwt_date.h" 7 | 8 | /*! 9 | \brief A class for drawing datetime scales 10 | 11 | QwtDateScaleDraw displays values as datetime labels. 12 | The format of the labels depends on the alignment of 13 | the major tick labels. 14 | 15 | The default format strings are: 16 | 17 | - Millisecond\n 18 | "hh:mm:ss:zzz\nddd dd MMM yyyy" 19 | - Second\n 20 | "hh:mm:ss\nddd dd MMM yyyy" 21 | - Minute\n 22 | "hh:mm\nddd dd MMM yyyy" 23 | - Hour\n 24 | "hh:mm\nddd dd MMM yyyy" 25 | - Day\n 26 | "ddd dd MMM yyyy" 27 | - Week\n 28 | "Www yyyy" 29 | - Month\n 30 | "MMM yyyy" 31 | - Year\n 32 | "yyyy" 33 | 34 | The format strings can be modified using setDateFormat() 35 | or individually for each tick label by overloading dateFormatOfDate(), 36 | 37 | Usually QwtDateScaleDraw is used in combination with 38 | QwtDateScaleEngine, that calculates scales for datetime 39 | intervals. 40 | 41 | \sa QwtDateScaleEngine, QwtPlot::setAxisScaleDraw() 42 | */ 43 | class QWT_EXPORT QwtDateScaleDraw: public QwtScaleDraw 44 | { 45 | public: 46 | QwtDateScaleDraw( Qt::TimeSpec = Qt::LocalTime ); 47 | virtual ~QwtDateScaleDraw(); 48 | 49 | void setDateFormat( QwtDate::IntervalType, const QString & ); 50 | QString dateFormat( QwtDate::IntervalType ) const; 51 | 52 | void setTimeSpec( Qt::TimeSpec ); 53 | Qt::TimeSpec timeSpec() const; 54 | 55 | void setUtcOffset( int seconds ); 56 | int utcOffset() const; 57 | 58 | void setWeek0Type( QwtDate::Week0Type ); 59 | QwtDate::Week0Type week0Type() const; 60 | 61 | virtual QwtText label( double ) const; 62 | 63 | QDateTime toDateTime( double ) const; 64 | 65 | protected: 66 | virtual QwtDate::IntervalType 67 | intervalType( const QwtScaleDiv & ) const; 68 | 69 | virtual QString dateFormatOfDate( const QDateTime &, 70 | QwtDate::IntervalType ) const; 71 | 72 | private: 73 | class PrivateData; 74 | PrivateData *d_data; 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_global.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef QWT_GLOBAL_H 11 | #define QWT_GLOBAL_H 12 | 13 | #include 14 | 15 | // QWT_VERSION is (major << 16) + (minor << 8) + patch. 16 | 17 | #define QWT_VERSION 0x060101 18 | #define QWT_VERSION_STR "6.1.1" 19 | 20 | #if defined(_MSC_VER) /* MSVC Compiler */ 21 | /* template-class specialization 'identifier' is already instantiated */ 22 | #pragma warning(disable: 4660) 23 | /* inherits via dominance */ 24 | #pragma warning(disable: 4250) 25 | #endif // _MSC_VER 26 | 27 | #ifdef QWT_DLL 28 | 29 | #if defined(QWT_MAKEDLL) // create a Qwt DLL library 30 | #define QWT_EXPORT Q_DECL_EXPORT 31 | #else // use a Qwt DLL library 32 | #define QWT_EXPORT Q_DECL_IMPORT 33 | #endif 34 | 35 | #endif // QWT_DLL 36 | 37 | #ifndef QWT_EXPORT 38 | #define QWT_EXPORT 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_math.cpp: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #include "qwt_math.h" 11 | 12 | /*! 13 | \brief Find the smallest value in an array 14 | \param array Pointer to an array 15 | \param size Array size 16 | */ 17 | double qwtGetMin( const double *array, int size ) 18 | { 19 | if ( size <= 0 ) 20 | return 0.0; 21 | 22 | double rv = array[0]; 23 | for ( int i = 1; i < size; i++ ) 24 | rv = qMin( rv, array[i] ); 25 | 26 | return rv; 27 | } 28 | 29 | 30 | /*! 31 | \brief Find the largest value in an array 32 | \param array Pointer to an array 33 | \param size Array size 34 | */ 35 | double qwtGetMax( const double *array, int size ) 36 | { 37 | if ( size <= 0 ) 38 | return 0.0; 39 | 40 | double rv = array[0]; 41 | for ( int i = 1; i < size; i++ ) 42 | rv = qMax( rv, array[i] ); 43 | 44 | return rv; 45 | } 46 | 47 | /*! 48 | \brief Normalize an angle to be int the range [0.0, 2 * PI[ 49 | \param radians Angle in radians 50 | \return Normalized angle in radians 51 | */ 52 | double qwtNormalizeRadians( double radians ) 53 | { 54 | double a = ::fmod( radians, 2.0 * M_PI ); 55 | if ( a < 0.0 ) 56 | a += 2.0 * M_PI; 57 | 58 | return a; 59 | 60 | } 61 | 62 | /*! 63 | \brief Normalize an angle to be int the range [0.0, 360.0[ 64 | \param radians Angle in degrees 65 | \return Normalized angle in degrees 66 | */ 67 | double qwtNormalizeDegrees( double degrees ) 68 | { 69 | double a = ::fmod( degrees, 360.0 ); 70 | if ( a < 0.0 ) 71 | a += 360.0; 72 | 73 | return a; 74 | } 75 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_pixel_matrix.cpp: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2003 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #include "qwt_pixel_matrix.h" 11 | 12 | /*! 13 | \brief Constructor 14 | 15 | \param rect Bounding rectangle for the matrix 16 | */ 17 | QwtPixelMatrix::QwtPixelMatrix( const QRect& rect ): 18 | QBitArray( qMax( rect.width() * rect.height(), 0 ) ), 19 | d_rect( rect ) 20 | { 21 | } 22 | 23 | //! Destructor 24 | QwtPixelMatrix::~QwtPixelMatrix() 25 | { 26 | } 27 | 28 | /*! 29 | Set the bounding rectangle of the matrix 30 | 31 | \param rect Bounding rectangle 32 | 33 | \note All bits are cleared 34 | */ 35 | void QwtPixelMatrix::setRect( const QRect& rect ) 36 | { 37 | if ( rect != d_rect ) 38 | { 39 | d_rect = rect; 40 | const int sz = qMax( rect.width() * rect.height(), 0 ); 41 | resize( sz ); 42 | } 43 | 44 | fill( false ); 45 | } 46 | 47 | //! \return Bounding rectangle 48 | QRect QwtPixelMatrix::rect() const 49 | { 50 | return d_rect; 51 | } 52 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_plot_dict.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | /*! \file !*/ 11 | #ifndef QWT_PLOT_DICT 12 | #define QWT_PLOT_DICT 13 | 14 | #include "qwt_global.h" 15 | #include "qwt_plot_item.h" 16 | #include 17 | 18 | /// \var typedef QList< QwtPlotItem *> QwtPlotItemList 19 | /// \brief See QT 4.x assistant documentation for QList 20 | typedef QList QwtPlotItemList; 21 | typedef QList::ConstIterator QwtPlotItemIterator; 22 | 23 | /*! 24 | \brief A dictionary for plot items 25 | 26 | QwtPlotDict organizes plot items in increasing z-order. 27 | If autoDelete() is enabled, all attached items will be deleted 28 | in the destructor of the dictionary. 29 | QwtPlotDict can be used to get access to all QwtPlotItem items - or all 30 | items of a specific type - that are currently on the plot. 31 | 32 | \sa QwtPlotItem::attach(), QwtPlotItem::detach(), QwtPlotItem::z() 33 | */ 34 | class QWT_EXPORT QwtPlotDict 35 | { 36 | public: 37 | explicit QwtPlotDict(); 38 | virtual ~QwtPlotDict(); 39 | 40 | void setAutoDelete( bool ); 41 | bool autoDelete() const; 42 | 43 | const QwtPlotItemList& itemList() const; 44 | QwtPlotItemList itemList( int rtti ) const; 45 | 46 | void detachItems( int rtti = QwtPlotItem::Rtti_PlotItem, 47 | bool autoDelete = true ); 48 | 49 | protected: 50 | void insertItem( QwtPlotItem * ); 51 | void removeItem( QwtPlotItem * ); 52 | 53 | private: 54 | class PrivateData; 55 | PrivateData *d_data; 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_plot_magnifier.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef QWT_PLOT_MAGNIFIER_H 11 | #define QWT_PLOT_MAGNIFIER_H 1 12 | 13 | #include "qwt_global.h" 14 | #include "qwt_magnifier.h" 15 | 16 | class QwtPlot; 17 | 18 | /*! 19 | \brief QwtPlotMagnifier provides zooming, by magnifying in steps. 20 | 21 | Using QwtPlotMagnifier a plot can be zoomed in/out in steps using 22 | keys, the mouse wheel or moving a mouse button in vertical direction. 23 | 24 | Together with QwtPlotZoomer and QwtPlotPanner it is possible to implement 25 | individual and powerful navigation of the plot canvas. 26 | 27 | \sa QwtPlotZoomer, QwtPlotPanner, QwtPlot 28 | */ 29 | class QWT_EXPORT QwtPlotMagnifier: public QwtMagnifier 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | explicit QwtPlotMagnifier( QWidget * ); 35 | virtual ~QwtPlotMagnifier(); 36 | 37 | void setAxisEnabled( int axis, bool on ); 38 | bool isAxisEnabled( int axis ) const; 39 | 40 | QWidget *canvas(); 41 | const QWidget *canvas() const; 42 | 43 | QwtPlot *plot(); 44 | const QwtPlot *plot() const; 45 | 46 | protected: 47 | virtual void rescale( double factor ); 48 | 49 | private: 50 | class PrivateData; 51 | PrivateData *d_data; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_plot_panner.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef QWT_PLOT_PANNER_H 11 | #define QWT_PLOT_PANNER_H 1 12 | 13 | #include "qwt_global.h" 14 | #include "qwt_panner.h" 15 | 16 | class QwtPlot; 17 | 18 | /*! 19 | \brief QwtPlotPanner provides panning of a plot canvas 20 | 21 | QwtPlotPanner is a panner for a plot canvas, that 22 | adjusts the scales of the axes after dropping 23 | the canvas on its new position. 24 | 25 | Together with QwtPlotZoomer and QwtPlotMagnifier powerful ways 26 | of navigating on a QwtPlot widget can be implemented easily. 27 | 28 | \note The axes are not updated, while dragging the canvas 29 | \sa QwtPlotZoomer, QwtPlotMagnifier 30 | */ 31 | class QWT_EXPORT QwtPlotPanner: public QwtPanner 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit QwtPlotPanner( QWidget * ); 37 | virtual ~QwtPlotPanner(); 38 | 39 | QWidget *canvas(); 40 | const QWidget *canvas() const; 41 | 42 | QwtPlot *plot(); 43 | const QwtPlot *plot() const; 44 | 45 | void setAxisEnabled( int axis, bool on ); 46 | bool isAxisEnabled( int axis ) const; 47 | 48 | protected Q_SLOTS: 49 | virtual void moveCanvas( int dx, int dy ); 50 | 51 | protected: 52 | virtual QBitmap contentsMask() const; 53 | virtual QPixmap grab() const; 54 | 55 | private: 56 | class PrivateData; 57 | PrivateData *d_data; 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_plot_svgitem.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef QWT_PLOT_SVGITEM_H 11 | #define QWT_PLOT_SVGITEM_H 12 | 13 | #include "qwt_global.h" 14 | #include "qwt_plot_item.h" 15 | #include 16 | 17 | class QSvgRenderer; 18 | class QByteArray; 19 | 20 | /*! 21 | \brief A plot item, which displays 22 | data in Scalable Vector Graphics (SVG) format. 23 | 24 | SVG images are often used to display maps 25 | */ 26 | 27 | class QWT_EXPORT QwtPlotSvgItem: public QwtPlotItem 28 | { 29 | public: 30 | explicit QwtPlotSvgItem( const QString& title = QString::null ); 31 | explicit QwtPlotSvgItem( const QwtText& title ); 32 | virtual ~QwtPlotSvgItem(); 33 | 34 | bool loadFile( const QRectF&, const QString &fileName ); 35 | bool loadData( const QRectF&, const QByteArray & ); 36 | 37 | virtual QRectF boundingRect() const; 38 | 39 | virtual void draw( QPainter *p, 40 | const QwtScaleMap &xMap, const QwtScaleMap &yMap, 41 | const QRectF &rect ) const; 42 | 43 | virtual int rtti() const; 44 | 45 | protected: 46 | const QSvgRenderer &renderer() const; 47 | QSvgRenderer &renderer(); 48 | 49 | void render( QPainter *painter, 50 | const QRectF &viewBox, const QRectF &rect ) const; 51 | 52 | QRectF viewBox( const QRectF &area ) const; 53 | 54 | private: 55 | void init(); 56 | 57 | class PrivateData; 58 | PrivateData *d_data; 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_plot_textlabel.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef QWT_PLOT_TEXT_LABEL_H 11 | #define QWT_PLOT_TEXT_LABEL_H 1 12 | 13 | #include "qwt_global.h" 14 | #include "qwt_plot_item.h" 15 | #include "qwt_text.h" 16 | 17 | /*! 18 | \brief A plot item, which displays a text label 19 | 20 | QwtPlotTextLabel displays a text label aligned to the plot canvas. 21 | 22 | In opposite to QwtPlotMarker the position of the label is unrelated to 23 | plot coordinates. 24 | 25 | As drawing a text is an expensive operation the label is cached 26 | in a pixmap to speed up replots. 27 | 28 | \par Example 29 | The following code shows how to add a title. 30 | 31 | \verbatim 32 | QwtText title( "Plot Title" ); 33 | title.setRenderFlags( Qt::AlignHCenter | Qt::AlignTop ); 34 | 35 | QFont font; 36 | font.setBold( true ); 37 | title.setFont( font ); 38 | 39 | QwtPlotTextLabel *titleItem = new QwtPlotTextLabel(); 40 | titleItem->setText( title ); 41 | titleItem->attach( this ); 42 | \endverbatim 43 | 44 | \sa QwtPlotMarker 45 | */ 46 | 47 | class QWT_EXPORT QwtPlotTextLabel: public QwtPlotItem 48 | { 49 | public: 50 | QwtPlotTextLabel(); 51 | virtual ~QwtPlotTextLabel(); 52 | 53 | virtual int rtti() const; 54 | 55 | void setText( const QwtText & ); 56 | QwtText text() const; 57 | 58 | void setMargin( int margin ); 59 | int margin() const; 60 | 61 | virtual QRectF textRect( const QRectF &, const QSizeF & ) const; 62 | 63 | protected: 64 | virtual void draw( QPainter *, 65 | const QwtScaleMap &, const QwtScaleMap &, 66 | const QRectF &) const; 67 | 68 | void invalidateCache(); 69 | 70 | private: 71 | class PrivateData; 72 | PrivateData *d_data; 73 | }; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_plot_xml.cpp: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #include "qwt_plot.h" 11 | 12 | /*! 13 | This method is intended for manipulating the plot widget 14 | from a specific editor in the Qwt designer plugin. 15 | 16 | \warning The plot editor has never been implemented. 17 | */ 18 | void QwtPlot::applyProperties( const QString & /* xmlDocument */ ) 19 | { 20 | #if 0 21 | // Temporary dummy code, for designer tests 22 | setTitle( xmlDocument ); 23 | replot(); 24 | #endif 25 | } 26 | 27 | /*! 28 | This method is intended for manipulating the plot widget 29 | from a specific editor in the Qwt designer plugin. 30 | 31 | \return QString::null 32 | \warning The plot editor has never been implemented. 33 | */ 34 | QString QwtPlot::grabProperties() const 35 | { 36 | #if 0 37 | // Temporary dummy code, for designer tests 38 | return title().text(); 39 | #else 40 | return QString::null; 41 | #endif 42 | } 43 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_plot_zoneitem.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef QWT_PLOT_ZONE_ITEM_H 11 | #define QWT_PLOT_ZONE_ITEM_H 12 | 13 | #include "qwt_global.h" 14 | #include "qwt_plot_item.h" 15 | #include "qwt_interval.h" 16 | 17 | class QPen; 18 | class QBrush; 19 | 20 | /*! 21 | \brief A plot item, which displays a zone 22 | 23 | A horizontal zone highlights an interval of the y axis - a vertical 24 | zone an interval of the x axis - and is unbounded in the opposite direction. 25 | It is filled with a brush and its border lines are optionally displayed with a pen. 26 | 27 | \note For displaying an area that is bounded for x and y coordinates 28 | use QwtPlotShapeItem 29 | */ 30 | 31 | class QWT_EXPORT QwtPlotZoneItem: 32 | public QwtPlotItem 33 | { 34 | public: 35 | explicit QwtPlotZoneItem(); 36 | virtual ~QwtPlotZoneItem(); 37 | 38 | virtual int rtti() const; 39 | 40 | void setOrientation( Qt::Orientation ); 41 | Qt::Orientation orientation(); 42 | 43 | void setInterval( double min, double max ); 44 | void setInterval( const QwtInterval & ); 45 | QwtInterval interval() const; 46 | 47 | void setPen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine ); 48 | void setPen( const QPen & ); 49 | const QPen &pen() const; 50 | 51 | void setBrush( const QBrush & ); 52 | const QBrush &brush() const; 53 | 54 | virtual void draw( QPainter *, 55 | const QwtScaleMap &, const QwtScaleMap &, 56 | const QRectF &) const; 57 | 58 | virtual QRectF boundingRect() const; 59 | 60 | private: 61 | class PrivateData; 62 | PrivateData *d_data; 63 | }; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_point_3d.cpp: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #include "qwt_point_3d.h" 11 | 12 | #ifndef QT_NO_DEBUG_STREAM 13 | 14 | QDebug operator<<( QDebug debug, const QwtPoint3D &point ) 15 | { 16 | debug.nospace() << "QwtPoint3D(" << point.x() 17 | << "," << point.y() << "," << point.z() << ")"; 18 | return debug.space(); 19 | } 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_sampling_thread.h: -------------------------------------------------------------------------------- 1 | #ifndef _QWT_SAMPLING_THREAD_H_ 2 | #define _QWT_SAMPLING_THREAD_H_ 3 | 4 | #include "qwt_global.h" 5 | #include 6 | 7 | /*! 8 | \brief A thread collecting samples at regular intervals. 9 | 10 | Continuous signals are converted into a discrete signal by 11 | collecting samples at regular intervals. A discrete signal 12 | can be displayed by a QwtPlotSeriesItem on a QwtPlot widget. 13 | 14 | QwtSamplingThread starts a thread calling periodically sample(), 15 | to collect and store ( or emit ) a single sample. 16 | 17 | \sa QwtPlotCurve, QwtPlotSeriesItem 18 | */ 19 | class QWT_EXPORT QwtSamplingThread: public QThread 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | virtual ~QwtSamplingThread(); 25 | 26 | double interval() const; 27 | double elapsed() const; 28 | 29 | public Q_SLOTS: 30 | void setInterval( double interval ); 31 | void stop(); 32 | 33 | protected: 34 | explicit QwtSamplingThread( QObject *parent = NULL ); 35 | 36 | virtual void run(); 37 | 38 | /*! 39 | Collect a sample 40 | 41 | \param elapsed Time since the thread was started in milliseconds 42 | */ 43 | virtual void sample( double elapsed ) = 0; 44 | 45 | private: 46 | class PrivateData; 47 | PrivateData *d_data; 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_system_clock.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef QWT_SYSTEM_CLOCK_H 11 | #define QWT_SYSTEM_CLOCK_H 12 | 13 | #include "qwt_global.h" 14 | 15 | /*! 16 | \brief QwtSystemClock provides high resolution clock time functions. 17 | 18 | Sometimes the resolution offered by QTime ( millisecond ) is not accurate 19 | enough for implementing time measurements ( f.e. sampling ). 20 | QwtSystemClock offers a subset of the QTime functionality using higher 21 | resolution timers ( if possible ). 22 | 23 | Precision and time intervals are multiples of milliseconds (ms). 24 | 25 | \note The implementation uses high-resolution performance counter on Windows, 26 | mach_absolute_time() on the Mac or POSIX timers on other systems. 27 | If none is available it falls back on QTimer. 28 | */ 29 | 30 | class QWT_EXPORT QwtSystemClock 31 | { 32 | public: 33 | QwtSystemClock(); 34 | virtual ~QwtSystemClock(); 35 | 36 | bool isNull() const; 37 | 38 | void start(); 39 | double restart(); 40 | double elapsed() const; 41 | 42 | private: 43 | class PrivateData; 44 | PrivateData *d_data; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /UI/qwt/src/qwt_text_label.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2002 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | #ifndef QWT_TEXT_LABEL_H 11 | #define QWT_TEXT_LABEL_H 12 | 13 | #include "qwt_global.h" 14 | #include "qwt_text.h" 15 | #include 16 | 17 | class QString; 18 | class QPaintEvent; 19 | class QPainter; 20 | 21 | /*! 22 | \brief A Widget which displays a QwtText 23 | */ 24 | 25 | class QWT_EXPORT QwtTextLabel : public QFrame 26 | { 27 | Q_OBJECT 28 | 29 | Q_PROPERTY( int indent READ indent WRITE setIndent ) 30 | Q_PROPERTY( int margin READ margin WRITE setMargin ) 31 | Q_PROPERTY( QString plainText READ plainText WRITE setPlainText ) 32 | 33 | public: 34 | explicit QwtTextLabel( QWidget *parent = NULL ); 35 | explicit QwtTextLabel( const QwtText &, QWidget *parent = NULL ); 36 | virtual ~QwtTextLabel(); 37 | 38 | void setPlainText( const QString & ); 39 | QString plainText() const; 40 | 41 | public Q_SLOTS: 42 | void setText( const QString &, 43 | QwtText::TextFormat textFormat = QwtText::AutoText ); 44 | virtual void setText( const QwtText & ); 45 | 46 | void clear(); 47 | 48 | public: 49 | const QwtText &text() const; 50 | 51 | int indent() const; 52 | void setIndent( int ); 53 | 54 | int margin() const; 55 | void setMargin( int ); 56 | 57 | virtual QSize sizeHint() const; 58 | virtual QSize minimumSizeHint() const; 59 | virtual int heightForWidth( int ) const; 60 | 61 | QRect textRect() const; 62 | 63 | virtual void drawText( QPainter *, const QRectF & ); 64 | 65 | protected: 66 | virtual void paintEvent( QPaintEvent *e ); 67 | virtual void drawContents( QPainter * ); 68 | 69 | private: 70 | void init(); 71 | int defaultIndent() const; 72 | 73 | class PrivateData; 74 | PrivateData *d_data; 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /UI/qwt/src/src.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | # qmake project file for building the qwt libraries 11 | 12 | QWT_ROOT = $${PWD}/.. 13 | include( $${QWT_ROOT}/qwtconfig.pri ) 14 | include( $${QWT_ROOT}/qwtbuild.pri ) 15 | include( $${QWT_ROOT}/qwtfunctions.pri ) 16 | 17 | TEMPLATE = lib 18 | TARGET = $$qwtLibraryTarget(qwt) 19 | 20 | DESTDIR = $${QWT_ROOT}/lib 21 | 22 | contains(QWT_CONFIG, QwtDll) { 23 | 24 | CONFIG += dll 25 | win32|symbian: DEFINES += QT_DLL QWT_DLL QWT_MAKEDLL 26 | } 27 | else { 28 | CONFIG += staticlib 29 | } 30 | 31 | contains(QWT_CONFIG, QwtFramework) { 32 | 33 | CONFIG += lib_bundle 34 | } 35 | 36 | include ( $${PWD}/src.pri ) 37 | 38 | # Install directives 39 | 40 | target.path = $${QWT_INSTALL_LIBS} 41 | INSTALLS = target 42 | 43 | CONFIG(lib_bundle) { 44 | 45 | FRAMEWORK_HEADERS.version = Versions 46 | FRAMEWORK_HEADERS.files = $${HEADERS} 47 | FRAMEWORK_HEADERS.path = Headers 48 | QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS 49 | } 50 | else { 51 | 52 | headers.files = $${HEADERS} 53 | headers.path = $${QWT_INSTALL_HEADERS} 54 | INSTALLS += headers 55 | } 56 | -------------------------------------------------------------------------------- /UI/qwt/textengines/mathml/mathml.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | message(The qwtmathml library contains code of the MML Widget from the Qt solutions package.) 11 | message(Beside the Qwt license you also have to take care of its license. ) 12 | 13 | include( $${PWD}/../textengines.pri ) 14 | 15 | TARGET = $$qwtLibraryTarget(qwtmathml) 16 | QT += xml 17 | 18 | greaterThan(QT_MAJOR_VERSION, 4) { 19 | 20 | QT += widgets 21 | } 22 | 23 | HEADERS = \ 24 | qwt_mathml_text_engine.h 25 | 26 | SOURCES = \ 27 | qwt_mathml_text_engine.cpp 28 | 29 | # qwt_mml_document.h/qwt_mml_document.cpp has been stripped down from 30 | # the mathml widgets offered in the Qt solutions package. 31 | 32 | HEADERS += qwt_mml_document.h 33 | SOURCES += qwt_mml_document.cpp 34 | 35 | qwtmathmlspec.files = qwtmathml.prf 36 | qwtmathmlspec.path = $${QWT_INSTALL_FEATURES} 37 | 38 | INSTALLS += qwtmathmlspec 39 | 40 | CONFIG(lib_bundle) { 41 | 42 | FRAMEWORK_HEADERS.version = Versions 43 | FRAMEWORK_HEADERS.files = qwt_mathml_text_engine.h 44 | FRAMEWORK_HEADERS.path = Headers 45 | QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS 46 | } 47 | else { 48 | 49 | headers.files = qwt_mathml_text_engine.h 50 | headers.path = $${QWT_INSTALL_HEADERS} 51 | INSTALLS += headers 52 | } 53 | 54 | -------------------------------------------------------------------------------- /UI/qwt/textengines/mathml/qwt_mathml_text_engine.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 2 | * Qwt Widget Library 3 | * Copyright (C) 1997 Josef Wilgen 4 | * Copyright (C) 2003 Uwe Rathmann 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the Qwt License, Version 1.0 8 | *****************************************************************************/ 9 | 10 | // vim: expandtab 11 | 12 | #ifndef QWT_MATHML_TEXT_ENGINE_H 13 | #define QWT_MATHML_TEXT_ENGINE_H 1 14 | 15 | #include "qwt_text_engine.h" 16 | 17 | /*! 18 | \brief Text Engine for the MathML renderer of the Qt solutions package. 19 | 20 | To enable MathML support the following code needs to be added to the 21 | application: 22 | \verbatim 23 | #include 24 | 25 | QwtText::setTextEngine(QwtText::MathMLText, new QwtMathMLTextEngine()); 26 | \endverbatim 27 | 28 | \sa QwtTextEngine, QwtText::setTextEngine 29 | \warning Unfortunately the MathML renderer doesn't support rotating of texts. 30 | */ 31 | 32 | class QWT_EXPORT QwtMathMLTextEngine: public QwtTextEngine 33 | { 34 | public: 35 | QwtMathMLTextEngine(); 36 | virtual ~QwtMathMLTextEngine(); 37 | 38 | virtual double heightForWidth( const QFont &font, int flags, 39 | const QString &text, double width ) const; 40 | 41 | virtual QSizeF textSize( const QFont &font, int flags, 42 | const QString &text ) const; 43 | 44 | virtual void draw( QPainter *painter, const QRectF &rect, 45 | int flags, const QString &text ) const; 46 | 47 | virtual bool mightRender( const QString & ) const; 48 | 49 | virtual void textMargins( const QFont &, const QString &, 50 | double &left, double &right, double &top, double &bottom ) const; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /UI/qwt/textengines/mathml/qwt_mml_document.h: -------------------------------------------------------------------------------- 1 | #ifndef _QWT_MML_DOCUMENT_H_ 2 | #define _QWT_MML_DOCUMENT_H_ 1 3 | 4 | #include 5 | #include 6 | 7 | class QPainter; 8 | class QPoint; 9 | 10 | class QwtMmlDocument; 11 | 12 | class QWT_EXPORT QwtMathMLDocument 13 | { 14 | public: 15 | enum MmlFont 16 | { 17 | NormalFont, 18 | FrakturFont, 19 | SansSerifFont, 20 | ScriptFont, 21 | MonospaceFont, 22 | DoublestruckFont 23 | }; 24 | 25 | QwtMathMLDocument(); 26 | ~QwtMathMLDocument(); 27 | 28 | void clear(); 29 | 30 | bool setContent( QString text, QString *errorMsg = 0, 31 | int *errorLine = 0, int *errorColumn = 0 ); 32 | void paint( QPainter *p, const QPoint &pos ) const; 33 | QSize size() const; 34 | 35 | QString fontName( MmlFont type ) const; 36 | void setFontName( MmlFont type, const QString &name ); 37 | 38 | int baseFontPointSize() const; 39 | void setBaseFontPointSize( int size ); 40 | 41 | private: 42 | QwtMmlDocument *m_doc; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /UI/qwt/textengines/mathml/qwtmathml.prf: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include ( ./qwtconfig.pri ) 11 | 12 | contains(QWT_CONFIG, QwtDll) { 13 | 14 | DEFINES *= QWT_DLL 15 | } 16 | 17 | QT *= xml 18 | 19 | contains(QWT_CONFIG, QwtFramework) { 20 | 21 | INCLUDEPATH *= $${QWT_INSTALL_LIBS}/qwtmathml.framework/Headers 22 | LIBS *= -F$${QWT_INSTALL_LIBS} 23 | } 24 | else { 25 | 26 | INCLUDEPATH *= $${QWT_INSTALL_HEADERS} 27 | LIBS *= -L$${QWT_INSTALL_LIBS} 28 | } 29 | 30 | INCLUDEPATH_QWTMATHML = $${INCLUDEPATH} 31 | qtAddLibrary(qwtmathml) 32 | 33 | # we don't want qtAddLibrary to expand the 34 | # include path, with directories, that might 35 | # conflict with other installations of qwt 36 | 37 | INCLUDEPATH = $${INCLUDEPATH_QWTMATHML} 38 | 39 | -------------------------------------------------------------------------------- /UI/qwt/textengines/textengines.pri: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | QWT_ROOT = $${PWD}/.. 11 | 12 | include( $${QWT_ROOT}/qwtconfig.pri ) 13 | include( $${QWT_ROOT}/qwtbuild.pri ) 14 | include( $${QWT_ROOT}/qwtfunctions.pri ) 15 | 16 | TEMPLATE = lib 17 | 18 | DESTDIR = $${QWT_ROOT}/lib 19 | INCLUDEPATH += $${QWT_ROOT}/src 20 | DEPENDPATH += $${QWT_ROOT}/src 21 | 22 | contains(QWT_CONFIG, QwtDll) { 23 | CONFIG += dll 24 | win32|symbian: DEFINES += QT_DLL QWT_DLL QWT_MAKEDLL 25 | } 26 | else { 27 | CONFIG += staticlib 28 | } 29 | 30 | contains(QWT_CONFIG, QwtFramework) { 31 | 32 | CONFIG += lib_bundle 33 | LIBS += -F$${QWT_ROOT}/lib 34 | } 35 | else { 36 | 37 | LIBS += -L$${QWT_ROOT}/lib 38 | } 39 | 40 | qwtAddLibrary(qwt) 41 | 42 | # Install directives 43 | 44 | target.path = $${QWT_INSTALL_LIBS} 45 | doc.path = $${QWT_INSTALL_DOCS} 46 | 47 | INSTALLS = target 48 | -------------------------------------------------------------------------------- /UI/qwt/textengines/textengines.pro: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Qwt Widget Library 3 | # Copyright (C) 1997 Josef Wilgen 4 | # Copyright (C) 2002 Uwe Rathmann 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the Qwt License, Version 1.0 8 | ################################################################ 9 | 10 | include( $${PWD}/../qwtconfig.pri ) 11 | 12 | TEMPLATE = subdirs 13 | 14 | contains(QWT_CONFIG, QwtMathML) { 15 | SUBDIRS += mathml 16 | } 17 | -------------------------------------------------------------------------------- /samples/5220_HT40PLUS.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/samples/5220_HT40PLUS.log -------------------------------------------------------------------------------- /samples/5240_HT20.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/samples/5240_HT20.log -------------------------------------------------------------------------------- /samples/5300_HT40MINUS.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/samples/5300_HT40MINUS.log -------------------------------------------------------------------------------- /samples/5300_HT40MINUS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LorenzoBianconi/ath_spectral/2ff0c4a04718b4448e8c2848dfab615227dca6b3/samples/5300_HT40MINUS.png --------------------------------------------------------------------------------