#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui/QMainWindow>
#include <QWidget>
#include <QHBoxLayout>
#include <QFrame>
#include <QPushButton>
#include <QTabWidget>
#include <QMenu>
#include <QAction>
#include <QDockWidget>
{
Q_OBJECT
public:
~MainWindow();
void baseLayerSettings(void);
private:
QWidget *headerWidget,
*footerWidget;
QPushButton *tab1_Button1,
*tab1_Button2,
*tab2_Button1,
*tab1_Button3,
*startMenu_button;
};
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui/QMainWindow>
#include <QWidget>
#include <QHBoxLayout>
#include <QFrame>
#include <QPushButton>
#include <QTabWidget>
#include <QMenu>
#include <QAction>
#include <QDockWidget>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
void baseLayerSettings(void);
private:
QFrame *baseLayer;
QWidget *headerWidget, *footerWidget;
QPushButton *tab1_Button1, *tab1_Button2, *tab2_Button1, *tab1_Button3, *startMenu_button;
QMenu *startMenu;
QAction *menuAction;
QDockWidget *headerDock, *centerDock, *footerDock;
QHBoxLayout *footerLayout;
};
To copy to clipboard, switch view to plain text mode
#include "mainwindow.h"
MainWindow
::MainWindow(QWidget *parent
){
baseLayerSettings();
setCentralWidget(baseLayer);
}
MainWindow::~MainWindow()
{
}
void MainWindow::baseLayerSettings(void)
{
headerDock->setMinimumHeight(70);
headerDock
->setFeatures
(QDockWidget::NoDockWidgetFeatures);
baseLayer->setStyleSheet("background-color: rgba(245, 250, 250, 255);");
footerDock->setMinimumHeight(70);
footerDock
->setFeatures
(QDockWidget::NoDockWidgetFeatures);
this->setCentralWidget(baseLayer);
this->addDockWidget(Qt::TopDockWidgetArea, headerDock);
this->addDockWidget(Qt::BottomDockWidgetArea, footerDock);
startMenu->setStyleSheet("QMenu::item {padding: 1px 10px 1px 20px; background-color: rgba(245, 250, 250, 255); height: 35px;};");
startMenu->setStyleSheet("QMenu::item:selected { background-color: rgba(109, 146, 155, 255); }");
startMenu->addAction("Break-Shift");
startMenu->addAction("Logout");
startMenu->addAction("Shutdown");
startMenu_button->setFixedSize(75, 40);
startMenu_button->setStyleSheet("border-style: outset; border-width: 1px; border-radius: 10px; border-color: blue; font-family: Monaco; font: 16px; color: rgba(4, 98, 148, 255); background-color: rgba(183, 175, 163, 255); min-width: 5em; min-height : 25px;");
startMenu_button->setStyleSheet("QPushButton:pressed { background-color: darkgray; font-family: Monaco; font-style: italic; color: rgba(29, 49, 122, 255)}");
startMenu_button->setMenu(startMenu);
headerWidget->setStyleSheet("background-color: rgba(172, 209, 233, 255);");
headerDock->setWidget(headerWidget);
footerDock->setWidget(startMenu_button);
footerWidget->setStyleSheet("background-color: rgba(232, 208, 169, 255);");
footerDock->setWidget(footerWidget);
footerWidget->setLayout(footerLayout);
footerLayout->addWidget(startMenu_button, 0, Qt::AlignLeft | Qt::AlignBottom);
startMenu_button->show();
}
#include "mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
baseLayerSettings();
setCentralWidget(baseLayer);
}
MainWindow::~MainWindow()
{
}
void MainWindow::baseLayerSettings(void)
{
headerDock = new QDockWidget(this);
headerDock->setMinimumHeight(70);
headerDock->setFeatures(QDockWidget::NoDockWidgetFeatures);
baseLayer = new QFrame(this);
baseLayer->setStyleSheet("background-color: rgba(245, 250, 250, 255);");
footerDock = new QDockWidget(this);
footerDock->setMinimumHeight(70);
footerDock->setFeatures(QDockWidget::NoDockWidgetFeatures);
this->setCentralWidget(baseLayer);
this->addDockWidget(Qt::TopDockWidgetArea, headerDock);
this->addDockWidget(Qt::BottomDockWidgetArea, footerDock);
startMenu = new QMenu;
startMenu->setStyleSheet("QMenu::item {padding: 1px 10px 1px 20px; background-color: rgba(245, 250, 250, 255); height: 35px;};");
startMenu->setStyleSheet("QMenu::item:selected { background-color: rgba(109, 146, 155, 255); }");
startMenu->addAction("Break-Shift");
startMenu->addAction("Logout");
startMenu->addAction("Shutdown");
startMenu_button = new QPushButton(tr("Menu"));
startMenu_button->setFixedSize(75, 40);
startMenu_button->setStyleSheet("border-style: outset; border-width: 1px; border-radius: 10px; border-color: blue; font-family: Monaco; font: 16px; color: rgba(4, 98, 148, 255); background-color: rgba(183, 175, 163, 255); min-width: 5em; min-height : 25px;");
startMenu_button->setStyleSheet("QPushButton:pressed { background-color: darkgray; font-family: Monaco; font-style: italic; color: rgba(29, 49, 122, 255)}");
startMenu_button->setMenu(startMenu);
headerWidget = new QWidget;
headerWidget->setStyleSheet("background-color: rgba(172, 209, 233, 255);");
headerDock->setWidget(headerWidget);
footerDock->setWidget(startMenu_button);
footerWidget = new QWidget;
footerWidget->setStyleSheet("background-color: rgba(232, 208, 169, 255);");
footerDock->setWidget(footerWidget);
footerLayout = new QHBoxLayout;
footerWidget->setLayout(footerLayout);
footerLayout->addWidget(startMenu_button, 0, Qt::AlignLeft | Qt::AlignBottom);
startMenu_button->show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks