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


Python QFrame.setLineWidth方法代码示例

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


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

示例1: CmdPrompt

# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setLineWidth [as 别名]
class CmdPrompt(QWidget):
    """
    CmdPrompt for Embroidermodder.
    """
    def __init__(self, parent=None):
        """Default class constructor."""
        super(CmdPrompt, self).__init__(parent)

        qDebug("CmdPrompt Constructor")
        self.setObjectName("Command Prompt")

        self.promptInput = promptInput = CmdPromptInput(self)
        self.promptHistory = CmdPromptHistory()
        self.promptDivider = QFrame(self)
        promptVBoxLayout = QVBoxLayout(self)

        self.promptSplitter = CmdPromptSplitter(self)

        self.setFocusProxy(promptInput)
        self.promptHistory.setFocusProxy(promptInput)

        self.promptDivider.setLineWidth(1)
        self.promptDivider.setFrameStyle(QFrame.HLine)
        QWIDGETSIZE_MAX = 1 # TODO/FIXME. What is QWIDGETSIZE_MAX???
        self.promptDivider.setMaximumSize(QWIDGETSIZE_MAX, 1)

        promptVBoxLayout.addWidget(self.promptSplitter)
        promptVBoxLayout.addWidget(self.promptHistory)
        promptVBoxLayout.addWidget(self.promptDivider)
        promptVBoxLayout.addWidget(promptInput)

        promptVBoxLayout.setSpacing(0)
        promptVBoxLayout.setContentsMargins(0, 0, 0, 0)

        self.setLayout(promptVBoxLayout)

        #TODO# self.styleHash = QHash<QString, QString>()
        #TODO# self.styleHash.insert("color",                      "#000000") # Match -------|
        #TODO# self.styleHash.insert("background-color",           "#FFFFFF") #              |
        #TODO# self.styleHash.insert("selection-color",            "#FFFFFF") #              |
        #TODO# self.styleHash.insert("selection-background-color", "#000000") # Match -------|
        #TODO# self.styleHash.insert("font-family",              "Monospace")
        #TODO# self.styleHash.insert("font-style",                  "normal")
        #TODO# self.styleHash.insert("font-size",                     "12px")

        # self.updateStyle()

        self.blinkState = False
        self.blinkTimer = QTimer(self)
        self.blinkTimer.timeout.connect(self.blink)

        self.show()

        #### stopBlinking = SIGNAL(str)
        #TODO# I'm guessing these are custom Signals...
        #TODO# promptInput.stopBlinking.connect(self.stopBlinking)
        #TODO# connect(promptInput, SIGNAL(appendHistory(const QString&, int)), promptHistory, SLOT(appendHistory(const QString&, int)));
        #TODO# connect(this, SIGNAL(appendTheHistory(const QString&, int)), promptHistory, SLOT(appendHistory(const QString&, int)));

        # For use outside of command prompt
        #TODO# connect(promptInput, SIGNAL(startCommand(const QString&)), this, SIGNAL(startCommand(const QString&)));
        #TODO# connect(promptInput, SIGNAL(runCommand(const QString&, const QString&)), this, SIGNAL(runCommand(const QString&, const QString&)));
        #TODO# connect(promptInput, SIGNAL(deletePressed()),    this, SIGNAL(deletePressed()));
        #TODO# connect(promptInput, SIGNAL(tabPressed()),       this, SIGNAL(tabPressed()));
        #TODO# connect(promptInput, SIGNAL(escapePressed()),    this, SIGNAL(escapePressed()));
        #TODO# connect(promptInput, SIGNAL(upPressed()),        this, SIGNAL(upPressed()));
        #TODO# connect(promptInput, SIGNAL(downPressed()),      this, SIGNAL(downPressed()));
        #TODO# connect(promptInput, SIGNAL(F1Pressed()),        this, SIGNAL(F1Pressed()));
        #TODO# connect(promptInput, SIGNAL(F2Pressed()),        this, SIGNAL(F2Pressed()));
        #TODO# connect(promptInput, SIGNAL(F3Pressed()),        this, SIGNAL(F3Pressed()));
        #TODO# connect(promptInput, SIGNAL(F4Pressed()),        this, SIGNAL(F4Pressed()));
        #TODO# connect(promptInput, SIGNAL(F5Pressed()),        this, SIGNAL(F5Pressed()));
        #TODO# connect(promptInput, SIGNAL(F6Pressed()),        this, SIGNAL(F6Pressed()));
        #TODO# connect(promptInput, SIGNAL(F7Pressed()),        this, SIGNAL(F7Pressed()));
        #TODO# connect(promptInput, SIGNAL(F8Pressed()),        this, SIGNAL(F8Pressed()));
        #TODO# connect(promptInput, SIGNAL(F9Pressed()),        this, SIGNAL(F9Pressed()));
        #TODO# connect(promptInput, SIGNAL(F10Pressed()),       this, SIGNAL(F10Pressed()));
        #TODO# connect(promptInput, SIGNAL(F11Pressed()),       this, SIGNAL(F11Pressed()));
        #TODO# connect(promptInput, SIGNAL(F12Pressed()),       this, SIGNAL(F12Pressed()));
        #TODO# connect(promptInput, SIGNAL(cutPressed()),       this, SIGNAL(cutPressed()));
        #TODO# connect(promptInput, SIGNAL(copyPressed()),      this, SIGNAL(copyPressed()));
        #TODO# connect(promptInput, SIGNAL(pastePressed()),     this, SIGNAL(pastePressed()));
        #TODO# connect(promptInput, SIGNAL(selectAllPressed()), this, SIGNAL(selectAllPressed()));
        #TODO# connect(promptInput, SIGNAL(undoPressed()),      this, SIGNAL(undoPressed()));
        #TODO# connect(promptInput, SIGNAL(redoPressed()),      this, SIGNAL(redoPressed()));
        #TODO#
        #TODO# connect(promptInput, SIGNAL(shiftPressed()),     this, SIGNAL(shiftPressed()));
        #TODO# connect(promptInput, SIGNAL(shiftReleased()),    this, SIGNAL(shiftReleased()));
        #TODO#
        #TODO# connect(promptHistory, SIGNAL(historyAppended(const QString&)), this, SIGNAL(historyAppended(const QString&)));

    def floatingChanged(self, isFloating): #TODO
        """
        TOWRITE

        :param `isFloating`: TOWRITE
        :type `isFloating`: bool
        """
        qDebug("CmdPrompt floatingChanged(%d)", isFloating)
        if isFloating:
