In qml, I can simply do this
Image {
anchors.fill: parent
source: "/path/to/coo/image"
fillMode: Image.PreserveAspectFit
}
I don't want to use QML due to its ties with JavaScript. How can I do this with Widgets ?
I tried using QLabel but it has no option to set aspect ratio or fillMode. I think I can manually scale the pixmap and then set it to QLabel but that wont be reactive (resize image when window is resized) like QML. Isn't there any image specefic widget in Qt to do this ?