Qt Creator:将Qt模块添加到项目 [英] Qt Creator: add Qt module to project

查看:1499
本文介绍了Qt Creator:将Qt模块添加到项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,当我在Qt Creator中创建一个新的Qt项目时,只要求提供一些简单的详细信息,例如项目的位置,构建目标,主窗口类名称(以及标题,源文件和表单文件)以及在选择将其添加到版本控制中的最终选择.

So when I create a new Qt project inside Qt Creator I'm only asked for some simple details like location of the project, build targets, the main window class name (along with header, source and form file) and at the enda choice to add it to version control.

创建项目后,仅获得qt核心和gui模块.我的问题是如何添加其他模块(例如network或opengl).我已经看过了,但是我找不到关于如何轻松添加其他Qt模块的任何信息.我知道我可以编辑.pro文件,但是不幸的是,我不知道Qt中的所有模块,也没想过我应该放在那里的名称.添加外部库很容易,但是为什么没有(显而易见的)选项来添加Qt库呢?

After I create the project I'm only given the qt core and gui modules. My question is how do I add other modules (such as network or opengl). I've looked and looked, yet I cannot find anything on how to add other Qt modules easily. I know I can edit the .pro file, but unfortunately I don't know all the modules in Qt, nevermind the name I'm supposed to put there. Adding external libraries is easy, but how come there's no (obvious) option to add Qt libraries?

我们将不胜感激^ _ ^谢谢!

Help would be much appreciated ^_^ Thanks!

哦,是的.如果有帮助,我正在运行Arch Linux.

Oh yeah... I'm running Arch Linux if that's any help.

推荐答案

编辑.pro文件.它应该有这样的一行:

Edit your .pro file. It should has one line like this:

QT += core gui

在此行中添加所需的模块.要获取模块的名称,只需删除此列表. (例如QtSql变成"sql")

Append the desired modules in this line. To get the module's names, just remove the "Qt" part in this list. (e.g. QtSql turns "sql")

这篇关于Qt Creator:将Qt模块添加到项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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