Added WeatherWidget
This commit is contained in:
@@ -1,9 +1,19 @@
|
|||||||
#include "weatherplugin.h"
|
#include "weatherplugin.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QStatusBar>
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include "weatherwidget.h"
|
||||||
|
|
||||||
WeatherPlugin::WeatherPlugin(QObject *parent) :
|
WeatherPlugin::WeatherPlugin(QObject *parent) :
|
||||||
ZeiterfassungPlugin(parent)
|
ZeiterfassungPlugin(parent)
|
||||||
{
|
{
|
||||||
qDebug() << "called";
|
qDebug() << "called";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WeatherPlugin::attachTo(MainWindow &mainWindow)
|
||||||
|
{
|
||||||
|
mainWindow.statusBar()->addWidget(new WeatherWidget(mainWindow));
|
||||||
|
}
|
||||||
|
@@ -15,6 +15,7 @@ public:
|
|||||||
explicit WeatherPlugin(QObject *parent = Q_NULLPTR);
|
explicit WeatherPlugin(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
// ZeiterfassungPlugin interface
|
// ZeiterfassungPlugin interface
|
||||||
|
void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WEATHERPLUGIN_H
|
#endif // WEATHERPLUGIN_H
|
||||||
|
@@ -14,8 +14,10 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib
|
|||||||
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT
|
||||||
|
|
||||||
HEADERS += weatherplugin.h
|
HEADERS += weatherplugin.h \
|
||||||
|
weatherwidget.h
|
||||||
|
|
||||||
SOURCES += weatherplugin.cpp
|
SOURCES += weatherplugin.cpp \
|
||||||
|
weatherwidget.cpp
|
||||||
|
|
||||||
OTHER_FILES += weatherplugin.json
|
OTHER_FILES += weatherplugin.json
|
||||||
|
10
plugins/weatherplugin/weatherwidget.cpp
Normal file
10
plugins/weatherplugin/weatherwidget.cpp
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#include "weatherwidget.h"
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
WeatherWidget::WeatherWidget(MainWindow &mainWindow) :
|
||||||
|
QLabel(&mainWindow),
|
||||||
|
m_mainWindow(mainWindow)
|
||||||
|
{
|
||||||
|
setText(tr("Weather"));
|
||||||
|
}
|
19
plugins/weatherplugin/weatherwidget.h
Normal file
19
plugins/weatherplugin/weatherwidget.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#ifndef WEATHERWIDGET_H
|
||||||
|
#define WEATHERWIDGET_H
|
||||||
|
|
||||||
|
#include <QLabel>
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
|
class WeatherWidget : public QLabel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit WeatherWidget(MainWindow &mainWindow);
|
||||||
|
|
||||||
|
private:
|
||||||
|
MainWindow &m_mainWindow;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // WEATHERWIDGET_H
|
Reference in New Issue
Block a user