├── QVariant ├── old.cpp └── CMakeLists.txt ├── Grid └── Grid.cpp ├── Concurrent ├── RunMemberFunction │ ├── MyClass.cpp │ ├── form.h │ ├── RunMemberFunction.cpp │ └── MyClass.h ├── RunWithGUIUpdate │ ├── LongFunction.h │ ├── LongFunction.cpp │ ├── form.h │ └── MyClass.h ├── FutureWatcher │ ├── MyClass.cpp │ ├── FutureWatcher.cpp │ └── MyClass.h ├── FutureWatcherProgressDialog │ ├── MyClass.cpp │ ├── FutureWatcherProgressDialog.cpp │ └── MyClass.h ├── FutureWatcherProgressDialogSubclass │ ├── MyClass.cpp │ └── FutureWatcherProgressDialogSubclass.cpp ├── Run │ ├── form.h │ ├── Run.cpp │ └── CMakeLists.txt ├── RunBind │ └── form.h ├── BlockingMapWithBoostBind │ └── CMakeLists.txt ├── RunFunctionTemplate │ └── CMakeLists.txt ├── RunFunctionTemplateNoArguments │ └── CMakeLists.txt └── MapAndMapped │ └── BlockingMapMemberFunction.cpp ├── ProgressBarThreadWindow_BAK ├── form.cpp.bak └── ProgressBarThreadWindow.cpp ├── GraphicsScene ├── test │ └── test.h ├── main.cpp └── form.h ├── ModelView ├── ListViewSubclass │ ├── CustomListView.cpp │ └── main.cpp ├── ListView │ └── main.cpp ├── TreeView │ ├── main.cpp │ └── form.h ├── ListViewImages │ ├── main.cpp │ ├── form.h │ └── form.cpp ├── AbstractListModel │ ├── main.cpp │ ├── form.h │ └── form.cpp ├── AbstractTableModel │ ├── main.cpp │ └── form.h ├── ItemSelectionModel │ └── main.cpp ├── ListViewComboBox │ └── main.cpp ├── ListViewImagesChange │ └── main.cpp ├── AbstractTableModelImage │ ├── main.cpp │ ├── form.cpp │ └── form.h ├── AbstractTableModelSelect │ ├── main.cpp │ └── form.h ├── AbstractListModelCheckable │ ├── main.cpp │ └── form.h ├── AbstractListModelFileDialog │ ├── main.cpp │ └── form.h ├── AbstractTableModelCheckable │ ├── main.cpp │ ├── form.h │ └── form.cpp ├── AbstractTableModelEditable │ ├── main.cpp │ └── form.h ├── AbstractTableModelSizeHints │ ├── main.cpp │ └── form.h ├── ListViewSelectionChanged │ └── main.cpp ├── AbstractListModelCheckableExternalData │ ├── main.cpp │ ├── Item.h │ └── form.h └── AbstractListModelCheckableExternalDataSafe │ ├── main.cpp │ ├── Item.h │ └── form.h ├── OptionalQt ├── form.cpp ├── noninteractive.cpp ├── legacy.h ├── normal.h ├── interactive.cpp └── form.h ├── ClassTemplateQObject ├── form.cpp ├── form.hpp └── ClassTemplateQObject.cpp ├── ClickGraphics ├── image.png └── form.h ├── Images ├── QImage │ ├── image.png │ ├── main.cpp │ └── form.h ├── QPixmapMovable.zip ├── Rubberband │ ├── image.png │ ├── main.cpp │ └── form.h ├── RubberbandColor │ ├── image.png │ └── form.h ├── RubberbandSignal │ ├── image.png │ ├── main.cpp │ └── form.h ├── QPixmap │ ├── main.cpp │ └── form.h ├── QPixmapAutoStretch │ └── main.cpp ├── QPixmapMovable │ ├── main.cpp │ └── form.h ├── QPixmapOpacity │ ├── main.cpp │ └── form.h └── QPixmapPosition │ └── main.cpp ├── LabeledImages ├── image.png └── form.h ├── QGraphicsView ├── image.png ├── QGraphicsView.zip └── form.h ├── TextCursor ├── headshot.jpg ├── form.h └── main.cpp ├── Timer ├── Timer.kdevelop.pcs ├── SingleShot │ ├── main.cpp │ ├── form.h │ └── form.cpp └── Timer.cpp ├── GraphicsTextItem ├── image.png └── form.h ├── Slider ├── Slider.kdevelop.pcs ├── main.cpp └── form.h ├── TranslateAnImage ├── image.png └── form.h ├── CheckBox ├── CheckBox.kdevelop.pcs ├── main.cpp └── form.h ├── ComboBox ├── ComboBox.kdevelop.pcs ├── demo.cpp └── main.h ├── GraphicsItemSubclass ├── image.png ├── MyGraphicsItem.cpp └── form.h ├── GraphicsViewSubclass ├── image.png └── form.h ├── ManuallyCreateImage ├── image.png └── form.h ├── TextEdit ├── TextEdit.kdevelop.pcs ├── main.cpp ├── form.h └── form.cpp ├── Toolbar_old ├── images │ └── button.png ├── menu.qrc ├── form.cpp ├── form.h └── Toolbar.cpp ├── GraphicsSceneSubclass ├── image.png ├── form.h └── MyGraphicsScene.h ├── GraphicsSimpleTextItem ├── image.png └── form.h ├── Calculator ├── Calculator.kdevelop.pcs └── main.cpp ├── FileDialog ├── FileDialog.kdevelop.pcs ├── FileDialog.cpp └── form.h ├── GroupBox └── groupbox.txt ├── ProgressBar ├── ProgressBar.kdevelop.pcs ├── ProgressBar.cpp └── form.h ├── RadioButton ├── RadioButton.kdevelop.pcs ├── main.cpp └── form.h ├── qmake ├── form.pro ├── main.cpp └── form.h ├── LabeledSlider-build-desktop ├── LabeledSlider.o ├── libLabeledSlider.so ├── moc_LabeledSlider.o ├── LabeledSliderPlugin.o └── moc_LabeledSliderPlugin.o ├── ProgressDialog ├── ProgressDialog.kdevelop.pcs ├── ProgressDialog.cpp └── form.h ├── FloatSliderPlugin-build-desktop ├── FloatSlider.o ├── moc_FloatSlider.o ├── FloatSliderPlugin.o ├── libFloatSliderPlugin.so └── moc_FloatSliderPlugin.o ├── customwidgetplugin-build-desktop ├── FloatSlider.o ├── analogclock.o ├── moc_FloatSlider.o ├── moc_analogclock.o ├── customwidgetplugin.o ├── libcustomwidgetplugin.so └── moc_customwidgetplugin.o ├── Databases ├── Sql │ ├── Sql.cpp │ └── CMakeLists.txt ├── TableView │ ├── TableView.cpp │ └── form.h ├── CreateTable │ ├── CreateTable.cpp │ └── form.h ├── SqlQueryModel │ ├── SqlQueryModel.cpp │ └── form.h ├── TableViewComboBox │ ├── TableViewComboBox.cpp │ └── form.h └── ListView │ └── form.h ├── ProgressBarMarquee ├── ProgressBarMarquee.kdevelop.pcs ├── ProgressBarMarquee.cpp └── form.h ├── Property ├── form.cpp └── Property.cpp ├── ListWidget ├── form.cpp ├── main.cpp └── form.h ├── ThreadClassMessageBox ├── TestClass.h ├── thread.cpp ├── TestClass.cpp ├── ThreadClassMessageBox.cpp ├── thread.h └── form.h ├── Debug ├── Debug.cpp └── CMakeLists.txt ├── SmartPointers ├── Pointer │ ├── Pointer.cpp │ ├── form.h │ └── form.cpp ├── ScopedPointer │ └── CMakeLists.txt └── SharedPointer │ └── CMakeLists.txt ├── GUIVisitor ├── VisitorParent.h ├── CMakeLists.txt └── SimpleVisitor.h ├── ComputationThread ├── ComputationObject.h ├── MyObject.h ├── demo.cpp └── MyObject.cpp ├── SignalArray ├── SmallWidget.cpp ├── MyWidget.h ├── SignalArray.cpp ├── SmallWidget.h ├── CMakeLists.txt └── MyWidget.cpp ├── ThreadMessageBox_bak ├── thread.h ├── thread.cpp ├── ThreadMessageBox.cpp ├── form.h └── form.cpp ├── QVector ├── QVector.cpp └── CMakeLists.txt ├── Maximize ├── form.cpp ├── main.cpp └── form.h ├── CheckForQT ├── form.h ├── main.cpp ├── form.cpp └── CMakeLists.txt ├── DialogButtonBox ├── form.h ├── main.cpp ├── form.cpp └── CMakeLists.txt ├── DrawLine ├── main.cpp └── form.h ├── HelpEngine ├── main.cpp └── form.h ├── Icon ├── Icon.cpp └── form.h ├── LineEdit ├── main.cpp └── form.h ├── MetaType └── main.cpp ├── QWT ├── Plot │ ├── main.cpp │ └── form.h └── Histogram │ ├── main.cpp │ └── form.h ├── SpinBox ├── main.cpp ├── form.cpp └── form.h ├── Style ├── Style.cpp └── form.h ├── TabWidget ├── main.cpp ├── form.cpp └── form.h ├── TableView ├── main.cpp └── form.h ├── ThreadMessageBox ├── thread.cpp ├── thread.h ├── ThreadMessageBox.cpp └── form.h ├── ButtonBox ├── main.cpp ├── form.cpp └── form.h ├── Dialog ├── Modal │ ├── main.cpp │ ├── dialog.h │ ├── dialog.cpp │ └── form.h ├── Modeless │ ├── main.cpp │ ├── dialog.cpp │ └── dialog.h └── ModalData │ ├── main.cpp │ ├── form.h │ └── dialog.h ├── KFileWidget ├── main.cpp └── form.h ├── PlaceHolder ├── main.cpp └── form.h ├── StringListModel ├── main.cpp └── form.h ├── TableWidget ├── main.cpp └── form.h ├── ThreadTemplateWithSignals ├── ThreadTemplateWithSignals.hxx └── Example.cpp ├── Toolbar ├── Toolbar.cpp ├── form.cpp └── form.h ├── AbstractItemDelegate ├── main.cpp └── form.h ├── AutoConnect ├── AutoConnect.cpp ├── form.cpp └── form.h ├── Cursor ├── main.cpp └── form.h ├── DragDropOS ├── main.cpp └── form.h ├── DrawLineInteractive ├── main.cpp ├── ClickableScene.h └── form.h ├── HandleItem ├── main.cpp ├── form.h └── form.cpp ├── Layout ├── main.cpp ├── form.h └── form.cpp ├── LineEditInputMask ├── main.cpp ├── form.h └── form.cpp ├── LineEditPassword ├── main.cpp ├── form.cpp └── form.h ├── Printer ├── main.cpp └── form.h ├── QGraphicsRectItem ├── main.cpp └── form.h ├── QWidgetSubclass ├── main.cpp └── form.h ├── ResizableRect └── main.cpp ├── StandardItemModel ├── main.cpp └── form.h ├── StatusBar ├── StatusBar.cpp ├── form.cpp └── form.h ├── TableWidgetClickRows ├── main.cpp └── form.h ├── TableWidgetImages ├── main.cpp └── form.h ├── TableWidgetSelectRow ├── main.cpp ├── SpecificColor.cpp └── form.h ├── TableWidgetSorting ├── main.cpp └── form.h ├── ToolTip ├── main.cpp ├── form.h └── form.cpp ├── Validator ├── Validator.cpp └── form.h ├── AbstractItemDelegateSize └── main.cpp ├── ClickableLabelInTable ├── main.cpp ├── form.h ├── ClickableLabel.cpp └── ClickableLabel.h ├── FileSelectionWidget ├── main.cpp └── form.h ├── GraphicsView ├── main.cpp └── form.h ├── HandleItemWORKING ├── main.cpp └── form.h ├── ManualLayout ├── main.cpp ├── form.h └── CMakeLists.txt ├── SavePixmap ├── main.cpp └── form.h ├── ScrollBar ├── main.cpp └── form.h ├── StandardItemModelListView ├── main.cpp └── form.h ├── StringListModelCheckable ├── main.cpp └── form.h ├── TableWidgetInsertSorted ├── main.cpp └── form.h ├── TableWidgetItemSubclass ├── main.cpp ├── form.h └── MyTableWidgetItem.cpp ├── TableWidgetWidthHeight ├── main.cpp └── form.h ├── ConstructorTimer ├── main.cpp ├── form.h └── form.cpp ├── FileMenu ├── main.cpp ├── filemenu.h └── filemenu.cpp ├── FloatSlider ├── main.cpp └── Demo │ └── main.cpp ├── MessageBox ├── main.cpp └── messagebox.h ├── MultipleInheritance ├── main.cpp ├── form.h └── form.cpp ├── RadioButtonGroups ├── main.cpp └── form.h ├── SaveGraphicsScene ├── main.cpp └── form.h ├── SaveGraphicsView ├── main.cpp └── form.h ├── ButtonWidget ├── main.cpp ├── form.h └── form.cpp ├── ComboBoxOfCheckBoxes └── demo.cpp ├── DesignerPlugin ├── main.cpp └── FloatSlider.cpp ├── FloatSlider_bak ├── main.cpp ├── FloatSlider.cpp └── FloatSlider.h ├── InputDialog ├── InputDialog.cpp └── form.h ├── LabeledSlider ├── main.cpp ├── Demo │ └── main.cpp └── DemoUI │ ├── main.cpp │ ├── form.h │ ├── Widget │ └── CMakeLists.txt │ └── form.cpp ├── ManualLayoutRemoveWidget ├── main.cpp └── form.h ├── ProgrammaticallyAddWidgetToForm ├── main.cpp └── form.h ├── QSignalMapper ├── main.cpp └── form.cpp ├── SliderBAK ├── RadioButton │ ├── main.cpp │ └── form.h └── CMakeLists.txt ├── SlotAutoName ├── form.cpp └── main.cpp ├── WidgetTemplated ├── main.cpp ├── InsideForm.cpp ├── filemenu.h └── InsideForm.txx ├── Connect ├── Connect.cpp ├── CMakeLists.txt └── MyWidget.h ├── Signal ├── Signal.cpp ├── CMakeLists.txt ├── MyWidget.h └── MyWidget.cpp ├── WidgetInsideMainWindow ├── main.cpp ├── InsideForm.h ├── filemenu.h └── InsideForm.cpp ├── Email ├── form.h ├── main.cpp └── CMakeLists.txt ├── ProgressBarThreaded └── ProgressBarThreaded.cpp ├── SizeRestrictions ├── SizeRestrictions.cpp ├── form.h └── form.cpp ├── Time ├── form.h ├── Time.cpp ├── form.h.bak └── CMakeLists.txt ├── FileDialogDefaultSuffix ├── FileDialogDefaultSuffix.cpp └── form.h ├── Webview ├── form.h ├── main.cpp └── form.cpp ├── HandleItemOLD └── form.h ├── SignalWithValue ├── SignalWithValue.cpp ├── CMakeLists.txt ├── MyWidget.h └── MyWidget.cpp ├── TextDocument ├── form.h └── main.cpp ├── Date ├── Date.cpp ├── form.h └── CMakeLists.txt ├── Label ├── Label.cpp ├── form.h └── form.cpp ├── Calendar ├── Calendar.cpp └── form.h ├── SlotWithCustomType └── main.cpp ├── SlotWithParameter ├── main.cpp ├── form.h └── form.cpp ├── Parent ├── Parent.cpp └── form.h ├── SignalPointerParameter ├── SignalPointerParameter.cpp ├── CMakeLists.txt └── MyWidget.h ├── QElapsedTimer ├── QElapsedTimer.cpp └── form.h ├── TimeAFunction └── TimeAFunction.cpp ├── Boost ├── form.h └── form.cpp ├── FileExtension ├── FileExtension.cpp └── CMakeLists.txt ├── Message ├── form.h └── form.cpp ├── ProgrammaticButton ├── CMakeLists.txt └── ProgrammaticButton.cpp ├── UseQtInLibrary ├── main.cpp └── mylib.cpp ├── WidgetWithoutApplication └── NonGUICode.cpp ├── Delegates ├── IndexWidget │ ├── IndexWidget.h │ ├── IndexWidget.cpp │ └── main.cpp └── PixmapDelegate │ └── PixmapDelegate.h ├── ThreadedGUIUpdate ├── ComputationClass.cpp ├── Interactive.cpp └── ComputationClass.h ├── ThreadedGUIUpdate_bad ├── ComputationClass.cpp ├── Interactive.cpp └── ComputationClass.h ├── QHash ├── QHash.cpp └── CMakeLists.txt ├── QMetaEnum └── CMakeLists.txt ├── Thread ├── form.h ├── form.cpp └── OldMethod │ └── CMakeLists.txt ├── ThreadFromGUI ├── Thread.cpp ├── form.h └── OldMethod │ └── CMakeLists.txt ├── Dir └── CMakeLists.txt ├── File └── CMakeLists.txt ├── ProgressBarThreadWindow └── ProgressBarThreadWindow.cpp ├── QColor ├── CMakeLists.txt └── main.cpp ├── Test └── Test.h ├── ITKFilterComputationThread └── Interactive.cpp ├── FileInfo └── CMakeLists.txt ├── ITKFilterComputationThreadHardCoded └── Interactive.cpp ├── XML ├── CMakeLists.txt └── out.xml ├── Settings └── CMakeLists.txt └── ThreadTemplate └── CMakeLists.txt /QVariant/old.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Grid/Grid.cpp: -------------------------------------------------------------------------------- 1 | QGridLayout -------------------------------------------------------------------------------- /Concurrent/RunMemberFunction/MyClass.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ProgressBarThreadWindow_BAK/form.cpp.bak: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GraphicsScene/test/test.h: -------------------------------------------------------------------------------- 1 | moe stuff 2 | here 3 | 4 | -------------------------------------------------------------------------------- /ModelView/ListViewSubclass/CustomListView.cpp: -------------------------------------------------------------------------------- 1 | #include "CustomListView.h" -------------------------------------------------------------------------------- /OptionalQt/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | -------------------------------------------------------------------------------- /ClassTemplateQObject/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | -------------------------------------------------------------------------------- /OptionalQt/noninteractive.cpp: -------------------------------------------------------------------------------- 1 | int main() 2 | { 3 | 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /ClickGraphics/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/ClickGraphics/image.png -------------------------------------------------------------------------------- /Images/QImage/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/Images/QImage/image.png -------------------------------------------------------------------------------- /LabeledImages/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/LabeledImages/image.png -------------------------------------------------------------------------------- /QGraphicsView/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/QGraphicsView/image.png -------------------------------------------------------------------------------- /TextCursor/headshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/TextCursor/headshot.jpg -------------------------------------------------------------------------------- /Images/QPixmapMovable.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/Images/QPixmapMovable.zip -------------------------------------------------------------------------------- /Timer/Timer.kdevelop.pcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/Timer/Timer.kdevelop.pcs -------------------------------------------------------------------------------- /GraphicsTextItem/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/GraphicsTextItem/image.png -------------------------------------------------------------------------------- /Images/Rubberband/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/Images/Rubberband/image.png -------------------------------------------------------------------------------- /Slider/Slider.kdevelop.pcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/Slider/Slider.kdevelop.pcs -------------------------------------------------------------------------------- /TranslateAnImage/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/TranslateAnImage/image.png -------------------------------------------------------------------------------- /CheckBox/CheckBox.kdevelop.pcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/CheckBox/CheckBox.kdevelop.pcs -------------------------------------------------------------------------------- /ComboBox/ComboBox.kdevelop.pcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/ComboBox/ComboBox.kdevelop.pcs -------------------------------------------------------------------------------- /GraphicsItemSubclass/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/GraphicsItemSubclass/image.png -------------------------------------------------------------------------------- /GraphicsViewSubclass/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/GraphicsViewSubclass/image.png -------------------------------------------------------------------------------- /ManuallyCreateImage/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/ManuallyCreateImage/image.png -------------------------------------------------------------------------------- /TextEdit/TextEdit.kdevelop.pcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/TextEdit/TextEdit.kdevelop.pcs -------------------------------------------------------------------------------- /Toolbar_old/images/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/Toolbar_old/images/button.png -------------------------------------------------------------------------------- /Toolbar_old/menu.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/button.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /GraphicsSceneSubclass/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/GraphicsSceneSubclass/image.png -------------------------------------------------------------------------------- /GraphicsSimpleTextItem/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/GraphicsSimpleTextItem/image.png -------------------------------------------------------------------------------- /Images/RubberbandColor/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/Images/RubberbandColor/image.png -------------------------------------------------------------------------------- /Images/RubberbandSignal/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/Images/RubberbandSignal/image.png -------------------------------------------------------------------------------- /QGraphicsView/QGraphicsView.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/QGraphicsView/QGraphicsView.zip -------------------------------------------------------------------------------- /Calculator/Calculator.kdevelop.pcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/Calculator/Calculator.kdevelop.pcs -------------------------------------------------------------------------------- /FileDialog/FileDialog.kdevelop.pcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/FileDialog/FileDialog.kdevelop.pcs -------------------------------------------------------------------------------- /GroupBox/groupbox.txt: -------------------------------------------------------------------------------- 1 | Border: 2 | In Qt Designer, in the StyleSheet property of the groupbox, add: 3 | border: 2px solid gray; -------------------------------------------------------------------------------- /ProgressBar/ProgressBar.kdevelop.pcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/ProgressBar/ProgressBar.kdevelop.pcs -------------------------------------------------------------------------------- /RadioButton/RadioButton.kdevelop.pcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/RadioButton/RadioButton.kdevelop.pcs -------------------------------------------------------------------------------- /qmake/form.pro: -------------------------------------------------------------------------------- 1 | CONFIG += qt 2 | HEADERS = form.h 3 | SOURCES = main.cpp \ 4 | form.cpp 5 | FORMS = form.ui 6 | -------------------------------------------------------------------------------- /LabeledSlider-build-desktop/LabeledSlider.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/LabeledSlider-build-desktop/LabeledSlider.o -------------------------------------------------------------------------------- /ProgressDialog/ProgressDialog.kdevelop.pcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/ProgressDialog/ProgressDialog.kdevelop.pcs -------------------------------------------------------------------------------- /FloatSliderPlugin-build-desktop/FloatSlider.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/FloatSliderPlugin-build-desktop/FloatSlider.o -------------------------------------------------------------------------------- /LabeledSlider-build-desktop/libLabeledSlider.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/LabeledSlider-build-desktop/libLabeledSlider.so -------------------------------------------------------------------------------- /LabeledSlider-build-desktop/moc_LabeledSlider.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/LabeledSlider-build-desktop/moc_LabeledSlider.o -------------------------------------------------------------------------------- /customwidgetplugin-build-desktop/FloatSlider.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/customwidgetplugin-build-desktop/FloatSlider.o -------------------------------------------------------------------------------- /customwidgetplugin-build-desktop/analogclock.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/customwidgetplugin-build-desktop/analogclock.o -------------------------------------------------------------------------------- /Databases/Sql/Sql.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | //#include 4 | 5 | int main(int, char *[]) 6 | { 7 | 8 | 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /FloatSliderPlugin-build-desktop/moc_FloatSlider.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/FloatSliderPlugin-build-desktop/moc_FloatSlider.o -------------------------------------------------------------------------------- /LabeledSlider-build-desktop/LabeledSliderPlugin.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/LabeledSlider-build-desktop/LabeledSliderPlugin.o -------------------------------------------------------------------------------- /ProgressBarMarquee/ProgressBarMarquee.kdevelop.pcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/ProgressBarMarquee/ProgressBarMarquee.kdevelop.pcs -------------------------------------------------------------------------------- /customwidgetplugin-build-desktop/moc_FloatSlider.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/customwidgetplugin-build-desktop/moc_FloatSlider.o -------------------------------------------------------------------------------- /customwidgetplugin-build-desktop/moc_analogclock.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/customwidgetplugin-build-desktop/moc_analogclock.o -------------------------------------------------------------------------------- /FloatSliderPlugin-build-desktop/FloatSliderPlugin.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/FloatSliderPlugin-build-desktop/FloatSliderPlugin.o -------------------------------------------------------------------------------- /LabeledSlider-build-desktop/moc_LabeledSliderPlugin.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/LabeledSlider-build-desktop/moc_LabeledSliderPlugin.o -------------------------------------------------------------------------------- /customwidgetplugin-build-desktop/customwidgetplugin.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/customwidgetplugin-build-desktop/customwidgetplugin.o -------------------------------------------------------------------------------- /FloatSliderPlugin-build-desktop/libFloatSliderPlugin.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/FloatSliderPlugin-build-desktop/libFloatSliderPlugin.so -------------------------------------------------------------------------------- /FloatSliderPlugin-build-desktop/moc_FloatSliderPlugin.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/FloatSliderPlugin-build-desktop/moc_FloatSliderPlugin.o -------------------------------------------------------------------------------- /Property/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | #include 5 | 6 | MainWindow::MainWindow() 7 | { 8 | setupUi(this); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /customwidgetplugin-build-desktop/libcustomwidgetplugin.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/customwidgetplugin-build-desktop/libcustomwidgetplugin.so -------------------------------------------------------------------------------- /customwidgetplugin-build-desktop/moc_customwidgetplugin.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daviddoria/QtExamples/HEAD/customwidgetplugin-build-desktop/moc_customwidgetplugin.o -------------------------------------------------------------------------------- /Toolbar_old/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | Form::Form(QWidget *parent) 6 | : QMainWindow(parent) 7 | { 8 | setupUi(this); 9 | } 10 | -------------------------------------------------------------------------------- /ListWidget/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | Form::Form(QWidget *parent) 6 | : QWidget(parent) 7 | { 8 | this->setupUi(this); 9 | } 10 | -------------------------------------------------------------------------------- /ThreadClassMessageBox/TestClass.h: -------------------------------------------------------------------------------- 1 | #ifndef TestClass_H 2 | #define TestClass_H 3 | 4 | class TestClass 5 | { 6 | public: 7 | void MyFunction(); 8 | 9 | }; 10 | 11 | #endif -------------------------------------------------------------------------------- /Debug/Debug.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | int main(int, char *[]) 6 | { 7 | QString test; 8 | qDebug() << test; 9 | 10 | 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /SmartPointers/Pointer/Pointer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | int main( int argc, char **argv ) 5 | { 6 | QApplication app(argc, argv); 7 | 8 | return app.exec(); 9 | } 10 | -------------------------------------------------------------------------------- /GUIVisitor/VisitorParent.h: -------------------------------------------------------------------------------- 1 | #ifndef VisitorParent_h 2 | #define VisitorParent_h 3 | 4 | class VisitorParent 5 | { 6 | public: 7 | virtual void DoSomething() = 0; 8 | }; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /ComputationThread/ComputationObject.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPUTATIONOBJECT_H 2 | #define COMPUTATIONOBJECT_H 3 | 4 | class ComputationObject 5 | { 6 | public: 7 | virtual void Step() = 0; 8 | }; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /SignalArray/SmallWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "SmallWidget.h" 2 | 3 | #include 4 | 5 | SmallWidget::SmallWidget() 6 | { 7 | } 8 | 9 | void SmallWidget::EmitSignal() 10 | { 11 | emit mysignal(); 12 | } 13 | -------------------------------------------------------------------------------- /ComputationThread/MyObject.h: -------------------------------------------------------------------------------- 1 | #ifndef MYOBJECT_H 2 | #define MYOBJECT_H 3 | 4 | #include "ComputationObject.h" 5 | 6 | class MyObject : public ComputationObject 7 | { 8 | void Step(); 9 | }; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /Concurrent/RunWithGUIUpdate/LongFunction.h: -------------------------------------------------------------------------------- 1 | #ifndef LongFunction_h 2 | #define LongFunction_h 3 | 4 | #include 5 | 6 | #include "MyClass.h" 7 | 8 | void LongFunction(MyClass* myClass); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /ThreadMessageBox_bak/thread.h: -------------------------------------------------------------------------------- 1 | #ifndef THREAD_H 2 | #define THREAD_H 3 | 4 | #include 5 | 6 | class Thread : public QThread 7 | { 8 | 9 | public: 10 | 11 | virtual void run(); 12 | }; 13 | 14 | #endif -------------------------------------------------------------------------------- /QVector/QVector.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | QVector a; 8 | 9 | a.push_back(1); 10 | 11 | std::cout << a[0] << std::endl; 12 | return 0; 13 | } -------------------------------------------------------------------------------- /ThreadClassMessageBox/thread.cpp: -------------------------------------------------------------------------------- 1 | #include "thread.h" 2 | 3 | #include 4 | #include 5 | 6 | void Thread::run() 7 | { 8 | MyTestClass.MyFunction(); 9 | 10 | emit DisplayMessageBoxSignal(); 11 | } -------------------------------------------------------------------------------- /Maximize/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | Form::Form(QWidget *parent) 6 | : QWidget(parent) 7 | { 8 | setupUi(this); 9 | 10 | this->setWindowState(Qt::WindowMaximized); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /CheckForQT/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /DialogButtonBox/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include 5 | 6 | class Form : public QWidget 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /DrawLine/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /HelpEngine/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Icon/Icon.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /LineEdit/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ListWidget/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /MetaType/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /OptionalQt/legacy.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | class Form : public QWidget 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | 11 | 12 | public slots: 13 | 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /OptionalQt/normal.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | class Form : public QWidget 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | 11 | 12 | public slots: 13 | 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /QWT/Plot/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /SpinBox/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Style/Style.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /TabWidget/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /TableView/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ThreadMessageBox/thread.cpp: -------------------------------------------------------------------------------- 1 | #include "thread.h" 2 | 3 | #include 4 | #include 5 | 6 | void Thread::run() 7 | { 8 | std::cout << "Thread::run()" << std::endl; 9 | emit DisplayMessageBoxSignal(); 10 | } -------------------------------------------------------------------------------- /ButtonBox/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Dialog/Modal/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Dialog/Modeless/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /DialogButtonBox/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Images/QImage/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Images/QPixmap/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /KFileWidget/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /PlaceHolder/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /QWT/Histogram/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /StringListModel/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /TableWidget/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ThreadTemplateWithSignals/ThreadTemplateWithSignals.hxx: -------------------------------------------------------------------------------- 1 | template 2 | void ThreadTemplateWithSignals::run() 3 | { 4 | for( int count = 0; count < 5; count++ ) 5 | { 6 | std::cout << count << std::endl;; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Toolbar/Toolbar.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /AbstractItemDelegate/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /AutoConnect/AutoConnect.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /CheckBox/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ComboBox/demo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "main.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MainWindow window; 9 | window.show(); 10 | return app.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /Cursor/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Dialog/ModalData/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /DragDropOS/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /DrawLineInteractive/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /HandleItem/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /Images/Rubberband/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Layout/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /LineEditInputMask/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /LineEditPassword/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ListWidget/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /Maximize/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/ListView/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/TreeView/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Printer/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /QGraphicsRectItem/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /QWidgetSubclass/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ResizableRect/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MainWindow form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Slider/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /StandardItemModel/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /StatusBar/StatusBar.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /TabWidget/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | #include 6 | 7 | Form::Form(QWidget *parent) : QMainWindow(parent) 8 | { 9 | setupUi(this); 10 | this->pushButton->setText("Hello"); 11 | } 12 | -------------------------------------------------------------------------------- /TableWidgetClickRows/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /TableWidgetImages/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /TableWidgetSelectRow/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /TableWidgetSorting/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /TextEdit/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ToolTip/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Validator/Validator.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /qmake/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /AbstractItemDelegateSize/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /CheckForQT/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ClickableLabelInTable/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /DrawLine/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /FileDialog/FileDialog.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form myForm; 9 | myForm.show(); 10 | return app.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /FileSelectionWidget/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /GraphicsScene/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /GraphicsView/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /HandleItemWORKING/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /Images/QPixmapAutoStretch/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Images/QPixmapMovable/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Images/QPixmapOpacity/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Images/QPixmapPosition/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Images/RubberbandSignal/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ManualLayout/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Maximize/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /ModelView/ListViewImages/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /RadioButton/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /SavePixmap/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ScrollBar/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /StandardItemModelListView/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /StringListModelCheckable/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /TableWidgetInsertSorted/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /TableWidgetItemSubclass/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /TableWidgetWidthHeight/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ThreadTemplateWithSignals/Example.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | ThreadTemplateWithSignals a; 7 | a.start(); 8 | a.wait(); 9 | 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /ComputationThread/demo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "main.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MainWindow window; 9 | window.show(); 10 | return app.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /ConstructorTimer/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /FileMenu/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "filemenu.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /FloatSlider/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "FloatSlider.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | FloatSlider slider; 9 | 10 | slider.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /GraphicsScene/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /Images/QPixmap/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /MessageBox/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "messagebox.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/AbstractListModel/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModel/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/ItemSelectionModel/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/ListViewComboBox/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/ListViewImagesChange/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/ListViewSubclass/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /MultipleInheritance/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /OptionalQt/interactive.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /RadioButtonGroups/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /SaveGraphicsScene/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /SaveGraphicsView/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /StandardItemModel/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /Timer/SingleShot/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ButtonWidget/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "buttonform.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ClassTemplateQObject/form.hpp: -------------------------------------------------------------------------------- 1 | #ifndef FORM_HPP 2 | #define FORM_HPP 3 | 4 | template 5 | Form::Form(QWidget *parent) : FormParent(parent) 6 | { 7 | } 8 | 9 | template 10 | void Form::Test() 11 | { 12 | } 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /ComboBoxOfCheckBoxes/demo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "main.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MainWindow window; 9 | window.show(); 10 | return app.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /DesignerPlugin/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "FloatSlider.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | FloatSlider slider; 9 | 10 | slider.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /FloatSlider_bak/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "FloatSlider.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | FloatSlider slider; 9 | 10 | slider.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Images/RubberbandColor/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | Form(QWidget *parent = 0); 11 | 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /InputDialog/InputDialog.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /LabeledSlider/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "FloatSlider.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | FloatSlider slider; 9 | 10 | slider.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ManualLayoutRemoveWidget/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModelImage/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModelSelect/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ProgrammaticallyAddWidgetToForm/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /QGraphicsRectItem/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /QSignalMapper/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "buttonform.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /SliderBAK/RadioButton/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /SlotAutoName/form.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | 3 | #include 4 | #include 5 | 6 | MyForm::MyForm(QWidget *parent) : QWidget(parent) 7 | { 8 | setupUi(this); 9 | } 10 | 11 | void MyForm::on_btnButton_clicked() 12 | { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /WidgetTemplated/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "filemenu.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Concurrent/FutureWatcher/MyClass.cpp: -------------------------------------------------------------------------------- 1 | #include "MyClass.h" 2 | 3 | // void MyClass::LongFunction() 4 | // { 5 | // for( int count = 0; count < 5; count++ ) 6 | // { 7 | // sleep( 1 ); 8 | // std::cout << "Ping long!" << std::endl; 9 | // } 10 | // } -------------------------------------------------------------------------------- /Connect/Connect.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "MyWidget.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc,argv); 8 | 9 | MyWidget form; 10 | form.EmitSignal(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /Databases/TableView/TableView.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Images/QPixmapMovable/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /Images/QPixmapOpacity/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /LabeledSlider/Demo/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "LabeledSlider.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | LabeledSlider slider; 9 | 10 | slider.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/AbstractListModelCheckable/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/AbstractListModelFileDialog/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModelCheckable/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModelEditable/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModelSizeHints/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ModelView/ListViewSelectionChanged/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ProgressBarMarquee/ProgressBarMarquee.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "form.h" 3 | 4 | int main( int argc, char **argv ) 5 | { 6 | QApplication app(argc, argv); 7 | MainWindow window; 8 | 9 | window.show(); 10 | return app.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /Signal/Signal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "MyWidget.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc,argv); 8 | 9 | MyWidget form; 10 | form.EmitSignal(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /StringListModelCheckable/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /WidgetInsideMainWindow/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "filemenu.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ClassTemplateQObject/ClassTemplateQObject.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Databases/CreateTable/CreateTable.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Email/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | #include 7 | 8 | class MainWindow : public QMainWindow, public Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | MainWindow(); 14 | 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /LabeledSlider/DemoUI/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | LabeledSlider slider; 9 | 10 | slider.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ProgressBar/ProgressBar.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "form.h" 3 | 4 | int main( int argc, char **argv ) 5 | { 6 | QApplication app(argc, argv); 7 | MainWindow window; 8 | 9 | window.show(); 10 | return app.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /ProgressBarThreaded/ProgressBarThreaded.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "form.h" 3 | 4 | int main( int argc, char **argv ) 5 | { 6 | QApplication app(argc, argv); 7 | MainWindow window; 8 | 9 | window.show(); 10 | return app.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /SignalArray/MyWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MYWIDGET_H 2 | #define MYWIDGET_H 3 | 4 | #include 5 | 6 | class MyWidget : public QObject 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MyWidget(); 12 | 13 | public slots: 14 | void myslot(); 15 | 16 | }; 17 | 18 | #endif -------------------------------------------------------------------------------- /SignalArray/SignalArray.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "MyWidget.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc,argv); 8 | 9 | MyWidget form; 10 | //form.show(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /SizeRestrictions/SizeRestrictions.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Time/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | #include 7 | 8 | class MainWindow : public QMainWindow, public Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | MainWindow(); 14 | 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /CheckForQT/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | Form::Form(QWidget *parent) : QWidget(parent) 6 | { 7 | #ifdef QT_VERSION 8 | #pragma message("Using QT!") 9 | #else 10 | #pragma message("NOT using QT!") 11 | #endif 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Databases/SqlQueryModel/SqlQueryModel.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /FileDialogDefaultSuffix/FileDialogDefaultSuffix.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form myForm; 9 | myForm.show(); 10 | return app.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /ModelView/AbstractListModelCheckableExternalData/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /TextCursor/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | #include 7 | 8 | class MainWindow : public QMainWindow, public Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | MainWindow(); 14 | 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ThreadMessageBox/thread.h: -------------------------------------------------------------------------------- 1 | #ifndef THREAD_H 2 | #define THREAD_H 3 | 4 | #include 5 | 6 | class Thread : public QThread 7 | { 8 | Q_OBJECT 9 | public: 10 | void run(); 11 | 12 | signals: 13 | void DisplayMessageBoxSignal(); 14 | 15 | }; 16 | 17 | #endif -------------------------------------------------------------------------------- /Webview/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | #include 7 | 8 | class MainWindow : public QMainWindow, public Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | MainWindow(); 14 | 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ComputationThread/MyObject.cpp: -------------------------------------------------------------------------------- 1 | #include "MyObject.h" 2 | 3 | #include 4 | 5 | void MyObject::Step() 6 | { 7 | std::cout << "Step()" << std::endl; 8 | 9 | for(unsigned int i = 0; i < 1e6; ++i) 10 | { 11 | float a = 2.0f + 3.0f; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Concurrent/FutureWatcherProgressDialog/MyClass.cpp: -------------------------------------------------------------------------------- 1 | #include "MyClass.h" 2 | 3 | // void MyClass::LongFunction() 4 | // { 5 | // for( int count = 0; count < 5; count++ ) 6 | // { 7 | // sleep( 1 ); 8 | // std::cout << "Ping long!" << std::endl; 9 | // } 10 | // } -------------------------------------------------------------------------------- /Databases/TableViewComboBox/TableViewComboBox.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | MyForm form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /HandleItem/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /HandleItemOLD/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ModelView/AbstractListModelCheckableExternalDataSafe/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | Form form; 9 | 10 | form.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /ProgressBarThreadWindow_BAK/ProgressBarThreadWindow.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "form.h" 3 | 4 | int main( int argc, char **argv ) 5 | { 6 | QApplication app(argc, argv); 7 | MainWindow window; 8 | 9 | window.show(); 10 | return app.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /SignalWithValue/SignalWithValue.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "MyWidget.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc,argv); 8 | 9 | MyWidget form; 10 | form.EmitSignal(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /TextDocument/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | #include 7 | 8 | class MainWindow : public QMainWindow, public Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | MainWindow(); 14 | 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /WidgetTemplated/InsideForm.cpp: -------------------------------------------------------------------------------- 1 | #include "InsideForm.h" 2 | 3 | #include 4 | 5 | InsideFormObject::InsideFormObject(QWidget *parent) 6 | { 7 | setupUi(this); 8 | connect( this->btnButton, SIGNAL( clicked() ), this, SLOT(btnButton_clicked()) ); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /Calculator/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include "calculatorform.h" 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QApplication app(argc, argv); 9 | CalculatorForm calculator; 10 | calculator.show(); 11 | return app.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Concurrent/FutureWatcherProgressDialogSubclass/MyClass.cpp: -------------------------------------------------------------------------------- 1 | #include "MyClass.h" 2 | 3 | // void MyClass::LongFunction() 4 | // { 5 | // for( int count = 0; count < 5; count++ ) 6 | // { 7 | // sleep( 1 ); 8 | // std::cout << "Ping long!" << std::endl; 9 | // } 10 | // } -------------------------------------------------------------------------------- /Date/Date.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /Email/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /HandleItemWORKING/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /Images/RubberbandSignal/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public slots: 10 | 11 | public: 12 | Form(QWidget *parent = 0); 13 | 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Label/Label.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /SlotAutoName/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | /* this doesn't work */ 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication app(argc, argv); 10 | MyForm form; 11 | 12 | form.show(); 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /Time/Time.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /Timer/Timer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /Webview/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /Calendar/Calendar.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /Property/Property.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /QWT/Plot/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MyForm(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /SlotWithCustomType/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | /* this doesn't work */ 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication app(argc, argv); 10 | MyForm form; 11 | 12 | form.show(); 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /SlotWithParameter/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | /* this doesn't work */ 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication app(argc, argv); 10 | MyForm form; 11 | 12 | form.show(); 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /StatusBar/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | Form::Form(QWidget *parent) 6 | : QMainWindow(parent) 7 | { 8 | setupUi(this); 9 | } 10 | 11 | void Form::on_pushButton_clicked() 12 | { 13 | this->statusBar()->showMessage("Set label text."); 14 | } 15 | -------------------------------------------------------------------------------- /TableView/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /TableWidget/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /TextCursor/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /TextDocument/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /Webview/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | #include 6 | 7 | MainWindow::MainWindow() 8 | { 9 | setupUi(this); 10 | QUrl url("http://www.google.com"); // Must have http:// or nothing appears. 11 | webView->load(url); 12 | } 13 | -------------------------------------------------------------------------------- /ConstructorTimer/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void AppReady(); 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ManualLayout/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include 5 | 6 | class MyForm : public QWidget 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | // public slots: 13 | // void pushButton_SetLabelText(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Parent/Parent.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main(int argc, char*argv[]) 7 | { 8 | QApplication app(argc, argv); 9 | 10 | QLabel label(&app); // can't use 'app', need a QObject 11 | 12 | return app.exec(); 13 | } -------------------------------------------------------------------------------- /QWT/Histogram/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MyForm(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /SignalPointerParameter/SignalPointerParameter.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "MyWidget.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc,argv); 8 | 9 | MyWidget form; 10 | form.EmitSignal(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /SmartPointers/ScopedPointer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(ScopedPointer) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | ADD_EXECUTABLE(ScopedPointer ScopedPointer.cpp ) 9 | TARGET_LINK_LIBRARIES(ScopedPointer ${QT_LIBRARIES}) 10 | -------------------------------------------------------------------------------- /SmartPointers/SharedPointer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(SharedPointer) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | ADD_EXECUTABLE(SharedPointer SharedPointer.cpp) 9 | TARGET_LINK_LIBRARIES(SharedPointer ${QT_LIBRARIES}) 10 | -------------------------------------------------------------------------------- /StringListModel/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /TableWidgetImages/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /TableWidgetSelectRow/SpecificColor.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * 4 | * The style sheet should look like this to set the selected background color: 5 | * 6 | * QTableWidget::item:selected{ 7 | background-color:red; 8 | } 9 | QTableWidget::item:selected:!active{ 10 | background-color:red; 11 | } 12 | */ -------------------------------------------------------------------------------- /TableWidgetSorting/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Timer/SingleShot/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void AppReady(); 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /AutoConnect/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | Form::Form(QWidget *parent) 6 | : QWidget(parent) 7 | { 8 | setupUi(this); 9 | } 10 | 11 | void Form::on_pushButton_clicked() 12 | { 13 | this->label->setText(this->textEdit->document()->toPlainText()); 14 | } 15 | -------------------------------------------------------------------------------- /ClickableLabelInTable/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Concurrent/RunWithGUIUpdate/LongFunction.cpp: -------------------------------------------------------------------------------- 1 | #include "LongFunction.h" 2 | 3 | void LongFunction(MyClass* myClass) 4 | { 5 | for( int count = 0; count < 5; count++ ) 6 | { 7 | sleep( 1 ); 8 | std::cout << "Ping long!" << std::endl; 9 | myClass->DoSomething(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /QElapsedTimer/QElapsedTimer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /TabWidget/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QMainWindow, public Ui::MainWindow 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /TableWidgetItemSubclass/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /TableWidgetWidthHeight/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ThreadMessageBox/ThreadMessageBox.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include "form.h" 6 | 7 | int main(int argc, char*argv[]) 8 | { 9 | QApplication app(argc, argv); 10 | 11 | Form form; 12 | form.show(); 13 | 14 | return app.exec(); 15 | } -------------------------------------------------------------------------------- /TimeAFunction/TimeAFunction.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /Boost/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public Q_SLOTS: 13 | void pushButton_SetLabelText(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /FileExtension/FileExtension.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | 8 | QFileInfo myFile("CMakeLists.txt"); 9 | std::cout << "extension: " << myFile.suffix().toStdString() << std::endl; 10 | 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /Label/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | class MainWindow : public QMainWindow, public Ui::MainWindow 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MainWindow(); 12 | 13 | public slots: 14 | void btnSetText_clicked(); 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Layout/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void pushButton_SetLabelText(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Message/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | class MainWindow : public QMainWindow, public Ui::MainWindow 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MainWindow(); 12 | 13 | public slots: 14 | void btnSetText_clicked(); 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ModelView/AbstractListModel/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModel/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ProgrammaticButton/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(ProgrammaticButton) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | ADD_EXECUTABLE(ProgrammaticButton ProgrammaticButton.cpp) 9 | TARGET_LINK_LIBRARIES(ProgrammaticButton ${QT_LIBRARIES}) 10 | -------------------------------------------------------------------------------- /SaveGraphicsView/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | public slots: 13 | void on_btnSave_clicked(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /StandardItemModelListView/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ThreadClassMessageBox/TestClass.cpp: -------------------------------------------------------------------------------- 1 | #include "TestClass.h" 2 | #include 3 | 4 | void TestClass::MyFunction() 5 | { 6 | std::cout << "MyFunction start." << std::endl; 7 | 8 | // ... I want to produce a message box here ... 9 | 10 | std::cout << "MyFunction end." << std::endl; 11 | } -------------------------------------------------------------------------------- /ThreadMessageBox_bak/thread.cpp: -------------------------------------------------------------------------------- 1 | #include "thread.h" 2 | 3 | #include 4 | #include 5 | 6 | void Thread::run() 7 | { 8 | std::cout << "Message box from thread" << std::endl; 9 | 10 | QMessageBox msgBox; 11 | msgBox.setText("Test Text"); 12 | msgBox.exec(); 13 | 14 | } -------------------------------------------------------------------------------- /ToolTip/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void pushButton_SetLabelText(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /UseQtInLibrary/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef QT_VERSION 4 | #pragma message("Main Using Qt!") 5 | #else 6 | #pragma message("Main NOT using Qt!") 7 | #endif 8 | 9 | int main(int argc, char *argv[]) 10 | { 11 | QApplication app(argc, argv); 12 | 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /WidgetWithoutApplication/NonGUICode.cpp: -------------------------------------------------------------------------------- 1 | struct Visitor 2 | { 3 | void DoSomething(){}; 4 | }; 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | 9 | Visitor visitor; 10 | for(unsigned int i = 0; i < 1000; ++i) 11 | { 12 | visitor.DoSomething(); 13 | } 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /Databases/SqlQueryModel/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_SqlQueryModel.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModelImage/form.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | 3 | Form::Form(QWidget *parent) : QWidget(parent) 4 | { 5 | setupUi(this); 6 | 7 | this->model = new MyTableModel; 8 | this->tableView->setModel(model); 9 | 10 | this->tableView->resizeColumnsToContents(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Parent/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | void on_btnOpen_clicked(); 13 | 14 | public: 15 | Form(QWidget *parent = 0); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /SlotWithParameter/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void btnButton_clicked(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /ThreadClassMessageBox/ThreadClassMessageBox.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include "form.h" 6 | 7 | int main(int argc, char*argv[]) 8 | { 9 | QApplication app(argc, argv); 10 | 11 | Form form; 12 | form.show(); 13 | 14 | return app.exec(); 15 | } -------------------------------------------------------------------------------- /Delegates/IndexWidget/IndexWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_IndexWidget.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Images/QImage/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | void on_btnOpen_clicked(); 13 | public: 14 | Form(QWidget *parent = 0); 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Images/Rubberband/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public slots: 10 | void SelectionChanged(); 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /InputDialog/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void btnClickMe_clicked(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /LineEditPassword/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | Form::Form(QWidget *parent) 6 | : QWidget(parent) 7 | { 8 | this->setupUi(this); 9 | } 10 | 11 | void Form::on_lineEdit_textEdited( const QString & text ) 12 | { 13 | this->label->setText(this->lineEdit->text()); 14 | } 15 | -------------------------------------------------------------------------------- /ModelView/AbstractListModelCheckable/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModelSizeHints/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /MultipleInheritance/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void pushButton_SetLabelText(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /SpinBox/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | Form::Form(QWidget *parent) 6 | : QWidget(parent) 7 | { 8 | this->setupUi(this); 9 | } 10 | 11 | void Form::on_spinBox_valueChanged(int value) 12 | { 13 | //this->label->setText(value); 14 | this->label->setNum(value); 15 | } 16 | -------------------------------------------------------------------------------- /Toolbar/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | Form::Form(QWidget *parent) 6 | : QMainWindow(parent) 7 | { 8 | setupUi(this); 9 | 10 | QIcon saveIcon = QIcon::fromTheme("document-save"); 11 | actionSave->setIcon(saveIcon); 12 | this->toolBar->addAction(actionSave); 13 | } 14 | -------------------------------------------------------------------------------- /AutoConnect/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void on_pushButton_clicked(); 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Concurrent/Run/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | void on_btnOpen_clicked(); 13 | 14 | public: 15 | Form(QWidget *parent = 0); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Concurrent/RunBind/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | void on_btnOpen_clicked(); 13 | 14 | public: 15 | Form(QWidget *parent = 0); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Dialog/Modeless/dialog.cpp: -------------------------------------------------------------------------------- 1 | #include "dialog.h" 2 | 3 | Dialog::Dialog() 4 | { 5 | setupUi(this); 6 | } 7 | 8 | void Dialog::on_buttonBox_accepted() 9 | { 10 | this->setResult(QDialog::Accepted); 11 | } 12 | 13 | void Dialog::on_buttonBox_rejected() 14 | { 15 | this->setResult(QDialog::Rejected); 16 | } 17 | -------------------------------------------------------------------------------- /KFileWidget/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void slot_fileDoubleClicked(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /QWidgetSubclass/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void slot_fileDoubleClicked(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /ScrollBar/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void pushButton_SetLabelText(); 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /SizeRestrictions/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::ButtonForm 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void pushButton_SetLabelText(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /SmartPointers/Pointer/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | class MainWindow : public QMainWindow, public Ui::MainWindow 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MainWindow(); 12 | 13 | public slots: 14 | void btnSetText_clicked(); 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /CheckBox/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void SetLabelText(); 15 | 16 | private: 17 | Ui::Form ui; 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ClickableLabelInTable/ClickableLabel.cpp: -------------------------------------------------------------------------------- 1 | #include "ClickableLabel.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | void ClickableLabel::mousePressEvent(QMouseEvent* pMouseEvent) 8 | { 9 | std::cout << "mousePressEvent: " << this->Id << std::endl; 10 | emit ClickedSignal(this->Id); 11 | } 12 | -------------------------------------------------------------------------------- /FloatSlider/Demo/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "FloatSlider.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication app(argc, argv); 8 | FloatSlider slider; 9 | slider.SetMinValue(0.0f); 10 | slider.SetMaxValue(2.0f); 11 | 12 | slider.show(); 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /LabeledImages/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | void on_btnOpen_clicked(); 13 | 14 | public: 15 | Form(QWidget *parent = 0); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /MessageBox/messagebox.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_messagebox.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void btnClickMe_clicked(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /QGraphicsView/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | void on_btnOpen_clicked(); 13 | 14 | public: 15 | Form(QWidget *parent = 0); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /SpinBox/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void on_spinBox_valueChanged(int); 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Concurrent/RunMemberFunction/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | void on_btnOpen_clicked(); 13 | 14 | public: 15 | Form(QWidget *parent = 0); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Databases/TableView/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_TableView.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void pushButton_clicked(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Debug/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(Debug) 4 | FIND_PACKAGE(Qt4 REQUIRED) 5 | INCLUDE(${QT_USE_FILE}) 6 | 7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 8 | 9 | ADD_EXECUTABLE(Debug Debug.cpp) 10 | TARGET_LINK_LIBRARIES(Debug ${QT_LIBRARIES}) 11 | 12 | -------------------------------------------------------------------------------- /FileMenu/filemenu.h: -------------------------------------------------------------------------------- 1 | #ifndef FILEMENUFORM_H 2 | #define FILEMENUFORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QMainWindow, private Ui::FileMenuForm 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void mnuTest_triggered(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /GUIVisitor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(GUIVisitor) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | QT4_WRAP_CPP(MOCSrcs DrawVisitor.h MainLoopObject.h) 9 | ADD_EXECUTABLE(GUIVisitor main.cpp ${MOCSrcs}) 10 | TARGET_LINK_LIBRARIES(GUIVisitor ${QT_LIBRARIES}) 11 | -------------------------------------------------------------------------------- /Icon/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include 7 | 8 | class Form : public QMainWindow, private Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | public slots: 16 | 17 | 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /LineEditPassword/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void on_lineEdit_textEdited( const QString & text ); 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ManuallyCreateImage/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | void on_btnOpen_clicked(); 13 | 14 | public: 15 | Form(QWidget *parent = 0); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ProgrammaticButton/ProgrammaticButton.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main( int argc, char **argv ) 5 | { 6 | QApplication a( argc, argv ); 7 | 8 | QPushButton hello( "Hello world!", 0 ); 9 | hello.resize( 100, 30 ); 10 | hello.show(); 11 | 12 | return a.exec(); 13 | } 14 | 15 | -------------------------------------------------------------------------------- /ProgressDialog/ProgressDialog.cpp: -------------------------------------------------------------------------------- 1 | //#include 2 | #include 3 | #include 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /Style/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include 7 | 8 | class Form : public QMainWindow, private Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | public slots: 16 | 17 | 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ThreadMessageBox_bak/ThreadMessageBox.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include "form.h" 6 | #include "thread.h" 7 | 8 | int main(int argc, char*argv[]) 9 | { 10 | QApplication app(argc, argv); 11 | 12 | Form form; 13 | form.show(); 14 | 15 | return app.exec(); 16 | } -------------------------------------------------------------------------------- /ThreadedGUIUpdate/ComputationClass.cpp: -------------------------------------------------------------------------------- 1 | #include "ComputationClass.h" 2 | 3 | #include 4 | 5 | void ComputationClass::DoComputation() 6 | { 7 | std::cout << "ComputationClass::DoComputation()" << std::endl; 8 | // Big computation is done here 9 | // ... 10 | emit RefreshSignal(); 11 | // ... 12 | } 13 | -------------------------------------------------------------------------------- /Toolbar/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include 7 | 8 | class Form : public QMainWindow, private Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | public slots: 16 | 17 | 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /TranslateAnImage/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | void on_btnOpen_clicked(); 13 | 14 | public: 15 | Form(QWidget *parent = 0); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ButtonWidget/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_buttonform.h" 5 | 6 | class MyForm : public QWidget, private Ui::ButtonForm 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void pushButton_SetLabelText(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Cursor/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void pushButton_clicked(); 14 | 15 | private: 16 | bool isWaiting; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Layout/form.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | 3 | MyForm::MyForm(QWidget *parent) 4 | : QWidget(parent) 5 | { 6 | setupUi(this); 7 | connect( this->pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_SetLabelText()) ); 8 | } 9 | 10 | void MyForm::pushButton_SetLabelText() 11 | { 12 | this->label->setText("hello"); 13 | } 14 | -------------------------------------------------------------------------------- /Signal/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(Signal) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | QT4_WRAP_CPP(MOCSrcs MyWidget.h) 9 | 10 | ADD_EXECUTABLE(Signal Signal.cpp MyWidget.cpp ${MOCSrcs}) 11 | TARGET_LINK_LIBRARIES(Signal ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /TextEdit/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void pushButton_SetLabelText(); 15 | 16 | private: 17 | Ui::Form ui; 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ThreadedGUIUpdate_bad/ComputationClass.cpp: -------------------------------------------------------------------------------- 1 | #include "ComputationClass.h" 2 | 3 | #include 4 | 5 | void ComputationClass::DoComputation() 6 | { 7 | std::cout << "ComputationClass::DoComputation()" << std::endl; 8 | // Big computation is done here 9 | // ... 10 | emit RefreshSignal(); 11 | // ... 12 | } 13 | -------------------------------------------------------------------------------- /Toolbar_old/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include 7 | 8 | class Form : public QMainWindow, private Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | public slots: 16 | 17 | 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Boost/form.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | 3 | MyForm::MyForm(QWidget *parent) 4 | : QWidget(parent) 5 | { 6 | setupUi(this); 7 | connect( this->pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_SetLabelText()) ); 8 | 9 | } 10 | 11 | void MyForm::pushButton_SetLabelText() 12 | { 13 | this->label->setText("hello"); 14 | } 15 | -------------------------------------------------------------------------------- /Concurrent/Run/Run.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include "form.h" 8 | 9 | int main(int argc, char*argv[]) 10 | { 11 | QApplication app(argc, argv); 12 | 13 | Form form; 14 | 15 | form.show(); 16 | 17 | return app.exec(); 18 | } -------------------------------------------------------------------------------- /Connect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(Connect) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | QT4_WRAP_CPP(MOCSrcs MyWidget.h) 9 | 10 | ADD_EXECUTABLE(Connect Connect.cpp MyWidget.cpp ${MOCSrcs}) 11 | TARGET_LINK_LIBRARIES(Connect ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /Connect/MyWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MYWIDGET_H 2 | #define MYWIDGET_H 3 | 4 | #include 5 | 6 | class MyWidget : public QObject 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MyWidget(); 12 | 13 | void EmitSignal(); 14 | 15 | public slots: 16 | void myslot(); 17 | 18 | signals: 19 | void mysignal(); 20 | 21 | }; 22 | 23 | #endif -------------------------------------------------------------------------------- /Dialog/Modal/dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_H 2 | #define DIALOG_H 3 | 4 | #include "ui_dialog.h" 5 | 6 | class Dialog : public QDialog, private Ui::Dialog 7 | { 8 | Q_OBJECT 9 | public: 10 | Dialog(); 11 | 12 | public slots: 13 | void on_buttonBox_accepted(); 14 | void on_buttonBox_rejected(); 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /GraphicsSceneSubclass/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | std::vector Items; 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /GraphicsViewSubclass/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | std::vector Items; 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /QHash/QHash.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | QHash hash; 8 | 9 | hash["one"] = 1; 10 | hash["three"] = 3; 11 | hash["seven"] = 7; 12 | 13 | int num1 = hash["seven"]; 14 | std::cout << "num1: " << num1 << std::endl; 15 | 16 | return 0; 17 | } -------------------------------------------------------------------------------- /Signal/MyWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MYWIDGET_H 2 | #define MYWIDGET_H 3 | 4 | #include 5 | 6 | class MyWidget : public QObject 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MyWidget(); 12 | 13 | void EmitSignal(); 14 | 15 | public slots: 16 | void myslot(); 17 | 18 | signals: 19 | void mysignal(); 20 | 21 | }; 22 | 23 | #endif -------------------------------------------------------------------------------- /ToolTip/form.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | 3 | MyForm::MyForm(QWidget *parent) 4 | : QWidget(parent) 5 | { 6 | setupUi(this); 7 | connect( this->pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_SetLabelText()) ); 8 | } 9 | 10 | void MyForm::pushButton_SetLabelText() 11 | { 12 | this->label->setText("hello"); 13 | } 14 | -------------------------------------------------------------------------------- /Databases/TableViewComboBox/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_TableViewComboBox.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void pushButton_clicked(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Dialog/Modeless/dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_H 2 | #define DIALOG_H 3 | 4 | #include "ui_dialog.h" 5 | 6 | class Dialog : public QDialog, private Ui::Dialog 7 | { 8 | Q_OBJECT 9 | public: 10 | Dialog(); 11 | 12 | public slots: 13 | void on_buttonBox_accepted(); 14 | void on_buttonBox_rejected(); 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /FileMenu/filemenu.cpp: -------------------------------------------------------------------------------- 1 | #include "filemenu.h" 2 | 3 | #include 4 | 5 | MyForm::MyForm(QWidget *parent) 6 | { 7 | setupUi(this); 8 | connect( this->mnuTest, SIGNAL( triggered() ), this, SLOT(mnuTest_triggered()) ); 9 | } 10 | 11 | void MyForm::mnuTest_triggered() 12 | { 13 | std::cout << "Clicked." << std::endl; 14 | } 15 | -------------------------------------------------------------------------------- /Message/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | #include 5 | 6 | MainWindow::MainWindow() 7 | { 8 | setupUi(this); 9 | connect(this->btnSetText, SIGNAL(clicked()), this, SLOT(btnSetText_clicked())); 10 | } 11 | 12 | void MainWindow::btnSetText_clicked() 13 | { 14 | this->lblLabel->setText("test"); 15 | } -------------------------------------------------------------------------------- /ProgrammaticallyAddWidgetToForm/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::ButtonForm 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void pushButton_SetLabelText(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /QMetaEnum/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(QMetaEnum) 4 | FIND_PACKAGE(Qt4 REQUIRED) 5 | INCLUDE(${QT_USE_FILE}) 6 | 7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 8 | 9 | ADD_EXECUTABLE(QMetaEnum QMetaEnum.cpp) 10 | TARGET_LINK_LIBRARIES(QMetaEnum ${QT_LIBRARIES}) 11 | -------------------------------------------------------------------------------- /TableWidgetSelectRow/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include 7 | 8 | class Form : public QWidget, public Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | void SetupTable(QTableWidget* table); 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Thread/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | void slot_Update(); 13 | 14 | public: 15 | Form(QWidget *parent = 0); 16 | 17 | private: 18 | unsigned int Counter; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /ThreadFromGUI/Thread.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include "form.h" 8 | 9 | int main(int argc, char*argv[]) 10 | { 11 | QApplication app(argc, argv); 12 | 13 | Form form; 14 | 15 | form.show(); 16 | 17 | return app.exec(); 18 | } -------------------------------------------------------------------------------- /ButtonWidget/form.cpp: -------------------------------------------------------------------------------- 1 | #include "buttonform.h" 2 | 3 | MyForm::MyForm(QWidget *parent) 4 | : QWidget(parent) 5 | { 6 | setupUi(this); 7 | connect( this->pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_SetLabelText()) ); 8 | } 9 | 10 | void MyForm::pushButton_SetLabelText() 11 | { 12 | this->label->setText("hello"); 13 | } 14 | -------------------------------------------------------------------------------- /Dir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(Dir) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(Dir Dir.cpp) 11 | TARGET_LINK_LIBRARIES(Dir ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /GraphicsItemSubclass/MyGraphicsItem.cpp: -------------------------------------------------------------------------------- 1 | #include "MyGraphicsItem.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | void MyGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent* pMouseEvent) 8 | { 9 | //std::cout << "mousePressEvent: " << this->Id << std::endl; 10 | emit ClickedSignal(this->Id); 11 | } 12 | -------------------------------------------------------------------------------- /GraphicsSceneSubclass/MyGraphicsScene.h: -------------------------------------------------------------------------------- 1 | #ifndef MyGraphicsScene_H 2 | #define MyGraphicsScene_H 3 | 4 | #include 5 | 6 | class MyGraphicsView : public QGraphicsScene 7 | { 8 | public: 9 | MyGraphicsView(QWidget *parent = 0); 10 | 11 | void mousePressEvent(QMouseEvent* pMouseEvent); 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /ModelView/AbstractListModelCheckableExternalData/Item.h: -------------------------------------------------------------------------------- 1 | #ifndef ITEM_H 2 | #define ITEM_H 3 | 4 | class Item 5 | { 6 | public: 7 | Item(const QString& name = QString(), const Qt::CheckState displayed = Qt::Unchecked) : 8 | Name(name), Displayed(displayed){} 9 | QString Name; 10 | Qt::CheckState Displayed; 11 | }; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModelImage/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include "MyTableModel.h" 7 | 8 | class Form : public QWidget, public Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | protected: 16 | MyTableModel* model; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /MultipleInheritance/form.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | 3 | MyForm::MyForm(QWidget *parent) 4 | : QWidget(parent) 5 | { 6 | setupUi(this); 7 | connect( this->pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_SetLabelText()) ); 8 | } 9 | 10 | void MyForm::pushButton_SetLabelText() 11 | { 12 | this->label->setText("hello"); 13 | } 14 | -------------------------------------------------------------------------------- /QSignalMapper/form.cpp: -------------------------------------------------------------------------------- 1 | #include "buttonform.h" 2 | 3 | MyForm::MyForm(QWidget *parent) 4 | : QWidget(parent) 5 | { 6 | setupUi(this); 7 | connect( this->pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_SetLabelText()) ); 8 | } 9 | 10 | void MyForm::pushButton_SetLabelText() 11 | { 12 | this->label->setText("hello"); 13 | } 14 | -------------------------------------------------------------------------------- /SliderBAK/RadioButton/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void pushButton_SetLabelText(); 15 | 16 | private: 17 | Ui::Form ui; 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ThreadMessageBox_bak/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include 5 | #include "ui_form.h" 6 | 7 | class Form : public QWidget, private Ui::Form 8 | { 9 | Q_OBJECT 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void pushButton_clicked(); 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /Toolbar_old/Toolbar.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * See 'Style' example for use of QIcon with QCommonStyle to use built in icons 3 | */ 4 | 5 | #include 6 | 7 | #include "form.h" 8 | 9 | int main(int argc, char *argv[]) 10 | { 11 | QApplication app(argc, argv); 12 | Form form; 13 | 14 | form.show(); 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /ButtonBox/form.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | 3 | MyForm::MyForm(QWidget *parent) 4 | : QWidget(parent) 5 | { 6 | setupUi(this); 7 | 8 | } 9 | 10 | void MyForm::on_buttonBox_accepted() 11 | { 12 | this->label->setText("accepted"); 13 | } 14 | 15 | void MyForm::on_buttonBox_rejected() 16 | { 17 | this->label->setText("rejected"); 18 | } 19 | -------------------------------------------------------------------------------- /Databases/Sql/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(Sql) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(Sql Sql.cpp) 11 | TARGET_LINK_LIBRARIES(Sql ${QT_LIBRARIES}) 12 | -------------------------------------------------------------------------------- /File/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(File) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(File File.cpp) 11 | TARGET_LINK_LIBRARIES(File ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /ModelView/AbstractListModelCheckableExternalDataSafe/Item.h: -------------------------------------------------------------------------------- 1 | #ifndef ITEM_H 2 | #define ITEM_H 3 | 4 | class Item 5 | { 6 | public: 7 | Item(const QString& name = QString(), const Qt::CheckState displayed = Qt::Unchecked) : 8 | Name(name), Displayed(displayed){} 9 | QString Name; 10 | Qt::CheckState Displayed; 11 | }; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModelCheckable/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include "MyTableModel.h" 7 | 8 | class Form : public QWidget, public Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | protected: 16 | MyTableModel* model; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /SizeRestrictions/form.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | 3 | MyForm::MyForm(QWidget *parent) 4 | : QWidget(parent) 5 | { 6 | setupUi(this); 7 | connect( this->pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_SetLabelText()) ); 8 | } 9 | 10 | void MyForm::pushButton_SetLabelText() 11 | { 12 | this->label->setText("hello"); 13 | } 14 | 15 | -------------------------------------------------------------------------------- /Slider/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void on_horizontalSlider_valueChanged(int); 15 | void SetLabelFromSlider(); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /SmartPointers/Pointer/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | #include 5 | 6 | MainWindow::MainWindow() 7 | { 8 | setupUi(this); 9 | connect(this->btnSetText, SIGNAL(clicked()), this, SLOT(btnSetText_clicked())); 10 | } 11 | 12 | void MainWindow::btnSetText_clicked() 13 | { 14 | this->lblLabel->setText("test"); 15 | } -------------------------------------------------------------------------------- /StatusBar/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | #include 6 | 7 | class Form : public QMainWindow, private Ui::MainWindow 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | Form(QWidget *parent = 0); 13 | 14 | public slots: 15 | void on_pushButton_clicked(); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /TableWidgetClickRows/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void on_tableWidget_cellClicked( int row, int column ); 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /TableWidgetItemSubclass/MyTableWidgetItem.cpp: -------------------------------------------------------------------------------- 1 | #include "MyGraphicsItem.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | void MyGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent* pMouseEvent) 8 | { 9 | //std::cout << "mousePressEvent: " << this->Id << std::endl; 10 | emit ClickedSignal(this->Id); 11 | } 12 | -------------------------------------------------------------------------------- /ThreadClassMessageBox/thread.h: -------------------------------------------------------------------------------- 1 | #ifndef THREAD_H 2 | #define THREAD_H 3 | 4 | #include 5 | 6 | #include "TestClass.h" 7 | 8 | class Thread : public QThread 9 | { 10 | Q_OBJECT 11 | public: 12 | void run(); 13 | 14 | signals: 15 | void DisplayMessageBoxSignal(); 16 | 17 | public: 18 | TestClass MyTestClass; 19 | }; 20 | 21 | #endif -------------------------------------------------------------------------------- /ThreadedGUIUpdate/Interactive.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "Form.h" 5 | 6 | int main( int argc, char** argv ) 7 | { 8 | QApplication app( argc, argv ); 9 | 10 | QApplication::setStyle(new QCleanlooksStyle); 11 | 12 | Form myForm; 13 | myForm.show(); 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /WidgetInsideMainWindow/InsideForm.h: -------------------------------------------------------------------------------- 1 | #ifndef INSIDEFORM_H 2 | #define INSIDEFORM_H 3 | 4 | #include "ui_InsideForm.h" 5 | 6 | class MyInsideForm : public QWidget, private Ui::InsideForm 7 | { 8 | Q_OBJECT 9 | public: 10 | MyInsideForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void btnButton_clicked(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /qmake/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void on_horizontalSlider_valueChanged(int); 15 | void SetLabelFromSlider(); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Concurrent/FutureWatcher/FutureWatcher.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include "form.h" 8 | 9 | int main(int argc, char*argv[]) 10 | { 11 | QApplication app(argc, argv); 12 | 13 | Form form; 14 | 15 | form.show(); 16 | 17 | return app.exec(); 18 | } -------------------------------------------------------------------------------- /DesignerPlugin/FloatSlider.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "FloatSlider.h" 4 | 5 | FloatSlider::FloatSlider(QWidget *parent) : QSlider(parent) 6 | { 7 | setupUi(this); 8 | } 9 | 10 | float FloatSlider::GetValue() 11 | { 12 | return this->MinValue + (this->MaxValue - this->MinValue) * static_cast(this->value()) / 100.0f; 13 | } 14 | -------------------------------------------------------------------------------- /FileDialogDefaultSuffix/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include 5 | 6 | #include "ui_form.h" 7 | 8 | class Form : public QWidget, private Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | private slots: 16 | void on_btnSave_clicked(); 17 | 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /FloatSlider_bak/FloatSlider.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "FloatSlider.h" 4 | 5 | FloatSlider::FloatSlider(QWidget *parent) : QSlider(parent) 6 | { 7 | setupUi(this); 8 | } 9 | 10 | float FloatSlider::GetValue() 11 | { 12 | return this->MinValue + (this->MaxValue - this->MinValue) * static_cast(this->value()) / 100.0f; 13 | } 14 | -------------------------------------------------------------------------------- /LineEditInputMask/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | void on_lineEdit_textEdited( const QString & text ); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ModelView/AbstractListModelCheckableExternalData/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include "Item.h" 7 | 8 | class Form : public QWidget, public Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | protected: 16 | QVector Items; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ProgressBarThreadWindow/ProgressBarThreadWindow.cpp: -------------------------------------------------------------------------------- 1 | // Can't do this - you cannot have GUI objects in the non-main thread! 2 | 3 | #include 4 | #include "form.h" 5 | 6 | int main( int argc, char **argv ) 7 | { 8 | QApplication app(argc, argv); 9 | MainWindow window; 10 | 11 | window.show(); 12 | return app.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /QColor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(QColor) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(QColor main.cpp) 11 | TARGET_LINK_LIBRARIES(QColor ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /Signal/MyWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "MyWidget.h" 2 | 3 | #include 4 | 5 | void MyWidget::myslot() 6 | { 7 | std::cout << "Slot called!" << std::endl; 8 | } 9 | 10 | void MyWidget::EmitSignal() 11 | { 12 | emit mysignal(); 13 | } 14 | 15 | MyWidget::MyWidget() 16 | { 17 | connect( this, SIGNAL( mysignal() ), this, SLOT(myslot()) ); 18 | } 19 | -------------------------------------------------------------------------------- /SignalArray/SmallWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef SmallWidget_H 2 | #define SmallWidget_H 3 | 4 | #include 5 | 6 | class SmallWidget : public QObject 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | SmallWidget(); 12 | 13 | void EmitSignal(); 14 | 15 | signals: 16 | void mysignal(); 17 | void mysignalVector(QVector); 18 | 19 | }; 20 | 21 | #endif -------------------------------------------------------------------------------- /Test/Test.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_H 2 | #define TEST_H 3 | 4 | #include "ui_Test.h" 5 | 6 | class Test : public QMainWindow 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Test(QWidget *parent = 0){ui.setupUi(this);} 12 | 13 | public slots: 14 | //void pushButton_SetLabelText(); 15 | 16 | private: 17 | Ui::MainWindow ui; 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ThreadMessageBox_bak/form.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | #include "thread.h" 3 | 4 | Form::Form(QWidget *parent) : QWidget(parent) 5 | { 6 | setupUi(this); 7 | connect( this->pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_clicked()) ); 8 | } 9 | 10 | void Form::pushButton_clicked() 11 | { 12 | Thread a; 13 | a.start(); 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /ThreadedGUIUpdate_bad/Interactive.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "Form.h" 5 | 6 | int main( int argc, char** argv ) 7 | { 8 | QApplication app( argc, argv ); 9 | 10 | QApplication::setStyle(new QCleanlooksStyle); 11 | 12 | Form myForm; 13 | myForm.show(); 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /WidgetInsideMainWindow/filemenu.h: -------------------------------------------------------------------------------- 1 | #ifndef FILEMENUFORM_H 2 | #define FILEMENUFORM_H 3 | 4 | #include "ui_filemenu.h" 5 | 6 | class MyForm : public QMainWindow, private Ui::FileMenuForm 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void mnuOpenInnerForm_triggered(); 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /ButtonBox/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MyForm(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | void on_buttonBox_accepted(); 16 | void on_buttonBox_rejected(); 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Calendar/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | #include 7 | 8 | class MainWindow : public QMainWindow, public Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | MainWindow(); 14 | 15 | public slots: 16 | void on_calendarWidget_clicked ( const QDate & date ) ; 17 | 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Dialog/Modal/dialog.cpp: -------------------------------------------------------------------------------- 1 | #include "dialog.h" 2 | 3 | Dialog::Dialog() 4 | { 5 | setupUi(this); 6 | } 7 | 8 | void Dialog::on_buttonBox_accepted() 9 | { 10 | this->setResult(QDialog::Accepted); 11 | //this->accept(); 12 | } 13 | 14 | void Dialog::on_buttonBox_rejected() 15 | { 16 | this->setResult(QDialog::Rejected); 17 | //this->reject(); 18 | } 19 | -------------------------------------------------------------------------------- /ITKFilterComputationThread/Interactive.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "Form.h" 5 | 6 | int main( int argc, char** argv ) 7 | { 8 | QApplication app( argc, argv ); 9 | 10 | QApplication::setStyle(new QCleanlooksStyle); 11 | 12 | Form myForm; 13 | myForm.show(); 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /ModelView/AbstractListModelCheckableExternalDataSafe/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include "Item.h" 7 | 8 | class Form : public QWidget, public Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | protected: 16 | QVector Items; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /SlotWithParameter/form.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | 3 | #include 4 | 5 | MyForm::MyForm(QWidget *parent) 6 | : QWidget(parent) 7 | { 8 | setupUi(this); 9 | connect( this->btnButton, SIGNAL( clicked() ), this, SLOT(btnButton_clicked()) ); 10 | } 11 | 12 | void MyForm::btnButton_clicked() 13 | { 14 | this->lblLabel->setText("hello"); 15 | } 16 | -------------------------------------------------------------------------------- /Date/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | #include 7 | 8 | class MainWindow : public QMainWindow, public Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | MainWindow(); 14 | 15 | public slots: 16 | void btnDisplayTime_clicked(); 17 | 18 | private: 19 | QTime timer; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /GUIVisitor/SimpleVisitor.h: -------------------------------------------------------------------------------- 1 | #ifndef SimpleVisitor_h 2 | #define SimpleVisitor_h 3 | 4 | #include 5 | 6 | #include "VisitorParent.h" 7 | 8 | class SimpleVisitor : public VisitorParent 9 | { 10 | public: 11 | 12 | void DoSomething() 13 | { 14 | std::cout << "SimpleVisitor::DoSomething()" << std::endl; 15 | } 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /LabeledSlider/DemoUI/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void on_horizontalSlider_valueChanged(int); 15 | void SetLabelFromSlider(); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ModelView/ListViewImages/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include "MyListModel.h" 7 | 8 | class Form : public QWidget, public Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | 14 | Form(QWidget *parent = 0); 15 | 16 | public slots: 17 | 18 | private: 19 | MyListModel* model; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /ModelView/TreeView/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include 7 | 8 | class Form : public QMainWindow, private Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | public slots: 16 | void on_treeView_clicked(); 17 | 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ProgressDialog/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | //class MainWindow : public QWidget 7 | class MainWindow : public QMainWindow, public Ui::MainWindow 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | MainWindow(); 13 | 14 | public slots: 15 | void on_btnStart_clicked(); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /QHash/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(QHash) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(QHash QHash.cpp) 11 | TARGET_LINK_LIBRARIES(QHash ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /Concurrent/FutureWatcher/MyClass.h: -------------------------------------------------------------------------------- 1 | #ifndef MyClass_H 2 | #define MyClass_H 3 | 4 | #include 5 | 6 | class MyClass 7 | { 8 | public: 9 | 10 | void LongFunction() 11 | { 12 | for( int count = 0; count < 5; count++ ) 13 | { 14 | sleep( 1 ); 15 | std::cout << "Ping long!" << std::endl; 16 | } 17 | } 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Concurrent/RunMemberFunction/RunMemberFunction.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include "form.h" 8 | 9 | int main(int argc, char*argv[]) 10 | { 11 | QApplication app(argc, argv); 12 | 13 | Form form; 14 | 15 | form.show(); 16 | 17 | return app.exec(); 18 | } 19 | -------------------------------------------------------------------------------- /Concurrent/RunWithGUIUpdate/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | private: 11 | unsigned int Counter; 12 | 13 | public slots: 14 | 15 | void slot_Update(); 16 | 17 | public: 18 | Form(QWidget *parent = 0); 19 | 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Dialog/Modal/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include "dialog.h" 7 | 8 | class Form : public QWidget, private Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | void ShowModal(); 15 | 16 | public slots: 17 | void on_btnShowModal_clicked(); 18 | 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Dialog/ModalData/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include "dialog.h" 7 | 8 | class Form : public QWidget, private Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | void ShowModal(); 15 | 16 | public slots: 17 | void on_btnShowModal_clicked(); 18 | 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /FileInfo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(FileInfo) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(FileInfo FileInfo.cpp) 11 | TARGET_LINK_LIBRARIES(FileInfo ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /ITKFilterComputationThreadHardCoded/Interactive.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "Form.h" 5 | 6 | int main( int argc, char** argv ) 7 | { 8 | QApplication app( argc, argv ); 9 | 10 | QApplication::setStyle(new QCleanlooksStyle); 11 | 12 | Form myForm; 13 | myForm.show(); 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /Time/form.h.bak: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | #include 7 | 8 | class MainWindow : public QMainWindow, public Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | MainWindow(); 14 | 15 | public slots: 16 | void btnDisplayTime_clicked(); 17 | 18 | private: 19 | QTime timer; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /UseQtInLibrary/mylib.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef QT_VERSION 4 | #pragma message("Lib Using Qt!") 5 | #else 6 | #pragma message("Lib NOT using Qt!") 7 | #endif 8 | 9 | 10 | void myfunction() 11 | { 12 | #ifdef QT_VERSION 13 | #pragma message("myfunction Using Qt!") 14 | #else 15 | #pragma message("myfunction NOT using Qt!") 16 | #endif 17 | } 18 | -------------------------------------------------------------------------------- /Concurrent/BlockingMapWithBoostBind/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(BlockingMapWithBoostBind) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | ADD_EXECUTABLE(BlockingMapWithBoostBind BlockingMapWithBoostBind.cpp)# ${MOCSrcs} ${UISrcs}) 9 | TARGET_LINK_LIBRARIES(BlockingMapWithBoostBind ${QT_LIBRARIES}) 10 | -------------------------------------------------------------------------------- /Concurrent/RunMemberFunction/MyClass.h: -------------------------------------------------------------------------------- 1 | #ifndef MyClass_H 2 | #define MyClass_H 3 | 4 | #include 5 | 6 | class MyClass 7 | { 8 | 9 | public: 10 | 11 | void start() 12 | { 13 | for( int count = 0; count < 5; count++ ) 14 | { 15 | sleep( 1 ); 16 | std::cout << "Ping!" << std::endl; 17 | } 18 | } 19 | 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /GraphicsItemSubclass/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | void ClickedSlot(const unsigned int); 12 | 13 | public: 14 | Form(QWidget *parent = 0); 15 | //std::vector Items; 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /HelpEngine/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void btnUpdate_SetLabelText(); 15 | void on_lineEdit_textEdited( const QString & text ); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /LineEdit/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void btnUpdate_SetLabelText(); 15 | void on_lineEdit_textEdited( const QString & text ); 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModelSelect/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void SomethingChanged(const QModelIndex & , const QModelIndex & ); 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /QVector/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(QVector) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(QVector QVector.cpp) 11 | TARGET_LINK_LIBRARIES(QVector ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /SignalWithValue/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(SignalWithValue) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | QT4_WRAP_CPP(MOCSrcs MyWidget.h) 9 | 10 | ADD_EXECUTABLE(SignalWithValue SignalWithValue.cpp MyWidget.cpp ${MOCSrcs}) 11 | TARGET_LINK_LIBRARIES(SignalWithValue ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /SliderBAK/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | cmake_minimum_required(VERSION 2.6) 3 | 4 | PROJECT(ProgressBar) 5 | 6 | FIND_PACKAGE(Qt4 REQUIRED) 7 | INCLUDE(${QT_USE_FILE}) 8 | 9 | QT4_WRAP_UI(UISrcs main.ui) 10 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | ADD_EXECUTABLE(ProgressBar ProgressBar.cpp ${UISrcs}) 13 | TARGET_LINK_LIBRARIES(ProgressBar ${QT_LIBRARIES}) 14 | -------------------------------------------------------------------------------- /WidgetInsideMainWindow/InsideForm.cpp: -------------------------------------------------------------------------------- 1 | #include "InsideForm.h" 2 | 3 | #include 4 | 5 | MyInsideForm::MyInsideForm(QWidget *parent) 6 | { 7 | setupUi(this); 8 | connect( this->btnButton, SIGNAL( clicked() ), this, SLOT(btnButton_clicked()) ); 9 | } 10 | 11 | void MyInsideForm::btnButton_clicked() 12 | { 13 | this->lblLabel->setText("Clicked"); 14 | } 15 | -------------------------------------------------------------------------------- /XML/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(XML) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | INCLUDE_DIRECTORIES(${QT_QTXML_INCLUDE_DIR}) # Prevents "QtXml: No such file or directory" 9 | 10 | ADD_EXECUTABLE(XML XML.cpp) 11 | message(${QT_LIBRARIES}) 12 | TARGET_LINK_LIBRARIES(XML ${QT_LIBRARIES} QtXml) 13 | -------------------------------------------------------------------------------- /ClickGraphics/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | void on_btnShowSelected_clicked(); 13 | 14 | public: 15 | Form(QWidget *parent = 0); 16 | std::vector Items; 17 | 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ClickableLabelInTable/ClickableLabel.h: -------------------------------------------------------------------------------- 1 | #ifndef ClickableLabel_H 2 | #define ClickableLabel_H 3 | 4 | #include 5 | 6 | class ClickableLabel : public QLabel 7 | { 8 | Q_OBJECT 9 | public: 10 | 11 | void mousePressEvent(QMouseEvent* pMouseEvent); 12 | unsigned int Id; 13 | 14 | signals: 15 | void ClickedSignal(const unsigned int); 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ProgressBar/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | //class MainWindow : public QWidget 7 | class MainWindow : public QMainWindow 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | MainWindow(); 13 | 14 | public slots: 15 | void TimerEvent(); 16 | 17 | private: 18 | Ui::MainWindow ui; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /QVariant/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(QVariant) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(QVariant QVariant.cpp) 11 | TARGET_LINK_LIBRARIES(QVariant ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /SignalWithValue/MyWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MYWIDGET_H 2 | #define MYWIDGET_H 3 | 4 | #include 5 | 6 | class MyWidget : public QObject 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MyWidget(); 12 | 13 | void EmitSignal(); 14 | 15 | public slots: 16 | void myslot(const std::string&); 17 | 18 | signals: 19 | void mysignal(const std::string&); 20 | 21 | }; 22 | 23 | #endif -------------------------------------------------------------------------------- /ThreadFromGUI/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | void on_btnGo_clicked(); 13 | void slot_Update(); 14 | 15 | public: 16 | Form(QWidget *parent = 0); 17 | 18 | private: 19 | unsigned int Counter; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Concurrent/FutureWatcherProgressDialog/FutureWatcherProgressDialog.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include "form.h" 8 | 9 | int main(int argc, char*argv[]) 10 | { 11 | QApplication app(argc, argv); 12 | 13 | Form form; 14 | 15 | form.show(); 16 | 17 | return app.exec(); 18 | } -------------------------------------------------------------------------------- /SignalArray/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(SignalArray) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | QT4_WRAP_CPP(MOCSrcs MyWidget.h SmallWidget.h) 9 | 10 | ADD_EXECUTABLE(SignalArray SignalArray.cpp MyWidget.cpp SmallWidget.cpp ${MOCSrcs}) 11 | TARGET_LINK_LIBRARIES(SignalArray ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /Concurrent/FutureWatcherProgressDialog/MyClass.h: -------------------------------------------------------------------------------- 1 | #ifndef MyClass_H 2 | #define MyClass_H 3 | 4 | #include 5 | 6 | class MyClass 7 | { 8 | public: 9 | 10 | void LongFunction() 11 | { 12 | for( int count = 0; count < 5; count++ ) 13 | { 14 | sleep( 1 ); 15 | std::cout << "Ping long!" << std::endl; 16 | } 17 | } 18 | }; 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /GraphicsTextItem/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | protected: 13 | QGraphicsScene* Scene; 14 | void showEvent ( QShowEvent * event ); 15 | void resizeEvent ( QResizeEvent * event ); 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Thread/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | #include 6 | #include 7 | 8 | Form::Form(QWidget *parent) 9 | : QWidget(parent), Counter(0) 10 | { 11 | setupUi(this); 12 | } 13 | 14 | void Form::slot_Update() 15 | { 16 | Counter++; 17 | std::stringstream ss; 18 | ss << Counter; 19 | this->label->setText(ss.str().c_str()); 20 | } 21 | -------------------------------------------------------------------------------- /DialogButtonBox/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | Form::Form(QWidget *parent) : QWidget(parent) 7 | { 8 | QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); 9 | buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); 10 | 11 | this->show(); 12 | } 13 | -------------------------------------------------------------------------------- /QColor/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | 8 | QColor blue("blue"); 9 | std::cout << blue.red() << " " << blue.green() << " " << blue.blue() << std::endl; 10 | 11 | QColor blue2(Qt::blue); 12 | std::cout << blue2.red() << " " << blue2.green() << " " << blue2.blue() << std::endl; 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /Settings/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(Settings) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | INCLUDE_DIRECTORIES(${QT_QTXML_INCLUDE_DIR}) # Prevents "QtXml: No such file or directory" 9 | 10 | ADD_EXECUTABLE(Settings Settings.cpp) 11 | message(${QT_LIBRARIES}) 12 | TARGET_LINK_LIBRARIES(Settings ${QT_LIBRARIES}) 13 | -------------------------------------------------------------------------------- /ThreadedGUIUpdate/ComputationClass.h: -------------------------------------------------------------------------------- 1 | #ifndef ComputationClass_H 2 | #define ComputationClass_H 3 | 4 | // QT 5 | #include 6 | 7 | class ComputationClass : public QObject 8 | { 9 | Q_OBJECT 10 | signals: 11 | void RefreshSignal(); 12 | 13 | public: 14 | 15 | // The real work is done here. 16 | void DoComputation(); 17 | 18 | private: 19 | 20 | 21 | }; 22 | 23 | #endif -------------------------------------------------------------------------------- /WidgetTemplated/filemenu.h: -------------------------------------------------------------------------------- 1 | #ifndef FILEMENUFORM_H 2 | #define FILEMENUFORM_H 3 | 4 | #include "ui_filemenu.h" 5 | 6 | class MyForm : public QMainWindow, private Ui::FileMenuForm 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | 12 | public slots: 13 | void mnuCreateIntForm_triggered(); 14 | void mnuCreateDoubleForm_triggered(); 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ComboBox/main.h: -------------------------------------------------------------------------------- 1 | #ifndef CALCULATORFORM_H 2 | #define CALCULATORFORM_H 3 | 4 | #include 5 | 6 | #include "ui_main.h" 7 | 8 | class MainWindow : public QMainWindow, public Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | MainWindow(QMainWindow *parent = 0); 14 | 15 | public slots: 16 | 17 | void on_comboBox_activated(int); 18 | 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Concurrent/FutureWatcherProgressDialogSubclass/FutureWatcherProgressDialogSubclass.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include "form.h" 8 | 9 | int main(int argc, char*argv[]) 10 | { 11 | QApplication app(argc, argv); 12 | 13 | Form form; 14 | 15 | form.show(); 16 | 17 | return app.exec(); 18 | } -------------------------------------------------------------------------------- /DragDropOS/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class MyForm : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | public: 10 | MyForm(QWidget *parent = 0); 11 | protected: 12 | void dropEvent ( QDropEvent * event ); 13 | 14 | void dragEnterEvent ( QDragEnterEvent * event ) ; 15 | 16 | public slots: 17 | 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Printer/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include 7 | #include 8 | 9 | class Form : public QWidget, public Ui::Form 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | Form(QWidget *parent = 0); 15 | public slots: 16 | void on_btnSave_clicked(); 17 | protected: 18 | QGraphicsScene* Scene; 19 | 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /ProgressBarMarquee/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | class MainWindow : public QMainWindow 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MainWindow(); 12 | 13 | public slots: 14 | 15 | void on_btnStop_clicked(); 16 | void on_btnStart_clicked(); 17 | 18 | private: 19 | 20 | Ui::MainWindow ui; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ThreadedGUIUpdate_bad/ComputationClass.h: -------------------------------------------------------------------------------- 1 | #ifndef ComputationClass_H 2 | #define ComputationClass_H 3 | 4 | // QT 5 | #include 6 | 7 | class ComputationClass : public QObject 8 | { 9 | Q_OBJECT 10 | signals: 11 | void RefreshSignal(); 12 | 13 | public: 14 | 15 | // The real work is done here. 16 | void DoComputation(); 17 | 18 | private: 19 | 20 | 21 | }; 22 | 23 | #endif -------------------------------------------------------------------------------- /WidgetTemplated/InsideForm.txx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | template 5 | MyInsideForm::MyInsideForm(QWidget *parent) 6 | { 7 | 8 | } 9 | 10 | template 11 | void MyInsideForm::btnButton_clicked() 12 | { 13 | this->SetValue(2.1); 14 | std::stringstream ss; 15 | ss << this->value; 16 | this->lblLabel->setText(ss.str().c_str()); 17 | } 18 | -------------------------------------------------------------------------------- /Concurrent/RunWithGUIUpdate/MyClass.h: -------------------------------------------------------------------------------- 1 | #ifndef MyClass_H 2 | #define MyClass_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | class MyClass : public QObject 9 | { 10 | Q_OBJECT 11 | public: 12 | MyClass(QObject* parent = 0){} 13 | 14 | public: 15 | void DoSomething() 16 | { 17 | emit Update(); 18 | } 19 | 20 | signals: 21 | void Update(); 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Thread/OldMethod/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(Thread) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(Thread Thread.cpp)# ${MOCSrcs} ${UISrcs}) 11 | TARGET_LINK_LIBRARIES(Thread ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /Validator/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | 15 | void on_lineEdit1_textEdited ( const QString & text ); 16 | void on_lineEdit2_textEdited ( const QString & text ); 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /LabeledSlider/DemoUI/Widget/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 2 | 3 | message("Widget CMAKE_CURRENT_BINARY_DIR? ${CMAKE_CURRENT_BINARY_DIR}") 4 | 5 | QT4_WRAP_UI(LabeledSliderUISrcs LabeledSlider.ui) 6 | QT4_WRAP_CPP(LabeledSliderMOCSrcs LabeledSlider.h) 7 | 8 | add_library(libCustomWidget LabeledSlider.cpp ${LabeledSliderMOCSrcs} ${LabeledSliderUISrcs}) 9 | -------------------------------------------------------------------------------- /SaveGraphicsScene/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include 7 | #include 8 | 9 | class Form : public QWidget, public Ui::Form 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | Form(QWidget *parent = 0); 15 | public slots: 16 | void on_btnSave_clicked(); 17 | protected: 18 | QGraphicsScene* Scene; 19 | 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /SignalArray/MyWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "MyWidget.h" 2 | #include "SmallWidget.h" 3 | 4 | #include 5 | 6 | 7 | MyWidget::MyWidget() 8 | { 9 | SmallWidget* smallWidget = new SmallWidget; 10 | connect( smallWidget, SIGNAL( mysignal() ), this, SLOT(myslot()) ); 11 | smallWidget->EmitSignal(); 12 | } 13 | 14 | void MyWidget::myslot() 15 | { 16 | std::cout << "Slot called!" << std::endl; 17 | } 18 | -------------------------------------------------------------------------------- /SignalPointerParameter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(SignalPointerParameter) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | QT4_WRAP_CPP(MOCSrcs MyWidget.h) 9 | 10 | ADD_EXECUTABLE(SignalPointerParameter SignalPointerParameter.cpp MyWidget.cpp ${MOCSrcs}) 11 | TARGET_LINK_LIBRARIES(SignalPointerParameter ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /TextEdit/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | 5 | Form::Form(QWidget *parent) 6 | : QWidget(parent) 7 | { 8 | ui.setupUi(this); 9 | connect( this->ui.pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_SetLabelText()) ); 10 | } 11 | 12 | void Form::pushButton_SetLabelText() 13 | { 14 | this->ui.label->setText(this->ui.textEdit->document()->toPlainText()); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ThreadFromGUI/OldMethod/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(Thread) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(Thread Thread.cpp)# ${MOCSrcs} ${UISrcs}) 11 | TARGET_LINK_LIBRARIES(Thread ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /ThreadTemplate/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(ThreadTemplate) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(ThreadTemplate ThreadTemplate.cpp) 11 | TARGET_LINK_LIBRARIES(ThreadTemplate ${QT_LIBRARIES}) 12 | 13 | -------------------------------------------------------------------------------- /Concurrent/RunFunctionTemplate/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(RunFunctionTemplate) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(RunFunctionTemplate RunFunctionTemplate.cpp) 11 | TARGET_LINK_LIBRARIES(RunFunctionTemplate ${QT_LIBRARIES}) 12 | -------------------------------------------------------------------------------- /Delegates/PixmapDelegate/PixmapDelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef PIXMAPDELEGATE_H 2 | #define PIXMAPDELEGATE_H 3 | 4 | #include 5 | 6 | class PixmapDelegate : public QStyledItemDelegate 7 | { 8 | Q_OBJECT 9 | public: 10 | PixmapDelegate(){} 11 | 12 | void paint(QPainter *painter, const QStyleOptionViewItem &option, 13 | const QModelIndex &index) const; 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /FileDialog/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include 5 | 6 | #include "ui_form.h" 7 | 8 | class Form : public QWidget, private Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | private slots: 16 | void btnSave_clicked(); 17 | void btnOpenFile_clicked(); 18 | void btnOpenDirectory_clicked(); 19 | 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModelCheckable/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include "form.h" 8 | 9 | Form::Form(QWidget *parent) : QWidget(parent) 10 | { 11 | setupUi(this); 12 | 13 | this->model = new MyTableModel; 14 | this->tableView->setModel(model); 15 | 16 | this->tableView->resizeColumnsToContents(); 17 | } 18 | -------------------------------------------------------------------------------- /QElapsedTimer/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_main.h" 5 | 6 | #include 7 | 8 | class MainWindow : public QMainWindow, public Ui::MainWindow 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | MainWindow(); 14 | 15 | public slots: 16 | void btnStart_clicked(); 17 | void btnStop_clicked(); 18 | 19 | private: 20 | QElapsedTimer timer; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /RadioButtonGroups/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void on_rad1_clicked(); 15 | void on_rad2_clicked(); 16 | void on_radA_clicked(); 17 | void on_radB_clicked(); 18 | 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /TableWidgetInsertSorted/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, public Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | //void on_tableWidgetInsertSorted(); 15 | void on_pushButton_clicked(); 16 | 17 | protected: 18 | void CreateTable(); 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /DrawLineInteractive/ClickableScene.h: -------------------------------------------------------------------------------- 1 | #ifndef ClickableScene_H 2 | #define ClickableScene_H 3 | 4 | #include 5 | #include 6 | 7 | class ClickableScene : public QGraphicsScene 8 | { 9 | public: 10 | ClickableScene(QWidget *parent = 0); 11 | 12 | void mousePressEvent(QGraphicsSceneMouseEvent* pMouseEvent); 13 | 14 | protected: 15 | QPointF LastClick; 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /FileExtension/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(FileExtension) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | INCLUDE_DIRECTORIES(${QT_QTXML_INCLUDE_DIR}) # Prevents "QtXml: No such file or directory" 9 | 10 | ADD_EXECUTABLE(FileExtension FileExtension.cpp) 11 | message(${QT_LIBRARIES}) 12 | TARGET_LINK_LIBRARIES(FileExtension ${QT_LIBRARIES}) 13 | -------------------------------------------------------------------------------- /ModelView/AbstractTableModelEditable/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include "MyTableModel.h" 7 | 8 | class Form : public QWidget, public Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | public slots: 16 | void on_btnUpdate_clicked(); 17 | 18 | protected: 19 | MyTableModel* model; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /OptionalQt/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #if defined(INTERACTIVE) 5 | #warning "Using interactive!" 6 | #include 7 | class Form : public QWidget 8 | #else 9 | #warning "Not using interactive!" 10 | class Form 11 | #endif 12 | { 13 | #if defined(INTERACTIVE) 14 | Q_OBJECT 15 | 16 | public: 17 | 18 | 19 | public slots: 20 | 21 | #endif 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /SavePixmap/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include 7 | #include 8 | 9 | class Form : public QWidget, public Ui::Form 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | Form(QWidget *parent = 0); 15 | public slots: 16 | void on_btnSave_clicked(); 17 | protected: 18 | QGraphicsScene* Scene; 19 | QPixmap Pixmap; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Dialog/ModalData/dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_H 2 | #define DIALOG_H 3 | 4 | #include "ui_dialog.h" 5 | 6 | class Dialog : public QDialog, private Ui::Dialog 7 | { 8 | Q_OBJECT 9 | public: 10 | Dialog(); 11 | 12 | std::string GetUserText(); 13 | 14 | public slots: 15 | void on_buttonBox_accepted(); 16 | void on_buttonBox_rejected(); 17 | 18 | protected: 19 | std::string userText; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /FileSelectionWidget/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include 5 | 6 | #include "ui_form.h" 7 | 8 | class Form : public QWidget, private Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | private slots: 16 | void btnSave_clicked(); 17 | void btnOpenFile_clicked(); 18 | void btnOpenDirectory_clicked(); 19 | 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /ModelView/AbstractListModelFileDialog/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class AbstractListModel; 7 | 8 | class Form : public QWidget, public Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | public slots: 16 | void editSlot(QModelIndex index); 17 | 18 | protected: 19 | AbstractListModel* Model; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /ModelView/ListViewImages/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | #include "PixmapDelegate.h" 5 | 6 | Form::Form(QWidget *parent) : QWidget(parent) 7 | { 8 | setupUi(this); 9 | 10 | this->model = new MyListModel; 11 | this->listView->setModel(model); 12 | 13 | PixmapDelegate* pixmapDelegate = new PixmapDelegate; 14 | this->listView->setItemDelegateForColumn(0, pixmapDelegate); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /RadioButton/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Form(QWidget *parent = 0); 12 | 13 | public slots: 14 | void pushButton_SetLabelText(); 15 | void radioButton_SetLabelText(); 16 | void radioButton_2_SetLabelText(); 17 | 18 | private: 19 | Ui::Form ui; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /AbstractItemDelegate/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include "MyTableModel.h" 7 | 8 | class Form : public QWidget, public Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | public slots: 16 | void TableChanged( const QModelIndex & , const QModelIndex & ); 17 | protected: 18 | MyTableModel* model; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Concurrent/RunFunctionTemplateNoArguments/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(RunFunctionTemplate) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9 | 10 | ADD_EXECUTABLE(RunFunctionTemplate RunFunctionTemplate.cpp) 11 | TARGET_LINK_LIBRARIES(RunFunctionTemplate ${QT_LIBRARIES}) 12 | -------------------------------------------------------------------------------- /Databases/ListView/form.h: -------------------------------------------------------------------------------- 1 | #ifndef ListView_H 2 | #define ListView_H 3 | 4 | #include "ui_ListView.h" 5 | 6 | class QSqlTableModel; 7 | 8 | class MyForm : public QWidget, private Ui::Form 9 | { 10 | Q_OBJECT 11 | public: 12 | MyForm(QWidget *parent = 0); 13 | ~MyForm(); 14 | 15 | protected: 16 | void showEvent ( QShowEvent * event ); 17 | 18 | protected: 19 | QSqlTableModel* TableModel; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /LabeledSlider/DemoUI/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "form.h" 5 | 6 | Form::Form(QWidget *parent) : QWidget(parent) 7 | { 8 | setupUi(this); 9 | } 10 | 11 | void Form::on_horizontalSlider_valueChanged(int value) 12 | { 13 | SetLabelFromSlider(); 14 | } 15 | 16 | void Form::SetLabelFromSlider() 17 | { 18 | this->label->setText(QString::number(this->labeledSlider->value())); 19 | } 20 | -------------------------------------------------------------------------------- /SignalWithValue/MyWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "MyWidget.h" 2 | 3 | #include 4 | 5 | void MyWidget::myslot(const std::string& mystring) 6 | { 7 | std::cout << mystring << std::endl; 8 | } 9 | 10 | void MyWidget::EmitSignal() 11 | { 12 | emit mysignal("test"); 13 | } 14 | 15 | MyWidget::MyWidget() 16 | { 17 | connect( this, SIGNAL( mysignal(const std::string&) ), this, SLOT(myslot(const std::string&)) ); 18 | } 19 | -------------------------------------------------------------------------------- /ConstructorTimer/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include "form.h" 6 | 7 | Form::Form(QWidget *parent) : QWidget(parent) 8 | { 9 | setupUi(this); 10 | //connect( this->ui.pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_SetLabelText()) ); 11 | QTimer::singleShot(0, this, SLOT(AppReady())); 12 | } 13 | 14 | void Form::AppReady() 15 | { 16 | std::cout << "Test." << std::endl; 17 | } 18 | -------------------------------------------------------------------------------- /Databases/CreateTable/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include "ui_CreateTable.h" 5 | 6 | class QSqlTableModel; 7 | 8 | class MyForm : public QWidget, private Ui::Form 9 | { 10 | Q_OBJECT 11 | public: 12 | MyForm(QWidget *parent = 0); 13 | ~MyForm(); 14 | 15 | public slots: 16 | void on_pushButton_clicked(); 17 | 18 | protected: 19 | QSqlTableModel* Model; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /GraphicsSimpleTextItem/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class Form : public QWidget, private Ui::Form 7 | { 8 | Q_OBJECT 9 | 10 | public slots: 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | protected: 15 | QGraphicsScene* Scene; 16 | 17 | 18 | void showEvent ( QShowEvent * event ); 19 | void resizeEvent ( QResizeEvent * event ); 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /ManualLayout/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(ManualLayout) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | QT4_WRAP_CPP(MOCSrcs form.h) 8 | 9 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 10 | 11 | ADD_EXECUTABLE(ManualLayout main.cpp form.cpp ${MOCSrcs}) 12 | TARGET_LINK_LIBRARIES(ManualLayout ${QT_LIBRARIES}) 13 | 14 | -------------------------------------------------------------------------------- /SignalPointerParameter/MyWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MYWIDGET_H 2 | #define MYWIDGET_H 3 | 4 | #include 5 | 6 | class MyClass 7 | { 8 | public: 9 | int a; 10 | }; 11 | 12 | class MyWidget : public QObject 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | MyWidget(); 18 | 19 | void EmitSignal(); 20 | 21 | public slots: 22 | void myslot(MyClass*); 23 | 24 | signals: 25 | void mysignal(MyClass*); 26 | 27 | }; 28 | 29 | #endif -------------------------------------------------------------------------------- /Timer/SingleShot/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include "form.h" 6 | 7 | Form::Form(QWidget *parent) : QWidget(parent) 8 | { 9 | setupUi(this); 10 | //connect( this->ui.pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_SetLabelText()) ); 11 | QTimer::singleShot(0, this, SLOT(AppReady())); 12 | } 13 | 14 | void Form::AppReady() 15 | { 16 | std::cout << "Test." << std::endl; 17 | } 18 | -------------------------------------------------------------------------------- /Concurrent/MapAndMapped/BlockingMapMemberFunction.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | class MyClass 6 | { 7 | public: 8 | void Test() 9 | { 10 | std::cout << "Test" << std::endl; 11 | } 12 | }; 13 | 14 | int main() 15 | { 16 | QVector v; 17 | MyClass a; 18 | v.push_back(a); 19 | 20 | QtConcurrent::blockingMap(v.begin(), v.end(), &MyClass::Test); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /DrawLineInteractive/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | #include "ClickableScene.h" 7 | 8 | class Form : public QWidget, private Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | 15 | public slots: 16 | //void slot_clicked( QGraphicsSceneMouseEvent * mouseEvent ); 17 | 18 | protected: 19 | ClickableScene* Scene; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /FloatSlider_bak/FloatSlider.h: -------------------------------------------------------------------------------- 1 | #ifndef FloatSlider_H 2 | #define FloatSlider_H 3 | 4 | #include "ui_FloatSlider.h" 5 | 6 | class FloatSlider : public QSlider, public Ui::FloatSlider 7 | { 8 | Q_OBJECT 9 | 10 | signals: 11 | void valueChanged(float); 12 | 13 | public: 14 | FloatSlider(QWidget *parent = 0); 15 | 16 | float GetValue(); 17 | 18 | protected: 19 | float MinValue; 20 | float MaxValue; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /GraphicsView/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include "ui_form.h" 5 | 6 | class QGraphicsPixmapItem; 7 | 8 | class Form : public QWidget, public Ui::Form 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Form(QWidget *parent = 0); 14 | protected: 15 | void showEvent ( QShowEvent * event ); 16 | void resizeEvent ( QResizeEvent * event ); 17 | 18 | QGraphicsPixmapItem* BlackItem; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Label/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | #include 5 | 6 | void Test(const QLabel& test) 7 | { 8 | 9 | } 10 | 11 | MainWindow::MainWindow() 12 | { 13 | setupUi(this); 14 | connect(this->btnSetText, SIGNAL(clicked()), this, SLOT(btnSetText_clicked())); 15 | QLabel test; 16 | Test(test); 17 | } 18 | 19 | 20 | void MainWindow::btnSetText_clicked() 21 | { 22 | this->lblLabel->setText("test"); 23 | } -------------------------------------------------------------------------------- /Date/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(Date) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | QT4_WRAP_UI(UISrcs main.ui) 9 | QT4_WRAP_CPP(MOCSrcs form.h) 10 | 11 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 12 | 13 | ADD_EXECUTABLE(Date Date.cpp form.cpp ${UISrcs} ${MOCSrcs}) 14 | TARGET_LINK_LIBRARIES(Date ${QT_LIBRARIES}) 15 | -------------------------------------------------------------------------------- /HandleItem/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "form.h" 4 | #include "HandleItem.h" 5 | 6 | #include 7 | 8 | Form::Form(QWidget *parent) : QWidget(parent) 9 | { 10 | setupUi(this); 11 | 12 | QGraphicsScene* scene = new QGraphicsScene( 0, 0, 200, 200 ); 13 | 14 | HandleItem *centerHandle = new HandleItem( QRect( 10, 10, 50, 100 ), scene, Qt::red); 15 | 16 | this->graphicsView->setScene( scene ); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /LineEditInputMask/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // This lets you set something like "000-000" to force the user to enter 6 digits separated by a -. 4 | 5 | #include "form.h" 6 | 7 | Form::Form(QWidget *parent) 8 | : QWidget(parent) 9 | { 10 | this->setupUi(this); 11 | } 12 | 13 | void Form::on_lineEdit_textEdited( const QString & text ) 14 | { 15 | this->label->setText(this->lineEdit->text().remove(QChar('-'))); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /ManualLayoutRemoveWidget/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include 5 | 6 | class QVBoxLayout; 7 | class QCheckBox; 8 | 9 | class MyForm : public QWidget 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | MyForm(QWidget *parent = 0); 15 | 16 | public slots: 17 | void Add(); 18 | void Remove(); 19 | 20 | protected: 21 | QVBoxLayout* Layout; 22 | std::vector CheckBoxes; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /PlaceHolder/form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include 5 | 6 | #include "ui_form.h" 7 | 8 | #include "FileSelectionWidget.h" 9 | 10 | class Form : public QWidget, private Ui::Form 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Form(QWidget *parent = 0); 16 | 17 | private slots: 18 | 19 | protected: 20 | FileSelectionWidget* Widget1; 21 | FileSelectionWidget* Widget2; 22 | 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /ThreadMessageBox/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include 5 | #include "ui_form.h" 6 | #include "thread.h" 7 | 8 | class Form : public QWidget, private Ui::Form 9 | { 10 | Q_OBJECT 11 | public: 12 | Form(QWidget *parent = 0); 13 | 14 | public slots: 15 | void pushButton_clicked(); 16 | void DisplayMessageBoxSlot(); 17 | 18 | private: 19 | Thread MyThread; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Time/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(Time) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | QT4_WRAP_UI(UISrcs main.ui) 9 | QT4_WRAP_CPP(MOCSrcs form.h) 10 | 11 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 12 | 13 | ADD_EXECUTABLE(Time Time.cpp form.cpp ${UISrcs} ${MOCSrcs}) 14 | TARGET_LINK_LIBRARIES(Time ${QT_LIBRARIES}) 15 | -------------------------------------------------------------------------------- /Concurrent/Run/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(Run) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | QT4_WRAP_CPP(MOCSrcs form.h) 9 | QT4_WRAP_UI(UISrcs form.ui) 10 | 11 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 12 | 13 | ADD_EXECUTABLE(Run Run.cpp form.cpp ${MOCSrcs} ${UISrcs}) 14 | TARGET_LINK_LIBRARIES(Run ${QT_LIBRARIES}) 15 | 16 | -------------------------------------------------------------------------------- /Delegates/IndexWidget/IndexWidget.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include "IndexWidget.h" 8 | 9 | Form::Form(QWidget *parent) 10 | : QWidget(parent) 11 | { 12 | setupUi(this); 13 | 14 | QStringListModel* model = new QStringListModel; 15 | this->listView->setModel(model); 16 | this->listView->setIndexWidget(QModelIndex(0, 0), new QComboBox); 17 | } 18 | -------------------------------------------------------------------------------- /Email/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(Email) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | QT4_WRAP_UI(UISrcs main.ui) 9 | QT4_WRAP_CPP(MOCSrcs form.h) 10 | 11 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 12 | 13 | ADD_EXECUTABLE(Email main.cpp form.cpp ${UISrcs} ${MOCSrcs}) 14 | TARGET_LINK_LIBRARIES(Email ${QT_LIBRARIES}) 15 | -------------------------------------------------------------------------------- /ThreadClassMessageBox/form.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONFORM_H 2 | #define BUTTONFORM_H 3 | 4 | #include 5 | #include "ui_form.h" 6 | #include "thread.h" 7 | 8 | class Form : public QWidget, private Ui::Form 9 | { 10 | Q_OBJECT 11 | public: 12 | Form(QWidget *parent = 0); 13 | 14 | public slots: 15 | void pushButton_clicked(); 16 | void DisplayMessageBoxSlot(); 17 | 18 | private: 19 | Thread MyThread; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /XML/out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title 5 | 6 | 7 |

8 | some links for you: 9 | 10 | Example.net 11 | Example.org 12 |

13 | 14 | 15 | -------------------------------------------------------------------------------- /CheckForQT/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(CheckForQT) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | QT4_WRAP_UI(UISrcs form.ui) 9 | QT4_WRAP_CPP(MOCSrcs form.h) 10 | 11 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 12 | 13 | ADD_EXECUTABLE(CheckForQT main.cpp form.cpp ${MOCSrcs} ${UISrcs}) 14 | TARGET_LINK_LIBRARIES(CheckForQT ${QT_LIBRARIES}) 15 | 16 | -------------------------------------------------------------------------------- /Delegates/IndexWidget/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "IndexWidget.h" 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | std::cout << "Enter." << std::endl; 14 | QApplication app(argc, argv); 15 | Form form; 16 | 17 | form.show(); 18 | 19 | return app.exec(); 20 | } 21 | -------------------------------------------------------------------------------- /DialogButtonBox/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | PROJECT(DialogButtonBox) 4 | 5 | FIND_PACKAGE(Qt4 REQUIRED) 6 | INCLUDE(${QT_USE_FILE}) 7 | 8 | QT4_WRAP_CPP(MOCSrcs form.h) 9 | 10 | include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | ADD_EXECUTABLE(DialogButtonBox main.cpp form.cpp ${MOCSrcs}) 13 | TARGET_LINK_LIBRARIES(DialogButtonBox ${QT_LIBRARIES}) 14 | 15 | -------------------------------------------------------------------------------- /ModelView/AbstractListModel/form.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include "form.h" 8 | #include "ListModel.h" 9 | 10 | Form::Form(QWidget *parent) 11 | : QWidget(parent) 12 | { 13 | setupUi(this); 14 | 15 | ListModel* model = new ListModel; 16 | this->tableView->setModel(model); 17 | 18 | this->tableView->resizeColumnsToContents(); 19 | 20 | } 21 | --------------------------------------------------------------------------------