Qt控件_QTextEdit
阅读原文时间:2021年04月23日阅读:1

setText()中只能填写QString类型

// 函数头应首先包括

#include <QString>

vector< cv::DMatch > matches;
QString str_match;

// 转换为字符串形式在QTextEdit中显示,通过arg()函数

str_match= QString("%1").arg(matches.size());

matches.clear();// 使用完vector容器中的内容后,通过clear()清空其中元素,但不回收空间

ui->match_ORB->setText( str_match);

参考:https://www.cnblogs.com/xiangwengao/archive/2012/03/23/2413257.html

备注:
QString的arg()方法用于填充字符串中的%1,%2…为给定的参数,如
QString m = tr("%1:%2:%3").arg(“12”).arg(“60”).arg(“60”); // m = 12:60:60

cv::solvePnPRansac( pts_obj, pts_img, cameraMatrix, cv::Mat(), rvec, tvec, false, 100, 1.0, 100, inliers);

参考:
https://wiki.qt.io/How_to_Use_QTextEdit
https://blog.csdn.net/EI__Nino/article/details/7297791

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章