Qlabel expanding for large images but working fine for small images



  • Hi all ,i tried displaying 400x500 image in label its working fine but on same label i tried displaying 1500x1800 size image ,here label is expanding and in debugger given this message

    setGeometryDp: Unable to set geometry 1400x626+9+47 on QWidgetWindow/'MainwindowWindow'. Resulting geometry: 1364x626+9+47 (frame: 9, 36, 9, 9, custom margin: 0, 0, 0, 0, minimum size: 522x367, maximum size: 16777215x16777215).

    i tried the code
    QImage base0(":/rgb.png");
    int w=base0.width();
    int h=base0.height();
    QImage image=base0.scaled(w,h,Qt::IgnoreAspectRatio);
    ui->labsourceimage->setPixmap(QPixmap::fromImage(image));

    How to solve this suggestions please??


  • Lifetime Qt Champion

    Hi,

    What about the scaledContent property ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.