File indexing completed on 2024-05-19 04:07:47
0001 /* 0002 SPDX-FileCopyrightText: 2010 Stefan Majewsky <majewsky@gmx.net> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef PALAPELI_ELIDINGLABEL_H 0008 #define PALAPELI_ELIDINGLABEL_H 0009 0010 #include <QLabel> 0011 0012 namespace Palapeli 0013 { 0014 class ElidingLabel : public QLabel 0015 { 0016 public: 0017 explicit ElidingLabel(QWidget* parent = nullptr); 0018 0019 QSize minimumSizeHint() const override; 0020 QSize sizeHint() const override; 0021 0022 QString fullText() const; 0023 void setFullText(const QString& text); 0024 protected: 0025 void resizeEvent(QResizeEvent* event) override; 0026 private: 0027 QString m_fullText; 0028 }; 0029 } 0030 0031 #endif // PALAPELI_ELIDINGLABEL_H