Changeset 846 for trunk/src/gui/graphicsview/qgraphicswidget.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/graphicsview/qgraphicswidget.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 325 325 326 326 /*! 327 \fn QGraphicsWidget::geometryChanged() 328 329 This signal gets emitted whenever the geometry is changed in setGeometry(). 330 */ 331 332 /*! 327 333 \property QGraphicsWidget::geometry 328 334 \brief the geometry of the widget … … 380 386 //set the new pos 381 387 d->geom.moveTopLeft(pos()); 388 emit geometryChanged(); 382 389 return; 383 390 } … … 385 392 QSizeF oldSize = size(); 386 393 QGraphicsLayoutItem::setGeometry(newGeom); 387 388 394 // Send resize event 389 395 bool resized = newGeom.size() != oldSize; … … 392 398 re.setOldSize(oldSize); 393 399 re.setNewSize(newGeom.size()); 400 if (oldSize.width() != newGeom.size().width()) 401 emit widthChanged(); 402 if (oldSize.height() != newGeom.size().height()) 403 emit heightChanged(); 394 404 QApplication::sendEvent(this, &re); 395 405 } 406 emit geometryChanged(); 396 407 } 397 408 … … 440 451 441 452 Contents margins are used by the assigned layout to define the placement 442 of subwidgets and layouts. Margins are particular ily useful for widgets453 of subwidgets and layouts. Margins are particularly useful for widgets 443 454 that constrain subwidgets to only a section of its own geometry. For 444 455 example, a group box with a layout will place subwidgets inside its frame, … … 738 749 739 750 /*! 751 \property QGraphicsWidget::layout 752 \brief The layout of the widget 753 754 Any existing layout manager is deleted before the new layout is assigned. If 755 \a layout is 0, the widget is left without a layout. Existing subwidgets' 756 geometries will remain unaffected. 757 758 QGraphicsWidget takes ownership of \a layout. 759 760 All widgets that are currently managed by \a layout or all of its 761 sublayouts, are automatically reparented to this item. The layout is then 762 invalidated, and the child widget geometries are adjusted according to 763 this item's geometry() and contentsMargins(). Children who are not 764 explicitly managed by \a layout remain unaffected by the layout after 765 it has been assigned to this widget. 766 767 If no layout is currently managing this widget, layout() will return 0. 768 769 */ 770 771 /*! 772 \fn void QGraphicsWidget::layoutChanged() 773 This signal gets emitted whenever the layout of the item changes 774 \internal 775 */ 776 777 /*! 740 778 Returns this widget's layout, or 0 if no layout is currently managing this 741 779 widget. … … 790 828 l->d_func()->reparentChildItems(this); 791 829 l->invalidate(); 830 emit layoutChanged(); 792 831 } 793 832 … … 915 954 { 916 955 Q_D(const QGraphicsWidget); 917 return d->font; 956 QFont fnt = d->font; 957 fnt.resolve(fnt.resolve() | d->inheritedFontResolveMask); 958 return fnt; 918 959 } 919 960 void QGraphicsWidget::setFont(const QFont &font) … … 965 1006 QPalette resolvedPalette = palette.resolve(naturalPalette); 966 1007 d->setPalette_helper(resolvedPalette); 1008 } 1009 1010 /*! 1011 \property QGraphicsWidget::autoFillBackground 1012 \brief whether the widget background is filled automatically 1013 \since 4.7 1014 1015 If enabled, this property will cause Qt to fill the background of the 1016 widget before invoking the paint() method. The color used is defined by the 1017 QPalette::Window color role from the widget's \l{QPalette}{palette}. 1018 1019 In addition, Windows are always filled with QPalette::Window, unless the 1020 WA_OpaquePaintEvent or WA_NoSystemBackground attributes are set. 1021 1022 By default, this property is false. 1023 1024 \sa Qt::WA_OpaquePaintEvent, Qt::WA_NoSystemBackground, 1025 */ 1026 bool QGraphicsWidget::autoFillBackground() const 1027 { 1028 Q_D(const QGraphicsWidget); 1029 return d->autoFillBackground; 1030 } 1031 void QGraphicsWidget::setAutoFillBackground(bool enabled) 1032 { 1033 Q_D(QGraphicsWidget); 1034 if (d->autoFillBackground != enabled) { 1035 d->autoFillBackground = enabled; 1036 update(); 1037 } 967 1038 } 968 1039 … … 1048 1119 break; 1049 1120 case ItemParentChange: { 1050 QGraphicsItem *parent = qVariantValue<QGraphicsItem *>(value);1051 d->fixFocusChainBeforeReparenting((parent && parent->isWidget()) ? static_cast<QGraphicsWidget *>(parent) : 0, scene());1052 1053 1121 // Deliver ParentAboutToChange. 1054 1122 QEvent event(QEvent::ParentAboutToChange);
Note:
See TracChangeset
for help on using the changeset viewer.