CustomWidget.cpp
Go to the documentation of this file.
1#include "CustomWidget.h"
2
4
5namespace armarx
6{
8 {
9 // connect to general QTreeWidgetItem callback.
10 // This also lets the conversion start for other objects. (Not just this widget)
11 ARMARX_CHECK(connect(this,
12 SIGNAL(elemChanged(QTreeWidgetItem*, int)),
13 overlayingItem->treeWidget(),
14 SIGNAL(itemChanged(QTreeWidgetItem*, int))));
15 }
16
19 {
20 return dynamic_cast<CustomWidget*>(elem);
21 }
22
25 {
26 if (!elem)
27 {
28 return nullptr;
29 }
30 auto* casted = DynamicCast(elem);
32 return casted;
33 }
34
35 void
37 {
38 QObject::blockSignals(doSupress);
39 }
40
41
42} // namespace armarx
void elemChanged(QTreeWidgetItem *elem, int col)
virtual void setSupressSignals(bool doSupress)
static CustomWidget * DynamicCastAndCheck(QWidget *)
QTreeWidgetItem * overlayingItem
CustomWidget(QTreeWidgetItem *overlayingItem)
static CustomWidget * DynamicCast(QWidget *)
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
This file offers overloads of toIce() and fromIce() functions for STL container types.