コード例 #1
0
    def __init__(self, parent=None):
        QFrame.__init__(self, parent)
        self.memBox = QGroupBox("Memory Usage", self)
        self.memBox.setFont(QFont("Helvetica", 10))

        self.memLayout = QVBoxLayout(self.memBox)
        #self.memLayout.setMargin( 15 )
        self.memLayout.setSpacing(5)

        o = Qt.Horizontal
        self.memLayout.addWidget(ValueBar(o, "Used", self.memBox, 57))
        self.memLayout.addWidget(ValueBar(o, "Shared", self.memBox, 17))
        self.memLayout.addWidget(ValueBar(o, "Cache", self.memBox, 30))
        self.memLayout.addWidget(ValueBar(o, "Buffers", self.memBox, 22))
        self.memLayout.addWidget(ValueBar(o, "Swap Used", self.memBox, 57))
        self.memLayout.addWidget(QWidget(self.memBox), 10)  # spacer

        self.cpuBox = QGroupBox("Cpu Usage", self)
        self.cpuBox.setFont(QFont("Helvetica", 10))

        self.cpuLayout = QHBoxLayout(self.cpuBox)
        #self.cpuLayout.setMargin( 15 )
        self.cpuLayout.setSpacing(5)

        o = Qt.Vertical
        self.cpuLayout.addWidget(ValueBar(o, "User", self.cpuBox, 57))
        self.cpuLayout.addWidget(ValueBar(o, "Total", self.cpuBox, 73))
        self.cpuLayout.addWidget(ValueBar(o, "System", self.cpuBox, 16))
        self.cpuLayout.addWidget(ValueBar(o, "Idle", self.cpuBox, 27))

        self.layout = QHBoxLayout(self)
        #self.layout.setMargin( 10 )
        self.layout.addWidget(self.memBox, 10)
        self.layout.addWidget(self.cpuBox, 0)
コード例 #2
0
 def initAppletDrawerUi(self):
     training_controls = EdgeTrainingGui.createDrawerControls(self)
     training_controls.layout().setContentsMargins(5,0,5,0)
     training_layout = QVBoxLayout()
     training_layout.addWidget( training_controls )
     training_layout.setContentsMargins(0,15,0,0)
     training_box = QGroupBox( "Training", parent=self )
     training_box.setLayout(training_layout)
     training_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
     
     multicut_controls = MulticutGuiMixin.createDrawerControls(self)
     multicut_controls.layout().setContentsMargins(5,0,5,0)
     multicut_layout = QVBoxLayout()
     multicut_layout.addWidget( multicut_controls )
     multicut_layout.setContentsMargins(0,15,0,0)
     multicut_box = QGroupBox( "Multicut", parent=self )
     multicut_box.setLayout(multicut_layout)
     multicut_box.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
     
     drawer_layout = QVBoxLayout()
     drawer_layout.addWidget(training_box)
     drawer_layout.addWidget(multicut_box)
     drawer_layout.setSpacing(2)
     drawer_layout.setContentsMargins(5,5,5,5)
     drawer_layout.addSpacerItem( QSpacerItem(0, 10, QSizePolicy.Minimum, QSizePolicy.Expanding) )
     
     self._drawer = QWidget(parent=self)
     self._drawer.setLayout(drawer_layout)        
コード例 #3
0
ファイル: history.py プロジェクト: koll00/Gui_SM
    def setup_page(self):
        settings_group = QGroupBox(_("Settings"))
        hist_spin = self.create_spinbox(
                            _("History depth: "), _(" entries"),
                            'max_entries', min_=10, max_=10000, step=10,
                            tip=_("Set maximum line count"))

        sourcecode_group = QGroupBox(_("Source code"))
        wrap_mode_box = self.create_checkbox(_("Wrap lines"), 'wrap')
        go_to_eof_box = self.create_checkbox(
                        _("Scroll automatically to last entry"), 'go_to_eof')
        font_group = self.create_fontgroup(option=None,
                                    text=_("Font style"),
                                    fontfilters=QFontComboBox.MonospacedFonts)
        names = CONF.get('color_schemes', 'names')
        choices = zip(names, names)
        cs_combo = self.create_combobox(_("Syntax color scheme: "),
                                        choices, 'color_scheme_name')

        settings_layout = QVBoxLayout()
        settings_layout.addWidget(hist_spin)
        settings_group.setLayout(settings_layout)

        sourcecode_layout = QVBoxLayout()
        sourcecode_layout.addWidget(wrap_mode_box)
        sourcecode_layout.addWidget(go_to_eof_box)
        sourcecode_layout.addWidget(cs_combo)
        sourcecode_group.setLayout(sourcecode_layout)
        
        vlayout = QVBoxLayout()
        vlayout.addWidget(settings_group)
        vlayout.addWidget(font_group)
        vlayout.addWidget(sourcecode_group)
        vlayout.addStretch(1)
        self.setLayout(vlayout)
コード例 #4
0
    def init_view(self):

        # initializing groups and layouts
        button_group = QGroupBox('Edit')
        button_layout = QVBoxLayout()
        robot_group = QGroupBox('Robots')
        robot_layout = QVBoxLayout()
        ball_group = QGroupBox('Ball')
        ball_layout = QVBoxLayout()
        
        # robot buttons to group
        robot_layout.addWidget(self.yellow_btn)
        robot_layout.addWidget(self.blue_btn)
        robot_layout.addStretch(1)
        robot_group.setLayout(robot_layout)

        # ball button to group
        ball_layout.addWidget(self.ball_btn)
        ball_layout.addStretch(1)
        ball_group.setLayout(ball_layout)

        # layout for button groups
        button_layout.addWidget(robot_group)
        button_layout.addWidget(ball_group)
        button_layout.addStretch(1)
        button_group.setLayout(button_layout)
        return button_group
