Pimcommon

customtreeview.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "pimcommon_export.h"
10#include <QTreeWidget>
11class QPaintEvent;
12class QEvent;
13namespace PimCommon
14{
15/**
16 * @brief The CustomTreeView class
17 * @author Laurent Montel <montel@kde.org>
18 */
19class PIMCOMMON_EXPORT CustomTreeView : public QTreeWidget
20{
21 Q_OBJECT
22public:
23 explicit CustomTreeView(QWidget *parent = nullptr);
24 ~CustomTreeView() override;
25
26 void setDefaultText(const QString &text);
27
28 [[nodiscard]] bool showDefaultText() const;
29 void setShowDefaultText(bool b);
30
31protected:
32 void paintEvent(QPaintEvent *event) override;
33 void changeEvent(QEvent *event) override;
34
35 bool mShowDefaultText = true;
36
37private:
38 PIMCOMMON_NO_EXPORT void generalPaletteChanged();
39 PIMCOMMON_NO_EXPORT void generalFontChanged();
40 QColor mTextColor;
41 QString mDefaultText;
42};
43}
The CustomTreeView class.
folderdialogacltab.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.