comparison style/AppEventFilter.h @ 668:dac3781826da thorn-cpp

Experimental branch based on Thorn C++ code from RG
author Chris Cannam
date Tue, 30 Apr 2019 11:36:38 +0100
parents
children
comparison
equal deleted inserted replaced
667:31ea416fea3c 668:dac3781826da
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Vect
5 An experimental audio player for plural recordings of a work
6 Centre for Digital Music, Queen Mary, University of London.
7
8 This file is taken from Rosegarden, a MIDI and audio sequencer and
9 musical notation editor. Copyright 2000-2018 the Rosegarden
10 development team. Thorn style developed in stylesheet form by
11 D. Michael McIntyre and reimplemented as a class by David Faure.
12
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version. See the file
17 COPYING included with this distribution for more information.
18 */
19
20 #ifndef SV_THORN_STYLE_APPEVENT_FILTER_H
21 #define SV_THORN_STYLE_APPEVENT_FILTER_H
22
23 #include "ThornStyle.h"
24
25 /**
26 * The AppEventFilter class is notified when a new widget is created
27 * and can decide whether to apply the Thorn Style to it or not.
28 */
29 class AppEventFilter : public QObject
30 {
31 Q_OBJECT
32
33 public:
34 AppEventFilter();
35 bool eventFilter(QObject *watched, QEvent *event) override;
36 bool shouldIgnoreThornStyle(QWidget *widget) const;
37 void polishWidget(QWidget *widget);
38
39 private:
40 ThornStyle m_style;
41 QPalette m_systemPalette;
42 QStyle *m_systemStyle;
43 };
44
45 #endif