{
int lod = option->levelOfDetail;
if (lod >= 1) {
// 1:1 or closer
painter->drawRoundRect(0, 0, 100, 100);
} else if (lod >= 0.5) {
// 1:2 to 1:1
painter->drawRect(0, 0, 100, 100);
} else if (lod >= 0.25) {
// 1:4 to 1:2
painter->fillRect(0, 0, 100, 100);
} else {
// Don't draw at all
}
}
void MyItem::paint(QPainter *painter, const QStyleOption...
{
int lod = option->levelOfDetail;
if (lod >= 1) {
// 1:1 or closer
painter->drawRoundRect(0, 0, 100, 100);
} else if (lod >= 0.5) {
// 1:2 to 1:1
painter->drawRect(0, 0, 100, 100);
} else if (lod >= 0.25) {
// 1:4 to 1:2
painter->fillRect(0, 0, 100, 100);
} else {
// Don't draw at all
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks