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. Image with active zones
Forum Updated to NodeBB v4.3 + New Features

Image with active zones

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 651 Views 2 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.
  • ivanicyI Offline
    ivanicyI Offline
    ivanicy
    wrote on last edited by ivanicy
    #1

    Hello!

    Wow, this is difficult to ask so it will be more difficult to answer but, I'll try it.

    I want to put in my application an image with dinamic zones. For example, something like this:

    0_1520858679696_ca1cd19a-2066-4c27-bb52-990bb0ea01c4-image.png !

    I want to put some icons in a plan image, and under them, a label with the status. I also want to allow you to click on the icons, to access a window.

    How can I do something like this?

    Thank you very much!

    K 1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      http://doc.qt.io/qt-5/qtwidgets-graphicsview-diagramscene-example.html

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      2
      • ivanicyI ivanicy

        Hello!

        Wow, this is difficult to ask so it will be more difficult to answer but, I'll try it.

        I want to put in my application an image with dinamic zones. For example, something like this:

        0_1520858679696_ca1cd19a-2066-4c27-bb52-990bb0ea01c4-image.png !

        I want to put some icons in a plan image, and under them, a label with the status. I also want to allow you to click on the icons, to access a window.

        How can I do something like this?

        Thank you very much!

        K Offline
        K Offline
        kenchan
        wrote on last edited by kenchan
        #3

        @ivanicy
        As @VRonin is indicating, a QGraphicsView with a QGraphicsScene is the way to go. You can put your image in the scene and put your zones etc. on top of it. You will get the ability to click on the items you add to the scene and otherwise interact with them.

        1 Reply Last reply
        3
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          Hi
          While possible to make something fast with QPainter, using a QGraphicsScene + view also gives
          free panning and scrolling in case plan image gets bigger than screen res and would handle
          even large "status" maps without a hiccup.
          For small sample, this is easy to read
          http://www.bogotobogo.com/Qt/Qt5_QGraphicsView_QGraphicsScene.php

          1 Reply Last reply
          3

          • Login

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