Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Accurate Button Placement in QDesigner
Forum Updated to NodeBB v4.3 + New Features

Accurate Button Placement in QDesigner

Scheduled Pinned Locked Moved Unsolved Qt for Python
pyside
3 Posts 3 Posters 335 Views 3 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.
  • L Offline
    L Offline
    LREGS
    wrote on last edited by
    #1

    As the title suggests, I'm struggling to accurately place buttons in QDesigner as they seem to have to be anchored to the dots within the background of the Widget within QDesigner.

    I have a background image of a climbing wall like this:

    board400x400.png

    And I've cut out the holds in Photoshop. I've extended the QLabel Widget to turn the photos of the holds into checkable buttons, and I obviously want to overlay them on the background image above to create the holds as buttons within the app.

    However, when I'm placing them in QDesigner it's not possible with my current knowledge to place them exactly in the holes of the image because it seems the center of the label needs to be anchored to one of the background dots in QDesigner.

    Am I going about this in completely the wrong way or is there something obvious I'm missing? I'm completely self-taught so I am probably ignorant of a lot of features.

    I'm also not caught up on this approach - if there was a way to make custom shaped buttons that I could overlay instead that would be great!

    Am I missing something with layouts?

    Should I just be creating custom buttons and the Painter?

    At the moment I'm just using normal transparent squares over the top of the holds, but I'm trying to make the app look a little more professional!

    Thanks :)

    jeremy_kJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      If you want precise positioning, you should do that in code.

      As for having push buttons with arbitrary geometries, it's something you would have to do yourself.

      Depending on your final goal, did you consider using the Graphics View framework ? It might be better suited.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • L LREGS

        As the title suggests, I'm struggling to accurately place buttons in QDesigner as they seem to have to be anchored to the dots within the background of the Widget within QDesigner.

        I have a background image of a climbing wall like this:

        board400x400.png

        And I've cut out the holds in Photoshop. I've extended the QLabel Widget to turn the photos of the holds into checkable buttons, and I obviously want to overlay them on the background image above to create the holds as buttons within the app.

        However, when I'm placing them in QDesigner it's not possible with my current knowledge to place them exactly in the holes of the image because it seems the center of the label needs to be anchored to one of the background dots in QDesigner.

        Am I going about this in completely the wrong way or is there something obvious I'm missing? I'm completely self-taught so I am probably ignorant of a lot of features.

        I'm also not caught up on this approach - if there was a way to make custom shaped buttons that I could overlay instead that would be great!

        Am I missing something with layouts?

        Should I just be creating custom buttons and the Painter?

        At the moment I'm just using normal transparent squares over the top of the holds, but I'm trying to make the app look a little more professional!

        Thanks :)

        jeremy_kJ Offline
        jeremy_kJ Offline
        jeremy_k
        wrote on last edited by jeremy_k
        #3

        @LREGS said in Accurate Button Placement in QDesigner:

        However, when I'm placing them in QDesigner it's not possible with my current knowledge to place them exactly in the holes of the image because it seems the center of the label needs to be anchored to one of the background dots in QDesigner.

        This is probably the snap to grid behavior. From the menu toolbar: Tools -> Form Editor -> Form Settings ...
        Check the Grid checkbox, and then uncheck Snap.

        @SGaist's suggestions are likely easier to deal with in the long run.

        Asking a question about code? http://eel.is/iso-c++/testcase/

        1 Reply Last reply
        1

        • Login

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