Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have a number of different options that I'll order from higher level to lower level:</p> <ol> <li>Use <a href="https://doc.qt.io/qt-4.8/qgraphicsscene.html" rel="nofollow noreferrer">QGraphicsScene</a>, <a href="https://doc.qt.io/qt-4.8/qgraphicsview.html" rel="nofollow noreferrer">QGraphicsView</a>, and <a href="https://doc.qt.io/qt-4.8/qgraphicsitem.html" rel="nofollow noreferrer">QGraphicsItems</a>. This sets probably forms the main option and best option for graphics intensive operations. By setting a <a href="https://doc.qt.io/qt-4.8/qglwidget.html" rel="nofollow noreferrer">QGLWidget</a> as the viewport you'll even have hardware acceleration on many systems.</li> <li>Use <a href="https://doc.qt.io/qt-4.8/qscrollarea.html" rel="nofollow noreferrer">QScrollArea</a> to support zooming in on your image, which can be a simple <a href="https://doc.qt.io/qt-4.8/qlabel.html" rel="nofollow noreferrer">QLabel</a>. By changing the viewed region you'll have effectual zoom. QLabel could be used to draw the image but you'll have to manually keep track of selected regions and do any selection overlays.</li> <li>Use a single <a href="https://doc.qt.io/qt-4.8/qwidget.html" rel="nofollow noreferrer">QWidget</a> and do custom painting. By calling <a href="https://doc.qt.io/qt-4.8/qwidget.html#update-2" rel="nofollow noreferrer">update()</a> after various events you'll be able to draw any necessary changes. Expect to do virtually everything manually.</li> </ol> <p>I'd recommend approach number 1. You can use a <a href="https://doc.qt.io/qt-4.8/qgraphicspixmapitem.html" rel="nofollow noreferrer">QGraphicsPixmapItem</a> to hold your image. You can then create a graphics item that represents your selection and use its bounding rectangle to find the <a href="https://doc.qt.io/qt-4.8/qrect.html#intersected" rel="nofollow noreferrer">intersecting</a> areas. QGraphicsView can handle all the <a href="https://doc.qt.io/qt-4.8/qgraphicsview.html#scale" rel="nofollow noreferrer">zooming</a> for you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload