|
|
372行目: |
372行目: |
| [[カテゴリ:Qt]][[カテゴリ:Python]] | | [[カテゴリ:Qt]][[カテゴリ:Python]] |
|
| |
|
| == エラー関連 ==
| |
| PySide2プロジェクトを実行する時、以下のような警告が出力される場合がある。<br>
| |
| Qt WebEngine seems to be initialized from a plugin.
| |
| Please set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute before constructing QGuiApplication.
| |
| <br>
| |
| これは、<code>QApplication</code>クラスのインスタンスを生成する前に、<code>AA_ShareOpenGLContexts</code>を設定することで修正できる。<br>
| |
| 以下の例は、PySide2を使用している場合である。<br>
| |
| <syntaxhighlight lang="python">
| |
| from PySide2 import QtCore, QtWidgets
| |
|
| |
| # ...略
| |
|
| |
| if __name__ == '__main__':
| |
| QCoreApplication.setAttribute(Qt.AA_ShareOpenGLContexts)
| |
| app = QApplication(sys.argv)
| |
|
| |
| # ...略
| |
| </syntaxhighlight>
| |
| <br>
| |
| また、PySide6を使用することで警告を回避することもできる。<br>
| |
| <br><br>
| |
|
| |
|
| __FORCETOC__ | | __FORCETOC__ |
| [[カテゴリ:Qt]][[カテゴリ:Python]] | | [[カテゴリ:Qt]][[カテゴリ:Python]] |