You need a resource file (.qrc) within which you embed the input text file. The input file can be any .txt file with a paragraph of text. Create a text file called input.txt and store it in the textfinder folder.

To add a resource file:

Select File > New File or Project > Qt > Qt Resource File > Choose.


"New File or Project dialog"

The Choose the Location dialog opens.

"Choose the Location dialog"

In the Name field, enter textfinder.
In the Path field, enter C:\Qt\examples\TextFinder, and click Next or Continue.
The Project Management dialog opens.

"Project Management dialog"

In the Add to project field, select TextFinder.pro and click Finish or Done to open the file in the code editor.
Select Add > Add Prefix.


In the Prefix field, replace the default prefix with a slash (/).
Select Add > Add Files, to locate and add input.txt.
"Editing resource files"

Qt中如何添加.qrc文件的更多相关文章

  1. 在Xcode中手动添加pch文件

    在Xcode中手动添加pch文件: 一: 在工程中新建.pch文件,pch文件名通常用工程名字命名: 二: 在Targets->build Settings->Prefix Header ...

  2. qt 中使用 c 语言文件

    qt 中直接使用 c 语言文件,c 文件可以直接包含,h 文件包含的时候,需要在 c++ 中添加额外信息,如下: #ifdef __cplusplus extern "C" { # ...

  3. git移除上一次的commit中误添加的文件

    在使用git进行版本管理时,往往会出现一些误操作,比如将一些不加上传的文件放到了暂存区,即上传到了上一次commit中 比如: commit c134ab90ca7c4daf8bfa22e3ad706 ...

  4. xcode6中如何添加pch文件

    在Xcode6之前,新建一个工程的时候,系统会帮我们自动新建一个以工程名为名字的pch (precompile header)文件,在开发过程中,可以将那些整个工程都广泛使用的头文件包含在该文件下,编 ...

  5. 第四十四篇、iOS开发中git添加.gitignore文件

    .gitignore文件可以直接使用https://github.com/github/gitignore 1.在项目中设置忽略文件(1)将从github上荡下来的对应的.gitignore文件(Sw ...

  6. 给Qt应用程序添加图标文件ico setWindowIcon

    1:通过qmake生成makefile实现过程: (1) 找到一张图片.ico,名字改为myappico.ico:注意:Qt5.2中 ico文件是256 * 256. (2) 创建一个新的文本文档,内 ...

  7. PrefixHeader.pch' file not found 以及 Xcode 中如何添加pch文件

    在开发的过程中,有时候接触到旧项目,会报: 'PrefixHeader.pch' file not found 的错误! 在Xcode6之前,新建一个工程的时候,系统会帮我们自动新建一个以工程名为名字 ...

  8. WPF 添加 Resources Dictionary 资源 一般类库项目中无法添加资源文件(ResourceDictionary)

    在文件夹或者项目右键-> Add(添加),会弹出可以快捷添加的资源,但是你会发现没有 ResourceDictionary资源可以选择. 解决此问题方法: 第一步:工程->右键->U ...

  9. 在控制台程序中,添加config文件

    一.右击类库 → 添加 → 新建项 → 应用程序配置文件(或者选择一个XML文件,然后将名字改成XXX.config),内容如下: <?xml version="1.0" e ...

随机推荐

  1. 教你如何删除tomcat服务器的stdout.log文件

    用Tomcat做WEB服务器的人都知道,有个很让人头痛的问题,就是stdout.log日志文件会自动增长,而且增长得很快. 先来看看我的痛处吧,公司有个WEB应用,就是用Tomcat作为服务器的,由于 ...

  2. JAVA设计模式 之 观察者模式(JDK内置实现)

    简介:使用JAVA内置的帮你搞定观察者模式. 1. 先把类图放在这里: (1). Observable类追踪所有的观察者,并通知他们. (2). Observer这个接口看起来很熟悉,它和我们之前写的 ...

  3. Gunicorn 和 Nginx

    Web Application Deployment Using Nginx Nginx is a very high performant web server / (reverse)-proxy. ...

  4. BZOJ3224——Tyvj 1728 普通平衡树

    1.题目大意:数据结构题,是treap,全都是treap比较基本的操作 2.分析:没啥思考的 #include <cstdio> #include <cstdlib> #inc ...

  5. leetcode 278. First Bad Version

    You are a product manager and currently leading a team to develop a new product. Unfortunately, the ...

  6. OpenCv皮肤检测-HSV分离

    HSV皮肤检测 // 进行肤色检测 void SkinDetect(IplImage* src, IplImage* dst) { // 创建图像头 IplImage* hsv = cvCreateI ...

  7. Linux system 函数的一些注意事项

    在日常的代码编程中 , 我们可以利用system  函数去调用一些我们自己想调用的命令 , 并获取他的返回值. 函数的原型如下: int system(const char *command); 上一 ...

  8. BZOJ 2654: tree

    Description \(n\) 个点, \(m\) 条边,边有权值和黑/白色,求含有 \(need\) 个白边的生成树. Sol 二分+Kruskal. 将每条白边都加上一个权值,然后跑最小生成树 ...

  9. POJ 2195 Going Home 最小费用最大流 尼玛,心累

    D - Going Home Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Subm ...

  10. Ubuntu编译源码程序依赖查找方法

    ubuntu平时编译源码程序的时候会提示缺少相关的库或是头文件,可以按照以下两种方法进行查找,然后再安装相应的软件包. 1.使用apt-file查找头文件 安装apt-file sudo apt-ge ...