Added sketch viewer window
This commit is contained in:
14
plugins/sketchplugin/sketchmainwindow.cpp
Normal file
14
plugins/sketchplugin/sketchmainwindow.cpp
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#include "sketchmainwindow.h"
|
||||||
|
#include "ui_sketchmainwindow.h"
|
||||||
|
|
||||||
|
SketchMainWindow::SketchMainWindow(QWidget *parent) :
|
||||||
|
QMainWindow(parent),
|
||||||
|
ui(new Ui::SketchMainWindow)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
SketchMainWindow::~SketchMainWindow()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
22
plugins/sketchplugin/sketchmainwindow.h
Normal file
22
plugins/sketchplugin/sketchmainwindow.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef SKETCHMAINWINDOW_H
|
||||||
|
#define SKETCHMAINWINDOW_H
|
||||||
|
|
||||||
|
#include <QMainWindow>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class SketchMainWindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
class SketchMainWindow : public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit SketchMainWindow(QWidget *parent = 0);
|
||||||
|
~SketchMainWindow();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::SketchMainWindow *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SKETCHMAINWINDOW_H
|
24
plugins/sketchplugin/sketchmainwindow.ui
Normal file
24
plugins/sketchplugin/sketchmainwindow.ui
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<ui version="4.0">
|
||||||
|
<author/>
|
||||||
|
<comment/>
|
||||||
|
<exportmacro/>
|
||||||
|
<class>SketchMainWindow</class>
|
||||||
|
<widget name="SketchMainWindow" class="QMainWindow">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>600</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>MainWindow</string>
|
||||||
|
</property>
|
||||||
|
<widget name="menubar" class="QMenuBar"/>
|
||||||
|
<widget name="centralwidget" class="QWidget"/>
|
||||||
|
<widget name="statusbar" class="QStatusBar"/>
|
||||||
|
</widget>
|
||||||
|
<pixmapfunction/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
@@ -8,6 +8,7 @@
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "sketchmainwindow.h"
|
||||||
|
|
||||||
SketchPlugin::SketchPlugin(QObject *parent) :
|
SketchPlugin::SketchPlugin(QObject *parent) :
|
||||||
ZeiterfassungPlugin(parent)
|
ZeiterfassungPlugin(parent)
|
||||||
@@ -31,5 +32,13 @@ SketchPlugin::SketchPlugin(QObject *parent) :
|
|||||||
|
|
||||||
void SketchPlugin::attachTo(MainWindow &mainWindow)
|
void SketchPlugin::attachTo(MainWindow &mainWindow)
|
||||||
{
|
{
|
||||||
mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/sketchplugin/images/sketch.png")), tr("Open Sketch viewer"));
|
mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/sketchplugin/images/sketch.png")), tr("Open Sketch viewer"),
|
||||||
|
this, &SketchPlugin::openWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SketchPlugin::openWindow()
|
||||||
|
{
|
||||||
|
auto window = new SketchMainWindow;
|
||||||
|
window->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
window->show();
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,9 @@ public:
|
|||||||
// ZeiterfassungPlugin interface
|
// ZeiterfassungPlugin interface
|
||||||
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void openWindow();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTranslator m_translator;
|
QTranslator m_translator;
|
||||||
};
|
};
|
||||||
|
@@ -4,11 +4,13 @@ TARGET = sketchplugin
|
|||||||
|
|
||||||
DBLIBS += core gui
|
DBLIBS += core gui
|
||||||
|
|
||||||
HEADERS += sketchplugin.h
|
HEADERS += sketchmainwindow.h \
|
||||||
|
sketchplugin.h
|
||||||
|
|
||||||
SOURCES += sketchplugin.cpp
|
SOURCES += sketchmainwindow.cpp \
|
||||||
|
sketchplugin.cpp
|
||||||
|
|
||||||
FORMS +=
|
FORMS += sketchmainwindow.ui
|
||||||
|
|
||||||
RESOURCES += sketchplugin_resources.qrc
|
RESOURCES += sketchplugin_resources.qrc
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user