当前位置: 首页>>代码示例>>Python>>正文


Python QVTKRenderWindowInteractor.setStatusTip方法代码示例

本文整理汇总了Python中vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor.setStatusTip方法的典型用法代码示例。如果您正苦于以下问题:Python QVTKRenderWindowInteractor.setStatusTip方法的具体用法?Python QVTKRenderWindowInteractor.setStatusTip怎么用?Python QVTKRenderWindowInteractor.setStatusTip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor的用法示例。


在下文中一共展示了QVTKRenderWindowInteractor.setStatusTip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Ui_MainWindow

# 需要导入模块: from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor [as 别名]
# 或者: from vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor import setStatusTip [as 别名]
class Ui_MainWindow(object):

    def setup_ui(self, main_window):

        exitAction = QtGui.QAction(
            QtGui.QIcon('exit.png'), 'E&xit', main_window)
        exitAction.setShortcut('Ctrl+Q')
        exitAction.setStatusTip('Exit Application')
        exitAction.triggered.connect(main_window.close)

        # Menu
        self.menubar = QtGui.QMenuBar(main_window)
        self.menubar.setNativeMenuBar(False)
        self.file_menu = self.menubar.addMenu('&File')
        self.file_menu.addAction(exitAction)
        main_window.setMenuBar(self.menubar)

        # Status Bar
        self.statusbar = QtGui.QStatusBar(main_window)
        self.statusbar.showMessage('Ready')
        main_window.setStatusBar(self.statusbar)

        main_window.setObjectName('Main Window')
        main_window.resize(640, 480)

        self.central_widget = QtGui.QWidget(main_window)
        self.gridlayout = QtGui.QGridLayout(self.central_widget)
        self.gridlayout.setSpacing(5)

        # Widgets
        self.vtk_widget = QVTKRenderWindowInteractor(self.central_widget)
        self.vtk_widget.setStatusTip('VTK Rendering Pane')

        # QGroupBox with 2 Buttons. For file/folder open
        self.open_gbox = QtGui.QGroupBox('Open Image')
        self.open_folder_radio = QtGui.QRadioButton('Folder')
        self.open_folder_radio.setCheckable(True)
        self.open_folder_radio.setStatusTip('Open DICOM folder')
        self.open_file_radio = QtGui.QRadioButton('File')
        self.open_file_radio.setCheckable(True)
        self.open_file_radio.setStatusTip('Open single medical image')
        # hbox: Horizontal Box
        self.open_hboxlayout = QtGui.QHBoxLayout(self.open_gbox)
        self.open_hboxlayout.setSpacing(3)
        self.open_hboxlayout.addWidget(self.open_folder_radio)
        self.open_hboxlayout.addWidget(self.open_file_radio)

        # For 3 vtkImagePlaneWidget
        self.plane_gbox = QtGui.QGroupBox()
        # self.plane_gbox.setStyleSheet("QGroupBox {border: 0, solid;\
        #                                           }")
        self.plane_x_cbox = QtGui.QCheckBox('X')  # x-plane
        self.plane_y_cbox = QtGui.QCheckBox('Y')
        self.plane_z_cbox = QtGui.QCheckBox('Z')
        self.plane_hboxlayout = QtGui.QHBoxLayout(self.plane_gbox)
        # self.plane_hboxlayout.setSpacing(3)
        # self.plane_hboxlayout.addStretch(1)
        self.plane_hboxlayout.addWidget(self.plane_x_cbox)
        self.plane_hboxlayout.addWidget(self.plane_y_cbox)
        self.plane_hboxlayout.addWidget(self.plane_z_cbox)

        # QGroupBox with 3 QCheckBox. For rendering
        self.render_gbox = QtGui.QGroupBox('Rendering')  # gbox: Group Box
        self.vol_cbox = QtGui.QCheckBox('Volume')  # cbox: Check Box
        self.iso_cbox = QtGui.QCheckBox('Isosurface')
        self.plane_cbox = QtGui.QCheckBox('Planes')
        # vbox: Vertical Box
        self.render_vboxlayout = QtGui.QVBoxLayout(self.render_gbox)
        self.render_vboxlayout.addWidget(self.vol_cbox)
        self.render_vboxlayout.addWidget(self.iso_cbox)
        self.render_vboxlayout.addWidget(self.plane_cbox)
        # self.render_vboxlayout.addWidget(self.plane_gbox)

        # Reset Camera Button
        self.reset_camera_btn = QtGui.QPushButton('Reset Camera')

        # Layout of widgets
        self.gridlayout.addWidget(self.vtk_widget, 2, 0, 10, 1)
        self.gridlayout.addWidget(self.open_gbox, 2, 1)
        self.gridlayout.addWidget(self.render_gbox, 3, 1)

        self.gridlayout.addWidget(self.reset_camera_btn, 9, 1)

        # TEST
        self.test_btn = QtGui.QPushButton('Test Button')
        self.gridlayout.addWidget(self.test_btn, 10, 1)
        self.test_spin = QtGui.QSpinBox()
        self.gridlayout.addWidget(self.test_spin, 11, 1)

        main_window.setCentralWidget(self.central_widget)
开发者ID:quentan,项目名称:Work_Test_4,代码行数:92,代码来源:ui_main_window.py


注:本文中的vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor.setStatusTip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。