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. Set QLabel border-image without stylesheet.
QtWS25 Last Chance

Set QLabel border-image without stylesheet.

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.1k 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.
  • B Offline
    B Offline
    bigbangvn
    wrote on last edited by
    #1

    Hi everyone!
    Do you know how to set QLabel border image without use SetStyleSheet ? I have use SetStyleSheet("border-image:url("://a.png"); But it affect all the childen.
    I have not found any method in QLabel class like : QLabel::SetBorderImage or others.
    Hate the StyleShit.

    Thank you.

    1 Reply Last reply
    0
    • IamSumitI Offline
      IamSumitI Offline
      IamSumit
      wrote on last edited by
      #2

      Hii,
      can you show the code ?

      Be Cute

      1 Reply Last reply
      0
      • C Offline
        C Offline
        clochydd
        wrote on last edited by
        #3

        Perhaps you may like the styleSheet after a while as it is a flexible way to control the design of your gui.
        I've posted some hints in "Qt Borderimage":http://qt-project.org/forums/viewthread/38805/
        If you do not want all children to be affected, you may assign a styleSheet to any child directly.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bigbangvn
          wrote on last edited by
          #4

          I have found a solution is using stylesheet with specific object-name :

          @ m_sliderLb->setObjectName(QString("SlideBar"));
          m_sliderLb->setStyleSheet("QLabel#SlideBar { border-image:url(:/images/slider_1.png);border-width:5} ");@

          It's ok. But i still think that stylesheet has poor perfomance in case so many objects use the same image file.

          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