我正面临 pyQT 的问题。所以我用设计器创建了一个图形界面,其中包含一个 QTabWidget。事情是我想在我的函数运行时隐藏和显示选项卡。我找到了一种解决方案,它包括删除所有选项卡并稍后添加它们。可以说我只有两个标签:
removedTab = self._application.getAlgorithmGUI().getWidget('tabWidget_Verification').widget(1)
self._application.getAlgorithmGUI().getWidget( 'tabWidget_Verification' ).removeTab( 1 )
当我稍后尝试添加这个已删除的选项卡时,我的程序崩溃了。
self._application.getAlgorithmGUI().getWidget( 'tabWidget_Verification' ).addTab(removedTab,QString.fromUtf8("TabRemoved"))
这是我的错误信息:
QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread
QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread
QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread
QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread
<unknown>: Fatal IO error 11 (Ressource temporairement non disponible) on X server :0.0.
有什么建议么?