qt

How to change the Mac OS X Keyboard Layout programmatically?

浪尽此生 提交于 2021-02-07 09:33:34
问题 My Qt app supports changing input language on Linux and Windows. I want to add support for changing the input language in Mac OSX, too. Unfortunately I don't have any information about the Mac SDK. (My first and last work with OS X was compiling Qt and compiling my app!) I googling this problem and found that I need to use Text Input Source Services and also I found these codes: TISInputSourceRef isref; isref = TISCopyCurrentKeyboardInputSource(); CFDataRef uchr = (CFDataRef

How to change the Mac OS X Keyboard Layout programmatically?

故事扮演 提交于 2021-02-07 09:33:17
问题 My Qt app supports changing input language on Linux and Windows. I want to add support for changing the input language in Mac OSX, too. Unfortunately I don't have any information about the Mac SDK. (My first and last work with OS X was compiling Qt and compiling my app!) I googling this problem and found that I need to use Text Input Source Services and also I found these codes: TISInputSourceRef isref; isref = TISCopyCurrentKeyboardInputSource(); CFDataRef uchr = (CFDataRef

How to change the Mac OS X Keyboard Layout programmatically?

拜拜、爱过 提交于 2021-02-07 09:33:01
问题 My Qt app supports changing input language on Linux and Windows. I want to add support for changing the input language in Mac OSX, too. Unfortunately I don't have any information about the Mac SDK. (My first and last work with OS X was compiling Qt and compiling my app!) I googling this problem and found that I need to use Text Input Source Services and also I found these codes: TISInputSourceRef isref; isref = TISCopyCurrentKeyboardInputSource(); CFDataRef uchr = (CFDataRef

Get HANDLE from QFile

我是研究僧i 提交于 2021-02-07 09:21:56
问题 I have a QFile , but I need to call some Win32 functions on it that accept only a HANDLE . Is there a way to retrieve the underlying HANDLE of the QFile ? 回答1: I found a way that uses _get_osfhandle() (available in MinGW and VS): QFile file; .... HANDLE handle = (HANDLE) _get_osfhandle(file.handle()). 来源: https://stackoverflow.com/questions/19707263/get-handle-from-qfile

draging a point on qtcharts in qml

人走茶凉 提交于 2021-02-07 08:56:21
问题 I am trying to drag a point on LineSeries on qtcharts. Here is my code: import QtQuick 2.0 import QtCharts 2.0 Item { anchors.fill: parent ChartView { title: "Two Series, Common Axes" anchors.fill: parent ValueAxis { id: axisX min: 0 max: 10 tickCount: 5 } ValueAxis { id: axisY min: -0.5 max: 1.5 } LineSeries { id: series1 axisX: axisX axisY: axisY onPressed: console.log("Pressed: " + point.x + ", " + point.y); onReleased: console.log("Released: " + point.x + ", " + point.y); } } // Add data

draging a point on qtcharts in qml

旧时模样 提交于 2021-02-07 08:56:11
问题 I am trying to drag a point on LineSeries on qtcharts. Here is my code: import QtQuick 2.0 import QtCharts 2.0 Item { anchors.fill: parent ChartView { title: "Two Series, Common Axes" anchors.fill: parent ValueAxis { id: axisX min: 0 max: 10 tickCount: 5 } ValueAxis { id: axisY min: -0.5 max: 1.5 } LineSeries { id: series1 axisX: axisX axisY: axisY onPressed: console.log("Pressed: " + point.x + ", " + point.y); onReleased: console.log("Released: " + point.x + ", " + point.y); } } // Add data

draging a point on qtcharts in qml

蹲街弑〆低调 提交于 2021-02-07 08:54:47
问题 I am trying to drag a point on LineSeries on qtcharts. Here is my code: import QtQuick 2.0 import QtCharts 2.0 Item { anchors.fill: parent ChartView { title: "Two Series, Common Axes" anchors.fill: parent ValueAxis { id: axisX min: 0 max: 10 tickCount: 5 } ValueAxis { id: axisY min: -0.5 max: 1.5 } LineSeries { id: series1 axisX: axisX axisY: axisY onPressed: console.log("Pressed: " + point.x + ", " + point.y); onReleased: console.log("Released: " + point.x + ", " + point.y); } } // Add data

Instantiating C++ objects from QML has tremendous memory usage overhead

此生再无相见时 提交于 2021-02-07 07:59:37
问题 Instantiating a QObject derived class on the heap in C++ gives me roughly about 160 bytes per object. Registering the same object via qmlRegisterType() for creation from QML and creating the object dynamically via createObject() gives me a little over 2000 bytes per object. That's quite the difference, almost 13 times more memory per object is being used when creating from QML. Note that the object doesn't have any bindings or anything extra compared to how it is in C++. Naturally, being

Instantiating C++ objects from QML has tremendous memory usage overhead

谁说我不能喝 提交于 2021-02-07 07:58:25
问题 Instantiating a QObject derived class on the heap in C++ gives me roughly about 160 bytes per object. Registering the same object via qmlRegisterType() for creation from QML and creating the object dynamically via createObject() gives me a little over 2000 bytes per object. That's quite the difference, almost 13 times more memory per object is being used when creating from QML. Note that the object doesn't have any bindings or anything extra compared to how it is in C++. Naturally, being

Drag file from application to explorer. Can my application do the copying?

廉价感情. 提交于 2021-02-07 07:23:14
问题 In Qml I can start a drag using the text/uri-list mime type in order to start a copy action from my application into a file explorer, e.g. Item { id: draggable anchors.fill: parent Drag.active: mouseArea.drag.active Drag.hotSpot.x: 0 Drag.hotSpot.y: 0 Drag.mimeData: { "text/uri-list": "file:///home/myname/Desktop/avatar.jpeg" } Drag.supportedActions: Qt.CopyAction Drag.dragType: Drag.Automatic Drag.onDragStarted: { } Drag.onDragFinished: { console.log("Time to copy") } } // Item or Item { id: