4#pragma warning(disable : 4800)
5#pragma warning(disable : 4251)
6#pragma warning(disable : 4244)
10#include "../../global.hpp"
11#include "../../genapi/value_node.hpp"
12#include "../../genapi/boolean_node.hpp"
13#include "detail_property.hpp"
25 class BooleanProperty :
public Private::Property
31 BooleanProperty(
const ValueNodePtr &node, Property *parent)
32 : Property(node, PT_Boolean, parent)
36 QWidget *CreateEditor(QWidget *)
override
41 bool SetEditorData(QWidget *editor,
const QVariant &data)
override
43 if (
auto cb = qobject_cast<QCheckBox *>(editor))
45 bool value = data.toBool();
46 cb->setChecked(value);
52 QVariant EditorData(QWidget *editor)
override
54 if (
auto cb = qobject_cast<QCheckBox *>(editor))
56 return QVariant(cb->isChecked());
64 QVariant Value(
int column,
int role = Qt::UserRole)
override
68 case Qt::CheckStateRole:
70 auto boolNode = std::dynamic_pointer_cast<BooleanNode>(Node());
71 if (boolNode && boolNode->IsAvailable())
73 if (boolNode->Value())
82 return Data(column, role);
84 auto boolNode = std::dynamic_pointer_cast<BooleanNode>(Node());
85 if (boolNode && boolNode->IsAvailable())
89 return QVariant::fromValue(boolNode->Value());
91 catch (
const CvbException &e)
103 void SetValue(
const QVariant &value)
override
105 auto boolNode = std::dynamic_pointer_cast<BooleanNode>(Node());
110 boolNode->SetValue(value.toBool());
112 catch (
const CvbException &)
119 QString HtmlDescription()
override
const int CVB_TIMEOUT
Timeout in function.
Definition exception.hpp:29
std::shared_ptr< ValueNode > ValueNodePtr
Convenience shared pointer for ValueNode.
Definition genapi.hpp:91
Namespace for user interface components.
Definition decl_image_scene.hpp:39
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17