diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-16 12:33:27 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-16 12:33:27 -0300 |
commit | f9b4c6b889e2444533af1baabdee3687020c1e7b (patch) | |
tree | bb4ebc2d6d5b14ae6042c060f91dbca18fc0a1d0 /qt-ui/modeldelegates.cpp | |
parent | 349a084496b694b4760f32bdf4d7b8caf2e8b3af (diff) | |
download | subsurface-f9b4c6b889e2444533af1baabdee3687020c1e7b.tar.gz |
Better handling of default sizes on the Cylinder and Weight widgets
Better handling of default sizes on the Cylinder and weight widgets,
the weigth widget didn't had a CSS applied so it looked odd compared
to the cylinder one, also the default behavior for the combobox delegate
didn't worked very well with the css applied, being too small.
this patch fixes that.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/modeldelegates.cpp')
-rw-r--r-- | qt-ui/modeldelegates.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index d201337b4..01f5197ce 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -76,6 +76,17 @@ QWidget* ComboBoxDelegate::createEditor(QWidget* parent, const QStyleOptionViewI return comboDelegate; } +void ComboBoxDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + QRect defaultRect = option.rect; + defaultRect.setX( defaultRect.x() -1); + defaultRect.setY( defaultRect.y() -1); + defaultRect.setWidth( defaultRect.width() + 2); + defaultRect.setHeight( defaultRect.height() + 2); + editor->setGeometry(defaultRect); +} + + void TankInfoDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& thisindex) const { QComboBox *c = qobject_cast<QComboBox*>(editor); |