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

QtQuick needs a rubberband / lasso component



    • Task
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • None


      There are several aspects to this:

      • it's not too hard to bind a Rectangle to a DragHandler with target: null (see tests/manual/pointer/rubberbandOnTable.qml from https://codereview.qt-project.org/#/c/250053/5)
      • detecting which Items fall within a rectangular boundary ought to be done in C++
      • drawing a plain rectangle can be done efficiently in the scene graph, without rounding  without AA and without needing any QML bindings, if we include that as part of a RubberbandHandler for example.  It can't get any more efficient than that.
      • techniques to increase contrast on arbitrary backgrounds may be necessary though, so it may not be so simple (XOR was an old way in the days before GPUs were dreamed of; or, marching ants consisting of black dashes with white borders around them, or some such).  Qt Quick Shapes can already draw shapes with dashed lines, FWIW.
      • if users demand fancy styling though (anything beyond setting the line color), maybe the customization ought to be done as part of Controls 2 (that way they can be different for each style)
      • TableView needs one kind of rubberbanding to select cells; but drawing and diagramming applications need another kind to select Items that fall within the rectangle
      • QRubberBand already exists as a widget, and rubber banding is possible in GraphicsView, so QtQuick has been behind all along by not having this
      • The rubberband might exist only while a mouse button is held down, so you drag out an area and release; but it should also be possible to have a more persistent variation with drag handles on the corners to change the selected area.  The drag handles might be a separate component, but we need an efficient implementation of them too (not using a separate QML Rectangle for each corner: been there, done that).


        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.



              richard Richard Moe Gustavsen
              srutledg Shawn Rutledge
              0 Vote for this issue
              1 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes