示例#1
0
 def create_tab(self, *widgets):
     """Create simple tab widget page: widgets added in a vertical layout"""
     widget = QWidget()
     layout = QVBoxLayout()
     for widg in widgets:
         layout.addWidget(widg)
     layout.addStretch(1)
     widget.setLayout(layout)
     return widget
示例#2
0
 def create_tab(self, *widgets):
     """Create simple tab widget page: widgets added in a vertical layout"""
     widget = QWidget()
     layout = QVBoxLayout()
     for widg in widgets:
         layout.addWidget(widg)
     layout.addStretch(1)
     widget.setLayout(layout)
     return widget
示例#3
0
    def setup_page(self):
        """
        Setup the page of the survey widget
        """

        population_group = QGroupBox(_("Alternatives population data"))
        population_bg = QButtonGroup(self)
        population_label = QLabel(_("Location of population data"))

        country_default_radio = self.create_radiobutton(
            _("Use country default population data"),
            'use_default',
            False,
            tip=_("Use country default population data"),
            button_group=population_bg)
        population_radio = self.create_radiobutton(
            _("The following file"),  # le fichier suivant",
            'enable',
            True,
            _("population data file for micrsosimulation"
              ),  # "Fichier de données pour la microsimulation",
            button_group=population_bg)
        population_file = self.create_browsefile("",
                                                 'data_file',
                                                 filters='*.h5')

        self.connect(country_default_radio, SIGNAL("toggled(bool)"),
                     population_file.setDisabled)
        self.connect(population_radio, SIGNAL("toggled(bool)"),
                     population_file.setEnabled)
        population_file_layout = QHBoxLayout()
        population_file_layout.addWidget(population_radio)
        population_file_layout.addWidget(population_file)

        population_layout = QVBoxLayout()
        population_layout.addWidget(population_label)
        population_layout.addWidget(country_default_radio)
        population_layout.addLayout(population_file_layout)
        population_group.setLayout(population_layout)
        vlayout = QVBoxLayout()
        vlayout.addWidget(population_group)
        vlayout.addStretch(1)
        self.setLayout(vlayout)
示例#4
0
    def setup_page(self):
        """
        Setup the page of the survey widget
        """
        
        profiles_group = QGroupBox(_("Alternatives profiles data")) 
        profiles_bg = QButtonGroup(self)
        profiles_label = QLabel(_("Location of profiles data")) 

        country_default_radio = self.create_radiobutton(_("Use country default profiles data"),
                                                    'use_default', False,
                                                    tip = _("Use country default profiles data"),
                                                    
                                button_group = profiles_bg)
        profiles_radio = self.create_radiobutton(_("The following file"),  # le fichier suivant",
                                               'enable', True,
                                               _("profiles data file for micrsosimulation"), # "Fichier de données pour la microsimulation",
                                               button_group=profiles_bg)
        profiles_file = self.create_browsefile("", 'data_file',
                                             filters='*.h5')
        
        self.connect(country_default_radio, SIGNAL("toggled(bool)"),
                     profiles_file.setDisabled)
        self.connect(profiles_radio, SIGNAL("toggled(bool)"),
                     profiles_file.setEnabled)
        profiles_file_layout = QHBoxLayout()
        profiles_file_layout.addWidget(profiles_radio)
        profiles_file_layout.addWidget(profiles_file)

        profiles_layout = QVBoxLayout()
        profiles_layout.addWidget(profiles_label)
        profiles_layout.addWidget(country_default_radio)
        profiles_layout.addLayout(profiles_file_layout)
        profiles_group.setLayout(profiles_layout)

        vlayout = QVBoxLayout()
        vlayout.addWidget(profiles_group)
        vlayout.addStretch(1)
        self.setLayout(vlayout)
示例#5
0
 def setup_page(self):
     interface_group = QGroupBox(_("Interface"))
     styles = [str(txt) for txt in QStyleFactory.keys()]
     choices = zip(styles, [style.lower() for style in styles])
     style_combo = self.create_combobox(_('Qt windows style'), choices,
                                        'windows_style',
                                        default=self.main.default_style)
     newcb = self.create_checkbox
     vertdock_box = newcb(_("Vertical dockwidget title bars"),
                          'vertical_dockwidget_titlebars')
     verttabs_box = newcb(_("Vertical dockwidget tabs"),
                          'vertical_tabs')
     animated_box = newcb(_("Animated toolbars and dockwidgets"),
                          'animated_docks')
     margin_box = newcb(_("Custom dockwidget margin:"),
                        'use_custom_margin')
     margin_spin = self.create_spinbox("", "pixels", 'custom_margin',
                                       0, 0, 30)
     self.connect(margin_box, SIGNAL("toggled(bool)"),
                  margin_spin.setEnabled)
     margin_spin.setEnabled(self.get_option('use_custom_margin'))
     margins_layout = QHBoxLayout()
     margins_layout.addWidget(margin_box)
     margins_layout.addWidget(margin_spin)
     
     interface_layout = QVBoxLayout()
     interface_layout.addWidget(style_combo)
     interface_layout.addWidget(vertdock_box)
     interface_layout.addWidget(verttabs_box)
     interface_layout.addWidget(animated_box)
     interface_layout.addLayout(margins_layout)
     interface_group.setLayout(interface_layout)
     
     vlayout = QVBoxLayout()
     vlayout.addWidget(interface_group)
     vlayout.addStretch(1)
     self.setLayout(vlayout)
示例#6
0
    def setup_page(self):
        interface_group = QGroupBox(_("Interface"))
        styles = [str(txt) for txt in QStyleFactory.keys()]
        choices = zip(styles, [style.lower() for style in styles])
        style_combo = self.create_combobox(_('Qt windows style'),
                                           choices,
                                           'windows_style',
                                           default=self.main.default_style)
        newcb = self.create_checkbox
        vertdock_box = newcb(_("Vertical dockwidget title bars"),
                             'vertical_dockwidget_titlebars')
        verttabs_box = newcb(_("Vertical dockwidget tabs"), 'vertical_tabs')
        animated_box = newcb(_("Animated toolbars and dockwidgets"),
                             'animated_docks')
        margin_box = newcb(_("Custom dockwidget margin:"), 'use_custom_margin')
        margin_spin = self.create_spinbox("", "pixels", 'custom_margin', 0, 0,
                                          30)
        self.connect(margin_box, SIGNAL("toggled(bool)"),
                     margin_spin.setEnabled)
        margin_spin.setEnabled(self.get_option('use_custom_margin'))
        margins_layout = QHBoxLayout()
        margins_layout.addWidget(margin_box)
        margins_layout.addWidget(margin_spin)

        interface_layout = QVBoxLayout()
        interface_layout.addWidget(style_combo)
        interface_layout.addWidget(vertdock_box)
        interface_layout.addWidget(verttabs_box)
        interface_layout.addWidget(animated_box)
        interface_layout.addLayout(margins_layout)
        interface_group.setLayout(interface_layout)

        vlayout = QVBoxLayout()
        vlayout.addWidget(interface_group)
        vlayout.addStretch(1)
        self.setLayout(vlayout)