当前位置:网站首页>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) //static3、 ... 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\FTHtake 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
边栏推荐
- Separation of storage and computing in Dahua cloud native database
- JS call() and apply()
- PostgreSQL database Wal - RM_ HEAP_ ID logging action
- JS, BOM, DOM (VI)
- How do the defi protocols perform under this round of stress test?
- Machine learning deep learning -- Vectorization
- Codeforces Round #802 (Div. 2) C D
- Multithreading structure of gbase 8s
- 华为鸿蒙开发第四课
- Data view for gbase 8s
猜你喜欢

Record the problem of C # print size once

机器学习深度学习——向量化

固态硬盘开盘数据恢复的方法
![[image fusion] image fusion based on MATLAB directional discrete cosine transform and principal component analysis [including Matlab source code 1907]](/img/a1/f7a35a04e180e89d7f2fdbf89c1160.jpg)
[image fusion] image fusion based on MATLAB directional discrete cosine transform and principal component analysis [including Matlab source code 1907]

固態硬盤開盤數據恢複的方法

WPF uses Maui's self drawing logic

成功解决:selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from

30岁了开始自学编程,家里比较困难还来得及吗?

电脑的dwg文件怎么打开

win11蓝牙无法连接怎么办?win11蓝牙无法连接的解决方法
随机推荐
XML (VIII)
JS call() and apply()
Separation of storage and computing in Dahua cloud native database
哪个编程语言实现hello world最烦琐?
我的IC之旅——资深芯片设计验证工程师成长——“胡”说IC工程师完美进阶
渗透测试-目录遍历漏洞
Blob page in gbase 8s
Use of deferred environment variable in gbase 8s
本轮压力测试下,DeFi协议们表现如何?
buuctf web
Codeforces Round #802 (Div. 2) C D
Trigger for gbase 8s
Wechat likes to pay attention to the solution of invalid automatic reply
Data view for gbase 8s
The solution of wechat applet switchtab unable to take parameters
Machine learning deep learning -- Vectorization
ORA-00800: soft external error
js的arguments
Cookie & session & JSP (XII)
为什么SQL语句命中索引比不命中索引要快?