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. Displaying a logo at a particular position
Forum Update on Monday, May 27th 2025

Displaying a logo at a particular position

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 802 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.
  • D Offline
    D Offline
    dev123
    wrote on 25 Sept 2014, 07:57 last edited by
    #1

    I have a collection of (radio)buttons on my screen, and I want to add a .png logo at a specific point (coordinate), possibly with the ability to scale up/down the image. (The feature that is provided with QPushButton.setGeometry)
    How could this be achieved? Thanks.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jeroentjehome
      wrote on 25 Sept 2014, 08:27 last edited by
      #2

      Did you place the buttons in a layout? Do you need the icon to stay within this layout, should it be a backgroud image? Maybe add a picture to show what you need. The easiest way to handle this to use the QLabel and place the png in there.

      Greetz, Jeroen

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dev123
        wrote on 25 Sept 2014, 09:40 last edited by
        #3

        I have the following code:
        QLabel myLabel;
        QPixmap pixmap("pic.png");
        myLabel.setPixmap(pixmap);
        myLabel.setMask(pixmap.mask());

        Now, I want to put myLabel below a particular button. Note that the above reports an error on line myLabel.setMask. What would be the easiest solution?

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jeroentjehome
          wrote on 25 Sept 2014, 12:52 last edited by
          #4

          Hi,
          First of all, the QLabel doesn't have a setMask function, so that will fail. Set the mask on the Pixmap and that should work.
          Do you want to have a button above the icon (use vertical layout)? Of should the icon be the background of the button?? (use borderimage)

          Greetz, Jeroen

          1 Reply Last reply
          0

          4/4

          25 Sept 2014, 12:52

          • Login

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