当前位置: 首页>>代码示例>>Python>>正文


Python QApplication.desktop方法代码示例

本文整理汇总了Python中PyQt5.QtWidgets.QApplication.desktop方法的典型用法代码示例。如果您正苦于以下问题:Python QApplication.desktop方法的具体用法?Python QApplication.desktop怎么用?Python QApplication.desktop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtWidgets.QApplication的用法示例。


在下文中一共展示了QApplication.desktop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _initUi

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _initUi(self):
        self.setWindowTitle('个股资料(F10)')
 
        # 控件
        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        self._stockInfoWidget = DyTreeWidget(self.fields)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(self._stockInfoWidget, 0, 0, 20, 10)
 
        grid.addWidget(okPushButton, 0, 10)
        grid.addWidget(cancelPushButton, 1, 10)
 
        self.setLayout(grid)
        self.resize(QApplication.desktop().size().width()//3, QApplication.desktop().size().height()//2) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:24,代码来源:DyStockInfoDlg.py

示例2: _initUi

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _initUi(self):
        self.setWindowTitle('选择哪些杰卡德指数可视化')
 
        # 控件
        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        self._jaccardIndexWidget = DyTreeWidget([[x] for x in self._columns])

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(self._jaccardIndexWidget, 0, 0, 20, 2)
 
        grid.addWidget(okPushButton, 20, 1)
        grid.addWidget(cancelPushButton, 20, 0)
 
        self.setLayout(grid)
        self.resize(QApplication.desktop().size().width()//6, QApplication.desktop().size().height()//2) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:24,代码来源:DyStockDataJaccardIndexPlotDlg.py

示例3: initUI

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def initUI(self):

        self.setWindowTitle('File Manager')
        self.resize(100, 100)

        desktop = QApplication.desktop()
        x = int(desktop.width()*0.9) - self.window().width()
        y = int(desktop.height()*0.1)
        self.move(x, y)

        self.setWindowFlags(QtCore.Qt.WindowMinimizeButtonHint |   # 使能最小化按钮
                            QtCore.Qt.WindowCloseButtonHint |      # 使能关闭按钮
                            QtCore.Qt.FramelessWindowHint |        # 去掉边框
                            QtCore.Qt.WindowStaysOnTopHint)        # 窗体总在最前端
        self.setFixedSize(self.width(), self.height())             # 固定窗体大小

        # 设置拖拽事件
        self.setAcceptDrops(True)

        # 设置背景图片
        self.set_background() 
开发者ID:SmileJET,项目名称:utils-for-python,代码行数:23,代码来源:drag_files_do_event.py

示例4: center

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def center(self):
        frame = self.frameGeometry()
        screen = QApplication.desktop().screenNumber(QApplication.desktop().cursor().pos())
        centerPoint = QApplication.desktop().screenGeometry(screen).center()
        frame.moveCenter(centerPoint)
        self.move(frame.topLeft()) 
开发者ID:frappe,项目名称:biometric-attendance-sync-tool,代码行数:8,代码来源:gui.py

示例5: _initUi

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _initUi(self, title):
        self.setWindowTitle(title)
        self.setWindowFlags(Qt.Window)
        self.resize(QApplication.desktop().size().width()//2, QApplication.desktop().size().height()//2)

        self.show()

        self.move((QApplication.desktop().size().width() - self.width())//2, (QApplication.desktop().size().height() - self.height())//2) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:10,代码来源:DyDataFrameWindow.py

示例6: _initUi

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _initUi(self, colNames):
        self.setWindowTitle('列运算')
 
        # 控件
        table = DyTableWidget(parent=None, readOnly=True, index=False, floatCut=True, autoScroll=False)
        table.setColNames(['列名', '表达式'])
        rows = [[name, 'x[{0}]'.format(i)] for i, name in enumerate(colNames)]
        table.fastAppendRows(rows)

        descriptionLabel = QLabel('列运算表达式(Pandas语法)')
        self._expressionTextEdit = QTextEdit()

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(table, 0, 0, 22, 1)

        grid.addWidget(descriptionLabel, 0, 1)

        grid.addWidget(self._expressionTextEdit, 1, 1, 20, 20)
 
        grid.addWidget(okPushButton, 0, 21)
        grid.addWidget(cancelPushButton, 1, 21)
 
 
        self.setLayout(grid)
        self.resize(QApplication.desktop().size().width()//2, QApplication.desktop().size().height()//4*3) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:35,代码来源:DyStockTableColumnOperateDlg.py

示例7: _initUi

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _initUi(self, colNames):
        self.setWindowTitle('过滤')
 
        # 控件
        table = DyTableWidget(parent=None, readOnly=True, index=False, floatCut=True, autoScroll=False)
        table.setColNames(['列名', '表达式'])
        rows = [[name, 'x[{0}]'.format(i)] for i, name in enumerate(colNames)]
        table.fastAppendRows(rows)

        descriptionLabel = QLabel('行过滤表达式(Python语法)')
        self._filterTextEdit = QTextEdit()
        self._newWindowCheckBox = QCheckBox('新窗口')
        self._newWindowCheckBox.setChecked(True)
        self._highlightCheckBox = QCheckBox('原窗口高亮')
        self._highlightCheckBox.setChecked(False)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(table, 0, 0, 22, 1)
        grid.addWidget(self._newWindowCheckBox, 0, 1)
        grid.addWidget(self._highlightCheckBox, 0, 2)

        grid.addWidget(descriptionLabel, 1, 1)

        grid.addWidget(self._filterTextEdit, 2, 1, 20, 20)
 
        grid.addWidget(okPushButton, 0, 21)
        grid.addWidget(cancelPushButton, 1, 21)
 
 
        self.setLayout(grid)
        self.resize(QApplication.desktop().size().width()//2, QApplication.desktop().size().height()//4*3) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:41,代码来源:DyStockTableFilterDlg.py

示例8: _initUi

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _initUi(self, name, baseDate):
        self.setWindowTitle('波动分布[{0}]'.format(name))
 
        # 控件
        forwardNTDaysLabel = QLabel('基准日期[{0}]向前N日(不包含基准日期)'.format(baseDate))
        self._forwardNTDaysLineEdit = QLineEdit('30')

        # 自身波动和绝对波动
        # 个股绝对波动 = 个股自身波动 + 大盘波动
        selfVolatilityRadioButton = QRadioButton('自身波动'); selfVolatilityRadioButton.setChecked(True)
        selfVolatilityRadioButton.setToolTip('个股绝对波动 = 个股自身波动 + 大盘波动')

        absoluteVolatilityRadioButton = QRadioButton('绝对波动')
        absoluteVolatilityRadioButton.setToolTip('个股绝对波动 = 个股自身波动 + 大盘波动')

        # 添加到QButtonGroup
        self._volatilityButtonGroup = QButtonGroup()
        self._volatilityButtonGroup.addButton(selfVolatilityRadioButton, 1); 
        self._volatilityButtonGroup.addButton(absoluteVolatilityRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(forwardNTDaysLabel, 0, 0)
        grid.addWidget(self._forwardNTDaysLineEdit, 0, 1)

        grid.addWidget(selfVolatilityRadioButton, 1, 0)
        grid.addWidget(absoluteVolatilityRadioButton, 1, 1)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
        self.setLayout(grid)

        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:43,代码来源:DyStockVolatilityDistDlg.py

示例9: _initUi

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _initUi(self, title, backward):
        self.setWindowTitle('添加{0}列'.format(title))
 
        # 控件
        increaseColumnsLable = QLabel('基准日期几日{0}'.format(title))
        self._increaseColumnsLineEdit = QLineEdit(','.join([str(x) for x in self._data['days']]) if self._data else '1,2,3,4,5,10')

        # 前 & 后
        forwardRadioButton = QRadioButton('向前')
        backwardRadioButton = QRadioButton('向后')
        if backward:
            backwardRadioButton.setChecked(True)
        else:
            forwardRadioButton.setChecked(True)

        # 添加到QButtonGroup
        self._wardButtonGroup = QButtonGroup()
        self._wardButtonGroup.addButton(forwardRadioButton, 1)
        self._wardButtonGroup.addButton(backwardRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(increaseColumnsLable, 0, 0, 1, 2)
        grid.addWidget(self._increaseColumnsLineEdit, 1, 0, 1, 2)

        grid.addWidget(forwardRadioButton, 2, 0)
        grid.addWidget(backwardRadioButton, 2, 1)

        grid.addWidget(okPushButton, 3, 1)
        grid.addWidget(cancelPushButton, 3, 0)
 
 
        self.setLayout(grid)
        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:43,代码来源:DyStockTableAddColumnsDlg.py

示例10: _initUi

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _initUi(self, name, baseDate):
        self.setWindowTitle('行业对比[{0}]-基准日期[{1}]'.format(name, baseDate))
 
        # 控件
        forwardNTDaysLabel = QLabel('向前N日涨幅(%)')
        self._forwardNTDaysLineEdit = QLineEdit('30')

        self._industry2CheckBox = QCheckBox('行业二级分级')
        #self._industry2CheckBox.setChecked(True)

        self._industry3CheckBox = QCheckBox('行业三级分级')
        self._industry3CheckBox.setChecked(True)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(forwardNTDaysLabel, 0, 0)
        grid.addWidget(self._forwardNTDaysLineEdit, 0, 1)

        grid.addWidget(self._industry2CheckBox, 1, 0)
        grid.addWidget(self._industry3CheckBox, 1, 1)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
        self.setLayout(grid)

        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:36,代码来源:DyStockIndustryCompareDlg.py

示例11: _limitUpRatioAct

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _limitUpRatioAct(self):
        colData = self.getColumnsData([self._rightClickHeaderItem.text()])

        limitUpNbr, nonLimitUpNbr = 0, 0
        for row in colData:
            if row is None:
                continue

            value = row[0]

            try:
                value = float(value)
            except Exception:
                continue

            if value >= DyStockCommon.limitUpPct:
                limitUpNbr += 1
            else:
                nonLimitUpNbr += 1

        totalNbr = limitUpNbr + nonLimitUpNbr

        table = DyTableWidget(readOnly=True, index=False)
        table.setColNames(['涨停', '非涨停', '涨停占比(%)'])
        table.appendRow([limitUpNbr, nonLimitUpNbr, limitUpNbr/totalNbr*100])

        table.setWindowTitle('涨停比')
        table.resize(QApplication.desktop().size().width()//2, QApplication.desktop().size().height()//3)
        table.show()

        self._windows.append(table) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:33,代码来源:DyStockTableWidget.py

示例12: _upDownRatioAct

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _upDownRatioAct(self):
        colData = self.getColumnsData([self._rightClickHeaderItem.text()])

        upNbr, downNbr, noChangeNbr = 0, 0, 0
        for row in colData:
            if row is None:
                continue
            value = row[0]

            try:
                value = float(value)
            except Exception:
                continue

            if value > 0:
                upNbr += 1
            elif value < 0:
                downNbr += 1
            else:
                noChangeNbr += 1

        totalNbr = upNbr + downNbr + noChangeNbr

        table = DyTableWidget(readOnly=True, index=False)
        table.setColNames(['涨', '跌', '平', '上涨占比(%)', '下跌占比(%)', '平占比(%)'])
        table.appendRow([upNbr, downNbr, noChangeNbr, upNbr/totalNbr*100, downNbr/totalNbr*100, noChangeNbr/totalNbr*100])

        table.setWindowTitle('涨跌比')
        table.resize(QApplication.desktop().size().width()//2, QApplication.desktop().size().height()//3)
        table.show()

        self._windows.append(table) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:34,代码来源:DyStockTableWidget.py

示例13: _initUi

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _initUi(self):
        self.setWindowTitle('要调试的股票')
 
        # 控件
        descriptionLabel = QLabel('要调试的股票代码')
        self._codesTextEdit = QTextEdit()
        self._codesTextEdit.setPlainText(self._read())

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(descriptionLabel, 0, 0)

        grid.addWidget(self._codesTextEdit, 1, 0, 20, 10)
 
        grid.addWidget(okPushButton, 1, 11)
        grid.addWidget(cancelPushButton, 2, 11)
 
 
        self.setLayout(grid)
        self.resize(QApplication.desktop().size().width()//3, QApplication.desktop().size().height()//2) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:29,代码来源:DyStockSelectTestedStocksDlg.py

示例14: _initUi

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _initUi(self, title):
        self.setWindowTitle('添加{0}列'.format(title))
 
        # 控件
        increaseColumnsLable = QLabel('基准日期几日{0}'.format(title))
        self._increaseColumnsLineEdit = QLineEdit(','.join(self._data['days']) if self._data else '1,2,3,4,5,10')

        # 前 & 后
        forwardRadioButton = QRadioButton('向前')
        backwardRadioButton = QRadioButton('向后'); backwardRadioButton.setChecked(True)

        # 添加到QButtonGroup
        self._wardButtonGroup = QButtonGroup()
        self._wardButtonGroup.addButton(forwardRadioButton, 1); 
        self._wardButtonGroup.addButton(backwardRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(increaseColumnsLable, 0, 0, 1, 2)
        grid.addWidget(self._increaseColumnsLineEdit, 1, 0, 1, 2)

        grid.addWidget(forwardRadioButton, 2, 0)
        grid.addWidget(backwardRadioButton, 2, 1)

        grid.addWidget(okPushButton, 3, 1)
        grid.addWidget(cancelPushButton, 3, 0)
 
 
        self.setLayout(grid)
        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:39,代码来源:DyStockSelectAddColumnsDlg.py

示例15: _initUi

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import desktop [as 别名]
def _initUi(self, strategyName):
        self.setWindowTitle('[{0}]另存为'.format(strategyName))
 
        allRadioButton = QRadioButton('所有'); allRadioButton.setChecked(True)
        highlightRadioButton = QRadioButton('高亮')

        # 添加到QButtonGroup
        self._buttonGroup = QButtonGroup()
        self._buttonGroup.addButton(allRadioButton, 1); 
        self._buttonGroup.addButton(highlightRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(allRadioButton, 1, 0)
        grid.addWidget(highlightRadioButton, 1, 1)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
        self.setLayout(grid)
        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:30,代码来源:DyStockSelectSaveAsDlg.py


注:本文中的PyQt5.QtWidgets.QApplication.desktop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。