git-svn-id: svn://db.shs.com.ru/libs@46 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-11-24 14:45:54 +00:00
parent 48addec20f
commit 2ace72ff47
20 changed files with 216 additions and 167 deletions

View File

@@ -12,7 +12,7 @@ QWidget * Delegate::widgetForProperty(QWidget * parent, const QModelIndex & inde
//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(toggled(bool)), this, SLOT(changedFlag()));
connect((QCheckBox*)w, SIGNAL(clicked(bool)), this, SLOT(changedFlag()));
//qDebug() << prop.enumerator().name();
} else {
if (value.canConvert<PropertyValuePair>()) {
@@ -273,6 +273,7 @@ void Delegate::changedFlag() {
PropertyEditor::PropertyEditor(QWidget * parent): QTreeWidget(parent) {
object = 0;
active_ = false;
configTree();
connect(this, SIGNAL(itemClicked(QTreeWidgetItem * , int)), this, SLOT(itemClicked(QTreeWidgetItem * , int)));
connect(this, SIGNAL(itemChanged(QTreeWidgetItem * , int)), this, SLOT(itemChanged(QTreeWidgetItem * , int)));
@@ -319,6 +320,7 @@ void PropertyEditor::itemClicked(QTreeWidgetItem * item, int column) {
void PropertyEditor::itemChanged(QTreeWidgetItem * item, int column) {
if (!active_) return;
if (column != 1) return;
QVariant value = item->data(1, Qt::UserRole);
if (value.canConvert<PropertyValuePair>()) {
@@ -332,6 +334,7 @@ void PropertyEditor::rebuild() {
clear();
configTree();
if (object == 0) return;
active_ = false;
const QMetaObject * mo = object->metaObject();
QList<const QMetaObject * > mol;
while (mo != 0) {
@@ -396,6 +399,7 @@ void PropertyEditor::rebuild() {
chue += 60;
chue %= 360;
}
active_ = true;
}