File: MatrixWindow.cpp

package info (click to toggle)
vite 1.2%2Bsvn%2Bgit4.c6c0ce7-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 21,544 kB
  • sloc: cpp: 32,343; makefile: 461; sh: 144; ansic: 67
file content (40 lines) | stat: -rw-r--r-- 762 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "MatrixWindow.hpp"

#include <QVBoxLayout>

Matrix_window::Matrix_window(symbol_matrix_t* matrix)
{
    QWidget* widget = new QWidget();
    QVBoxLayout* layout = new QVBoxLayout(widget);

    m_label = new QLabel(nullptr);
    m_label->setText("Infos: ");

    m_gl = new MatrixGLWidget(nullptr, matrix, m_label);
    m_gl->setObjectName(QString("matrix_gl_visualizer"));

    layout->addWidget(m_gl);
    layout->addWidget(m_label);

    this->setCentralWidget(widget);
}

Matrix_window::~Matrix_window()
{
    delete m_gl;
}

void Matrix_window::closeEvent(QCloseEvent* event)
{
    delete this;
}

void Matrix_window::keyPressEvent(QKeyEvent* event)
{
    switch (event->key())
    {
    case Qt::Key_Escape:
        close();
        break;
    }
}