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

QProgressbar how image

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.8k 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.
  • N Offline
    N Offline
    Nexicoll
    wrote on last edited by
    #1

    Can I use image how QProgressBar ? When Yes, can You show me how ?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @
      progressBar->setStyleSheet("QProgressBar::chunk { background-image: url(/path/image.png); }");
      @

      1 Reply Last reply
      0
      • N Offline
        N Offline
        Nexicoll
        wrote on last edited by
        #3

        When I change image to ProgressBar i see this picture !http://zapodaj.net/9bfab24ee6fcc.png.html()! Where is path to add image , because now is empty :(

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          This uses "Qt resource system":http://qt-project.org/doc/qt-5/resources.html
          i.e. you need to put your image in the resource file first and it will be compiled into your exe.
          Using images from outside with relative or absolute paths is a bad idea because the paths will change on another user computer, but if you still want to use it just type it in by hand and not using resource selector.

          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