How to get current size of QWidget placed in QGridLayout?
-
Hello,
How to get current size of QWidget placed in QGridLayout? Method width() and height() does not return correct values. -
Hi
Just a note.
Do not take width() and height() in the constructor of the widget holding the QGridLayout as resize/layout calculations are
postponed until Widget is shown and might not have correct values yet. -
@clostridium_difficile said in How to get current size of QWidget placed in QGridLayout?:
Method width() and height() does not return correct values.
They should, please show us your code.
-
Hi
Just a note.
Do not take width() and height() in the constructor of the widget holding the QGridLayout as resize/layout calculations are
postponed until Widget is shown and might not have correct values yet. -
Hi
Just a note.
Do not take width() and height() in the constructor of the widget holding the QGridLayout as resize/layout calculations are
postponed until Widget is shown and might not have correct values yet.@mrjj said in How to get current size of QWidget placed in QGridLayout?:
Hi
Just a note.
Do not take width() and height() in the constructor of the widget holding the QGridLayout as resize/layout calculations are
postponed until Widget is shown and might not have correct values yet.Yeah, it worked! Thanks. Size of the widget is calculated AFTER placing it in the layout.
-
@clostridium_difficile said in How to get current size of QWidget placed in QGridLayout?:
Size of the widget is calculated AFTER placing it in the layout.
How should it work otherwise :)