qt5

Qt5学习笔记 2.1_字符串类

ⅰ亾dé卋堺 提交于 2020-03-01 18:08:26
操作字符串 字符串拼接的五种方法 /******************************操作字符串******************************/ /***first***/ QString str1="welcome ";//str1="welcome" str1=str1+"to you! ";//str1="welcome to you!" qDebug("str1=%s\n",qPrintable(str1)); /***second***/ QString str2="Hellow! ";//str2="Hellow! " str1.append(str2);//str1="welcome to you! Hellow! " str1.append("you! ");//str1="welcome to you! Hellow! you! " qDebug("str1=%s\n", qPrintable(str1)); /***third***/ QString str3; str3.sprintf("%s", " welcome ");//str3= " welcome " str3.sprintf("%s", " to you! ");//str3=" welcome to you! " str3.sprintf("%s %s",

QML. How to change MapPolyline path from C++?

主宰稳场 提交于 2020-02-27 03:33:27
问题 Here is a QML map: Map { anchors.fill: parent plugin: osmMapPlugin center: QtPositioning.coordinate(56.006355, 92.860984) zoomLevel: 14 MapPolyline { line.width: 3 line.color: 'red' path: [ { latitude: -27, longitude: 153.0 }, { latitude: -27, longitude: 154.1 }, { latitude: -28, longitude: 153.5 }, { latitude: -29, longitude: 153.5 } ] } } How to change path from C++/qt ? I tried this: QML: Map { anchors.fill: parent plugin: osmMapPlugin center: QtPositioning.coordinate(56.006355, 92.860984)

QML. How to change MapPolyline path from C++?

落花浮王杯 提交于 2020-02-27 03:33:27
问题 Here is a QML map: Map { anchors.fill: parent plugin: osmMapPlugin center: QtPositioning.coordinate(56.006355, 92.860984) zoomLevel: 14 MapPolyline { line.width: 3 line.color: 'red' path: [ { latitude: -27, longitude: 153.0 }, { latitude: -27, longitude: 154.1 }, { latitude: -28, longitude: 153.5 }, { latitude: -29, longitude: 153.5 } ] } } How to change path from C++/qt ? I tried this: QML: Map { anchors.fill: parent plugin: osmMapPlugin center: QtPositioning.coordinate(56.006355, 92.860984)

How to execute a shell command under Linux unsing QProcess?

…衆ロ難τιáo~ 提交于 2020-02-24 11:32:07
问题 I am trying to read the screen resolution from within a Qt application, but without using the GUI module. So I have tried using: xrandr |grep \* |awk '{print $1}' command through QProcess , but it shows a warning and does not give any output: unknown escape sequence:'\\*' Rewriting it with \\\* does not help, as it leads to the following error: /usr/bin/xrandr: unrecognized option '|grep'\nTry '/usr/bin/xrandr --help' for more information.\n How can I solve that? 回答1: You have to use bash and

QML MapPolygon from C++ model

我的未来我决定 提交于 2020-02-24 06:37:28
问题 I want to dynamically add/remove/edit MapPolygon in QML Map application. I have some others jobs with created polygons (file export/import etc.) so I think that I should use MapItemView with C++ model sotirng Polygons data. I tried to create my own model with my own QObject based objects: Object: class MODELSHARED_EXPORT Polygon : public QObject { Q_OBJECT Q_PROPERTY(QList<QGeoCoordinate> coordinates READ coordinates WRITE setCoordinates NOTIFY coordinatesChanged) public: explicit Polygon

QML MapPolygon from C++ model

醉酒当歌 提交于 2020-02-24 06:37:08
问题 I want to dynamically add/remove/edit MapPolygon in QML Map application. I have some others jobs with created polygons (file export/import etc.) so I think that I should use MapItemView with C++ model sotirng Polygons data. I tried to create my own model with my own QObject based objects: Object: class MODELSHARED_EXPORT Polygon : public QObject { Q_OBJECT Q_PROPERTY(QList<QGeoCoordinate> coordinates READ coordinates WRITE setCoordinates NOTIFY coordinatesChanged) public: explicit Polygon

PyQt Set column widths

百般思念 提交于 2020-02-21 13:20:18
问题 I've got a simple QTableView and I essentially want to emulate this: view.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents) However, I cannot actually use this, since this calls sizeHint on every single row, which is unacceptable in my case, since the widget needs to be responsive on startup and the calculations take a long time for all the rows. Therefore this is not an option. I know what the size of a single column, which is always the same, and is always the one with

PyQt Set column widths

≡放荡痞女 提交于 2020-02-21 13:18:33
问题 I've got a simple QTableView and I essentially want to emulate this: view.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents) However, I cannot actually use this, since this calls sizeHint on every single row, which is unacceptable in my case, since the widget needs to be responsive on startup and the calculations take a long time for all the rows. Therefore this is not an option. I know what the size of a single column, which is always the same, and is always the one with

PyQt Set column widths

谁都会走 提交于 2020-02-21 13:17:31
问题 I've got a simple QTableView and I essentially want to emulate this: view.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents) However, I cannot actually use this, since this calls sizeHint on every single row, which is unacceptable in my case, since the widget needs to be responsive on startup and the calculations take a long time for all the rows. Therefore this is not an option. I know what the size of a single column, which is always the same, and is always the one with

win10 opencv3.4.6+CMake3.15.3+qt5.11(MSVC)+hdf5环境配置

早过忘川 提交于 2020-02-21 11:21:58
1 安装软件 安装QT 可以在这里下载 http://download.qt.io/archive/qt/5.14/ 组件根据个人电脑安装情况选MinGW、msvc的对应版本; 然后添加C:\Qt\Qt5.11.1\5.11.1\msvc2017_64\bin到系统环境变量path中; 安装cmake 下载后,安装点下一步即可,然后把路径加到path中(不加也可以) 安装hdf5 下载源码安装没成功. 下载cmake版本的源码,解压; 源码目录下有相应的bat文件,选择合适的bat文件,(我直接运行bat文件,失败了),复制里面的文本; 管理员模式打开cmd或者powershell,进入解压的文件夹下,执行刚才复制的文本; 生成hdf5的压缩包,exe文件(一些情况下)把其中名字类似HDF5-1.10.5-win64.zip的压缩包解压,就是库、包文件; 把bin所在的路径添加到系统环境变量中 visual studio 2017 微软官网下载 sdk工具 还需要安装windows的sdk工具,用于debug, sdk下载 否则可能导致错误: debug时显示the selected debugger may be inappropriate for the inferior… imshow 无法解析的外部命令未找到,但在安装了上面的sdk后,解决问题 2 编译opencv4.1