qt-creator 相关问题

Qt Creator是一个全面的开源C ++ IDE,是Qt Project的一部分。


QT创建者和QT设计工作室结缔组织编程错误

在QT Design Studio中,我创建了一个移动项目,并为导出设置了CMAKE。 当我在QT创建者中打开cmakelists.txt文件时,我在项目Explorer中遇到了此错误: CMAKE项目

回答 0 投票 0


QT QML下拉列表,如html

简单的东西,但找不到。我想要一个带有几个选择的简单下拉选择框。像html一样 1 2 ... 简单的东西,但找不到。我想要一个带有几个选择的简单下拉选择框。像html <select> <option>1</option> <option>2</option> </select> QML的代码是什么? there是一个简单的例子,可以用作起点: import QtQuick 1.0 Rectangle { width:400; height: 400; Rectangle { id:comboBox property variant items: ["Item 1", "Item 2", "Item 3"] property alias selectedItem: chosenItemText.text; property alias selectedIndex: listView.currentIndex; signal comboClicked; width: 100; height: 30; z: 100; smooth:true; Rectangle { id:chosenItem radius:4; width:parent.width; height:comboBox.height; color: "lightsteelblue" smooth:true; Text { anchors.top: parent.top; anchors.left: parent.left; anchors.margins: 8; id:chosenItemText text:comboBox.items[0]; font.family: "Arial" font.pointSize: 14; smooth:true } MouseArea { anchors.fill: parent; onClicked: { comboBox.state = comboBox.state==="dropDown"?"":"dropDown" } } } Rectangle { id:dropDown width:comboBox.width; height:0; clip:true; radius:4; anchors.top: chosenItem.bottom; anchors.margins: 2; color: "lightgray" ListView { id:listView height:500; model: comboBox.items currentIndex: 0 delegate: Item{ width:comboBox.width; height: comboBox.height; Text { text: modelData anchors.top: parent.top; anchors.left: parent.left; anchors.margins: 5; } MouseArea { anchors.fill: parent; onClicked: { comboBox.state = "" var prevSelection = chosenItemText.text chosenItemText.text = modelData if(chosenItemText.text != prevSelection){ comboBox.comboClicked(); } listView.currentIndex = index; } } } } } Component { id: highlight Rectangle { width:comboBox.width; height:comboBox.height; color: "red"; radius: 4 } } states: State { name: "dropDown"; PropertyChanges { target: dropDown; height:40*comboBox.items.length } } transitions: Transition { NumberAnimation { target: dropDown; properties: "height"; easing.type: Easing.OutExpo; duration: 1000 } } } } 对于新用户,QT5.3Qtquick.controlscombobox-compore..中有一个内置ComboBox 文档中的示例: import QtQuick 2.2 import QtQuick.Controls 1.2 ComboBox { id: combo editable: true model: ListModel { id: model ListElement { text: "Banana"; color: "Yellow" } ListElement { text: "Apple"; color: "Green" } ListElement { text: "Coconut"; color: "Brown" } } onAccepted: { if (combo.find(currentText) === -1) { model.append({text: editText}) currentIndex = combo.find(editText) } } } 注:我不得不将其作为答案,因为文本要长时间发表评论。 我一直在使用ComboBoxStyle(自定义功能有限)和完全自定义实现的方法,但是它们在focus管理和管理方面有很多限制。 我最终以2部分组成的实现the的实现:您实际上放置在某个地方的标题和您动态创建的下拉组件。后者包括覆盖所有内容(和拦截鼠标活动)和一个小心位于标头下方的下拉列表组成。 代码非常庞大,可以在此处包含,因此您可以在我的博客文章中查看所有代码中的详细信息。 如果您针对诺基亚设备(Symbian或Meego),则可以使用高级QT快速组件。我相信z-index是类似于HTML的ComboBox。 请参见Http://doc.qt.nokia.com/qt-components-symbian/qml-menu.html或http://harmattan-dev.nokia.com/docs/docs/docs/docs/library/library/library/html/html/qt-ctml/qt-components /qt-components-meego-menu.html 如果您针对Symbian,则有SelectionListItem和SelectionDialog: http://doc.qt.nokia.com/qt-components-symbian/qml-selectionlistitem.html

回答 0 投票 0

在Firebird中使用QT存储程序 我从QT和火鸟数据库开始。我完成了驱动程序安装过程,并在数据库上执行操作,例如插入,更新和选择。 当我开始做一个...

使用QT 2.0.1和Firebird 2.1在Linux中进行编程。我创建了一个简单的存储过程测试,该测试将插入到表中。它通过运行控制台来起作用,但是当试图从QT跑步时,它不起作用,也没有任何错误。 SQL代码是:

回答 3 投票 0

如何更改 QtCreator 中的构建目录?

我有一个使用 QtCreator 完成的基于 cmake 的 C++ 项目。我手动编写了 CMakeLists.txt 文件。当从 QtCreator 的命令行构建时,我得到这个目录结构,如 exp...

回答 4 投票 0

在 Windows 上为 Linux / Mac 编译 Qt 项目

是否可以在 Windows 上为 Linux / Mac 编译 Qt 项目? 我正在使用带有 MinGW 和 Qt Creator 的 Qt 5.0.2。

回答 4 投票 0

无法修改 Qt Creator 中的选项卡设置

我想用tab键插入2个空格。 所有其他解决方案似乎都引用了旧版本的 Qt Creator。 工具 -> 选项 -> 文本编辑器 -> 行为 -> 制表符和缩进 没有“选项”选项

回答 2 投票 0

无法在另一台计算机上运行我的exe文件。 “应用程序请求运行时以异常方式终止它”错误

我的exe在我编程的计算机上运行完全正常。它调试得很好,发布得很好,我可以将 exe 文件从“release”文件夹移动到一个新文件中,找到所需的 .dll 文件…

回答 5 投票 0

Qt Creator 有缺陷的套件 - 无法删除它们

我在 Windows XP 上安装了 Qt Creator,里面有几个套件: 桌面Qt 4.8.7 MSVC2008 32位 桌面Qt 4.8.7 MSVC2010 32位 桌面Qt 4.8.7 MSVC2010 64位 桌面 Qt 4.8.7 MinGW44 32...

回答 1 投票 0

QT 不响应外接触摸屏的触摸事件

我正在尝试在 Ubuntu 上使用带有 QT 应用程序的 HMDI/USB 触摸屏。我可以使用触摸屏在操作系统中导航,但我的 QT 应用程序对触摸完全没有响应...

回答 1 投票 0

制作QMYSQL驱动

我试图使用官方网站制作QMYSQL驱动程序:https://doc.qt.io/qt-6/sql-driver.html#qmysql。我在命令行中输入: qt-cmake -G Ninja "C:\Qt1 .8.1\Src\qtbase\src\plugins\

回答 1 投票 0

Qt Creator 中的调试器未正确显示值

对于有关我的问题的一些上下文,我的配置如下: Qt 创建者版本:9.0.2 Qt版本:5.15.8 Qt 套件:“Dekstop Qt 6.6.2 GCC 64 位”的替代品 C++11 操作系统:...

回答 1 投票 0

QtCreator 小部件内的 PCL 查看器,带有 VTK 和 QVTKOpenGLStereoWidget

我需要使用 Qt 小部件创建一个图形窗口,该窗口允许在其中表示我之前使用 PLC 库加载的点云。 这是我到目前为止不起作用的(我

回答 1 投票 0

如何在Qt Creator中配置编译器?

我尝试在 Qt Creator 中编译一些 C++ 代码,但是收到此错误消息: :-1:错误:Qt Creator 需要设置编译器才能构建。配置一个 套件选项中的编译器。 ...

回答 1 投票 0

Windows 中的 Visual Studio 编译器目录

我已经安装了 Visual Studio Community 2015。我想将 Visual Studio 2015 编译器添加到 Qt Creator。所以我进入了这个屏幕。 https://snag.gy/QND9wl.jpg 现在它要求我提供详细信息...

回答 1 投票 0

在 C++ 的 Qt Creator 项目中使用 MuParser 的问题

我正在尝试将 MuParser 包含在我的 Qt Creator 项目中,但我已经努力了很长一段时间才能让它正常工作。 我现在在哪里,似乎无法找到几个符号......

回答 1 投票 0

在Ubuntu上编译Qt项目每次都失败

历史 我已经开始在 www.multiport.us 上挖矿,因此我正在挖掘许多不同的硬币。 Scrypt 硬币和 sha-256。 我不想把所有的硬币都放在 Cryptsy 或 Vircuex 上,所以我正在尝试...

回答 1 投票 0

Qt Creator 中缺少编译器

我最近在我的 win Vista 32 位机器上在线安装了 Qt Creator 2.8.1。 首先,我编写了简单的按钮代码。当我尝试构建时,它显示错误消息: Qt 创建者...

回答 1 投票 0

Mac 上的 Qt Creator 调试器失败

我是一名正在学习斯坦福大学CS106B课程的大学生(我自己不是斯坦福大学的学生),需要使用Qt Creator。 我已经成功设置了 Qt Creator 并且 C++ 程序能够运行...

回答 1 投票 0

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.