4d10065c54
Conflicts: examples/widgets/applicationicon/applicationicon.svg examples/widgets/applicationicon/main.cpp examples/widgets/elidedlabel/elidedlabel.cpp examples/widgets/elidedlabel/elidedlabel.h examples/widgets/elidedlabel/main.cpp examples/widgets/elidedlabel/testwidget.cpp examples/widgets/elidedlabel/testwidget.h (cherry picked from commit 1b555a91f05b68c697b6985d1b672dc0fba5fc5a) (cherry picked from commit c0e0bfdd451f42b10051e8064153b811080ffa0e)
37 lines
695 B
C++
37 lines
695 B
C++
#ifndef ELIDEDLABEL_H
|
|
#define ELIDEDLABEL_H
|
|
|
|
#include <QFrame>
|
|
#include <QRect>
|
|
#include <QResizeEvent>
|
|
#include <QString>
|
|
#include <QWidget>
|
|
|
|
//! [0]
|
|
class ElidedLabel : public QFrame
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(QString text READ text WRITE setText)
|
|
Q_PROPERTY(bool isElided READ isElided)
|
|
|
|
public:
|
|
ElidedLabel(const QString &text, QWidget *parent = 0);
|
|
|
|
void setText(const QString &text);
|
|
const QString & text() const { return content; }
|
|
bool isElided() const { return elided; }
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *event);
|
|
|
|
signals:
|
|
void elisionChanged(bool elided);
|
|
|
|
private:
|
|
bool elided;
|
|
QString content;
|
|
};
|
|
//! [0]
|
|
|
|
#endif // TEXTWRAPPINGWIDGET_H
|