Setting the Application Icon on Windows
First, create an ICO format bitmap file that contains the icon
image. This can be done with e.g. Microsoft Visual C++: Select
File|New, then select the File tab in the dialog that appears, and
choose Icon. (Note that you do not need to load your application
into Visual C++here we are only using the icon editor.)
Store the ICO file in your application’s source code directory,
for example, with the name myappico.ico. Then, create a text file
called, say, myapp.rc in which you put a single line of text:IDI_ICON1ICON
DISCARDABLE
"myappico.ico"Finally, assuming you are using qmake to generate
your makefiles, add this line to your myapp.pro file:
RC_FILE = myapp.rcRegenerate your makefile and your application.
The .exe file will now be represented with your icon inExplorer.
If you do not use qmake, the necessary steps are: first, run the
rc program on the .rc file, then link your application with the
resulting .res file.
*** 作如下:首先准备个ICO图标。例如:myappico.ico
用记事本新建个文件,里面就写一行:
IDI_ICON1 ICON DISCARDABLE “myappico.ico”
保存改名为 myapp.rc并把它和你的图标myappico.ico一起复制到你的QT工程项目的目录。
用记事本打开你的QT工程文件(如 “myapp.pro” ),在里面最后新添一行
保存,编译你的工程,成功了吧。
下载开源包:qt-x11-opensource-src-4.3.2.tar.gz 解压:gunzip qt-x11-opensource-src-4.3.2.tar.gz tar xvf qt-x11-opensource-src-4.3.2.tar 运行脚本:进入qt-x11-opensource-src-4.3.2文件夹,输入./configure运行shell脚本程序,为软件安装测试当前系统的一些必要的配置信息 编译: gmake 安装:gmake install 环境变量: vi /etc/profile 在该文件的末尾加上: PATH=/usr/local/Trolltech/Qt-4.3.2/bin:$PATH QTDIR=/usr/local/Trolltech/Qt-4.3.2 MANPATH=$QTDIR/man:$MANPATH LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH export PATH QTDIR MANPATH LD_LIBRARY_PATH 重启之后完成配置,写一个简单的HelloQt程序验证看是否配置成功,然后qmake -project 生成工程文件,qmake 该生成的工程文件(.pro)生成Makefile,最后make生成执行文件。 注: 1、gmake 过程中可能会报错,提示无法找到krb5.h,解决方法是: ln -s /usr/kerberos/include/com_err.h /usr/include/com_err.h ln -s /usr/kerberos/include/profile.h /usr/include/profile.h ln -s /usr/kerberos/include/krb5.h /usr/include/krb5.h 2、如果linux装在虚拟机上,貌似mount不能找到windows下的硬盘,对于linux文件和windows文件系统的互拷,首先:虚拟机->安装VMware tools;然后cd /mnt/cdrom,执行./vmware-install.pl文件;最后虚拟机->设置->选项->共享文件夹完成linux和windows共享文件夹(对应与linux下的/mnt/hgfs)的创建来相互拷贝文件。欢迎分享,转载请注明来源:内存溢出
评论列表(0条)