Permalink
Browse files

First commit.

0 parents commit 09876e5ed3aa1f9a6e341cb4e79606ec7e129e9c @daviddoria committed Feb 17, 2012
Showing with 10,200 additions and 0 deletions.
  1. +15 −0 AbstractItemDelegate/CMakeLists.txt
  2. +23 −0 AbstractItemDelegate/LabelDelegate.cpp
  3. +19 −0 AbstractItemDelegate/LabelDelegate.h
  4. +52 −0 AbstractItemDelegate/MyTableModel.cpp
  5. +19 −0 AbstractItemDelegate/MyTableModel.h
  6. +36 −0 AbstractItemDelegate/form.cpp
  7. +21 −0 AbstractItemDelegate/form.h
  8. +35 −0 AbstractItemDelegate/form.ui
  9. +12 −0 AbstractItemDelegate/main.cpp
  10. +15 −0 AbstractItemDelegateSize/CMakeLists.txt
  11. +18 −0 AbstractItemDelegateSize/LabelDelegate.cpp
  12. +22 −0 AbstractItemDelegateSize/LabelDelegate.h
  13. +53 −0 AbstractItemDelegateSize/MyTableModel.cpp
  14. +19 −0 AbstractItemDelegateSize/MyTableModel.h
  15. +40 −0 AbstractItemDelegateSize/form.cpp
  16. +23 −0 AbstractItemDelegateSize/form.h
  17. +35 −0 AbstractItemDelegateSize/form.ui
  18. +12 −0 AbstractItemDelegateSize/main.cpp
  19. +12 −0 AutoConnect/AutoConnect.cpp
  20. +15 −0 AutoConnect/CMakeLists.txt
  21. +14 −0 AutoConnect/form.cpp
  22. +18 −0 AutoConnect/form.h
  23. +55 −0 AutoConnect/form.ui
  24. +17 −0 Boost/CMakeLists.txt
  25. +14 −0 Boost/form.cpp
  26. +16 −0 Boost/form.h
  27. +45 −0 Boost/form.ui
  28. +24 −0 Boost/main.cpp
  29. +15 −0 ButtonBox/CMakeLists.txt
  30. +18 −0 ButtonBox/form.cpp
  31. +19 −0 ButtonBox/form.h
  32. +45 −0 ButtonBox/form.ui
  33. +12 −0 ButtonBox/main.cpp
  34. +15 −0 ButtonWidget/CMakeLists.txt
  35. +13 −0 ButtonWidget/form.cpp
  36. +16 −0 ButtonWidget/form.h
  37. +45 −0 ButtonWidget/form.ui
  38. +12 −0 ButtonWidget/main.cpp
  39. +15 −0 Calculator/CMakeLists.txt
  40. BIN Calculator/Calculator.kdevelop.pcs
  41. +323 −0 Calculator/Doxyfile
  42. +20 −0 Calculator/calculatorform.cpp
  43. +22 −0 Calculator/calculatorform.h
  44. +284 −0 Calculator/calculatorform.ui
  45. +12 −0 Calculator/main.cpp
  46. +14 −0 Calendar/CMakeLists.txt
  47. +14 −0 Calendar/Calendar.cpp
  48. +16 −0 Calendar/form.cpp
  49. +20 −0 Calendar/form.h
  50. +40 −0 Calendar/main.ui
  51. +17 −0 CheckBox/CMakeLists.txt
  52. BIN CheckBox/CheckBox.kdevelop.pcs
  53. +323 −0 CheckBox/Doxyfile
  54. +24 −0 CheckBox/form.cpp
  55. +20 −0 CheckBox/form.h
  56. +58 −0 CheckBox/form.ui
  57. +12 −0 CheckBox/main.cpp
  58. +15 −0 CheckForQT/CMakeLists.txt
  59. +323 −0 CheckForQT/Doxyfile
  60. +13 −0 CheckForQT/form.cpp
  61. +15 −0 CheckForQT/form.h
  62. +58 −0 CheckForQT/form.ui
  63. +12 −0 CheckForQT/main.cpp
  64. +14 −0 ClassTemplateQObject/CMakeLists.txt
  65. +12 −0 ClassTemplateQObject/ClassTemplateQObject.cpp
  66. +4 −0 ClassTemplateQObject/form.cpp
  67. +45 −0 ClassTemplateQObject/form.h
  68. +14 −0 ClassTemplateQObject/form.hpp
  69. +65 −0 ClassTemplateQObject/form.ui
  70. +15 −0 ClickGraphics/CMakeLists.txt
  71. +52 −0 ClickGraphics/form.cpp
  72. +20 −0 ClickGraphics/form.h
  73. +55 −0 ClickGraphics/form.ui
  74. BIN ClickGraphics/image.png
  75. +36 −0 ClickGraphics/main.cpp
  76. +15 −0 ClickableLabelInTable/CMakeLists.txt
  77. +11 −0 ClickableLabelInTable/ClickableLabel.cpp
  78. +18 −0 ClickableLabelInTable/ClickableLabel.h
  79. +43 −0 ClickableLabelInTable/form.cpp
  80. +18 −0 ClickableLabelInTable/form.h
  81. +42 −0 ClickableLabelInTable/form.ui
  82. +12 −0 ClickableLabelInTable/main.cpp
  83. +15 −0 ComboBox/CMakeLists.txt
  84. BIN ComboBox/ComboBox.kdevelop.pcs
  85. +17 −0 ComboBox/Direct.cpp.bak
  86. +323 −0 ComboBox/Doxyfile
  87. +11 −0 ComboBox/demo.cpp
  88. +17 −0 ComboBox/main.cpp
  89. +21 −0 ComboBox/main.h
  90. +52 −0 ComboBox/main.ui
  91. +15 −0 ComboBoxOfCheckBoxes/CMakeLists.txt
  92. +11 −0 ComboBoxOfCheckBoxes/demo.cpp
  93. +50 −0 ComboBoxOfCheckBoxes/main.cpp
  94. +29 −0 ComboBoxOfCheckBoxes/main.h
  95. +52 −0 ComboBoxOfCheckBoxes/main.ui
  96. +28 −0 ComboBoxOfCheckBoxes/mainMethod1.cpp
  97. +27 −0 ComboBoxOfCheckBoxes/mainMethod1.h
  98. +15 −0 ComputationThread/CMakeLists.txt
  99. +10 −0 ComputationThread/ComputationObject.h
  100. +34 −0 ComputationThread/ComputationThread.cpp
  101. +55 −0 ComputationThread/ComputationThread.h
  102. +13 −0 ComputationThread/MyObject.cpp
  103. +11 −0 ComputationThread/MyObject.h
  104. +38 −0 ComputationThread/TestComputationThread.cpp
  105. +22 −0 ComputationThread/TestComputationThread.h
  106. +11 −0 ComputationThread/demo.cpp
  107. +48 −0 ComputationThread/main.cpp
  108. +32 −0 ComputationThread/main.h
  109. +84 −0 ComputationThread/main.ui
  110. +27 −0 Concurrent/BlockingMapWithBoostBind/BlockingMapWithBoostBind.cpp
  111. +9 −0 Concurrent/BlockingMapWithBoostBind/CMakeLists.txt
  112. +15 −0 Concurrent/FutureWatcher/CMakeLists.txt
  113. +18 −0 Concurrent/FutureWatcher/FutureWatcher.cpp
  114. +10 −0 Concurrent/FutureWatcher/MyClass.cpp
  115. +20 −0 Concurrent/FutureWatcher/MyClass.h
  116. +34 −0 Concurrent/FutureWatcher/form.cpp
  117. +27 −0 Concurrent/FutureWatcher/form.h
  118. +38 −0 Concurrent/FutureWatcher/form.ui
  119. +15 −0 Concurrent/FutureWatcherProgressDialog/CMakeLists.txt
  120. +18 −0 Concurrent/FutureWatcherProgressDialog/FutureWatcherProgressDialog.cpp
  121. +10 −0 Concurrent/FutureWatcherProgressDialog/MyClass.cpp
  122. +21 −0 Concurrent/FutureWatcherProgressDialog/MyClass.h
  123. +36 −0 Concurrent/FutureWatcherProgressDialog/form.cpp
  124. +30 −0 Concurrent/FutureWatcherProgressDialog/form.h
  125. +28 −0 Concurrent/FutureWatcherProgressDialog/form.ui
  126. +15 −0 Concurrent/FutureWatcherProgressDialogSubclass/CMakeLists.txt
  127. +18 −0 Concurrent/FutureWatcherProgressDialogSubclass/FutureWatcherProgressDialogSubclass.cpp
  128. +10 −0 Concurrent/FutureWatcherProgressDialogSubclass/MyClass.cpp
  129. +34 −0 Concurrent/FutureWatcherProgressDialogSubclass/MyClass.h
  130. +43 −0 Concurrent/FutureWatcherProgressDialogSubclass/form.cpp
  131. +31 −0 Concurrent/FutureWatcherProgressDialogSubclass/form.h
  132. +28 −0 Concurrent/FutureWatcherProgressDialogSubclass/form.ui
  133. +23 −0 Concurrent/MapAndMapped/BlockingMapMemberFunction.cpp
  134. +24 −0 Concurrent/MapAndMapped/BlockingMappedMemberFunction.cpp
  135. +28 −0 Concurrent/MapAndMapped/BlockingMappedMemberFunctionOtherObjectBind.cpp
  136. +29 −0 Concurrent/MapAndMapped/BlockingMappedMemberFunctionOtherObjectOperator.cpp
  137. +19 −0 Concurrent/MapAndMapped/BlockingMappedParallelFor.cpp
  138. +43 −0 Concurrent/MapAndMapped/CMakeLists.txt
  139. +53 −0 Concurrent/MapAndMapped/Concurrent.cpp
  140. +28 −0 Concurrent/MapAndMapped/Inplace.cpp
  141. +48 −0 Concurrent/MapAndMapped/InplaceComplexType.cpp
  142. +39 −0 Concurrent/MapAndMapped/MemberFunction.cpp
  143. +73 −0 Concurrent/MapAndMapped/NonBlockingNonStaticMap.cpp
  144. +45 −0 Concurrent/MapAndMapped/NonStaticMapAnyClassMember.cpp
  145. +57 −0 Concurrent/MapAndMapped/legacy.cpp
  146. +15 −0 Concurrent/Run/CMakeLists.txt
  147. +18 −0 Concurrent/Run/Run.cpp
  148. +29 −0 Concurrent/Run/form.cpp
  149. +19 −0 Concurrent/Run/form.h
  150. +48 −0 Concurrent/Run/form.ui
  151. +14 −0 Concurrent/RunBind/CMakeLists.txt
  152. +61 −0 Concurrent/RunBind/RunBind.cpp
  153. +29 −0 Concurrent/RunBind/form.cpp
  154. +19 −0 Concurrent/RunBind/form.h
  155. +48 −0 Concurrent/RunBind/form.ui
  156. +11 −0 Concurrent/RunFunctionTemplate/CMakeLists.txt
  157. +31 −0 Concurrent/RunFunctionTemplate/Legacy.cpp
  158. +86 −0 Concurrent/RunFunctionTemplate/RunFunctionTemplate.cpp
  159. +11 −0 Concurrent/RunFunctionTemplateNoArguments/CMakeLists.txt
  160. +31 −0 Concurrent/RunFunctionTemplateNoArguments/Legacy.cpp
  161. +21 −0 Concurrent/RunFunctionTemplateNoArguments/RunFunctionTemplate.cpp
  162. +15 −0 Concurrent/RunMemberFunction/CMakeLists.txt
  163. 0 Concurrent/RunMemberFunction/MyClass.cpp
  164. +22 −0 Concurrent/RunMemberFunction/MyClass.h
  165. +18 −0 Concurrent/RunMemberFunction/RunMemberFunction.cpp
  166. +22 −0 Concurrent/RunMemberFunction/form.cpp
  167. +19 −0 Concurrent/RunMemberFunction/form.h
  168. +48 −0 Concurrent/RunMemberFunction/form.ui
  169. +14 −0 Concurrent/RunWithGUIUpdate/CMakeLists.txt
  170. +11 −0 Concurrent/RunWithGUIUpdate/LongFunction.cpp
  171. +10 −0 Concurrent/RunWithGUIUpdate/LongFunction.h
  172. +24 −0 Concurrent/RunWithGUIUpdate/MyClass.h
  173. +23 −0 Concurrent/RunWithGUIUpdate/RunWithGUIUpdate.cpp
  174. +22 −0 Concurrent/RunWithGUIUpdate/form.cpp
  175. +22 −0 Concurrent/RunWithGUIUpdate/form.h
  176. +48 −0 Concurrent/RunWithGUIUpdate/form.ui
  177. +12 −0 Connect/CMakeLists.txt
  178. +13 −0 Connect/Connect.cpp
  179. +24 −0 Connect/MyWidget.cpp
  180. +23 −0 Connect/MyWidget.h
  181. +15 −0 ConstructorTimer/CMakeLists.txt
  182. +17 −0 ConstructorTimer/form.cpp
  183. +17 −0 ConstructorTimer/form.h
  184. +55 −0 ConstructorTimer/form.ui
  185. +12 −0 ConstructorTimer/main.cpp
  186. +15 −0 Cursor/CMakeLists.txt
  187. +28 −0 Cursor/form.cpp
  188. +19 −0 Cursor/form.h
  189. +45 −0 Cursor/form.ui
  190. +12 −0 Cursor/main.cpp
  191. +16 −0 Databases/CreateTable/CMakeLists.txt
  192. +12 −0 Databases/CreateTable/CreateTable.cpp
  193. +42 −0 Databases/CreateTable/CreateTable.ui
  194. +77 −0 Databases/CreateTable/form.cpp
  195. +22 −0 Databases/CreateTable/form.h
  196. +12 −0 Databases/DatabaseInMemory/CMakeLists.txt
  197. +85 −0 Databases/DatabaseInMemory/Legacy.cpp
  198. +29 −0 Databases/DatabaseInMemory/SqlTableModel.cpp
  199. +135 −0 Databases/DatabaseInMemory/connection.h
  200. +16 −0 Databases/ListView/CMakeLists.txt
  201. +64 −0 Databases/ListView/ListView.cpp
  202. +42 −0 Databases/ListView/ListView.ui
  203. +47 −0 Databases/ListView/form.cpp
  204. +22 −0 Databases/ListView/form.h
  205. +11 −0 Databases/Sql/CMakeLists.txt
  206. +10 −0 Databases/Sql/Sql.cpp
  207. +12 −0 Databases/SqlDatabase/CMakeLists.txt
  208. +61 −0 Databases/SqlDatabase/SqlDatabase.cpp
  209. +15 −0 Databases/SqlQueryModel/CMakeLists.txt
  210. +12 −0 Databases/SqlQueryModel/SqlQueryModel.cpp
  211. +42 −0 Databases/SqlQueryModel/SqlQueryModel.ui
  212. +27 −0 Databases/SqlQueryModel/form.cpp
  213. +16 −0 Databases/SqlQueryModel/form.h
  214. +12 −0 Databases/SqlTableModel/CMakeLists.txt
  215. +85 −0 Databases/SqlTableModel/Legacy.cpp
  216. +29 −0 Databases/SqlTableModel/SqlTableModel.cpp
  217. +135 −0 Databases/SqlTableModel/connection.h
  218. +16 −0 Databases/TableView/CMakeLists.txt
  219. +12 −0 Databases/TableView/TableView.cpp
  220. +42 −0 Databases/TableView/TableView.ui
  221. +96 −0 Databases/TableView/form.cpp
  222. +16 −0 Databases/TableView/form.h
  223. +16 −0 Databases/TableViewComboBox/CMakeLists.txt
  224. +12 −0 Databases/TableViewComboBox/TableViewComboBox.cpp
  225. +42 −0 Databases/TableViewComboBox/TableViewComboBox.ui
  226. +47 −0 Databases/TableViewComboBox/form.cpp
  227. +16 −0 Databases/TableViewComboBox/form.h
  228. +14 −0 Date/CMakeLists.txt
  229. +14 −0 Date/Date.cpp
  230. +20 −0 Date/form.cpp
  231. +22 −0 Date/form.h
  232. +37 −0 Date/main.ui
  233. +16 −0 Delegates/ComboBoxDelegate/CMakeLists.txt
  234. +62 −0 Delegates/ComboBoxDelegate/ComboBoxDelegate.cpp
  235. +29 −0 Delegates/ComboBoxDelegate/ComboBoxDelegate.h
  236. +44 −0 Delegates/ComboBoxDelegate/main.cpp
  237. +16 −0 Delegates/ComboBoxDelegateBAK/CMakeLists.txt
  238. +72 −0 Delegates/ComboBoxDelegateBAK/ComboBoxDelegate.cpp
  239. +30 −0 Delegates/ComboBoxDelegateBAK/ComboBoxDelegate.h
  240. +48 −0 Delegates/ComboBoxDelegateBAK/main.cpp
  241. +16 −0 Delegates/ComboBoxDelegateEditOnly/CMakeLists.txt
  242. +66 −0 Delegates/ComboBoxDelegateEditOnly/ComboBoxDelegate.cpp
  243. +30 −0 Delegates/ComboBoxDelegateEditOnly/ComboBoxDelegate.h
  244. +44 −0 Delegates/ComboBoxDelegateEditOnly/main.cpp
  245. +14 −0 Delegates/IndexWidget/CMakeLists.txt
  246. +17 −0 Delegates/IndexWidget/IndexWidget.cpp
  247. +18 −0 Delegates/IndexWidget/IndexWidget.h
  248. +24 −0 Delegates/IndexWidget/IndexWidget.ui
  249. +20 −0 Delegates/IndexWidget/main.cpp
  250. +15 −0 Delegates/PixmapDelegate/CMakeLists.txt
  251. +16 −0 Delegates/PixmapDelegate/PixmapDelegate.cpp
  252. +16 −0 Delegates/PixmapDelegate/PixmapDelegate.h
  253. +39 −0 Delegates/PixmapDelegate/main.cpp
  254. +16 −0 Delegates/SpinBoxDelegate/CMakeLists.txt
  255. +102 −0 Delegates/SpinBoxDelegate/delegate.cpp
  256. +68 −0 Delegates/SpinBoxDelegate/delegate.h
  257. +47 −0 Delegates/SpinBoxDelegate/main.cpp
  258. +13 −0 DesignerPlugin/FloatSlider.cpp
  259. +26 −0 DesignerPlugin/FloatSlider.h
  260. +55 −0 DesignerPlugin/FloatSlider.ui
  261. +155 −0 DesignerPlugin/customwidgetplugin.cpp
  262. +72 −0 DesignerPlugin/customwidgetplugin.h
  263. +24 −0 DesignerPlugin/customwidgetplugin.pro
  264. +206 −0 DesignerPlugin/customwidgetplugin.pro.user
  265. +12 −0 DesignerPlugin/main.cpp
  266. +15 −0 Dialog/Modal/CMakeLists.txt
  267. +18 −0 Dialog/Modal/dialog.cpp
  268. +18 −0 Dialog/Modal/dialog.h
  269. +91 −0 Dialog/Modal/dialog.ui
  270. +25 −0 Dialog/Modal/form.cpp
  271. +21 −0 Dialog/Modal/form.h
  272. +45 −0 Dialog/Modal/form.ui
  273. +12 −0 Dialog/Modal/main.cpp
  274. +15 −0 Dialog/ModalData/CMakeLists.txt
  275. +22 −0 Dialog/ModalData/dialog.cpp
  276. +22 −0 Dialog/ModalData/dialog.h
  277. +91 −0 Dialog/ModalData/dialog.ui
  278. +33 −0 Dialog/ModalData/form.cpp
  279. +21 −0 Dialog/ModalData/form.h
  280. +45 −0 Dialog/ModalData/form.ui
  281. +12 −0 Dialog/ModalData/main.cpp
  282. +15 −0 Dialog/Modeless/CMakeLists.txt
  283. +16 −0 Dialog/Modeless/dialog.cpp
  284. +18 −0 Dialog/Modeless/dialog.h
  285. +91 −0 Dialog/Modeless/dialog.ui
  286. +39 −0 Dialog/Modeless/form.cpp
  287. +26 −0 Dialog/Modeless/form.h
  288. +45 −0 Dialog/Modeless/form.ui
  289. +12 −0 Dialog/Modeless/main.cpp
  290. +14 −0 DialogButtonBox/CMakeLists.txt
  291. +12 −0 DialogButtonBox/form.cpp
  292. +15 −0 DialogButtonBox/form.h
  293. +12 −0 DialogButtonBox/main.cpp
  294. +12 −0 Dir/CMakeLists.txt
  295. +42 −0 Dir/Dir.cpp
  296. +15 −0 DragDropOS/CMakeLists.txt
  297. +30 −0 DragDropOS/form.cpp
  298. +20 −0 DragDropOS/form.h
  299. +19 −0 DragDropOS/form.ui
  300. +12 −0 DragDropOS/main.cpp
Sorry, we could not display the entire diff because too many files (1,311) changed.
15 AbstractItemDelegate/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 2.6)
+
+PROJECT(AbstractItemDelegate)
+
+FIND_PACKAGE(Qt4 REQUIRED)
+INCLUDE(${QT_USE_FILE})
+
+QT4_WRAP_UI(UISrcs form.ui)
+QT4_WRAP_CPP(MOCSrcs form.h LabelDelegate.h)
+
+include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+
+ADD_EXECUTABLE(AbstractItemDelegate main.cpp LabelDelegate.cpp MyTableModel.cpp form.cpp ${MOCSrcs} ${UISrcs})
+TARGET_LINK_LIBRARIES(AbstractItemDelegate ${QT_LIBRARIES})
+
23 AbstractItemDelegate/LabelDelegate.cpp
@@ -0,0 +1,23 @@
+#include "LabelDelegate.h"
+
+#include <QPainter>
+
+#include <iostream>
+
+void LabelDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+ QPixmap pixmap = index.data(Qt::DisplayRole).value<QPixmap>();
+ //std::cout << pixmap.width() << " " << pixmap.height() << std::endl;
+ //std::cout << "rect: " << option.rect.width() << " " << option.rect.height() << std::endl;
+
+ QRect rect = option.rect;
+ rect.adjust(rect.width()/3, 0, -rect.width()/3, 0);
+ painter->drawPixmap(rect, pixmap, pixmap.rect());
+}
+
+QSize LabelDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
+{
+ std::cout << "sizeHint()" << std::endl;
+ unsigned int sideLength = 300;
+ return QSize(sideLength, sideLength);
+}
19 AbstractItemDelegate/LabelDelegate.h
@@ -0,0 +1,19 @@
+#ifndef LABELDELEGATE_H
+#define LABELDELEGATE_H
+
+#include <QStyledItemDelegate>
+
+class LabelDelegate : public QStyledItemDelegate
+{
+ Q_OBJECT
+public:
+ LabelDelegate(){}
+
+ void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
+
+ QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
+};
+
+
+
+#endif
52 AbstractItemDelegate/MyTableModel.cpp
@@ -0,0 +1,52 @@
+#include "MyTableModel.h"
+
+#include <iostream>
+#include <sstream>
+
+#include <QLabel>
+#include <QPainter>
+#include <QPixmap>
+#include <QStyledItemDelegate>
+
+
+
+MyTableModel::MyTableModel() : QAbstractTableModel()
+{
+
+}
+
+int MyTableModel::rowCount(const QModelIndex& parent) const
+{
+ return 5;
+}
+
+int MyTableModel::columnCount(const QModelIndex& parent) const
+{
+ return 2;
+}
+
+QVariant MyTableModel::data(const QModelIndex& index, int role) const
+{
+ if(role == Qt::DisplayRole)
+ {
+ if(index.column() == 0)
+ {
+ return index.row();
+ }
+ else if(index.column() == 1)
+ {
+ //std::cout << "Creating image." << std::endl;
+ QPixmap pixmap(20,20);
+ QColor black(0,0,0);
+ pixmap.fill(black);
+ return pixmap;
+ }
+ }
+
+ return QVariant::Invalid;
+}
+
+Qt::ItemFlags MyTableModel::flags(const QModelIndex & index ) const
+{
+ return Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable;
+}
19 AbstractItemDelegate/MyTableModel.h
@@ -0,0 +1,19 @@
+#ifndef MyTableModel_H
+#define MyTableModel_H
+
+#include <QAbstractTableModel>
+
+#include <vector>
+
+class MyTableModel : public QAbstractTableModel
+{
+public:
+ MyTableModel();
+
+ int rowCount(const QModelIndex& parent) const;
+ int columnCount(const QModelIndex& parent) const;
+ QVariant data(const QModelIndex& index, int role) const;
+ Qt::ItemFlags flags ( const QModelIndex & index ) const;
+};
+
+#endif
36 AbstractItemDelegate/form.cpp
@@ -0,0 +1,36 @@
+#include <QAbstractTableModel>
+#include <QtGui>
+
+#include <iostream>
+#include <sstream>
+
+#include "form.h"
+
+#include "LabelDelegate.h"
+
+Form::Form(QWidget *parent)
+ : QWidget(parent)
+{
+ setupUi(this);
+
+ this->model = new MyTableModel;
+ this->tableView->setModel(model);
+
+ LabelDelegate* delegate = new LabelDelegate;
+
+ //this->tableView->setItemDelegate(delegate);
+ this->tableView->setItemDelegateForColumn(1, delegate);
+
+
+ this->tableView->resizeColumnsToContents();
+ this->tableView->resizeRowsToContents();
+
+ this->connect(this->model, SIGNAL(dataChanged ( const QModelIndex & , const QModelIndex & )), SLOT(TableChanged( const QModelIndex & , const QModelIndex & )));
+
+}
+
+
+void Form::TableChanged( const QModelIndex &topLeft , const QModelIndex &bottomRight )
+{
+ std::cout << "TableChanged()" << std::endl;
+}
21 AbstractItemDelegate/form.h
@@ -0,0 +1,21 @@
+#ifndef FORM_H
+#define FORM_H
+
+#include "ui_form.h"
+
+#include "MyTableModel.h"
+
+class Form : public QWidget, public Ui::Form
+{
+ Q_OBJECT
+
+public:
+ Form(QWidget *parent = 0);
+
+public slots:
+ void TableChanged( const QModelIndex & , const QModelIndex & );
+protected:
+ MyTableModel* model;
+};
+
+#endif
35 AbstractItemDelegate/form.ui
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QTableView" name="tableView">
+ <attribute name="horizontalHeaderStretchLastSection">
+ <bool>true</bool>
+ </attribute>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QPushButton" name="btnUpdate">
+ <property name="text">
+ <string>Update</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
12 AbstractItemDelegate/main.cpp
@@ -0,0 +1,12 @@
+#include <QApplication>
+
+#include "form.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ Form form;
+
+ form.show();
+ return app.exec();
+}
15 AbstractItemDelegateSize/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 2.6)
+
+PROJECT(AbstractItemDelegateSize)
+
+FIND_PACKAGE(Qt4 REQUIRED)
+INCLUDE(${QT_USE_FILE})
+
+QT4_WRAP_UI(UISrcs form.ui)
+QT4_WRAP_CPP(MOCSrcs form.h LabelDelegate.h)
+
+include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+
+ADD_EXECUTABLE(AbstractItemDelegateSize main.cpp LabelDelegate.cpp MyTableModel.cpp form.cpp ${MOCSrcs} ${UISrcs})
+TARGET_LINK_LIBRARIES(AbstractItemDelegateSize ${QT_LIBRARIES})
+
18 AbstractItemDelegateSize/LabelDelegate.cpp
@@ -0,0 +1,18 @@
+#include "LabelDelegate.h"
+
+#include <QPainter>
+
+#include <iostream>
+
+void LabelDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+ QPixmap pixmap = index.data(Qt::DisplayRole).value<QPixmap>();
+ //std::cout << pixmap.width() << " " << pixmap.height() << std::endl;
+ //std::cout << "rect: " << option.rect.width() << " " << option.rect.height() << std::endl;
+
+ QRect rect = option.rect;
+ //rect.adjust(rect.width()/3, 0, -rect.width()/3, 0);
+ painter->drawPixmap(rect, pixmap, pixmap.rect());
+
+ emit UpdateSize(index.row(), index.column(), pixmap.width(), pixmap.height());
+}
22 AbstractItemDelegateSize/LabelDelegate.h
@@ -0,0 +1,22 @@
+#ifndef LABELDELEGATE_H
+#define LABELDELEGATE_H
+
+#include <QStyledItemDelegate>
+
+class LabelDelegate : public QStyledItemDelegate
+{
+ Q_OBJECT
+
+signals:
+ void UpdateSize(int, int, int, int) const;
+
+public:
+ LabelDelegate(){}
+
+ void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
+
+};
+
+
+
+#endif
53 AbstractItemDelegateSize/MyTableModel.cpp
@@ -0,0 +1,53 @@
+#include "MyTableModel.h"
+
+#include <iostream>
+#include <sstream>
+
+#include <QLabel>
+#include <QPainter>
+#include <QPixmap>
+#include <QStyledItemDelegate>
+
+
+
+MyTableModel::MyTableModel() : QAbstractTableModel()
+{
+
+}
+
+int MyTableModel::rowCount(const QModelIndex& parent) const
+{
+ return 5;
+}
+
+int MyTableModel::columnCount(const QModelIndex& parent) const
+{
+ return 2;
+}
+
+QVariant MyTableModel::data(const QModelIndex& index, int role) const
+{
+ if(role == Qt::DisplayRole)
+ {
+ if(index.column() == 0)
+ {
+ return index.row();
+ }
+ else if(index.column() == 1)
+ {
+ //std::cout << "Creating image." << std::endl;
+ int size = 75;
+ QPixmap pixmap(size,size);
+ QColor black(0,0,0);
+ pixmap.fill(black);
+ return pixmap;
+ }
+ }
+
+ return QVariant::Invalid;
+}
+
+Qt::ItemFlags MyTableModel::flags(const QModelIndex & index ) const
+{
+ return Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable;
+}
19 AbstractItemDelegateSize/MyTableModel.h
@@ -0,0 +1,19 @@
+#ifndef MyTableModel_H
+#define MyTableModel_H
+
+#include <QAbstractTableModel>
+
+#include <vector>
+
+class MyTableModel : public QAbstractTableModel
+{
+public:
+ MyTableModel();
+
+ int rowCount(const QModelIndex& parent) const;
+ int columnCount(const QModelIndex& parent) const;
+ QVariant data(const QModelIndex& index, int role) const;
+ Qt::ItemFlags flags ( const QModelIndex & index ) const;
+};
+
+#endif
40 AbstractItemDelegateSize/form.cpp
@@ -0,0 +1,40 @@
+#include <QAbstractTableModel>
+#include <QtGui>
+
+#include <iostream>
+#include <sstream>
+
+#include "form.h"
+
+#include "LabelDelegate.h"
+
+Form::Form(QWidget *parent)
+ : QWidget(parent)
+{
+ setupUi(this);
+
+ this->model = new MyTableModel;
+ this->tableView->setModel(model);
+
+ LabelDelegate* delegate = new LabelDelegate;
+
+ this->connect(delegate, SIGNAL(UpdateSize(int,int,int,int)), SLOT(slot_UpdateSize(int,int,int,int)));
+ //this->tableView->setItemDelegate(delegate);
+ this->tableView->setItemDelegateForColumn(1, delegate);
+
+ this->connect(this->model, SIGNAL(dataChanged ( const QModelIndex & , const QModelIndex & )), SLOT(TableChanged( const QModelIndex & , const QModelIndex & )));
+
+}
+
+
+void Form::TableChanged( const QModelIndex &topLeft , const QModelIndex &bottomRight )
+{
+ std::cout << "TableChanged()" << std::endl;
+}
+
+void Form::slot_UpdateSize(int row, int column, int width, int height)
+{
+ this->tableView->setColumnWidth(column, width);
+ this->tableView->setRowHeight(row, height);
+
+}
23 AbstractItemDelegateSize/form.h
@@ -0,0 +1,23 @@
+#ifndef FORM_H
+#define FORM_H
+
+#include "ui_form.h"
+
+#include "MyTableModel.h"
+
+class Form : public QWidget, public Ui::Form
+{
+ Q_OBJECT
+
+public:
+ Form(QWidget *parent = 0);
+
+public slots:
+ void TableChanged( const QModelIndex & , const QModelIndex & );
+ void slot_UpdateSize(int row, int column, int width, int height);
+
+protected:
+ MyTableModel* model;
+};
+
+#endif
35 AbstractItemDelegateSize/form.ui
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QTableView" name="tableView">
+ <attribute name="horizontalHeaderStretchLastSection">
+ <bool>false</bool>
+ </attribute>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QPushButton" name="btnUpdate">
+ <property name="text">
+ <string>Update</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
12 AbstractItemDelegateSize/main.cpp
@@ -0,0 +1,12 @@
+#include <QApplication>
+
+#include "form.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ Form form;
+
+ form.show();
+ return app.exec();
+}
12 AutoConnect/AutoConnect.cpp
@@ -0,0 +1,12 @@
+#include <QApplication>
+
+#include "form.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ Form form;
+
+ form.show();
+ return app.exec();
+}
15 AutoConnect/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 2.6)
+
+PROJECT(AutoConnect)
+
+FIND_PACKAGE(Qt4 REQUIRED)
+INCLUDE(${QT_USE_FILE})
+
+QT4_WRAP_UI(UISrcs form.ui)
+QT4_WRAP_CPP(MOCSrcs form.h)
+
+include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+
+ADD_EXECUTABLE(AutoConnect AutoConnect.cpp form.h form.cpp ${MOCSrcs} ${UISrcs})
+TARGET_LINK_LIBRARIES(AutoConnect ${QT_LIBRARIES})
+
14 AutoConnect/form.cpp
@@ -0,0 +1,14 @@
+#include <QtGui>
+
+#include "form.h"
+
+Form::Form(QWidget *parent)
+ : QWidget(parent)
+{
+ setupUi(this);
+}
+
+void Form::on_pushButton_clicked()
+{
+ this->label->setText(this->textEdit->document()->toPlainText());
+}
18 AutoConnect/form.h
@@ -0,0 +1,18 @@
+#ifndef FORM_H
+#define FORM_H
+
+#include "ui_form.h"
+
+class Form : public QWidget, private Ui::Form
+{
+ Q_OBJECT
+
+public:
+ Form(QWidget *parent = 0);
+
+ public slots:
+ void on_pushButton_clicked();
+
+};
+
+#endif
55 AutoConnect/form.ui
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <widget class="QPushButton" name="pushButton">
+ <property name="geometry">
+ <rect>
+ <x>80</x>
+ <y>120</y>
+ <width>91</width>
+ <height>28</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label">
+ <property name="geometry">
+ <rect>
+ <x>170</x>
+ <y>220</y>
+ <width>61</width>
+ <height>18</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ <widget class="QTextEdit" name="textEdit">
+ <property name="geometry">
+ <rect>
+ <x>250</x>
+ <y>30</y>
+ <width>104</width>
+ <height>78</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
17 Boost/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 2.6)
+
+PROJECT(Boost)
+
+FIND_PACKAGE(Qt4 REQUIRED)
+INCLUDE(${QT_USE_FILE})
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_KEYWORDS")
+
+QT4_WRAP_UI(UISrcs form.ui)
+QT4_WRAP_CPP(MOCSrcs form.h)
+
+include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+
+ADD_EXECUTABLE(Boost main.cpp form.cpp ${MOCSrcs} ${UISrcs})
+TARGET_LINK_LIBRARIES(Boost ${QT_LIBRARIES})
+
14 Boost/form.cpp
@@ -0,0 +1,14 @@
+#include "form.h"
+
+MyForm::MyForm(QWidget *parent)
+ : QWidget(parent)
+{
+ setupUi(this);
+ connect( this->pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_SetLabelText()) );
+
+}
+
+void MyForm::pushButton_SetLabelText()
+{
+ this->label->setText("hello");
+}
16 Boost/form.h
@@ -0,0 +1,16 @@
+#ifndef FORM_H
+#define FORM_H
+
+#include "ui_form.h"
+
+class MyForm : public QWidget, private Ui::Form
+{
+ Q_OBJECT
+public:
+ MyForm(QWidget *parent = 0);
+
+public Q_SLOTS:
+ void pushButton_SetLabelText();
+};
+
+#endif
45 Boost/form.ui
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>My Program</string>
+ </property>
+ <widget class="QPushButton" name="pushButton">
+ <property name="geometry">
+ <rect>
+ <x>130</x>
+ <y>100</y>
+ <width>91</width>
+ <height>28</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Click me</string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label">
+ <property name="geometry">
+ <rect>
+ <x>150</x>
+ <y>150</y>
+ <width>61</width>
+ <height>18</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Before click</string>
+ </property>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
24 Boost/main.cpp
@@ -0,0 +1,24 @@
+#include <QApplication>
+#include <iostream>
+
+#include "form.h"
+
+#include <boost/signals2/signal.hpp>
+
+void func()
+{
+ std::cout << "Hello, world!" << std::endl;
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ MyForm form;
+
+ form.show();
+
+ boost::signals2::signal<void ()> s;
+ s.connect(func);
+
+ return app.exec();
+}
15 ButtonBox/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 2.6)
+
+PROJECT(ButtonBox)
+
+FIND_PACKAGE(Qt4 REQUIRED)
+INCLUDE(${QT_USE_FILE})
+
+QT4_WRAP_UI(UISrcs form.ui)
+QT4_WRAP_CPP(MOCSrcs form.h)
+
+include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+
+ADD_EXECUTABLE(ButtonBox main.cpp form.cpp ${MOCSrcs} ${UISrcs})
+TARGET_LINK_LIBRARIES(ButtonBox ${QT_LIBRARIES})
+
18 ButtonBox/form.cpp
@@ -0,0 +1,18 @@
+#include "form.h"
+
+MyForm::MyForm(QWidget *parent)
+ : QWidget(parent)
+{
+ setupUi(this);
+
+}
+
+void MyForm::on_buttonBox_accepted()
+{
+ this->label->setText("accepted");
+}
+
+void MyForm::on_buttonBox_rejected()
+{
+ this->label->setText("rejected");
+}
19 ButtonBox/form.h
@@ -0,0 +1,19 @@
+#ifndef BUTTONFORM_H
+#define BUTTONFORM_H
+
+#include "ui_form.h"
+
+class MyForm : public QWidget, private Ui::Form
+{
+ Q_OBJECT
+
+public:
+ MyForm(QWidget *parent = 0);
+
+public slots:
+
+ void on_buttonBox_accepted();
+ void on_buttonBox_rejected();
+};
+
+#endif
45 ButtonBox/form.ui
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>My Program</string>
+ </property>
+ <widget class="QLabel" name="label">
+ <property name="geometry">
+ <rect>
+ <x>120</x>
+ <y>220</y>
+ <width>141</width>
+ <height>18</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Before click</string>
+ </property>
+ </widget>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="geometry">
+ <rect>
+ <x>110</x>
+ <y>120</y>
+ <width>176</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
12 ButtonBox/main.cpp
@@ -0,0 +1,12 @@
+#include <QApplication>
+
+#include "form.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ MyForm form;
+
+ form.show();
+ return app.exec();
+}
15 ButtonWidget/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 2.6)
+
+PROJECT(ButtonWidget)
+
+FIND_PACKAGE(Qt4 REQUIRED)
+INCLUDE(${QT_USE_FILE})
+
+QT4_WRAP_UI(UISrcs form.ui)
+QT4_WRAP_CPP(MOCSrcs form.h)
+
+include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+
+ADD_EXECUTABLE(ButtonWidget main.cpp form.h form.cpp ${MOCSrcs} ${UISrcs})
+TARGET_LINK_LIBRARIES(ButtonWidget ${QT_LIBRARIES})
+
13 ButtonWidget/form.cpp
@@ -0,0 +1,13 @@
+#include "buttonform.h"
+
+MyForm::MyForm(QWidget *parent)
+ : QWidget(parent)
+{
+ setupUi(this);
+ connect( this->pushButton, SIGNAL( clicked() ), this, SLOT(pushButton_SetLabelText()) );
+}
+
+void MyForm::pushButton_SetLabelText()
+{
+ this->label->setText("hello");
+}
16 ButtonWidget/form.h
@@ -0,0 +1,16 @@
+#ifndef BUTTONFORM_H
+#define BUTTONFORM_H
+
+#include "ui_buttonform.h"
+
+class MyForm : public QWidget, private Ui::ButtonForm
+{
+ Q_OBJECT
+public:
+ MyForm(QWidget *parent = 0);
+
+public slots:
+ void pushButton_SetLabelText();
+};
+
+#endif
45 ButtonWidget/form.ui
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>My Program</string>
+ </property>
+ <widget class="QPushButton" name="pushButton">
+ <property name="geometry">
+ <rect>
+ <x>130</x>
+ <y>100</y>
+ <width>91</width>
+ <height>28</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Click me</string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label">
+ <property name="geometry">
+ <rect>
+ <x>150</x>
+ <y>150</y>
+ <width>61</width>
+ <height>18</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Before click</string>
+ </property>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
12 ButtonWidget/main.cpp
@@ -0,0 +1,12 @@
+#include <QApplication>
+
+#include "buttonform.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ MyForm form;
+
+ form.show();
+ return app.exec();
+}
15 Calculator/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 2.6)
+
+PROJECT(Calculator)
+
+FIND_PACKAGE(Qt4 REQUIRED)
+INCLUDE(${QT_USE_FILE})
+
+QT4_WRAP_UI(UISrcs calculatorform.ui)
+QT4_WRAP_CPP(MOCSrcs calculatorform.h)
+
+include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+
+ADD_EXECUTABLE(Calculator main.cpp calculatorform.h calculatorform.cpp ${MOCSrcs} ${UISrcs})
+TARGET_LINK_LIBRARIES(Calculator ${QT_LIBRARIES})
+
BIN Calculator/Calculator.kdevelop.pcs
Binary file not shown.
323 Calculator/Doxyfile
@@ -0,0 +1,323 @@
+# Doxyfile 1.5.7.1-KDevelop
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING = UTF-8
+PROJECT_NAME = Calculator
+PROJECT_NUMBER = $VERSION$
+OUTPUT_DIRECTORY =
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH = /home/doriad/
+STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = NO
+QT_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS = YES
+SEPARATE_MEMBER_PAGES = NO
+TAB_SIZE = 8
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+OPTIMIZE_FOR_FORTRAN = NO
+OPTIMIZE_OUTPUT_VHDL = NO
+EXTENSION_MAPPING =
+BUILTIN_STL_SUPPORT = NO
+CPP_CLI_SUPPORT = NO
+SIP_SUPPORT = NO
+IDL_PROPERTY_SUPPORT = YES
+DISTRIBUTE_GROUP_DOC = NO
+SUBGROUPING = YES
+TYPEDEF_HIDES_STRUCT = NO
+SYMBOL_CACHE_SIZE = 0
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = NO
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = NO
+EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_METHODS = NO
+EXTRACT_ANON_NSPACES = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+SORT_GROUP_NAMES = NO
+SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+SHOW_DIRECTORIES = NO
+SHOW_FILES = YES
+SHOW_NAMESPACES = YES
+FILE_VERSION_FILTER =
+LAYOUT_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = /media/portable/Examples/c++/src/QT/Calculator
+INPUT_ENCODING = UTF-8
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.d \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.idl \
+ *.odl \
+ *.cs \
+ *.php \
+ *.php3 \
+ *.inc \
+ *.m \
+ *.mm \
+ *.dox \
+ *.py \
+ *.f90 \
+ *.f \
+ *.vhd \
+ *.vhdl \
+ *.C \
+ *.CC \
+ *.C++ \
+ *.II \
+ *.I++ \
+ *.H \
+ *.HH \
+ *.H++ \
+ *.CS \
+ *.PHP \
+ *.PHP3 \
+ *.M \
+ *.MM \
+ *.PY \
+ *.F90 \
+ *.F \
+ *.VHD \
+ *.VHDL \
+ *.C \
+ *.H \
+ *.tlh \
+ *.diff \
+ *.patch \
+ *.moc \
+ *.xpm \
+ *.dox
+RECURSIVE = yes
+EXCLUDE =
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXCLUDE_SYMBOLS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS = *
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION = NO
+REFERENCES_LINK_SOURCE = YES
+USE_HTAGS = NO
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+HTML_DYNAMIC_SECTIONS = NO
+GENERATE_DOCSET = NO
+DOCSET_FEEDNAME = "Doxygen generated docs"
+DOCSET_BUNDLE_ID = org.doxygen.Project
+GENERATE_HTMLHELP = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+CHM_INDEX_ENCODING =
+BINARY_TOC = NO
+TOC_EXPAND = NO
+GENERATE_QHP = NO
+QCH_FILE =
+QHP_NAMESPACE =
+QHP_VIRTUAL_FOLDER = doc
+QHP_CUSTOM_FILTER_NAME =
+QHP_CUST_FILTER_ATTRS =
+QHP_SECT_FILTER_ATTRS =
+QHG_LOCATION =
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = NONE
+TREEVIEW_WIDTH = 250
+FORMULA_FONTSIZE = 10
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = YES
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = YES
+USE_PDFLATEX = YES
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = yes
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE = Calculator.tag
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+MSCGEN_PATH =
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = NO
+DOT_FONTNAME = FreeSans
+DOT_FONTSIZE = 10
+DOT_FONTPATH =
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+GROUP_GRAPHS = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+CALLER_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+DOT_GRAPH_MAX_NODES = 50
+MAX_DOT_GRAPH_DEPTH = 1000
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
20 Calculator/calculatorform.cpp
@@ -0,0 +1,20 @@
+
+ #include <QtGui>
+
+ #include "calculatorform.h"
+
+ CalculatorForm::CalculatorForm(QWidget *parent)
+ : QWidget(parent)
+ {
+ ui.setupUi(this);
+ }
+
+ void CalculatorForm::on_inputSpinBox1_valueChanged(int value)
+ {
+ ui.outputWidget->setText(QString::number(value + ui.inputSpinBox2->value()));
+ }
+
+ void CalculatorForm::on_inputSpinBox2_valueChanged(int value)
+ {
+ ui.outputWidget->setText(QString::number(value + ui.inputSpinBox1->value()));
+ }
22 Calculator/calculatorform.h
@@ -0,0 +1,22 @@
+
+ #ifndef CALCULATORFORM_H
+ #define CALCULATORFORM_H
+
+ #include "ui_calculatorform.h"
+
+ class CalculatorForm : public QWidget
+ {
+ Q_OBJECT
+
+ public:
+ CalculatorForm(QWidget *parent = 0);
+
+ private slots:
+ void on_inputSpinBox1_valueChanged(int value);
+ void on_inputSpinBox2_valueChanged(int value);
+
+ private:
+ Ui::CalculatorForm ui;
+ };
+
+ #endif
284 Calculator/calculatorform.ui
@@ -0,0 +1,284 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>CalculatorForm</class>
+ <widget class="QWidget" name="CalculatorForm" >
+ <property name="objectName" >
+ <string notr="true" >CalculatorForm</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="windowTitle" >
+ <string>Calculator Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="6" >
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" >horizontalSpacer</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>239</x>
+ <y>9</y>
+ <width>152</width>
+ <height>52</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="4" >
+ <widget class="QLabel" name="label_3_2" >
+ <property name="objectName" >
+ <string notr="true" >label_3_2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>169</x>
+ <y>9</y>
+ <width>20</width>
+ <height>52</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>=</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="5" >
+ <layout class="QVBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_2_2_2" >
+ <property name="objectName" >
+ <string notr="true" >label_2_2_2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>36</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Output</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="outputWidget" >
+ <property name="objectName" >
+ <string notr="true" >outputWidget</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>24</y>
+ <width>36</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::Box</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Sunken</enum>
+ </property>
+ <property name="text" >
+ <string>0</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="2" >
+ <spacer>
+ <property name="objectName" >
+ <string notr="true" >verticalSpacer</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>89</x>
+ <y>67</y>
+ <width>20</width>
+ <height>224</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="3" >
+ <layout class="QVBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="objectName" >
+ <string notr="true" >label_2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>46</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Input 2</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="inputSpinBox2" >
+ <property name="objectName" >
+ <string notr="true" >inputSpinBox2</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>26</y>
+ <width>46</width>
+ <height>25</height>
+ </rect>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="label_3" >
+ <property name="objectName" >
+ <string notr="true" >label_3</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>63</x>
+ <y>9</y>
+ <width>20</width>
+ <height>52</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" >
+ <property name="objectName" >
+ <string notr="true" />
+ </property>
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="objectName" >
+ <string notr="true" >label</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>46</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Input 1</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="inputSpinBox1" >
+ <property name="objectName" >
+ <string notr="true" >inputSpinBox1</string>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>26</y>
+ <width>46</width>
+ <height>25</height>
+ </rect>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections/>
+ </ui>
12 Calculator/main.cpp
@@ -0,0 +1,12 @@
+
+ #include <QApplication>
+
+ #include "calculatorform.h"
+
+ int main(int argc, char *argv[])
+ {
+ QApplication app(argc, argv);
+ CalculatorForm calculator;
+ calculator.show();
+ return app.exec();
+ }
14 Calendar/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 2.6)
+
+PROJECT(Calendar)
+
+FIND_PACKAGE(Qt4 REQUIRED)
+INCLUDE(${QT_USE_FILE})
+
+QT4_WRAP_UI(UISrcs main.ui)
+QT4_WRAP_CPP(MOCSrcs form.h)
+
+include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+
+ADD_EXECUTABLE(Calendar Calendar.cpp form.cpp ${UISrcs} ${MOCSrcs})
+TARGET_LINK_LIBRARIES(Calendar ${QT_LIBRARIES})
14 Calendar/Calendar.cpp
@@ -0,0 +1,14 @@
+#include <QProgressDialog>
+#include <QApplication>
+
+#include "form.h"
+
+int main( int argc, char **argv )
+{
+ QApplication app(argc, argv);
+ MainWindow window;
+
+ window.show();
+
+ return app.exec();
+}
16 Calendar/form.cpp
@@ -0,0 +1,16 @@
+#include <QtGui>
+
+#include "form.h"
+#include <iostream>
+
+MainWindow::MainWindow()
+{
+ setupUi(this);
+ QDate currentDate = this->calendarWidget->selectedDate();
+ std::cout << "currentDate: " << currentDate.toString().toStdString() << std::endl;
+}
+
+void MainWindow::on_calendarWidget_clicked ( const QDate & date )
+{
+ std::cout << "clicked: " << date.toString().toStdString() << std::endl;
+}
20 Calendar/form.h
@@ -0,0 +1,20 @@
+#ifndef FORM_H
+#define FORM_H
+
+#include "ui_main.h"
+
+#include <QTime>
+
+class MainWindow : public QMainWindow, public Ui::MainWindow
+{
+Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void on_calendarWidget_clicked ( const QDate & date ) ;
+
+};
+
+#endif
40 Calendar/main.ui
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>568</width>
+ <height>447</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QCalendarWidget" name="calendarWidget"/>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ </widget>