没有它的预处理步骤,Qt的可用性? [英] How usable is Qt without its preprocessing step?

查看:112
本文介绍了没有它的预处理步骤,Qt的可用性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为库不需要使用特殊工具来预处理我的源代码是不合理的。也就是说,几个人已经推荐Qt库给我用于跨平台GUI开发。

I think it's unreasonable for a library to require preprocessing of my source code with a special tool. That said, several people have recommended the Qt library to me for cross platform GUI development.

Qt没有预处理步骤有多好用?

How usable is Qt without the preprocessing step?

编辑:好的人,我不是这个问题作为一个裂口Qt - 太多的Qt fanboys对待它,如果它是。我不想讨论Qt想出这个预处理工具的事实的优点。我理解为什么这个工具是在那里,我明白为什么Qt的设计的大部分是建立在预处理的想法。

Okay people, I'm not meaning this question as a rip on Qt -- too many Qt fanboys are treating it as if it is. I don't want to discuss the merits of the fact that Qt came up with this preprocessing tool. I understand why the tool is there, and I understand why there are large parts of Qt's design that are built upon the idea of preprocessing.

我从来没有使用过Qt, ergo我没有任何地位,撕裂它。但我更愿意用自己的书面形式编写少量样板文件,而不是依赖于翻译我的整个构建过程。我不会使用Flex和Bison在我当前的项目中有同样的原因;如果我不使用这些工具,我肯定不会使用另一种预处理。

I've never used Qt, ergo I am in no position to rip on it. But I would much rather pay in writing a small amount of boilerplate myself and not depend on ripping apart my entire build process. I won't use Flex and Bison in my current project for the same reason; if I won't use those tools, I'm definitely not going to use another kind of preprocessing.

所以,请不要把我当成在Qt。我不能评论如何好或不好它是;我没有使用它。我只想知道是否可以使用它 moc

So, please don't take me as ripping on Qt. I cannot comment on how nice or not nice it is; I have not used it. I just want to know if it is possible to use it without moc.

推荐答案

Qt不需要使用moc只是为了使用它,它需要使用如果你创建一个QObject的子类,并声明信号和槽在您的自定义类。

Qt doesn't require the use of moc just to use it, it requires that usage if you create a subclass of QObject, and to declare signals and slots in your custom classes.

这并不是不合理,moc提供了C ++没有的功能,信号/槽,内省等。

It's not unreasonable, moc provides features that C++ doesn't have, signals/slots, introspection, etc.

你将不得不使用moc预处理器。你或者爱它,或者讨厌它。

So, to do something minimally advanced, you WILL have to use the moc preprocessor. You either love it, or hate it.

这篇关于没有它的预处理步骤,Qt的可用性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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