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. Is it possible to make an image with buttons on it

Is it possible to make an image with buttons on it

Scheduled Pinned Locked Moved Unsolved General and Desktop
qwidgetqimage
4 Posts 2 Posters 1.5k Views
  • 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.
  • S Offline
    S Offline
    SolaVitae
    wrote on 13 Dec 2017, 13:08 last edited by
    #1

    Two questions.

    I'm trying to make a map with buttons that can be clicked on it, curious if it's possible to put buttons on the image, like have the map as a background image with buttons on the image?

    Also is it possible to show only a portion of an image that you could drag and drop to show more of the image? The image is 9600x6800 pixels, and I'd like a widget to show 1024x800 of it at a time but the image is draggable to reveal more of it

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 13 Dec 2017, 13:30 last edited by
      #2

      Hi
      1:
      Yes, say you use a QLabel to display the map/image. Then you
      can just place the buttons on top of it.
      2:
      You can use a scrollArea or QGraphicsView ( which have drag panning pr default)
      to show a section of the full image but it cant progressively load more of the image on demand.
      For such feature, you must hand program that using some sort of tilesystem.

      1 Reply Last reply
      1
      • S Offline
        S Offline
        SolaVitae
        wrote on 14 Dec 2017, 01:21 last edited by
        #3

        i wouldnt want it to load more of the image per say, it would have the entire image loaded, just the parts that arent within the 1024x800 view arent visible until you drag or scroll the image in a way that would put that section of the image in the view

        0_1513214419605_989.jpg

        The blue box would be the visible region while the green box is the entire image, where you could only see the part of the image that is within the blue box

        M 1 Reply Last reply 14 Dec 2017, 07:56
        0
        • S SolaVitae
          14 Dec 2017, 01:21

          i wouldnt want it to load more of the image per say, it would have the entire image loaded, just the parts that arent within the 1024x800 view arent visible until you drag or scroll the image in a way that would put that section of the image in the view

          0_1513214419605_989.jpg

          The blue box would be the visible region while the green box is the entire image, where you could only see the part of the image that is within the blue box

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 14 Dec 2017, 07:56 last edited by
          #4

          @SolaVitae
          Ok then the default
          classes will just work.

          Maybe you can try with
          http://doc.qt.io/qt-5/qtwidgets-widgets-imageviewer-example.html

          1 Reply Last reply
          0

          1/4

          13 Dec 2017, 13:08

          • Login

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