Skip to content

Commit c6c2e72

Browse files
committed
add variant type aliases, as preparation to migrate away from QVariant
1 parent 8f4494b commit c6c2e72

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

src/core/core.pri

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
HEADERS += \
22
$$PWD/cowbytearray.h \
3-
$$PWD/cowstring.h
3+
$$PWD/cowstring.h \
4+
$$PWD/variant.h
45

56
HEADERS += \
67
$$PWD/zmqcontext.h \

src/core/variant.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (C) 2026 Fastly, Inc.
3+
*
4+
* This file is part of Pushpin.
5+
*
6+
* $FANOUT_BEGIN_LICENSE:APACHE2$
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*
20+
* $FANOUT_END_LICENSE$
21+
*/
22+
23+
#ifndef VARIANT_H
24+
#define VARIANT_H
25+
26+
#include <QVariant>
27+
#include <QHash>
28+
#include <QMap>
29+
#include <QList>
30+
#include "qtcompat.h"
31+
32+
using Variant = QVariant;
33+
using VariantHash = QVariantHash;
34+
using VariantMap = QVariantMap;
35+
using VariantList = QVariantList;
36+
37+
// Note: typeId() and canConvert() functions are already provided by qtcompat.h
38+
// Since Variant = QVariant (alias), those functions work directly with our types
39+
40+
#endif

0 commit comments

Comments
 (0)