Skip to content
Snippets Groups Projects
Commit 5aba9747 authored by mingf2's avatar mingf2
Browse files

plot window

parent f9a961bc
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@
#include <QResizeEvent>
#include <QTimer>
#include <TSystem.h>
class QRootCanvas : public QWidget
{
Q_OBJECT
......
......@@ -33,17 +33,21 @@ SOURCES += \
$$PWD/Sources/qrootcanvas.cpp \
$$PWD/Sources/reconstruction.cpp \
$$PWD/Sources/setup.cpp \
$$PWD/Sources/worker.cpp
$$PWD/Sources/worker.cpp \
qcustomcanvas.cpp
HEADERS += \
$$PWD/Headers/MainWindow.h \
$$PWD/Headers/qrootcanvas.h \
$$PWD/Headers/reconstruction.h \
$$PWD/Headers/setup.h \
$$PWD/Headers/worker.h
$$PWD/Headers/worker.h \
qcustomcanvas.h
FORMS += \
MainWindow.ui
MainWindow.ui \
plotcanvas.ui \
plotwindow.ui
QMAKE_LFLAGS += -fopenmp
QMAKE_CXXFLAGS += -fopenmp
......@@ -51,14 +55,14 @@ QMAKE_CXXFLAGS += -fopenmp
#QMAKE_LFLAGS += -fsanitize=address
LIBS += -fopenmp
ROOTSYS=/home/ming/root
#ROOTSYS=/home/ming/root
INCLUDEPATH += \
$$ROOTSYS/include \
$$(ROOTSYS)/include \
$$PWD/Headers
LIBS += \
-L$$ROOTSYS/lib -lCore -lImt -lRIO -lNet -lHist -lGraf \
-L$$(ROOTSYS)/lib -lCore -lImt -lRIO -lNet -lHist -lGraf \
-lGraf3d -lGpad -lTree -lTreePlayer -lRint -lPostscript -lMatrix \
-lPhysics -lMathCore -lThread -lMultiProc -pthread -lm -ldl -rdynamic
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PlotCanvas</class>
<widget class="QMainWindow" name="PlotCanvas">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QRootCanvas" name="canvas" native="true"/>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="actionClear"/>
<addaction name="actionScreenShot"/>
<addaction name="actionSave2Txt"/>
</widget>
<action name="actionClear">
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icons/icons/reload.svg</normaloff>:/icons/icons/reload.svg</iconset>
</property>
<property name="text">
<string>Clear</string>
</property>
</action>
<action name="actionFreeze">
<property name="text">
<string>Freeze</string>
</property>
</action>
<action name="actionScreenShot">
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icons/icons/screenshot.svg</normaloff>:/icons/icons/screenshot.svg</iconset>
</property>
<property name="text">
<string>ScreenShot</string>
</property>
</action>
<action name="actionZoomout">
<property name="text">
<string>Zoomout</string>
</property>
</action>
<action name="actionSave2Txt">
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icons/icons/save.svg</normaloff>:/icons/icons/save.svg</iconset>
</property>
<property name="text">
<string>Save2Txt</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>QRootCanvas</class>
<extends>QWidget</extends>
<header location="global">qrootcanvas.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="resources.qrc"/>
</resources>
<connections/>
</ui>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PlotWindow</class>
<widget class="QMainWindow" name="PlotWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget"/>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>
#include "qcustomcanvas.h"
#include <QDebug>
QCustomCanvas::QCustomCanvas(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::PlotCanvas)
{
ui->setupUi(this);
connect(ui->actionClear, &QAction::triggered, this, &QCustomCanvas::handleClear);
connect(ui->actionFreeze, &QAction::triggered, this, &QCustomCanvas::handleFreeze);
connect(ui->actionZoomout, &QAction::triggered, this, &QCustomCanvas::handleZoomout);
connect(ui->actionScreenShot, &QAction::triggered, this, &QCustomCanvas::handleScreenshot);
connect(ui->actionSave2Txt, &QAction::triggered, this, &QCustomCanvas::handleSave2Txt);
}
QCustomCanvas::~QCustomCanvas()
{
delete ui;
}
void QCustomCanvas::handleSave2Txt()
{
qDebug() << "save canvas to txt";
}
void QCustomCanvas::handleClear()
{
qDebug() << "clear canvas";
}
void QCustomCanvas::handleZoomout()
{
qDebug() << "zoom out";
}
void QCustomCanvas::handleFreeze()
{
qDebug() << "Freeze canvas";
}
void QCustomCanvas::handleScreenshot()
{
qDebug() << "save canvas to image";
}
#ifndef QCUSTOMCANVAS_H
#define QCUSTOMCANVAS_H
#include "ui_plotcanvas.h"
#include <QMainWindow>
namespace Ui {
class PlotCanvas;
}
class QCustomCanvas : public QMainWindow
{
Q_OBJECT
private:
Ui::PlotCanvas* ui;
public:
explicit QCustomCanvas(QWidget *parent = nullptr);
~QCustomCanvas();
TCanvas* Canvas(){return ui->canvas->Canvas();}
signals:
public slots:
void handleSave2Txt();
void handleClear();
void handleZoomout();
void handleFreeze();
void handleScreenshot();
};
#endif // QCUSTOMCANVAS_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment