Solved Get size of window with debug when runtime
-
Re: How to check for window size changes?
Hai, i'm new here, how do i get the window size while running, sometime i will resize the window and get the window size.
When i use
void mywindow::resizeEvent(QResizeEvent *event) { qDebug() << "Height : " << height(); qDebug() << "Width : " << width(); }
and I only get the initial size
-
-
Hai, thanks for help, it solved. This is my latest code
//mainwindow.h protected: void resizeEvent (QResizeEvent *e); //mainwindow.cpp #include <QResizeEvent> //. //. void mainwindow::resizeEvent(QResizeEvent *e) { qDebug() << e->size().width(); qDebug() << e->size().height(); qDebug() << e->size(); QWidget::resizeEvent(e); }