Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/graphicsview/qgraphicswidget.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    325325
    326326/*!
     327  \fn QGraphicsWidget::geometryChanged()
     328
     329  This signal gets emitted whenever the geometry is changed in setGeometry().
     330*/
     331
     332/*!
    327333    \property QGraphicsWidget::geometry
    328334    \brief the geometry of the widget
     
    380386            //set the new pos
    381387            d->geom.moveTopLeft(pos());
     388            emit geometryChanged();
    382389            return;
    383390        }
     
    385392    QSizeF oldSize = size();
    386393    QGraphicsLayoutItem::setGeometry(newGeom);
    387 
    388394    // Send resize event
    389395    bool resized = newGeom.size() != oldSize;
     
    392398        re.setOldSize(oldSize);
    393399        re.setNewSize(newGeom.size());
     400        if (oldSize.width() != newGeom.size().width())
     401            emit widthChanged();
     402        if (oldSize.height() != newGeom.size().height())
     403            emit heightChanged();
    394404        QApplication::sendEvent(this, &re);
    395405    }
     406    emit geometryChanged();
    396407}
    397408
     
    440451
    441452    Contents margins are used by the assigned layout to define the placement
    442     of subwidgets and layouts. Margins are particularily useful for widgets
     453    of subwidgets and layouts. Margins are particularly useful for widgets
    443454    that constrain subwidgets to only a section of its own geometry. For
    444455    example, a group box with a layout will place subwidgets inside its frame,
     
    738749
    739750/*!
     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/*!
    740778    Returns this widget's layout, or 0 if no layout is currently managing this
    741779    widget.
     
    790828    l->d_func()->reparentChildItems(this);
    791829    l->invalidate();
     830    emit layoutChanged();
    792831}
    793832
     
    915954{
    916955    Q_D(const QGraphicsWidget);
    917     return d->font;
     956    QFont fnt = d->font;
     957    fnt.resolve(fnt.resolve() | d->inheritedFontResolveMask);
     958    return fnt;
    918959}
    919960void QGraphicsWidget::setFont(const QFont &font)
     
    9651006    QPalette resolvedPalette = palette.resolve(naturalPalette);
    9661007    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*/
     1026bool QGraphicsWidget::autoFillBackground() const
     1027{
     1028    Q_D(const QGraphicsWidget);
     1029    return d->autoFillBackground;
     1030}
     1031void QGraphicsWidget::setAutoFillBackground(bool enabled)
     1032{
     1033    Q_D(QGraphicsWidget);
     1034    if (d->autoFillBackground != enabled) {
     1035        d->autoFillBackground = enabled;
     1036        update();
     1037    }
    9671038}
    9681039
     
    10481119        break;
    10491120    case ItemParentChange: {
    1050         QGraphicsItem *parent = qVariantValue<QGraphicsItem *>(value);
    1051         d->fixFocusChainBeforeReparenting((parent && parent->isWidget()) ? static_cast<QGraphicsWidget *>(parent) : 0, scene());
    1052 
    10531121        // Deliver ParentAboutToChange.
    10541122        QEvent event(QEvent::ParentAboutToChange);
Note: See TracChangeset for help on using the changeset viewer.