def user_map(self):
     """Slot to show user map from bgg to ludopedia"""
     user_map_dialog = QDialog(self)
     user_map_dialog.setModal(True)
     bgg_to_ludo = self.get_bgg_to_ludo_users()
     user_list = [f'{key} -> {value}' for key, value in bgg_to_ludo.items()]
     list_widget = QListWidget(user_map_dialog)
     list_widget.addItems(user_list)
     list_widget.setResizeMode(QListView.Adjust)
     list_widget.sortItems()
     grid_layout = QGridLayout(user_map_dialog)
     grid_layout.addWidget(list_widget, 1, 1)
     user_map_dialog.resize(400, 400)
     user_map_dialog.show()
Esempio n. 2
0
    def __init__(self, parent, nchan, methods):
        super().__init__(parent)
        self.setWindowTitle("Run ICA")

        vbox = QVBoxLayout(self)
        grid = QGridLayout()
        grid.addWidget(QLabel("Method:"), 0, 0)
        self.method = QComboBox()
        self.method.addItems(methods)
        self.method.setCurrentIndex(0)
        self.method.currentIndexChanged.connect(self.toggle_options)
        grid.addWidget(self.method, 0, 1)

        self.extended_label = QLabel("Extended:")
        grid.addWidget(self.extended_label, 1, 0)
        self.extended = QCheckBox()
        self.extended.setChecked(True)
        grid.addWidget(self.extended, 1, 1)

        self.ortho_label = QLabel("Orthogonal:")
        grid.addWidget(self.ortho_label, 2, 0)
        self.ortho = QCheckBox()
        self.ortho.setChecked(False)
        grid.addWidget(self.ortho, 2, 1)
        if "Picard" not in methods:
            self.ortho_label.hide()
            self.ortho.hide()

        grid.addWidget(QLabel("Number of components:"), 3, 0)
        self.n_components = QSpinBox()
        self.n_components.setRange(0, nchan)
        self.n_components.setValue(nchan)
        self.n_components.setAlignment(Qt.AlignRight)
        grid.addWidget(self.n_components, 3, 1)

        grid.addWidget(QLabel("Exclude bad segments:"), 4, 0)
        self.exclude_bad_segments = QCheckBox()
        self.exclude_bad_segments.setChecked(True)
        grid.addWidget(self.exclude_bad_segments, 4, 1)

        vbox.addLayout(grid)

        buttonbox = QDialogButtonBox(QDialogButtonBox.Ok
                                     | QDialogButtonBox.Cancel)
        vbox.addWidget(buttonbox)
        buttonbox.accepted.connect(self.accept)
        buttonbox.rejected.connect(self.reject)
        vbox.setSizeConstraint(QVBoxLayout.SetFixedSize)

        self.toggle_options()
Esempio n. 3
0
    def __init__(self):
        super().__init__()

        ## declared variables
        self.dir_path = "None selected"
        self.filelist = ["Select Folder"]
        self.filelistindex = None

        self.setWindowTitle("Ephys-Quick Analysis")

        layout = QGridLayout()

        toolbar = QToolBar("Function toolbar")
        self.addToolBar(toolbar)
        self.folderbuttonsetup()
        toolbar.addAction(self.folderbutton)
        self.setStatusBar(QStatusBar(self))

        self.filebox = QComboBox()
        self.filebox.addItems(self.filelist)
        layout.addWidget(self.filebox, 0, 0, 1, 2)

        self.tracelabel = QLabel("Sweep number :")
        layout.addWidget(self.tracelabel, 0, 2)

        self.sweepslider = QSpinBox()
        self.sweepslider.setMinimum(0)
        self.sweepslider.setSingleStep(1)
        layout.addWidget(self.sweepslider, 0, 3, 1, 2)

        self.pw = pg.PlotWidget(name='Clamp')  ## giving the plots names allows us to link their axes together
        layout.addWidget(self.pw, 1, 0, 2, 5)
        self.pw2 = pg.PlotWidget(name='ClampZoom')  ## giving the plots names allows us to link their axes together
        layout.addWidget(self.pw2, 1, 6, 2, 5)
        self.pw3 = pg.PlotWidget(name='Stim')
        layout.addWidget(self.pw3, 6, 0, 2, 5)
        self.pw3.setXLink(self.pw)
        self.pw4 = pg.PlotWidget(name='StimZoom')
        layout.addWidget(self.pw4, 6, 6, 2, 5)
        self.pw4.setXLink(self.pw2)

        self.pw.setBackground('w')
        self.pw2.setBackground('w')
        self.pw3.setBackground('w')
        self.pw4.setBackground('w')

        widget = QWidget()
        widget.setLayout(layout)
        self.setCentralWidget(widget)
Esempio n. 4
0
    def setupUi(self, Dialog):
        if not Dialog.objectName():
            Dialog.setObjectName(u"Dialog")
        Dialog.resize(500, 400)
        Dialog.setSizeGripEnabled(False)
        self.main_layout = QVBoxLayout(Dialog)
        self.main_layout.setObjectName(u"main_layout")
        self.scrollArea = QScrollArea(Dialog)
        self.scrollArea.setObjectName(u"scrollArea")
        self.scrollArea.setWidgetResizable(True)
        self.credits_list = QWidget()
        self.credits_list.setObjectName(u"credits_list")
        self.credits_list.setGeometry(QRect(0, 0, 480, 349))
        self.credits_layout = QGridLayout(self.credits_list)
        self.credits_layout.setObjectName(u"credits_layout")
        self.version_label = QLabel(self.credits_list)
        self.version_label.setObjectName(u"version_label")
        self.version_label.setAlignment(Qt.AlignRight | Qt.AlignTrailing
                                        | Qt.AlignVCenter)

        self.credits_layout.addWidget(self.version_label, 0, 0, 1, 1)

        self.version = QLabel(self.credits_list)
        self.version.setObjectName(u"version")
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.version.sizePolicy().hasHeightForWidth())
        self.version.setSizePolicy(sizePolicy)

        self.credits_layout.addWidget(self.version, 0, 1, 1, 1)

        self.scrollArea.setWidget(self.credits_list)

        self.main_layout.addWidget(self.scrollArea)

        self.buttonBox = QDialogButtonBox(Dialog)
        self.buttonBox.setObjectName(u"buttonBox")
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Ok)

        self.main_layout.addWidget(self.buttonBox)

        self.retranslateUi(Dialog)
        self.buttonBox.accepted.connect(Dialog.accept)
        self.buttonBox.rejected.connect(Dialog.reject)

        QMetaObject.connectSlotsByName(Dialog)
Esempio n. 5
0
 def _setup_room_widget(self, room: Room):
     _grp = QGroupBox(title=room.name)
     _layout = QGridLayout()
     _row_num = 0
     for _light in room.lights:
         _lc = LightControl(_light)
         self._light_ctrl.append(_lc)
         _lbl = QLabel(f" > {_light.name}")
         _layout.addWidget(_lbl, _row_num, 0)
         _layout.addWidget(_lc.toggle_btn, _row_num, 1)
         _layout.addWidget(_lc.show_color_picker_btn, _row_num, 2)
         _layout.addWidget(_lc.slider, _row_num, 3)
         _row_num += 1
     _grp.setLayout(_layout)
     return _grp
Esempio n. 6
0
    def __init__(self) -> None:
        super().__init__()

        main_layout = QGridLayout()
        button_box = self._create_button_box()
        main_layout.addWidget(self._create_options_group_box(), 0, 0)
        main_layout.addWidget(button_box, 1, 0)

        main_layout.setSizeConstraint(QLayout.SetMinimumSize)

        self.setLayout(main_layout)

        self._refresh_model_info()
        self.setWindowTitle('Predict')
        self._plot_window = QMainWindow()
Esempio n. 7
0
 def __init__(self):
     super().__init__()
     self.setWindowTitle("Example")
     self.layout = QGridLayout()
     self.layout.setContentsMargins(6, 6, 6, 6)
     self.layout.addWidget(QTableWidget(), 0, 0, 1, 3)
     self.loading_bar = QProgressBar()
     self.loading_bar.setTextVisible(False)
     self.loading_bar.setValue(25)
     self.layout.addWidget(self.loading_bar, 1, 0, 1, 1)
     self.refresh_btn = FixedWindowsButton("Refresh")
     self.layout.addWidget(self.refresh_btn, 1, 1, 1, 1)
     self.execute_btn = FixedWindowsButton("Execute")
     self.layout.addWidget(self.execute_btn, 1, 2, 1, 1)
     self.setLayout(self.layout)
Esempio n. 8
0
    def __init__(self):
        super(MainWindow, self).__init__()

        self.setWindowTitle("My App")

        layout = QGridLayout()

        layout.addWidget(Color("red"), 0, 0)
        layout.addWidget(Color("green"), 1, 0)
        layout.addWidget(Color("blue"), 1, 1)
        layout.addWidget(Color("purple"), 2, 1)

        widget = QWidget()
        widget.setLayout(layout)

        self.setCentralWidget(widget)
    def createRotableGroupBox(self):
        self.rotableGroupBox = QGroupBox("Rotable Widgets")

        self.rotableWidgets.append(QSpinBox())
        self.rotableWidgets.append(QSlider())
        self.rotableWidgets.append(QDial())
        self.rotableWidgets.append(QProgressBar())
        count = len(self.rotableWidgets)
        for i in range(count):
            self.rotableWidgets[i].valueChanged[int].\
                connect(self.rotableWidgets[(i+1) % count].setValue)

        self.rotableLayout = QGridLayout()
        self.rotableGroupBox.setLayout(self.rotableLayout)

        self.rotateWidgets()
Esempio n. 10
0
    def __init__(self, board_size: int = 4) -> None:
        """
        Creates a 2048 board
        Args:
            board (Table[Table[int]]) = The 2048 game board

        Returns (QtWidgets.QWidget) = The game board as qt widget
        """
        super().__init__()
        self.board = QGridLayout(self)
        self.board_size = 100
        self._font_size = round(self.board_size / 5)
        self._default_bg_color = COLORSET_2[0]
        self._default_color = "#" + contrasting_text_color(
            self._default_bg_color[1:])
        self.__create_cells(board_size)
Esempio n. 11
0
    def __init__(self, db: SqlDB):
        super().__init__()
        self.setWidgetResizable(True)
        self.db = db
        self.icons = Icons()

        base = QWidget(self)
        base.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self.setWidget(base)
        grid = QGridLayout()
        base.setLayout(grid)
        row = 0

        # _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
        # TEST Label
        test = QLabel('TEST')
        test.setStyleSheet(
            "QLabel {font-size:14pt; padding: 0 2px; background: #ddf;}")
        test.setFrameStyle(QFrame.StyledPanel | QFrame.Plain)
        grid.addWidget(test, row, 0, 1, 2)
        row += 1

        # ---------------------------------------------------------------------
        # SUPPLIER dump
        lab_dump_supplier = QLabel('DUMP table supplier')
        lab_dump_supplier.setStyleSheet(
            "QLabel {font-size:10pt; padding: 0 2px;}")
        but_dump_supplier = QPushButton()
        but_dump_supplier.setIcon(QIcon(self.icons.PLAY))
        but_dump_supplier.setSizePolicy(QSizePolicy.Fixed,
                                        QSizePolicy.Expanding)
        but_dump_supplier.clicked.connect(self.on_click_dump_supplier)
        grid.addWidget(lab_dump_supplier, row, 0)
        grid.addWidget(but_dump_supplier, row, 1)
        row += 1

        # ---------------------------------------------------------------------
        # PART dump
        lab_dump_part = QLabel('DUMP table part')
        lab_dump_part.setStyleSheet("QLabel {font-size:10pt; padding: 0 2px;}")
        but_dump_part = QPushButton()
        but_dump_part.setIcon(QIcon(self.icons.PLAY))
        but_dump_part.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)
        but_dump_part.clicked.connect(self.on_click_dump_part)
        grid.addWidget(lab_dump_part, row, 0)
        grid.addWidget(but_dump_part, row, 1)
        row += 1
Esempio n. 12
0
    def __init__(self):
        super().__init__()
        self.setWindowTitle('嵌套布局示例')

        # 全局布局(1个):水平
        wlayout = QHBoxLayout()
        # 局部布局(4个):水平、竖直、网格、表单
        hlayout = QHBoxLayout()
        vlayout = QVBoxLayout()
        glayout = QGridLayout()
        formlayout = QFormLayout()

        # 局部布局添加部件(例如:按钮)
        hlayout.addWidget(QPushButton(str(1)))
        hlayout.addWidget(QPushButton(str(2)))
        vlayout.addWidget(QPushButton(str(3)))
        vlayout.addWidget(QPushButton(str(4)))
        glayout.addWidget(QPushButton(str(5)), 0, 0)
        glayout.addWidget(QPushButton(str(6)), 0, 1)
        glayout.addWidget(QPushButton(str(7)), 1, 0)
        glayout.addWidget(QPushButton(str(8)), 1, 1)
        formlayout.addWidget(QPushButton(str(9)))
        formlayout.addWidget(QPushButton(str(10)))
        formlayout.addWidget(QPushButton(str(11)))
        formlayout.addWidget(QPushButton(str(12)))

        # 准备四个部件
        hwg = QWidget()
        vwg = QWidget()
        gwg = QWidget()
        fwg = QWidget()

        # 四个部件设置局部布局
        hwg.setLayout(hlayout)
        vwg.setLayout(vlayout)
        gwg.setLayout(glayout)
        fwg.setLayout(formlayout)

        # 四个部件加至全局布局
        wlayout.addWidget(hwg)
        wlayout.addWidget(vwg)
        wlayout.addWidget(gwg)
        wlayout.addWidget(fwg)

        # 窗体本体设置全局布局
        self.setLayout(wlayout)
Esempio n. 13
0
    def __init__(self, parent, compatibles, title="Append data"):
        super().__init__(parent)
        self.setWindowTitle(title)

        vbox = QVBoxLayout(self)
        grid = QGridLayout()

        grid.addWidget(QLabel("Source"), 0, 0, Qt.AlignCenter)
        grid.addWidget(QLabel("Destination"), 0, 2, Qt.AlignCenter)

        self.source = QListWidget(self)
        self.source.setAcceptDrops(True)
        self.source.setDragEnabled(True)
        self.source.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.source.setDefaultDropAction(Qt.DropAction.MoveAction)
        self.source.insertItems(0, [d["name"] for d in compatibles])
        grid.addWidget(self.source, 1, 0)

        self.move_button = QPushButton("→")
        self.move_button.setEnabled(False)
        grid.addWidget(self.move_button, 1, 1, Qt.AlignHCenter)

        self.destination = QListWidget(self)
        self.destination.setAcceptDrops(True)
        self.destination.setDragEnabled(True)
        self.destination.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.destination.setDefaultDropAction(Qt.DropAction.MoveAction)
        grid.addWidget(self.destination, 1, 2)
        vbox.addLayout(grid)

        self.buttonbox = QDialogButtonBox(QDialogButtonBox.Ok
                                          | QDialogButtonBox.Cancel)
        self.buttonbox.accepted.connect(self.accept)
        self.buttonbox.rejected.connect(self.reject)

        vbox.addWidget(self.buttonbox)
        vbox.setSizeConstraint(QVBoxLayout.SetFixedSize)
        self.destination.model().rowsInserted.connect(self.toggle_ok_button)
        self.destination.model().rowsRemoved.connect(self.toggle_ok_button)
        self.source.itemSelectionChanged.connect(self.toggle_move_source)
        self.destination.itemSelectionChanged.connect(
            self.toggle_move_destination)
        self.move_button.clicked.connect(self.move)
        self.toggle_ok_button()
        self.toggle_move_source()
        self.toggle_move_destination()
Esempio n. 14
0
    def setupWidgets(self):
        """
        Set up the widgets and layouts for interface.
        """
        dir_label = QLabel("Choose Directory:")
        self.dir_line_edit = QLineEdit()

        dir_button = QPushButton('...')
        dir_button.setToolTip("Select file directory.")
        dir_button.clicked.connect(self.setDirectory)

        self.change_name_edit = QLineEdit()
        self.change_name_edit.setToolTip(
            "Files will be appended with numerical values.For example: filename <b> 01 </b >.jpg")
        self.change_name_edit.setPlaceholderText("Change file names to...")

        rename_button = QPushButton("Rename Files")
        rename_button.setToolTip("Begin renaming files in directory.")
        rename_button.clicked.connect(self.renameFiles)

        file_exts = [".jpg", ".jpeg", ".png", ".gif", ".txt"]

        # Create combo box for selecting file extensions.
        ext_cb = QComboBox()
        self.cb_value = file_exts[0]
        ext_cb.setToolTip("Only files with this extension will be changed.")
        ext_cb.addItems(file_exts)
        ext_cb.currentTextChanged.connect(self.updateCbValue)

        # Text edit is for displaying the file names as they are updated.
        self.display_files_edit = QTextEdit()
        self.display_files_edit.setReadOnly(True)
        self.progress_bar = QProgressBar()
        self.progress_bar.setValue(0)

        # Set layout and widgets.
        grid = QGridLayout()
        grid.addWidget(dir_label, 0, 0)
        grid.addWidget(self.dir_line_edit, 1, 0, 1, 2)
        grid.addWidget(dir_button, 1, 2)
        grid.addWidget(self.change_name_edit, 2, 0)
        grid.addWidget(ext_cb, 2, 1)
        grid.addWidget(rename_button, 2, 2)
        grid.addWidget(self.display_files_edit, 3, 0, 1, 3)
        grid.addWidget(self.progress_bar, 4, 0, 1, 3)
        self.setLayout(grid)
Esempio n. 15
0
    def __init__(self) -> None:
        super().__init__()

        self._pool = QThreadPool.globalInstance()

        self._init_options_group_box()
        self._init_button_box()

        main_layout = QGridLayout()
        main_layout.addWidget(self._options_group_box, 0, 0)
        main_layout.addWidget(self._button_box, 1, 0)
        main_layout.setSizeConstraint(QLayout.SetMinimumSize)

        self._main_layout = main_layout
        self.setLayout(self._main_layout)

        self.setWindowTitle('Train Model')
Esempio n. 16
0
 def __init__(self, parent, header):
     super(HeaderWidget, self).__init__(parent)
     layout = QGridLayout()
     layout.setContentsMargins(0, 0, 0, 0)
     layout.setVerticalSpacing(1)
     row = 0
     col = 0
     for field in header.fields:
         name = field[0]
         value = field[1]
         fieldType = ""
         if len(field) > 2:
             fieldType = field[2]
         layout.addWidget(QLabel(name + ": "), row, col * 3)
         if isinstance(value, list):
             for i in range(0, len(value)):
                 if fieldType == "ptr":
                     label = ClickableAddressLabel(value[i])
                 elif fieldType == "code":
                     label = ClickableCodeLabel(value[i])
                 else:
                     label = QLabel(value[i])
                     label.setFont(binaryninjaui.getMonospaceFont(self))
                 layout.addWidget(label, row, col * 3 + 1)
                 row += 1
         else:
             if fieldType == "ptr":
                 label = ClickableAddressLabel(value)
             elif fieldType == "code":
                 label = ClickableCodeLabel(value)
             else:
                 label = QLabel(value)
                 label.setFont(binaryninjaui.getMonospaceFont(self))
             layout.addWidget(label, row, col * 3 + 1)
             row += 1
         if (header.columns > 1) and (row >= header.rows_per_column) and (
             (col + 1) < header.columns):
             row = 0
             col += 1
     for col in range(1, header.columns):
         layout.setColumnMinimumWidth(
             col * 3 - 1,
             UIContext.getScaledWindowSize(20, 20).width())
     layout.setColumnStretch(header.columns * 3 - 1, 1)
     self.setLayout(layout)
Esempio n. 17
0
    def createOptionsGroupBox(self):
        self.optionsGroupBox = QGroupBox("Options")

        buttonsOrientationLabel = QLabel("Orientation of buttons:")

        buttonsOrientationComboBox = QComboBox()
        buttonsOrientationComboBox.addItem("Horizontal", Qt.Horizontal)
        buttonsOrientationComboBox.addItem("Vertical", Qt.Vertical)
        buttonsOrientationComboBox.currentIndexChanged[int].connect(
            self.buttonsOrientationChanged)

        self.buttonsOrientationComboBox = buttonsOrientationComboBox

        optionsLayout = QGridLayout()
        optionsLayout.addWidget(buttonsOrientationLabel, 0, 0)
        optionsLayout.addWidget(self.buttonsOrientationComboBox, 0, 1)
        optionsLayout.setColumnStretch(2, 1)
        self.optionsGroupBox.setLayout(optionsLayout)
Esempio n. 18
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        self.setWindowTitle('About')

        textElement = QLabel(
            "For more information, visit: https://github.com/noobiept/screen_ruler\n\n"
            "You can find there a readme (with the documentation), the source code, and an issues tracker,\n"
            "where you can write suggestions or problems with the application.\n\n"
            "Thanks for using this program.")
        textElement.setTextInteractionFlags(Qt.TextSelectableByMouse
                                            | Qt.TextSelectableByKeyboard)

        layout = QGridLayout()
        layout.addWidget(textElement)
        layout.setSizeConstraint(QLayout.SetFixedSize)

        self.setLayout(layout)
Esempio n. 19
0
    def __init__(self, parent, channels, default_stim):
        super().__init__(parent)
        self.setWindowTitle("Find Events")
        vbox = QVBoxLayout(self)
        grid = QGridLayout()

        grid.addWidget(QLabel("Stim channel:"), 0, 0)
        self.stimchan = QComboBox()
        self.stimchan.addItems(channels)
        self.stimchan.setCurrentIndex(default_stim)
        grid.addWidget(self.stimchan, 0, 1)

        grid.addWidget(QLabel("Consecutive"), 1, 0)
        self.consecutive = QCheckBox()
        self.consecutive.setChecked(True)
        grid.addWidget(self.consecutive, 1, 1)

        grid.addWidget(QLabel("Initial event"), 2, 0)
        self.initial_event = QCheckBox()
        self.initial_event.setChecked(True)
        grid.addWidget(self.initial_event, 2, 1)

        grid.addWidget(QLabel("Cast to unsigned integer"), 3, 0)
        self.uint_cast = QCheckBox()
        self.uint_cast.setChecked(True)
        grid.addWidget(self.uint_cast, 3, 1)

        grid.addWidget(QLabel("Minimum duration:"), 4, 0)
        self.minduredit = QSpinBox()
        self.minduredit.setMaximum(MAX_INT)
        grid.addWidget(self.minduredit, 4, 1)

        grid.addWidget(QLabel("Shortest event:"), 5, 0)
        self.shortesteventedit = QSpinBox()
        self.shortesteventedit.setMaximum(MAX_INT)
        grid.addWidget(self.shortesteventedit, 5, 1)

        vbox.addLayout(grid)
        buttonbox = QDialogButtonBox(QDialogButtonBox.Ok
                                     | QDialogButtonBox.Cancel)
        vbox.addWidget(buttonbox)
        buttonbox.accepted.connect(self.accept)
        buttonbox.rejected.connect(self.reject)
        vbox.setSizeConstraint(QVBoxLayout.SetFixedSize)
    def initUI(self):
        """
        Init widget

        """
        grid = QGridLayout()
        hbox = QHBoxLayout()
        hbox.addSpacing(2)

        self._buttonBack = QPushButton(QIcon(PATH_IMAGE_BACK_NEDDLE), "", self)
        self._buttonBack.clicked.connect(self.signalController.back2menu)
        hbox.addWidget(self._buttonBack, 0, QtCore.Qt.AlignLeft)

        self.label = QLabel("SettingsView")
        hbox.addWidget(self.label, 1, QtCore.Qt.AlignCenter)

        grid.addLayout(hbox, 0, 0, QtCore.Qt.AlignTop)

        jsonDataSettings = self.get_settings(None)

        # TODO: Possibility to change settings via this widget
        #self._labels_settings = []

        counter = 1

        for name in jsonDataSettings:
            single = jsonDataSettings[name]

            translated = single[self.TRANSLATED]
            value = single[self.VALUE]

            newLabel = QLabel(name.replace('_', ' '))
            if translated:
                secondLabel = QLabel(QKeySequence(value).toString())
            else:
                secondLabel = QLabel(str(value))

            grid.addWidget(newLabel, counter, 0, QtCore.Qt.AlignLeft)
            grid.addWidget(secondLabel, counter, 1, QtCore.Qt.AlignRight)

            counter += 1

        self.setLayout(grid)
        self.setWindowTitle("Game settings")