コード例 #5
0
    def setup_ui(self):
        # json file selector
        self.json_groupbox = QGroupBox("Export ODK Aggregate")
        layout = QGridLayout()
        self.json_select_button = PushButton("", self)
        self.json_select_button.clicked.connect(self.json_selector_clicked)
        layout.addWidget(self.json_select_button, 1, 0)
        self.json_groupbox.setLayout(layout)

        # destination folder selector
        self.destination_groupbox = QGroupBox("Destination")
        layout = QGridLayout()
        self.destination_select_button = PushButton(self.destination_folder,
                                                    self)
        self.destination_select_button.clicked.connect(
            self.destination_selector_clicked)
        layout.addWidget(self.destination_select_button, 1, 0)
        self.destination_groupbox.setLayout(layout)

        # period calendars
        today = datetime.date.today()
        self.period_groupbox = QGroupBox("Période")
        layout = QGridLayout()
        self.from_date_selector = DateTimeEdit(QDate(self.from_date))
        self.from_date_selector.dateChanged.connect(self.from_date_changed)
        self.from_date_selector.setMaximumDate(self.to_date)
        self.to_date_selector = DateTimeEdit(QDate(self.to_date))
        self.to_date_selector.dateChanged.connect(self.to_date_changed)
        self.to_date_selector.setMinimumDate(self.from_date)
        self.to_date_selector.setMaximumDate(today)
        layout.addWidget(Label("Du"), 2, 0)
        layout.addWidget(self.from_date_selector, 3, 0)
        layout.addWidget(Label("Au"), 2, 1)
        layout.addWidget(self.to_date_selector, 3, 1)
        self.period_groupbox.setLayout(layout)

        # start button
        self.start_button = PushButton("Démarrer")
        self.start_button.setEnabled(False)
        self.start_button.setDefault(True)
        self.start_button.clicked.connect(self.export_requested)

        # cancel button
        self.cancel_button = CancelPushButton("Annuler")
        self.cancel_button.setEnabled(False)
        self.cancel_button.clicked.connect(self.cancel_export)

        # grid
        self.gridBox = QGridLayout()
        self.gridBox.addWidget(self.json_groupbox, 0, 0, 1, 2)
        self.gridBox.addWidget(self.destination_groupbox, 1, 0, 1, 2)
        self.gridBox.addWidget(self.period_groupbox, 2, 0, 1, 2)
        self.gridBox.addWidget(self.start_button, 3, 0)
        self.gridBox.addWidget(self.cancel_button, 3, 1)

        vBox = QVBoxLayout()
        vBox.addLayout(self.gridBox)
        self.setLayout(vBox)

        self.json_fpath = None
コード例 #6
0
    def __init__(self, mainwindow, result_manager):
        QWidget.__init__(self, mainwindow)
        #mainwindow is an OpusGui
        self.mainwindow = mainwindow
        self.result_manager = result_manager
        self.toolboxBase = self.result_manager.mainwindow.toolboxBase

        self.inGui = False
        self.logFileKey = 0

        self.xml_helper = ResultsManagerXMLHelper(toolboxBase=self.toolboxBase)
        self.result_generator = OpusResultGenerator(
            toolboxBase=self.toolboxBase)

        self.result_generator.guiElement = self

        self.tabIcon = QIcon(':/Images/Images/cog.png')
        self.tabLabel = 'Advanced Visualization'

        self.widgetLayout = QVBoxLayout(self)
        self.widgetLayout.setAlignment(Qt.AlignTop)

        self.resultsGroupBox = QGroupBox(self)
        self.widgetLayout.addWidget(self.resultsGroupBox)

        self.dataGroupBox = QGroupBox(self)
        self.widgetLayout.addWidget(self.dataGroupBox)

        self.optionsGroupBox = QGroupBox(self)
        self.widgetLayout.addWidget(self.optionsGroupBox)

        self._setup_definition_widget()

        self._setup_buttons()
        self._setup_tabs()
コード例 #7
0
    def __init__(self, parent):
        super(EditorCompletion, self).__init__()
        vbox = QVBoxLayout(self)

        groupBoxClose = QGroupBox(translations.TR_PREF_EDITOR_COMPLETE)
        formClose = QGridLayout(groupBoxClose)
        formClose.setContentsMargins(5, 15, 5, 5)
        self._checkParentheses = QCheckBox(
            translations.TR_PREF_EDITOR_PARENTHESES + " ()")
        self._checkParentheses.setChecked('(' in settings.BRACES)
        self._checkKeys = QCheckBox(translations.TR_PREF_EDITOR_KEYS + " {}")
        self._checkKeys.setChecked('{' in settings.BRACES)
        self._checkBrackets = QCheckBox(translations.TR_PREF_EDITOR_BRACKETS +
                                        " []")
        self._checkBrackets.setChecked('[' in settings.BRACES)
        self._checkSimpleQuotes = QCheckBox(
            translations.TR_PREF_EDITOR_SIMPLE_QUOTES)
        self._checkSimpleQuotes.setChecked("'" in settings.QUOTES)
        self._checkDoubleQuotes = QCheckBox(
            translations.TR_PREF_EDITOR_DOUBLE_QUOTES)
        self._checkDoubleQuotes.setChecked('"' in settings.QUOTES)
        self._checkCompleteDeclarations = QCheckBox(
            translations.TR_PREF_EDITOR_COMPLETE_DECLARATIONS.format(
                resources.get_shortcut("Complete-Declarations").toString(
                    QKeySequence.NativeText)))
        self._checkCompleteDeclarations.setChecked(
            settings.COMPLETE_DECLARATIONS)
        formClose.addWidget(self._checkParentheses,
                            1,
                            1,
                            alignment=Qt.AlignTop)
        formClose.addWidget(self._checkKeys, 1, 2, alignment=Qt.AlignTop)
        formClose.addWidget(self._checkBrackets, 2, 1, alignment=Qt.AlignTop)
        formClose.addWidget(self._checkSimpleQuotes,
                            2,
                            2,
                            alignment=Qt.AlignTop)
        formClose.addWidget(self._checkDoubleQuotes,
                            3,
                            1,
                            alignment=Qt.AlignTop)
        vbox.addWidget(groupBoxClose)

        groupBoxCode = QGroupBox(translations.TR_PREF_EDITOR_CODE_COMPLETION)
        formCode = QGridLayout(groupBoxCode)
        formCode.setContentsMargins(5, 15, 5, 5)
        self._checkCodeDot = QCheckBox(
            translations.TR_PREF_EDITOR_ACTIVATE_COMPLETION)
        self._checkCodeDot.setChecked(settings.CODE_COMPLETION)
        formCode.addWidget(self._checkCompleteDeclarations,
                           5,
                           1,
                           alignment=Qt.AlignTop)

        formCode.addWidget(self._checkCodeDot, 6, 1, alignment=Qt.AlignTop)
        vbox.addWidget(groupBoxCode)
        vbox.addItem(
            QSpacerItem(0, 10, QSizePolicy.Expanding, QSizePolicy.Expanding))
コード例 #8
0
    def createWidgets(self):
        """
        QtWidgets creation
        """
        self.dockToolbar = QToolBar(self)
        self.dockToolbar.setStyleSheet(
            "QToolBar { border: 0px }")  # remove 3D border
        self.dockToolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)

        self.dockToolbarClipboard = QToolBar(self)
        self.dockToolbarClipboard.setStyleSheet(
            "QToolBar { border: 0px }")  # remove 3D border
        self.dockToolbarClipboard.setToolButtonStyle(
            Qt.ToolButtonTextUnderIcon)

        self.clipBox = QGroupBox("Clipboard")
        self.clipBox.setStyleSheet("""
                                           QGroupBox { font: normal; border: 1px solid silver; border-radius: 2px; } 
                                           QGroupBox { padding-bottom: 10px; background-color: #FAFAFA; } 
                                           QGroupBox::title { subcontrol-position: bottom center;}
                                       """)
        layoutClipBox = QHBoxLayout()
        layoutClipBox.addWidget(self.dockToolbarClipboard)
        layoutClipBox.setContentsMargins(0, 0, 0, 0)
        self.clipBox.setLayout(layoutClipBox)

        self.paramsBox = QGroupBox("Parameters")
        self.paramsBox.setStyleSheet("""
                                           QGroupBox { font: normal; border: 1px solid silver; border-radius: 2px; } 
                                           QGroupBox { padding-bottom: 10px; background-color: #FAFAFA; } 
                                           QGroupBox::title { subcontrol-position: bottom center;}
                                       """)
        layoutParamBox = QHBoxLayout()
        layoutParamBox.addWidget(self.dockToolbar)
        layoutParamBox.setContentsMargins(0, 0, 0, 0)
        self.paramsBox.setLayout(layoutParamBox)

        layoutToolbars = QHBoxLayout()
        layoutToolbars.addWidget(self.paramsBox)
        layoutToolbars.addWidget(self.clipBox)
        layoutToolbars.addStretch(1)
        layoutToolbars.setContentsMargins(5, 0, 0, 0)

        title = QLabel("Test Config:")
        title.setStyleSheet("QLabel { padding-left: 2px; padding-top: 2px }")
        font = QFont()
        font.setBold(True)
        title.setFont(font)

        layout = QVBoxLayout()
        layout.addWidget(title)
        layout.addLayout(layoutToolbars)
        layout.addWidget(self.tc)
        layout.setContentsMargins(0, 0, 0, 0)

        self.setLayout(layout)
コード例 #9
0
ファイル: Config.py プロジェクト: TibbersBear/openfisca
    def setup_page(self):

        dirs_group = QGroupBox(u"Répertoires de sauvegarde")
        cas_type_dir = self.create_browsedir(u'Cas types', 'cas_type_dir')
        reformes_dir = self.create_browsedir(u'Réformes', 'reformes_dir')
        calib_dir = self.create_browsedir(u'Calages', 'calib_dir')
        data_dir = self.create_browsedir(u'Données internes', 'data_dir')

        survey_group = QGroupBox(u"Données d'enquête")
        survey_bg = QButtonGroup(self)
        survey_label = QLabel(
            u"Emplacement des données d'enquête pour la microsimulation")

        bareme_only_radio = self.create_radiobutton(u"Mode barème uniquement",
                                                    'survey_data/bareme_only',
                                                    False,
                                                    u"Mode barème uniquement",
                                                    button_group=survey_bg)
        survey_radio = self.create_radiobutton(
            "le fichier suivant",
            'survey_data/survey_enabled',
            True,
            "Fichier de données pour la microsimulation",
            button_group=survey_bg)
        survey_file = self.create_browsefile("",
                                             'survey_data/file',
                                             filters='*.csv')
        self.connect(bareme_only_radio, SIGNAL("toggled(bool)"),
                     survey_file.setDisabled)
        self.connect(survey_radio, SIGNAL("toggled(bool)"),
                     survey_file.setEnabled)
        survey_file_layout = QHBoxLayout()
        survey_file_layout.addWidget(survey_radio)
        survey_file_layout.addWidget(survey_file)

        survey_layout = QVBoxLayout()
        survey_layout.addWidget(survey_label)
        survey_layout.addWidget(bareme_only_radio)
        survey_layout.addLayout(survey_file_layout)
        survey_group.setLayout(survey_layout)

        dirs_layout = QVBoxLayout()
        dirs_layout.addWidget(cas_type_dir)
        dirs_layout.addWidget(reformes_dir)
        dirs_layout.addWidget(calib_dir)
        dirs_group.setLayout(dirs_layout)

        paths_layout = QVBoxLayout()
        paths_layout.addWidget(dirs_group)
        paths_layout.addWidget(survey_group)
        paths_layout.addWidget(data_dir)

        paths_layout.addStretch(1)
        self.setLayout(paths_layout)
コード例 #10
0
    def __init__(self, scheme, parent):
        super(EditorSchemeDesigner, self).__init__(parent, Qt.Dialog)
        self.original_style = copy.copy(resources.CUSTOM_SCHEME)
        self._avoid_on_loading, self.saved, self._components = True, False, {}
        self.setWindowTitle(translations.TR_PREFERENCES_EDITOR_SCHEME_DESIGNER)
        self.setMinimumSize(450, 480)
        self.setMaximumSize(500, 900)
        self.resize(450, 600)

        # all layouts and groupboxes
        group0 = QGroupBox(translations.TR_PROJECT_NAME)  # scheme filename
        group1 = QGroupBox(translations.TR_PROJECT_PROPERTIES)  # properties
        group2 = QGroupBox(translations.TR_PREVIEW)  # quick preview thingy
        group0_hbox, group1_vbox = QHBoxLayout(group0), QVBoxLayout(group1)
        this_dialog_vbox, group2_vbox = QVBoxLayout(self), QVBoxLayout(group2)
        self._grid, scrollArea, frame = QGridLayout(), QScrollArea(), QFrame()

        # widgets
        self.line_name, btnSave = QLineEdit(), QPushButton(
            translations.TR_SAVE)
        self.line_name.setPlaceholderText(getuser().capitalize() + "s_scheme")
        group0_hbox.addWidget(self.line_name)
        group0_hbox.addWidget(btnSave)
        self.connect(btnSave, SIGNAL("clicked()"), self.save_scheme)
        _demo = "<center>" + ascii_letters  # demo text for preview
        self.preview_label1, self.preview_label2 = QLabel(_demo), QLabel(_demo)
        group2_vbox.addWidget(self.preview_label1)
        group2_vbox.addWidget(self.preview_label2)

        # rows titles
        self._grid.addWidget(QLabel("<b>" + translations.TR_PROJECT_NAME), 0,
                             0)
        self._grid.addWidget(QLabel("<b>" + translations.TR_CODE), 0, 1)
        self._grid.addWidget(
            QLabel("<b>" + translations.TR_EDITOR_SCHEME_PICK_COLOR), 0, 2)

        # fill rows
        for key in sorted(tuple(resources.COLOR_SCHEME.keys())):
            self.add_item(key, scheme)
        self.preview_label1.setStyleSheet('background:transparent')
        self.preview_label2.setStyleSheet('color:     transparent')

        # fill the scroll area
        frame.setLayout(self._grid)
        scrollArea.setWidget(frame)
        group1_vbox.addWidget(scrollArea)

        # put groups on the dialog
        this_dialog_vbox.addWidget(group1)
        this_dialog_vbox.addWidget(group2)
        this_dialog_vbox.addWidget(group0)
        self._avoid_on_loading = self._modified = False
コード例 #11
0
            def __init__(self, source_stage_index, num_stages, *args,
                         **kwargs):
                super(LabelDistributionOptionsDlg,
                      self).__init__(*args, **kwargs)

                from PyQt4.QtCore import Qt
                from PyQt4.QtGui import QGroupBox, QCheckBox, QRadioButton, QDialogButtonBox

                self.setWindowTitle(
                    "Distributing from Stage {}".format(source_stage_index +
                                                        1))

                self.stage_checkboxes = []
                for stage_index in range(1, num_stages + 1):
                    self.stage_checkboxes.append(
                        QCheckBox("Stage {}".format(stage_index)))

                # By default, send labels back into the current stage, at least.
                self.stage_checkboxes[source_stage_index].setChecked(True)

                stage_selection_layout = QVBoxLayout()
                for checkbox in self.stage_checkboxes:
                    stage_selection_layout.addWidget(checkbox)

                stage_selection_groupbox = QGroupBox(
                    "Send labels from Stage {} to:".format(source_stage_index +
                                                           1), self)
                stage_selection_groupbox.setLayout(stage_selection_layout)

                self.copy_button = QRadioButton("Copy", self)
                self.partition_button = QRadioButton("Partition", self)
                self.partition_button.setChecked(True)
                distribution_mode_layout = QVBoxLayout()
                distribution_mode_layout.addWidget(self.copy_button)
                distribution_mode_layout.addWidget(self.partition_button)

                distribution_mode_group = QGroupBox("Distribution Mode", self)
                distribution_mode_group.setLayout(distribution_mode_layout)

                buttonbox = QDialogButtonBox(Qt.Horizontal, parent=self)
                buttonbox.setStandardButtons(QDialogButtonBox.Ok
                                             | QDialogButtonBox.Cancel)
                buttonbox.accepted.connect(self.accept)
                buttonbox.rejected.connect(self.reject)

                dlg_layout = QVBoxLayout()
                dlg_layout.addWidget(stage_selection_groupbox)
                dlg_layout.addWidget(distribution_mode_group)
                dlg_layout.addWidget(buttonbox)
                self.setLayout(dlg_layout)
コード例 #12
0
ファイル: PluginWidget.py プロジェクト: yiqideren/freeseer
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        self.pluginMetadata = {}

        # Main layout
        self.mainLayout = QVBoxLayout()
        self.setLayout(self.mainLayout)

        # Define size used for the underlines
        self.underlineSize = QSize()
        self.underlineSize.setHeight(1)

        # Define font used for headers
        self.font = QFont()
        self.font.setPointSize(11)
        self.font.setBold(True)
        self.font.setUnderline(True)

        # Plugins Description
        self.pluginDescription = QLabel()
        self.pluginDescription.setText(
            "Click a plugin to see more information." +
            " Plugins can be configured from the Recording tab. \n")
        self.pluginDescription.setWordWrap(True)

        # Plugins GroupBox
        self.pluginLayout = QVBoxLayout()
        self.pluginGroupBox = QGroupBox(
            "Plugins extend the functionality of Freeseer")
        self.pluginGroupBox.setLayout(self.pluginLayout)
        self.pluginLayout.insertWidget(0, self.pluginDescription)
        self.mainLayout.insertWidget(0, self.pluginGroupBox)

        # Plugins list
        self.list = QTreeWidget()
        self.list.setHeaderHidden(True)
        self.list.headerItem().setText(0, "1")
        self.pluginLayout.insertWidget(1, self.list)

        # Details
        self.detailPane = QGroupBox()
        self.detailLayout = QVBoxLayout()
        self.detailPane.setLayout(self.detailLayout)
        self.detailPaneDesc = QLabel()
        self.detailPaneDesc.setWordWrap(True)
        self.detailLayout.addWidget(self.detailPaneDesc)
        self.pluginLayout.insertWidget(2, self.detailPane)

        self.list.itemSelectionChanged.connect(self.treeViewSelect)
コード例 #13
0
    def __getProfileLimitsGroupbox(self):
        " Creates the profile limits groupbox "
        limitsGroupbox = QGroupBox(self)
        limitsGroupbox.setTitle("Profiler diagram limits")
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            limitsGroupbox.sizePolicy().hasHeightForWidth())
        limitsGroupbox.setSizePolicy(sizePolicy)

        layoutLimits = QGridLayout(limitsGroupbox)
        self.__nodeLimitEdit = QLineEdit()
        self.__nodeLimitEdit.textEdited.connect(self.__setRunButtonProps)
        self.__nodeLimitValidator = QDoubleValidator(0.0, 100.0, 2, self)
        self.__nodeLimitValidator.setNotation(
            QDoubleValidator.StandardNotation)
        self.__nodeLimitEdit.setValidator(self.__nodeLimitValidator)
        nodeLimitLabel = QLabel("Hide nodes below")
        self.__edgeLimitEdit = QLineEdit()
        self.__edgeLimitEdit.textEdited.connect(self.__setRunButtonProps)
        self.__edgeLimitValidator = QDoubleValidator(0.0, 100.0, 2, self)
        self.__edgeLimitValidator.setNotation(
            QDoubleValidator.StandardNotation)
        self.__edgeLimitEdit.setValidator(self.__edgeLimitValidator)
        edgeLimitLabel = QLabel("Hide edges below")
        layoutLimits.addWidget(nodeLimitLabel, 0, 0)
        layoutLimits.addWidget(self.__nodeLimitEdit, 0, 1)
        layoutLimits.addWidget(QLabel("%"), 0, 2)
        layoutLimits.addWidget(edgeLimitLabel, 1, 0)
        layoutLimits.addWidget(self.__edgeLimitEdit, 1, 1)
        layoutLimits.addWidget(QLabel("%"), 1, 2)
        return limitsGroupbox
コード例 #14
0
 def _create(self, base_frame):
     self.sliders = []
     self.spinboxes = []
     for i in range(len(self.dim_labels)):
         self.sliders.append(QSlider(QtCore.Qt.Horizontal))
         self.sliders[i].setRange(0, self.n_slider_steps[i])
         self.sliders[i].valueChanged.connect(
             partial(self._on_slide, i))
         spinbox = QDoubleSpinBox()
         spinbox.setRange(*self.limits[i])
         spinbox.setDecimals(3)
         spinbox.setSingleStep(0.001)
         self.spinboxes.append(spinbox)
         self.spinboxes[i].valueChanged.connect(
             partial(self._on_pos_edited, i))
     slider_group = QGridLayout()
     slider_group.addWidget(QLabel("Position"),
                            0, 0, 1, 3, QtCore.Qt.AlignCenter)
     slider_group.addWidget(QLabel("Orientation (Euler angles)"),
                            0, 3, 1, 3, QtCore.Qt.AlignCenter)
     for i, slider in enumerate(self.sliders):
         slider_group.addWidget(QLabel(self.dim_labels[i]), 1, i)
         slider_group.addWidget(slider, 2, i)
         slider_group.addWidget(self.spinboxes[i], 3, i)
     slider_groupbox = QGroupBox("Transformation in frame '%s'"
                                 % base_frame)
     slider_groupbox.setLayout(slider_group)
     layout = QHBoxLayout()
     layout.addWidget(slider_groupbox)
     layout.addStretch(1)
     return layout
コード例 #15
0
ファイル: wizards.py プロジェクト: FjTorrejon/eyegrade
 def _initialize(self):
     ## self.paramTPerm = self.field("paramTPerm")
     self.tabs.clear()
     self.total_answers = 0
     self.radioGroups = {}
     filas = int(self.paramNPerm.toString())
     for x in range(filas):
         mygroupbox = QScrollArea()
         mygroupbox.setWidget(QWidget())
         mygroupbox.setWidgetResizable(True)
         myform = QHBoxLayout(mygroupbox.widget())
         cols = self.paramNCols.toString().split(',')
         ansID = 0
         radioGroupList = {}
         for col in cols:
             mygroupboxCol = QGroupBox()
             myformCol = QFormLayout()
             mygroupboxCol.setLayout(myformCol)
             for y in range(int(col)):
                 ansID += 1
                 radioGroupList[ansID] = QButtonGroup()
                 layoutRow = QHBoxLayout()
                 for j in range(int(self.paramNAlts.toString())):
                     myradio = QRadioButton(chr(97 + j).upper())
                     layoutRow.addWidget(myradio)
                     radioGroupList[ansID].addButton(myradio)
                 self.total_answers += 1
                 myformCol.addRow(str(ansID), layoutRow)
             myform.addWidget(mygroupboxCol)
         self.radioGroups[chr(97 + x).upper()] = radioGroupList
         self.tabs.addTab(mygroupbox, _('Model ') + chr(97 + x).upper())
コード例 #16
0
ファイル: autowizard.py プロジェクト: vertrex/DFF
    def __init__(self, parent=None):
        QWizardPage.__init__(self, parent)
        self.parent = parent
        self.setTitle(self.tr("Add dumps"))

        label = QLabel(
            self.
            tr("What do you want to analyse? "
               "The first step is to choose some dumps for analysis. "
               "You could load a local file, a dump or choose to mount connected devices"
               ))
        label.setWordWrap(True)
        layout = QGridLayout()
        layout.addWidget(label, 0, 0)

        groupBox = QGroupBox(self.tr("Dumps"))
        self.localFilesRadioButton = QRadioButton(self.tr("Add a local file"))
        self.deviceRadioButton = QRadioButton(self.tr("Add a device"))
        self.localFilesRadioButton.setChecked(True)
        groupBoxLayout = QVBoxLayout()
        groupBoxLayout.addWidget(self.localFilesRadioButton)
        groupBoxLayout.addWidget(self.deviceRadioButton)
        groupBox.setLayout(groupBoxLayout)
        layout.addWidget(groupBox, 1, 0)
        self.setLayout(layout)
コード例 #17
0
    def createWidgetGetAsk(self):
        """
        Create ask widget
        """
        # ask
        self.getAskGroup = QGroupBox(self.tr(""))

        self.askTextLine = QLineEdit(self)
        self.askTextLine.setMinimumWidth(300)
        self.askTextCombo = QComboBox(self)
        self.askTextCombo.addItems( LIST_TYPES )

        self.askTextCacheLine = QLineEdit(self)
        self.askTextCacheLine.setMinimumWidth(300)
        self.askTextCacheCombo = QComboBox(self)
        self.askTextCacheCombo.addItems( [ "CACHE" ] )
        
        mainAsklayout = QGridLayout()
        mainAsklayout.addWidget(  QLabel( self.tr("User input prompt:") ), 0, 0 )
        mainAsklayout.addWidget(  self.askTextCombo, 0, 1 )
        mainAsklayout.addWidget(  self.askTextLine, 0, 2 )
        mainAsklayout.addWidget(  QLabel( self.tr("And save response in:") ), 1, 0 )
        mainAsklayout.addWidget(  self.askTextCacheCombo, 1, 1 )
        mainAsklayout.addWidget(  self.askTextCacheLine, 1, 2 )
        
        self.getAskGroup.setLayout(mainAsklayout)
        self.getAskGroup.hide()
コード例 #18
0
ファイル: goto.py プロジェクト: palaniyappanBala/dff
    def createGoto(self):
        self.offbox = QGroupBox("Go to location")
        self.offgrid = QGridLayout()

        #Format
        formatlabel = QLabel("Format :")
        self.format = QComboBox()
        self.format.addItem("Hexadecimal")
        self.format.addItem("Decimal")
        #Type: Offset, Page, Block
        typelabel = QLabel("Type :")
        self.type = QComboBox()
        self.type.addItem("Offset")
        self.type.addItem("Page")
        self.type.addItem("Block")
        #Place
        offsetlabel = QLabel("Place :")
        self.offset = QLineEdit()

        self.offgrid.addWidget(formatlabel, 0, 0)
        self.offgrid.addWidget(self.format, 0, 1)

        self.offgrid.addWidget(typelabel, 1, 0)
        self.offgrid.addWidget(self.type, 1, 1)

        self.offgrid.addWidget(offsetlabel, 2, 0)
        self.offgrid.addWidget(self.offset, 2, 1)

        #        self.offgrid.addWidget(self.gobutton, 6, 0)

        self.offbox.setLayout(self.offgrid)
        self.vbox.addWidget(self.offbox)
コード例 #19
0
ファイル: menu.py プロジェクト: ma-tech/Interface_PyImagePlot
 def initUI(self):
     # title
     title = QLabel(self)
     title.setText("User Instruction")
     title.setAlignment(Qt.AlignCenter)
     # user instruction
     groupBox = QGroupBox()
     text = QLabel(self)
     text.setText("Create image montages and histograms from the interface:\nChoose option No. 1 to 5 on main interface.\nClick Enter to select the paths for input and output locations.\nEnjoy using the interface!")
     self.setStyleSheet("QLabel { color: #8B4513; font-size: 16px;font-family: cursive, sans-serif;}")    
     title.setStyleSheet("QLabel { color: #8B4513; font-weight: 600;}")
     # set layout
     sbox = QVBoxLayout(self)
     sbox.addWidget(text)
     groupBox.setLayout(sbox) 
     vBoxLayout = QVBoxLayout()
     vBoxLayout.addSpacing(15)
     vBoxLayout.addWidget(title)
     vBoxLayout.addWidget(groupBox)
     vBoxLayout.addSpacing(15)
     self.setLayout(vBoxLayout)
     # set background as transparent
     palette	= QPalette()
     palette.setBrush(QPalette.Background,QBrush(QPixmap()))
     self.setPalette(palette)
コード例 #20
0
    def createWidgetElement(self):
        """
        Create text widget
        """
        self.elemenAndroidGroup = QGroupBox(self.tr(""))
        
        self.elementTextAndroidLine = QLineEdit(self)
        self.elementTextAndroidLine.setMinimumWidth(300)
        self.elementTextCombo = QComboBox(self)
        self.elementTextCombo.addItems( LIST_TYPES )
        
        self.elementDescriptionAndroidLine = QLineEdit(self)
        self.elementDescriptionAndroidLine.setMinimumWidth(300)
        self.elementClassAndroidLine = QLineEdit(self)
        self.elementClassAndroidLine.setMinimumWidth(300)
        self.elementRessourceIdAndroidLine = QLineEdit(self)
        self.elementRessourceIdAndroidLine.setMinimumWidth(300)
        self.elementPackageAndroidLine = QLineEdit(self)
        self.elementPackageAndroidLine.setMinimumWidth(300)

        # get  text end
        elementAndroidlayout = QGridLayout()
        elementAndroidlayout.addWidget( QLabel( self.tr("Text Element:") ) , 0,1)
        elementAndroidlayout.addWidget( self.elementTextCombo , 0, 2)
        elementAndroidlayout.addWidget( self.elementTextAndroidLine , 0, 3)
        elementAndroidlayout.addWidget( QLabel( self.tr("Description Element:") ) , 1,1)
        elementAndroidlayout.addWidget( self.elementDescriptionAndroidLine , 1, 3)
        elementAndroidlayout.addWidget( QLabel( self.tr("Class Name:") ) , 2,1)
        elementAndroidlayout.addWidget( self.elementClassAndroidLine , 2, 3)
        elementAndroidlayout.addWidget( QLabel( self.tr("Resource ID:") ) , 3,1)
        elementAndroidlayout.addWidget( self.elementRessourceIdAndroidLine , 3, 3)
        elementAndroidlayout.addWidget( QLabel( self.tr("Package Name:") ) , 4,1)
        elementAndroidlayout.addWidget( self.elementPackageAndroidLine , 4, 3)
        self.elemenAndroidGroup.setLayout(elementAndroidlayout)
        self.elemenAndroidGroup.hide()
コード例 #21
0
ファイル: Config.py プロジェクト: TibbersBear/openfisca
    def setup_page(self):
        simulation_group = QGroupBox("Simulation")
        sim_dateedit = self.create_dateedit("Date de la simulation",
                                            'datesim',
                                            min_date=QDate(2002, 01, 01),
                                            max_date=QDate(2010, 12, 31))
        nmen_spinbox = self.create_spinbox(u'Nombre de ménages',
                                           '',
                                           'nmen',
                                           min_=1,
                                           max_=10001,
                                           step=100)
        xaxis_choices = [(u'Salaires', 'sal'), (u'Chômage', 'cho'),
                         (u'Retraites', 'rst')]
        xaxis_combo = self.create_combobox('Axe des abscisses', xaxis_choices,
                                           'xaxis')
        maxrev_spinbox = self.create_spinbox("Revenu maximum",
                                             'euros',
                                             'maxrev',
                                             min_=0,
                                             max_=10000000,
                                             step=1000)

        simulation_layout = QVBoxLayout()
        simulation_layout.addWidget(sim_dateedit)
        simulation_layout.addWidget(nmen_spinbox)
        simulation_layout.addWidget(xaxis_combo)
        simulation_layout.addWidget(maxrev_spinbox)

        simulation_group.setLayout(simulation_layout)

        vlayout = QVBoxLayout()
        vlayout.addWidget(simulation_group)
        vlayout.addStretch(1)
        self.setLayout(vlayout)
コード例 #22
0
    def __getDebugGroupbox(self):
        " Creates the debug settings groupbox "
        dbgGroupbox = QGroupBox(self)
        dbgGroupbox.setTitle("Debugger")
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            dbgGroupbox.sizePolicy().hasHeightForWidth())
        dbgGroupbox.setSizePolicy(sizePolicy)

        dbgLayout = QVBoxLayout(dbgGroupbox)
        self.__reportExceptionCheckBox = QCheckBox("Report &exceptions")
        self.__reportExceptionCheckBox.stateChanged.connect(
            self.__onReportExceptionChanged)
        self.__traceInterpreterCheckBox = QCheckBox("T&race interpreter libs")
        self.__traceInterpreterCheckBox.stateChanged.connect(
            self.__onTraceInterpreterChanged)
        self.__stopAtFirstCheckBox = QCheckBox("Stop at first &line")
        self.__stopAtFirstCheckBox.stateChanged.connect(
            self.__onStopAtFirstChanged)
        self.__autoforkCheckBox = QCheckBox("&Fork without asking")
        self.__autoforkCheckBox.stateChanged.connect(self.__onAutoforkChanged)
        self.__debugChildCheckBox = QCheckBox("Debu&g child process")
        self.__debugChildCheckBox.stateChanged.connect(self.__onDebugChild)

        dbgLayout.addWidget(self.__reportExceptionCheckBox)
        dbgLayout.addWidget(self.__traceInterpreterCheckBox)
        dbgLayout.addWidget(self.__stopAtFirstCheckBox)
        dbgLayout.addWidget(self.__autoforkCheckBox)
        dbgLayout.addWidget(self.__debugChildCheckBox)
        return dbgGroupbox
コード例 #23
0
ファイル: Field.py プロジェクト: 1383385/DegenPrimerGUI
 def _build_field(self):
     #build option
     if self.option.is_compound:
         #make container
         container = QGroupBox(self.title, self.parent)
         container.setToolTip(self.option.formatted_desc)
         layout = QGridLayout(container)
         self._addRow(container, self.parent.layout())
         #make option
         if not self.option.is_poly or self.value_required or self.field is not None:
             field = dict((opt.name, Field(opt, container))
                          for opt in self.option.options)
             self._add_or_set('container', container)
             self._add_or_set('field', field)
         #add +/- buttons if poly-option
         if self.option.is_poly:
             new_row = layout.rowCount()
             if self.field is not None and len(self.field) > int(
                     self.value_required):
                 del_button = QPushButton('-', container)
                 del_button.setToolTip('Delete this %s' % self.title)
                 del_option_gui = trigger(self._del_instance,
                                          self.field[-1],
                                          self.container[-1])
                 del_button.clicked.connect(del_option_gui)
                 layout.addWidget(del_button, new_row, 0)
             add_button = QPushButton('+', container)
             add_button.setToolTip('Add another %s' % self.title)
             add_button.clicked.connect(self._add_instance)
             layout.addWidget(add_button, new_row, 1)
     else:
         field = self._make_simple_field(self.option, self.parent)
         self._add_or_set('field', field)
コード例 #24
0
    def create_ui_components(self):
        """
        Create layouts and qt controls.
        """
        self.layout = QGridLayout()

        self.kanjiGroup = QGroupBox()
        self.kanjiLayout = QGridLayout()

        # Kanji ui group
        self.day, self.week, self.month, self.year = \
        QLabel(KANJI), QLabel(KANJI), QLabel(KANJI), QLabel(KANJI)

        self.dayLabel, self.weekLabel, self.monthLabel, self.yearLabel = \
        QLabel('<b>Day</b>'), QLabel('<b>Week</b>'), \
        QLabel('<b>Month</b>'), QLabel('<b>Year</b>')

        # Main layout
        self.showAbout = QPushButton('A&bout')
        # DB controls (top)
        self.showDB, self.availableDB, self.changeDB = \
        QPushButton('&Change DB (active:)'), QComboBox(), QPushButton('&Remap')
        # General controls (bottom)
        self.getAll, self.showStats, self.quitApp, self.authGen, self.methodCombo = \
        QPushButton('&Get all'), QPushButton('&Stats'), QPushButton('&Quit'), \
        QPushButton('&Auth'), QComboBox()
        # Notifications
        self.progressBar = QProgressBar()
        self.statusMessage = QLabel()
        # About
        self.aboutBox = QMessageBox()
コード例 #25
0
    def activationGroupBox(self):
        self.topLeftGroupBoxBtt = QGroupBox(self.tr("Nouvelle license"))
        self.setWindowTitle(u"License")
        self.parentWidget().setWindowTitle(u"Activation de la license")

        self.code_field = PyTextViewer(
            u"""Vous avez besoin du code ci desous
                                           pour l'activation:<hr> <b>{code}</b><hr>
                                           <h4>Contacts:</h4>{contact}""".
            format(code=SettingsAdmin().select().get().clean_mac,
                   contact=Constants.TEL_AUT))
        self.name_field = LineEdit()
        self.license_field = QTextEdit()
        self.pixmap = QPixmap("")
        self.image = FLabel(self)
        self.image.setPixmap(self.pixmap)

        butt = Button_save(u"Enregistrer")
        butt.clicked.connect(self.add_lience)

        editbox = QGridLayout()
        editbox.addWidget(FLabel(u"Nom: "), 0, 0)
        editbox.addWidget(self.name_field, 0, 1)
        editbox.addWidget(FLabel(u"License: "), 1, 0)
        editbox.addWidget(self.license_field, 1, 1)
        editbox.addWidget(self.code_field, 1, 2)
        editbox.addWidget(self.image, 5, 1)
        editbox.addWidget(butt, 6, 1)

        self.topLeftGroupBoxBtt.setLayout(editbox)
コード例 #26
0
    def __getTermGroupbox(self):
        " Creates the term groupbox "
        termGroupbox = QGroupBox(self)
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            termGroupbox.sizePolicy().hasHeightForWidth())
        termGroupbox.setSizePolicy(sizePolicy)

        layoutTerm = QVBoxLayout(termGroupbox)
        self.__redirectRButton = QRadioButton(termGroupbox)
        self.__redirectRButton.setText("&Redirect to IDE")
        self.__redirectRButton.toggled.connect(self.__redirectedChanged)
        layoutTerm.addWidget(self.__redirectRButton)
        self.__autoRButton = QRadioButton(termGroupbox)
        self.__autoRButton.setText("Aut&o detection")
        layoutTerm.addWidget(self.__autoRButton)
        self.__konsoleRButton = QRadioButton(termGroupbox)
        self.__konsoleRButton.setText("Default &KDE konsole")
        layoutTerm.addWidget(self.__konsoleRButton)
        self.__gnomeRButton = QRadioButton(termGroupbox)
        self.__gnomeRButton.setText("gnome-&terminal")
        layoutTerm.addWidget(self.__gnomeRButton)
        self.__xtermRButton = QRadioButton(termGroupbox)
        self.__xtermRButton.setText("&xterm")
        layoutTerm.addWidget(self.__xtermRButton)
        return termGroupbox
コード例 #27
0
ファイル: BoxTemperature.py プロジェクト: LEDS/Lifebox
    def settings(self, parent):
        # CRIANDO O GRUPOBOXTEMPS PARA POR OS LABELS E LCD'S
        self.groupBoxTemps = QGroupBox(parent)

        # CRIANDO O LABEL PARA INFORMAR O QUE O LCD ESTÁ MOSTRANDO
        self.lbTemp1 = QLabel(self.groupBoxTemps)
        self.lbTemp1.setGeometry(QRect(70, 10, 127, 10))
        self.lbTemp1.setMaximumSize(QSize(16777215, 10))
        self.lbTemp1.setText("Termometro 1")
        self.lbTemp1.setAlignment(Qt.AlignCenter)

        # CRIANDO O LABEL PARA INFORMAR O QUE O LCD ESTÁ MOSTRANDO
        self.lbTemp2 = QLabel(self.groupBoxTemps)
        self.lbTemp2.setGeometry(QRect(330, 10, 130, 10))
        self.lbTemp2.setMaximumSize(QSize(16777215, 10))
        self.lbTemp2.setText("Termometro 2")
        self.lbTemp2.setAlignment(Qt.AlignCenter)

        # CRIANDO O LCD PARA INFORMAR A TEMPERATURA DO TERMOMETRO 1
        self.lcdTemp1 = QLCDNumber(self.groupBoxTemps)
        self.lcdTemp1.setGeometry(QRect(30, 30, 211, 71))
        self.lcdTemp1.display("00.00")
        self.lcdTemp1.setDigitCount(6)

        # CRIANDO O LCD PARA INFORMAR A TEMPERATURA DO TERMOMETRO 2
        self.lcdTemp2 = QLCDNumber(self.groupBoxTemps)
        self.lcdTemp2.setGeometry(QRect(290, 30, 211, 71))
        self.lcdTemp2.display("00.00")
        self.lcdTemp2.setDigitCount(6)

        # COLOCANDO LAYOUT NO GRUPOBOXTEMPS
        self.addWidget(self.groupBoxTemps)
コード例 #28
0
    def createWidgetEndXY(self):
        """
        Create widget 
        """
        self.endXyAndroidGroup = QGroupBox(self.tr(""))
        endXyAndroidlayout = QGridLayout()

        self.endxAndroidLine = QLineEdit(self)
        validatorEndXAndroid = QIntValidator(self)
        self.endxAndroidLine.setValidator(validatorEndXAndroid)
        self.endxAndroidLine.installEventFilter(self)

        self.endyAndroidLine = QLineEdit(self)
        validatorEndYAndroid = QIntValidator(self)
        self.endyAndroidLine.setValidator(validatorEndYAndroid)
        self.endyAndroidLine.installEventFilter(self)

        endXyAndroidlayout.addWidget(
            QLabel(self.tr("Destination Coordinate X:")), 0, 0)
        endXyAndroidlayout.addWidget(self.endxAndroidLine, 0, 1)
        endXyAndroidlayout.addWidget(
            QLabel(self.tr("Destination Coordinate Y:")), 1, 0)
        endXyAndroidlayout.addWidget(self.endyAndroidLine, 1, 1)

        self.endXyAndroidGroup.setLayout(endXyAndroidlayout)
        self.endXyAndroidGroup.hide()
コード例 #29
0
    def __getIDEWideGroupbox(self):
        " Creates the IDE wide groupbox "
        ideGroupbox = QGroupBox(self)
        ideGroupbox.setTitle("IDE Wide Settings")
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            ideGroupbox.sizePolicy().hasHeightForWidth())
        ideGroupbox.setSizePolicy(sizePolicy)

        layoutIDE = QHBoxLayout(ideGroupbox)

        termGroupbox = self.__getTermGroupbox()
        termGroupbox.setTitle("Terminal to run in")
        layoutIDE.addWidget(termGroupbox)

        if self.__action == "profile":
            # Profile version of the dialog
            limitsGroupbox = self.__getProfileLimitsGroupbox()
            layoutIDE.addWidget(limitsGroupbox)
        else:
            # Debug version of the dialog
            dbgGroupbox = self.__getDebugGroupbox()
            layoutIDE.addWidget(dbgGroupbox)
        return ideGroupbox
コード例 #30
0
ファイル: setup_widget.py プロジェクト: willle3456/robocup-ai
 def init_view(self):
     field_group = QGroupBox('Field')
     field_layout = QVBoxLayout()
     field_layout.addWidget(self)
     field_layout.addStretch(1)
     field_group.setLayout(field_layout)
     return field_group