mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Code cleanup: implement window title update via signal
This seems quite convoluted to me but I can't seem to make a more straight forward implementation work. The idea is that core code should never directly call into the UI. So instead the core code (this is C code) calls a helper function. That helper function calls a member function of a class which in return emits a signal. The UI code connects to that signal and acts accordingly when it is received. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c593dea119
commit
0fa0eb2879
6 changed files with 63 additions and 6 deletions
20
windowtitleupdate.h
Normal file
20
windowtitleupdate.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef WINDOWTITLEUPDATE_H
|
||||
#define WINDOWTITLEUPDATE_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class WindowTitleUpdate : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WindowTitleUpdate(QObject *parent = 0);
|
||||
~WindowTitleUpdate();
|
||||
static WindowTitleUpdate *instance();
|
||||
void emitSignal();
|
||||
signals:
|
||||
void updateTitle();
|
||||
private:
|
||||
static WindowTitleUpdate *m_instance;
|
||||
};
|
||||
|
||||
#endif // WINDOWTITLEUPDATE_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue