This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
YASMIN/ui/menu/MainMenu.cpp
kazu 075d8bb633 a lot!!! of changes
added main menu
added debug display
many debug widgets for plotting live data
worked on android live sensors
added offline-data sensor feeding
some dummy data sensors
worked on the map display
added ui debug for grid-points, particles and weights
added a cool dude to display the estimation
added real filtering based on the Indoor components
c++11 fixes for android compilation
online and offline filtering support
new resampling technique for testing
map loading via dialog
2016-09-16 19:30:04 +02:00

56 lines
1.7 KiB
C++

#include "MainMenu.h"
#include "../Icons.h"
#include <QPushButton>
#include <QGridLayout>
#include <Indoor/Assertions.h>
MainMenu::MainMenu(QWidget* parent) : QWidget(parent) {
setMinimumHeight(64);
QGridLayout* lay = new QGridLayout(this);
int row = 0;
int col = 0;
btnLoadMap = getButton("load");
Assert::isTrue(connect(btnLoadMap, &QPushButton::clicked, this, &MainMenu::onLoadButton), "connect() failed");
lay->addWidget(btnLoadMap, row, col, 1,1,Qt::AlignTop); ++col;
btnDebug = getButton("bug");
Assert::isTrue(connect(btnDebug, &QPushButton::clicked, this, &MainMenu::onDebugButton), "connect() failed");
lay->addWidget(btnDebug, row, col, 1,1,Qt::AlignTop); ++col;
btnCamera = getButton("camera");
Assert::isTrue(connect(btnCamera, &QPushButton::clicked, this, &MainMenu::onCameraButton), "connect() failed");
lay->addWidget(btnCamera, row, col, 1,1,Qt::AlignTop); ++col;
btnTransparent = getButton("cube");
Assert::isTrue(connect(btnTransparent, &QPushButton::clicked, this, &MainMenu::onTransparentButton), "connect() failed");
lay->addWidget(btnTransparent, row, col, 1,1,Qt::AlignTop); ++col;
btnStart = getButton("run");
Assert::isTrue(connect(btnStart, &QPushButton::clicked, this, &MainMenu::onStartButton), "connect() failed");
lay->addWidget(btnStart, row, col, 1,1,Qt::AlignTop); ++col;
}
QPushButton* MainMenu::getButton(const std::string& icon) {
const int size = 48;
const int border = 4;
QPushButton* btn = new QPushButton(Icons::getIcon(icon, size), "");
btn->setIconSize(QSize(size,size));
btn->setMinimumHeight(size+border);
btn->setMaximumHeight(size+border);
btn->setMinimumWidth(size+border);
btn->setMaximumWidth(size+border);
return btn;
}