python类SIGNAL的实例源码

VillageFinder.py 文件源码 项目:TWTools 作者: ZeX2 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def get_coords_data(self):
        if self.gui_data is None:
            return

        option = None
        if self.listRadio.isChecked():
            option = 1
        else:
            option = 0

        number = self.numberCheck.isChecked()
        player = self.playerCheck.isChecked()
        points = self.pointsCheck.isChecked()

        self.get_coords_thread = CoordsThread(self.gui_data, option, number, player, points)
        self.connect(self.get_coords_thread, QtCore.SIGNAL("update_coords(PyObject)"), self.update_coords)
        self.get_coords_thread.start()
PCBcategories.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        QtGui.QDialog.__init__(self, parent)
        self.setWindowTitle(u'Add new category')
        #
        self.categoryName = QtGui.QLineEdit('')
        self.categoryName.setStyleSheet('background-color:#FFF;')

        self.categoryDescription = QtGui.QTextEdit('')
        # buttons
        buttons = QtGui.QDialogButtonBox()
        buttons.setOrientation(QtCore.Qt.Vertical)
        buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole)
        buttons.addButton("Add", QtGui.QDialogButtonBox.AcceptRole)
        self.connect(buttons, QtCore.SIGNAL("accepted()"), self, QtCore.SLOT("accept()"))
        self.connect(buttons, QtCore.SIGNAL("rejected()"), self, QtCore.SLOT("reject()"))
        #
        lay = QtGui.QGridLayout(self)
        lay.addWidget(QtGui.QLabel(u'Name'), 0, 0, 1, 1)
        lay.addWidget(self.categoryName, 0, 1, 1, 1)
        lay.addWidget(QtGui.QLabel(u'Desctiption'), 1, 0, 1, 1, QtCore.Qt.AlignTop)
        lay.addWidget(self.categoryDescription, 1, 1, 1, 1)
        lay.addWidget(buttons, 0, 2, 2, 1, QtCore.Qt.AlignCenter)
        lay.setRowStretch(1, 10)
PCBexportKerkythea.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        #
        self.form = self
        self.form.setWindowTitle(u"Export to Kerkythea v1.2")
        #
        tab = QtGui.QTabWidget()
        tab.addTab(self.tabGeneral(), u'General')
        tab.addTab(self.tabCamera(), u'Cameras')
        tab.addTab(self.tabLight(), u'Lights')
        #
        lay = QtGui.QVBoxLayout(self)
        lay.addWidget(tab)
        #
        self.connect(self.exportObjectsAs_YES, QtCore.SIGNAL("clicked ()"), self.setColors)
        self.connect(self.exportObjectsAs_NO, QtCore.SIGNAL("clicked ()"), self.setColors)
linelist_manager.py 文件源码 项目:smhr 作者: andycasey 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def sort(self, column, order):

        if "line_list" not in self.session.metadata:
            return None

        self.emit(QtCore.SIGNAL("layoutAboutToBeChanged()"))

        self.session.metadata["line_list"].sort(self.columns[column])
        if order == QtCore.Qt.DescendingOrder:
            self.session.metadata["line_list"].reverse()

        self.dataChanged.emit(self.createIndex(0, 0),
            self.createIndex(self.rowCount(0), self.columnCount(0)))
        self.emit(QtCore.SIGNAL("layoutChanged()"))

        # Must update hash sorting after any modification to line list
        self.session.metadata["line_list_argsort_hashes"] = np.argsort(
            self.session.metadata["line_list"]["hash"])
fileloading.py 文件源码 项目:android_malware_detection 作者: congyuandong 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def run(self):
        if self.incoming_file:
            try:
                file_path, file_type = self.incoming_file
                if file_type in ["APK", "DEX", "DEY"]:
                    ret = self.session.add(file_path,
                                           open(file_path, 'r').read())
                    self.emit(QtCore.SIGNAL("loadedFile(bool)"), ret)
                elif file_type == "SESSION" :
                    self.session.load(file_path)
                    self.emit(QtCore.SIGNAL("loadedFile(bool)"), True)
            except Exception as e:
                androconf.debug(e)
                androconf.debug(traceback.format_exc())
                self.emit(QtCore.SIGNAL("loadedFile(bool)"), False)

            self.incoming_file = []
        else:
            self.emit(QtCore.SIGNAL("loadedFile(bool)"), False)
fileloading.py 文件源码 项目:android_malware_detection 作者: congyuandong 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def run(self):
        if self.incoming_file:
            try:
                file_path, file_type = self.incoming_file
                if file_type in ["APK", "DEX", "DEY"]:
                    ret = self.session.add(file_path,
                                           open(file_path, 'r').read())
                    self.emit(QtCore.SIGNAL("loadedFile(bool)"), ret)
                elif file_type == "SESSION" :
                    self.session.load(file_path)
                    self.emit(QtCore.SIGNAL("loadedFile(bool)"), True)
            except Exception as e:
                androconf.debug(e)
                androconf.debug(traceback.format_exc())
                self.emit(QtCore.SIGNAL("loadedFile(bool)"), False)

            self.incoming_file = []
        else:
            self.emit(QtCore.SIGNAL("loadedFile(bool)"), False)
_TaskPanelCaeMesherGmsh.py 文件源码 项目:Cfd 作者: qingfengxia 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def __init__(self, obj):
        self.mesh_obj = obj
        self.form = FreeCADGui.PySideUic.loadUi(CfdTools.getModulePath() + "/TaskPanelCaeMesherGmsh.ui")

        self.Timer = QtCore.QTimer()
        self.Timer.start(100)  # 100 milli seconds
        self.gmsh_runs = False
        self.console_message_gmsh = ''

        QtCore.QObject.connect(self.form.if_max, QtCore.SIGNAL("valueChanged(Base::Quantity)"), self.max_changed)
        QtCore.QObject.connect(self.form.if_min, QtCore.SIGNAL("valueChanged(Base::Quantity)"), self.min_changed)
        QtCore.QObject.connect(self.form.cb_dimension, QtCore.SIGNAL("activated(int)"), self.choose_dimension)
        QtCore.QObject.connect(self.Timer, QtCore.SIGNAL("timeout()"), self.update_timer_text)

        self.form.cb_dimension.addItems(_CaeMeshGmsh._CaeMeshGmsh.known_element_dimensions)

        self.get_mesh_params()
        self.get_active_analysis()
        self.update()
universal_tool_template_v7.3.py 文件源码 项目:universal_tool_template.py 作者: shiningdesign 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def Establish_Connections(self):
        # loop button and menu action to link to functions
        for ui_name in self.uiList.keys():
            if ui_name.endswith('_btn'):
                QtCore.QObject.connect(self.uiList[ui_name], QtCore.SIGNAL("clicked()"), getattr(self, ui_name[:-4]+"_action", partial(self.default_action,ui_name)))
            elif ui_name.endswith('_atn'):
                QtCore.QObject.connect(self.uiList[ui_name], QtCore.SIGNAL("triggered()"), getattr(self, ui_name[:-4]+"_action", partial(self.default_action,ui_name)))
            elif ui_name.endswith('_btnMsg'):
                QtCore.QObject.connect(self.uiList[ui_name], QtCore.SIGNAL("clicked()"), getattr(self, ui_name[:-7]+"_message", partial(self.default_message,ui_name)))
            elif ui_name.endswith('_atnMsg'):
                QtCore.QObject.connect(self.uiList[ui_name], QtCore.SIGNAL("triggered()"), getattr(self, ui_name[:-7]+"_message", partial(self.default_message,ui_name)))
        # custom connection

    #=======================================
    # UI Response functions (custom + prebuilt functions)
    #=======================================
    #-- ui actions
xlfview.py 文件源码 项目:xiboside 作者: ajiwo 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __init__(self, media, parent):
        super(VideoMediaView, self).__init__(media, parent)
        self._widget = QWidget(parent)
        self._process = QProcess(self._widget)
        self._process.setObjectName('%s-process' % self.objectName())
        self._std_out = []
        self._errors = []
        self._stopping = False
        self._mute = False
        if 'mute' in self._options:
            self._mute = bool(int(self._options['mute']))

        self._widget.setGeometry(media['_geometry'])
        self.connect(self._process, SIGNAL("error()"), self._process_error)
        self.connect(self._process, SIGNAL("finished()"), self.stop)
        self.connect(self._process, SIGNAL("readyReadStandardOutput()"), self.__grep_std_out)
        self.set_default_widget_prop()

        self._stop_timer = QTimer(self)
        self._stop_timer.setSingleShot(True)
        self._stop_timer.setInterval(1000)
        self._stop_timer.timeout.connect(self._force_stop)
VillageFinder.py 文件源码 项目:TWTools 作者: ZeX2 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def run(self):
        self.emit(QtCore.SIGNAL("reset_rows()"))

        for row in self.table_data:
            self.emit(QtCore.SIGNAL("update_table(PyObject)"), row)

        self.emit(QtCore.SIGNAL("get_coords_data(PyObject)"), self.table_data)
VillageFinder.py 文件源码 项目:TWTools 作者: ZeX2 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def table_function(self):
        self.get_table_thread = TableThread(self.gui_data)
        self.connect(self.get_table_thread, QtCore.SIGNAL("update_table(PyObject)"), self.update_table)
        self.connect(self.get_table_thread, QtCore.SIGNAL("reset_rows()"), self.reset_rows)
        self.connect(self.get_table_thread, QtCore.SIGNAL("get_coords_data(PyObject)"), self.get_coords_data)
        self.get_table_thread.start()
main.py 文件源码 项目:TWTools 作者: ZeX2 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def download_function(self):
        self.downloadButton.setEnabled(False)
        self.downloadButton.setText("Downloading....")
        server = self.serverBox.currentText()
        world = self.worldBox.currentText()
        url = self.servers_dict[server][world]

        self.get_download_thread = DownloadThread(url)
        self.connect(self.get_download_thread, QtCore.SIGNAL("get_world_data(PyObject)"), self.get_world_data)
        self.connect(self.get_download_thread, QtCore.SIGNAL("download_error(PyObject)"), self.download_error)
        self.get_download_thread.start()
BacktimingCalculator.py 文件源码 项目:TWTools 作者: ZeX2 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def run(self):
        speed_dict = {0: 18, 1:22, 2:18, 3:18, 4: 9, 5: 10, 6: 10, 7: 11, 8: 30, 9: 30, 10: 10, 11: 35}
        speed = speed_dict[self.unit]
        one_field_speed = speed * (1 / float(self.unit_speed)) * (1 / float(self.world_speed))

        origin = self.origin.split("|")
        origin_x = origin[0]
        origin_y = origin[1]

        destination = self.destination.split("|")
        destination_x = destination[0]
        destination_y = destination[1]

        x = int(origin_x) - int(destination_x)
        y = int(origin_y) - int(destination_y)

        max_range_squared = (x ** 2) + (y ** 2)
        range_ = math.sqrt(max_range_squared)

        minutes = range_ * one_field_speed
        rounded_seconds = round(minutes * 60)

        travel_time = datetime.timedelta(seconds = rounded_seconds)
        arrival_time = self.arrival.toPython()

        backtime = arrival_time + travel_time

        data = [backtime, self.origin]
        self.emit(QtCore.SIGNAL("update_backtime(PyObject)"), data)
BacktimingCalculator.py 文件源码 项目:TWTools 作者: ZeX2 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def backtime_function(self):
        if ((self.world_speed == 0) and (self.unit_speed == 0)):
            print("asdasd")
            return

        origin_coord = self.originEdit.text()
        destination_coord = self.destinationEdit.text()

        coord_pattern = re.compile("\d{3}\|\d{3}")
        origin_validity = coord_pattern.match(origin_coord)
        destination_validity = coord_pattern.match(destination_coord)

        if ((destination_validity is None) or (origin_validity is None)):
            QtGui.QMessageBox.critical(
                self,
                "Search Around Error",
                "Please enter a valid coordinate such as 556|494",
                QtGui.QMessageBox.Ok)
            self.calculateButton.setEnabled(True)
            return

        self.calculateButton.setEnabled(False)

        world_speed = self.world_speed
        unit_speed = self.unit_speed
        origin = self.originEdit.text()
        destination = self.destinationEdit.text()
        unit = self.unitBox.currentIndex()
        arrival = self.arrivalEdit.dateTime()

        self.get_backtime_thread = BacktimeThread(world_speed, unit_speed, origin, destination, unit, arrival)
        self.connect(self.get_backtime_thread, QtCore.SIGNAL("update_backtime(PyObject)"), self.update_backtime)
        self.get_backtime_thread.start()
CoordExtractor.py 文件源码 项目:TWTools 作者: ZeX2 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def run(self):
        coord_pattern = re.compile("\d{3}\|\d{3}")
        coords_list = list(set(re.findall(coord_pattern, self.text)))
        coords_string = ""
        for coord in coords_list:
            coords_string = coords_string + coord + " "

        coords_string = coords_string[:-1]
        self.emit(QtCore.SIGNAL("get_coords(PyObject)"), coords_string)
CoordExtractor.py 文件源码 项目:TWTools 作者: ZeX2 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def extract_function(self):
        self.extractButton.setEnabled(False)
        text = self.plainTextEdit.toPlainText()
        self.get_extract_thread = ExtractThread(text)
        self.connect(self.get_extract_thread, QtCore.SIGNAL("get_coords(PyObject)"), self.get_coords)
        self.get_extract_thread.start()
GDT.py 文件源码 项目:FreeCAD-GDT 作者: juanvanyo 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def generateWidget( self, idGDT, ContainerOfData ):
        self.idGDT = idGDT
        self.ContainerOfData = ContainerOfData
        if hasattr(FreeCADGui,"Snapper"):
            if FreeCADGui.Snapper.grid:
                FreeCAD.DraftWorkingPlane.alignToPointAndAxis(self.ContainerOfData.p1, self.ContainerOfData.Direction, 0.0)
                FreeCADGui.Snapper.grid.set()
        self.FORMAT = makeFormatSpec(0,'Length')
        self.uiloader = FreeCADGui.UiLoader()
        self.inputfield = self.uiloader.createWidget("Gui::InputField")
        self.inputfield.setText(self.FORMAT % 0)
        self.ContainerOfData.OffsetValue = 0
        QtCore.QObject.connect(self.inputfield,QtCore.SIGNAL("valueChanged(double)"),self.valueChanged)

        return GDTDialog_hbox(self.Text,self.inputfield)
Cute.py 文件源码 项目:HexRaysPyTools 作者: igogo-x86 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def connect(sender, signal, callback):
    """Connect a signal.
    Use this function only in cases where code should work with both Qt5 and Qt4, as it is an ugly hack.
    Args:
        sender: The Qt object emitting the signal
        signal: A string, containing the signal signature (as in Qt4 and PySide)
        callback: The function to be called upon receiving the signal
    """
    if use_qt5:
        return getattr(sender, signal.split('(', 1)[0]).connect(callback)
    else:
        return sender.connect(QtCore.SIGNAL(signal), callback)
Cute.py 文件源码 项目:HexRaysPyTools 作者: igogo-x86 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def disconnect(sender, signal, callback):
    """Disconnect a signal.
    Use this function only in cases where code should work with both Qt5 and Qt4, as it is an ugly hack.
    Args:
        sender: The Qt object emitting the signal
        signal: A string, containing the signal signature (as in Qt4 and PySide)
        callback: The function to be called upon receiving the signal
    """
    if use_qt5:
        return getattr(sender, signal.split('(', 1)[0]).disconnect(callback)
    else:
        return sender.disconnect(QtCore.SIGNAL(signal), callback)
PCBcategories.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self, categoryID, parent=None):
        QtGui.QDialog.__init__(self, parent)
        self.setWindowTitle(u'Update category')

        self.categoryID = categoryID
        categoryData = readCategories()[self.categoryID]
        #
        self.categoryName = QtGui.QLineEdit('')
        self.categoryName.setStyleSheet('background-color:#FFF;')
        self.categoryName.setText(categoryData[0])

        self.categoryDescription = QtGui.QTextEdit('')
        self.categoryDescription.setText(categoryData[1])
        # buttons
        buttons = QtGui.QDialogButtonBox()
        buttons.setOrientation(QtCore.Qt.Vertical)
        buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole)
        buttons.addButton("Update", QtGui.QDialogButtonBox.AcceptRole)
        self.connect(buttons, QtCore.SIGNAL("accepted()"), self, QtCore.SLOT("accept()"))
        self.connect(buttons, QtCore.SIGNAL("rejected()"), self, QtCore.SLOT("reject()"))
        #
        lay = QtGui.QGridLayout(self)
        lay.addWidget(QtGui.QLabel(u'Name'), 0, 0, 1, 1)
        lay.addWidget(self.categoryName, 0, 1, 1, 1)
        lay.addWidget(QtGui.QLabel(u'Desctiption'), 1, 0, 1, 1, QtCore.Qt.AlignTop)
        lay.addWidget(self.categoryDescription, 1, 1, 1, 1)
        lay.addWidget(buttons, 0, 2, 2, 1, QtCore.Qt.AlignCenter)
        lay.setRowStretch(1, 10)
PCBexport.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def formatPliku(self):
        page = QtGui.QWizardPage()
        page.setSubTitle(u"<span style='font-weight:bold;font-size:13px;'>File format</span>")
        #
        self.nazwaProgramu = QtGui.QLabel()
        self.formatPliku = QtGui.QLabel()

        self.ikonaProgramu = QtGui.QLabel()
        self.ikonaProgramu.setFixedSize(120, 120)
        self.ikonaProgramu.setAlignment(QtCore.Qt.AlignCenter)
        #
        self.listaFormatow = QtGui.QListWidget()
        for i, j in supSoftware.items():
            if j['export']:
                a = QtGui.QListWidgetItem(j['name'])
                a.setData(QtCore.Qt.UserRole, i)

                self.listaFormatow.addItem(a)
        QtCore.QObject.connect(self.listaFormatow, QtCore.SIGNAL("currentRowChanged (int)"), self.zmianaProgramu)
        #
        lay = QtGui.QGridLayout(page)
        lay.addWidget(self.listaFormatow, 0, 0, 4, 1)
        lay.addWidget(self.ikonaProgramu, 0, 1, 1, 1, QtCore.Qt.AlignCenter)
        lay.addWidget(self.nazwaProgramu, 1, 1, 1, 1)
        lay.addWidget(self.formatPliku, 2, 1, 1, 1)
        lay.setHorizontalSpacing(20)
        lay.setColumnMinimumWidth(1, 140)
        return page
PCBexport.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def exportUstawienia(self):
        page = QtGui.QWizardPage()
        page.setSubTitle(u"<span style='font-weight:bold;font-size:13px;'>Settings</span>")
        #
        self.pathToFile = QtGui.QLineEdit('')
        #self.pathToFile.setReadOnly(True)
        #
        zmianaSciezki = QtGui.QPushButton('...')
        zmianaSciezki.setToolTip(u'Change path')
        QtCore.QObject.connect(zmianaSciezki, QtCore.SIGNAL("pressed ()"), self.zmianaSciezkiF)
        #
        self.addHoles = QtGui.QCheckBox(u'Add holes')
        self.addDimensions = QtGui.QCheckBox(u'Add dimensions')
        self.addAnnotations = QtGui.QCheckBox(u'Add annotations')
        self.addGluePaths = QtGui.QCheckBox(u'Export glue paths')
        #
        lay = QtGui.QGridLayout(page)
        lay.addWidget(QtGui.QLabel(u'Path: '), 0, 0, 1, 1)
        lay.addWidget(self.pathToFile, 0, 1, 1, 1)
        lay.addWidget(zmianaSciezki, 0, 2, 1, 1)
        lay.addItem(QtGui.QSpacerItem(1, 10), 1, 0, 1, 3)
        lay.addWidget(self.addHoles, 2, 0, 1, 3)
        lay.addWidget(self.addDimensions, 3, 0, 1, 3)
        lay.addWidget(self.addAnnotations, 4, 0, 1, 3)
        lay.addWidget(self.addGluePaths, 5, 0, 1, 3)
        lay.setColumnStretch(1, 6)
        return page
PCBcollision.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        #
        self.form = self
        self.form.setWindowTitle(u'Check collisions')
        self.form.setWindowIcon(QtGui.QIcon(":/data/img/collisions.png"))

        self.root = None
        self.obj = None
        self.tmpFile = None
        self.transaprency = {}
        #
        self.createSolid = QtGui.QCheckBox(u'Create solid on exit')
        #
        self.table1 = collisionObjectTable()
        #
        self.table2 = collisionObjectTable()
        #
        checkButton = QtGui.QPushButton(u"Check")
        self.connect(checkButton, QtCore.SIGNAL("released ()"), self.preview)
        #
        lay = QtGui.QGridLayout(self)
        lay.addWidget(checkButton, 0, 0, 1, 2)
        lay.addWidget(QtGui.QLabel(u'First group'), 1, 0, 1, 1)
        lay.addWidget(self.table1, 2, 0, 1, 1)
        lay.addWidget(QtGui.QLabel(u'Second group'), 1, 1, 1, 1)
        lay.addWidget(self.table2, 2, 1, 1, 1)
        lay.addWidget(self.createSolid, 3, 0, 1, 2)
        #
        self.readObjects()
        self.removeRoot()
convertDB.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        QtGui.QDialog.__init__(self, parent)
        self.setWindowTitle("Convert old database to a new format")
        self.setMinimumWidth(500)
        # stary plik z modelami
        self.oldFilePath = QtGui.QLineEdit(os.path.join(__currentPath__, "param.py"))
        # nowy plik z modelami
        self.newFilePath = QtGui.QLineEdit(os.path.join(__currentPath__, "data/dane.cfg"))
        #
        self.pominDuplikaty = QtGui.QCheckBox(u"Skip duplicates")
        self.pominDuplikaty.setChecked(True)
        self.pominDuplikaty.setDisabled(True)
        #
        self.removeOld = QtGui.QCheckBox(u"Remove old database")
        self.removeOld.setChecked(True)
        # przyciski
        buttons = QtGui.QDialogButtonBox()
        buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole)
        buttons.addButton("Convert", QtGui.QDialogButtonBox.AcceptRole)
        self.connect(buttons, QtCore.SIGNAL("accepted()"), self.konwertuj)
        self.connect(buttons, QtCore.SIGNAL("rejected()"), self, QtCore.SLOT("reject()"))
        #
        self.mainLayout = QtGui.QGridLayout(self)
        #self.mainLayout.setContentsMargins(0, 0, 0, 0)
        self.mainLayout.addWidget(QtGui.QLabel(u"Old database"), 0, 0, 1, 1)
        self.mainLayout.addWidget(self.oldFilePath, 0, 1, 1, 1)
        self.mainLayout.addWidget(QtGui.QLabel(u"New database"), 1, 0, 1, 1)
        self.mainLayout.addWidget(self.newFilePath, 1, 1, 1, 1)

        self.mainLayout.addWidget(self.pominDuplikaty, 3, 0, 1, 2)
        self.mainLayout.addWidget(self.removeOld, 4, 0, 1, 2)
        self.mainLayout.addWidget(buttons, 5, 1, 1, 1, QtCore.Qt.AlignRight)
        self.mainLayout.setRowStretch(6, 10)
PCBmoveParts.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def open(self):
        self.form.connect(self.form.positionX, QtCore.SIGNAL('valueChanged (double)'), self.changePos)
        self.form.connect(self.form.positionY, QtCore.SIGNAL('valueChanged (double)'), self.changePos)
        self.form.connect(self.form.positionZ, QtCore.SIGNAL('valueChanged (double)'), self.changePos)
        self.form.connect(self.form.rotationRX, QtCore.SIGNAL('valueChanged (double)'), self.changePos)
        self.form.connect(self.form.rotationRY, QtCore.SIGNAL('valueChanged (double)'), self.changePos)
        self.form.connect(self.form.rotationRZ, QtCore.SIGNAL('valueChanged (double)'), self.changePos)
        self.form.connect(self.form.resetButton, QtCore.SIGNAL('pressed ()'), self.loadData)
        #
        self.readLibs()
        self.loadData()
        self.changePos(1)
        #
        self.form.connect(self.form.listaBibliotek, QtCore.SIGNAL('currentIndexChanged (int)'), self.loadData)
