plotwindow can load csv files
This commit is contained in:
parent
e5d1df9dbc
commit
81de09d563
8 changed files with 150 additions and 22 deletions
|
@ -11,9 +11,12 @@ class MainWindow : public QMainWindow
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget* parent = nullptr);
|
||||
explicit MainWindow(char** argv, QWidget* parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
int Failed() { return error_code; }
|
||||
|
||||
private:
|
||||
Ui::MainWindow* ui;
|
||||
int error_code;
|
||||
};
|
28
include/PlotWidget.hpp
Normal file
28
include/PlotWidget.hpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <vector>
|
||||
|
||||
namespace Ui {
|
||||
class PlotWidget;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
double x, y;
|
||||
} DataPoint;
|
||||
|
||||
class PlotWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PlotWidget(QWidget* parent = nullptr);
|
||||
~PlotWidget();
|
||||
|
||||
int SetDataSource(const std::string& filename);
|
||||
|
||||
private:
|
||||
Ui::PlotWidget* ui;
|
||||
|
||||
std::vector<DataPoint>* data;
|
||||
};
|
|
@ -11,27 +11,20 @@
|
|||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
<string>Regression</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="PlotWidget" name="plot" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>146</x>
|
||||
<y>102</y>
|
||||
<width>271</width>
|
||||
<height>91</height>
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
<width>801</width>
|
||||
<height>551</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>28</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
|
@ -41,12 +34,20 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>21</height>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>PlotWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>PlotWidget.hpp</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
36
include/ui/PlotWidget.ui
Normal file
36
include/ui/PlotWidget.ui
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PlotWidget</class>
|
||||
<widget class="QWidget" name="PlotWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>718</width>
|
||||
<height>572</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QTextBrowser" name="tmp_CSVDisplay">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>35</x>
|
||||
<y>31</y>
|
||||
<width>651</width>
|
||||
<height>511</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:6.6pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Add table
Add a link
Reference in a new issue