コード例 #1
0
    def createLayout(self):
        self.groupBox = QGroupBox("What Is Your Favorite Sport?")

        hboxlayout = QHBoxLayout()

        self.button = QPushButton("Football", self)
        self.button.setIcon(QtGui.QIcon("home.png"))
        self.button.setIconSize(QSize(40, 40))
        self.button.setToolTip("This Is Click Me Button")
        self.button.setMinimumHeight(40)
        hboxlayout.addWidget(self.button)

        self.button1 = QPushButton("Cricket", self)
        self.button1.setIcon(QtGui.QIcon("home.png"))
        self.button1.setIconSize(QSize(40, 40))
        self.button1.setMinimumHeight(40)
        self.button1.setToolTip("This Is Click Me Button")
        hboxlayout.addWidget(self.button1)

        self.button2 = QPushButton("Tennis", self)
        self.button2.setIcon(QtGui.QIcon("home.png"))
        self.button2.setIconSize(QSize(40, 40))
        self.button2.setMinimumHeight(40)
        self.button2.setToolTip("This Is Click Me Button")
        hboxlayout.addWidget(self.button2)

        self.groupBox.setLayout(hboxlayout)
コード例 #2
0
ファイル: main.py プロジェクト: YongZhengYew/DTIScoringSystem
    def accountCreationPageUI(self):
        layout = QFormLayout()

        self.accountCreationPage.nameInput = QLineEdit()
        layout.addRow("Name", self.accountCreationPage.nameInput)

        self.accountCreationPage.phoneNumberInput = QLineEdit()
        layout.addRow("Phone Number",
                      self.accountCreationPage.phoneNumberInput)

        self.accountCreationPage.passwordInput = QLineEdit()
        layout.addRow("New Password", self.accountCreationPage.passwordInput)

        self.accountCreationPage.passwordConfirmInput = QLineEdit()
        layout.addRow("Confirm New Password",
                      self.accountCreationPage.passwordConfirmInput)

        self.accountCreationPage.createAccountButton = QPushButton(
            "&Create Account")
        self.accountCreationPage.createAccountButton.clicked.connect(
            self.createAccount)

        self.accountCreationPage.finishCreatingAccountsButton = QPushButton(
            "&Done")
        self.accountCreationPage.finishCreatingAccountsButton.clicked.connect(
            self.goTo_PlayerAdmissionsPage)

        layout.addRow(self.accountCreationPage.finishCreatingAccountsButton,
                      self.accountCreationPage.createAccountButton)
        self.accountCreationPage.setLayout(layout)
コード例 #3
0
ファイル: main.py プロジェクト: YongZhengYew/DTIScoringSystem
    def questionPlayPageUI(self):
        layout = QFormLayout()

        self.questionPlayPage.titleDisplay = QLabel()
        layout.addRow(self.questionPlayPage.titleDisplay)

        self.questionPlayPage.contentDisplay = QLabel()
        layout.addRow(self.questionPlayPage.contentDisplay)

        self.questionPlayPage.choiceList = QListWidget()
        self.questionPlayPage.playerScores = QLabel()
        layout.addRow(self.questionPlayPage.choiceList,
                      self.questionPlayPage.playerScores)

        self.questionPlayPage.chooseButton = QPushButton("&Submit")
        self.questionPlayPage.chooseButton.clicked.connect(
            self.submitPlayQuestion)
        layout.addRow(self.questionPlayPage.chooseButton)

        self.questionPlayPage.collapseButton = QPushButton("Collapse!")
        self.questionPlayPage.collapseButton.clicked.connect(
            self.goTo_CollapsePage)
        self.questionPlayPage.abortButton = QPushButton("Abort")
        self.questionPlayPage.abortButton.clicked.connect(
            self.abortGameInProgress)
        layout.addRow(self.questionPlayPage.collapseButton,
                      self.questionPlayPage.abortButton)

        self.questionPlayPage.setLayout(layout)
コード例 #4
0
    def initUI(self):

        self.col = QColor(0, 0, 0)

        redb = QPushButton('Red', self)
        redb.setCheckable(True)
        redb.move(10, 10)

        redb.clicked[bool].connect(self.setColor)

        greenb = QPushButton('Green', self)
        greenb.setCheckable(True)
        greenb.move(10, 60)

        greenb.clicked[bool].connect(self.setColor)

        blueb = QPushButton('Blue', self)
        blueb.setCheckable(True)
        blueb.move(10, 110)

        blueb.clicked[bool].connect(self.setColor)

        self.square = QFrame(self)
        self.square.setGeometry(150, 20, 100, 100)
        self.square.setStyleSheet("QWidget { background-color: %s }" %
                                  self.col.name())

        self.setGeometry(300, 300, 300, 250)
        self.setWindowTitle('Toggle button')
        self.show()
コード例 #5
0
ファイル: main.py プロジェクト: YongZhengYew/DTIScoringSystem
    def playerAdmissionsPageUI(self):
        layout = QFormLayout()

        self.playerAdmissionsPage.createAnAccountButton = QPushButton(
            "&Create New Account!")
        self.playerAdmissionsPage.createAnAccountButton.clicked.connect(
            self.goTo_AccountCreationPage)
        layout.addRow(self.playerAdmissionsPage.createAnAccountButton)

        self.playerAdmissionsPage.proceedToLoginButton = QPushButton("&Login")
        self.playerAdmissionsPage.proceedToLoginButton.clicked.connect(
            self.goTo_LoginPage)
        layout.addRow(self.playerAdmissionsPage.proceedToLoginButton)

        self.playerAdmissionsPage.readyList = QListWidget()
        layout.addRow(self.playerAdmissionsPage.readyList)

        self.playerAdmissionsPage.removePlayerButton = QPushButton(
            "&Remove Selected Players")
        self.playerAdmissionsPage.removePlayerButton.clicked.connect(
            self.removePlayerFromPlayerAdmissionsPageList)
        layout.addRow(self.playerAdmissionsPage.removePlayerButton)

        self.playerAdmissionsPage.startGameButton = QPushButton("&Start Game!")
        self.playerAdmissionsPage.startGameButton.clicked.connect(
            self.startNewGame)
        layout.addRow(self.playerAdmissionsPage.startGameButton)

        self.playerAdmissionsPage.proceedToFacilAuthPageButton = QPushButton(
            "&Faciliator Page")
        self.playerAdmissionsPage.proceedToFacilAuthPageButton.clicked.connect(
            self.goTo_FacilAuthPage)
        layout.addRow(self.playerAdmissionsPage.proceedToFacilAuthPageButton)

        self.playerAdmissionsPage.setLayout(layout)
コード例 #6
0
    def __init__(
        self,
        onOpenLogButtonPressed: Callable[[], None],
        onAgentVarsButtonPressed: Callable[[], None],
        parent: Optional[QWidget] = None,
        *args: Tuple[Any, Any],
        **kwargs: Tuple[Any, Any],
    ) -> None:
        """
        The "Open Log" and "Agent Variables" buttons view used for opening those windows.
        """
        super(SolverWindowsButtonsView, self).__init__(parent=parent, *args, **kwargs)
        self.setContentsMargins(0, 0, 0, 0)

        layout = QHBoxLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)

        # define the buttons
        openLogButton = QPushButton("Open Log")
        agentVarsButton = QPushButton("Agent Variables")

        # connect them to their respective methods
        openLogButton.pressed.connect(onOpenLogButtonPressed)  # type: ignore
        agentVarsButton.pressed.connect(onAgentVarsButtonPressed)  # type: ignore

        layout.addWidget(openLogButton)
        layout.addWidget(agentVarsButton)

        layout.setAlignment(openLogButton, Qt.Alignment.AlignHCenter)
        layout.setAlignment(agentVarsButton, Qt.Alignment.AlignHCenter)

        self.setLayout(layout)
コード例 #7
0
ファイル: widget.py プロジェクト: swavan/oneui
def delete_confirmation(parent, _id: str, action: Callable):
    msg = QMessageBox()
    msg.setText("Are you sure, you want to remove ?")
    msg.setStyleSheet('''
        background-color: #1d251c;
        color: #bdc0bd;
    ''')
    msg.setParent(parent)
    msg.setWindowModality(Qt.WindowModality.WindowModal)

    style = '''
    margin-top: 20px;
    border: none;
    '''
    yes_btn = QPushButton("  Yes")
    yes_btn.setIcon(QIcon(full_path("assets/images/icons/trash-can.ico")))
    yes_btn.setStyleSheet(style)

    no_btn = QPushButton("  Cancel")
    no_btn.setStyleSheet(style)
    no_btn.setIcon(QIcon(full_path("assets/images/icons/cancel.ico")))

    yes_btn.setDefault(True)

    msg.addButton(no_btn, msg.ButtonRole.NoRole)
    msg.addButton(yes_btn, msg.ButtonRole.YesRole)

    msg.buttonClicked.connect(lambda x: action(_id) if x.text().lower().strip() == "yes" else do_nothing())
    msg.exec()
コード例 #8
0
    def __init__(
        self,
        parent=None,
        buttons=None,
        exercises=None,
        index: int = None,
    ):
        super(ChangeKeyDialog, self).__init__(parent)
        layout = QVBoxLayout(self)
        self.setLayout(layout)
        widget = QWidget()
        keyLayout = QVBoxLayout()
        widget.setStyleSheet("""
        QWidget{
            border-radius: 12px;
            border: 1px solid grey;
            background-color: #b5b5b5;
            color: white;
            font-size: 40px;
        }
        """)
        # widget.setFixedSize(100, 100)
        self.currentKeyLabel = QLabel('W')
        keyLayout.addWidget(self.currentKeyLabel)
        keyLayout.setAlignment(self.currentKeyLabel, Qt.Alignment.AlignCenter)
        widget.setLayout(keyLayout)

        label = QLabel("Press a key to swap")
        emptyKey = QPushButton('Use empty slot')
        emptyKey.setFocusPolicy(Qt.FocusPolicy.ClickFocus)
        emptyKey.clicked.connect(self.useEmpty)

        acceptKey = QPushButton('Accept')
        acceptKey.clicked.connect(self.accept)
        acceptKey.setFocusPolicy(Qt.FocusPolicy.ClickFocus)

        layout.addWidget(label)
        layout.addWidget(widget)
        actions = QHBoxLayout()
        actions.addWidget(emptyKey)
        actions.addWidget(acceptKey)
        layout.addLayout(actions)
        layout.setAlignment(widget, Qt.Alignment.AlignCenter)
        self.buttons = buttons
        self.exercises = exercises
        self.index = index

        self.monitor = KeyMonitor()
        self.monitor.start_monitoring()
        self.currentKey = self.monitor.currentKey

        self.timer = QTimer()
        self.timer.timeout.connect(self.onTimeout)
        self.timer.start()
        print("Dialog init done!")
コード例 #9
0
    def initUI(self):
        self.setGeometry(self.xPos, self.yPos, self.width, self.height)
        self.vBoxLayout = QVBoxLayout()

        self.slider = Slider(
            direction=Qt.Orientation.Horizontal,
            duration=750,
            animationType=QEasingCurve.Type.OutQuad,
            wrap=False,
        )

        self.label1 = QLabel()
        self.label1.setText('First Slide')
        self.label1.setAlignment(Qt.AlignmentFlag.AlignCenter)
        self.label1.setStyleSheet(
            'QLabel{background-color: rgb(245, 177, 66); color: rgb(21, 21, 21); font: 25pt;}'
        )
        self.slider.addWidget(self.label1)

        self.label2 = QLabel()
        self.label2.setText('Second Slide')
        self.label2.setAlignment(Qt.AlignmentFlag.AlignCenter)
        self.label2.setStyleSheet(
            'QLabel{background-color: rgb(21, 21, 21); color: rgb(245, 177, 66); font: 25pt;}'
        )
        self.slider.addWidget(self.label2)

        self.label3 = QLabel()
        self.label3.setText('Third Slide')
        self.label3.setAlignment(Qt.AlignmentFlag.AlignCenter)
        self.label3.setStyleSheet(
            'QLabel{background-color: rgb(93, 132, 48); color: rgb(245, 177, 66); font: 25pt;}'
        )
        self.slider.addWidget(self.label3)

        self.buttonPrevious = QPushButton()
        self.buttonPrevious.setText('Previous Slide')
        self.buttonPrevious.clicked.connect(self.slider.slidePrevious)

        self.buttonNext = QPushButton()
        self.buttonNext.setText('Next Slide')
        self.buttonNext.clicked.connect(self.slider.slideNext)

        self.buttonLayout = QHBoxLayout()
        self.buttonLayout.addWidget(self.buttonPrevious)
        self.buttonLayout.addWidget(self.buttonNext)

        self.vBoxLayout.addWidget(self.slider)
        self.vBoxLayout.addLayout(self.buttonLayout)

        self.centralWidget = QWidget(self)
        self.centralWidget.setLayout(self.vBoxLayout)
        self.setCentralWidget(self.centralWidget)

        self.show()
コード例 #10
0
ファイル: Dictgui.py プロジェクト: nanza404/lazyDictionary
 def button(self):
     self.btn0 = QPushButton('Start', self)
     self.btn0.setGeometry(0, 30, 150, 70)
     self.btn0.setStyleSheet('background-color:green')
     self.btn0.setFont(QFont('san serif', 15))
     self.btn1 = QPushButton('Stop', self)
     self.btn1.setGeometry(150, 30, 150, 70)
     self.btn1.setStyleSheet('background-color:grey')
     self.btn1.setFont(QFont('san serif', 15))
     self.btn0.clicked.connect(self.clickButton0)
     self.btn1.clicked.connect(self.clickButton1)
コード例 #11
0
 def __init__(self, parent):
     super(QWidget, self).__init__(parent)
     self.parent = parent
     self.saveButton = QPushButton("Save")
     self.saveButton.setEnabled(False)
     closeButton = QPushButton("Close")
     closeButton.clicked.connect(self.closeOnClick)
     hbox = QHBoxLayout()
     hbox.addStretch(1)
     hbox.addWidget(self.saveButton)
     hbox.addWidget(closeButton)
     self.setLayout(hbox)
コード例 #12
0
ファイル: main.py プロジェクト: YongZhengYew/DTIScoringSystem
    def facilStartPageUI(self):
        layout = QFormLayout()

        self.facilStartPage.loginPlayersButton = QPushButton("Log In Players")
        self.facilStartPage.loginPlayersButton.clicked.connect(
            self.goTo_PlayerAdmissionsPage)
        layout.addRow(self.facilStartPage.loginPlayersButton)

        self.facilStartPage.questionBankButton = QPushButton("Question Bank")
        self.facilStartPage.questionBankButton.clicked.connect(
            self.goTo_QuestionBankPage)
        layout.addRow(self.facilStartPage.questionBankButton)

        self.facilStartPage.setLayout(layout)
コード例 #13
0
    def __init__(self, parent=None):
        super(ConfigDialog, self).__init__(parent)
        self.classifyExercises = parent.classifyExercises
        self.setFixedSize(500, 400)
        self.setWindowTitle("Model Configurations")

        self.epochValue = QLabel()
        self.vbox = QVBoxLayout()
        self.label_maximum = QLabel()
        self.label_minimum = QLabel()
        self.slider_hbox = QHBoxLayout()
        self.slider_vbox = QVBoxLayout()
        self.batchSizeMenu = QComboBox()
        self.properties = QFormLayout()
        self.epochSlider = Slider(orientation=Qt.Orientations.Horizontal)

        self.trainButton = QPushButton('Train Model')
        self.resultButton = QPushButton('Show result image')
        self.progress = QProgressBar()

        self.batchSizeMenu.addItems(['2', '4', '8', '16', '32', '64', '128'])
        self.batchSizeMenu.setCurrentIndex(3)
        self.batchSizeMenu.setMaximumWidth(100)

        self.initSlider()

        self.properties.addRow('Batch Size', self.batchSizeMenu)

        self.resultButton.setEnabled(False)
        self.actionsLayout = QHBoxLayout()

        self.actionsLayout.addWidget(self.trainButton)
        self.actionsLayout.addWidget(self.resultButton)

        self.optionsLayout = QVBoxLayout()
        self.optionsLayout.addWidget(QLabel('Model properties'))
        self.optionsLayout.addLayout(self.vbox)
        self.optionsLayout.addLayout(self.properties)
        self.optionsLayout.addLayout(self.actionsLayout)
        self.progress.setAlignment(QtCore.Qt.Alignment.AlignCenter)
        self.optionsLayout.addWidget(self.progress)
        # self.options_layout.addWidget(self.label)
        # self.options_layout.addWidget(self.list_widget)

        self.setLayout(self.optionsLayout)

        self.trainThread = TrainThread(self.classifyExercises)
        self.connections()
        print("init config")
コード例 #14
0
    def __init__(self, nugget_list_widget):
        super(NuggetListItemWidget, self).__init__(nugget_list_widget)
        self.nugget_list_widget = nugget_list_widget
        self.nugget = None

        self.setFixedHeight(40)
        self.setStyleSheet("background-color: white")

        self.layout = QHBoxLayout(self)
        self.layout.setContentsMargins(20, 0, 20, 0)
        self.layout.setSpacing(10)

        self.info_label = QLabel()
        self.info_label.setFont(CODE_FONT_BOLD)
        self.layout.addWidget(self.info_label)

        self.left_split_label = QLabel("|")
        self.left_split_label.setFont(CODE_FONT_BOLD)
        self.layout.addWidget(self.left_split_label)

        self.text_edit = QTextEdit()
        self.text_edit.setReadOnly(True)
        self.text_edit.setFrameStyle(0)
        self.text_edit.setFont(CODE_FONT)
        self.text_edit.setLineWrapMode(QTextEdit.LineWrapMode.FixedPixelWidth)
        self.text_edit.setLineWrapColumnOrWidth(10000)
        self.text_edit.setHorizontalScrollBarPolicy(
            Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
        self.text_edit.setVerticalScrollBarPolicy(
            Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
        self.text_edit.setFixedHeight(30)
        self.text_edit.setText("")
        self.layout.addWidget(self.text_edit)

        self.right_split_label = QLabel("|")
        self.right_split_label.setFont(CODE_FONT_BOLD)
        self.layout.addWidget(self.right_split_label)

        self.match_button = QPushButton()
        self.match_button.setIcon(QIcon("aset_ui/resources/correct.svg"))
        self.match_button.setFlat(True)
        self.match_button.clicked.connect(self._match_button_clicked)
        self.layout.addWidget(self.match_button)

        self.fix_button = QPushButton()
        self.fix_button.setIcon(QIcon("aset_ui/resources/incorrect.svg"))
        self.fix_button.setFlat(True)
        self.fix_button.clicked.connect(self._fix_button_clicked)
        self.layout.addWidget(self.fix_button)
コード例 #15
0
    def __init__(self, summary_plots=None):
        super(SummaryWindow, self).__init__()

        ## Create GUI Layout
        layout = QVBoxLayout()

        self.fig, self.axs = summary_plots()
        for axis in self.axs:
            axis.tick_params(axis='both', which='major', labelsize=9)
            axis.xaxis.label.set_fontsize(10)
            axis.yaxis.label.set_fontsize(10)
        self.fig.subplots_adjust(bottom=0.11)
        self.fig.subplots_adjust(hspace=0.3)
        self.canvas = FigureCanvas(self.fig)
        self.toolbar = NavigationToolbar(self.canvas, self)
        # Attach figure to the layout
        lf = QVBoxLayout()
        lf.addWidget(self.toolbar)
        lf.addWidget(self.canvas)
        layout.addLayout(lf)

        # add quit button
        bq = QPushButton("QUIT")
        bq.pressed.connect(self.close)
        lb = QVBoxLayout()  # Layout for buttons
        lb.addWidget(bq)
        layout.addLayout(lb)

        self.setLayout(layout)
        self.setGeometry(100, 150, 1500, 900)
        # self.adjustSize()
        self.show()
        self.setWindowTitle('Last experiment summary')
コード例 #16
0
 def UiComponents(self):
     button = QPushButton("Close Window", self)
     button.setGeometry(QRect(100, 100, 111, 50))
     button.setIcon(QtGui.QIcon("home.png"))
     button.setIconSize(QSize(40, 40))
     button.setToolTip("This Is Click Me Button")
     button.clicked.connect(ClickMe)
コード例 #17
0
    def __init__(self):
        super().__init__()

        self.setWindowTitle("File Hash Checker")
        self.setGeometry(0, 0, 600, 300)

        self.labelFileDropper = FileDropper("Datei auswählen")
        #self.selectFileButton.clicked.connect(self.get_file_to_check)
        self.labelFileDropper.setAcceptDrops(True)
        self.labelFileDropper.setStyleSheet(
            "border: 1px solid black; border-radius: 15px; text-align: center; "
            "height: 200px")
        self.labelFileDropper.move(0, 0)
        self.labelFileDropper.resize(500, 150)

        self.labelMD5Hash = QLabel(
            "Bitte zu vergleichenden MD5 Hash eingeben:")

        self.textMD5Hash = QLineEdit()

        self.buttonCompareMD5 = QPushButton('MD5 Vergleichen')
        self.buttonCompareMD5.clicked.connect(self.compare_md5)

        self.labelIsSame = QLabel()

        layout = QVBoxLayout()
        layout.addWidget(self.labelFileDropper)
        layout.addWidget(self.labelMD5Hash)
        layout.addWidget(self.textMD5Hash)
        layout.addWidget(self.buttonCompareMD5)
        layout.addWidget(self.labelIsSame)

        self.setLayout(layout)
コード例 #18
0
ファイル: event_sender.py プロジェクト: zouye9527/python
    def initUI(self):

        btn1 = QPushButton("Button 1", self)
        btn1.move(30, 50)

        btn2 = QPushButton("Button 2", self)
        btn2.move(150, 50)

        btn1.clicked.connect(self.buttonClicked)
        btn2.clicked.connect(self.buttonClicked)

        self.statusBar()

        self.setGeometry(300, 300, 450, 350)
        self.setWindowTitle('Event sender')
        self.show()
コード例 #19
0
ファイル: pycalc.py プロジェクト: imssyang/python3
 def _createButtons(self):
     """Create the buttons."""
     self.buttons = {}
     buttonsLayout = QGridLayout()
     # Button text | position on the QGridLayout
     buttons = {
         "7": (0, 0),
         "8": (0, 1),
         "9": (0, 2),
         "/": (0, 3),
         "C": (0, 4),
         "4": (1, 0),
         "5": (1, 1),
         "6": (1, 2),
         "*": (1, 3),
         "(": (1, 4),
         "1": (2, 0),
         "2": (2, 1),
         "3": (2, 2),
         "-": (2, 3),
         ")": (2, 4),
         "0": (3, 0),
         "00": (3, 1),
         ".": (3, 2),
         "+": (3, 3),
         "=": (3, 4),
     }
     # Create the buttons and add them to the grid layout
     for btnText, pos in buttons.items():
         self.buttons[btnText] = QPushButton(btnText)
         self.buttons[btnText].setFixedSize(40, 40)
         buttonsLayout.addWidget(self.buttons[btnText], pos[0], pos[1])
     # Add buttonsLayout to the general layout
     self.generalLayout.addLayout(buttonsLayout)
コード例 #20
0
ファイル: ui_widget.py プロジェクト: ervindobri/MyoExercises
    def __init__(self):
        super().__init__()
        self.statusBar = QStatusBar()
        self.restartProcessButton = QPushButton('START Myo Connect')
        self.iconLabel = QLabel()
        self.informationLabel = QLabel(
            'App current information is displayed here...')
        self.left = int(self.screen().size().width() / 4)
        self.top = int(self.screen().size().height() / 4)
        self.width = 640
        self.height = 450

        self.title = 'Myo Exercises'

        if MyoService.check_if_process_running():
            print("Myo Connect is running!")
            self.classifyExercises = ClassifyExercises(
                # subject="Ervin",
                # nr_of_samples=number_of_samples,
                epochs=300,
                # nr_of_gestures=4,
                exercises=PREDEFINED_EXERCISES,
                # batch_size=50,
                training_batch_size=16)
        else:
            self.classifyExercises = None
            # self.informationLabel.setText('Myo Connect is not running! Please start process.')
        self.table_widget = MainTabWidget(self)

        self.initUI()
        self.setStyleSheet("background-color: white;")
コード例 #21
0
    def __init__(self, interactive_matching_widget):
        super(NuggetListWidget, self).__init__(interactive_matching_widget)
        self.interactive_matching_widget = interactive_matching_widget

        self.layout = QVBoxLayout(self)
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.layout.setSpacing(10)

        # top widget
        self.top_widget = QWidget()
        self.top_layout = QHBoxLayout(self.top_widget)
        self.top_layout.setContentsMargins(0, 0, 0, 0)
        self.top_layout.setSpacing(10)
        self.layout.addWidget(self.top_widget)

        self.description = QLabel(
            "Below you see a list of guessed matches for you to confirm or correct."
        )
        self.description.setFont(LABEL_FONT)
        self.top_layout.addWidget(self.description)

        self.stop_button = QPushButton("Continue With Next Attribute")
        self.stop_button.setFont(BUTTON_FONT)
        self.stop_button.clicked.connect(self._stop_button_clicked)
        self.stop_button.setMaximumWidth(240)
        self.top_layout.addWidget(self.stop_button)

        # nugget list
        self.nugget_list = CustomScrollableList(self, NuggetListItemWidget)
        self.layout.addWidget(self.nugget_list)
コード例 #22
0
ファイル: gui.py プロジェクト: kovidgoyal/vise
 def __init__(self, parent=None):
     QWidget.__init__(self, parent)
     self.l = l = QFormLayout(self)
     self.username = u = QLineEdit(self)
     u.textChanged.connect(self.changed.emit)
     l.addRow(_('&Username:'******'Username for this account'))
     self.password = p = QLineEdit(self)
     l.addRow(_('&Password:'******'Password for this account'))
     p.textChanged.connect(self.changed.emit)
     p.setEchoMode(QLineEdit.EchoMode.Password)
     self.show_password = sp = QCheckBox(_('&Show password'))
     l.addWidget(sp)
     sp.toggled.connect(self.show_password_toggled)
     self.la = la = QLabel(_('&Notes:'))
     l.addRow(la)
     self.notes = n = QPlainTextEdit(self)
     la.setBuddy(n)
     n.textChanged.connect(self.changed.emit)
     l.addRow(n)
     self.autosubmit = asb = QCheckBox(
         _('&Auto login with these credentials'), self)
     l.addRow(asb)
     asb.stateChanged.connect(self.on_change)
     self.rb = b = QPushButton(_('&Delete this account'))
     b.clicked.connect(self.delete_requested.emit)
     l.addRow(b)
コード例 #23
0
    def initUi(self):
        self.setWindowTitle('Calculadora Suma 💻')
        self.setFixedSize(300, 400)

        self.lbl_numero_1 = QLabel('Número 1: ', self)
        self.lbl_numero_1.move(50, 50)

        self.lbl_numero_2 = QLabel('Número 2: ', self)
        self.lbl_numero_2.move(50, 100)

        self.txt_numero_1 = QLineEdit(self)
        self.txt_numero_1.setFixedWidth(100)
        self.txt_numero_1.move(150, 50)
        self.txt_numero_1.setValidator(QDoubleValidator())

        self.txt_numero_2 = QLineEdit(self)
        self.txt_numero_2.setFixedWidth(100)
        self.txt_numero_2.move(150, 100)
        self.txt_numero_2.setValidator(QDoubleValidator())

        self.btn_sumar = QPushButton('Sumar', self)
        self.btn_sumar.setFixedWidth(100)
        self.btn_sumar.move(100, 170)
        self.btn_sumar.clicked.connect(self.sumar)  # Evento Click

        self.lbl_resultado = QLabel('Resultado: ', self)
        self.lbl_resultado.move(50, 250)

        self.lbl_resultado = QLabel(self)
        self.lbl_resultado.setFixedWidth(100)
        self.lbl_resultado.move(150, 250)
コード例 #24
0
ファイル: TagBox_Demo.py プロジェクト: alvii147/MangoUI
    def initUI(self):
        self.setGeometry(self.xPos, self.yPos, self.width, self.height)
        self.vBoxLayout = QVBoxLayout()

        self.tagbox = TagBox()
        self.tagbox.addTag('Homelander')
        self.tagbox.addTag('Queen Maeve')
        self.tagbox.addTag('Black Noir')
        self.tagbox.addTag('Transluscent')
        self.tagbox.addTag('A-Train')
        self.tagbox.addTag('The Deep')
        self.vBoxLayout.addWidget(self.tagbox)

        self.tagEdit = QLineEdit()
        self.vBoxLayout.addWidget(self.tagEdit)

        self.addButton = QPushButton()
        self.addButton.setText('Add New Tag')
        self.addButton.clicked.connect(self.addNewTag)
        self.vBoxLayout.addWidget(self.addButton)

        self.centralWidget = QWidget(self)
        self.centralWidget.setLayout(self.vBoxLayout)
        self.setCentralWidget(self.centralWidget)
        self.show()
コード例 #25
0
    def initUI(self):
        self.setWindowTitle("查看回收站文件夹内容")
        self.form = QVBoxLayout()
        for item in iter(self.files):
            ico = QPushButton(set_file_icon(item.name), item.name)
            ico.setStyleSheet(
                "QPushButton {border:none; background:transparent; color:black;}"
            )
            ico.adjustSize()
            it = QLabel(f"<font color='#CCCCCC'>({item.size})</font>")
            hbox = QHBoxLayout()
            hbox.addWidget(ico)
            hbox.addStretch(1)
            hbox.addWidget(it)
            self.form.addLayout(hbox)

        self.form.setSpacing(10)
        self.buttonBox = QDialogButtonBox()
        self.buttonBox.setOrientation(Qt.Orientation.Horizontal)
        self.buttonBox.setStandardButtons(
            QDialogButtonBox.StandardButton.Close)
        self.buttonBox.button(
            QDialogButtonBox.StandardButton.Close).setText("关闭")
        self.buttonBox.setStyleSheet(btn_style)
        self.buttonBox.rejected.connect(self.reject)

        vbox = QVBoxLayout()
        vbox.addLayout(self.form)
        vbox.addStretch(1)
        vbox.addWidget(self.buttonBox)
        self.setLayout(vbox)
コード例 #26
0
    def __init__(self, interactive_matching_widget):
        super(DocumentWidget, self).__init__(interactive_matching_widget)
        self.interactive_matching_widget = interactive_matching_widget

        self.layout = QVBoxLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.layout.setSpacing(10)
        self.setLayout(self.layout)

        self.document = None
        self.current_nugget = None
        self.base_formatted_text = ""
        self.idx_mapper = {}
        self.nuggets_in_order = []

        self.text_edit = QTextEdit()
        self.layout.addWidget(self.text_edit)
        self.text_edit.setReadOnly(True)
        self.text_edit.setFrameStyle(0)
        self.text_edit.setFont(CODE_FONT)
        self.text_edit.setHorizontalScrollBarPolicy(
            Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
        self.text_edit.setText("")

        self.buttons_widget = QWidget()
        self.buttons_widget_layout = QHBoxLayout(self.buttons_widget)
        self.layout.addWidget(self.buttons_widget)

        self.left_button = QPushButton("Skip Left")
        self.left_button.setFont(BUTTON_FONT)
        self.left_button.clicked.connect(self._left_button_clicked)
        self.buttons_widget_layout.addWidget(self.left_button)

        self.right_button = QPushButton("Skip Right")
        self.right_button.setFont(BUTTON_FONT)
        self.right_button.clicked.connect(self._right_button_clicked)
        self.buttons_widget_layout.addWidget(self.right_button)

        self.match_button = QPushButton("Confirm Match")
        self.match_button.setFont(BUTTON_FONT)
        self.match_button.clicked.connect(self._match_button_clicked)
        self.buttons_widget_layout.addWidget(self.match_button)

        self.no_match_button = QPushButton("There Is No Match")
        self.no_match_button.setFont(BUTTON_FONT)
        self.no_match_button.clicked.connect(self._no_match_button_clicked)
        self.buttons_widget_layout.addWidget(self.no_match_button)
コード例 #27
0
    def CreateHorizontalLayout(self):
        self.horizontalGroupBox = QGroupBox("What is your favorite color?")
        layout = QHBoxLayout()

        buttonBlue = QPushButton('Blue', self)
        buttonBlue.clicked.connect(lambda: self.on_click(buttonBlue))
        layout.addWidget(buttonBlue)

        buttonRed = QPushButton('Red', self)
        buttonRed.clicked.connect(lambda: self.on_click(buttonRed))
        layout.addWidget(buttonRed)

        buttonGreen = QPushButton('Green', self)
        buttonGreen.clicked.connect(lambda: self.on_click(buttonGreen))
        layout.addWidget(buttonGreen)

        self.horizontalGroupBox.setLayout(layout)
コード例 #28
0
    def initUi(self):
        self.setWindowTitle('Demo QMessageBox')
        self.setFixedSize(400, 400)

        self.btn_mostrar_mensaje = QPushButton('Mostrar mensaje', self)
        self.btn_mostrar_mensaje.move(125, 150)
        self.btn_mostrar_mensaje.setFixedWidth(150)
        self.btn_mostrar_mensaje.clicked.connect(self.mostrar_mensaje)
コード例 #29
0
 def add_refresh_button(self, name, func):
     layout = self.v_layout
     btn = QPushButton(name, self)
     btn.setMaximumWidth(60)
     layout.insertWidget(0, btn)
     btn.clicked.connect(self._add_items_to_filter)
     btn.clicked.connect(super().accept)
     btn.clicked.connect(func)
コード例 #30
0
ファイル: FirstWin.py プロジェクト: cxinping/PyQt6
 def __init__(self, parent=None):
     super(WinForm, self).__init__(parent)
     self.setGeometry(300, 300, 350, 350)
     self.setWindowTitle('点击按钮关闭窗口')
     quit = QPushButton('Close', self)
     quit.setGeometry(10, 10, 60, 35)
     quit.setStyleSheet("background-color: red")
     quit.clicked.connect(self.close)