Ejemplo n.º 1
1
    def createOrdersTab(self):
        """Create the page to view the Orders table from the database."""
        ord_sql_model = QSqlRelationalTableModel()
        ord_sql_model.setTable("Orders")
        ord_sql_model.setRelation(
            ord_sql_model.fieldIndex("product_id"),
            QSqlRelation("Products", "product_id", "product_name"))
        ord_sql_model.setRelation(
            ord_sql_model.fieldIndex("customer_id"),
            QSqlRelation("Customers", "customer_id", "first_name"))
        ord_sql_model.setHeaderData(ord_sql_model.fieldIndex("customer_id"),
                                    Qt.Orientation.Horizontal, "customer_name")
        ord_sql_model.select()  # Populate the model with data

        ord_proxy_model = QSortFilterProxyModel()
        ord_proxy_model.setSourceModel(ord_sql_model)

        ord_table = QTableView()
        ord_table.setSortingEnabled(True)
        ord_table.setModel(ord_proxy_model)
        ord_table.setItemDelegate(SqlProxyDelegate(ord_table))
        ord_table.setItemDelegateForColumn(
            ord_sql_model.fieldIndex("date_of_order"), DateDelegate())
        ord_table.horizontalHeader().setSectionResizeMode(
            QHeaderView.ResizeMode.Stretch)

        ord_h_box = QHBoxLayout()
        ord_h_box.addWidget(ord_table)
        self.orders_tab.setLayout(ord_h_box)
Ejemplo n.º 2
0
    def add_header_fields(self) -> None:
        layout: QLayout = QHBoxLayout()

        self.layout().addItem(layout)

        labels_layout: QLayout = QVBoxLayout()
        line_edits_layout: QLayout = QVBoxLayout()

        layout.addItem(labels_layout)
        layout.addItem(line_edits_layout)

        labels_layout.addWidget(QLabel("""Header File Name""", self))
        labels_layout.addWidget(
            QLabel("""Output Path (relative to root of project)""", self))

        line_edits_layout.addWidget(self.header_name_input)

        path_edit_layout: QLayout = QHBoxLayout()
        path_edit_layout.addWidget(self.header_output_path_input)
        path_edit_layout.addWidget(self.header_output_path_selector)

        path_edit_layout.setAlignment(self.header_output_path_selector,
                                      Qt.AlignmentFlag.AlignRight)

        self.header_output_path_selector.setFixedSize(QSize(25, 25))

        line_edits_layout.addItem(path_edit_layout)

        self.header_output_path_selector.clicked.connect(
            lambda: self.open_path_selection_dialog())
    def __init__(self):
        super(MainWidget, self).__init__()
        self.resize(500, 600)
        self.setWindowTitle("喜马拉雅下载 by[Zero] " + __VERSION__)
        self.mainlayout = QVBoxLayout()
        self.setLayout(self.mainlayout)
        self.groupbox = QGroupBox("选择类型")
        self.groupbox.setFixedHeight(50)
        hlayout = QHBoxLayout(self.groupbox)
        self.signal_m4a = QRadioButton("单个下载")
        self.mut_m4a = QRadioButton("专辑下载")
        self.vip_signal_m4a = QRadioButton("VIP单个下载")
        self.vip_m4a = QRadioButton("VIP专辑下载")

        hlayout.addWidget(self.signal_m4a)
        hlayout.addWidget(self.mut_m4a)
        hlayout.addWidget(self.vip_signal_m4a)
        hlayout.addWidget(self.vip_m4a)
        self.mainlayout.addWidget(self.groupbox)

        frame01 = QFrame(self)
        child_layout = QVBoxLayout()
        print(self.width())
        label01 = QLabel("链   接", self)
        label02 = QLabel("下载目录", self)
        self.url_lineedit = QLineEdit(self)
        self.dir_lineedit = QLineEdit(self)
        hlayout01 = QHBoxLayout()
        hlayout01.addWidget(label01, 1)
        hlayout01.addWidget(self.url_lineedit, 9)
        hlayout02 = QHBoxLayout()
        hlayout02.addWidget(label02, 1)
        hlayout02.addWidget(self.dir_lineedit, 9)
        child_layout.addLayout(hlayout01)
        child_layout.addLayout(hlayout02)
        child_layout.setContentsMargins(
            5, 0, 5, 0)  #(int left, int top, int right, int bottom)
        frame01.setLayout(child_layout)
        self.download_progressbar = QProgressBar()
        self.download_progressbar.setAlignment(
            QtCore.Qt.Alignment.AlignCenter)  #文字居中
        self.download_progressbar.setValue(88)
        self.download_btn = QPushButton("开始下载")
        self.show_plaintextedit = QPlainTextEdit()
        self.show_plaintextedit.setMinimumHeight(400)
        self.mainlayout.addWidget(frame01)
        self.mainlayout.addWidget(self.download_progressbar)
        self.mainlayout.addWidget(self.download_btn)
        self.mainlayout.addWidget(self.show_plaintextedit)
        self.mainlayout.addStretch()
        ### 设置stylesheet
        self.download_btn.setStyleSheet(
            'QPushButton:pressed{ text-align: center;background-color:red;}')
Ejemplo n.º 4
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")
Ejemplo n.º 5
0
    def setTabWidgets(self):
        # Tab1 widgets:
        layout = QHBoxLayout()
        layout.addWidget(TrainWidget(self))
        self.tab1.layout = layout
        self.tab1.setLayout(self.tab1.layout)

        self.tab2.layout = TestWidget(self)
        self.tab2.setLayout(self.tab2.layout)

        layout2 = QHBoxLayout()
        layout2.addWidget(KeysWidget(self))

        self.tab3.layout = layout2
        self.tab3.setLayout(self.tab3.layout)
Ejemplo n.º 6
0
    def initUI(self):

        hbox = QHBoxLayout(self)

        topleft = QFrame(self)
        topleft.setFrameShape(QFrame.Shape.StyledPanel)

        topright = QFrame(self)
        topright.setFrameShape(QFrame.Shape.StyledPanel)

        bottom = QFrame(self)
        bottom.setFrameShape(QFrame.Shape.StyledPanel)

        splitter1 = QSplitter(Qt.Orientations.Horizontal)
        splitter1.addWidget(topleft)
        splitter1.addWidget(topright)

        splitter2 = QSplitter(Qt.Orientations.Vertical)
        splitter2.addWidget(splitter1)
        splitter2.addWidget(bottom)

        hbox.addWidget(splitter2)
        self.setLayout(hbox)

        self.setGeometry(300, 300, 450, 400)
        self.setWindowTitle('QSplitter')
        self.show()
Ejemplo n.º 7
0
    def __init__(
        self,
        parent: Optional[QWidget] = None,
        *args: Tuple[Any, Any],
        **kwargs: Tuple[Any, Any],
    ) -> None:
        """
        The log layout consisting of, for each command:
            Left: Command name
            Right: Command result
        """
        super(VerticalLogLayout, self).__init__(parent=parent, *args, **kwargs)
        # set layout and add placeholder layouts to ensure they aren't automatically destroyed later
        layout = QHBoxLayout()

        self.__commandNames.append("Command name")
        self.__commandResults.append("Result")

        commandNamesBox = QVBoxLayout()
        commandResultsBox = QVBoxLayout()

        # add the human descriptions text to the layouts
        for i in range(0, len(self.__commandNames)):
            commandNamesBox.addWidget(QLabel(self.__commandNames[i]))
            commandResultsBox.addWidget(QLabel(self.__commandResults[i]))

        layout.addLayout(commandNamesBox)
        layout.addLayout(commandResultsBox)

        # remember to set the layout!
        self.setLayout(layout)
Ejemplo n.º 8
0
    def __init__(self, parent, top):
        super(QWidget, self).__init__(parent)
        self.top = top
        hlayout = QHBoxLayout()
        self.layout = QGridLayout()
        hlayout.addLayout(self.layout)
        hlayout.setAlignment(hlayout, Qt.Alignment.AlignTop)
        self.setLayout(hlayout)
        self.row = 0

        self.__addLabel__("Gateway Services")
        self.__addLabel__("Gateway Host Name/IP Address")
        self.gatewayHostName = QLineEdit(self)
        self.__addInput__(self.gatewayHostName)

        self.__addLabel__("Exercise Data Server Host Name/IP Address")
        self.productionEDS = QLineEdit(self)
        self.prodEnable = QRadioButton("Production")
        self.prodEnable.setChecked(True)
        self.prodEnable.toggled.connect(self.radioProdClicked)
        self.prodEnable.setStyleSheet("QRadioButton{ width: 100; }")
        self.__addInputAndRadio__(self.productionEDS, self.prodEnable)
        self.testEDS = QLineEdit(self)
        self.testEnable = QRadioButton("Test")
        self.testEnable.toggled.connect(self.radioTestClicked)
        self.testEnable.setStyleSheet("QRadioButton{ width: 100; }")
        self.__addInputAndRadio__(self.testEDS, self.testEnable)

        self.__addLabel__("Messaging Port")
        self.messagePort = QLineEdit("61616")
        self.__addInput__(self.messagePort)
Ejemplo n.º 9
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)
Ejemplo n.º 10
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)
    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)
Ejemplo n.º 12
0
    def __init__(self, parent, top):
        super(QWidget, self).__init__(parent)
        self.top = top
        hlayout = QHBoxLayout()
        self.layout = QGridLayout()
        hlayout.addLayout(self.layout)
        hlayout.setAlignment(hlayout, Qt.Alignment.AlignTop)
        self.setLayout(hlayout)
        self.row = 0

        self.__addLabel__("Federate Name")
        self.federateName = QLineEdit('REMOTE_WORKSTATION')
        self.__addInput__(self.federateName)

        self.__addLabel__("Message Directory Cache")
        self.messageDirectoryCache = QLineEdit(self)
        self.__addInputAndSelect__(self.messageDirectoryCache, self.top)

        self.__addLabel__("Map Data Cache")
        self.mapDataCache = QLineEdit(self)
        self.__addInputAndSelect__(self.mapDataCache, self.top)

        self.__addLabel__("Raster Map Cache")
        self.rasterMapCache = QLineEdit(self)
        self.__addInputAndSelect__(self.rasterMapCache, self.top)

        self.__addLabel__("Remote Control Location")
        self.remoteControlLocation = QLineEdit(self)
        self.__addInputAndSelect__(self.remoteControlLocation, self.top)
Ejemplo n.º 13
0
 def configure_gui(self):
      
     self.undo = ['']
     self.redo = []
     
     self.layout = QHBoxLayout(self)
     self.layout.setContentsMargins(0, 0, 5, 0)
Ejemplo n.º 14
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)
Ejemplo n.º 15
0
    def initUI(self):

        OVER_CAPACITY = 750

        sld = QSlider(Qt.Orientations.Horizontal, self)
        sld.setFocusPolicy(Qt.FocusPolicy.NoFocus)
        sld.setRange(1, OVER_CAPACITY)
        sld.setValue(75)
        sld.setGeometry(30, 40, 150, 30)

        self.c = Communicate()
        self.wid = BurningWidget()
        self.c.updateBW[int].connect(self.wid.setValue)

        sld.valueChanged[int].connect(self.changeValue)
        hbox = QHBoxLayout()
        hbox.addWidget(self.wid)
        vbox = QVBoxLayout()
        vbox.addStretch(1)
        vbox.addLayout(hbox)
        self.setLayout(vbox)

        self.setGeometry(300, 300, 390, 210)
        self.setWindowTitle('Burning widget')
        self.show()
Ejemplo n.º 16
0
    def __init__(self, ID=0):
        super(NodeWidget, self).__init__()
        laytout = QHBoxLayout()
        self.input_id = QLineEdit(str(ID))
        self.input_id.setFixedWidth(30)
        self.input_text = QLineEdit("")
        self.input_text.setFixedHeight(20)
        self.input_text.setFixedWidth(400)
        self.input_type = QComboBox()
        self.input_type.addItem('开始/结束')
        self.input_type.addItem('流程')
        self.input_type.addItem('判定')
        self.input_type.addItem('None')
        self.input_type.setFixedWidth(80)
        self.input_x = QLineEdit("0")
        self.input_x.setFixedWidth(30)
        self.input_y = QLineEdit("0")
        self.input_y.setFixedWidth(30)
        self.input_link1 = QLineEdit("")
        self.input_link1.setFixedWidth(30)
        self.input_link2 = QLineEdit("")
        self.input_link2.setFixedWidth(30)

        laytout.addWidget(self.input_id)
        laytout.addWidget(self.input_text)
        laytout.addWidget(self.input_type)
        laytout.addWidget(self.input_x)
        laytout.addWidget(self.input_y)
        laytout.addWidget(self.input_link1)
        laytout.addWidget(self.input_link2)
        laytout.addStretch()
        laytout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(laytout)
        self.data = []
Ejemplo n.º 17
0
    def createCustomersTab(self):
        """Create the page to view the Customers table from the database."""
        cust_sql_model = QSqlRelationalTableModel()
        cust_sql_model.setTable("Customers")
        cust_sql_model.setRelation(
            cust_sql_model.fieldIndex("staff_id"),
            QSqlRelation("Staff", "staff_id", "username"))
        cust_sql_model.setHeaderData(cust_sql_model.fieldIndex("staff_id"),
                                     Qt.Orientation.Horizontal,
                                     "staff_username")
        cust_sql_model.select()  # Populate the model with data

        cust_proxy_model = QSortFilterProxyModel()
        cust_proxy_model.setSourceModel(cust_sql_model)

        cust_table = QTableView()
        cust_table.setSortingEnabled(True)
        cust_table.setModel(cust_proxy_model)
        cust_table.setItemDelegate(SqlProxyDelegate(cust_table))
        cust_table.setItemDelegateForColumn(cust_sql_model.fieldIndex("phone"),
                                            PhoneDelegate())
        cust_table.horizontalHeader().setSectionResizeMode(
            QHeaderView.ResizeMode.Stretch)

        cust_h_box = QHBoxLayout()
        cust_h_box.addWidget(cust_table)
        self.customer_tab.setLayout(cust_h_box)
Ejemplo n.º 18
0
    def createLineEdit(self):
        hboxLayout = QHBoxLayout()

        self.lineEdit.returnPressed.connect(self.onReturn_pressed)
        hboxLayout.addWidget(self.lineEdit)

        self.groupBox.setLayout(hboxLayout)
Ejemplo n.º 19
0
    def __init__(self):
        global serialPort, baud, fmt
        self.serialLogState = False
        self.fmts = ['bin', 'oct', 'dec', 'hex', 'csv', 'csv+', 'ascii']
        self.baudList = [
            4800, 7200, 9600, 14400, 19200, 28800, 38400, 57600, 76800, 115200,
            230400, 460800, 921600, 1000000, 2000000, 4000000
        ]
        fmt = self.fmts.index(fmt)
        super().__init__()
        layoutA = QHBoxLayout()

        self.baudBox = QComboBox()
        self.getBaud()
        layoutA.addWidget(self.baudBox)

        self.formatBox = QComboBox()
        self.getFormat()
        layoutA.addWidget(self.formatBox)

        layoutB = QHBoxLayout()
        self.portBox = QComboBox()
        self.getPorts()
        layoutB.addWidget(self.portBox)

        parentLayout = QVBoxLayout()
        parentLayout.addLayout(layoutB)
        parentLayout.addLayout(layoutA)

        self.setLayout(parentLayout)

        self.portBox.currentTextChanged.connect(self.portSelected)
        self.portBox.setCurrentIndex(len(self.ports) - 1)

        self.baudBox.currentTextChanged.connect(self.baudSelected)
        try:
            self.baudBox.setCurrentIndex(self.baudList.index(baud))
        except:
            self.baudBox.setCurrentIndex(-1)

        self.formatBox.currentTextChanged.connect(self.formatSelected)
        self.formatBox.setCurrentIndex(fmt)

        self.button1 = QPushButton()
        self.button1.setText("start")
        self.button1.released.connect(self.btn1Clicked)
        layoutA.addWidget(self.button1)
Ejemplo n.º 20
0
    def initUI(self):
        self.setWindowTitle("合并文件")
        self.setWindowIcon(QIcon(SRC_DIR + "upload.ico"))
        self.logo = QLabel()
        self.logo.setPixmap(QPixmap(SRC_DIR + "logo3.gif"))
        self.logo.setStyleSheet("background-color:rgb(0,153,255);")
        self.logo.setAlignment(Qt.AlignmentFlag.AlignCenter)

        # lable
        self.choose_lb = QLabel("选择文件夹")
        # folder
        self.choose_folder = MyLineEdit(self)
        self.choose_folder.setObjectName("choose_folder")
        self.choose_folder.clicked.connect(self.slot_choose_folder)
        self.status = QLabel(self)

        self.buttonBox = QDialogButtonBox()
        self.buttonBox.setOrientation(Qt.Orientation.Horizontal)
        self.buttonBox.setStandardButtons(
            QDialogButtonBox.StandardButton.Ok
            | QDialogButtonBox.StandardButton.Cancel)
        self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setText("提取")
        self.buttonBox.button(
            QDialogButtonBox.StandardButton.Cancel).setText("关闭")
        self.buttonBox.setStyleSheet(btn_style)

        vbox = QVBoxLayout()
        hbox_head = QHBoxLayout()
        hbox_button = QHBoxLayout()
        hbox_head.addWidget(self.choose_lb)
        hbox_head.addWidget(self.choose_folder)
        hbox_button.addWidget(self.buttonBox)
        vbox.addWidget(self.logo)
        vbox.addStretch(1)
        vbox.addWidget(self.status)
        vbox.addLayout(hbox_head)
        vbox.addStretch(1)
        vbox.addLayout(hbox_button)
        self.setLayout(vbox)
        self.setMinimumWidth(350)

        # 设置信号
        self.buttonBox.accepted.connect(self.slot_btn_ok)
        self.buttonBox.rejected.connect(self.slot_btn_no)
        self.buttonBox.rejected.connect(self.reject)
Ejemplo n.º 21
0
 def __addInputAndRadio__(self, input, radio):
     hbox = QHBoxLayout()
     hbox.setContentsMargins(0, 0, 0, 0)
     hbox.addWidget(input)
     hbox.addWidget(radio)
     widget = QWidget(self)
     widget.setLayout(hbox)
     self.layout.addWidget(widget, self.row, 0, 1, -1)
     self.row += 1
Ejemplo n.º 22
0
 def __init__(self, parent=None):
     QWidget.__init__(self, parent)
     self.l = l = QHBoxLayout(self)
     l.setContentsMargins(0, 0, 0, 0)
     self.la = la = QLabel(self)
     l.addWidget(la)
     self.edit = Search(self)
     la.setBuddy(self.edit)
     l.addWidget(self.edit)
Ejemplo n.º 23
0
    def configure_gui(self):
        
        self.center = QWidget(self)
        self.layout = QHBoxLayout()

        self.center.setLayout(self.layout)
        self.setCentralWidget(self.center)
        self.layout.setContentsMargins(5, 0, 5, 0)
        self.layout.setSpacing(0)
Ejemplo n.º 24
0
    def __init__(self, document_base_viewer):
        super(AttributeWidget, self).__init__(document_base_viewer)
        self.document_base_viewer = document_base_viewer
        self.attribute = None

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

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

        self.attribute_name = QLabel()
        self.attribute_name.setFont(CODE_FONT_BOLD)
        self.layout.addWidget(self.attribute_name,
                              alignment=Qt.AlignmentFlag.AlignLeft)

        self.num_matched = QLabel("matches: -")
        self.num_matched.setFont(CODE_FONT)
        self.layout.addWidget(self.num_matched,
                              alignment=Qt.AlignmentFlag.AlignLeft)

        self.buttons_widget = QWidget()
        self.buttons_layout = QHBoxLayout(self.buttons_widget)
        self.buttons_layout.setContentsMargins(0, 0, 0, 0)
        self.buttons_layout.setSpacing(10)
        self.layout.addWidget(self.buttons_widget,
                              alignment=Qt.AlignmentFlag.AlignRight)

        self.forget_matches_button = QPushButton()
        self.forget_matches_button.setIcon(QIcon("aset_ui/resources/redo.svg"))
        self.forget_matches_button.setToolTip(
            "Forget matches for this attribute.")
        self.forget_matches_button.setFlat(True)
        self.forget_matches_button.clicked.connect(
            self._forget_matches_button_clicked)
        self.buttons_layout.addWidget(self.forget_matches_button)

        self.remove_button = QPushButton()
        self.remove_button.setIcon(QIcon("aset_ui/resources/trash.svg"))
        self.remove_button.setToolTip("Remove this attribute.")
        self.remove_button.setFlat(True)
        self.remove_button.clicked.connect(self._remove_button_clicked)
        self.buttons_layout.addWidget(self.remove_button)
Ejemplo n.º 25
0
    def __init__(self):
        super(MyWidget, self).__init__()
        self.setFixedSize(620, 600)
        self.setWindowTitle("自动画流程图工具 version:1.0.0 ")
        self.laytout = QVBoxLayout(self)
        headwidget = QWidget(self)
        headlayout = QHBoxLayout()
        label01 = QLabel(" ID ")
        label02 = QLabel("流程图内容")
        label03 = QLabel("节点类型")
        label04 = QLabel("X坐标")
        label05 = QLabel("Y坐标")
        label06 = QLabel("link1")
        label07 = QLabel('link2')
        headlayout.addWidget(label01, 3)
        headlayout.addWidget(label02, 40)
        headlayout.addWidget(label03, 8)
        headlayout.addWidget(label04, 3)
        headlayout.addWidget(label05, 3)
        headlayout.addWidget(label06, 3)
        headlayout.addWidget(label07, 3)
        headlayout.addStretch()
        headlayout.setContentsMargins(0, 0, 0, 0)
        headwidget.setLayout(headlayout)
        btnwidget = QWidget()
        btnlayout = QHBoxLayout()
        self.add_btn = QPushButton("添加节点")
        self.start_btn = QPushButton("开始画图")
        btnlayout.addWidget(self.add_btn)
        btnlayout.addWidget(self.start_btn)
        btnwidget.setLayout(btnlayout)
        btnlayout.setContentsMargins(0, 0, 0, 0)

        self.laytout.addStretch()
        self.laytout.addWidget(btnwidget)
        self.laytout.addWidget(headwidget)
        #self.laytout.addStretch()

        self.add_btn.clicked.connect(self.add_node)
        self.start_btn.clicked.connect(self.start_draw_visiflow)

        self.nodes = []
        self.id = 0
Ejemplo n.º 26
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()
Ejemplo n.º 27
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!")
Ejemplo n.º 28
0
 def __addInputAndSelect__(self, input, top):
     hbox = QHBoxLayout()
     hbox.setContentsMargins(0, 0, 0, 0)
     hbox.addWidget(input)
     browseButton = BrowseButton(self, input, top)
     browseButton.adjustSize()
     hbox.addWidget(browseButton)
     widget = QWidget(self)
     widget.setLayout(hbox)
     self.layout.addWidget(widget, self.row, 0, 1, -1)
     self.row += 1
Ejemplo n.º 29
0
    def init_ui(self):
        layout = QHBoxLayout()
        self.setLayout(layout)

        self.dtr_btn = QCheckBox('DTR')
        self.dtr_btn.clicked.connect(self.handle_dtr)
        self.rts_btn = QCheckBox('RTS')
        self.rts_btn.clicked.connect(self.handle_rts)

        layout.addWidget(self.dtr_btn)
        layout.addWidget(self.rts_btn)
Ejemplo n.º 30
0
    def __init__(self, parent=None):
        """Initializer."""
        super().__init__(parent)
        self.setWindowTitle("RP Contacts")
        self.resize(550, 250)
        self.centralWidget = QWidget()
        self.setCentralWidget(self.centralWidget)
        self.layout = QHBoxLayout()
        self.centralWidget.setLayout(self.layout)

        self.ContactsModel = ContactsModel()
        self.setupUI()