Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

First commit.

  • Loading branch information...
commit 09876e5ed3aa1f9a6e341cb4e79606ec7e129e9c 0 parents
David Doria authored February 17, 2012

Showing 306 changed files with 10,288 additions and 0 deletions. Show diff stats Hide diff stats

  1. 15  AbstractItemDelegate/CMakeLists.txt
  2. 23  AbstractItemDelegate/LabelDelegate.cpp
  3. 19  AbstractItemDelegate/LabelDelegate.h
  4. 52  AbstractItemDelegate/MyTableModel.cpp
  5. 19  AbstractItemDelegate/MyTableModel.h
  6. 36  AbstractItemDelegate/form.cpp
  7. 21  AbstractItemDelegate/form.h
  8. 35  AbstractItemDelegate/form.ui
  9. 12  AbstractItemDelegate/main.cpp
  10. 15  AbstractItemDelegateSize/CMakeLists.txt
  11. 18  AbstractItemDelegateSize/LabelDelegate.cpp
  12. 22  AbstractItemDelegateSize/LabelDelegate.h
  13. 53  AbstractItemDelegateSize/MyTableModel.cpp
  14. 19  AbstractItemDelegateSize/MyTableModel.h
  15. 40  AbstractItemDelegateSize/form.cpp
  16. 23  AbstractItemDelegateSize/form.h
  17. 35  AbstractItemDelegateSize/form.ui
  18. 12  AbstractItemDelegateSize/main.cpp
  19. 12  AutoConnect/AutoConnect.cpp
  20. 15  AutoConnect/CMakeLists.txt
  21. 14  AutoConnect/form.cpp
  22. 18  AutoConnect/form.h
  23. 55  AutoConnect/form.ui
  24. 17  Boost/CMakeLists.txt
  25. 14  Boost/form.cpp
  26. 16  Boost/form.h
  27. 45  Boost/form.ui
  28. 24  Boost/main.cpp
  29. 15  ButtonBox/CMakeLists.txt
  30. 18  ButtonBox/form.cpp
  31. 19  ButtonBox/form.h
  32. 45  ButtonBox/form.ui
  33. 12  ButtonBox/main.cpp
  34. 15  ButtonWidget/CMakeLists.txt
  35. 13  ButtonWidget/form.cpp
  36. 16  ButtonWidget/form.h
  37. 45  ButtonWidget/form.ui
  38. 12  ButtonWidget/main.cpp
  39. 15  Calculator/CMakeLists.txt
  40. BIN  Calculator/Calculator.kdevelop.pcs
  41. 323  Calculator/Doxyfile
  42. 20  Calculator/calculatorform.cpp
  43. 22  Calculator/calculatorform.h
  44. 284  Calculator/calculatorform.ui
  45. 12  Calculator/main.cpp
  46. 14  Calendar/CMakeLists.txt
  47. 14  Calendar/Calendar.cpp
  48. 16  Calendar/form.cpp
  49. 20  Calendar/form.h
  50. 40  Calendar/main.ui
  51. 17  CheckBox/CMakeLists.txt
  52. BIN  CheckBox/CheckBox.kdevelop.pcs
  53. 323  CheckBox/Doxyfile
  54. 24  CheckBox/form.cpp
  55. 20  CheckBox/form.h
  56. 58  CheckBox/form.ui
  57. 12  CheckBox/main.cpp
  58. 15  CheckForQT/CMakeLists.txt
  59. 323  CheckForQT/Doxyfile
  60. 13  CheckForQT/form.cpp
  61. 15  CheckForQT/form.h
  62. 58  CheckForQT/form.ui
  63. 12  CheckForQT/main.cpp
  64. 14  ClassTemplateQObject/CMakeLists.txt
  65. 12  ClassTemplateQObject/ClassTemplateQObject.cpp
  66. 4  ClassTemplateQObject/form.cpp
  67. 45  ClassTemplateQObject/form.h
  68. 14  ClassTemplateQObject/form.hpp
  69. 65  ClassTemplateQObject/form.ui
  70. 15  ClickGraphics/CMakeLists.txt
  71. 52  ClickGraphics/form.cpp
  72. 20  ClickGraphics/form.h
  73. 55  ClickGraphics/form.ui
  74. BIN  ClickGraphics/image.png
  75. 36  ClickGraphics/main.cpp
  76. 15  ClickableLabelInTable/CMakeLists.txt
  77. 11  ClickableLabelInTable/ClickableLabel.cpp
  78. 18  ClickableLabelInTable/ClickableLabel.h
  79. 43  ClickableLabelInTable/form.cpp
  80. 18  ClickableLabelInTable/form.h
  81. 42  ClickableLabelInTable/form.ui
  82. 12  ClickableLabelInTable/main.cpp
  83. 15  ComboBox/CMakeLists.txt
  84. BIN  ComboBox/ComboBox.kdevelop.pcs
  85. 17  ComboBox/Direct.cpp.bak
  86. 323  ComboBox/Doxyfile
  87. 11  ComboBox/demo.cpp
  88. 17  ComboBox/main.cpp
  89. 21  ComboBox/main.h
  90. 52  ComboBox/main.ui
  91. 15  ComboBoxOfCheckBoxes/CMakeLists.txt
  92. 11  ComboBoxOfCheckBoxes/demo.cpp
  93. 50  ComboBoxOfCheckBoxes/main.cpp
  94. 29  ComboBoxOfCheckBoxes/main.h
  95. 52  ComboBoxOfCheckBoxes/main.ui
  96. 28  ComboBoxOfCheckBoxes/mainMethod1.cpp
  97. 27  ComboBoxOfCheckBoxes/mainMethod1.h
  98. 15  ComputationThread/CMakeLists.txt
  99. 10  ComputationThread/ComputationObject.h
  100. 34  ComputationThread/ComputationThread.cpp
  101. 55  ComputationThread/ComputationThread.h
  102. 13  ComputationThread/MyObject.cpp
  103. 11  ComputationThread/MyObject.h
  104. 38  ComputationThread/TestComputationThread.cpp
  105. 22  ComputationThread/TestComputationThread.h
  106. 11  ComputationThread/demo.cpp
  107. 48  ComputationThread/main.cpp
  108. 32  ComputationThread/main.h
  109. 84  ComputationThread/main.ui
  110. 27  Concurrent/BlockingMapWithBoostBind/BlockingMapWithBoostBind.cpp
  111. 9  Concurrent/BlockingMapWithBoostBind/CMakeLists.txt
  112. 15  Concurrent/FutureWatcher/CMakeLists.txt
  113. 18  Concurrent/FutureWatcher/FutureWatcher.cpp
  114. 10  Concurrent/FutureWatcher/MyClass.cpp
  115. 20  Concurrent/FutureWatcher/MyClass.h
  116. 34  Concurrent/FutureWatcher/form.cpp
  117. 27  Concurrent/FutureWatcher/form.h
  118. 38  Concurrent/FutureWatcher/form.ui
  119. 15  Concurrent/FutureWatcherProgressDialog/CMakeLists.txt
  120. 18  Concurrent/FutureWatcherProgressDialog/FutureWatcherProgressDialog.cpp
  121. 10  Concurrent/FutureWatcherProgressDialog/MyClass.cpp
  122. 21  Concurrent/FutureWatcherProgressDialog/MyClass.h
  123. 36  Concurrent/FutureWatcherProgressDialog/form.cpp
  124. 30  Concurrent/FutureWatcherProgressDialog/form.h
  125. 28  Concurrent/FutureWatcherProgressDialog/form.ui
  126. 15  Concurrent/FutureWatcherProgressDialogSubclass/CMakeLists.txt
  127. 18  Concurrent/FutureWatcherProgressDialogSubclass/FutureWatcherProgressDialogSubclass.cpp
  128. 10  Concurrent/FutureWatcherProgressDialogSubclass/MyClass.cpp
  129. 34  Concurrent/FutureWatcherProgressDialogSubclass/MyClass.h
  130. 43  Concurrent/FutureWatcherProgressDialogSubclass/form.cpp
  131. 31  Concurrent/FutureWatcherProgressDialogSubclass/form.h
  132. 28  Concurrent/FutureWatcherProgressDialogSubclass/form.ui
  133. 23  Concurrent/MapAndMapped/BlockingMapMemberFunction.cpp
  134. 24  Concurrent/MapAndMapped/BlockingMappedMemberFunction.cpp
  135. 28  Concurrent/MapAndMapped/BlockingMappedMemberFunctionOtherObjectBind.cpp
  136. 29  Concurrent/MapAndMapped/BlockingMappedMemberFunctionOtherObjectOperator.cpp
  137. 19  Concurrent/MapAndMapped/BlockingMappedParallelFor.cpp
  138. 43  Concurrent/MapAndMapped/CMakeLists.txt
  139. 53  Concurrent/MapAndMapped/Concurrent.cpp
  140. 28  Concurrent/MapAndMapped/Inplace.cpp
  141. 48  Concurrent/MapAndMapped/InplaceComplexType.cpp
  142. 39  Concurrent/MapAndMapped/MemberFunction.cpp
  143. 73  Concurrent/MapAndMapped/NonBlockingNonStaticMap.cpp
  144. 45  Concurrent/MapAndMapped/NonStaticMapAnyClassMember.cpp
  145. 57  Concurrent/MapAndMapped/legacy.cpp
  146. 15  Concurrent/Run/CMakeLists.txt
  147. 18  Concurrent/Run/Run.cpp
  148. 29  Concurrent/Run/form.cpp
  149. 19  Concurrent/Run/form.h
  150. 48  Concurrent/Run/form.ui
  151. 14  Concurrent/RunBind/CMakeLists.txt
  152. 61  Concurrent/RunBind/RunBind.cpp
  153. 29  Concurrent/RunBind/form.cpp
  154. 19  Concurrent/RunBind/form.h
  155. 48  Concurrent/RunBind/form.ui
  156. 11  Concurrent/RunFunctionTemplate/CMakeLists.txt
  157. 31  Concurrent/RunFunctionTemplate/Legacy.cpp
  158. 86  Concurrent/RunFunctionTemplate/RunFunctionTemplate.cpp
  159. 11  Concurrent/RunFunctionTemplateNoArguments/CMakeLists.txt
  160. 31  Concurrent/RunFunctionTemplateNoArguments/Legacy.cpp
  161. 21  Concurrent/RunFunctionTemplateNoArguments/RunFunctionTemplate.cpp
  162. 15  Concurrent/RunMemberFunction/CMakeLists.txt
  163. 0  Concurrent/RunMemberFunction/MyClass.cpp
  164. 22  Concurrent/RunMemberFunction/MyClass.h
  165. 18  Concurrent/RunMemberFunction/RunMemberFunction.cpp
  166. 22  Concurrent/RunMemberFunction/form.cpp
  167. 19  Concurrent/RunMemberFunction/form.h
  168. 48  Concurrent/RunMemberFunction/form.ui
  169. 14  Concurrent/RunWithGUIUpdate/CMakeLists.txt
  170. 11  Concurrent/RunWithGUIUpdate/LongFunction.cpp
  171. 10  Concurrent/RunWithGUIUpdate/LongFunction.h
  172. 24  Concurrent/RunWithGUIUpdate/MyClass.h
  173. 23  Concurrent/RunWithGUIUpdate/RunWithGUIUpdate.cpp
  174. 22  Concurrent/RunWithGUIUpdate/form.cpp
  175. 22  Concurrent/RunWithGUIUpdate/form.h
  176. 48  Concurrent/RunWithGUIUpdate/form.ui
  177. 12  Connect/CMakeLists.txt
  178. 13  Connect/Connect.cpp
  179. 24  Connect/MyWidget.cpp
  180. 23  Connect/MyWidget.h
  181. 15  ConstructorTimer/CMakeLists.txt
  182. 17  ConstructorTimer/form.cpp
  183. 17  ConstructorTimer/form.h
  184. 55  ConstructorTimer/form.ui
  185. 12  ConstructorTimer/main.cpp
  186. 15  Cursor/CMakeLists.txt
  187. 28  Cursor/form.cpp
  188. 19  Cursor/form.h
  189. 45  Cursor/form.ui
  190. 12  Cursor/main.cpp
  191. 16  Databases/CreateTable/CMakeLists.txt
  192. 12  Databases/CreateTable/CreateTable.cpp
  193. 42  Databases/CreateTable/CreateTable.ui
  194. 77  Databases/CreateTable/form.cpp
  195. 22  Databases/CreateTable/form.h
  196. 12  Databases/DatabaseInMemory/CMakeLists.txt
  197. 85  Databases/DatabaseInMemory/Legacy.cpp
  198. 29  Databases/DatabaseInMemory/SqlTableModel.cpp
  199. 135  Databases/DatabaseInMemory/connection.h
  200. 16  Databases/ListView/CMakeLists.txt
  201. 64  Databases/ListView/ListView.cpp
  202. 42  Databases/ListView/ListView.ui
  203. 47  Databases/ListView/form.cpp
  204. 22  Databases/ListView/form.h
  205. 11  Databases/Sql/CMakeLists.txt
  206. 10  Databases/Sql/Sql.cpp
  207. 12  Databases/SqlDatabase/CMakeLists.txt
  208. 61  Databases/SqlDatabase/SqlDatabase.cpp
  209. 15  Databases/SqlQueryModel/CMakeLists.txt
  210. 12  Databases/SqlQueryModel/SqlQueryModel.cpp
  211. 42  Databases/SqlQueryModel/SqlQueryModel.ui
  212. 27  Databases/SqlQueryModel/form.cpp
  213. 16  Databases/SqlQueryModel/form.h
  214. 12  Databases/SqlTableModel/CMakeLists.txt
  215. 85  Databases/SqlTableModel/Legacy.cpp
  216. 29  Databases/SqlTableModel/SqlTableModel.cpp
  217. 135  Databases/SqlTableModel/connection.h
  218. 16  Databases/TableView/CMakeLists.txt
  219. 12  Databases/TableView/TableView.cpp
  220. 42  Databases/TableView/TableView.ui
  221. 96  Databases/TableView/form.cpp
  222. 16  Databases/TableView/form.h
  223. 16  Databases/TableViewComboBox/CMakeLists.txt
  224. 12  Databases/TableViewComboBox/TableViewComboBox.cpp
  225. 42  Databases/TableViewComboBox/TableViewComboBox.ui
  226. 47  Databases/TableViewComboBox/form.cpp
  227. 16  Databases/TableViewComboBox/form.h
  228. 14  Date/CMakeLists.txt
  229. 14  Date/Date.cpp
  230. 20  Date/form.cpp
  231. 22  Date/form.h
  232. 37  Date/main.ui
  233. 16  Delegates/ComboBoxDelegate/CMakeLists.txt
  234. 62  Delegates/ComboBoxDelegate/ComboBoxDelegate.cpp
  235. 29  Delegates/ComboBoxDelegate/ComboBoxDelegate.h
  236. 44  Delegates/ComboBoxDelegate/main.cpp
  237. 16  Delegates/ComboBoxDelegateBAK/CMakeLists.txt
  238. 72  Delegates/ComboBoxDelegateBAK/ComboBoxDelegate.cpp
  239. 30  Delegates/ComboBoxDelegateBAK/ComboBoxDelegate.h
  240. 48  Delegates/ComboBoxDelegateBAK/main.cpp
  241. 16  Delegates/ComboBoxDelegateEditOnly/CMakeLists.txt
  242. 66  Delegates/ComboBoxDelegateEditOnly/ComboBoxDelegate.cpp
  243. 30  Delegates/ComboBoxDelegateEditOnly/ComboBoxDelegate.h
  244. 44  Delegates/ComboBoxDelegateEditOnly/main.cpp
  245. 14  Delegates/IndexWidget/CMakeLists.txt
  246. 17  Delegates/IndexWidget/IndexWidget.cpp
  247. 18  Delegates/IndexWidget/IndexWidget.h
  248. 24  Delegates/IndexWidget/IndexWidget.ui
  249. 20  Delegates/IndexWidget/main.cpp
  250. 15  Delegates/PixmapDelegate/CMakeLists.txt
  251. 16  Delegates/PixmapDelegate/PixmapDelegate.cpp
  252. 16  Delegates/PixmapDelegate/PixmapDelegate.h
  253. 39  Delegates/PixmapDelegate/main.cpp
  254. 16  Delegates/SpinBoxDelegate/CMakeLists.txt
  255. 102  Delegates/SpinBoxDelegate/delegate.cpp
  256. 68  Delegates/SpinBoxDelegate/delegate.h
  257. 47  Delegates/SpinBoxDelegate/main.cpp
  258. 13  DesignerPlugin/FloatSlider.cpp
  259. 26  DesignerPlugin/FloatSlider.h
  260. 55  DesignerPlugin/FloatSlider.ui
  261. 155  DesignerPlugin/customwidgetplugin.cpp
  262. 72  DesignerPlugin/customwidgetplugin.h
  263. 24  DesignerPlugin/customwidgetplugin.pro
  264. 206  DesignerPlugin/customwidgetplugin.pro.user
  265. 12  DesignerPlugin/main.cpp
  266. 15  Dialog/Modal/CMakeLists.txt
  267. 18  Dialog/Modal/dialog.cpp
  268. 18  Dialog/Modal/dialog.h
  269. 91  Dialog/Modal/dialog.ui
  270. 25  Dialog/Modal/form.cpp
  271. 21  Dialog/Modal/form.h
  272. 45  Dialog/Modal/form.ui
  273. 12  Dialog/Modal/main.cpp
  274. 15  Dialog/ModalData/CMakeLists.txt
  275. 22  Dialog/ModalData/dialog.cpp
  276. 22  Dialog/ModalData/dialog.h
  277. 91  Dialog/ModalData/dialog.ui
  278. 33  Dialog/ModalData/form.cpp
  279. 21  Dialog/ModalData/form.h
  280. 45  Dialog/ModalData/form.ui
  281. 12  Dialog/ModalData/main.cpp
  282. 15  Dialog/Modeless/CMakeLists.txt
  283. 16  Dialog/Modeless/dialog.cpp
  284. 18  Dialog/Modeless/dialog.h
  285. 91  Dialog/Modeless/dialog.ui
  286. 39  Dialog/Modeless/form.cpp
  287. 26  Dialog/Modeless/form.h
  288. 45  Dialog/Modeless/form.ui
  289. 12  Dialog/Modeless/main.cpp
  290. 14  DialogButtonBox/CMakeLists.txt
  291. 12  DialogButtonBox/form.cpp
  292. 15  DialogButtonBox/form.h
  293. 12  DialogButtonBox/main.cpp
  294. 12  Dir/CMakeLists.txt
  295. 42  Dir/Dir.cpp
  296. 15  DragDropOS/CMakeLists.txt
  297. 30  DragDropOS/form.cpp
  298. 20  DragDropOS/form.h
  299. 19  DragDropOS/form.ui
  300. 12  DragDropOS/main.cpp
  301. 15  DrawLine/CMakeLists.txt
  302. 27  DrawLine/form.cpp
  303. 15  DrawLine/form.h
  304. 19  DrawLine/form.ui
  305. 12  DrawLine/main.cpp
15  AbstractItemDelegate/CMakeLists.txt
... ...
@@ -0,0 +1,15 @@
  1
+cmake_minimum_required(VERSION 2.6)
  2
+
  3
+PROJECT(AbstractItemDelegate)
  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 LabelDelegate.h)
  10
+
  11
+include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
  12
+
  13
+ADD_EXECUTABLE(AbstractItemDelegate main.cpp LabelDelegate.cpp MyTableModel.cpp form.cpp ${MOCSrcs} ${UISrcs})
  14
+TARGET_LINK_LIBRARIES(AbstractItemDelegate ${QT_LIBRARIES})
  15
+
23  AbstractItemDelegate/LabelDelegate.cpp
... ...
@@ -0,0 +1,23 @@
  1
+#include "LabelDelegate.h"
  2
+
  3
+#include <QPainter>
  4
+
  5
+#include <iostream>
  6
+
  7
+void LabelDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
  8
+{
  9
+  QPixmap pixmap = index.data(Qt::DisplayRole).value<QPixmap>();
  10
+  //std::cout << pixmap.width() << " " << pixmap.height() << std::endl;
  11
+  //std::cout << "rect: " << option.rect.width() << " " << option.rect.height() << std::endl;
  12
+
  13
+  QRect rect = option.rect;
  14
+  rect.adjust(rect.width()/3, 0, -rect.width()/3, 0);
  15
+  painter->drawPixmap(rect, pixmap, pixmap.rect());
  16
+}
  17
+
  18
+QSize LabelDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
  19
+{
  20
+  std::cout << "sizeHint()" << std::endl;
  21
+  unsigned int sideLength = 300;
  22
+  return QSize(sideLength, sideLength);
  23
+}
19  AbstractItemDelegate/LabelDelegate.h
... ...
@@ -0,0 +1,19 @@
  1
+#ifndef LABELDELEGATE_H
  2
+#define LABELDELEGATE_H
  3
+
  4
+#include <QStyledItemDelegate>
  5
+
  6
+class LabelDelegate : public QStyledItemDelegate
  7
+{
  8
+   Q_OBJECT
  9
+public:
  10
+  LabelDelegate(){}
  11
+  
  12
+  void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
  13
+
  14
+  QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
  15
+};
  16
+
  17
+
  18
+
  19
+#endif
52  AbstractItemDelegate/MyTableModel.cpp
... ...
@@ -0,0 +1,52 @@
  1
+#include "MyTableModel.h"
  2
+
  3
+#include <iostream>
  4
+#include <sstream>
  5
+
  6
+#include <QLabel>
  7
+#include <QPainter>
  8
+#include <QPixmap>
  9
+#include <QStyledItemDelegate>
  10
+
  11
+
  12
+
  13
+MyTableModel::MyTableModel() : QAbstractTableModel()
  14
+{
  15
+  
  16
+}
  17
+
  18
+int MyTableModel::rowCount(const QModelIndex& parent) const
  19
+{
  20
+  return 5;
  21
+}
  22
+
  23
+int MyTableModel::columnCount(const QModelIndex& parent) const
  24
+{
  25
+  return 2;
  26
+}
  27
+
  28
+QVariant MyTableModel::data(const QModelIndex& index, int role) const
  29
+{
  30
+  if(role == Qt::DisplayRole)
  31
+    {
  32
+    if(index.column() == 0)
  33
+      {
  34
+      return index.row();
  35
+      }
  36
+    else if(index.column() == 1)
  37
+      {
  38
+      //std::cout << "Creating image." << std::endl;
  39
+      QPixmap pixmap(20,20);
  40
+      QColor black(0,0,0);
  41
+      pixmap.fill(black);
  42
+      return pixmap;
  43
+      }
  44
+    }
  45
+
  46
+  return QVariant::Invalid;
  47
+}
  48
+
  49
+Qt::ItemFlags MyTableModel::flags(const QModelIndex & index ) const
  50
+{
  51
+  return Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable;
  52
+}
19  AbstractItemDelegate/MyTableModel.h
... ...
@@ -0,0 +1,19 @@
  1
+#ifndef MyTableModel_H
  2
+#define MyTableModel_H
  3
+
  4
+#include <QAbstractTableModel>
  5
+
  6
+#include <vector>
  7
+
  8
+class MyTableModel : public QAbstractTableModel
  9
+{
  10
+public:
  11
+  MyTableModel();
  12
+  
  13
+  int rowCount(const QModelIndex& parent) const;
  14
+  int columnCount(const QModelIndex& parent) const;
  15
+  QVariant data(const QModelIndex& index, int role) const;
  16
+  Qt::ItemFlags flags ( const QModelIndex & index ) const;
  17
+};
  18
+
  19
+#endif
36  AbstractItemDelegate/form.cpp
... ...
@@ -0,0 +1,36 @@
  1
+#include <QAbstractTableModel>
  2
+#include <QtGui>
  3
+
  4
+#include <iostream>
  5
+#include <sstream>
  6
+
  7
+#include "form.h"
  8
+
  9
+#include "LabelDelegate.h"
  10
+
  11
+Form::Form(QWidget *parent)
  12
+    : QWidget(parent)
  13
+{
  14
+  setupUi(this);
  15
+  
  16
+  this->model = new MyTableModel;
  17
+  this->tableView->setModel(model);
  18
+
  19
+  LabelDelegate* delegate = new LabelDelegate;
  20
+  
  21
+  //this->tableView->setItemDelegate(delegate);
  22
+  this->tableView->setItemDelegateForColumn(1, delegate);
  23
+  
  24
+  
  25
+  this->tableView->resizeColumnsToContents();
  26
+  this->tableView->resizeRowsToContents();
  27
+  
  28
+  this->connect(this->model, SIGNAL(dataChanged ( const QModelIndex & , const QModelIndex & )), SLOT(TableChanged( const QModelIndex & , const QModelIndex & )));
  29
+  
  30
+}
  31
+
  32
+
  33
+void Form::TableChanged( const QModelIndex &topLeft , const QModelIndex &bottomRight )
  34
+{
  35
+  std::cout << "TableChanged()" << std::endl;
  36
+}
21  AbstractItemDelegate/form.h
... ...
@@ -0,0 +1,21 @@
  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
35  AbstractItemDelegate/form.ui
... ...
@@ -0,0 +1,35 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<ui version="4.0">
  3
+ <class>Form</class>
  4
+ <widget class="QWidget" name="Form">
  5
+  <property name="geometry">
  6
+   <rect>
  7
+    <x>0</x>
  8
+    <y>0</y>
  9
+    <width>400</width>
  10
+    <height>300</height>
  11
+   </rect>
  12
+  </property>
  13
+  <property name="windowTitle">
  14
+   <string>Form</string>
  15
+  </property>
  16
+  <layout class="QGridLayout" name="gridLayout">
  17
+   <item row="0" column="0">
  18
+    <widget class="QTableView" name="tableView">
  19
+     <attribute name="horizontalHeaderStretchLastSection">
  20
+      <bool>true</bool>
  21
+     </attribute>
  22
+    </widget>
  23
+   </item>
  24
+   <item row="1" column="0">
  25
+    <widget class="QPushButton" name="btnUpdate">
  26
+     <property name="text">
  27
+      <string>Update</string>
  28
+     </property>
  29
+    </widget>
  30
+   </item>
  31
+  </layout>
  32
+ </widget>
  33
+ <resources/>
  34
+ <connections/>
  35
+</ui>
12  AbstractItemDelegate/main.cpp
... ...
@@ -0,0 +1,12 @@
  1
+#include <QApplication>
  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
+}
15  AbstractItemDelegateSize/CMakeLists.txt
... ...
@@ -0,0 +1,15 @@
  1
+cmake_minimum_required(VERSION 2.6)
  2
+
  3
+PROJECT(AbstractItemDelegateSize)
  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 LabelDelegate.h)
  10
+
  11
+include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
  12
+
  13
+ADD_EXECUTABLE(AbstractItemDelegateSize main.cpp LabelDelegate.cpp MyTableModel.cpp form.cpp ${MOCSrcs} ${UISrcs})
  14
+TARGET_LINK_LIBRARIES(AbstractItemDelegateSize ${QT_LIBRARIES})
  15
+
18  AbstractItemDelegateSize/LabelDelegate.cpp
... ...
@@ -0,0 +1,18 @@
  1
+#include "LabelDelegate.h"
  2
+
  3
+#include <QPainter>
  4
+
  5
+#include <iostream>
  6
+
  7
+void LabelDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
  8
+{
  9
+  QPixmap pixmap = index.data(Qt::DisplayRole).value<QPixmap>();
  10
+  //std::cout << pixmap.width() << " " << pixmap.height() << std::endl;
  11
+  //std::cout << "rect: " << option.rect.width() << " " << option.rect.height() << std::endl;
  12
+
  13
+  QRect rect = option.rect;
  14
+  //rect.adjust(rect.width()/3, 0, -rect.width()/3, 0);
  15
+  painter->drawPixmap(rect, pixmap, pixmap.rect());
  16
+  
  17
+  emit UpdateSize(index.row(), index.column(), pixmap.width(), pixmap.height());
  18
+}
22  AbstractItemDelegateSize/LabelDelegate.h
... ...
@@ -0,0 +1,22 @@
  1
+#ifndef LABELDELEGATE_H
  2
+#define LABELDELEGATE_H
  3
+
  4
+#include <QStyledItemDelegate>
  5
+
  6
+class LabelDelegate : public QStyledItemDelegate
  7
+{
  8
+   Q_OBJECT
  9
+   
  10
+signals:
  11
+  void UpdateSize(int, int, int, int) const;
  12
+  
  13
+public:
  14
+  LabelDelegate(){}
  15
+  
  16
+  void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
  17
+
  18
+};
  19
+
  20
+
  21
+
  22
+#endif
53  AbstractItemDelegateSize/MyTableModel.cpp
... ...
@@ -0,0 +1,53 @@
  1
+#include "MyTableModel.h"
  2
+
  3
+#include <iostream>
  4
+#include <sstream>
  5
+
  6
+#include <QLabel>
  7
+#include <QPainter>
  8
+#include <QPixmap>
  9
+#include <QStyledItemDelegate>
  10
+
  11
+
  12
+
  13
+MyTableModel::MyTableModel() : QAbstractTableModel()
  14
+{
  15
+  
  16
+}
  17
+
  18
+int MyTableModel::rowCount(const QModelIndex& parent) const
  19
+{
  20
+  return 5;
  21
+}
  22
+
  23
+int MyTableModel::columnCount(const QModelIndex& parent) const
  24
+{
  25
+  return 2;
  26
+}
  27
+
  28
+QVariant MyTableModel::data(const QModelIndex& index, int role) const
  29
+{
  30
+  if(role == Qt::DisplayRole)
  31
+    {
  32
+    if(index.column() == 0)
  33
+      {
  34
+      return index.row();
  35
+      }
  36
+    else if(index.column() == 1)
  37
+      {
  38
+      //std::cout << "Creating image." << std::endl;
  39
+      int size = 75;
  40
+      QPixmap pixmap(size,size);
  41
+      QColor black(0,0,0);
  42
+      pixmap.fill(black);
  43
+      return pixmap;
  44
+      }
  45
+    }
  46
+
  47
+  return QVariant::Invalid;
  48
+}
  49
+
  50
+Qt::ItemFlags MyTableModel::flags(const QModelIndex & index ) const
  51
+{
  52
+  return Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable;
  53
+}
19  AbstractItemDelegateSize/MyTableModel.h
... ...
@@ -0,0 +1,19 @@
  1
+#ifndef MyTableModel_H
  2
+#define MyTableModel_H
  3
+
  4
+#include <QAbstractTableModel>
  5
+
  6
+#include <vector>
  7
+
  8
+class MyTableModel : public QAbstractTableModel
  9
+{
  10
+public:
  11
+  MyTableModel();
  12
+  
  13
+  int rowCount(const QModelIndex& parent) const;
  14
+  int columnCount(const QModelIndex& parent) const;
  15
+  QVariant data(const QModelIndex& index, int role) const;
  16
+  Qt::ItemFlags flags ( const QModelIndex & index ) const;
  17
+};
  18
+
  19
+#endif
40  AbstractItemDelegateSize/form.cpp
... ...
@@ -0,0 +1,40 @@
  1
+#include <QAbstractTableModel>
  2
+#include <QtGui>
  3
+
  4
+#include <iostream>
  5
+#include <sstream>
  6
+
  7
+#include "form.h"
  8
+
  9
+#include "LabelDelegate.h"
  10
+
  11
+Form::Form(QWidget *parent)
  12
+    : QWidget(parent)
  13
+{
  14
+  setupUi(this);
  15
+  
  16
+  this->model = new MyTableModel;
  17
+  this->tableView->setModel(model);
  18
+
  19
+  LabelDelegate* delegate = new LabelDelegate;
  20
+  
  21
+  this->connect(delegate, SIGNAL(UpdateSize(int,int,int,int)), SLOT(slot_UpdateSize(int,int,int,int)));
  22
+  //this->tableView->setItemDelegate(delegate);
  23
+  this->tableView->setItemDelegateForColumn(1, delegate);
  24
+  
  25
+  this->connect(this->model, SIGNAL(dataChanged ( const QModelIndex & , const QModelIndex & )), SLOT(TableChanged( const QModelIndex & , const QModelIndex & )));
  26
+  
  27
+}
  28
+
  29
+
  30
+void Form::TableChanged( const QModelIndex &topLeft , const QModelIndex &bottomRight )
  31
+{
  32
+  std::cout << "TableChanged()" << std::endl;
  33
+}
  34
+
  35
+void Form::slot_UpdateSize(int row, int column, int width, int height)
  36
+{
  37
+  this->tableView->setColumnWidth(column, width);
  38
+  this->tableView->setRowHeight(row, height);
  39
+    
  40
+}
23  AbstractItemDelegateSize/form.h
... ...
@@ -0,0 +1,23 @@
  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
+  void slot_UpdateSize(int row, int column, int width, int height);
  18
+  
  19
+protected:
  20
+  MyTableModel* model;
  21
+};
  22
+
  23
+#endif
35  AbstractItemDelegateSize/form.ui
... ...
@@ -0,0 +1,35 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<ui version="4.0">
  3
+ <class>Form</class>
  4
+ <widget class="QWidget" name="Form">
  5
+  <property name="geometry">
  6
+   <rect>
  7
+    <x>0</x>
  8
+    <y>0</y>
  9
+    <width>400</width>
  10
+    <height>300</height>
  11
+   </rect>
  12
+  </property>
  13
+  <property name="windowTitle">
  14
+   <string>Form</string>
  15
+  </property>
  16
+  <layout class="QGridLayout" name="gridLayout">
  17
+   <item row="0" column="0">
  18
+    <widget class="QTableView" name="tableView">
  19
+     <attribute name="horizontalHeaderStretchLastSection">
  20
+      <bool>false</bool>
  21
+     </attribute>
  22
+    </widget>
  23
+   </item>
  24
+   <item row="1" column="0">
  25
+    <widget class="QPushButton" name="btnUpdate">
  26
+     <property name="text">
  27
+      <string>Update</string>
  28
+     </property>
  29
+    </widget>
  30
+   </item>
  31
+  </layout>
  32
+ </widget>
  33
+ <resources/>
  34
+ <connections/>
  35
+</ui>
12  AbstractItemDelegateSize/main.cpp
... ...
@@ -0,0 +1,12 @@
  1
+#include <QApplication>
  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
+}
12  AutoConnect/AutoConnect.cpp
... ...
@@ -0,0 +1,12 @@
  1
+#include <QApplication>
  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
+}
15  AutoConnect/CMakeLists.txt
... ...
@@ -0,0 +1,15 @@
  1
+cmake_minimum_required(VERSION 2.6)
  2
+
  3
+PROJECT(AutoConnect)
  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(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
  12
+
  13
+ADD_EXECUTABLE(AutoConnect AutoConnect.cpp form.h form.cpp ${MOCSrcs} ${UISrcs})
  14
+TARGET_LINK_LIBRARIES(AutoConnect ${QT_LIBRARIES})
  15
+
14  AutoConnect/form.cpp
... ...
@@ -0,0 +1,14 @@
  1
+#include <QtGui>
  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
+}
18  AutoConnect/form.h
... ...
@@ -0,0 +1,18 @@
  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
55  AutoConnect/form.ui
... ...
@@ -0,0 +1,55 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<ui version="4.0">
  3
+ <class>Form</class>
  4
+ <widget class="QWidget" name="Form">
  5
+  <property name="geometry">
  6
+   <rect>
  7
+    <x>0</x>
  8
+    <y>0</y>
  9
+    <width>400</width>
  10
+    <height>300</height>
  11
+   </rect>
  12
+  </property>
  13
+  <property name="windowTitle">
  14
+   <string>Form</string>
  15
+  </property>
  16
+  <widget class="QPushButton" name="pushButton">
  17
+   <property name="geometry">
  18
+    <rect>
  19
+     <x>80</x>
  20
+     <y>120</y>
  21
+     <width>91</width>
  22
+     <height>28</height>
  23
+    </rect>
  24
+   </property>
  25
+   <property name="text">
  26
+    <string>PushButton</string>
  27
+   </property>
  28
+  </widget>
  29
+  <widget class="QLabel" name="label">
  30
+   <property name="geometry">
  31
+    <rect>
  32
+     <x>170</x>
  33
+     <y>220</y>
  34
+     <width>61</width>
  35
+     <height>18</height>
  36
+    </rect>
  37
+   </property>
  38
+   <property name="text">
  39
+    <string>TextLabel</string>
  40
+   </property>
  41
+  </widget>
  42
+  <widget class="QTextEdit" name="textEdit">
  43
+   <property name="geometry">
  44
+    <rect>
  45
+     <x>250</x>
  46
+     <y>30</y>
  47
+     <width>104</width>
  48
+     <height>78</height>
  49
+    </rect>
  50
+   </property>
  51
+  </widget>
  52
+ </widget>
  53
+ <resources/>
  54
+ <connections/>
  55
+</ui>
17  Boost/CMakeLists.txt
... ...
@@ -0,0 +1,17 @@
  1
+cmake_minimum_required(VERSION 2.6)
  2
+
  3
+PROJECT(Boost)
  4
+
  5
+FIND_PACKAGE(Qt4 REQUIRED)
  6
+INCLUDE(${QT_USE_FILE})
  7
+
  8
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_KEYWORDS")
  9
+
  10
+QT4_WRAP_UI(UISrcs form.ui)
  11
+QT4_WRAP_CPP(MOCSrcs form.h)
  12
+
  13
+include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
  14
+
  15
+ADD_EXECUTABLE(Boost main.cpp form.cpp ${MOCSrcs} ${UISrcs})
  16
+TARGET_LINK_LIBRARIES(Boost ${QT_LIBRARIES})
  17
+
14  Boost/form.cpp
... ...
@@ -0,0 +1,14 @@
  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
+}
16  Boost/form.h
... ...
@@ -0,0 +1,16 @@
  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
45  Boost/form.ui
... ...
@@ -0,0 +1,45 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<ui version="4.0">
  3
+ <class>Form</class>
  4
+ <widget class="QWidget" name="Form">
  5
+  <property name="geometry">
  6
+   <rect>
  7
+    <x>0</x>
  8
+    <y>0</y>
  9
+    <width>400</width>
  10
+    <height>300</height>
  11
+   </rect>
  12
+  </property>
  13
+  <property name="windowTitle">
  14
+   <string>My Program</string>
  15
+  </property>
  16
+  <widget class="QPushButton" name="pushButton">
  17
+   <property name="geometry">
  18
+    <rect>
  19
+     <x>130</x>
  20
+     <y>100</y>
  21
+     <width>91</width>
  22
+     <height>28</height>
  23
+    </rect>
  24
+   </property>
  25
+   <property name="text">
  26
+    <string>Click me</string>
  27
+   </property>
  28
+  </widget>
  29
+  <widget class="QLabel" name="label">
  30
+   <property name="geometry">
  31
+    <rect>
  32
+     <x>150</x>
  33
+     <y>150</y>
  34
+     <width>61</width>
  35
+     <height>18</height>
  36
+    </rect>
  37
+   </property>
  38
+   <property name="text">
  39
+    <string>Before click</string>
  40
+   </property>
  41
+  </widget>
  42
+ </widget>
  43
+ <resources/>
  44
+ <connections/>
  45
+</ui>
24  Boost/main.cpp
... ...
@@ -0,0 +1,24 @@
  1
+#include <QApplication>
  2
+#include <iostream>
  3
+
  4
+#include "form.h"
  5
+
  6
+#include <boost/signals2/signal.hpp>
  7
+
  8
+void func()
  9
+{
  10
+  std::cout << "Hello, world!" << std::endl;
  11
+}
  12
+
  13
+int main(int argc, char *argv[])
  14
+{
  15
+  QApplication app(argc, argv);
  16
+  MyForm form;
  17
+
  18
+  form.show();
  19
+
  20
+  boost::signals2::signal<void ()> s;
  21
+  s.connect(func);
  22
+
  23
+  return app.exec();
  24
+}
15  ButtonBox/CMakeLists.txt
... ...
@@ -0,0 +1,15 @@
  1
+cmake_minimum_required(VERSION 2.6)
  2
+
  3
