当前位置:网站首页>Qdebug June 2022
Qdebug June 2022
2022-06-25 04:50:00 【Gongjianbo】
One 、Qt Widgets Problem communication
Two 、Qt Quick Problem communication
1.QML The program does not start properly on some graphics cards
Environmental Science :Window10 MSVC2019 Qt5.15.2-64bit( Lower versions will also )
The phenomenon : The notebook + The expansion screen has two screens ,Windows The main screen of the setting can normally display QML Of Window window , The auxiliary screen will be stuck during startup ( A black or white window is stuck there ; The default operation focus will pop up on which screen , So the program can be started by dragging it to the corresponding screen ). Disable the integrated graphics card that comes with the notebook , The main screen and auxiliary screen can be started normally .
Later learned Qt You can set the blacklist of the graphics card .Qt Quick application OpenGL The order of implementation is desktop,angle,software, To use Qt Quick 2 Work needs to be provided OpenGL2.1 And above , This requires disabling some pairs of OpenGL Support problematic graphics cards , And then use angle perhaps software .
Qt file :https://doc.qt.io/qt-5/windows-requirements.html
my Demo:https://github.com/gongjianbo/MyTestCode2021/tree/master/Qml/OpenGLBlackList
Write the problematic graphics card information to a json In file , And then in the environment variable QT_OPENGL_BUGLIST Appoint json Path to file ( To facilitate the resource file path I use here ):
{
"name": "Qt built-in GPU driver blacklist",
"version": "5.14",
"entries": [
{
"id": 1,
"description": "Intel(R) UHD Graphics",
"vendor_id": "0x8086",
"device_id": ["0x9ba4"],
"os": {
"type": "win"
},
"features": [
"disable_desktopgl"
]
}
]
}
int main(int argc, char *argv[])
{
qputenv("QT_OPENGL_BUGLIST", ":/opengl-blacklist.json");
QGuiApplication app(argc, argv);
... ...
return app.exec();
}
This type of graphics card is disabled in the settings desktop opengl, Will try angle and software The implementation of the .
json File each graphics card mainly distinguishes two parameters , manufacturer id And equipment id, It can be downloaded from Windows View... In device manager , This VEN The last four hexadecimal digits are the manufacturers id, DEV The next four hexadecimal digits are the device id:
There are many types of graphics cards that may be incompatible , It will be updated to the blacklist .
2.QML FileDialog Pick up to url The path is formatted as a local path
QML Of FileDialog The obtained file or directory path is url Format , Except that the path is preceded by "file:///" start , And escape #%^{} Equal special symbol .
Qt C++ Of QUrl Class provides two interfaces for url Conversion with local path format :
//url Convert to local path
QString QUrl::toLocalFile() const
// Generate based on local path url
QUrl QUrl::fromLocalFile(const QString &localFile) //static
3、 ... and 、 other
1.QString Remove blanks
QString str=" a b\t\tc\n\nd ";
// Remove any white space
str.remove(QRegularExpression("\\s")); //"abcd"
str.remove(QRegExp("\\s")); //"abcd"
// Remove the head blank
str.remove(QRegExp("^ +\\s*")); //"a b\t\tc\n\nd "
// Remove trailing blanks
str.remove(QRegExp("\\s* +$")); //" a b\t\tc\n\nd"
// Remove the blank on both sides
str=str.trimmed(); //"a b\t\tc\n\nd"
// Remove the blank on both sides , And replace the internal white space with a single space
str=str.simplified(); //"a b c d"
qDebug()<<str;
2.FTH: ( Numbers ): ***Fault tolerant heap shim applied to current process. This is usually due toprevious crashes. ***
Microsoft documentation :https://docs.microsoft.com/en-us/windows/win32/win7appqual/fault-tolerant-heap
Qt Creator The error prompt appears when running the program in , Most likely, the runtime crashed before . After the error prompt appears, you need to modify the registry to set , Otherwise, this error will be prompted every time .
Refer to Microsoft documentation , Fault tolerant heap (Fault Tolerant Heap,FTH) yes Windows 7 A subsystem of , Responsible for monitoring application crashes and autonomously applying mitigation measures , To prevent future crashes on every application . But I didn't find any specific use , Should it collapse or will it collapse .
First find the registry FTH Set up :
Computer \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FTH
take Enabled One from 1 Set to 0( I also took FTH/State A message under the directory that is the same as the program name is deleted )
The document says restart the computer after setting ,FTH Will no longer activate for new applications ( But the actual measurement does not restart and there is no problem )
After setting, execute CMD Command to clear all FTH Application records :
Rundll32.exe fthsvc.dll,FthSysprepSpecialize
边栏推荐
- Paper notes: multi label learning ESMC (I don't understand it, but I haven't written it yet, so I'll put it here for a place temporarily)
- Immutable學習之路----告別傳統拷貝
- Vscade setting clang format
- dotnet-exec 0.4.0 released
- 【图像融合】基于matlab方向离散余弦变换和主成分分析图像融合【含Matlab源码 1907期】
- js中的concat()
- Méthode de récupération des données d'ouverture du disque dur à l'état solide
- Why PHP is not safe
- 重磅直播 | 相移法+多频外差之数学原理推导+实现
- 写shell脚本报错总结
猜你喜欢
哪个编程语言实现hello world最烦琐?
台式电脑连不上wifi怎么办
2.0SpingMVC使用RESTful
Web3 DApp用户体验最佳实践
Méthode de récupération des données d'ouverture du disque dur à l'état solide
Why does the SQL statement hit the index faster than it does not?
At the age of 30, I began to learn programming by myself. Is it still time for me to have difficulties at home?
win11蓝牙无法连接怎么办?win11蓝牙无法连接的解决方法
Simple text analysis of malicious samples - Introduction
在 .NET 6 中使用 dotnet format 格式化代码
随机推荐
Basic introduction of gbase 8s blocking technology
Wechat likes to pay attention to the solution of invalid automatic reply
Codeforces Round #802 (Div. 2) C D
【FLink】access closed classloader classloader. check-leaked-classloader
Kotlin Compose 完善toDo项目 Surface 渲染背景 与阴影
epplus复制模板后打印区域变小的问题
[image fusion] image fusion based on MATLAB directional discrete cosine transform and principal component analysis [including Matlab source code 1907]
buuctf(pwn)
Filter & listener (XIV)
Vscade setting clang format
机器学习深度学习——向量化
Triangle class (construction and deconstruction)
Cookie & session & JSP (XII)
大话云原生数据库中的存算分离
Part I Verilog quick start
重磅直播 | 相移法+多频外差之数学原理推导+实现
STM32的DMA双缓冲模式详解
Data import and export for gbase 8s
华为鸿蒙开发第四课
【无标题】