[Qt-interest] resizeEvent get's only called _after_ resize

chris_honschu at gmx.de chris_honschu at gmx.de
Fri Jul 24 01:45:29 CEST 2009


// "hello" never gets called, no matter what
// constructor is used for QSizePolicy
//
// is this a bug?

#include <QtGui/QApplication>
#include <QtGui>

class Window : public QMainWindow{
public:
 Window(){
  QSizePolicy poli;
  poli.setHeightForWidth(true);
  this->setSizePolicy(poli); }
 int heightForWidth(int w) const{
  qDebug() << "hello" << w;
  return w; }
};

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Window w;
    w.show();
    return a.exec();
}



More information about the Qt-interest-old mailing list