qt

Qt Bluetooth on iOS

匆匆过客 提交于 2021-02-10 06:31:09
问题 I tried to search for an answer for my query. It seems trivial, but I cant find an answer yet. I am trying to run a program using Qt Bluetooth on iOS. I am able to use it successfully on MacOS. But even the most basic feature of code like : QBluetoothLocalDevice localDevice; QString localDeviceName; // Check if Bluetooth is available on this device if (localDevice.isValid()) { // Turn Bluetooth on localDevice.powerOn(); // Read local device name localDeviceName = localDevice.name(); // Make

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:

QT5.9连接MySQL5.7解决QSqlDatabase: QMYSQL driver not loaded问题

偶尔善良 提交于 2021-02-08 18:00:29
QT5.9连接MySQL5.7解决QSqlDatabase: QMYSQL driver not loaded问题 参考文章: (1)QT5.9连接MySQL5.7解决QSqlDatabase: QMYSQL driver not loaded问题 (2)https://www.cnblogs.com/linzijie1998/p/11096167.html 备忘一下。 来源: oschina 链接: https://my.oschina.net/u/4437974/blog/4950977

How to set QML MapPolyline Path Property

走远了吗. 提交于 2021-02-08 14:57:15
问题 I have a MapPolyline object in my QtQuick Project. I need to change the path property from the C++ file, but I have no idea how to do that. My qml - File: MapPolyline { id: mapline objectName: "MapLine" line.width: 5 line.color: "green" path: {[ { latitude: 47.219791, longitude: 9.546032 }, { latitude: 47.219657, longitude: 9.542508 }, { latitude: 47.2194446, longitude: 9.5437876 } ]} } And now I want to change the content of the path property from the C++ file. Thanks for the help! 回答1: Qt

Qt on Mac — how to access “search” in help menu

一世执手 提交于 2021-02-08 13:43:43
问题 I am porting my Qt app to Mac OS X. On Windows/Linux I've used a QLineEdit to provide a search feature in the Help menu. In Mac OS X, I saw something like this is built-in: How can I access this search bar with Qt (i.e., add my own elements to it)? I looked at QMenuBar in the docs but couldn't find anything relevant. If it's not possible, can I at least use some native API from my C++ Qt app? Thanks a lot. 回答1: It seems you can't do this directly through Qt, however, you can implement this

Qt on Mac — how to access “search” in help menu

帅比萌擦擦* 提交于 2021-02-08 13:42:34
问题 I am porting my Qt app to Mac OS X. On Windows/Linux I've used a QLineEdit to provide a search feature in the Help menu. In Mac OS X, I saw something like this is built-in: How can I access this search bar with Qt (i.e., add my own elements to it)? I looked at QMenuBar in the docs but couldn't find anything relevant. If it's not possible, can I at least use some native API from my C++ Qt app? Thanks a lot. 回答1: It seems you can't do this directly through Qt, however, you can implement this

XWarpPointer does not work on ubuntu 12.04 in wmware player

五迷三道 提交于 2021-02-08 11:30:23
问题 Hello i'm trying to move the mouse pointer by using Xlib in my Qt application: cout <<"move mouse to "<<x<<","<<y<<endl; XWarpPointer(defaultdisplay, None, desktoproot, 0, 0, 0, 0, x, y); XFlush(defaultdisplay); //QCursor::setPos(x,y); but this not work in an ubuntu that is inside a wmware player (maybe vmware tools uses X11), any idea for disabling the vmware mouse integration or using any other code? thanks. 回答1: i finally found the solucion, all i needed to do is edit the .vmx file in my

format date/time value shown by a QTableView

北战南征 提交于 2021-02-08 11:14:09
问题 I´m using a QTableView to show a database table via model. One of the table columns have a timestamp, acctually a QDateTime was stored there before. Is there some way to format the timestamp value at presentation time? I was thinking in something like the .toString of a QDateTime("yyyy-MM-dd hh:mm:ss.zzz") . 回答1: It is possible to return date formatted as you wish in this virtual method of QAbstractItemModel : QVariant QAbstractItemModel::data(const QModelIndex &item, int role = Qt:

format date/time value shown by a QTableView

人走茶凉 提交于 2021-02-08 11:13:02
问题 I´m using a QTableView to show a database table via model. One of the table columns have a timestamp, acctually a QDateTime was stored there before. Is there some way to format the timestamp value at presentation time? I was thinking in something like the .toString of a QDateTime("yyyy-MM-dd hh:mm:ss.zzz") . 回答1: It is possible to return date formatted as you wish in this virtual method of QAbstractItemModel : QVariant QAbstractItemModel::data(const QModelIndex &item, int role = Qt: