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


Python QtCore.qsrand方法代码示例

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


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

示例1: visualize

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qsrand [as 别名]
def visualize(params, folder):

    #Check matching files
    list_files = glob.glob(folder+"/*_model*.dat");
    print list_files;
    print "No. of files:", len(list_files);
    ### LOAD All the Models ###
    for model_file in list_files:
        
        model = pickle.load(open(model_file,'rb'));
        
        print ">Reading model :",model_file;
       
        print ">creating model...";
        print model;
        ndmmodel = ndmModel.ndmModel(params['numI'], params['numH'], params['numO'], model['best_sol']);

        print ">model created!", type(ndmmodel);

    
        #visualise the model
        print ">visualizing model";
        app = QtGui.QApplication(sys.argv);
        QtCore.qsrand(QtCore.QTime(0,0,0).secsTo(QtCore.QTime.currentTime()));
        widget2 = GraphWidget(ndmmodel,'Test Set');
        widget2.show();
开发者ID:adamuas,项目名称:coevondm,代码行数:28,代码来源:VisualizeModel.py

示例2: main

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qsrand [as 别名]
def main():
    """
    This is where the main program execution begins.
    @return: None
    """
    app = QtGui.QApplication(sys.argv)
    app.setStyle('Plastique')
    QtCore.qsrand(QtCore.QTime(0,0,0).secsTo(QtCore.QTime.currentTime()))

    #make a splash screen to show while application initializes
    screendir = os.path.dirname(os.path.abspath('__file__'))
    pixmap = QtGui.QPixmap(os.path.join(screendir,"SideMail/Resources/splashscreen.png"))
    splash = QtGui.QSplashScreen(pixmap, QtCore.Qt.WindowStaysOnTopHint)
    splash.setMask(pixmap.mask())
    splash.show()
    splash.showMessage((u'Starting...'),
                       QtCore.Qt.AlignRight | QtCore.Qt.AlignBottom,
                       QtCore.Qt.yellow)
    
    app.processEvents()
    widget = SideMail()
    widget.show()
    #hide splash when done loading
    splash.finish(widget)

    sys.exit(app.exec_())
开发者ID:mattanimation,项目名称:PyCommune,代码行数:28,代码来源:sidemail.py

示例3: __init__

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qsrand [as 别名]
    def __init__(self, target):
        super(LightningStrikesTransition, self).__init__()

        self.setEventSource(self)
        self.setEventType(QtCore.QEvent.Timer)
        self.setTargetState(target)
        QtCore.qsrand(QtCore.QDateTime.currentDateTime().toTime_t())
        self.startTimer(1000)
开发者ID:CapB1ack,项目名称:PyQt4,代码行数:10,代码来源:stickman.py

示例4: main

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qsrand [as 别名]
def main():
    app = QtGui.QApplication(sys.argv)
    QtCore.qsrand(QtCore.QTime(0,0,0).secsTo(QtCore.QTime.currentTime()))
    qtp = QtCore.QThreadPool(app).globalInstance()
    MainW= QtGui.QMainWindow()
    ui = MainWindow()
    ui.show()
    sys.exit(app.exec_())
开发者ID:fccoelho,项目名称:epigrass,代码行数:10,代码来源:neteditor.py

示例5: play

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qsrand [as 别名]
    def play(self,):
        """
        """

        log.info("Playing animation")

        self._init_qt()
        QtCore.qsrand(QtCore.QTime(0, 0, 0).secsTo(QtCore.QTime.currentTime()))
        widget = InteractiveCellWidget(self.meta)
        self._create_window(widget)
开发者ID:jonathan-fouchard,项目名称:kt_simul,代码行数:12,代码来源:animate.py

示例6: iniciarJuego

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qsrand [as 别名]
 def iniciarJuego(self):
     self.habilitarBotones()
     cont = 0
     aleatorio = 0
     self.miliseg = 0
     self.seg = 0
     self.min = 0
     
     ##Semilla del aleatorio#
     seed = QtCore.QTime()
     seed.start()
     QtCore.qsrand(seed.msec())
     niveles = self.uiS.textNivel.text()
     
     if(niveles == "Juvenil"):  self.valores = plantilla1.split(",")
     elif(niveles == "Profesional"):  self.valores = plantilla2.split(",")
     elif(niveles == "Experto"):  self.valores = plantilla3.split(",")
     
     for i in range(9):
         for j in range(9):
             num = (i*9)+j
             aleatorio = randint(0,10)
             
             if(niveles == "Juvenil"):
                 if(aleatorio <= 6):
                     self.listaCeldas[num].setTextColor(QtCore.Qt.blue)
                     self.listaCeldas[num].setText(self.valores[cont])
                     self.listaCeldas[num].setDisabled(True)
                 else:
                     self.listaCeldas[num].setDisabled(False)
                     self.listaCeldas[num].setText("")
             elif(niveles == "Profesional"):
                 if(aleatorio <= 4):
                     self.listaCeldas[num].setTextColor(QtCore.Qt.blue)
                     self.listaCeldas[num].setText(self.valores[cont])
                     self.listaCeldas[num].setDisabled(True)
                 else:
                     self.listaCeldas[num].setDisabled(False)
                     self.listaCeldas[num].setText("")
             elif(niveles == "Experto"):
                 if(aleatorio <= 3):
                     self.listaCeldas[num].setTextColor(QtCore.Qt.blue)
                     self.listaCeldas[num].setText(self.valores[cont])
                     self.listaCeldas[num].setDisabled(True)
                 else:
                     self.listaCeldas[num].setDisabled(False)
                     self.listaCeldas[num].setText("")
             self.listaCeldas[num].setAlignment(QtCore.Qt.AlignRight)
             cont += 1
     
     self.inicialtiempo()    #Reemplaza a update
开发者ID:cramirezmera,项目名称:ProyectoLenguajes2Parcial1,代码行数:53,代码来源:pySudoku.py

示例7: main

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qsrand [as 别名]
def main():    
    #QtGui.QApplication.setGraphicsSystem('raster')
    app = QtGui.QApplication(sys.argv)
    sf = QtGui.QStyleFactory()
    print list(sf.keys())
    print QtGui.qApp.style().metaObject().className()
    QtGui.qApp.setStyle(sf.create('windowsxp'))
    #QtGui.qApp.setStyle(sf.create('cleanlooks'))
    #QtGui.qApp.setStyle(sf.create('motif'))
    QtCore.qsrand(QtCore.QTime(0,0,0).secsTo(QtCore.QTime.currentTime()))
    window = PWindow.PWindow()
    window.show()

    sys.exit(app.exec_())
开发者ID:xcthulhu,项目名称:pschem,代码行数:16,代码来源:pschem.py

示例8: boundingRect

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qsrand [as 别名]
    def boundingRect(self):
        return QtCore.QRectF()

    def paint(self, painter, option, widget=None):
        pass


if __name__== '__main__':

    import sys
    import math

    app = QtGui.QApplication(sys.argv)

    QtCore.qsrand(QtCore.QTime(0, 0, 0).secsTo(QtCore.QTime.currentTime()))

    scene = QtGui.QGraphicsScene(-200, -200, 400, 400)

    for i in range(10):
        item = ColorItem()
        angle = i*6.28 / 10.0
        item.setPos(math.sin(angle)*150, math.cos(angle)*150)
        scene.addItem(item)

    robot = Robot()
    robot.scale(1.2, 1.2)
    robot.setPos(0, -20)
    scene.addItem(robot)

    view = QtGui.QGraphicsView(scene)
开发者ID:CapB1ack,项目名称:PyQt4,代码行数:32,代码来源:dragdroprobot.py


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