Python PyQt4.QtGui.QGroupBox() Examples

The following are 30 code examples of PyQt4.QtGui.QGroupBox(). 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 also want to check out all available functions/classes of the module PyQt4.QtGui , or try the search function .
Example #1
Source File: universal_tool_template_2010.py    From universal_tool_template.py with MIT License 6 votes vote down vote up
def setLang(self, langName):
        lang_data = self.memoData['lang'][langName]
        for ui_name in lang_data.keys():
            if ui_name in self.uiList.keys() and lang_data[ui_name] != '':
                ui_element = self.uiList[ui_name]
                # '' means no translation availdanle in that data file
                if isinstance(ui_element, (QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox) ):
                    # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                    ui_element.setText(lang_data[ui_name])
                elif isinstance(ui_element, (QtWidgets.QGroupBox, QtWidgets.QMenu) ):
                    # uiType: QMenu, QGroupBox
                    ui_element.setTitle(lang_data[ui_name])
                elif isinstance(ui_element, QtWidgets.QTabWidget):
                    # uiType: QTabWidget
                    tabCnt = ui_element.count()
                    tabNameList = lang_data[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != '':
                                ui_element.setTabText(i,tabNameList[i])
                elif isinstance(ui_element, QtWidgets.QComboBox):
                    # uiType: QComboBox
                    itemCnt = ui_element.count()
                    itemNameList = lang_data[ui_name].split(';')
                    ui_element.clear()
                    ui_element.addItems(itemNameList)
                elif isinstance(ui_element, QtWidgets.QTreeWidget):
                    # uiType: QTreeWidget
                    labelCnt = ui_element.headerItem().columnCount()
                    labelList = lang_data[ui_name].split(';')
                    ui_element.setHeaderLabels(labelList)
                elif isinstance(ui_element, QtWidgets.QTableWidget):
                    # uiType: QTableWidget
                    colCnt = ui_element.columnCount()
                    headerList = lang_data[ui_name].split(';')
                    cur_table.setHorizontalHeaderLabels( headerList )
                elif isinstance(ui_element, (str, unicode) ):
                    # uiType: string for msg
                    self.uiList[ui_name] = lang_data[ui_name] 
Example #2
Source File: universal_tool_template_v8.1.py    From universal_tool_template.py with MIT License 6 votes vote down vote up
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QGroupBox, QtWidgets.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name] 
Example #3
Source File: universal_tool_template_v7.3.py    From universal_tool_template.py with MIT License 6 votes vote down vote up
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtGui.QLabel, QtGui.QPushButton, QtGui.QAction, QtGui.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtGui.QGroupBox, QtGui.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtGui.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name] 
Example #4
Source File: UITranslator.py    From universal_tool_template.py with MIT License 6 votes vote down vote up
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QGroupBox, QtWidgets.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name] 
Example #5
Source File: settingDialog.py    From LabelImgTool with MIT License 6 votes vote down vote up
def createModeGroup(self):
        '''
        set the trask mode setting group
        :return: mode group
        '''
        self.modegroupBox = QtGui.QGroupBox("& Task Mode")
        self.modegroupBox.setCheckable(True)
        self.modegroupBox.setChecked(True)
        self.CLS_mode_rb = QtGui.QRadioButton("CLS Mode")
        self.CLS_mode_rb.clicked.connect(self.CLS_model_selected)
        self.DET_mode_rb = QtGui.QRadioButton("DET Mode")
        self.DET_mode_rb.clicked.connect(self.DET_model_selected)
        self.SEG_mode_rb = QtGui.QRadioButton("SEG Mode")
        self.SEG_mode_rb.clicked.connect(self.SEG_model_selected)
        self.BRU_mode_rb = QtGui.QRadioButton("BRU Mode")
        self.BRU_mode_rb.clicked.connect(self.BRU_model_selected)

        vbox = QtGui.QVBoxLayout()
        vbox.addWidget(self.CLS_mode_rb)
        vbox.addWidget(self.DET_mode_rb)
        vbox.addWidget(self.SEG_mode_rb)
        vbox.addWidget(self.BRU_mode_rb)
        vbox.addStretch(True)
        self.modegroupBox.setLayout(vbox)
        return self.modegroupBox 
Example #6
Source File: settingDialog.py    From LabelImgTool with MIT License 6 votes vote down vote up
def createDEToptGroup(self):
        self.detgroupBox = QtGui.QGroupBox("& DET options")
        self.enable_show_label_cb = QtGui.QCheckBox('enable show label name')


        self.label_font_size_sl = QtGui.QSlider(QtCore.Qt.Horizontal)
        self.label_font_size_sl.setRange(5,50)
        self.label_font_size_sp = QtGui.QSpinBox()
        self.label_font_size_sp.setRange(5,50)
        QtCore.QObject.connect(self.label_font_size_sl, QtCore.SIGNAL("valueChanged(int)"),

                               self.label_font_size_sp, QtCore.SLOT("setValue(int)"))
        self.label_font_size_sl.valueChanged.connect(self.change_label_font_size)
        self.label_font_size_sl.setValue(self.__class__.label_font_size)
        vbox = QtGui.QVBoxLayout()
        vbox.addWidget(self.enable_show_label_cb)
        vbox.addWidget(QtGui.QLabel('label font size'))
        vbox.addWidget(self.label_font_size_sl)
        vbox.addWidget(self.label_font_size_sp)
        vbox.addStretch()
        self.detgroupBox.setLayout(vbox)
        return self.detgroupBox 
Example #7
Source File: UITranslator_v1.0.py    From universal_tool_template.py with MIT License 6 votes vote down vote up
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtGui.QLabel, QtGui.QPushButton, QtGui.QAction, QtGui.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtGui.QGroupBox, QtGui.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtGui.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name] 
Example #8
Source File: settingDialog.py    From LabelImgTool with MIT License 6 votes vote down vote up
def createSEGoptGroup(self):
        self.seggroupBox = QtGui.QGroupBox("& SEG options")
        self.enable_color_map_cb = QtGui.QCheckBox('enable color map')
        self.instance_seg_label_cb = QtGui.QCheckBox('set instance seg')
        self.instance_seg_label_cb.setChecked(self.__class__.instance_seg_flag)
        self.instance_seg_label_cb.stateChanged.connect(self.change_instance_seg_label)
        if self.__class__.enable_color_map:
            self.enable_color_map_cb.toggle()
        self.enable_color_map_cb.stateChanged.connect(
            self.change_color_enable_state)
        if self.__class__.enable_color_map:
            self.enable_color_map_cb.setChecked(True)
        vbox = QtGui.QVBoxLayout()
        vbox.addWidget(self.enable_color_map_cb)
        vbox.addWidget(self.instance_seg_label_cb)
        vbox.addStretch(True)
        self.seggroupBox.setLayout(vbox)
        return self.seggroupBox 
Example #9
Source File: options.py    From wacom-gui with GNU General Public License v3.0 6 votes vote down vote up
def screenOptions(self):
        if QtGui.QDesktopWidget().numScreens() == 1:
            self.screenFull = None
            return None
        groupBox = QtGui.QGroupBox("Screen Area")
        groupBox.setAlignment(QtCore.Qt.AlignHCenter)
        groupBox.setFixedHeight(120)
        self.screenGroup = QtGui.QButtonGroup(groupBox)
        self.displays = []
        for x in range(0, QtGui.QDesktopWidget().numScreens()):
            self.displays.append(QtGui.QRadioButton("Monitor %d" % x))
        self.screenFull = QtGui.QRadioButton("All Monitors")
        for screen in self.displays:
            self.screenGroup.addButton(screen)
        self.screenGroup.addButton(self.screenFull)
        screenLayout = QtGui.QVBoxLayout()
        for screen in self.displays:
            screenLayout.addWidget(screen)
        screenLayout.addWidget(self.screenFull)
        screenLayout.addStretch(1)
        self.screenGroup.buttonClicked.connect(self.screenChange)
        groupBox.setLayout(screenLayout)
        return groupBox 
Example #10
Source File: trial_detail_widget.py    From time_trial with MIT License 6 votes vote down vote up
def __init__(self, parent=None):
        super(TrialDetailsWidget, self).__init__(parent)

        self.layout = QtGui.QVBoxLayout()
        self.setLayout(self.layout)

        self.box = QtGui.QGroupBox("Trial Settings")
        self.layout.addWidget(self.box)

        self.box_layout = QtGui.QFormLayout()
        self.box_layout.setFormAlignment(QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft)
        self.box.setLayout(self.box_layout)


        self.type = QtGui.QLabel("")
        self.box_layout.addRow("<b>Type</b>", self.type)

        self.name = QtGui.QLabel("")
        self.box_layout.addRow("<b>Name</b>", self.name)

        self.description = QtGui.QLabel("")
        self.box_layout.addRow("<b>Description</b>", self.description) 
Example #11
Source File: trial_detail_widget.py    From time_trial with MIT License 6 votes vote down vote up
def __init__(self, parent=None):
        super(RacerDetailsWidget, self).__init__(parent)

        self.layout = QtGui.QVBoxLayout()
        self.setLayout(self.layout)


        self.box = QtGui.QGroupBox("Racer Settings")
        self.layout.addWidget(self.box)
        self.box_layout = QtGui.QFormLayout()
        self.box_layout.setFormAlignment(QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft)
        self.box.setLayout(self.box_layout)


        self.racer = QtGui.QLabel("")
        self.box_layout.addRow("<b>Racer</b>", self.racer)


        self.core_id = QtGui.QLabel("")
        self.box_layout.addRow("<b>Core ID</b>", self.core_id)

        self.real_time = QtGui.QLabel("")
        self.box_layout.addRow("<b>Real-Time</b>", self.real_time) 
Example #12
Source File: plotter_tab.py    From time_trial with MIT License 5 votes vote down vote up
def __init__(self, parent = None):
        super(PlotterTab, self).__init__(parent)
        self.layout = QtGui.QGridLayout()
        self.setLayout(self.layout)

        # data sources
        self.data_box = QtGui.QGroupBox(self, title="Data Sources")
        self.layout.addWidget(self.data_box,0,0)

        data_box_layout = QtGui.QGridLayout(self.data_box)
        self.data_box.setLayout(data_box_layout)

        self.data_source_model = DataSourceModel()
        self.data_source_table = QtGui.QTableView()
        self.data_source_table.setModel(self.data_source_model)
        self.data_source_table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.data_source_table.activated.connect(self.event_open_data_source_edit)

        data_box_layout.addWidget(self.data_source_table, 0, 0)


        self.plotter = PlotterWidget(self)
        self.plotter.set_data_source_model(self.data_source_model)
        self.layout.addWidget(self.plotter, 1,0,1,2)

        self.data_source_model.rowsInserted.connect(self.plotter.update_plot)


        # main buttons
        add_file_button = QtGui.QPushButton(self.data_box)
        add_file_button.setText("Add File")

        add_file_button.released.connect(self.event_show_select_file_dialog)
        self.layout.addWidget(add_file_button,0,1) 
Example #13
Source File: ui_composer_photo_data_source.py    From stdm with GNU General Public License v2.0 5 votes vote down vote up
def setupUi(self, PhotoDataSourceEditor):
        PhotoDataSourceEditor.setObjectName(_fromUtf8("PhotoDataSourceEditor"))
        PhotoDataSourceEditor.resize(276, 298)
        self.gridLayout = QtGui.QGridLayout(PhotoDataSourceEditor)
        self.gridLayout.setVerticalSpacing(12)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.vl_notification = QtGui.QVBoxLayout()
        self.vl_notification.setObjectName(_fromUtf8("vl_notification"))
        self.gridLayout.addLayout(self.vl_notification, 1, 0, 1, 2)
        self.label_4 = QtGui.QLabel(PhotoDataSourceEditor)
        self.label_4.setStyleSheet(_fromUtf8("padding: 2px; font-weight: bold; background-color: rgb(200, 200, 200);"))
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.gridLayout.addWidget(self.label_4, 0, 0, 1, 2)
        spacerItem = QtGui.QSpacerItem(20, 118, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 4, 1, 1, 1)
        self.groupBox = QtGui.QGroupBox(PhotoDataSourceEditor)
        self.groupBox.setMinimumSize(QtCore.QSize(0, 0))
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout_2 = QtGui.QGridLayout(self.groupBox)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.ref_table = ReferencedTableEditor(self.groupBox)
        self.ref_table.setObjectName(_fromUtf8("ref_table"))
        self.gridLayout_2.addWidget(self.ref_table, 0, 0, 1, 1)
        self.gridLayout.addWidget(self.groupBox, 2, 0, 1, 2)
        self.label = QtGui.QLabel(PhotoDataSourceEditor)
        self.label.setMaximumSize(QtCore.QSize(100, 16777215))
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 3, 0, 1, 1)
        self.cbo_document_type = QtGui.QComboBox(PhotoDataSourceEditor)
        self.cbo_document_type.setMinimumSize(QtCore.QSize(0, 30))
        self.cbo_document_type.setObjectName(_fromUtf8("cbo_document_type"))
        self.gridLayout.addWidget(self.cbo_document_type, 3, 1, 1, 1)

        self.retranslateUi(PhotoDataSourceEditor)
        QtCore.QMetaObject.connectSlotsByName(PhotoDataSourceEditor) 
Example #14
Source File: settings_tab.py    From time_trial with MIT License 5 votes vote down vote up
def __init__(self,  parent = None, session = None):
        super(SettingsTab, self).__init__(parent)
        self.session = session
        self.layout = QtGui.QGridLayout()
        self.setLayout(self.layout)

        racers_box = QtGui.QGroupBox("Racer Configuration")
        racers_box_layout = QtGui.QGridLayout()
        racers_box.setLayout(racers_box_layout)
        self.layout.addWidget(racers_box,0,0)

        self.racers_table = QtGui.QTableView(self)
        self.racers_table.doubleClicked.connect(self.edit_racer)
        self.racers_table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.racers_table.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
        self.racers_table_model = SQLAlchemyTableModel(session, Racer, [
            ('name', Racer.name, 'name'),
            ('hostname', Racer.hostname, 'hostname'),
            ('location', Racer.location, 'location')])


        self.racers_table_selection_model  = QtGui.QItemSelectionModel(self.racers_table_model)
        self.racers_table.setModel(self.racers_table_selection_model.model())
        self.racers_table.setSelectionModel(self.racers_table_selection_model)


        racers_box_layout.addWidget(self.racers_table,0,0, 1, 3)

        racers_add_button = QtGui.QPushButton("Add")
        racers_add_button.released.connect(self.add_racer)
        racers_box_layout.addWidget(racers_add_button, 1, 0)

        racers_edit_button = QtGui.QPushButton("Edit")
        racers_edit_button.released.connect(self.edit_racer)
        racers_box_layout.addWidget(racers_edit_button, 1, 1)


        racers_delete_button = QtGui.QPushButton("Delete")
        racers_delete_button.released.connect(self.delete_racer)
        racers_box_layout.addWidget(racers_delete_button, 1, 2) 
Example #15
Source File: options.py    From wacom-gui with GNU General Public License v3.0 5 votes vote down vote up
def flipOptions(self):
        groupBox = QtGui.QGroupBox("Tablet Orientation")
        groupBox.setAlignment(QtCore.Qt.AlignHCenter)
        groupBox.setFixedHeight(120)
        self.tabletFlipGroup = QtGui.QButtonGroup(groupBox)
        self.tabletRight = QtGui.QRadioButton("Right-Handed")
        self.tabletLeft = QtGui.QRadioButton("Left-Handed")
        self.tabletFlipGroup.addButton(self.tabletRight)
        self.tabletFlipGroup.addButton(self.tabletLeft)
        flipLayout = QtGui.QVBoxLayout()
        flipLayout.addWidget(self.tabletRight)
        flipLayout.addWidget(self.tabletLeft)
        flipLayout.addStretch(1)
        getCommand = os.popen("xsetwacom --get \"%s stylus\" Rotate" % self.tabletStylus).readlines()
        # check correct button for orientation
        if getCommand[0] == "none\n":
            self.orient = "xsetwacom --set \"%s stylus\" Rotate none" % self.tabletStylus
            self.orient += "\nxsetwacom --set \"%s eraser\" Rotate none" % self.tabletEraser
            self.tabletRight.setChecked(1)
        elif getCommand[0] == "half\n":
            self.orient = "xsetwacom --set \"%s stylus\" Rotate half" % self.tabletStylus
            self.orient += "\nxsetwacom --set \"%s eraser\" Rotate half" % self.tabletEraser
            self.tabletLeft.setChecked(1)
        self.tabletFlipGroup.buttonClicked.connect(self.tabletFlipChange)
        groupBox.setLayout(flipLayout)
        return groupBox 
Example #16
Source File: MotorControlModernUi.py    From rpi-course with MIT License 5 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(534, 310)
        self.dial = QtGui.QDial(Dialog)
        self.dial.setGeometry(QtCore.QRect(120, -10, 311, 261))
        self.dial.setMaximum(100)
        self.dial.setObjectName(_fromUtf8("dial"))
        self.lcdNumber = QtGui.QLCDNumber(Dialog)
        self.lcdNumber.setGeometry(QtCore.QRect(10, 250, 71, 41))
        self.lcdNumber.setAutoFillBackground(False)
        self.lcdNumber.setFrameShape(QtGui.QFrame.StyledPanel)
        self.lcdNumber.setFrameShadow(QtGui.QFrame.Raised)
        self.lcdNumber.setDigitCount(3)
        self.lcdNumber.setSegmentStyle(QtGui.QLCDNumber.Filled)
        self.lcdNumber.setObjectName(_fromUtf8("lcdNumber"))
        self.progressBar = QtGui.QProgressBar(Dialog)
        self.progressBar.setGeometry(QtCore.QRect(90, 250, 441, 41))
        self.progressBar.setProperty("value", 0)
        self.progressBar.setObjectName(_fromUtf8("progressBar"))
        self.groupBox = QtGui.QGroupBox(Dialog)
        self.groupBox.setGeometry(QtCore.QRect(10, 160, 71, 80))
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.CWButton = QtGui.QRadioButton(self.groupBox)
        self.CWButton.setGeometry(QtCore.QRect(10, 20, 82, 17))
        self.CWButton.setChecked(True)
        self.CWButton.setObjectName(_fromUtf8("CWButton"))
        self.CCWButton = QtGui.QRadioButton(self.groupBox)
        self.CCWButton.setGeometry(QtCore.QRect(10, 40, 81, 31))
        self.CCWButton.setObjectName(_fromUtf8("CCWButton"))

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example #17
Source File: editor.py    From pytransform3d with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def _create(self, base_frame):
            self.sliders = []
            self.spinboxes = []
            for i in range(len(self.dim_labels)):
                self.sliders.append(QtGui.QSlider(QtCore.Qt.Horizontal))
                self.sliders[i].setRange(0, self.n_slider_steps[i])
                self.connect(self.sliders[i],
                             QtCore.SIGNAL("valueChanged(int)"),
                             partial(self._on_slide, i))
                spinbox = QtGui.QDoubleSpinBox()
                spinbox.setRange(*self.limits[i])
                spinbox.setDecimals(3)
                spinbox.setSingleStep(0.001)
                self.spinboxes.append(spinbox)
                self.connect(self.spinboxes[i],
                             QtCore.SIGNAL("valueChanged(double)"),
                             partial(self._on_pos_edited, i))
            slider_group = QtGui.QGridLayout()
            slider_group.addWidget(QtGui.QLabel("Position"),
                                   0, 0, 1, 3, QtCore.Qt.AlignCenter)
            slider_group.addWidget(QtGui.QLabel("Orientation (Euler angles)"),
                                   0, 3, 1, 3, QtCore.Qt.AlignCenter)
            for i, slider in enumerate(self.sliders):
                slider_group.addWidget(QtGui.QLabel(self.dim_labels[i]), 1, i)
                slider_group.addWidget(slider, 2, i)
                slider_group.addWidget(self.spinboxes[i], 3, i)
            slider_groupbox = QtGui.QGroupBox("Transformation in frame '%s'"
                                              % base_frame)
            slider_groupbox.setLayout(slider_group)
            layout = QtGui.QHBoxLayout()
            layout.addWidget(slider_groupbox)
            layout.addStretch(1)
            return layout 
Example #18
Source File: settingDialog.py    From LabelImgTool with MIT License 5 votes vote down vote up
def createBRUoptGroup(self):
        self.brugroupBox = QtGui.QGroupBox("& Brush options")
        #self.single_label_rb = QtGui.QRadioButton("single label")
        #self.multi_label_rb = QtGui.QRadioButton("multi label")
        vbox = QtGui.QVBoxLayout()
        #vbox.addWidget(self.single_label_rb)
        #vbox.addWidget(self.multi_label_rb)
        vbox.addStretch(True)
        self.brugroupBox.setLayout(vbox)
        return self.brugroupBox 
Example #19
Source File: settingDialog.py    From LabelImgTool with MIT License 5 votes vote down vote up
def createCLSoptGroup(self):
        self.clsgroupBox = QtGui.QGroupBox("& CLS options")
        #self.single_label_rb = QtGui.QRadioButton("single label")
        #self.multi_label_rb = QtGui.QRadioButton("multi label")
        vbox = QtGui.QVBoxLayout()
        #vbox.addWidget(self.single_label_rb)
        #vbox.addWidget(self.multi_label_rb)
        vbox.addStretch(True)
        self.clsgroupBox.setLayout(vbox)
        return self.clsgroupBox 
Example #20
Source File: universal_tool_template_v8.1.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def quickGrpUI(self, ui_name, ui_label, ui_layout):
        self.uiList[ui_name] = QtWidgets.QGroupBox(ui_label)
        if isinstance(ui_layout, QtWidgets.QLayout):
            self.uiList[ui_name].setLayout(ui_layout)
        elif isinstance(ui_layout, str):
            ui_layout = self.quickLayout(ui_name+"_layout", ui_layout)
            self.uiList[ui_name].setLayout(ui_layout)
        return [self.uiList[ui_name], ui_layout] 
Example #21
Source File: ui_changepwd.py    From stdm with GNU General Public License v2.0 5 votes vote down vote up
def setupUi(self, frmChangePwd):
        frmChangePwd.setObjectName(_fromUtf8("frmChangePwd"))
        frmChangePwd.resize(320, 200)
        frmChangePwd.setMaximumSize(QtCore.QSize(320, 16777215))
        self.gridLayout_2 = QtGui.QGridLayout(frmChangePwd)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.groupBox = QtGui.QGroupBox(frmChangePwd)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout_3 = QtGui.QGridLayout(self.groupBox)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.txtNewPass = QtGui.QLineEdit(self.groupBox)
        self.txtNewPass.setMinimumSize(QtCore.QSize(0, 30))
        self.txtNewPass.setMaxLength(200)
        self.txtNewPass.setEchoMode(QtGui.QLineEdit.Password)
        self.txtNewPass.setObjectName(_fromUtf8("txtNewPass"))
        self.gridLayout.addWidget(self.txtNewPass, 0, 1, 1, 1)
        self.label = QtGui.QLabel(self.groupBox)
        self.label.setMinimumSize(QtCore.QSize(70, 0))
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        self.label_2 = QtGui.QLabel(self.groupBox)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
        self.txtConfirmPass = QtGui.QLineEdit(self.groupBox)
        self.txtConfirmPass.setMinimumSize(QtCore.QSize(0, 30))
        self.txtConfirmPass.setMaxLength(200)
        self.txtConfirmPass.setEchoMode(QtGui.QLineEdit.Password)
        self.txtConfirmPass.setObjectName(_fromUtf8("txtConfirmPass"))
        self.gridLayout.addWidget(self.txtConfirmPass, 1, 1, 1, 1)
        self.gridLayout_3.addLayout(self.gridLayout, 0, 0, 1, 1)
        self.gridLayout_2.addWidget(self.groupBox, 0, 0, 1, 1)
        self.btnBox = QtGui.QDialogButtonBox(frmChangePwd)
        self.btnBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.btnBox.setObjectName(_fromUtf8("btnBox"))
        self.gridLayout_2.addWidget(self.btnBox, 1, 0, 1, 1)

        self.retranslateUi(frmChangePwd)
        QtCore.QObject.connect(self.btnBox, QtCore.SIGNAL(_fromUtf8("rejected()")), frmChangePwd.reject)
        QtCore.QMetaObject.connectSlotsByName(frmChangePwd) 
Example #22
Source File: universal_tool_template_v8.1.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def loadLang(self):
        self.quickMenu(['language_menu;&Language'])
        cur_menu = self.uiList['language_menu']
        self.quickMenuAction('langDefault_atnLang', 'Default','','langDefault.png', cur_menu)
        cur_menu.addSeparator()
        self.uiList['langDefault_atnLang'].triggered.connect(partial(self.setLang,'default'))
        # store default language
        self.memoData['lang']={}
        self.memoData['lang']['default']={}
        for ui_name in self.uiList:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                self.memoData['lang']['default'][ui_name] = str(ui_element.text())
            elif type(ui_element) in [ QtWidgets.QGroupBox, QtWidgets.QMenu ]:
                # uiType: QMenu, QGroupBox
                self.memoData['lang']['default'][ui_name] = str(ui_element.title())
            elif type(ui_element) in [ QtWidgets.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                tabNameList = []
                for i in range(tabCnt):
                    tabNameList.append(str(ui_element.tabText(i)))
                self.memoData['lang']['default'][ui_name]=';'.join(tabNameList)
            elif type(ui_element) == str:
                # uiType: string for msg
                self.memoData['lang']['default'][ui_name] = self.uiList[ui_name]
        
        # try load other language
        lang_path = os.path.dirname(self.location) # better in packed than(os.path.abspath(__file__))
        baseName = os.path.splitext( os.path.basename(self.location) )[0]
        for fileName in os.listdir(lang_path):
            if fileName.startswith(baseName+"_lang_"):
                langName = fileName.replace(baseName+"_lang_","").split('.')[0].replace(" ","")
                self.memoData['lang'][ langName ] = self.readRawFile( os.path.join(lang_path,fileName) )
                self.quickMenuAction(langName+'_atnLang', langName.upper(),'',langName + '.png', cur_menu)
                self.uiList[langName+'_atnLang'].triggered.connect(partial(self.setLang,langName))
        # if no language file detected, add export default language option
        if len(self.memoData['lang']) == 1:
            self.quickMenuAction('langExport_atnLang', 'Export Default Language','','langExport.png', cur_menu)
            self.uiList['langExport_atnLang'].triggered.connect(self.exportLang) 
Example #23
Source File: universal_tool_template_v8.1.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def qui(self, ui_list_string, parentObject_string='', opt=''):
        # pre-defined user short name syntax
        type_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txtEdit': 'LNTextEdit', 'txt': 'QTextEdit',
            'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem', 
        }
        # get ui_list, creation or existing ui object
        ui_list = [x.strip() for x in ui_list_string.split('|')]
        for i in range(len(ui_list)):
            if ui_list[i] in self.uiList:
                # - exisiting object
                ui_list[i] = self.uiList[ui_list[i]]
            else:
                # - string creation: 
                # get part info
                partInfo = ui_list[i].split(';',1)
                uiName = partInfo[0].split('@')[0]
                uiType = uiName.rsplit('_',1)[-1]
                if uiType in type_dict:
                    uiType = type_dict[uiType]
                # set quickUI string format
                ui_list[i] = partInfo[0]+';'+uiType
                if len(partInfo)==1:
                    # give empty button and label a place holder name
                    if uiType in ('btn', 'btnMsg', 'QPushButton','label', 'QLabel'):
                        ui_list[i] = partInfo[0]+';'+uiType + ';'+uiName 
                elif len(partInfo)==2:
                    ui_list[i]=ui_list[i]+";"+partInfo[1]
        # get parentObject or exisiting object
        parentObject = parentObject_string
        if parentObject in self.uiList:
            parentObject = self.uiList[parentObject]
        # process quickUI
        self.quickUI(ui_list, parentObject, opt) 
Example #24
Source File: universal_tool_template_v7.3.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def loadLang(self):
        self.quickMenu(['language_menu;&Language'])
        cur_menu = self.uiList['language_menu']
        self.quickMenuAction('langDefault_atnLang', 'Default','','langDefault.png', cur_menu)
        cur_menu.addSeparator()
        QtCore.QObject.connect( self.uiList['langDefault_atnLang'], QtCore.SIGNAL("triggered()"), partial(self.setLang, 'default') )
        # store default language
        self.memoData['lang']={}
        self.memoData['lang']['default']={}
        for ui_name in self.uiList:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtGui.QLabel, QtGui.QPushButton, QtGui.QAction, QtGui.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                self.memoData['lang']['default'][ui_name] = str(ui_element.text())
            elif type(ui_element) in [ QtGui.QGroupBox, QtGui.QMenu ]:
                # uiType: QMenu, QGroupBox
                self.memoData['lang']['default'][ui_name] = str(ui_element.title())
            elif type(ui_element) in [ QtGui.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                tabNameList = []
                for i in range(tabCnt):
                    tabNameList.append(str(ui_element.tabText(i)))
                self.memoData['lang']['default'][ui_name]=';'.join(tabNameList)
            elif type(ui_element) == str:
                # uiType: string for msg
                self.memoData['lang']['default'][ui_name] = self.uiList[ui_name]
        
        # try load other language
        lang_path = os.path.dirname(self.location) # better in packed than(os.path.abspath(__file__))
        baseName = os.path.splitext( os.path.basename(self.location) )[0]
        for fileName in os.listdir(lang_path):
            if fileName.startswith(baseName+"_lang_"):
                langName = fileName.replace(baseName+"_lang_","").split('.')[0].replace(" ","")
                self.memoData['lang'][ langName ] = self.readRawFile( os.path.join(lang_path,fileName) )
                self.quickMenuAction(langName+'_atnLang', langName.upper(),'',langName + '.png', cur_menu)
                QtCore.QObject.connect( self.uiList[langName+'_atnLang'], QtCore.SIGNAL("triggered()"), partial(self.setLang, langName) )
        # if no language file detected, add export default language option
        if len(self.memoData['lang']) == 1:
            self.quickMenuAction('langExport_atnLang', 'Export Default Language','','langExport.png', cur_menu)
            QtCore.QObject.connect( self.uiList['langExport_atnLang'], QtCore.SIGNAL("triggered()"), self.exportLang ) 
Example #25
Source File: universal_tool_template_v7.3.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def qui(self, ui_list_string, parentObject_string='', opt=''):
        # pre-defined user short name syntax
        type_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txtEdit': 'LNTextEdit', 'txt': 'QTextEdit',
            'tree': 'QTreeWidget',
            'space': 'QSpacerItem', 
        }
        # get ui_list, creation or existing ui object
        ui_list = [x.strip() for x in ui_list_string.split('|')]
        for i in range(len(ui_list)):
            if ui_list[i] in self.uiList:
                # - exisiting object
                ui_list[i] = self.uiList[ui_list[i]]
            else:
                # - string creation: 
                # get part info
                partInfo = ui_list[i].split(';',1)
                uiName = partInfo[0].split('@')[0]
                uiType = uiName.rsplit('_',1)[-1]
                if uiType in type_dict:
                    uiType = type_dict[uiType]
                # set quickUI string format
                ui_list[i] = partInfo[0]+';'+uiType
                if len(partInfo)==1:
                    # give empty button and label a place holder name
                    if uiType in ('btn', 'btnMsg', 'QPushButton','label', 'QLabel'):
                        ui_list[i] = partInfo[0]+';'+uiType + ';'+uiName 
                elif len(partInfo)==2:
                    ui_list[i]=ui_list[i]+";"+partInfo[1]
        # get parentObject or exisiting object
        parentObject = parentObject_string
        if parentObject in self.uiList:
            parentObject = self.uiList[parentObject]
        # process quickUI
        self.quickUI(ui_list, parentObject, opt) 
