qtquick2

How to implement rich text logic on QML TextEdit with QSyntaxHighlighter class in Qt?

南楼画角 提交于 2020-02-02 11:58:07
问题 I have a TextEdit in my QML file and I have a QSyntaxHighlighter C++ class. I want to specify the highlighting logic in the C++ class and apply it to the TextEdit, but I am not sure how to make the connection between the QML object and the C++ class. Can you also please provide some sample code? I couldn't find how to implement it with the Qt documentation. 回答1: You can use TextEdit::textDocument, which holds an instance of QQuickTextDocument, to gain access to the underlying QTextDocument

Qt show application, if currently running

霸气de小男生 提交于 2020-01-26 03:41:07
问题 I'm creating a single instance app, which is minimised to system tray, I want to show the currently running instance, then quit the new one. How can I create this functionality? main.cpp #include <QApplication> #include <QQmlApplicationEngine> #include <QIcon> #include <QQuickWidget> #include <QSystemTrayIcon> #include <QQmlContext> #include <QQmlEngine> #include <QSystemSemaphore> #include <QSharedMemory> // Declare a user-defined data type to work with an icon in QML Q_DECLARE_METATYPE

How to disable rendering in QML WebView?

╄→гoц情女王★ 提交于 2020-01-25 06:01:40
问题 I am currently building an application that makes use of QML WebView ( import QtWebKit 3.0 ). The users need to resize the WebView very often (I am using a QML SplitView ), however this leads to the UI to lag extremely whenever the app window is resized. Is there any way to prevent this? 回答1: Instead of changing the width and height properties change scale property of the WebView . At beginning of the resize save initial values of width and height . On resize don't change width and height .

Does PyQt5/pyqt4 already supports QtVirtualKeyboard with Handwriting Recognition?

∥☆過路亽.° 提交于 2020-01-24 23:11:22
问题 I'm working on a desktop application using pyqt5, and I want to use a Virtual Keyboard with Handwriting Recognition. I saw that Qt, QtVirtualKeyboard already support it. Here's a link! I got the C++ Qt example code running on QtCreator. But using python3.5 and PyQt5 it gives this message: module "QtQuick.VirtualKeyboard" is not installed import QtQuick.VirtualKeyboard 2.1 How should I go on from here? Does PyQt5 comes with VirtualKeyboard module? if no How to install it on PyQt5? 回答1: I been

Does PyQt5/pyqt4 already supports QtVirtualKeyboard with Handwriting Recognition?

谁都会走 提交于 2020-01-24 23:11:02
问题 I'm working on a desktop application using pyqt5, and I want to use a Virtual Keyboard with Handwriting Recognition. I saw that Qt, QtVirtualKeyboard already support it. Here's a link! I got the C++ Qt example code running on QtCreator. But using python3.5 and PyQt5 it gives this message: module "QtQuick.VirtualKeyboard" is not installed import QtQuick.VirtualKeyboard 2.1 How should I go on from here? Does PyQt5 comes with VirtualKeyboard module? if no How to install it on PyQt5? 回答1: I been

Get active Tab from TabView and change item property

柔情痞子 提交于 2020-01-24 09:31:07
问题 In the context of a dual-pane file manager, I have two TabView items side by side, each contains multiple tabs of course, and each Tab loads a TableView showing the content of a specific directory using FolderListModel . SplitView TabView Tab Tab TabView Tab My current task is to implement a toolbar button to toggle the showHidden property of the FolderListModel instance shown in the active tab. Therefore, I need a way to find out what the currently active tab is. Next, once I get the active

QML ListView populate property does not work (its animation)

你离开我真会死。 提交于 2020-01-23 12:29:45
问题 I have following QML ListView inside ueLoginWindow : import QtQuick 2.0 import QtMultimedia 5.5 import QtQuick.Controls 1.3 import QtQuick.Extras 1.4 import QtQuick.Layouts 1.2 import QtQuick.Window 2.2 import QtTest 1.1 import Enginio 1.0 import QtBluetooth 5.5 import QtCanvas3D 1.0 import QtLocation 5.5 import QtNfc 5.5 import QtPositioning 5.5 import QtQuick.LocalStorage 2.0 import QtQuick.XmlListModel 2.0 import QtSensors 5.5 import QtWebChannel 1.0 import QtWebKit 3.0 import QtWebSockets

QML ListView populate property does not work (its animation)

删除回忆录丶 提交于 2020-01-23 12:29:07
问题 I have following QML ListView inside ueLoginWindow : import QtQuick 2.0 import QtMultimedia 5.5 import QtQuick.Controls 1.3 import QtQuick.Extras 1.4 import QtQuick.Layouts 1.2 import QtQuick.Window 2.2 import QtTest 1.1 import Enginio 1.0 import QtBluetooth 5.5 import QtCanvas3D 1.0 import QtLocation 5.5 import QtNfc 5.5 import QtPositioning 5.5 import QtQuick.LocalStorage 2.0 import QtQuick.XmlListModel 2.0 import QtSensors 5.5 import QtWebChannel 1.0 import QtWebKit 3.0 import QtWebSockets

error: Unknown module(s) in QT: qml quick - Qt Creator

半世苍凉 提交于 2020-01-21 03:56:26
问题 I installed Qt Creator via the Software Manager on Linux Mint 18 (x86_64) . I made a few sample projects, and some dependencies/packages/libraries/whatever were missing, so I installed the via apt. I made a QtQuick application and in Issues there is an error message saying: error: Unknown module(s) in QT: qml quick I read that there is some libraries to build and link, but I don't know where to find them. 回答1: According to Hayt's answer (and the askubuntu post), I had to install the

error: Unknown module(s) in QT: qml quick - Qt Creator

半城伤御伤魂 提交于 2020-01-21 03:56:06
问题 I installed Qt Creator via the Software Manager on Linux Mint 18 (x86_64) . I made a few sample projects, and some dependencies/packages/libraries/whatever were missing, so I installed the via apt. I made a QtQuick application and in Issues there is an error message saying: error: Unknown module(s) in QT: qml quick I read that there is some libraries to build and link, but I don't know where to find them. 回答1: According to Hayt's answer (and the askubuntu post), I had to install the