Mercurial > hg > svgui
comparison widgets/TransformFinder.h @ 420:f8e04ad8e7b1
* More transform finder fiddling
author | Chris Cannam |
---|---|
date | Thu, 25 Sep 2008 13:47:40 +0000 |
parents | b0c8e0def62e |
children | 7466402a32c5 |
comparison
equal
deleted
inserted
replaced
419:b0c8e0def62e | 420:f8e04ad8e7b1 |
---|---|
33 class SelectableLabel : public QLabel | 33 class SelectableLabel : public QLabel |
34 { | 34 { |
35 Q_OBJECT | 35 Q_OBJECT |
36 | 36 |
37 public: | 37 public: |
38 SelectableLabel(QWidget *parent = 0) : QLabel(parent) { | 38 SelectableLabel(QWidget *parent = 0); |
39 setTextFormat(Qt::RichText); | |
40 } | |
41 virtual ~SelectableLabel() { } | 39 virtual ~SelectableLabel() { } |
42 | 40 |
43 void setSelectedText(QString); | 41 void setSelectedText(QString); |
44 void setUnselectedText(QString); | 42 void setUnselectedText(QString); |
45 | 43 |
44 bool isSelected() const { return m_selected; } | |
45 | |
46 signals: | |
47 void selectionChanged(); | |
48 | |
49 public slots: | |
50 void setSelected(bool); | |
51 void toggle(); | |
52 | |
46 protected: | 53 protected: |
47 virtual void mousePressEvent(QMouseEvent *e); | 54 virtual void mousePressEvent(QMouseEvent *e); |
55 QString m_selectedText; | |
56 QString m_unselectedText; | |
57 bool m_selected; | |
48 }; | 58 }; |
49 | 59 |
50 class TransformFinder : public QDialog | 60 class TransformFinder : public QDialog |
51 { | 61 { |
52 Q_OBJECT | 62 Q_OBJECT |
57 | 67 |
58 TransformId getTransform() const; | 68 TransformId getTransform() const; |
59 | 69 |
60 protected slots: | 70 protected slots: |
61 void searchTextChanged(const QString &); | 71 void searchTextChanged(const QString &); |
62 | 72 void selectedLabelChanged(); |
73 | |
63 protected: | 74 protected: |
64 QScrollArea *m_resultsScroll; | 75 QScrollArea *m_resultsScroll; |
65 QWidget *m_resultsFrame; | 76 QWidget *m_resultsFrame; |
66 QGridLayout *m_resultsLayout; | 77 QGridLayout *m_resultsLayout; |
67 std::vector<SelectableLabel *> m_labels; | 78 std::vector<SelectableLabel *> m_labels; |
79 TransformId m_selectedTransform; | |
68 }; | 80 }; |
69 | 81 |
70 #endif | 82 #endif |
71 | 83 |