如何在 QtDesigner 中加载 QMovie?

How do I load QMovie within QtDesigner?

我需要在 QtDesigner 中加载 QMovie。我注意到 QtDesigner 无法访问很多 类。我通常在 QtDesigner 中设计,我只是直接在我的代码中加载 ui 文件。这样我就不必担心在代码中实现 GUI 本身。 有什么方法可以做到这一点而无需编辑我的代码吗?

所以总而言之,我想将 QMovie 添加到我的主 window 中的水平布局。

QMovie 不是小部件,因此将其添加为布局没有任何意义。

您可能想要 QLabel,它有 setMovie method for dispalying animated images. But note that a QMovie cannot play videos - if you want that functionality, you will have to use a Phonon.VideoWidget,而不是 QLabel