当前位置:网站首页>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
边栏推荐
- Code scanning payment flow chart of Alipay payment function developed by PHP
- 华为鸿蒙开发第四课
- Region of Halcon: generation of multiple regions (3)
- Construction scheme of distributed websocket
- Cnpm: unable to load file c:\users\administrator\appdata\roaming\npm\cnpm PS1 because running scripts is prohibited on this system.
- great! Auto like, I use pyautogui!
- ASEMI大功率场效应管和三极管的区别
- CTF_ Web: Changan cup-2021 old but a little new & asuka
- jsz中的join()
- JS' sort() function
猜你喜欢

js的sort()函数

绝了!自动点赞,我用 PyAutoGUI!

Simple text analysis of malicious samples - Introduction

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

两小时带你进入软件测试行业风口(附全套软件测试学习路线)

The solution of wechat applet switchtab unable to take parameters

Part I Verilog quick start

ASEMI三相整流桥的工作原理

Chapter IX app project test (2) test tools

Method of opening data recovery of solid state disk
随机推荐
CTF_ Web: Changan cup-2021 old but a little new & asuka
js的sort()函数
Successfully solved: selenium common. exceptions. TimeoutException: Message: timeout: Timed out receiving message from
Vscode 设置clang-format
XML (VIII)
Why does the SQL statement hit the index faster than it does not?
Cascading deletion of gbase 8s
Which programming language is the most cumbersome to implement Hello world?
After the newly assigned variable of the applet is modified, the original variable will also be modified
JS arguments
File upload vulnerability shooting range upload labs learning (pass1-pass5)
Upgrade PHP to php7 The impact of X (2), the obsolescence of mcrypt decryption
Introduction to the hardest core PWN in the whole network_ Graphic analysis
Mongodb cluster
The SQL response is slow. What are your troubleshooting ideas?
Construction scheme of distributed websocket
Heavy broadcast | phase shift method + mathematical principle derivation of multi frequency heterodyne + implementation
Gbase 8s parallel operation problem scenario description
ASEMI大功率场效应管和三极管的区别
Gbase 8s memory management