Python PyQt5.QtWidgets.QGridLayout() Examples

The following are 30 code examples for showing how to use PyQt5.QtWidgets.QGridLayout(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .

Example 1
Project: ANGRYsearch   Author: DoTheEvo   File: angrysearch.py    License: GNU General Public License v2.0 7 votes vote down vote up
def __init__(self, setting_params=None):
        super().__init__()
        self.setting_params = setting_params
        self.search_input = Qw.QLineEdit()
        self.table = AngryTableView(self.setting_params['angrysearch_lite'],
                                    self.setting_params['row_height'])
        self.upd_button = Qw.QPushButton('update')
        self.fts_checkbox = Qw.QCheckBox()

        grid = Qw.QGridLayout()
        grid.setSpacing(10)

        grid.addWidget(self.search_input, 1, 1)
        grid.addWidget(self.fts_checkbox, 1, 3)
        grid.addWidget(self.upd_button, 1, 4)
        grid.addWidget(self.table, 2, 1, 4, 4)
        self.setLayout(grid)

        self.setTabOrder(self.search_input, self.table)
        self.setTabOrder(self.table, self.upd_button)


# THE MAIN APPLICATION WINDOW WITH THE STATUS BAR AND LOGIC
# LOADS AND SAVES QSETTINGS FROM ~/.config/angrysearch
# INITIALIZES AND SETS GUI, WAITING FOR USER INPUTS 
Example 2
Project: dcc   Author: amimo   File: xrefwindow.py    License: Apache License 2.0 6 votes vote down vote up
def __init__(self, parent=None, win=None, xrefs_list=None, method="", path=""):
        super(XrefDialog, self).__init__(parent)

        if not isinstance(xrefs_list, list) or len(xrefs_list) == 0:
            log.warning("Bad XrefDialog creation")
            return

        if not method:
            title = "Xrefs to %s" % path.split("/")[-1]
        else:
            title = "Xrefs to %s -> %s" % (path.split("/")[-1], method)

        self.setWindowTitle(title)
        layout = QtWidgets.QGridLayout()
        xrefwin = XrefListView(self, win=win, xrefs=xrefs_list)
        layout.addWidget(xrefwin, 0, 0)
        self.setLayout(layout) 
Example 3
Project: easygui_qt   Author: aroberge   File: calendar_widget.py    License: BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def __init__(self, title="Calendar"):
        super(CalendarWidget, self).__init__()

        self.setWindowTitle(title)
        layout = qt_widgets.QGridLayout()
        layout.setColumnStretch(1, 1)

        self.cal = qt_widgets.QCalendarWidget(self)
        self.cal.setGridVisible(True)
        self.cal.clicked[QtCore.QDate].connect(self.show_date)
        layout.addWidget(self.cal, 0, 0, 1, 2)

        self.date_label = qt_widgets.QLabel()
        self.date = self.cal.selectedDate()
        self.date_label.setText(self.date.toString())
        layout.addWidget(self.date_label, 1, 0)

        button_box = qt_widgets.QDialogButtonBox()
        confirm_button = button_box.addButton(qt_widgets.QDialogButtonBox.Ok)
        confirm_button.clicked.connect(self.confirm)
        layout.addWidget(button_box, 1, 1)

        self.setLayout(layout)
        self.show()
        self.raise_() 
Example 4
Project: qhangups   Author: xmikos   File: ui_qhangupsconversations.py    License: GNU General Public License v3.0 6 votes vote down vote up
def setupUi(self, QHangupsConversations):
        QHangupsConversations.setObjectName("QHangupsConversations")
        QHangupsConversations.resize(500, 350)
        self.centralwidget = QtWidgets.QWidget(QHangupsConversations)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.conversationsTabWidget = QtWidgets.QTabWidget(self.centralwidget)
        self.conversationsTabWidget.setElideMode(QtCore.Qt.ElideRight)
        self.conversationsTabWidget.setTabsClosable(True)
        self.conversationsTabWidget.setMovable(True)
        self.conversationsTabWidget.setObjectName("conversationsTabWidget")
        self.gridLayout.addWidget(self.conversationsTabWidget, 0, 0, 1, 1)
        QHangupsConversations.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(QHangupsConversations)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 500, 27))
        self.menubar.setObjectName("menubar")
        QHangupsConversations.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(QHangupsConversations)
        self.statusbar.setObjectName("statusbar")
        QHangupsConversations.setStatusBar(self.statusbar)

        self.retranslateUi(QHangupsConversations)
        self.conversationsTabWidget.setCurrentIndex(-1)
        QtCore.QMetaObject.connectSlotsByName(QHangupsConversations) 
Example 5
Project: minesweeper   Author: duguyue100   File: gui.py    License: MIT License 6 votes vote down vote up
def create_grid(self, grid_width, grid_height):
        """Create a grid layout with stacked widgets.

        Parameters
        ----------
        grid_width : int
            the width of the grid
        grid_height : int
            the height of the grid
        """
        self.grid_layout = QGridLayout()
        self.setLayout(self.grid_layout)
        self.grid_layout.setSpacing(1)
        self.grid_wgs = {}
        for i in xrange(grid_height):
            for j in xrange(grid_width):
                self.grid_wgs[(i, j)] = FieldWidget()
                self.grid_layout.addWidget(self.grid_wgs[(i, j)], i, j) 
Example 6
Project: DevilYuan   Author: moyuanz   File: DySingleEditDlg.py    License: MIT License 6 votes vote down vote up
def _initUi(self, title, label, default):
        self.setWindowTitle(title)
 
        # 控件
        label_ = QLabel(label)
        self._lineEdit = QLineEdit(str(self._data['data']) if self._data else str(default) )

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(label_, 0, 0, 1, 2)
        grid.addWidget(self._lineEdit, 0, 2, 1, 2)

        grid.addWidget(okPushButton, 1, 2, 1, 2)
        grid.addWidget(cancelPushButton, 1, 0, 1, 2)
 
 
        self.setLayout(grid) 
Example 7
Project: DevilYuan   Author: moyuanz   File: DyProcessNbrDlg.py    License: MIT License 6 votes vote down vote up
def _initUi(self):
        self.setWindowTitle('进程数')
 
        # 控件
        processNbrLable = QLabel('进程数')
        self._processNbrLineEdit = QLineEdit(str(self._data['nbr']) if self._data else '0' )

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(processNbrLable, 0, 0)
        grid.addWidget(self._processNbrLineEdit, 1, 0, 1, 2)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
 
        self.setLayout(grid) 
Example 8
Project: DevilYuan   Author: moyuanz   File: DyStockInfoDlg.py    License: MIT License 6 votes vote down vote up
def _initUi(self):
        self.setWindowTitle('个股资料(F10)')
 
        # 控件
        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        self._stockInfoWidget = DyTreeWidget(self.fields)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(self._stockInfoWidget, 0, 0, 20, 10)
 
        grid.addWidget(okPushButton, 0, 10)
        grid.addWidget(cancelPushButton, 1, 10)
 
        self.setLayout(grid)
        self.resize(QApplication.desktop().size().width()//3, QApplication.desktop().size().height()//2) 
Example 9
Project: DevilYuan   Author: moyuanz   File: DyStockSelectDayKChartPeriodDlg.py    License: MIT License 6 votes vote down vote up
def _initUi(self):
        self.setWindowTitle('日K线前后交易日周期')
 
        # 控件
        dayKChartPeriodLable = QLabel('股票(指数)日K线前后交易日周期')
        self._dayKChartPeriodLineEdit = QLineEdit(str(self._data['periodNbr']) if self._data else '60' )

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(dayKChartPeriodLable, 0, 0, 1, 2)
        grid.addWidget(self._dayKChartPeriodLineEdit, 1, 0, 1, 2)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
 
        self.setLayout(grid) 
Example 10
Project: DevilYuan   Author: moyuanz   File: DyStockSelectStockInfoDlg.py    License: MIT License 6 votes vote down vote up
def _initUi(self):
        self.setWindowTitle('个股资料(F10)')
 
        # 控件
        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        self._stockInfoWidget = DyTreeWidget(self.fields)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(self._stockInfoWidget, 0, 0, 20, 10)
 
        grid.addWidget(okPushButton, 0, 10)
        grid.addWidget(cancelPushButton, 1, 10)
 
        self.setLayout(grid)
        self.resize(QApplication.desktop().size().width()//3, QApplication.desktop().size().height()//2) 
Example 11
Project: DevilYuan   Author: moyuanz   File: DyStockDataHistDaysManualUpdateDlg.py    License: MIT License 6 votes vote down vote up
def _createIndicatorGroupBox(self):
        indicatorGroupBox = QGroupBox('指标')

        grid = QGridLayout()
        grid.setSpacing(10)

        rowNbr = 4
        self._indicatorCheckBoxList = []
        for i, indicator in enumerate(DyStockDataCommon.dayIndicators):
            checkBox = QCheckBox(indicator)
            checkBox.setChecked(True)

            grid.addWidget(checkBox, i//rowNbr, i%rowNbr)

            self._indicatorCheckBoxList.append(checkBox)

        indicatorGroupBox.setLayout(grid)

        return indicatorGroupBox 
Example 12
Project: DevilYuan   Author: moyuanz   File: DyStockMongoDbConfigDlg.py    License: MIT License 6 votes vote down vote up
def _createConnectionTab(self, tabWidget):
        widget = QWidget()

        labelHost = QLabel('主机')
        labelPort = QLabel('端口')

        self._lineEditHost = QLineEdit(self._data['Connection']["Host"])
        self._lineEditPort = QLineEdit(str(self._data['Connection']["Port"]))

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(labelHost, 0, 0)
        grid.addWidget(self._lineEditHost, 0, 1)

        grid.addWidget(labelPort, 0, 2)
        grid.addWidget(self._lineEditPort, 0, 3)
 
        widget.setLayout(grid)

        tabWidget.addTab(widget, "连接") 
Example 13
Project: DevilYuan   Author: moyuanz   File: DyStockAccountConfigDlg.py    License: MIT License 6 votes vote down vote up
def _initUi(self):
        self.setWindowTitle('配置-账号(实盘交易)')

        self._tabWidget = QTabWidget()
        self._createYhTab()
        self._createThsTab()
        
        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(self._tabWidget, 0, 0, 2, 1)

        grid.addWidget(okPushButton, 0, 1)
        grid.addWidget(cancelPushButton, 1, 1)
 
        self.setLayout(grid) 
Example 14
Project: multibootusb   Author: mbusb   File: ui_about.py    License: GNU General Public License v2.0 5 votes vote down vote up
def setupUi(self, About):
        About.setObjectName("About")
        About.resize(498, 369)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(About.sizePolicy().hasHeightForWidth())
        About.setSizePolicy(sizePolicy)
        self.verticalLayout = QtWidgets.QVBoxLayout(About)
        self.verticalLayout.setObjectName("verticalLayout")
        self.gridLayout_11 = QtWidgets.QGridLayout()
        self.gridLayout_11.setObjectName("gridLayout_11")
        self.label_6 = QtWidgets.QLabel(About)
        self.label_6.setObjectName("label_6")
        self.gridLayout_11.addWidget(self.label_6, 1, 1, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_11.addItem(spacerItem, 1, 2, 1, 1)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_11.addItem(spacerItem1, 1, 0, 1, 1)
        spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_11.addItem(spacerItem2, 0, 1, 1, 1)
        spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_11.addItem(spacerItem3, 2, 1, 1, 1)
        self.verticalLayout.addLayout(self.gridLayout_11)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem4)
        self.button_close = QtWidgets.QPushButton(About)
        self.button_close.setObjectName("button_close")
        self.horizontalLayout.addWidget(self.button_close)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(About)
        QtCore.QMetaObject.connectSlotsByName(About) 
Example 15
Project: simnibs   Author: simnibs   File: electrodeGUI.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, electrode_struct):
        super(Ui_Electrode, self).__init__()

        self.electrode_struct = copy.deepcopy(electrode_struct)
        mainLayout = QtWidgets.QGridLayout()

        self.glElectrode = GLElectrode()
        self.set_shape_size_layout()
        self.set_connector_layout()
        self.set_type_tick_layout()
        self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Cancel)
        self.button_box.accepted.connect(self.checkAndAccept)
        #self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)

        mainLayout.addWidget(self.shape_size, 0,4)
        mainLayout.addWidget(self.type_thick, 1,4)
        mainLayout.addWidget(self.connector_box,2,4)
        mainLayout.addWidget(self.glElectrode,0,0,4,4)
        mainLayout.addWidget(self.button_box, 4,4)


        self.update_electrode()
        self.glElectrode.electrode_object, self.glElectrode.plug_object = self.glElectrode.drawElectrode(self.electrode_struct)
        self.glElectrode.electrode_struct = self.electrode_struct
        self.glElectrode.update()

        self.setLayout(mainLayout)
        self.resize(900,450)

        self.setWindowTitle('Electrode')


    #Shape and size box 
Example 16
Project: simnibs   Author: simnibs   File: main_gui.py    License: GNU General Public License v3.0 5 votes vote down vote up
def selectFileLayout(self):

        self.select_file = QtWidgets.QGroupBox('')
        layout = QtWidgets.QGridLayout()

        tag_m2m = QtWidgets.QLabel('<b>m2m Folder:<\\b>')
        layout.addWidget(tag_m2m, 1, 0, 1, 3)

        self.m2m_folder_lineEdit = QtWidgets.QLineEdit()
        layout.addWidget(self.m2m_folder_lineEdit, 2, 0, 1, 3)
 
        file_browse_m2m = QtWidgets.QPushButton('Browse')
        file_browse_m2m.clicked.connect(self.m2mFolderDialog)
        layout.addWidget(file_browse_m2m,2,3,1,1)

        tag = QtWidgets.QLabel('<b>Head Mesh:<\\b>')
        layout.addWidget(tag,3,0,1,3)

        self.file_name = QtWidgets.QLineEdit()
        layout.addWidget(self.file_name, 4, 0, 1, 3)
 
        file_browse = QtWidgets.QPushButton('Browse')
        file_browse.clicked.connect(self.fileDialog)
        layout.addWidget(file_browse, 4, 3, 1, 1)

        tag_Out = QtWidgets.QLabel('<b>Output Folder:<\\b>')
        layout.addWidget(tag_Out,5,0,1,3)

        self.out_folder_lineEdit = QtWidgets.QLineEdit()
        layout.addWidget(self.out_folder_lineEdit,6,0,1,3)
 
        file_browse_out = QtWidgets.QPushButton('Browse')
        file_browse_out.clicked.connect(self.outFolderDialog)
        layout.addWidget(file_browse_out,6,3,1,1)



        self.select_file.setLayout(layout) 
Example 17
Project: simnibs   Author: simnibs   File: main_gui.py    License: GNU General Public License v3.0 5 votes vote down vote up
def poslistTabs(self):
        poslistsTabs = QtWidgets.QGroupBox("Position Lists:")
        layout = QtWidgets.QGridLayout()
        self.poslistTabWidget = QtWidgets.QTabWidget()
        #elc_table = ElcTable(0,3,self.headModelWidget.glHeadModel,self)
        #self.poslistTabWidget.addTab(elc_table.generateGroupBox(), "tDCS")
        layout.addWidget(self.poslistTabWidget,0,0,3,0)

        add_tDCS_button = QtWidgets.QPushButton("Add tDCS Poslist")
        add_tDCS_button.clicked.connect(self.addTdcsPoslistTab)
        layout.addWidget(add_tDCS_button,3,0)

        add_TMS_button = QtWidgets.QPushButton("Add TMS Poslist")
        add_TMS_button.clicked.connect(self.addTmsPoslistTab)
        layout.addWidget(add_TMS_button,3,1)

        copy_button = QtWidgets.QPushButton("Copy Poslist")
        copy_button.clicked.connect(self.copyPoslist)
        layout.addWidget(copy_button,3,2)

        self.poslistTabWidget.setTabsClosable(True)
        self.poslistTabWidget.tabCloseRequested.connect(self.removePoslistTab)

        self.poslistTabWidget.currentChanged.connect(self.changeGlStimulators)
        #self.pos

        poslistsTabs.setLayout(layout)

        return poslistsTabs

    #Adds a tdcs-type tab to the poslist tabs 
Example 18
Project: simnibs   Author: simnibs   File: main_gui.py    License: GNU General Public License v3.0 5 votes vote down vote up
def coilBox(self):
        box = QtWidgets.QGroupBox("Coil Definition File:")
        layout = QtWidgets.QGridLayout()

        coil_line_edit = QtWidgets.QLineEdit()
        coil_line_edit.textChanged.connect(self.set_coil_fn)
        layout.addWidget(coil_line_edit,0,0,1,3)

        file_browse_btn = QtWidgets.QPushButton('Browse')
        file_browse_btn.clicked.connect(self.coilDialog)
        layout.addWidget(file_browse_btn,0,3,1,1)

        box.setLayout(layout)

        return box, coil_line_edit 
Example 19
Project: simnibs   Author: simnibs   File: main_gui.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, centre, reference, name, glHeadModel):
        super(Position_GUI, self).__init__()
        self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
        self.centre = centre
        self.reference = reference
        self.glHeadModel = glHeadModel
        self.ogl_object = None
        self.name = name
        glHeadModel.windowClicked.connect(self.getClickedPosition)

        mainLayout = QtWidgets.QGridLayout()

        self.set_position_layout()
        self.set_direction_layout()
        #self.getClickedPosition()

        mainLayout.addWidget(self.position_box,0,0,1,2)
        mainLayout.addWidget(self.direction_box,1,0,1,2)

        self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Cancel)
        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)

        mainLayout.addWidget(self.button_box,2,1,1,3)


        self.project_button = QtWidgets.QPushButton('Project on scalp') 
        self.project_button.clicked.connect(self.project_points)
        mainLayout.addWidget(self.project_button,2,0,1,1)

        self.setLayout(mainLayout)
        self.setWindowTitle("Position")
        self.el_type = []
        self.el_coords = []
        self.el_name = []
        self.load_cap()
        #self.resize(200,300) 
Example 20
Project: simnibs   Author: simnibs   File: main_gui.py    License: GNU General Public License v3.0 5 votes vote down vote up
def set_position_layout(self):
        self.position_box = QtWidgets.QGroupBox("Position")
        load_pos = self.centre is not None and len(self.centre) == 3

        Layout = QtWidgets.QGridLayout()
        self.eeg_pos_selector = QtWidgets.QComboBox()
        self.eeg_pos_selector.activated.connect(self.select_eeg_pos)
        Layout.addWidget(self.eeg_pos_selector, 1,0)
        self.eeg_pos_selector.setEnabled(False)

        self.label_x = QtWidgets.QLabel("X:")
        Layout.addWidget(self.label_x,0,1)
        self.pos_x = QtWidgets.QDoubleSpinBox()
        self.pos_x.setRange(-1000,1000)
        if load_pos: self.pos_x.setValue(self.centre[0])
        #self.pos_x.valueChanged.connect(self.update_center)
        Layout.addWidget(self.pos_x,1,1)

        self.label_y = QtWidgets.QLabel("Y:")
        Layout.addWidget(self.label_y,0,2)
        self.pos_y = QtWidgets.QDoubleSpinBox()
        self.pos_y.setRange(-1000,1000)
        if load_pos: self.pos_y.setValue(self.centre[1])
       # self.pos_y.valueChanged.connect(self.update_center)
        Layout.addWidget(self.pos_y,1,2)

        self.label_z = QtWidgets.QLabel("Z:")
        Layout.addWidget(self.label_z,0,3)
        self.pos_z = QtWidgets.QDoubleSpinBox()
        self.pos_z.setRange(-1000,1000)
        if load_pos: self.pos_z.setValue(self.centre[2])
        #self.pos_z.valueChanged.connect(self.update_center)
        Layout.addWidget(self.pos_z,1,3)

        self.position_box.setLayout(Layout) 
Example 21
Project: simnibs   Author: simnibs   File: main_gui.py    License: GNU General Public License v3.0 5 votes vote down vote up
def set_direction_layout(self):
        box_text = "Direction Reference"
        self.direction_box = QtWidgets.QGroupBox(box_text)

        load_ref = self.reference is not None and len(self.reference) == 3

        Layout = QtWidgets.QGridLayout()

        self.check = QtWidgets.QCheckBox('Define Reference Coordinates')

        Layout.addWidget(self.check, 0,0,1,3)

        self.label_x2 = QtWidgets.QLabel("X:")
        Layout.addWidget(self.label_x2,1,1)
        self.ref_x = QtWidgets.QDoubleSpinBox()
        self.ref_x.setRange(-1000, 1000)
        if load_ref: self.ref_x.setValue(self.reference[0])
        #self.ref_x.valueChanged.connect(self.update_stimulator)
        Layout.addWidget(self.ref_x,2,1)

        self.label_y2 = QtWidgets.QLabel("Y:")
        Layout.addWidget(self.label_y2,1,2)
        self.ref_y = QtWidgets.QDoubleSpinBox()
        self.ref_y.setRange(-1000, 1000)
        if load_ref: self.ref_y.setValue(self.reference[1])
        #self.ref_y.valueChanged.connect(self.update_stimulator)
        Layout.addWidget(self.ref_y,2,2)

        self.label_z2 = QtWidgets.QLabel("Z:")
        Layout.addWidget(self.label_z2,1,3)
        self.ref_z = QtWidgets.QDoubleSpinBox()
        self.ref_z.setRange(-1000, 1000)
        if load_ref: self.ref_z.setValue(self.reference[2])
        #self.ref_z.valueChanged.connect(self.update_stimulator)
        Layout.addWidget(self.ref_z,2,3)

        self.direction_box.setLayout(Layout)

    #Returns the positions 
Example 22
Project: simnibs   Author: simnibs   File: simulation_menu.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, eeg_cap):
        super(EEGFileDialog, self).__init__(parent)

        self.fname = eeg_cap

        groupBox = QtWidgets.QGroupBox('EEG Cap File')
        layout = QtWidgets.QHBoxLayout()

        groupBox.lineEdit = QtWidgets.QLineEdit()
        if self.fname is not None:
            groupBox.lineEdit.setText(self.fname)
        layout.addWidget(groupBox.lineEdit)

        groupBox.selectFile = QtWidgets.QPushButton('&Browse')
        groupBox.selectFile.clicked.connect(self.selectFile)
        layout.addWidget(groupBox.selectFile)

        groupBox.setLayout(layout)
        self.group_box = groupBox

        self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Cancel)
        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)

        mainLayout = QtWidgets.QGridLayout()

        mainLayout.addWidget(self.group_box)
        mainLayout.addWidget(self.button_box)

        self.setLayout(mainLayout)  

        self.setWindowTitle('Tensor file names')
        self.resize(400,200) 
Example 23
Project: simnibs   Author: simnibs   File: simulation_menu.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        super(SimProgressScreen, self).__init__()

        self.text = ''
        self.simFinished = False

        self.textBox = QtWidgets.QTextEdit()
        self.textBox.setReadOnly(True)
        self.textBox.setAcceptRichText(True)


        self.terminate_btn = QtWidgets.QPushButton('Terminate')
        self.terminate_btn.clicked.connect(self.close)

        mainLayout = QtWidgets.QGridLayout()

        mainLayout.addWidget(self.textBox)
        mainLayout.addWidget(self.terminate_btn)

        self.central_widget = QtWidgets.QWidget()
        self.central_widget.setLayout(mainLayout)


        self.setCentralWidget(self.central_widget)


        self.resize(800,500)

        self.setWindowTitle('Simulation Progress')
        try:
            gui_icon = os.path.join(SIMNIBSDIR,'resources', 'gui_icon.gif')
            self.setWindowIcon(QtGui.QIcon(gui_icon))
        except:
            pass 
Example 24
Project: dcc   Author: amimo   File: xrefwindow.py    License: Apache License 2.0 5 votes vote down vote up
def __init__(self,
                 parent=None,
                 win=None,
                 method_analysis=None):
        super(XrefDialogMethod, self).__init__(parent)
        self.method_analysis = method_analysis

        title = "Xrefs for the method %s" % self.method_analysis.method

        self.setWindowTitle(title)

        xrefs_list = []

        xrefs_from = self.method_analysis.get_xref_from()
        for ref_class, ref_method, _ in xrefs_from:
            xrefs_list.append(('From', ref_method, ref_class.get_vm_class()))

        xrefs_to = self.method_analysis.get_xref_to()
        for ref_class, ref_method, _ in xrefs_to:
            xrefs_list.append(('To', ref_method, ref_class.get_vm_class()))

        closeButton = QtWidgets.QPushButton("Close")
        closeButton.clicked.connect(self.close)

        xreflayout = QtWidgets.QGridLayout()
        xrefwin = XrefListView(self, win=win, xrefs=xrefs_list)
        xreflayout.addWidget(xrefwin, 0, 0)

        buttonsLayout = QtWidgets.QHBoxLayout()
        buttonsLayout.addStretch(1)
        buttonsLayout.addWidget(closeButton)

        mainLayout = QtWidgets.QVBoxLayout()
        mainLayout.addLayout(xreflayout)
        mainLayout.addLayout(buttonsLayout)

        self.setLayout(mainLayout) 
Example 25
Project: dcc   Author: amimo   File: xrefwindow.py    License: Apache License 2.0 5 votes vote down vote up
def __init__(self,
                 parent=None,
                 win=None,
                 current_class=None,
                 class_analysis=None,
                 field_analysis=None):
        super(XrefDialogField, self).__init__(parent)
        self.current_class = current_class
        self.class_analysis = class_analysis
        self.field_analysis = field_analysis

        title = "Xrefs for the field %s" % self.field_analysis.field

        self.setWindowTitle(title)

        xrefs_list = []

        xrefs_read = self.field_analysis.get_xref_read()
        for ref_class, ref_method in xrefs_read:
            xrefs_list.append(('Read', ref_method, ref_class.get_vm_class()))

        xrefs_write = self.field_analysis.get_xref_write()
        for ref_class, ref_method in xrefs_write:
            xrefs_list.append(('Write', ref_method, ref_class.get_vm_class()))

        closeButton = QtWidgets.QPushButton("Close")
        closeButton.clicked.connect(self.close)

        xreflayout = QtWidgets.QGridLayout()
        xrefwin = XrefListView(self, win=win, xrefs=xrefs_list)
        xreflayout.addWidget(xrefwin, 0, 0)

        buttonsLayout = QtWidgets.QHBoxLayout()
        buttonsLayout.addStretch(1)
        buttonsLayout.addWidget(closeButton)

        mainLayout = QtWidgets.QVBoxLayout()
        mainLayout.addLayout(xreflayout)
        mainLayout.addLayout(buttonsLayout)

        self.setLayout(mainLayout) 
Example 26
Project: dcc   Author: amimo   File: xrefwindow.py    License: Apache License 2.0 5 votes vote down vote up
def __init__(self, parent=None, win=None, string_analysis=None):
        super(XrefDialogString, self).__init__(parent)
        self.string_analysis = string_analysis

        title = "Xrefs for the string %s" % self.string_analysis.value

        self.setWindowTitle(title)

        xrefs_list = []

        xrefs_from = self.string_analysis.get_xref_from()
        for ref_class, ref_method in xrefs_from:
            xrefs_list.append(('From', ref_method, ref_class.get_vm_class()))

        closeButton = QtWidgets.QPushButton("Close")
        closeButton.clicked.connect(self.close)

        xreflayout = QtWidgets.QGridLayout()
        xrefwin = XrefListView(self, win=win, xrefs=xrefs_list)
        xreflayout.addWidget(xrefwin, 0, 0)

        buttonsLayout = QtWidgets.QHBoxLayout()
        buttonsLayout.addStretch(1)
        buttonsLayout.addWidget(closeButton)

        mainLayout = QtWidgets.QVBoxLayout()
        mainLayout.addLayout(xreflayout)
        mainLayout.addLayout(buttonsLayout)

        self.setLayout(mainLayout) 
Example 27
Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: intro_dlg.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        super().__init__()

        self.updating_gui_bool = False

        self.overview_qlw = TimingOverviewWt()
        self.grid = QtWidgets.QGridLayout()
        self.notification_interval_qsp = QtWidgets.QSpinBox()
        self.show_after_qsb = QtWidgets.QSpinBox()
        self.rest_interval_qsp = QtWidgets.QSpinBox()

        self._init_ui()
        self.update_gui()
        self._connect_slots_to_signals() 
Example 28
Project: tf-pose   Author: SrikanthVelpuri   File: exportDialogTemplate_pyqt5.py    License: Apache License 2.0 5 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(241, 367)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 3)
        self.itemTree = QtWidgets.QTreeWidget(Form)
        self.itemTree.setObjectName("itemTree")
        self.itemTree.headerItem().setText(0, "1")
        self.itemTree.header().setVisible(False)
        self.gridLayout.addWidget(self.itemTree, 1, 0, 1, 3)
        self.label_2 = QtWidgets.QLabel(Form)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 2, 0, 1, 3)
        self.formatList = QtWidgets.QListWidget(Form)
        self.formatList.setObjectName("formatList")
        self.gridLayout.addWidget(self.formatList, 3, 0, 1, 3)
        self.exportBtn = QtWidgets.QPushButton(Form)
        self.exportBtn.setObjectName("exportBtn")
        self.gridLayout.addWidget(self.exportBtn, 6, 1, 1, 1)
        self.closeBtn = QtWidgets.QPushButton(Form)
        self.closeBtn.setObjectName("closeBtn")
        self.gridLayout.addWidget(self.closeBtn, 6, 2, 1, 1)
        self.paramTree = ParameterTree(Form)
        self.paramTree.setObjectName("paramTree")
        self.paramTree.headerItem().setText(0, "1")
        self.paramTree.header().setVisible(False)
        self.gridLayout.addWidget(self.paramTree, 5, 0, 1, 3)
        self.label_3 = QtWidgets.QLabel(Form)
        self.label_3.setObjectName("label_3")
        self.gridLayout.addWidget(self.label_3, 4, 0, 1, 3)
        self.copyBtn = QtWidgets.QPushButton(Form)
        self.copyBtn.setObjectName("copyBtn")
        self.gridLayout.addWidget(self.copyBtn, 6, 0, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example 29
Project: tf-pose   Author: SrikanthVelpuri   File: FlowchartTemplate_pyqt5.py    License: Apache License 2.0 5 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(529, 329)
        self.selInfoWidget = QtWidgets.QWidget(Form)
        self.selInfoWidget.setGeometry(QtCore.QRect(260, 10, 264, 222))
        self.selInfoWidget.setObjectName("selInfoWidget")
        self.gridLayout = QtWidgets.QGridLayout(self.selInfoWidget)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setObjectName("gridLayout")
        self.selDescLabel = QtWidgets.QLabel(self.selInfoWidget)
        self.selDescLabel.setText("")
        self.selDescLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.selDescLabel.setWordWrap(True)
        self.selDescLabel.setObjectName("selDescLabel")
        self.gridLayout.addWidget(self.selDescLabel, 0, 0, 1, 1)
        self.selNameLabel = QtWidgets.QLabel(self.selInfoWidget)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.selNameLabel.setFont(font)
        self.selNameLabel.setText("")
        self.selNameLabel.setObjectName("selNameLabel")
        self.gridLayout.addWidget(self.selNameLabel, 0, 1, 1, 1)
        self.selectedTree = DataTreeWidget(self.selInfoWidget)
        self.selectedTree.setObjectName("selectedTree")
        self.selectedTree.headerItem().setText(0, "1")
        self.gridLayout.addWidget(self.selectedTree, 1, 0, 1, 2)
        self.hoverText = QtWidgets.QTextEdit(Form)
        self.hoverText.setGeometry(QtCore.QRect(0, 240, 521, 81))
        self.hoverText.setObjectName("hoverText")
        self.view = FlowchartGraphicsView(Form)
        self.view.setGeometry(QtCore.QRect(0, 0, 256, 192))
        self.view.setObjectName("view")

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example 30
Project: FIRST-plugin-ida   Author: vrtadmin   File: first.py    License: GNU General Public License v2.0 5 votes vote down vote up
def init_top_layout(self):
            title = QtWidgets.QLabel('Mass Function Upload')
            title.setStyleSheet('font: 16pt;')

            description = QtWidgets.QLabel((
                'Upload function prototype to server for others to access.\n'
                'Select the functions you want to upload. Click to select a '
                'function and click again to deselect the function. Once '
                'uploaded you can manage prototypes you\'ve created in the '
                'management window.'))
            description.setWordWrap(True)
            description.setLineWidth(200)
            description.setStyleSheet('text-size: 90%')

            vbox_text = QtWidgets.QVBoxLayout()
            vbox_text.addWidget(title)
            vbox_text.addWidget(description)

            vbox_legend = QtWidgets.QVBoxLayout()
            grid_legend = QtWidgets.QGridLayout()
            style = 'background-color: #{0:06x}; border: 1px solid #c0c0c0;'
            colors = [  FIRST.color_changed, FIRST.color_unchanged,
                        FIRST.color_default, FIRST.color_selected]
            text = ['Changed', 'Unchanged', 'Default', 'Selected']
            for i in xrange(len(colors)):
                box = QtWidgets.QLabel()
                box.setFixedHeight(10)
                box.setFixedWidth(10)
                box.setStyleSheet(style.format(colors[i].color().rgb() & 0xFFFFFF))
                grid_legend.addWidget(box, i, 0)
                grid_legend.addWidget(QtWidgets.QLabel(text[i]), i, 1)

            vbox_legend.addLayout(grid_legend)
            vbox_legend.setAlignment(Qt.AlignRight | Qt.AlignBottom)

            self.top_layout.addLayout(vbox_text)
            self.top_layout.addStretch()
            self.top_layout.addLayout(vbox_legend)