Exemplo n.º 1
0
    def __init__(self, parent=None, label="Renamer", text=""):
        super(GetNameWidget, self).__init__(parent)
        self.result = ""
        self.line = LineEdit(label="Rename", placeholder_text=text)

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.line)

        button_layout = QtWidgets.QHBoxLayout()
        # button_group = QtGui.QButtonGroup()
        layout.addLayout(button_layout)

        # sets the default button at confirm
        button = QtWidgets.QPushButton("Confirm")
        button.setDefault(True)
        button.setFocus()

        # adds the cancel button
        cancel = QtWidgets.QPushButton("Cancel")
        button.clicked.connect(self.rename_call)
        cancel.clicked.connect(self.close_ui)
        button_layout.addWidget(button)
        button_layout.addWidget(cancel)

        self.setWindowTitle(label)
        self.setLayout(layout)
Exemplo n.º 2
0
 def build(self):
     """
     builds the widget with stuff.
     :return: <bool> True for success.
     """
     self.widgets['label'] = QtWidgets.QLabel("Intentionally Empty")
     self.widgets['instructions'] = QtWidgets.QVBoxLayout()
     self.widgets['updateButton'] = QtWidgets.QPushButton("Update")
     self.main_layout.addLayout(self.widgets['instructions'])
     self.widgets['instructions'].insertStretch(0)
     self.widgets['instructions'].addWidget(self.widgets['label'])
     self.main_layout.addWidget(self.widgets['updateButton'])
     return True
Exemplo n.º 3
0
    def __init__(self, parent=None, list_items=()):
        super(ModulesList, self).__init__(parent)
        self.selected_item = None

        self.list_items = list_items

        vertical_layout = QtWidgets.QVBoxLayout()
        self.list_widget = QtWidgets.QListWidget()
        vertical_layout.addWidget(self.list_widget)

        horizontal_layout = QtWidgets.QHBoxLayout()
        self.ok_button = QtWidgets.QPushButton("Ok")
        self.cancel_button = QtWidgets.QPushButton("Cancel")
        horizontal_layout.addWidget(self.ok_button)
        horizontal_layout.addWidget(self.cancel_button)

        vertical_layout.addLayout(horizontal_layout)

        self.list_widget.addItems(self.list_items)

        self.create_connections()

        self.setLayout(vertical_layout)
        self.setWindowTitle("Modules List")
Exemplo n.º 4
0
 def add_delete_button():
     """
     adds a push button.
     :return: <QtWidgets.QPushButton>
     """
     return QtWidgets.QPushButton("Remove")
Exemplo n.º 5
0
 def add_build_button():
     """
     adds a push button.
     :return: <QtWidgets.QPushButton>
     """
     return QtWidgets.QPushButton("Build")