当前位置:网站首页>QT notes - custom data types
QT notes - custom data types
2022-07-24 12:07:00 【Cool breeze in the old street °】
1. When we send data by thread , We often encounter the following situations :
Translated into :
QOject::connect Cannot type QVector<int> Parameters of the queue ( Please make sure QVector<int> Registered qRegisterMetaType)
Help document :
So we try to use qRegisterMetaType To register our customized data
// Register custom data
qRegisterMetaType<QVector<int>>("QVector<int>");
2. When we use QVariant When using custom data , We often encounter the following situations :
Help document :
Set the custom type to QVariant, We usually use Q_DECLARE_METATYPE This macro , Need to be defined outside the class , It takes effect after this custom type , Otherwise, an error will be reported
struct Person
{
QString name;
int age;
int score;
QString className;
};
Q_DECLARE_METATYPE(Person)
边栏推荐
- What is prescaler in STM32
- Threat hunting collection
- Most after analyze table in PostgreSQL_ common_ Why is the elems field not filled in?
- CCF 1-2 question answering record (2)
- MOS tube - Notes on rapid recovery application (I) [principle]
- One of his birds sold for 60million -- the collection of eight mountain people in the Ming and Qing Dynasties
- [data mining engineer - written examination] sheen company in 2022
- Basic usage of GCC
- 栈顶与栈底
- Collision, removal and cleaning
猜你喜欢

NFT digital collection system construction - app development

3、 Implementation principle of MFC message mapping mechanism

动态内存管理

容错、熔断的使用与扩展

Microsoft SQL Server database language and function usage (XII)

One of his birds sold for 60million -- the collection of eight mountain people in the Ming and Qing Dynasties

Linked list - Sword finger offer interview question 02.07. linked list intersection

QT notes - qtablewidget table spanning tree, qtreewidget tree node generates table content

安装jmeter

MySQL advanced (XVII) cannot connect to database server problem analysis
随机推荐
LogBack & MDC & a simple use
Operational amplifier - Notes on rapid recovery [II] (application)
Basic syntax of MySQL DDL and DML and DQL
Nacos permissions and databases
Dry goods sharing - taking over a new data team as a lead - Problem Inventory and insights findings
Cgo+gsoap+onvif learning summary: 9. Go and C conduct socket communication and onvif protocol processing
动态内存管理
[rust] Why do I suggest you learn rust | a preliminary study of rust
Optimization method of "great mathematics for use" -- optimal design of Cascade Reservoir Irrigation
Detailed OSPF configuration of layer 3 switch / router [Huawei ENSP experiment]
【C和指针第11章】动态内存分配
Collision, removal and cleaning
计算两个坐标经纬度之间的距离(5种方式)
A*与JPS
One week's wonderful content sharing (issue 13)
2 万字详解,吃透 ES!
Common shortcuts to VIM editor
[mathematical basis of Cyberspace Security Chapter 3] congruence
Threat hunting collection
QT notes - EventFilter event filter