I think your question is to set visible or not items ... is like a html layer at top or sub ...
9 years a go i write Miniscribus... https://www.linux-apps.com/content/s...?content=67552
and i say to controll all QList<QGraphicsItem *> to show a top or on cellar...
all tests an app you an find on https://github.com/pehohlva/fop-miniscribus ... dinosaurier qt4.8 version...
by...
/* filter only item a top Zindex / zValue */
bool GraphicsScene
::WakeUp( const QPointF incomming
) {
qreal thebest = 0; /* zindex on front */
for (int o=0;o<listing.size();o++) {
listing[o]->setSelected(false);
thebest = qMax(listing[o]->zValue(),thebest);
}
/* activate item at top z-index zValue / not the down not visible!!!! */
for (int e=0;e<listing.size();e++) {
if (listing[e]->zValue() == thebest) {
emit SelectOn(listing[e],thebest);
return true;
}
}
return false;
}
/* filter only item a top Zindex / zValue */
bool GraphicsScene::WakeUp( const QPointF incomming )
{
QList<QGraphicsItem *> listing = QGraphicsScene::items(incomming);
qreal thebest = 0; /* zindex on front */
for (int o=0;o<listing.size();o++) {
listing[o]->setSelected(false);
listing[o]->setFlag(QGraphicsItem::ItemIsSelectable,false);
thebest = qMax(listing[o]->zValue(),thebest);
}
/* activate item at top z-index zValue / not the down not visible!!!! */
for (int e=0;e<listing.size();e++) {
if (listing[e]->zValue() == thebest) {
listing[e]->setFlag(QGraphicsItem::ItemIsSelectable,true);
emit SelectOn(listing[e],thebest);
return true;
}
}
return false;
}
To copy to clipboard, switch view to plain text mode
Bookmarks