Do you have a style sheet attached to the label? Does it add a margin or padding? If so, each time you scale the image you add the margin/padding to it size.

This, for example, does not change the size of the label every two seconds:
Qt Code:
  1. #include <QtGui>
  2. #include <QDebug>
  3.  
  4. class MainWindow: public QMainWindow {
  5. Q_OBJECT
  6. public:
  7. MainWindow(QWidget *p = 0): QMainWindow(p) {
  8.  
  9. QWidget *central = new QWidget(this);
  10. label1 = new QLabel(this);
  11. image.load("test.png");
  12. label1->setPixmap(image);
  13. qDebug() << image.size() << label1->size();
  14. label2 = new QLabel("Label 2", this);
  15.  
  16. QVBoxLayout *layout = new QVBoxLayout(central);
  17. layout->addWidget(label1);
  18. layout->addWidget(label2);
  19.  
  20. central->setLayout(layout);
  21. setCentralWidget(central);
  22.  
  23. connect(&t, SIGNAL(timeout()), SLOT(tick()));
  24. t.start(2000);
  25. }
  26. public slots:
  27. void tick() {
  28. QPixmap temp = image.scaled(label1->width(), label1->height(), Qt::KeepAspectRatio);
  29. qDebug() << temp.size() << label1->size();
  30. label1->setPixmap(temp);
  31. }
  32. private:
  33. QPixmap image;
  34. QLabel *label1 ;
  35. QLabel *label2 ;
  36. QTimer t;
  37. };
  38.  
  39. int main(int argc, char *argv[])
  40. {
  41. QApplication app(argc, argv);
  42.  
  43. MainWindow m;
  44. m.show();
  45. return app.exec();
  46. }
  47. #include "main.moc"
To copy to clipboard, switch view to plain text mode 
unless you add:
Qt Code:
  1. qApp->setStyleSheet("QLabel { margin: 5px; }");
To copy to clipboard, switch view to plain text mode 
in main().