+PROJECT(ButtonBox)
  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(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
  12
+
  13
+ADD_EXECUTABLE(ButtonBox main.cpp form.cpp ${MOCSrcs} ${UISrcs})
  14
+TARGET_LINK_LIBRARIES(ButtonBox ${QT_LIBRARIES})
  15
+
18  ButtonBox/form.cpp
... ...
@@ -0,0 +1,18 @@
  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  ButtonBox/form.h
... ...
@@ -0,0 +1,19 @@
  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
45  ButtonBox/form.ui
... ...
@@ -0,0 +1,45 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<ui version="4.0">
  3
+ <class>Form</class>
  4
+ <widget class="QWidget" name="Form">
  5
+  <property name="geometry">
  6
+   <rect>
  7
+    <x>0</x>
  8
+    <y>0</y>
  9
+    <width>400</width>
  10
+    <height>300</height>
  11
+   </rect>
  12
+  </property>
  13
+  <property name="windowTitle">
  14
+   <string>My Program</string>
  15
+  </property>
  16
+  <widget class="QLabel" name="label">
  17
+   <property name="geometry">
  18
+    <rect>
  19
+     <x>120</x>
  20
+     <y>220</y>
  21
+     <width>141</width>
  22
+     <height>18</height>
  23
+    </rect>
  24
+   </property>
  25
+   <property name="text">
  26
+    <string>Before click</string>
  27
+   </property>
  28
+  </widget>
  29
+  <widget class="QDialogButtonBox" name="buttonBox">
  30
+   <property name="geometry">
  31
+    <rect>
  32
+     <x>110</x>
  33
+     <y>120</y>
  34
+     <width>176</width>
  35
+     <height>27</height>
  36
+    </rect>
  37
+   </property>
  38
+   <property name="standardButtons">
  39
+    <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
  40
+   </property>
  41
+  </widget>
  42
+ </widget>
  43
+ <resources/>
  44
+ <connections/>
  45
+</ui>
12  ButtonBox/main.cpp
... ...
@@ -0,0 +1,12 @@
  1
+#include <QApplication>
  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
+}
15  ButtonWidget/CMakeLists.txt
... ...
@@ -0,0 +1,15 @@
  1
+cmake_minimum_required(VERSION 2.6)
  2
+
  3
+PROJECT(ButtonWidget)
  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(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
  12
+
  13
+ADD_EXECUTABLE(ButtonWidget main.cpp form.h form.cpp ${MOCSrcs} ${UISrcs})
  14
+TARGET_LINK_LIBRARIES(ButtonWidget ${QT_LIBRARIES})
  15
+
13  ButtonWidget/form.cpp
... ...
@@ -0,0 +1,13 @@
  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
+}
16  ButtonWidget/form.h
... ...
@@ -0,0 +1,16 @@
  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
45  ButtonWidget/form.ui
... ...
@@ -0,0 +1,45 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<ui version="4.0">
  3
+ <class>Form</class>
  4
+ <widget class="QWidget" name="Form">
  5
+  <property name="geometry">
  6
+   <rect>
  7
+    <x>0</x>
  8
+    <y>0</y>
  9
+    <width>400</width>
  10
+    <height>300</height>
  11
+   </rect>
  12
+  </property>
  13
+  <property name="windowTitle">
  14
+   <string>My Program</string>
  15
+  </property>
  16
+  <widget class="QPushButton" name="pushButton">
  17
+   <property name="geometry">
  18
+    <rect>
  19
+     <x>130</x>
  20
+     <y>100</y>
  21
+     <width>91</width>
  22
+     <height>28</height>
  23
+    </rect>
  24
+   </property>
  25
+   <property name="text">
  26
+    <string>Click me</string>
  27
+   </property>
  28
+  </widget>
  29
+  <widget class="QLabel" name="label">
  30
+   <property name="geometry">
  31
+    <rect>
  32
+     <x>150</x>
  33
+     <y>150</y>
  34
+     <width>61</width>
  35
+     <height>18</height>
  36
+    </rect>
  37
+   </property>
  38
+   <property name="text">
  39
+    <string>Before click</string>
  40
+   </property>
  41
+  </widget>
  42
+ </widget>
  43
+ <resources/>
  44
+ <connections/>
  45
+</ui>
12  ButtonWidget/main.cpp
... ...
@@ -0,0 +1,12 @@
  1
+#include <QApplication>
  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
+}
15  Calculator/CMakeLists.txt
... ...
@@ -0,0 +1,15 @@
  1
+cmake_minimum_required(VERSION 2.6)
  2
+
  3
+PROJECT(Calculator)
  4
+
  5
+FIND_PACKAGE(Qt4 REQUIRED)
  6
+INCLUDE(${QT_USE_FILE})
  7
+
  8
+QT4_WRAP_UI(UISrcs calculatorform.ui)
  9
+QT4_WRAP_CPP(MOCSrcs calculatorform.h)
  10
+
  11
+include_directories(${include_directories} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
  12
+
  13
+ADD_EXECUTABLE(Calculator main.cpp calculatorform.h calculatorform.cpp ${MOCSrcs} ${UISrcs})
  14
+TARGET_LINK_LIBRARIES(Calculator ${QT_LIBRARIES})
  15
+
BIN  Calculator/Calculator.kdevelop.pcs
Binary file not shown
323  Calculator/Doxyfile
... ...
@@ -0,0 +1,323 @@
  1
+# Doxyfile 1.5.7.1-KDevelop
  2
+
  3
+#---------------------------------------------------------------------------
  4
+# Project related configuration options
  5
+#---------------------------------------------------------------------------
  6
+DOXYFILE_ENCODING      = UTF-8
  7
+PROJECT_NAME           = Calculator
  8
+PROJECT_NUMBER         = $VERSION$
  9
+OUTPUT_DIRECTORY       = 
  10
+CREATE_SUBDIRS         = NO
  11
+OUTPUT_LANGUAGE        = English
  12
+BRIEF_MEMBER_DESC      = YES
  13
+REPEAT_BRIEF           = YES
  14
+ABBREVIATE_BRIEF       = "The $name class" \
  15
+                         "The $name widget" \
  16
+                         "The $name file" \
  17
+                         is \
  18
+                         provides \
  19
+                         specifies \
  20
+                         contains \
  21
+                         represents \
  22
+                         a \
  23
+                         an \
  24
+                         the
  25
+ALWAYS_DETAILED_SEC    = NO
  26
+INLINE_INHERITED_MEMB  = NO
  27
+FULL_PATH_NAMES        = YES
  28
+STRIP_FROM_PATH        = /home/doriad/
  29
+STRIP_FROM_INC_PATH    =