qml

nextItemInFocusChain function not working in qml on mac?

孤人 提交于 2021-02-11 12:02:23
问题 I have a form where i've done a custom field that only accepts the top, right and bottom arrows. But to accept the tab navigation i'm using the following chain of functions: nextItemInFocusChain().forceActiveFocus() The problem is that this is working on windows but not on mac ... I've a formulary to illustrate the problem where next to that "code text field" i have a comboBox where i want, that when the user clicks on tab in the "code text field" to navigate to. It seems that it only

QML Calendar and Google Calendar API in Python events integration

随声附和 提交于 2021-02-10 23:27:30
问题 I'm currently working on creating a QML Calendar that will ideally display events from a Google calendar. This is an example of what I'd like to emulate in python: https://doc.qt.io/qt-5.9/qtquickcontrols-calendar-example.html Right now, a python file is taking dates and event summaries from the Google Calendar API and returning them as a dictionary (the tenevents variable in the python code) of {date: event summary}. I have a very simple QML window displaying a calendar and a rectangle. I

Notify QML for 'usb device inserted' events using PyQt5 and pyudev

有些话、适合烂在心里 提交于 2021-02-10 22:24:32
问题 I have a GUI application (made with PyQt5 and QML) and would like to get notify when a usb device is plugged or unplugged from the computer. After some investigation, I have found that pyudev could be the library to use. But I have trouble using it with PyQt5 and QML. I have succeed to use the pyudev example for MonitorObservor, and there are other example provided in the documentation, here with PySide and here with Glib. I have also found an example using PyQt5 and widgets application here.

Font stretching in QML

旧城冷巷雨未停 提交于 2021-02-10 18:55:12
问题 We are converting some older QT widget code to use QML and I cannot find the equivalent property for the QFont::setStretch() operation. The QML Font page shows only family, bold, italic, underline, pointSize, pixelSize, weight, overline, strikeout, capitalization, letterSpacing, wordSpacing, kerning, preferShaping and hintingPreference. This font selection is being done within a Text object, along the lines of: Text { font.family: "LiberationSans" font.pixelSize: 178 font.weight: 80 //font

Font stretching in QML

夙愿已清 提交于 2021-02-10 18:50:43
问题 We are converting some older QT widget code to use QML and I cannot find the equivalent property for the QFont::setStretch() operation. The QML Font page shows only family, bold, italic, underline, pointSize, pixelSize, weight, overline, strikeout, capitalization, letterSpacing, wordSpacing, kerning, preferShaping and hintingPreference. This font selection is being done within a Text object, along the lines of: Text { font.family: "LiberationSans" font.pixelSize: 178 font.weight: 80 //font

PyInstaller and QML Files

点点圈 提交于 2021-02-10 16:50:14
问题 How can I include the QML file into my Python project as a single executable. When I run pyinstaller --onefile main.py , running the executable results in an error that the QML file is not found. Unless I use an absolute path or place view.qml in the same directory as my executable. I don't want to have a separate QML file, I want it combined into the executable. main.py: if __name__ == "__main__": app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() engine.load(QUrl("view.qml"))

How to include QtQuickControls

☆樱花仙子☆ 提交于 2021-02-10 15:59:00
问题 I've included to my project : "import QtQuickQontrols 1.4" But now I need to use ScrollBar , and for this, I need to include "import QtQuickControls 2.2" But when I include version 2.2 and delete 1.4, my project is ruined... MenuBar, TableView is under errors! Ok, when I include both this version it's errors , too! I did run qmake, and give me some advice what should I do to implement my ScrollBar. I've tried to add ScrollView, but inside this it doesn't work : .... ScrollBar.vertical:

How to Add Dynamic Data to a QML Table

三世轮回 提交于 2021-02-09 11:46:22
问题 I'm trying to add rows to a table from Python. I'm using a TableView described with QML. I can't figure out how to add a model to the table, unless the model is also in QML. But I can't figure out how to add values to the model. import sys from PyQt5.QtCore import QAbstractTableModel, QObject, QUrl from PyQt5.QtQml import QQmlApplicationEngine from PyQt5.QtQuick import QQuickView from PyQt5.QtWidgets import QApplication myApp = QApplication(sys.argv) engine = QQmlApplicationEngine() context =

QML: SoundEffect not working, Audio does

走远了吗. 提交于 2021-02-08 20:47:59
问题 I have two custom QML elements for audio, one for playing music (and extends the QML Audio element) and one for playing sound effects (which extends QML's SoundEffect element). I am able to play background music with no problem, but when I try to play a sound effect, the interface freezes for a couple of seconds (the music keeps playing) and then when it unfreezes, I get the Windows error sound. Here is what I have (the music has a similar architecture): MySoundEffect.qml Loader { id:

QML: SoundEffect not working, Audio does

限于喜欢 提交于 2021-02-08 20:47:08
问题 I have two custom QML elements for audio, one for playing music (and extends the QML Audio element) and one for playing sound effects (which extends QML's SoundEffect element). I am able to play background music with no problem, but when I try to play a sound effect, the interface freezes for a couple of seconds (the music keeps playing) and then when it unfreezes, I get the Windows error sound. Here is what I have (the music has a similar architecture): MySoundEffect.qml Loader { id: