Kirigami2

enums.cpp
1 /*
2  * SPDX-FileCopyrightText: 2016 Marco Martin <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 #include "enums.h"
8 
9 #include "moc_enums.cpp"
10 
11 #include <QVariant>
12 
13 bool DisplayHint::displayHintSet(DisplayHints values, Hint hint)
14 {
15  return isDisplayHintSet(values, hint);
16 }
17 
18 bool DisplayHint::displayHintSet(QObject *object, DisplayHint::Hint hint)
19 {
20  if (!object) {
21  return false;
22  }
23 
24  auto property = object->property("displayHint");
25  if (property.isValid()) {
26  return isDisplayHintSet(DisplayHints{property.toInt()}, hint);
27  } else {
28  return false;
29  }
30 }
31 
32 bool DisplayHint::isDisplayHintSet(DisplayHint::DisplayHints values, DisplayHint::Hint hint)
33 {
34  if (hint == DisplayHint::AlwaysHide && (values & DisplayHint::KeepVisible)) {
35  return false;
36  }
37 
38  return values & hint;
39 }
QAction * hint(const QObject *recvr, const char *slot, QObject *parent)
QVector< V > values(const QMultiHash< K, V > &c)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:14:23 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.