Eventviews

decorationlabel.h
1/*
2 SPDX-FileCopyrightText: 2000, 2001, 2003 Cornelius Schumacher <schumacher@kde.org>
3 SPDX-FileCopyrightText: 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
4 SPDX-FileCopyrightText: 2007 Loïc Corbasson <loic.corbasson@gmail.com>
5
6 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
7*/
8#pragma once
9
10#include "calendardecoration.h"
11
12#include <QLabel>
13
14namespace EventViews
15{
16class DecorationLabel : public QLabel
17{
19public:
20 explicit DecorationLabel(EventViews::CalendarDecoration::Element *e, QWidget *parent = nullptr);
21
22 explicit DecorationLabel(const QString &shortText,
23 const QString &longText = QString(),
24 const QString &extensiveText = QString(),
25 const QPixmap &pixmap = QPixmap(),
26 const QUrl &url = QUrl(),
27 QWidget *parent = nullptr);
28 ~DecorationLabel() override;
29
30public Q_SLOTS:
31 void setExtensiveText(const QString &);
32 void setLongText(const QString &);
33 void setPixmap(const QPixmap &);
34 void setShortText(const QString &);
35 void setText(const QString &);
36 void setUrl(const QUrl &);
37 void useShortText(bool allowAutomaticSqueeze = false);
38 void useLongText(bool allowAutomaticSqueeze = false);
39 void useExtensiveText(bool allowAutomaticSqueeze = false);
40 void usePixmap(bool allowAutomaticSqueeze = false);
41 void useDefaultText();
42
43protected:
44 void resizeEvent(QResizeEvent *) override;
45 void mouseReleaseEvent(QMouseEvent *) override;
46 virtual void squeezeContentsToLabel();
47 bool mAutomaticSqueeze = true;
48 EventViews::CalendarDecoration::Element *mDecorationElement = nullptr;
49 QString mShortText;
50 QString mLongText;
51 QString mExtensiveText;
52 QPixmap mPixmap;
53 QUrl mUrl;
54};
55}
Class for calendar decoration elements.
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 Mon Nov 18 2024 12:07:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.