How to align pushbutton
-
Hello, how i can i allign my pushbutton in the centre of the mainwindow ? ive been googling for a while, and didnt find any answer...
also, i would like to have my button in the centre of the window even if the window is resized...Best regards,
OSiRiS -
Add QPushButton to main widget in designer and press Ctrl+G.
It's the simplest way. -
Sorry, this does not solve anything
it just stretches the button, so its as wide as mainwindow, and the button´s geometry is disabled, so i cant move it any further
-
But now it's...
[quote author="andyc" date="1319583136"]in the centre of the window even if the window is resized[/quote]
also, you can set "Horizontal Policy" property to "Fixed" -
See "How to center a window on the screen":http://developer.qt.nokia.com/wiki/Center_a_Window_on_the_Screen
But instead of desktop available geometry, use button parent geometry. -
[quote author="andyc" date="1319583136"]Hello, how i can i allign my pushbutton in the centre of the mainwindow ? ive been googling for a while, and didnt find any answer...
also, i would like to have my button in the centre of the window even if the window is resized...Best regards,
OSiRiS[/quote]Do you mean like using a layout? Otherwise, can you elaborate?