Python PyQt4.QtCore 模块,QRect() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用PyQt4.QtCore.QRect()

项目:pip-gui    作者:GDGVIT    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(582, 317)
        self.verticalLayoutWidget = QtGui.QWidget(Form)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 561, 261))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.labelProgress = QtGui.QLabel(self.verticalLayoutWidget)
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.labelProgress.setFont(font)
        self.labelProgress.setObjectName(_fromUtf8("labelProgress"))
        self.verticalLayout.addWidget(self.labelProgress)
        self.textEdit = QtGui.QTextEdit(self.verticalLayoutWidget)
        self.textEdit.setObjectName(_fromUtf8("textEdit"))
        self.verticalLayout.addWidget(self.textEdit)
        self.btnContinue = QtGui.QPushButton(Form)
        self.btnContinue.setGeometry(QtCore.QRect(450, 280, 90, 28))
        self.btnContinue.setObjectName(_fromUtf8("btnContinue"))

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:typing-pattern-recognition    作者:abinashmeher999    | 项目源码 | 文件源码
def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(554, 470)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.pwd_label = QtGui.QLabel(self.centralwidget)
        self.pwd_label.setGeometry(QtCore.QRect(130, 140, 61, 16))
        self.pwd_label.setObjectName(_fromUtf8("pwd_label"))
        self.pwd_line_edit = QtGui.QLineEdit(self.centralwidget)
        self.pwd_line_edit.setGeometry(QtCore.QRect(200, 140, 181, 21))
        self.pwd_line_edit.setText(_fromUtf8(""))
        self.pwd_line_edit.setEchoMode(QtGui.QLineEdit.Password)
        self.pwd_line_edit.setObjectName(_fromUtf8("pwd_line_edit"))
        self.finish_button = QtGui.QPushButton(self.centralwidget)
        self.finish_button.setGeometry(QtCore.QRect(290, 200, 110, 32))
        self.finish_button.setObjectName(_fromUtf8("finish_button"))
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
项目:SameKeyProxy    作者:xzhou    | 项目源码 | 文件源码
def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1030, 896)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.tableWidget = QtGui.QTableWidget(self.centralwidget)
        self.tableWidget.setGeometry(QtCore.QRect(10, 10, 791, 771))
        self.tableWidget.setColumnCount(17)
        self.tableWidget.setObjectName("tableWidget")
        self.tableWidget.setColumnCount(17)
        self.tableWidget.setRowCount(0)
        self.pushButton = QtGui.QPushButton(self.centralwidget)
        self.pushButton.setGeometry(QtCore.QRect(850, 40, 92, 28))
        self.pushButton.setObjectName("pushButton")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1030, 25))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
项目:siren    作者:ozsolarwind    | 项目源码 | 文件源码
def save_View(self):
        outputimg = QtGui.QPixmap(self.view.width(), self.view.height())
        painter = QtGui.QPainter(outputimg)
        targetrect = QtCore.QRectF(0, 0, self.view.width(), self.view.height())
        sourcerect = QtCore.QRect(0, 0, self.view.width(), self.view.height())
        self.view.render(painter, targetrect, sourcerect)
        fname = self.new_scenario[:self.new_scenario.rfind('.')] + '.png'
        fname = QtGui.QFileDialog.getSaveFileName(self, 'Save image file',
                self.scenarios + fname, 'Image Files (*.png *.jpg *.bmp)')
        if fname != '':
            fname = str(fname)
            i = fname.rfind('.')
            if i < 0:
                fname = fname + '.png'
                i = fname.rfind('.')
            outputimg.save(fname, fname[i + 1:])
            try:
                comment = 'View saved to ' + fname[fname.rfind('/') + 1:]
            except:
                comment = 'View saved to ' + fname
            self.view.emit(QtCore.SIGNAL('statusmsg'), comment)
        painter.end()
项目:siren    作者:ozsolarwind    | 项目源码 | 文件源码
def save_View(self):
        outputimg = QtGui.QPixmap(self.view.width(), self.view.height())
        painter = QtGui.QPainter(outputimg)
        targetrect = QtCore.QRectF(0, 0, self.view.width(), self.view.height())
        sourcerect = QtCore.QRect(0, 0, self.view.width(), self.view.height())
        self.view.render(painter, targetrect, sourcerect)
        fname = 'worldwindow_view.png'
        fname = QtGui.QFileDialog.getSaveFileName(self, 'Save image file',
                fname, 'Image Files (*.png *.jpg *.bmp)')
        if fname != '':
            fname = str(fname)
            i = fname.rfind('.')
            if i < 0:
                fname = fname + '.png'
                i = fname.rfind('.')
            outputimg.save(fname, fname[i + 1:])
            try:
                comment = 'View saved to ' + fname[fname.rfind('/') + 1:]
            except:
                comment = 'View saved to ' + fname
            self.view.emit(QtCore.SIGNAL('statusmsg'), comment)
        painter.end()
项目:rec-attend-public    作者:renmengye    | 项目源码 | 文件源码
def drawDisp( self , qp ):
        if not self.dispOverlay:
            return 

        # Save QPainter settings to stack
        qp.save()
        # Define transparency
        qp.setOpacity(self.transp)
        # Draw the overlay image
        qp.drawImage(QtCore.QRect( self.xoff, self.yoff, self.w, self.h ),self.dispOverlay)
        # Restore settings
        qp.restore()

        return self.dispOverlay



    #############################
    ## Mouse/keyboard events
    #############################

    # Mouse moved
    # Need to save the mouse position
    # Need to drag a polygon point
    # Need to update the mouse selected object
项目:cityscapes-api    作者:renmengye    | 项目源码 | 文件源码
def drawDisp( self , qp ):
        if not self.dispOverlay:
            return 

        # Save QPainter settings to stack
        qp.save()
        # Define transparency
        qp.setOpacity(self.transp)
        # Draw the overlay image
        qp.drawImage(QtCore.QRect( self.xoff, self.yoff, self.w, self.h ),self.dispOverlay)
        # Restore settings
        qp.restore()

        return self.dispOverlay



    #############################
    ## Mouse/keyboard events
    #############################

    # Mouse moved
    # Need to save the mouse position
    # Need to drag a polygon point
    # Need to update the mouse selected object
项目:dxf2gcode    作者:cnc-club    | 项目源码 | 文件源码
def __init__(self, parent=None):
        """
        Initialisation of the View Object. This is called by the gui created
        with the QTDesigner.
        @param parent: Main is passed as a pointer for reference.
        """
        super(MyGraphicsView, self).__init__(parent)
        self.currentItem = None

        self.setTransformationAnchor(QGraphicsView.AnchorUnderMouse)
        self.setResizeAnchor(QGraphicsView.AnchorViewCenter)

        # self.setDragMode(QGraphicsView.RubberBandDrag )
        self.setDragMode(QGraphicsView.NoDrag)

        self.parent = parent
        self.mppos = None

        self.rubberBand = QRubberBand(QRubberBand.Rectangle, self)
        self.prvRectRubberBand = QtCore.QRect()
