接受 QTCreator 构造函数完成建议
我在 Mac 上使用 QTCreator,并且正在努力适应它。如果我输入以下内容:
QWidget *w = new QWidget(
并按 Control+Space
,我会得到一个工具提示(即黄色),其中包含我可能想要使用的“3 中的 1”个可能的构造函数原型。我可以使用向上/向下箭头来查看不同的原型。
但我该如何选择一个来帮我完成呢?我试过按回车键和制表符。都不接受完成。
我缺少什么?
I'm using QTCreator on the Mac, and I'm trying to get used to it. If I type in the following:
QWidget *w = new QWidget(
And press Control+Space
, I get a tooltip (i.e., in yellow) that has a "1 of 3" possible constructor prototypes I might want to use. I can use arrow up/down to see the different prototypes.
But how do I choose one to have it completed for me? I've tried hitting return, and tab. Neither accept the completion.
What am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一种 API 帮助程序,它会在您键入时保持运行状态,以便您可以查看函数所需的参数类型。它显示的不是代码完成选项,而是声明的函数。在本例中,它显示了 QWidget 构造函数的三个不同重载。
可以为单个参数传递的实际参数通常有许多可能的值。对于具有多个参数的函数,组合会变得相当大,因此尝试提出单一建议是不合理的。
当您开始为每个参数输入一些内容时,代码完成将会启动。
That is sort of an API helper that will stay up as you type so you can see what parameter types the function is expecting. What it is showing is not code completion options but the function as it is declared. In this case, it is showing the three different overloads of the QWidget constructor.
There are often many possible values for the actual parameter that can be passed for a single argument. For functions with more than one parameter, the combinations grow quite large so it isn't reasonable to try to present a single suggestion.
As you start to type something in for each parameter, code completion will kick in.