Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to "inflate" or "grow" a rectangle in Qt?

Tags:

c++

qt

Does Qt have a built-in way to inflate or grow a rectangle? Like .NET's Rectangle.Inflate or Java's Rectangle.grow... or do I have to implement my own? I've looked through the docs and couldn't find one but maybe I'm missing something.

like image 257
Jake Petroules Avatar asked Sep 14 '25 04:09

Jake Petroules


1 Answers

There seems to be an adjust function that comes closest to what you want. You could easily use it to "inflate" a rectangle:

rect.adjust(-dx, -dy, dx, dy);

where dx and dy are the amounts you want to inflate in the x and y directions.

like image 93
casablanca Avatar answered Sep 16 '25 19:09

casablanca