Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-17571

QGraphicsProxyWidget is not transparent proxy

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.7.0
    • Widgets: GraphicsView
    • None

    Description

      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));
      }
      

      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?

      PS Yes, I called setAutoExpandDelay(10);
      d->openTimer.stop();

      Attachments

        1. Bug.tar.gz
          0.8 kB
        2. proxy-text-edit-bug.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            frederik Frederik Gladhorn
            dimanne DimanNe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes