c++qlabel

Qt: setting text to a Qlabel with a pixmap and back


So i have a QLabel with a pixmap (added to it with the function setPixmap() ). Let's say now I add text to it with setText(). The QLabel starts displaying the text which is what I want it to do. And now is my question - is there a way to change the label back to start showing the previous pixmap rather than adding it again with setPixmap()?


Solution

  • No.

    http://qt-project.org/doc/qt-4.8/qlabel.html#text-prop

    Here is written that setting text to QLabel clears any previous content.