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 {
21 Short = 0,
22 Long = 1,
23 Extensive = 2
24 };
25
26 [[nodiscard]] TextType largestFittingTextType() const;
27 void setFixedType(TextType type);
28
29public Q_SLOTS:
30 void useShortText();
31 void useLongText();
32 void useExtensiveText();
33 void useDefaultText();
34
35protected:
36 void resizeEvent(QResizeEvent *) override;
37 virtual void squeezeTextToLabel();
38 bool mTextTypeFixed = false;
39 const QString mShortText;
40 const QString mLongText;
41 QString mExtensiveText;
42
43private:
44 [[nodiscard]] int getIndent() const;
45};
46}
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 Sat Dec 21 2024 16:57:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.