Quote Originally Posted by wysota View Post
Show the code please.
I think I narrowed down the code to this. MyLabel is inherited from QLabel. I want it to change size (to maximum space) when I resize the window. It looks like it is not resizing automatically after this resize event. Is there some method I'm missing here ?

Qt Code:
  1. void MyLabel::resizeEvent(QResizeEvent* ev)
  2. {
  3. int minPointSize=14;
  4. const QSize& sz=ev->size();
  5. const QFont& fnt=font();
  6. QFont f=fnt;
  7.  
  8. qDebug() << "Resize event:" << sz << "pixelsize:" << f.pixelSize()
  9. << "." << f.pointSize();
  10.  
  11. f.setPointSize(sz.height()/2);
  12.  
  13. if (f.pointSize() < minPointSize) {
  14. f.setPointSize(minPointSize);
  15. }
  16.  
  17. setFont(f);
  18.  
  19. }
To copy to clipboard, switch view to plain text mode