Dear Forum,
i have a simple QLabel. Now i want to set an Image to this Label via Pixmap.
This is working with an hardcoded path for example "data/image1.png".
But if i try to set the pixmap path dynamically from an std::string i cant view this image and i get no errors.
This is my Code:
// working example hardcoded
string path = "data/image1.png";
QPixmap pixmap(path.c_str());
ui->imageSite1->setPixmap(pixmap);
BUT if i try to set the path dynamic as a function parameter for example, i cant view this image :-( .
Code:
string path = "data/"+imgfilepath; // parameter from methode
QPixmap pixmap(path.c_str());
Can anyone help me?
Thanks in advanced.
kenny
Bookmarks