├── .gitignore ├── LICENSE ├── README.md ├── documentation └── images │ ├── WidgetDelegateLoading.png │ ├── WidgetItemDelegateLoaded.png │ ├── WidgetItemDelegateSize.png │ ├── WidgetItemDelegateStatic.png │ ├── color_palette.png │ ├── color_widgets.png │ ├── item_delegates(1).png │ ├── message_log.png │ ├── multiprogress.png │ ├── multiprogress_detailed.png │ ├── object_mapper.png │ ├── overlay(1).png │ ├── overlay(2).png │ ├── overview.png │ ├── property_widget_buttons.png │ ├── property_widget_group.png │ ├── property_widget_tree.png │ ├── spinboxes.png │ ├── text_by_circle.png │ └── text_by_curve.png ├── examples ├── codeeditor │ ├── codeeditor.cpp │ ├── codeeditor.h │ ├── codeeditor.pro │ ├── codeeditor.qrc │ ├── jsedit.cpp │ ├── jsedit.h │ ├── main.cpp │ └── resources │ │ ├── LICENSE │ │ ├── application.json │ │ └── qt-logo.png ├── colorpalette │ ├── colorpalette.pro │ ├── colorpalette.qrc │ ├── main.cpp │ ├── resources │ │ └── Grays.cmap │ ├── widget.cpp │ └── widget.h ├── colorwidgets │ ├── colorwidgets.pro │ ├── demowidget.cpp │ ├── demowidget.h │ └── main.cpp ├── configwidget │ ├── configwidget.pro │ ├── main.cpp │ ├── pages.cpp │ ├── pages.h │ ├── qconfigwidget.cpp │ ├── qconfigwidget.h │ ├── qconfigwizard.cpp │ └── qconfigwizard.h ├── curvedtext │ ├── curvedtext.pro │ ├── curvedtext.qrc │ ├── main.cpp │ ├── metadata.json │ ├── qtradiusesmodel.cpp │ ├── qtradiusesmodel.h │ ├── widget.cpp │ └── widget.h ├── examples.pro ├── groupingmodel │ ├── groupingmodel.pro │ ├── main.cpp │ ├── modelwidget.cpp │ └── modelwidget.h ├── indicators │ ├── indicators.pro │ ├── main.cpp │ ├── moc_predefs.h │ ├── moc_widget.cpp │ ├── widget.cpp │ └── widget.h ├── itemdelegatedemo │ ├── default.txt │ ├── itemdelegatedemo.pro │ ├── itemdelegatedemo.qrc │ ├── main.cpp │ ├── mainwindow.cpp │ ├── mainwindow.h │ ├── treeitem.cpp │ ├── treeitem.h │ ├── treemodel.cpp │ ├── treemodel.h │ └── ui_mainwindow.h ├── itemviewdemo │ ├── demowidget.cpp │ ├── demowidget.h │ ├── itemviewdemo.pro │ ├── main.cpp │ ├── qoptionmodel.cpp │ └── qoptionmodel.h ├── messagelog │ ├── log.txt │ ├── main.cpp │ ├── messagelog.pro │ ├── resources.qrc │ ├── widget.cpp │ └── widget.h ├── metainvoke │ ├── controller.cpp │ ├── controller.h │ ├── main.cpp │ └── metainvoke.pro ├── multiprogress │ ├── main.cpp │ ├── multiprogress.pro │ ├── multiprogress.qrc │ ├── progresswidget.cpp │ ├── progresswidget.h │ └── resources │ │ └── items.json ├── objectmapper │ ├── dialog.cpp │ ├── dialog.h │ ├── main.cpp │ └── objectmapper.pro ├── objecttree │ ├── main.cpp │ ├── mainwindow.cpp │ ├── mainwindow.h │ └── objecttree.pro ├── objectviewer │ ├── dialog.cpp │ ├── dialog.h │ ├── main.cpp │ ├── metadata.json │ ├── objectviewer.pro │ └── objectviewer.qrc ├── overlay │ ├── main.cpp │ ├── overlay.pro │ ├── widget.cpp │ └── widget.h ├── overview │ ├── main.cpp │ ├── mainwindow.cpp │ ├── mainwindow.h │ ├── overview.pro │ ├── qtcodewindow.cpp │ ├── qtcodewindow.h │ ├── qtfilesystemwindow.cpp │ └── qtfilesystemwindow.h ├── qtanimatedwizard │ ├── main.cpp │ └── qtanimatedwizard.pro ├── resources │ └── palettes │ │ ├── Adobe │ │ ├── db32.act │ │ ├── db32_t.act │ │ ├── nord.aco │ │ └── nord.ase │ │ ├── GIMP │ │ ├── Bears.cmap │ │ ├── Bgold.cmap │ │ ├── Blues.cmap │ │ ├── Borders.cmap │ │ ├── Browns_And_Yellows.cmap │ │ ├── Caramel.cmap │ │ ├── Cascade.cmap │ │ ├── China.cmap │ │ ├── Coldfire.cmap │ │ ├── Cranes.cmap │ │ ├── DB32.cmap │ │ ├── Dark_pastels.cmap │ │ ├── Default.cmap │ │ ├── Ega.cmap │ │ ├── Firecode.cmap │ │ ├── Gold.cmap │ │ ├── GrayViolet.cmap │ │ ├── Grayblue.cmap │ │ ├── Grays.cmap │ │ ├── Greens.cmap │ │ ├── Hilite.cmap │ │ ├── Khaki.cmap │ │ ├── Lights.cmap │ │ ├── Material_Design.gpl │ │ ├── Muted.cmap │ │ ├── Named_Colors.cmap │ │ ├── News3.cmap │ │ ├── Op2.cmap │ │ ├── Paintjet.cmap │ │ ├── Pastels.cmap │ │ ├── Plasma.cmap │ │ ├── Reds.cmap │ │ ├── Reds_And_Purples.cmap │ │ ├── Royal.cmap │ │ ├── Tango.cmap │ │ ├── Topographic.cmap │ │ ├── Visibone.cmap │ │ ├── Visibone_2.cmap │ │ ├── Volcano.cmap │ │ ├── Warm_Colors.cmap │ │ └── Web.cmap │ │ ├── JASC │ │ └── jascpalette.pal │ │ ├── OSX │ │ ├── DB16.clr │ │ └── Nord.clr │ │ ├── RIFF │ │ └── sample.pal │ │ └── Text │ │ ├── db32.txt │ │ └── hexpalette.txt ├── spinboxes │ ├── demowidget.cpp │ ├── demowidget.h │ ├── main.cpp │ └── spinboxes.pro ├── sqlutils │ ├── main.cpp │ ├── qtsqlitembrowser.cpp │ ├── qtsqlitembrowser.h │ ├── resources │ │ └── images │ │ │ ├── database.png │ │ │ ├── field.png │ │ │ ├── systable.png │ │ │ ├── table.png │ │ │ └── view.png │ ├── sqlutils.pro │ └── sqlutils.qrc ├── variantmodel │ ├── main.cpp │ ├── variantmodel.pro │ ├── widget.cpp │ └── widget.h └── widgetdelegatedemo │ ├── main.cpp │ ├── previewlabel.cpp │ ├── previewlabel.h │ ├── qtfilelistmodel.cpp │ ├── qtfilelistmodel.h │ ├── widget.cpp │ ├── widget.h │ └── widgetdelegatedemo.pro ├── modelexporters ├── csvexporter │ ├── csvexporter.pro │ ├── qtcsvexporter.cpp │ ├── qtcsvexporter.h │ ├── qtcsvexporter.json │ ├── qtcsvexportplugin.cpp │ └── qtcsvexportplugin.h ├── excelexporter │ ├── excelexporter.json │ ├── excelexporter.pro │ ├── qtexcelexporter.cpp │ ├── qtexcelexporter.h │ ├── qtexcelexporterplugin.cpp │ └── qtexcelexporterplugin.h ├── htmlexporter │ ├── htmlexporter.json │ ├── htmlexporter.pro │ ├── moc_predefs.h │ ├── moc_qthtmlexporterplugin.cpp │ ├── qthtmlexporter.cpp │ ├── qthtmlexporter.h │ ├── qthtmlexporterplugin.cpp │ └── qthtmlexporterplugin.h ├── jsonexporter │ ├── jsonexporter.pro │ ├── qtjsonexporter.cpp │ ├── qtjsonexporter.h │ ├── qtjsonexporter.json │ ├── qtjsonexporterplugin.cpp │ └── qtjsonexporterplugin.h ├── modelexporters.pro └── xmlexporter │ ├── qtxmlexporter.cpp │ ├── qtxmlexporter.h │ ├── qtxmlexporterplugin.cpp │ ├── qtxmlexporterplugin.h │ ├── xmlexporter.json │ └── xmlexporter.pro ├── qtcoreextra ├── include │ ├── QtCoreExtra │ ├── QtEnums │ ├── QtGlobalExtra │ ├── QtJsonMapper │ ├── QtMethodInvoker │ ├── QtObjectMapper │ ├── QtResource │ ├── QtSettingsMapper │ └── QtXmlMapper ├── qtcoreextra.pri ├── qtcoreextra.pro └── src │ ├── qtcoreextra.h │ ├── qtglobalextra.h │ ├── qtjsonmapper.cpp │ ├── qtjsonmapper.h │ ├── qtjsonsettingsformat.cpp │ ├── qtjsonsettingsformat.h │ ├── qtmemorypool.h │ ├── qtmethodinvoker.cpp │ ├── qtmethodinvoker.h │ ├── qtobjectmapper.cpp │ ├── qtobjectmapper.h │ ├── qtresource.cpp │ ├── qtresource.h │ ├── qtsettingsmapper.cpp │ ├── qtsettingsmapper.h │ ├── qtxmlmapper.cpp │ └── qtxmlmapper.h ├── qtextra.pro ├── qtplugins ├── include │ ├── QtPluginInterface │ ├── QtPluginManager │ ├── QtPluginManagerDialog │ ├── QtPluginPropertyModel │ ├── QtPluginTreeView │ └── QtPluginsExt ├── qtplugins.pri ├── qtplugins.pro ├── qtplugins.qrc └── src │ ├── qtplugininterface.cpp │ ├── qtplugininterface.h │ ├── qtpluginmanager.cpp │ ├── qtpluginmanager.h │ ├── qtpluginmanagerdialog.cpp │ ├── qtpluginmanagerdialog.h │ ├── qtpluginmetadata.h │ ├── qtpluginpropertymodel.cpp │ ├── qtpluginpropertymodel.h │ ├── qtpluginsextra.h │ ├── qtplugintreeview.cpp │ └── qtplugintreeview.h ├── qtpropertybrowser ├── images │ ├── cursor-arrow.png │ ├── cursor-busy.png │ ├── cursor-closedhand.png │ ├── cursor-cross.png │ ├── cursor-forbidden.png │ ├── cursor-hand.png │ ├── cursor-hsplit.png │ ├── cursor-ibeam.png │ ├── cursor-openhand.png │ ├── cursor-sizeall.png │ ├── cursor-sizeb.png │ ├── cursor-sizef.png │ ├── cursor-sizeh.png │ ├── cursor-sizev.png │ ├── cursor-uparrow.png │ ├── cursor-vsplit.png │ ├── cursor-wait.png │ └── cursor-whatsthis.png ├── include │ ├── QtAbstractEditorFactoryBase │ ├── QtAbstractPropertyBrowser │ ├── QtAbstractPropertyManager │ ├── QtAttributeResource │ ├── QtBoolPropertyManager │ ├── QtBrowserItem │ ├── QtButtonPropertyBrowser │ ├── QtCharEditorFactory │ ├── QtCharPropertyManager │ ├── QtCheckBoxFactory │ ├── QtColorEditorFactory │ ├── QtColorPropertyManager │ ├── QtCursorEditorFactory │ ├── QtCursorPropertyManager │ ├── QtDateEditFactory │ ├── QtDatePropertyManager │ ├── QtDateTimeEditFactory │ ├── QtDateTimePropertyManager │ ├── QtDockWidget │ ├── QtDoublePropertyManager │ ├── QtDoubleSpinBoxFactory │ ├── QtEnumEditorFactory │ ├── QtEnumPropertyManager │ ├── QtFlagPropertyManager │ ├── QtFontEditorFactory │ ├── QtFontPropertyManager │ ├── QtGroupBoxPropertyBrowser │ ├── QtGroupPropertyManager │ ├── QtIntPropertyManager │ ├── QtKeySequenceEditorFactory │ ├── QtKeySequencePropertyManager │ ├── QtLineEditFactory │ ├── QtLocalePropertyManager │ ├── QtMainWindow │ ├── QtObjectEditor │ ├── QtPointFPropertyManager │ ├── QtPointPropertyManager │ ├── QtProperty │ ├── QtPropertyWidget │ ├── QtRectFPropertyManager │ ├── QtRectPropertyManager │ ├── QtScrollBarFactory │ ├── QtSizeFPropertyManager │ ├── QtSizePolicyPropertyManager │ ├── QtSizePropertyManager │ ├── QtSliderFactory │ ├── QtSpinBoxFactory │ ├── QtStringPropertyManager │ ├── QtTimeEditFactory │ ├── QtTimePropertyManager │ ├── QtTreePropertyBrowser │ ├── QtVariantEditorFactory │ ├── QtVariantProperty │ └── QtVariantPropertyManager ├── qtpropertybrowser.pri ├── qtpropertybrowser.pro ├── qtpropertybrowser.qrc └── src │ ├── qpropertyproxyobject.cpp │ ├── qtattributeresource.cpp │ ├── qtattributeresource.h │ ├── qtbuttonpropertybrowser.cpp │ ├── qtbuttonpropertybrowser.h │ ├── qteditorfactory.cpp │ ├── qteditorfactory.h │ ├── qtgroupboxpropertybrowser.cpp │ ├── qtgroupboxpropertybrowser.h │ ├── qtobjecteditor.cpp │ ├── qtobjecteditor.h │ ├── qtpropertybrowser.cpp │ ├── qtpropertybrowser.h │ ├── qtpropertybrowser.qrc │ ├── qtpropertybrowserutils.cpp │ ├── qtpropertybrowserutils_p.h │ ├── qtpropertymanager.cpp │ ├── qtpropertymanager.h │ ├── qtpropertyproxyobject.h │ ├── qtpropertywidget.cpp │ ├── qtpropertywidget.h │ ├── qttreepropertybrowser.cpp │ ├── qttreepropertybrowser.h │ ├── qtvariantproperty.cpp │ └── qtvariantproperty.h ├── qtsqlextra ├── include │ ├── QtSqlBuilder │ ├── QtSqlExtra │ └── QtSqlUtils ├── qtsqlextra.pri ├── qtsqlextra.pro └── src │ ├── qtsqlbuilder.cpp │ ├── qtsqlbuilder.h │ ├── qtsqlextra.h │ ├── qtsqlutils.cpp │ └── qtsqlutils.h ├── qtsqlwidgets ├── include │ ├── QtSqlConnectionDialog │ ├── QtSqlConnectionEdit │ ├── QtSqlItemTreeModel │ └── QtSqlWidgets ├── qtsqlwidgets.pri ├── qtsqlwidgets.pro ├── qtsqlwidgets.qrc ├── resources │ └── connect_options.json └── src │ ├── qtsqlconnectiondialog.cpp │ ├── qtsqlconnectiondialog.h │ ├── qtsqlconnectionedit.cpp │ ├── qtsqlconnectionedit.h │ ├── qtsqlitemtreemodel.cpp │ ├── qtsqlitemtreemodel.h │ └── qtsqlwidgets.h └── qtwidgetsextra ├── include ├── QtAboutDialog ├── QtActionItemDelegate ├── QtButtonLocker ├── QtCachingProxyModel ├── QtCardWidget ├── QtCheckableProxyModel ├── QtColorButton ├── QtColorComboBox ├── QtColorGrid ├── QtColorPalette ├── QtColorSelector ├── QtColorTriangle ├── QtColumnProxyModel ├── QtComboBoxItemDelegate ├── QtCompositeItemDelegate ├── QtCompositeProxyModel ├── QtContentView ├── QtCounterItemDelegate ├── QtCrumbBar ├── QtCustomHeaderView ├── QtDockWidget ├── QtEditDialog ├── QtHsvRadialPicker ├── QtHsvRectPicker ├── QtItemFilter ├── QtItemMapper ├── QtItemModelUtility ├── QtItemViewController ├── QtItemViewNavigator ├── QtLineBoxEdit ├── QtLongSpinBox ├── QtMainWindow ├── QtMenuItemDelegate ├── QtMessageLogView ├── QtMessageLogWidget ├── QtMultiProgressDialog ├── QtNotificationBar ├── QtObjectTreeModel ├── QtOptionsWidget ├── QtOverviewWidget ├── QtPaintUtils ├── QtPathLineEdit ├── QtPatternEdit ├── QtPlaceholderEffect ├── QtProgressEffect ├── QtProgressItemDelegate ├── QtRangeNavigator ├── QtRevertibleProxyModel ├── QtRichTextItemDelegate ├── QtSheetItemDelegate ├── QtShortcutEdit ├── QtSlideButton ├── QtSlideCheckBox ├── QtSlideController ├── QtSpanSlider ├── QtSpinBoxEdit ├── QtSplashWidget ├── QtStateIndicator ├── QtSwitchButton ├── QtSyntaxHighlighter ├── QtTableModelExporter ├── QtTableModelExporterDialog ├── QtTableModelExporterFactory ├── QtTableModelExporterPlugin ├── QtTextCodecModel ├── QtTextSpinBox ├── QtTreeProxyModel ├── QtVariantItemDelegate ├── QtVariantListModel ├── QtVariantTypeDelegate ├── QtWidgetItemDelegate ├── QtWidgetsExtra └── QtWindowManager ├── qtwidgetsextra.pri ├── qtwidgetsextra.pro ├── qtwidgetsextra.qrc ├── resources ├── images │ ├── icons8-search-16.png │ ├── patterns-HW.png │ ├── patterns-HWRX.png │ ├── patterns-RX.png │ ├── patterns-aA.png │ ├── patterns-aAHW.png │ ├── patterns-aAHWRX.png │ ├── patterns-aARX.png │ └── patterns.ora ├── shaders │ ├── dual_kawase_down.frag │ ├── dual_kawase_up.frag │ └── simple.vert └── text │ └── textcodecs.txt └── src ├── effects ├── blur.h ├── boxblur.cpp ├── glblurfunctions.cpp ├── glblurfunctions.h ├── qtblurbehindeffect.cpp ├── qtblurbehindeffect.h └── stackblur.cpp ├── indicators ├── qtstateindicator.cpp ├── qtstateindicator.h ├── qtswitchbutton.cpp └── qtswitchbutton.h ├── itemviews ├── delegates │ ├── qtactionitemdelegate.cpp │ ├── qtactionitemdelegate.h │ ├── qtcomboboxitemdelegate.cpp │ ├── qtcomboboxitemdelegate.h │ ├── qtcompositeitemdelegate.cpp │ ├── qtcompositeitemdelegate.h │ ├── qtcounteritemdelegate.cpp │ ├── qtcounteritemdelegate.h │ ├── qtmenuitemdelegate.cpp │ ├── qtmenuitemdelegate.h │ ├── qtprogressitemdelegate.cpp │ ├── qtprogressitemdelegate.h │ ├── qtrichtextitemdelegate.cpp │ ├── qtrichtextitemdelegate.h │ ├── qtsheetitemdelegate.cpp │ ├── qtsheetitemdelegate.h │ ├── qtvariantitemdelegate.cpp │ ├── qtvariantitemdelegate.h │ ├── qtvarianttypedelegate.cpp │ ├── qtvarianttypedelegate.h │ ├── qtwidgetitemdelegate.cpp │ └── qtwidgetitemdelegate.h ├── models │ ├── qtcachingproxymodel.cpp │ ├── qtcachingproxymodel.h │ ├── qtcheckableproxymodel.cpp │ ├── qtcheckableproxymodel.h │ ├── qtcolumnproxymodel.cpp │ ├── qtcolumnproxymodel.h │ ├── qtcompositeproxymodel.cpp │ ├── qtcompositeproxymodel.h │ ├── qtenumlistmodel.cpp │ ├── qtenumlistmodel.h │ ├── qtheaderproxymodel.cpp │ ├── qtheaderproxymodel.h │ ├── qtitemfilter.cpp │ ├── qtitemfilter.h │ ├── qtobjectlistmodel.cpp │ ├── qtobjectlistmodel.h │ ├── qtobjecttreemodel.cpp │ ├── qtobjecttreemodel.h │ ├── qtrevertibleproxymodel.cpp │ ├── qtrevertibleproxymodel.h │ ├── qtrowproxymodel.cpp │ ├── qtrowproxymodel.h │ ├── qttablemodelexporter.cpp │ ├── qttablemodelexporter.h │ ├── qttablemodelexporterdialog.cpp │ ├── qttablemodelexporterdialog.h │ ├── qttablemodelexporterfactory.cpp │ ├── qttablemodelexporterfactory.h │ ├── qttablemodelexporterplugin.h │ ├── qttextcodecmodel.cpp │ ├── qttextcodecmodel.h │ ├── qttreeproxymodel.cpp │ ├── qttreeproxymodel.h │ ├── qtvariantlistmodel.cpp │ └── qtvariantlistmodel.h ├── qtitemmodelutility.h └── views │ ├── qtcrumbbar.cpp │ ├── qtcrumbbar.h │ ├── qtcustomheaderview.cpp │ ├── qtcustomheaderview.h │ ├── qtitemviewcontroller.cpp │ ├── qtitemviewcontroller.h │ ├── qtitemviewnavigator.cpp │ ├── qtitemviewnavigator.h │ ├── qtrangenavigator.cpp │ └── qtrangenavigator.h ├── mainwindow ├── qtdocksidebar.cpp ├── qtdocksidebar.h ├── qtdocktabbar.cpp ├── qtdocktabbar.h ├── qtdockwidget.cpp ├── qtdockwidget.h ├── qtdockwidgettitlebar.cpp ├── qtdockwidgettitlebar.h ├── qtmainwindow.cpp ├── qtmainwindow.h ├── qtwindowmanager.cpp └── qtwindowmanager.h ├── painting ├── qtcolorpalette.cpp ├── qtcolorpalette.h ├── qtcolorpaletteformats.cpp ├── qtcolorutils.cpp ├── qtcolorutils.h ├── qtpaintutils.cpp └── qtpaintutils.h ├── qtwidgetsextra.h └── widgets ├── qtaboutdialog.cpp ├── qtaboutdialog.h ├── qtbuttonlocker.cpp ├── qtbuttonlocker.h ├── qtcardwidget.cpp ├── qtcardwidget.h ├── qtcolorbutton.cpp ├── qtcolorbutton.h ├── qtcolorcombobox.cpp ├── qtcolorcombobox.h ├── qtcolorgrid.cpp ├── qtcolorgrid.h ├── qtcolorgrid_p.h ├── qtcolorselector.cpp ├── qtcolorselector.h ├── qtcolortriangle.cpp ├── qtcolortriangle.h ├── qtcontentview.cpp ├── qtcontentview.h ├── qtdaterange.cpp ├── qtdaterange.h ├── qtdaterangeedit.cpp ├── qtdaterangeedit.h ├── qteditdialog.cpp ├── qteditdialog.h ├── qtenums.cpp ├── qtenums.h ├── qtfloatingtoolbutton.cpp ├── qtfloatingtoolbutton.h ├── qthsvradialpicker.cpp ├── qthsvradialpicker.h ├── qthsvrectpicker.cpp ├── qthsvrectpicker.h ├── qtlineboxedit.cpp ├── qtlineboxedit.h ├── qtlongspinbox.cpp ├── qtlongspinbox.h ├── qtmessagelogmodel.cpp ├── qtmessagelogmodel.h ├── qtmessagelogview.cpp ├── qtmessagelogview.h ├── qtmessagelogwidget.cpp ├── qtmessagelogwidget.h ├── qtmultiprogressdialog.cpp ├── qtmultiprogressdialog.h ├── qtnotificationbar.cpp ├── qtnotificationbar.h ├── qtoptionswidget.cpp ├── qtoptionswidget.h ├── qtoverviewwidget.cpp ├── qtoverviewwidget.h ├── qtpathlineedit.cpp ├── qtpathlineedit.h ├── qtpatternedit.cpp ├── qtpatternedit.h ├── qtplaceholdereffect.cpp ├── qtplaceholdereffect.h ├── qtprogresseffect.cpp ├── qtprogresseffect.h ├── qtshortcutedit.cpp ├── qtshortcutedit.h ├── qtslidebutton.cpp ├── qtslidebutton.h ├── qtslidebutton_p.h ├── qtslidecheckbox.cpp ├── qtslidecheckbox.h ├── qtslidecontroller.cpp ├── qtslidecontroller.h ├── qtsnackbar.cpp ├── qtsnackbar.h ├── qtspanslider.cpp ├── qtspanslider.h ├── qtspinboxedit.cpp ├── qtspinboxedit.h ├── qtsplashwidget.cpp ├── qtsplashwidget.h ├── qtsyntaxhighlighter.cpp ├── qtsyntaxhighlighter.h ├── qttextspinbox.cpp └── qttextspinbox.h /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | #ignore thumbnails created by windows 3 | Thumbs.db 4 | #Ignore files build by Visual Studio 5 | *.pdb 6 | *.user 7 | *.aps 8 | *.pch 9 | *.vspscc 10 | *_i.c 11 | *_p.c 12 | *.ncb 13 | *.suo 14 | *.tlb 15 | *.tlh 16 | *.bak 17 | *.cache 18 | *.ilk 19 | *.log 20 | *.ipch 21 | [Bb]in 22 | [Ll]ib 23 | [Ll]ibs 24 | [Tt]mp 25 | [Bb]uild 26 | [Dd]ebug*/ 27 | *.lib 28 | *.sbr 29 | obj/ 30 | [Rr]elease*/ 31 | _ReSharper*/ 32 | [Tt]est[Rr]esult* 33 | *.suo 34 | *.sdf 35 | *.opensdf 36 | *.db 37 | *.opendb 38 | 39 | # Directories 40 | doc/ 41 | catch/ 42 | 43 | # Qt progect stash 44 | .qmake.stash 45 | 46 | # Prerequisites 47 | *.d 48 | 49 | # Compiled Object files 50 | *.slo 51 | *.lo 52 | *.o 53 | *.obj 54 | 55 | # Precompiled Headers 56 | *.gch 57 | *.pch 58 | 59 | # Compiled Dynamic libraries 60 | *.so 61 | *.dylib 62 | *.dll 63 | 64 | # Compiled Static libraries 65 | *.lai 66 | *.la 67 | *.a 68 | *.lib 69 | 70 | # Executables 71 | *.exe 72 | *.out 73 | *.app 74 | 75 | # Makefiles 76 | Makefile 77 | Makefile.* 78 | 79 | 80 | -------------------------------------------------------------------------------- /documentation/images/WidgetDelegateLoading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/WidgetDelegateLoading.png -------------------------------------------------------------------------------- /documentation/images/WidgetItemDelegateLoaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/WidgetItemDelegateLoaded.png -------------------------------------------------------------------------------- /documentation/images/WidgetItemDelegateSize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/WidgetItemDelegateSize.png -------------------------------------------------------------------------------- /documentation/images/WidgetItemDelegateStatic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/WidgetItemDelegateStatic.png -------------------------------------------------------------------------------- /documentation/images/color_palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/color_palette.png -------------------------------------------------------------------------------- /documentation/images/color_widgets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/color_widgets.png -------------------------------------------------------------------------------- /documentation/images/item_delegates(1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/item_delegates(1).png -------------------------------------------------------------------------------- /documentation/images/message_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/message_log.png -------------------------------------------------------------------------------- /documentation/images/multiprogress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/multiprogress.png -------------------------------------------------------------------------------- /documentation/images/multiprogress_detailed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/multiprogress_detailed.png -------------------------------------------------------------------------------- /documentation/images/object_mapper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/object_mapper.png -------------------------------------------------------------------------------- /documentation/images/overlay(1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/overlay(1).png -------------------------------------------------------------------------------- /documentation/images/overlay(2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/overlay(2).png -------------------------------------------------------------------------------- /documentation/images/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/overview.png -------------------------------------------------------------------------------- /documentation/images/property_widget_buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/property_widget_buttons.png -------------------------------------------------------------------------------- /documentation/images/property_widget_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/property_widget_group.png -------------------------------------------------------------------------------- /documentation/images/property_widget_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/property_widget_tree.png -------------------------------------------------------------------------------- /documentation/images/spinboxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/spinboxes.png -------------------------------------------------------------------------------- /documentation/images/text_by_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/text_by_circle.png -------------------------------------------------------------------------------- /documentation/images/text_by_curve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/documentation/images/text_by_curve.png -------------------------------------------------------------------------------- /examples/codeeditor/codeeditor.h: -------------------------------------------------------------------------------- 1 | #ifndef CODEEDITOR_H 2 | #define CODEEDITOR_H 3 | 4 | #include 5 | 6 | class QtAboutDialog; 7 | class QtNotificationBar; 8 | class QtSyntaxHighlighter; 9 | 10 | class QtPatternEdit; 11 | 12 | class JSEdit; 13 | 14 | class CodeEditor : 15 | public QMainWindow 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | CodeEditor(QWidget *parent = 0); 21 | ~CodeEditor(); 22 | 23 | public Q_SLOTS: 24 | void open(); 25 | void save(); 26 | void setSyntax(); 27 | void about(); 28 | private: 29 | void createMenus(); 30 | void createActions(); 31 | 32 | private: 33 | QHash syntaxFiles; 34 | JSEdit* codeEdit; 35 | QtSyntaxHighlighter* highlighter; 36 | QMenu* fileMenu; 37 | QMenu* syntaxMenu; 38 | QMenu* helpMenu; 39 | QToolBar* toolBar; 40 | QtNotificationBar* notificationBar; 41 | QtAboutDialog* aboutDialog; 42 | QtPatternEdit* patternEdit; 43 | // QObject interface 44 | public: 45 | virtual bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; 46 | }; 47 | 48 | #endif // CODEEDITOR_H 49 | -------------------------------------------------------------------------------- /examples/codeeditor/codeeditor.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/qt-logo.png 4 | 5 | 6 | resources/application.json 7 | 8 | 9 | resources/LICENSE 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/codeeditor/main.cpp: -------------------------------------------------------------------------------- 1 | #include "codeeditor.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | CodeEditor w; 8 | w.resize(640, 480); 9 | w.show(); 10 | 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /examples/codeeditor/resources/application.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Code Editor", 3 | "description": "Qt Source Code Editor Example", 4 | "version": "1.0\n\n%SystemInfo%", 5 | "copyright": "Qt Corporation 2019(c)", 6 | "image": ":/images/logo.png", 7 | "license": ":/text/license" 8 | } 9 | -------------------------------------------------------------------------------- /examples/codeeditor/resources/qt-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/codeeditor/resources/qt-logo.png -------------------------------------------------------------------------------- /examples/colorpalette/colorpalette.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/Grays.cmap 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/colorpalette/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 | -------------------------------------------------------------------------------- /examples/colorpalette/resources/Grays.cmap: -------------------------------------------------------------------------------- 1 | GIMP Palette 2 | Name: Grays 3 | 0 0 0 gray0 4 | 7 7 7 gray3 5 | 15 15 15 gray6 6 | 23 23 23 gray9 7 | 31 31 31 gray12 8 | 39 39 39 gray15 9 | 47 47 47 gray18 10 | 55 55 55 gray21 11 | 63 63 63 gray25 12 | 71 71 71 gray28 13 | 79 79 79 gray31 14 | 87 87 87 gray34 15 | 95 95 95 gray37 16 | 103 103 103 gray40 17 | 111 111 111 gray43 18 | 119 119 119 gray46 19 | 127 127 127 gray50 20 | 135 135 135 gray53 21 | 143 143 143 gray56 22 | 151 151 151 gray59 23 | 159 159 159 gray62 24 | 167 167 167 gray65 25 | 175 175 175 gray68 26 | 183 183 183 gray71 27 | 191 191 191 gray75 28 | 199 199 199 gray78 29 | 207 207 207 gray81 30 | 215 215 215 gray84 31 | 223 223 223 gray87 32 | 231 231 231 gray90 33 | 239 239 239 gray93 34 | 247 247 247 gray96 35 | -------------------------------------------------------------------------------- /examples/colorpalette/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class QLabel; 9 | class QSpinBox; 10 | class QAbstractButton; 11 | class QDialogButtonBox; 12 | class QPlainTextEdit; 13 | class QtGradientWidget; 14 | 15 | class Widget : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | Widget(QWidget *parent = 0); 21 | ~Widget(); 22 | private slots: 23 | void open(); 24 | void save(); 25 | void clicked(QAbstractButton* button); 26 | void colorSelected(const QColor& c); 27 | void setIconWidth(int w); 28 | void setIconHeight(int h); 29 | private: 30 | int guessFormat(const QString& filePath); 31 | private: 32 | QtGradientWidget* gradientView; 33 | QtColorGrid* colorGrid; 34 | QPlainTextEdit* textEdit; 35 | QDialogButtonBox* buttonBox; 36 | QSpinBox* wSizeEdit; 37 | QSpinBox* hSizeEdit; 38 | QLabel* colorLabel; 39 | }; 40 | 41 | 42 | 43 | class QtGradientWidget : public QWidget 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | QtGradientWidget(QWidget *parent = 0); 49 | ~QtGradientWidget(); 50 | 51 | const QtColorPalette& colorPalette() const; 52 | void readPalette(const QString& path, int format); 53 | void writePalette(const QString &path, int format); 54 | // QWidget interface 55 | protected: 56 | virtual void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; 57 | virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; 58 | 59 | public: 60 | QtColorPalette mPalette; 61 | QGradient mGradient; 62 | }; 63 | 64 | 65 | #endif // WIDGET_H 66 | -------------------------------------------------------------------------------- /examples/colorwidgets/demowidget.h: -------------------------------------------------------------------------------- 1 | #ifndef DEMOWIDGET_H 2 | #define DEMOWIDGET_H 3 | 4 | #include 5 | 6 | class QFormLayout; 7 | class QVBoxLayout; 8 | class DemoWidget : public QWidget 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | DemoWidget(QWidget *parent = 0); 14 | ~DemoWidget(); 15 | 16 | void insertWidget(QWidget* w); 17 | private: 18 | QVBoxLayout* layout; 19 | }; 20 | 21 | #endif // DEMOWIDGET_H 22 | -------------------------------------------------------------------------------- /examples/colorwidgets/main.cpp: -------------------------------------------------------------------------------- 1 | #include "demowidget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | DemoWidget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /examples/configwidget/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "qconfigwidget.h" 3 | #include "qconfigwizard.h" 4 | int main(int argc, char *argv[]) 5 | { 6 | //Q_INIT_RESOURCE(configdialog); 7 | 8 | QApplication app(argc, argv); 9 | app.setApplicationDisplayName("Qt Example"); 10 | 11 | QConfigWidget widget; 12 | QConfigWizard wizard; 13 | 14 | widget.show(); 15 | wizard.show(); 16 | 17 | return app.exec(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /examples/configwidget/qconfigwidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class QListWidget; 5 | class QListWidgetItem; 6 | class QStackedWidget; 7 | 8 | // ### 9 | class QtSlideController; 10 | 11 | class QConfigWidget : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | QConfigWidget(QWidget* parent = Q_NULLPTR); 17 | 18 | public slots: 19 | void changePage(QListWidgetItem *current, QListWidgetItem *previous); 20 | 21 | private: 22 | void createIcons(); 23 | 24 | QListWidget *contentsWidget; 25 | QStackedWidget *pagesWidget; 26 | QtSlideController* controller; 27 | }; 28 | 29 | -------------------------------------------------------------------------------- /examples/configwidget/qconfigwizard.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | class QtRangeNavigator; 4 | class QConfigWizard : 5 | public QDialog 6 | { 7 | Q_OBJECT 8 | public: 9 | QConfigWizard(QWidget* parent = Q_NULLPTR); 10 | public slots: 11 | void changePage(int page); 12 | private: 13 | QtRangeNavigator* navigator; 14 | }; 15 | -------------------------------------------------------------------------------- /examples/curvedtext/curvedtext.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | metadata.json 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/curvedtext/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 | -------------------------------------------------------------------------------- /examples/curvedtext/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "QtPropertyWidget": { 3 | "QtPropertyWidget":"Редактор свойств", 4 | "classFilter":{"classFilter":"Фильтр классов", "placeholderText":"<Фильтр>"}, 5 | "propertyFilter":{"propertyFilter":"Фильр свойств", "placeholderText":"<Фильтр>"}, 6 | "submitPolicy":{"submitPolicy":"Способ фиксации"}, 7 | "viewType":{"viewType":"Вид отображения"}, 8 | "isFinal":{"isFinal":"Нерекурсивно"} 9 | }, 10 | "PaintArea": { 11 | "offset": {"offset":"offset","minimum":0.0, "maximum":1.0, "singleStep":0.01}, 12 | "stretch": {"stretch":"stretch","minimum":0.0, "maximum":1.0, "singleStep":0.01}, 13 | "angle": {"angle":"angle","minimum":0.0, "maximum":1.0, "singleStep":0.01}, 14 | "penWidth": {"penWidth":"penWidth", "minimum":0, "maximum":100, "singleStep":1} 15 | }, 16 | "PolygonArea": { 17 | "radius": {"radius":"radius","minimum":0.0, "maximum":1000.0, "singleStep":1.0} 18 | }, 19 | "StarArea": { 20 | "sideCount":{"sideCount":"sideCount", "minimum":3, "maximum":1000, "singleStep":1}, 21 | "factor": {"factor":"factor","minimum":0.0, "maximum":1.0, "singleStep":0.05}, 22 | "radius": {"radius":"radius","minimum":0.0, "maximum":1000.0, "singleStep":1.0} 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /examples/curvedtext/qtradiusesmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef QTRADIUSESMODEL_H 2 | #define QTRADIUSESMODEL_H 3 | 4 | #include 5 | 6 | using RadiusesVector = QVarLengthArray; 7 | 8 | class QtRadiusesModel : public QAbstractTableModel 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | explicit QtRadiusesModel(QObject *parent = nullptr); 14 | 15 | // Header: 16 | QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; 17 | 18 | // Basic functionality: 19 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; 20 | int columnCount(const QModelIndex &parent = QModelIndex()) const override; 21 | 22 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; 23 | 24 | // Editable: 25 | bool setData(const QModelIndex &index, const QVariant &value, 26 | int role = Qt::EditRole) override; 27 | 28 | Qt::ItemFlags flags(const QModelIndex& index) const override; 29 | 30 | void reset(int count); 31 | 32 | const RadiusesVector& radiuses() const; 33 | 34 | private: 35 | RadiusesVector radiusesArray; 36 | }; 37 | 38 | #endif // QTRADIUSESMODEL_H 39 | -------------------------------------------------------------------------------- /examples/examples.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += \ 4 | objectviewer \ 5 | configwidget \ 6 | itemviewdemo \ 7 | codeeditor \ 8 | objectmapper \ 9 | itemdelegatedemo \ 10 | sqlutils \ 11 | qtanimatedwizard \ 12 | colorwidgets \ 13 | spinboxes \ 14 | variantmodel \ 15 | curvedtext \ 16 | colorpalette \ 17 | metainvoke \ 18 | indicators \ 19 | objecttree \ 20 | multiprogress \ 21 | overlay \ 22 | messagelog \ 23 | overview \ 24 | groupingmodel \ 25 | widgetdelegatedemo 26 | -------------------------------------------------------------------------------- /examples/groupingmodel/modelwidget.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "modelwidget.h" 5 | 6 | 7 | ModelWidget::ModelWidget(QWidget *parent) 8 | : QWidget(parent) 9 | { 10 | view = new QTreeView(this); 11 | 12 | model = new QSqlQueryModel(this); 13 | model->setQuery("select id, firstname, lastname, date(timestamp) as birthdate from people order by birthdate desc", QSqlDatabase::database(":memory:")); 14 | //model->setEditStrategy(QSqlTableModel::OnManualSubmit); 15 | //model->select(); 16 | 17 | model->setHeaderData(0, Qt::Horizontal, tr("ID")); 18 | model->setHeaderData(1, Qt::Horizontal, tr("First name")); 19 | model->setHeaderData(2, Qt::Horizontal, tr("Last name")); 20 | 21 | proxy = new QtTreeProxyModel(this); 22 | proxy->setGroupping(1, Qt::DisplayRole); 23 | proxy->setSourceModel(model); 24 | 25 | connect(proxy, &QtTreeProxyModel::groupColumnChanged, view, &QTreeView::doItemsLayout); 26 | connect(proxy, &QtTreeProxyModel::groupNameRoleChanged, view, &QTreeView::doItemsLayout); 27 | 28 | view->setModel(proxy); 29 | 30 | QtPropertyWidget* controller = new QtPropertyWidget(this); 31 | controller->setObject(proxy); 32 | 33 | QHBoxLayout* layout = new QHBoxLayout(this); 34 | layout->addWidget(view); 35 | layout->addWidget(controller); 36 | } 37 | 38 | ModelWidget::~ModelWidget() 39 | { 40 | 41 | } 42 | -------------------------------------------------------------------------------- /examples/groupingmodel/modelwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MODELWIDGET_H 2 | #define MODELWIDGET_H 3 | 4 | #include 5 | 6 | class QSqlTableModel; 7 | class QSqlQueryModel; 8 | class QtTreeProxyModel; 9 | 10 | class ModelWidget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | ModelWidget(QWidget *parent = 0); 16 | ~ModelWidget(); 17 | 18 | private: 19 | QTreeView* view; 20 | QSqlQueryModel* model; 21 | QtTreeProxyModel* proxy; 22 | }; 23 | 24 | #endif // MODELWIDGET_H 25 | -------------------------------------------------------------------------------- /examples/indicators/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 | -------------------------------------------------------------------------------- /examples/indicators/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | Widget::Widget(QWidget *parent) : QWidget(parent) 11 | { 12 | indicator = new QtSwitchButton(this); 13 | //indicator = new QtStateIndicator(this); 14 | //qobject_cast(indicator)->setClickable(false); 15 | //qobject_cast(indicator)->setAnimated(true); 16 | //qobject_cast(indicator)->setDuration(300); 17 | 18 | connect(indicator, SIGNAL(clicked()), SLOT(switchLight())); 19 | //indicator = new QtSwitchButton(this); 20 | 21 | browser = new QtPropertyWidget(this); 22 | browser->setObject(indicator); 23 | 24 | QSplitter* splitter = new QSplitter(this); 25 | splitter->addWidget(indicator); 26 | splitter->addWidget(browser); 27 | 28 | QVBoxLayout* layout = new QVBoxLayout(this); 29 | layout->addWidget(splitter); 30 | } 31 | 32 | Widget::~Widget() 33 | { 34 | 35 | } 36 | 37 | void Widget::switchLight() 38 | { 39 | QtStateIndicator* stateIndicator = qobject_cast(indicator); 40 | if (!stateIndicator) { 41 | return; 42 | } 43 | QColor color = stateIndicator->color(); 44 | QRgb rgb = color.rgb(); 45 | rgb ^= qRgb(255, 255, 0); 46 | color.setRgb(rgb); 47 | stateIndicator->setColor(color); 48 | } 49 | -------------------------------------------------------------------------------- /examples/indicators/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | class QAbstractButton; 7 | class QtPropertyWidget; 8 | 9 | class Widget : public QWidget 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | Widget(QWidget *parent = 0); 15 | ~Widget(); 16 | public Q_SLOTS: 17 | void switchLight(); 18 | private: 19 | QtPropertyWidget* browser; 20 | QAbstractButton* indicator; 21 | }; 22 | 23 | #endif // WIDGET_H 24 | -------------------------------------------------------------------------------- /examples/itemdelegatedemo/itemdelegatedemo.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | default.txt 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/itemdelegatedemo/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | class QMenu; 10 | class QAction; 11 | class QTreeView; 12 | 13 | class MainWindow : public QMainWindow 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | MainWindow(QWidget *parent = 0); 19 | 20 | public slots: 21 | void updateActions(); 22 | 23 | private slots: 24 | void insertChild(); 25 | bool insertColumn(); 26 | void insertRow(); 27 | bool removeColumn(); 28 | void removeRow(); 29 | void changeValue(const QString& name, const QVariant& value); 30 | 31 | private: 32 | void setupUi(); 33 | 34 | private: 35 | QtCrumbBar* breadcrumbBar; 36 | QTreeView* view; 37 | QMenu* fileMenu; 38 | QAction* exitAction; 39 | QMenu* actionsMenu; 40 | QAction* removeRowAction; 41 | QAction* removeColumnAction; 42 | QAction* insertRowAction; 43 | QAction* insertColumnAction; 44 | QAction* insertChildAction; 45 | }; 46 | 47 | 48 | class Widget : public QWidget 49 | { 50 | Q_OBJECT 51 | public: 52 | Widget(QWidget* parent = 0); 53 | private Q_SLOTS: 54 | void formatPath(); 55 | private: 56 | QTreeView* view; 57 | }; 58 | 59 | #endif // MAINWINDOW_H 60 | -------------------------------------------------------------------------------- /examples/itemviewdemo/demowidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class QAction; 5 | class QTableView; 6 | class QAbstractTableModel; 7 | class QSortFilterProxyModel; 8 | 9 | class QtItemViewController; 10 | class QtPatternEdit; 11 | 12 | class DemoWidget : public QWidget 13 | { 14 | Q_OBJECT 15 | public: 16 | DemoWidget(QWidget* parent = 0); 17 | ~DemoWidget(); 18 | 19 | private slots: 20 | void currentChanged(const QModelIndex& index); 21 | void filterModel(const QString& pattern); 22 | void aboutPlugins(); 23 | void exportModel(); 24 | 25 | private: 26 | void enableActions(); 27 | 28 | private: 29 | QTableView* view; 30 | QAbstractTableModel* model; 31 | QSortFilterProxyModel* proxy; 32 | QtItemViewController* controller; 33 | QtPatternEdit* filterEdit; 34 | }; 35 | 36 | -------------------------------------------------------------------------------- /examples/itemviewdemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include "demowidget.h" 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | class QtItemModelExporterInterface : 12 | public QtGenericInterface 13 | { 14 | typedef QtGenericInterface InterfaceBase; 15 | // QtPluginInterface interface 16 | public: 17 | QtItemModelExporterInterface() : 18 | InterfaceBase(QObject::tr("Model Export")) { 19 | } 20 | 21 | bool resolve(QObject *instance) const Q_DECL_OVERRIDE { 22 | QtTableModelExporterPlugin* plugin = qobject_cast(instance); 23 | if (plugin) { 24 | QtTableModelExporterFactory::instance()->registerExporter(plugin); 25 | return true; 26 | } 27 | return false; 28 | } 29 | }; 30 | 31 | QT_PLUGIN_INTERFACE(QtItemModelExporterInterface) 32 | 33 | void loadPlugins() 34 | { 35 | QtPluginManager& manager = QtPluginManager::instance(); 36 | 37 | QDir pluginsDir(qApp->applicationDirPath()); 38 | pluginsDir.cd("plugins"); 39 | manager.load(pluginsDir); 40 | manager.load(); 41 | } 42 | 43 | 44 | int main(int argc, char *argv[]) 45 | { 46 | QApplication a(argc, argv); 47 | loadPlugins(); 48 | 49 | DemoWidget w; 50 | w.show(); 51 | 52 | return a.exec(); 53 | } 54 | -------------------------------------------------------------------------------- /examples/messagelog/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 | -------------------------------------------------------------------------------- /examples/messagelog/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | log.txt 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/messagelog/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include 6 | 7 | class QPushButton; 8 | 9 | class QtMessageLogView; 10 | class QtMessageLogWidget; 11 | 12 | class Widget : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | Widget(QWidget *parent = 0); 18 | ~Widget(); 19 | 20 | private Q_SLOTS: 21 | void createMessage(); 22 | void toggleTimer(bool on); 23 | private: 24 | QtMessageLogWidget* widget; 25 | QtMessageLogView* view; 26 | QPushButton* generateButton; 27 | QPushButton* clearButton; 28 | QTimer* timer; 29 | QFile file; 30 | }; 31 | 32 | 33 | 34 | 35 | #endif // WIDGET_H 36 | -------------------------------------------------------------------------------- /examples/metainvoke/controller.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "controller.h" 4 | 5 | BasicController::BasicController(QObject *parent) : 6 | QObject(parent), 7 | invoker(new QtMethodInvoker) 8 | { 9 | } 10 | 11 | BasicController::~BasicController() 12 | { 13 | delete invoker; 14 | } 15 | 16 | void BasicController::invoke(const QString &command) 17 | { 18 | if (!invoker->invoke(this, command, Q_ARG(QString, command))) { 19 | qCritical() << "failed to find command: " << command; 20 | } 21 | } 22 | 23 | void BasicController::initialize() 24 | { 25 | invoker->setMetaObject(this->metaObject()); 26 | } 27 | 28 | DomainController::DomainController(QObject *parent) : 29 | BasicController(parent) 30 | { 31 | initialize(); 32 | } 33 | 34 | DomainController::~DomainController() 35 | { 36 | } 37 | 38 | void DomainController::update(const QString &value) 39 | { 40 | qDebug() << Q_FUNC_INFO << value; 41 | } 42 | 43 | void DomainController::start(const QString &value) 44 | { 45 | qDebug() << Q_FUNC_INFO << value; 46 | } 47 | 48 | void DomainController::stop(const QString &value) 49 | { 50 | qDebug() << Q_FUNC_INFO << value; 51 | } 52 | -------------------------------------------------------------------------------- /examples/metainvoke/controller.h: -------------------------------------------------------------------------------- 1 | #ifndef CONTROLLER_H 2 | #define CONTROLLER_H 3 | 4 | #include 5 | 6 | class QtMethodInvoker; 7 | class BasicController : public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | explicit BasicController(QObject *parent = Q_NULLPTR); 12 | virtual ~BasicController(); 13 | 14 | void invoke(const QString& command); 15 | protected: 16 | void initialize(); 17 | 18 | private: 19 | QtMethodInvoker* invoker; 20 | }; 21 | 22 | 23 | class DomainController : public BasicController 24 | { 25 | Q_OBJECT 26 | public: 27 | DomainController(QObject *parent = Q_NULLPTR); 28 | virtual ~DomainController(); 29 | 30 | Q_CLASSINFO("update", "update") 31 | Q_INVOKABLE void update(const QString& value); 32 | 33 | Q_CLASSINFO("start", "start") 34 | Q_INVOKABLE void start(const QString& value); 35 | 36 | Q_CLASSINFO("stop", "stop") 37 | Q_INVOKABLE void stop(const QString& value); 38 | }; 39 | 40 | #endif // CONTROLLER_H 41 | -------------------------------------------------------------------------------- /examples/metainvoke/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "controller.h" 4 | 5 | int main() 6 | { 7 | DomainController controller; 8 | QString command; 9 | QTextStream input(stdin); 10 | for (;;) { 11 | if (input.atEnd()) 12 | break; 13 | input >> command; 14 | if (command.isEmpty()) 15 | continue; 16 | controller.invoke(command); 17 | } 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /examples/metainvoke/metainvoke.pro: -------------------------------------------------------------------------------- 1 | QT += core 2 | QT -= gui 3 | 4 | CONFIG += c++11 5 | CONFIG += console 6 | 7 | TEMPLATE = app 8 | 9 | CONFIG += debug_and_release 10 | 11 | CONFIG(debug, debug|release) { 12 | TARGET = metainvoked 13 | MOC_DIR = tmp/debug_shared/moc 14 | OBJECTS_DIR = tmp/debug_shared/obj 15 | RCC_DIR = tmp/debug_shared/rcc 16 | LIBS += -L../../libs -lqtpropertybrowserd -lqtcoreextrad 17 | } else { 18 | TARGET = metainvoke 19 | MOC_DIR = tmp/release_shared/moc 20 | OBJECTS_DIR = tmp/release_shared/obj 21 | RCC_DIR = tmp/release_shared/rcc 22 | LIBS += -L../../libs -lqtpropertybrowser -lqtcoreextra 23 | } 24 | 25 | # The following define makes your compiler emit warnings if you use 26 | # any feature of Qt which as been marked as deprecated (the exact warnings 27 | # depend on your compiler). Please consult the documentation of the 28 | # deprecated API in order to know how to port your code away from it. 29 | DEFINES += QT_DEPRECATED_WARNINGS QTCOREEXTRA_DLL 30 | 31 | # You can also make your code fail to compile if you use deprecated APIs. 32 | # In order to do so, uncomment the following line. 33 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 34 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 35 | 36 | DESTDIR = ../bin 37 | INCLUDEPATH += \ 38 | ../../qtcoreextra/include 39 | 40 | DEPENDPATH += \ 41 | ../../qtcoreextra/include 42 | 43 | 44 | HEADERS += \ 45 | controller.h 46 | 47 | SOURCES += main.cpp \ 48 | controller.cpp 49 | -------------------------------------------------------------------------------- /examples/multiprogress/main.cpp: -------------------------------------------------------------------------------- 1 | #include "progresswidget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | ProgressWidget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /examples/multiprogress/multiprogress.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/items.json 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/multiprogress/progresswidget.h: -------------------------------------------------------------------------------- 1 | #ifndef PROGRESSWIDGET_H 2 | #define PROGRESSWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class ProgressWidget : public QWidget 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | ProgressWidget(QWidget *parent = 0); 14 | ~ProgressWidget(); 15 | 16 | public Q_SLOTS: 17 | void execute(); 18 | 19 | private: 20 | QJsonObject json; 21 | QPushButton* execButton; 22 | }; 23 | 24 | #endif // PROGRESSWIDGET_H 25 | -------------------------------------------------------------------------------- /examples/multiprogress/resources/items.json: -------------------------------------------------------------------------------- 1 | { 2 | "DataSet 1": ["Item1_1", "Item1_2", "Item1_3", "Item1_4", "Item1_5"], 3 | "DataSet 2": ["Item2_1", "Item2_2", "Item2_3", "Item2_4"], 4 | "DataSet 3": ["Item3_1", "Item3_2", "Item3_3", "Item3_4", "Item3_5", "Item3_6", "Item3_7", "Item3_8"], 5 | "DataSet 4": ["Item4_1", "Item4_2"], 6 | "DataSet 5": ["Item5_1", "Item5_2", "Item5_3", "Item5_4", "Item5_5", "Item5_6"], 7 | "DataSet 6": ["Item6_1"], 8 | "DataSet 7": ["Item7_1", "Item7_2", "Item7_3"], 9 | "DataSet 8": ["Item1_1", "Item1_2", "Item1_3", "Item1_4", "Item1_5"], 10 | "DataSet 9": ["Item2_1", "Item2_2", "Item2_3", "Item2_4"], 11 | "DataSet 10": ["Item3_1", "Item3_2", "Item3_3", "Item3_4", "Item3_5", "Item3_6", "Item3_7", "Item3_8"], 12 | "DataSet 11": ["Item4_1", "Item4_2"], 13 | "DataSet 12": ["Item5_1", "Item5_2", "Item5_3", "Item5_4", "Item5_5", "Item5_6"], 14 | "DataSet 13": ["Item3_1", "Item3_2", "Item3_3", "Item3_4", "Item3_5", "Item3_6", "Item3_7", "Item3_8"], 15 | "DataSet 14": ["Item3_1", "Item3_2", "Item3_3", "Item3_4", "Item3_5", "Item3_6", "Item3_7", "Item3_8", "Item3_9", "Item3_10", "Item3_11"], 16 | "DataSet 15": ["Item3_1", "Item3_2", "Item3_3", "Item3_4", "Item3_5", "Item3_6", "Item3_7"] 17 | } 18 | -------------------------------------------------------------------------------- /examples/objecttree/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | MainWindow w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /examples/objecttree/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | 7 | class QTreeView; 8 | class QtObjectTreeModel; 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | MainWindow(QWidget *parent = 0); 16 | ~MainWindow(); 17 | 18 | private: 19 | void createMenus(); 20 | void createActions(); 21 | void createView(); 22 | 23 | private Q_SLOTS: 24 | void insertObject(); 25 | void removeObject(); 26 | 27 | 28 | private: 29 | QObject* rootObject; 30 | QtObjectTreeModel* model; 31 | QTreeView* view; 32 | QMenu* fileMenu; 33 | QMenu* itemMenu; 34 | }; 35 | 36 | #endif // MAINWINDOW_H 37 | -------------------------------------------------------------------------------- /examples/objectviewer/main.cpp: -------------------------------------------------------------------------------- 1 | #include "dialog.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Dialog w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /examples/objectviewer/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "QtPropertyWidget": { 3 | "QtPropertyWidget":"Редактор свойств", 4 | "classFilter":{"classFilter":"Фильтр классов", "placeholderText":"<Фильтр>"}, 5 | "propertyFilter":{"propertyFilter":"Фильр свойств", "placeholderText":"<Фильтр>"}, 6 | "submitPolicy":{"submitPolicy":"Способ фиксации"}, 7 | "viewType":{"viewType":"Вид отображения"}, 8 | "isFinal":{"isFinal":"Нерекурсивно"} 9 | }, 10 | "QtGadget": { 11 | "QtGadget": "Gadget", 12 | "id": {"id":"Идентификатор"} 13 | }, 14 | "QContact": { 15 | "QContact": "Контакт", 16 | "firstName": { "firstName": "Имя" }, 17 | "lastName": { "lastName": "Фамилия"}, 18 | "age": { "age":"Возраст", "minimum":0, "maximum":100 }, 19 | "rating": { "rating":"Рейтинг", "minimum":0.0, "maximum":1.0, "singleStep":0.1 }, 20 | "birthday": { "birthday":"День рождения" }, 21 | "married": { "married":"Семейное положение" } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/objectviewer/objectviewer.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | metadata.json 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/overlay/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 | -------------------------------------------------------------------------------- /examples/overlay/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | class QTimer; 11 | class QPropertyAnimation; 12 | 13 | class QtProgressEffect; 14 | class QtPlaceholderEffect; 15 | 16 | class Widget : public QWidget 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | Widget(QWidget *parent = 0); 22 | ~Widget(); 23 | 24 | public Q_SLOTS: 25 | void insertRow(); 26 | void removeRow(); 27 | 28 | void process(); 29 | void cancel(); 30 | 31 | private Q_SLOTS: 32 | void toggleAnimation(bool on); 33 | void openLink(const QString& url); 34 | private: 35 | QTableWidget* view; 36 | QPushButton* addRowButton; 37 | QPushButton* delRowButton; 38 | QPushButton* processButton; 39 | QPushButton* cancelButton; 40 | QPropertyAnimation* animation; 41 | QtProgressEffect* progressEffect; 42 | QTimer* timer; 43 | }; 44 | 45 | 46 | 47 | 48 | 49 | 50 | #endif // WIDGET_H 51 | -------------------------------------------------------------------------------- /examples/overview/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | MainWindow w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /examples/overview/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | class QMdiArea; 7 | 8 | class QtOverviewWidget; 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit MainWindow(QWidget *parent = 0); 16 | ~MainWindow(); 17 | 18 | public Q_SLOTS: 19 | void createCodeWindow(); 20 | void createFsWindow(); 21 | private: 22 | void createCentralWidget(); 23 | void createActions(); 24 | void createDockWidgets(); 25 | 26 | private: 27 | QMenu* fileMenu; 28 | QAction* codeAct; 29 | QAction* viewAct; 30 | QAction* exitAct; 31 | QMdiArea* area; 32 | QtOverviewWidget* overview; 33 | }; 34 | 35 | #endif // MAINWINDOW_H 36 | -------------------------------------------------------------------------------- /examples/overview/qtcodewindow.h: -------------------------------------------------------------------------------- 1 | #ifndef QTCODEWINDOW_H 2 | #define QTCODEWINDOW_H 3 | 4 | #include 5 | 6 | class QPlainTextEdit; 7 | class QtOverviewWidget; 8 | 9 | 10 | class QtCodeWindow : public QWidget 11 | { 12 | Q_OBJECT 13 | public: 14 | explicit QtCodeWindow(QWidget *parent = nullptr); 15 | ~QtCodeWindow(); 16 | 17 | bool load(); 18 | 19 | private: 20 | QPlainTextEdit* edit; 21 | QtOverviewWidget* overview; 22 | }; 23 | 24 | #endif // QTCODEWINDOW_H 25 | -------------------------------------------------------------------------------- /examples/overview/qtfilesystemwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef QTTREEWINDOW_H 2 | #define QTTREEWINDOW_H 3 | 4 | #include 5 | 6 | class QTreeView; 7 | class QFileSystemModel; 8 | class QtOverviewWidget; 9 | 10 | class QtFileSystemWindow : public QWidget 11 | { 12 | Q_OBJECT 13 | public: 14 | explicit QtFileSystemWindow(QWidget *parent = nullptr); 15 | ~QtFileSystemWindow(); 16 | 17 | private: 18 | QFileSystemModel* model; 19 | QTreeView* view; 20 | QtOverviewWidget* overview; 21 | 22 | }; 23 | 24 | #endif // QTTREEWINDOW_H 25 | -------------------------------------------------------------------------------- /examples/resources/palettes/Adobe/db32.act: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/resources/palettes/Adobe/db32.act -------------------------------------------------------------------------------- /examples/resources/palettes/Adobe/db32_t.act: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/resources/palettes/Adobe/db32_t.act -------------------------------------------------------------------------------- /examples/resources/palettes/Adobe/nord.aco: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/resources/palettes/Adobe/nord.aco -------------------------------------------------------------------------------- /examples/resources/palettes/Adobe/nord.ase: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/resources/palettes/Adobe/nord.ase -------------------------------------------------------------------------------- /examples/resources/palettes/GIMP/Browns_And_Yellows.cmap: -------------------------------------------------------------------------------- 1 | GIMP Palette 2 | Name: Browns And Yellows 3 | # 4 | 189 183 107 Dark Khaki 5 | 240 230 140 Khaki 6 | 238 232 170 Pale Goldenrod 7 | 250 250 210 Light Goldenrod Yellow 8 | 255 255 224 Light Yellow 9 | 255 255 0 Yellow 10 | 255 215 0 Gold 11 | 238 221 130 Light Goldenrod 12 | 218 165 32 Goldenrod 13 | 184 134 11 Dark Goldenrod 14 | 188 143 143 Rosy Brown 15 | 139 69 19 Saddle Brown 16 | 160 82 45 Sienna 17 | 205 133 63 Peru 18 | 222 184 135 Burlywood 19 | 245 245 220 Beige 20 | 245 222 179 Wheat 21 | 244 164 96 Sandy Brown 22 | 210 180 140 Tan 23 | 210 105 30 Chocolate 24 | 255 165 0 Orange 25 | 255 140 0 Dark Orange 26 | -------------------------------------------------------------------------------- /examples/resources/palettes/GIMP/DB32.cmap: -------------------------------------------------------------------------------- 1 | GIMP Palette 2 | Name: DawnBringer 32 3 | Columns: 8 4 | # 5 | 155 173 183 Untitled (occurs 1024) 6 | 82 75 36 Untitled (occurs 1024) 7 | 102 57 49 Untitled (occurs 1024) 8 | 118 66 138 Untitled (occurs 1024) 9 | 215 123 186 Untitled (occurs 1024) 10 | 50 60 57 Untitled (occurs 1024) 11 | 55 148 110 Untitled (occurs 1024) 12 | 69 40 60 Untitled (occurs 1024) 13 | 238 195 154 Untitled (occurs 1024) 14 | 172 50 50 Untitled (occurs 1024) 15 | 132 126 135 Untitled (occurs 1024) 16 | 138 111 48 Untitled (occurs 1024) 17 | 153 229 80 Untitled (occurs 1024) 18 | 143 151 74 Untitled (occurs 1024) 19 | 75 105 47 Untitled (occurs 1024) 20 | 143 86 59 Untitled (occurs 1024) 21 | 105 106 106 Untitled (occurs 1024) 22 | 203 219 252 Untitled (occurs 1024) 23 | 217 160 102 Untitled (occurs 1024) 24 | 34 32 52 Untitled (occurs 1024) 25 | 106 190 48 Untitled (occurs 1024) 26 | 99 155 255 Untitled (occurs 1024) 27 | 89 86 82 Untitled (occurs 1024) 28 | 95 205 228 Untitled (occurs 1024) 29 | 48 96 130 Untitled (occurs 1024) 30 | 255 255 255 Untitled (occurs 1024) 31 | 223 113 38 Untitled (occurs 1024) 32 | 91 110 225 Untitled (occurs 1024) 33 | 251 242 54 Untitled (occurs 1024) 34 | 0 0 0 Untitled (occurs 1024) 35 | 63 63 116 Untitled (occurs 1024) 36 | 217 87 99 Untitled (occurs 1024) 37 | -------------------------------------------------------------------------------- /examples/resources/palettes/GIMP/Default.cmap: -------------------------------------------------------------------------------- 1 | GIMP Palette 2 | Name: Default 3 | # 4 | 255 0 0 Red 5 | 255 0 255 Magenta 6 | 0 0 255 Blue 7 | 0 255 255 Cyan 8 | 0 255 0 Green 9 | 255 255 0 Yellow 10 | 127 0 0 Dark Red 11 | 127 0 127 Dark Magenta 12 | 0 0 127 Dark Blue 13 | 0 127 127 Dark Cyan 14 | 0 127 0 Dark Green 15 | 130 127 0 Dark Yellow 16 | 0 0 0 Black 17 | 25 25 25 Gray 10% 18 | 51 51 51 Gray 20% 19 | 76 76 76 Gray 30% 20 | 102 102 102 Gray 40% 21 | 127 127 127 Gray 50% 22 | 153 153 153 Gray 60% 23 | 178 178 178 Gray 70% 24 | 204 204 204 Gray 80% 25 | 229 229 229 Gray 90% 26 | 255 255 255 White 27 | -------------------------------------------------------------------------------- /examples/resources/palettes/GIMP/Grays.cmap: -------------------------------------------------------------------------------- 1 | GIMP Palette 2 | Name: Grays 3 | 0 0 0 gray0 4 | 7 7 7 gray3 5 | 15 15 15 gray6 6 | 23 23 23 gray9 7 | 31 31 31 gray12 8 | 39 39 39 gray15 9 | 47 47 47 gray18 10 | 55 55 55 gray21 11 | 63 63 63 gray25 12 | 71 71 71 gray28 13 | 79 79 79 gray31 14 | 87 87 87 gray34 15 | 95 95 95 gray37 16 | 103 103 103 gray40 17 | 111 111 111 gray43 18 | 119 119 119 gray46 19 | 127 127 127 gray50 20 | 135 135 135 gray53 21 | 143 143 143 gray56 22 | 151 151 151 gray59 23 | 159 159 159 gray62 24 | 167 167 167 gray65 25 | 175 175 175 gray68 26 | 183 183 183 gray71 27 | 191 191 191 gray75 28 | 199 199 199 gray78 29 | 207 207 207 gray81 30 | 215 215 215 gray84 31 | 223 223 223 gray87 32 | 231 231 231 gray90 33 | 239 239 239 gray93 34 | 247 247 247 gray96 35 | -------------------------------------------------------------------------------- /examples/resources/palettes/GIMP/Lights.cmap: -------------------------------------------------------------------------------- 1 | GIMP Palette 2 | Name: Lights 3 | # 4 | 255 250 250 Snow 5 | 248 248 255 Ghost White 6 | 245 245 245 White Smoke 7 | 220 220 220 Gainsboro 8 | 255 250 240 Floral White 9 | 253 245 230 Old Lace 10 | 250 240 230 Linen 11 | 250 235 215 Antique White 12 | 255 239 213 Papaya Whip 13 | 255 235 205 Blanched Almond 14 | 255 228 196 Bisque 15 | 255 218 185 Peach Puff 16 | 255 222 173 Navajo White 17 | 255 228 181 Moccasin 18 | 255 248 220 Cornsilk 19 | 255 255 240 Ivory 20 | 255 250 205 Lemon Chiffon 21 | 255 245 238 Seashell 22 | 240 255 240 Honeydew 23 | 245 255 250 Mint Cream 24 | 240 255 255 Azure 25 | 240 248 255 Alice Blue 26 | 230 230 250 Lavender 27 | 255 228 225 Misty Rose 28 | 255 255 255 White 29 | -------------------------------------------------------------------------------- /examples/resources/palettes/GIMP/Paintjet.cmap: -------------------------------------------------------------------------------- 1 | GIMP Palette 2 | Name: Paintjet 3 | # 4 | # A map with the PaintJet's 8 primary colors repeated twice. 5 | # Use these colors for 180dpi PaintJet images. 6 | # 7 | 24 20 12 Untitled 8 | 244 240 232 Untitled 9 | 196 68 72 Untitled 10 | 48 132 92 Untitled 11 | 240 232 72 Untitled 12 | 52 48 116 Untitled 13 | 188 48 108 Untitled 14 | 40 116 196 Untitled 15 | 24 20 12 Untitled 16 | 244 240 232 Untitled 17 | 196 68 72 Untitled 18 | 48 132 92 Untitled 19 | 240 232 72 Untitled 20 | 52 48 116 Untitled 21 | 188 48 108 Untitled 22 | 40 116 196 Untitled 23 | -------------------------------------------------------------------------------- /examples/resources/palettes/GIMP/Pastels.cmap: -------------------------------------------------------------------------------- 1 | GIMP Palette 2 | Name: Pastels 3 | # 4 | 226 145 145 Untitled 5 | 153 221 146 Untitled 6 | 147 216 185 Untitled 7 | 148 196 211 Untitled 8 | 148 154 206 Untitled 9 | 179 148 204 Untitled 10 | 204 150 177 Untitled 11 | 204 164 153 Untitled 12 | 223 229 146 Untitled 13 | 255 165 96 Untitled 14 | 107 255 99 Untitled 15 | 101 255 204 Untitled 16 | 101 196 255 Untitled 17 | 101 107 255 Untitled 18 | 173 101 255 Untitled 19 | 255 101 244 Untitled 20 | 255 101 132 Untitled 21 | 255 101 101 Untitled 22 | -------------------------------------------------------------------------------- /examples/resources/palettes/GIMP/Reds_And_Purples.cmap: -------------------------------------------------------------------------------- 1 | GIMP Palette 2 | Name: Reds And Purples 3 | # 4 | 205 92 92 Indian Red 5 | 178 34 34 Firebrick 6 | 165 42 42 Brown Red 7 | 233 150 122 Dark Salmon 8 | 250 128 114 Salmon 9 | 255 160 122 Light Salmon 10 | 255 127 80 Coral 11 | 240 128 128 Light Coral 12 | 255 99 71 Tomato 13 | 255 69 0 Orange Red 14 | 255 0 0 Red 15 | 255 105 180 Hot Pink 16 | 255 20 147 Deep Pink 17 | 255 192 203 Pink 18 | 255 182 193 Light Pink 19 | 219 112 147 Pale Violet Red 20 | 176 48 96 Maroon 21 | 199 21 133 Medium Violet Red 22 | 208 32 144 Violet Red 23 | 255 0 255 Magenta 24 | 238 130 238 Violet 25 | 221 160 221 Plum 26 | 218 112 214 Orchid 27 | 186 85 211 Medium Orchid 28 | 153 50 204 Dark Orchid 29 | 148 0 211 Dark Violet 30 | 138 43 226 Blue Violet 31 | 160 32 240 Purple 32 | 147 112 219 Medium Purple 33 | 216 191 216 Thistle 34 | -------------------------------------------------------------------------------- /examples/resources/palettes/GIMP/Tango.cmap: -------------------------------------------------------------------------------- 1 | GIMP Palette 2 | Name: Tango Icon Theme 3 | Columns: 3 4 | # 5 | 252 233 79 Butter 1 6 | 237 212 0 Butter 2 7 | 196 160 0 Butter 3 8 | 138 226 52 Chameleon 1 9 | 115 210 22 Chameleon 2 10 | 78 154 6 Chameleon 3 11 | 252 175 62 Orange 1 12 | 245 121 0 Orange 2 13 | 206 92 0 Orange 3 14 | 114 159 207 Sky Blue 1 15 | 52 101 164 Sky Blue 2 16 | 32 74 135 Sky Blue 3 17 | 173 127 168 Plum 1 18 | 117 80 123 Plum 2 19 | 92 53 102 Plum 3 20 | 233 185 110 Chocolate 1 21 | 193 125 17 Chocolate 2 22 | 143 89 2 Chocolate 3 23 | 239 41 41 Scarlet Red 1 24 | 204 0 0 Scarlet Red 2 25 | 164 0 0 Scarlet Red 3 26 | 238 238 236 Untitled 27 | 238 238 236 Aluminium 1 28 | 211 215 207 Aluminium 2 29 | 186 189 182 Aluminium 3 30 | 136 138 133 Aluminium 4 31 | 85 87 83 Aluminium 5 32 | 46 52 54 Aluminium 6 33 | -------------------------------------------------------------------------------- /examples/resources/palettes/GIMP/Warm_Colors.cmap: -------------------------------------------------------------------------------- 1 | GIMP Palette 2 | Name: Warm Colors 3 | # 4 | 196 9 9 Untitled 5 | 216 213 8 Untitled 6 | 237 110 0 Untitled 7 | 232 0 50 Untitled 8 | 140 11 11 Untitled 9 | 228 170 4 Untitled 10 | 117 0 0 Untitled 11 | -------------------------------------------------------------------------------- /examples/resources/palettes/JASC/jascpalette.pal: -------------------------------------------------------------------------------- 1 | JASC-PAL 2 | 0100 3 | 16 4 | 255 0 0 5 | 0 255 0 6 | 0 0 255 7 | 255 255 0 8 | 0 255 255 9 | 255 0 255 10 | 100 0 0 11 | 0 100 0 12 | 0 0 100 13 | 100 100 0 14 | 0 100 100 15 | 100 0 100 16 | 200 200 0 17 | 0 200 200 18 | 200 0 200 19 | 255 255 255 20 | -------------------------------------------------------------------------------- /examples/resources/palettes/OSX/DB16.clr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/resources/palettes/OSX/DB16.clr -------------------------------------------------------------------------------- /examples/resources/palettes/OSX/Nord.clr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/resources/palettes/OSX/Nord.clr -------------------------------------------------------------------------------- /examples/resources/palettes/RIFF/sample.pal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/resources/palettes/RIFF/sample.pal -------------------------------------------------------------------------------- /examples/resources/palettes/Text/db32.txt: -------------------------------------------------------------------------------- 1 | ; Paint.NET DB32 Palette 2 | ; http://www.pixeljoint.com/forum/forum_posts.asp?TID=16247 3 | ; https://github.com/geoffb/dawnbringer-palettes 4 | FF000000 5 | FF222034 6 | FF45283C 7 | FF663931 8 | FF8F563B 9 | FFDF7126 10 | FFD9A066 11 | FFEEC39A 12 | FFFBF236 13 | FF99E550 14 | FF6ABE30 15 | FF37946E 16 | FF4B692F 17 | FF524B24 18 | FF323C39 19 | FF3F3F74 20 | FF306082 21 | FF5B6EE1 22 | FF639BFF 23 | FF5FCDE4 24 | FFCBDBFC 25 | FFFFFFFF 26 | FF9BADB7 27 | FF847E87 28 | FF696A6A 29 | FF595652 30 | FF76428A 31 | FFAC3232 32 | FFD95763 33 | FFD77BBA 34 | FF8F974A 35 | FF8A6F30 36 | -------------------------------------------------------------------------------- /examples/resources/palettes/Text/hexpalette.txt: -------------------------------------------------------------------------------- 1 | ; paint.net Palette File 2 | ; Lines that start with a semicolon are comments 3 | ; Colors are written as 8-digit hexadecimal numbers: aarrggbb 4 | ; For example, this would specify green: FF00FF00 5 | ; The alpha ('aa') value specifies how transparent a color is. FF is fully opaque, 00 is fully transparent. 6 | ; A palette must consist of ninety six (96) colors. If there are less than this, the remaining color 7 | ; slots will be set to white (FFFFFFFF). If there are more, then the remaining colors will be ignored. 8 | FF000000 9 | FF404040 10 | FFFF0000 11 | FFFF6A00 12 | FF23FFBD 13 | FFB6FF00 14 | FF4CFF00 15 | FF00FF21 16 | FF00FF90 17 | FF00FFFF 18 | FFFFFA7C 19 | FF0026FF 20 | FF4800FF 21 | -------------------------------------------------------------------------------- /examples/spinboxes/demowidget.h: -------------------------------------------------------------------------------- 1 | #ifndef DEMOWIDGET_H 2 | #define DEMOWIDGET_H 3 | 4 | #include 5 | 6 | class QFormLayout; 7 | class QVBoxLayout; 8 | 9 | class QtGraphicsBageEffect; 10 | 11 | class DemoWidget : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | DemoWidget(QWidget *parent = 0); 17 | ~DemoWidget(); 18 | 19 | void insertWidget(QWidget* w); 20 | void insertWidgets(QWidget *label, QWidget* content); 21 | 22 | public Q_SLOTS: 23 | void clicked(bool on); 24 | void setBageValue(int value); 25 | 26 | private: 27 | QVBoxLayout* layout; 28 | QtGraphicsBageEffect* bageEffect; 29 | }; 30 | 31 | #endif // DEMOWIDGET_H 32 | -------------------------------------------------------------------------------- /examples/spinboxes/main.cpp: -------------------------------------------------------------------------------- 1 | #include "demowidget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | DemoWidget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /examples/sqlutils/resources/images/database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/sqlutils/resources/images/database.png -------------------------------------------------------------------------------- /examples/sqlutils/resources/images/field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/sqlutils/resources/images/field.png -------------------------------------------------------------------------------- /examples/sqlutils/resources/images/systable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/sqlutils/resources/images/systable.png -------------------------------------------------------------------------------- /examples/sqlutils/resources/images/table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/sqlutils/resources/images/table.png -------------------------------------------------------------------------------- /examples/sqlutils/resources/images/view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/examples/sqlutils/resources/images/view.png -------------------------------------------------------------------------------- /examples/sqlutils/sqlutils.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/images/database.png 4 | resources/images/field.png 5 | resources/images/systable.png 6 | resources/images/table.png 7 | resources/images/view.png 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/variantmodel/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 | -------------------------------------------------------------------------------- /examples/variantmodel/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | class QtVariantListModel; 7 | class QtCheckableProxyModel; 8 | class QtRevertibleProxyModel; 9 | class QtItemViewController; 10 | 11 | class Widget : public QMainWindow 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | Widget(QWidget *parent = 0); 17 | ~Widget(); 18 | 19 | public Q_SLOTS: 20 | void updateActions(const QModelIndex&, int); 21 | void updateActions(); 22 | void checkedItems(); 23 | private: 24 | QtItemViewController* controller; 25 | QtVariantListModel* model; 26 | QtCheckableProxyModel* viewProxy; 27 | QtRevertibleProxyModel* cachingProxy; 28 | }; 29 | 30 | #endif // WIDGET_H 31 | -------------------------------------------------------------------------------- /examples/widgetdelegatedemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | 8 | Widget w; 9 | w.show(); 10 | 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /examples/widgetdelegatedemo/previewlabel.h: -------------------------------------------------------------------------------- 1 | #ifndef PREVIEWLABEL_H 2 | #define PREVIEWLABEL_H 3 | 4 | #include 5 | #include 6 | 7 | // 8 | // This class is a simplified example of 9 | // creating QtItemDelegate compatiable 10 | // widget with custom painting. 11 | // 12 | class PreviewLabel : public QAbstractButton 13 | { 14 | Q_OBJECT 15 | public: 16 | // Shape of mask of label 17 | enum class MaskShape 18 | { 19 | NoShape, // rectangle shape - no mask at all (default) 20 | Circle, // circle mask 21 | Rounded // rectangle with rounded corners 22 | }; 23 | 24 | explicit PreviewLabel(QWidget* parent = Q_NULLPTR); 25 | ~PreviewLabel(); 26 | 27 | void setMaskShape(MaskShape shape); 28 | MaskShape maskShape() const; 29 | 30 | void setPixmap(const QPixmap& pixmap, Qt::TransformationMode mode = Qt::FastTransformation); 31 | QPixmap pixmap() const; 32 | 33 | void setLoading(bool on); 34 | bool isLoading() const; 35 | 36 | public Q_SLOTS: 37 | void updateProgress(); 38 | 39 | protected: 40 | void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; 41 | void resizeEvent(QResizeEvent* event) Q_DECL_OVERRIDE; 42 | 43 | private: 44 | std::unique_ptr d; 45 | }; 46 | 47 | #endif // PREVIEWLABEL_H 48 | -------------------------------------------------------------------------------- /modelexporters/csvexporter/qtcsvexporter.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys" : [ "CSV" ] 3 | } 4 | -------------------------------------------------------------------------------- /modelexporters/csvexporter/qtcsvexportplugin.cpp: -------------------------------------------------------------------------------- 1 | #include "qtcsvexportplugin.h" 2 | #include "qtcsvexporter.h" 3 | 4 | 5 | QtCsvExporterPlugin::QtCsvExporterPlugin( QObject *parent /*= 0*/ ) : 6 | QObject(parent) 7 | { 8 | } 9 | 10 | QtTableModelExporter* QtCsvExporterPlugin::create( QAbstractTableModel* model ) const 11 | { 12 | return new QtTableModelCsvExporter(model); 13 | } 14 | 15 | QString QtCsvExporterPlugin::exporterName() const 16 | { 17 | return tr("CSV"); 18 | } 19 | 20 | QIcon QtCsvExporterPlugin::icon() const 21 | { 22 | return QIcon(":/images/export-csv"); 23 | } 24 | 25 | 26 | #if QT_VERSION < 0x050000 27 | #ifdef _DEBUG 28 | Q_EXPORT_PLUGIN2("csvexporterd", QtCsvExporterPlugin) 29 | #else 30 | Q_EXPORT_PLUGIN2("csvexporter", QtCsvExporterPlugin) 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /modelexporters/csvexporter/qtcsvexportplugin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class QtCsvExporterPlugin : 6 | public QObject, 7 | public QtTableModelExporterPlugin 8 | { 9 | Q_OBJECT 10 | Q_CLASSINFO("Version", "1.0") 11 | Q_CLASSINFO("QtCsvExporterPlugin", "CSV Export Plugin") 12 | 13 | Q_INTERFACES(QtTableModelExporterPlugin) 14 | 15 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) 16 | Q_PLUGIN_METADATA(IID "com.QtExtra.QtTableModelExporterPlugin/1.0" FILE "qtcsvexporter.json") 17 | #endif 18 | 19 | public: 20 | explicit QtCsvExporterPlugin(QObject *parent = Q_NULLPTR); 21 | 22 | // QtTableModelExporterPlugin interface 23 | QtTableModelExporter* create(QAbstractTableModel* model) const; 24 | QString exporterName() const; 25 | QIcon icon() const; 26 | }; 27 | -------------------------------------------------------------------------------- /modelexporters/excelexporter/excelexporter.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys" : [ "MSEXCEL" ] 3 | } 4 | -------------------------------------------------------------------------------- /modelexporters/excelexporter/qtexcelexporter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #ifdef Q_OS_WIN 4 | #include 5 | 6 | class QTextCodec; 7 | class QtTableModelExcelExporterPrivate; 8 | 9 | class QtTableModelExcelExporter : 10 | public QtTableModelExporter 11 | { 12 | Q_OBJECT 13 | 14 | Q_CLASSINFO("QtTableModelExcelExporter", "Microsoft Excel Export") 15 | 16 | Q_PROPERTY(QString dateFormat READ dateFormat WRITE setDateFormat) 17 | Q_CLASSINFO("dateFormat", "Date format") 18 | 19 | Q_PROPERTY(QString timeFormat READ timeFormat WRITE setTimeFormat) 20 | Q_CLASSINFO("timeFormat", "Time format") 21 | 22 | Q_PROPERTY(bool autoOpen READ isAutoOpen WRITE setAutoOpen) 23 | Q_CLASSINFO("autoOpen", "Open MS Excel") 24 | 25 | public: 26 | explicit QtTableModelExcelExporter(QAbstractTableModel* model = Q_NULLPTR); 27 | ~QtTableModelExcelExporter(); 28 | 29 | void setDateFormat(const QString& format); 30 | QString dateFormat() const; 31 | 32 | void setTimeFormat(const QString& format); 33 | QString timeFormat() const; 34 | 35 | void setAutoOpen(bool on); 36 | bool isAutoOpen() const; 37 | 38 | QStringList fileFilter() const; 39 | 40 | bool exportModel(QIODevice* device) override; 41 | void storeIndex(const QModelIndex& index = QModelIndex()) override; 42 | QWidget *createEditor(QDialog* parent) const override; 43 | 44 | private Q_SLOTS: 45 | void reportError(int errcode, const QString& source, const QString& desc, const QString& help); 46 | 47 | private: 48 | QScopedPointer d; 49 | }; 50 | #endif 51 | -------------------------------------------------------------------------------- /modelexporters/excelexporter/qtexcelexporterplugin.cpp: -------------------------------------------------------------------------------- 1 | #include "qtexcelexporterplugin.h" 2 | #ifdef Q_OS_WIN32 3 | #include "qtexcelexporter.h" 4 | #else 5 | #include 6 | #endif 7 | 8 | 9 | QtExcelExporterPlugin::QtExcelExporterPlugin( QObject *parent /*= 0*/ ) : QObject(parent) 10 | { 11 | } 12 | 13 | QtTableModelExporter* QtExcelExporterPlugin::create( QAbstractTableModel* model ) const 14 | { 15 | #ifndef Q_OS_WIN 16 | Q_UNUSED(model); 17 | QMessageBox::critical(0, tr("Export Error"), 18 | tr("Data exporting in this format is accesible only on Windows Platform.")); 19 | return Q_NULLPTR; 20 | #else 21 | return new QtTableModelExcelExporter(model); 22 | #endif 23 | } 24 | 25 | QString QtExcelExporterPlugin::exporterName() const 26 | { 27 | return tr("Microsft Excel"); 28 | } 29 | 30 | QIcon QtExcelExporterPlugin::icon() const 31 | { 32 | return QIcon(":/images/export-excel"); 33 | } 34 | 35 | #if QT_VERSION < 0x050000 36 | #ifdef _DEBUG 37 | Q_EXPORT_PLUGIN2("qexcelexporterd", QtExcelExporterPlugin) 38 | #else 39 | Q_EXPORT_PLUGIN2("qexcelexporter", QtExcelExporterPlugin) 40 | #endif 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /modelexporters/excelexporter/qtexcelexporterplugin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class QtExcelExporterPlugin : 6 | public QObject, 7 | public QtTableModelExporterPlugin 8 | { 9 | Q_OBJECT 10 | Q_INTERFACES(QtTableModelExporterPlugin) 11 | Q_CLASSINFO("Version", "1.0 (Windows OS Only)") 12 | 13 | #if QT_VERSION >= 0x050000 14 | Q_PLUGIN_METADATA(IID "com.QtExtra.QtTableModelExporterPlugin/1.0" FILE "excelexporter.json") 15 | 16 | #endif // QT_VERSION >= 0x050000 17 | 18 | public: 19 | explicit QtExcelExporterPlugin(QObject *parent = Q_NULLPTR); 20 | // QtTableModelExporterPlugin interface 21 | QtTableModelExporter* create(QAbstractTableModel* model) const; 22 | QString exporterName() const; 23 | QIcon icon() const; 24 | }; 25 | 26 | -------------------------------------------------------------------------------- /modelexporters/htmlexporter/htmlexporter.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys" : [ "HTML" ] 3 | } 4 | -------------------------------------------------------------------------------- /modelexporters/htmlexporter/qthtmlexporterplugin.cpp: -------------------------------------------------------------------------------- 1 | #include "qthtmlexporterplugin.h" 2 | #include "qthtmlexporter.h" 3 | 4 | QtHtmlExporterPlugin::QtHtmlExporterPlugin(QObject *parent) : 5 | QObject(parent) 6 | { 7 | } 8 | 9 | QtTableModelExporter *QtHtmlExporterPlugin::create(QAbstractTableModel *model) const 10 | { 11 | return new QtTableModelHtmlExporter(model); 12 | } 13 | 14 | QString QtHtmlExporterPlugin::exporterName() const 15 | { 16 | return QStringLiteral("HTML"); 17 | } 18 | 19 | QIcon QtHtmlExporterPlugin::icon() const 20 | { 21 | return QIcon(":/images/html"); 22 | } 23 | 24 | 25 | #if QT_VERSION < 0x050000 26 | #ifdef _DEBUG 27 | Q_EXPORT_PLUGIN2("htmlexporterd", QtHtmlExporterPlugin) 28 | #else 29 | Q_EXPORT_PLUGIN2("htmlexporter", QtHtmlExporterPlugin) 30 | #endif 31 | #endif // QT_VERSION < 0x050000 32 | 33 | -------------------------------------------------------------------------------- /modelexporters/htmlexporter/qthtmlexporterplugin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class QtHtmlExporterPlugin : 6 | public QObject, 7 | public QtTableModelExporterPlugin 8 | { 9 | Q_OBJECT 10 | Q_CLASSINFO("Version", "1.0") 11 | Q_CLASSINFO("QtHtmlExporterPlugin", "HTML Export Plugin") 12 | 13 | Q_INTERFACES(QtTableModelExporterPlugin) 14 | 15 | #if QT_VERSION >= 0x050000 16 | Q_PLUGIN_METADATA(IID "com.QtExtra.QtTableModelExporterPlugin/1.0" FILE "htmlexporter.json") 17 | #endif // QT_VERSION >= 0x050000 18 | 19 | public: 20 | explicit QtHtmlExporterPlugin(QObject *parent = Q_NULLPTR); 21 | QtTableModelExporter* create(QAbstractTableModel* model) const; 22 | QString exporterName() const; 23 | QIcon icon() const; 24 | }; 25 | 26 | -------------------------------------------------------------------------------- /modelexporters/jsonexporter/qtjsonexporter.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys" : [ "JSON" ] 3 | } 4 | -------------------------------------------------------------------------------- /modelexporters/jsonexporter/qtjsonexporterplugin.cpp: -------------------------------------------------------------------------------- 1 | #include "qtjsonexporterplugin.h" 2 | #include "qtjsonexporter.h" 3 | 4 | QtJsonExporterPlugin::QtJsonExporterPlugin(QObject *parent) : 5 | QObject(parent) 6 | { 7 | } 8 | 9 | QtTableModelExporter *QtJsonExporterPlugin::create(QAbstractTableModel *model) const 10 | { 11 | return new QtTableModelJsonExporter(model); 12 | } 13 | 14 | QString QtJsonExporterPlugin::exporterName() const 15 | { 16 | return QStringLiteral("JSON"); 17 | } 18 | 19 | QIcon QtJsonExporterPlugin::icon() const 20 | { 21 | return QIcon(":/images/export-json"); 22 | } 23 | 24 | 25 | #if QT_VERSION < 0x050000 26 | #ifdef _DEBUG 27 | Q_EXPORT_PLUGIN2("jsonexporterd", QtJsonExporterPlugin) 28 | #else 29 | Q_EXPORT_PLUGIN2("jsonexporter", QtJsonExporterPlugin) 30 | #endif 31 | #endif 32 | -------------------------------------------------------------------------------- /modelexporters/jsonexporter/qtjsonexporterplugin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class QtJsonExporterPlugin : 6 | public QObject, 7 | public QtTableModelExporterPlugin 8 | { 9 | Q_OBJECT 10 | Q_CLASSINFO("Version", "1.0") 11 | Q_CLASSINFO("QtJsonExporterPlugin", "JSON Export Plugin") 12 | 13 | Q_INTERFACES(QtTableModelExporterPlugin) 14 | #if QT_VERSION >= 0x050000 15 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QGenericPluginFactoryInterface" FILE "qtjsonexporter.json") 16 | #endif // QT_VERSION >= 0x050000 17 | 18 | public: 19 | explicit QtJsonExporterPlugin(QObject *parent = 0); 20 | 21 | // QtTableModelExporterPlugin interface 22 | QtTableModelExporter *create(QAbstractTableModel *model) const; 23 | QString exporterName() const; 24 | QIcon icon() const; 25 | }; 26 | 27 | -------------------------------------------------------------------------------- /modelexporters/modelexporters.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += \ 4 | csvexporter \ 5 | jsonexporter \ 6 | htmlexporter \ 7 | xmlexporter 8 | 9 | win32 { 10 | SUBDIRS += excelexporter 11 | } 12 | 13 | -------------------------------------------------------------------------------- /modelexporters/xmlexporter/qtxmlexporter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class QtTableModelXmlExporter : 5 | public QtTableModelExporter 6 | { 7 | Q_OBJECT 8 | Q_CLASSINFO("QtTableModelXmlExporter", "XML Export") 9 | 10 | Q_PROPERTY(bool autoFormat READ isAutoFormatting WRITE setAutoFormatting) 11 | Q_CLASSINFO("autoFormat", "AutoFormat") 12 | 13 | public: 14 | explicit QtTableModelXmlExporter(QAbstractTableModel* model = Q_NULLPTR); 15 | ~QtTableModelXmlExporter(); 16 | 17 | void setAutoFormatting(bool on = true); 18 | bool isAutoFormatting() const; 19 | 20 | // QtTableModelExporter interface 21 | QStringList fileFilter() const override; 22 | bool exportModel(QIODevice *device) override; 23 | void storeIndex(const QModelIndex& index = QModelIndex()) override; 24 | QWidget *createEditor(QDialog *parent) const override; 25 | 26 | private: 27 | QScopedPointer d; 28 | }; 29 | -------------------------------------------------------------------------------- /modelexporters/xmlexporter/qtxmlexporterplugin.cpp: -------------------------------------------------------------------------------- 1 | #include "qtxmlexporterplugin.h" 2 | #include "qtxmlexporter.h" 3 | 4 | QtXmlExporterPlugin::QtXmlExporterPlugin(QObject *parent) : 5 | QObject(parent) 6 | { 7 | } 8 | 9 | QtTableModelExporter* QtXmlExporterPlugin::create( QAbstractTableModel* model ) const 10 | { 11 | return new QtTableModelXmlExporter(model); 12 | } 13 | 14 | QString QtXmlExporterPlugin::exporterName() const 15 | { 16 | return QStringLiteral("XML"); 17 | } 18 | 19 | QIcon QtXmlExporterPlugin::icon() const 20 | { 21 | return QIcon(":/images/export-xml"); 22 | } 23 | 24 | #if QT_VERSION < 0x050000 25 | #ifdef _DEBUG 26 | Q_EXPORT_PLUGIN2("xmlexporterd", QtXmlExporterPlugin) 27 | #else 28 | Q_EXPORT_PLUGIN2("xmlexporter", QtXmlExporterPlugin) 29 | #endif 30 | #endif // QT_VERSION < 0x050000 31 | -------------------------------------------------------------------------------- /modelexporters/xmlexporter/qtxmlexporterplugin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class QtXmlExporterPlugin: 6 | public QObject, 7 | public QtTableModelExporterPlugin 8 | { 9 | Q_OBJECT 10 | Q_CLASSINFO("Version", "1.0") 11 | Q_CLASSINFO("QtXmlExporterPlugin", "XML Export Plugin") 12 | 13 | Q_INTERFACES(QtTableModelExporterPlugin) 14 | 15 | #if QT_VERSION >= 0x050000 16 | Q_PLUGIN_METADATA(IID "com.QtExtra.QtTableModelExporterPlugin/1.0" FILE "xmlexporter.json") 17 | #endif // QT_VERSION >= 0x050000 18 | 19 | public: 20 | explicit QtXmlExporterPlugin(QObject *parent = Q_NULLPTR); 21 | 22 | // QtTableModelExporterPlugin interface 23 | QtTableModelExporter* create(QAbstractTableModel* model) const; 24 | QString exporterName() const; 25 | QIcon icon() const; 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /modelexporters/xmlexporter/xmlexporter.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys" : [ "XML" ] 3 | } 4 | -------------------------------------------------------------------------------- /qtcoreextra/include/QtCoreExtra: -------------------------------------------------------------------------------- 1 | #include "../src/qtcoreextra.h" -------------------------------------------------------------------------------- /qtcoreextra/include/QtEnums: -------------------------------------------------------------------------------- 1 | #include "../src/qtenums.h" 2 | -------------------------------------------------------------------------------- /qtcoreextra/include/QtGlobalExtra: -------------------------------------------------------------------------------- 1 | #include "../src/qtglobalextra.h" 2 | -------------------------------------------------------------------------------- /qtcoreextra/include/QtJsonMapper: -------------------------------------------------------------------------------- 1 | #include "../src/qtjsonmapper.h" 2 | -------------------------------------------------------------------------------- /qtcoreextra/include/QtMethodInvoker: -------------------------------------------------------------------------------- 1 | #include "../src/qtmethodinvoker.h" 2 | -------------------------------------------------------------------------------- /qtcoreextra/include/QtObjectMapper: -------------------------------------------------------------------------------- 1 | #include "../src/qtobjectmapper.h" 2 | -------------------------------------------------------------------------------- /qtcoreextra/include/QtResource: -------------------------------------------------------------------------------- 1 | #include "../src/qtresource.h" 2 | -------------------------------------------------------------------------------- /qtcoreextra/include/QtSettingsMapper: -------------------------------------------------------------------------------- 1 | #include "../src/qtsettingsmapper.h" 2 | -------------------------------------------------------------------------------- /qtcoreextra/include/QtXmlMapper: -------------------------------------------------------------------------------- 1 | #include "../src/qtxmlmapper.h" 2 | -------------------------------------------------------------------------------- /qtcoreextra/qtcoreextra.pri: -------------------------------------------------------------------------------- 1 | # Input 2 | HEADERS += \ 3 | $$PWD/src/qtsettingsmapper.h \ 4 | $$PWD/src/qtxmlmapper.h \ 5 | $$PWD/src/qtjsonmapper.h \ 6 | $$PWD/src/qtresource.h \ 7 | $$PWD/src/qtobjectmapper.h \ 8 | $$PWD/src/qtmemorypool.h \ 9 | $$PWD/src/qtcoreextra.h \ 10 | $$PWD/src/qtglobalextra.h \ 11 | $$PWD/src/qtmethodinvoker.h \ 12 | $$PWD/src/qtjsonsettingsformat.h 13 | 14 | 15 | SOURCES += \ 16 | $$PWD/src/qtsettingsmapper.cpp \ 17 | $$PWD/src/qtxmlmapper.cpp \ 18 | $$PWD/src/qtjsonmapper.cpp \ 19 | $$PWD/src/qtresource.cpp \ 20 | $$PWD/src/qtobjectmapper.cpp \ 21 | $$PWD/src/qtmethodinvoker.cpp \ 22 | $$PWD/src/qtjsonsettingsformat.cpp 23 | -------------------------------------------------------------------------------- /qtcoreextra/qtcoreextra.pro: -------------------------------------------------------------------------------- 1 | CONFIG += debug_and_release 2 | 3 | CONFIG(debug, debug|release) { 4 | TARGET = qtcoreextrad 5 | MOC_DIR = tmp/debug_shared/moc 6 | OBJECTS_DIR = tmp/debug_shared/obj 7 | RCC_DIR = tmp/debug_shared/rcc 8 | } else { 9 | TARGET = qtcoreextra 10 | MOC_DIR = tmp/release_shared/moc 11 | OBJECTS_DIR = tmp/release_shared/obj 12 | RCC_DIR = tmp/release_shared/rcc 13 | } 14 | 15 | TEMPLATE = lib 16 | DESTDIR = ../libs 17 | DLLDESTDIR = ../bin 18 | INCLUDEPATH = . include 19 | DEPENDPATH = . src include 20 | 21 | DEFINES += QTCOREEXTRA_MAKEDLL QTCOREEXTRA_BUILD_LIB 22 | #win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000 23 | 24 | include(qtcoreextra.pri) 25 | 26 | -------------------------------------------------------------------------------- /qtcoreextra/src/qtcoreextra.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #ifndef Q_NO_IMPL 6 | # define Q_NO_IMPL(x) qWarning("(%s:%i) %s:%s is not yet implemented", __FILE__, __LINE__, Q_FUNC_INFO, #x); 7 | #endif 8 | 9 | # if defined(QTCOREEXTRA_NODLL) 10 | # undef QTCOREEXTRA_MAKEDLL 11 | # undef QTCOREEXTRA_DLL 12 | # elif defined(QTCOREEXTRA_MAKEDLL) /* create a DLL library */ 13 | # if defined(QTCOREEXTRA_DLL) 14 | # undef QTCOREEXTRA_DLL 15 | # endif 16 | # if defined(QTCOREEXTRA_BUILD_LIB) 17 | # define QTCOREEXTRA_EXPORT Q_DECL_EXPORT 18 | # else 19 | # define QTCOREEXTRA_EXPORT Q_DECL_IMPORT 20 | # endif 21 | # elif defined(QTCOREEXTRA_DLL) /* use a DLL library */ 22 | # define QTCOREEXTRA_EXPORT Q_DECL_IMPORT 23 | # endif 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /qtcoreextra/src/qtglobalextra.h: -------------------------------------------------------------------------------- 1 | #ifndef QTGLOBALEXTRA_H 2 | #define QTGLOBALEXTRA_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace QtExtra 10 | { 11 | static inline const QMetaObject* metaObject(const QObject* object) { 12 | return object->metaObject(); 13 | } 14 | 15 | template 16 | static inline const QMetaObject* metaObject() { 17 | return &T::staticMetaObject; 18 | } 19 | 20 | static inline const char* className(const QMetaObject *metaObject) { 21 | return (metaObject == Q_NULLPTR ? "" : metaObject->className()); 22 | } 23 | 24 | static inline const char* className(const QObject* object) { 25 | return (object == Q_NULLPTR ? "" : QtExtra::className(object->metaObject())); 26 | } 27 | 28 | template 29 | static inline const char* className() { 30 | return QtExtra::className(QtExtra::metaObject()); 31 | } 32 | 33 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) 34 | template 35 | static inline bool inherits(const QMetaObject* metaObject) { 36 | return metaObject->inherits(QtExtra::metaObject<_Base>()); 37 | } 38 | #endif 39 | 40 | template 41 | static inline bool inherits(const QObject* object) { 42 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) 43 | return QtExtra::inherits<_Base>(object->metaObject()); 44 | #else 45 | return object->inherits(QtExtra::className<_Base>()); 46 | #endif 47 | } 48 | 49 | 50 | 51 | } 52 | 53 | 54 | 55 | #endif // QTGLOBALEXTRA_H 56 | -------------------------------------------------------------------------------- /qtcoreextra/src/qtjsonmapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | struct QMetaObject; 6 | class QMetaProperty; 7 | class QObject; 8 | 9 | class QJsonObject; 10 | 11 | 12 | class QTCOREEXTRA_EXPORT QtJsonMapper : 13 | public QtObjectMapper 14 | { 15 | Q_DISABLE_COPY(QtJsonMapper) 16 | 17 | public: 18 | QtJsonMapper(); 19 | ~QtJsonMapper(); 20 | 21 | // QtObjectMapper interface 22 | protected: 23 | bool write(QJsonObject& json, const QObject *obj, const QMetaProperty &p) const Q_DECL_OVERRIDE; 24 | bool read(const QJsonObject& json, QObject *obj, const QMetaProperty &p) const Q_DECL_OVERRIDE; 25 | bool validate(const QJsonObject& json, const QMetaProperty &p) const Q_DECL_OVERRIDE; 26 | }; 27 | 28 | 29 | 30 | class QTCOREEXTRA_EXPORT QtTypedJsonMapper : 31 | public QtJsonMapper 32 | { 33 | Q_DISABLE_COPY(QtTypedJsonMapper) 34 | 35 | public: 36 | QtTypedJsonMapper(); 37 | ~QtTypedJsonMapper(); 38 | 39 | // QtJsonMapper interface 40 | protected: 41 | bool write(QJsonObject& json, const QObject *obj, const QMetaProperty &p) const Q_DECL_OVERRIDE; 42 | bool read(const QJsonObject& json, QObject *obj, const QMetaProperty &p) const Q_DECL_OVERRIDE; 43 | bool validate(const QJsonObject& json, const QMetaProperty &p) const Q_DECL_OVERRIDE; 44 | }; 45 | 46 | -------------------------------------------------------------------------------- /qtcoreextra/src/qtjsonsettingsformat.h: -------------------------------------------------------------------------------- 1 | #ifndef QTJSONSETTINGSFORMAT_H 2 | #define QTJSONSETTINGSFORMAT_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | class QTCOREEXTRA_EXPORT QtJsonSettingsFormat 9 | { 10 | Q_DISABLE_COPY(QtJsonSettingsFormat) 11 | 12 | QtJsonSettingsFormat(); 13 | ~QtJsonSettingsFormat(); 14 | 15 | public: 16 | static bool read(QIODevice &device, QSettings::SettingsMap &map); 17 | static bool write(QIODevice &device, const QSettings::SettingsMap &map); 18 | static void registrateDefault(const QString &ext = "json"); 19 | }; 20 | 21 | 22 | #endif // QTJSONSETTINGSFORMAT_H 23 | -------------------------------------------------------------------------------- /qtcoreextra/src/qtresource.cpp: -------------------------------------------------------------------------------- 1 | #include "qtresource.h" 2 | #include 3 | #include 4 | 5 | QtResource::QtResource(const QString &file, const QLocale &locale) : 6 | QResource(file, locale) 7 | { 8 | } 9 | 10 | QString QtResource::toString() const 11 | { 12 | QBuffer buf; 13 | buffer(buf); 14 | buf.open(QBuffer::ReadOnly); 15 | return buf.readAll(); 16 | } 17 | 18 | QStringList QtResource::toStringList() const 19 | { 20 | QStringList strings; 21 | QBuffer buf; 22 | buffer(buf); 23 | buf.open(QBuffer::ReadOnly); 24 | QTextStream stream(&buf); 25 | QString line; 26 | while(!stream.atEnd()) { 27 | stream.readLineInto(&line); 28 | strings << line; 29 | } 30 | return strings; 31 | } 32 | 33 | void QtResource::buffer(QBuffer& buffer) const 34 | { 35 | buffer.setData(reinterpret_cast(this->data()), this->size()); 36 | } 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /qtcoreextra/src/qtresource.h: -------------------------------------------------------------------------------- 1 | #ifndef QTRESOURCE_H 2 | #define QTRESOURCE_H 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | class QBuffer; 10 | 11 | class QTCOREEXTRA_EXPORT QtResource : 12 | public QResource 13 | { 14 | public: 15 | QtResource(const QString &file = QString(), const QLocale &locale = QLocale()); 16 | 17 | QString toString() const; 18 | QStringList toStringList() const; 19 | 20 | void buffer(QBuffer& buffer) const; 21 | }; 22 | 23 | #endif // QTRESOURCE_H 24 | -------------------------------------------------------------------------------- /qtcoreextra/src/qtsettingsmapper.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "qtsettingsmapper.h" 8 | 9 | #include "qtglobalextra.h" 10 | 11 | QtSettingsMapper::QtSettingsMapper() 12 | { 13 | 14 | } 15 | 16 | QtSettingsMapper::~QtSettingsMapper() 17 | { 18 | 19 | } 20 | 21 | bool QtSettingsMapper::write(QSettings &settings, const QObject *obj, const QMetaProperty &p) const 22 | { 23 | const QByteArray className = QtExtra::className(obj); 24 | const QByteArray propertyName = p.name(); 25 | QString path; 26 | path.reserve(className.size() + propertyName.size() + 1); 27 | path += className; 28 | path += '/'; 29 | path += propertyName; 30 | settings.setValue(path, p.read(obj)); 31 | return true; 32 | } 33 | 34 | bool QtSettingsMapper::read(const QSettings &settings, QObject *obj, const QMetaProperty &p) const 35 | { 36 | const QByteArray className = QtExtra::className(obj); 37 | const QByteArray propertyName = p.name(); 38 | QString path; 39 | path.reserve(className.size() + propertyName.size() + 1); 40 | path += className; 41 | path += '/'; 42 | path += propertyName; 43 | return p.write(obj, settings.value(path)); 44 | } 45 | 46 | bool QtSettingsMapper::validate(const QSettings &, const QMetaProperty &) const 47 | { 48 | /*const char* className = obj->metaObject()->className(); 49 | QString path; 50 | path += className; 51 | path += '/'; 52 | path += p.name(); 53 | return settings.contains(path);*/ 54 | return false; 55 | } 56 | -------------------------------------------------------------------------------- /qtcoreextra/src/qtsettingsmapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class QObject; 6 | class QSettings; 7 | 8 | class QTCOREEXTRA_EXPORT QtSettingsMapper : 9 | public QtObjectMapper 10 | { 11 | Q_DISABLE_COPY(QtSettingsMapper) 12 | public: 13 | QtSettingsMapper(); 14 | ~QtSettingsMapper(); 15 | 16 | // QtObjectMapper interface 17 | protected: 18 | bool write(QSettings &settings, const QObject *obj, const QMetaProperty &p) const Q_DECL_OVERRIDE; 19 | bool read(const QSettings &settings, QObject *obj, const QMetaProperty &p) const Q_DECL_OVERRIDE; 20 | bool validate(const QSettings &settings, const QMetaProperty &p) const Q_DECL_OVERRIDE; 21 | }; 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /qtcoreextra/src/qtxmlmapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class QObject; 5 | class QXmlStreamWriter; 6 | class QXmlStreamReader; 7 | 8 | class QTCOREEXTRA_EXPORT QtXmlMapper 9 | { 10 | Q_DISABLE_COPY(QtXmlMapper) 11 | public: 12 | QtXmlMapper(); 13 | virtual ~QtXmlMapper(); 14 | 15 | virtual bool write(QXmlStreamWriter& xml, const QObject* o) const; 16 | virtual bool read(QXmlStreamReader &xml, QObject* o); 17 | }; 18 | -------------------------------------------------------------------------------- /qtextra.pro: -------------------------------------------------------------------------------- 1 | ##################################################################### 2 | # Main projectfile 3 | ##################################################################### 4 | 5 | CONFIG = ordered 6 | TEMPLATE = subdirs 7 | 8 | SUBDIRS += \ 9 | qtcoreextra \ 10 | qtplugins \ 11 | qtwidgetsextra \ 12 | qtpropertybrowser \ 13 | qtsqlextra \ 14 | qtsqlwidgets \ 15 | modelexporters \ 16 | examples 17 | 18 | -------------------------------------------------------------------------------- /qtplugins/include/QtPluginInterface: -------------------------------------------------------------------------------- 1 | #include "../src/qtplugininterface.h" -------------------------------------------------------------------------------- /qtplugins/include/QtPluginManager: -------------------------------------------------------------------------------- 1 | #include "../src/qtpluginmanager.h" -------------------------------------------------------------------------------- /qtplugins/include/QtPluginManagerDialog: -------------------------------------------------------------------------------- 1 | #include "../src/qtpluginmanagerdialog.h" -------------------------------------------------------------------------------- /qtplugins/include/QtPluginPropertyModel: -------------------------------------------------------------------------------- 1 | #include "../src/qtpluginpropertymodel.h" -------------------------------------------------------------------------------- /qtplugins/include/QtPluginTreeView: -------------------------------------------------------------------------------- 1 | #include "../src/qtplugintreeview.h" -------------------------------------------------------------------------------- /qtplugins/include/QtPluginsExt: -------------------------------------------------------------------------------- 1 | #include "../src/qtpluginsextra.h" 2 | -------------------------------------------------------------------------------- /qtplugins/qtplugins.pri: -------------------------------------------------------------------------------- 1 | # Input 2 | HEADERS += src/qtplugininterface.h \ 3 | src/qtpluginmanager.h \ 4 | src/qtpluginmanagerdialog.h \ 5 | src/qtpluginmetadata.h \ 6 | src/qtpluginpropertymodel.h \ 7 | src/qtplugintreeview.h \ 8 | $$PWD/src/qtpluginsextra.h 9 | SOURCES += src/qtplugininterface.cpp \ 10 | src/qtpluginmanager.cpp \ 11 | src/qtpluginmanagerdialog.cpp \ 12 | src/qtpluginpropertymodel.cpp \ 13 | src/qtplugintreeview.cpp 14 | 15 | #RESOURCES += qtplugins.qrc 16 | -------------------------------------------------------------------------------- /qtplugins/qtplugins.pro: -------------------------------------------------------------------------------- 1 | CONFIG += debug_and_release 2 | 3 | CONFIG(debug, debug|release) { 4 | TARGET = qtpluginsd 5 | MOC_DIR = tmp/debug_shared/moc 6 | OBJECTS_DIR = tmp/debug_shared/obj 7 | RCC_DIR = tmp/debug_shared/rcc 8 | } else { 9 | TARGET = qtplugins 10 | MOC_DIR = tmp/release_shared/moc 11 | OBJECTS_DIR = tmp/release_shared/obj 12 | RCC_DIR = tmp/release_shared/rcc 13 | } 14 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 15 | TEMPLATE = lib 16 | DESTDIR = ../libs 17 | DLLDESTDIR = ../bin 18 | INCLUDEPATH = . include 19 | DEPENDPATH = . src include 20 | 21 | DEFINES += QTPLUGINS_MAKEDLL QTPLUGINS_BUILD_LIB 22 | #win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000 23 | 24 | # The following define makes your compiler emit warnings if you use 25 | # any feature of Qt which as been marked as deprecated (the exact warnings 26 | # depend on your compiler). Please consult the documentation of the 27 | # deprecated API in order to know how to port your code away from it. 28 | DEFINES += QT_DEPRECATED_WARNINGS 29 | 30 | include(qtplugins.pri) 31 | -------------------------------------------------------------------------------- /qtplugins/qtplugins.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /qtplugins/src/qtplugininterface.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "qtplugininterface.h" 3 | 4 | 5 | QtPluginInterface::~QtPluginInterface() 6 | { 7 | } 8 | 9 | const QString &QtPluginInterface::uncategorized() 10 | { 11 | static QString categoryName(QObject::tr("Uncategorized")); 12 | return categoryName; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /qtplugins/src/qtplugininterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class QObject; 6 | 7 | class QTPLUGINS_EXPORT QtPluginInterface 8 | { 9 | public: 10 | virtual ~QtPluginInterface(); 11 | virtual bool resolve(QObject* instance) const = 0; 12 | virtual const QString& iid() const = 0; 13 | virtual const QString& category() const = 0; 14 | 15 | static const QString& uncategorized(); 16 | }; 17 | 18 | template 19 | class QtGenericInterface : 20 | public QtPluginInterface 21 | { 22 | public: 23 | QtGenericInterface(const QString& category = QtPluginInterface::uncategorized()) : 24 | _category(category) { 25 | } 26 | 27 | virtual ~QtGenericInterface() {} 28 | 29 | bool resolve(QObject*) const Q_DECL_OVERRIDE { 30 | return false; 31 | } 32 | 33 | const QString& iid() const Q_DECL_OVERRIDE { 34 | static const QString staticIID(qobject_interface_iid<_Interface*>()); 35 | return staticIID; 36 | } 37 | 38 | const QString& category() const Q_DECL_OVERRIDE { 39 | return _category; 40 | } 41 | 42 | private: 43 | QString _category; 44 | }; 45 | -------------------------------------------------------------------------------- /qtplugins/src/qtpluginmanagerdialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | class QTreeWidgetItem; 7 | 8 | class QtPluginManagerDialogPrivate; 9 | class QTPLUGINS_EXPORT QtPluginManagerDialog : 10 | public QDialog 11 | { 12 | Q_OBJECT 13 | public: 14 | explicit QtPluginManagerDialog(QWidget *parent = Q_NULLPTR); 15 | ~QtPluginManagerDialog(); 16 | 17 | private Q_SLOTS: 18 | void showProperties(QTreeWidgetItem* item); 19 | 20 | private: 21 | QScopedPointer d; 22 | }; 23 | 24 | 25 | -------------------------------------------------------------------------------- /qtplugins/src/qtpluginmetadata.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class QObject; 5 | 6 | struct QtPluginMetadata 7 | { 8 | QObject *instance; 9 | QString key; 10 | QString libPath; 11 | QString iid; 12 | QString errorString; 13 | bool isLoaded; 14 | bool isStatic; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /qtplugins/src/qtpluginpropertymodel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | struct QtPluginMetadata; 6 | class QtPluginPropertyModelPrivate; 7 | 8 | class QTPLUGINS_EXPORT QtPluginPropertyModel : 9 | public QAbstractTableModel 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | enum ColumnType 15 | { 16 | TitleColumn, 17 | ValueColumn 18 | }; 19 | 20 | explicit QtPluginPropertyModel(QObject *parent = Q_NULLPTR); 21 | ~QtPluginPropertyModel(); 22 | 23 | void setMetadata(const QtPluginMetadata& metadata); 24 | 25 | int rowCount(const QModelIndex &parent = QModelIndex()) const; 26 | 27 | int columnCount(const QModelIndex& = QModelIndex()) const { return ValueColumn+1; } 28 | 29 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 30 | 31 | QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; 32 | 33 | public Q_SLOTS: 34 | void clear(); 35 | 36 | private: 37 | QScopedPointer d; 38 | }; 39 | -------------------------------------------------------------------------------- /qtplugins/src/qtpluginsextra.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #ifndef Q_NO_IMPL 5 | # define Q_NO_IMPL(x) qWarning("(%s:%d) %s:%s is not yet implemented", __FILE__, __LINE__, Q_FUNC_INFO, #x); 6 | #endif 7 | 8 | # if defined(QTPLUGINS_NODLL) 9 | # undef QTPLUGINS_MAKEDLL 10 | # undef QTPLUGINS_DLL 11 | # elif defined(QTPLUGINS_MAKEDLL) /* create a DLL library */ 12 | # if defined(QTPLUGINS_DLL) 13 | # undef QTPLUGINS_DLL 14 | # endif 15 | # if defined(QTPLUGINS_BUILD_LIB) 16 | # define QTPLUGINS_EXPORT Q_DECL_EXPORT 17 | # else 18 | # define QTPLUGINS_EXPORT Q_DECL_IMPORT 19 | # endif 20 | # elif defined(QTPLUGINS_DLL) /* use a DLL library */ 21 | # define QTPLUGINS_EXPORT Q_DECL_IMPORT 22 | # endif 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /qtplugins/src/qtplugintreeview.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | class QTreeWidgetItem; 7 | 8 | class QtPluginTreeViewPrivate; 9 | 10 | class QTPLUGINS_EXPORT QtPluginTreeView : 11 | public QTreeWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | explicit QtPluginTreeView(QWidget *parent = Q_NULLPTR); 16 | ~QtPluginTreeView(); 17 | 18 | QString key(const QModelIndex& index) const; 19 | 20 | inline QModelIndex indexFromItem ( QTreeWidgetItem * item, int column = 0 ) const 21 | { 22 | return QTreeWidget::indexFromItem(item, column); 23 | } 24 | 25 | private: 26 | QScopedPointer d; 27 | }; 28 | 29 | -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-arrow.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-busy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-busy.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-closedhand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-closedhand.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-cross.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-forbidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-forbidden.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-hand.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-hsplit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-hsplit.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-ibeam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-ibeam.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-openhand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-openhand.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-sizeall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-sizeall.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-sizeb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-sizeb.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-sizef.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-sizef.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-sizeh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-sizeh.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-sizev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-sizev.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-uparrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-uparrow.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-vsplit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-vsplit.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-wait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-wait.png -------------------------------------------------------------------------------- /qtpropertybrowser/images/cursor-whatsthis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtpropertybrowser/images/cursor-whatsthis.png -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtAbstractEditorFactoryBase: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertybrowser.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtAbstractPropertyBrowser: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertybrowser.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtAbstractPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertybrowser.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtAttributeResource: -------------------------------------------------------------------------------- 1 | #include "../src/qtattributeresource.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtBoolPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtBrowserItem: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertybrowser.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtButtonPropertyBrowser: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtbuttonpropertybrowser.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtCharEditorFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtCharPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtCheckBoxFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtColorEditorFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtColorPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtCursorEditorFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtCursorPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtDateEditFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtDatePropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtDateTimeEditFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtDateTimePropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtDockWidget: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtdockwidget.h" -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtDoublePropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtDoubleSpinBoxFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtEnumEditorFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtEnumPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtFlagPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtFontEditorFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtFontPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtGroupBoxPropertyBrowser: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtgroupboxpropertybrowser.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtGroupPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtIntPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtKeySequenceEditorFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtKeySequencePropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtLineEditFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtLocalePropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtMainWindow: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtmainwindow.h" -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtObjectEditor: -------------------------------------------------------------------------------- 1 | #include "../src/qtobjecteditor.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtPointFPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtPointPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtProperty: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertybrowser.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtPropertyWidget: -------------------------------------------------------------------------------- 1 | #include "../src/qtpropertywidget.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtRectFPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtRectPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtScrollBarFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtSizeFPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtSizePolicyPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtSizePropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtSliderFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtSpinBoxFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtStringPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtTimeEditFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qteditorfactory.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtTimePropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtpropertymanager.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtTreePropertyBrowser: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qttreepropertybrowser.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtVariantEditorFactory: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtvariantproperty.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtVariantProperty: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtvariantproperty.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/include/QtVariantPropertyManager: -------------------------------------------------------------------------------- 1 | #include "../src/propertybrowser/qtvariantproperty.h" 2 | -------------------------------------------------------------------------------- /qtpropertybrowser/qtpropertybrowser.pri: -------------------------------------------------------------------------------- 1 | 2 | SOURCES += $$PWD/src/qtpropertybrowser.cpp \ 3 | $$PWD/src/qtpropertymanager.cpp \ 4 | $$PWD/src/qteditorfactory.cpp \ 5 | $$PWD/src/qtvariantproperty.cpp \ 6 | $$PWD/src/qttreepropertybrowser.cpp \ 7 | $$PWD/src/qtbuttonpropertybrowser.cpp \ 8 | $$PWD/src/qtgroupboxpropertybrowser.cpp \ 9 | $$PWD/src/qtpropertybrowserutils.cpp \ 10 | $$PWD/src/qpropertyproxyobject.cpp \ 11 | $$PWD/src/qtpropertywidget.cpp \ 12 | $$PWD/src/qtattributeresource.cpp 13 | 14 | HEADERS += $$PWD/src/qtpropertybrowser.h \ 15 | $$PWD/src/qtpropertymanager.h \ 16 | $$PWD/src/qteditorfactory.h \ 17 | $$PWD/src/qtvariantproperty.h \ 18 | $$PWD/src/qttreepropertybrowser.h \ 19 | $$PWD/src/qtbuttonpropertybrowser.h \ 20 | $$PWD/src/qtgroupboxpropertybrowser.h \ 21 | $$PWD/src/qtpropertybrowserutils_p.h \ 22 | $$PWD/src/qtpropertyproxyobject.h \ 23 | $$PWD/src/qtpropertywidget.h \ 24 | $$PWD/src/qtattributeresource.h 25 | 26 | RESOURCES += $$PWD/qtpropertybrowser.qrc 27 | -------------------------------------------------------------------------------- /qtpropertybrowser/qtpropertybrowser.pro: -------------------------------------------------------------------------------- 1 | CONFIG += debug_and_release 2 | 3 | CONFIG(debug, debug|release) { 4 | TARGET = qtpropertybrowserd 5 | MOC_DIR = tmp/debug_shared/moc 6 | OBJECTS_DIR = tmp/debug_shared/obj 7 | RCC_DIR = tmp/debug_shared/rcc 8 | } else { 9 | TARGET = qtpropertybrowser 10 | MOC_DIR = tmp/release_shared/moc 11 | OBJECTS_DIR = tmp/release_shared/obj 12 | RCC_DIR = tmp/release_shared/rcc 13 | } 14 | 15 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 16 | 17 | TEMPLATE = lib 18 | DESTDIR = ../libs 19 | DLLDESTDIR = ../bin 20 | INCLUDEPATH = . include 21 | 22 | win32-msvc*|win32-icc:DEFINES += QT_QTPROPERTYBROWSER_EXPORT 23 | win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000 24 | 25 | include(qtpropertybrowser.pri) 26 | 27 | 28 | -------------------------------------------------------------------------------- /qtpropertybrowser/qtpropertybrowser.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/cursor-arrow.png 4 | images/cursor-busy.png 5 | images/cursor-closedhand.png 6 | images/cursor-cross.png 7 | images/cursor-forbidden.png 8 | images/cursor-hand.png 9 | images/cursor-hsplit.png 10 | images/cursor-ibeam.png 11 | images/cursor-openhand.png 12 | images/cursor-sizeall.png 13 | images/cursor-sizeb.png 14 | images/cursor-sizef.png 15 | images/cursor-sizeh.png 16 | images/cursor-sizev.png 17 | images/cursor-uparrow.png 18 | images/cursor-vsplit.png 19 | images/cursor-wait.png 20 | images/cursor-whatsthis.png 21 | 22 | 23 | -------------------------------------------------------------------------------- /qtpropertybrowser/src/qpropertyproxyobject.cpp: -------------------------------------------------------------------------------- 1 | #include "qtpropertyproxyobject.h" 2 | 3 | 4 | 5 | QtPropertyProxyObject::QtPropertyProxyObject( QObject *parent /*= 0*/ ) : QObject(parent) 6 | { 7 | } 8 | 9 | QtPropertyProxyObject::~QtPropertyProxyObject() 10 | { 11 | } 12 | 13 | void QtPropertyProxyObject::apply() 14 | { 15 | // does nothing 16 | } 17 | 18 | void QtPropertyProxyObject::restoreDefaults() 19 | { 20 | // does nothing 21 | } -------------------------------------------------------------------------------- /qtpropertybrowser/src/qtpropertybrowser.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/cursor-arrow.png 4 | images/cursor-busy.png 5 | images/cursor-closedhand.png 6 | images/cursor-cross.png 7 | images/cursor-forbidden.png 8 | images/cursor-hand.png 9 | images/cursor-hsplit.png 10 | images/cursor-ibeam.png 11 | images/cursor-openhand.png 12 | images/cursor-sizeall.png 13 | images/cursor-sizeb.png 14 | images/cursor-sizef.png 15 | images/cursor-sizeh.png 16 | images/cursor-sizev.png 17 | images/cursor-uparrow.png 18 | images/cursor-vsplit.png 19 | images/cursor-wait.png 20 | images/cursor-whatsthis.png 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /qtpropertybrowser/src/qtpropertyproxyobject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | 5 | #if defined(Q_OS_WIN) 6 | # if !defined(QT_QTPROPERTYBROWSER_EXPORT) && !defined(QT_QTPROPERTYBROWSER_IMPORT) 7 | # define QT_QTPROPERTYBROWSER_EXPORT 8 | # elif defined(QT_QTPROPERTYBROWSER_IMPORT) 9 | # if defined(QT_QTPROPERTYBROWSER_EXPORT) 10 | # undef QT_QTPROPERTYBROWSER_EXPORT 11 | # endif 12 | # define QT_QTPROPERTYBROWSER_EXPORT __declspec(dllimport) 13 | # elif defined(QT_QTPROPERTYBROWSER_EXPORT) 14 | # undef QT_QTPROPERTYBROWSER_EXPORT 15 | # define QT_QTPROPERTYBROWSER_EXPORT __declspec(dllexport) 16 | # endif 17 | #else 18 | # define QT_QTPROPERTYBROWSER_EXPORT 19 | #endif 20 | 21 | 22 | 23 | //#define QT_META_TR(ClassName) static const char *ClassName##MetaInfoTr[] = 24 | 25 | class QtPropertyProxyObjectPrivate; 26 | 27 | class QT_QTPROPERTYBROWSER_EXPORT QtPropertyProxyObject : 28 | public QObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit QtPropertyProxyObject(QObject *parent = Q_NULLPTR); 34 | virtual ~QtPropertyProxyObject(); 35 | 36 | public slots: 37 | virtual void apply(); 38 | virtual void restoreDefaults(); 39 | }; 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /qtsqlextra/include/QtSqlBuilder: -------------------------------------------------------------------------------- 1 | #include "../src/qtsqlbuilder.h" 2 | -------------------------------------------------------------------------------- /qtsqlextra/include/QtSqlExtra: -------------------------------------------------------------------------------- 1 | #include "../src/qtsqlextra.h" 2 | -------------------------------------------------------------------------------- /qtsqlextra/include/QtSqlUtils: -------------------------------------------------------------------------------- 1 | #include "../src/qtsqlutils.h" 2 | -------------------------------------------------------------------------------- /qtsqlextra/qtsqlextra.pri: -------------------------------------------------------------------------------- 1 | SOURCES += \ 2 | $$PWD/src/qtsqlbuilder.cpp \ 3 | $$PWD/src/qtsqlutils.cpp 4 | 5 | HEADERS += \ 6 | $$PWD/src/qtsqlextra.h \ 7 | $$PWD/src/qtsqlbuilder.h \ 8 | $$PWD/src/qtsqlutils.h 9 | -------------------------------------------------------------------------------- /qtsqlextra/src/qtsqlextra.h: -------------------------------------------------------------------------------- 1 | #ifndef QTSQLEXTRA_GLOBAL_H 2 | #define QTSQLEXTRA_GLOBAL_H 3 | 4 | #include 5 | #include 6 | 7 | #ifndef Q_NO_IMPL 8 | # define Q_NO_IMPL(x) qWarning("(%s:%d) %s:%s is not yet implemented", __FILE__, __LINE__, Q_FUNC_INFO, #x); 9 | #endif 10 | 11 | #if defined(QTSQLEXTRA_NODLL) 12 | # undef QTSQLEXTRA_MAKEDLL 13 | # undef QTSQLEXTRA_DLL 14 | #elif defined(QTSQLEXTRA_MAKEDLL) /* create a DLL library */ 15 | # if defined(QTSQLEXTRA_DLL) 16 | # undef QTSQLEXTRA_DLL 17 | # endif 18 | # if defined(QTSQLEXTRA_BUILD_LIB) 19 | # define QTSQLEXTRA_EXPORT Q_DECL_EXPORT 20 | # else 21 | # define QTSQLEXTRA_EXPORT Q_DECL_IMPORT 22 | # endif 23 | #elif defined(QTSQLEXTRA_DLL) /* use a DLL library */ 24 | # define QTSQLEXTRA_EXPORT Q_DECL_IMPORT 25 | #endif 26 | 27 | #endif // QTSQLEXTRA_GLOBAL_H 28 | -------------------------------------------------------------------------------- /qtsqlwidgets/include/QtSqlConnectionDialog: -------------------------------------------------------------------------------- 1 | #include "../src/qtsqlconnectiondialog.h" 2 | -------------------------------------------------------------------------------- /qtsqlwidgets/include/QtSqlConnectionEdit: -------------------------------------------------------------------------------- 1 | #include "../src/qtsqlconnectionedit.h" 2 | -------------------------------------------------------------------------------- /qtsqlwidgets/include/QtSqlItemTreeModel: -------------------------------------------------------------------------------- 1 | #include "../src/qtsqlitemtreemodel.h" 2 | -------------------------------------------------------------------------------- /qtsqlwidgets/include/QtSqlWidgets: -------------------------------------------------------------------------------- 1 | #include "../src/qtsqlwidgets.h" 2 | -------------------------------------------------------------------------------- /qtsqlwidgets/qtsqlwidgets.pri: -------------------------------------------------------------------------------- 1 | 2 | SOURCES += \ 3 | $$PWD/src/qtsqlitemtreemodel.cpp \ 4 | $$PWD/src/qtsqlconnectionedit.cpp \ 5 | $$PWD/src/qtsqlconnectiondialog.cpp 6 | 7 | HEADERS += \ 8 | $$PWD/src/qtsqlwidgets.h \ 9 | $$PWD/src/qtsqlitemtreemodel.h \ 10 | $$PWD/src/qtsqlconnectionedit.h \ 11 | $$PWD/src/qtsqlconnectiondialog.h 12 | 13 | RESOURCES += \ 14 | $$PWD/qtsqlwidgets.qrc 15 | 16 | -------------------------------------------------------------------------------- /qtsqlwidgets/qtsqlwidgets.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/connect_options.json 4 | 5 | 6 | -------------------------------------------------------------------------------- /qtsqlwidgets/src/qtsqlconnectiondialog.h: -------------------------------------------------------------------------------- 1 | #ifndef QTSQLCONNECTIONDIALOG_H 2 | #define QTSQLCONNECTIONDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | class QTSQLWIDGETS_EXPORT QtSqlConnectionDialog : public QDialog 8 | { 9 | Q_OBJECT 10 | public: 11 | QtSqlConnectionDialog(QWidget* parent = Q_NULLPTR, Qt::WindowFlags flags = 0); 12 | ~QtSqlConnectionDialog(); 13 | 14 | QString connectionName() const; 15 | QString databaseName() const; 16 | QString driverName() const; 17 | QString userName() const; 18 | QString password() const; 19 | QString hostName() const; 20 | int port() const; 21 | QString options() const; 22 | 23 | public Q_SLOTS: 24 | void setConnectionName(const QString& name); 25 | void setDatabaseName(const QString& databaseName); 26 | void setDriverName(const QString& driverName); 27 | void setUserName(const QString& userName); 28 | void setPassword(const QString& password); 29 | void setHostName(const QString& hostName); 30 | void setPort(int port); 31 | void setOptions(const QString& options); 32 | 33 | void test(); 34 | 35 | private Q_SLOTS: 36 | void success(); 37 | void fail(const QString& message); 38 | void warning(const QString& message); 39 | void error(const QString& message); 40 | private: 41 | QScopedPointer d; 42 | }; 43 | 44 | #endif // QTSQLCONNECTIONDIALOG_H 45 | -------------------------------------------------------------------------------- /qtsqlwidgets/src/qtsqlwidgets.h: -------------------------------------------------------------------------------- 1 | #ifndef QTSQLWIDGETS_GLOBAL_H 2 | #define QTSQLWIDGETS_GLOBAL_H 3 | 4 | #include 5 | #include 6 | 7 | #ifndef Q_NO_IMPL 8 | # define Q_NO_IMPL(x) qWarning("(%s:%d) %s:%s is not yet implemented", __FILE__, __LINE__, Q_FUNC_INFO, #x); 9 | #endif 10 | 11 | #if defined(QTSQLWIDGETS_NODLL) 12 | # undef QTSQLWIDGETS_MAKEDLL 13 | # undef QTSQLWIDGETS_DLL 14 | #elif defined(QTSQLWIDGETS_MAKEDLL) /* create a DLL library */ 15 | # if defined(QTSQLWIDGETS_DLL) 16 | # undef QTSQLWIDGETS_DLL 17 | # endif 18 | # if defined(QTSQLWIDGETS_BUILD_LIB) 19 | # define QTSQLWIDGETS_EXPORT Q_DECL_EXPORT 20 | # else 21 | # define QTSQLWIDGETS_EXPORT Q_DECL_IMPORT 22 | # endif 23 | #elif defined(QTSQLWIDGETS_DLL) /* use a DLL library */ 24 | # define QTSQLWIDGETS_EXPORT Q_DECL_IMPORT 25 | #endif 26 | 27 | #endif // QTSQLWIDGETS_GLOBAL_H 28 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtAboutDialog: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtaboutdialog.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtActionItemDelegate: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/delegates/qtactionitemdelegate.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtButtonLocker: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtbuttonlocker.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtCachingProxyModel: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qtrevertibleproxymodel.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtCardWidget: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtcardwidget.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtCheckableProxyModel: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qtcheckableproxymodel.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtColorButton: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtcolorbutton.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtColorComboBox: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtcolorcombobox.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtColorGrid: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtcolorgrid.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtColorPalette: -------------------------------------------------------------------------------- 1 | #include "../src/painting/qtcolorpalette.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtColorSelector: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtcolorselector.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtColorTriangle: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtcolortriangle.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtColumnProxyModel: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qtcolumnproxymodel.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtComboBoxItemDelegate: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/delegates/qtcomboboxitemdelegate.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtCompositeItemDelegate: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/delegates/qtcompositeitemdelegate.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtCompositeProxyModel: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qtcompositeproxymodel.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtContentView: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtcontentview.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtCounterItemDelegate: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/delegates/qtcounteritemdelegate.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtCrumbBar: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/views/qtcrumbbar.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtCustomHeaderView: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/views/qtcustomheaderview.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtDockWidget: -------------------------------------------------------------------------------- 1 | #include "../src/mainwindow/qtdockwidget.h" -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtEditDialog: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qteditdialog.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtHsvRadialPicker: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qthsvradialpicker.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtHsvRectPicker: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qthsvrectpicker.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtItemFilter: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qtitemfilter.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtItemMapper: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qtitemmapper.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtItemModelUtility: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/qtitemmodelutility.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtItemViewController: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/views/qtitemviewcontroller.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtItemViewNavigator: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/views/qtitemviewnavigator.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtLineBoxEdit: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtlineboxedit.h" -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtLongSpinBox: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtlongspinbox.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtMainWindow: -------------------------------------------------------------------------------- 1 | #include "../src/mainwindow/qtmainwindow.h" -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtMenuItemDelegate: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/delegates/qtmenuitemdelegate.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtMessageLogView: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtmessagelogview.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtMessageLogWidget: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtmessagelogwidget.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtMultiProgressDialog: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtmultiprogressdialog.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtNotificationBar: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtnotificationbar.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtObjectTreeModel: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qtobjecttreemodel.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtOptionsWidget: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtoptionswidget.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtOverviewWidget: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtoverviewwidget.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtPaintUtils: -------------------------------------------------------------------------------- 1 | #include "../src/painting/qtpaintutils.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtPathLineEdit: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtpathlineedit.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtPatternEdit: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtpatternedit.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtPlaceholderEffect: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtplaceholdereffect.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtProgressEffect: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtprogresseffect.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtProgressItemDelegate: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/delegates/qtprogressitemdelegate.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtRangeNavigator: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/views/qtrangenavigator.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtRevertibleProxyModel: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qtrevertibleproxymodel.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtRichTextItemDelegate: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/delegates/qtrichtextitemdelegate.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtSheetItemDelegate: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/delegates/qtsheetitemdelegate.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtShortcutEdit: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtshortcutedit.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtSlideButton: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtslidebutton.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtSlideCheckBox: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtslidecheckbox.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtSlideController: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtslidecontroller.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtSpanSlider: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtspanslider.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtSpinBoxEdit: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtspinboxedit.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtSplashWidget: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtsplashwidget.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtStateIndicator: -------------------------------------------------------------------------------- 1 | #include "../src/indicators/qtstateindicator.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtSwitchButton: -------------------------------------------------------------------------------- 1 | #include "../src/indicators/qtswitchbutton.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtSyntaxHighlighter: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qtsyntaxhighlighter.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtTableModelExporter: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qttablemodelexporter.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtTableModelExporterDialog: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qttablemodelexporterdialog.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtTableModelExporterFactory: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qttablemodelexporterfactory.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtTableModelExporterPlugin: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qttablemodelexporterplugin.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtTextCodecModel: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qttextcodecmodel.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtTextSpinBox: -------------------------------------------------------------------------------- 1 | #include "../src/widgets/qttextspinbox.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtTreeProxyModel: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qttreeproxymodel.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtVariantItemDelegate: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/delegates/qtvariantitemdelegate.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtVariantListModel: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/models/qtvariantlistmodel.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtVariantTypeDelegate: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/delegates/qtvarianttypedelegate.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtWidgetItemDelegate: -------------------------------------------------------------------------------- 1 | #include "../src/itemviews/delegates/qtwidgetitemdelegate.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtWidgetsExtra: -------------------------------------------------------------------------------- 1 | #include "../src/qtwidgetsextra.h" 2 | -------------------------------------------------------------------------------- /qtwidgetsextra/include/QtWindowManager: -------------------------------------------------------------------------------- 1 | #include "../src/mainwindow/qtwindowmanager.h" -------------------------------------------------------------------------------- /qtwidgetsextra/qtwidgetsextra.pro: -------------------------------------------------------------------------------- 1 | CONFIG += c++1z 2 | CONFIG += debug_and_release 3 | 4 | CONFIG(debug, debug|release) { 5 | TARGET = qtwidgetsextrad 6 | MOC_DIR = tmp/debug_shared/moc 7 | OBJECTS_DIR = tmp/debug_shared/obj 8 | RCC_DIR = tmp/debug_shared/rcc 9 | } else { 10 | TARGET = qtwidgetsextra 11 | MOC_DIR = tmp/release_shared/moc 12 | OBJECTS_DIR = tmp/release_shared/obj 13 | RCC_DIR = tmp/release_shared/rcc 14 | } 15 | 16 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 17 | 18 | TEMPLATE = lib 19 | DESTDIR = ../libs 20 | DLLDESTDIR = ../bin 21 | INCLUDEPATH = . include 22 | DEPENDPATH = . src include 23 | 24 | DEFINES += QTWIDGETSEXTRA_MAKEDLL QTWIDGETSEXTRA_BUILD_LIB 25 | #win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000 26 | 27 | 28 | include(qtwidgetsextra.pri) 29 | 30 | -------------------------------------------------------------------------------- /qtwidgetsextra/qtwidgetsextra.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/text/textcodecs.txt 4 | 5 | 6 | resources/images/patterns-aA.png 7 | resources/images/patterns-aAHW.png 8 | resources/images/patterns-aAHWRX.png 9 | resources/images/patterns-aARX.png 10 | resources/images/patterns-HW.png 11 | resources/images/patterns-HWRX.png 12 | resources/images/patterns-RX.png 13 | resources/images/icons8-search-16.png 14 | 15 | 16 | resources/shaders/dual_kawase_down.frag 17 | resources/shaders/dual_kawase_up.frag 18 | resources/shaders/simple.vert 19 | 20 | 21 | -------------------------------------------------------------------------------- /qtwidgetsextra/resources/images/icons8-search-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtwidgetsextra/resources/images/icons8-search-16.png -------------------------------------------------------------------------------- /qtwidgetsextra/resources/images/patterns-HW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtwidgetsextra/resources/images/patterns-HW.png -------------------------------------------------------------------------------- /qtwidgetsextra/resources/images/patterns-HWRX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtwidgetsextra/resources/images/patterns-HWRX.png -------------------------------------------------------------------------------- /qtwidgetsextra/resources/images/patterns-RX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtwidgetsextra/resources/images/patterns-RX.png -------------------------------------------------------------------------------- /qtwidgetsextra/resources/images/patterns-aA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtwidgetsextra/resources/images/patterns-aA.png -------------------------------------------------------------------------------- /qtwidgetsextra/resources/images/patterns-aAHW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtwidgetsextra/resources/images/patterns-aAHW.png -------------------------------------------------------------------------------- /qtwidgetsextra/resources/images/patterns-aAHWRX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtwidgetsextra/resources/images/patterns-aAHWRX.png -------------------------------------------------------------------------------- /qtwidgetsextra/resources/images/patterns-aARX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtwidgetsextra/resources/images/patterns-aARX.png -------------------------------------------------------------------------------- /qtwidgetsextra/resources/images/patterns.ora: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progzdeveloper/QtExtra/1264df0b38a3569d04e56bafc188eecc4952df0f/qtwidgetsextra/resources/images/patterns.ora -------------------------------------------------------------------------------- /qtwidgetsextra/resources/shaders/dual_kawase_down.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | in highp vec4 vColor; 3 | out highp vec4 fColor; 4 | 5 | uniform sampler2D texture; 6 | uniform vec2 iResolution; 7 | uniform vec2 offset; 8 | uniform vec2 halfpixel; 9 | 10 | void main() 11 | { 12 | vec2 uv = vec2(gl_FragCoord.xy / iResolution); 13 | 14 | vec4 sum = texture2D(texture, uv) * 4.0; 15 | sum += texture2D(texture, uv - halfpixel.xy * offset); 16 | sum += texture2D(texture, uv + halfpixel.xy * offset); 17 | sum += texture2D(texture, uv + vec2(halfpixel.x, -halfpixel.y) * offset); 18 | sum += texture2D(texture, uv - vec2(halfpixel.x, -halfpixel.y) * offset); 19 | 20 | fColor = sum / 8.0; 21 | } 22 | -------------------------------------------------------------------------------- /qtwidgetsextra/resources/shaders/dual_kawase_up.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | in highp vec4 vColor; 3 | out highp vec4 fColor; 4 | 5 | uniform sampler2D texture; 6 | uniform vec2 iResolution; 7 | uniform vec2 offset; 8 | uniform vec2 halfpixel; 9 | 10 | void main() 11 | { 12 | vec2 uv = vec2(gl_FragCoord.xy / iResolution); 13 | 14 | vec4 sum = texture2D(texture, uv + vec2(-halfpixel.x * 2.0, 0.0) * offset); 15 | sum += texture2D(texture, uv + vec2(-halfpixel.x, halfpixel.y) * offset) * 2.0; 16 | sum += texture2D(texture, uv + vec2(0.0, halfpixel.y * 2.0) * offset); 17 | sum += texture2D(texture, uv + vec2(halfpixel.x, halfpixel.y) * offset) * 2.0; 18 | sum += texture2D(texture, uv + vec2(halfpixel.x * 2.0, 0.0) * offset); 19 | sum += texture2D(texture, uv + vec2(halfpixel.x, -halfpixel.y) * offset) * 2.0; 20 | sum += texture2D(texture, uv + vec2(0.0, -halfpixel.y * 2.0) * offset); 21 | sum += texture2D(texture, uv + vec2(-halfpixel.x, -halfpixel.y) * offset) * 2.0; 22 | 23 | fColor = sum / 12.0; 24 | } 25 | -------------------------------------------------------------------------------- /qtwidgetsextra/resources/shaders/simple.vert: -------------------------------------------------------------------------------- 1 | #version 330 2 | layout(location = 0) in vec3 position; 3 | 4 | void main() 5 | { 6 | gl_Position = vec4(position, 1.0); 7 | } 8 | -------------------------------------------------------------------------------- /qtwidgetsextra/resources/text/textcodecs.txt: -------------------------------------------------------------------------------- 1 | System 2 | Apple Roman 3 | Big5 4 | Big5-HKSCS 5 | CP949 6 | EUC-JP 7 | EUC-KR 8 | GB18030-0 9 | IBM 850 10 | IBM 866 11 | IBM 874 12 | ISO 2022-JP 13 | ISO 8859-1 14 | ISO 8859-2 15 | ISO 8859-3 16 | ISO 8859-4 17 | ISO 8859-5 18 | ISO 8859-6 19 | ISO 8859-7 20 | ISO 8859-8 21 | ISO 8859-9 22 | ISO 8859-10 23 | ISO 8859-13 24 | ISO 8859-14 25 | ISO 8859-15 26 | ISO 8859-16 27 | Iscii-Bng 28 | Iscii-Dev 29 | Iscii-Gjr 30 | Iscii-Knd 31 | Iscii-Mlm 32 | Iscii-Ori 33 | Iscii-Pnj 34 | Iscii-Tlg 35 | Iscii-Tml 36 | JIS X 0201 37 | JIS X 0208 38 | KOI8-R 39 | KOI8-U 40 | MuleLao-1 41 | ROMAN8 42 | Shift-JIS 43 | TIS-620 44 | TSCII 45 | UTF-8 46 | UTF-16 47 | UTF-16BE 48 | UTF-16LE 49 | UTF-32 50 | UTF-32BE 51 | UTF-32LE 52 | Windows-1250 53 | Windows-1251 54 | Windows-1252 55 | Windows-1253 56 | Windows-1254 57 | Windows-1255 58 | Windows-1256 59 | Windows-1257 60 | Windows-1258 61 | WINSAMI2 -------------------------------------------------------------------------------- /qtwidgetsextra/src/effects/blur.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | QImage QTWIDGETSEXTRA_EXPORT stackBlurImage(const QImage& _image, int _radius, int _threadCount = 1); 6 | 7 | QImage QTWIDGETSEXTRA_EXPORT boxBlurImage(const QImage& _image, const QRect& _rect, int _radius); 8 | inline QImage boxBlurImage(const QImage& _image, int _radius) 9 | { 10 | return boxBlurImage(_image, _image.rect(), _radius); 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/effects/glblurfunctions.h: -------------------------------------------------------------------------------- 1 | #ifndef GLBLURFUNCTIONS_H 2 | #define GLBLURFUNCTIONS_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | class GLBlurFunctions : protected QOpenGLFunctions_3_3_Core 19 | { 20 | public: 21 | GLBlurFunctions(); 22 | ~GLBlurFunctions(); 23 | 24 | QImage blurImage_DualKawase(QImage imageToBlur, int offset, int iterations); 25 | float getGPUTime(); 26 | float getCPUTime(); 27 | 28 | private: 29 | void renderToFBO(QOpenGLFramebufferObject* targetFBO, GLuint sourceTexture, QOpenGLShaderProgram *shader); 30 | void initFBOTextures(); 31 | 32 | QOpenGLShaderProgram *m_ShaderProgram_kawase_up; 33 | QOpenGLShaderProgram *m_ShaderProgram_kawase_down; 34 | 35 | QVector m_FBO_vector; 36 | QOpenGLTexture *m_textureToBlur; 37 | 38 | QOpenGLVertexArrayObject m_VertexArrayObject; 39 | QOpenGLBuffer m_VertexBuffer; 40 | 41 | QOffscreenSurface *m_Surface; 42 | QOpenGLContext *m_Context; 43 | 44 | int m_iterations; 45 | QImage m_imageToBlur; 46 | 47 | //GPU timer 48 | GLuint GPUTimerQueries[1]; 49 | GLint GPUTimerAvailable; 50 | GLuint64 GPUtimerElapsedTime; 51 | 52 | //CPU timer 53 | QElapsedTimer CPUTimer; 54 | quint64 CPUTimerElapsedTime; 55 | }; 56 | 57 | #endif // GLBLURFUNCTIONS_H 58 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/indicators/qtswitchbutton.h: -------------------------------------------------------------------------------- 1 | #ifndef QTSWITCHBUTTON_H 2 | #define QTSWITCHBUTTON_H 3 | 4 | #include 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtSwitchButton : public QAbstractButton 8 | { 9 | public: 10 | QtSwitchButton(QWidget* parent); 11 | ~QtSwitchButton(); 12 | 13 | // QWidget interface 14 | protected: 15 | virtual void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; 16 | virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; 17 | 18 | // QAbstractButton interface 19 | protected: 20 | virtual bool hitButton(const QPoint &pos) const Q_DECL_OVERRIDE; 21 | 22 | private: 23 | QT_PIMPL(QtSwitchButton) 24 | }; 25 | 26 | #endif // QTSWITCHBUTTON_H 27 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/delegates/qtcompositeitemdelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef QTCOMPOSITEITEMDELEGATE_H 2 | #define QTCOMPOSITEITEMDELEGATE_H 3 | 4 | #include 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtCompositeItemDelegate : 8 | public QStyledItemDelegate 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit QtCompositeItemDelegate(QObject* parent = Q_NULLPTR); 13 | virtual ~QtCompositeItemDelegate(); 14 | 15 | // QAbstractItemDelegate interface 16 | public: 17 | virtual void paint(QPainter *painter, const QStyleOptionViewItem &opt, const QModelIndex &index) const; 18 | virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; 19 | }; 20 | 21 | #endif // QTCOMPOSITEITEMDELEGATE_H 22 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/delegates/qtcounteritemdelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef QTCOUNTERITEMDELEGATE_H 2 | #define QTCOUNTERITEMDELEGATE_H 3 | 4 | #include 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtCounterItemDelegate : 8 | public QStyledItemDelegate 9 | { 10 | Q_OBJECT 11 | public: 12 | 13 | enum CounterMode 14 | { 15 | None = 0, 16 | Plus = 1, 17 | Suffix = 2, 18 | User = Suffix + 1 19 | }; 20 | 21 | explicit QtCounterItemDelegate(QObject *parent = Q_NULLPTR); 22 | explicit QtCounterItemDelegate(CounterMode mode, QObject* parent = Q_NULLPTR); 23 | virtual ~QtCounterItemDelegate(); 24 | 25 | void setCounterMode(CounterMode mode); 26 | CounterMode counterMode() const; 27 | 28 | void setIconSize(const QSize& size); 29 | QSize iconSize() const; 30 | 31 | // QAbstractItemDelegate interface 32 | public: 33 | virtual void paint(QPainter *painter, 34 | const QStyleOptionViewItem &option, 35 | const QModelIndex &index) const Q_DECL_OVERRIDE; 36 | 37 | virtual QSize sizeHint(const QStyleOptionViewItem &option, 38 | const QModelIndex &index) const Q_DECL_OVERRIDE; 39 | protected: 40 | virtual QString formatCounter(qint64 count) const; 41 | 42 | private: 43 | CounterMode mMode; 44 | QSize mIconSize; 45 | }; 46 | 47 | 48 | #endif // QTCOUNTERITEMDELEGATE_H 49 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/delegates/qtmenuitemdelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef QTMENUITEMDELEGATE_H 2 | #define QTMENUITEMDELEGATE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class QTWIDGETSEXTRA_EXPORT QtMenuItemDelegate : 9 | public QItemDelegate 10 | { 11 | public: 12 | QtMenuItemDelegate(QObject* parent = Q_NULLPTR); 13 | 14 | // QAbstractItemDelegate interface 15 | public: 16 | virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; 17 | virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; 18 | }; 19 | 20 | #endif // QTMENUITEMDELEGATE_H 21 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/delegates/qtprogressitemdelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef QTPROGRESSITEMDELEGATE_H 2 | #define QTPROGRESSITEMDELEGATE_H 3 | #include 4 | #include 5 | 6 | class QRect; 7 | 8 | class QTWIDGETSEXTRA_EXPORT QtProgressItemDelegate : 9 | public QItemDelegate 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit QtProgressItemDelegate(QObject * parent = 0); 14 | ~QtProgressItemDelegate(); 15 | 16 | void setPrecision(int prec = 0); 17 | int precision() const; 18 | 19 | // QAbstractItemDelegate interface 20 | public: 21 | virtual void paint(QPainter * painter, 22 | const QStyleOptionViewItem & option, 23 | const QModelIndex & index) const Q_DECL_OVERRIDE; 24 | 25 | virtual QSize sizeHint(const QStyleOptionViewItem &option, 26 | const QModelIndex &index) const Q_DECL_OVERRIDE; 27 | 28 | private: 29 | QRect rect(const QStyleOptionViewItem &option, 30 | const QModelIndex &index, int role) const; 31 | 32 | private: 33 | int mPrec; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/delegates/qtsheetitemdelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef QTSHEETDELEGATE_H 2 | #define QTSHEETDELEGATE_H 3 | 4 | #include 5 | #include 6 | 7 | class QTreeView; 8 | 9 | class QTWIDGETSEXTRA_EXPORT QtSheetItemDelegate : 10 | public QStyledItemDelegate 11 | { 12 | Q_OBJECT 13 | public: 14 | explicit QtSheetItemDelegate(QTreeView *view, QObject *parent); 15 | virtual ~QtSheetItemDelegate(); 16 | 17 | // QAbstractItemDelegate interface 18 | public: 19 | virtual void paint(QPainter *painter, 20 | const QStyleOptionViewItem &opt, 21 | const QModelIndex &index) const Q_DECL_OVERRIDE; 22 | 23 | virtual QSize sizeHint(const QStyleOptionViewItem &opt, 24 | const QModelIndex &index) const Q_DECL_OVERRIDE; 25 | 26 | 27 | private: 28 | QTreeView* mView; 29 | }; 30 | 31 | #endif // QTSHEETDELEGATE_H 32 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/delegates/qtvarianttypedelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef QTVARIANTTYPEDELEGATE_H 2 | #define QTVARIANTTYPEDELEGATE_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | class QWidget; 10 | class QModelIndex; 11 | class QStyleOptionViewItem; 12 | class QAbstractItemModel; 13 | 14 | 15 | class QTWIDGETSEXTRA_EXPORT QtVariantTypeDelegate : 16 | public QStyledItemDelegate 17 | { 18 | Q_OBJECT 19 | public: 20 | explicit QtVariantTypeDelegate(QObject *parent = 0); 21 | ~QtVariantTypeDelegate(); 22 | 23 | inline void setItemRole(int role) { mRole = role; } 24 | inline int itemRole() const { return mRole; } 25 | 26 | QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, 27 | const QModelIndex &index) const; 28 | 29 | void setEditorData(QWidget *editor, const QModelIndex &index) const; 30 | void setModelData(QWidget *editor, QAbstractItemModel *model, 31 | const QModelIndex &index) const; 32 | 33 | void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, 34 | const QModelIndex &index) const; 35 | 36 | private: 37 | Q_DISABLE_COPY(QtVariantTypeDelegate) 38 | int mRole; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/models/qtcachingproxymodel.h: -------------------------------------------------------------------------------- 1 | #ifndef QTCACHINGPROXYMODEL_H 2 | #define QTCACHINGPROXYMODEL_H 3 | 4 | #include 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtCachingProxyModel : 8 | public QIdentityProxyModel 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | enum CachingPolicy 14 | { 15 | ManualUpdate = 0, 16 | AutoUpdate = 1 17 | }; 18 | 19 | explicit QtCachingProxyModel(QObject* parent = Q_NULLPTR); 20 | ~QtCachingProxyModel(); 21 | 22 | void setCachingPolicy(CachingPolicy policy); 23 | CachingPolicy cachingPolicy() const; 24 | 25 | void setUpdateInterval(int interval); 26 | int updateInterval() const; 27 | 28 | void setMaxCacheSize(int maxSize); 29 | int maxCacheSize() const; 30 | 31 | int cacheSize() const; 32 | 33 | void setCachedColumn(int column); 34 | int cachedColumn() const; 35 | 36 | void setCachedRoles(const std::vector& roles); 37 | const std::vector& cachedRoles() const; 38 | 39 | void setSourceModel(QAbstractItemModel* model) Q_DECL_OVERRIDE; 40 | 41 | bool setData(const QModelIndex &index, const QVariant &value, int role) Q_DECL_OVERRIDE; 42 | QVariant data(const QModelIndex &proxyIndex, int role) const Q_DECL_OVERRIDE; 43 | 44 | public Q_SLOTS: 45 | void clearCache(); 46 | virtual void updateCache(); 47 | virtual void cacheIndex(const QModelIndex& index); 48 | 49 | protected: 50 | void timerEvent(QTimerEvent* event) Q_DECL_OVERRIDE; 51 | 52 | private: 53 | QT_PIMPL(QtCachingProxyModel) 54 | }; 55 | 56 | #endif // QTCACHINGPROXYMODEL_H 57 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/models/qtcolumnproxymodel.h: -------------------------------------------------------------------------------- 1 | #ifndef QTSUBSETPROXYMODEL_H 2 | #define QTSUBSETPROXYMODEL_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | class QTWIDGETSEXTRA_EXPORT QtColumnProxyModel : 9 | public QIdentityProxyModel 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit QtColumnProxyModel(QObject *parent = 0); 14 | ~QtColumnProxyModel(); 15 | 16 | // API 17 | 18 | void setSourceColumns(const QVector &columns); 19 | const QVector& sourceColumns() const; 20 | 21 | // QAbstractItemModel interface 22 | public: 23 | int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; 24 | int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; 25 | 26 | QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; 27 | QModelIndex parent(const QModelIndex &child) const override; 28 | 29 | QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; 30 | 31 | QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE; 32 | 33 | // QAbstractProxyModel interface 34 | public: 35 | QModelIndex mapFromSource(const QModelIndex &sourceIndex) const Q_DECL_OVERRIDE; 36 | QModelIndex mapToSource(const QModelIndex &proxyIndex) const Q_DECL_OVERRIDE; 37 | 38 | 39 | private: 40 | QT_PIMPL(QtColumnProxyModel) 41 | }; 42 | 43 | #endif // QTSUBSETPROXYMODEL_H 44 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/models/qtenumlistmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef QTENUMLISTMODEL_H 2 | #define QTENUMLISTMODEL_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | class QTWIDGETSEXTRA_EXPORT QtEnumListModel : public QAbstractListModel 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit QtEnumListModel(QObject* parent = Q_NULLPTR); 14 | QtEnumListModel(const QMetaEnum& e, QObject* parent = Q_NULLPTR); 15 | 16 | ~QtEnumListModel(); 17 | 18 | void setEnum(const QMetaEnum& e); 19 | 20 | QMetaEnum metaEnum() const; 21 | 22 | void setCheckable(bool on); 23 | bool isCheckable() const; 24 | 25 | // QAbstractItemModel interface 26 | public: 27 | virtual int rowCount(const QModelIndex & parent = QModelIndex()) const Q_DECL_OVERRIDE; 28 | virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; 29 | virtual bool setData(const QModelIndex& index, const QVariant& value, int role) Q_DECL_OVERRIDE; 30 | virtual Qt::ItemFlags flags(const QModelIndex& index) const Q_DECL_OVERRIDE; 31 | 32 | // QAbstractItemModel interface 33 | public Q_SLOTS: 34 | virtual void revert() Q_DECL_OVERRIDE; 35 | 36 | void clear(); 37 | 38 | 39 | protected: 40 | void setMeta(const QMetaEnum& e); 41 | 42 | private: 43 | class QtEnumListModelPrivate* d_ptr; 44 | Q_DECLARE_PRIVATE(QtEnumListModel) 45 | 46 | 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/models/qtheaderproxymodel.cpp: -------------------------------------------------------------------------------- 1 | #include "qtheaderproxymodel.h" 2 | 3 | QtHeaderProxyModel::QtHeaderProxyModel(QObject *parent) 4 | : QIdentityProxyModel(parent) 5 | { 6 | } 7 | 8 | QtHeaderProxyModel::~QtHeaderProxyModel() 9 | { 10 | } 11 | 12 | QVariant QtHeaderProxyModel::headerData(int section, Qt::Orientation orientation, int role) const 13 | { 14 | if (section == 0 && orientation == Qt::Horizontal && role == Qt::DisplayRole) 15 | return tr("Headers"); 16 | 17 | if (orientation == Qt::Vertical && role == Qt::DisplayRole) 18 | return section; 19 | 20 | return QVariant(); 21 | } 22 | 23 | int QtHeaderProxyModel::rowCount(const QModelIndex &/*parent*/) const 24 | { 25 | if (sourceModel()) 26 | return sourceModel()->columnCount(); 27 | return 0; 28 | } 29 | 30 | int QtHeaderProxyModel::columnCount(const QModelIndex &/*parent*/) const 31 | { 32 | return 1; 33 | } 34 | 35 | QVariant QtHeaderProxyModel::data(const QModelIndex &index, int role) const 36 | { 37 | if (!index.isValid()) 38 | return QVariant(); 39 | if (sourceModel()) 40 | return sourceModel()->headerData(mapToSource(index).row(), Qt::Horizontal, role); 41 | return QVariant(); 42 | } 43 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/models/qtheaderproxymodel.h: -------------------------------------------------------------------------------- 1 | #ifndef QTHEADERPROXYMODEL_H 2 | #define QTHEADERPROXYMODEL_H 3 | 4 | #include 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtHeaderProxyModel : 8 | public QIdentityProxyModel 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | explicit QtHeaderProxyModel(QObject *parent = Q_NULLPTR); 14 | ~QtHeaderProxyModel(); 15 | 16 | // QAbstractItemModel interface 17 | public: 18 | QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE; 19 | 20 | virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; 21 | virtual int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; 22 | 23 | virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; 24 | }; 25 | 26 | #endif // QTHEADERPROXYMODEL_H 27 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/models/qttablemodelexporterdialog.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "qttablemodelexporterdialog.h" 4 | #include "qttablemodelexporter.h" 5 | 6 | 7 | class QtTableModelExporterDialogPrivate 8 | { 9 | public: 10 | QtTableModelExporterDialog *q_ptr; 11 | QDialogButtonBox * buttonBox; 12 | QWidget * controller; 13 | QtTableModelExporter *exporter; 14 | const char* member; 15 | void createUi(); 16 | }; 17 | 18 | void QtTableModelExporterDialogPrivate::createUi() 19 | { 20 | buttonBox = new QDialogButtonBox(QDialogButtonBox::Yes|QDialogButtonBox::Cancel, Qt::Horizontal, q_ptr); 21 | QObject::connect(buttonBox, &QDialogButtonBox::accepted, q_ptr, &QtTableModelExporterDialog::accept); 22 | QObject::connect(buttonBox, &QDialogButtonBox::rejected, q_ptr, &QtTableModelExporterDialog::reject); 23 | 24 | controller = exporter->createEditor(q_ptr); 25 | 26 | QVBoxLayout *layout = new QVBoxLayout(q_ptr); 27 | layout->addWidget(controller); 28 | layout->addWidget(buttonBox); 29 | } 30 | 31 | 32 | QtTableModelExporterDialog::QtTableModelExporterDialog(QtTableModelExporter *exporter, 33 | QWidget *parent /*= Q_NULLPTR*/ ) 34 | : QDialog(parent), d_ptr(new QtTableModelExporterDialogPrivate) 35 | { 36 | d_ptr->q_ptr = this; 37 | d_ptr->exporter = exporter; 38 | d_ptr->createUi(); 39 | } 40 | 41 | QtTableModelExporterDialog::~QtTableModelExporterDialog() 42 | { 43 | delete d_ptr; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/models/qttablemodelexporterdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef QTTABLEMODELEXPORTERDIALOG_H 2 | #define QTTABLEMODELEXPORTERDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | class QtTableModelExporter; 8 | 9 | class QtTableModelExporterDialogPrivate; 10 | 11 | class QTWIDGETSEXTRA_EXPORT QtTableModelExporterDialog : 12 | public QDialog 13 | { 14 | Q_OBJECT 15 | public: 16 | explicit QtTableModelExporterDialog(QtTableModelExporter *exporter, 17 | QWidget *parent = Q_NULLPTR); 18 | ~QtTableModelExporterDialog(); 19 | 20 | private: 21 | class QtTableModelExporterDialogPrivate *d_ptr; 22 | Q_DISABLE_COPY(QtTableModelExporterDialog) 23 | Q_DECLARE_PRIVATE(QtTableModelExporterDialog) 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/models/qttablemodelexporterfactory.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "qttablemodelexporterfactory.h" 3 | #include "qttablemodelexporterplugin.h" 4 | #include "qttablemodelexporter.h" 5 | 6 | 7 | QtTableModelExporterFactory::QtTableModelExporterFactory() 8 | { 9 | } 10 | 11 | QtTableModelExporterFactory::~QtTableModelExporterFactory() 12 | { 13 | qDeleteAll(m_creatorHash); 14 | } 15 | 16 | void QtTableModelExporterFactory::registerExporter(QtTableModelExporterPlugin* plugin) 17 | { 18 | if (plugin) { 19 | m_creatorHash[plugin->exporterName()] = plugin; 20 | } 21 | } 22 | 23 | QtTableModelExporter* QtTableModelExporterFactory::createExporter(const QString& exporter, 24 | QAbstractTableModel* model) const 25 | { 26 | CreatorHash::const_iterator it = m_creatorHash.find(exporter); 27 | if (it == m_creatorHash.end()) 28 | return 0; 29 | return (*it)->create(model); 30 | } 31 | 32 | QIcon QtTableModelExporterFactory::exporterIcon( const QString& exporter ) const 33 | { 34 | CreatorHash::const_iterator it = m_creatorHash.find(exporter); 35 | if (it == m_creatorHash.end()) 36 | return QIcon(); 37 | return (*it)->icon(); 38 | } 39 | 40 | QStringList QtTableModelExporterFactory::keys() const 41 | { 42 | return m_creatorHash.keys(); 43 | } 44 | 45 | QtTableModelExporterFactory* QtTableModelExporterFactory::instance() 46 | { 47 | static QtTableModelExporterFactory globalInstance; 48 | return &globalInstance; 49 | } 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/models/qttablemodelexporterfactory.h: -------------------------------------------------------------------------------- 1 | #ifndef QTTABLEMODELEXPORTERFACTORY_H 2 | #define QTTABLEMODELEXPORTERFACTORY_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class QAbstractTableModel; 12 | class QtTableModelExporter; 13 | class QtTableModelExporterPlugin; 14 | 15 | class QTWIDGETSEXTRA_EXPORT QtTableModelExporterFactory : 16 | public QFactoryInterface 17 | { 18 | Q_DISABLE_COPY(QtTableModelExporterFactory) 19 | QtTableModelExporterFactory(); 20 | public: 21 | 22 | ~QtTableModelExporterFactory(); 23 | 24 | void registerExporter(QtTableModelExporterPlugin* creator); 25 | QtTableModelExporter* createExporter(const QString& exporter, 26 | QAbstractTableModel* model) const; 27 | 28 | QIcon exporterIcon(const QString& exporter) const; 29 | 30 | QStringList keys() const; 31 | 32 | static QtTableModelExporterFactory* instance(); 33 | 34 | private: 35 | typedef QHash CreatorHash; 36 | CreatorHash m_creatorHash; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/models/qttablemodelexporterplugin.h: -------------------------------------------------------------------------------- 1 | #ifndef QTTABLEMODELEXPORTERPLUGIN_H 2 | #define QTTABLEMODELEXPORTERPLUGIN_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class QAbstractTableModel; 10 | class QtTableModelExporter; 11 | 12 | class QTWIDGETSEXTRA_EXPORT QtTableModelExporterPlugin 13 | { 14 | public: 15 | virtual ~QtTableModelExporterPlugin(){} 16 | virtual QtTableModelExporter* create(QAbstractTableModel* model) const = 0; 17 | virtual QString exporterName() const = 0; 18 | virtual QIcon icon() const = 0; 19 | }; 20 | 21 | Q_DECLARE_INTERFACE(QtTableModelExporterPlugin, "com.QtExtra.QtTableModelExporterPlugin/1.0") 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/models/qttextcodecmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef QTTEXTCODECMODEL_H 2 | #define QTTEXTCODECMODEL_H 3 | 4 | #include 5 | #include 6 | 7 | class QtTextCodecModelPrivate; 8 | class QTWIDGETSEXTRA_EXPORT QtTextCodecModel : 9 | public QAbstractListModel 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit QtTextCodecModel(QObject *parent = Q_NULLPTR); 15 | ~QtTextCodecModel(); 16 | 17 | int rowCount ( const QModelIndex & parent = QModelIndex() ) const; 18 | 19 | QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const; 20 | 21 | private: 22 | Q_DECLARE_PRIVATE(QtTextCodecModel) 23 | QtTextCodecModelPrivate *d_ptr; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/qtitemmodelutility.h: -------------------------------------------------------------------------------- 1 | #ifndef QTITEMVIEWUTILITY_H 2 | #define QTITEMVIEWUTILITY_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | static inline QModelIndex sourceIndex(const QModelIndex& index) { 9 | const QAbstractProxyModel* proxy = qobject_cast(index.model()); 10 | return (proxy != Q_NULLPTR ? proxy->mapToSource(index) : index); 11 | } 12 | 13 | static inline QModelIndex sourceIndex(const QAbstractItemModel* model, int row, int column) { 14 | return sourceIndex(model->index(row, column)); 15 | } 16 | 17 | static inline const QAbstractItemModel* sourceModel(const QAbstractItemModel* model) 18 | { 19 | const QAbstractProxyModel* proxy = qobject_cast(model); 20 | while(proxy != Q_NULLPTR) { 21 | model = proxy->sourceModel(); 22 | proxy = qobject_cast(model); 23 | } 24 | return model; 25 | } 26 | 27 | static inline QString formatPath(const QModelIndex& current, const QString& separator = "/", int role = Qt::DisplayRole) 28 | { 29 | QModelIndex index = current; 30 | QString result; 31 | QStack stack; 32 | while(index.isValid()) { 33 | stack.push(index.data(role).toString()); 34 | index = index.parent(); 35 | } 36 | 37 | while(!stack.isEmpty()) { 38 | result += separator; 39 | result += stack.pop(); 40 | } 41 | return result; 42 | } 43 | 44 | #endif // QTITEMVIEWUTILITY_H 45 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/views/qtcrumbbar.h: -------------------------------------------------------------------------------- 1 | #ifndef QTCRUMBVIEW_H 2 | #define QTCRUMBVIEW_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | class QCompleter; 10 | class QAbstractItemModel; 11 | 12 | class QTWIDGETSEXTRA_EXPORT QtCrumbBar : 13 | public QFrame 14 | { 15 | Q_OBJECT 16 | public: 17 | explicit QtCrumbBar(QWidget* parent = Q_NULLPTR); 18 | virtual ~QtCrumbBar(); 19 | 20 | virtual void setModel(QAbstractItemModel* model); 21 | QAbstractItemModel* model() const; 22 | 23 | QModelIndexList indexList() const; 24 | 25 | void setCompleter(QCompleter* completer); 26 | QCompleter* completer() const; 27 | 28 | void setRootIcon(const QIcon& icon); 29 | QIcon rootIcon() const; 30 | 31 | public Q_SLOTS: 32 | void reset(); 33 | void back(); 34 | void setCurrentIndex(const QModelIndex& index); 35 | 36 | private Q_SLOTS: 37 | void crumbClicked(); 38 | void closeEditor(); 39 | 40 | Q_SIGNALS: 41 | void indexChanged(const QModelIndex& index); 42 | 43 | // QObject interface 44 | protected: 45 | virtual bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; 46 | 47 | private: 48 | QT_PIMPL(QtCrumbBar) 49 | }; 50 | 51 | #endif // QTCRUMBVIEW_H 52 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/views/qtcustomheaderview.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class QtCustomHeaderViewPrivate; 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtCustomHeaderView : 8 | public QHeaderView 9 | { 10 | Q_OBJECT 11 | Q_DISABLE_COPY(QtCustomHeaderView) 12 | public: 13 | explicit QtCustomHeaderView(Qt::Orientation orientation, QWidget * parent = Q_NULLPTR); 14 | virtual ~QtCustomHeaderView(void); 15 | QMenu *createStandardContextMenu(); 16 | 17 | void setSortingEnabled(bool on); 18 | bool isSortingEnabled() const; 19 | 20 | void setSectionStatus(int section, quint32 status); 21 | quint32 sectionStatus(int section) const; 22 | 23 | void setStatusIcon(int status, const QIcon& icon); 24 | QIcon statusIcon(int status) const; 25 | 26 | public slots: 27 | void sortModel(int column, Qt::SortOrder order); 28 | void collapseSection(int logicalIndex); 29 | 30 | protected: 31 | virtual void mousePressEvent(QMouseEvent * event); 32 | virtual void mouseMoveEvent(QMouseEvent * event); 33 | virtual void contextMenuEvent(QContextMenuEvent * event); 34 | 35 | virtual void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const; 36 | virtual QSize sectionSizeFromContents ( int logicalIndex ) const; 37 | 38 | signals: 39 | void sectionClicked(int logicalIndex); 40 | 41 | private: 42 | Q_DECLARE_PRIVATE(QtCustomHeaderView) 43 | QtCustomHeaderViewPrivate *d_ptr; 44 | }; 45 | 46 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/itemviews/views/qtitemviewnavigator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class QAbstractItemView; 5 | 6 | class QTWIDGETSEXTRA_EXPORT QtItemViewNavigator : 7 | public QtRangeNavigator 8 | { 9 | Q_OBJECT 10 | public: 11 | explicit QtItemViewNavigator(QWidget* parent = Q_NULLPTR); 12 | QtItemViewNavigator(QAbstractItemView *view, QWidget * parent = Q_NULLPTR); 13 | ~QtItemViewNavigator(void); 14 | 15 | void setView(QAbstractItemView *view); 16 | QAbstractItemView *view() const; 17 | 18 | /*void setIconSize(const QSize& size); 19 | QSize iconSize() const;*/ 20 | private Q_SLOTS: 21 | void moveTo(int row); 22 | void setIndex(const QModelIndex& index); 23 | void updateRange(); 24 | private: 25 | QT_PIMPL(QtItemViewNavigator) 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/mainwindow/qtdocksidebar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class QtDockWidget; 5 | 6 | class QtDockSideBarPrivate; 7 | 8 | class QtDockSideBar : 9 | public QToolBar 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit QtDockSideBar(Qt::DockWidgetArea area, QWidget *parent = 0); 14 | ~QtDockSideBar(); 15 | 16 | void insertDockWidget(QtDockWidget *dw); 17 | void removeDockWidget(QtDockWidget *dw); 18 | bool contains(QtDockWidget *w) const; 19 | 20 | private slots: 21 | void moveTab(int from, int to); 22 | void show(int key); 23 | 24 | private: 25 | Q_DECLARE_PRIVATE(QtDockSideBar) 26 | QtDockSideBarPrivate *d_ptr; 27 | 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/mainwindow/qtdocktabbar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class QKeyEvent; 5 | class QMouseEvent; 6 | 7 | class QtDockTabBar : 8 | public QTabBar 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit QtDockTabBar(Qt::DockWidgetArea area, QWidget *parent = 0); 13 | ~QtDockTabBar(); 14 | 15 | signals: 16 | void tabClicked(int i); 17 | void tabHover(int i); 18 | 19 | protected: 20 | void mouseMoveEvent ( QMouseEvent * e ); 21 | void mousePressEvent ( QMouseEvent * e ); 22 | void keyPressEvent( QKeyEvent *e ); 23 | private: 24 | friend class QtSideBar; 25 | Q_DISABLE_COPY(QtDockTabBar) 26 | }; 27 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/mainwindow/qtdockwidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | class QEvent; 7 | 8 | class QtDockWidgetPrivate; 9 | class QTWIDGETSEXTRA_EXPORT QtDockWidget : 10 | public QDockWidget 11 | { 12 | Q_OBJECT 13 | Q_PROPERTY(bool autoHide READ isAutoHide WRITE setAutoHide) 14 | 15 | public: 16 | explicit QtDockWidget(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags()); 17 | explicit QtDockWidget(const QString& title, QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags()); 18 | ~QtDockWidget(); 19 | 20 | bool isAutoHide() const; 21 | 22 | public slots: 23 | void setAutoHide(bool on = true); 24 | void setFloating(bool on) { 25 | QDockWidget::setFloating(on); 26 | } 27 | signals: 28 | void autoHideChanged(bool on); 29 | 30 | protected: 31 | void leaveEvent(QEvent * e); 32 | void focusOutEvent(QFocusEvent *e); 33 | 34 | private: 35 | friend class QtDockWidgetTitleBar; 36 | Q_DISABLE_COPY(QtDockWidget) 37 | Q_DECLARE_PRIVATE(QtDockWidget) 38 | QtDockWidgetPrivate *d_ptr; 39 | }; 40 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/mainwindow/qtdockwidgettitlebar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class QPaintEvent; 5 | 6 | class QtDockWidgetTitleBarPrivate; 7 | 8 | class QtDockWidgetTitleBar : 9 | public QWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit QtDockWidgetTitleBar(QWidget *parent = 0, Qt::WindowFlags f = 0); 14 | ~QtDockWidgetTitleBar(); 15 | public slots: 16 | void closeWidget(); 17 | void autoHide(); 18 | void undock(); 19 | private slots: 20 | void updateButtons(bool autoHide); 21 | void clicked(int button); 22 | void changeFeatures(QDockWidget::DockWidgetFeatures features); 23 | 24 | protected: 25 | void paintEvent(QPaintEvent *); 26 | 27 | private: 28 | Q_DISABLE_COPY(QtDockWidgetTitleBar) 29 | Q_DECLARE_PRIVATE(QtDockWidgetTitleBar) 30 | QtDockWidgetTitleBarPrivate *d_ptr; 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/mainwindow/qtmainwindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | class QContextMenuEvent; 8 | class QtDockWidget; 9 | class QMenu; 10 | 11 | class QtMainWindowPrivate; 12 | 13 | class QTWIDGETSEXTRA_EXPORT QtMainWindow : 14 | public QMainWindow 15 | { 16 | Q_OBJECT 17 | public: 18 | explicit QtMainWindow(QWidget *parent = 0, Qt::WindowFlags f = 0); 19 | ~QtMainWindow(); 20 | 21 | void addDockWidget(Qt::DockWidgetArea area, QtDockWidget * dockwidget); 22 | void addDockWidget(Qt::DockWidgetArea area, QtDockWidget * dockwidget, Qt::Orientation orientation); 23 | 24 | private slots: 25 | void changeDockLocation(Qt::DockWidgetArea area); 26 | void changeDockState(bool on); 27 | void focusChanged(QWidget * old, QWidget * now ); 28 | 29 | protected: 30 | virtual QMenu *createContextMenu(); 31 | void contextMenuEvent(QContextMenuEvent *e); 32 | 33 | QByteArray saveDockState() const; 34 | void restoreDockState(const QByteArray& bytes); 35 | 36 | private: 37 | QT_PIMPL(QtMainWindow) 38 | }; 39 | 40 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/mainwindow/qtwindowmanager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | class QMainWindow; 7 | 8 | class QListWidgetItem; 9 | 10 | class QtWindowManagerPrivate; 11 | class QTWIDGETSEXTRA_EXPORT QtWindowManager : 12 | public QFrame 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | QtWindowManager(QWidget* parent = 0, Qt::WindowFlags flags = Qt::ToolTip); 18 | ~QtWindowManager(); 19 | 20 | void setMainWindow(QMainWindow* w); 21 | QMainWindow* mainWindow() const; 22 | 23 | void setHighlightEnabled(bool on); 24 | bool isHighlightEnaled() const; 25 | 26 | protected: 27 | void paintEvent(QPaintEvent* e); 28 | void showEvent(QShowEvent* e); 29 | void hideEvent(QHideEvent* e); 30 | bool eventFilter(QObject* object, QEvent* e); 31 | 32 | private: 33 | bool filterKeyEvent(QObject* object, QKeyEvent* e); 34 | bool execAction(int key); 35 | 36 | private slots: 37 | void itemClicked(QListWidgetItem*); 38 | 39 | private: 40 | Q_DISABLE_COPY(QtWindowManager) 41 | Q_DECLARE_PRIVATE(QtWindowManager) 42 | QtWindowManagerPrivate* d_ptr; 43 | }; 44 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/painting/qtcolorutils.cpp: -------------------------------------------------------------------------------- 1 | #include "qtcolorutils.h" 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | 8 | QString standardColorName(const QColor &color) 9 | { 10 | static QHash colorNames; 11 | if (colorNames.isEmpty()) { 12 | QColor c; 13 | QStringList names = QColor::colorNames(); 14 | for (auto it = names.begin(); it != names.end(); ++it) { 15 | c.setNamedColor(*it); 16 | colorNames[c] = *it; 17 | } 18 | } 19 | auto it = colorNames.find(color) ; 20 | return (it == colorNames.end() ? color.name() : *it); 21 | } 22 | 23 | QPixmap colorPixmap(const QColor& color, const QSize& size) 24 | { 25 | QPixmap pixmap(size); 26 | if (QPixmapCache::find("_qt_cached_" + color.name(), &pixmap)) { 27 | return pixmap; 28 | } 29 | pixmap.fill(Qt::transparent); 30 | 31 | QPainter painter(&pixmap); 32 | painter.setPen(Qt::NoPen); 33 | painter.setBrush(color); 34 | painter.drawRoundRect(pixmap.rect().adjusted(1, 1, -1, -1), 4, 4); 35 | return pixmap; 36 | } 37 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/painting/qtcolorutils.h: -------------------------------------------------------------------------------- 1 | #ifndef QTCOLORUTILS_H 2 | #define QTCOLORUTILS_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | inline uint qHash(const QColor& c) { 11 | return c.rgba(); 12 | } 13 | 14 | QTWIDGETSEXTRA_EXPORT QString standardColorName(const QColor &color); 15 | QTWIDGETSEXTRA_EXPORT QPixmap colorPixmap(const QColor& color, const QSize &size); 16 | 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/qtwidgetsextra.h: -------------------------------------------------------------------------------- 1 | #ifndef QTWIDGETSEXTRA_H 2 | #define QTWIDGETSEXTRA_H 3 | 4 | #include 5 | #include 6 | 7 | #ifndef Q_NO_IMPL 8 | # define Q_NO_IMPL(x) qWarning("(%s:%d) %s:%s is not yet implemented", __FILE__, __LINE__, Q_FUNC_INFO, #x); 9 | #endif 10 | 11 | #ifndef QT_PIMPL 12 | #define QT_PIMPL(_Class) \ 13 | QScopedPointer d_ptr; \ 14 | Q_DECLARE_PRIVATE(_Class) 15 | #endif 16 | 17 | 18 | #if defined(QTWIDGETSEXTRA_NODLL) 19 | # undef QTWIDGETSEXTRA_MAKEDLL 20 | # undef QTWIDGETSEXTRA_DLL 21 | #elif defined(QTWIDGETSEXTRA_MAKEDLL) /* create a DLL library */ 22 | # if defined(QTWIDGETSEXTRA_DLL) 23 | # undef QTWIDGETSEXTRA_DLL 24 | # endif 25 | # if defined(QTWIDGETSEXTRA_BUILD_LIB) 26 | # define QTWIDGETSEXTRA_EXPORT Q_DECL_EXPORT 27 | # else 28 | # define QTWIDGETSEXTRA_EXPORT Q_DECL_IMPORT 29 | # endif 30 | #elif defined(QTWIDGETSEXTRA_DLL) /* use a DLL library */ 31 | # define QTWIDGETSEXTRA_EXPORT Q_DECL_IMPORT 32 | #endif 33 | 34 | #endif 35 | 36 | 37 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtaboutdialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class QJsonDocument; 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtAboutDialog : 8 | public QDialog 9 | { 10 | Q_OBJECT 11 | Q_DISABLE_COPY(QtAboutDialog) 12 | public: 13 | explicit QtAboutDialog(QWidget *parent = Q_NULLPTR); 14 | explicit QtAboutDialog(const QJsonDocument& json, QWidget *parent = Q_NULLPTR); 15 | ~QtAboutDialog(); 16 | 17 | void setJson(const QJsonDocument& document); 18 | void setJson(const QJsonObject& json); 19 | void setAboutText(const QString& text); 20 | void setVersionInfo(const QString& version); 21 | void setCopyrightText(const QString& text); 22 | void setLicenseText(const QString& text); 23 | void setLicenseFile(const QString& fileName); 24 | void setImage(const QPixmap& pixmap); 25 | 26 | private: 27 | QT_PIMPL(QtAboutDialog) 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtbuttonlocker.h: -------------------------------------------------------------------------------- 1 | #ifndef QTBUTTONLOCKER_H 2 | #define QTBUTTONLOCKER_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | class QAbstractButton; 10 | 11 | class QTWIDGETSEXTRA_EXPORT QtButtonLocker : public QObject 12 | { 13 | Q_OBJECT 14 | public: 15 | explicit QtButtonLocker(QObject *parent = Q_NULLPTR); 16 | ~QtButtonLocker(); 17 | 18 | void setIcon(const QIcon& icon); 19 | QIcon icon() const; 20 | 21 | // QObject interface 22 | public: 23 | bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; 24 | 25 | protected: 26 | virtual void lock(QAbstractButton* button); 27 | virtual void unlock(QAbstractButton* button); 28 | 29 | private: 30 | QT_PIMPL(QtButtonLocker) 31 | }; 32 | 33 | #endif // QTBUTTONLOCKER_H 34 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtcolorbutton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | typedef QVector QtColorSet; 8 | 9 | class QTWIDGETSEXTRA_EXPORT QtColorButton : 10 | public QToolButton 11 | { 12 | Q_OBJECT 13 | Q_PROPERTY(QColor color READ color WRITE setColor USER true) 14 | Q_PROPERTY(PopupStyle popupStyle READ popupStyle WRITE setPopupStyle NOTIFY popupStyleChanged) 15 | 16 | Q_DISABLE_COPY(QtColorButton) 17 | public: 18 | 19 | enum PopupStyle 20 | { 21 | GridPopup, 22 | ListPopup 23 | }; 24 | Q_ENUM(PopupStyle) 25 | 26 | explicit QtColorButton(QWidget* parent = Q_NULLPTR); 27 | explicit QtColorButton(const QStringList& colorNames, QWidget* parent = Q_NULLPTR); 28 | explicit QtColorButton(const QtColorSet& colorSet, QWidget* parent = Q_NULLPTR); 29 | 30 | ~QtColorButton(); 31 | 32 | QColor color() const; 33 | 34 | void setColors(const QtColorSet& colorSet); 35 | QtColorSet colors() const; 36 | 37 | void setGridWidth(int width); 38 | int gridWidth() const; 39 | 40 | PopupStyle popupStyle() const; 41 | 42 | void updateMenu(); 43 | 44 | public Q_SLOTS: 45 | void setColor(const QColor& c); 46 | void setPopupStyle(PopupStyle style); 47 | 48 | private Q_SLOTS: 49 | void colorSelected(); 50 | void pickColor(); 51 | 52 | Q_SIGNALS: 53 | void colorChanged(const QColor& c); 54 | void popupStyleChanged(PopupStyle); 55 | 56 | private: 57 | QT_PIMPL(QtColorButton) 58 | }; 59 | 60 | 61 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtcolorgrid.h: -------------------------------------------------------------------------------- 1 | #ifndef QTCOLORGRID_H 2 | #define QTCOLORGRID_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | 12 | class QtColorPalette; 13 | 14 | class QtColorGrid : 15 | public QListView 16 | { 17 | Q_OBJECT 18 | public: 19 | explicit QtColorGrid(QWidget *parent = Q_NULLPTR); 20 | ~QtColorGrid(); 21 | 22 | void setColors(const QVector& colors); 23 | void setColors(const QList &colors); 24 | void setColors(const QtColorPalette &palette); 25 | const QtColorPalette& colors() const; 26 | 27 | QColor currentColor() const; 28 | 29 | public Q_SLOTS: 30 | void clear(); 31 | 32 | // QAbstractItemView interface 33 | protected Q_SLOTS: 34 | void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) Q_DECL_OVERRIDE; 35 | 36 | private Q_SLOTS: 37 | void resizeIcons(const QSize& size); 38 | 39 | Q_SIGNALS: 40 | void colorsChanged(); 41 | void colorChanged(const QColor& c); 42 | 43 | // QWidget interface 44 | protected: 45 | void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; 46 | 47 | private: 48 | void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE; 49 | 50 | private: 51 | QT_PIMPL(QtColorGrid) 52 | }; 53 | 54 | #endif // QTCOLORGRID_H 55 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtcolorgrid_p.h: -------------------------------------------------------------------------------- 1 | #ifndef QTCOLORGRID_P_H 2 | #define QTCOLORGRID_P_H 3 | 4 | #include 5 | #include 6 | #include "../painting/qtcolorpalette.h" 7 | 8 | class QtColorGridModel : 9 | public QAbstractListModel 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit QtColorGridModel(QObject* parent = Q_NULLPTR); 14 | ~QtColorGridModel(); 15 | 16 | void setPalette(const QtColorPalette& palette); 17 | const QtColorPalette& palette(); 18 | 19 | // Basic functionality: 20 | int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; 21 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; 22 | 23 | void clear(); 24 | 25 | private: 26 | QtColorPalette mPalette; 27 | }; 28 | 29 | 30 | class QtColorGridDelegate : 31 | public QStyledItemDelegate 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit QtColorGridDelegate(QObject* parent = Q_NULLPTR); 37 | ~QtColorGridDelegate(); 38 | 39 | // QAbstractItemDelegate interface 40 | public: 41 | void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; 42 | }; 43 | 44 | #endif // QTCOLORGRID_P_H 45 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtcolortriangle.h: -------------------------------------------------------------------------------- 1 | #ifndef QTCOLORTRIANGLE_H 2 | #define QTCOLORTRIANGLE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class QPointF; 9 | struct Vertex; 10 | 11 | class QTWIDGETSEXTRA_EXPORT QtColorTriangle : public QWidget 12 | { 13 | Q_OBJECT 14 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) 15 | 16 | public: 17 | explicit QtColorTriangle(QWidget *parent = Q_NULLPTR); 18 | ~QtColorTriangle(); 19 | 20 | //QSize sizeHint() const; 21 | QSize minimumSizeHint() const Q_DECL_OVERRIDE; 22 | int heightForWidth(int w) const Q_DECL_OVERRIDE; 23 | 24 | void polish(); 25 | QColor color() const; 26 | 27 | Q_SIGNALS: 28 | void colorChanged(const QColor &col); 29 | 30 | public Q_SLOTS: 31 | void setColor(const QColor &col); 32 | 33 | protected: 34 | void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; 35 | void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE; 36 | void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; 37 | void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE; 38 | void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE; 39 | void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE; 40 | 41 | private: 42 | QT_PIMPL(QtColorTriangle) 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtcontentview.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | class QTWIDGETSEXTRA_EXPORT QtContentView : 7 | public QPlainTextEdit 8 | { 9 | Q_OBJECT 10 | Q_DISABLE_COPY(QtContentView) 11 | friend class LineNumberArea; 12 | 13 | public: 14 | explicit QtContentView(QWidget *parent = Q_NULLPTR); 15 | ~QtContentView(void); 16 | 17 | bool lineNumbersShown() const; 18 | 19 | public Q_SLOTS: 20 | void showLineNumbers(bool on); 21 | 22 | private Q_SLOTS: 23 | void updateLineNumberAreaWidth(int newBlockCount); 24 | void updateLineNumberArea(const QRect&, int); 25 | void highlightCurrentLine(); 26 | 27 | protected: 28 | void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; 29 | 30 | private: 31 | void lineNumberAreaPaintEvent(QPaintEvent *event); 32 | int lineNumberAreaWidth(); 33 | QWidget *lineNumberArea; 34 | }; 35 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qteditdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef QTEDITDIALOG_H 2 | #define QTEDITDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | class QItemEditorFactory; 10 | 11 | class QTWIDGETSEXTRA_EXPORT QtEditDialog : 12 | public QDialog 13 | { 14 | Q_OBJECT 15 | Q_DISABLE_COPY(QtEditDialog) 16 | public: 17 | explicit QtEditDialog(QWidget *parent = Q_NULLPTR); 18 | explicit QtEditDialog(QItemEditorFactory* factory, QWidget* parent = Q_NULLPTR); 19 | ~QtEditDialog(); 20 | 21 | template 22 | Q_INLINE_TEMPLATE void registerEditor(const QByteArray& propName) { 23 | this->registerEditor(_UserType, new QItemEditorCreator<_Editor>(propName)); 24 | } 25 | 26 | void registerEditor(int userType, QItemEditorCreatorBase* creator); 27 | 28 | bool isChecked(const QString& objectName) const; 29 | 30 | void insert(const QString& title, const QString& objectName, const QVariant& value, bool checkable = false); 31 | 32 | QVariantHash values() const; 33 | QVariant value(const QString &id) const; 34 | 35 | Q_SIGNALS: 36 | void valueChanged(const QString& id, const QVariant& value); 37 | 38 | private Q_SLOTS: 39 | void editorValueChanged(); 40 | 41 | private: 42 | QT_PIMPL(QtEditDialog) 43 | }; 44 | 45 | 46 | #endif // QTEDITDIALOG_H 47 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qthsvradialpicker.h: -------------------------------------------------------------------------------- 1 | #ifndef QTHSVRADIALPICKER_H 2 | #define QTHSVRADIALPICKER_H 3 | 4 | #include 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtHsvRadialPicker : 8 | public QWidget 9 | { 10 | Q_OBJECT 11 | Q_PROPERTY(int value READ value WRITE setValue) 12 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) 13 | Q_DISABLE_COPY(QtHsvRadialPicker) 14 | 15 | public: 16 | explicit QtHsvRadialPicker(QWidget *parent = Q_NULLPTR); 17 | ~QtHsvRadialPicker(); 18 | 19 | int value() const; 20 | 21 | QSize minimumSizeHint() const Q_DECL_OVERRIDE; 22 | 23 | const QColor color() const; 24 | 25 | public Q_SLOTS: 26 | void setValue(int v); 27 | void setColor(const QColor &c); 28 | 29 | Q_SIGNALS: 30 | void valueChanged(int); 31 | void colorChanged(QColor); 32 | 33 | // QWidget interface 34 | protected: 35 | void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE; 36 | void showEvent(QShowEvent *e) Q_DECL_OVERRIDE; 37 | void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE; 38 | void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; 39 | void mouseMoveEvent(QMouseEvent *me) Q_DECL_OVERRIDE; 40 | void changeEvent(QEvent *ce) Q_DECL_OVERRIDE; 41 | 42 | protected: 43 | virtual void drawCrosshair(QPainter *painter, const QPoint &pt); 44 | 45 | private: 46 | QT_PIMPL(QtHsvRadialPicker) 47 | 48 | 49 | }; 50 | 51 | #endif // QTHSVRADIALPICKER_H 52 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtnotificationbar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtNotificationBar : 8 | public QFrame 9 | { 10 | Q_OBJECT 11 | Q_DISABLE_COPY(QtNotificationBar) 12 | public: 13 | explicit QtNotificationBar(QWidget *parent = Q_NULLPTR); 14 | ~QtNotificationBar(); 15 | 16 | bool isAnimated() const; 17 | 18 | public Q_SLOTS: 19 | void setAnimated(bool on = true); 20 | void showMessage(const QString& text, const QIcon& icon = QIcon(), bool closeable = true); 21 | void clearMessage(); 22 | 23 | private: 24 | void animate(); 25 | 26 | private: 27 | QT_PIMPL(QtNotificationBar) 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtoptionswidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | class QWidget; 7 | class QListWidgetItem; 8 | 9 | 10 | class QTWIDGETSEXTRA_EXPORT QtOptionsWidget : 11 | public QWidget 12 | { 13 | Q_OBJECT 14 | Q_DISABLE_COPY(QtOptionsWidget) 15 | public: 16 | explicit QtOptionsWidget(QWidget *parent = Q_NULLPTR); 17 | ~QtOptionsWidget(); 18 | 19 | int addWidget ( QWidget * widget ); 20 | int count () const; 21 | int currentIndex () const; 22 | QWidget * currentWidget () const; 23 | int indexOf ( QWidget * widget ) const; 24 | QWidget * widget ( int index ) const; 25 | 26 | public Q_SLOTS: 27 | void setCurrentIndex ( int index ); 28 | void setCurrentWidget ( QWidget * widget ); 29 | 30 | private Q_SLOTS: 31 | void changePage(QListWidgetItem *current, 32 | QListWidgetItem *previous); 33 | 34 | Q_SIGNALS: 35 | void currentChanged ( int index ); 36 | void widgetRemoved ( int index ); 37 | 38 | private: 39 | QT_PIMPL(QtOptionsWidget) 40 | }; 41 | 42 | 43 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtpatternedit.h: -------------------------------------------------------------------------------- 1 | #ifndef QTPATTERNEDIT_H 2 | #define QTPATTERNEDIT_H 3 | 4 | #include 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtPatternEdit : 8 | public QLineEdit 9 | { 10 | Q_OBJECT 11 | Q_PROPERTY(Options options READ options WRITE setOptions NOTIFY optionsChanged) 12 | 13 | public: 14 | enum Option 15 | { 16 | NoOption = 0x00, 17 | CaseSensitive = 0x01, 18 | WholeWords = 0x02, 19 | RegularExpr = 0x04 20 | }; 21 | Q_DECLARE_FLAGS(Options, Option) 22 | 23 | explicit QtPatternEdit(QWidget *parent = Q_NULLPTR); 24 | QtPatternEdit(const QString &pattern, QWidget *parent = Q_NULLPTR); 25 | ~QtPatternEdit(); 26 | 27 | void setOptions(Options opts); 28 | Options options() const; 29 | 30 | private Q_SLOTS: 31 | void showOptions(); 32 | void toggleOption(bool on); 33 | 34 | Q_SIGNALS: 35 | void optionsChanged(Options); 36 | 37 | private: 38 | QT_PIMPL(QtPatternEdit) 39 | }; 40 | 41 | Q_DECLARE_OPERATORS_FOR_FLAGS(QtPatternEdit::Options) 42 | 43 | #endif // QTPATTERNEDIT_H 44 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtprogresseffect.h: -------------------------------------------------------------------------------- 1 | #ifndef QTPROGRESSEFFECT_H 2 | #define QTPROGRESSEFFECT_H 3 | 4 | #include 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtProgressEffect : 8 | public QGraphicsEffect 9 | { 10 | Q_OBJECT 11 | Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) 12 | Q_PROPERTY(int minimum READ minimum WRITE setMinimum) 13 | Q_PROPERTY(int maximum READ maximum WRITE setMaximum) 14 | Q_PROPERTY(int progress READ progress WRITE setProgress) 15 | Q_PROPERTY(QString labelText READ labelText WRITE setLabelText) 16 | 17 | public: 18 | explicit QtProgressEffect(QObject* parent = Q_NULLPTR); 19 | QtProgressEffect(QWidget* widget, QObject* parent = Q_NULLPTR); 20 | ~QtProgressEffect(); 21 | 22 | qreal opacity() const; 23 | int minimum() const; 24 | int maximum() const; 25 | int progress() const; 26 | QString labelText() const; 27 | 28 | 29 | public Q_SLOTS: 30 | void setOpacity(qreal opacity); 31 | void setMinimum(int minimum); 32 | void setMaximum(int maximum); 33 | void setRange(int minimum, int maximum); 34 | void setLabelText(const QString& text); 35 | void setProgress(int value); 36 | 37 | Q_SIGNALS: 38 | void opacityChanged(qreal); 39 | 40 | // QGraphicsEffect interface 41 | protected: 42 | void draw(QPainter *painter) Q_DECL_OVERRIDE; 43 | 44 | // QObject interface 45 | protected: 46 | void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; 47 | 48 | private: 49 | QT_PIMPL(QtProgressEffect) 50 | }; 51 | 52 | 53 | #endif // QTPROGRESSEFFECT_H 54 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtshortcutedit.h: -------------------------------------------------------------------------------- 1 | #ifndef QTSHORTCUTEDIT_H 2 | #define QTSHORTCUTEDIT_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | class QEvent; 10 | class QLineEdit; 11 | 12 | class QTWIDGETSEXTRA_EXPORT QtShortcutEdit : 13 | public QWidget 14 | { 15 | Q_OBJECT 16 | Q_PROPERTY(QKeySequence shortcut READ keySequence WRITE setKeySequence) 17 | Q_DISABLE_COPY(QtShortcutEdit) 18 | 19 | public: 20 | explicit QtShortcutEdit(QWidget *parent = Q_NULLPTR); 21 | 22 | QKeySequence keySequence() const; 23 | 24 | public Q_SLOTS: 25 | void setKeySequence(const QKeySequence &sequence); 26 | 27 | Q_SIGNALS: 28 | void keySequenceChanged(const QKeySequence &sequence); 29 | 30 | protected: 31 | bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; 32 | void focusInEvent(QFocusEvent *e) Q_DECL_OVERRIDE; 33 | void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE; 34 | void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE; 35 | void keyReleaseEvent(QKeyEvent *e) Q_DECL_OVERRIDE; 36 | void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; 37 | bool event(QEvent *e) Q_DECL_OVERRIDE; 38 | 39 | private Q_SLOTS: 40 | void slotClearShortcut(); 41 | 42 | private: 43 | void handleKeyEvent(QKeyEvent *e); 44 | int translateModifiers(Qt::KeyboardModifiers state, const QString &text) const; 45 | 46 | private: 47 | int m_num; 48 | QKeySequence m_keySequence; 49 | QLineEdit *m_lineEdit; 50 | }; 51 | 52 | #endif // QTSHORTCUTEDIT_H 53 | 54 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtslidebutton.h: -------------------------------------------------------------------------------- 1 | #ifndef QTSLIDEBUTTON_H 2 | #define QTSLIDEBUTTON_H 3 | 4 | #include 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtSlideButton : 8 | public QAbstractButton 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit QtSlideButton(QWidget *parent = Q_NULLPTR); 13 | ~QtSlideButton(); 14 | 15 | QSize sizeHint() const Q_DECL_OVERRIDE; 16 | 17 | protected: 18 | bool hitButton(const QPoint& p) const Q_DECL_OVERRIDE; 19 | void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; 20 | void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; 21 | 22 | private: 23 | QT_PIMPL(QtSlideButton) 24 | }; 25 | 26 | #endif // QTSLIDEBUTTON_H 27 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtslidebutton_p.h: -------------------------------------------------------------------------------- 1 | #include "qtslidebutton.h" 2 | #include 3 | 4 | class QPainter; 5 | class QPropertyAnimation; 6 | 7 | 8 | class QtSlideButtonPrivate : 9 | public QObject 10 | { 11 | Q_OBJECT 12 | Q_PROPERTY(qreal position READ position WRITE setPosition) 13 | public: 14 | QtSlideButtonPrivate(QtSlideButton* q); 15 | ~QtSlideButtonPrivate(); 16 | 17 | qreal position() const; 18 | 19 | void drawSlider(QPainter *painter); 20 | void updateSliderRect(const QSize& size); 21 | 22 | public slots: 23 | void animate(bool); 24 | void setPosition(qreal value); 25 | 26 | private: 27 | QtSlideButton *q_ptr; 28 | qreal pos; 29 | QRectF sliderShape; 30 | QLinearGradient gradient; 31 | 32 | public: 33 | QPropertyAnimation *animation; 34 | }; 35 | 36 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtslidecheckbox.h: -------------------------------------------------------------------------------- 1 | #ifndef QTSLIDECHECKBOX_H 2 | #define QTSLIDECHECKBOX_H 3 | 4 | #include 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtSlideCheckBox : 8 | public QCheckBox 9 | { 10 | Q_OBJECT 11 | Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged) 12 | Q_PROPERTY(int duration READ duration WRITE setDuration) 13 | public: 14 | explicit QtSlideCheckBox(QWidget* parent = Q_NULLPTR); 15 | explicit QtSlideCheckBox(Qt::Orientation orientation, QWidget* parent = Q_NULLPTR); 16 | ~QtSlideCheckBox(); 17 | 18 | void setSpacing(int m); 19 | int spacing() const; 20 | 21 | void setAnimated(bool on); 22 | bool isAnimated() const; 23 | 24 | void setDuration(int msec); 25 | int duration() const; 26 | 27 | void setOrientation(Qt::Orientation orientation); 28 | Qt::Orientation orientation() const; 29 | 30 | QSize minimumSizeHint() const Q_DECL_OVERRIDE; 31 | 32 | Q_SIGNALS: 33 | void orientationChanged(Qt::Orientation); 34 | 35 | // QWidget interface 36 | protected: 37 | void resizeEvent(QResizeEvent* e) Q_DECL_OVERRIDE; 38 | void paintEvent(QPaintEvent * e) Q_DECL_OVERRIDE; 39 | 40 | // QAbstractButton interface 41 | protected: 42 | bool hitButton(const QPoint &pos) const Q_DECL_OVERRIDE; 43 | void nextCheckState() Q_DECL_OVERRIDE; 44 | 45 | private Q_SLOTS: 46 | void animate(qreal value); 47 | 48 | private: 49 | QT_PIMPL(QtSlideCheckBox) 50 | }; 51 | 52 | 53 | #endif // QTSLIDECHECKBOX_H 54 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtsnackbar.cpp: -------------------------------------------------------------------------------- 1 | #include "qtsnackbar.h" 2 | 3 | QtSnackBarWidget::QtSnackBarWidget(QWidget *parent) : QWidget(parent) 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtsnackbar.h: -------------------------------------------------------------------------------- 1 | #ifndef QTSNACKBAR_H 2 | #define QTSNACKBAR_H 3 | 4 | #include 5 | 6 | class QtSnackBarWidget : public QWidget 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit QtSnackBarWidget(QWidget *parent = nullptr); 11 | 12 | signals: 13 | 14 | public slots: 15 | }; 16 | 17 | #endif // QTSNACKBAR_H 18 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtspinboxedit.h: -------------------------------------------------------------------------------- 1 | #ifndef QTSPINBOXEDIT_H 2 | #define QTSPINBOXEDIT_H 3 | 4 | #include 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtSpinBoxEdit : public QSpinBox 8 | { 9 | Q_OBJECT 10 | public: 11 | explicit QtSpinBoxEdit(QWidget* parent = Q_NULLPTR); 12 | ~QtSpinBoxEdit(); 13 | 14 | public Q_SLOTS: 15 | virtual void showEditor(); 16 | 17 | private: 18 | QT_PIMPL(QtSpinBoxEdit) 19 | }; 20 | 21 | #endif // QTSPINBOXEDIT_H 22 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qtsyntaxhighlighter.h: -------------------------------------------------------------------------------- 1 | #ifndef QTSYNTAXHIGHLIGHTER_H 2 | #define QTSYNTAXHIGHLIGHTER_H 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | class QTWIDGETSEXTRA_EXPORT QtSyntaxHighlighter : 10 | public QSyntaxHighlighter 11 | { 12 | Q_OBJECT 13 | Q_DISABLE_COPY(QtSyntaxHighlighter) 14 | public: 15 | explicit QtSyntaxHighlighter(QObject* parent = Q_NULLPTR); 16 | explicit QtSyntaxHighlighter(QTextDocument *parent); 17 | ~QtSyntaxHighlighter(); 18 | 19 | void load(const QJsonObject& json); 20 | void load(const QJsonDocument& json); 21 | void load(QIODevice *device, QJsonParseError* error = Q_NULLPTR); 22 | void load(const QByteArray& bytes, QJsonParseError* error = Q_NULLPTR); 23 | 24 | QString syntax() const; 25 | 26 | // QSyntaxHighlighter interface 27 | protected: 28 | void highlightBlock(const QString &text) Q_DECL_OVERRIDE; 29 | 30 | private: 31 | QT_PIMPL(QtSyntaxHighlighter) 32 | }; 33 | 34 | #endif // QTSYNTAXHIGHLIGHTER_H 35 | -------------------------------------------------------------------------------- /qtwidgetsextra/src/widgets/qttextspinbox.h: -------------------------------------------------------------------------------- 1 | #ifndef QTTEXTSPINBOX_H 2 | #define QTTEXTSPINBOX_H 3 | 4 | #include 5 | #include 6 | 7 | class QTWIDGETSEXTRA_EXPORT QtTextSpinBox : 8 | public QSpinBox 9 | { 10 | Q_OBJECT 11 | Q_PROPERTY(QStringList list READ list WRITE setList) 12 | 13 | public: 14 | explicit QtTextSpinBox(QWidget* parent = Q_NULLPTR); 15 | QtTextSpinBox(const QStringList &list, QWidget *parent = Q_NULLPTR); 16 | ~QtTextSpinBox(); 17 | 18 | QValidator::State validate(QString& input, int& pos ) const Q_DECL_OVERRIDE; 19 | 20 | public Q_SLOTS: 21 | virtual void setList(const QStringList &s); 22 | const QStringList &list() const; 23 | 24 | Q_SIGNALS: 25 | void listChanged(const QStringList &); 26 | 27 | protected: 28 | virtual QString textFromValue(int value) const; 29 | virtual int valueFromText(const QString & text) const; 30 | 31 | private: 32 | QT_PIMPL(QtTextSpinBox) 33 | }; 34 | 35 | #endif // QTTEXTSPINBOX_H 36 | --------------------------------------------------------------------------------