项目:BeltaGo    作者:54BayMax    | 项目源码 | 文件源码
def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(800, 600)
        self.centralWidget = QtGui.QWidget(MainWindow)
        self.centralWidget.setObjectName(_fromUtf8("centralWidget"))
        self.pushButton = QtGui.QPushButton(self.centralWidget)
        self.pushButton.setGeometry(QtCore.QRect(40, 510, 75, 23))
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.textBrowser = QtGui.QTextBrowser(self.centralWidget)
        self.textBrowser.setGeometry(QtCore.QRect(40, 20, 571, 461))
        self.textBrowser.setObjectName(_fromUtf8("textBrowser"))
        self.radioButton = QtGui.QRadioButton(self.centralWidget)
        self.radioButton.setGeometry(QtCore.QRect(680, 110, 89, 16))
        self.radioButton.setObjectName(_fromUtf8("radioButton"))
        self.radioButton_2 = QtGui.QRadioButton(self.centralWidget)
        self.radioButton_2.setGeometry(QtCore.QRect(680, 160, 89, 16))
        self.radioButton_2.setObjectName(_fromUtf8("radioButton_2"))
        self.label = QtGui.QLabel(self.centralWidget)
        self.label.setGeometry(QtCore.QRect(640, 350, 101, 101))
        self.label.setObjectName(_fromUtf8("label"))
        MainWindow.setCentralWidget(self.centralWidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
项目:cityscapesScripts    作者:mcordts    | 项目源码 | 文件源码
def drawDisp( self , qp ):
        if not self.dispOverlay:
            return 

        # Save QPainter settings to stack
        qp.save()
        # Define transparency
        qp.setOpacity(self.transp)
        # Draw the overlay image
        qp.drawImage(QtCore.QRect( self.xoff, self.yoff, self.w, self.h ),self.dispOverlay)
        # Restore settings
        qp.restore()

        return self.dispOverlay



    #############################
    ## Mouse/keyboard events
    #############################

    # Mouse moved
    # Need to save the mouse position
    # Need to drag a polygon point
    # Need to update the mouse selected object
项目:ProStep    作者:Gaultus    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(400, 113)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setGeometry(QtCore.QRect(40, 60, 341, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(10, 30, 71, 16))
        self.label.setObjectName(_fromUtf8("label"))
        self.textEdit = QtGui.QTextEdit(Dialog)
        self.textEdit.setGeometry(QtCore.QRect(90, 30, 291, 21))
        self.textEdit.setObjectName(_fromUtf8("textEdit"))
        self.sbRepeats = QtGui.QSpinBox(Dialog)
        self.sbRepeats.setGeometry(QtCore.QRect(90, 60, 50, 21))
        self.sbRepeats.setObjectName(_fromUtf8("textEdit"))
        self.sbRepeats.setMinimum(1)
        self.sbRepeats.setMaximum(99)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), self.Accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), self.Reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
        self.dlg = Dialog
项目:ProStep    作者:Gaultus    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        self.dlg = Dialog
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(385, 114)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setGeometry(QtCore.QRect(10, 50, 341, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(20, 20, 71, 16))
        self.label.setObjectName(_fromUtf8("label"))
        self.spinBox = QtGui.QSpinBox(Dialog)
        self.spinBox.setGeometry(QtCore.QRect(100, 20, 42, 22))
        self.spinBox.setObjectName(_fromUtf8("spinBox"))
        self.spinBox.setMinimum(-80)
        self.spinBox.setMaximum(80)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), self.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), self.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
项目:ProStep    作者:Gaultus    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(400, 113)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setGeometry(QtCore.QRect(40, 60, 341, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(10, 30, 71, 16))
        self.label.setObjectName(_fromUtf8("label"))
        self.textEdit = QtGui.QTextEdit(Dialog)
        self.textEdit.setGeometry(QtCore.QRect(90, 30, 291, 21))
        self.textEdit.setObjectName(_fromUtf8("textEdit"))
        self.sbRepeats = QtGui.QSpinBox(Dialog)
        self.sbRepeats.setGeometry(QtCore.QRect(90, 60, 50, 21))
        self.sbRepeats.setObjectName(_fromUtf8("textEdit"))
        self.sbRepeats.setMinimum(1)
        self.sbRepeats.setMaximum(99)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), self.Accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), self.Reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
        self.dlg = Dialog
项目:ProStep    作者:Gaultus    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        self.dlg = Dialog
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(385, 114)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setGeometry(QtCore.QRect(10, 50, 341, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(20, 20, 71, 16))
        self.label.setObjectName(_fromUtf8("label"))
        self.spinBox = QtGui.QSpinBox(Dialog)
        self.spinBox.setGeometry(QtCore.QRect(100, 20, 42, 22))
        self.spinBox.setObjectName(_fromUtf8("spinBox"))
        self.spinBox.setMinimum(-80)
        self.spinBox.setMaximum(80)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), self.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), self.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
项目:ProStep    作者:Gaultus    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        self.dlg = Dialog
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(385, 114)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setGeometry(QtCore.QRect(10, 50, 341, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(20, 20, 71, 16))
        self.label.setObjectName(_fromUtf8("label"))
        self.spinBox = QtGui.QSpinBox(Dialog)
        self.spinBox.setGeometry(QtCore.QRect(100, 20, 42, 22))
        self.spinBox.setObjectName(_fromUtf8("spinBox"))
        self.spinBox.setMinimum(-80)
        self.spinBox.setMaximum(80)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), self.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), self.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
项目:ProStep    作者:Gaultus    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(400, 113)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setGeometry(QtCore.QRect(40, 60, 341, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(10, 30, 71, 16))
        self.label.setObjectName(_fromUtf8("label"))
        self.textEdit = QtGui.QTextEdit(Dialog)
        self.textEdit.setGeometry(QtCore.QRect(90, 30, 291, 21))
        self.textEdit.setObjectName(_fromUtf8("textEdit"))
        self.sbRepeats = QtGui.QSpinBox(Dialog)
        self.sbRepeats.setGeometry(QtCore.QRect(90, 60, 50, 21))
        self.sbRepeats.setObjectName(_fromUtf8("textEdit"))
        self.sbRepeats.setMinimum(1)
        self.sbRepeats.setMaximum(99)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), self.Accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), self.Reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
        self.dlg = Dialog
项目:ProStep    作者:Gaultus    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        self.dlg = Dialog
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(385, 114)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setGeometry(QtCore.QRect(10, 50, 341, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(20, 20, 71, 16))
        self.label.setObjectName(_fromUtf8("label"))
        self.spinBox = QtGui.QSpinBox(Dialog)
        self.spinBox.setGeometry(QtCore.QRect(100, 20, 42, 22))
        self.spinBox.setObjectName(_fromUtf8("spinBox"))
        self.spinBox.setMinimum(-80)
        self.spinBox.setMaximum(80)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), self.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), self.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def resizeEventVertical(self, event):
        if self.label_pos == TOP:
            y = self.label_font_metrics.height()+self.spacing
            height = y
            self.label_rect = QtCore.QRect(0, 0, self.width(), height)
        elif self.label_pos == BOTTOM:
            y = 0
            height = self.label_font_metrics.height()+self.spacing
            self.label_rect = QtCore.QRect(0, self.height()-height, self.width(), height)
        else:
            y = height = 0
        self.range_rect = QtCore.QRectF((self.width()-self.range_size)/2., self.range_size/2.+y, self.range_size, self.height()-self.range_size-height)
        self.range_range = self.range_rect.y()+4, self.range_rect.height()-8
        pos = QtCore.QPointF(self.range_rect.center().x(), self.get_pos())
        self.slider_rect.moveCenter(pos)
        self.cursor.move(pos.x(), pos.y())
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def resizeEvent(self, event):
        QtGui.QWidget.resizeEvent(self, event)
        if not self.reference: return
        object_rect = self.reference.mapToScene(self.reference.rect())
        real_rect = self.main.display.mapFromScene(object_rect).boundingRect()
        real_pos = self.mapFromGlobal(self.main.display.mapToGlobal(real_rect.topLeft()))
        mask_rect = QtCore.QRect(real_pos, real_rect.size())
        mask_rect.adjust(-3, -3, -8, -3)
        bmp = QtGui.QBitmap(self.width(), self.height())
        bmp.clear()
        qp = QtGui.QPainter(bmp)
        qp.setPen(QtCore.Qt.black)
        qp.setBrush(QtCore.Qt.black)
        qp.drawRect(0, 0, self.width(), self.height())
        qp.eraseRect(mask_rect)
        qp.end()
        self.setMask(bmp)
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def createDragData(self):
        if not self.selection: return
        start = self.selection[0]
        end = self.selection[-1]
        if start == end:
            self.waveobj_list[start].preview_rect.setSelected(True)
        self.drag = QtGui.QDrag(self)
        data = MimeData()
        data.setData('audio/waves', QtCore.QByteArray('{}:{}'.format(start, end)))
        data.setReferenceData(self.main)
        pixmap = QtGui.QPixmap(int(self.viewport().rect().width() / 64. * (end - start + 1)), self.height())
        pixmap.fill(QtGui.QColor(192, 192, 192, 128))
        qp = QtGui.QPainter(pixmap)
        qp.setRenderHints(qp.Antialiasing)
        x = self.mapFromScene(self.waveobj_list[start].preview_rect.pos()).x()
        width = self.mapFromScene(self.waveobj_list[end].preview_rect.pos()).x() + self.mapFromScene(self.waveobj_list[end].preview_rect.boundingRect().topRight()).x() - x
        self.render(qp, source=QtCore.QRect(x, self.wavegroup.boundingRect().y(), width, self.mapToScene(self.viewport().rect()).boundingRect().height()), mode=QtCore.Qt.IgnoreAspectRatio)
        qp.end()
        self.drag.setPixmap(pixmap)
        self.drag.setMimeData(data)
        self.drag.exec_()
项目:Offline-Typeracer    作者:softwareengpro    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(800, 600)
        Dialog.setStyleSheet(_fromUtf8("\n"
"background-color: rgb(85, 170, 127);"))
        self.joinchallenge = QtGui.QPushButton(Dialog)
        self.joinchallenge.setGeometry(QtCore.QRect(370, 346, 98, 41))
        self.joinchallenge.setStyleSheet(_fromUtf8("color: rgb(0, 0, 49);"))
        self.joinchallenge.setObjectName(_fromUtf8("pushButton"))
        self.textEdit = QtGui.QTextEdit(Dialog)
        self.textEdit.setGeometry(QtCore.QRect(303, 160, 311, 51))
        self.textEdit.setStyleSheet(_fromUtf8("background-color: rgb(255, 255, 255);"))
        self.textEdit.setObjectName(_fromUtf8("textEdit"))
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(120, 160, 151, 41))
        self.label.setStyleSheet(_fromUtf8("color: rgb(0, 0, 49);"))
        self.label.setObjectName(_fromUtf8("label"))

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
项目:python_qt_tutorial    作者:awesomebytes    | 项目源码 | 文件源码
def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(818, 600)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.my_button = QtGui.QPushButton(self.centralwidget)
        self.my_button.setGeometry(QtCore.QRect(150, 190, 176, 44))
        self.my_button.setObjectName(_fromUtf8("my_button"))
        self.my_label = QtGui.QLabel(self.centralwidget)
        self.my_label.setGeometry(QtCore.QRect(450, 200, 131, 34))
        self.my_label.setObjectName(_fromUtf8("my_label"))
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 818, 42))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
项目:SXDK    作者:cdminigun    | 项目源码 | 文件源码
def btnSave(self):
        os = self.OS_CB.currentText();
        endian = str(self.EndiancomboBox.currentText());
                if 'little' in endian.lower():
                        endian = 'little'
                else:
                        endian = 'big'

                NOP = self.Nopslide.value();
        addsz = self.Addrsz.value();
        offset = self.offset.value();
        start = self.Saddr.text();
        ofile =  self.FilenameLE.text();

                genshell = GenerateShellcode(int(addsz), int(NOP), str(os), bit, str(start), int(offset), str(endian))
                genshell.parse_inputs()
                genshell.write_file(ofile)
    #   self.output = QtGui.QLabel(self.centralwidget)

    #   self.output.setGeometry(QtCore.QRect(110, 266, 391, 91))
     #       self.output.setStyleSheet(_fromUtf8("font: 18pt \"Monospace\";"))
        #   self.output.setObjectName(_fromUtf8("output"))
项目:barium    作者:barium-project    | 项目源码 | 文件源码
def setupUi(self):
        Form = self
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(800, 600)
        self.frame = QtGui.QFrame(Form)
        self.frame.setGeometry(QtCore.QRect(10, 10, 781, 581))
        self.frame.setFrameShape(QtGui.QFrame.Box)
        self.frame.setFrameShadow(QtGui.QFrame.Raised)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.label = QtGui.QLabel(self.frame)
        self.label.setGeometry(QtCore.QRect(10, 10, 261, 21))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        self.ms_data_text = QtGui.QPlainTextEdit(self.frame)
        self.ms_data_text.setGeometry(QtCore.QRect(10, 40, 761, 531))
        self.ms_data_text.setReadOnly(True)
        self.ms_data_text.setOverwriteMode(False)
        self.ms_data_text.setObjectName(_fromUtf8("ms_data_text"))

        self.retranslateUi()
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:barium    作者:barium-project    | 项目源码 | 文件源码
def setupUi(self):
        Form = self
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(400, 150)
        self.frame = QtGui.QFrame(Form)
        self.frame.setGeometry(QtCore.QRect(9, 9, 381, 131))
        self.frame.setFrameShape(QtGui.QFrame.Box)
        self.frame.setFrameShadow(QtGui.QFrame.Raised)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.label = QtGui.QLabel(self.frame)
        self.label.setGeometry(QtCore.QRect(10, 10, 241, 21))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        self.cl_command_text = QtGui.QPlainTextEdit(self.frame)
        self.cl_command_text.setGeometry(QtCore.QRect(10, 40, 361, 81))
        self.cl_command_text.setObjectName(_fromUtf8("cl_command_text"))
        self.cl_command_button = QtGui.QPushButton(self.frame)
        self.cl_command_button.setGeometry(QtCore.QRect(214, 10, 151, 23))
        self.cl_command_button.setObjectName(_fromUtf8("cl_command_button"))

        self.retranslateUi()
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:ChiantiPy    作者:chianti-atomic    | 项目源码 | 文件源码
def setupUi(self, selectorDialogForm):
        selectorDialogForm.setObjectName("selectorDialogForm")
        selectorDialogForm.setWindowModality(QtCore.Qt.WindowModal)
        selectorDialogForm.setModal(False)
