-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathimmutablelabel.h
49 lines (36 loc) · 1.34 KB
/
immutablelabel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*!
\class ImmutableLabel
\ingroup Interlinear
\brief This QLabel subclass renders the specified TextBit as suggested by the font specifications in the associated WritingSystem. It is used mainly by WordDisplayWidget, but also by AnalysisWidget.
The class also has various options to control its display, which are used by WordDisplayWidget.
*/
#ifndef IMMUTABLELABEL_H
#define IMMUTABLELABEL_H
#include <QLabel>
#include "textbit.h"
#include "glossitem.h"
class ImmutableLabel : public QLabel
{
Q_OBJECT
public:
ImmutableLabel(const TextBit & bit, bool technicolor, QWidget *parent = nullptr);
~ImmutableLabel();
void matchTextAlignmentTo( Qt::LayoutDirection target );
QSize sizeHint() const;
QSize minimumSizeHint() const;
signals:
void doubleClick( TextBit & bit );
public slots:
void setCandidateNumber(GlossItem::CandidateNumber status);
void setApprovalStatus(GlossItem::ApprovalStatus status);
void setCandidateNumberAndApprovalStatus(GlossItem::CandidateNumber number, GlossItem::ApprovalStatus status);
void setTextBit(const TextBit & bit);
private:
GlossItem::CandidateNumber mCandidateNumber;
GlossItem::ApprovalStatus mApprovalStatus;
TextBit mTextBit;
bool mTechnicolor;
void updateStyle();
void mouseDoubleClickEvent ( QMouseEvent * event );
};
#endif // IMMUTABLELABEL_H