Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
modmedLog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MODMED
modmedLog
Commits
b93816f4
Commit
b93816f4
authored
Nov 15, 2019
by
EXT Arnaud Clère
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renaming QMetaObject-based qbind: qzap
parent
ad0429bf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
tests/QBind/QValue.h
tests/QBind/QValue.h
+3
-3
tests/QBind/data.h
tests/QBind/data.h
+1
-1
No files found.
tests/QBind/QValue.h
View file @
b93816f4
...
...
@@ -848,9 +848,9 @@ QSeq<T_> QSeq<T_>::forEach(Ts& ts,
#include <QtCore/qmetatype.h>
#include <QtCore/qmetaobject.h>
// For Q
BIND_GADGET
_WITH_METAOBJECT below
// For Q
_DEFINE_ZAP
_WITH_METAOBJECT below
template
<
class
T
>
QValueStatus
q
bind
(
QValue
&&
v
,
T
*
t
)
{
QValueStatus
q
zap
(
QValue
&&
v
,
T
*
t
)
{
auto
rw
=
v
->
mode
();
auto
mo
=
T
::
staticMetaObject
;
auto
r
=
v
.
meta
(
qmName
,
QAsciiData
(
mo
.
className
())).
record
();
...
...
@@ -921,7 +921,7 @@ QValueStatus qbind(QValue&& v, T* t) {
}
//! Default bind(QValue&&) based on static QMetaObject reflection
#define Q
BIND_GADGET_WITH_METAOBJECT(Class) QValueStatus zap(QValue&& v) { return qbind
<Class>(std::move(v), this); }
#define Q
_DEFINE_ZAP_WITH_METAOBJECT(Class) QValueStatus zap(QValue&& v) { return qzap
<Class>(std::move(v), this); }
template
<
typename
T
>
struct
QTransmogrifier
<
QDefaultValue
<
T
>>
{
...
...
tests/QBind/data.h
View file @
b93816f4
...
...
@@ -9,7 +9,7 @@ class Phone {
Q_PROPERTY
(
Type
type
MEMBER
_t
)
Q_PROPERTY
(
QString
number
MEMBER
_n
)
public:
Q
BIND_GADGET
_WITH_METAOBJECT
(
Phone
)
// making it (de)serializable and printable using reflection
Q
_DEFINE_ZAP
_WITH_METAOBJECT
(
Phone
)
// making it (de)serializable and printable using reflection
enum
Type
:
quint8
{
Unknown
=
0
,
Mobile
,
Home
,
Office
};
Q_ENUM
(
Type
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment