slicer.modules.SegmentEditorWidget does not exists anymore

I haven’t updated Slicer for a while, but now my .slicerrc does not work as usual. I have the line slicer.modules.SegmentEditorWidget.editor.findChild( "QWidget", "EffectsGroupBox" ), but in the newest Slicer version the SegmentEditorWidget is not there unless I have opened that module in Slicer window (for example by slicer.utils.selectModule( "SegmentEditor" )). However, opening that module creates a Segmentation node which I do not want.

How do I get access to the SegmentEditorWidget, without creating a Segmentation node?


My context: I use the following code in my startup file in order to set up shortcuts which I can access with my Wacom tablet menu:

def setupSegmentEditorShortcuts():
    # find buttons
    widget = slicer.modules.SegmentEditorWidget.editor.findChild("QWidget", "EffectsGroupBox")
    def addEffectShortcut(name, keysequence ):
        but = widget.findChild( 'QToolButton', name )
        shortcut = qt.QShortcut( mainWindow() ) # ^TODO: use SegmentEditorWidget for focused shortcut, does thtat work?
        shortcut.setKey( keysequence )
        shortcut.connect( 'activated()', lambda: but.click() )
    addEffectShortcut( "NULL", qt.QKeySequence( 'Shift+F4' ) )
    addEffectShortcut( "Paint", qt.QKeySequence( 'Shift+F5' ) )
    addEffectShortcut( "Draw", qt.QKeySequence( 'Shift+F6' ) )
    addEffectShortcut( "Erase", qt.QKeySequence( 'Shift+F7' ) )
    addEffectShortcut( "Scissors", qt.QKeySequence( 'Shift+F8' ) )
    # add shortcut for brush size
    qt.QShortcut( qt.QKeySequence( "Shift+F9"), mainWindow() ).connect( 'activated()', lambda: updateBrushSize( -1 ) )
    qt.QShortcut( qt.QKeySequence( "Shift+F10"), mainWindow() ).connect( 'activated()', lambda: updateBrushSize( 1 ) )