Small ui improvements
This commit is contained in:
parent
887e14add9
commit
6eea5688a8
5 changed files with 467 additions and 360 deletions
32
src/elidedlabel.h
Normal file
32
src/elidedlabel.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#ifndef ELIDEDLABEL_H
|
||||
#define ELIDEDLABEL_H
|
||||
|
||||
#include <QFrame>
|
||||
|
||||
class ElidedLabel : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString text READ text WRITE setText)
|
||||
Q_PROPERTY(bool isElided READ isElided)
|
||||
|
||||
public:
|
||||
explicit ElidedLabel(const QString &text, QWidget *parent = 0);
|
||||
explicit ElidedLabel(QWidget *parent = 0);
|
||||
|
||||
void setText(const QString &text);
|
||||
const QString & text() const { return content; }
|
||||
bool isElided() const { return elided; }
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
||||
|
||||
signals:
|
||||
void elisionChanged(bool elided);
|
||||
|
||||
private:
|
||||
bool elided;
|
||||
QString content;
|
||||
};
|
||||
|
||||
|
||||
#endif // ELIDEDLABEL_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue