diff options
author | Norwegian Rock Cat <qt-info@nokia.com> | 2009-05-15 16:27:34 +0200 |
---|---|---|
committer | Norwegian Rock Cat <qt-info@nokia.com> | 2009-05-15 16:27:34 +0200 |
commit | 06dba5e913def3b5f0fc77b9c11ba3a59c786617 (patch) | |
tree | 7a94aac334da324f7a3921614a70a399ac1f2dcf /src | |
parent | 25213744d532257fdf20dddd91bfadb272c066a5 (diff) |
update sizepolicy and sizehint
Diffstat (limited to 'src')
-rw-r--r-- | src/qtsegmentcontrol.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qtsegmentcontrol.cpp b/src/qtsegmentcontrol.cpp index fd28fa8..0ec9257 100644 --- a/src/qtsegmentcontrol.cpp +++ b/src/qtsegmentcontrol.cpp @@ -113,6 +113,7 @@ static QSize segmentSizeFromContents(const QStyleOption *option, const QSize &co if (const QtStyleOptionSegmentControlSegment *segment = static_cast<const QtStyleOptionSegmentControlSegment *>(option)) { ret.rwidth() += 20; + ret.rheight() += 10; if (!segment->icon.isNull()) ret.rwidth() += 5; } @@ -163,6 +164,9 @@ void QtSegmentControlPrivate::postUpdate(int /*index*/, bool geoToo) QtSegmentControl::QtSegmentControl(QWidget *parent) : QWidget(parent), d(new QtSegmentControlPrivate(this)) { + setFocusPolicy(Qt::TabFocus); + setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + setAttribute(Qt::WA_WState_OwnSizePolicy, false); } QtSegmentControl::~QtSegmentControl() @@ -344,7 +348,7 @@ QSize QtSegmentControl::sizeHint() const QRect rect; const int segmentCount = d->segments.count(); for (int i = 0; i < segmentCount; ++i) { - rect.unite(segmentRect(i)); + rect = rect.united(segmentRect(i)); } return rect.size(); } |