class MyWidget: public QWidget { public: MyWidget(): QWidget(){ } protected: virtual bool event ( QEvent * event ){ qDebug() << "MyWidget::event:" << event->type(); return QWidget::event ( event ); } virtual void resizeEvent ( QResizeEvent * e ){ qDebug("MyWidget::resizeEvent"); QWidget::resizeEvent(e); }};int main(int argc, char *argv[]){ QApplication app(argc, argv); MyWidget main; main.show(); return app.exec(); }
#include <QtGui>class MyWidget: public QWidget { public: MyWidget(): QWidget(){ } protected: virtual void resizeEvent ( QResizeEvent * e ){ qDebug("MyWidget::resizeEvent"); QWidget::resizeEvent(e); }};int main(int argc, char *argv[]){ QApplication app(argc, argv); MyWidget main; main.show(); return app.exec(); }
TEMPLATE=appSOURCES=main.cpptarget=./sampleCONFIG += qt warn_on debug consoleDESTDIR=./
TRWidget*w = new TRWidget(this);QMdiSubWindow *s = mdiArea->addSubWindow(w, Qt::SubWindow);s->setOption(QMdiSubWindow::RubberBandResize);