Exemple #1
0
    def __init__(self, child_process_queue: Queue, emitter: Emitter):
        super().__init__()
        self.process_queue = child_process_queue
        self.emitter = emitter
        self.emitter.daemon = True
        self.emitter.start()

        # ------------------------------------------------------------------------------------------------------------
        # Create the UI
        # -------------------------------------------------------------------------------------------------------------
        self.browser = QTextBrowser()
        self.lineedit = QLineEdit('Type text and press <Enter>')
        self.lineedit.selectAll()
        layout = QVBoxLayout()
        layout.addWidget(self.browser)
        layout.addWidget(self.lineedit)
        self.setLayout(layout)
        self.lineedit.setFocus()
        self.setWindowTitle('Upper')

        # -------------------------------------------------------------------------------------------------------------
        # Connect signals
        # -------------------------------------------------------------------------------------------------------------
        # When enter is pressed on the lineedit call self.to_child
        self.lineedit.returnPressed.connect(self.to_child)

        # When the emitter has data available for the UI call the updateUI function
        self.emitter.ui_data_available.connect(self.updateUI)
Exemple #2
0
    def initUI(self):

        self.le = QLineEdit()
        self.le.setPlaceholderText('기본 값 유윈스 학사공')
        self.le.returnPressed.connect(self.get_url_subject)

        self.btn = QPushButton('Start')
        self.btn.clicked.connect(self.get_url_subject)

        self.lbl = QLabel('과를 입력하세요.')

        self.tb = QTextBrowser()
        self.tb.setAcceptRichText(True)
        self.tb.setOpenExternalLinks(True)

        grid = QGridLayout()
        grid.addWidget(self.le, 0, 0, 1, 3)
        grid.addWidget(self.btn, 0, 3, 1, 1)
        grid.addWidget(self.lbl, 1, 0, 1, 4)
        grid.addWidget(self.tb, 2, 0, 1, 4)

        self.setLayout(grid)

        self.setWindowTitle('Web Crawler')
        self.setGeometry(100, 100, 450, 650)
        self.show()
Exemple #3
0
    def __init__(self, ):
        super(ChangeLog, self).__init__()
        self.setWindowTitle('pyIMD :: What\'s new in pyIMD')
        self.setFixedSize(1100, 500)
        self.setWindowIcon(
            QtGui.QIcon(
                resource_path(
                    os.path.join(
                        os.path.join("ui", "icons", "pyIMD_logo_icon.ico")))))
        self.setWindowFlags(Qt.WindowCloseButtonHint)

        h_box = QVBoxLayout()
        v_box = QHBoxLayout()
        grid_h = QGridLayout()
        grid_v = QGridLayout()
        self.change_log_text = QTextBrowser()
        self.cancel_btn = QPushButton('Close', self)
        self.cancel_btn.clicked.connect(self.close_window)

        grid_v.addWidget(self.cancel_btn, 1, 1)
        v_box.addStretch()
        v_box.addLayout(grid_v)
        grid_h.addWidget(self.change_log_text)
        h_box.addLayout(grid_h)
        h_box.addLayout(v_box)
        self.setLayout(h_box)

        change_log = open(resource_path('change_log.txt')).read()
        self.change_log_text.setText(change_log)
Exemple #4
0
    def initUI(self):
        self.le = QLineEdit()  # QLineEdit() : HTML 태그형태로 입력할 수 있는 한 줄 짜리 입력창
        self.le.returnPressed.connect(
            self.append_text
        )  # 키보드에 엔터가 눌렸는지 안눌렸는지 알아내는 returnPressed.엔터를 누르면 값을 append_text로 전달

        self.tb = QTextBrowser()  # 태그를 해석해서 출력시켜줄 텍스트브라우저 객체 생성
        self.tb.setAcceptRichText(
            True
        )  # 텍스트 브라우저에 출력된 글씨들을 복사한다던지, 이와 같이 해당 글자를 접근 가능하게 할거면 True, 막을거면 False
        self.tb.setOpenExternalLinks(
            True)  # 외부 브라우저로 접속해야 하기 때문에 외부링크 허용 True, 허용하지 않으면 False

        self.clear_btn = QPushButton('Clear')  # 버튼 생성(버튼에 쓰일 값은 Clear)
        self.clear_btn.pressed.connect(
            self.clear_text)  # 버튼이 눌려지면 clear_text 함수 호출

        vbox = QVBoxLayout()  # 박스 객체 생성
        vbox.addWidget(self.le, 0)  # 0행에 위젯 달기
        vbox.addWidget(self.tb, 1)  # 1행에 위젯 달기
        vbox.addWidget(self.clear_btn, 2)  # 2행에 버튼 달기

        self.setLayout(vbox)

        self.setWindowTitle('QTextBrowser')
        self.setGeometry(300, 300, 300, 300)
        self.show()
Exemple #5
0
    def __init__(self, id, name, meas_dict):
        QtWidgets.QWidget.__init__(self)
        self.id = id
        self.name = name
        self.meas_dict = meas_dict
        self.grid = QGridLayout(self)

        self.meas_table = QTableWidget()
        self.meas_table.setRowCount( len(meas_dict))
        self.meas_table.setColumnCount(2)

        header = [ "量测名称", "值" ]
        self.meas_table.setHorizontalHeaderLabels(header)

        self.grid.addWidget(self.meas_table, 0, 0, 1, 1)

        self.frame_show = QTextBrowser()
        self.grid.addWidget(self.frame_show, 0, 1, 1, 1)

        row = 0
        for meas in self.meas_dict:
            item = QTableWidgetItem(meas)
            self.meas_table.setItem(row, 0, item)

            item = QTableWidgetItem(self.meas_dict[meas])
            self.meas_table.setItem(row, 1, item)

            row += 1
Exemple #6
0
    def initUI(self):
        self.setWindowTitle('Pyminer Curve Fitting Tool')
        self.setGeometry(10, 10, 600, 400)
        self.outer_layout = QHBoxLayout()
        self.setLayout(self.outer_layout)
        self.control_layout = QVBoxLayout()

        m = PlotCanvas(self)
        self.outer_layout.addWidget(m)

        self.control_panel = ControlPanel()

        self.text_show = QTextBrowser()
        self.control_layout.addWidget(self.text_show)
        self.control_layout.addWidget(self.control_panel)
        self.text_show.setMinimumWidth(200)

        self.button_refresh = QPushButton('Fit')
        self.control_layout.addWidget(self.button_refresh)
        self.button_refresh.clicked.connect(self.fit)

        self.control_layout.addItem(
            QSpacerItem(0, 0, QSizePolicy.Minimum, QSizePolicy.Expanding))
        self.outer_layout.addLayout(self.control_layout)
        self.canvas = m
        self.figure = m.figure
Exemple #7
0
 def init_UI(self):
     """Initiate widgets"""
     self.widget = QWidget()
     self.widget.layout = QGridLayout()
     self.widget.setLayout(self.widget.layout)
     self.setCentralWidget(self.widget)
     
     #### validators for user input ####
     double_validator = QDoubleValidator() # floats
     int_validator = QIntValidator(0,10000000) # positive integers
     msr_validator = QIntValidator(-1,1000000) # integers >= -1
     nat_validator = QIntValidator(1,10000000) # natural numbers
     col_validator = QIntValidator(1,self.ncols-1) # for number of columns
     
     self.load_measure = QPushButton('Load measure', self)
     self.widget.layout.addWidget(self.load_measure, 0,0, 1,1)
     self.load_measure.clicked.connect(self.)
     
     self.measure_label = QLabel('', self)
     self.widget.layout.addWidget(self.load_measure, 0,1, 1,1)
     
     self.status_label = QTextBrowser() 
     self.widget.layout.addWidget(self.status_label, 1,0, 2,4)
     
     font = QFont()
     font.setPixelSize(14)
     self.varplot_canvas = pg.PlotWidget()
     self.varplot_canvas.getAxis('bottom').tickFont = font
     self.varplot_canvas.getAxis('left').tickFont = font
     self.widget.layout.addWidget(self.varplot_canvas, 6,0, 2,4)
     
     self.var_label = QLabel(self.get_label(), self)
     self.widget.layout.addWidget(self.var_label, 7,1, 1,1)
Exemple #8
0
    def __init__(self):
        super(CrawlWindow, self).__init__()
        self.resize(800, 600)
        self.setWindowTitle('猫眼Top100电影爬取软件')
        self.setWindowIcon(QIcon(':res/maoyan.png'))

        self.start_btn = QPushButton(self)
        self.stop_btn = QPushButton(self)
        self.save_combobox = QComboBox(self)
        self.table = QTableWidget(self)
        self.log_browser = QTextBrowser(self)
        self.progressbar = QProgressBar(self)

        self.h_layout = QHBoxLayout()
        self.v_layout = QVBoxLayout()

        self.crawl_thread = CrawlThread()
        self.db = None
        self.btn_sound = QSound(':res/btn.wav', self)
        self.finish_sound = QSound(':res/finish.wav', self)

        self.btn_init()
        self.combobox_init()
        self.table_init()
        self.progressbar_init()
        self.layout_init()
        self.crawl_init()
        self.db_connect()
Exemple #9
0
    def creatFormGroupBox(self):
        self.formGroupBox = QGroupBox('消息')
        layout = QFormLayout()

        msgbox = QTextBrowser()

        self.stack = QStackedWidget(self)  # 设置一个堆栈以切换不同用户的对话界面
        self.stack.addWidget(msgbox)  # 每个用户有一个文本框展示信息

        self.userBox['无'] = msgbox

        self.showMsg('无', info)

        self.selur = QComboBox()  # 使用下拉列表选择用户对话框
        self.selur.addItem('无')
        self.selur.currentTextChanged.connect(self.changeBox)  # 绑定处理方法
        self.selur.setDisabled(True)

        # 绘制输入框和发送按钮
        childgrid = QGridLayout()
        self.umsg = QLineEdit()
        self.sendbt = QPushButton('发送')
        childgrid.addWidget(self.umsg, 0, 0)
        childgrid.addWidget(self.sendbt, 0, 1)
        layout.addRow(self.stack)
        layout.addRow(self.selur, childgrid)
        self.sendbt.clicked.connect(self.sendMsg)

        # 一开始禁用输入框和发送按钮
        self.umsg.setEnabled(False)
        self.sendbt.setEnabled(False)

        self.formGroupBox.setLayout(layout)
Exemple #10
0
    def initUI(self):
        self.le = QLineEdit()
        self.le.returnPressed.connect(self.append_text)
        # 줄편집기 하나를 만들었습니다.
        #
        # Enter키를 누르면 append_text 메서드가 호출됩니다.

        self.tb = QTextBrowser()
        self.tb.setAcceptRichText(True)
        self.tb.setOpenExternalLinks(True)
        # QTextBrowser() 클래스를 이용해서 텍스트 브라우저를 하나 만들었습니다.
        #
        # setAcceptRichText()를 True로 설정해주면, 서식 있는 텍스트
        # (Rich text)를 사용할 수 있습니다.
        #
        # 디폴트로 True이기 때문에 없어도 되는 부분입니다.
        #
        # setOpenExternalLinks()를 True로 설정해주면, 외부 링크로의 연결이 가능합니다.

        self.clear_btn = QPushButton('Clear')
        self.clear_btn.pressed.connect(self.clear_text)
        # clear_btn을 클릭하면, clear_text 메서드가 호출됩니다.

        vbox = QVBoxLayout()
        vbox.addWidget(self.le, 0)
        vbox.addWidget(self.tb, 1)
        vbox.addWidget(self.clear_btn, 2)

        self.setLayout(vbox)

        self.setWindowTitle('QTextBrowser')
        self.setGeometry(300, 300, 300, 300)
        self.show()
Exemple #11
0
    def gui(self, window, graph):
        def _format_mmap(item):
            region = self.find_region(item['region_id'])

            if not region:
                print('Missing region?')
                return

            content_link = ""
            if region and item.get('content', None):
                content_link = "<a href='#{}'>Show content</a>".format(
                    item['region_id'])

            return "0x%X - 0x%X (%s) %s %s %s" % (
                region['address'], region['address'] + region['size'],
                utils.format_bytes(region['size']), "|".join(
                    region['prot']), "|".join(region['flags']), content_link)

        value = "<br>".join(map(_format_mmap, self.descriptor['mmap']))

        edit = QTextBrowser()
        edit.setHtml(value)
        edit.anchorClicked.connect(self.on_anchor_clicked)

        window.addTab(edit, "Content")
Exemple #12
0
    def __init__(self):
        super(CrawlWindow, self).__init__()
        self.resize(500, 500)
        self.setWindowTitle('toptoon漫画更新监测')
        self.setWindowIcon(QIcon(':reson/maoyan.ico'))

        # 初始化启动按钮
        self.start_btn = QPushButton(self)
        # 初始化输出文本框
        self.log_browser = QTextBrowser(self)
        # 初始化表格控件
        self.table = QTableWidget(self)

        # 初始化水平布局
        self.h_layout = QHBoxLayout()
        # 初始化垂直布局
        self.v_layout = QVBoxLayout()

        # 初始化音频播放
        self.btn_sound = QSound(':reson/btn.wav', self)
        self.finish_sound = QSound(':reson/finish.wav', self)

        # 实例化线程
        self.worker = MyThread()

        # 实例化
        self.start_btn_init()
        self.layout_init()
        self.set_log_init()
        self.table_init()
Exemple #13
0
    def __init__(self):
        super(Window, self).__init__()

        centralWidget = QTextBrowser()
        centralWidget.setPlainText("Central widget")

        layout = BorderLayout()
        layout.addWidget(centralWidget, BorderLayout.Center)

        # Because BorderLayout doesn't call its super-class addWidget() it
        # doesn't take ownership of the widgets until setLayout() is called.
        # Therefore we keep a local reference to each label to prevent it being
        # garbage collected too soon.
        label_n = self.createLabel("North")
        layout.addWidget(label_n, BorderLayout.North)

        label_w = self.createLabel("West")
        layout.addWidget(label_w, BorderLayout.West)

        label_e1 = self.createLabel("East 1")
        layout.addWidget(label_e1, BorderLayout.East)

        label_e2 = self.createLabel("East 2")
        layout.addWidget(label_e2, BorderLayout.East)

        label_s = self.createLabel("South")
        layout.addWidget(label_s, BorderLayout.South)

        self.setLayout(layout)

        self.setWindowTitle("Border Layout")
Exemple #14
0
    def __init__(self, app):
        super().__init__()
        self.app = app
        self.async_fetch = AsyncFetch(CachedHttpClient(HttpClient(), 'cache'))
        self.async_fetch.ready.connect(self.on_fetch_ready)

        self.comboxBox = QComboBox(self)
        self.comboxBox.setEditable(True)
        self.comboxBox.setCurrentText('')
        self.comboxBox.currentTextChanged.connect(self.on_text_changed)

        font = QFont()
        font.setPointSize(font.pointSize() + ADD_TO_FONT_SIZE)
        self.comboxBox.setFont(font)

        self.browser = QTextBrowser(self)
        self.browser.setText(STYLE + HTML)
        self.browser.show()

        mainLayout = QVBoxLayout(self)
        mainLayout.setSpacing(0)
        mainLayout.setContentsMargins(0, 0, 0, 0)
        mainLayout.addWidget(self.comboxBox)
        mainLayout.addWidget(self.browser)
        self.setLayout(mainLayout)

        self.setWindowTitle('OrdbokUibNo')
        self.resize(WINDOW_WIDTH, WINDOW_HEIGHT)
        self.setWindowIcon(QIcon(ICON_FILENAME))

        QTimer.singleShot(1, self.center)

        self.center()
        self.show()
    def initUI(self):
        self.line_edit = QLineEdit()
        self.line_edit.returnPressed.connect(self.addText)

        self.btn_add = QPushButton('입력')
        self.btn_add.clicked.connect(self.addText)

        self.tb = QTextBrowser()
        self.tb.setAcceptRichText(True)
        self.tb.setOpenExternalLinks(True)
        self.tb.append('일반 플래인 텍스트입니다.')

        self.tb.setAlignment(Qt.AlignCenter)
        self.btn_clear = QPushButton('지우기')
        self.btn_clear.clicked.connect(self.clearText)

        vbox = QVBoxLayout()
        vbox.addWidget(self.line_edit)
        vbox.addWidget(self.tb)
        vbox.addWidget(self.btn_add)
        vbox.addWidget(self.btn_clear)

        self.setLayout(vbox)

        self.setWindowTitle('QTextBrowser')
        self.setGeometry(300, 300, 300, 400)
        self.show()
Exemple #16
0
    def initUI(self):
        self.analysis_push_1 = QPushButton("부분 분석")
        self.analysis_push_2 = QPushButton("전체 분석")
        self.analysis_spin_1 = QSpinBox()
        self.analysis_label_1 = QLabel("주간 데이터")
        self.analysis_table_1 = QTableView()
        self.analysis_text_1 = QTextBrowser()

        self.analysis_spin_1.setMaximum(999)
        self.analysis_spin_1.setValue(20)

        self.leftLayout = QHBoxLayout()
        self.fig = plt.Figure()
        self.canvas = FigureCanvas(self.fig)
        self.leftLayout.addWidget(self.canvas)

        self.rightLayout = QVBoxLayout()
        self.rightLayout.addWidget(self.analysis_spin_1)
        self.rightLayout.addWidget(self.analysis_label_1)
        self.rightLayout.addWidget(self.analysis_push_1)
        self.rightLayout.addWidget(self.analysis_push_2)
        self.rightLayout.addWidget(self.analysis_table_1)
        self.rightLayout.addWidget(self.analysis_text_1)

        self.layout = QHBoxLayout()
        self.layout.addLayout(self.leftLayout, 3)
        self.layout.addLayout(self.rightLayout, 1)
        self.setLayout(self.layout)

        self.a1 = self.fig.add_subplot(3, 1, 1)
        self.a2 = self.fig.add_subplot(3, 1, 2)
        self.a3 = self.fig.add_subplot(3, 1, 3)

        self.analysis_push_1.clicked.connect(self.setAnalysisGraph)
        self.analysis_push_2.clicked.connect(self.setAllAnalysisGraph)
Exemple #17
0
 def __init__(self,
         parent: Optional[QMainWindow] = None,
         dat: Optional[_session] = None):
     """
     Node view/edit dock widget constructor
     """
     assert isinstance(dat, _session) or dat is None, \
         "parameter dat is %s, expecting %s" %(type(dat), _session)
     assert isinstance(parent, QMainWindow) or parent is None, \
         "parameter parent is %s, expecting %s" %(type(parent), QMainWindow)
     super(helpBrowserDock, self).__init__(parent=parent)
     self.setupUi(self)
     self.dat = dat
     self.mw = parent
     self._cloud_notification = None
     self.aboutButton.clicked.connect(self.showAbout.emit)
     #self.contentsButton.clicked.connect(self.showContents)
     self.licenseButton.clicked.connect(self.showLicense)
     self.ccsidepButton.clicked.connect(self.showCCSIDep)
     self.textBrowser = QTextBrowser(self.tabWidget.widget(0))
     self.webviewLayout.addWidget(self.textBrowser)
     self.helpPath = os.path.join(helpPath(), 'html')
     self.showLicense()
     self.execButton.clicked.connect(self.runDebugCode)
     self.stopButton.clicked.connect(self.setStopTrue)
     self.loadButton.clicked.connect(self.loadDbgCode)
     self.saveButton.clicked.connect(self.saveDbgCode)
     self.ccButton.clicked.connect(self.clearCode)
     self.crButton.clicked.connect(self.clearRes)
     self.clearLogButton.clicked.connect(self.clearLogView)
     self.statusCloudButton.clicked.connect(self.clearCloudLogView)
     self.synhi = PythonHighlighter(self.pycodeEdit.document())
     self.stop = False
     self.timer = None
Exemple #18
0
    def __init__(
        self,
        mainWindow,
        debugService: DebugService,
        errorSubmitter: ErrorSubmitter,
        exception: Optional[Exception],
        message: str,
        title: str,
        parent=None,
        *args,
        **kwargs,
    ):
        parent = parent or mainWindow
        super().__init__(*args, parent=parent, **kwargs)
        self._mainWindow = mainWindow
        self._debugData = debugService.getForMachine()
        self._errorSubmitter = errorSubmitter
        self._exception = exception
        self._message = message
        self._title = title

        self.textBrowser = QTextBrowser(self)
        self.textEdit = QTextEdit(self)
        self.buttonBox = QDialogButtonBox(self)

        self._setupUI()
        self.exec_()
Exemple #19
0
 def initUI(self):
     self.resize(800, 800)
     self.setWindowTitle('关于我们')
     icon = QIcon()
     #切换到上一目录,便于使用其他资源
     # os.chdir('..')
     # print(os.getcwd())
     icon.addPixmap(QPixmap('../image/school_logo_nobg.png'), QIcon.Normal,
                    QIcon.Off)
     self.setWindowIcon(icon)
     self.text_brower = QTextBrowser()
     with open('../about', 'r', encoding='utf-8') as f:
         text = f.read()
     self.text_brower.setPlainText(text)
     self.button = QPushButton('前往GitHub给我们Star')
     self.button.setIcon(QIcon('../image/star.png'))
     qss_file = '../qss_/aboutWindowStyle.qss'
     load_help = LoadQSSHelper.LoadQSSHelper()
     style = load_help.load(qss_file)
     self.button.setStyleSheet(style)
     vlayout = QVBoxLayout()
     vlayout.addWidget(self.text_brower)
     vlayout.addWidget(self.button)
     self.setLayout(vlayout)
     self.button.clicked.connect(self.onClickedOpen)
Exemple #20
0
    def __init__(self, page, parent=None):
        super(HelpForm, self).__init__(parent)
        self.setAttribute(Qt.WA_DeleteOnClose)
        self.setAttribute(Qt.WA_GroupLeader)

        backAction = QAction(qtawesome.icon("fa.backward"), "&Back", self)
        backAction.setShortcut(QKeySequence.Back)
        homeAction = QAction(qtawesome.icon("fa.home"), "&Home", self)
        homeAction.setShortcut("Home")
        self.pageLabel = QLabel()

        toolBar = QToolBar()
        toolBar.addAction(backAction)
        toolBar.addAction(homeAction)
        toolBar.addWidget(self.pageLabel)
        self.textBrowser = QTextBrowser()

        layout = QVBoxLayout()
        layout.addWidget(toolBar)
        layout.addWidget(self.textBrowser, 1)
        self.setLayout(layout)

        backAction.triggered.connect(self.tbackward)
        homeAction.triggered.connect(self.thome)
        self.textBrowser.sourceChanged.connect(self.updatePageTitle)

        self.textBrowser.setSearchPaths([":/help"])
        self.textBrowser.setSource(QUrl(page))
        self.resize(400, 600)
        self.setWindowTitle("{0} Help".format(QApplication.applicationName()))
Exemple #21
0
    def tabChatInit(self):

        size = self.size()

        layout = QGridLayout()
        self.listChatting = QListWidget()
        self.listChatting.setFixedSize(size.width() / 3, size.height())

        self.chatLog = QTextBrowser()
        self.chatLog.document().setMaximumBlockCount(1000)  # 限制1000行
        self.chatLog.setFixedSize(size.width() * 2 / 3, size.height() * 2 / 3)

        self.textInput = QTextEdit()
        self.textInput.setFixedSize(size.width() * 2 / 3, size.height() / 4)

        self.btnSend = QPushButton()
        self.btnSend.setText('发送')

        # 显示正在聊天的朋友
        self.chattingFri = QLabel('当前聊天朋友:_____')

        self.btnSend.clicked.connect(self.sendMsg)
        self.listChatting.itemClicked.connect(self.listClick)

        self.chatLog.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
        self.chatLog.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)

        layout.addWidget(self.listChatting, 0, 0, 6, 1)
        layout.addWidget(self.chatLog, 0, 1, 3, 3)
        layout.addWidget(self.textInput, 3, 1, 2, 3)
        layout.addWidget(self.chattingFri, 5, 1, 1, 1)
        layout.addWidget(self.btnSend, 5, 3, 1, 1)

        self.tabChat.setLayout(layout)
Exemple #22
0
    def __init__(self, browser_choice='text', initial_page=''):
        """

        browser_choice =='text' for text_browser
                               but this can also show simple Html text
                       =='web'  for web browser

        set_page_txt puts text either plain string text
        or HTML format

        """
        super().__init__()
        self.layout = QVBoxLayout()
        self.setLayout(self.layout)
        self.browser_choice = browser_choice
        self.page_txt = initial_page
        if self.browser_choice in ['text', 'html']:
            self.browser = QTextBrowser()
            self.browser.setAcceptRichText(True)
            self.browser.setOpenExternalLinks(True)
        elif self.browser_choice == 'web':
            #self.browser = QWebEngineView()
            pass
        #---initial view
        self.layout.addWidget(self.browser)
        self.set_page_txt(self.page_txt)
Exemple #23
0
    def __init__(self, exctype, excvalue, exctb):
        super(ExceptionDialog, self).__init__()

        self._tbshort = ''.join(
            traceback.format_exception_only(exctype, excvalue))
        tbfull = traceback.format_exception(exctype, excvalue, exctb)
        self._tbfull = ''.join(tbfull)
        self._ext_maintainer = app.extensions().is_extension_exception(tbfull)

        layout = QVBoxLayout()
        self.setLayout(layout)

        self.errorLabel = QLabel()
        layout.addWidget(self.errorLabel)
        textview = QTextBrowser()
        layout.addWidget(textview)
        textview.setText(self._tbfull)
        textview.moveCursor(QTextCursor.End)

        layout.addWidget(widgets.Separator())

        b = self.buttons = QDialogButtonBox(QDialogButtonBox.Ok
                                            | QDialogButtonBox.Cancel)
        b.button(QDialogButtonBox.Ok).setIcon(icons.get("tools-report-bug"))
        layout.addWidget(b)

        b.accepted.connect(self.accept)
        b.rejected.connect(self.reject)
        self.resize(600, 300)
        app.translateUI(self)
        self.exec_()
Exemple #24
0
    def __init__(self, parent=None):
        super(Window, self).__init__(parent)

        model = FileListModel(self)
        model.setDirPath(QLibraryInfo.location(QLibraryInfo.PrefixPath))

        label = QLabel("Directory")
        lineEdit = QLineEdit()
        label.setBuddy(lineEdit)

        view = QListView()
        view.setModel(model)

        self.logViewer = QTextBrowser()
        self.logViewer.setSizePolicy(
            QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred))

        lineEdit.textChanged.connect(model.setDirPath)
        lineEdit.textChanged.connect(self.logViewer.clear)
        model.numberPopulated.connect(self.updateLog)

        layout = QGridLayout()
        layout.addWidget(label, 0, 0)
        layout.addWidget(lineEdit, 0, 1)
        layout.addWidget(view, 1, 0, 1, 2)
        layout.addWidget(self.logViewer, 2, 0, 1, 2)

        self.setLayout(layout)
        self.setWindowTitle("Fetch More Example")
Exemple #25
0
    def ui(self):
        """ Method build ui """
        grid = QGridLayout(self)
        self.setLayout(grid)

        self.userLbl = QLabel(self)
        self.timeLbl = QLabel(self)
        self.timeLbl.setAlignment(Qt.AlignRight)

        self.line_1 = QFrame(self)
        self.line_1.setFrameShape(QFrame.HLine)
        self.line_1.setFrameShadow(QFrame.Sunken)
        self.line_2 = QFrame(self)
        self.line_2.setFrameShape(QFrame.HLine)
        self.line_2.setFrameShadow(QFrame.Sunken)

        self.msgLbl = QTextBrowser(self)
        # font = QFont()
        # font.setPointSize(12)
        # self.msgLbl.setFont(font)
        self.msgLbl.setFrameShape(QFrame.NoFrame)
        self.msgLbl.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.msgLbl.setSizeAdjustPolicy(QAbstractScrollArea.AdjustToContents)
        self.msgLbl.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)

        grid.addWidget(self.userLbl, 0, 0)
        grid.addWidget(self.timeLbl, 0, 1)
        grid.addWidget(self.line_1, 1, 0, 1, 2)
        grid.addWidget(self.msgLbl, 2, 0, 1, 2)
        grid.addWidget(self.line_2, 3, 0, 1, 2)
Exemple #26
0
    def InitUI(self):
        self.setGeometry(100, 100, 300, 400)
        self.setWindowIcon(QtGui.QIcon("home.png"))
        self.label_name = QLabel("Name?")
        self.label_id = QLabel("id?")

        self.lineedit_name = QLineEdit("")
        self.lineedit_id = QLineEdit("")

        self.btn = QPushButton("db입력")
        self.btn_show_db = QPushButton("보기")
        self.btn_del = QPushButton("지우기")
        self.qrs = QTextBrowser()
        vbox = QVBoxLayout()
        hbox = QHBoxLayout()
        vbox.addWidget(self.label_name)
        vbox.addWidget(self.lineedit_name)
        vbox.addWidget(self.label_id)
        vbox.addWidget(self.lineedit_id)
        gbox = QGroupBox()
        hbox.addWidget(self.btn)
        hbox.addWidget(self.btn_show_db)
        hbox.addWidget(self.btn_del)
        gbox.setLayout(hbox)
        vbox.addWidget(gbox)
        vbox.addWidget(self.qrs)
        self.setLayout(vbox)

        self.btn.clicked.connect(self.db_btn_click)

        self.btn_show_db.clicked.connect(self.show_db)
        self.btn_del.clicked.connect(self.delete_all)
 def __init__(self, lang):
     super().__init__()
     self.lang = lang
     self._translate = QCoreApplication.translate
     # Init
     self.label_header = QLabel(self)
     self.tabs = QTabWidget(self)
     self.tab_about = QWidget()
     self.tab_sources = QWidget()
     self.tab_authors = QWidget()
     self.tab_thanks = QWidget()
     self.sources_text = QTextBrowser(self.tab_sources)
     self.about_text = QTextBrowser(self.tab_about)
     self.authors_text = QTextBrowser(self.tab_authors)
     self.thanks_text = QTextBrowser(self.tab_thanks)
     self.button_box = QDialogButtonBox(self)
Exemple #28
0
    def __init__(self):
        QtWidgets.QMainWindow.__init__(self)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.setWindowTitle("application main window")
        self.main_widget = QtWidgets.QWidget(self)
        self.xs = []
        self.ys = []
        vbox = QtWidgets.QVBoxLayout(self.main_widget)

        self.canvas = MyMplCanvas(self.main_widget, width=6, height=6,
                                  dpi=100)  ###attention###
        vbox.addWidget(self.canvas)

        hbox = QtWidgets.QHBoxLayout(self.main_widget)
        self.textBrowser = QTextBrowser(self)
        self.lineEdit = QLineEdit(self)

        vbox.addWidget(self.textBrowser)
        vbox.addWidget(self.lineEdit)

        self.setLayout(vbox)

        self.main_widget.setFocus()
        self.setCentralWidget(self.main_widget)
        self.lineEdit.returnPressed.connect(self.update_text)

        self.ani = FuncAnimation(self.canvas.figure,
                                 self.update_line,
                                 interval=10)
Exemple #29
0
    def initUI(self):
        self.label1 = QLabel('횟수 입력: ', self)

        self.le = QLineEdit()
        self.le.returnPressed.connect(self.append_text)

        self.tb = QTextBrowser()
        self.tb.setAcceptRichText(True)
        self.tb.setOpenExternalLinks(True)

        self.clear_btn = QPushButton('Clear')
        self.clear_btn.pressed.connect(self.clear_text)

        hbox = QHBoxLayout()
        hbox.addStretch(1)
        hbox.addWidget(self.label1, 0)
        hbox.addWidget(self.le, 1)
        hbox.addStretch(1)

        vbox1 = QVBoxLayout()
        vbox1.addLayout(hbox)
        vbox1.addWidget(self.tb, 1)
        vbox1.addWidget(self.clear_btn, 2)

        self.setLayout(vbox1)

        self.setWindowIcon(
            QIcon('D:\Python\Mymodules\\auto_lotto\\favicon.png'))
        # self.setGeometry(800, 800, 800, 600)
        self.setWindowTitle("로또 번호 자동 추첨 프로그램 by SteveKwon211")
        self.resize(800, 550)
        self.center()
        self.show()
    def __init__(self):
        super(SearchWindow, self).__init__()  # 使用super函数可以实现子类使用父类的方法
        self.setWindowTitle("电影搜索")
        self.setWindowIcon(QIcon('../douban.jpg'))  # 设置窗口图标
        self.resize(600, 800)
        # 电影信息
        self.movies_df = pd.read_csv('../data/doubanMovies.csv',
                                     encoding='utf-8')
        self.movies_df = self.movies_df.iloc[:, [0, 1, 6, 15, 16]]
        self.movies_df = self.movies_df.drop_duplicates(subset='url')
        self.movies_df = self.movies_df.rename(
            columns={'Unnamed: 0': 'Movie_ID'})

        self.search_label = QLabel("<h3>请输入电影名称:</h3>", self)
        self.search_edit = QLineEdit(self)
        self.search_button = QPushButton("搜索", self)
        self.search_button.clicked.connect(
            lambda: self.Fuzzy_search(self.search_edit.text()))
        self.search_browser = QTextBrowser(self)

        self.h_layout = QHBoxLayout()
        self.v_layout = QVBoxLayout()

        self.h_layout.addWidget(self.search_label)
        self.h_layout.addWidget(self.search_edit)
        self.h_layout.addWidget(self.search_button)

        self.v_layout.addLayout(self.h_layout)
        self.v_layout.addWidget(self.search_browser)

        self.setLayout(self.v_layout)