CuteLogger
Fast and simple logging solution for Qt based applications
keyframesdock.h
1 /*
2  * Copyright (c) 2016-2018 Meltytech, LLC
3  * Author: Dan Dennedy <dan@dennedy.org>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef KEYFRAMESDOCK_H
20 #define KEYFRAMESDOCK_H
21 
22 #include "qmltypes/qmlfilter.h"
23 #include "models/metadatamodel.h"
24 #include "sharedframe.h"
25 #include "models/keyframesmodel.h"
26 
27 #include <QDockWidget>
28 #include <QQuickWidget>
29 #include <QScopedPointer>
30 
31 class QmlFilter;
32 class QmlMetadata;
33 class MetadataModel;
34 class AttachedFiltersModel;
35 class QmlProducer;
36 
37 class KeyframesDock : public QDockWidget
38 {
39  Q_OBJECT
40 
41 public:
42  explicit KeyframesDock(QmlProducer* qmlProducer, QWidget *parent = 0);
43 
44  KeyframesModel& model() { return m_model; }
45  Q_INVOKABLE int seekPrevious();
46  Q_INVOKABLE int seekNext();
47 
48 signals:
49  void changed();
50 
51 public slots:
52  void setCurrentFilter(QmlFilter* filter, QmlMetadata* meta);
53  void load(bool force = false);
54 
55 protected:
56  bool event(QEvent *event);
57  void keyPressEvent(QKeyEvent* event);
58  void keyReleaseEvent(QKeyEvent* event);
59 
60 private slots:
61  void onVisibilityChanged(bool visible);
62 
63 private:
64  QQuickWidget m_qview;
65  QmlMetadata m_emptyQmlMetadata;
66  QmlFilter m_emptyQmlFilter;
67  KeyframesModel m_model;
68  QmlProducer* m_qmlProducer;
69 
70  int currentParameter() const;
71 };
72 
73 #endif // KEYFRAMESDOCK_H