开发者

How can I set the path + filename in Qt Designer's property box?

I sucessfully added a QLabel widget into the FormWindow and set a pixmap in code, but when examine the property box the pixmap filepath field was empty even if the image did get loaded properly.

The QPixmap struct has no members holding the path, so this info must be somewhere in the Property Box. How can I access it?

If the pixmap filepath property field is left blank, then it won't be saved correctly to the .ui file. Next time you bring it back, the label will exist but no image will be shown.

I guess some internal slot & signals things has to be emitted or triggered, but just can't f开发者_如何学Goind a way to do it. Any help is appreciated.


QPixmap does not keep file path (http://doc.trolltech.com/3.3/qpixmap.html#QPixmap-5). If you want to have it each time you access your QPixmap, you need to subclass it and add the file path as member

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