Added AbsenceDialog

This commit is contained in:
0xFEEDC0DE64
2017-12-28 17:00:49 +01:00
parent 5c7eec85c5
commit e6abb26536
6 changed files with 122 additions and 7 deletions

View File

@@ -0,0 +1,14 @@
#include "absencedialog.h"
#include "ui_absencedialog.h"
AbsenceDialog::AbsenceDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AbsenceDialog)
{
ui->setupUi(this);
}
AbsenceDialog::~AbsenceDialog()
{
delete ui;
}

View File

@@ -0,0 +1,17 @@
#pragma once
#include <QDialog>
namespace Ui { class AbsenceDialog; }
class AbsenceDialog : public QDialog
{
Q_OBJECT
public:
explicit AbsenceDialog(QWidget *parent = 0);
~AbsenceDialog();
private:
Ui::AbsenceDialog *ui;
};

View File

@@ -0,0 +1,71 @@
<ui version="4.0">
<author/>
<comment/>
<exportmacro/>
<class>AbsenceDialog</class>
<widget class="QDialog" name="AbsenceDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>30</x>
<y>240</y>
<width>341</width>
<height>32</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</widget>
<pixmapfunction/>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AbsenceDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AbsenceDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -18,13 +18,16 @@ DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSA
HEADERS += \
absenceplugin.h \
absencewidget.h
absencewidget.h \
absencedialog.h
SOURCES += \
absenceplugin.cpp \
absencewidget.cpp
absencewidget.cpp \
absencedialog.cpp
FORMS +=
FORMS += \
absencedialog.ui
RESOURCES += absenceplugin_resources.qrc

View File

@@ -1,8 +1,18 @@
#include "absencewidget.h"
#include "absencedialog.h"
AbsenceWidget::AbsenceWidget(QWidget *parent) :
QToolButton(parent)
{
setIcon(QIcon(QStringLiteral(":/zeiterfassung/plugins/absenceplugin/images/absence.png")));
setText(tr("Absence"));
connect(this, &QAbstractButton::pressed, this, &AbsenceWidget::pressedSlot);
}
void AbsenceWidget::pressedSlot()
{
AbsenceDialog dialog(this);
dialog.exec();
}

View File

@@ -1,5 +1,4 @@
#ifndef ABSENCEWIDGET_H
#define ABSENCEWIDGET_H
#pragma once
#include <QToolButton>
@@ -9,6 +8,7 @@ class AbsenceWidget : public QToolButton
public:
explicit AbsenceWidget(QWidget *parent = Q_NULLPTR);
};
#endif // ABSENCEWIDGET_H
private Q_SLOTS:
void pressedSlot();
};