Qt Designer中QGraphicsView的占位符图像

问题描述 投票:0回答:1

我经常有使用QGraphicsView的UI。在run的时候,我可以在场景中放置各种奇妙的事物。但是,在Qt Designer(Creator)中的[[design时候,我想显示某种占位符图像,以帮助我形象化UI的真实外观。

我找不到用于设置某种背景图像的属性。我在styleSheet属性中尝试了各种设置,但未显示任何内容,例如

QGraphicsView: { background-image: speedo.png; }

qt qt-designer qgraphicsview
1个回答
0
投票
有可能,您只是使用了错误的语法:

QGraphicsView { background-image: url("/path/to/your/image.png"); }


[QGraphicsViewQWidget,因此您可以使用Qt Style Sheets Reference设计具有允许属性的小部件
© www.soinside.com 2019 - 2024. All rights reserved.