Now QSplitter can have 0-pixel handle

Change-Id: Iad920ffcd5d7f4c01504d41d1740f130b7aa53dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
This commit is contained in:
ABBAPOH 2012-02-25 23:52:09 +04:00 committed by Qt by Nokia
parent 73b24486ed
commit 5cb2fbe088
2 changed files with 5 additions and 5 deletions

View File

@ -232,14 +232,14 @@ void QSplitterHandle::resizeEvent(QResizeEvent *event)
{
Q_D(const QSplitterHandle);
// When splitters are only 1 pixel large we increase the
// When splitters are only 1 or 0 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);
bool useTinyMode = (d->s->handleWidth() <= 1);
setAttribute(Qt::WA_MouseNoMask, useTinyMode);
if (useTinyMode) {
if (orientation() == Qt::Horizontal)
@ -1528,14 +1528,14 @@ 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
If you set handleWidth to 1 or 0, the actual grab area will grow to overlap a
few pixels of it's respective widgets.
*/
int QSplitter::handleWidth() const
{
Q_D(const QSplitter);
if (d->handleWidth > 0) {
if (d->handleWidth >= 0) {
return d->handleWidth;
} else {
return style()->pixelMetric(QStyle::PM_SplitterWidth, 0, this);

View File

@ -83,7 +83,7 @@ class QSplitterPrivate : public QFramePrivate
Q_DECLARE_PUBLIC(QSplitter)
public:
QSplitterPrivate() : rubberBand(0), opaque(true), firstShow(true),
childrenCollapsible(true), compatMode(false), handleWidth(0), blockChildAdd(false) {}
childrenCollapsible(true), compatMode(false), handleWidth(-1), blockChildAdd(false) {}
QPointer<QRubberBand> rubberBand;
mutable QList<QSplitterLayoutStruct *> list;