PDA

View Full Version : Resize event



boss_bhat
19th July 2006, 15:02
can some body explain how to post a resize event ??

Thanks in advance,
Boss

jacek
19th July 2006, 15:05
It should be enough to invoke QWidget::resize(), otherwise just create QResizeEvent on the heap and use QCoreApplication::postEvent().

boss_bhat
19th July 2006, 15:11
I tried using resize() but it didnt work for me , I will explain what I am trying to do, I have
a class derived from QWidget and here is it's constructor,

MyWidget::MyWidget( QString videoFileName, QWidget* parent, Qt::WFlags flags )
:QWidget(parent,flags)
{
// Do I really have to turn off the double buffering?? -Make sure before commit.
setAttribute(Qt::WA_PaintOnScreen);

resize(300,300);
.
.
.
}

Now If I trace this it doesnt post invoke resize

jpn
19th July 2006, 15:26
Is this widget in a layout?

boss_bhat
19th July 2006, 15:33
I am using it as the centralWidget of the QmainWindow
QMainWindow mywindows;

mywindows.setCentralWidget(&mywidget);

jacek
19th July 2006, 15:43
I am using it as the centralWidget of the QmainWindow
Then you should resize the main window.