2019-10-09 20:15:53 +08:00
|
|
|
%Import QtWidgets/QtWidgetsmod.sip
|
|
|
|
|
|
|
|
%If (Qt_5_0_0 -)
|
|
|
|
|
|
|
|
namespace ads
|
|
|
|
{
|
|
|
|
|
|
|
|
class CElidingLabel : QLabel
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <ElidingLabel.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void mouseReleaseEvent(QMouseEvent* event);
|
|
|
|
virtual void resizeEvent( QResizeEvent *event );
|
|
|
|
virtual void mouseDoubleClickEvent( QMouseEvent *ev );
|
|
|
|
|
|
|
|
public:
|
2024-04-04 05:49:08 +08:00
|
|
|
CElidingLabel(QWidget* parent /TransferThis/ = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags ());
|
|
|
|
CElidingLabel(const QString& text, QWidget* parent /TransferThis/ = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags ());
|
2019-10-09 20:15:53 +08:00
|
|
|
virtual ~CElidingLabel();
|
|
|
|
Qt::TextElideMode elideMode() const;
|
|
|
|
void setElideMode(Qt::TextElideMode mode);
|
2020-02-22 05:47:09 +08:00
|
|
|
bool isElided() const;
|
2019-10-09 20:15:53 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
virtual QSize minimumSizeHint() const;
|
|
|
|
virtual QSize sizeHint() const;
|
|
|
|
void setText(const QString &text);
|
|
|
|
QString text() const;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void clicked();
|
|
|
|
void doubleClicked();
|
2020-02-22 05:47:09 +08:00
|
|
|
void elidedChanged(bool elided);
|
2019-10-09 20:15:53 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
%End
|