Eventviews

alternatelabel.h
1/*
2 SPDX-FileCopyrightText: 2000, 2001, 2003 Cornelius Schumacher <schumacher@kde.org>
3 SPDX-FileCopyrightText: 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
4
5 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
6*/
7#pragma once
8
9#include <QLabel>
10
11namespace EventViews
12{
13class AlternateLabel : public QLabel
14{
16public:
17 AlternateLabel(const QString &shortlabel, const QString &longlabel, const QString &extensivelabel = QString(), QWidget *parent = nullptr);
18 ~AlternateLabel() override;
19
20 enum TextType { Short = 0, Long = 1, Extensive = 2 };
21
22 [[nodiscard]] TextType largestFittingTextType() const;
23 void setFixedType(TextType type);
24
25public Q_SLOTS:
26 void useShortText();
27 void useLongText();
28 void useExtensiveText();
29 void useDefaultText();
30
31protected:
32 void resizeEvent(QResizeEvent *) override;
33 virtual void squeezeTextToLabel();
34 bool mTextTypeFixed = false;
35 const QString mShortText;
36 const QString mLongText;
37 QString mExtensiveText;
38
39private:
40 [[nodiscard]] int getIndent() const;
41};
42}
Namespace EventViews provides facilities for displaying incidences, including events,...
Definition agenda.h:33
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:29 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.