Changeset 561 for trunk/src/gui/widgets/qsplitter.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/widgets/qsplitter.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 120 120 Q_D(QSplitterHandle); 121 121 d->s = parent; 122 d->hover = false;123 122 setOrientation(orientation); 124 123 } … … 270 269 { 271 270 Q_D(QSplitterHandle); 272 if (e->button() == Qt::LeftButton) 271 if (e->button() == Qt::LeftButton) { 273 272 d->mouseOffset = d->pick(e->pos()); 273 d->pressed = true; 274 update(); 275 } 274 276 } 275 277 … … 285 287 d->s->setRubberBand(-1); 286 288 moveSplitter(pos); 289 } 290 if (e->button() == Qt::LeftButton) { 291 d->pressed = false; 292 update(); 287 293 } 288 294 } … … 304 310 if (d->hover) 305 311 opt.state |= QStyle::State_MouseOver; 312 if (d->pressed) 313 opt.state |= QStyle::State_Sunken; 306 314 if (isEnabled()) 307 315 opt.state |= QStyle::State_Enabled; … … 353 361 */ 354 362 bool first = true; 363 bool allInvisible = n != 0; 355 364 for (int i = 0; i < n ; ++i) { 356 365 QSplitterLayoutStruct *s = list.at(i); 357 s->handle->setHidden(first || s->widget->isHidden()); 358 if (!s->widget->isHidden()) 366 bool widgetHidden = s->widget->isHidden(); 367 if (allInvisible && !widgetHidden && !s->collapsed) 368 allInvisible = false; 369 s->handle->setHidden(first || widgetHidden); 370 if (!widgetHidden) 359 371 first = false; 360 372 } 373 374 if (allInvisible) 375 for (int i = 0; i < n ; ++i) { 376 QSplitterLayoutStruct *s = list.at(i); 377 if (!s->widget->isHidden()) { 378 s->collapsed = false; 379 break; 380 } 381 } 361 382 362 383 int fi = 2 * q->frameWidth(); … … 390 411 391 412 if (empty) { 392 if (qobject_cast<QSplitter *>( q->parentWidget())) {413 if (qobject_cast<QSplitter *>(parent)) { 393 414 // nested splitters; be nice 394 415 maxl = maxt = 0; … … 924 945 925 946 \ingroup organizers 926 \mainclass 947 927 948 928 949 A splitter lets the user control the size of child widgets by dragging the … … 1518 1539 /*! 1519 1540 \fn int QSplitter::margin() const 1520 Returns the wi th of thethe margin around the contents of the widget.1541 Returns the width of the margin around the contents of the widget. 1521 1542 1522 1543 Use QWidget::getContentsMargins() instead.
Note:
See TracChangeset
for help on using the changeset viewer.