Example #26
Source File: universal_tool_template_1000.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def quickGrpUI(self, ui_name, ui_label, ui_layout):
        self.uiList[ui_name] = QtWidgets.QGroupBox(ui_label)
        if isinstance(ui_layout, QtWidgets.QLayout):
            self.uiList[ui_name].setLayout(ui_layout)
        elif isinstance(ui_layout, str):
            ui_layout = self.quickLayout(ui_name+"_layout", ui_layout)
            self.uiList[ui_name].setLayout(ui_layout)
        return [self.uiList[ui_name], ui_layout] 
Example #27
Source File: universal_tool_template_1000.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def setLang(self, langName):
        lang_data = self.memoData['lang'][langName]
        for ui_name in lang_data.keys():
            if ui_name in self.uiList.keys() and lang_data[ui_name] != '':
                ui_element = self.uiList[ui_name]
                # '' means no translation availdanle in that data file
                if isinstance(ui_element, (QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox) ):
                    # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                    ui_element.setText(lang_data[ui_name])
                elif isinstance(ui_element, (QtWidgets.QGroupBox, QtWidgets.QMenu) ):
                    # uiType: QMenu, QGroupBox
                    ui_element.setTitle(lang_data[ui_name])
                elif isinstance(ui_element, QtWidgets.QTabWidget):
                    # uiType: QTabWidget
                    tabCnt = ui_element.count()
                    tabNameList = lang_data[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != '':
                                ui_element.setTabText(i,tabNameList[i])
                elif isinstance(ui_element, QtWidgets.QComboBox):
                    # uiType: QComboBox
                    itemCnt = ui_element.count()
                    itemNameList = lang_data[ui_name].split(';')
                    ui_element.clear()
                    ui_element.addItems(itemNameList)
                elif isinstance(ui_element, QtWidgets.QTreeWidget):
                    # uiType: QTreeWidget
                    labelCnt = ui_element.headerItem().columnCount()
                    labelList = lang_data[ui_name].split(';')
                    ui_element.setHeaderLabels(labelList)
                elif isinstance(ui_element, QtWidgets.QTableWidget):
                    # uiType: QTableWidget
                    colCnt = ui_element.columnCount()
                    headerList = lang_data[ui_name].split(';')
                    cur_table.setHorizontalHeaderLabels( headerList )
                elif isinstance(ui_element, (str, unicode) ):
                    # uiType: string for msg
                    self.uiList[ui_name] = lang_data[ui_name] 
Example #28
Source File: universal_tool_template_0904.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def quickGrpUI(self, ui_name, ui_label, ui_layout):
        self.uiList[ui_name] = QtWidgets.QGroupBox(ui_label)
        if isinstance(ui_layout, QtWidgets.QLayout):
            self.uiList[ui_name].setLayout(ui_layout)
        elif isinstance(ui_layout, str):
            ui_layout = self.quickLayout(ui_name+"_layout", ui_layout)
            self.uiList[ui_name].setLayout(ui_layout)
        return [self.uiList[ui_name], ui_layout] 
Example #29
Source File: universal_tool_template_0904.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QGroupBox, QtWidgets.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name] 
Example #30
Source File: universal_tool_template_0904.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def __init__(self, parent=None, mode=0):
        super_class.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version="0.1"
        self.help = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file."
        
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        
        self.location = ""
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
            
        self.name = self.__class__.__name__
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)
        
        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txt': 'QTextEdit',
            'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem', 
        }
        self.qui_user_dict = {}
        #------------------------------