refactoring qad widgets part 2
c++ cast, nullptr, forward declaration, agregate ui, connect to member functions, order and clear includes
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
#include "propertyeditor.h"
|
||||
#include "colorbutton.h"
|
||||
#include "qpointedit.h"
|
||||
#include "qrectedit.h"
|
||||
#include "clineedit.h"
|
||||
#include <QPainter>
|
||||
#include <QCheckBox>
|
||||
#include <QSpinBox>
|
||||
#include <QApplication>
|
||||
|
||||
|
||||
QWidget * Delegate::widgetForProperty(QWidget * parent, const QModelIndex & index) const {
|
||||
@@ -10,7 +17,6 @@ QWidget * Delegate::widgetForProperty(QWidget * parent, const QModelIndex & inde
|
||||
if (index.data(Qt::UserRole + 1).toString() == "__flag") {
|
||||
qulonglong key = index.data(Qt::UserRole).toULongLong();
|
||||
value = index.parent().data(Qt::UserRole);
|
||||
//QMetaProperty prop = index.parent().data(Qt::UserRole + 1).value<QMetaProperty>();
|
||||
w = new QCheckBox(parent); type = 14; ((QCheckBox*)w)->setChecked(((value.toULongLong() & key) == key && key != 0) || (value.toULongLong() == 0 && key == 0));
|
||||
((QCheckBox*)w)->setText("0x" + QString::number(key, 16).toUpper());
|
||||
connect((QCheckBox*)w, SIGNAL(clicked(bool)), this, SLOT(changedFlag()));
|
||||
|
||||
Reference in New Issue
Block a user