#        selectorDialogForm.setWindowModality(QtCore.Qt.ApplicationModal)
        selectorDialogForm.resize(500,300)
        self.buttonBox = QtGui.QDialogButtonBox(selectorDialogForm)
        self.buttonBox.setGeometry(QtCore.QRect(30,240,341,32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.listWidget = QtGui.QListWidget(selectorDialogForm)
        self.listWidget.setGeometry(QtCore.QRect(70,20,360,200))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.listWidget.setFont(font)
        self.listWidget.setObjectName("listWidget")
        self.retranslateUi(selectorDialogForm)
        QtCore.QObject.connect(self.buttonBox,QtCore.SIGNAL("accepted()"),selectorDialogForm.accept)
        QtCore.QObject.connect(self.buttonBox,QtCore.SIGNAL("rejected()"),selectorDialogForm.reject)
        QtCore.QMetaObject.connectSlotsByName(selectorDialogForm)
项目:python_mini_projeler    作者:o11    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.setGeometry(350, 10, 600, 600)
        self.groupBox = QtGui.QGroupBox(Form)
        self.groupBox.setGeometry(QtCore.QRect(19, 70, 561, 201))
        self.groupBox.setObjectName(_fromUtf8("groupBox"))

        self.labels(Form)

        self.comboBoxsAndLineedit()

        self.buttons(Form)

        self.tableArea(Form)

        self.resultArea(Form)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:python_mini_projeler    作者:o11    | 项目源码 | 文件源码
def tableArea(self, Form):
        self.tableResult = QtGui.QTableWidget(Form)
        self.tableResult.setGeometry(QtCore.QRect(15, 400, 571, 192))
        self.tableResult.setObjectName(_fromUtf8("tableResult"))
        self.tableResult.setColumnCount(7)
        item = QtGui.QTableWidgetItem()
        self.tableResult.setHorizontalHeaderItem(0, item)
        item = QtGui.QTableWidgetItem()
        self.tableResult.setHorizontalHeaderItem(1, item)
        item = QtGui.QTableWidgetItem()
        self.tableResult.setHorizontalHeaderItem(2, item)
        item = QtGui.QTableWidgetItem()
        self.tableResult.setHorizontalHeaderItem(3, item)
        item = QtGui.QTableWidgetItem()
        self.tableResult.setHorizontalHeaderItem(4, item)
        item = QtGui.QTableWidgetItem()
        self.tableResult.setHorizontalHeaderItem(5, item)
        item = QtGui.QTableWidgetItem()
        self.tableResult.setHorizontalHeaderItem(6, item)
项目:python_mini_projeler    作者:o11    | 项目源码 | 文件源码
def labels(self, Form):
        self.label = QtGui.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(10, 20, 581, 31))
        font = QtGui.QFont()
        font.setPointSize(20)
        font.setWeight(50)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName(_fromUtf8("label"))
        self.label_2 = QtGui.QLabel(self.groupBox)
        self.label_2.setGeometry(QtCore.QRect(20, 40, 201, 17))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.label_3 = QtGui.QLabel(self.groupBox)
        self.label_3.setGeometry(QtCore.QRect(340, 40, 201, 17))
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.label_4 = QtGui.QLabel(self.groupBox)
        self.label_4.setGeometry(QtCore.QRect(20, 110, 201, 17))
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.label_5 = QtGui.QLabel(self.groupBox)
        self.label_5.setGeometry(QtCore.QRect(340, 110, 201, 17))
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.label_6 = QtGui.QLabel(self.groupBox)
        self.label_6.setGeometry(QtCore.QRect(340, 180, 91, 17))
        self.label_6.setObjectName(_fromUtf8("label_6"))
项目:python_mini_projeler    作者:o11    | 项目源码 | 文件源码
def resultArea(self, Form):
        self.gbSonuclar = QtGui.QGroupBox(Form)
        self.gbSonuclar.setGeometry(QtCore.QRect(20, 279, 291, 101))
        self.gbSonuclar.setTitle(_fromUtf8(""))
        self.gbSonuclar.setVisible(False)
        self.gbSonuclar.setObjectName(_fromUtf8("gbSonuclar"))
        self.lblFaiz = QtGui.QLabel(self.gbSonuclar)
        self.lblFaiz.setGeometry(QtCore.QRect(20, 60, 241, 17))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.lblFaiz.setFont(font)
        self.lblFaiz.setObjectName(_fromUtf8("lblFaiz"))
        self.lblTaksit = QtGui.QLabel(self.gbSonuclar)
        self.lblTaksit.setGeometry(QtCore.QRect(20, 30, 241, 17))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.lblTaksit.setFont(font)
        self.lblTaksit.setObjectName(_fromUtf8("lblTaksit"))
项目:pyqtChat    作者:HeLiangHIT    | 项目源码 | 文件源码
def doLayout(self, rect, testOnly):
        x = rect.x()
        y = rect.y()
        lineHeight = 0

        for item in self.itemList:
            wid = item.widget()
            spaceX = self.spacing() + wid.style().layoutSpacing(QtGui.QSizePolicy.PushButton, QtGui.QSizePolicy.PushButton, QtCore.Qt.Horizontal)
            spaceY = self.spacing() + wid.style().layoutSpacing(QtGui.QSizePolicy.PushButton, QtGui.QSizePolicy.PushButton, QtCore.Qt.Vertical)
            nextX = x + item.sizeHint().width() + spaceX
            if nextX - spaceX > rect.right() and lineHeight > 0:
                x = rect.x()
                y = y + lineHeight + spaceY
                nextX = x + item.sizeHint().width() + spaceX
                lineHeight = 0

            if not testOnly:
                item.setGeometry(QtCore.QRect(QtCore.QPoint(x, y), item.sizeHint()))

            x = nextX
            lineHeight = max(lineHeight, item.sizeHint().height())

        return y + lineHeight - rect.y()
项目:GSM-scanner    作者:yosriayed    | 项目源码 | 文件源码
def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(800, 600)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.plainTextEdit = QtGui.QPlainTextEdit(self.centralwidget)
        self.plainTextEdit.setGeometry(QtCore.QRect(10, 30, 551, 111))
        self.plainTextEdit.setReadOnly(True)
        self.plainTextEdit.setObjectName(_fromUtf8("plainTextEdit"))
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 21))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
项目:easy-expression    作者:earlybackhome    | 项目源码 | 文件源码
def doLayout(self, rect, testOnly):
        x = rect.x()
        y = rect.y()
        lineHeight = 0

        for item in self.itemList:
            wid = item.widget()
            spaceX = self.spacing() + wid.style().layoutSpacing(QtGui.QSizePolicy.PushButton, QtGui.QSizePolicy.PushButton, QtCore.Qt.Horizontal)
            spaceY = self.spacing() + wid.style().layoutSpacing(QtGui.QSizePolicy.PushButton, QtGui.QSizePolicy.PushButton, QtCore.Qt.Vertical)
            nextX = x + item.sizeHint().width() + spaceX
            if nextX - spaceX > rect.right() and lineHeight > 0:
                x = rect.x()
                y = y + lineHeight + spaceY
                nextX = x + item.sizeHint().width() + spaceX
                lineHeight = 0

            if not testOnly:
                item.setGeometry(QtCore.QRect(QtCore.QPoint(x, y), item.sizeHint()))

            x = nextX
            lineHeight = max(lineHeight, item.sizeHint().height())

        return y + lineHeight - rect.y()
项目:PH5    作者:PIC-IRIS    | 项目源码 | 文件源码
def on_mouse_release(self,event):
        #print "on_mouse_release"
        if not self.enableDrawing: return
        if QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ShiftModifier: return
        if event._button == 1:
            # this call is for showing info on the control panel
            self.defineViewWindow(0, 0, self.width, self.height)
        if not self.select: return
        if event == None: return
        x0, y0 = event.press_event.pos
        x1, y1 = event.last_event.pos

        self.zoomWidget.setGeometry(QtCore.QRect(QPoint(x0+self.offsetX,y0+self.offsetY), 
                                                 QPoint(x1+self.offsetX,y1+self.offsetY)).normalized())
        self.zoomWidget.show()   
        if x0 > x1: x0, x1 = x1, x0
        if y0 > y1: y0, y1 = y1, y0
        #print "x0=%s, y0=%s, x1=%s, y1=%s" % (x0,y0,x1,y1)
        v = self.defineViewWindow(x0, y0, x1, y1, setData=False)
        if v!=False:
            #print "on_mouse_release: ", v 
            self.LT, self.RB = v 
            # save this new values for selection to zoom or pass to support window

        else: self.zoomWidget.hide()
项目:BioNanoAnalyst    作者:AppliedBioinformatics    | 项目源码 | 文件源码
def setupUi(self, Manual):
        Manual.setObjectName(_fromUtf8("Manual"))
        Manual.resize(740, 450)
        Manual.setMinimumSize(QtCore.QSize(740, 450))
        Manual.setMaximumSize(QtCore.QSize(740, 450))
        self.textBrowser = QtGui.QTextBrowser(Manual)
        self.textBrowser.setGeometry(QtCore.QRect(10, 40, 721, 371))
        self.textBrowser.setObjectName(_fromUtf8("textBrowser"))
        self.label = QtGui.QLabel(Manual)
        self.label.setGeometry(QtCore.QRect(10, 10, 271, 21))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Arial"))
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        self.manual_bn = QtGui.QPushButton(Manual)
        self.manual_bn.setGeometry(QtCore.QRect(650, 420, 75, 23))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Arial"))
        self.manual_bn.setFont(font)
        self.manual_bn.setObjectName(_fromUtf8("manual_bn"))

        self.retranslateUi(Manual)
        QtCore.QMetaObject.connectSlotsByName(Manual)
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(529, 329)
        self.selInfoWidget = QtGui.QWidget(Form)
        self.selInfoWidget.setGeometry(QtCore.QRect(260, 10, 264, 222))
        self.selInfoWidget.setObjectName(_fromUtf8("selInfoWidget"))
        self.gridLayout = QtGui.QGridLayout(self.selInfoWidget)
        self.gridLayout.setMargin(0)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.selDescLabel = QtGui.QLabel(self.selInfoWidget)
        self.selDescLabel.setText(_fromUtf8(""))
        self.selDescLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.selDescLabel.setWordWrap(True)
        self.selDescLabel.setObjectName(_fromUtf8("selDescLabel"))
        self.gridLayout.addWidget(self.selDescLabel, 0, 0, 1, 1)
        self.selNameLabel = QtGui.QLabel(self.selInfoWidget)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.selNameLabel.setFont(font)
        self.selNameLabel.setText(_fromUtf8(""))
        self.selNameLabel.setObjectName(_fromUtf8("selNameLabel"))
        self.gridLayout.addWidget(self.selNameLabel, 0, 1, 1, 1)
        self.selectedTree = DataTreeWidget(self.selInfoWidget)
        self.selectedTree.setObjectName(_fromUtf8("selectedTree"))
        self.selectedTree.headerItem().setText(0, _fromUtf8("1"))
        self.gridLayout.addWidget(self.selectedTree, 1, 0, 1, 2)
        self.hoverText = QtGui.QTextEdit(Form)
        self.hoverText.setGeometry(QtCore.QRect(0, 240, 521, 81))
        self.hoverText.setObjectName(_fromUtf8("hoverText"))
        self.view = FlowchartGraphicsView(Form)
        self.view.setGeometry(QtCore.QRect(0, 0, 256, 192))
        self.view.setObjectName(_fromUtf8("view"))

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(529, 329)
        self.selInfoWidget = QtGui.QWidget(Form)
        self.selInfoWidget.setGeometry(QtCore.QRect(260, 10, 264, 222))
        self.selInfoWidget.setObjectName(_fromUtf8("selInfoWidget"))
        self.gridLayout = QtGui.QGridLayout(self.selInfoWidget)
        self.gridLayout.setMargin(0)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.selDescLabel = QtGui.QLabel(self.selInfoWidget)
        self.selDescLabel.setText(_fromUtf8(""))
        self.selDescLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.selDescLabel.setWordWrap(True)
        self.selDescLabel.setObjectName(_fromUtf8("selDescLabel"))
        self.gridLayout.addWidget(self.selDescLabel, 0, 0, 1, 1)
        self.selNameLabel = QtGui.QLabel(self.selInfoWidget)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.selNameLabel.setFont(font)
        self.selNameLabel.setText(_fromUtf8(""))
        self.selNameLabel.setObjectName(_fromUtf8("selNameLabel"))
        self.gridLayout.addWidget(self.selNameLabel, 0, 1, 1, 1)
        self.selectedTree = DataTreeWidget(self.selInfoWidget)
        self.selectedTree.setObjectName(_fromUtf8("selectedTree"))
        self.selectedTree.headerItem().setText(0, _fromUtf8("1"))
        self.gridLayout.addWidget(self.selectedTree, 1, 0, 1, 2)
        self.hoverText = QtGui.QTextEdit(Form)
        self.hoverText.setGeometry(QtCore.QRect(0, 240, 521, 81))
        self.hoverText.setObjectName(_fromUtf8("hoverText"))
        self.view = FlowchartGraphicsView(Form)
        self.view.setGeometry(QtCore.QRect(0, 0, 256, 192))
        self.view.setObjectName(_fromUtf8("view"))

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:CPNSimulatorGui    作者:chris-kuhr    | 项目源码 | 文件源码
def export_Step_as_SVG(self):
        '''Export Petrinet and subnets to seperate SVG files'''
        filename = QtGui.QFileDialog.getSaveFileName( self, "Export Step as SVG", "%s/output/svg/"%(self.workingDir) , "*.svg" )
        if filename is "":
            return

        iterString = ""        
        for editor in self.editors:

            if editor is self.editors[0]:
                iterString = "_%s" %self.simulator.net
            else:
                iterString = "_%s" %editor.subnet

            generator = QtSvg.QSvgGenerator()
            newFilename = filename
            if ".svg" in filename:
                newFilename = filename.split(".svg")[0]+iterString+".svg"
            else:
                newFilename = filename+iterString+".svg"

            generator.setFileName(newFilename)            
            rect = editor.diagramScene.sceneRect()
            generator.setSize(QtCore.QSize(rect.width(), rect.height()))
            generator.setViewBox(QtCore.QRect(0, 0, rect.width(), rect.height()))
            generator.setTitle("%s Step %d"%(str(self.simulator.net), self.simulator.displayStep))
            painter = QtGui.QPainter()
            painter.begin(generator)
            editor.diagramScene.render( painter, source=rect , mode=QtCore.Qt.KeepAspectRatio)
            painter.end()

    #------------------------------------------------------------------------------------------------
