diff 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
line wrap: on
line diff
--- a/widgets/TransformFinder.h	Tue Sep 23 16:53:26 2008 +0000
+++ b/widgets/TransformFinder.h	Thu Sep 25 12:44:23 2008 +0000
@@ -22,11 +22,31 @@
 
 #include "transform/Transform.h"
 
-class QVBoxLayout;
+class QGridLayout;
 class QScrollArea;
 class QLabel;
+class SelectableLabel;
 class QWidget;
 
+
+#include <QLabel>
+class SelectableLabel : public QLabel
+{
+    Q_OBJECT
+
+public:
+    SelectableLabel(QWidget *parent = 0) : QLabel(parent) {
+        setTextFormat(Qt::RichText);
+    }
+    virtual ~SelectableLabel() { }
+
+    void setSelectedText(QString);
+    void setUnselectedText(QString);
+
+protected:
+    virtual void mousePressEvent(QMouseEvent *e);
+};
+
 class TransformFinder : public QDialog
 {
     Q_OBJECT
@@ -43,8 +63,8 @@
 protected:
     QScrollArea *m_resultsScroll;
     QWidget *m_resultsFrame;
-    QVBoxLayout *m_resultsLayout;
-    std::vector<QLabel *> m_labels;
+    QGridLayout *m_resultsLayout;
+    std::vector<SelectableLabel *> m_labels;
 };
 
 #endif