Changeset 24175 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 29, 2009 6:34:06 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 54114
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsHD.cpp
r24161 r24175 2340 2340 2341 2341 aPainter->save(); 2342 aPainter->translate (aRect.x(), aRect.y()); 2343 2344 int rows = mStorageModel->rowCount (aIndex.parent()); 2345 2346 // TODO Draw Correct Braches! 2347 2348 if (aIndex.row() == 0) 2349 aPainter->drawLine (QPoint (aRect.width() / 2, 2), QPoint (aRect.width() / 2, aRect.height() / 2)); 2350 else 2351 aPainter->drawLine (QPoint (aRect.width() / 2, 0), QPoint (aRect.width() / 2, aRect.height() / 2)); 2352 2353 if (aIndex.row() < rows - 1) 2354 aPainter->drawLine (QPoint (aRect.width() / 2, aRect.height() / 2), QPoint (aRect.width() / 2, aRect.height())); 2355 2356 aPainter->drawLine (QPoint (aRect.width() / 2, aRect.height() / 2), QPoint (aRect.width() - 2, aRect.height() / 2)); 2357 2342 QStyleOption options; 2343 options.initFrom (mTwStorageTree); 2344 options.rect = aRect; 2345 options.state |= QStyle::State_Item; 2346 if (aIndex.row() < mStorageModel->rowCount (aIndex.parent()) - 1) 2347 options.state |= QStyle::State_Sibling; 2348 /* This pen is commonly used by different 2349 * look and feel styles to paint tree-view branches. */ 2350 QPen pen (QBrush (options.palette.dark().color(), Qt::Dense4Pattern), 0); 2351 aPainter->setPen (pen); 2352 /* If we want tree-view branches to be always painted we have to use QCommonStyle::drawPrimitive() 2353 * because QCommonStyle performs branch painting as opposed to particular inherited sub-classing styles. */ 2354 qobject_cast <QCommonStyle*> (style())->QCommonStyle::drawPrimitive (QStyle::PE_IndicatorBranch, &options, aPainter); 2358 2355 aPainter->restore(); 2359 2356 }
Note:
See TracChangeset
for help on using the changeset viewer.