Fixed combo boxes in the property view resizing when you modify them and screwing up vertical alignment

This commit is contained in:
parax0 2016-03-21 17:07:11 -06:00
parent 87bf3dbfcc
commit 220c54004f
2 changed files with 3 additions and 1 deletions

View File

@ -190,6 +190,8 @@ QWidget* CPropertyDelegate::createEditor(QWidget *pParent, const QStyleOptionVie
if (pOut) if (pOut)
{ {
pOut->setFocusPolicy(Qt::StrongFocus); pOut->setFocusPolicy(Qt::StrongFocus);
QSize Size = mpModel->data(rkIndex, Qt::SizeHintRole).toSize();
pOut->setFixedHeight(Size.height());
} }
return pOut; return pOut;

View File

@ -21,7 +21,7 @@ public:
void SetPropertyModel(CPropertyModel *pModel); void SetPropertyModel(CPropertyModel *pModel);
void SetEditor(CWorldEditor *pEditor); 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 setEditorData(QWidget *pEditor, const QModelIndex &rkIndex) const;
virtual void setModelData(QWidget *pEditor, QAbstractItemModel *pModel, const QModelIndex &rkIndex) const; virtual void setModelData(QWidget *pEditor, QAbstractItemModel *pModel, const QModelIndex &rkIndex) const;
bool eventFilter(QObject *pObject, QEvent *pEvent); bool eventFilter(QObject *pObject, QEvent *pEvent);