#ifndef JAUS_H
#define JAUS_H
#include <QMainWindow>
#include <QVBoxLayout>
namespace Ui {
class jaus;
}
Q_OBJECT
public:
jaus();
~jaus();
protected:
private:
Ui::jaus *ui;
void createActions();
void createMenus();
private slots:
void exit();
void startLog();
void stopLog();
void debug();
void about();
};
#endif // JAUS_H
#include "jaus.h"
#include "ui_jaus.h"
jaus::jaus()
{
setCentralWidget(widget);
layout->setMargin(5);
layout->addWidget(topFiller);
layout->addWidget(bottomFiller);
widget->setLayout(layout);
createActions();
createMenus();
QString message
= tr
("JAUS Communicator - Version 0.1");
statusBar()->showMessage(message);
}
jaus::~jaus()
{
delete ui;
}
void jaus
::changeEvent(QEvent *e
) {
switch (e->type()) {
ui->retranslateUi(this);
break;
default:
break;
}
}
void jaus::createActions()
{
exitAct
= new QAction(tr
("&Exit"),
this);
exitAct->setStatusTip(tr("Exit the application"));
connect(exitAct, SIGNAL(triggered()), this, SLOT(exit()));
startLogAct
= new QAction(tr
("&Logging"),
this);
startLogAct->setStatusTip(tr("Enables Logging"));
connect(startLogAct, SIGNAL(triggered()), this, SLOT(startLog()));
debugAct
= new QAction(tr
("&Debug"),
this);
debugAct->setStatusTip(tr("Turns Debugging On"));
connect(debugAct, SIGNAL(triggered()), this, SLOT(debug()));
aboutAct
= new QAction(tr
("&About"),
this);;
connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
}
void jaus::createMenus()
{
fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu->addAction(exitAct);
fileMenu->addSeparator();
dataMenu = menuBar()->addMenu(tr("&Data"));
dataMenu->addAction(startLogAct);
dataMenu->addAction(debugAct);
dataMenu->addSeparator();
helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(aboutAct);
}
void jaus::about()
{
}
void jaus::exit()
{
}
void jaus::debug()
{
}
void jaus::startLog()
{
}
void jaus::stopLog()
{
}
#include <QtGui/QApplication>
#include "jaus.h"
int main(int argc, char *argv[])
{
jaus w;
w.show();
return a.exec();
}
#ifndef JAUS_H
#define JAUS_H
#include <QMainWindow>
#include <QVBoxLayout>
namespace Ui {
class jaus;
}
class jaus : public QMainWindow {
Q_OBJECT
public:
jaus();
~jaus();
protected:
void changeEvent(QEvent *e);
void contextMenuEvent(QContextMenuEvent *event);
private:
Ui::jaus *ui;
void createActions();
void createMenus();
QMenu *fileMenu;
QMenu *dataMenu;
QMenu *helpMenu;
QAction *exitAct;
QAction *startLogAct;
QAction *stopLogAct;
QAction *debugAct;
QAction *aboutAct;
private slots:
void exit();
void startLog();
void stopLog();
void debug();
void about();
};
#endif // JAUS_H
#include "jaus.h"
#include "ui_jaus.h"
jaus::jaus()
{
QWidget *widget = new QWidget;
setCentralWidget(widget);
QWidget *topFiller = new QWidget;
topFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QWidget *bottomFiller = new QWidget;
bottomFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QVBoxLayout *layout = new QVBoxLayout;
layout->setMargin(5);
layout->addWidget(topFiller);
layout->addWidget(bottomFiller);
widget->setLayout(layout);
createActions();
createMenus();
QString message = tr("JAUS Communicator - Version 0.1");
statusBar()->showMessage(message);
}
jaus::~jaus()
{
delete ui;
}
void jaus::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void jaus::createActions()
{
exitAct = new QAction(tr("&Exit"), this);
exitAct->setStatusTip(tr("Exit the application"));
connect(exitAct, SIGNAL(triggered()), this, SLOT(exit()));
startLogAct = new QAction(tr("&Logging"), this);
startLogAct->setStatusTip(tr("Enables Logging"));
connect(startLogAct, SIGNAL(triggered()), this, SLOT(startLog()));
debugAct = new QAction(tr("&Debug"), this);
debugAct->setStatusTip(tr("Turns Debugging On"));
connect(debugAct, SIGNAL(triggered()), this, SLOT(debug()));
aboutAct = new QAction(tr("&About"), this);;
connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
}
void jaus::createMenus()
{
fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu->addAction(exitAct);
fileMenu->addSeparator();
dataMenu = menuBar()->addMenu(tr("&Data"));
dataMenu->addAction(startLogAct);
dataMenu->addAction(debugAct);
dataMenu->addSeparator();
helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(aboutAct);
}
void jaus::about()
{
}
void jaus::exit()
{
}
void jaus::debug()
{
}
void jaus::startLog()
{
}
void jaus::stopLog()
{
}
#include <QtGui/QApplication>
#include "jaus.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
jaus w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks