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


Python Qt.WindowMinimizeButtonHint方法代码示例

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


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

示例1: _print_preview

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMinimizeButtonHint [as 别名]
def _print_preview(tab: apitypes.Tab) -> None:
    """Show a print preview."""
    def print_callback(ok: bool) -> None:
        if not ok:
            message.error("Printing failed!")

    tab.printing.check_preview_support()
    diag = QPrintPreviewDialog(tab)
    diag.setAttribute(Qt.WA_DeleteOnClose)
    diag.setWindowFlags(
        diag.windowFlags() |  # type: ignore[operator, arg-type]
        Qt.WindowMaximizeButtonHint |
        Qt.WindowMinimizeButtonHint)
    diag.paintRequested.connect(functools.partial(
        tab.printing.to_printer, callback=print_callback))
    diag.exec_() 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:18,代码来源:misccommands.py

示例2: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMinimizeButtonHint [as 别名]
def __init__(self, parent=None):
        """
        Constructor
        
        @param parent reference to the parent widget
        @type QWidget
        """
        super(DyMainWindow, self).__init__(parent)
        self.setupUi(self)

        self.setWindowFlags(Qt.WindowMinimizeButtonHint|Qt.WindowCloseButtonHint)
        self.setFixedSize(self.width(), self.height())

        # menu
        self._initMenu()

        # config
        self._config() 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:20,代码来源:DyMainWindow.py

示例3: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMinimizeButtonHint [as 别名]
def __init__(self, *args, **kwargs):
        super(Window, self).__init__(*args, **kwargs)
        # 主屏幕的可用大小(去掉任务栏)
        self._rect = QApplication.instance().desktop().availableGeometry(self)
        self.resize(800, 600)
        self.setWindowFlags(Qt.Window
                            | Qt.FramelessWindowHint
                            | Qt.WindowSystemMenuHint
                            | Qt.WindowMinimizeButtonHint
                            | Qt.WindowMaximizeButtonHint
                            | Qt.WindowCloseButtonHint)
        # 增加薄边框
        style = win32gui.GetWindowLong(int(self.winId()), win32con.GWL_STYLE)
        win32gui.SetWindowLong(
            int(self.winId()), win32con.GWL_STYLE, style | win32con.WS_THICKFRAME)

        if QtWin.isCompositionEnabled():
            # 加上 Aero 边框阴影
            QtWin.extendFrameIntoClientArea(self, -1, -1, -1, -1)
        else:
            QtWin.resetExtendedFrame(self) 
开发者ID:PyQt5,项目名称:PyQt,代码行数:23,代码来源:NativeEvent.py

示例4: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMinimizeButtonHint [as 别名]
def __init__(self, parent=None):
        # 继承主窗口类
        super(Reader, self).__init__(parent)
        # 设置应用图标
        self.setWindowIcon(QIcon('source/book.png'))
        # 获取屏幕对象
        self.screen = QDesktopWidget().screenGeometry()
        self.setupUi(self)
        # 仅支持最小化以及关闭按钮
        self.setWindowFlags(Qt.WindowMinimizeButtonHint|Qt.WindowCloseButtonHint)
        # 去掉 toolbar 右键菜单
        self.setContextMenuPolicy(Qt.NoContextMenu)
        # 固定界面大小,不可修改
        self.setFixedSize(self.screen.width(), self.screen.height())
        # 获取 QTableWidget 实例 
        self.table = QTableWidget()  
        # 将 self.table 设置为中心 widget
        self.setCentralWidget(self.table)
        # 初始化
        self.initUi() 
开发者ID:xflywind,项目名称:Python-Application,代码行数:22,代码来源:__main__.py

示例5: _createConfigUI

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMinimizeButtonHint [as 别名]
def _createConfigUI(self):
        if self._ui_view is None:
            Logger.log("d", "Creating ImageReader config UI")
            path = os.path.join(PluginRegistry.getInstance().getPluginPath("ImageReader"), "ConfigUI.qml")
            self._ui_view = Application.getInstance().createQmlComponent(path, {"manager": self})
            self._ui_view.setFlags(self._ui_view.flags() & ~Qt.WindowCloseButtonHint & ~Qt.WindowMinimizeButtonHint & ~Qt.WindowMaximizeButtonHint)
            self._disable_size_callbacks = False 
开发者ID:Ultimaker,项目名称:Cura,代码行数:9,代码来源:ImageReaderUI.py

示例6: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMinimizeButtonHint [as 别名]
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.DomainCookies = {}

        self.setWindowTitle('微信读书助手') # 设置窗口标题
        self.resize(900, 600) # 设置窗口大小
        self.setWindowFlags(Qt.WindowMinimizeButtonHint) # 禁止最大化按钮
        self.setFixedSize(self.width(), self.height()) # 禁止调整窗口大小

        url = 'https://weread.qq.com/#login' # 目标地址
        self.browser = QWebEngineView() # 实例化浏览器对象

        self.profile = QWebEngineProfile.defaultProfile()
        self.profile.cookieStore().deleteAllCookies() # 初次运行软件时删除所有cookies
        self.profile.cookieStore().cookieAdded.connect(self.onCookieAdd) # cookies增加时触发self.onCookieAdd()函数

        self.browser.loadFinished.connect(self.onLoadFinished) # 网页加载完毕时触发self.onLoadFinished()函数

        self.browser.load(QUrl(url)) # 加载网页
        self.setCentralWidget(self.browser) # 设置中心窗口





    # 网页加载完毕事件 
开发者ID:shengqiangzhang,项目名称:examples-of-web-crawlers,代码行数:29,代码来源:pyqt_gui.py

示例7: isMinimizeable

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMinimizeButtonHint [as 别名]
def isMinimizeable(self):
        """是否可以最小化
        """
        return self.testWindowFlags(Qt.WindowMinimizeButtonHint) 
开发者ID:PyQt5,项目名称:CustomWidgets,代码行数:6,代码来源:CTitleBar.py

示例8: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMinimizeButtonHint [as 别名]
def __init__(self, parent=None):
        super(tableWidget, self).__init__(parent)

        self.setWindowTitle("QTableWidget en PyQt5 por: ANDRES NIÑO")
        self.setWindowIcon(QIcon("Qt.png"))
        self.setWindowFlags(Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint |
                            Qt.MSWindowsFixedSizeDialogHint)
        self.setFixedSize(740, 348)

        self.initUI() 
开发者ID:andresnino,项目名称:PyQt5,代码行数:12,代码来源:tableWidget.py

示例9: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMinimizeButtonHint [as 别名]
def __init__(self, parent = None):
        super(tomarFoto, self).__init__(parent)

        self.setWindowTitle("Tomar foto con PyQt5 por: ANDRES NIÑO")
        self.setWindowIcon(QIcon("Qt.png"))
        self.setWindowFlags(Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint |
                            Qt.MSWindowsFixedSizeDialogHint)
        self.setFixedSize(645, 420)

        self.initUI() 
开发者ID:andresnino,项目名称:PyQt5,代码行数:12,代码来源:tomarFoto.py

示例10: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMinimizeButtonHint [as 别名]
def __init__(self, parent=None, aw = None):
        super(ArtisanDialog,self).__init__(parent)
        self.aw = aw # the Artisan application window
        
        # IMPORTANT NOTE: if dialog items have to be access after it has been closed, this Qt.WA_DeleteOnClose attribute 
        # has to be set to False explicitly in its initializer (like in comportDlg) to avoid the early GC and one might
        # want to use a dialog.deleteLater() call to explicitly have the dialog and its widgets GCe
        # or rather use sip.delete(dialog) if the GC via .deleteLater() is prevented by a link to a parent object (parent not None)
        self.setAttribute(Qt.WA_DeleteOnClose, True)

#        if platf == 'Windows':
# setting those Windows flags could be the reason for some instabilities on Windows
#            windowFlags = self.windowFlags()
#        #windowFlags &= ~Qt.WindowContextHelpButtonHint # remove help button
#        #windowFlags &= ~Qt.WindowMaximizeButtonHint # remove maximise button
#        #windowFlags &= ~Qt.WindowMinMaxButtonsHint  # remove min/max combo
#        #windowFlags |= Qt.WindowMinimizeButtonHint  # Add minimize  button
#        windowFlags |= Qt.WindowSystemMenuHint  # Adds a window system menu, and possibly a close button
#            windowFlags |= Qt.WindowMinMaxButtonsHint  # add min/max combo
#            self.setWindowFlags(windowFlags)

        # configure standard dialog buttons
        self.dialogbuttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel,Qt.Horizontal)
        self.dialogbuttons.button(QDialogButtonBox.Ok).setDefault(True)
        self.dialogbuttons.button(QDialogButtonBox.Ok).setAutoDefault(True)
        self.dialogbuttons.button(QDialogButtonBox.Cancel).setDefault(False)
        self.dialogbuttons.button(QDialogButtonBox.Cancel).setAutoDefault(False)
        self.dialogbuttons.button(QDialogButtonBox.Ok).setFocusPolicy(Qt.StrongFocus) # to add to tab focus switch
        if self.aw.locale not in self.aw.qtbase_locales:
            self.dialogbuttons.button(QDialogButtonBox.Ok).setText(QApplication.translate("Button","OK", None))
            self.dialogbuttons.button(QDialogButtonBox.Cancel).setText(QApplication.translate("Button","Cancel",None))
        # add additional CMD-. shortcut to close the dialog
        self.dialogbuttons.button(QDialogButtonBox.Cancel).setShortcut(QKeySequence("Ctrl+."))
        # add additional CMD-W shortcut to close this dialog (ESC on Mac OS X)
        cancelAction = QAction(self, triggered=lambda _:self.dialogbuttons.rejected.emit())
        try:
            cancelAction.setShortcut(QKeySequence.Cancel)
        except:
            pass
        self.dialogbuttons.button(QDialogButtonBox.Cancel).addActions([cancelAction]) 
开发者ID:artisan-roaster-scope,项目名称:artisan,代码行数:42,代码来源:dialogs.py

示例11: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMinimizeButtonHint [as 别名]
def __init__(self, parent=None):
        # 继承主窗口类
        super(Reader, self).__init__(parent)
        # 设置应用图标
        self.setWindowIcon(QIcon('source/book.png'))
        # 获取屏幕对象
        self.screen = QDesktopWidget().screenGeometry()
        self.setupUi(self)
        # 仅支持最小化以及关闭按钮
        self.setWindowFlags(Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint)
        # 去掉 toolbar 右键菜单
        self.setContextMenuPolicy(Qt.NoContextMenu)
        # 固定界面大小,不可修改
        self.setFixedSize(self.screen.width(), self.screen.height() - 75)
        # 获取 QTableWidget 实例
        self.table = QTableWidget()
        # 将 self.table 设置为中心 widget
        # self.setCentralWidget(self.table)
        # 初始化选项卡
        self.tabwidget = QTabWidget()
        # 添加书库选项卡
        self.tabwidget.addTab(self.table, '书库')
        self.setCentralWidget(self.tabwidget)
        # 设置选项卡可以关闭
        self.tabwidget.setTabsClosable(True)
        # 点击选项卡叉号时,执行 removeTabab 操作
        self.tabwidget.tabCloseRequested[int].connect(self.remove_tab)
        self.initUi() 
开发者ID:xflywind,项目名称:Python-Application,代码行数:30,代码来源:__main__.py

示例12: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMinimizeButtonHint [as 别名]
def __init__(self, parent=None):
        # 继承主窗口类
        super(Starter, self).__init__(parent)
        # 不支持全屏
        self.setWindowFlags(Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint)
        # 图标
        self.setWindowIcon(QIcon('source/1.ico'))
        self.setupUi(self)
        self.initUi() 
开发者ID:xflywind,项目名称:Python-Application,代码行数:11,代码来源:start.py


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