You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The script below works fine in 4.1.0.3 but results in a "Process finished with exit code -1073741819 (0xC0000005)" after upgrading to 4.2.1 (PySide6-Essentials-6.6.2 PySide6-qtads-4.2.1 shiboken6-6.6.2)
Env:
Python 3.11
Windows 11
Not sure if this is PySide6QtAds related or QtAds. Tried to reproduce in PyQtAds but that package on pip is still at version 3.8.1 so no luck there.
"""Demo / Test file for auto hide docks in PySide6QtAds.A custom close event is added to the docks to make them return to the hidden state when the close button is pressed."""fromPySide6importQtWidgetsimportPySide6QtAdsVERSION="4.2.1"# __version__ is not availableifVERSION=="4.2.1":
LOCATION=PySide6QtAds.ads.SideBarLocation.SideBarRightelse:
LOCATION=PySide6QtAds._ads.SideBarLocation.SideBarRightdefcreate_dock_manager(main_window):
# auto-hide iconsifVERSION=="4.2.1":
# 4.2.1PySide6QtAds.CDockManager.setAutoHideConfigFlags(
PySide6QtAds.ads.CDockManager.eAutoHideFlag.AutoHideSideBarsIconOnly
)
else:
# < 4.2.1PySide6QtAds.CDockManager.setAutoHideConfigFlag(
PySide6QtAds.CDockManager.DefaultAutoHideConfig
)
PySide6QtAds.CDockManager.setAutoHideConfigFlag(
PySide6QtAds.CDockManager.AutoHideSideBarsIconOnly, True
)
dock_manager=PySide6QtAds.CDockManager(main_window)
dock_manager.setConfigFlag(PySide6QtAds.CDockManager.ActiveTabHasCloseButton, False)
returndock_managerdefset_as_central_widget(
dock_manager: PySide6QtAds.CDockManager, widget: QtWidgets.QWidget
):
central_dock_widget=PySide6QtAds.CDockWidget("CentralWidget")
central_dock_widget.setWidget(widget)
central_dock_area=dock_manager.setCentralWidget(central_dock_widget)
central_dock_widget.setFeature(PySide6QtAds.CDockWidget.DockWidgetClosable, False)
central_dock_area.setAllowedAreas(PySide6QtAds.DockWidgetArea.OuterDockAreas)
returncentral_dock_widget#def_dock_return_to_hidden_state(d: PySide6QtAds.CDockWidget):
"""Triggers visibility (making it invisible) and then places it in the right sidebar."""d.toggleViewAction().trigger() # removes the dock from the guimanager=d.dockManager()
manager.addAutoHideDockWidget(LOCATION, d)
defadd_global_dock(
manager: PySide6QtAds.CDockManager,
d: PySide6QtAds.CDockWidget,
):
"""Adds a dock to the manager and make it a 'global' dock. Global docks are docks that can not be closed and are hidden on the top right by default. """assertisinstance(d, PySide6QtAds.CDockWidget)
#container=manager.addAutoHideDockWidget(
LOCATION, d
)
d.setFeature(PySide6QtAds.CDockWidget.DockWidgetFeature.CustomCloseHandling, True)
d.closeRequested.connect(lambdadock=d: _dock_return_to_hidden_state(dock))
container.setSize(350)
returndif__name__=="__main__":
fromPySide6.QtWidgetsimport (
QApplication,
QMainWindow,
QLabel,
)
app=QApplication()
mw=QMainWindow()
dock_manager=create_dock_manager(mw)
# create the central widget dockmain_widget=QLabel("Main Widget")
main_widget.setStyleSheet("background-color: lightblue;")
central_dock=PySide6QtAds.CDockWidget("Central Dock", mw)
central_dock.setWidget(main_widget)
central_dock_area=dock_manager.setCentralWidget(central_dock)
central_dock_area.setAllowedAreas(PySide6QtAds.DockWidgetArea.OuterDockAreas)
# create an un-closable dock on the right sizeglobal_widget1=QLabel("Global widget 1")
global_widget1.setStyleSheet("background-color: lightyellow;")
global_dock1=PySide6QtAds.CDockWidget("Global Dock 1", mw)
global_dock1.setWidget(global_widget1)
d=add_global_dock(dock_manager, global_dock1) #<-- Process finished with exit code -1073741819 (0xC0000005)mw.show()
app.exec()
The text was updated successfully, but these errors were encountered:
The script below works fine in 4.1.0.3 but results in a "Process finished with exit code -1073741819 (0xC0000005)" after upgrading to 4.2.1 (PySide6-Essentials-6.6.2 PySide6-qtads-4.2.1 shiboken6-6.6.2)
Env:
Python 3.11
Windows 11
Not sure if this is PySide6QtAds related or QtAds. Tried to reproduce in PyQtAds but that package on pip is still at version 3.8.1 so no luck there.
The text was updated successfully, but these errors were encountered: