Changeset 846 for trunk/src/gui/graphicsview/qgraphicswidget_p.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_p.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) … … 45 45 46 46 #include <QtCore/qdebug.h> 47 #include <QtCore/qnumeric.h> 47 48 #include "qgraphicswidget_p.h" 48 49 #include "qgraphicslayout.h" … … 71 72 windowFlags = wFlags; 72 73 73 q->setParentItem(parentItem); 74 if (parentItem) 75 setParentItemHelper(parentItem, 0, 0); 76 74 77 q->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred, QSizePolicy::DefaultType)); 75 78 q->setGraphicsItem(q); … … 77 80 resolveLayoutDirection(); 78 81 q->unsetWindowFrameMargins(); 79 q->setFlag(QGraphicsItem::ItemUsesExtendedStyleOption); 80 q->setFlag(QGraphicsItem::ItemSendsGeometryChanges); 82 flags |= QGraphicsItem::ItemUsesExtendedStyleOption; 83 flags |= QGraphicsItem::ItemSendsGeometryChanges; 84 if (windowFlags & Qt::Window) 85 flags |= QGraphicsItem::ItemIsPanel; 81 86 } 82 87 … … 250 255 void QGraphicsWidgetPrivate::resolveFont(uint inheritedMask) 251 256 { 257 Q_Q(QGraphicsWidget); 252 258 inheritedFontResolveMask = inheritedMask; 259 if (QGraphicsWidget *p = q->parentWidget()) 260 inheritedFontResolveMask |= p->d_func()->inheritedFontResolveMask; 253 261 QFont naturalFont = naturalWidgetFont(); 254 262 QFont resolvedFont = font.resolve(naturalFont); … … 757 765 QGraphicsWidget *firstOld = 0; 758 766 bool wasPreviousNew = true; 759 767 760 768 while (w != q) { 761 769 bool isCurrentNew = q->isAncestorOf(w); … … 792 800 793 801 if (oldScene && newScene != oldScene) 794 oldScene->d_func()->tabFocusFirst = firstOld;802 oldScene->d_func()->tabFocusFirst = (firstOld && firstOld->scene() == oldScene) ? firstOld : 0; 795 803 796 804 QGraphicsItem *topLevelItem = newParent ? newParent->topLevelItem() : 0; … … 826 834 } 827 835 836 qreal QGraphicsWidgetPrivate::width() const 837 { 838 Q_Q(const QGraphicsWidget); 839 return q->geometry().width(); 840 } 841 842 void QGraphicsWidgetPrivate::setWidth(qreal w) 843 { 844 if (qIsNaN(w)) 845 return; 846 Q_Q(QGraphicsWidget); 847 if (q->geometry().width() == w) 848 return; 849 850 QRectF oldGeom = q->geometry(); 851 852 q->setGeometry(QRectF(q->x(), q->y(), w, height())); 853 } 854 855 void QGraphicsWidgetPrivate::resetWidth() 856 { 857 Q_Q(QGraphicsWidget); 858 q->setGeometry(QRectF(q->x(), q->y(), 0, height())); 859 } 860 861 qreal QGraphicsWidgetPrivate::height() const 862 { 863 Q_Q(const QGraphicsWidget); 864 return q->geometry().height(); 865 } 866 867 void QGraphicsWidgetPrivate::setHeight(qreal h) 868 { 869 if (qIsNaN(h)) 870 return; 871 Q_Q(QGraphicsWidget); 872 if (q->geometry().height() == h) 873 return; 874 875 QRectF oldGeom = q->geometry(); 876 877 q->setGeometry(QRectF(q->x(), q->y(), width(), h)); 878 } 879 880 void QGraphicsWidgetPrivate::resetHeight() 881 { 882 Q_Q(QGraphicsWidget); 883 q->setGeometry(QRectF(q->x(), q->y(), width(), 0)); 884 } 885 828 886 void QGraphicsWidgetPrivate::setGeometryFromSetPos() 829 887 {
Note:
See TracChangeset
for help on using the changeset viewer.