项目:CPNSimulatorGui    作者:chris-kuhr    | 项目源码 | 文件源码
def setupUi(self, TokenDialog):
        TokenDialog.setObjectName(_fromUtf8("TokenDialog"))
        TokenDialog.resize(361, 213)
        self.centralwidget = QtGui.QWidget(TokenDialog)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.verticalLayoutWidget = QtGui.QWidget(self.centralwidget)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 361, 211))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.listWidget = QtGui.QListWidget(self.verticalLayoutWidget)
        self.listWidget.setObjectName(_fromUtf8("listWidget"))
        self.verticalLayout.addWidget(self.listWidget)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.checkBox = QtGui.QCheckBox(self.verticalLayoutWidget)
        self.checkBox.setObjectName(_fromUtf8("checkBox"))
        self.horizontalLayout_2.addWidget(self.checkBox)
        self.spinBox = QtGui.QSpinBox(self.verticalLayoutWidget)
        self.spinBox.setMinimumSize(QtCore.QSize(50, 0))
        self.spinBox.setMaximumSize(QtCore.QSize(50, 16777215))
        self.spinBox.setObjectName(_fromUtf8("spinBox"))
        self.horizontalLayout_2.addWidget(self.spinBox)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.pushButton = QtGui.QPushButton(self.verticalLayoutWidget)
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.horizontalLayout.addWidget(self.pushButton)
        self.pushButton_2 = QtGui.QPushButton(self.verticalLayoutWidget)
        self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
        self.horizontalLayout.addWidget(self.pushButton_2)
        self.verticalLayout.addLayout(self.horizontalLayout)
        TokenDialog.setCentralWidget(self.centralwidget)

        self.retranslateUi(TokenDialog)
        QtCore.QMetaObject.connectSlotsByName(TokenDialog)
项目:typing-pattern-recognition    作者:abinashmeher999    | 项目源码 | 文件源码
def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(490, 424)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.login_button = QtGui.QPushButton(self.centralwidget)
        self.login_button.setGeometry(QtCore.QRect(270, 230, 121, 32))
        self.login_button.setObjectName(_fromUtf8("login_button"))
        self.notuser_label = QtGui.QLabel(self.centralwidget)
        self.notuser_label.setGeometry(QtCore.QRect(180, 290, 71, 20))
        self.notuser_label.setObjectName(_fromUtf8("notuser_label"))
        self.register_button = QtGui.QPushButton(self.centralwidget)
        self.register_button.setGeometry(QtCore.QRect(260, 280, 121, 32))
        self.register_button.setObjectName(_fromUtf8("register_button"))
        self.usr_line_edit = QtGui.QLineEdit(self.centralwidget)
        self.usr_line_edit.setGeometry(QtCore.QRect(200, 140, 181, 21))
        self.usr_line_edit.setText(_fromUtf8(""))
        self.usr_line_edit.setObjectName(_fromUtf8("usr_line_edit"))
        self.pwd_line_edit = QtGui.QLineEdit(self.centralwidget)
        self.pwd_line_edit.setGeometry(QtCore.QRect(200, 180, 181, 21))
        self.pwd_line_edit.setText(_fromUtf8(""))
        self.pwd_line_edit.setEchoMode(QtGui.QLineEdit.Password)
        self.pwd_line_edit.setObjectName(_fromUtf8("pwd_line_edit"))
        self.usr_name_label = QtGui.QLabel(self.centralwidget)
        self.usr_name_label.setGeometry(QtCore.QRect(120, 140, 61, 16))
        self.usr_name_label.setObjectName(_fromUtf8("usr_name_label"))
        self.pwd_label = QtGui.QLabel(self.centralwidget)
        self.pwd_label.setGeometry(QtCore.QRect(125, 183, 61, 20))
        self.pwd_label.setObjectName(_fromUtf8("pwd_label"))
        self.reset_button = QtGui.QPushButton(self.centralwidget)
        self.reset_button.setGeometry(QtCore.QRect(190, 230, 81, 32))
        self.reset_button.setObjectName(_fromUtf8("reset_button"))
        self.message_label = QtGui.QLabel(self.centralwidget)
        self.message_label.setGeometry(QtCore.QRect(120, 110, 251, 20))
        self.message_label.setText(_fromUtf8(""))
        self.message_label.setAlignment(QtCore.Qt.AlignCenter)
        self.message_label.setObjectName(_fromUtf8("message_label"))
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
项目:darkc0de-old-stuff    作者:tuwid    | 项目源码 | 文件源码
def setupUi(self, Settings):
        Settings.setObjectName("Settings")
        Settings.resize(310, 96)
        Settings.setMinimumSize(QtCore.QSize(310, 96))
        Settings.setMaximumSize(QtCore.QSize(310, 96))
        self.layoutWidget = QtGui.QWidget(Settings)
        self.layoutWidget.setGeometry(QtCore.QRect(0, 0, 310, 104))
        self.layoutWidget.setObjectName("layoutWidget")
        self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.label_3 = QtGui.QLabel(self.layoutWidget)
        self.label_3.setObjectName("label_3")
        self.gridLayout.addWidget(self.label_3, 0, 0, 1, 1)
        self.path = QtGui.QLineEdit(self.layoutWidget)
        self.path.setObjectName("path")
        self.gridLayout.addWidget(self.path, 0, 1, 1, 1)
        self.browse = QtGui.QPushButton(self.layoutWidget)
        self.browse.setObjectName("browse")
        self.gridLayout.addWidget(self.browse, 0, 2, 1, 1)
        self.verticalLayout.addLayout(self.gridLayout)
        self.buttonBox = QtGui.QDialogButtonBox(self.layoutWidget)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(Settings)
        QtCore.QMetaObject.connectSlotsByName(Settings)
