Changeset 11078
- Timestamp:
- Jul 31, 2010, 6:55:26 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt/filterbar.cc
r11073 r11078 11 11 */ 12 12 13 #include <iostream>14 15 13 #include <QString> 16 14 #include <QtGui> … … 39 37 }; 40 38 39 namespace 40 { 41 int getHSpacing( QWidget * w ) 42 { 43 return qMax( 4, w->style()->pixelMetric( QStyle::PM_LayoutHorizontalSpacing, 0, w ) ); 44 } 45 } 46 41 47 FilterBarComboBoxDelegate :: FilterBarComboBoxDelegate( QObject * parent, QComboBox * combo ): 42 48 QItemDelegate( parent ), … … 81 87 QRect boundingBox = option.rect; 82 88 83 const int hmargin = myCombo->style()->pixelMetric( QStyle::PM_LayoutHorizontalSpacing, 0,myCombo );89 const int hmargin = getHSpacing( myCombo ); 84 90 boundingBox.setLeft( boundingBox.left() + hmargin ); 85 91 boundingBox.setRight( boundingBox.right() - hmargin ); … … 122 128 { 123 129 QStyle * s = myCombo->style( ); 124 const int hmargin = s->pixelMetric( QStyle::PM_LayoutHorizontalSpacing, 0, myCombo ); 125 130 const int hmargin = getHSpacing( myCombo ); 126 131 127 132 QSize size = QItemDelegate::sizeHint( option, index ); … … 162 167 QStyle * s = style(); 163 168 QRect rect = s->subControlRect( QStyle::CC_ComboBox, &opt, QStyle::SC_ComboBoxEditField, this ); 164 const int hmargin = s->pixelMetric( QStyle::PM_LayoutHorizontalSpacing, 0,this );169 const int hmargin = getHSpacing( this ); 165 170 rect.setRight( rect.right() - hmargin ); 166 171
Note: See TracChangeset
for help on using the changeset viewer.