QCustomPlot

setDateTimeFormat adds an hour

淺唱寂寞╮ 提交于 2019-12-11 23:20:26
问题 I would like to display my x axis in the hh:mm:ss format. It basicaly works, but there is one problem. The displayed time doesnt start from 00:00:00 but from 01:00:00. I thought maybe its because the time is in ap mode, but I havent specified that, here is how I do it: customPlot->xAxis->setTickLabelType(QCPAxis::ltDateTime); customPlot->xAxis->setDateTimeFormat("hh:mm:ss"); And the plot at point 0 starts from hour 1: I would appreciate all help regarding this. How to make the starting point

QT QCustomPlot parent

和自甴很熟 提交于 2019-12-11 16:47:54
问题 I have a QCustomPlot widget in my ui as follows: ui->plot_widget also I have another QCustomPlot object in my cpp file as follows: QCustomPlot *plot=new QCustomPlot(); I want to add plot data into ui->plot_widget data. If I use ui->plot_widget=plot the widget parent of ui->plot_widget will be destroyed and my ui does not update ui->plot_widget . How can I add plot data into ui->plot_widget data? 来源: https://stackoverflow.com/questions/48345789/qt-qcustomplot-parent

QT QCustomPlot in a new thread

匆匆过客 提交于 2019-12-11 14:33:30
问题 In my UI, I have a QCustomPlot and I have generatePlot function which uses from this QCustomPlot and runs in a new thread as follows: future = QtConcurrent::run(this, &MainWindow::generatePlot); In generatePlot function, I create QCPbars like this: QCPBars *bar = new QCPBars(customPlot->xAxis, customPlot->yAxis); But, I get this error : QObject: Cannot create children for a parent that is in a different thread. I think that's because the thread of customPlot is diffrenet from bar . How can I

QCustomPlot linker

落花浮王杯 提交于 2019-12-11 04:38:52
问题 I would like to use the features of QCustomPlot to draw some results from my openCV projects. I didn't find a way to include QCustomPlot to my Microsoft Visual Studio 2010. I have included or course the cpp and h file into my project. But, I think what is still missing for me is regarding its linker and the additional dependencies (.lib file) 1>moc_ex4.obj : error LNK2019: unresolved external symbol "public: void __thiscall ex4::plot_graphs(void)" (?plot_graphs@ex4@@QAEXXZ) referenced in

Display 12digit double or int as full instead of 3.23223e+9 on QLabel

两盒软妹~` 提交于 2019-12-11 00:15:11
问题 C++ is displaying a number 3232235975 on QLabel as 3.23223e+9 , while on QCustomPlot axis as 3.23223*10^9 . I am not involving stream such as std::cout , that is why std::setprecision doesn't work for my case. Am actually working with QCustomPlot to plot graph with 12digit numbers on the axis. Is this C++ issue or is it QCustomPlot mechanism issue? How can I display all the digits of the number? Thanks EDIT: After receiving hint of setNumberPrecision() from @saeed, now the coordination is

How to plot large time series with QCustomPlot efficiently?

眉间皱痕 提交于 2019-12-07 12:22:40
问题 I am currently plotting a digital signal in Qt with QCustomPlot but it seems that when the number of samples is greater than 10000000 the operation becomes very slow. I have a time vector and a data vector and I'm setting the data like this: QCustomPlot *plot; QCPGraph *graph; graph->setData(time, data); Any chance to make this more efficient? 回答1: Because QCustomPlot uses internally a QCPDataMap (which is a typedef of QMap<double, QCPData> ) this means that it is using a map to store the

How to plot large time series with QCustomPlot efficiently?

限于喜欢 提交于 2019-12-06 01:56:58
I am currently plotting a digital signal in Qt with QCustomPlot but it seems that when the number of samples is greater than 10000000 the operation becomes very slow. I have a time vector and a data vector and I'm setting the data like this: QCustomPlot *plot; QCPGraph *graph; graph->setData(time, data); Any chance to make this more efficient? Because QCustomPlot uses internally a QCPDataMap (which is a typedef of QMap<double, QCPData> ) this means that it is using a map to store the actual data sorted by x coordinates (keys). Unfortunately the QCPGraph::setData(const QVector<double> &x, const

Tooltip-like squares on a QCustomPlot widget

左心房为你撑大大i 提交于 2019-12-04 04:52:18
问题 I am using QCustomPlot in Qt Creator. I haven't specified any tooltips for my widget or anything. When I hold down my cursor on the plot without moving, an empty tooltip-like thing appears. I am wondering how to turn this off. I appreciate any hint in this matter. 回答1: Thanks for help guys, in the MainWindow.ui file I had to remove this part of code (it was auto generated): <property name="toolTip"> <string><html><head/><body><p><br/></p></body></html></string> </property> 来源: https:/

Qt编写气体安全管理系统1-项目框架

老子叫甜甜 提交于 2019-12-04 04:17:06
一、前言 说到项目框架,也叫代码框架,其实是非常重要的,随着编程经验的增加,相信每个程序员都会有一个自己的习惯的项目框架,这个东西跟建房子一样,先把架子搭好,然后挨个往里边填充内容,据说牛逼的架构师都是负责搭建好框架,然后安排手下的人负责编写具体的业务逻辑代码,最多再写点核心算法,一般来说至少要5年以上工作经验的牛人才有这个实力。框架搭建得好,有事半功倍的效果,搭建框架的时候就已经在考虑后期的拓展了。 我一般写Qt项目的框架,都喜欢用pri文件进行管理,pri是个好东西,其实就是个文本文件,专门进行分类管理代码文件,建议各位可以多用,除非你的项目就一两个代码文件没有必要使用之外,可能大部分人接触的都是pro文件,如果代码文件数量比较多比如几十个的话,全部堆在pro文件中,看起来实在是乱七八糟的,在项目树视图中而且还要滚动条拉来拉去找代码文件,极其的不方便,眼睛都会看花。我的项目框架一般都是不同的pri对应不同的文件夹,这样每个文件夹下的代码文件数量不会太多,好找,清清爽爽干净整洁,看起来相当舒服,有个舒适的心情,写代码效率也更高。 通用的组件放一起,比如数据打印导出组件、邮件转发组件、短信转发组件等。 第三方开源的组件放一起,比如串口类qextserialport、曲线图表类qcustomplot、属性控件类qtpropertybrowser。

QCustomPlot - show item on QCPAxisRect below customPlot

天涯浪子 提交于 2019-12-04 00:50:47
In a project resembling the QCustomPlot financial demo I want to draw a QCPItemRect not only into the chart area, but also to the area below the chart. Having QCPAxisRect * xRect = new QCPAxisRect( this->ui.customPlot ) ... this->ui.customPlot->plotLayout()->addElement(1, 0, xRect); I want to add the QCPItemRect like QCPItemRect * xItem = new QCPItemRect( this->ui.customPlot ); xItem -> setPen ( QPen ( Qt::black )); xItem -> bottomRight ->setAxisRect( this->xRect ); xItem -> topLeft ->setAxisRect( this->xRect ); xItem -> bottomRight ->setCoords(x - 2.0, y - 2.0); xItem -> topLeft ->setCoords(x