CWidgetUpdateBlocker.h
Go to the documentation of this file.
1 #ifndef iwidgets_CWidgetUpdateBlocker_included
2 #define iwidgets_CWidgetUpdateBlocker_included
3 
4 
5 // Qt includes
6 #include <QtCore/QtGlobal>
7 #if QT_VERSION >= 0x050000
8 #include <QtWidgets/QWidget>
9 #else
10 #include <QtGui/QWidget>
11 #endif
12 
13 
14 namespace iwidgets
15 {
16 
17 
22 {
23 public:
24  explicit CWidgetUpdateBlocker(QWidget* widgetPtr);
26 
27 private:
28  QWidget* m_widgetPtr;
29 };
30 
31 
32 // inline methods
33 
35  :m_widgetPtr(widgetPtr)
36 {
37  Q_ASSERT(widgetPtr != NULL);
38 
39  m_widgetPtr->setUpdatesEnabled(false);
40 }
41 
42 
44 {
45  m_widgetPtr->setUpdatesEnabled(true);
46 }
47 
48 
49 } // namespace iwidgets
50 
51 
52 #endif // !iwidgets_CWidgetUpdateBlocker_included
53 
54 
CWidgetUpdateBlocker(QWidget *widgetPtr)
Help class used to block widget update till it is destructed.
#define NULL
Definition: istd.h:64

© 2007-2017 Witold Gantzke and Kirill Lepskiy