#.........这里部分代码省略.........
开发者ID:JTrantow,项目名称:Embroidermodder,代码行数:103,代码来源:cmdprompt.py

示例2: CmdPrompt

# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setLineWidth [as 别名]
class CmdPrompt(QWidget):
    """
    Subclass of `QWidget`_

    CmdPrompt for Embroidermodder.

    .. sphinx_generate_methods_summary::
       CmdPrompt
    """

    def QWIDGETSIZE_MAX(self):
        return (1 << 24) - 1

    def __init__(self, parent=None):
        """
        Default class constructor.

        :param `parent`: Pointer to a parent widget instance.
        :type `parent`: `QWidget`_
        """
        super(CmdPrompt, self).__init__(parent)

        qDebug("CmdPrompt Constructor")
        self.setObjectName("Command Prompt")

        self.promptInput = promptInput = CmdPromptInput(self)
        self.promptHistory = promptHistory = CmdPromptHistory()
        self.promptDivider = QFrame(self)
        promptVBoxLayout = QVBoxLayout(self)

        self.promptSplitter = CmdPromptSplitter(self)

        self.setFocusProxy(promptInput)
        self.promptHistory.setFocusProxy(promptInput)

        self.promptDivider.setLineWidth(1)
        self.promptDivider.setFrameStyle(QFrame.HLine)
        self.promptDivider.setMaximumSize(self.QWIDGETSIZE_MAX(), 1)

        promptVBoxLayout.addWidget(self.promptSplitter)
        promptVBoxLayout.addWidget(self.promptHistory)
        promptVBoxLayout.addWidget(self.promptDivider)
        promptVBoxLayout.addWidget(promptInput)

        promptVBoxLayout.setSpacing(0)
        promptVBoxLayout.setContentsMargins(0, 0, 0, 0)

        self.setLayout(promptVBoxLayout)

        self.styleHash = {}  # QHash<QString, QString>()
        self.styleHash["color"] =                      "#000000" # Match -------|
        self.styleHash["background-color"] =           "#FFFFFF" #              |
        self.styleHash["selection-color"] =            "#FFFFFF" #              |
        self.styleHash["selection-background-color"] = "#000000" # Match -------|
        self.styleHash["font-family"] =              "Monospace"
        self.styleHash["font-style"] =                  "normal"
        self.styleHash["font-size"] =                     "12px"

        self.updateStyle()

        self.blinkState = False
        self.blinkTimer = QTimer(self)
        self.blinkTimer.timeout.connect(self.blink)

        self.show()

        self.connect(promptInput, SIGNAL("stopBlinking()"), self, SLOT("stopBlinking()"))
        self.connect(promptInput, SIGNAL("appendHistory(QString, int)"), promptHistory, SLOT("appendHistory(const QString&, int)"))
        self.connect(self, SIGNAL("appendTheHistory(QString, int)"), promptHistory, SLOT("appendHistory(const QString&, int)"))

        # For use outside of command prompt
        self.connect(promptInput, SIGNAL("startCommand(QString)"), self, SIGNAL("startCommand(QString)"))
        self.connect(promptInput, SIGNAL("runCommand(QString, QString)"), self, SIGNAL("runCommand(QString, QString)"))
        self.connect(promptInput, SIGNAL("deletePressed()"),    self, SIGNAL("deletePressed()"))
        self.connect(promptInput, SIGNAL("tabPressed()"),       self, SIGNAL("tabPressed()"))
        self.connect(promptInput, SIGNAL("escapePressed()"),    self, SIGNAL("escapePressed()"))
        self.connect(promptInput, SIGNAL("upPressed()"),        self, SIGNAL("upPressed()"))
        self.connect(promptInput, SIGNAL("downPressed()"),      self, SIGNAL("downPressed()"))
        self.connect(promptInput, SIGNAL("F1Pressed()"),        self, SIGNAL("F1Pressed()"))
        self.connect(promptInput, SIGNAL("F2Pressed()"),        self, SIGNAL("F2Pressed()"))
        self.connect(promptInput, SIGNAL("F3Pressed()"),        self, SIGNAL("F3Pressed()"))
        self.connect(promptInput, SIGNAL("F4Pressed()"),        self, SIGNAL("F4Pressed()"))
        self.connect(promptInput, SIGNAL("F5Pressed()"),        self, SIGNAL("F5Pressed()"))
        self.connect(promptInput, SIGNAL("F6Pressed()"),        self, SIGNAL("F6Pressed()"))
        self.connect(promptInput, SIGNAL("F7Pressed()"),        self, SIGNAL("F7Pressed()"))
        self.connect(promptInput, SIGNAL("F8Pressed()"),        self, SIGNAL("F8Pressed()"))
        self.connect(promptInput, SIGNAL("F9Pressed()"),        self, SIGNAL("F9Pressed()"))
        self.connect(promptInput, SIGNAL("F10Pressed()"),       self, SIGNAL("F10Pressed()"))
        self.connect(promptInput, SIGNAL("F11Pressed()"),       self, SIGNAL("F11Pressed()"))
        self.connect(promptInput, SIGNAL("F12Pressed()"),       self, SIGNAL("F12Pressed()"))
        self.connect(promptInput, SIGNAL("cutPressed()"),       self, SIGNAL("cutPressed()"))
        self.connect(promptInput, SIGNAL("copyPressed()"),      self, SIGNAL("copyPressed()"))
        self.connect(promptInput, SIGNAL("pastePressed()"),     self, SIGNAL("pastePressed()"))
        self.connect(promptInput, SIGNAL("selectAllPressed()"), self, SIGNAL("selectAllPressed()"))
        self.connect(promptInput, SIGNAL("undoPressed()"),      self, SIGNAL("undoPressed()"))
        self.connect(promptInput, SIGNAL("redoPressed()"),      self, SIGNAL("redoPressed()"))

        self.connect(promptInput, SIGNAL("shiftPressed()"),     self, SIGNAL("shiftPressed()"))
        self.connect(promptInput, SIGNAL("shiftReleased()"),    self, SIGNAL("shiftReleased()"))

#.........这里部分代码省略.........
开发者ID:Allen76,项目名称:Embroidermodder,代码行数:103,代码来源:cmdprompt.py


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