问题标签 [qtquick2]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c++ - QtQuick 2.1 从 TextInput 获取文本
我试图获取用户在 textField qml 元素中插入的文本并将其发送到函数。我已经将方法从 c++ 导出到 qml 并且工作正常,现在我不知道如何发送字段值这里的方法是qml源代码:
那么问题是如何获取TextField中的值呢?
xml - 仅在 XmlListModel 准备好后如何更新 QML ListView?
我有一个 XmlListModel,它最初查询一个本地 XML 文件,该文件有一个世界共同城市的列表以及它们的纬度和经度。如果用户在该本地列表中找不到城市,XML ListModel 然后查询在线 API 以检索城市的纬度、经度。
因此,如代码所示,默认情况下,它使用 localCityUrl() 函数作为其源来显示本地城市列表。
在这一点上一切都很好。然而,当用户在线搜索一个城市时(因为它在本地列表中不可用),它会更改源以查询在线 API,该 API 默认始终返回 5 个结果(与用户搜索词的最佳匹配)。
我包含了一个后退按钮,单击该按钮会使用下面的代码将 XML ListModel 源更改回本地文件,
但是,在这样做时,我收到错误消息,
它基本上是在抱怨它试图读取 Xml ListModel 的值以分配给文本委托的行。
我如何确保它只在 Xml ListModel 准备好时才尝试这样做?我已经尝试在 Xml ListModel 中使用 onStatusChanged。
奇怪的是,它仅在从在线更改为本地时才抱怨源更改。所以当用户第一次在线搜索时,并没有显示任何错误。但是只有当用户按下后退按钮切换到本地源时,才会出现错误。
qml - Hide the highlight of a ListView while scrolling
I am building a Qt5 application based on Qt-Quick 2 for the UI. I have an issue while displaying a ListView with an highlight component. When I scroll the ListView the highlight rectangle is visible outside of the ListView and I can't find a way to avoid it.
Here is an example of the issue with a minimal QML file:
Is there a way to "limit" a component to its parent borders or to hide the highlight component while scrolling?
video-streaming - 使用 QtQuick 的实时视频流
我想在我的 QML/QtQuick 应用程序中尽可能接近实时地流式传输视频。
我已经测试过:
使用 vlc 作为服务器(0ms 缓冲区)和 stream-m,两者的延迟都长达 30 秒。所以我的问题是双重的:
- QtQuick 支持哪些流媒体格式?
- 我应该使用什么类型的媒体进行流式传输;比如说我的网络摄像头,尽可能接近实时?
qml - 如何在 QT Quick 2 上制作翻转效果以切换面板
我正在使用 QT Quick 2 来构建 UI。它由 5 个面板组成,一次显示一个。所以我想写一个翻转效果来在这些面板之间切换。我发现 Flipable 元素效果是我想要的,但它只能翻转两个面板。我怎样才能为 5 个面板完成这项工作?
5 个面板将被触发随机出现(通过 5 个按钮)而不是按顺序出现。
javascript - 等待QML界面中两个按钮被点击
我又一次绝望了。我已将 QML 接口添加到现有 QT C++ 应用程序。知道我想实现这样的东西:
用户想连接图片让他们同步跳过。所以他点击了一个名为“连接”的按钮,然后点击第一张图片,然后点击第二张图片。按钮的信号带有一个 id,因此 connect-Function 知道点击了哪些图片并将最终信号发送到 c++ 部分。
我想要这样的东西:
那么,有谁知道如何解决这个问题?
非常感谢!
c++ - QtQuick2 and C++ : Using a Repeater
I'm using Qt 5.0.2 and QtQuick 2.0 to try building a very simple QML application, displaying tiles.
I want the tiles to be dynamically created with a repeater, interfacing C++.
I found an example on how to do it (MineHunt
), but this example is using QtQuick 1 and Qt 4.7.
Here is my code :
This file imports a folder named tiles
containing another QML file named tile.qml
which contains the following code :
I also have a class which implements methods needed to provide the tiles
model.
It compiles fine but when I run it, I get the following error :
What's wrong with my code ?
qt5 - QtQuick application starts in a client machine but not in another
I have a QtQuick application based on Qt5.1 that starts on my machine (developer-WIN7) and on another (client-WIN8) machine but not on another client(WIN7) (there is no errors) ?
the previous version of my app which uses Qt5.0.2 works good on the same client.
Have you an idea of what the problem is how can i find the problem ?
Thank you.
Edit: I have deleted the grafic driver and the application is opened but there is a blank screen.
dynamic - QtQuick:无法从子级访问动态添加的属性
我有一个类似于这样的结构:
该项目将通过createObject(baz, {"gridMap": gridMap})
where从另一个项目创建gridMap: []
。
为什么我会得到类似于以下的输出?
qml - How to make TableView Items draggable
I’ve a TableView and have implemented my own item delegate for it. I want to be able to drag it out and place it somewhere else. How do I do it
Don’t mind if there are a few brackets less here and there. Those I’m taking care of ofcourse. But why can’t I drag objDragableText
and how do i do it?
Also, onClicked
is captured as in the comments above but not onPressed
. How do I also do this?
{Qt 5.1 RC 1 - Win7 - MinGw 4.8}