Qt png图像未显示在部署应用程序中 [英] Qt png images not showing up in deployment app

查看:496
本文介绍了Qt png图像未显示在部署应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的.png图像会显示在Qt Creator中,以及在调试和发布情况下构建我的项目时.当我尝试部署并运行exe时,我的图像没有显示.

My .png images show up im Qt Creator and also when i build my project in both debug and release situations. When I try to deploy my exe and run it my images don't show up.

我的.pro文件:

QT       += core gui multimedia multimediawidgets

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = WinSim
TEMPLATE = app

DEFINES += QT_DEPRECATED_WARNINGS


SOURCES += main.cpp\
    mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui


RESOURCES += \
resourcefile.qrc
win32:RC_ICONS += icons\uokicon.ico

我的资源文件:

<RCC>
<qresource prefix="/">
    <file>icons/ico.png</file>
    <file>icons/ppicon.png</file>
    <file>icons/cricon.png</file>
    <file>icons/bgim.png</file>
    <file>icons/button.png</file>
    <file>icons/startmenu.png</file>
    <file>icons/power.png</file>
    <file>icons/uokicon.ico</file>
</qresource>
</RCC>

推荐答案

我要做的就是用windeployqt部署我的程序.谢谢@eyllanesc指出这一点!

All i needed to do was deploy my program with windeployqt. Thank you @eyllanesc for pointing that out !

这篇关于Qt png图像未显示在部署应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