Ejemplo n.º 1
0
    def __init__(self,
                 parent: QWidget = None,
                 scene: 'PMGraphicsScene' = None):
        super().__init__(parent)
        self.groups = ['simple_calc', 'logic', 'matrix', 'plot', 'io']
        self.node_info_dic: Dict[str, List[Dict[str, object]]] = {
            key: []
            for key in self.groups
        }

        self.setLayout(QVBoxLayout())
        self.top_layout = QHBoxLayout()
        self.layout().addLayout(self.top_layout)
        self.button_edit = QPushButton('Edit')
        self.button_add = QPushButton('Add')
        self.top_layout.addWidget(self.button_edit)
        self.top_layout.addWidget(self.button_add)
        self.button_edit.clicked.connect(self.on_edit)
        self.button_add.clicked.connect(self.on_add)
        self.toolbox = QToolBox()
        self.list_widgets: Dict[str, QListWidget] = {}
        for text in self.groups:
            list_widget = QListWidget()
            list_widget.doubleClicked.connect(self.on_item_double_clicked)
            self.layout().addWidget(self.toolbox)
            self.toolbox.addItem(list_widget, text)
            self.list_widgets[text] = list_widget
        self.scene: 'PMGraphicsScene' = scene
        self.load_nodes()
Ejemplo n.º 2
0
 def init_widgets(self):
     self.janus.widgets["mainwindow"] = QMainWindow()
     self.janus.widgets["mainwindow"].setWindowTitle(self.applicationName())
     central_widget = QWidget(self.janus.widgets["mainwindow"])
     self.janus.widgets["mainwindowlayout"] = QHBoxLayout(central_widget)
     self.janus.widgets["mainwindow"].resize(1368, 768)
     self.janus.widgets["mainwindow"].setCentralWidget(central_widget)
     #plot
     plot_row_widget = QWidget(central_widget)
     self.janus.widgets["plotlayout"] = QVBoxLayout(plot_row_widget)
     self.janus.widgets["plot"] = Plot(central_widget)
     self.janus.widgets["plot"].widget.setSizePolicy(QSizePolicy(
             QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding))
     self.janus.widgets["plot"].widget.setLabels(left="events [arbitrary unit]", bottom="energy [eV]")
     self.janus.widgets["plot"].add_line_item(1, pos=6930.3, label="Co Kα1")
     self.janus.widgets["plotlayout"].addWidget(self.janus.widgets["plot"].widget, 3)
     self.janus.widgets["elementtable"] = AcqXrfElementsTable(plot_row_widget)
     self.janus.widgets["plotlayout"].addWidget(self.janus.widgets["elementtable"].widget, 1)
     self.janus.widgets["mainwindowlayout"].addWidget(plot_row_widget, 3)
     #acquisition methods
     methods_row_widget = QWidget(central_widget)
     self.janus.widgets["methodrowlayout"] = QVBoxLayout(methods_row_widget)
     self.janus.widgets["acqmethods"] = QToolBox(central_widget)
     self.janus.widgets["acqxrf"] = AcqXrfParameters(self.janus.widgets["acqmethods"])
     self.janus.widgets["acqmethods"].addItem(self.janus.widgets["acqxrf"].widget, "XRF Spectrum")
     self.janus.widgets["acqxanes"] = AcqXanesParameters(self.janus.widgets["acqmethods"])
     self.janus.widgets["acqmethods"].addItem(self.janus.widgets["acqxanes"].widget, "XANES Scan")
     self.janus.widgets["acqrun"] = AcqRunParameters(central_widget)
     self.janus.widgets["methodrowlayout"].addWidget(self.janus.widgets["acqmethods"], 3)
     self.janus.widgets["methodrowlayout"].addWidget(self.janus.widgets["acqrun"].widget, 1)
     self.janus.widgets["mainwindowlayout"].addWidget(methods_row_widget, 1)
     self.janus.widgets["acqprogressdialog"] = AcqProgressDialog(self.janus.widgets["mainwindow"])
Ejemplo n.º 3
0
    def __init__(self, parent, model, result):
        QWidget.__init__(self, parent)
        self.setLayout(QVBoxLayout())

        scrollArea = QScrollArea(self)
        self.layout().addWidget(scrollArea)
        scrollArea.setWidgetResizable(True)

        viewport = QToolBox()
        scrollArea.setWidget(viewport)

        self.computationTimeGroup = ComputationTimeTable(result)
        self.preemptionsGroup = InformationTable(result, 'preemption_count',
                                                 ['min', 'avg', 'max', 'sum'])
        self.migrationsGroup = InformationTable(result, 'migration_count',
                                                ['min', 'avg', 'max', 'sum'])
        self.taskMigrationsGroup = TaskMigrationTable(result)
        self.responseTimeGroup = InformationTable(
            result,
            'response_time', ['min', 'avg', 'max', 'std dev'],
            map_=lambda x: x / float(model.cycles_per_ms))

        viewport.addItem(self.computationTimeGroup, "Computation time:")
        viewport.addItem(self.preemptionsGroup, "Preemptions:")
        viewport.addItem(self.migrationsGroup, "Migrations:")
        viewport.addItem(self.taskMigrationsGroup, "Task migrations:")
        viewport.addItem(self.responseTimeGroup, "Response time:")
Ejemplo n.º 4
0
    def init_window(self):

        self.setWindowIcon(QtGui.QIcon(self.iconName))
        self.setWindowTitle(self.title)
        self.setGeometry(self.left, self.top, self.width, self.height)

        self.setStyleSheet("background-color:orange")

        vbox = QVBoxLayout()

        toolbox = QToolBox()
        toolbox.setStyleSheet("background-color:grey")
        vbox.addWidget(toolbox)

        label = QLabel()
        toolbox.addItem(label, "Python")

        label1 = QLabel()
        toolbox.addItem(label1, "Java")

        label2 = QLabel()
        toolbox.addItem(label2, "C++")

        self.setLayout(vbox)

        self.show()
Ejemplo n.º 5
0
    def __init__(self):
        self.__widget = QWidget()
        self.__grid = QGridLayout()
        self.__widget.setLayout(self.__grid)

        self.__label = QLabel(self.__widget)
        self.__label.setText('Enter country name: ')
        self.__grid.addWidget(self.__label, 0, 0)

        self.__entry = QLineEdit(self.__widget)
        self.__entry.setPlaceholderText('Type country...')
        self.__grid.addWidget(self.__entry, 0, 1)

        self.__button = QPushButton(self.__widget)
        self.__button.setText('Search')
        self.__button.clicked.connect(self.__make_request)
        self.__grid.addWidget(self.__button, 0, 2)

        self.__toolbox = QToolBox()
        self.__grid.addWidget(self.__toolbox)

        self.__data_label = QLabel()
        self.__toolbox.addItem(self.__data_label, 'Data:')

        self.__widget.setWindowTitle('Covid App')
        self.__widget.show()
Ejemplo n.º 6
0
    def __init__(self):

        QWidget.__init__(self)

        # Add a toolbox to the sidebar:
        self.toolbox = QToolBox()

        # Each tab of the toolbox contains a widget:
        self.hdfViewerTab = kstHDFViewer()

        # Configure the alignment tab:
        self.preprocessingTab = kstPreprocessingPanel()

        # Configure the refocusing tab:
        self.reconstructionTab = kstReconstructionPanel()

        # Configure the whole widget:
        self.toolbox.addItem(self.hdfViewerTab, KST_SIDEBAR_HDFVIEW)
        self.toolbox.addItem(self.preprocessingTab, KST_SIDEBAR_PREPROC)
        self.toolbox.addItem(self.reconstructionTab, KST_SIDEBAR_RECON)

        # Define layout:
        layout = QVBoxLayout()
        layout.addWidget(self.toolbox)
        layout.setContentsMargins(10, 10, 2, 10)  #left,top,right,bottom
        self.setLayout(layout)
Ejemplo n.º 7
0
    def createToolBox(self):
        self.buttonGroup = QButtonGroup()
        self.buttonGroup.setExclusive(False)
        self.buttonGroup.buttonClicked[int].connect(self.buttonGroupClicked)

        layout = QGridLayout()
        layout.addWidget(self.createCellWidget("Diamond", ITGItem.Diamond), 0,
                         0)
        layout.addWidget(self.createCellWidget("Square", ITGItem.Square), 0, 1)
        layout.addWidget(
            self.createCellWidget("Parallelogram", ITGItem.Parallelogram), 1,
            0)

        layout.setRowStretch(3, 10)
        layout.setColumnStretch(2, 10)

        itemWidget = QWidget()
        itemWidget.setLayout(layout)

        self.backgroundButtonGroup = QButtonGroup()

        self.toolBox = QToolBox()
        self.toolBox.setSizePolicy(
            QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Ignored))
        self.toolBox.setMinimumWidth(itemWidget.sizeHint().width())
        self.toolBox.addItem(itemWidget, "Basic Components")
Ejemplo n.º 8
0
    def create_framework_toolbox(self):
        framework_layers = frameworks_utils.get_framework_layers(
            self.get_selected_framework())

        self.framework_layers_button_group = QButtonGroup()
        self.framework_layers_button_group.setExclusive(False)
        self.framework_layers_button_group.buttonClicked[int].connect(
            self.framework_layers_button_group_clicked)

        layout = QGridLayout()
        for framework_layer in framework_layers:
            layout.addWidget(
                self.create_framework_layer_widget(framework_layer()))

        layout.setRowStretch(3, 10)
        layout.setColumnStretch(2, 10)

        item_widget = QWidget()
        item_widget.setLayout(layout)

        self.framework_toolbox = QToolBox()
        self.framework_toolbox.setSizePolicy(
            QSizePolicy(
                QSizePolicy.Maximum,
                QSizePolicy.Ignored,
            ), )
        self.framework_toolbox.setMinimumWidth(item_widget.sizeHint().width())
        self.framework_toolbox.addItem(item_widget,
                                       main_window_constants.LAYERS)
Ejemplo n.º 9
0
    def __init__(self, *args, **kwargs):
        super(ToolBox, self).__init__(*args, **kwargs)

        # self.setStyleSheet('background-color:yellow')
        layout = QVBoxLayout()
        toolbox = QToolBox()

        toolbox.setItemToolTip(0, 'This is a tooltip')

        layout.addWidget(toolbox)

        label1 = QLabel()
        toolbox.addItem(label1, 'One')

        label2 = QLabel()
        toolbox.addItem(label2, 'Two')

        label3 = QLabel()
        toolbox.addItem(label3, 'Three')

        label4 = QLabel()
        toolbox.addItem(label4, 'Four')

        label5 = QLabel()
        toolbox.addItem(label5, 'Five')

        label6 = QLabel()
        toolbox.addItem(label6, 'Six')

        self.setLayout(layout)
Ejemplo n.º 10
0
    def createToolBox(self):
        self.buttonGroup = QButtonGroup()
        self.buttonGroup.setExclusive(False)
        self.buttonGroup.buttonClicked[int].connect(self.buttonGroupClicked)

        layout = QGridLayout()
        layout.addWidget(self.createCellWidget("Conditional", DiagramItem.Conditional),
                0, 0)
        layout.addWidget(self.createCellWidget("Process", DiagramItem.Step), 0,
                1)
        layout.addWidget(self.createCellWidget("Input/Output", DiagramItem.Io),
                1, 0)

        textButton = QToolButton()
        textButton.setCheckable(True)
        self.buttonGroup.addButton(textButton, self.InsertTextButton)
        textButton.setIcon(QIcon(QPixmap(':/images/textpointer.png').scaled(30, 30)))
        textButton.setIconSize(QSize(50, 50))

        textLayout = QGridLayout()
        textLayout.addWidget(textButton, 0, 0, Qt.AlignHCenter)
        textLayout.addWidget(QLabel("Text"), 1, 0, Qt.AlignCenter)
        textWidget = QWidget()
        textWidget.setLayout(textLayout)
        layout.addWidget(textWidget, 1, 1)

        layout.setRowStretch(3, 10)
        layout.setColumnStretch(2, 10)

        itemWidget = QWidget()
        itemWidget.setLayout(layout)

        self.backgroundButtonGroup = QButtonGroup()
        self.backgroundButtonGroup.buttonClicked.connect(self.backgroundButtonGroupClicked)

        backgroundLayout = QGridLayout()
        backgroundLayout.addWidget(self.createBackgroundCellWidget("Blue Grid",
                ':/images/background1.png'), 0, 0)
        backgroundLayout.addWidget(self.createBackgroundCellWidget("White Grid",
                ':/images/background2.png'), 0, 1)
        backgroundLayout.addWidget(self.createBackgroundCellWidget("Gray Grid",
                ':/images/background3.png'), 1, 0)
        backgroundLayout.addWidget(self.createBackgroundCellWidget("No Grid",
                ':/images/background4.png'), 1, 1)

        backgroundLayout.setRowStretch(2, 10)
        backgroundLayout.setColumnStretch(2, 10)

        backgroundWidget = QWidget()
        backgroundWidget.setLayout(backgroundLayout)

        self.toolBox = QToolBox()
        self.toolBox.setSizePolicy(QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Ignored))
        self.toolBox.setMinimumWidth(itemWidget.sizeHint().width())
        self.toolBox.addItem(itemWidget, "Basic Flowchart Shapes")
        self.toolBox.addItem(backgroundWidget, "Backgrounds")
Ejemplo n.º 11
0
    def createLeft(self):
        leftBox = QToolBox()
        leftSys = self.createLeftSys()
        leftBind = self.createLeftBind()
        leftBox.setSizePolicy(
            QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum))
        leftBox.addItem(leftSys, "系统信息")
        leftBox.addItem(leftBind, "BIND调整")

        return leftBox
Ejemplo n.º 12
0
    def __init__(self):
        super().__init__()
        signal.signal(signal.SIGINT, self.exit)
        # WIDGET
        self._widget = QWidget(self)
        self.setCentralWidget(self._widget)
        self.resize(900, 900)
        self._widget.event = types.MethodType(self._handle_event, self._widget)
        self._widget.setAttribute(Qt.WA_AcceptTouchEvents
                                  | Qt.WA_TranslucentBackground)
        self._widget.setWindowFlags(Qt.NoDropShadowWindowHint)
        # VTK
        self._vtk_widget = QVTKRenderWindowInteractor(self._widget)
        self._vtk_widget.resize(900, 900)
        self._ren_win = self._vtk_widget.GetRenderWindow()
        self._interactor = self._ren_win.GetInteractor()
        self._vtk_widget.SetInteractorStyle(InteractorStyle())
        # # TEST_WIDGET
        self._test_widget = QWidget(self)
        self._test_widget.resize(300, 300)
        self._test_widget.setStyleSheet(
            'QWidget {background: rgb(60, 60, 60)}')
        # TEST_BTN
        self._button = QPushButton(self._test_widget)
        self._button.setText('test')
        self._button.setStyleSheet(
            'QPushButton {background: rgb(255, 255, 255)}')
        self._button.pressed.connect(self._pressed)
        self._button.released.connect(self._released)
        self._button.resize(100, 30)
        self._button.move(100, 200)
        self._test_widget1 = QToolBox(self._test_widget)
        self._test_widget1.resize(100, 100)
        self._test_widget1.show()
        self._button.show()
        self._test_widget.show()

        # RENDER
        self._renderer = vtk.vtkOpenGLRenderer()
        self._renderer.SetBackground((0, 0, 0))
        self._renderer.AddActor(self._axis_actor())
        for actor in self._stl_actor().values():
            self._renderer.AddActor(actor)
        self._camera = self._renderer.GetActiveCamera()
        self._ren_win.AddRenderer(self._renderer)
        self._ren_win.Render()
        # CAMERA
        self._camera = self._renderer.GetActiveCamera()
        self._camera.SetPosition(13, 0, 0)
        self._vtk_widget.Start()
        # TIMER
        self._timer = QTimer()
        self._timer.setInterval(int(1000 / 60))
        self._timer.timeout.connect(self._render_once)
        self._timer.start()
Ejemplo n.º 13
0
    def __init__(self, parent=None):
        super().__init__(parent)

        self.layer_nodes = QToolBox(self)
        self.common_nodes = QToolBox(self)
        self.units_nodes = QToolBox(self)
        # custom pin tab
        self.pin_nodes = QToolBox(self)

        self.set_toolbox()
        self.set_pin_box()
        self.addTab(self.pin_nodes, "Pins")
        self.addTab(self.layer_nodes, "Layers")
        self.addTab(self.common_nodes, "Common")
        self.addTab(self.units_nodes, "Units")

        self.setTabIcon(0, QIcon(icon['PIN_TAB']))
        self.setCurrentWidget(self.layer_nodes)
        self.setMinimumWidth(290)
        self.setMaximumWidth(500)
    def initUI(self):
        vbox = QVBoxLayout()

        toolbox = QToolBox()
        toolbox.setStyleSheet('background-color:green')
        toolbox.addItem(QLabel(), "Python")
        toolbox.addItem(QLabel(), "Java")
        toolbox.addItem(QLabel(), "C++")

        vbox.addWidget(toolbox)

        self.setLayout(vbox)
Ejemplo n.º 15
0
 def makeControlWindow(self):
     tb = QToolBox()
     tb.addItem(self.makeIpContainer(), "Connection and Run-State")
     tb.addItem(self.makeDisplayedParameterControl(),
                "Displayed Parameters")
     tb.addItem(self.makeSweepControl(), "Sweep Parameters")
     tb.addItem(self.makeCallButtonCtrl(), "Calibration")
     tb.setMinimumWidth(220)
     tb.setMaximumWidth(220)
     layout = QVBoxLayout()
     layout.addWidget(tb)
     layout.addStretch(1)
     return layout
Ejemplo n.º 16
0
    def __init__(self, gWindow, hashRef, maxItems=16, parent=None):
        super(IPFSHashExplorerToolBox, self).__init__(gWindow)

        self.rootHash = hashRef
        self.maxItems = maxItems

        self.toolbox = QToolBox()
        self.exLayout = QVBoxLayout()
        self.exLayout.addWidget(self.toolbox)

        self.vLayout.addLayout(self.exLayout)
        if self.rootHash:
            self.viewHash(self.rootHash)
Ejemplo n.º 17
0
    def __init__(self, dockwidget):
        super(QuickInsert, self).__init__(dockwidget)
        self._dockwidget = weakref.ref(dockwidget)
        # filled in by ButtonGroup subclasses
        self.actionDict = {}

        layout = QVBoxLayout()
        self.setLayout(layout)
        layout.setContentsMargins(0, 0, 0, 0)

        self.helpButton = QToolButton(
            icon=icons.get("help-contents"),
            autoRaise=True,
            clicked=lambda: userguide.show("quickinsert"))
        self.directionLabel = QLabel()
        self.direction = QComboBox()
        self.direction.addItems(['', '', ''])
        self.direction.setItemIcon(0, icons.get("go-up"))
        self.direction.setItemIcon(2, icons.get("go-down"))
        self.direction.setCurrentIndex(1)
        hor = QHBoxLayout()
        hor.setContentsMargins(0, 0, 0, 0)
        hor.addWidget(self.helpButton)
        hor.addWidget(self.directionLabel)
        hor.addWidget(self.direction)
        layout.addLayout(hor)

        self.toolbox = QToolBox(self)
        gadgets.toolboxwheeler.ToolBoxWheeler(self.toolbox)
        layout.addWidget(self.toolbox)

        for cls in (
                articulations.Articulations,
                dynamics.Dynamics,
                spanners.Spanners,
                barlines.BarLines,
        ):
            widget = cls(self)
            self.toolbox.addItem(widget, widget.icon(), '')

        app.translateUI(self)
        userguide.openWhatsThis(self)

        # restore remembered current page
        name = QSettings().value("quickinsert/current_tool", "", str)
        if name:
            for i in range(self.toolbox.count()):
                if name == self.toolbox.widget(i).__class__.__name__.lower():
                    self.toolbox.setCurrentIndex(i)
                    break
        self.toolbox.currentChanged.connect(self.slotCurrentChanged)
Ejemplo n.º 18
0
    def __init__(self, parent=None):
        super(Window, self).__init__(parent)

        # tool box
        tool_box = QToolBox()

        # items
        tool_box.addItem(QPlainTextEdit('Text 1'), 'Page 1')
        tool_box.addItem(QPlainTextEdit('Text 2'), 'Page 2')

        # vertical box layout
        vlayout = QVBoxLayout()
        vlayout.addWidget(tool_box)
        self.setLayout(vlayout)
Ejemplo n.º 19
0
    def init_ui(self):
        vbox = QVBoxLayout()
        toolbox = QToolBox()
        toolbox.setStyleSheet("background-color:green")
        vbox.addWidget(toolbox)

        label = QLabel()
        toolbox.addItem(label, "Python")

        label = QLabel()
        toolbox.addItem(label, "Java")

        label = QLabel()
        toolbox.addItem(label, "C++")

        self.setLayout(vbox)
Ejemplo n.º 20
0
 def InitWindow(self):
     self.setWindowIcon(QtGui.QIcon("icon.png"))
     self.setWindowTitle(self.title)
     self.setGeometry(self.left, self.top, self.width, self.height)
     self.setStyleSheet("background-color:yellow")
     vbox = QVBoxLayout()
     toolbox = QToolBox()
     vbox.addWidget(toolbox)
     label = QLabel()
     toolbox.addItem(label, "Python")
     toolbox.setFont(QtGui.QFont("Sanserif", 15))
     label = QLabel()
     toolbox.addItem(label, "Java")
     label = QLabel()
     toolbox.addItem(label, "C++")
     self.setLayout(vbox)
     self.show()
Ejemplo n.º 21
0
    def __initUI(self):
        vlayout = QVBoxLayout(self)
        self.__toolBox_ = QToolBox()
        vlayout.addWidget(self.__toolBox_)

        #  设置左侧导航栏 toolBox 初始化时的宽度
        self.__toolBox_.setStyleSheet("QToolBoxButton { min-width:180px}")
        # 设置左侧导航栏 toolBox 在左右拉拽时的最小宽度
        self.__toolBox_.setMinimumWidth(100)
        # 设置软件启动时默认打开导航栏的第几个 Item;这里设置的是打开第1个 Item。
        self.__toolBox_.setCurrentIndex(0)
        # self.__toolBox_.setFrameShape(QToolBox.Shape.StyledPanel) # 为toolbox增加边框
        # self.__toolBox_.set

        self.setFileInfoText(info)
        self.setTlvSdpText(sdp)
        self.setTlvCodecText('')
Ejemplo n.º 22
0
    def InitUI(self):
        vbox = QVBoxLayout()

        toolbox = QToolBox()
        # toolbox.setStyleSheet('background-color:white')
        vbox.addWidget(toolbox)

        label = QLabel()
        toolbox.addItem(label, "Python")

        label = QLabel()
        toolbox.addItem(label, "Java")

        label = QLabel()
        toolbox.addItem(label, "C++")

        self.setLayout(vbox)
