Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGraphicsProxyWidget is not transparent proxy

QGraphicsProxyWidget is not transparent proxy

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DimanNe
    wrote on last edited by
    #1

    So, I have QTreeView embedded in QGraphicsProxyWidget. And QTreeView does not auto expand branches while drag and dropping due to incorrect calculations of coordinates.

    How it doesn't work.

    There is void timerEvent(QTimerEvent *event) in QTreeView class:
    @
    QPoint pos = d->viewport->mapFromGlobal(QCursor::pos());
    if (state() == QAbstractItemView::DraggingState
    && d->viewport->rect().contains(pos)) {
    QModelIndex index = indexAt(pos);
    setExpanded(index, !isExpanded(index));
    }
    d->openTimer.stop();
    @

    Error is in "QPoint pos = d->viewport->mapFromGlobal(QCursor::pos());". It tries to map global coordinates to viewport's coordinates, but viewport's rect EQUALS the rect of QGraphicsProxyWidget in QGraphicsScene! And rect of QGraphicsProxyWidget in QGraphicsScene is always the same (x=70, y=0), independently of MainWindow position on the screen!

    How can I solve the problem? Or is it bug?

    PS Yes, I called setAutoExpandDelay(10);

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved