def __init__(self): QWidget.__init__(self, flags=Qt.Widget) self.setWindowTitle("Soccer Highlight") self.setWindowIcon(QIcon('./images/soccer.png')) self.setFixedWidth(640) self.setFixedHeight(480) layout_base = QBoxLayout(QBoxLayout.TopToBottom, self) self.setLayout(layout_base) # 첫 번째 그룹 QBoxLayout #grp_1 = QGroupBox("LEAUGE") #layout_base.addWidget(grp_1) #layout = QHBoxLayout() #layout.addWidget(QPushButton("Laliga")) #layout.addWidget(QPushButton("Serie A")) #layout.addWidget(QPushButton("Ligue 1")) #layout.addWidget(QPushButton("Bundesliga")) #layout.addWidget(QPushButton("K-League")) #grp_1.setLayout(layout) # 두 번째 그룹 QGridLayout grp_2 = QGroupBox("Select your file & League") layout_base.addWidget(grp_2) grp_2_layout = QBoxLayout(QBoxLayout.LeftToRight) grp_2.setLayout(grp_2_layout) layout = QGridLayout() # layout.addItem(QSpacerItem(10, 200)) # 파일 선택 버튼 self.file_b = QPushButton('File Open') self.file_b.clicked.connect(self.pushButtonClicked) layout.addWidget(self.file_b, 1, 0) # 파일 이름 출력 self.f_label = QLabel() layout.addWidget(self.f_label) # 리그 선택 self.L_cb = QComboBox(self) # L_cb.addItem('Laliga') # L_cb.addItem('Serie A') # L_cb.addItem('Ligue 1') # L_cb.addItem('Bundesliga') # L_cb.addItem('K-League') self.L_cb.addItems(["Laliga", "Serie A", "Ligue 1", "Bundesliga", "K-League"]) self.L_cb.currentTextChanged.connect(self.on_select) grp_2_layout.addLayout(layout) grp_2_layout.addWidget(self.L_cb) # 세 번째 그룹 QFormLaytout grp_3 = QGroupBox("Make HighLight") layout_base.addWidget(grp_3) layout = QFormLayout() grp_3.setLayout(layout) self.submit_b = QPushButton('확인') self.submit_b.clicked.connect(self.makeHighlight) # 파일 선택 layout.addRow(self.submit_b)
def __init__(self, parent): super().__init__() self.is_enabled = False self.parent: MainWindow = parent self.keyframe: Optional[TextAnimationKeyframe] = None layout = QGridLayout() self.setLayout(layout) groupBox = QGroupBox("Frame Properties") layout.addWidget(groupBox) self.toggleKeyframeButton = QPushButton('Add Keyframe') self.toggleKeyframeButton.setCheckable(True) self.toggleKeyframeButton.clicked.connect(self.on_toggle_keyframe) self.frameEdit = QLineEdit() self.xEdit = QLineEdit() self.yEdit = QLineEdit() self.textSizeEdit = QLineEdit() self.frameEdit.editingFinished.connect(self.on_editing_finished) self.xEdit.editingFinished.connect(self.on_editing_finished) self.yEdit.editingFinished.connect(self.on_editing_finished) self.textSizeEdit.editingFinished.connect(self.on_editing_finished) layout = QFormLayout() layout.addRow(self.toggleKeyframeButton) layout.addRow(QLabel("Frame:"), self.frameEdit) layout.addRow(QLabel("x:"), self.xEdit) layout.addRow(QLabel("y:"), self.yEdit) layout.addRow(QLabel("Text Size:"), self.textSizeEdit) groupBox.setLayout(layout)
def __init__(self, parent): super().__init__() self.is_enabled = False self.parent: MainWindow = parent self.keyframe: Optional[TextAnimationKeyframe] = None layout = QGridLayout() self.setLayout(layout) groupBox = QGroupBox("Text Template Properties") layout.addWidget(groupBox) self.textColorButton = ColorButton() self.textColorButton.setColor(QColor("white")) self.backgroundColorButton = ColorButton() self.strokeWidthEdit = QLineEdit() self.yEdit = QLineEdit() self.strokeColorButton = ColorButton() self.strokeColorButton.setColor(QColor("black")) self.strokeWidthEdit.setText("0") self.textColorButton.colorChangedFromDialog.connect( self.on_editing_finished) self.backgroundColorButton.colorChangedFromDialog.connect( self.on_editing_finished) self.strokeWidthEdit.editingFinished.connect(self.on_editing_finished) self.strokeColorButton.colorChangedFromDialog.connect( self.on_editing_finished) layout = QFormLayout() layout.addRow(QLabel("Text Color"), self.textColorButton) layout.addRow(QLabel("Background Color"), self.backgroundColorButton) layout.addRow(QLabel("Stroke"), self.strokeWidthEdit) layout.addRow(QLabel("Stroke Color"), self.strokeColorButton) groupBox.setLayout(layout)