├── .clang-format ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── UiPreview.assets ├── 165294264943820225191524305.gif ├── 165294336692220225191522254.gif ├── 165294410414120225191518431.gif ├── 165294524356320225191528126.gif ├── 165294551010920225191532407.gif ├── 16529476089682022519167348.gif ├── 165294782053120225191610569.gif ├── 16698569751572022121911412.gif ├── QQ20231110-163619-HD202311101638541.gif ├── QQ录屏2023052616574620235261658311.gif ├── image-20220519144218268.png ├── image-20220519145002696.png ├── image-20220519153100472.png ├── image-20220519153539266.png ├── image-20220519153556457.png ├── image-20220519153609328.png ├── image-20220519153617953.png ├── image-20220519153626148.png ├── image-20220519153749963.png ├── image-20220519153904665.png ├── image-20220519154416408.png ├── image-20220519154531989.png ├── image-20220519154603715.png ├── image-20220519154616413.png ├── image-20220519155120304.png ├── image-20220519155131669.png ├── image-20220519155138884.png ├── image-20220519155150157.png ├── image-20220519160009386.png ├── image-20220519160512835.png ├── image-20220519161302386.png ├── image-20240621150955630.png ├── image-20240801154148218.png ├── image-20240801154356539.png └── image-20241104100818611.png ├── UiPreview.md ├── cmake ├── Common.cmake ├── Example.cmake ├── ExportHelper.cmake ├── QCustomUi.rc.in ├── QCustomUiConfig.cmake.in ├── Tests.cmake └── Version.h.in ├── doc ├── images │ ├── QCtmClassifyTreeViewDetail.png │ ├── QCtmDrawerWidgetDetail.png │ ├── QCtmEditLabelDetail.png │ ├── QCtmIPAddressEditDetail.png │ ├── QCtmMessageBoxDetail.png │ ├── QCtmMultiComboBoxDetail.png │ ├── QCtmNavigationBarDetail.png │ ├── QCtmNavigationPaneDetail.png │ ├── QCtmStageProgressBarDetail.png │ ├── QCtmTitleBarDetail.png │ ├── arrow_bc.png │ ├── bgrContent.png │ ├── btn_next.png │ ├── btn_prev.png │ ├── bullet_dn.png │ ├── bullet_sq.png │ ├── home.png │ ├── ico_out.png │ └── logo.png ├── index.html ├── qctmabstractlogmodel-members.html ├── qctmabstractlogmodel.html ├── qctmabstractmessagetipdata-members.html ├── qctmabstractmessagetipdata.html ├── qctmabstractmessagetipmodel-members.html ├── qctmabstractmessagetipmodel.html ├── qctmabstractmessagetipview-members.html ├── qctmabstractmessagetipview.html ├── qctmabstractmultipageitemmodel-members.html ├── qctmabstractmultipageitemmodel.html ├── qctmabstractmultipagetablemodel-members.html ├── qctmabstractmultipagetablemodel.html ├── qctmapplication-members.html ├── qctmapplication.html ├── qctmcircleprogressbar-members.html ├── qctmcircleprogressbar.html ├── qctmclassifytreegroupitem-members.html ├── qctmclassifytreegroupitem.html ├── qctmclassifytreeiconitem-members.html ├── qctmclassifytreeiconitem.html ├── qctmclassifytreeitem-members.html ├── qctmclassifytreeitem.html ├── qctmclassifytreemodel-members.html ├── qctmclassifytreemodel.html ├── qctmclassifytreeview-members.html ├── qctmclassifytreeview.html ├── qctmcolor-members.html ├── qctmcolor.html ├── qctmcombobox-members.html ├── qctmcombobox.html ├── qctmdialog-members.html ├── qctmdialog.html ├── qctmdigitkeyboard-members.html ├── qctmdigitkeyboard.html ├── qctmdraweritemwidget-members.html ├── qctmdraweritemwidget.html ├── qctmdrawerwidget-members.html ├── qctmdrawerwidget.html ├── qctmeditlabel-members.html ├── qctmeditlabel.html ├── qctmfile-members.html ├── qctmfile.html ├── qctmheaderview-members.html ├── qctmheaderview.html ├── qctmhexlineedit-members.html ├── qctmhexlineedit.html ├── qctminputdialog-members.html ├── qctminputdialog.html ├── qctmipaddressedit-members.html ├── qctmipaddressedit.html ├── qctmloadingdialog-members.html ├── qctmloadingdialog.html ├── qctmlogdata-members.html ├── qctmlogdata.html ├── qctmlogevent-members.html ├── qctmlogevent.html ├── qctmlogfiltermodel-members.html ├── qctmlogfiltermodel.html ├── qctmlogmanager-members.html ├── qctmlogmanager.html ├── qctmlogmodel-members.html ├── qctmlogmodel.html ├── qctmlogwidget-members.html ├── qctmlogwidget.html ├── qctmlonglongspinbox-members.html ├── qctmlonglongspinbox.html ├── qctmmessagebox-members.html ├── qctmmessagebox.html ├── qctmmessagetipbutton-members.html ├── qctmmessagetipbutton.html ├── qctmmessagetipdata-members.html ├── qctmmessagetipdata.html ├── qctmmessagetipmodel-members.html ├── qctmmessagetipmodel.html ├── qctmmessagetipview-members.html ├── qctmmessagetipview.html ├── qctmmulticombobox-members.html ├── qctmmulticombobox.html ├── qctmmultipagebuttonbox-members.html ├── qctmmultipagebuttonbox.html ├── qctmmultipagestringlistmodel-members.html ├── qctmmultipagestringlistmodel.html ├── qctmnavigationbar-members.html ├── qctmnavigationbar.html ├── qctmnavigationsidebar-members.html ├── qctmnavigationsidebar.html ├── qctmnavigationsidepane-members.html ├── qctmnavigationsidepane.html ├── qctmpathbrowser-members.html ├── qctmpathbrowser.html ├── qctmrangeslider-members.html ├── qctmrangeslider.html ├── qctmrecentdata-members.html ├── qctmrecentdata.html ├── qctmrecentmodel-members.html ├── qctmrecentmodel.html ├── qctmrecentview-members.html ├── qctmrecentview.html ├── qctmrecentviewdelegate-members.html ├── qctmrecentviewdelegate.html ├── qctmselectionbuttonbox-members.html ├── qctmselectionbuttonbox.html ├── qctmserialportcombobox-members.html ├── qctmserialportcombobox.html ├── qctmsignalblocker-members.html ├── qctmsignalblocker.html ├── qctmstageprogressbar-members.html ├── qctmstageprogressbar.html ├── qctmstylesheet-members.html ├── qctmstylesheet.html ├── qctmswitchbutton-members.html ├── qctmswitchbutton.html ├── qctmtableitemdelegate-members.html ├── qctmtableitemdelegate.html ├── qctmtableview-members.html ├── qctmtableview.html ├── qctmtabpage-members.html ├── qctmtabpage.html ├── qctmtabwidget-members.html ├── qctmtabwidget.html ├── qctmtitlebar-members.html ├── qctmtitlebar.html ├── qctmtoolbox-members.html ├── qctmtoolbox.html ├── qctmulonglongspinbox-members.html ├── qctmulonglongspinbox.html ├── qctmwindow-members.html ├── qctmwindow.html ├── qcustomui-module.html ├── qcustomui.index ├── qcustomui.qch ├── qcustomui.qhp ├── search-results.html └── style │ ├── offline-dark.css │ ├── offline-simple.css │ └── offline.css └── src ├── CMakeLists.txt ├── Designer ├── CMakeLists.txt ├── CircleProgressBar.cpp ├── CircleProgressBar.h ├── ClassifyTreeView.cpp ├── ClassifyTreeView.h ├── ComboBox.cpp ├── ComboBox.h ├── EditLabel.cpp ├── EditLabel.h ├── HexLineEdit.cpp ├── HexLineEdit.h ├── IPAddressEdit.cpp ├── IPAddressEdit.h ├── LongLongSpinBox.cpp ├── LongLongSpinBox.h ├── MultiComboBox.cpp ├── MultiComboBox.h ├── MultiPageButtonBox.cpp ├── MultiPageButtonBox.h ├── QCustomUiWidgets.cpp ├── QCustomUiWidgets.h ├── RecentView.cpp ├── RecentView.h ├── SelectionButtonBox.cpp ├── SelectionButtonBox.h ├── SerialPortComboBox.cpp ├── SerialPortComboBox.h ├── StageProgressBar.cpp ├── StageProgressBar.h ├── SwitchButton.cpp ├── SwitchButton.h ├── TableView.cpp ├── TableView.h ├── ULongLongSpinBox.cpp └── ULongLongSpinBox.h ├── Examples ├── CMakeLists.txt ├── CircleProgressBarExample │ ├── CMakeLists.txt │ ├── CircleProgressBarExample.cpp │ ├── CircleProgressBarExample.h │ └── main.cpp ├── ClassifyTreeViewExample │ ├── CMakeLists.txt │ ├── ClassifyTreeViewExample.cpp │ ├── ClassifyTreeViewExample.h │ ├── ClassifyTreeViewExample.qrc │ ├── main.cpp │ └── resources │ │ ├── bus-color.svg │ │ └── list.svg ├── DigitKeyboardExample │ ├── CMakeLists.txt │ ├── DigitKeyboardExample.cpp │ ├── DigitKeyboardExample.h │ └── main.cpp ├── DrawerExample │ ├── CMakeLists.txt │ ├── DrawerExample.cpp │ ├── DrawerExample.h │ ├── DrawerExample.qrc │ ├── Resources │ │ └── Edit.svg │ └── main.cpp ├── EditLabelExample │ ├── CMakeLists.txt │ ├── EditLabelExample.cpp │ ├── EditLabelExample.h │ ├── EditLabelExample.qrc │ ├── EditLabelExample.ui │ └── main.cpp ├── HexLineEditExample │ ├── CMakeLists.txt │ ├── HexLineEditExample.cpp │ ├── HexLineEditExample.h │ └── main.cpp ├── IPAddressEditExample │ ├── CMakeLists.txt │ ├── IPAddressEditExample.cpp │ ├── IPAddressEditExample.h │ ├── IPAddressEditExample.qrc │ ├── IPAddressEditExample.ui │ └── main.cpp ├── InputDialogExample │ ├── CMakeLists.txt │ ├── InputDialogExample.cpp │ ├── InputDialogExample.h │ ├── InputDialogExample.ui │ └── main.cpp ├── LoadingExample │ ├── CMakeLists.txt │ ├── LoadingExample.cpp │ ├── LoadingExample.h │ ├── LoadingExample.qrc │ └── main.cpp ├── LogExample │ ├── CMakeLists.txt │ ├── LogExample.cpp │ ├── LogExample.h │ └── main.cpp ├── LongLongSpinBoxExample │ ├── CMakeLists.txt │ ├── LongLongSpinBoxExample.cpp │ ├── LongLongSpinBoxExample.h │ └── main.cpp ├── MessageBoxExample │ ├── CMakeLists.txt │ ├── MessageBoxExample.cpp │ ├── MessageBoxExample.h │ ├── MessageBoxExample.qrc │ ├── MessageBoxExample.ui │ └── main.cpp ├── MessageTipExample │ ├── CMakeLists.txt │ ├── MessageTipExample.cpp │ ├── MessageTipExample.h │ └── main.cpp ├── MultiComboBoxExample │ ├── CMakeLists.txt │ ├── MultiComboBoxExample.cpp │ ├── MultiComboBoxExample.h │ ├── MultiComboBoxExample.qrc │ └── main.cpp ├── MultiPageViewExample │ ├── CMakeLists.txt │ ├── MultiPageTableModel.cpp │ ├── MultiPageTableModel.h │ ├── MultiPageViewExample.cpp │ ├── MultiPageViewExample.h │ ├── MultiPageViewExample.ui │ └── main.cpp ├── NavigationBarExample │ ├── CMakeLists.txt │ ├── NavigationBarExample.cpp │ ├── NavigationBarExample.h │ ├── NavigationBarExample.qrc │ └── main.cpp ├── NavigationPaneExample │ ├── CMakeLists.txt │ ├── NavigationPane.cpp │ ├── NavigationPane.h │ ├── NavigationPane.qrc │ └── main.cpp ├── PathBrowserExample │ ├── CMakeLists.txt │ ├── PathBrowserExample.cpp │ ├── PathBrowserExample.h │ └── main.cpp ├── RangeSliderExample │ ├── CMakeLists.txt │ ├── RangeSliderExample.cpp │ ├── RangeSliderExample.h │ └── main.cpp ├── RecentViewExample │ ├── CMakeLists.txt │ ├── RecentViewExample.cpp │ ├── RecentViewExample.h │ └── main.cpp ├── SelectionButtonBoxExample │ ├── CMakeLists.txt │ ├── SelectionButtonBoxExample.cpp │ ├── SelectionButtonBoxExample.h │ └── main.cpp ├── SerialPortComboBoxExample │ ├── CMakeLists.txt │ ├── SerialPortComboBoxExample.cpp │ ├── SerialPortComboBoxExample.h │ └── main.cpp ├── StageProgressBarExample │ ├── CMakeLists.txt │ ├── StageProgressBarExample.cpp │ ├── StageProgressBarExample.h │ ├── StageProgressBarExample.qrc │ ├── StageProgressBarExample.ui │ └── main.cpp ├── SwitchButtonExample │ ├── CMakeLists.txt │ ├── SwitchButtonExample.cpp │ ├── SwitchButtonExample.h │ └── main.cpp ├── TitleBarStyleSheetExample │ ├── CMakeLists.txt │ └── main.cpp ├── ToolBoxExample │ ├── CMakeLists.txt │ ├── Resource │ │ ├── NewFolder.svg │ │ └── NewFolderActive.svg │ ├── TestDialog.cpp │ ├── TestDialog.h │ ├── TestDialog.ui │ ├── ToolBoxExample.cpp │ ├── ToolBoxExample.h │ ├── ToolBoxExample.qrc │ ├── ToolBoxExample.ui │ └── main.cpp ├── ULongLongSpinBoxExample │ ├── CMakeLists.txt │ ├── ULongLongSpinBoxExample.cpp │ ├── ULongLongSpinBoxExample.h │ └── main.cpp └── WindowAndDialogExamples │ ├── CMakeLists.txt │ ├── WindowAndDialogExamples.cpp │ ├── WindowAndDialogExamples.h │ ├── WindowAndDialogExamples.qrc │ ├── WindowAndDialogExamples.ui │ └── main.cpp ├── QCustomUi ├── CMakeLists.txt ├── Docs │ ├── QCtmAbstractMessageTipData.qdoc │ ├── QCtmClassifyTreeGroupItem.qdoc │ ├── QCtmClassifyTreeIconItem.qdoc │ ├── QCtmRecentData.qdoc │ └── QCtmSignalBlocker.qdoc ├── Private │ ├── FakeAbstractSpinBoxPrivate.cpp │ ├── QCtmActionGroup.cpp │ ├── QCtmActionGroup_p.h │ ├── QCtmClassifyTreeNode_p.h │ ├── QCtmDrawerItemTitle.cpp │ ├── QCtmDrawerItemTitle_p.h │ ├── QCtmFramelessDelegate.cpp │ ├── QCtmFramelessDelegate_p.h │ ├── QCtmFramelessDelegate_win.cpp │ ├── QCtmFramelessDelegate_win.h │ ├── QCtmLogFilterModel.cpp │ ├── QCtmLogFilterModel.h │ ├── QCtmMaximumSizeButton.cpp │ ├── QCtmMaximumSizeButton_p.h │ ├── QCtmMessageTipHelper.cpp │ ├── QCtmMessageTipHelper_p.h │ ├── QCtmMessageViewDelegate.cpp │ ├── QCtmMessageViewDelegate_p.h │ ├── QCtmNavigationImageButton.cpp │ ├── QCtmNavigationImageButton_p.h │ ├── QCtmPaletteFactor.cpp │ ├── QCtmPaletteFactor.h │ ├── QCtmSeparator.cpp │ ├── QCtmSeparator_p.h │ ├── QCtmStyle.cpp │ ├── QCtmStyleOptionSelectionButtonBox.h │ ├── QCtmStyleSheet_p.h │ ├── QCtmStyle_p.h │ ├── QCtmToolBoxItem.cpp │ ├── QCtmToolBoxItem.ui │ ├── QCtmToolBoxItemTitle.cpp │ ├── QCtmToolBoxItemTitle_p.h │ ├── QCtmToolBoxItem_p.h │ ├── QCtmToolButton.cpp │ ├── QCtmToolButton_p.h │ ├── QCtmUserButton.cpp │ ├── QCtmUserButton_p.h │ ├── QCtmWidgetItem.cpp │ ├── QCtmWidgetItem_p.h │ ├── QCtmXPM.h │ ├── QtVersionAdapter.h │ ├── Util.cpp │ └── Util_p.h ├── QCtmAbstractLogModel.cpp ├── QCtmAbstractLogModel.h ├── QCtmAbstractMessageTipModel.cpp ├── QCtmAbstractMessageTipModel.h ├── QCtmAbstractMessageTipView.cpp ├── QCtmAbstractMessageTipView.h ├── QCtmAbstractMultiPageItemModel.cpp ├── QCtmAbstractMultiPageItemModel.h ├── QCtmAbstractMultiPageTableModel.cpp ├── QCtmAbstractMultiPageTableModel.h ├── QCtmApplication.cpp ├── QCtmApplication.h ├── QCtmCircleProgressBar.cpp ├── QCtmCircleProgressBar.h ├── QCtmClassifyTreeItem.cpp ├── QCtmClassifyTreeItem.h ├── QCtmClassifyTreeModel.cpp ├── QCtmClassifyTreeModel.h ├── QCtmClassifyTreeView.cpp ├── QCtmClassifyTreeView.h ├── QCtmColor.cpp ├── QCtmColor.h ├── QCtmComboBox.cpp ├── QCtmComboBox.h ├── QCtmDialog.cpp ├── QCtmDialog.h ├── QCtmDigitKeyboard.cpp ├── QCtmDigitKeyboard.h ├── QCtmDigitKeyboard.ui ├── QCtmDrawerItemWidget.cpp ├── QCtmDrawerItemWidget.h ├── QCtmDrawerWidget.cpp ├── QCtmDrawerWidget.h ├── QCtmEditLabel.cpp ├── QCtmEditLabel.h ├── QCtmFile.cpp ├── QCtmFile.h ├── QCtmHeaderView.cpp ├── QCtmHeaderView.h ├── QCtmHexLineEdit.cpp ├── QCtmHexLineEdit.h ├── QCtmIPAddressEdit.cpp ├── QCtmIPAddressEdit.h ├── QCtmInputDialog.cpp ├── QCtmInputDialog.h ├── QCtmLoadingDialog.cpp ├── QCtmLoadingDialog.h ├── QCtmLoadingDialog.ui ├── QCtmLogData.cpp ├── QCtmLogData.h ├── QCtmLogEvent.cpp ├── QCtmLogEvent.h ├── QCtmLogManager.cpp ├── QCtmLogManager.h ├── QCtmLogModel.cpp ├── QCtmLogModel.h ├── QCtmLogWidget.cpp ├── QCtmLogWidget.h ├── QCtmLongLongSpinBox.cpp ├── QCtmLongLongSpinBox.h ├── QCtmMessageBox.cpp ├── QCtmMessageBox.h ├── QCtmMessageTipButton.cpp ├── QCtmMessageTipButton.h ├── QCtmMessageTipData.cpp ├── QCtmMessageTipData.h ├── QCtmMessageTipModel.cpp ├── QCtmMessageTipModel.h ├── QCtmMessageTipView.cpp ├── QCtmMessageTipView.h ├── QCtmMultiComboBox.cpp ├── QCtmMultiComboBox.h ├── QCtmMultiPageButtonBox.cpp ├── QCtmMultiPageButtonBox.h ├── QCtmMultiPageStringListModel.cpp ├── QCtmMultiPageStringListModel.h ├── QCtmNavigationBar.cpp ├── QCtmNavigationBar.h ├── QCtmNavigationSideBar.cpp ├── QCtmNavigationSideBar.h ├── QCtmNavigationSidePane.cpp ├── QCtmNavigationSidePane.h ├── QCtmPathBrowser.cpp ├── QCtmPathBrowser.h ├── QCtmRangeSlider.cpp ├── QCtmRangeSlider.h ├── QCtmRecentModel.cpp ├── QCtmRecentModel.h ├── QCtmRecentView.cpp ├── QCtmRecentView.h ├── QCtmRecentViewDelegate.cpp ├── QCtmRecentViewDelegate.h ├── QCtmSelectionButtonBox.cpp ├── QCtmSelectionButtonBox.h ├── QCtmSerialPortComboBox.cpp ├── QCtmSerialPortComboBox.h ├── QCtmSignalBlocker.h ├── QCtmStageProgressBar.cpp ├── QCtmStageProgressBar.h ├── QCtmStyleSheet.cpp ├── QCtmStyleSheet.h ├── QCtmSwitchButton.cpp ├── QCtmSwitchButton.h ├── QCtmTabPage.cpp ├── QCtmTabPage.h ├── QCtmTabWidget.cpp ├── QCtmTabWidget.h ├── QCtmTableItemDelegate.cpp ├── QCtmTableItemDelegate.h ├── QCtmTableView.cpp ├── QCtmTableView.h ├── QCtmTitleBar.cpp ├── QCtmTitleBar.h ├── QCtmTitleBar.ui ├── QCtmToolBox.cpp ├── QCtmToolBox.h ├── QCtmULongLongSpinBox.cpp ├── QCtmULongLongSpinBox.h ├── QCtmWindow.cpp ├── QCtmWindow.h ├── QCtmWindow.ui ├── QCustomUi.qrc ├── Resources │ ├── Clear.png │ ├── Error.png │ ├── QCtmDocking │ │ ├── dockTitleFixed.svg │ │ └── dockTitleFloat.svg │ ├── cancel.png │ ├── clear-light.png │ ├── close-light.png │ ├── close.png │ ├── copy-light.png │ ├── copy.png │ ├── drop-down-light.png │ ├── drop-down.png │ ├── edit.png │ ├── help-light.png │ ├── help.png │ ├── hideButton-light.png │ ├── hideButton.png │ ├── info.png │ ├── loading.gif │ ├── maximize-light.png │ ├── maximize.png │ ├── maximize_max-light.png │ ├── maximize_max.png │ ├── messageTip-light.png │ ├── messageTip.png │ ├── minimize-light.png │ ├── minimize.png │ ├── ok.png │ ├── people-light.png │ ├── people.png │ ├── search-light.png │ ├── search.png │ ├── stylesheet │ │ └── sw-light.css │ ├── system_menu.png │ ├── tree-close-light.png │ ├── tree-close.png │ ├── tree-open-light.png │ ├── tree-open.png │ └── warning.png ├── qcustomui_global.h ├── qcustomui_zh.qm └── qcustomui_zh.ts └── Tests ├── Auto ├── CMakeLists.txt ├── QCtmCircleProgressBar │ ├── CMakeLists.txt │ └── tst_QCtmCircleProgressBar.cpp ├── QCtmDialog │ ├── CMakeLists.txt │ └── tst_QCtmDialog.cpp ├── QCtmDigitKeyboard │ ├── CMakeLists.txt │ └── tst_QCtmDigitKeyboard.cpp ├── QCtmDrawerWidget │ ├── CMakeLists.txt │ └── tst_QCtmDrawerWidget.cpp ├── QCtmEditLabel │ ├── CMakeLists.txt │ └── tst_QCtmEditLabel.cpp ├── QCtmIPAddressEdit │ ├── CMakeLists.txt │ └── tst_QCtmIPAddressEdit.cpp ├── QCtmLoadingDialog │ ├── CMakeLists.txt │ └── tst_QCtmLoadingDialog.cpp ├── QCtmStageProgressBar │ ├── CMakeLists.txt │ └── tst_QCtmStageProgressBar.cpp ├── QCtmSwitchButton │ ├── CMakeLists.txt │ └── tst_QCtmSwitchButton.cpp ├── QCtmToolBox │ ├── CMakeLists.txt │ └── tst_QCtmToolBox.cpp └── QCtmWindow │ ├── CMakeLists.txt │ └── tst_QCtmWindow.cpp └── CMakeLists.txt /.clang-format: -------------------------------------------------------------------------------- 1 | # Format Style Options - Created with Clang Power Tools 2 | --- 3 | AccessModifierOffset: -4 4 | AlignConsecutiveAssignments: Consecutive 5 | AlignConsecutiveBitFields: Consecutive 6 | AlignTrailingComments: true 7 | AllowAllParametersOfDeclarationOnNextLine: false 8 | AllowShortBlocksOnASingleLine: Empty 9 | AllowShortCaseLabelsOnASingleLine: false 10 | AllowShortLambdasOnASingleLine: All 11 | AllowShortEnumsOnASingleLine: true 12 | AllowShortFunctionsOnASingleLine: All 13 | AllowShortIfStatementsOnASingleLine: Never 14 | AllowShortLoopsOnASingleLine: false 15 | AlwaysBreakAfterDefinitionReturnType: None 16 | AlwaysBreakAfterReturnType: None 17 | BasedOnStyle: Mozilla 18 | BreakBeforeBraces: Allman 19 | BreakBeforeInheritanceComma: true 20 | BreakInheritanceList: BeforeComma 21 | BreakConstructorInitializers: BeforeComma 22 | ColumnLimit: 140 23 | CompactNamespaces: true 24 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 25 | ConstructorInitializerIndentWidth : 4 26 | ContinuationIndentWidth: 4 27 | ExperimentalAutoDetectBinPacking: true 28 | FixNamespaceComments: true 29 | IndentCaseBlocks: true 30 | IndentCaseLabels: false 31 | IndentRequires: false 32 | IndentWidth: 4 33 | MaxEmptyLinesToKeep: 1 34 | PointerAlignment: Left 35 | ReflowComments: true 36 | SortIncludes: true 37 | SortUsingDeclarations: true 38 | SpaceBeforeCpp11BracedList: true 39 | Standard: Latest 40 | StatementAttributeLikeMacros: 41 | - Q_UNUSED 42 | - QT_REQUIRE_VERSION 43 | StatementMacros: 44 | - Q_UNUSED 45 | - QT_REQUIRE_VERSION 46 | UseTab: Never 47 | ... 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | /.vs 3 | /build 4 | /src/EditActivity/*.user 5 | /src/QCustomUi/x64/Debug/*.obj 6 | /src/SwitchLauncherExample/x64/Debug/*.pdb 7 | /src/SwitchLauncherExample/x64/Debug/*.obj 8 | /src/SwitchLauncher/x64/Debug/SwitchLauncher.tlog/*.tlog 9 | *.tlog 10 | *.user 11 | *.pdb 12 | *.log 13 | *.obj 14 | GeneratedFiles 15 | *.aps 16 | *.props 17 | /CMakeSettings.json 18 | /out 19 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | project(QCustomUi VERSION "1.18.1") 4 | enable_testing() 5 | 6 | set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) 7 | set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/build) 8 | set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_LIST_DIR}/build/obj) 9 | set(INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include) 10 | if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) 11 | set(INSTALL_LIBRARYDIR ${CMAKE_INSTALL_PREFIX}/lib/x64) 12 | set(INSTALL_BINDIR ${CMAKE_INSTALL_PREFIX}/bin/x64) 13 | else() 14 | set(INSTALL_LIBRARYDIR ${CMAKE_INSTALL_PREFIX}/lib/x86) 15 | set(INSTALL_BINDIR ${CMAKE_INSTALL_PREFIX}/bin/x86) 16 | endif(${CMAKE_SIZEOF_VOID_P} EQUAL 8) 17 | 18 | include(${CMAKE_CURRENT_LIST_DIR}/cmake/Common.cmake) 19 | if (MSVC) 20 | add_compile_options(/W3) 21 | else() 22 | add_compile_options(-Wall) 23 | endif() 24 | 25 | include(${PROJECT_SOURCE_DIR}/cmake/ExportHelper.cmake) 26 | 27 | export_config(${PROJECT_NAME} ${INSTALL_LIBRARYDIR} ${INSTALL_INCLUDEDIR}) 28 | 29 | option(BUILD_STATIC "Build QCustomUi static library." OFF) 30 | 31 | add_subdirectory(src) 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QCustomUi 2 | 3 | ## 一、简介 4 | 5 | QCustomUi是一个自定义UI库,主要提供无边框窗口和一些自定义控件,方便Qt开发。 6 | 当前库于Qt5.15.2和Qt6下编译通过。 7 | 8 | 编译完成后,点击安装,会自动安装设计器插件到QtDesigner和QtCreator下。 9 | 10 | >注意:如果没有将Qt的运行库设置到PATH环境变量中,QtCreator可能缺乏某些QCustomUi依赖的Qt库而无法加载设计器插件。 11 | 12 | ## 二、编译 13 | 14 | 现在QCustomUi默认仅编译QCustomUi本身,若需要编译Examples,则在CMake中将**BUILD_EXAMPLES**选项激活,若要编译Tests,则在CMake中将**BUILD_TESTS**选项激活,若要编译Qt设计器插件,则在CMake中将**BUILD_DESIGNER**选项激活。 15 | 16 | 现在QCustomUi引用了第三方库**pegtl**, 在CMake生成阶段将自动从指定地址下载,**下载过程可能需要一点时间,请耐心等待**由于国内对github访问速度缓慢的问题,在CMake中默认是从gitee的镜像仓库下载的,若需要从原地址下载,请将**src/QCustomUi/CMakeLists.txt**中下列内容修改为注释掉的github地址: 17 | 18 | ```cmake 19 | FetchContent_Declare( 20 | pegtl 21 | #GIT_REPOSITORY https://github.com/taocpp/PEGTL.git #github 原仓库地址 22 | GIT_REPOSITORY https://gitee.com/mirrors/pegtl.git #gitee镜像地址 23 | GIT_TAG main 24 | FIND_PACKAGE_ARGS NAMES pegtl 25 | ) 26 | ``` 27 | 28 | 当然,下载**pegtl**是在当前环境中并没有pegtl库的情况下,如果你已经下载了pegtl库,并且引入其**pegtl-config.cmake**到CMAKE_PREFIX_PATH中,或者使用其它库管理工具,如vcpkg等,也可以在vcpkg中安装pegtl库,这样在编译过程中会自动找到pegtl,而不会执行下载过程。 29 | 30 | ## 三、UI界面预览 31 | 32 | 界面预览请查看[界面预览](UiPreview.md)页面 -------------------------------------------------------------------------------- /UiPreview.assets/165294264943820225191524305.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/165294264943820225191524305.gif -------------------------------------------------------------------------------- /UiPreview.assets/165294336692220225191522254.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/165294336692220225191522254.gif -------------------------------------------------------------------------------- /UiPreview.assets/165294410414120225191518431.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/165294410414120225191518431.gif -------------------------------------------------------------------------------- /UiPreview.assets/165294524356320225191528126.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/165294524356320225191528126.gif -------------------------------------------------------------------------------- /UiPreview.assets/165294551010920225191532407.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/165294551010920225191532407.gif -------------------------------------------------------------------------------- /UiPreview.assets/16529476089682022519167348.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/16529476089682022519167348.gif -------------------------------------------------------------------------------- /UiPreview.assets/165294782053120225191610569.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/165294782053120225191610569.gif -------------------------------------------------------------------------------- /UiPreview.assets/16698569751572022121911412.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/16698569751572022121911412.gif -------------------------------------------------------------------------------- /UiPreview.assets/QQ20231110-163619-HD202311101638541.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/QQ20231110-163619-HD202311101638541.gif -------------------------------------------------------------------------------- /UiPreview.assets/QQ录屏2023052616574620235261658311.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/QQ录屏2023052616574620235261658311.gif -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519144218268.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519144218268.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519145002696.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519145002696.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519153100472.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519153100472.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519153539266.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519153539266.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519153556457.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519153556457.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519153609328.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519153609328.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519153617953.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519153617953.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519153626148.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519153626148.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519153749963.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519153749963.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519153904665.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519153904665.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519154416408.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519154416408.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519154531989.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519154531989.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519154603715.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519154603715.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519154616413.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519154616413.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519155120304.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519155120304.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519155131669.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519155131669.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519155138884.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519155138884.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519155150157.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519155150157.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519160009386.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519160009386.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519160512835.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519160512835.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20220519161302386.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20220519161302386.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20240621150955630.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20240621150955630.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20240801154148218.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20240801154148218.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20240801154356539.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20240801154356539.png -------------------------------------------------------------------------------- /UiPreview.assets/image-20241104100818611.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/UiPreview.assets/image-20241104100818611.png -------------------------------------------------------------------------------- /cmake/Common.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_STANDARD 20) 2 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 3 | set(CMAKE_DEBUG_POSTFIX "d") 4 | -------------------------------------------------------------------------------- /cmake/Example.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_AUTOMOC ON) 2 | set(CMAKE_AUTOUIC ON) 3 | set(CMAKE_AUTORCC ON) 4 | 5 | find_package(QT NAMES Qt5 Qt6 REQUIRED) 6 | find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets REQUIRED) 7 | -------------------------------------------------------------------------------- /cmake/ExportHelper.cmake: -------------------------------------------------------------------------------- 1 | function(export_config target_name installdir includedir) 2 | include(CMakePackageConfigHelpers) 3 | 4 | configure_package_config_file("${PROJECT_SOURCE_DIR}/cmake/${target_name}Config.cmake.in" 5 | "${CMAKE_CURRENT_BINARY_DIR}/${target_name}Config.cmake" 6 | INSTALL_DESTINATION "${installdir}/cmake/" 7 | PATH_VARS installdir includedir) 8 | 9 | write_basic_package_version_file( 10 | "${CMAKE_CURRENT_BINARY_DIR}/${target_name}ConfigVersion.cmake" 11 | VERSION ${PROJECT_VERSION} 12 | COMPATIBILITY AnyNewerVersion) 13 | 14 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${target_name}ConfigVersion.cmake" 15 | "${CMAKE_CURRENT_BINARY_DIR}/${target_name}Config.cmake" DESTINATION "${installdir}/cmake/") 16 | set(CMAKE_EXPORT_PACKAGE_REGISTRY ON) 17 | export(PACKAGE ${target_name}) 18 | endfunction() 19 | 20 | function(export_install_target target_name includedir libdir bindir) 21 | install(TARGETS ${target_name} 22 | EXPORT ${target_name} 23 | ARCHIVE DESTINATION ${libdir} 24 | RUNTIME DESTINATION ${bindir}/${CMAKE_BUILD_TYPE} 25 | PUBLIC_HEADER DESTINATION ${includedir}/${target_name}) 26 | 27 | install(EXPORT ${target_name} FILE "${target_name}Targets.cmake" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cmake") 28 | install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/cmake" DESTINATION "${libdir}" FILES_MATCHING PATTERN "*.cmake") 29 | endfunction() -------------------------------------------------------------------------------- /cmake/QCustomUi.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | VS_VERSION_INFO VERSIONINFO 4 | FILEVERSION ${PROJECT_VERSION_MAJOR}, ${PROJECT_VERSION_MINOR}, ${PROJECT_VERSION_PATCH} 5 | PRODUCTVERSION ${PROJECT_VERSION_MAJOR}, ${PROJECT_VERSION_MINOR}, ${PROJECT_VERSION_PATCH} 6 | FILEFLAGSMASK 0x17L 7 | #ifdef _DEBUG 8 | FILEFLAGS 0x1L 9 | #else 10 | FILEFLAGS 0x0L 11 | #endif 12 | FILEOS 0x4L 13 | FILETYPE 0x0L 14 | FILESUBTYPE 0x0L 15 | BEGIN 16 | BLOCK "StringFileInfo" 17 | BEGIN 18 | BLOCK "040904b0" 19 | BEGIN 20 | VALUE "FileDescription", "QCustomUi" 21 | VALUE "FileVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}" 22 | VALUE "InternalName", "QCustomUi" 23 | VALUE "LegalCopyright", "Copyright (C) 2019-2025 QCustomUi" 24 | VALUE "OriginalFilename", "QCustomUi.dll" 25 | VALUE "ProductName", "QCustomUi" 26 | VALUE "ProductVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x409, 1200 32 | END 33 | END -------------------------------------------------------------------------------- /cmake/QCustomUiConfig.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include_directories(@includedir@) 4 | include(@installdir@/cmake/QCustomUiTargets.cmake) -------------------------------------------------------------------------------- /cmake/Tests.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_AUTOMOC ON) 2 | set(CMAKE_AUTOUIC ON) 3 | set(CMAKE_AUTORCC ON) 4 | 5 | find_package(QT NAMES Qt5 Qt6 REQUIRED) 6 | find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets Test REQUIRED) 7 | 8 | function(qcustomui_internal_add_test name) 9 | set(multiopts SOURCES PRIVATE_LIBRARIES PUBLIC_LIBRARIES) 10 | cmake_parse_arguments(arg "${flags}" "${options}" "${multiopts}" ${ARGN}) 11 | include_directories(${PROJECT_SOURCE_DIR}/src) 12 | add_executable(${name} ${arg_SOURCES}) 13 | target_link_libraries(${name} PUBLIC ${arg_PUBLIC_LIBRARIES} PRIVATE "${arg_PRIVATE_LIBRARIES}") 14 | set_target_properties(${name} PROPERTIES "FOLDER" "Tests") 15 | install(TARGETS ${name} RUNTIME DESTINATION ${INSTALL_BINDIR}/${CMAKE_BUILD_TYPE}) 16 | add_test(NAME "${name}" COMMAND ${name} WORKING_DIRECTORY ${INSTALL_BINDIR}/${CMAKE_BUILD_TYPE}) 17 | endfunction(qcustomui_internal_add_test) -------------------------------------------------------------------------------- /cmake/Version.h.in: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2024 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #define QCUSTOMUI_VERSION_MAJOR ${PROJECT_VERSION_MAJOR} 23 | #define QCUSTOMUI_VERSION_MINOR ${PROJECT_VERSION_MINOR} 24 | #define QCUSTOMUI_VERSION_MICRO ${PROJECT_VERSION_PATCH} 25 | 26 | #define _QCUSTOMUI_TOSTR(x) #x 27 | #define _QCUSTOMUI_TO_STR(x) _QCUSTOMUI_TOSTR(x) 28 | 29 | #define QCUSTOMUI_VERSION \ 30 | _QCUSTOMUI_TO_STR(QCUSTOMUI_VERSION_MAJOR) "." _QCUSTOMUI_TO_STR(QCUSTOMUI_VERSION_MINOR) "." _QCUSTOMUI_TO_STR(QCUSTOMUI_VERSION_MICRO) 31 | -------------------------------------------------------------------------------- /doc/images/QCtmClassifyTreeViewDetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/QCtmClassifyTreeViewDetail.png -------------------------------------------------------------------------------- /doc/images/QCtmDrawerWidgetDetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/QCtmDrawerWidgetDetail.png -------------------------------------------------------------------------------- /doc/images/QCtmEditLabelDetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/QCtmEditLabelDetail.png -------------------------------------------------------------------------------- /doc/images/QCtmIPAddressEditDetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/QCtmIPAddressEditDetail.png -------------------------------------------------------------------------------- /doc/images/QCtmMessageBoxDetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/QCtmMessageBoxDetail.png -------------------------------------------------------------------------------- /doc/images/QCtmMultiComboBoxDetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/QCtmMultiComboBoxDetail.png -------------------------------------------------------------------------------- /doc/images/QCtmNavigationBarDetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/QCtmNavigationBarDetail.png -------------------------------------------------------------------------------- /doc/images/QCtmNavigationPaneDetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/QCtmNavigationPaneDetail.png -------------------------------------------------------------------------------- /doc/images/QCtmStageProgressBarDetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/QCtmStageProgressBarDetail.png -------------------------------------------------------------------------------- /doc/images/QCtmTitleBarDetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/QCtmTitleBarDetail.png -------------------------------------------------------------------------------- /doc/images/arrow_bc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/arrow_bc.png -------------------------------------------------------------------------------- /doc/images/bgrContent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/bgrContent.png -------------------------------------------------------------------------------- /doc/images/btn_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/btn_next.png -------------------------------------------------------------------------------- /doc/images/btn_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/btn_prev.png -------------------------------------------------------------------------------- /doc/images/bullet_dn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/bullet_dn.png -------------------------------------------------------------------------------- /doc/images/bullet_sq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/bullet_sq.png -------------------------------------------------------------------------------- /doc/images/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/home.png -------------------------------------------------------------------------------- /doc/images/ico_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/ico_out.png -------------------------------------------------------------------------------- /doc/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/images/logo.png -------------------------------------------------------------------------------- /doc/qcustomui.qch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/doc/qcustomui.qch -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(QCustomUi) 2 | 3 | option(BUILD_EXAMPLES "Build example applications." FALSE) 4 | if(BUILD_EXAMPLES) 5 | add_subdirectory(Examples) 6 | endif(BUILD_EXAMPLES) 7 | 8 | option(BUILD_TESTS "Build test applications." FALSE) 9 | if(BUILD_TESTS) 10 | add_subdirectory(Tests) 11 | endif(BUILD_TESTS) 12 | 13 | option(BUILD_DESIGNER "Build designer plugin." FALSE) 14 | if(BUILD_DESIGNER) 15 | add_subdirectory(Designer) 16 | endif(BUILD_DESIGNER) -------------------------------------------------------------------------------- /src/Designer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TARGET_NAME "QCustomUiDesignerPlugin") 2 | 3 | file(GLOB HEADERS "*.h") 4 | file(GLOB SOURCES "*.cpp") 5 | file(GLOB RESOURCES *.qrc) 6 | file(GLOB UI *.ui) 7 | 8 | source_group("Headers" FILES ${HEADERS}) 9 | source_group("Sources" FILES ${SOURCES}) 10 | source_group("Resource" FILES ${RESOURCES}) 11 | source_group("UI" FILES ${UI}) 12 | 13 | set(CMAKE_AUTOMOC ON) 14 | set(CMAKE_AUTOUIC ON) 15 | set(CMAKE_AUTORCC ON) 16 | 17 | find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) 18 | find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets UiPlugin REQUIRED) 19 | file(REAL_PATH "${QT_DIR}/../../.." QTDIR) 20 | 21 | include_directories(../) 22 | 23 | add_library(${TARGET_NAME} SHARED 24 | ${HEADERS} 25 | ${SOURCES} 26 | ${RESOURCES} 27 | ${UI} 28 | ) 29 | 30 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::UiPlugin) 31 | 32 | install(TARGETS ${TARGET_NAME} 33 | CONFIGURATIONS Release 34 | RUNTIME DESTINATION "${QTDIR}/plugins/designer") 35 | install(TARGETS ${TARGET_NAME} 36 | CONFIGURATIONS Release 37 | RUNTIME DESTINATION "${QTDIR}/../../Tools/QtCreator/bin/plugins/designer") 38 | 39 | install(FILES ${QCustomUi_BINARY_DIR}/src/QCustomUi/QCustomUi${CMAKE_SHARED_MODULE_SUFFIX} 40 | CONFIGURATIONS Release 41 | DESTINATION "${QTDIR}/bin") 42 | install(FILES ${QCustomUi_BINARY_DIR}/src/QCustomUi/QCustomUi${CMAKE_SHARED_MODULE_SUFFIX} 43 | CONFIGURATIONS Release 44 | DESTINATION "${QTDIR}/../../Tools/QtCreator/bin") 45 | -------------------------------------------------------------------------------- /src/Designer/CircleProgressBar.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | #include "CircleProgressBar.h" 20 | 21 | #include 22 | 23 | CircleProgressBar::CircleProgressBar(QObject* parent /*= nullptr*/) : QObject(parent = nullptr) {} 24 | 25 | QString CircleProgressBar::domXml() const 26 | { 27 | return "\n" 28 | " \n" 29 | " \n" 30 | "\n"; 31 | } 32 | 33 | QWidget* CircleProgressBar::createWidget(QWidget* parent) { return new QCtmCircleProgressBar(parent); } 34 | -------------------------------------------------------------------------------- /src/Designer/ClassifyTreeView.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | #include "ClassifyTreeView.h" 20 | 21 | #include 22 | 23 | ClassifyTreeView::ClassifyTreeView(QObject* parent /*= nullptr*/) : QObject(parent) {} 24 | 25 | QString ClassifyTreeView::domXml() const 26 | { 27 | return "\n" 28 | " \n" 29 | " \n" 30 | "\n"; 31 | } 32 | 33 | QWidget* ClassifyTreeView::createWidget(QWidget* parent) { return new QCtmClassifyTreeView(parent); } 34 | -------------------------------------------------------------------------------- /src/Designer/ComboBox.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | #include "ComboBox.h" 20 | 21 | #include 22 | 23 | ComboBox::ComboBox(QObject* parent /*= nullptr*/) : QObject(parent) {} 24 | 25 | QString ComboBox::domXml() const 26 | { 27 | return "\n" 28 | " \n" 29 | " \n" 30 | "\n"; 31 | } 32 | 33 | QWidget* ComboBox::createWidget(QWidget* parent) { return new QCtmComboBox(parent); } 34 | -------------------------------------------------------------------------------- /src/Designer/EditLabel.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | #include "EditLabel.h" 20 | 21 | #include 22 | 23 | EditLabel::EditLabel(QObject* parent /*= nullptr*/) : QObject(parent) {} 24 | 25 | QString EditLabel::domXml() const 26 | { 27 | return "\n" 28 | " \n" 29 | " \n" 30 | "\n"; 31 | } 32 | 33 | QWidget* EditLabel::createWidget(QWidget* parent) { return new QCtmEditLabel(parent); } 34 | -------------------------------------------------------------------------------- /src/Designer/SwitchButton.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | #include "SwitchButton.h" 20 | 21 | #include 22 | 23 | SwitchButton::SwitchButton(QObject* parent /*= nullptr*/) : QObject(parent = nullptr) {} 24 | 25 | QString SwitchButton::domXml() const 26 | { 27 | return "\n" 28 | " \n" 29 | " \n" 30 | "\n"; 31 | } 32 | 33 | QWidget* SwitchButton::createWidget(QWidget* parent) { return new QCtmSwitchButton(parent); } 34 | -------------------------------------------------------------------------------- /src/Designer/TableView.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | #include "TableView.h" 20 | 21 | #include 22 | 23 | TableView::TableView(QObject* parent /*= nullptr*/) : QObject(parent = nullptr) {} 24 | 25 | QString TableView::domXml() const 26 | { 27 | return "\n" 28 | " \n" 29 | " \n" 30 | "\n"; 31 | } 32 | 33 | QWidget* TableView::createWidget(QWidget* parent) { return new QCtmTableView(parent); } 34 | -------------------------------------------------------------------------------- /src/Examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(${PROJECT_SOURCE_DIR}/cmake/Example.cmake) 2 | 3 | add_subdirectory(ClassifyTreeViewExample) 4 | add_subdirectory(DrawerExample) 5 | add_subdirectory(EditLabelExample) 6 | add_subdirectory(IPAddressEditExample) 7 | add_subdirectory(LoadingExample) 8 | add_subdirectory(MessageBoxExample) 9 | add_subdirectory(MultiComboBoxExample) 10 | add_subdirectory(NavigationBarExample) 11 | add_subdirectory(NavigationPaneExample) 12 | add_subdirectory(StageProgressBarExample) 13 | add_subdirectory(WindowAndDialogExamples) 14 | add_subdirectory(MessageTipExample) 15 | add_subdirectory(InputDialogExample) 16 | add_subdirectory(ToolBoxExample) 17 | add_subdirectory(PathBrowserExample) 18 | add_subdirectory(DigitKeyboardExample) 19 | add_subdirectory(SwitchButtonExample) 20 | add_subdirectory(CircleProgressBarExample) 21 | add_subdirectory(MultiPageViewExample) 22 | add_subdirectory(RecentViewExample) 23 | add_subdirectory(SelectionButtonBoxExample) 24 | if (NOT ${BUILD_STATIC}) 25 | add_subdirectory(LongLongSpinBoxExample) 26 | add_subdirectory(ULongLongSpinBoxExample) 27 | endif() 28 | add_subdirectory(HexLineEditExample) 29 | add_subdirectory(SerialPortComboBoxExample) 30 | add_subdirectory(TitleBarStyleSheetExample) 31 | add_subdirectory(LogExample) 32 | add_subdirectory(RangeSliderExample) -------------------------------------------------------------------------------- /src/Examples/CircleProgressBarExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/CircleProgressBarExample/CircleProgressBarExample.cpp: -------------------------------------------------------------------------------- 1 | #include "CircleProgressBarExample.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | CircleProgressBarExample::CircleProgressBarExample(QWidget* parent) : QCtmWindow(parent) { init(); } 10 | 11 | CircleProgressBarExample::~CircleProgressBarExample() {} 12 | 13 | void CircleProgressBarExample::init() 14 | { 15 | auto layout = new QVBoxLayout(this->centralWidget()); 16 | auto progressBar1 = new QCtmCircleProgressBar(this); 17 | 18 | layout->addWidget(progressBar1, 1); 19 | 20 | auto slider = new QSlider(this); 21 | slider->setOrientation(Qt::Horizontal); 22 | layout->addWidget(slider); 23 | connect(slider, &QSlider::valueChanged, this, [=](double value) { progressBar1->setValue(value); }); 24 | slider->setValue(20); 25 | slider->setRange(0, 100); 26 | auto btn = new QPushButton("test", this); 27 | btn->setCheckable(true); 28 | layout->addWidget(btn); 29 | // progressBar1->setPenCapStyle(Qt::PenCapStyle::RoundCap); 30 | // progressBar1->setBarWidth(30); 31 | connect(btn, 32 | &QPushButton::clicked, 33 | this, 34 | [=](bool checked) 35 | { 36 | if (checked) 37 | { 38 | progressBar1->setRange(0, 0); 39 | } 40 | else 41 | { 42 | progressBar1->setRange(0, 100); 43 | } 44 | }); 45 | } 46 | -------------------------------------------------------------------------------- /src/Examples/CircleProgressBarExample/CircleProgressBarExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class CircleProgressBarExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | CircleProgressBarExample(QWidget* parent = Q_NULLPTR); 11 | ~CircleProgressBarExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/CircleProgressBarExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "CircleProgressBarExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | CircleProgressBarExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/ClassifyTreeViewExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/ClassifyTreeViewExample/ClassifyTreeViewExample.cpp: -------------------------------------------------------------------------------- 1 | #include "ClassifyTreeViewExample.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | ClassifyTreeViewExample::ClassifyTreeViewExample(QWidget* parent) : QCtmWindow(parent) 8 | { 9 | auto view = new QCtmClassifyTreeView(this); 10 | setCentralWidget(view); 11 | setWindowTitle("ClassifyTreeViewExample"); 12 | auto model = new QCtmClassifyTreeModel(this); 13 | for (int i = 0; i < 5; i++) 14 | { 15 | auto root = new QCtmClassifyTreeGroupItem(QIcon(":/ClassifyTreeViewExample/resources/list.svg"), QString("root%1").arg(i)); 16 | for (int j = 0; j < 20; j++) 17 | root->addChild( 18 | new QCtmClassifyTreeIconItem(QIcon(":/ClassifyTreeViewExample/resources/bus-color.svg"), QString("name%1").arg(j))); 19 | model->addItem(root); 20 | } 21 | view->setIconItemSize({ 70, 30 }); 22 | view->setModel(model); 23 | } 24 | -------------------------------------------------------------------------------- /src/Examples/ClassifyTreeViewExample/ClassifyTreeViewExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class ClassifyTreeViewExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | ClassifyTreeViewExample(QWidget* parent = Q_NULLPTR); 11 | }; 12 | -------------------------------------------------------------------------------- /src/Examples/ClassifyTreeViewExample/ClassifyTreeViewExample.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/bus-color.svg 4 | resources/list.svg 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Examples/ClassifyTreeViewExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ClassifyTreeViewExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | ClassifyTreeViewExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/DigitKeyboardExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/DigitKeyboardExample/DigitKeyboardExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class DigitKeyboardExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | DigitKeyboardExample(QWidget* parent = Q_NULLPTR); 11 | }; 12 | -------------------------------------------------------------------------------- /src/Examples/DigitKeyboardExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "DigitKeyboardExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | DigitKeyboardExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/DrawerExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/DrawerExample/DrawerExample.cpp: -------------------------------------------------------------------------------- 1 | #include "DrawerExample.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | DrawerExample::DrawerExample(QWidget* parent) : QCtmWindow(parent) { init(); } 13 | 14 | DrawerExample::~DrawerExample() {} 15 | 16 | void DrawerExample::init() 17 | { 18 | auto layout = new QHBoxLayout(this->centralWidget()); 19 | auto drawer = new QCtmDrawerWidget(this); 20 | layout->addWidget(drawer); 21 | 22 | auto tree = new QTreeView(this); 23 | auto model = new QFileSystemModel(this); 24 | model->setRootPath(QDir::homePath()); 25 | tree->setModel(model); 26 | 27 | auto item1 = drawer->addWidget(tr("Example1"), new QLabel(tr("Example text"))); 28 | item1->addAction(QIcon(":/DrawerExample/Resources/Edit.svg")); 29 | drawer->addWidget(tr("Example2"), tree); 30 | // drawer->setExclusive(true); 31 | } 32 | -------------------------------------------------------------------------------- /src/Examples/DrawerExample/DrawerExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class DrawerExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | DrawerExample(QWidget* parent = Q_NULLPTR); 11 | ~DrawerExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/DrawerExample/DrawerExample.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Resources/Edit.svg 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Examples/DrawerExample/Resources/Edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Examples/DrawerExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "DrawerExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | DrawerExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/EditLabelExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/EditLabelExample/EditLabelExample.cpp: -------------------------------------------------------------------------------- 1 | #include "EditLabelExample.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | EditLabelExample::EditLabelExample(QWidget* parent) : QCtmWindow(parent) { init(); } 8 | 9 | EditLabelExample::~EditLabelExample() {} 10 | 11 | void EditLabelExample::init() 12 | { 13 | auto layout = new QHBoxLayout(this->centralWidget()); 14 | layout->addStretch(1); 15 | layout->addWidget(new QCtmEditLabel(tr("Example Text"), this)); 16 | layout->addStretch(1); 17 | } 18 | -------------------------------------------------------------------------------- /src/Examples/EditLabelExample/EditLabelExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class EditLabelExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | EditLabelExample(QWidget* parent = Q_NULLPTR); 11 | ~EditLabelExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/EditLabelExample/EditLabelExample.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Examples/EditLabelExample/EditLabelExample.ui: -------------------------------------------------------------------------------- 1 | 2 | EditLabelExampleClass 3 | 4 | 5 | EditLabelExampleClass 6 | 7 | 8 | 9 | 0 10 | 0 11 | 600 12 | 400 13 | 14 | 15 | 16 | EditLabelExample 17 | $centralwidget$ 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Examples/EditLabelExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "EditLabelExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | EditLabelExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/HexLineEditExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/HexLineEditExample/HexLineEditExample.cpp: -------------------------------------------------------------------------------- 1 | #include "HexLineEditExample.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | HexLineEditExample::HexLineEditExample(QWidget* parent) : QCtmWindow(parent) { init(); } 10 | 11 | HexLineEditExample::~HexLineEditExample() {} 12 | 13 | void HexLineEditExample::init() 14 | { 15 | auto layout = new QHBoxLayout(this->centralWidget()); 16 | layout->addWidget(new QCtmHexLineEdit(this)); 17 | } 18 | -------------------------------------------------------------------------------- /src/Examples/HexLineEditExample/HexLineEditExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class HexLineEditExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | HexLineEditExample(QWidget* parent = Q_NULLPTR); 11 | ~HexLineEditExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/HexLineEditExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "HexLineEditExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | HexLineEditExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/IPAddressEditExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/IPAddressEditExample/IPAddressEditExample.cpp: -------------------------------------------------------------------------------- 1 | #include "IPAddressEditExample.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | IPAddressEditExample::IPAddressEditExample(QWidget* parent) : QCtmWindow(parent) { init(); } 9 | 10 | IPAddressEditExample::~IPAddressEditExample() {} 11 | 12 | void IPAddressEditExample::init() 13 | { 14 | auto layout = new QHBoxLayout(this->centralWidget()); 15 | layout->addStretch(1); 16 | auto edit = new QCtmIPAddressEdit(this); 17 | edit->setIPAddress("192.168.1.1"); 18 | layout->addWidget(edit); 19 | auto btn = new QPushButton("clear", this); 20 | connect(btn, &QPushButton::clicked, edit, &QCtmIPAddressEdit::clear); 21 | layout->addWidget(btn); 22 | layout->addStretch(1); 23 | } 24 | -------------------------------------------------------------------------------- /src/Examples/IPAddressEditExample/IPAddressEditExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class IPAddressEditExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | IPAddressEditExample(QWidget* parent = Q_NULLPTR); 11 | ~IPAddressEditExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/IPAddressEditExample/IPAddressEditExample.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Examples/IPAddressEditExample/IPAddressEditExample.ui: -------------------------------------------------------------------------------- 1 | 2 | IPAddressEditExampleClass 3 | 4 | 5 | IPAddressEditExampleClass 6 | 7 | 8 | 9 | 0 10 | 0 11 | 600 12 | 400 13 | 14 | 15 | 16 | IPAddressEditExample 17 | $centralwidget$ 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Examples/IPAddressEditExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "IPAddressEditExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | IPAddressEditExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/InputDialogExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/InputDialogExample/InputDialogExample.cpp: -------------------------------------------------------------------------------- 1 | #include "InputDialogExample.h" 2 | 3 | #include 4 | 5 | InputDialogExample::InputDialogExample(QWidget* parent) : QCtmWindow(parent) 6 | { 7 | ui.setupUi(this->centralWidget()); 8 | connect(ui.itemBtn, 9 | &QToolButton::clicked, 10 | this, 11 | [=]() 12 | { 13 | auto item = QCtmInputDialog::getItem(this, "Input", "Select item:", QStringList { "Item1", "Item2", "Item3" }); 14 | ui.itemEdit->setText(item); 15 | }); 16 | connect(ui.intBtn, 17 | &QToolButton::clicked, 18 | this, 19 | [=]() 20 | { 21 | auto i = QCtmInputDialog::getInt(this, "Input", "Input number:"); 22 | ui.intEdit->setText(QString::number(i)); 23 | }); 24 | connect(ui.doubleBtn, 25 | &QToolButton::clicked, 26 | this, 27 | [=]() 28 | { 29 | auto d = QCtmInputDialog::getDouble(this, "Input", "Input number:"); 30 | ui.doubleEdit->setText(QString::number(d)); 31 | }); 32 | connect(ui.textBtn, 33 | &QToolButton::clicked, 34 | this, 35 | [=]() 36 | { 37 | auto text = QCtmInputDialog::getText(this, "Input", "Input text:"); 38 | ui.textEdit->setText(text); 39 | }); 40 | connect(ui.multiTextBtn, 41 | &QToolButton::clicked, 42 | this, 43 | [=]() 44 | { 45 | auto text = QCtmInputDialog::getMultiLineText(this, "Input", "Input text:"); 46 | ui.multiTextEdit->setText(text); 47 | }); 48 | } 49 | 50 | InputDialogExample::~InputDialogExample() {} 51 | -------------------------------------------------------------------------------- /src/Examples/InputDialogExample/InputDialogExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ui_InputDialogExample.h" 4 | 5 | #include 6 | 7 | class InputDialogExample : public QCtmWindow 8 | { 9 | Q_OBJECT 10 | public: 11 | InputDialogExample(QWidget* parent = nullptr); 12 | ~InputDialogExample(); 13 | 14 | private: 15 | Ui::InputDialogExample ui; 16 | }; 17 | -------------------------------------------------------------------------------- /src/Examples/InputDialogExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "InputDialogExample.h" 4 | 5 | int main(int agrc, char* agrv[]) 6 | { 7 | QCtmApplication a(agrc, agrv); 8 | InputDialogExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/LoadingExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/LoadingExample/LoadingExample.cpp: -------------------------------------------------------------------------------- 1 | #include "LoadingExample.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | LoadingExample::LoadingExample(QWidget* parent) : QCtmWindow(parent) 12 | { 13 | setWindowTitle(tr("LoadingExample")); 14 | auto btn = new QPushButton(this->centralWidget()); 15 | btn->move(100, 100); 16 | btn->setText(tr("Show Loading 3 seconds")); 17 | auto loading = new QCtmLoadingDialog(this); 18 | loading->setCancelEnable(true); 19 | connect(btn, 20 | &QPushButton::clicked, 21 | this, 22 | [=]() 23 | { 24 | std::thread( 25 | [&] 26 | { 27 | std::this_thread::sleep_for(std::chrono::milliseconds(3000)); 28 | QMetaObject::invokeMethod(loading, &QCtmLoadingDialog::done); 29 | }) 30 | .detach(); 31 | auto ret = loading->exec(); 32 | if (ret == QCtmLoadingDialog::Result::Done) 33 | { 34 | QCtmMessageBox::information(this, "Tips", "Loading finished."); 35 | } 36 | else 37 | { 38 | QCtmMessageBox::information(this, "Tips", "Loading canceled."); 39 | } 40 | }); 41 | } 42 | -------------------------------------------------------------------------------- /src/Examples/LoadingExample/LoadingExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class LoadingExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | LoadingExample(QWidget* parent = Q_NULLPTR); 11 | 12 | private: 13 | }; 14 | -------------------------------------------------------------------------------- /src/Examples/LoadingExample/LoadingExample.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Examples/LoadingExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "LoadingExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | LoadingExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/LogExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} CONFIGURATIONS Debug RUNTIME DESTINATION ${INSTALL_BINDIR}/${CMAKE_BUILD_TYPE}) 26 | -------------------------------------------------------------------------------- /src/Examples/LogExample/LogExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class LogExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | LogExample(QWidget* parent = nullptr); 11 | ~LogExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/LogExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "LogExample.h" 2 | 3 | #include 4 | #include 5 | 6 | int main(int argc, char* argv[]) 7 | { 8 | QCtmLogManager::initBeforeApp(); // [1] init before QCtmApplication 9 | QCtmApplication a(argc, argv); 10 | LogExample w; 11 | w.showMaximized(); 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /src/Examples/LongLongSpinBoxExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/LongLongSpinBoxExample/LongLongSpinBoxExample.cpp: -------------------------------------------------------------------------------- 1 | #include "LongLongSpinBoxExample.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | LongLongSpinBoxExample::LongLongSpinBoxExample(QWidget* parent) : QCtmWindow(parent) { init(); } 10 | 11 | LongLongSpinBoxExample::~LongLongSpinBoxExample() {} 12 | 13 | void LongLongSpinBoxExample::init() 14 | { 15 | auto layout = new QHBoxLayout(this->centralWidget()); 16 | layout->addStretch(1); 17 | auto box = new QCtmLongLongSpinBox(this); 18 | box->setRange(std::numeric_limits::min(), std::numeric_limits::max()); 19 | connect(box, 20 | &QCtmLongLongSpinBox::valueChanged, 21 | this, 22 | [this](qlonglong value) 23 | { 24 | qDebug() << QString::number(value); // QCtmMessageBox::information(this, "Value Changed", QString::number(value)); 25 | }); 26 | box->setSuffix("V"); 27 | box->setPrefix("Data:"); 28 | box->setDisplayFieldWidth(8); 29 | box->setDisplayFillChar('0'); 30 | box->setDisplayIntegerBase(16); 31 | layout->addWidget(box); 32 | layout->addStretch(1); 33 | } 34 | -------------------------------------------------------------------------------- /src/Examples/LongLongSpinBoxExample/LongLongSpinBoxExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class LongLongSpinBoxExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | LongLongSpinBoxExample(QWidget* parent = Q_NULLPTR); 11 | ~LongLongSpinBoxExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/LongLongSpinBoxExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "LongLongSpinBoxExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | LongLongSpinBoxExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/MessageBoxExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/MessageBoxExample/MessageBoxExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ui_MessageBoxExample.h" 4 | 5 | #include 6 | 7 | class MessageBoxExample : public QCtmWindow 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | MessageBoxExample(QWidget* parent = Q_NULLPTR); 13 | ~MessageBoxExample(); 14 | 15 | private: 16 | void init(); 17 | 18 | private: 19 | Ui::MessageBoxExampleClass ui; 20 | }; 21 | -------------------------------------------------------------------------------- /src/Examples/MessageBoxExample/MessageBoxExample.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Examples/MessageBoxExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "MessageBoxExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | MessageBoxExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/MessageTipExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/MessageTipExample/MessageTipExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class MessageTipExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | public: 9 | MessageTipExample(QWidget* parent = nullptr); 10 | ~MessageTipExample(); 11 | }; 12 | -------------------------------------------------------------------------------- /src/Examples/MessageTipExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "MessageTipExample.h" 2 | 3 | #include 4 | 5 | int main(int agrc, char* agrv[]) 6 | { 7 | QCtmApplication a(agrc, agrv); 8 | MessageTipExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/MultiComboBoxExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/MultiComboBoxExample/MultiComboBoxExample.cpp: -------------------------------------------------------------------------------- 1 | #include "MultiComboBoxExample.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | MultiComboBoxExample::MultiComboBoxExample(QWidget* parent) : QCtmWindow(parent) 8 | { 9 | init(); 10 | setWindowTitle(tr("MultiComboBox Example")); 11 | } 12 | 13 | MultiComboBoxExample::~MultiComboBoxExample() {} 14 | 15 | void MultiComboBoxExample::init() 16 | { 17 | auto layout = new QVBoxLayout(this->centralWidget()); 18 | layout->setAlignment(Qt::AlignCenter); 19 | layout->addStretch(1); 20 | { 21 | auto box = new QCtmMultiComboBox(this); 22 | QStringList items { tr("Item1"), tr("Item2"), tr("Item3"), tr("Item4"), tr("Item5") }; 23 | box->addItems(items); 24 | box->setFixedWidth(200); 25 | layout->addWidget(box); 26 | } 27 | { 28 | auto box = new QCtmMultiComboBox(this); 29 | box->setEnabled(false); 30 | QStringList items { tr("Item1"), tr("Item2"), tr("Item3"), tr("Item4"), tr("Item5") }; 31 | box->addItems(items); 32 | box->setFixedWidth(200); 33 | layout->addWidget(box); 34 | } 35 | layout->addStretch(1); 36 | } 37 | -------------------------------------------------------------------------------- /src/Examples/MultiComboBoxExample/MultiComboBoxExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class MultiComboBoxExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | MultiComboBoxExample(QWidget* parent = Q_NULLPTR); 11 | ~MultiComboBoxExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/MultiComboBoxExample/MultiComboBoxExample.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Examples/MultiComboBoxExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "MultiComboBoxExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | MultiComboBoxExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/MultiPageViewExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/MultiPageViewExample/MultiPageTableModel.cpp: -------------------------------------------------------------------------------- 1 | #include "MultiPageTableModel.h" 2 | 3 | struct MultiPageTableModel::Impl 4 | { 5 | QVector datas; 6 | }; 7 | 8 | MultiPageTableModel::MultiPageTableModel(QObject* parent) : QCtmAbstractMultiPageTableModel(parent), m_impl(std::make_unique()) {} 9 | 10 | MultiPageTableModel::~MultiPageTableModel() {} 11 | 12 | void MultiPageTableModel::setTestDatas(const QVector& datas) 13 | { 14 | beginResetModel(); 15 | m_impl->datas = datas; 16 | endResetModel(); 17 | } 18 | 19 | int MultiPageTableModel::rowCount(const QModelIndex& parent /* = QModelIndex() */) const 20 | { 21 | return std::min(m_impl->datas.size() - offset(), pageRowCount()); 22 | } 23 | 24 | int MultiPageTableModel::columnCount(const QModelIndex& parent /* = QModelIndex() */) const { return 3; } 25 | 26 | QVariant MultiPageTableModel::data(const QModelIndex& index, int role /* = Qt::DisplayRole */) const 27 | { 28 | auto row = offset() + index.row(); 29 | if (row < 0 || row >= m_impl->datas.size()) 30 | return {}; 31 | if (role == Qt::DisplayRole) 32 | { 33 | const auto& d = m_impl->datas[row]; 34 | switch (index.column()) 35 | { 36 | case 0: 37 | return d.col1; 38 | case 1: 39 | return d.col2; 40 | case 2: 41 | return d.col3; 42 | } 43 | } 44 | return {}; 45 | } 46 | 47 | int MultiPageTableModel::pageCount() const 48 | { 49 | return m_impl->datas.size() / pageRowCount() + static_cast(m_impl->datas.size() % pageRowCount()); 50 | } 51 | -------------------------------------------------------------------------------- /src/Examples/MultiPageViewExample/MultiPageTableModel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | struct Data 8 | { 9 | QString col1; 10 | int col2; 11 | int col3; 12 | }; 13 | 14 | class MultiPageTableModel : public QCtmAbstractMultiPageTableModel 15 | { 16 | Q_OBJECT 17 | public: 18 | MultiPageTableModel(QObject* parent = nullptr); 19 | ~MultiPageTableModel(); 20 | 21 | void setTestDatas(const QVector& datas); 22 | int rowCount(const QModelIndex& parent /* = QModelIndex() */) const override; 23 | int columnCount(const QModelIndex& parent /* = QModelIndex() */) const override; 24 | QVariant data(const QModelIndex& index, int role /* = Qt::DisplayRole */) const override; 25 | int pageCount() const override; 26 | 27 | private: 28 | struct Impl; 29 | std::unique_ptr m_impl; 30 | }; -------------------------------------------------------------------------------- /src/Examples/MultiPageViewExample/MultiPageViewExample.cpp: -------------------------------------------------------------------------------- 1 | #include "MultiPageViewExample.h" 2 | #include "MultiPageTableModel.h" 3 | 4 | MultiPageViewExample::MultiPageViewExample() 5 | { 6 | ui.setupUi(this->centralWidget()); 7 | auto listModel = new QCtmMultiPageStringListModel(this); 8 | QStringList list; 9 | for (int i = 0; i < 999; ++i) 10 | { 11 | list.push_back(QString("Item %1").arg(i)); 12 | } 13 | listModel->setStringList(std::move(list)); 14 | ui.listView->setModel(listModel); 15 | ui.btnBox->setModel(listModel); 16 | listModel->setPageRowCount(50); 17 | ui.btnBox->setPageButtonCount(0); 18 | 19 | auto tableModel = new MultiPageTableModel(this); 20 | ui.tableView->setModel(tableModel); 21 | ui.btnBox_2->setModel(tableModel); 22 | QVector datas; 23 | for (int i = 0; i < 999; ++i) 24 | { 25 | datas.push_back(Data { QString("col %1").arg(i), i, i }); 26 | } 27 | tableModel->setTestDatas(datas); 28 | } 29 | 30 | MultiPageViewExample::~MultiPageViewExample() {} 31 | -------------------------------------------------------------------------------- /src/Examples/MultiPageViewExample/MultiPageViewExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ui_MultiPageViewExample.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | class MultiPageViewExample : public QCtmWindow 10 | { 11 | Q_OBJECT 12 | public: 13 | MultiPageViewExample(); 14 | ~MultiPageViewExample(); 15 | 16 | private: 17 | Ui::MultiPageViewExample ui; 18 | }; -------------------------------------------------------------------------------- /src/Examples/MultiPageViewExample/MultiPageViewExample.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MultiPageViewExample 4 | 5 | 6 | 7 | 0 8 | 0 9 | 780 10 | 550 11 | 12 | 13 | 14 | MultiPageViewExample 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | QCtmMultiPageButtonBox 34 | QWidget 35 |
QCustomUi/QCtmMultiPageButtonBox.h
36 | 1 37 |
38 |
39 | 40 | 41 |
42 | -------------------------------------------------------------------------------- /src/Examples/MultiPageViewExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "MultiPageViewExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | MultiPageViewExample w; 9 | w.show(); 10 | return a.exec(); 11 | } -------------------------------------------------------------------------------- /src/Examples/NavigationBarExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/NavigationBarExample/NavigationBarExample.cpp: -------------------------------------------------------------------------------- 1 | #include "NavigationBarExample.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | NavigationBarExample::NavigationBarExample(QWidget* parent) : QCtmWindow(parent) { init(); } 12 | 13 | NavigationBarExample::~NavigationBarExample() {} 14 | 15 | void NavigationBarExample::init() 16 | { 17 | auto nvBar = new QCtmNavigationBar(this); 18 | setNavigationBar(nvBar); 19 | 20 | QPixmap image({ 120, 70 }); 21 | image.fill(QColor(0, 0, 0, 0)); 22 | { 23 | QPainter p(&image); 24 | QFont font; 25 | font.setBold(true); 26 | font.setPixelSize(20); 27 | p.setFont(font); 28 | QTextOption opt; 29 | opt.setAlignment(Qt::AlignCenter); 30 | p.drawText(image.rect(), "QCustomUi", opt); 31 | } 32 | nvBar->addLogo(image, QCtmNavigationBar::Left); 33 | nvBar->addAction(tr("Action 1"), QCtmNavigationBar::ActionPosition::Left); 34 | 35 | auto search = new QLineEdit; 36 | search->addAction(new QAction(QIcon(":/QCustomUi/Resources/search-light.png"), "", this), QLineEdit::ActionPosition::TrailingPosition); 37 | auto action = new QWidgetAction(this); 38 | action->setDefaultWidget(search); 39 | action->setVisible(false); 40 | nvBar->addAction(action, QCtmNavigationBar::Right); 41 | nvBar->addHelp(QUrl("http://llongww.gitee.io/qcustomuidocument"), QIcon(":/QCustomUi/Resources/help-light.png")); 42 | QTimer::singleShot(2000, [=]() { action->setVisible(true); }); 43 | nvBar->addUser(QIcon(":/QCustomUi/Resources/people-light.png"), "ABC")->setVisible(false); 44 | nvBar->addAction(tr("Center Action"), QCtmNavigationBar::Center); 45 | } 46 | -------------------------------------------------------------------------------- /src/Examples/NavigationBarExample/NavigationBarExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class NavigationBarExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | NavigationBarExample(QWidget* parent = Q_NULLPTR); 11 | ~NavigationBarExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/NavigationBarExample/NavigationBarExample.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Examples/NavigationBarExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "NavigationBarExample.h" 2 | #include 3 | 4 | int main(int argc, char* argv[]) 5 | { 6 | QCtmApplication a(argc, argv); 7 | NavigationBarExample w; 8 | w.show(); 9 | return a.exec(); 10 | } 11 | -------------------------------------------------------------------------------- /src/Examples/NavigationPaneExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/NavigationPaneExample/NavigationPane.cpp: -------------------------------------------------------------------------------- 1 | #include "NavigationPane.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | NavigationPane::NavigationPane(QWidget* parent) : QCtmWindow(parent) { init(); } 9 | 10 | NavigationPane::~NavigationPane() {} 11 | 12 | void NavigationPane::init() 13 | { 14 | auto nvBar = new QCtmNavigationBar(this); 15 | setNavigationBar(nvBar); 16 | 17 | auto creatPane = [=](QCtmNavigationSidePane::DockArea area, const QString& text) 18 | { 19 | auto bar = new QCtmNavigationSidePane(area, nvBar); 20 | bar->setWidget(new QLabel(text)); 21 | return bar; 22 | }; 23 | 24 | nvBar->addPane(tr("Left"), QCtmNavigationBar::ActionPosition::Left, creatPane(QCtmNavigationSidePane::DockArea::Left, "Left")); 25 | nvBar->addPane(tr("Top"), QCtmNavigationBar::ActionPosition::Left, creatPane(QCtmNavigationSidePane::DockArea::Top, "Top")); 26 | nvBar->addPane(tr("Right"), QCtmNavigationBar::ActionPosition::Right, creatPane(QCtmNavigationSidePane::DockArea::Right, "Right")); 27 | nvBar->addPane(tr("Bottom"), QCtmNavigationBar::ActionPosition::Left, creatPane(QCtmNavigationSidePane::DockArea::Bottom, "Bottom")); 28 | } 29 | -------------------------------------------------------------------------------- /src/Examples/NavigationPaneExample/NavigationPane.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class NavigationPane : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | NavigationPane(QWidget* parent = Q_NULLPTR); 11 | ~NavigationPane(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/NavigationPaneExample/NavigationPane.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Examples/NavigationPaneExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "NavigationPane.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | NavigationPane w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/PathBrowserExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/PathBrowserExample/PathBrowserExample.cpp: -------------------------------------------------------------------------------- 1 | #include "PathBrowserExample.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | PathBrowserExample::PathBrowserExample(QWidget* parent /*= nullptr*/) : QCtmWindow(parent) 9 | { 10 | auto layout = new QVBoxLayout(this->centralWidget()); 11 | layout->addWidget(m_path1 = new QCtmPathBrowser(this)); 12 | layout->addWidget(m_path2 = new QCtmPathBrowser(this)); 13 | 14 | m_path1->setPath("C:/Windows/System32"); 15 | m_path2->setPath("C:/Windows/System32"); 16 | m_path2->setReadOnly(true); 17 | 18 | connect(m_path1, 19 | &QCtmPathBrowser::pathClicked, 20 | this, 21 | [=](const QString& path) { QCtmMessageBox::information(this, tr("Path Clicked"), path); }); 22 | connect(m_path1, 23 | &QCtmPathBrowser::pathChanged, 24 | this, 25 | [=](const QString& path) { QCtmMessageBox::information(this, tr("Path Changed"), path); }); 26 | connect(m_path2, 27 | &QCtmPathBrowser::pathClicked, 28 | this, 29 | [=](const QString& path) { QCtmMessageBox::information(this, tr("Path Clicked"), path); }); 30 | connect(m_path2, 31 | &QCtmPathBrowser::pathChanged, 32 | this, 33 | [=](const QString& path) { QCtmMessageBox::information(this, tr("Path Changed"), path); }); 34 | } 35 | 36 | PathBrowserExample::~PathBrowserExample() {} 37 | -------------------------------------------------------------------------------- /src/Examples/PathBrowserExample/PathBrowserExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class QCtmPathBrowser; 6 | class PathBrowserExample : public QCtmWindow 7 | { 8 | Q_OBJECT 9 | public: 10 | PathBrowserExample(QWidget* parent = nullptr); 11 | ~PathBrowserExample(); 12 | 13 | private: 14 | QCtmPathBrowser* m_path1; 15 | QCtmPathBrowser* m_path2; 16 | }; 17 | -------------------------------------------------------------------------------- /src/Examples/PathBrowserExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "PathBrowserExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | PathBrowserExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/RangeSliderExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${INSTALL_BINDIR}/${CMAKE_BUILD_TYPE}) -------------------------------------------------------------------------------- /src/Examples/RangeSliderExample/RangeSliderExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class RangeSliderExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | public: 9 | RangeSliderExample(QWidget* parent = nullptr); 10 | ~RangeSliderExample(); 11 | }; 12 | -------------------------------------------------------------------------------- /src/Examples/RangeSliderExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "RangeSliderExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | RangeSliderExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/RecentViewExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/RecentViewExample/RecentViewExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class RecentViewExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | RecentViewExample(QWidget* parent = Q_NULLPTR); 11 | ~RecentViewExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/RecentViewExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "RecentViewExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | RecentViewExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/SelectionButtonBoxExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/SelectionButtonBoxExample/SelectionButtonBoxExample.cpp: -------------------------------------------------------------------------------- 1 | #include "SelectionButtonBoxExample.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | SelectionButtonBoxExample::SelectionButtonBoxExample(QWidget* parent) : QCtmWindow(parent) 9 | { 10 | auto layout = new QVBoxLayout(this->centralWidget()); 11 | { 12 | auto box = new QCtmSelectionButtonBox({ "Test1", "Test2", "Test3" }); 13 | layout->addWidget(box); 14 | } 15 | { 16 | auto box = new QCtmSelectionButtonBox(); 17 | layout->addWidget(box); 18 | box->setTexts({ { "Test1", "Test2", "Test3" } }); 19 | box->setExclusionPolicy(QCtmSelectionButtonBox::ExclusionPolicy::Exclusive); 20 | } 21 | { 22 | auto box = new QCtmSelectionButtonBox(); 23 | layout->addWidget(box); 24 | box->setTexts({ { "Test1", "Test2", "Test3" } }); 25 | box->setExclusionPolicy(QCtmSelectionButtonBox::ExclusionPolicy::ExclusiveOptional); 26 | } 27 | { 28 | auto box = new QCtmSelectionButtonBox(Qt::Vertical); 29 | layout->addWidget(box); 30 | box->setTexts({ { "Test1", "Test2", "Test3" } }); 31 | box->setExclusionPolicy(QCtmSelectionButtonBox::ExclusionPolicy::ExclusiveOptional); 32 | } 33 | } 34 | 35 | SelectionButtonBoxExample::~SelectionButtonBoxExample() {} 36 | -------------------------------------------------------------------------------- /src/Examples/SelectionButtonBoxExample/SelectionButtonBoxExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class SelectionButtonBoxExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | public: 9 | explicit SelectionButtonBoxExample(QWidget* parent = nullptr); 10 | ~SelectionButtonBoxExample(); 11 | }; -------------------------------------------------------------------------------- /src/Examples/SelectionButtonBoxExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "SelectionButtonBoxExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | SelectionButtonBoxExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/SerialPortComboBoxExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/SerialPortComboBoxExample/SerialPortComboBoxExample.cpp: -------------------------------------------------------------------------------- 1 | #include "SerialPortComboBoxExample.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | SerialPortComboBoxExample::SerialPortComboBoxExample(QWidget* parent) : QCtmWindow(parent) { init(); } 9 | 10 | SerialPortComboBoxExample::~SerialPortComboBoxExample() {} 11 | 12 | void SerialPortComboBoxExample::init() 13 | { 14 | auto layout = new QHBoxLayout(this->centralWidget()); 15 | layout->addStretch(1); 16 | auto box = new QCtmSerialPortComboBox(this); 17 | layout->addWidget(box); 18 | layout->addStretch(1); 19 | } 20 | -------------------------------------------------------------------------------- /src/Examples/SerialPortComboBoxExample/SerialPortComboBoxExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class SerialPortComboBoxExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | SerialPortComboBoxExample(QWidget* parent = Q_NULLPTR); 11 | ~SerialPortComboBoxExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/SerialPortComboBoxExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "SerialPortComboBoxExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | SerialPortComboBoxExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/StageProgressBarExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/StageProgressBarExample/StageProgressBarExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class StageProgressBarExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | StageProgressBarExample(QWidget* parent = Q_NULLPTR); 11 | ~StageProgressBarExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/StageProgressBarExample/StageProgressBarExample.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Examples/StageProgressBarExample/StageProgressBarExample.ui: -------------------------------------------------------------------------------- 1 | 2 | StageProgressBarExampleClass 3 | 4 | 5 | StageProgressBarExampleClass 6 | 7 | 8 | 9 | 0 10 | 0 11 | 600 12 | 400 13 | 14 | 15 | 16 | StageProgressBarExample 17 | $centralwidget$ 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Examples/StageProgressBarExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "StageProgressBarExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | StageProgressBarExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/SwitchButtonExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/SwitchButtonExample/SwitchButtonExample.cpp: -------------------------------------------------------------------------------- 1 | #include "SwitchButtonExample.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | SwitchButtonExample::SwitchButtonExample(QWidget* parent) : QCtmWindow(parent) 8 | { 9 | auto btn = new QCtmSwitchButton(this); 10 | QHBoxLayout* layout = new QHBoxLayout(this->centralWidget()); 11 | layout->addStretch(1); 12 | layout->addWidget(btn); 13 | layout->addStretch(1); 14 | this->setStyleSheet(".SwitchButtonExample{background:white;}"); 15 | // btn->setStyleSheet("QCtmSwitchButton" 16 | // "{" 17 | // "qproperty-uncheckedBackground: #F1ADB3;" 18 | // "qproperty-uncheckedBackgroundBorderColor: transparent;" 19 | // "qproperty-uncheckedHandleBrush: #DB3340;" 20 | // "qproperty-uncheckedHandleBorderColor: transparent;" 21 | // "qproperty-checkedBackground: #ABE3B8;" 22 | // "qproperty-checkedBackgroundBorderColor: transparent;" 23 | // "qproperty-checkedHandleBrush: #2DB84D;" 24 | // "qproperty-checkedHandleBorderColor: transparent;" 25 | // "}"); 26 | // btn->setChecked(true); 27 | // btn->setEnabled(false); 28 | } 29 | 30 | SwitchButtonExample::~SwitchButtonExample() {} 31 | -------------------------------------------------------------------------------- /src/Examples/SwitchButtonExample/SwitchButtonExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class SwitchButtonExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | SwitchButtonExample(QWidget* parent = nullptr); 11 | ~SwitchButtonExample(); 12 | }; 13 | -------------------------------------------------------------------------------- /src/Examples/SwitchButtonExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "SwitchButtonExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | SwitchButtonExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/TitleBarStyleSheetExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/TitleBarStyleSheetExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv, QCtmApplication::ApplicationFlags, false); 8 | auto style = QCtmStyleSheet::defaultStyleSheet(); 9 | style += "QCtmTitleBar" 10 | "{" 11 | " background: #1F1F1F;" 12 | " color: white;" 13 | "}" 14 | "QCtmTitleBar QAbstractButton:hover,QCtmTitleBar QAbstractButton:pressed" 15 | "{" 16 | " background: #3D3D3D;" 17 | "}" 18 | "QCtmTitleBar #closeBtn:hover,QCtmTitleBar #closeBtn:pressed" 19 | "{" 20 | " background: #C32B1C;" 21 | "}" 22 | "QCtmTitleBar #closeBtn" 23 | "{" 24 | " qproperty-icon: url(:/QCustomUi/Resources/close.png);" 25 | "}" 26 | "QCtmTitleBar QAbstractButton:hover,QCtmTitleBar QAbstractButton:pressed" 27 | "{" 28 | " background: #3D3D3D;" 29 | "}" 30 | "QCtmMaximumSizeButton" 31 | "{" 32 | " qproperty-maximumSizedIcon: url(:/QCustomUi/Resources/maximize.png);" 33 | " qproperty-revertIcon: url(:/QCustomUi/Resources/maximize_max.png);" 34 | "}" 35 | "QCtmTitleBar #minimumSizeBtn" 36 | "{" 37 | " qproperty-icon: url(:/QCustomUi/Resources/minimize.png);" 38 | "}"; 39 | a.setStyleSheet(style); 40 | QCtmWindow w; 41 | w.show(); 42 | return a.exec(); 43 | } 44 | -------------------------------------------------------------------------------- /src/Examples/ToolBoxExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/ToolBoxExample/Resource/NewFolder.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Examples/ToolBoxExample/Resource/NewFolderActive.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Examples/ToolBoxExample/TestDialog.cpp: -------------------------------------------------------------------------------- 1 | #include "TestDialog.h" 2 | 3 | #include 4 | 5 | TestDialog::TestDialog(QWidget* parent) : QCtmDialog(parent) 6 | { 7 | ui.setupUi(centralWidget()); 8 | connect(ui.okBtn, &QToolButton::clicked, this, &TestDialog::accept); 9 | connect(ui.dlgBtn, 10 | &QToolButton::clicked, 11 | this, 12 | [=]() 13 | { 14 | QCtmMessageBox::information(this, QStringLiteral("test"), QStringLiteral("test")); 15 | return; 16 | }); 17 | } 18 | 19 | TestDialog::~TestDialog() {} 20 | -------------------------------------------------------------------------------- /src/Examples/ToolBoxExample/TestDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ui_TestDialog.h" 4 | 5 | #include 6 | 7 | class TestDialog: public QCtmDialog 8 | { 9 | Q_OBJECT 10 | public: 11 | TestDialog(QWidget* parent = Q_NULLPTR); 12 | ~TestDialog(); 13 | 14 | private: 15 | Ui::TestDialog ui; 16 | }; 17 | -------------------------------------------------------------------------------- /src/Examples/ToolBoxExample/TestDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | TestDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | 15 | 16 | 17 | 确定 18 | 19 | 20 | 21 | 22 | 23 | 24 | 弹窗 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/Examples/ToolBoxExample/ToolBoxExample.cpp: -------------------------------------------------------------------------------- 1 | #include "ToolBoxExample.h" 2 | #include "TestDialog.h" 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | struct ToolBoxExample::Impl 10 | { 11 | TestDialog* dialog { nullptr }; 12 | }; 13 | 14 | ToolBoxExample::ToolBoxExample(QWidget* parent) : QWidget(parent), m_impl(std::make_unique()) 15 | { 16 | ui.setupUi(this); 17 | QIcon icon; 18 | icon.addFile(":/ToolBoxExample/Resource/NewFolder.svg", QSize(), QIcon::Mode::Normal); 19 | icon.addFile(":/ToolBoxExample/Resource/NewFolderActive.svg", QSize(), QIcon::Mode::Selected); 20 | auto action = new QAction(icon, "", this); 21 | addAction(action); 22 | connect(action, &QAction::triggered, this, [=]() { QCtmMessageBox::information(this, tr("Tips"), tr("New Folder")); }); 23 | // TEST DIALOG BUG 24 | m_impl->dialog = new TestDialog(this); 25 | connect(ui.toolButton, &QToolButton::clicked, this, [=]() { m_impl->dialog->exec(); }); 26 | // end 27 | } 28 | 29 | ToolBoxExample::~ToolBoxExample() {} 30 | -------------------------------------------------------------------------------- /src/Examples/ToolBoxExample/ToolBoxExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ui_ToolBoxExample.h" 4 | 5 | class ToolBoxExample : public QWidget 6 | { 7 | Q_OBJECT 8 | public: 9 | ToolBoxExample(QWidget* parent = nullptr); 10 | ~ToolBoxExample(); 11 | 12 | private: 13 | Ui::ToolBoxExample ui; 14 | struct Impl; 15 | std::unique_ptr m_impl; 16 | }; 17 | -------------------------------------------------------------------------------- /src/Examples/ToolBoxExample/ToolBoxExample.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Resource/NewFolder.svg 4 | Resource/NewFolderActive.svg 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Examples/ToolBoxExample/ToolBoxExample.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ToolBoxExample 4 | 5 | 6 | 7 | 0 8 | 0 9 | 287 10 | 619 11 | 12 | 13 | 14 | ToolBoxExample 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | dialopg 24 | 25 | 26 | 27 | 28 | 29 | 30 | false 31 | 32 | 33 | 34 | 1 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/Examples/ToolBoxExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ToolBoxExample.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | int main(int argc, char* argv[]) 11 | { 12 | QCtmApplication a(argc, argv); 13 | 14 | QCtmToolBox* toolBox = new QCtmToolBox; 15 | ToolBoxExample* w = new ToolBoxExample(toolBox); 16 | toolBox->addWidget(QObject::tr("Explorer"), w); 17 | QCtmWindow window; 18 | QSplitter* sp = new QSplitter(&window); 19 | auto layout = new QHBoxLayout(window.centralWidget()); 20 | layout->setContentsMargins(0, 0, 0, 0); 21 | layout->addWidget(sp); 22 | sp->addWidget(toolBox); 23 | auto content = new QWidget(sp); 24 | sp->addWidget(content); 25 | // auto edit = new QLineEdit(content); 26 | sp->setStretchFactor(1, 1); 27 | window.show(); 28 | return a.exec(); 29 | } 30 | -------------------------------------------------------------------------------- /src/Examples/ULongLongSpinBoxExample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/ULongLongSpinBoxExample/ULongLongSpinBoxExample.cpp: -------------------------------------------------------------------------------- 1 | #include "ULongLongSpinBoxExample.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | ULongLongSpinBoxExample::ULongLongSpinBoxExample(QWidget* parent) : QCtmWindow(parent) { init(); } 10 | 11 | ULongLongSpinBoxExample::~ULongLongSpinBoxExample() {} 12 | 13 | void ULongLongSpinBoxExample::init() 14 | { 15 | auto layout = new QHBoxLayout(this->centralWidget()); 16 | layout->addStretch(1); 17 | auto box = new QCtmULongLongSpinBox(this); 18 | box->setRange(std::numeric_limits::min(), std::numeric_limits::max()); 19 | connect(box, 20 | &QCtmULongLongSpinBox::valueChanged, 21 | this, 22 | [this](qulonglong value) 23 | { 24 | qDebug() << QString::number(value); // QCtmMessageBox::information(this, "Value Changed", QString::number(value)); 25 | }); 26 | box->setMinimumWidth(200); 27 | // box->setSuffix("V"); 28 | // box->setPrefix("Data:"); 29 | layout->addWidget(box); 30 | layout->addStretch(1); 31 | } 32 | -------------------------------------------------------------------------------- /src/Examples/ULongLongSpinBoxExample/ULongLongSpinBoxExample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class ULongLongSpinBoxExample : public QCtmWindow 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | ULongLongSpinBoxExample(QWidget* parent = Q_NULLPTR); 11 | ~ULongLongSpinBoxExample(); 12 | 13 | private: 14 | void init(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/Examples/ULongLongSpinBoxExample/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ULongLongSpinBoxExample.h" 2 | 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | QCtmApplication a(argc, argv); 8 | ULongLongSpinBoxExample w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/Examples/WindowAndDialogExamples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | string( REGEX REPLACE ".*/(.*)" "\\1" TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 2 | 3 | include_directories(../../) 4 | 5 | file(GLOB HEADERS *.h) 6 | file(GLOB SOURCES *.cpp) 7 | file(GLOB RESOURCES *.qrc) 8 | file(GLOB UI *.ui) 9 | 10 | source_group("Headers" FILES ${HEADERS}) 11 | source_group("Sources" FILES ${SOURCES}) 12 | source_group("Resource" FILES ${RESOURCES}) 13 | source_group("UI" FILES ${UI}) 14 | 15 | add_executable(${TARGET_NAME} WIN32 16 | ${HEADERS} 17 | ${SOURCES} 18 | ${RESOURCES} 19 | ${UI} 20 | ) 21 | 22 | set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples") 23 | target_link_libraries(${TARGET_NAME} PUBLIC QCustomUi PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) 24 | 25 | install(TARGETS ${TARGET_NAME} 26 | CONFIGURATIONS Debug 27 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Debug) 28 | install(TARGETS ${TARGET_NAME} 29 | CONFIGURATIONS Release 30 | RUNTIME DESTINATION ${INSTALL_BINDIR}/Release) 31 | -------------------------------------------------------------------------------- /src/Examples/WindowAndDialogExamples/WindowAndDialogExamples.cpp: -------------------------------------------------------------------------------- 1 | #include "WindowAndDialogExamples.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | WindowAndDialogExamples::WindowAndDialogExamples(QWidget* parent) : QCtmWindow(parent) 17 | { 18 | ui.setupUi(this->centralWidget()); 19 | auto* dlg = new QCtmDialog(this); 20 | dlg->setWindowFlag(Qt::WindowMinMaxButtonsHint); 21 | auto layout = new QHBoxLayout(dlg->centralWidget()); 22 | auto btn = new QPushButton(dlg); 23 | layout->addWidget(btn); 24 | connect(ui.popDialogBtn, &QPushButton::clicked, this, [=]() { dlg->exec(); }); 25 | connect(btn, &QPushButton::clicked, this, [=]() { QCtmMessageBox::information(dlg, "Test", "Test"); }); 26 | // this->titleBar()->setFixedHeight(50); 27 | this->titleBar()->addAction(new QAction(tr("Test Button"))); 28 | auto action = new QWidgetAction(this); 29 | action->setDefaultWidget(new QLineEdit(this)); 30 | this->titleBar()->addAction(action); 31 | auto menuBar = new QMenuBar(this); 32 | this->setMenuBar(menuBar); 33 | menuBar->addMenu(tr("&File"))->addAction(tr("&Open")); 34 | this->setStatusBar(new QStatusBar(this)); 35 | } 36 | -------------------------------------------------------------------------------- /src/Examples/WindowAndDialogExamples/WindowAndDialogExamples.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ui_WindowAndDialogExamples.h" 4 | 5 | #include 6 | 7 | class WindowAndDialogExamples : public QCtmWindow 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | WindowAndDialogExamples(QWidget* parent = Q_NULLPTR); 13 | 14 | private: 15 | Ui::WindowAndDialogExamplesClass ui; 16 | }; 17 | -------------------------------------------------------------------------------- /src/Examples/WindowAndDialogExamples/WindowAndDialogExamples.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Examples/WindowAndDialogExamples/WindowAndDialogExamples.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | WindowAndDialogExamplesClass 4 | 5 | 6 | 7 | 0 8 | 0 9 | 600 10 | 400 11 | 12 | 13 | 14 | WindowAndDialogExamples 15 | 16 | 17 | 18 | 19 | 20 | Pop Dialog 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/Examples/WindowAndDialogExamples/main.cpp: -------------------------------------------------------------------------------- 1 | #include "WindowAndDialogExamples.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | int main(int argc, char* argv[]) 13 | { 14 | QCtmApplication a(argc, argv); 15 | a.setWindowIcon(a.style()->standardIcon(QStyle::SP_FileIcon)); 16 | WindowAndDialogExamples w; 17 | w.showMaximized(); 18 | return a.exec(); 19 | } 20 | -------------------------------------------------------------------------------- /src/QCustomUi/Docs/QCtmAbstractMessageTipData.qdoc: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | /*! 21 | \class QCtmAbstractMessageTipData 22 | \brief 消息提示数据接口类. 23 | \ingroup QCustomUi 24 | \inmodule QCustomUi 25 | */ 26 | 27 | /*! 28 | \fn QCtmAbstractMessageTipData::QCtmAbstractMessageTipData() 29 | \brief 构造函数. 30 | */ 31 | 32 | /*! 33 | \fn QCtmAbstractMessageTipData::~QCtmAbstractMessageTipData() 34 | \brief 析构函数. 35 | */ -------------------------------------------------------------------------------- /src/QCustomUi/Docs/QCtmClassifyTreeIconItem.qdoc: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | /*! 21 | \class QCtmClassifyTreeIconItem 22 | \brief 这是一个标准的图标item, 用在QCtmClassifyTreeModel中. 23 | \inherits QCtmClassifyTreeItem 24 | \ingroup QCustomUi 25 | \inmodule QCustomUi 26 | \inheaderfile QCtmClassifyTreeIconItem.h 27 | */ 28 | 29 | /*! 30 | \reimp 31 | \fn int QCtmClassifyTreeIconItem::itemType() const 32 | */ 33 | -------------------------------------------------------------------------------- /src/QCustomUi/Private/QCtmActionGroup_p.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include 23 | 24 | #include 25 | 26 | class QCtmActionGroup : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | QCtmActionGroup(QObject* parent); 32 | ~QCtmActionGroup(); 33 | 34 | void addAction(QAction* action); 35 | void removeAction(QAction* action); 36 | private slots: 37 | void actionChanged(); 38 | 39 | private: 40 | struct Impl; 41 | std::unique_ptr m_impl; 42 | }; 43 | -------------------------------------------------------------------------------- /src/QCustomUi/Private/QCtmLogFilterModel.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include 23 | 24 | #include 25 | 26 | class QCtmLogFilterModel : public QSortFilterProxyModel 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit QCtmLogFilterModel(QObject* parent = nullptr); 32 | ~QCtmLogFilterModel(); 33 | 34 | void search(const QString& keyword); 35 | bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const override; 36 | public slots: 37 | void showLog(QtMsgType type, bool show); 38 | 39 | private: 40 | struct Impl; 41 | std::unique_ptr m_impl; 42 | }; 43 | -------------------------------------------------------------------------------- /src/QCustomUi/Private/QCtmNavigationImageButton_p.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include "QCtmToolButton_p.h" 23 | 24 | #include 25 | 26 | class QCtmNavigationImageButton : public QCtmToolButton 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | QCtmNavigationImageButton(QWidget* parent); 32 | ~QCtmNavigationImageButton(); 33 | 34 | protected: 35 | void paintEvent(QPaintEvent* e) override; 36 | void resizeEvent(QResizeEvent* e) override; 37 | QSize sizeHint() const override; 38 | 39 | private: 40 | struct Impl; 41 | std::unique_ptr m_impl; 42 | }; 43 | -------------------------------------------------------------------------------- /src/QCustomUi/Private/QCtmPaletteFactor.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include 23 | 24 | #include 25 | 26 | class QCtmPaletteFactor 27 | { 28 | public: 29 | QCtmPaletteFactor(); 30 | static void init(QWidget* widget); 31 | 32 | protected: 33 | virtual void initQCtmTitleBar(QWidget* bar); 34 | virtual void initQCtmNavigationBar(QWidget* bar); 35 | 36 | private: 37 | struct Impl; 38 | std::unique_ptr m_impl; 39 | }; -------------------------------------------------------------------------------- /src/QCustomUi/Private/QCtmStyleOptionSelectionButtonBox.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include 23 | 24 | #if QT_VERSION_MAJOR < 6 25 | class QCtmStyleOptionSelectionButtonBox : public QStyleOptionHeader 26 | { 27 | public: 28 | using QStyleOptionHeader::QStyleOptionHeader; 29 | }; 30 | #else 31 | class QCtmStyleOptionSelectionButtonBox : public QStyleOptionHeaderV2 32 | { 33 | public: 34 | using QStyleOptionHeaderV2::QStyleOptionHeaderV2; 35 | }; 36 | #endif -------------------------------------------------------------------------------- /src/QCustomUi/Private/QCtmStyle_p.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include 23 | 24 | class QCtmStyle : public QProxyStyle 25 | { 26 | public: 27 | QCtmStyle(QStyle* style = Q_NULLPTR) : QProxyStyle(style) {} 28 | QPixmap standardPixmap(StandardPixmap standardIcon, 29 | const QStyleOption* option = Q_NULLPTR, 30 | const QWidget* widget = Q_NULLPTR) const override; 31 | }; 32 | -------------------------------------------------------------------------------- /src/QCustomUi/Private/QCtmToolBoxItem.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | QCtmToolBoxItem 4 | 5 | 6 | 7 | 0 8 | 0 9 | 513 10 | 393 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 0 19 | 20 | 21 | 0 22 | 23 | 24 | 0 25 | 26 | 27 | 0 28 | 29 | 30 | 0 31 | 32 | 33 | 34 | 35 | 36 | 0 37 | 20 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 0 47 | 48 | 49 | 0 50 | 51 | 52 | 0 53 | 54 | 55 | 0 56 | 57 | 58 | 0 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | QCtmToolBoxItemTitle 68 | QWidget 69 |
Private/QCtmToolBoxItemTitle_p.h
70 | 1 71 |
72 |
73 | 74 | 75 |
76 | -------------------------------------------------------------------------------- /src/QCustomUi/Private/QCtmToolBoxItemTitle_p.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include 23 | 24 | class QCtmToolBoxItemTitle : public QWidget 25 | { 26 | Q_OBJECT 27 | public: 28 | QCtmToolBoxItemTitle(QWidget* parent); 29 | ~QCtmToolBoxItemTitle(); 30 | 31 | void setTitle(const QString& title); 32 | const QString& title() const; 33 | void setIcon(const QIcon& icon); 34 | const QIcon& icon() const; 35 | 36 | protected: 37 | void paintEvent(QPaintEvent* event) override; 38 | 39 | private: 40 | struct Impl; 41 | std::unique_ptr m_impl; 42 | }; 43 | -------------------------------------------------------------------------------- /src/QCustomUi/Private/QtVersionAdapter.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #include 21 | 22 | namespace QtVersionAdapter 23 | { 24 | template 25 | inline QPoint eventPos(Event* e) 26 | { 27 | #if QT_VERSION_MAJOR < 6 28 | return e->pos(); 29 | #else 30 | return e->position().toPoint(); 31 | #endif 32 | } 33 | } // namespace QtVersionAdapter -------------------------------------------------------------------------------- /src/QCustomUi/Private/Util.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #include "QCtmWidgetItem_p.h" 21 | #include "Util_p.h" 22 | 23 | QCtmWidgetItemPtr Util::find(QAction* action, const QList& items) 24 | { 25 | for (auto& item : items) 26 | { 27 | if (item->action() == action) 28 | return item; 29 | } 30 | return nullptr; 31 | } 32 | 33 | QCtmWidgetItemPtr Util::find(QWidget* widget, const QList& items) 34 | { 35 | for (auto& item : items) 36 | { 37 | if (item->widget() == widget) 38 | return item; 39 | } 40 | return nullptr; 41 | } 42 | -------------------------------------------------------------------------------- /src/QCustomUi/QCtmAbstractMessageTipView.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include "QCtmNavigationSidePane.h" 23 | #include "qcustomui_global.h" 24 | 25 | class QCtmAbstractMessageTipModel; 26 | class QCtmNavigationBar; 27 | 28 | class QCUSTOMUI_EXPORT QCtmAbstractMessageTipView : public QCtmNavigationSidePane 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit QCtmAbstractMessageTipView(QCtmNavigationBar* parent); 34 | ~QCtmAbstractMessageTipView(); 35 | virtual void setModel(QCtmAbstractMessageTipModel* model) = 0; 36 | virtual QCtmAbstractMessageTipModel* model() const = 0; 37 | }; 38 | -------------------------------------------------------------------------------- /src/QCustomUi/QCtmApplication.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include "qcustomui_global.h" 23 | 24 | #include 25 | 26 | #include 27 | 28 | class QCUSTOMUI_EXPORT QCtmApplication : public QApplication 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | QCtmApplication(int& argc, char** argv, int = ApplicationFlags, bool defaultStyle = true); 34 | ~QCtmApplication(); 35 | 36 | bool checkOtherProcess(const QString& key); 37 | #ifdef Q_OS_WIN 38 | static void setGetObjectDisabled(bool d); 39 | #endif 40 | private: 41 | struct Impl; 42 | std::unique_ptr m_impl; 43 | friend class WindowsEventFilter; 44 | }; 45 | -------------------------------------------------------------------------------- /src/QCustomUi/QCtmComboBox.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include "qcustomui_global.h" 23 | 24 | #include 25 | 26 | class QCUSTOMUI_EXPORT QCtmComboBox : public QComboBox 27 | { 28 | Q_OBJECT 29 | public: 30 | explicit QCtmComboBox(QWidget* parent = nullptr); 31 | ~QCtmComboBox(); 32 | 33 | signals: 34 | void aboutToShowPopup(); 35 | 36 | protected: 37 | void showPopup() override; 38 | }; 39 | -------------------------------------------------------------------------------- /src/QCustomUi/QCtmDigitKeyboard.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | QCtmDigitKeyboard 4 | 5 | 6 | 7 | 0 8 | 0 9 | 422 10 | 268 11 | 12 | 13 | 14 | 15 | 16 | 17 | true 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Qt::NoFocus 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/QCustomUi/QCtmFile.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | #pragma once 20 | 21 | #include "qcustomui_global.h" 22 | 23 | #include 24 | 25 | #include 26 | 27 | class QCUSTOMUI_EXPORT QCtmFile : public QFile 28 | { 29 | public: 30 | using QFile::QFile; 31 | 32 | static std::optional load(const QString& file, QIODevice::OpenMode mode = QIODevice::ReadOnly); 33 | static bool save(const QString& file, const QByteArray& content, QIODevice::OpenMode mode = QIODevice::WriteOnly); 34 | }; 35 | -------------------------------------------------------------------------------- /src/QCustomUi/QCtmHexLineEdit.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | #pragma once 20 | 21 | #include "qcustomui_global.h" 22 | 23 | #include 24 | 25 | class QCUSTOMUI_EXPORT QCtmHexLineEdit : public QLineEdit 26 | { 27 | Q_OBJECT 28 | public: 29 | explicit QCtmHexLineEdit(QWidget* parent = nullptr); 30 | explicit QCtmHexLineEdit(const QString& text, QWidget* parent = nullptr); 31 | ~QCtmHexLineEdit(); 32 | }; 33 | -------------------------------------------------------------------------------- /src/QCustomUi/QCtmLogEvent.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include "QCtmLogData.h" 23 | #include "qcustomui_global.h" 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | class QCUSTOMUI_EXPORT QCtmLogEvent : public QEvent 32 | { 33 | public: 34 | enum 35 | { 36 | QCtmLog = QEvent::User + 0xFE 37 | }; 38 | explicit QCtmLogEvent(QCtmLogDataPtr log); 39 | ~QCtmLogEvent(); 40 | 41 | QCtmLogDataPtr log() const; 42 | 43 | private: 44 | struct Impl; 45 | std::unique_ptr m_impl; 46 | }; 47 | -------------------------------------------------------------------------------- /src/QCustomUi/QCtmSerialPortComboBox.cpp: -------------------------------------------------------------------------------- 1 | #include "QCtmSerialPortComboBox.h" 2 | 3 | #include 4 | 5 | struct QCtmSerialPortComboBox::Impl 6 | { 7 | QStringList items; 8 | }; 9 | 10 | /*! 11 | \class QCtmSerialPortComboBox 12 | \brief 串口选择框,下拉选择时自动刷新串口列表. 13 | \inherits QCtmComboBox 14 | \ingroup QCustomUi 15 | \inmodule QCustomUi 16 | \inheaderfile QCtmSerialPortComboBox.h 17 | */ 18 | 19 | /*! 20 | \brief 构造函数 \a parent. 21 | */ 22 | QCtmSerialPortComboBox::QCtmSerialPortComboBox(QWidget* parent /*= nullptr*/) : QCtmComboBox(parent), m_impl(std::make_unique()) 23 | { 24 | connect(this, &QCtmComboBox::aboutToShowPopup, this, &QCtmSerialPortComboBox::onAboutToShowPopup); 25 | onAboutToShowPopup(); 26 | } 27 | 28 | /*! 29 | \brief 析构函数. 30 | */ 31 | QCtmSerialPortComboBox::~QCtmSerialPortComboBox() {} 32 | 33 | /*! 34 | \brief 响应弹出框消息,刷新串口列表. 35 | */ 36 | void QCtmSerialPortComboBox::onAboutToShowPopup() 37 | { 38 | auto oldItem = this->currentText(); 39 | auto ports = QSerialPortInfo::availablePorts(); 40 | QStringList items; 41 | for (const auto& port : ports) 42 | { 43 | items.push_back(port.portName()); 44 | } 45 | std::sort(items.begin(), items.end()); 46 | if (m_impl->items == items) 47 | return; 48 | m_impl->items = items; 49 | 50 | QSignalBlocker blocker(this); 51 | clear(); 52 | addItems(items); 53 | if (items.contains(oldItem)) 54 | { 55 | setCurrentText(oldItem); 56 | } 57 | else 58 | { 59 | blocker.unblock(); 60 | auto current = currentText(); 61 | if (this->isEditable()) 62 | emit editTextChanged(current); 63 | emit currentTextChanged(current); 64 | emit currentIndexChanged(currentIndex()); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/QCustomUi/QCtmSerialPortComboBox.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | #pragma once 20 | 21 | #include "QCtmComboBox.h" 22 | 23 | class QCUSTOMUI_EXPORT QCtmSerialPortComboBox : public QCtmComboBox 24 | { 25 | Q_OBJECT 26 | public: 27 | explicit QCtmSerialPortComboBox(QWidget* parent = nullptr); 28 | ~QCtmSerialPortComboBox(); 29 | 30 | protected slots: 31 | virtual void onAboutToShowPopup(); 32 | 33 | private: 34 | struct Impl; 35 | std::unique_ptr m_impl; 36 | }; -------------------------------------------------------------------------------- /src/QCustomUi/QCtmStyleSheet.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include "qcustomui_global.h" 23 | 24 | #include 25 | 26 | class QCUSTOMUI_EXPORT QCtmStyleSheet 27 | { 28 | public: 29 | static QString defaultStyleSheet(); 30 | }; 31 | -------------------------------------------------------------------------------- /src/QCustomUi/QCtmTableView.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | ** ** 3 | ** Copyright (C) 2019-2025 LiLong ** 4 | ** This file is part of QCustomUi. ** 5 | ** ** 6 | ** QCustomUi is free software: you can redistribute it and/or modify ** 7 | ** it under the terms of the GNU Lesser General Public License as published by ** 8 | ** the Free Software Foundation, either version 3 of the License, or ** 9 | ** (at your option) any later version. ** 10 | ** ** 11 | ** QCustomUi is distributed in the hope that it will be useful, ** 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 | ** GNU Lesser General Public License for more details. ** 15 | ** ** 16 | ** You should have received a copy of the GNU Lesser General Public License ** 17 | ** along with QCustomUi. If not, see . ** 18 | **********************************************************************************/ 19 | 20 | #pragma once 21 | 22 | #include "qcustomui_global.h" 23 | 24 | #include 25 | 26 | class QCtmTableItemDelegate; 27 | 28 | class QCUSTOMUI_EXPORT QCtmTableView : public QTableView 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit QCtmTableView(QWidget* parent = nullptr); 34 | ~QCtmTableView(); 35 | 36 | protected: 37 | bool viewportEvent(QEvent* event) override; 38 | virtual void setHoverIndex(const QModelIndex& index); 39 | 40 | private: 41 | QCtmTableItemDelegate* m_delegate; 42 | QModelIndex m_hover; 43 | }; 44 | -------------------------------------------------------------------------------- /src/QCustomUi/QCtmWindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | QCtmWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 681 10 | 373 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 0 19 | 20 | 21 | 0 22 | 23 | 24 | 0 25 | 26 | 27 | 0 28 | 29 | 30 | 0 31 | 32 | 33 | 34 | 35 | 0 36 | 37 | 38 | 39 | 40 | QLayout::SetMinimumSize 41 | 42 | 43 | 44 | 45 | 46 | 47 | QLayout::SetMinimumSize 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | QLayout::SetMinimumSize 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/QCustomUi/QCustomUi.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Resources/maximize.png 4 | Resources/maximize_max.png 5 | Resources/minimize.png 6 | Resources/hideButton.png 7 | Resources/system_menu.png 8 | Resources/messageTip.png 9 | Resources/help.png 10 | Resources/people.png 11 | Resources/close-light.png 12 | Resources/help-light.png 13 | Resources/hideButton-light.png 14 | Resources/maximize-light.png 15 | Resources/messageTip-light.png 16 | Resources/minimize-light.png 17 | Resources/people-light.png 18 | Resources/maximize_max-light.png 19 | Resources/close.png 20 | Resources/tree-close.png 21 | Resources/tree-open.png 22 | Resources/tree-open-light.png 23 | Resources/tree-close-light.png 24 | Resources/Error.png 25 | Resources/info.png 26 | Resources/warning.png 27 | Resources/search.png 28 | Resources/search-light.png 29 | Resources/copy.png 30 | Resources/copy-light.png 31 | Resources/clear-light.png 32 | Resources/drop-down.png 33 | Resources/drop-down-light.png 34 | qcustomui_zh.qm 35 | Resources/edit.png 36 | Resources/cancel.png 37 | Resources/ok.png 38 | Resources/loading.gif 39 | 40 | 41 | Resources/stylesheet/sw-light.css 42 | 43 | 44 | Resources/QCtmDocking/dockTitleFixed.svg 45 | Resources/QCtmDocking/dockTitleFloat.svg 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/QCustomUi/Resources/Clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/Clear.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/Error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/Error.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/QCtmDocking/dockTitleFixed.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/QCustomUi/Resources/QCtmDocking/dockTitleFloat.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/QCustomUi/Resources/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/cancel.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/clear-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/clear-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/close-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/close-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/close.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/copy-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/copy-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/copy.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/drop-down-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/drop-down-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/drop-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/drop-down.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/edit.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/help-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/help-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/help.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/hideButton-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/hideButton-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/hideButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/hideButton.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/info.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/loading.gif -------------------------------------------------------------------------------- /src/QCustomUi/Resources/maximize-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/maximize-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/maximize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/maximize.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/maximize_max-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/maximize_max-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/maximize_max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/maximize_max.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/messageTip-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/messageTip-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/messageTip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/messageTip.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/minimize-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/minimize-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/minimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/minimize.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/ok.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/people-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/people-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/people.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/people.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/search-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/search-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/search.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/system_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/system_menu.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/tree-close-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/tree-close-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/tree-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/tree-close.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/tree-open-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/tree-open-light.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/tree-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/tree-open.png -------------------------------------------------------------------------------- /src/QCustomUi/Resources/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/Resources/warning.png -------------------------------------------------------------------------------- /src/QCustomUi/qcustomui_zh.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilongww/QCustomUI/1b96a37ebd6fef59b261521f272cfcf5a94b414d/src/QCustomUi/qcustomui_zh.qm -------------------------------------------------------------------------------- /src/Tests/Auto/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(QCtmIPAddressEdit) 2 | add_subdirectory(QCtmSwitchButton) 3 | add_subdirectory(QCtmCircleProgressBar) 4 | add_subdirectory(QCtmWindow) 5 | add_subdirectory(QCtmDialog) 6 | add_subdirectory(QCtmStageProgressBar) 7 | add_subdirectory(QCtmEditLabel) 8 | add_subdirectory(QCtmDrawerWidget) 9 | add_subdirectory(QCtmToolBox) 10 | add_subdirectory(QCtmLoadingDialog) 11 | add_subdirectory(QCtmDigitKeyboard) -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmCircleProgressBar/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qcustomui_internal_add_test(tst_QCtmCircleProgressBar 2 | SOURCES 3 | tst_QCtmCircleProgressBar.cpp 4 | PUBLIC_LIBRARIES 5 | QCustomUi 6 | PRIVATE_LIBRARIES 7 | Qt::Gui 8 | Qt::Widgets 9 | Qt::Test 10 | ) -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmDialog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qcustomui_internal_add_test(tst_QCtmDialog 2 | SOURCES 3 | tst_QCtmDialog.cpp 4 | PUBLIC_LIBRARIES 5 | QCustomUi 6 | PRIVATE_LIBRARIES 7 | Qt::Gui 8 | Qt::Widgets 9 | Qt::Test 10 | ) -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmDialog/tst_QCtmDialog.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class tst_QCtmDialog : public QObject 10 | { 11 | Q_OBJECT 12 | private slots: 13 | void taskTitleBar(); 14 | }; 15 | 16 | void tst_QCtmDialog::taskTitleBar() 17 | { 18 | QCtmDialog w; 19 | QPointer oldbar = w.titleBar(); 20 | delete oldbar; 21 | auto bar = w.titleBar(); 22 | QVERIFY(bar != oldbar); 23 | bar = new QCtmTitleBar(&w); 24 | w.setTitleBar(bar); 25 | QVERIFY(bar == w.titleBar()); 26 | w.setTitleBar(nullptr); 27 | QVERIFY(bar != w.titleBar()); 28 | } 29 | 30 | QTEST_MAIN(tst_QCtmDialog) 31 | 32 | #include "tst_QCtmDialog.moc" 33 | -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmDigitKeyboard/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qcustomui_internal_add_test(tst_QCtmDigitKeyboard 2 | SOURCES 3 | tst_QCtmDigitKeyboard.cpp 4 | PUBLIC_LIBRARIES 5 | QCustomUi 6 | PRIVATE_LIBRARIES 7 | Qt::Gui 8 | Qt::Widgets 9 | Qt::Test 10 | ) -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmDrawerWidget/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qcustomui_internal_add_test(tst_QCtmDrawerWidget 2 | SOURCES 3 | tst_QCtmDrawerWidget.cpp 4 | PUBLIC_LIBRARIES 5 | QCustomUi 6 | PRIVATE_LIBRARIES 7 | Qt::Gui 8 | Qt::Widgets 9 | Qt::Test 10 | ) 11 | -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmEditLabel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qcustomui_internal_add_test(tst_QCtmEditLabel 2 | SOURCES 3 | tst_QCtmEditLabel.cpp 4 | PUBLIC_LIBRARIES 5 | QCustomUi 6 | PRIVATE_LIBRARIES 7 | Qt::Gui 8 | Qt::Widgets 9 | Qt::Test 10 | ) 11 | -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmEditLabel/tst_QCtmEditLabel.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class tst_QCtmEditLabel : public QObject 10 | { 11 | Q_OBJECT 12 | private slots: 13 | void taskGetSet(); 14 | void editFinished(); 15 | }; 16 | 17 | void tst_QCtmEditLabel::taskGetSet() 18 | { 19 | QCtmEditLabel label; 20 | auto readOnly = label.isReadOnly(); 21 | label.setReadOnly(!readOnly); 22 | QVERIFY(readOnly != label.isReadOnly()); 23 | 24 | { 25 | auto icon = label.style()->standardIcon(QStyle::SP_ArrowBack); 26 | label.setEditButtonIcon(icon); 27 | QVERIFY(!label.editButtonIcon().isNull()); 28 | } 29 | 30 | { 31 | auto icon = label.style()->standardIcon(QStyle::SP_ArrowDown); 32 | label.setFinishButtonIcon(icon); 33 | QVERIFY(!label.finishButtonIcon().isNull()); 34 | } 35 | 36 | { 37 | auto icon = label.style()->standardIcon(QStyle::SP_ArrowForward); 38 | label.setRevertButtonIcon(icon); 39 | QVERIFY(!label.revertButtonIcon().isNull()); 40 | } 41 | } 42 | 43 | void tst_QCtmEditLabel::editFinished() 44 | { 45 | QCtmEditLabel label; 46 | QSignalSpy spy(&label, &QCtmEditLabel::editFinished); 47 | label.show(); 48 | QVERIFY(QTest::qWaitForWindowExposed(&label)); 49 | QMetaObject::invokeMethod(&label, "onEditButtonClicked"); 50 | auto input = label.findChild(); 51 | QVERIFY(input); 52 | QTest::sendKeyEvent(QTest::KeyAction::Click, input, Qt::Key_0, QTest::keyToAscii(Qt::Key_0), Qt::KeyboardModifier::NoModifier); 53 | auto applyBtn = label.findChild("QCtmEditLabel_applyBtn"); 54 | QTest::mouseClick(applyBtn, Qt::LeftButton); 55 | QVERIFY(spy.size() == 1); 56 | } 57 | 58 | QTEST_MAIN(tst_QCtmEditLabel) 59 | 60 | #include "tst_QCtmEditLabel.moc" 61 | -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmIPAddressEdit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qcustomui_internal_add_test(tst_QCtmIPAddressEdit 2 | SOURCES 3 | tst_QCtmIPAddressEdit.cpp 4 | PUBLIC_LIBRARIES 5 | QCustomUi 6 | PRIVATE_LIBRARIES 7 | Qt::Gui 8 | Qt::Widgets 9 | Qt::Test 10 | ) 11 | -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmLoadingDialog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qcustomui_internal_add_test(tst_QCtmLoadingDialog 2 | SOURCES 3 | tst_QCtmLoadingDialog.cpp 4 | PUBLIC_LIBRARIES 5 | QCustomUi 6 | PRIVATE_LIBRARIES 7 | Qt::Gui 8 | Qt::Widgets 9 | Qt::Test 10 | ) 11 | -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmLoadingDialog/tst_QCtmLoadingDialog.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | using namespace std::chrono_literals; 10 | 11 | class tst_QCtmLoadingDialog : public QObject 12 | { 13 | Q_OBJECT 14 | private slots: 15 | void initTestCase(); 16 | void cancelEnable(); 17 | void setMovie(); 18 | void cleanupTestCase(); 19 | 20 | private: 21 | QWidget* m_topWidget; 22 | QCtmLoadingDialog* m_loading; 23 | }; 24 | 25 | void tst_QCtmLoadingDialog::initTestCase() 26 | { 27 | m_topWidget = new QWidget; 28 | m_topWidget->show(); 29 | QVERIFY(QTest::qWaitForWindowExposed(m_topWidget)); 30 | m_loading = new QCtmLoadingDialog(m_topWidget); 31 | } 32 | 33 | void tst_QCtmLoadingDialog::cancelEnable() 34 | { 35 | { // get set 36 | auto flag = m_loading->cancelEnable(); 37 | m_loading->setCancelEnable(!flag); 38 | QVERIFY(flag != m_loading->cancelEnable()); 39 | } 40 | 41 | { // cancel enable true 42 | m_loading->setCancelEnable(true); 43 | QTimer::singleShot(1s, m_loading, [=]() { QTest::keyClick(m_loading, Qt::Key_Escape); }); 44 | QVERIFY(m_loading->exec() == QCtmLoadingDialog::Result::Cancel); 45 | } 46 | 47 | { // cancel enable false 48 | m_loading->setCancelEnable(false); 49 | QTimer::singleShot(1s, m_loading, [=]() { QTest::keyClick(m_loading, Qt::Key_Escape); }); 50 | QTimer::singleShot(2s, m_loading, [=]() { m_loading->done(); }); 51 | QVERIFY(m_loading->exec() == QCtmLoadingDialog::Result::Done); 52 | } 53 | } 54 | 55 | void tst_QCtmLoadingDialog::setMovie() 56 | { 57 | auto movie = new QMovie; 58 | m_loading->setMovie(movie); 59 | QVERIFY(m_loading->movie() == movie); 60 | } 61 | 62 | void tst_QCtmLoadingDialog::cleanupTestCase() { delete m_topWidget; } 63 | 64 | QTEST_MAIN(tst_QCtmLoadingDialog) 65 | 66 | #include "tst_QCtmLoadingDialog.moc" 67 | -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmStageProgressBar/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qcustomui_internal_add_test(tst_QCtmStageProgressBar 2 | SOURCES 3 | tst_QCtmStageProgressBar.cpp 4 | PUBLIC_LIBRARIES 5 | QCustomUi 6 | PRIVATE_LIBRARIES 7 | Qt::Gui 8 | Qt::Widgets 9 | Qt::Test 10 | ) -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmSwitchButton/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qcustomui_internal_add_test(tst_QCtmSwitchButton 2 | SOURCES 3 | tst_QCtmSwitchButton.cpp 4 | PUBLIC_LIBRARIES 5 | QCustomUi 6 | PRIVATE_LIBRARIES 7 | Qt::Gui 8 | Qt::Widgets 9 | Qt::Test 10 | ) -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmSwitchButton/tst_QCtmSwitchButton.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | class tst_QCtmSwitchButton : public QObject 7 | { 8 | Q_OBJECT 9 | private slots: 10 | void taskGetSet(); 11 | }; 12 | 13 | // 测试Get Set 14 | void tst_QCtmSwitchButton::taskGetSet() 15 | { 16 | QCtmSwitchButton btn(nullptr); 17 | { 18 | QBrush brush(QColor(1, 1, 1)); 19 | btn.setUncheckedBackground(brush); 20 | QVERIFY(btn.uncheckedBackground() == brush); 21 | } 22 | { 23 | QColor color(2, 2, 2); 24 | btn.setUncheckedBackgroundBorderColor(color); 25 | QVERIFY(btn.uncheckedBackgroundBorderColor() == color); 26 | } 27 | { 28 | QBrush brush(QColor(3, 3, 3)); 29 | btn.setUncheckedHandleBrush(brush); 30 | QVERIFY(btn.uncheckedHandleBrush() == brush); 31 | } 32 | { 33 | QColor color(4, 4, 4); 34 | btn.setUncheckedHandleBorderColor(color); 35 | QVERIFY(btn.uncheckedHandleBorderColor() == color); 36 | } 37 | { 38 | QBrush brush(QColor(5, 5, 5)); 39 | btn.setCheckedBackground(brush); 40 | QVERIFY(btn.checkedBackground() == brush); 41 | } 42 | { 43 | QColor color(6, 6, 6); 44 | btn.setCheckedBackgroundBorderColor(color); 45 | QVERIFY(btn.checkedBackgroundBorderColor() == color); 46 | } 47 | { 48 | QBrush brush(QColor(7, 7, 7)); 49 | btn.setCheckedHandleBrush(brush); 50 | QVERIFY(btn.checkedHandleBrush() == brush); 51 | } 52 | { 53 | QColor color(8, 8, 8); 54 | btn.setCheckedHandleBorderColor(color); 55 | QVERIFY(btn.checkedHandleBorderColor() == color); 56 | } 57 | } 58 | 59 | QTEST_MAIN(tst_QCtmSwitchButton) 60 | 61 | #include "tst_QCtmSwitchButton.moc" -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmToolBox/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qcustomui_internal_add_test(tst_QCtmToolBox 2 | SOURCES 3 | tst_QCtmToolBox.cpp 4 | PUBLIC_LIBRARIES 5 | QCustomUi 6 | PRIVATE_LIBRARIES 7 | Qt::Gui 8 | Qt::Widgets 9 | Qt::Test 10 | ) 11 | -------------------------------------------------------------------------------- /src/Tests/Auto/QCtmWindow/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qcustomui_internal_add_test(tst_QCtmWindow 2 | SOURCES 3 | tst_QCtmWindow.cpp 4 | PUBLIC_LIBRARIES 5 | QCustomUi 6 | PRIVATE_LIBRARIES 7 | Qt::Gui 8 | Qt::Widgets 9 | Qt::Test 10 | ) -------------------------------------------------------------------------------- /src/Tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(${PROJECT_SOURCE_DIR}/cmake/Tests.cmake) 2 | add_subdirectory(Auto) --------------------------------------------------------------------------------