Unsolved I need to display one box with varying size.
-
Hi
I need to display one white box in QT form with varying size. Whose size would vary from 5x5 cells to 50x50 cells. The calcaulation should be done on basis of some formula.
So by formula I will get n which will be in range of 1..10
then I need to display the box of size = n ( 5 x5). How can i do that please help.
-
Did you look setFixedSize(..) method of QWidget ?
-
@dheerendra said in I need to display one box with varying size.:
etFixedSi
@dheerendra ok I will have a look. Which widget we should use in design tab of qt to achieve this?
-
@Ayush-Gupta You should explain better what you want to achieve. Where do you want to have this box? Is it some kind of drawing? Are you using QPainter?
-
@jsulm I have one QDialog box where I need to create one widget whose size i can change through code and the size of the box should be reduce / increase based on the formula I mentioned
-
@Ayush-Gupta Well, just do not put this widget in a layout and set its size and position using https://doc.qt.io/qt-5/qwidget.html#setGeometry-1
Or do what @dheerendra suggested.