summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qsplitter.cpp
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-03-30 11:28:02 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2010-03-30 11:28:02 (GMT)
commit753ce0f7a2f16dd0303f6ad5493e9ce6bfc13fd7 (patch)
treefc1467525883912cc603174cbb55174d9201e4da /src/gui/widgets/qsplitter.cpp
parent9181ba917aa4f842e5c3e8febebe363f4dc11c6f (diff)
parent3ac354b885dcaf7186cf8bafdfc2bdc0c6d8dbd0 (diff)
downloadQt-753ce0f7a2f16dd0303f6ad5493e9ce6bfc13fd7.zip
Qt-753ce0f7a2f16dd0303f6ad5493e9ce6bfc13fd7.tar.gz
Qt-753ce0f7a2f16dd0303f6ad5493e9ce6bfc13fd7.tar.bz2
Merge remote branch 'qt/4.7' into 4.7
Conflicts: tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir
Diffstat (limited to 'src/gui/widgets/qsplitter.cpp')
-rw-r--r--src/gui/widgets/qsplitter.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/gui/widgets/qsplitter.cpp b/src/gui/widgets/qsplitter.cpp
index 597b28b..88b7517 100644
--- a/src/gui/widgets/qsplitter.cpp
+++ b/src/gui/widgets/qsplitter.cpp
@@ -227,6 +227,33 @@ QSize QSplitterHandle::sizeHint() const
/*!
\reimp
*/
+void QSplitterHandle::resizeEvent(QResizeEvent *event)
+{
+ Q_D(const QSplitterHandle);
+
+ // When splitters are only 1 pixel large we increase the
+ // actual grab area to five pixels
+
+ // Note that QSplitter uses contentsRect for layouting
+ // and ensures that handles are drawn on top of widgets
+ // We simply use the contents margins for draggin and only
+ // paint the mask area
+ bool useTinyMode = (d->s->handleWidth() == 1);
+ setAttribute(Qt::WA_MouseNoMask, useTinyMode);
+ if (useTinyMode) {
+ if (orientation() == Qt::Horizontal)
+ setContentsMargins(2, 0, 2, 0);
+ else
+ setContentsMargins(0, 2, 0, 2);
+ setMask(QRegion(contentsRect()));
+ }
+
+ QWidget::resizeEvent(event);
+}
+
+/*!
+ \reimp
+*/
bool QSplitterHandle::event(QEvent *event)
{
Q_D(QSplitterHandle);
@@ -301,7 +328,7 @@ void QSplitterHandle::paintEvent(QPaintEvent *)
Q_D(QSplitterHandle);
QPainter p(this);
QStyleOption opt(0);
- opt.rect = rect();
+ opt.rect = contentsRect();
opt.palette = palette();
if (orientation() == Qt::Horizontal)
opt.state = QStyle::State_Horizontal;
@@ -1662,6 +1689,9 @@ void QSplitter::setSizes(const QList<int> &list)
By default, this property contains a value that depends on the user's platform
and style preferences.
+
+ If you set handleWidth to 1, the actual grab area will grow to overlap a
+ few pixels of it's respective widgets.
*/
int QSplitter::handleWidth() const