当前位置:网站首页>QTreeWidget作为单例模式以dll返回的两个问题
QTreeWidget作为单例模式以dll返回的两个问题
2022-06-24 15:32:00 【kupeThinkPoem】
目录
1、Must construct a QApplication before a QPaintDevice
一、现象
最近写一个Qt的dll,QTreeWiget需要在dll中返回,但是遇到了崩溃等问题。
二、问题
1、Must construct a QApplication before a QPaintDevice
Releases和DEBUG版本的库混在一起了,虽然他们是不同的名字(Debug版本带个d)。
2、程序崩溃
单例往往是静态全局变量,如果在单例的构造函数里面调用new QTreeWidget,QApplication这时还没有定义。在QApplication声明定义之后,再init调用new QTreeWidget,否则会有程序崩溃现象。
三、总结
在制作界面dll得注意,在QApplication声明定义之后才能进行界面的生成和初始化。
边栏推荐
- 一个简单而功能强大的开发者工具箱Box3.cc
- Istio Troubleshooting: using istio to reserve ports causes pod startup failure
- Cvpr2022 𞓜 thin domain adaptation
- The industrial control security of roaming the Intranet
- Motion planning of floating base robot
- practice
- 3 ring kill 360 security guard process
- Task priority motion planning of floating base
- Xingxinghai, it is said that the new generation can fight better?
- [log service CLS] initial experience of Tencent cloud CLS log service
猜你喜欢

A brief introduction to the lexical analysis of PostgreSQL

动作捕捉系统用于地下隧道移动机器人定位与建图

Multimeter resistance measurement diagram and precautions

Laravel 8 realizes auth login

IDEA 插件 Material Theme UI收费后的办法

Successfully solved: selenium common. exceptions. SessionNotCreatedException: Message: session not created: This versi

CVPR 2022 - Interpretation of selected papers of meituan technical team

ES mapping之keyword;term查詢添加keyword查詢;更改mapping keyword類型

postgresql之词法分析简介

常见的缺陷管理工具——禅道,从安装到使用手把手教会你
随机推荐
Low fidelity prototype vs high fidelity prototype, which one is more suitable for your design?
How to implement redis cache of highly paid programmers & interview questions series 115? How do I find a hot key? What are the possible problems with caching?
In 2021, big companies often ask IOS interview questions -- runloop
Use list
东方财富哪个开户更安全,更好点
API data interface for announcement of Hong Kong listed companies
Actual combat | a tortuous fishing counteraction
How to allow easydss online classroom system to upload an on-demand file with a space in the file name?
Port conflict handling method for tongweb
laravel8使用faker调用工厂填充数据
US Senate promotes bipartisan gun safety bill
Typescript raw data type
阿里OSS对象存储服务
Istio practical skill: enable accesslog locally
Multimeter resistance measurement diagram and precautions
leetcode 139. Word break word split (medium)
Domestic payment system and payment background construction
Record the range of data that MySQL update will lock
Bert whitening vector dimension reduction and its application
兴业证券靠谱吗?开证券账户安全吗?