mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-07 00:05:44 +08:00
96a187242e
version: sunnypilot v2026.003.000 (dev)
date: 2026-08-06T04:12:40
master commit: 099143ad9d
26 lines
527 B
C++
26 lines
527 B
C++
#pragma once
|
|
|
|
#include <QLabel>
|
|
#include <QMouseEvent>
|
|
|
|
class ElidedLabel : public QLabel {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ElidedLabel(QWidget *parent = 0);
|
|
explicit ElidedLabel(const QString &text, QWidget *parent = 0);
|
|
|
|
signals:
|
|
void clicked();
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *event) override;
|
|
void resizeEvent(QResizeEvent* event) override;
|
|
void mouseReleaseEvent(QMouseEvent *event) override {
|
|
if (rect().contains(event->pos())) {
|
|
emit clicked();
|
|
}
|
|
}
|
|
QString lastText_, elidedText_;
|
|
};
|