项目:darkc0de-old-stuff    作者:tuwid    | 项目源码 | 文件源码
def setupUi(self, Settings):
        Settings.setObjectName("Settings")
        Settings.resize(310, 96)
        Settings.setMinimumSize(QtCore.QSize(310, 96))
        Settings.setMaximumSize(QtCore.QSize(310, 96))
        self.layoutWidget = QtGui.QWidget(Settings)
        self.layoutWidget.setGeometry(QtCore.QRect(0, 0, 310, 104))
        self.layoutWidget.setObjectName("layoutWidget")
        self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.label_3 = QtGui.QLabel(self.layoutWidget)
        self.label_3.setObjectName("label_3")
        self.gridLayout.addWidget(self.label_3, 0, 0, 1, 1)
        self.path = QtGui.QLineEdit(self.layoutWidget)
        self.path.setObjectName("path")
        self.gridLayout.addWidget(self.path, 0, 1, 1, 1)
        self.browse = QtGui.QPushButton(self.layoutWidget)
        self.browse.setObjectName("browse")
        self.gridLayout.addWidget(self.browse, 0, 2, 1, 1)
        self.verticalLayout.addLayout(self.gridLayout)
        self.buttonBox = QtGui.QDialogButtonBox(self.layoutWidget)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(Settings)
        QtCore.QMetaObject.connectSlotsByName(Settings)
项目:linkchecker-gui    作者:linkcheck    | 项目源码 | 文件源码
def resizeEvent (self, event):
        """Resize line number area together with editor."""
        super(Editor, self).resizeEvent(event)
        cr = self.contentsRect()
        self.lineNumberArea.setGeometry(QtCore.QRect(cr.left(), cr.top(),
                                  self.lineNumberAreaWidth(), cr.height()))
项目:LearningPyQt    作者:manashmndl    | 项目源码 | 文件源码
def paintSection(self, painter, rect, logicalIndex):

        if not rect.isValid():
            return

        #------------------------------ paint section (without the label) ----

        opt = QtGui.QStyleOptionHeader()        
        self.initStyleOption(opt)

        opt.rect = rect
        opt.section = logicalIndex
        opt.text = ""

        #---- mouse over highlight ----

        mouse_pos = self.mapFromGlobal(QtGui.QCursor.pos())               
        if rect.contains(mouse_pos):
            opt.state |= QtGui.QStyle.State_MouseOver

        #---- paint ----

        painter.save()        
        self.style().drawControl(QtGui.QStyle.CE_Header, opt, painter, self)
        painter.restore()

        #------------------------------------------- paint mathText label ----

        qpixmap = self.qpixmaps[logicalIndex]

        #---- centering ----

        xpix = (rect.width() - qpixmap.size().width()) / 2. + rect.x()
        ypix = (rect.height() - qpixmap.size().height()) / 2.

        #---- paint ----

        rect = QtCore.QRect(xpix, ypix, qpixmap.size().width(),
                            qpixmap.size().height())
        painter.drawPixmap(rect, qpixmap)
项目:browser-history-phyton    作者:sistem-progamlama    | 项目源码 | 文件源码
def __init__(self, parent=None):
        super(Ui_Dialog, self).__init__(parent)
        self.setObjectName(_fromUtf8("Dialog"))
        parent.resize(320, 240)
        self.setMinimumSize(QtCore.QSize(550, 500))
        self.setMaximumSize(QtCore.QSize(550, 500))
        self.pushButton = QtGui.QPushButton(self)
        self.pushButton.setGeometry(QtCore.QRect(160, 100, 98, 27))
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.lineEdit = QtGui.QLineEdit(MainWindow)
        self.lineEdit.setGeometry(QtCore.QRect(140, 20, 113, 27))
        self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
        self.label = QtGui.QLabel(MainWindow)
        self.label.setGeometry(QtCore.QRect(40, 20, 91, 17))
        self.label.setObjectName(_fromUtf8("label"))
        self.lineEdit_2 = QtGui.QLineEdit(MainWindow)
        self.lineEdit_2.setEnabled(True)
        self.lineEdit_2.setGeometry(QtCore.QRect(140, 50, 113, 27))
        self.lineEdit_2.setEchoMode(QtGui.QLineEdit.Password)
        self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2"))
        self.label_2 = QtGui.QLabel(MainWindow)
        self.label_2.setGeometry(QtCore.QRect(90, 60, 41, 17))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.pushButton_2 = QtGui.QPushButton(MainWindow)
        self.pushButton_2.setGeometry(QtCore.QRect(50, 100, 98, 27))
        self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))

        self.checkBox = QtGui.QCheckBox(MainWindow)
        self.checkBox.setGeometry(QtCore.QRect(80, 130, 141, 22))
        self.checkBox.setObjectName(_fromUtf8("checkBox"))
        self.retranslateUi(MainWindow)
        QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("clicked()")), self.click)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
        QtCore.QObject.connect(self.pushButton_2, QtCore.SIGNAL(_fromUtf8("clicked()")), self.uyeOl)
        self.yeniform = None
项目:rec-attend-public    作者:renmengye    | 项目源码 | 文件源码
def drawImage(self, qp):
        # Return if no image available
        if self.image.isNull():
            return

        # Save the painters current setting to a stack
        qp.save()
        # Draw the image
        qp.drawImage(QtCore.QRect( self.xoff, self.yoff, self.w, self.h ), self.image)
        # Restore the saved setting from the stack
        qp.restore()
项目:EasyStorj    作者:lakewik    | 项目源码 | 文件源码
def setupUi(self, MainMenu):
        MainMenu.setObjectName(_fromUtf8("MainMenu"))
        MainMenu.resize(715, 257)
        self.label = QtGui.QLabel(MainMenu)
        self.label.setGeometry(QtCore.QRect(230, 10, 241, 41))
        self.label.setObjectName(_fromUtf8("label"))
        self.bucket_manager_bt = QtGui.QPushButton(MainMenu)
        self.bucket_manager_bt.setGeometry(QtCore.QRect(30, 70, 211, 31))
        self.bucket_manager_bt.setObjectName(_fromUtf8("bucket_manager_bt"))
        self.settings_bt = QtGui.QPushButton(MainMenu)
        self.settings_bt.setGeometry(QtCore.QRect(30, 110, 211, 31))
        self.settings_bt.setObjectName(_fromUtf8("settings_bt"))
        self.uploader_bt = QtGui.QPushButton(MainMenu)
        self.uploader_bt.setGeometry(QtCore.QRect(30, 150, 331, 41))
        self.uploader_bt.setObjectName(_fromUtf8("uploader_bt"))
        self.file_manager_bt = QtGui.QPushButton(MainMenu)
        self.file_manager_bt.setGeometry(QtCore.QRect(480, 70, 211, 71))
        self.file_manager_bt.setObjectName(_fromUtf8("file_manager_bt"))
        self.about_bt = QtGui.QPushButton(MainMenu)
        self.about_bt.setGeometry(QtCore.QRect(480, 210, 211, 31))
        self.about_bt.setObjectName(_fromUtf8("about_bt"))
        self.label_2 = QtGui.QLabel(MainMenu)
        self.label_2.setGeometry(QtCore.QRect(40, 210, 91, 31))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.account_label = QtGui.QLabel(MainMenu)
        self.account_label.setGeometry(QtCore.QRect(150, 210, 311, 31))
        self.account_label.setObjectName(_fromUtf8("account_label"))
        self.create_bucket_bt = QtGui.QPushButton(MainMenu)
        self.create_bucket_bt.setGeometry(QtCore.QRect(260, 70, 211, 71))
        self.create_bucket_bt.setObjectName(_fromUtf8("create_bucket_bt"))
        self.downloader_bt = QtGui.QPushButton(MainMenu)
        self.downloader_bt.setGeometry(QtCore.QRect(370, 150, 321, 41))
        self.downloader_bt.setObjectName(_fromUtf8("downloader_bt"))

        self.retranslateUi(MainMenu)
        QtCore.QMetaObject.connectSlotsByName(MainMenu)
