Adding about box
This commit is contained in:
parent
4ec6bf9f95
commit
a396e030e8
2 changed files with 19 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
#include <QMenuBar>
|
||||
#include <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
|
||||
#include "window.h"
|
||||
|
@ -27,10 +28,17 @@ Window::Window(QWidget *parent) :
|
|||
QObject::connect(quit_action, SIGNAL(triggered()),
|
||||
this, SLOT(close()));
|
||||
|
||||
about_action = new QAction("About", this);
|
||||
QObject::connect(about_action, SIGNAL(triggered()),
|
||||
this, SLOT(on_about()));
|
||||
|
||||
auto file_menu = menuBar()->addMenu("File");
|
||||
file_menu->addAction(open_action);
|
||||
file_menu->addAction(quit_action);
|
||||
|
||||
auto help_menu = menuBar()->addMenu("Help");
|
||||
help_menu->addAction(about_action);
|
||||
|
||||
resize(600, 400);
|
||||
}
|
||||
|
||||
|
@ -44,6 +52,15 @@ void Window::on_open()
|
|||
}
|
||||
}
|
||||
|
||||
void Window::on_about()
|
||||
{
|
||||
QMessageBox::about(this, "About fstl", "<b>fstl</b><br><br>"
|
||||
"A fast viewer for <code>.stl</code> files.<br>"
|
||||
"<a href=\"https://github.com/mkeeter/fstl\">https://github.com/mkeeter/fstl</a><br><br>"
|
||||
"© 2014 Matthew Keeter<br>"
|
||||
"<a href=\"mailto:matt.j.keeter@gmail.com\">matt.j.keeter@gmail.com</a><br>");
|
||||
}
|
||||
|
||||
|
||||
void Window::enable_open_action()
|
||||
{
|
||||
|
|
|
@ -14,11 +14,13 @@ public:
|
|||
|
||||
public slots:
|
||||
void on_open();
|
||||
void on_about();
|
||||
void disable_open_action();
|
||||
void enable_open_action();
|
||||
|
||||
private:
|
||||
QAction* open_action;
|
||||
QAction* about_action;
|
||||
QAction* quit_action;
|
||||
|
||||
Canvas* canvas;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue