示例#1
0
    def __init__(self, parent=None, *args, **kwargs):

        QHBoxLayout.__init__(self)
        if 'texto' in kwargs:
            textoEtiqueta = kwargs['texto']
            self.labelPeriodo = Etiqueta(parent, texto=textoEtiqueta)
            self.labelPeriodo.setObjectName("labelPeriodo")
            self.addWidget(self.labelPeriodo)

        self.lineEditMes = Spinner(decimales=0)
        self.lineEditMes.setDecimals(0)
        self.lineEditMes.setObjectName("lineEditMes")
        self.addWidget(self.lineEditMes)
        self.lineEditAnio = Spinner(decimales=0)
        self.lineEditAnio.setDecimals(0)
        self.lineEditAnio.setObjectName("lineEditAnio")
        self.addWidget(self.lineEditAnio)

        self.lineEditMes.proximoWidget = self.lineEditAnio
        self.lineEditAnio.valueChanged.connect(self.ActualizaPeriodo)
        self.lineEditMes.valueChanged.connect(self.ActualizaPeriodo)
        self.lineEditAnio.setValue(datetime.date.today().year)
        self.lineEditMes.setValue(datetime.date.today().month)
        self.lineEditMes.setMinimum(1.)
        self.lineEditMes.setMaximum(12.)
        self.lineEditAnio.setMinimum(2000.)
        self.lineEditAnio.setMaximum(2050.)
        self.lineEditAnio.setValue(datetime.date.today().year)
        self.lineEditAnio.proximoWidget = self.proximoWidget
示例#2
0
    def __init__(self, parentView, parent, backgroundColor, foregroundColor, value, height, fontSize):
        QHBoxLayout.__init__(self)
        self.backgroundColor = backgroundColor
        self.foregroundColor = foregroundColor

        self.labelLayout = QVBoxLayout()
        self.upLabel = LabelButtons(
            "spin-up", parentView, backgroundColor, foregroundColor, old_div(height, 2), old_div(height, 2)
        )
        self.labelLayout.addWidget(self.upLabel)
        self.upLabel.clicked.connect(self.on_upLabel)

        self.downLabel = LabelButtons(
            "spin-down", parentView, backgroundColor, foregroundColor, old_div(height, 2), old_div(height, 2)
        )
        self.labelLayout.addWidget(self.downLabel)
        self.downLabel.clicked.connect(self.on_downLabel)

        self.addLayout(self.labelLayout)

        self.spinBox = DelayedSpinBox(750)
        self.spinBox.delayedValueChanged.connect(self.spinBoxValueChanged)
        self.addWidget(self.spinBox)
        self.spinBox.setToolTip("Spinbox")
        self.spinBox.setButtonSymbols(QAbstractSpinBox.NoButtons)
        self.spinBox.setAlignment(Qt.AlignRight)
        self.spinBox.setMaximum(value)
        self.spinBox.setMaximumHeight(height)
        self.spinBox.setSuffix("/" + str(value))
        font = self.spinBox.font()
        font.setPixelSize(fontSize)
        self.spinBox.setFont(font)
        self.do_draw()
示例#3
0
    def __init__(self, parentView, parent, backgroundColor, foregroundColor,
                 value, height, fontSize):
        QHBoxLayout.__init__(self)
        self.backgroundColor = backgroundColor
        self.foregroundColor = foregroundColor

        self.labelLayout = QVBoxLayout()
        self.upLabel = LabelButtons("spin-up", parentView, backgroundColor,
                                    foregroundColor, old_div(height, 2),
                                    old_div(height, 2))
        self.labelLayout.addWidget(self.upLabel)
        self.upLabel.clicked.connect(self.on_upLabel)

        self.downLabel = LabelButtons("spin-down", parentView, backgroundColor,
                                      foregroundColor, old_div(height, 2),
                                      old_div(height, 2))
        self.labelLayout.addWidget(self.downLabel)
        self.downLabel.clicked.connect(self.on_downLabel)

        self.addLayout(self.labelLayout)

        self.spinBox = DelayedSpinBox(750)
        self.spinBox.delayedValueChanged.connect(self.spinBoxValueChanged)
        self.addWidget(self.spinBox)
        self.spinBox.setToolTip("Spinbox")
        self.spinBox.setButtonSymbols(QAbstractSpinBox.NoButtons)
        self.spinBox.setAlignment(Qt.AlignRight)
        self.spinBox.setMaximum(value)
        self.spinBox.setMaximumHeight(height)
        self.spinBox.setSuffix("/" + str(value))
        font = self.spinBox.font()
        font.setPixelSize(fontSize)
        self.spinBox.setFont(font)
        self.do_draw()
示例#4
0
 def __init__(self, *buttons):
     QHBoxLayout.__init__(self)
     self.addStretch(1)
     for b in buttons:
         if b is None:
             continue
         self.addWidget(b)
示例#5
0
 def __init__(self, parent=None) -> None:
     QHBoxLayout.__init__(self, parent)
     # Основные компоненты
     self.back_button = QPushButton("Назад")
     self.next_button = QPushButton("Далее")
     # Добавим их
     self.addWidget(self.back_button)
     self.addWidget(self.next_button)
示例#6
0
    def __init__(self, parent=None) -> None:
        QHBoxLayout.__init__(self, parent)

        self.aerodynamic_radio_button = QRadioButton("Аэродинамическая цель")
        self.aerodynamic_radio_button.setChecked(True)
        self.ballistic_radio_button = QRadioButton("Баллистическая цель")

        self.addWidget(self.aerodynamic_radio_button)
        self.addWidget(self.ballistic_radio_button)
示例#7
0
 def __init__(self, parent=None) -> None:
     QHBoxLayout.__init__(self, parent)
     # Основные компоненты
     self.velocity_spin_boxes = [
         TargetVelocitySpinBox(coord) for coord in ["x", "y", "z"]
     ]
     # Добавим их в контейнер
     for spin_box in self.velocity_spin_boxes:
         self.addWidget(spin_box)
示例#8
0
 def __init__(self, color, parent=None):
     QHBoxLayout.__init__(self)
     assert isinstance(color, QColor)
     self.lineedit = QLineEdit(color.name(), parent)
     self.lineedit.textChanged['QString'].connect(self.update_color)
     self.addWidget(self.lineedit)
     self.colorbtn = ColorButton(parent)
     self.colorbtn.color = color
     self.colorbtn.colorChanged[QColor].connect(self.update_text)
     self.addWidget(self.colorbtn)
示例#9
0
    def __init__(self, parent=None, *args, **kwargs):
        QHBoxLayout.__init__(self)
        if 'titulo' in kwargs:
            self.titulo = kwargs['titulo']
        if 'tamanio' in kwargs:
            self.tamanio = kwargs['tamanio']
        if 'enabled' in kwargs:
            self.enabled = kwargs['enabled']

        self.setupUi(parent)
示例#10
0
 def __init__(self, color, parent=None):
     QHBoxLayout.__init__(self)
     assert isinstance(color, QColor)
     self.lineedit = QLineEdit(color.name(), parent)
     self.lineedit.textChanged['QString'].connect(self.update_color)
     self.addWidget(self.lineedit)
     self.colorbtn = ColorButton(parent)
     self.colorbtn.color = color
     self.colorbtn.colorChanged[QColor].connect(self.update_text)
     self.addWidget(self.colorbtn)
示例#11
0
    def __init__(self, preset={}, parent=None):
        QHBoxLayout.__init__(self)

        self.settings = Settings(SETTING_FILEPTH['app'], ST_FORMAT['ini'], self)
        self.parent = parent

        self.preset = preset

        if check_preset(self.preset):
            self.buildUI()
示例#12
0
    def __init__(self, parent=None) -> None:
        QHBoxLayout.__init__(self, parent)

        # Нужные кнопки
        self.stop_button = QPushButton("Стоп")
        self.start_button = QPushButton("Старт")

        # Добавим их
        self.addWidget(self.stop_button)
        self.addWidget(self.start_button)

        # И выключим, чтоб не трогали
        self.start_button.setEnabled(False)
        self.stop_button.setEnabled(False)
示例#13
0
 def __init__(self, controlDialog):
     QHBoxLayout.__init__(self)
     self.setAlignment(Qt.AlignLeft)
     self.reload = CmdButton(controlPanel=None,
                             label=' Reload Config ',
                             controlDialog=controlDialog,
                             cmdStr='%s reloadConfiguration' %
                             controlDialog.moduleRow.actorName)
     self.statusButton = CmdButton(controlPanel=None,
                                   label=' STATUS ',
                                   controlDialog=controlDialog,
                                   cmdStr='%s status' %
                                   controlDialog.moduleRow.actorName)
     self.addWidget(self.reload)
     self.addWidget(self.statusButton)
    def __init__(self, customize, id, name):
        QHBoxLayout.__init__(self)

        self.customize = customize
        self.checkbox = QCheckBox(name)

        self.id = id

        self.checkbox.setCheckState(0)
        self.checkbox.stateChanged.connect(self.handleChecking)

        self.comscale = QComboBox()
        self.comscale.addItems(['linear', 'log'])
        self.comscale.currentIndexChanged.connect(self.updateScale)

        self.addWidget(self.checkbox)
        self.addWidget(self.comscale)
示例#15
0
 def __init__(self, parent=None):
     QHBoxLayout.__init__(self, parent)
     self.setContentsMargins(0, 4, 0, 0)
     self.setSpacing(0)
     self.timeControlFontSize = 12
示例#16
0
 def __init__(self, parent=None):
     QHBoxLayout.__init__(self, parent)
     self.setContentsMargins(0, 4, 0, 0)
     self.setSpacing(0)
     self.timeControlFontSize = 12
示例#17
0
 def __init__(self, *buttons):
     QHBoxLayout.__init__(self)
     self.addStretch(1)
     for b in buttons:
         self.addWidget(b)
示例#18
0
 def __init__(self, *buttons: Iterable[QAbstractButton]) -> None:
     QHBoxLayout.__init__(self)
     self.addStretch(1)
     for b in buttons:
         self.addWidget(b)
示例#19
0
 def __init__(self):
     QHBoxLayout.__init__(self)
     self.setSpacing(5)
     self.setContentsMargins(10, 10, 10, 10)
示例#20
0
 def __init__(self, widget: QWidget):
     QHBoxLayout.__init__(self)
     self.setContentsMargins(0, 0, 0, 0)
     self.addWidget(widget)
示例#21
0
    def __init__(self, channel):
        QHBoxLayout.__init__(self)
        self.id = channel.name        
        
        self.chan_thumbdata = dpr.get_thumb_data(self.id, "Channel")            
        self.img_chan = QtGui.QPixmap()
        self.img_chan.loadFromData(self.chan_thumbdata)
        self.img_chan = self.img_chan.scaledToHeight(80)
        self.lbl_chan = QtWidgets.QLabel()
        self.lbl_chan.mouseReleaseEvent = self.goToChannel  
        self.lbl_chan.setPixmap(self.img_chan)
        self.addWidget(self.lbl_chan) 
                        
        self.vBox_all = QtWidgets.QVBoxLayout()      
        self.vBox_all.addStretch()
        self.lbl_name = QtWidgets.QLabel(channel["Title"], font=f_subheader)
        self.vBox_all.addWidget(self.lbl_name)
        self.hBox_top = QtWidgets.QHBoxLayout()
        
        self.vBox_subscribers = QtWidgets.QVBoxLayout()           
        self.lbl_subscribers = QtWidgets.QLabel("Subscribers")            
        self.vBox_subscribers.addWidget(self.lbl_subscribers)
        self.lbl_subscribers_val = QtWidgets.QLabel(str(channel["Subscribers"]))            
        self.vBox_subscribers.addWidget(self.lbl_subscribers_val)
        self.hBox_top.addLayout(self.vBox_subscribers) 
              
        self.vBox_views = QtWidgets.QVBoxLayout()           
        self.lbl_views = QtWidgets.QLabel("Views")            
        self.vBox_views.addWidget(self.lbl_views)
        self.lbl_views_val = QtWidgets.QLabel(str(channel["Views"]))            
        self.vBox_views.addWidget(self.lbl_views_val)
        self.hBox_top.addLayout(self.vBox_views) 
        
        self.vBox_num_vids = QtWidgets.QVBoxLayout()   
        self.lbl_num_vids = QtWidgets.QLabel("# Videos")
        self.vBox_num_vids.addWidget(self.lbl_num_vids)        
        self.lbl_num_vids_val = QtWidgets.QLabel(str(len(dpr.get_scanned_videos(self.id))))
        self.vBox_num_vids.addWidget(self.lbl_num_vids_val)
        self.hBox_top.addLayout(self.vBox_num_vids) 
                
        self.vBox_comments = QtWidgets.QVBoxLayout()   
        self.lbl_comments = QtWidgets.QLabel("Comments")
        self.vBox_comments.addWidget(self.lbl_comments)        
        self.lbl_comments_val = QtWidgets.QLabel(str(channel["Comments"]))
        self.vBox_comments.addWidget(self.lbl_comments_val)
        self.hBox_top.addLayout(self.vBox_comments) 
        
        self.vBox_upload = QtWidgets.QVBoxLayout()   
        self.lbl_upload = QtWidgets.QLabel("Upload")
        self.vBox_upload.addWidget(self.lbl_upload)        
        self.lbl_upload_val = QtWidgets.QLabel(dpr.parse_date(channel["Upload"]))
        self.vBox_upload.addWidget(self.lbl_upload_val)
        self.hBox_top.addLayout(self.vBox_upload)

        self.vBox_gathered = QtWidgets.QVBoxLayout()   
        self.lbl_gathered = QtWidgets.QLabel("Gathered")
        self.vBox_gathered.addWidget(self.lbl_gathered)        
        self.lbl_gathered_val = QtWidgets.QLabel(dpr.parse_date(channel["Gathered"]))
        self.vBox_gathered.addWidget(self.lbl_gathered_val)
        self.hBox_top.addLayout(self.vBox_gathered)      
        
        self.vBox_all.addLayout(self.hBox_top)           
        self.vBox_all.addStretch()
        self.addLayout(self.vBox_all)
        self.addStretch()
示例#22
0
    def __init__(self, video):
        QHBoxLayout.__init__(self)
        self.id = video.name
        
        self.vid_thumbdata = dpr.get_thumb_data(self.id, "Video")            
        self.img_vid = QtGui.QPixmap()        
        self.img_vid.loadFromData(self.vid_thumbdata)        
        self.img_vid = self.img_vid.scaledToHeight(80)
        self.lbl_vid = QtWidgets.QLabel()
        self.lbl_vid.mouseReleaseEvent = self.goToVideo  
        self.lbl_vid.setPixmap(self.img_vid)
        self.addWidget(self.lbl_vid) 
                        
        self.vBox_all = QtWidgets.QVBoxLayout()      
        self.vBox_all.addStretch()
        self.lbl_name = QtWidgets.QLabel(video["Title"], font=f_subheader)
        self.vBox_all.addWidget(self.lbl_name)
        self.hBox_top = QtWidgets.QHBoxLayout()
        
        self.vBox_views = QtWidgets.QVBoxLayout()           
        self.lbl_views = QtWidgets.QLabel("Views")            
        self.vBox_views.addWidget(self.lbl_views)
        self.lbl_views_val = QtWidgets.QLabel(str(video["Views"]))            
        self.vBox_views.addWidget(self.lbl_views_val)
        self.hBox_top.addLayout(self.vBox_views) 
        
        self.vBox_channel = QtWidgets.QVBoxLayout()           
        self.lbl_channel = QtWidgets.QLabel("Channel")            
        self.vBox_channel.addWidget(self.lbl_channel)
        self.lbl_channel_val = QtWidgets.QLabel(video["ChannelTitle"])           
        self.vBox_channel.addWidget(self.lbl_channel_val)
        self.hBox_top.addLayout(self.vBox_channel) 
              
        self.vBox_likes = QtWidgets.QVBoxLayout()           
        self.lbl_likes = QtWidgets.QLabel("Likes/Dislikes")            
        self.vBox_likes.addWidget(self.lbl_likes)
        self.lbl_likes_val = QtWidgets.QLabel(str(video["Likes"])+"/"+str(video["Dislikes"]))            
        self.vBox_likes.addWidget(self.lbl_likes_val)
        self.hBox_top.addLayout(self.vBox_likes) 
        
        self.vBox_duration = QtWidgets.QVBoxLayout()   
        self.lbl_duration = QtWidgets.QLabel("Duration")
        self.vBox_duration.addWidget(self.lbl_duration)        
        self.lbl_duration_val = QtWidgets.QLabel(str(dpr.parse_duration(video["Duration"])))
        self.vBox_duration.addWidget(self.lbl_duration_val)
        self.hBox_top.addLayout(self.vBox_duration) 
        
        self.vBox_comments = QtWidgets.QVBoxLayout()   
        self.lbl_comments = QtWidgets.QLabel("Comments")
        self.vBox_comments.addWidget(self.lbl_comments)        
        self.lbl_comments_val = QtWidgets.QLabel(str(video["Comments"]))
        self.vBox_comments.addWidget(self.lbl_comments_val)
        self.hBox_top.addLayout(self.vBox_comments) 
        
        self.vBox_upload = QtWidgets.QVBoxLayout()   
        self.lbl_upload = QtWidgets.QLabel("Upload")
        self.vBox_upload.addWidget(self.lbl_upload)        
        self.lbl_upload_val = QtWidgets.QLabel(dpr.parse_date(video["Upload"]))
        self.vBox_upload.addWidget(self.lbl_upload_val)
        self.hBox_top.addLayout(self.vBox_upload)

        self.vBox_gathered = QtWidgets.QVBoxLayout()   
        self.lbl_gathered = QtWidgets.QLabel("Gathered")
        self.vBox_gathered.addWidget(self.lbl_gathered)        
        self.lbl_gathered_val = QtWidgets.QLabel(dpr.parse_date(video["Gathered"]))
        self.vBox_gathered.addWidget(self.lbl_gathered_val)
        self.hBox_top.addLayout(self.vBox_gathered)              
        
        self.vBox_all.addLayout(self.hBox_top)           
        self.vBox_all.addStretch()
        self.addLayout(self.vBox_all)
        self.addStretch()
示例#23
0
 def __init__(self, *buttons):
     QHBoxLayout.__init__(self)
     self.addStretch(1)
     for b in buttons:
         self.addWidget(b)
示例#24
0
 def __init__(self, *args, **kwargs):
     QHBoxLayout.__init__(self, *args, **kwargs)
     self.setSpacing(spacing)