Ejemplo n.º 23
0
    def __init__(self):
        super(MainForm, self).__init__()

        # 主窗口初始化时实现主窗口布局
        self.setupUi(self)

        toolBox = QToolBox()

        #  设置左侧导航栏 toolBox 初始化时的宽度
        toolBox.setStyleSheet("QToolBoxButton { min-width:210px}")

        # 设置左侧导航栏 toolBox 在左右拉拽时的最小宽度
        toolBox.setMinimumWidth(100)

        toolBox.addItem(QPushButton("Tab Content 1"), "Tab &1")
        toolBox.addItem(QLabel("Tab Content 2"), "生产动态分析测试与建模")
        toolBox.addItem(QPlainTextEdit('Text 3'), QIcon('snapshot.png'), "设置")
        toolBox.setCurrentIndex(0)  # 设置软件启动时默认打开导航栏的第几个 Item;这里设置的是打开第1个 Item。
        self.verticalLayout.addWidget(toolBox)

        # #  下面两行为设置 QSplitter 分割器伸缩大小因子,但是这样设置全屏后导航栏放大了不好看
        # self.splitter.setStretchFactor(0, 30)  # 分割器左边第1个占比例30%
        # self.splitter.setStretchFactor(1, 70)  # 分割器左边第1个占比例70%

        #  下面一行为设置 QSplitter 分割器伸缩大小因子,但是这样设置全屏后导航栏放大了比较好看;不清楚原因。
        self.splitter.setStretchFactor(
            0, 0
        )  # 此函数用于设定:控件是否可伸缩。第一个参数用于指定控件的序号。第二个函数大于0时,表示控件可伸缩,小于0时,表示控件不可伸缩。
        self.splitter.setStretchFactor(
            1, 1
        )  # 此函数用于设定:控件是否可伸缩。第一个参数用于指定控件的序号。第二个函数大于0时,表示控件可伸缩,小于0时,表示控件不可伸缩。

        #  设置 QSplitter 分割器各部分最小化时的情况,设置为“False”意味着左右拉动分隔栏时各部分不会消失;此设置也可以在界面设计时在 QtDesigner 里设置。
        self.splitter.setChildrenCollapsible(False)

        #  设置 QSplitter 分割器随主窗口自适应大小变化。此设置也可以在界面设计时在 QtDesigner 里设置。
        self.splitter.setAutoFillBackground(True)

        # 主窗口初始化时实例化子窗口
        self.child = ChildrenForm()

        # 在主窗口的QSplitter里添加子窗口
        self.splitter.addWidget(self.child)
Ejemplo n.º 24
0
    def __init__(self, parent=None, allow_close=False):
        super().__init__(parent)
        self.setupUi(self)

        if parent:
            self.setModal(True)

        if allow_close:
            self.accept_button.hide()
            self.decline_button.hide()
        else:
            self.close_button.hide()

        self.licenses = QToolBox()
        self.lic_layout.addWidget(self.licenses)

        self.__allow_close = allow_close
        self.__accepted = False

        self._init_licenses()
Ejemplo n.º 25
0
def gui_configuration(subwindow,parent):
    
    frame = QFrame()
    layout = QVBoxLayout()
    pushButton1 = QPushButton('Sistemas Lineares')
    

    toolbox = QToolBox()
    label = QLabel('Sistemas de primeira ordem')
    label2= QLabel('Sistemas de segunda ordem')
    toolbox.addItem(label,'Sistemas 1 ordem')
    toolbox.addItem(label2,'Sistemas 2 ordem')
    

    layout.addWidget(pushButton1)
    
    layout.addWidget(toolbox)
    frame.setLayout(layout)
    subwindow.setWidget(frame)
    return subwindow
Ejemplo n.º 26
0
    def InitWindow(self):
        self.setWindowIcon(QtGui.QIcon(self.IconName))
        self.setWindowTitle(self.title)
        self.setGeometry(self.left, self.top, self.width, self.height)
        #self.setStyleSheet('background-color:green')

        vbox = QVBoxLayout()
        toolbox = QToolBox()
        toolbox.setStyleSheet('background-color:green')
        self.label = QLabel()
        self.label2 = QLabel()
        self.label3 = QLabel()

        toolbox.addItem(self.label, "Python")
        toolbox.addItem(self.label2, "Java")
        toolbox.addItem(self.label3, "C++")
        vbox.addWidget(toolbox)

        self.setLayout(vbox)
        self.show()
