QApplication::setDesktopSettingsAware(false)在pyqt如何设置
时间: 2024-03-20 21:38:40 浏览: 17
在 PyQt 中,可以使用 `QApplication.setDesktopSettingsAware(False)` 方法来设置桌面设置感知。具体的代码实现如下:
```python
from PyQt5.QtWidgets import QApplication
app = QApplication([])
app.setDesktopSettingsAware(False)
```
这样,就可以将桌面设置感知设置为 False 了。
相关问题
QApplication::setAttribute(Qt::AA_DisableSessionManager)在pyqt里如何设置
在 PyQt 中,可以使用 `QApplication.setAttribute()` 方法来设置应用程序的属性,包括 `Qt::AA_DisableSessionManager`。具体的代码实现如下:
```python
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication
app = QApplication([])
app.setAttribute(Qt.AA_DisableSessionManager)
```
这样,就可以将应用程序的 `Qt::AA_DisableSessionManager` 属性设置为 True 了。
QApplication::setAttribute(Qt::AA_DisableSessionManager)在pyqt中怎么写
在PyQt中,可以使用`QCoreApplication.setAttribute()`方法来设置Qt应用程序属性。因此,将上述代码翻译为PyQt代码,可以写成以下形式:
```python
from PyQt5.QtCore import Qt, QCoreApplication
QCoreApplication.setAttribute(Qt.AA_DisableSessionManager)
```
这将禁用Qt应用程序的会话管理器。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)