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 Toggling
Forum Updated to NodeBB v4.3 + New Features

Image Toggling

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 386 Views 1 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.
  • G Offline
    G Offline
    GoldRatio
    wrote on last edited by
    #1

    I'm brand new to QML and was wondering if you could toggle between images using a ComboBox. And if so how you would accomplish it. Basically, every choice of the combo box would trigger a different image, but the images need to all be in the same place.

    Thanks!

    raven-worxR 1 Reply Last reply
    0
    • G GoldRatio

      I'm brand new to QML and was wondering if you could toggle between images using a ComboBox. And if so how you would accomplish it. Basically, every choice of the combo box would trigger a different image, but the images need to all be in the same place.

      Thanks!

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @GoldRatio

      ComboBox {
          id: comboBox
          ....
      }
      
      Image {
         source: {
            switch( comboBox.currentIndex )
            {
                  case 0: return "path/to/image0.png"
                  case 1: return "path/to/image1.png"
                  ...
            }
        }
      }
      

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      2
      • G Offline
        G Offline
        GoldRatio
        wrote on last edited by
        #3

        @raven-worx Thanks for all the help!

        1 Reply Last reply
        0

        • Login

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