Esempio n. 21
0
    def setupUi(self, UpdateQuotesDlg):
        if not UpdateQuotesDlg.objectName():
            UpdateQuotesDlg.setObjectName(u"UpdateQuotesDlg")
        UpdateQuotesDlg.setWindowModality(Qt.ApplicationModal)
        UpdateQuotesDlg.resize(256, 107)
        self.gridLayout = QGridLayout(UpdateQuotesDlg)
        self.gridLayout.setObjectName(u"gridLayout")
        self.StartDateLbl = QLabel(UpdateQuotesDlg)
        self.StartDateLbl.setObjectName(u"StartDateLbl")

        self.gridLayout.addWidget(self.StartDateLbl, 0, 0, 1, 1)

        self.StartDateEdit = QDateEdit(UpdateQuotesDlg)
        self.StartDateEdit.setObjectName(u"StartDateEdit")
        self.StartDateEdit.setCalendarPopup(True)
        self.StartDateEdit.setTimeSpec(Qt.UTC)

        self.gridLayout.addWidget(self.StartDateEdit, 0, 1, 1, 1)

        self.buttonBox = QDialogButtonBox(UpdateQuotesDlg)
        self.buttonBox.setObjectName(u"buttonBox")
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok)

        self.gridLayout.addWidget(self.buttonBox, 2, 1, 1, 1)

        self.EndDateLbl = QLabel(UpdateQuotesDlg)
        self.EndDateLbl.setObjectName(u"EndDateLbl")

        self.gridLayout.addWidget(self.EndDateLbl, 1, 0, 1, 1)

        self.EndDateEdit = QDateEdit(UpdateQuotesDlg)
        self.EndDateEdit.setObjectName(u"EndDateEdit")
        self.EndDateEdit.setCalendarPopup(True)
        self.EndDateEdit.setTimeSpec(Qt.UTC)

        self.gridLayout.addWidget(self.EndDateEdit, 1, 1, 1, 1)


        self.retranslateUi(UpdateQuotesDlg)
        self.buttonBox.accepted.connect(UpdateQuotesDlg.accept)
        self.buttonBox.rejected.connect(UpdateQuotesDlg.reject)

        QMetaObject.connectSlotsByName(UpdateQuotesDlg)
 def create_login_group(self):
     """Create labels and line edits for providing BGG and ludopedia login information"""
     (self.bgg_user_line_edit,
      bgg_user_label) = self.create_qlineedit('Usuario BoardGameGeek:')
     (self.ludo_mail_line_edit,
      ludo_mail_label) = self.create_qlineedit('E-mail Ludopedia:')
     (self.ludo_pass_line_edit,
      ludo_pass_label) = self.create_qlineedit('Senha Ludopedia:')
     self.ludo_pass_line_edit.setEchoMode(QLineEdit.PasswordEchoOnEdit)
     group_box = QGroupBox('Login')
     grid_layout = QGridLayout(group_box)
     grid_layout.addWidget(bgg_user_label, 1, 1)
     grid_layout.addWidget(self.bgg_user_line_edit, 1, 2)
     grid_layout.addWidget(ludo_mail_label, 2, 1)
     grid_layout.addWidget(self.ludo_mail_line_edit, 2, 2)
     grid_layout.addWidget(ludo_pass_label, 3, 1)
     grid_layout.addWidget(self.ludo_pass_line_edit, 3, 2)
     group_box.setLayout(grid_layout)
     return group_box
Esempio n. 23
0
    def makeUI(self):

        self.setWindowTitle(self.title)
        self.setGeometry(self.left, self.top, self.width, self.height)
        self.createLayout()

        windowLayout = QGridLayout()

        windowLayout.addWidget(self.box0, 1, 1, 1, 1)
        windowLayout.addWidget(self.box4, 0, 0, 1, 1)
        windowLayout.addWidget(self.box6, 1, 0, 1, 1)
        windowLayout.addWidget(self.box7, 0, 1, 1, 1)
        windowLayout.addWidget(self.box5, 3, 0, 1, 2)
        windowLayout.addWidget(self.box8, 2, 0, 1, 2)

        windowLayout.setAlignment(QtCore.Qt.AlignTop)

        self.setLayout(windowLayout)
        self.show()
Esempio n. 24
0
    def __init__(self):
        super(Dialog, self).__init__()

        self.rotableWidgets = []

        self.createRotableGroupBox()
        self.createOptionsGroupBox()
        self.createButtonBox()

        mainLayout = QGridLayout()
        mainLayout.addWidget(self.rotableGroupBox, 0, 0)
        mainLayout.addWidget(self.optionsGroupBox, 1, 0)
        mainLayout.addWidget(self.buttonBox, 2, 0)
        mainLayout.setSizeConstraint(QLayout.SetMinimumSize)

        self.mainLayout = mainLayout
        self.setLayout(self.mainLayout)

        self.setWindowTitle("Dynamic Layouts")
Esempio n. 25
0
    def __init__(self, parent=None):
        QWizardPage.__init__(self, parent)
        self.setTitle("Select the data source(s) to analyze:")

        self.label = QLabel("<b>Images are not required.</b><br> However, if they"+
                            " are not present, then bounded metrics will be calculated from the bounding rectangle"
                            " of the provided coordinates.")
        self.label.setWordWrap(True)
        self.label.setTextFormat(Qt.RichText)
        self.label.setAlignment(Qt.AlignCenter)

        self.file_dir_form = QGridLayout()

        self.coord_label = QLineEdit()
        self.coord_label.setReadOnly(True)
        self.coord_label.text()
        self.coord_butt = QPushButton("Select...")

        self._coord_path = ""

        self.image_label = QLineEdit()
        self.image_label.setReadOnly(True)
        #self.image_label.setMaximumWidth()
        self.image_butt = QPushButton("Select...")
        self.image_path = ""

        self.file_dir_form.addWidget(self.coord_label, 0, 0)
        self.file_dir_form.addWidget(self.coord_butt, 0, 1)
        self.file_dir_form.addWidget(self.image_label, 1, 0)
        self.file_dir_form.addWidget(self.image_butt, 1, 1)

        self.v_layout = QVBoxLayout()
        self.v_layout.setSpacing(32)
        self.v_layout.addWidget(self.label)
        self.v_layout.addLayout(self.file_dir_form)

        self.file_dir_form.setSpacing(4)

        self.setLayout(self.v_layout)

        self.butt_signal
        self.coord_butt.clicked.connect(self.select_coord_path)
        self.image_butt.clicked.connect(self.select_image_path)
Esempio n. 26
0
def createRegistrationPage():
    page = QWizardPage()
    page.setTitle("Registration")
    page.setSubTitle("Please fill both fields.")

    nameLabel = QLabel("Name:")
    nameLineEdit = QLineEdit()

    emailLabel = QLabel("Email address:")
    emailLineEdit = QLineEdit()

    layout = QGridLayout()
    layout.addWidget(nameLabel, 0, 0)
    layout.addWidget(nameLineEdit, 0, 1)
    layout.addWidget(emailLabel, 1, 0)
    layout.addWidget(emailLineEdit, 1, 1)
    page.setLayout(layout)

    return page
Esempio n. 27
0
    def __init__(self,
                 title: str,
                 initially_folded: bool = True,
                 parent: QWidget = None):
        super().__init__(parent)

        self._folded = initially_folded

        self._toggleButton = QToolButton(self)
        self._toggleButton.setStyleSheet("QToolButton { height: 20px; }")
        font = self._toggleButton.font()
        font.setBold(True)
        font.setPixelSize(13)
        self._toggleButton.setFont(font)
        self._toggleButton.setMaximumHeight(20)
        self._toggleButton.setToolButtonStyle(
            Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
        self._toggleButton.setArrowType(Qt.ArrowType.RightArrow)
        self._toggleButton.setText(title)
        self._toggleButton.setCheckable(True)
        self._toggleButton.setChecked(False)
        self._toggleButton.clicked.connect(self._on_click)

        self._headerLine = QFrame(self)
        self._headerLine.setFrameShape(QFrame.HLine)
        self._headerLine.setSizePolicy(QSizePolicy.Expanding,
                                       QSizePolicy.Maximum)

        self._contentArea = QFrame(self)
        self._contentArea.setObjectName("foldable_contentArea")
        self._contentArea.setStyleSheet(
            "#foldable_contentArea { border: none; }")
        self._contentArea.setSizePolicy(QSizePolicy.Expanding,
                                        QSizePolicy.Minimum)

        self._mainLayout = QGridLayout(self)
        self._mainLayout.setVerticalSpacing(0)
        self._mainLayout.setContentsMargins(0, 0, 0, 0)
        self._mainLayout.addWidget(self._toggleButton, 0, 0, 1, 1,
                                   Qt.AlignLeft)
        self._mainLayout.addWidget(self._headerLine, 0, 1, 1, 1)
        self._mainLayout.addWidget(self._contentArea, 1, 0, 1, 2)
Esempio n. 28
0
    def __init__(self):
        QMainWindow.__init__(self)

        # TODO: temp paths
        self.artistPath = "img\\artist\\"
        self.languagePath = "img\\language\\"
        self.songPath = "lib\\"

        # Database startup
        startUp()

        # Start Song Queue List
        self.songQueue = SongQueue()

        # Start Media Player
        self.mediaPlayer = MediaPlayer(self.songQueue, self.setMarquee, self)

        # Set the colour of the window
        self.setStyleSheet("MainWindow { background-color: rgb(25, 33, 60)}")

        # Create layout and set margins/spacings
        self.layout = QGridLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.layout.setSpacing(0)

        # Create overlays of the application
        self.overlayTop = OverlayTop(self)
        self.overlayBottom = OverlayBottom(self)

        # Add overlays to layout
        self.layout.addWidget(self.overlayTop, 0, 0)
        self.layout.addWidget(self.overlayBottom, 2, 0)

        # Create home page then add to layout
        self.content = WindowHome(self)
        self.layout.addWidget(self.content, 1, 0)

        # Create widget, then set layout to widget which gets added as central widget
        window = QWidget()
        window.setLayout(self.layout)
        self.setCentralWidget(window)
        self.mediaPlayer.start()
Esempio n. 29
0
 def __init__(self):
     super().__init__()
     # 设置属性
     self.resize(400, 300)
     self.setWindowTitle("测试Qt进度条和aria2的联合")
     # 注册组件
     self.labelUrl = QLabel("下载链接")
     self.lineEditorUrl = QLineEdit(
         "https://download.cnki.net/CAJViewer-x86_64-buildubuntu1604-210401.AppImage"
     )
     self.labelProgress = QLabel("下载进度")
     self.downloadProgress = QProgressBar()
     self.textResult = QTextBrowser()
     self.buttonStart = QPushButton("开始")
     self.buttonPause = QPushButton("暂停")
     self.buttonUnpause = QPushButton("继续")
     self.buttonRemove = QPushButton("移除")
     self.buttonDebug = QPushButton("Debug")
     # 设置组件
     self.lineEditorUrl.setClearButtonEnabled(True)
     self.buttonStart.setIcon(self.style().standardIcon(
         QStyle.SP_MediaPlay))
     self.buttonPause.setIcon(self.style().standardIcon(
         QStyle.SP_MediaPause))
     self.buttonUnpause.setIcon(self.style().standardIcon(
         QStyle.SP_MediaPlay))
     self.buttonRemove.setIcon(self.style().standardIcon(
         QStyle.SP_MediaStop))
     # self.buttonPause.setDisabled(True)
     # self.buttonStop.setDisabled(True)
     # 添加组件
     self.layout = QGridLayout(self)
     self.layout.addWidget(self.labelUrl, 0, 0, 1, 1)
     self.layout.addWidget(self.lineEditorUrl, 0, 1, 1, 5)
     self.layout.addWidget(self.labelProgress, 1, 0, 1, 1)
     self.layout.addWidget(self.downloadProgress, 1, 1, 1, 5)
     self.layout.addWidget(self.textResult, 2, 0, 2, 5)
     self.layout.addWidget(self.buttonStart, 4, 0, 1, 1)
     self.layout.addWidget(self.buttonPause, 4, 1, 1, 1)
     self.layout.addWidget(self.buttonUnpause, 4, 2, 1, 1)
     self.layout.addWidget(self.buttonRemove, 4, 3, 1, 1)
     self.layout.addWidget(self.buttonDebug, 4, 4, 1, 1)
 def show_play_table(self, plays):
     """Shows a table with all the plays to be imported, allowing user to select some to skip"""
     tree_model = PlayTableModel(plays)
     table_widget = QTableView()
     table_widget.setModel(tree_model)
     table_widget.verticalHeader().setVisible(False)
     table_view_header = table_widget.horizontalHeader()
     table_view_header.setStretchLastSection(True)
     for column in range(tree_model.columnCount()):
         column_size = tree_model.data(tree_model.index(0, column),
                                       PlayTableModel.SIZE_ROLE)
         table_view_header.resizeSection(column, column_size)
     table_widget_dialog = QDialog(self)
     table_widget_dialog.setModal(True)
     grid_layout = QGridLayout(table_widget_dialog)
     grid_layout.addWidget(table_widget, 1, 1)
     table_widget_dialog.resize(800, 600)
     table_widget_dialog.exec_()
     skipped_plays = tree_model.get_skipped_plays()
     return [play for play in plays if play.id not in skipped_plays]