annotate widgets/Pane.h @ 4:ce747045a023

* Invalidate cache when model replaced
author Chris Cannam
date Thu, 12 Jan 2006 13:43:15 +0000
parents 2a4f26e85b4c
children 37b110168acf
rev   line source
Chris@0 1
Chris@0 2 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */
Chris@0 3
Chris@0 4 /*
Chris@0 5 A waveform viewer and audio annotation editor.
Chris@0 6 Chris Cannam, Queen Mary University of London, 2005
Chris@0 7
Chris@0 8 This is experimental software. Not for distribution.
Chris@0 9 */
Chris@0 10
Chris@0 11 #ifndef _PANE_H_
Chris@0 12 #define _PANE_H_
Chris@0 13
Chris@0 14 #include <QFrame>
Chris@0 15 #include <QPoint>
Chris@0 16
Chris@0 17 #include "base/ZoomConstraint.h"
Chris@0 18 #include "base/View.h"
Chris@0 19
Chris@0 20 class QWidget;
Chris@0 21 class QPaintEvent;
Chris@0 22 class Layer;
Chris@0 23
Chris@0 24 class Pane : public View
Chris@0 25 {
Chris@0 26 Q_OBJECT
Chris@0 27
Chris@0 28 public:
Chris@0 29 Pane(QWidget *parent = 0);
Chris@0 30 virtual QString getPropertyContainerIconName() const { return "pane"; }
Chris@0 31
Chris@0 32 virtual bool shouldIlluminateLocalFeatures(const Layer *layer, QPoint &pos);
Chris@0 33
Chris@0 34 void setCentreLineVisible(bool visible);
Chris@0 35 bool getCentreLineVisible() const { return m_centreLineVisible; }
Chris@0 36
Chris@0 37 signals:
Chris@0 38 void paneInteractedWith();
Chris@0 39
Chris@0 40 protected:
Chris@0 41 virtual void paintEvent(QPaintEvent *e);
Chris@0 42 virtual void mousePressEvent(QMouseEvent *e);
Chris@0 43 virtual void mouseReleaseEvent(QMouseEvent *e);
Chris@0 44 virtual void mouseMoveEvent(QMouseEvent *e);
Chris@0 45 virtual void mouseDoubleClickEvent(QMouseEvent *e);
Chris@0 46 virtual void leaveEvent(QEvent *e);
Chris@0 47 virtual void wheelEvent(QWheelEvent *e);
Chris@0 48
Chris@0 49 bool m_identifyFeatures;
Chris@0 50 QPoint m_identifyPoint;
Chris@0 51 QPoint m_clickPos;
Chris@0 52 QPoint m_mousePos;
Chris@0 53 bool m_clickedInRange;
Chris@0 54 bool m_shiftPressed;
Chris@0 55 size_t m_dragCentreFrame;
Chris@0 56 bool m_centreLineVisible;
Chris@0 57 };
Chris@0 58
Chris@0 59 #endif
Chris@0 60