Browse Source

Switched to QWT

Dmitry Yu Okunev 5 years ago
parent
commit
bf170a2bd2
5 changed files with 22 additions and 18 deletions
  1. 3 0
      .gitmodules
  2. 1 0
      3rdparty/qwt
  3. 2 1
      mainwindow.cpp
  4. 9 17
      mainwindow.ui
  5. 7 0
      rmui.pro

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "3rdparty/qwt"]
+	path = 3rdparty/qwt
+	url = https://github.com/osakared/qwt

+ 1 - 0
3rdparty/qwt

@@ -0,0 +1 @@
+Subproject commit 3bbb09072a2781864c620b1ec1fb366430f803ea

+ 2 - 1
mainwindow.cpp

@@ -31,7 +31,8 @@ MainWindow::MainWindow(QWidget *parent) :
     this->setWindowTitle("RM control interface");
     this->ui->centralWidget->installEventFilter(this);
     this->ui->toolsWidget->installEventFilter(this);
-
+    this->ui->ADC1Plot->setAxisScale(QwtPlot::yLeft, 0, 4095);
+    this->ui->ADC2Plot->setAxisScale(QwtPlot::yLeft, 0, 4095);
 }
 
 MainWindow::~MainWindow()

+ 9 - 17
mainwindow.ui

@@ -42,32 +42,17 @@
         <enum>QLayout::SetMaximumSize</enum>
        </property>
        <item>
-        <widget class="QOpenGLWidget" name="ADC1Graphic">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
+        <widget class="QwtPlot" name="ADC1Plot">
          <property name="minimumSize">
           <size>
            <width>300</width>
            <height>150</height>
           </size>
          </property>
-         <property name="focusPolicy">
-          <enum>Qt::NoFocus</enum>
-         </property>
         </widget>
        </item>
        <item>
-        <widget class="QOpenGLWidget" name="ADC2Graphic">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
+        <widget class="QwtPlot" name="ADC2Plot">
          <property name="minimumSize">
           <size>
            <width>300</width>
@@ -374,6 +359,13 @@
   </widget>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
+ <customwidgets>
+  <customwidget>
+   <class>QwtPlot</class>
+   <extends>QFrame</extends>
+   <header>qwt_plot.h</header>
+  </customwidget>
+ </customwidgets>
  <resources/>
  <connections/>
 </ui>

+ 7 - 0
rmui.pro

@@ -18,3 +18,10 @@ SOURCES += main.cpp\
 HEADERS  += mainwindow.h
 
 FORMS    += mainwindow.ui
+
+win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../opt/qwt/lib/release/ -lqwt
+else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../opt/qwt/lib/debug/ -lqwt
+else:unix: LIBS += -L$$PWD/../../../opt/qwt/lib/ -lqwt
+
+INCLUDEPATH += $$PWD/../../../opt/qwt
+DEPENDPATH += $$PWD/../../../opt/qwt