简体   繁体   English

QT小部件与QT GUI

[英]QT widgets vs QT GUI

I'm new at QT, actually I didn't start yet but I'm intending to create a xml file (markups and nodes and everything .. ) from a QT user interface. 我是QT的新手,实际上我还没有开始,但我打算从QT用户界面创建一个xml文件(标记和节点以及所有......)。

For example the user can find in my interface text fields where he can insert an employee name, id and age and my program will turn that to an employee node in my output xml file with its attributes name , id , age. 例如,用户可以在我的界面中找到可以插入员工姓名,身份和年龄的文本字段,我的程序会将其转换为输出xml文件中的员工节点,其属性名称为id,age。 so since I'm coding with c++ I wanted to create this interface as a QT GUI but I found that QT creator provides a project named QT Widget with the same option. 因为我用c ++编码,我想创建这个界面作为QT GUI,但我发现QT创建者提供了一个名为QT Widget的项目,具有相同的选项。

So I'm kind of confused now and I don't know what's the difference between them so I can chose. 所以我现在很困惑,我不知道它们之间的区别是什么,所以我可以选择。 I will appreciate any help from guys. 我很感激你们的帮助。

Do you mean Qt Quick vs. Qt Widgets? 你的意思是Qt Quick vs. Qt Widgets?

Qt Quick is a more recent type of Qt GUI which is created from a declarative markup languages known as QML. Qt Quick是一种更新的Qt GUI类型,它是使用称为QML的声明性标记语言创建的。 The QML source is interpreted at run-time as opposed to Qt Widgets which are compiled from C++ source code into native executable code. QML源在运行时被解释,而Qt Widgets则是从C ++源代码编译成本机可执行代码。 In addition to QML, Qt Quick uses inline Javascript for scripting the UI, but it can be (and usually is) interfaced from C++ for more complex processing. 除了QML之外,Qt Quick还使用内联Javascript来编写UI脚本,但它可以(并且通常是)从C ++接口以进行更复杂的处理。

EDIT: Qt Quick is also very much touch-oriented (at least at its current state) whereas Qt Widget GUIs provide a much richer set of UI elements. 编辑:Qt Quick也非常注重触摸(至少在当前状态下),而Qt Widget GUI提供了更丰富的UI元素集。 So if you are making a desktop application, you might want to leave Qt Quick alone. 因此,如果您正在制作桌面应用程序,则可能需要单独使用Qt Quick。

If I have understood your question correctly: a Qt Widget is a tiny element, one of the many items in a gui (buttons, comboboxes are all widgets). 如果我正确地理解了你的问题:Qt Widget是一个很小的元素,gui中的众多项目之一(按钮,组合框都是小部件)。 The Qt Widget, project type is for creating one, which you can use in a separate projects interface. Qt Widget,项目类型用于创建一个,您可以在单独的项目界面中使用它。

A Qt Gui is more likely the project type you want, that will allow you to drag in many widgets to create your 'interface text fields'. Qt Gui更有可能是您想要的项目类型,这将允许您拖动许多小部件来创建“界面文本字段”。

You would use a Qt Widget project type if you need to do more advanced customization or create your own text field control. 如果需要进行更高级的自定义或创建自己的文本字段控件,可以使用Qt Widget项目类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM