-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nitial commit. Deleted and recreated .git to get rid of poster and da…
…ta files, bc they were huge and causing pushes to be >75MB.
0 parents
commit cc988ea
Showing
7 changed files
with
1,404 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "MainWindow.hpp" | ||
|
||
#include <QAction> | ||
#include <QFileDialog> | ||
#include <QKeySequence> | ||
#include <QMenuBar> | ||
|
||
#include <iostream> | ||
|
||
void MainWindow::setupMenu(){ | ||
auto menuBar = this->menuBar(); | ||
|
||
QAction* exitAction = new QAction(tr("&Quit"), this); | ||
exitAction->setShortcuts(QKeySequence::Quit); | ||
exitAction->setStatusTip(tr("Exit application")); | ||
connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); | ||
|
||
QAction* loadAction = new QAction(tr("&Load"), this); | ||
loadAction->setShortcuts(QKeySequence::Quit); | ||
loadAction->setStatusTip(tr("Load fluid file")); | ||
connect(loadAction, SIGNAL(triggered()), this, SLOT(load())); | ||
|
||
auto fileMenu = menuBar->addMenu(tr("&File")); | ||
fileMenu->addAction(loadAction); | ||
fileMenu->addSeparator(); | ||
fileMenu->addAction(exitAction); | ||
} | ||
|
||
void MainWindow::setupUI(){ | ||
vizWidget = new VizWidget(); | ||
setCentralWidget(vizWidget); | ||
} | ||
|
||
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) { | ||
setupMenu(); | ||
setupUI(); | ||
setWindowTitle(tr("Vizualizer")); | ||
} | ||
|
||
void MainWindow::load() { | ||
QString fname = QFileDialog::getOpenFileName(nullptr, tr("Open File"), "./", tr("*.dat")); | ||
|
||
std::cout << fname.toUtf8().constData() << std::endl; | ||
vizWidget->loadFile(fname); | ||
// TODO: Call load on vizualizer widget. Set slider min/max. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef MAIN_WINDOW_HPP | ||
#define MAIN_WINDOW_HPP | ||
|
||
#include "VizWidget.hpp" | ||
|
||
#include <QMainWindow> | ||
|
||
class MainWindow : public QMainWindow{ | ||
Q_OBJECT | ||
|
||
VizWidget* vizWidget; | ||
|
||
void setupMenu(); | ||
void setupUI(); | ||
|
||
public: | ||
MainWindow(QWidget* parent = nullptr); | ||
|
||
private slots: | ||
void load(); | ||
}; | ||
|
||
#endif // MAIN_WINDOW_HPP |
Oops, something went wrong.