PCBfunctions.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        QtGui.QPushButton.__init__(self, parent)
        self.setStyleSheet('''
            QPushButton
            {
                border: 1px solid #000;
                background-color: rgb(255, 0, 0);
                margin: 1px;
            }
        ''')
        self.setFlat(True)
        #self.setFixedSize(20, 20)
        self.kolor = [0., 0., 0.]
        #
        self.connect(self, QtCore.SIGNAL("released ()"), self.pickColor)
PCBtoolBar.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def defConstraintAreaF(self):
        ''' create constraint are dialog '''
        dial = QtGui.QDialog()
        dial.setWindowTitle("Create constraint area")
        # areas list
        lista = QtGui.QListWidget()
        for i, j in PCBconstraintAreas.items():
            a = QtGui.QListWidgetItem(j[0])
            a.setData(QtCore.Qt.UserRole, i)

            lista.addItem(a)
        lista.sortItems()
        ##########
        # przyciski
        buttons = QtGui.QDialogButtonBox()
        buttons.setOrientation(QtCore.Qt.Vertical)
        buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole)
        buttons.addButton("Create", QtGui.QDialogButtonBox.AcceptRole)
        dial.connect(buttons, QtCore.SIGNAL("accepted()"), dial, QtCore.SLOT("accept()"))
        dial.connect(buttons, QtCore.SIGNAL("rejected()"), dial, QtCore.SLOT("reject()"))
        ####
        lay = QtGui.QGridLayout()
        lay.addWidget(lista, 0, 0, 1, 1)
        lay.addWidget(buttons, 0, 1, 1, 1)
        dial.setLayout(lay)

        if dial.exec_():
            self.constraintAreaF(str(lista.currentItem().data(QtCore.Qt.UserRole)))
spectral_models.py 文件源码 项目:smhr 作者: andycasey 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def sort(self, column, order):

        self.emit(QtCore.SIGNAL("layoutAboutToBeChanged()"))
        self._data = sorted(self._data,
            key=lambda sm: getattr(sm, self.attrs[column]))

        if order == QtCore.Qt.DescendingOrder:
            self._data.reverse()

        self.dataChanged.emit(self.createIndex(0, 0),
            self.createIndex(self.rowCount(0), self.columnCount(0)))
        self.emit(QtCore.SIGNAL("layoutChanged()"))
linelist_manager.py 文件源码 项目:smhr 作者: andycasey 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def sort(self, column, order):

        if "spectral_models" not in self.session.metadata:
            return None

        self.emit(QtCore.SIGNAL("layoutAboutToBeChanged()"))

        sorters = {
            0: lambda sm: sm.transitions["wavelength"].mean(),
            1: lambda sm: sm._repr_element,
            2: lambda sm: isinstance(sm, SpectralSynthesisModel),
            3: lambda sm: sm.use_for_stellar_parameter_inference,
            4: lambda sm: sm.use_for_stellar_composition_inference
        }

        self.session.metadata["spectral_models"].sort(key=sorters[column])

        if order == QtCore.Qt.DescendingOrder:
            self.session.metadata["spectral_models"].reverse()

        self.session._spectral_model_conflicts = spectral_model_conflicts(
            self.session.metadata["spectral_models"],
            self.session.metadata["line_list"])

        self.dataChanged.emit(self.createIndex(0, 0),
            self.createIndex(self.rowCount(0), self.columnCount(0)))
        self.emit(QtCore.SIGNAL("layoutChanged()"))
mainwindow.py 文件源码 项目:android_malware_detection 作者: congyuandong 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def setupSession(self):
        self.session = Session()

        self.fileLoadingThread = FileLoadingThread(self.session)
        self.connect(self.fileLoadingThread,
                QtCore.SIGNAL("loadedFile(bool)"),
                self.loadedFile)


问题


面经


文章

微信
公众号

扫码关注公众号