annotate widgets/TransformFinder.h @ 419:b0c8e0def62e

* some work on transform finder
author Chris Cannam
date Thu, 25 Sep 2008 12:44:23 +0000
parents fbf9f53cf979
children f8e04ad8e7b1
rev   line source
Chris@416 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@416 2
Chris@416 3 /*
Chris@416 4 Sonic Visualiser
Chris@416 5 An audio file viewer and annotation editor.
Chris@416 6 Centre for Digital Music, Queen Mary, University of London.
Chris@416 7 This file copyright 2008 QMUL.
Chris@416 8
Chris@416 9 This program is free software; you can redistribute it and/or
Chris@416 10 modify it under the terms of the GNU General Public License as
Chris@416 11 published by the Free Software Foundation; either version 2 of the
Chris@416 12 License, or (at your option) any later version. See the file
Chris@416 13 COPYING included with this distribution for more information.
Chris@416 14 */
Chris@416 15
Chris@416 16 #ifndef _TRANSFORM_FINDER_H_
Chris@416 17 #define _TRANSFORM_FINDER_H_
Chris@416 18
Chris@416 19 #include <QDialog>
Chris@416 20
Chris@417 21 #include <vector>
Chris@417 22
Chris@416 23 #include "transform/Transform.h"
Chris@416 24
Chris@419 25 class QGridLayout;
Chris@416 26 class QScrollArea;
Chris@417 27 class QLabel;
Chris@419 28 class SelectableLabel;
Chris@417 29 class QWidget;
Chris@416 30
Chris@419 31
Chris@419 32 #include <QLabel>
Chris@419 33 class SelectableLabel : public QLabel
Chris@419 34 {
Chris@419 35 Q_OBJECT
Chris@419 36
Chris@419 37 public:
Chris@419 38 SelectableLabel(QWidget *parent = 0) : QLabel(parent) {
Chris@419 39 setTextFormat(Qt::RichText);
Chris@419 40 }
Chris@419 41 virtual ~SelectableLabel() { }
Chris@419 42
Chris@419 43 void setSelectedText(QString);
Chris@419 44 void setUnselectedText(QString);
Chris@419 45
Chris@419 46 protected:
Chris@419 47 virtual void mousePressEvent(QMouseEvent *e);
Chris@419 48 };
Chris@419 49
Chris@416 50 class TransformFinder : public QDialog
Chris@416 51 {
Chris@416 52 Q_OBJECT
Chris@416 53
Chris@416 54 public:
Chris@416 55 TransformFinder(QWidget *parent = 0);
Chris@416 56 ~TransformFinder();
Chris@416 57
Chris@416 58 TransformId getTransform() const;
Chris@416 59
Chris@416 60 protected slots:
Chris@416 61 void searchTextChanged(const QString &);
Chris@416 62
Chris@416 63 protected:
Chris@416 64 QScrollArea *m_resultsScroll;
Chris@417 65 QWidget *m_resultsFrame;
Chris@419 66 QGridLayout *m_resultsLayout;
Chris@419 67 std::vector<SelectableLabel *> m_labels;
Chris@416 68 };
Chris@416 69
Chris@416 70 #endif
Chris@416 71