Gates
Gates

Reputation: 67

How to resize and move component(Label, PictureBox) in runtime on Qt?

Is it possible to resize and move component in run-time using mouse on Qt? If yes, how? Is there any property? Please share tutorial/docs/guide/howtos!

Upvotes: 0

Views: 477

Answers (1)

Bowdzone
Bowdzone

Reputation: 3854

You can implement resize/move behaviour of Qwidgetsyourself pretty easy by subclassing and overriding

The first one would have to check where on the widget the mouse is and set some bool variable to mark one of the actions. The Move needs to check if the mouse button is pressed and one of the bools is true and the release calls setGeometry() with a new size or position.

Upvotes: 1

Related Questions