项目:EasyStorj    作者:lakewik    | 项目源码 | 文件源码
def setupUi(self, InitialWindow):
        InitialWindow.setObjectName(_fromUtf8("InitialWindow"))
        InitialWindow.resize(820, 202)
        self.label = QtGui.QLabel(InitialWindow)
        self.label.setGeometry(QtCore.QRect(10, 0, 801, 61))
        self.label.setObjectName(_fromUtf8("label"))
        self.line = QtGui.QFrame(InitialWindow)
        self.line.setGeometry(QtCore.QRect(10, 50, 801, 20))
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        self.login_bt = QtGui.QPushButton(InitialWindow)
        self.login_bt.setGeometry(QtCore.QRect(10, 70, 401, 71))
        font = QtGui.QFont()
        font.setPointSize(18)
        self.login_bt.setFont(font)
        self.login_bt.setObjectName(_fromUtf8("login_bt"))
        self.register_bt = QtGui.QPushButton(InitialWindow)
        self.register_bt.setGeometry(QtCore.QRect(420, 70, 391, 71))
        font = QtGui.QFont()
        font.setPointSize(18)
        self.register_bt.setFont(font)
        self.register_bt.setObjectName(_fromUtf8("register_bt"))
        self.about_bt = QtGui.QPushButton(InitialWindow)
        self.about_bt.setGeometry(QtCore.QRect(10, 150, 801, 41))
        font = QtGui.QFont()
        font.setPointSize(18)
        self.about_bt.setFont(font)
        self.about_bt.setObjectName(_fromUtf8("about_bt"))

        self.retranslateUi(InitialWindow)
        QtCore.QMetaObject.connectSlotsByName(InitialWindow)
项目:EasyStorj    作者:lakewik    | 项目源码 | 文件源码
def setupUi(self, Logs):
        Logs.setObjectName(_fromUtf8("Logs"))
        Logs.resize(930, 369)
        self.label = QtGui.QLabel(Logs)
        self.label.setGeometry(QtCore.QRect(10, 10, 911, 31))
        self.label.setObjectName(_fromUtf8("label"))
        self.line = QtGui.QFrame(Logs)
        self.line.setGeometry(QtCore.QRect(10, 40, 911, 21))
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        self.logs_table = QtGui.QTableWidget(Logs)
        self.logs_table.setGeometry(QtCore.QRect(10, 60, 911, 251))
        self.logs_table.setObjectName(_fromUtf8("logs_table"))
        self.logs_table.setColumnCount(0)
        self.logs_table.setRowCount(0)
        self.exit_bt = QtGui.QPushButton(Logs)
        self.exit_bt.setGeometry(QtCore.QRect(790, 330, 131, 26))
        self.exit_bt.setObjectName(_fromUtf8("exit_bt"))
        self.save_logs_as_bt = QtGui.QPushButton(Logs)
        self.save_logs_as_bt.setGeometry(QtCore.QRect(650, 330, 131, 26))
        self.save_logs_as_bt.setObjectName(_fromUtf8("save_logs_as_bt"))
        self.logs_settings_bt = QtGui.QPushButton(Logs)
        self.logs_settings_bt.setGeometry(QtCore.QRect(510, 330, 131, 26))
        self.logs_settings_bt.setObjectName(_fromUtf8("logs_settings_bt"))
        self.label_2 = QtGui.QLabel(Logs)
        self.label_2.setGeometry(QtCore.QRect(10, 320, 181, 41))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.total_log_positions = QtGui.QLabel(Logs)
        self.total_log_positions.setGeometry(QtCore.QRect(200, 320, 131, 41))
        self.total_log_positions.setObjectName(_fromUtf8("total_log_positions"))
        self.clear_logs_bt = QtGui.QPushButton(Logs)
        self.clear_logs_bt.setGeometry(QtCore.QRect(370, 330, 131, 26))
        self.clear_logs_bt.setObjectName(_fromUtf8("clear_logs_bt"))

        self.retranslateUi(Logs)
        QtCore.QMetaObject.connectSlotsByName(Logs)
项目:EasyStorj    作者:lakewik    | 项目源码 | 文件源码
def setupUi(self, BucketManager):
        BucketManager.setObjectName(_fromUtf8("BucketManager"))
        BucketManager.resize(883, 290)
        self.bucket_list_tableview = QtGui.QTableView(BucketManager)
        self.bucket_list_tableview.setGeometry(QtCore.QRect(10, 50, 671, 201))
        self.bucket_list_tableview.setObjectName(_fromUtf8("bucket_list_tableview"))
        self.label = QtGui.QLabel(BucketManager)
        self.label.setGeometry(QtCore.QRect(350, 0, 181, 51))
        self.label.setObjectName(_fromUtf8("label"))
        self.line = QtGui.QFrame(BucketManager)
        self.line.setGeometry(QtCore.QRect(690, 50, 20, 201))
        self.line.setFrameShape(QtGui.QFrame.VLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        self.edit_bucket_bt = QtGui.QPushButton(BucketManager)
        self.edit_bucket_bt.setGeometry(QtCore.QRect(710, 50, 161, 51))
        self.edit_bucket_bt.setObjectName(_fromUtf8("edit_bucket_bt"))
        self.delete_bucket_bt = QtGui.QPushButton(BucketManager)
        self.delete_bucket_bt.setGeometry(QtCore.QRect(710, 110, 161, 41))
        self.delete_bucket_bt.setObjectName(_fromUtf8("delete_bucket_bt"))
        self.quit_bt = QtGui.QPushButton(BucketManager)
        self.quit_bt.setGeometry(QtCore.QRect(710, 210, 161, 41))
        self.quit_bt.setObjectName(_fromUtf8("quit_bt"))
        self.label_2 = QtGui.QLabel(BucketManager)
        self.label_2.setGeometry(QtCore.QRect(630, 260, 111, 21))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.total_buckets_label = QtGui.QLabel(BucketManager)
        self.total_buckets_label.setGeometry(QtCore.QRect(750, 260, 121, 21))
        self.total_buckets_label.setObjectName(_fromUtf8("total_buckets_label"))
        self.create_new_bucket_bt = QtGui.QPushButton(BucketManager)
        self.create_new_bucket_bt.setGeometry(QtCore.QRect(710, 160, 161, 41))
        self.create_new_bucket_bt.setObjectName(_fromUtf8("create_new_bucket_bt"))

        self.retranslateUi(BucketManager)
        QtCore.QMetaObject.connectSlotsByName(BucketManager)