├── README.md ├── battery ├── battery.cpp ├── battery.h ├── battery.pro ├── frmbattery.cpp ├── frmbattery.h ├── frmbattery.ui └── main.cpp ├── bgdemo ├── bgdemo.pro ├── image │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ └── 5.png ├── main.cpp ├── rc.qrc ├── widget.cpp ├── widget.h └── widget.ui ├── buttondefence ├── buttondefence.cpp ├── buttondefence.h ├── buttondefence.pro ├── frmbuttondefence.cpp ├── frmbuttondefence.h ├── frmbuttondefence.ui ├── image │ ├── bg_call.jpg │ ├── btn_defence_alarm_bubble.png │ ├── btn_defence_alarm_bubble2.png │ ├── btn_defence_alarm_circle.png │ ├── btn_defence_alarm_msg.png │ ├── btn_defence_alarm_msg2.png │ ├── btn_defence_alarm_police.png │ ├── btn_defence_arming_bubble.png │ ├── btn_defence_arming_bubble2.png │ ├── btn_defence_arming_circle.png │ ├── btn_defence_arming_msg.png │ ├── btn_defence_arming_msg2.png │ ├── btn_defence_arming_police.png │ ├── btn_defence_bypass_bubble.png │ ├── btn_defence_bypass_bubble2.png │ ├── btn_defence_bypass_circle.png │ ├── btn_defence_bypass_msg.png │ ├── btn_defence_bypass_msg2.png │ ├── btn_defence_bypass_police.png │ ├── btn_defence_disarming_bubble.png │ ├── btn_defence_disarming_bubble2.png │ ├── btn_defence_disarming_circle.png │ ├── btn_defence_disarming_msg.png │ ├── btn_defence_disarming_msg2.png │ ├── btn_defence_disarming_police.png │ ├── btn_defence_error_bubble.png │ ├── btn_defence_error_bubble2.png │ ├── btn_defence_error_circle.png │ ├── btn_defence_error_msg.png │ ├── btn_defence_error_msg2.png │ └── btn_defence_error_police.png ├── main.cpp └── main.qrc ├── colorwidget ├── colorwidget.cpp ├── colorwidget.h ├── colorwidget.pro └── main.cpp ├── comtool ├── api │ ├── api.pri │ ├── app.cpp │ ├── app.h │ ├── quiwidget.cpp │ └── quiwidget.h ├── comtool.pro ├── file │ ├── device.txt │ └── send.txt ├── form │ ├── form.pri │ ├── frmcomtool.cpp │ ├── frmcomtool.h │ └── frmcomtool.ui ├── head.h ├── main.cpp ├── other │ ├── main.ico │ ├── main.qrc │ └── main.rc ├── qextserialport │ ├── qextserialport.cpp │ ├── qextserialport.h │ ├── qextserialport.pri │ ├── qextserialport_global.h │ ├── qextserialport_p.h │ ├── qextserialport_unix.cpp │ ├── qextserialport_win.cpp │ └── readme.txt └── readme.txt ├── countcode ├── countcode.pro ├── frmcountcode.cpp ├── frmcountcode.h ├── frmcountcode.ui └── main.cpp ├── dbpage ├── TA.db ├── dbpage.cpp ├── dbpage.h ├── dbpage.pro ├── frmdbpage.cpp ├── frmdbpage.h ├── frmdbpage.ui ├── head.h ├── main.cpp └── readme.txt ├── devicesizetable ├── devicesizetable.cpp ├── devicesizetable.h ├── devicesizetable.pro ├── frmdevicesizetable.cpp ├── frmdevicesizetable.h ├── frmdevicesizetable.ui └── main.cpp ├── emailtool ├── emailtool.pro ├── frmemailtool.cpp ├── frmemailtool.h ├── frmemailtool.ui ├── main.cpp └── sendemail │ ├── emailaddress.cpp │ ├── emailaddress.h │ ├── mimeattachment.cpp │ ├── mimeattachment.h │ ├── mimecontentformatter.cpp │ ├── mimecontentformatter.h │ ├── mimefile.cpp │ ├── mimefile.h │ ├── mimehtml.cpp │ ├── mimehtml.h │ ├── mimeinlinefile.cpp │ ├── mimeinlinefile.h │ ├── mimemessage.cpp │ ├── mimemessage.h │ ├── mimemultipart.cpp │ ├── mimemultipart.h │ ├── mimepart.cpp │ ├── mimepart.h │ ├── mimetext.cpp │ ├── mimetext.h │ ├── quotedprintable.cpp │ ├── quotedprintable.h │ ├── sendemail.pri │ ├── sendemailthread.cpp │ ├── sendemailthread.h │ ├── smtpclient.cpp │ ├── smtpclient.h │ └── smtpmime.h ├── flatui ├── flatui.cpp ├── flatui.h ├── flatui.pro ├── frmflatui.cpp ├── frmflatui.h ├── frmflatui.ui └── main.cpp ├── framelesswidget ├── framelesswidget.cpp ├── framelesswidget.h ├── framelesswidget.pro ├── frmframelesswidget.cpp ├── frmframelesswidget.h ├── frmframelesswidget.ui └── main.cpp ├── gifwidget ├── gif.h ├── gifwidget.cpp ├── gifwidget.h ├── gifwidget.pro ├── image │ ├── gifwidget.ico │ └── gifwidget.png ├── main.cpp └── main.qrc ├── ipaddress ├── frmipaddress.cpp ├── frmipaddress.h ├── frmipaddress.ui ├── ipaddress.cpp ├── ipaddress.h ├── ipaddress.pro └── main.cpp ├── lightbutton ├── frmlightbutton.cpp ├── frmlightbutton.h ├── frmlightbutton.ui ├── lightbutton.cpp ├── lightbutton.gif ├── lightbutton.h ├── lightbutton.pro └── main.cpp ├── lineeditnext ├── lineeditnext.pro ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── lunarcalendarwidget ├── frmlunarcalendarwidget.cpp ├── frmlunarcalendarwidget.h ├── frmlunarcalendarwidget.ui ├── image │ ├── bg_calendar.png │ └── fontawesome-webfont.ttf ├── lunarcalendarinfo.cpp ├── lunarcalendarinfo.h ├── lunarcalendaritem.cpp ├── lunarcalendaritem.h ├── lunarcalendarwidget.cpp ├── lunarcalendarwidget.h ├── lunarcalendarwidget.pro ├── main.cpp └── main.qrc ├── maskwidget ├── frmmaskwidget.cpp ├── frmmaskwidget.h ├── frmmaskwidget.ui ├── main.cpp ├── maskwidget.cpp ├── maskwidget.h └── maskwidget.pro ├── mouseline ├── main.cpp ├── mouseline.pro ├── widget.cpp ├── widget.h └── widget.ui ├── movewidget ├── frmmovewidget.cpp ├── frmmovewidget.h ├── frmmovewidget.ui ├── main.cpp ├── movewidget.cpp ├── movewidget.h └── movewidget.pro ├── navbutton ├── frmnavbutton.cpp ├── frmnavbutton.h ├── frmnavbutton.ui ├── iconhelper.cpp ├── iconhelper.h ├── image │ └── fontawesome-webfont.ttf ├── main.cpp ├── main.qrc ├── navbutton.cpp ├── navbutton.h └── navbutton.pro ├── nettool ├── api │ ├── api.pri │ ├── app.cpp │ ├── app.h │ ├── quiwidget.cpp │ ├── quiwidget.h │ ├── tcpserver.cpp │ └── tcpserver.h ├── file │ ├── device.txt │ └── send.txt ├── form │ ├── form.pri │ ├── frmmain.cpp │ ├── frmmain.h │ ├── frmmain.ui │ ├── frmtcpclient.cpp │ ├── frmtcpclient.h │ ├── frmtcpclient.ui │ ├── frmtcpserver.cpp │ ├── frmtcpserver.h │ ├── frmtcpserver.ui │ ├── frmudpclient.cpp │ ├── frmudpclient.h │ ├── frmudpclient.ui │ ├── frmudpserver.cpp │ ├── frmudpserver.h │ └── frmudpserver.ui ├── head.h ├── main.cpp ├── nettool.pro ├── other │ ├── main.ico │ ├── main.qrc │ ├── main.rc │ ├── qt_zh_CN.qm │ └── widgets.qm ├── readme.txt └── snap │ ├── QQ截图20180514145725.jpg │ ├── QQ截图20180514145729.jpg │ ├── QQ截图20180514145732.jpg │ └── QQ截图20180514145909.jpg ├── ntpclient ├── frmntpclient.cpp ├── frmntpclient.h ├── frmntpclient.ui ├── main.cpp ├── ntpclient.cpp ├── ntpclient.h └── ntpclient.pro ├── pngtool ├── frmpngtool.cpp ├── frmpngtool.h ├── frmpngtool.ui ├── main.cpp └── pngtool.pro ├── qwtdemo ├── 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.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 ├── frmmain.cpp ├── frmmain.h ├── frmmain.ui ├── main.cpp ├── qwt │ ├── qwt.h │ ├── qwt.pri │ ├── 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_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_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 └── qwtdemo.pro ├── savelog ├── frmsavelog.cpp ├── frmsavelog.h ├── frmsavelog.ui ├── main.cpp ├── savelog.cpp ├── savelog.h └── savelog.pro ├── saveruntime ├── frmsaveruntime.cpp ├── frmsaveruntime.h ├── frmsaveruntime.ui ├── main.cpp ├── saveruntime.cpp ├── saveruntime.h └── saveruntime.pro ├── snap ├── battery.gif ├── bgdemo.gif ├── buttondefence.gif ├── colorwidget.gif ├── comtool.jpg ├── countcode.gif ├── dbpage.png ├── devicesizetable.gif ├── emailtool.jpg ├── flatui.gif ├── framelesswidget.gif ├── gifwidget.gif ├── ipaddress.gif ├── lightbutton.gif ├── lineeditnext.gif ├── lunarcalendarwidget.gif ├── maskwidget.gif ├── mouseline.gif ├── movewidget.gif ├── navbutton.gif ├── nettool.gif ├── ntpclient.gif ├── pngtool.gif ├── qwtdemo.jpg ├── styledemo_flatwhite.png ├── styledemo_lightblue.png ├── styledemo_psblack.png ├── videopanel.gif └── zhtopy.gif ├── styledemo ├── frmmain.cpp ├── frmmain.h ├── frmmain.ui ├── head.h ├── main.cpp ├── other │ ├── image │ │ ├── Font Awesome Cheatsheet.png │ │ ├── btn_close.png │ │ ├── btn_ok.png │ │ ├── fontawesome-webfont.ttf │ │ ├── msg_error.png │ │ ├── msg_info.png │ │ ├── msg_question.png │ │ ├── qt_zh_CN.qm │ │ └── widgets.qm │ ├── main.qrc │ ├── qss.qrc │ └── qss │ │ ├── flatwhite.css │ │ ├── flatwhite │ │ ├── add_bottom.png │ │ ├── add_left.png │ │ ├── add_right.png │ │ ├── add_top.png │ │ ├── branch_close.png │ │ ├── branch_open.png │ │ ├── calendar_nextmonth.png │ │ ├── calendar_prevmonth.png │ │ ├── checkbox_checked.png │ │ ├── checkbox_checked_disable.png │ │ ├── checkbox_parcial.png │ │ ├── checkbox_parcial_disable.png │ │ ├── checkbox_unchecked.png │ │ ├── checkbox_unchecked_disable.png │ │ ├── radiobutton_checked.png │ │ ├── radiobutton_checked_disable.png │ │ ├── radiobutton_unchecked.png │ │ └── radiobutton_unchecked_disable.png │ │ ├── lightblue.css │ │ ├── lightblue │ │ ├── add_bottom.png │ │ ├── add_left.png │ │ ├── add_right.png │ │ ├── add_top.png │ │ ├── branch_close.png │ │ ├── branch_open.png │ │ ├── calendar_nextmonth.png │ │ ├── calendar_prevmonth.png │ │ ├── checkbox_checked.png │ │ ├── checkbox_checked_disable.png │ │ ├── checkbox_parcial.png │ │ ├── checkbox_parcial_disable.png │ │ ├── checkbox_unchecked.png │ │ ├── checkbox_unchecked_disable.png │ │ ├── radiobutton_checked.png │ │ ├── radiobutton_checked_disable.png │ │ ├── radiobutton_unchecked.png │ │ └── radiobutton_unchecked_disable.png │ │ ├── psblack.css │ │ └── psblack │ │ ├── add_bottom.png │ │ ├── add_left.png │ │ ├── add_right.png │ │ ├── add_top.png │ │ ├── branch_close.png │ │ ├── branch_open.png │ │ ├── calendar_nextmonth.png │ │ ├── calendar_prevmonth.png │ │ ├── checkbox_checked.png │ │ ├── checkbox_checked_disable.png │ │ ├── checkbox_parcial.png │ │ ├── checkbox_parcial_disable.png │ │ ├── checkbox_unchecked.png │ │ ├── checkbox_unchecked_disable.png │ │ ├── radiobutton_checked.png │ │ ├── radiobutton_checked_disable.png │ │ ├── radiobutton_unchecked.png │ │ └── radiobutton_unchecked_disable.png ├── snap_flatwhite.png ├── snap_lightblue.png ├── snap_psblack.png └── styledemo.pro ├── videopanel ├── bg_novideo.png ├── frmmain.cpp ├── frmmain.h ├── frmmain.ui ├── main.cpp ├── main.qrc └── videopanel.pro └── zhtopy ├── frmzhtopy.cpp ├── frmzhtopy.h ├── frmzhtopy.ui ├── image └── zhtopy.txt ├── main.cpp ├── main.qrc ├── zhtopy.cpp ├── zhtopy.h └── zhtopy.pro /battery/battery.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-02-08T09:46:02 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = battery 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmbattery.cpp 18 | SOURCES += battery.cpp 19 | 20 | HEADERS += frmbattery.h 21 | HEADERS += battery.h 22 | 23 | FORMS += frmbattery.ui 24 | -------------------------------------------------------------------------------- /battery/frmbattery.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmbattery.h" 4 | #include "ui_frmbattery.h" 5 | 6 | frmBattery::frmBattery(QWidget *parent) : QWidget(parent), ui(new Ui::frmBattery) 7 | { 8 | ui->setupUi(this); 9 | this->initForm(); 10 | } 11 | 12 | frmBattery::~frmBattery() 13 | { 14 | delete ui; 15 | } 16 | 17 | void frmBattery::initForm() 18 | { 19 | connect(ui->horizontalSlider, SIGNAL(valueChanged(int)), ui->battery, SLOT(setValue(int))); 20 | ui->horizontalSlider->setValue(30); 21 | } 22 | -------------------------------------------------------------------------------- /battery/frmbattery.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMBATTERY_H 2 | #define FRMBATTERY_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class frmBattery; 9 | } 10 | 11 | class frmBattery : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit frmBattery(QWidget *parent = 0); 17 | ~frmBattery(); 18 | 19 | private: 20 | Ui::frmBattery *ui; 21 | 22 | private slots: 23 | void initForm(); 24 | }; 25 | 26 | #endif // FRMBATTERY_H 27 | -------------------------------------------------------------------------------- /battery/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmbattery.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmBattery w; 27 | w.setWindowTitle("电池电量控件"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /bgdemo/bgdemo.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-08-19T20:24:03 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = bgdemo 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | widget.cpp 17 | 18 | HEADERS += widget.h 19 | 20 | FORMS += widget.ui 21 | 22 | RESOURCES += \ 23 | rc.qrc 24 | -------------------------------------------------------------------------------- /bgdemo/image/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/bgdemo/image/1.png -------------------------------------------------------------------------------- /bgdemo/image/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/bgdemo/image/2.png -------------------------------------------------------------------------------- /bgdemo/image/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/bgdemo/image/3.png -------------------------------------------------------------------------------- /bgdemo/image/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/bgdemo/image/4.png -------------------------------------------------------------------------------- /bgdemo/image/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/bgdemo/image/5.png -------------------------------------------------------------------------------- /bgdemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /bgdemo/rc.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/1.png 4 | image/2.png 5 | image/3.png 6 | image/4.png 7 | image/5.png 8 | 9 | 10 | -------------------------------------------------------------------------------- /bgdemo/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Widget; 8 | } 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Widget(QWidget *parent = 0); 16 | ~Widget(); 17 | 18 | protected: 19 | bool eventFilter(QObject *watched, QEvent *evt); 20 | 21 | private: 22 | Ui::Widget *ui; 23 | }; 24 | 25 | #endif // WIDGET_H 26 | -------------------------------------------------------------------------------- /buttondefence/buttondefence.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2018-07-04T09:39:27 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = buttondefence 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmbuttondefence.cpp 18 | SOURCES += buttondefence.cpp 19 | 20 | HEADERS += frmbuttondefence.h 21 | HEADERS += buttondefence.h 22 | 23 | FORMS += frmbuttondefence.ui 24 | 25 | RESOURCES += main.qrc 26 | -------------------------------------------------------------------------------- /buttondefence/frmbuttondefence.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMBUTTONDEFENCE_H 2 | #define FRMBUTTONDEFENCE_H 3 | 4 | #include 5 | 6 | class ButtonDefence; 7 | class QPushButton; 8 | 9 | namespace Ui 10 | { 11 | class frmButtonDefence; 12 | } 13 | 14 | class frmButtonDefence : public QWidget 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit frmButtonDefence(QWidget *parent = 0); 20 | ~frmButtonDefence(); 21 | 22 | private slots: 23 | void initForm(); 24 | void changeStyle(); 25 | void changeStatus(); 26 | void on_ckCanMove_stateChanged(int arg1); 27 | 28 | private: 29 | Ui::frmButtonDefence *ui; 30 | ButtonDefence *btn1; 31 | ButtonDefence *btn2; 32 | ButtonDefence *btn3; 33 | QList btnStyle; 34 | QList btnStatus; 35 | }; 36 | 37 | #endif // FRMBUTTONDEFENCE_H 38 | -------------------------------------------------------------------------------- /buttondefence/image/bg_call.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/bg_call.jpg -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_alarm_bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_alarm_bubble.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_alarm_bubble2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_alarm_bubble2.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_alarm_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_alarm_circle.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_alarm_msg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_alarm_msg.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_alarm_msg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_alarm_msg2.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_alarm_police.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_alarm_police.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_arming_bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_arming_bubble.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_arming_bubble2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_arming_bubble2.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_arming_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_arming_circle.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_arming_msg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_arming_msg.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_arming_msg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_arming_msg2.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_arming_police.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_arming_police.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_bypass_bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_bypass_bubble.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_bypass_bubble2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_bypass_bubble2.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_bypass_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_bypass_circle.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_bypass_msg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_bypass_msg.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_bypass_msg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_bypass_msg2.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_bypass_police.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_bypass_police.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_disarming_bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_disarming_bubble.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_disarming_bubble2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_disarming_bubble2.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_disarming_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_disarming_circle.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_disarming_msg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_disarming_msg.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_disarming_msg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_disarming_msg2.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_disarming_police.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_disarming_police.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_error_bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_error_bubble.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_error_bubble2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_error_bubble2.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_error_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_error_circle.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_error_msg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_error_msg.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_error_msg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_error_msg2.png -------------------------------------------------------------------------------- /buttondefence/image/btn_defence_error_police.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/buttondefence/image/btn_defence_error_police.png -------------------------------------------------------------------------------- /buttondefence/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmbuttondefence.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmButtonDefence w; 27 | w.setWindowTitle("防区按钮控件"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /colorwidget/colorwidget.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-01-05T22:11:54 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = colorwidget 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += colorwidget.cpp 18 | HEADERS += colorwidget.h 19 | -------------------------------------------------------------------------------- /colorwidget/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "colorwidget.h" 4 | #include 5 | #include 6 | #include 7 | 8 | int main(int argc, char *argv[]) 9 | { 10 | QApplication a(argc, argv); 11 | a.setFont(QFont("Microsoft Yahei", 9)); 12 | 13 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 14 | #if _MSC_VER 15 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 16 | #else 17 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 18 | #endif 19 | QTextCodec::setCodecForLocale(codec); 20 | QTextCodec::setCodecForCStrings(codec); 21 | QTextCodec::setCodecForTr(codec); 22 | #else 23 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 24 | QTextCodec::setCodecForLocale(codec); 25 | #endif 26 | 27 | ColorWidget::Instance()->show(); 28 | 29 | return a.exec(); 30 | } 31 | -------------------------------------------------------------------------------- /comtool/api/api.pri: -------------------------------------------------------------------------------- 1 | HEADERS += \ 2 | $$PWD/app.h \ 3 | $$PWD/quiwidget.h 4 | 5 | SOURCES += \ 6 | $$PWD/app.cpp \ 7 | $$PWD/quiwidget.cpp 8 | -------------------------------------------------------------------------------- /comtool/file/device.txt: -------------------------------------------------------------------------------- 1 | 01 03 00 00 00 06 C5 C8;01 03 0C 00 01 00 01 00 00 00 01 00 01 00 01 37 DC -------------------------------------------------------------------------------- /comtool/file/send.txt: -------------------------------------------------------------------------------- 1 | 16 FF 01 01 E0 E1 2 | 16 FF 01 01 E1 E2 3 | 16 01 02 DF BC 16 01 02 DF BC 16 01 02 DF BC 12 13 14 15 4 | 16 00 00 04 D0 F0 F1 65 C4 5 | 16 00 00 04 D0 05 AB 5A C4 6 | 16 01 10 02 F0 03 06 16 01 11 02 F0 03 06 16 01 12 02 F0 03 06 16 01 13 02 F0 03 06 16 01 7 | 14 02 F0 03 06 16 01 15 02 F0 03 06 16 01 16 02 F0 03 06 8 | 16 11 01 03 E8 01 10 0E 9 | 16 11 01 03 E8 01 12 10 10 | 16 11 01 03 E8 01 14 12 11 | 16 11 01 03 E8 01 15 13 12 | DISARMEDALL 13 | BURGLARY 012 14 | BYPASS 012 15 | DISARMED 012 16 | 16 00 01 01 D1 D3 17 | 16 01 11 11 -------------------------------------------------------------------------------- /comtool/form/form.pri: -------------------------------------------------------------------------------- 1 | FORMS += \ 2 | $$PWD/frmcomtool.ui 3 | 4 | HEADERS += \ 5 | $$PWD/frmcomtool.h 6 | 7 | SOURCES += \ 8 | $$PWD/frmcomtool.cpp 9 | -------------------------------------------------------------------------------- /comtool/head.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #if (QT_VERSION > QT_VERSION_CHECK(5,0,0)) 6 | #include 7 | #endif 8 | 9 | #include "app.h" 10 | 11 | #pragma execution_character_set("utf-8") 12 | -------------------------------------------------------------------------------- /comtool/main.cpp: -------------------------------------------------------------------------------- 1 | #include "frmcomtool.h" 2 | #include "quiwidget.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | a.setWindowIcon(QIcon(":/main.ico")); 8 | 9 | QFont font; 10 | font.setFamily(QUIConfig::FontName); 11 | font.setPixelSize(QUIConfig::FontSize); 12 | a.setFont(font); 13 | 14 | //设置编码以及加载中文翻译文件 15 | QUIHelper::setCode(); 16 | QUIHelper::setTranslator(":/qt_zh_CN.qm"); 17 | QUIHelper::setTranslator(":/widgets.qm"); 18 | QUIHelper::initRand(); 19 | 20 | App::Intervals << "1" << "10" << "20" << "50" << "100" << "200" << "300" << "500" << "1000" << "1500" << "2000" << "3000" << "5000" << "10000"; 21 | App::ConfigFile = QString("%1/%2.ini").arg(QUIHelper::appPath()).arg(QUIHelper::appName()); 22 | App::readConfig(); 23 | App::readSendData(); 24 | App::readDeviceData(); 25 | 26 | frmComTool w; 27 | w.setWindowTitle("串口调试助手V2019 QQ: 517216493"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /comtool/other/main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/comtool/other/main.ico -------------------------------------------------------------------------------- /comtool/other/main.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.ico 4 | 5 | 6 | -------------------------------------------------------------------------------- /comtool/other/main.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "main.ico" -------------------------------------------------------------------------------- /comtool/qextserialport/qextserialport.pri: -------------------------------------------------------------------------------- 1 | HEADERS += \ 2 | $$PWD/qextserialport.h \ 3 | $$PWD/qextserialport_global.h \ 4 | $$PWD/qextserialport_p.h 5 | 6 | SOURCES += $$PWD/qextserialport.cpp 7 | 8 | win32:SOURCES += $$PWD/qextserialport_win.cpp 9 | unix:SOURCES += $$PWD/qextserialport_unix.cpp 10 | -------------------------------------------------------------------------------- /comtool/qextserialport/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/comtool/qextserialport/readme.txt -------------------------------------------------------------------------------- /comtool/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/comtool/readme.txt -------------------------------------------------------------------------------- /countcode/countcode.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-02-08T09:21:04 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = countcode 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmcountcode.cpp 18 | HEADERS += frmcountcode.h 19 | FORMS += frmcountcode.ui 20 | 21 | -------------------------------------------------------------------------------- /countcode/frmcountcode.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMCOUNTCODE_H 2 | #define FRMCOUNTCODE_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class frmCountCode; 8 | } 9 | 10 | class frmCountCode : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit frmCountCode(QWidget *parent = 0); 16 | ~frmCountCode(); 17 | 18 | private: 19 | Ui::frmCountCode *ui; 20 | QStringList listFile; 21 | 22 | private: 23 | void initForm(); 24 | bool checkFile(const QString &fileName); 25 | void countCode(const QString &filePath); 26 | void countCode(const QStringList &files); 27 | void countCode(const QString &fileName, int &lineCode, int &lineBlank, int &lineNotes); 28 | 29 | private slots: 30 | void on_btnOpenFile_clicked(); 31 | void on_btnOpenPath_clicked(); 32 | void on_btnClear_clicked(); 33 | }; 34 | 35 | #endif // FRMCOUNTCODE_H 36 | -------------------------------------------------------------------------------- /countcode/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmcountcode.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmCountCode w; 27 | w.setWindowTitle("代码行数统计"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /dbpage/TA.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/dbpage/TA.db -------------------------------------------------------------------------------- /dbpage/dbpage.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-01-15T14:34:50 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui sql 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = dbpage 12 | TEMPLATE = app 13 | MOC_DIR = temp/moc 14 | RCC_DIR = temp/rcc 15 | UI_DIR = temp/ui 16 | OBJECTS_DIR = temp/obj 17 | DESTDIR = bin 18 | PRECOMPILED_HEADER = head.h 19 | 20 | INCLUDEPATH += $$PWD 21 | CONFIG += warn_off 22 | 23 | SOURCES += \ 24 | main.cpp \ 25 | dbpage.cpp \ 26 | frmdbpage.cpp 27 | 28 | HEADERS += \ 29 | dbpage.h \ 30 | frmdbpage.h 31 | 32 | FORMS += \ 33 | frmdbpage.ui 34 | -------------------------------------------------------------------------------- /dbpage/frmdbpage.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMDBPAGE_H 2 | #define FRMDBPAGE_H 3 | 4 | #include 5 | 6 | class DbPage; 7 | 8 | namespace Ui { 9 | class frmDbPage; 10 | } 11 | 12 | class frmDbPage : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit frmDbPage(QWidget *parent = 0); 18 | ~frmDbPage(); 19 | 20 | private: 21 | Ui::frmDbPage *ui; 22 | 23 | QList columnNames; //字段名集合 24 | QList columnWidths; //字段宽度集合 25 | DbPage *dbPage; //数据库翻页类 26 | 27 | QString tableName; //表名称 28 | QString countName; //统计行数字段名称 29 | 30 | private slots: 31 | void initForm(); 32 | 33 | private slots: 34 | void on_btnSelect_clicked(); 35 | }; 36 | 37 | #endif // FRMDBPAGE_H 38 | -------------------------------------------------------------------------------- /dbpage/head.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #if (QT_VERSION > QT_VERSION_CHECK(5,0,0)) 5 | #include 6 | #endif 7 | 8 | #pragma execution_character_set("utf-8") 9 | -------------------------------------------------------------------------------- /dbpage/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/dbpage/readme.txt -------------------------------------------------------------------------------- /devicesizetable/devicesizetable.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-02-08T10:02:20 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = devicesizetable 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmdevicesizetable.cpp 18 | SOURCES += devicesizetable.cpp 19 | 20 | HEADERS += frmdevicesizetable.h 21 | HEADERS += devicesizetable.h 22 | 23 | FORMS += frmdevicesizetable.ui 24 | -------------------------------------------------------------------------------- /devicesizetable/frmdevicesizetable.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmdevicesizetable.h" 4 | #include "ui_frmdevicesizetable.h" 5 | 6 | frmDeviceSizeTable::frmDeviceSizeTable(QWidget *parent) : QWidget(parent), ui(new Ui::frmDeviceSizeTable) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | frmDeviceSizeTable::~frmDeviceSizeTable() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /devicesizetable/frmdevicesizetable.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMDEVICESIZETABLE_H 2 | #define FRMDEVICESIZETABLE_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class frmDeviceSizeTable; 9 | } 10 | 11 | class frmDeviceSizeTable : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit frmDeviceSizeTable(QWidget *parent = 0); 17 | ~frmDeviceSizeTable(); 18 | 19 | private: 20 | Ui::frmDeviceSizeTable *ui; 21 | }; 22 | 23 | #endif // FRMDEVICESIZETABLE_H 24 | -------------------------------------------------------------------------------- /devicesizetable/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmdevicesizetable.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmDeviceSizeTable w; 27 | w.setWindowTitle("本地存储空间大小控件"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /emailtool/emailtool.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2016-09-29T13:23:25 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network sql xml 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = emailtool 12 | TEMPLATE = app 13 | MOC_DIR = temp/moc 14 | RCC_DIR = temp/rcc 15 | UI_DIR = temp/ui 16 | OBJECTS_DIR = temp/obj 17 | DESTDIR = bin 18 | 19 | CONFIG += warn_off 20 | SOURCES += main.cpp 21 | SOURCES += frmemailtool.cpp 22 | HEADERS += frmemailtool.h 23 | FORMS += frmemailtool.ui 24 | 25 | include ($$PWD/sendemail/sendemail.pri) 26 | INCLUDEPATH += $$PWD 27 | INCLUDEPATH += $$PWD/sendemail 28 | -------------------------------------------------------------------------------- /emailtool/frmemailtool.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMEMAILTOOL_H 2 | #define FRMEMAILTOOL_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class frmEmailTool; 9 | } 10 | 11 | class frmEmailTool : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit frmEmailTool(QWidget *parent = 0); 17 | ~frmEmailTool(); 18 | 19 | private: 20 | Ui::frmEmailTool *ui; 21 | 22 | private: 23 | bool check(); 24 | 25 | private slots: 26 | void initForm(); 27 | void receiveEmailResult(QString result); 28 | 29 | private slots: 30 | void on_btnSend_clicked(); 31 | void on_btnSelect_clicked(); 32 | void on_cboxServer_currentIndexChanged(int index); 33 | }; 34 | 35 | #endif // FRMEMAILTOOL_H 36 | -------------------------------------------------------------------------------- /emailtool/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmemailtool.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmEmailTool w; 27 | w.setWindowTitle("邮件发送工具"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /emailtool/sendemail/emailaddress.cpp: -------------------------------------------------------------------------------- 1 | #include "emailaddress.h" 2 | 3 | EmailAddress::EmailAddress(const QString &address, const QString &name) 4 | { 5 | this->address = address; 6 | this->name = name; 7 | } 8 | 9 | EmailAddress::~EmailAddress() 10 | { 11 | } 12 | 13 | void EmailAddress::setName(const QString &name) 14 | { 15 | this->name = name; 16 | } 17 | 18 | void EmailAddress::setAddress(const QString &address) 19 | { 20 | this->address = address; 21 | } 22 | 23 | const QString &EmailAddress::getName() const 24 | { 25 | return name; 26 | } 27 | 28 | const QString &EmailAddress::getAddress() const 29 | { 30 | return address; 31 | } 32 | -------------------------------------------------------------------------------- /emailtool/sendemail/emailaddress.h: -------------------------------------------------------------------------------- 1 | #ifndef EMAILADDRESS_H 2 | #define EMAILADDRESS_H 3 | 4 | #include 5 | 6 | class EmailAddress : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | 11 | EmailAddress(); 12 | EmailAddress(const QString &address, const QString &name = ""); 13 | 14 | ~EmailAddress(); 15 | 16 | void setName(const QString &name); 17 | void setAddress(const QString &address); 18 | 19 | const QString &getName() const; 20 | const QString &getAddress() const; 21 | 22 | private: 23 | QString name; 24 | QString address; 25 | 26 | }; 27 | 28 | #endif // EMAILADDRESS_H 29 | -------------------------------------------------------------------------------- /emailtool/sendemail/mimeattachment.cpp: -------------------------------------------------------------------------------- 1 | #include "mimeattachment.h" 2 | #include 3 | 4 | MimeAttachment::MimeAttachment(QFile *file) 5 | : MimeFile(file) 6 | { 7 | } 8 | 9 | MimeAttachment::~MimeAttachment() 10 | { 11 | } 12 | 13 | void MimeAttachment::prepare() 14 | { 15 | this->header += "Content-disposition: attachment\r\n"; 16 | MimeFile::prepare(); 17 | } 18 | -------------------------------------------------------------------------------- /emailtool/sendemail/mimeattachment.h: -------------------------------------------------------------------------------- 1 | #ifndef MIMEATTACHMENT_H 2 | #define MIMEATTACHMENT_H 3 | 4 | #include 5 | #include "mimepart.h" 6 | #include "mimefile.h" 7 | 8 | class MimeAttachment : public MimeFile 9 | { 10 | Q_OBJECT 11 | public: 12 | MimeAttachment(QFile *file); 13 | ~MimeAttachment(); 14 | 15 | protected: 16 | virtual void prepare(); 17 | 18 | }; 19 | 20 | #endif // MIMEATTACHMENT_H 21 | -------------------------------------------------------------------------------- /emailtool/sendemail/mimecontentformatter.h: -------------------------------------------------------------------------------- 1 | #ifndef MIMECONTENTFORMATTER_H 2 | #define MIMECONTENTFORMATTER_H 3 | 4 | #include 5 | #include 6 | 7 | class MimeContentFormatter : public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | MimeContentFormatter(int max_length = 76); 12 | 13 | void setMaxLength(int l); 14 | int getMaxLength() const; 15 | 16 | QString format(const QString &content, bool quotedPrintable = false) const; 17 | 18 | protected: 19 | int max_length; 20 | 21 | }; 22 | 23 | #endif // MIMECONTENTFORMATTER_H 24 | -------------------------------------------------------------------------------- /emailtool/sendemail/mimefile.cpp: -------------------------------------------------------------------------------- 1 | #include "mimefile.h" 2 | #include 3 | 4 | MimeFile::MimeFile(QFile *file) 5 | { 6 | this->file = file; 7 | this->cType = "application/octet-stream"; 8 | this->cName = QFileInfo(*file).fileName(); 9 | this->cEncoding = Base64; 10 | } 11 | 12 | MimeFile::~MimeFile() 13 | { 14 | delete file; 15 | } 16 | 17 | void MimeFile::prepare() 18 | { 19 | file->open(QIODevice::ReadOnly); 20 | this->content = file->readAll(); 21 | file->close(); 22 | MimePart::prepare(); 23 | } 24 | -------------------------------------------------------------------------------- /emailtool/sendemail/mimefile.h: -------------------------------------------------------------------------------- 1 | #ifndef MIMEFILE_H 2 | #define MIMEFILE_H 3 | 4 | #include "mimepart.h" 5 | #include 6 | 7 | class MimeFile : public MimePart 8 | { 9 | Q_OBJECT 10 | public: 11 | 12 | MimeFile(QFile *f); 13 | ~MimeFile(); 14 | 15 | protected: 16 | QFile *file; 17 | virtual void prepare(); 18 | 19 | }; 20 | 21 | #endif // MIMEFILE_H 22 | -------------------------------------------------------------------------------- /emailtool/sendemail/mimehtml.cpp: -------------------------------------------------------------------------------- 1 | #include "mimehtml.h" 2 | 3 | MimeHtml::MimeHtml(const QString &html) : MimeText(html) 4 | { 5 | this->cType = "text/html"; 6 | } 7 | 8 | MimeHtml::~MimeHtml() {} 9 | 10 | void MimeHtml::setHtml(const QString &html) 11 | { 12 | this->text = html; 13 | } 14 | 15 | const QString &MimeHtml::getHtml() const 16 | { 17 | return text; 18 | } 19 | 20 | void MimeHtml::prepare() 21 | { 22 | MimeText::prepare(); 23 | } 24 | -------------------------------------------------------------------------------- /emailtool/sendemail/mimehtml.h: -------------------------------------------------------------------------------- 1 | #ifndef MIMEHTML_H 2 | #define MIMEHTML_H 3 | 4 | #include "mimetext.h" 5 | 6 | class MimeHtml : public MimeText 7 | { 8 | Q_OBJECT 9 | public: 10 | MimeHtml(const QString &html = ""); 11 | ~MimeHtml(); 12 | 13 | void setHtml(const QString &html); 14 | const QString &getHtml() const; 15 | 16 | protected: 17 | virtual void prepare(); 18 | 19 | }; 20 | 21 | #endif // MIMEHTML_H 22 | -------------------------------------------------------------------------------- /emailtool/sendemail/mimeinlinefile.cpp: -------------------------------------------------------------------------------- 1 | #include "mimeinlinefile.h" 2 | 3 | MimeInlineFile::MimeInlineFile(QFile *f) 4 | : MimeFile(f) 5 | { 6 | } 7 | 8 | MimeInlineFile::~MimeInlineFile() 9 | {} 10 | 11 | void MimeInlineFile::prepare() 12 | { 13 | this->header += "Content-Disposition: inline\r\n"; 14 | MimeFile::prepare(); 15 | } 16 | -------------------------------------------------------------------------------- /emailtool/sendemail/mimeinlinefile.h: -------------------------------------------------------------------------------- 1 | #ifndef MIMEINLINEFILE_H 2 | #define MIMEINLINEFILE_H 3 | 4 | #include "mimefile.h" 5 | 6 | class MimeInlineFile : public MimeFile 7 | { 8 | public: 9 | 10 | MimeInlineFile(QFile *f); 11 | ~MimeInlineFile(); 12 | 13 | protected: 14 | virtual void prepare(); 15 | 16 | }; 17 | 18 | #endif // MIMEINLINEFILE_H 19 | -------------------------------------------------------------------------------- /emailtool/sendemail/mimemultipart.h: -------------------------------------------------------------------------------- 1 | #ifndef MIMEMULTIPART_H 2 | #define MIMEMULTIPART_H 3 | 4 | #include "mimepart.h" 5 | 6 | class MimeMultiPart : public MimePart 7 | { 8 | Q_OBJECT 9 | public: 10 | enum MultiPartType { 11 | Mixed = 0, // RFC 2046, section 5.1.3 12 | Digest = 1, // RFC 2046, section 5.1.5 13 | Alternative = 2, // RFC 2046, section 5.1.4 14 | Related = 3, // RFC 2387 15 | Report = 4, // RFC 6522 16 | Signed = 5, // RFC 1847, section 2.1 17 | Encrypted = 6 // RFC 1847, section 2.2 18 | }; 19 | 20 | MimeMultiPart(const MultiPartType type = Related); 21 | ~MimeMultiPart(); 22 | 23 | void setMimeType(const MultiPartType type); 24 | MultiPartType getMimeType() const; 25 | 26 | const QList &getParts() const; 27 | 28 | void addPart(MimePart *part); 29 | virtual void prepare(); 30 | 31 | protected: 32 | QList parts; 33 | MultiPartType type; 34 | 35 | }; 36 | 37 | #endif // MIMEMULTIPART_H 38 | -------------------------------------------------------------------------------- /emailtool/sendemail/mimetext.cpp: -------------------------------------------------------------------------------- 1 | #include "mimetext.h" 2 | 3 | MimeText::MimeText(const QString &txt) 4 | { 5 | this->text = txt; 6 | this->cType = "text/plain"; 7 | this->cCharset = "utf-8"; 8 | this->cEncoding = _8Bit; 9 | } 10 | 11 | MimeText::~MimeText() { } 12 | 13 | void MimeText::setText(const QString &text) 14 | { 15 | this->text = text; 16 | } 17 | 18 | const QString &MimeText::getText() const 19 | { 20 | return text; 21 | } 22 | 23 | void MimeText::prepare() 24 | { 25 | this->content.clear(); 26 | this->content.append(text); 27 | MimePart::prepare(); 28 | } 29 | -------------------------------------------------------------------------------- /emailtool/sendemail/mimetext.h: -------------------------------------------------------------------------------- 1 | #ifndef MIMETEXT_H 2 | #define MIMETEXT_H 3 | 4 | #include "mimepart.h" 5 | 6 | class MimeText : public MimePart 7 | { 8 | public: 9 | 10 | MimeText(const QString &text = ""); 11 | ~MimeText(); 12 | 13 | void setText(const QString &text); 14 | const QString &getText() const; 15 | 16 | protected: 17 | QString text; 18 | void prepare(); 19 | 20 | }; 21 | 22 | #endif // MIMETEXT_H 23 | -------------------------------------------------------------------------------- /emailtool/sendemail/quotedprintable.h: -------------------------------------------------------------------------------- 1 | #ifndef QUOTEDPRINTABLE_H 2 | #define QUOTEDPRINTABLE_H 3 | 4 | #include 5 | #include 6 | 7 | class QuotedPrintable : public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | 12 | static QString &encode(const QByteArray &input); 13 | static QByteArray &decode(const QString &input); 14 | 15 | private: 16 | QuotedPrintable(); 17 | }; 18 | 19 | #endif // QUOTEDPRINTABLE_H 20 | -------------------------------------------------------------------------------- /emailtool/sendemail/sendemail.pri: -------------------------------------------------------------------------------- 1 | HEADERS += \ 2 | $$PWD/emailaddress.h \ 3 | $$PWD/mimeattachment.h \ 4 | $$PWD/mimecontentformatter.h \ 5 | $$PWD/mimefile.h \ 6 | $$PWD/mimehtml.h \ 7 | $$PWD/mimeinlinefile.h \ 8 | $$PWD/mimemessage.h \ 9 | $$PWD/mimemultipart.h \ 10 | $$PWD/mimepart.h \ 11 | $$PWD/mimetext.h \ 12 | $$PWD/quotedprintable.h \ 13 | $$PWD/smtpclient.h \ 14 | $$PWD/smtpmime.h \ 15 | $$PWD/sendemailthread.h 16 | 17 | SOURCES += \ 18 | $$PWD/emailaddress.cpp \ 19 | $$PWD/mimeattachment.cpp \ 20 | $$PWD/mimecontentformatter.cpp \ 21 | $$PWD/mimefile.cpp \ 22 | $$PWD/mimehtml.cpp \ 23 | $$PWD/mimeinlinefile.cpp \ 24 | $$PWD/mimemessage.cpp \ 25 | $$PWD/mimemultipart.cpp \ 26 | $$PWD/mimepart.cpp \ 27 | $$PWD/mimetext.cpp \ 28 | $$PWD/quotedprintable.cpp \ 29 | $$PWD/smtpclient.cpp \ 30 | $$PWD/sendemailthread.cpp 31 | -------------------------------------------------------------------------------- /emailtool/sendemail/smtpmime.h: -------------------------------------------------------------------------------- 1 | #ifndef SMTPMIME_H 2 | #define SMTPMIME_H 3 | 4 | #include "smtpclient.h" 5 | #include "mimepart.h" 6 | #include "mimehtml.h" 7 | #include "mimeattachment.h" 8 | #include "mimemessage.h" 9 | #include "mimetext.h" 10 | #include "mimeinlinefile.h" 11 | #include "mimefile.h" 12 | 13 | #endif // SMTPMIME_H 14 | -------------------------------------------------------------------------------- /flatui/flatui.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-01-09T09:29:12 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = flatui 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmflatui.cpp 18 | SOURCES += flatui.cpp 19 | 20 | HEADERS += frmflatui.h 21 | HEADERS += flatui.h 22 | 23 | FORMS += frmflatui.ui 24 | -------------------------------------------------------------------------------- /flatui/frmflatui.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMFLATUI_H 2 | #define FRMFLATUI_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class frmFlatUI; 9 | } 10 | 11 | class frmFlatUI : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit frmFlatUI(QWidget *parent = 0); 17 | ~frmFlatUI(); 18 | 19 | private: 20 | Ui::frmFlatUI *ui; 21 | 22 | private slots: 23 | void initForm(); 24 | }; 25 | 26 | #endif // FRMFLATUI_H 27 | -------------------------------------------------------------------------------- /flatui/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmflatui.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmFlatUI w; 27 | w.setWindowTitle("FlatUI控件集合"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /framelesswidget/framelesswidget.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2019-10-03T10:55:58 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = framelesswidget 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmframelesswidget.cpp 18 | SOURCES += framelesswidget.cpp 19 | 20 | HEADERS += frmframelesswidget.h 21 | HEADERS += framelesswidget.h 22 | 23 | FORMS += frmframelesswidget.ui 24 | -------------------------------------------------------------------------------- /framelesswidget/frmframelesswidget.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMFRAMELESSWIDGET_H 2 | #define FRMFRAMELESSWIDGET_H 3 | 4 | #include 5 | class FramelessWidget; 6 | 7 | namespace Ui 8 | { 9 | class frmFramelessWidget; 10 | } 11 | 12 | class frmFramelessWidget : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit frmFramelessWidget(QWidget *parent = 0); 18 | ~frmFramelessWidget(); 19 | 20 | protected: 21 | void closeEvent(QCloseEvent *); 22 | 23 | private: 24 | Ui::frmFramelessWidget *ui; 25 | QWidget *w; 26 | FramelessWidget *frameless; 27 | 28 | private slots: 29 | void on_btnOpen_clicked(); 30 | void stateChanged1(int arg1); 31 | void stateChanged2(int arg1); 32 | }; 33 | 34 | #endif // FRMFRAMELESSWIDGET_H 35 | -------------------------------------------------------------------------------- /framelesswidget/frmframelesswidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | frmFramelessWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 600 10 | 480 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 10 20 | 10 21 | 181 22 | 23 23 | 24 | 25 | 26 | 弹窗无边框窗体 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /framelesswidget/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmframelesswidget.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmFramelessWidget w; 27 | w.setWindowTitle("无边框窗体类"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /gifwidget/gifwidget.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-01-05T22:11:54 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = gifwidget 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += gifwidget.cpp 18 | HEADERS += gifwidget.h 19 | HEADERS += gif.h 20 | RESOURCES += main.qrc 21 | -------------------------------------------------------------------------------- /gifwidget/image/gifwidget.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/gifwidget/image/gifwidget.ico -------------------------------------------------------------------------------- /gifwidget/image/gifwidget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/gifwidget/image/gifwidget.png -------------------------------------------------------------------------------- /gifwidget/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "gifwidget.h" 4 | #include 5 | #include 6 | #include 7 | 8 | int main(int argc, char *argv[]) 9 | { 10 | QApplication a(argc, argv); 11 | a.setFont(QFont("Microsoft Yahei", 9)); 12 | a.setWindowIcon(QIcon(":/image/gifwidget.ico")); 13 | 14 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 15 | #if _MSC_VER 16 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 17 | #else 18 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 19 | #endif 20 | QTextCodec::setCodecForLocale(codec); 21 | QTextCodec::setCodecForCStrings(codec); 22 | QTextCodec::setCodecForTr(codec); 23 | #else 24 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 25 | QTextCodec::setCodecForLocale(codec); 26 | #endif 27 | 28 | GifWidget::Instance()->show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /gifwidget/main.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/gifwidget.ico 4 | 5 | 6 | -------------------------------------------------------------------------------- /ipaddress/frmipaddress.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmipaddress.h" 4 | #include "ui_frmipaddress.h" 5 | #include "qdebug.h" 6 | 7 | frmIPAddress::frmIPAddress(QWidget *parent) : QWidget(parent), ui(new Ui::frmIPAddress) 8 | { 9 | ui->setupUi(this); 10 | } 11 | 12 | frmIPAddress::~frmIPAddress() 13 | { 14 | delete ui; 15 | } 16 | 17 | void frmIPAddress::on_btnSetIP_clicked() 18 | { 19 | ui->widgetIP->setIP("192.168.1.56"); 20 | } 21 | 22 | void frmIPAddress::on_btnGetIP_clicked() 23 | { 24 | qDebug() << ui->widgetIP->getIP(); 25 | } 26 | 27 | void frmIPAddress::on_btnClear_clicked() 28 | { 29 | ui->widgetIP->clear(); 30 | } 31 | -------------------------------------------------------------------------------- /ipaddress/frmipaddress.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMADDRESS_H 2 | #define FRMADDRESS_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class frmIPAddress; 8 | } 9 | 10 | class frmIPAddress : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit frmIPAddress(QWidget *parent = 0); 16 | ~frmIPAddress(); 17 | 18 | private: 19 | Ui::frmIPAddress *ui; 20 | 21 | private slots: 22 | void on_btnSetIP_clicked(); 23 | void on_btnGetIP_clicked(); 24 | void on_btnClear_clicked(); 25 | 26 | }; 27 | 28 | #endif // FRMADDRESS_H 29 | -------------------------------------------------------------------------------- /ipaddress/ipaddress.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-08-10T17:11:52 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = ipaddress 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmipaddress.cpp 18 | SOURCES += ipaddress.cpp 19 | 20 | HEADERS += frmipaddress.h 21 | HEADERS += ipaddress.h 22 | 23 | FORMS += frmipaddress.ui 24 | -------------------------------------------------------------------------------- /ipaddress/main.cpp: -------------------------------------------------------------------------------- 1 | #include "frmipaddress.h" 2 | #include 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | a.setFont(QFont("Microsoft Yahei", 9)); 9 | 10 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 11 | #if _MSC_VER 12 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 13 | #else 14 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 15 | #endif 16 | QTextCodec::setCodecForLocale(codec); 17 | QTextCodec::setCodecForCStrings(codec); 18 | QTextCodec::setCodecForTr(codec); 19 | #else 20 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 21 | QTextCodec::setCodecForLocale(codec); 22 | #endif 23 | 24 | frmIPAddress w; 25 | w.show(); 26 | 27 | return a.exec(); 28 | } 29 | -------------------------------------------------------------------------------- /lightbutton/frmlightbutton.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMLIGHTBUTTON_H 2 | #define FRMLIGHTBUTTON_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class frmLightButton; 9 | } 10 | 11 | class frmLightButton : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit frmLightButton(QWidget *parent = 0); 17 | ~frmLightButton(); 18 | 19 | private: 20 | Ui::frmLightButton *ui; 21 | int type; 22 | 23 | private slots: 24 | void initForm(); 25 | void updateValue(); 26 | }; 27 | 28 | #endif // FRMLIGHTBUTTON_H 29 | -------------------------------------------------------------------------------- /lightbutton/frmlightbutton.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | frmLightButton 4 | 5 | 6 | 7 | 0 8 | 0 9 | 500 10 | 300 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | LightButton 31 | QWidget 32 |
lightbutton.h
33 | 1 34 |
35 |
36 | 37 | 38 |
39 | -------------------------------------------------------------------------------- /lightbutton/lightbutton.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/lightbutton/lightbutton.gif -------------------------------------------------------------------------------- /lightbutton/lightbutton.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-02-08T15:04:18 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = lightbutton 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmlightbutton.cpp 18 | SOURCES += lightbutton.cpp 19 | 20 | HEADERS += frmlightbutton.h 21 | HEADERS += lightbutton.h 22 | 23 | FORMS += frmlightbutton.ui 24 | -------------------------------------------------------------------------------- /lightbutton/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmlightbutton.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmLightButton w; 27 | w.setWindowTitle("高亮发光按钮"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /lineeditnext/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /lineeditnext/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | #include "qlineedit.h" 4 | 5 | Widget::Widget(QWidget *parent) : 6 | QWidget(parent), 7 | ui(new Ui::Widget) 8 | { 9 | ui->setupUi(this); 10 | connect(ui->lineEdit1, SIGNAL(returnPressed()), this, SLOT(next())); 11 | connect(ui->lineEdit2, SIGNAL(returnPressed()), this, SLOT(next())); 12 | connect(ui->lineEdit3, SIGNAL(returnPressed()), this, SLOT(next())); 13 | } 14 | 15 | Widget::~Widget() 16 | { 17 | delete ui; 18 | } 19 | 20 | void Widget::next() 21 | { 22 | QLineEdit *lineEdit = (QLineEdit *)sender(); 23 | if (lineEdit == ui->lineEdit1) { 24 | ui->lineEdit2->setFocus(); 25 | } else if (lineEdit == ui->lineEdit2) { 26 | ui->lineEdit3->setFocus(); 27 | } else if (lineEdit == ui->lineEdit3) { 28 | ui->lineEdit1->setFocus(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lineeditnext/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Widget; 8 | } 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Widget(QWidget *parent = 0); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | 21 | private slots: 22 | void next(); 23 | }; 24 | 25 | #endif // WIDGET_H 26 | -------------------------------------------------------------------------------- /lunarcalendarwidget/frmlunarcalendarwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMLUNARCALENDARWIDGET_H 2 | #define FRMLUNARCALENDARWIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class frmLunarCalendarWidget; 8 | } 9 | 10 | class frmLunarCalendarWidget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit frmLunarCalendarWidget(QWidget *parent = 0); 16 | ~frmLunarCalendarWidget(); 17 | 18 | private: 19 | Ui::frmLunarCalendarWidget *ui; 20 | 21 | private slots: 22 | void initForm(); 23 | void on_cboxCalendarStyle_currentIndexChanged(int index); 24 | void on_cboxSelectType_currentIndexChanged(int index); 25 | void on_cboxWeekNameFormat_currentIndexChanged(int index); 26 | void on_ckShowLunar_stateChanged(int arg1); 27 | }; 28 | 29 | #endif // FRMLUNARCALENDARWIDGET_H 30 | -------------------------------------------------------------------------------- /lunarcalendarwidget/image/bg_calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/lunarcalendarwidget/image/bg_calendar.png -------------------------------------------------------------------------------- /lunarcalendarwidget/image/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/lunarcalendarwidget/image/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /lunarcalendarwidget/lunarcalendarwidget.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-01-05T22:11:54 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = lunarcalendarwidget 12 | TEMPLATE = app 13 | MOC_DIR = temp/moc 14 | RCC_DIR = temp/rcc 15 | UI_DIR = temp/ui 16 | OBJECTS_DIR = temp/obj 17 | DESTDIR = $$PWD/../bin 18 | CONFIG += qt warn_off 19 | RESOURCES += main.qrc 20 | 21 | SOURCES += main.cpp 22 | SOURCES += frmlunarcalendarwidget.cpp 23 | SOURCES += lunarcalendaritem.cpp 24 | SOURCES += lunarcalendarinfo.cpp 25 | SOURCES += lunarcalendarwidget.cpp 26 | 27 | HEADERS += frmlunarcalendarwidget.h 28 | HEADERS += lunarcalendaritem.h 29 | HEADERS += lunarcalendarinfo.h 30 | HEADERS += lunarcalendarwidget.h 31 | 32 | FORMS += frmlunarcalendarwidget.ui 33 | 34 | INCLUDEPATH += $$PWD 35 | -------------------------------------------------------------------------------- /lunarcalendarwidget/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmlunarcalendarwidget.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmLunarCalendarWidget w; 27 | w.setWindowTitle("自定义农历控件"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /lunarcalendarwidget/main.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/bg_calendar.png 4 | image/fontawesome-webfont.ttf 5 | 6 | 7 | -------------------------------------------------------------------------------- /maskwidget/frmmaskwidget.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmmaskwidget.h" 4 | #include "ui_frmmaskwidget.h" 5 | #include "maskwidget.h" 6 | #include "qdialog.h" 7 | 8 | frmMaskWidget::frmMaskWidget(QWidget *parent) : QWidget(parent), ui(new Ui::frmMaskWidget) 9 | { 10 | ui->setupUi(this); 11 | MaskWidget::Instance()->setMainWidget(this); 12 | MaskWidget::Instance()->setDialogNames(QStringList() << "frmTest"); 13 | } 14 | 15 | frmMaskWidget::~frmMaskWidget() 16 | { 17 | delete ui; 18 | exit(0); 19 | } 20 | 21 | void frmMaskWidget::on_pushButton_clicked() 22 | { 23 | QDialog d; 24 | d.setObjectName("frmTest"); 25 | d.setWindowTitle("遮罩层弹出窗体"); 26 | d.resize(400, 300); 27 | d.exec(); 28 | } 29 | -------------------------------------------------------------------------------- /maskwidget/frmmaskwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMMASKWIDGET_H 2 | #define FRMMASKWIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class frmMaskWidget; 8 | } 9 | 10 | class frmMaskWidget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit frmMaskWidget(QWidget *parent = 0); 16 | ~frmMaskWidget(); 17 | 18 | private slots: 19 | void on_pushButton_clicked(); 20 | 21 | private: 22 | Ui::frmMaskWidget *ui; 23 | }; 24 | 25 | #endif // FRMMASKWIDGET_H 26 | -------------------------------------------------------------------------------- /maskwidget/frmmaskwidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | frmMaskWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 600 10 | 480 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 10 20 | 10 21 | 131 22 | 23 23 | 24 | 25 | 26 | 弹出遮罩窗体 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /maskwidget/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmmaskwidget.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmMaskWidget w; 27 | w.setWindowTitle("遮罩层窗体"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /maskwidget/maskwidget.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-01-05T22:11:54 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = maskwidget 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += maskwidget.cpp 18 | SOURCES += frmmaskwidget.cpp 19 | 20 | HEADERS += maskwidget.h 21 | HEADERS += frmmaskwidget.h 22 | 23 | FORMS += frmmaskwidget.ui 24 | 25 | 26 | -------------------------------------------------------------------------------- /mouseline/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /mouseline/mouseline.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2018-08-13T14:27:21 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = mouseline 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | widget.cpp 17 | 18 | HEADERS += widget.h 19 | 20 | FORMS += widget.ui 21 | -------------------------------------------------------------------------------- /mouseline/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | #include "qpainter.h" 4 | #include "qevent.h" 5 | #include "qdebug.h" 6 | 7 | Widget::Widget(QWidget *parent) : 8 | QWidget(parent), 9 | ui(new Ui::Widget) 10 | { 11 | ui->setupUi(this); 12 | this->setMouseTracking(true); 13 | } 14 | 15 | Widget::~Widget() 16 | { 17 | delete ui; 18 | } 19 | 20 | void Widget::mouseMoveEvent(QMouseEvent *event) 21 | { 22 | lastPos = event->pos(); 23 | update(); 24 | } 25 | 26 | void Widget::mouseReleaseEvent(QMouseEvent *event) 27 | { 28 | //这里是鼠标按下的坐标,自己存到数据库 29 | lastPos = event->pos(); 30 | update(); 31 | qDebug() << lastPos; 32 | } 33 | 34 | void Widget::paintEvent(QPaintEvent *) 35 | { 36 | QPainter painter(this); 37 | 38 | QPen pen; 39 | pen.setWidth(5); 40 | pen.setColor(Qt::red); 41 | painter.setPen(pen); 42 | 43 | //绘制横向线 44 | painter.drawLine(0, lastPos.y(), width(), lastPos.y()); 45 | //绘制纵向线 46 | painter.drawLine(lastPos.x(), 0, lastPos.x(), height()); 47 | } 48 | -------------------------------------------------------------------------------- /mouseline/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Widget; 8 | } 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Widget(QWidget *parent = 0); 16 | ~Widget(); 17 | 18 | protected: 19 | void mouseMoveEvent(QMouseEvent *event); 20 | void mouseReleaseEvent(QMouseEvent *event); 21 | void paintEvent(QPaintEvent *); 22 | 23 | private: 24 | Ui::Widget *ui; 25 | QPoint lastPos; 26 | }; 27 | 28 | #endif // WIDGET_H 29 | -------------------------------------------------------------------------------- /mouseline/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | Widget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 400 9 | 300 10 | 11 | 12 | 13 | Widget 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /movewidget/frmmovewidget.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMMOVEWIDGET_H 2 | #define FRMMOVEWIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class frmMoveWidget; 9 | } 10 | 11 | class frmMoveWidget : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit frmMoveWidget(QWidget *parent = 0); 17 | ~frmMoveWidget(); 18 | 19 | private: 20 | Ui::frmMoveWidget *ui; 21 | 22 | private slots: 23 | void initForm(); 24 | }; 25 | 26 | #endif // FRMMOVEWIDGET_H 27 | -------------------------------------------------------------------------------- /movewidget/frmmovewidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | frmMoveWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 500 10 | 300 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /movewidget/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmmovewidget.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmMoveWidget w; 27 | w.setWindowTitle("通用移动类"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /movewidget/movewidget.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2019-09-28T15:04:18 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = lightbutton 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmmovewidget.cpp 18 | SOURCES += movewidget.cpp 19 | 20 | HEADERS += frmmovewidget.h 21 | HEADERS += movewidget.h 22 | 23 | FORMS += frmmovewidget.ui 24 | -------------------------------------------------------------------------------- /navbutton/frmnavbutton.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMNAVBUTTON_H 2 | #define FRMNAVBUTTON_H 3 | 4 | #include 5 | 6 | class NavButton; 7 | 8 | namespace Ui 9 | { 10 | class frmNavButton; 11 | } 12 | 13 | class frmNavButton : public QWidget 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit frmNavButton(QWidget *parent = 0); 19 | ~frmNavButton(); 20 | 21 | private: 22 | Ui::frmNavButton *ui; 23 | QList btns1; 24 | QList btns2; 25 | QList btns3; 26 | QList btns4; 27 | QList btns5; 28 | QList btns6; 29 | QList btns7; 30 | 31 | private slots: 32 | void initForm(); 33 | void buttonClick1(); 34 | void buttonClick2(); 35 | void buttonClick3(); 36 | void buttonClick4(); 37 | void buttonClick5(); 38 | void buttonClick6(); 39 | void buttonClick7(); 40 | }; 41 | 42 | #endif // FRMNAVBUTTON_H 43 | -------------------------------------------------------------------------------- /navbutton/image/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/navbutton/image/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /navbutton/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmnavbutton.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmNavButton w; 27 | w.setWindowTitle("导航按钮控件"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /navbutton/main.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/fontawesome-webfont.ttf 4 | 5 | 6 | -------------------------------------------------------------------------------- /navbutton/navbutton.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-02-08T15:12:35 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = navbutton 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += iconhelper.cpp 18 | SOURCES += frmnavbutton.cpp 19 | SOURCES += navbutton.cpp 20 | 21 | HEADERS += frmnavbutton.h 22 | HEADERS += iconhelper.h 23 | HEADERS += navbutton.h 24 | 25 | FORMS += frmnavbutton.ui 26 | 27 | RESOURCES += main.qrc 28 | -------------------------------------------------------------------------------- /nettool/api/api.pri: -------------------------------------------------------------------------------- 1 | HEADERS += \ 2 | $$PWD/app.h \ 3 | $$PWD/quiwidget.h \ 4 | $$PWD/tcpserver.h 5 | 6 | SOURCES += \ 7 | $$PWD/app.cpp \ 8 | $$PWD/quiwidget.cpp \ 9 | $$PWD/tcpserver.cpp 10 | -------------------------------------------------------------------------------- /nettool/file/send.txt: -------------------------------------------------------------------------------- 1 | 16 FF 01 01 E0 E1 2 | 16 FF 01 01 E1 E2 3 | 16 01 02 DF BC 16 01 02 DF BC 16 01 02 DF BC 12 13 14 15 4 | 16 00 00 04 D0 F0 F1 65 C4 5 | 16 00 00 04 D0 05 AB 5A C4 6 | 16 01 10 02 F0 03 06 16 01 11 02 F0 03 06 16 01 12 02 F0 03 06 16 01 13 02 F0 03 06 16 01 7 | 14 02 F0 03 06 16 01 15 02 F0 03 06 16 01 16 02 F0 03 06 8 | 16 11 01 03 E8 01 10 0E 9 | 16 11 01 03 E8 01 12 10 10 | 16 11 01 03 E8 01 14 12 11 | 16 11 01 03 E8 01 15 13 12 | DISARMEDALL 13 | BURGLARY 012 14 | BYPASS 012 15 | DISARMED 012 16 | 16 00 01 01 D1 D3 17 | 16 01 11 11 -------------------------------------------------------------------------------- /nettool/form/form.pri: -------------------------------------------------------------------------------- 1 | FORMS += \ 2 | $$PWD/frmmain.ui \ 3 | $$PWD/frmtcpclient.ui \ 4 | $$PWD/frmtcpserver.ui \ 5 | $$PWD/frmudpclient.ui \ 6 | $$PWD/frmudpserver.ui 7 | 8 | HEADERS += \ 9 | $$PWD/frmmain.h \ 10 | $$PWD/frmtcpclient.h \ 11 | $$PWD/frmtcpserver.h \ 12 | $$PWD/frmudpclient.h \ 13 | $$PWD/frmudpserver.h 14 | 15 | SOURCES += \ 16 | $$PWD/frmmain.cpp \ 17 | $$PWD/frmtcpclient.cpp \ 18 | $$PWD/frmtcpserver.cpp \ 19 | $$PWD/frmudpclient.cpp \ 20 | $$PWD/frmudpserver.cpp 21 | -------------------------------------------------------------------------------- /nettool/form/frmmain.cpp: -------------------------------------------------------------------------------- 1 | #include "frmmain.h" 2 | #include "ui_frmmain.h" 3 | #include "quiwidget.h" 4 | 5 | frmMain::frmMain(QWidget *parent) : QWidget(parent), ui(new Ui::frmMain) 6 | { 7 | ui->setupUi(this); 8 | ui->tabWidget->setCurrentIndex(App::CurrentIndex); 9 | } 10 | 11 | frmMain::~frmMain() 12 | { 13 | delete ui; 14 | } 15 | 16 | void frmMain::on_tabWidget_currentChanged(int index) 17 | { 18 | App::CurrentIndex = index; 19 | App::writeConfig(); 20 | } 21 | -------------------------------------------------------------------------------- /nettool/form/frmmain.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMMAIN_H 2 | #define FRMMAIN_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class frmMain; 8 | } 9 | 10 | class frmMain : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit frmMain(QWidget *parent = 0); 16 | ~frmMain(); 17 | 18 | private slots: 19 | void on_tabWidget_currentChanged(int index); 20 | 21 | private: 22 | Ui::frmMain *ui; 23 | }; 24 | 25 | #endif // FRMMAIN_H 26 | -------------------------------------------------------------------------------- /nettool/form/frmtcpclient.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMTCPCLIENT_H 2 | #define FRMTCPCLIENT_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class frmTcpClient; 9 | } 10 | 11 | class frmTcpClient : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit frmTcpClient(QWidget *parent = 0); 17 | ~frmTcpClient(); 18 | 19 | private: 20 | Ui::frmTcpClient *ui; 21 | 22 | bool isOk; 23 | QTcpSocket *tcpSocket; 24 | QTimer *timer; 25 | 26 | private slots: 27 | void initForm(); 28 | void initConfig(); 29 | void saveConfig(); 30 | void changeTimer(); 31 | void append(int type, const QString &data, bool clear = false); 32 | 33 | void connected(); 34 | void disconnected(); 35 | void readData(); 36 | void sendData(const QString &data); 37 | 38 | private slots: 39 | void on_btnConnect_clicked(); 40 | void on_btnSave_clicked(); 41 | void on_btnClear_clicked(); 42 | void on_btnSend_clicked(); 43 | }; 44 | 45 | #endif // FRMTCPCLIENT_H 46 | -------------------------------------------------------------------------------- /nettool/form/frmudpclient.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMUDPCLIENT_H 2 | #define FRMUDPCLIENT_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class frmUdpClient; 9 | } 10 | 11 | class frmUdpClient : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit frmUdpClient(QWidget *parent = 0); 17 | ~frmUdpClient(); 18 | 19 | private: 20 | Ui::frmUdpClient *ui; 21 | 22 | QUdpSocket *udpSocket; 23 | QTimer *timer; 24 | 25 | private slots: 26 | void initForm(); 27 | void initConfig(); 28 | void saveConfig(); 29 | void changeTimer(); 30 | void append(int type, const QString &data, bool clear = false); 31 | 32 | void readData(); 33 | void sendData(const QString &ip, int port, const QString &data); 34 | 35 | private slots: 36 | void on_btnSave_clicked(); 37 | void on_btnClear_clicked(); 38 | void on_btnSend_clicked(); 39 | }; 40 | 41 | #endif // FRMUDPCLIENT_H 42 | -------------------------------------------------------------------------------- /nettool/form/frmudpserver.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMUDPSERVER_H 2 | #define FRMUDPSERVER_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class frmUdpServer; 9 | } 10 | 11 | class frmUdpServer : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit frmUdpServer(QWidget *parent = 0); 17 | ~frmUdpServer(); 18 | 19 | private: 20 | Ui::frmUdpServer *ui; 21 | 22 | QUdpSocket *udpSocket; 23 | QTimer *timer; 24 | 25 | private slots: 26 | void initForm(); 27 | void initIP(); 28 | void initConfig(); 29 | void saveConfig(); 30 | void changeTimer(); 31 | void append(int type, const QString &data, bool clear = false); 32 | 33 | void readData(); 34 | void sendData(const QString &ip, int port, const QString &data); 35 | void clientConnected(const QString &ip, int port); 36 | 37 | private slots: 38 | void on_btnListen_clicked(); 39 | void on_btnSave_clicked(); 40 | void on_btnClear_clicked(); 41 | void on_btnSend_clicked(); 42 | }; 43 | 44 | #endif // FRMUDPSERVER_H 45 | -------------------------------------------------------------------------------- /nettool/head.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #if (QT_VERSION > QT_VERSION_CHECK(5,0,0)) 6 | #include 7 | #endif 8 | 9 | #include "app.h" 10 | 11 | #pragma execution_character_set("utf-8") 12 | -------------------------------------------------------------------------------- /nettool/main.cpp: -------------------------------------------------------------------------------- 1 | #include "frmmain.h" 2 | #include "quiwidget.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | a.setWindowIcon(QIcon(":/main.ico")); 8 | 9 | QFont font; 10 | font.setFamily(QUIConfig::FontName); 11 | font.setPixelSize(QUIConfig::FontSize); 12 | a.setFont(font); 13 | 14 | //设置编码以及加载中文翻译文件 15 | QUIHelper::setCode(); 16 | QUIHelper::setTranslator(":/qt_zh_CN.qm"); 17 | QUIHelper::setTranslator(":/widgets.qm"); 18 | QUIHelper::initRand(); 19 | 20 | App::Intervals << "1" << "10" << "20" << "50" << "100" << "200" << "300" << "500" << "1000" << "1500" << "2000" << "3000" << "5000" << "10000"; 21 | App::ConfigFile = QString("%1/%2.ini").arg(QUIHelper::appPath()).arg(QUIHelper::appName()); 22 | App::readConfig(); 23 | App::readSendData(); 24 | App::readDeviceData(); 25 | 26 | frmMain w; 27 | w.setWindowTitle(QString("网络调试助手V2020 本机IP: %1 QQ: 517216493").arg(QUIHelper::getLocalIP())); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /nettool/nettool.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2016-09-19T13:33:20 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = nettool 12 | TEMPLATE = app 13 | MOC_DIR = temp/moc 14 | RCC_DIR = temp/rcc 15 | UI_DIR = temp/ui 16 | OBJECTS_DIR = temp/obj 17 | DESTDIR = bin 18 | win32:RC_FILE = other/main.rc 19 | 20 | SOURCES += main.cpp 21 | HEADERS += head.h 22 | RESOURCES += other/main.qrc 23 | CONFIG += warn_off 24 | 25 | include ($$PWD/api/api.pri) 26 | include ($$PWD/form/form.pri) 27 | 28 | INCLUDEPATH += $$PWD 29 | INCLUDEPATH += $$PWD/api 30 | INCLUDEPATH += $$PWD/form 31 | -------------------------------------------------------------------------------- /nettool/other/main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/nettool/other/main.ico -------------------------------------------------------------------------------- /nettool/other/main.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.ico 4 | qt_zh_CN.qm 5 | widgets.qm 6 | 7 | 8 | -------------------------------------------------------------------------------- /nettool/other/main.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "main.ico" -------------------------------------------------------------------------------- /nettool/other/qt_zh_CN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/nettool/other/qt_zh_CN.qm -------------------------------------------------------------------------------- /nettool/other/widgets.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/nettool/other/widgets.qm -------------------------------------------------------------------------------- /nettool/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/nettool/readme.txt -------------------------------------------------------------------------------- /nettool/snap/QQ截图20180514145725.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/nettool/snap/QQ截图20180514145725.jpg -------------------------------------------------------------------------------- /nettool/snap/QQ截图20180514145729.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/nettool/snap/QQ截图20180514145729.jpg -------------------------------------------------------------------------------- /nettool/snap/QQ截图20180514145732.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/nettool/snap/QQ截图20180514145732.jpg -------------------------------------------------------------------------------- /nettool/snap/QQ截图20180514145909.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/nettool/snap/QQ截图20180514145909.jpg -------------------------------------------------------------------------------- /ntpclient/frmntpclient.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmntpclient.h" 4 | #include "ui_frmntpclient.h" 5 | #include "ntpclient.h" 6 | 7 | frmNtpClient::frmNtpClient(QWidget *parent) : QWidget(parent), ui(new Ui::frmNtpClient) 8 | { 9 | ui->setupUi(this); 10 | connect(NtpClient::Instance(), SIGNAL(receiveTime(QDateTime)), this, SLOT(receiveTime(QDateTime))); 11 | } 12 | 13 | frmNtpClient::~frmNtpClient() 14 | { 15 | delete ui; 16 | } 17 | 18 | void frmNtpClient::on_btnGetTime_clicked() 19 | { 20 | NtpClient::Instance()->setNtpIP(ui->txtNtpIP->text().trimmed()); 21 | NtpClient::Instance()->getDateTime(); 22 | } 23 | 24 | void frmNtpClient::receiveTime(const QDateTime &dateTime) 25 | { 26 | ui->txtTime->setText(dateTime.toString("yyyy-MM-dd HH:mm:ss")); 27 | } 28 | -------------------------------------------------------------------------------- /ntpclient/frmntpclient.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMNTPCLIENT_H 2 | #define FRMNTPCLIENT_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class frmNtpClient; 9 | } 10 | 11 | class frmNtpClient : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit frmNtpClient(QWidget *parent = 0); 17 | ~frmNtpClient(); 18 | 19 | private: 20 | Ui::frmNtpClient *ui; 21 | 22 | private slots: 23 | void on_btnGetTime_clicked(); 24 | void receiveTime(const QDateTime &dateTime); 25 | }; 26 | 27 | #endif // FRMNTPCLIENT_H 28 | -------------------------------------------------------------------------------- /ntpclient/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmntpclient.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmNtpClient w; 27 | w.setWindowTitle("Ntp校时"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /ntpclient/ntpclient.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2019-02-16T15:08:47 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = ntpclient 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmntpclient.cpp 18 | SOURCES += ntpclient.cpp 19 | 20 | HEADERS += frmntpclient.h 21 | HEADERS += ntpclient.h 22 | 23 | FORMS += frmntpclient.ui 24 | -------------------------------------------------------------------------------- /pngtool/frmpngtool.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMPNGTOOL_H 2 | #define FRMPNGTOOL_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class frmPngTool; 8 | } 9 | 10 | class frmPngTool : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit frmPngTool(QWidget *parent = 0); 16 | ~frmPngTool(); 17 | 18 | private slots: 19 | void on_btnFile_clicked(); 20 | void on_btnDir_clicked(); 21 | void on_btnOk_clicked(); 22 | 23 | private: 24 | Ui::frmPngTool *ui; 25 | QStringList files; 26 | }; 27 | 28 | #endif // FRMPNGTOOL_H 29 | -------------------------------------------------------------------------------- /pngtool/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmpngtool.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmPngTool w; 27 | w.setWindowTitle("PNG图片警告去除工具"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /pngtool/pngtool.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-02-08T09:21:04 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = pngtool 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmpngtool.cpp 18 | HEADERS += frmpngtool.h 19 | FORMS += frmpngtool.ui 20 | 21 | -------------------------------------------------------------------------------- /qwtdemo/examples/animation/animation.pro: -------------------------------------------------------------------------------- 1 | TARGET = animation 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | SOURCES += main.cpp 10 | SOURCES += plot.cpp 11 | HEADERS += plot.h 12 | 13 | include ($$PWD/../../qwt/qwt.pri) 14 | INCLUDEPATH += $$PWD 15 | INCLUDEPATH += $$PWD/../../qwt 16 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/barchart/barchart.pro: -------------------------------------------------------------------------------- 1 | TARGET = barchart 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | SOURCES += main.cpp 10 | SOURCES += barchart.cpp 11 | HEADERS += barchart.h 12 | 13 | include ($$PWD/../../qwt/qwt.pri) 14 | INCLUDEPATH += $$PWD 15 | INCLUDEPATH += $$PWD/../../qwt 16 | -------------------------------------------------------------------------------- /qwtdemo/examples/bode/bode.pro: -------------------------------------------------------------------------------- 1 | TARGET = bode 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | SOURCES += main.cpp 10 | SOURCES += plot.cpp 11 | SOURCES += mainwindow.cpp 12 | HEADERS += plot.h 13 | HEADERS += mainwindow.h 14 | HEADERS += complexnumber.h 15 | HEADERS += pixmaps.h 16 | 17 | include ($$PWD/../../qwt/qwt.pri) 18 | INCLUDEPATH += $$PWD 19 | INCLUDEPATH += $$PWD/../../qwt 20 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/controls/controls.pro: -------------------------------------------------------------------------------- 1 | TARGET = controls 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | sliderbox.h \ 11 | slidertab.h \ 12 | wheelbox.h \ 13 | wheeltab.h \ 14 | knobbox.h \ 15 | knobtab.h \ 16 | dialbox.h \ 17 | dialtab.h 18 | 19 | SOURCES = \ 20 | sliderbox.cpp \ 21 | slidertab.cpp \ 22 | wheelbox.cpp \ 23 | wheeltab.cpp \ 24 | knobbox.cpp \ 25 | knobtab.cpp \ 26 | dialbox.cpp \ 27 | dialtab.cpp \ 28 | main.cpp 29 | 30 | include ($$PWD/../../qwt/qwt.pri) 31 | INCLUDEPATH += $$PWD 32 | INCLUDEPATH += $$PWD/../../qwt 33 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/cpuplot/cpuplot.pro: -------------------------------------------------------------------------------- 1 | TARGET = cpuplot 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | cpuplot.h \ 11 | cpustat.h \ 12 | cpupiemarker.h 13 | 14 | SOURCES = \ 15 | cpuplot.cpp \ 16 | cpustat.cpp \ 17 | cpupiemarker.cpp 18 | 19 | include ($$PWD/../../qwt/qwt.pri) 20 | INCLUDEPATH += $$PWD 21 | INCLUDEPATH += $$PWD/../../qwt 22 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/curvdemo1/curvdemo1.pro: -------------------------------------------------------------------------------- 1 | TARGET = curvdemo1 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | SOURCES = \ 10 | curvdemo1.cpp 11 | 12 | include ($$PWD/../../qwt/qwt.pri) 13 | INCLUDEPATH += $$PWD 14 | INCLUDEPATH += $$PWD/../../qwt 15 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/dials/dials.pro: -------------------------------------------------------------------------------- 1 | TARGET = dials 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | attitude_indicator.h \ 11 | speedo_meter.h \ 12 | cockpit_grid.h \ 13 | compass_grid.h 14 | 15 | SOURCES = \ 16 | attitude_indicator.cpp \ 17 | speedo_meter.cpp \ 18 | cockpit_grid.cpp \ 19 | compass_grid.cpp \ 20 | dials.cpp 21 | 22 | include ($$PWD/../../qwt/qwt.pri) 23 | INCLUDEPATH += $$PWD 24 | INCLUDEPATH += $$PWD/../../qwt 25 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/distrowatch/distrowatch.pro: -------------------------------------------------------------------------------- 1 | TARGET = distrowatch 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | barchart.h 11 | 12 | SOURCES = \ 13 | barchart.cpp \ 14 | main.cpp 15 | 16 | include ($$PWD/../../qwt/qwt.pri) 17 | INCLUDEPATH += $$PWD 18 | INCLUDEPATH += $$PWD/../../qwt 19 | -------------------------------------------------------------------------------- /qwtdemo/examples/event_filter/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/qwtdemo/examples/event_filter/README -------------------------------------------------------------------------------- /qwtdemo/examples/event_filter/canvaspicker.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/qwtdemo/examples/event_filter/canvaspicker.cpp -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/event_filter/event_filter.pro: -------------------------------------------------------------------------------- 1 | TARGET = event_filter 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | colorbar.h \ 11 | scalepicker.h \ 12 | canvaspicker.h \ 13 | plot.h 14 | 15 | SOURCES = \ 16 | colorbar.cpp \ 17 | scalepicker.cpp \ 18 | canvaspicker.cpp \ 19 | plot.cpp \ 20 | event_filter.cpp 21 | 22 | include ($$PWD/../../qwt/qwt.pri) 23 | INCLUDEPATH += $$PWD 24 | INCLUDEPATH += $$PWD/../../qwt 25 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/examples.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS += \ 3 | animation \ 4 | barchart \ 5 | cpuplot \ 6 | curvdemo1 \ 7 | distrowatch \ 8 | friedberg \ 9 | itemeditor \ 10 | legends \ 11 | stockchart \ 12 | simpleplot \ 13 | sinusplot \ 14 | realtime \ 15 | refreshtest \ 16 | scatterplot \ 17 | spectrogram \ 18 | rasterview \ 19 | tvplot \ 20 | bode \ 21 | event_filter \ 22 | oscilloscope \ 23 | sysinfo \ 24 | radio \ 25 | dials \ 26 | controls 27 | -------------------------------------------------------------------------------- /qwtdemo/examples/friedberg/friedberg.pro: -------------------------------------------------------------------------------- 1 | TARGET = friedberg 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | plot.h \ 11 | friedberg2007.h 12 | 13 | SOURCES = \ 14 | friedberg2007.cpp \ 15 | plot.cpp \ 16 | main.cpp 17 | 18 | include ($$PWD/../../qwt/qwt.pri) 19 | INCLUDEPATH += $$PWD 20 | INCLUDEPATH += $$PWD/../../qwt 21 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/itemeditor/itemeditor.pro: -------------------------------------------------------------------------------- 1 | TARGET = itemeditor 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | editor.h \ 11 | shapefactory.h \ 12 | plot.h 13 | 14 | SOURCES = \ 15 | editor.cpp \ 16 | shapefactory.cpp \ 17 | plot.cpp \ 18 | main.cpp 19 | 20 | include ($$PWD/../../qwt/qwt.pri) 21 | INCLUDEPATH += $$PWD 22 | INCLUDEPATH += $$PWD/../../qwt 23 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/legends/legends.pro: -------------------------------------------------------------------------------- 1 | TARGET = legends 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | mainwindow.h \ 11 | panel.h \ 12 | settings.h \ 13 | plot.h 14 | 15 | SOURCES = \ 16 | mainwindow.cpp \ 17 | panel.cpp \ 18 | plot.cpp \ 19 | main.cpp 20 | 21 | include ($$PWD/../../qwt/qwt.pri) 22 | INCLUDEPATH += $$PWD 23 | INCLUDEPATH += $$PWD/../../qwt 24 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/oscilloscope/oscilloscope.pro: -------------------------------------------------------------------------------- 1 | TARGET = oscilloscope 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | signaldata.h \ 11 | plot.h \ 12 | knob.h \ 13 | wheelbox.h \ 14 | samplingthread.h \ 15 | curvedata.h \ 16 | mainwindow.h 17 | 18 | SOURCES = \ 19 | signaldata.cpp \ 20 | plot.cpp \ 21 | knob.cpp \ 22 | wheelbox.cpp \ 23 | samplingthread.cpp \ 24 | curvedata.cpp \ 25 | mainwindow.cpp \ 26 | main.cpp 27 | 28 | include ($$PWD/../../qwt/qwt.pri) 29 | INCLUDEPATH += $$PWD 30 | INCLUDEPATH += $$PWD/../../qwt 31 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/radio/radio.pro: -------------------------------------------------------------------------------- 1 | TARGET = radio 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | mainwindow.h \ 11 | ampfrm.h \ 12 | tunerfrm.h 13 | 14 | SOURCES = \ 15 | mainwindow.cpp \ 16 | ampfrm.cpp \ 17 | tunerfrm.cpp \ 18 | radio.cpp 19 | 20 | include ($$PWD/../../qwt/qwt.pri) 21 | INCLUDEPATH += $$PWD 22 | INCLUDEPATH += $$PWD/../../qwt 23 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/rasterview/rasterview.pro: -------------------------------------------------------------------------------- 1 | TARGET = rasterview 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | plot.h 11 | 12 | SOURCES = \ 13 | plot.cpp \ 14 | main.cpp 15 | 16 | include ($$PWD/../../qwt/qwt.pri) 17 | INCLUDEPATH += $$PWD 18 | INCLUDEPATH += $$PWD/../../qwt 19 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/realtime/realtime.pro: -------------------------------------------------------------------------------- 1 | TARGET = realtime 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | mainwindow.h \ 11 | scrollzoomer.h \ 12 | scrollbar.h \ 13 | incrementalplot.h \ 14 | randomplot.h 15 | 16 | SOURCES = \ 17 | main.cpp \ 18 | mainwindow.cpp \ 19 | scrollzoomer.cpp \ 20 | scrollbar.cpp \ 21 | incrementalplot.cpp \ 22 | randomplot.cpp 23 | 24 | include ($$PWD/../../qwt/qwt.pri) 25 | INCLUDEPATH += $$PWD 26 | INCLUDEPATH += $$PWD/../../qwt 27 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/refreshtest/refreshtest.pro: -------------------------------------------------------------------------------- 1 | TARGET = refreshtest 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | settings.h \ 11 | circularbuffer.h \ 12 | panel.h \ 13 | plot.h \ 14 | mainwindow.h 15 | 16 | SOURCES = \ 17 | circularbuffer.cpp \ 18 | panel.cpp \ 19 | plot.cpp \ 20 | mainwindow.cpp \ 21 | main.cpp 22 | 23 | include ($$PWD/../../qwt/qwt.pri) 24 | INCLUDEPATH += $$PWD 25 | INCLUDEPATH += $$PWD/../../qwt 26 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/scatterplot/scatterplot.pro: -------------------------------------------------------------------------------- 1 | TARGET = scatterplot 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | mainwindow.h \ 11 | plot.h 12 | 13 | SOURCES = \ 14 | main.cpp \ 15 | mainwindow.cpp \ 16 | plot.cpp 17 | 18 | include ($$PWD/../../qwt/qwt.pri) 19 | INCLUDEPATH += $$PWD 20 | INCLUDEPATH += $$PWD/../../qwt 21 | -------------------------------------------------------------------------------- /qwtdemo/examples/simpleplot/simpleplot.pro: -------------------------------------------------------------------------------- 1 | TARGET = simpleplot 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | SOURCES = \ 10 | simpleplot.cpp 11 | 12 | include ($$PWD/../../qwt/qwt.pri) 13 | INCLUDEPATH += $$PWD 14 | INCLUDEPATH += $$PWD/../../qwt 15 | -------------------------------------------------------------------------------- /qwtdemo/examples/sinusplot/sinusplot.pro: -------------------------------------------------------------------------------- 1 | TARGET = sinusplot 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | SOURCES = \ 10 | sinusplot.cpp 11 | 12 | include ($$PWD/../../qwt/qwt.pri) 13 | INCLUDEPATH += $$PWD 14 | INCLUDEPATH += $$PWD/../../qwt 15 | -------------------------------------------------------------------------------- /qwtdemo/examples/spectrogram/plot.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class Plot: public QwtPlot 5 | { 6 | Q_OBJECT 7 | 8 | public: 9 | enum ColorMap 10 | { 11 | RGBMap, 12 | IndexMap, 13 | HueMap, 14 | AlphaMap 15 | }; 16 | 17 | Plot( QWidget * = NULL ); 18 | 19 | public Q_SLOTS: 20 | void showContour( bool on ); 21 | void showSpectrogram( bool on ); 22 | void setColorMap( int ); 23 | void setAlpha( int ); 24 | 25 | #ifndef QT_NO_PRINTER 26 | void printPlot(); 27 | #endif 28 | 29 | private: 30 | QwtPlotSpectrogram *d_spectrogram; 31 | 32 | int d_mapType; 33 | int d_alpha; 34 | }; 35 | -------------------------------------------------------------------------------- /qwtdemo/examples/spectrogram/spectrogram.pro: -------------------------------------------------------------------------------- 1 | TARGET = spectrogram 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | plot.h 11 | 12 | SOURCES = \ 13 | plot.cpp \ 14 | main.cpp 15 | 16 | include ($$PWD/../../qwt/qwt.pri) 17 | INCLUDEPATH += $$PWD 18 | INCLUDEPATH += $$PWD/../../qwt 19 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/stockchart/stockchart.pro: -------------------------------------------------------------------------------- 1 | TARGET = stockchart 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | HEADERS = \ 10 | legend.h \ 11 | griditem.h \ 12 | plot.h \ 13 | quotefactory.h 14 | 15 | SOURCES = \ 16 | legend.cpp \ 17 | griditem.cpp \ 18 | quotefactory.cpp \ 19 | plot.cpp \ 20 | main.cpp 21 | 22 | include ($$PWD/../../qwt/qwt.pri) 23 | INCLUDEPATH += $$PWD 24 | INCLUDEPATH += $$PWD/../../qwt 25 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/sysinfo/sysinfo.pro: -------------------------------------------------------------------------------- 1 | TARGET = sysinfo 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | SOURCES = \ 10 | sysinfo.cpp 11 | 12 | include ($$PWD/../../qwt/qwt.pri) 13 | INCLUDEPATH += $$PWD 14 | INCLUDEPATH += $$PWD/../../qwt 15 | -------------------------------------------------------------------------------- /qwtdemo/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 | -------------------------------------------------------------------------------- /qwtdemo/examples/tvplot/tvplot.pro: -------------------------------------------------------------------------------- 1 | TARGET = tvplot 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = $$PWD/../bin 8 | 9 | SOURCES = \ 10 | tvplot.cpp \ 11 | main.cpp 12 | 13 | HEADERS = \ 14 | tvplot.h 15 | 16 | include ($$PWD/../../qwt/qwt.pri) 17 | INCLUDEPATH += $$PWD 18 | INCLUDEPATH += $$PWD/../../qwt 19 | -------------------------------------------------------------------------------- /qwtdemo/frmmain.cpp: -------------------------------------------------------------------------------- 1 | #include "frmmain.h" 2 | #include "ui_frmmain.h" 3 | #include "qwt.h" 4 | #include "qwt_dial.h" 5 | #include "qwt_plot.h" 6 | 7 | frmMain::frmMain(QWidget *parent) : 8 | QWidget(parent), 9 | ui(new Ui::frmMain) 10 | { 11 | ui->setupUi(this); 12 | } 13 | 14 | frmMain::~frmMain() 15 | { 16 | delete ui; 17 | } 18 | -------------------------------------------------------------------------------- /qwtdemo/frmmain.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMMAIN_H 2 | #define FRMMAIN_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class frmMain; 8 | } 9 | 10 | class frmMain : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit frmMain(QWidget *parent = 0); 16 | ~frmMain(); 17 | 18 | private: 19 | Ui::frmMain *ui; 20 | }; 21 | 22 | #endif // FRMMAIN_H 23 | -------------------------------------------------------------------------------- /qwtdemo/frmmain.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | frmMain 4 | 5 | 6 | 7 | 0 8 | 0 9 | 749 10 | 456 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | QFrame::StyledPanel 21 | 22 | 23 | QFrame::Raised 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | QwtPlot 32 | QFrame 33 |
qwt_plot.h
34 | 1 35 |
36 |
37 | 38 | 39 |
40 | -------------------------------------------------------------------------------- /qwtdemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include "frmmain.h" 2 | #include "qapplication.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | 8 | frmMain w; 9 | w.setWindowTitle("qwtdemo"); 10 | w.show(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /qwtdemo/qwt/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 | -------------------------------------------------------------------------------- /qwtdemo/qwt/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 | -------------------------------------------------------------------------------- /qwtdemo/qwt/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 | -------------------------------------------------------------------------------- /qwtdemo/qwtdemo.pro: -------------------------------------------------------------------------------- 1 | TARGET = qwtdemo 2 | TEMPLATE = app 3 | MOC_DIR = temp/moc 4 | RCC_DIR = temp/rcc 5 | UI_DIR = temp/ui 6 | OBJECTS_DIR = temp/obj 7 | DESTDIR = bin 8 | 9 | CONFIG += warn_off 10 | SOURCES += main.cpp 11 | SOURCES += frmmain.cpp 12 | FORMS += frmmain.ui 13 | HEADERS += frmmain.h 14 | 15 | include ($$PWD/qwt/qwt.pri) 16 | INCLUDEPATH += $$PWD 17 | INCLUDEPATH += $$PWD/qwt 18 | -------------------------------------------------------------------------------- /savelog/frmsavelog.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMSAVELOG_H 2 | #define FRMSAVELOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class frmSaveLog; 8 | } 9 | 10 | class frmSaveLog : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit frmSaveLog(QWidget *parent = 0); 16 | ~frmSaveLog(); 17 | 18 | private: 19 | Ui::frmSaveLog *ui; 20 | QTimer *timer; 21 | 22 | private slots: 23 | void initForm(); 24 | void append(); 25 | void on_btnDebug_clicked(); 26 | void on_ckTimer_stateChanged(int arg1); 27 | void on_ckNet_stateChanged(int arg1); 28 | void on_ckSave_stateChanged(int arg1); 29 | 30 | }; 31 | 32 | #endif // FRMSAVELOG_H 33 | -------------------------------------------------------------------------------- /savelog/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmsavelog.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmSaveLog w; 27 | w.setWindowTitle("输出日志文件"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /savelog/savelog.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2019-02-16T15:08:47 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = savelog 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmsavelog.cpp 18 | SOURCES += savelog.cpp 19 | 20 | HEADERS += frmsavelog.h 21 | HEADERS += savelog.h 22 | 23 | FORMS += frmsavelog.ui 24 | -------------------------------------------------------------------------------- /saveruntime/frmsaveruntime.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmsaveruntime.h" 4 | #include "ui_frmsaveruntime.h" 5 | #include "saveruntime.h" 6 | 7 | frmSaveRunTime::frmSaveRunTime(QWidget *parent) : QWidget(parent), ui(new Ui::frmSaveRunTime) 8 | { 9 | ui->setupUi(this); 10 | } 11 | 12 | frmSaveRunTime::~frmSaveRunTime() 13 | { 14 | delete ui; 15 | } 16 | 17 | void frmSaveRunTime::on_checkBox_stateChanged(int arg1) 18 | { 19 | if (arg1 == 0) { 20 | SaveRunTime::Instance()->stop(); 21 | } else { 22 | SaveRunTime::Instance()->start(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /saveruntime/frmsaveruntime.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMSAVERUNTIME_H 2 | #define FRMSAVERUNTIME_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class frmSaveRunTime; 8 | } 9 | 10 | class frmSaveRunTime : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit frmSaveRunTime(QWidget *parent = 0); 16 | ~frmSaveRunTime(); 17 | 18 | private: 19 | Ui::frmSaveRunTime *ui; 20 | 21 | private slots: 22 | void on_checkBox_stateChanged(int arg1); 23 | }; 24 | 25 | #endif // FRMSAVERUNTIME_H 26 | -------------------------------------------------------------------------------- /saveruntime/frmsaveruntime.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | frmSaveRunTime 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | Qt::Vertical 21 | 22 | 23 | 24 | 20 25 | 40 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 启动服务 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /saveruntime/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmsaveruntime.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmSaveRunTime w; 27 | w.setWindowTitle("保存运行时间"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /saveruntime/saveruntime.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2019-02-16T15:08:47 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = saveruntime 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmsaveruntime.cpp 18 | SOURCES += saveruntime.cpp 19 | 20 | HEADERS += frmsaveruntime.h 21 | HEADERS += saveruntime.h 22 | 23 | FORMS += frmsaveruntime.ui 24 | -------------------------------------------------------------------------------- /snap/battery.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/battery.gif -------------------------------------------------------------------------------- /snap/bgdemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/bgdemo.gif -------------------------------------------------------------------------------- /snap/buttondefence.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/buttondefence.gif -------------------------------------------------------------------------------- /snap/colorwidget.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/colorwidget.gif -------------------------------------------------------------------------------- /snap/comtool.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/comtool.jpg -------------------------------------------------------------------------------- /snap/countcode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/countcode.gif -------------------------------------------------------------------------------- /snap/dbpage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/dbpage.png -------------------------------------------------------------------------------- /snap/devicesizetable.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/devicesizetable.gif -------------------------------------------------------------------------------- /snap/emailtool.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/emailtool.jpg -------------------------------------------------------------------------------- /snap/flatui.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/flatui.gif -------------------------------------------------------------------------------- /snap/framelesswidget.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/framelesswidget.gif -------------------------------------------------------------------------------- /snap/gifwidget.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/gifwidget.gif -------------------------------------------------------------------------------- /snap/ipaddress.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/ipaddress.gif -------------------------------------------------------------------------------- /snap/lightbutton.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/lightbutton.gif -------------------------------------------------------------------------------- /snap/lineeditnext.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/lineeditnext.gif -------------------------------------------------------------------------------- /snap/lunarcalendarwidget.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/lunarcalendarwidget.gif -------------------------------------------------------------------------------- /snap/maskwidget.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/maskwidget.gif -------------------------------------------------------------------------------- /snap/mouseline.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/mouseline.gif -------------------------------------------------------------------------------- /snap/movewidget.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/movewidget.gif -------------------------------------------------------------------------------- /snap/navbutton.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/navbutton.gif -------------------------------------------------------------------------------- /snap/nettool.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/nettool.gif -------------------------------------------------------------------------------- /snap/ntpclient.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/ntpclient.gif -------------------------------------------------------------------------------- /snap/pngtool.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/pngtool.gif -------------------------------------------------------------------------------- /snap/qwtdemo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/qwtdemo.jpg -------------------------------------------------------------------------------- /snap/styledemo_flatwhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/styledemo_flatwhite.png -------------------------------------------------------------------------------- /snap/styledemo_lightblue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/styledemo_lightblue.png -------------------------------------------------------------------------------- /snap/styledemo_psblack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/styledemo_psblack.png -------------------------------------------------------------------------------- /snap/videopanel.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/videopanel.gif -------------------------------------------------------------------------------- /snap/zhtopy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/snap/zhtopy.gif -------------------------------------------------------------------------------- /styledemo/frmmain.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMMAIN_H 2 | #define FRMMAIN_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class frmMain; 9 | } 10 | 11 | class frmMain : public QMainWindow 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit frmMain(QWidget *parent = 0); 17 | ~frmMain(); 18 | 19 | private: 20 | Ui::frmMain *ui; 21 | 22 | private slots: 23 | void initForm(); 24 | void initTableWidget(); 25 | void initTreeWidget(); 26 | void initListWidget(); 27 | void initOther(); 28 | void initStyle(); 29 | void initTranslator(); 30 | }; 31 | 32 | #endif // FRMMAIN_H 33 | -------------------------------------------------------------------------------- /styledemo/head.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #if (QT_VERSION > QT_VERSION_CHECK(5,0,0)) 5 | #include 6 | #endif 7 | 8 | #pragma execution_character_set("utf-8") 9 | -------------------------------------------------------------------------------- /styledemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include "frmmain.h" 2 | #include "qapplication.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | a.setFont(QFont("Microsoft Yahei", 9)); 8 | 9 | frmMain w; 10 | w.setWindowTitle("styledemo Author: feiyangqingyun@163.com QQ: 517216493"); 11 | w.show(); 12 | 13 | return a.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /styledemo/other/image/Font Awesome Cheatsheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/image/Font Awesome Cheatsheet.png -------------------------------------------------------------------------------- /styledemo/other/image/btn_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/image/btn_close.png -------------------------------------------------------------------------------- /styledemo/other/image/btn_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/image/btn_ok.png -------------------------------------------------------------------------------- /styledemo/other/image/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/image/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /styledemo/other/image/msg_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/image/msg_error.png -------------------------------------------------------------------------------- /styledemo/other/image/msg_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/image/msg_info.png -------------------------------------------------------------------------------- /styledemo/other/image/msg_question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/image/msg_question.png -------------------------------------------------------------------------------- /styledemo/other/image/qt_zh_CN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/image/qt_zh_CN.qm -------------------------------------------------------------------------------- /styledemo/other/image/widgets.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/image/widgets.qm -------------------------------------------------------------------------------- /styledemo/other/main.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/btn_close.png 4 | image/btn_ok.png 5 | image/fontawesome-webfont.ttf 6 | image/msg_error.png 7 | image/msg_info.png 8 | image/msg_question.png 9 | image/qt_zh_CN.qm 10 | image/widgets.qm 11 | 12 | 13 | -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/add_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/add_bottom.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/add_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/add_left.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/add_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/add_right.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/add_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/add_top.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/branch_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/branch_close.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/branch_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/branch_open.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/calendar_nextmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/calendar_nextmonth.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/calendar_prevmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/calendar_prevmonth.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/checkbox_checked.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/checkbox_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/checkbox_checked_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/checkbox_parcial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/checkbox_parcial.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/checkbox_parcial_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/checkbox_parcial_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/checkbox_unchecked.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/checkbox_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/checkbox_unchecked_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/radiobutton_checked.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/radiobutton_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/radiobutton_checked_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/radiobutton_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/radiobutton_unchecked.png -------------------------------------------------------------------------------- /styledemo/other/qss/flatwhite/radiobutton_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/flatwhite/radiobutton_unchecked_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/add_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/add_bottom.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/add_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/add_left.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/add_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/add_right.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/add_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/add_top.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/branch_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/branch_close.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/branch_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/branch_open.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/calendar_nextmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/calendar_nextmonth.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/calendar_prevmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/calendar_prevmonth.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/checkbox_checked.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/checkbox_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/checkbox_checked_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/checkbox_parcial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/checkbox_parcial.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/checkbox_parcial_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/checkbox_parcial_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/checkbox_unchecked.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/checkbox_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/checkbox_unchecked_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/radiobutton_checked.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/radiobutton_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/radiobutton_checked_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/radiobutton_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/radiobutton_unchecked.png -------------------------------------------------------------------------------- /styledemo/other/qss/lightblue/radiobutton_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/lightblue/radiobutton_unchecked_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/add_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/add_bottom.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/add_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/add_left.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/add_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/add_right.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/add_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/add_top.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/branch_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/branch_close.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/branch_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/branch_open.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/calendar_nextmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/calendar_nextmonth.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/calendar_prevmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/calendar_prevmonth.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/checkbox_checked.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/checkbox_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/checkbox_checked_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/checkbox_parcial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/checkbox_parcial.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/checkbox_parcial_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/checkbox_parcial_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/checkbox_unchecked.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/checkbox_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/checkbox_unchecked_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/radiobutton_checked.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/radiobutton_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/radiobutton_checked_disable.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/radiobutton_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/radiobutton_unchecked.png -------------------------------------------------------------------------------- /styledemo/other/qss/psblack/radiobutton_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/other/qss/psblack/radiobutton_unchecked_disable.png -------------------------------------------------------------------------------- /styledemo/snap_flatwhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/snap_flatwhite.png -------------------------------------------------------------------------------- /styledemo/snap_lightblue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/snap_lightblue.png -------------------------------------------------------------------------------- /styledemo/snap_psblack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/styledemo/snap_psblack.png -------------------------------------------------------------------------------- /styledemo/styledemo.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-02-19T12:55:42 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = styledemo 12 | TEMPLATE = app 13 | MOC_DIR = temp/moc 14 | RCC_DIR = temp/rcc 15 | UI_DIR = temp/ui 16 | OBJECTS_DIR = temp/obj 17 | DESTDIR = $$PWD/../bin 18 | 19 | INCLUDEPATH += $$PWD 20 | CONFIG += warn_off 21 | 22 | SOURCES += main.cpp \ 23 | frmmain.cpp 24 | SOURCES += 25 | 26 | HEADERS += head.h \ 27 | frmmain.h 28 | HEADERS += 29 | 30 | FORMS += \ 31 | frmmain.ui 32 | 33 | RESOURCES += other/qss.qrc 34 | RESOURCES += other/main.qrc 35 | -------------------------------------------------------------------------------- /videopanel/bg_novideo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockyZhong30/feiyangqingyun-QWidgetDemo/df0944281200b923a1734615aff8d212c0ecd735/videopanel/bg_novideo.png -------------------------------------------------------------------------------- /videopanel/main.cpp: -------------------------------------------------------------------------------- 1 | #include "frmmain.h" 2 | #include "qcoreapplication.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | 8 | QFont font; 9 | font.setFamily("MicroSoft Yahei"); 10 | font.setPixelSize(12); 11 | a.setFont(font); 12 | 13 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 14 | #if _MSC_VER 15 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 16 | #else 17 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 18 | #endif 19 | QTextCodec::setCodecForLocale(codec); 20 | QTextCodec::setCodecForCStrings(codec); 21 | QTextCodec::setCodecForTr(codec); 22 | #else 23 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 24 | QTextCodec::setCodecForLocale(codec); 25 | #endif 26 | 27 | frmMain w; 28 | w.showMaximized(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /videopanel/main.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | bg_novideo.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /videopanel/videopanel.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2016-09-29T09:37:26 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = videopanel 12 | TEMPLATE = app 13 | MOC_DIR = temp/moc 14 | RCC_DIR = temp/rcc 15 | UI_DIR = temp/ui 16 | OBJECTS_DIR = temp/obj 17 | DESTDIR = bin 18 | 19 | SOURCES += main.cpp 20 | SOURCES += frmmain.cpp 21 | HEADERS += frmmain.h 22 | FORMS += frmmain.ui 23 | RESOURCES += main.qrc 24 | CONFIG += warn_off 25 | -------------------------------------------------------------------------------- /zhtopy/frmzhtopy.cpp: -------------------------------------------------------------------------------- 1 | #include "frmzhtopy.h" 2 | #include "ui_frmzhtopy.h" 3 | #include "zhtopy.h" 4 | 5 | frmZhToPY::frmZhToPY(QWidget *parent) : QWidget(parent), ui(new Ui::frmZhToPY) 6 | { 7 | ui->setupUi(this); 8 | ZhToPY::Instance()->loadPY(":/image/zhtopy.txt"); 9 | } 10 | 11 | frmZhToPY::~frmZhToPY() 12 | { 13 | delete ui; 14 | } 15 | 16 | void frmZhToPY::on_btnPY_clicked() 17 | { 18 | ui->txtResult->setText(ZhToPY::Instance()->zhToPY(ui->txtChinese->text())); 19 | } 20 | 21 | void frmZhToPY::on_btnJP_clicked() 22 | { 23 | ui->txtResult->setText(ZhToPY::Instance()->zhToJP(ui->txtChinese->text())); 24 | } 25 | -------------------------------------------------------------------------------- /zhtopy/frmzhtopy.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMZHTOPY_H 2 | #define FRMZHTOPY_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class frmZhToPY; 8 | } 9 | 10 | class frmZhToPY : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit frmZhToPY(QWidget *parent = 0); 16 | ~frmZhToPY(); 17 | 18 | private: 19 | Ui::frmZhToPY *ui; 20 | 21 | private slots: 22 | void on_btnPY_clicked(); 23 | void on_btnJP_clicked(); 24 | }; 25 | 26 | #endif // FRMZHTOPY_H 27 | -------------------------------------------------------------------------------- /zhtopy/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "frmzhtopy.h" 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | a.setFont(QFont("Microsoft Yahei", 9)); 11 | 12 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 13 | #if _MSC_VER 14 | QTextCodec *codec = QTextCodec::codecForName("gbk"); 15 | #else 16 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 17 | #endif 18 | QTextCodec::setCodecForLocale(codec); 19 | QTextCodec::setCodecForCStrings(codec); 20 | QTextCodec::setCodecForTr(codec); 21 | #else 22 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 23 | QTextCodec::setCodecForLocale(codec); 24 | #endif 25 | 26 | frmZhToPY w; 27 | w.setWindowTitle("汉字转拼音"); 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /zhtopy/main.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/zhtopy.txt 4 | 5 | 6 | -------------------------------------------------------------------------------- /zhtopy/zhtopy.h: -------------------------------------------------------------------------------- 1 | #ifndef ZHTOPY_H 2 | #define ZHTOPY_H 3 | 4 | /** 5 | * 汉字转拼音类 作者:feiyangqingyun(QQ:517216493) 2019-2-16 6 | * 1:汉字转拼音 7 | * 2:汉字转拼音简拼 8 | * 3:汉字转拼音首字母 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #ifdef quc 15 | #if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) 16 | #include 17 | #else 18 | #include 19 | #endif 20 | 21 | class QDESIGNER_WIDGET_EXPORT ZhToPY : public QObject 22 | #else 23 | class ZhToPY : public QObject 24 | #endif 25 | 26 | { 27 | Q_OBJECT 28 | public: 29 | static ZhToPY *Instance(); 30 | explicit ZhToPY(QObject *parent = 0); 31 | 32 | private: 33 | static QScopedPointer self; 34 | QStringList listPY; 35 | QStringList listJP; 36 | 37 | public: 38 | //载入拼音文件 39 | void loadPY(const QString &fileName = "zhtopy.txt"); 40 | //汉字转拼音 41 | QString zhToPY(const QString &chinese); 42 | //汉字转字母简拼 43 | QString zhToJP(const QString &chinese); 44 | //汉字转首字母 45 | QString zhToZM(const QString &chinese); 46 | }; 47 | 48 | #endif // ZHTOPY_H 49 | -------------------------------------------------------------------------------- /zhtopy/zhtopy.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2019-02-16T15:08:47 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = zhtopy 12 | TEMPLATE = app 13 | DESTDIR = $$PWD/../bin 14 | CONFIG += warn_off 15 | 16 | SOURCES += main.cpp 17 | SOURCES += frmzhtopy.cpp 18 | SOURCES += zhtopy.cpp 19 | 20 | HEADERS += frmzhtopy.h 21 | HEADERS += zhtopy.h 22 | 23 | FORMS += frmzhtopy.ui 24 | 25 | RESOURCES += main.qrc 26 | --------------------------------------------------------------------------------