From 220c54004f9e8cbc4219605db6b02e306637a2bb Mon Sep 17 00:00:00 2001 From: parax0 Date: Mon, 21 Mar 2016 17:07:11 -0600 Subject: [PATCH] Fixed combo boxes in the property view resizing when you modify them and screwing up vertical alignment --- src/Editor/PropertyEdit/CPropertyDelegate.cpp | 2 ++ src/Editor/PropertyEdit/CPropertyDelegate.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Editor/PropertyEdit/CPropertyDelegate.cpp b/src/Editor/PropertyEdit/CPropertyDelegate.cpp index 9fd5860f..7723aa4c 100644 --- a/src/Editor/PropertyEdit/CPropertyDelegate.cpp +++ b/src/Editor/PropertyEdit/CPropertyDelegate.cpp @@ -190,6 +190,8 @@ QWidget* CPropertyDelegate::createEditor(QWidget *pParent, const QStyleOptionVie if (pOut) { pOut->setFocusPolicy(Qt::StrongFocus); + QSize Size = mpModel->data(rkIndex, Qt::SizeHintRole).toSize(); + pOut->setFixedHeight(Size.height()); } return pOut; diff --git a/src/Editor/PropertyEdit/CPropertyDelegate.h b/src/Editor/PropertyEdit/CPropertyDelegate.h index e0dc9e45..8336bb2e 100644 --- a/src/Editor/PropertyEdit/CPropertyDelegate.h +++ b/src/Editor/PropertyEdit/CPropertyDelegate.h @@ -21,7 +21,7 @@ public: void SetPropertyModel(CPropertyModel *pModel); void SetEditor(CWorldEditor *pEditor); - virtual QWidget* createEditor(QWidget *pParent, const QStyleOptionViewItem& rkOption, const QModelIndex &rkIndex) const; + virtual QWidget* createEditor(QWidget *pParent, const QStyleOptionViewItem& rkOption, const QModelIndex& rkIndex) const; virtual void setEditorData(QWidget *pEditor, const QModelIndex &rkIndex) const; virtual void setModelData(QWidget *pEditor, QAbstractItemModel *pModel, const QModelIndex &rkIndex) const; bool eventFilter(QObject *pObject, QEvent *pEvent);