当前位置:网站首页>Error: c2665: "qmessagebox:: critical": none of the four overloads can convert all parameter types
Error: c2665: "qmessagebox:: critical": none of the four overloads can convert all parameter types
2022-06-29 22:46:00 【Miaowei】
Qt List of articles
List of articles
Preface
In the use of QMessageBox::criticalQtCreator Compiler error :
E:\QtExercise\QtReadWriteXml\QtXmlDom\QtXmlDom\AnalysisTrackDpj.cpp:39: error: C2665: “QMessageBox::critical”: 4 None of the overloads can convert all parameter types 

One 、 Question why
1. The first thing to think about is not including QMessageBox The header file , So include QMessageBox The header file , But the problem is still unsolved 
2. Let yourself define AnalysisTrackDpj Class inheritance QMessageBox
Although the compilation has passed , It works ,
But the compiler gives a warning :direct base ‘QObject’ is inaccessible due to ambiguity:
Think I let AnalysisTrackDpj Inherit separately QObject and QMessageBox, and QMessageBox Inherit again QObject, I always feel that there is a problem

3. take this Change to 0
Through continuous testing and consulting data, it is found that this The problem of pointer . because information The first parameter type of the static function is QWidget* parent. And my DatabaseOperatoor.cpp There is no window to create , hold this Pass to information, The compiler cannot determine who its parent window is . The solution is to this Change to 0, I am the top window , solve the problem .
For detailed description, click c++ - About Qt MessageBox::warning() overloading - Stack Overflow To view the

Reference resources
边栏推荐
- wirehark数据分析与取证infiltration.pacapng
- js函数相关的复习
- leetcode 416. Partition equal subset sum partition equal subset sum (medium)
- Touch key and key control corresponding LED status reversal
- Efficient implementation of dynamiccast with template function and specialization function
- qt5.14.2连接ubuntu20.04的mysql数据库出错
- 正如以往我们对于互联网的看法一样,我们对于互联网的认识开始变得深度
- 云原生爱好者周刊:炫酷的 Grafana 监控面板集合
- 5-2web application vulnerability scanning
- 读书郎上市背后隐忧:业绩下滑明显,市场地位较靠后,竞争力存疑
猜你喜欢

低代码、端到端,一小时构建IoT示例场景,声网发布灵隼物联网云平台

#第三天

解题元宇宙,网络游戏中的多元通信方案

触摸按键与按键控制对应的LED状态翻转

Daily mathematics serial 54: February 23

Portable 4K audio and video conference terminal all-in-one machine with 8x digital zoom

深入解析kubernetes controller-runtime

Low code, end-to-end, one hour to build IOT sample scenarios, and the sound network released lingfalcon Internet of things cloud platform

26 years old, 0 basic career change software test, from 3K to 16K monthly salary, a super complete learning guide compiled by me

合宙AIR32F103CBT6开发板上手报告
随机推荐
js函数相关的复习
5-2web application vulnerability scanning
What are the software testing methods and technical knowledge points?
【无工具搭建PHP8+oracle11g+Windows环境】内网/无网络/Win10/PHP连接oracle数据库实例
math_ Basic elementary function graph (power function / exponent / logarithm / trigonometry / inverse trigonometry)
Mysql database: the difference between drop, truncate and delete
Spark cluster installation
Kr-gcn: an interpretable recommendation system based on knowledge aware reasoning
《天天数学》连载54:二月二十三日
论文浅尝 | KR-GCN: 知识感知推理的可解释推荐系统
Touch key and key control corresponding LED status reversal
Basic use of Nacos configuration center
Qt5.14.2 error connecting to the MySQL database of Ubuntu 20.04
Just like our previous views on the Internet, our understanding of the Internet began to become deeper
Live broadcast platform development, enter the visual area to execute animation, dynamic effects and add style class names
#第三天
0. grpc环境搭建
Go zero micro Service Practice Series (VII. How to optimize such a high demand)
error: C2665: “QMessageBox::critical”: 4 个重载中没有一个可以转换所有参数类型
Daily mathematics serial 54: February 23