Pimcommon

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

KDE's Doxygen guidelines are available online.