Generally, I've been searching for a while and could not find a serious answer. The problem is that I've a QString variable containing certain url, e.g. "C:/Users/Me/Desktop/image.png". How to open it and display the image in my application window?
I know the problem might seem trivial, however I can't find a working solution.
解决方案
Load the image by using QPixmap and then show it with QLabel:
QString url = R"(C:/Users/Me/Desktop/image.png)";
QPixmap img(url);
QLabel *label = new QLabel(this);
label->setPixmap(img);