ICF 3.1.1.10
Technical documentation of ICF Libraries
CWidgetUpdateBlocker.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef iwidgets_CWidgetUpdateBlocker_included
7#define iwidgets_CWidgetUpdateBlocker_included
8
9
10// Qt includes
11#include <QtCore/QtGlobal>
12#include <QtWidgets/QWidget>
13
14
15namespace iwidgets
16{
17
18
22class [[maybe_unused]] CWidgetUpdateBlocker
23{
24public:
25 explicit CWidgetUpdateBlocker(QWidget* widgetPtr);
27
28private:
29 QWidget* m_widgetPtr;
30};
31
32
33// inline methods
34
36: m_widgetPtr(widgetPtr)
37{
38 Q_ASSERT(widgetPtr != nullptr);
39
40 m_widgetPtr->setUpdatesEnabled(false);
41}
42
43
45{
46 m_widgetPtr->setUpdatesEnabled(true);
47}
48
49
50} // namespace iwidgets
51
52
53#endif // !iwidgets_CWidgetUpdateBlocker_included
54
55
Help class used to block widget update till it is destructed.
Namespace contains implementation of Qt widget extensions.

© Witold Gantzke and Kirill Lepskiy