Ejemplo n.º 27
0
    def _create_image_processes_boxes(self):
        tool_box = QToolBox()
        for page in TYPES:
            qwidget = QWidget()
            vbox = QVBoxLayout()
            for image_process in self.model.transformations + self.model.splits:
                if image_process.process_type == page:
                    vbox.addWidget(image_process.gui(self.image_widget))

            vbox.addStretch()
            apply_button = QPushButton("Apply")
            apply_button.setToolTip("Apply changes and redraw image")
            apply_button.clicked.connect(self._apply_clicked_handler)
            hbox = QHBoxLayout()
            hbox.addStretch()
            hbox.addWidget(apply_button)
            vbox.addLayout(hbox)
            qwidget.setLayout(vbox)

            tool_box.addItem(qwidget, page[1])
        return tool_box
Ejemplo n.º 28
0
    def initUi(self):

        layout = QGridLayout()

        tool_box = QToolBox()

        linux_button = QPushButton('Linux')
        tool_box.addItem(linux_button, 'Linux')

        windows_button = QPushButton('Windows')
        tool_box.addItem(windows_button, 'Windows')

        mac_button = QPushButton('Mac')
        tool_box.addItem(mac_button, 'Mac')

        android_button = QPushButton('Android')
        tool_box.addItem(android_button, 'Android')

        layout.addWidget(tool_box, 0, 0)

        self.setLayout(layout)
Ejemplo n.º 29
0
    def add_containers(self, layout):
        
        toolbox = QToolBox()
        toolbox.setMinimumHeight(200)        
        
        linux_button = QPushButton('Linux')
        windows_button = QPushButton('Windows')       
        toolbox.addItem(linux_button, 'Linux')        
        mac_button = QPushButton('Mac')
        
        toolbox.addItem(windows_button, 'Windows')
        toolbox.addItem(mac_button, 'Mac')
        toolbox.setMinimumHeight(200)        
        
        
        tab_widget = QTabWidget()
        tab_widget.insertTab(
                0, QLabel('Linux'), 'Linux')
        tab_widget.insertTab(
                1, QLabel('Windows'), 'Windows')
        tab_widget.insertTab(
                2, QLabel('Mac'), 'Mac')
        tab_widget.setMinimumHeight(200)
        
        plain_text_edit = QPlainTextEdit()
        plain_text_edit.setWordWrapMode(
                QTextOption.NoWrap)

        scroll_area = QScrollArea()
        scroll_area.setWidget(plain_text_edit)
        scroll_area.setWidgetResizable(True)
        scroll_area.setMinimumHeight(200)        

        
        layout.addWidget(toolbox, 0, 1)
        layout.addWidget(tab_widget, 1, 1)
        layout.addWidget(scroll_area, 2, 1)
        
        scroll_area = QScrollArea()
Ejemplo n.º 30
0
    def initUI(self):
        self.layout = QVBoxLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)

        self.requestAreaWidget = QToolBox()
        self.requestAreaWidget.layout().setSpacing(1)

        self.requestTabs = QTabWidget()
        self.requestTabs.setUsesScrollButtons(True)
        self.requestTabs.currentChanged.connect(self.__updateTabSizes__)
        self.requestAreaWidget.addItem(self.requestTabs, "Requests")

        self.requestOps = RequestsOperations(self)
        self.requestAreaWidget.addItem(self.requestOps, "Operations")

        self.generalConfig = GlobalOverpassSettingUI(self)
        self.requestAreaWidget.addItem(self.generalConfig, "General")

        self.disambiguationWidget = DisambiguationWidget(
            self.__getRequestByName__, self.__applyTableRow__, self)
        self.requestAreaWidget.addItem(self.disambiguationWidget,
                                       "Disambiguation")

        self.headers = self.requestAreaWidget.findChildren(
            QAbstractButton, "qt_toolbox_toolboxbutton")
        self.requestAreaWidget.currentChanged.connect(
            self.__onToolTabChanged__)
        self.headers[0].setIcon(QIcon(os.path.join(picturesDir,
                                                   "arrowUp.png")))
        for i in range(1, len(self.headers)):
            self.headers[i].setIcon(
                QIcon(os.path.join(picturesDir, "arrowDown.png")))

        self.layout.addWidget(self.requestAreaWidget)

        self.setLayout(self.layout)