Changeset 846 for trunk/src/gui/widgets/qcommandlinkbutton.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/widgets/qcommandlinkbutton.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 47 47 #include "qcolor.h" 48 48 #include "qfont.h" 49 49 50 50 51 #include "private/qpushbutton_p.h" … … 118 119 int leftMargin() const { return 7; } 119 120 int rightMargin() const { return 4; } 120 int bottomMargin() const { return 4; }121 int bottomMargin() const { return ; } 121 122 122 123 QString description; … … 174 175 { 175 176 Q_Q(const QCommandLinkButton); 176 return q->rect().adjusted(textOffset(), topMargin(), 177 -rightMargin(), 0); 177 QRect r = q->rect().adjusted(textOffset(), topMargin(), -rightMargin(), 0); 178 if (description.isEmpty()) 179 { 180 QFontMetrics fm(titleFont()); 181 r.setTop(r.top() + qMax(0, (q->icon().actualSize(q->iconSize()).height() 182 - fm.height()) / 2)); 183 } 184 185 return r; 178 186 } 179 187 … … 243 251 layout.endLayout(); 244 252 } 245 return q Round(descriptionheight);253 return q(descriptionheight); 246 254 } 247 255 … … 254 262 QSize size = sizeHint(); 255 263 int minimumHeight = qMax(d->descriptionOffset() + d->bottomMargin(), 256 icon Size().height() + d->topMargin());264 icon).height() + d->topMargin()); 257 265 size.setHeight(minimumHeight); 258 266 return size; … … 328 336 // find the width available for the description area 329 337 return qMax(heightWithoutDescription + d->descriptionHeight(width), 330 iconSize().height() + d->topMargin() + d->bottomMargin()); 338 icon().actualSize(iconSize()).height() + d->topMargin() + 339 d->bottomMargin()); 331 340 } 332 341 … … 341 350 initStyleOption(&option); 342 351 343 //Enable command link appear ence on Vista352 //Enable command link appearnce on Vista 344 353 option.features |= QStyleOptionButton::CommandLinkButton; 345 354 option.text = QString();
Note:
See TracChangeset
for help on using the changeset viewer.