Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Slicer 3D GUI edit
QtWS25 Last Chance

Slicer 3D GUI edit

Scheduled Pinned Locked Moved Unsolved General and Desktop
interfacedock widgetpositioning
2 Posts 2 Posters 383 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Santiago_Pendon
    wrote on last edited by
    #1

    Hi to everyone!

    This is my very first post in Qt Forum :)

    I'm a 3D Slicer user (https://www.slicer.org/) and now me and my team develops a tool that requires some interface modifications. Slicer 3D chiefs told me that all the interface is made by Qt, and can be modified using Python so... This is the idea:

    I have a function that creates this: (The text is modified)
    Captura de pantalla 2024-05-03 095056.png

    For that I use:

    def createDockInterface():
        # Delete the statusBar to have cleaner view:
        slicer.util.mainWindow().setStatusBar(None)
        
        # Create and name the widget:
        dock_widget = qt.QDockWidget("ST Assistant v16")
        dock_widget.setObjectName('SegmentTracerDockWidget')
        
        
        # Add the Welcome text:
        label = qt.QLabel("Welcome to SegmentTracer. Loading and resampling data")
        dock_layout = qt.QVBoxLayout()
        dock_layout.addWidget(label)
        dock_content = qt.QWidget()
        dock_content.setLayout(dock_layout)
        dock_widget.setWidget(dock_content)
        
        # Display the widget in bottom left corner:
        slicer.util.mainWindow().addDockWidget(qt.Qt.LeftDockWidgetArea, dock_widget)   
    
    

    But I would like to move it to here:
    Captura de pantalla 2024-05-03 095607.png

    At this moment, we can move it dragging the dock but, it would be great if the widget will appear on the top automatically.

    Thanks for any help! :)

    Pl45m4P 1 Reply Last reply
    0
    • S Santiago_Pendon

      Hi to everyone!

      This is my very first post in Qt Forum :)

      I'm a 3D Slicer user (https://www.slicer.org/) and now me and my team develops a tool that requires some interface modifications. Slicer 3D chiefs told me that all the interface is made by Qt, and can be modified using Python so... This is the idea:

      I have a function that creates this: (The text is modified)
      Captura de pantalla 2024-05-03 095056.png

      For that I use:

      def createDockInterface():
          # Delete the statusBar to have cleaner view:
          slicer.util.mainWindow().setStatusBar(None)
          
          # Create and name the widget:
          dock_widget = qt.QDockWidget("ST Assistant v16")
          dock_widget.setObjectName('SegmentTracerDockWidget')
          
          
          # Add the Welcome text:
          label = qt.QLabel("Welcome to SegmentTracer. Loading and resampling data")
          dock_layout = qt.QVBoxLayout()
          dock_layout.addWidget(label)
          dock_content = qt.QWidget()
          dock_content.setLayout(dock_layout)
          dock_widget.setWidget(dock_content)
          
          # Display the widget in bottom left corner:
          slicer.util.mainWindow().addDockWidget(qt.Qt.LeftDockWidgetArea, dock_widget)   
      
      

      But I would like to move it to here:
      Captura de pantalla 2024-05-03 095607.png

      At this moment, we can move it dragging the dock but, it would be great if the widget will appear on the top automatically.

      Thanks for any help! :)

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @Santiago_Pendon said in Slicer 3D GUI edit:

      it would be great if the widget will appear on the top automatically.

      AFAIK there is no way to set a position or order of QDockWidgets in some DockArea.
      I think they are ordered the way they are added.
      So to have your own QDockWidget on top, you have to add it before everything else, which might be tricky.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved