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. View position of top-left corner

View position of top-left corner

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 514 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.
  • G Offline
    G Offline
    Goranjeb
    wrote on last edited by
    #1

    Hi all. I'm new in Qt and i start to develop a simple UI with the Qt4.8.6 library and i have a question: i create a new empty widget with this two QPushButtons and i try to positioning it in the top-left corner of my widget. (https://www.dropbox.com/s/2yxutc6iad0xqxd/Schermata.png )
    But if i set the x,y coordinates of my first PushButton to 0,0, the button is positioned not in the real top-left corner but in 5,4: in fact, to obtain the situation of the image i had to set my PushButton position to -5,-4. My question is: why this behaviour?

    I also set fixed size of this two PushButton to 150x150, but i had to set my second PushButton x coordinate to 133 (instead of 150) to put it in the first button right-side. I think this is a very newbie question but: why x = 150 is the wrong coordinate? it seems that there is a rectangle that surround the image of the real clickable button, but why? Thanks all for the answers.

    EDIT: i forgot to tell that i also try to put all button in a QGridLayout, but the "padding" still present.

    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