Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef UTILS_H
5#define UTILS_H
6
7#include "ui4.h"
8#include <qstring.h>
9#include <qlist.h>
10#include <qhash.h>
11
13
14inline bool toBool(const QString &str)
16
18{ return str ? str->text() : QString(); }
19
20inline QHash<QString, DomProperty *> propertyMap(const QList<DomProperty *> &properties)
21{
22 QHash<QString, DomProperty *> map;
23 for (DomProperty *p : properties)
24 map.insert(p->attributeName(), p);
25 return map;
26}
27
29
30#endif // UTILS_H
iterator insert(const Key &key, const T &value)
Definition qmap.h:688
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
Definition qstring.cpp:6664
QString str
[2]
QMap< QString, QString > map
[6]
Combined button and popup list for selecting options.
@ CaseInsensitive
static const QCssKnownValue properties[NumProperties - 1]
GLfloat GLfloat p
[1]
QString toString(const DomString *str)
Definition utils.h:17
QT_BEGIN_NAMESPACE bool toBool(const QString &str)
Definition utils.h:14
QHash< QString, DomProperty * > propertyMap(const QList< DomProperty * > &properties)
Definition utils.h:20