python类QColor()的实例源码

design.py 文件源码 项目:TWTools 作者: ZeX2 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def setupUi(self):
        """Bruh"""
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.setGeometry(50, 50, 600, 300)
        self.setWindowTitle("ZeZe's TWTools - Backtiming Calculator")
        self.setWindowIcon(QtGui.QIcon(resource_path("images/icon.png")))

        """Background color"""
        self.backgroundPalette = QtGui.QPalette()
        self.backgroundColor = QtGui.QColor(217, 204, 170)
        self.backgroundPalette.setColor(
            QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(self.backgroundPalette)

        """Main layout & return to main menu button"""
        self.verticalLayout = QtGui.QVBoxLayout(self)

        self.buttonLayout = QtGui.QHBoxLayout(self)
        self.verticalLayout.addLayout(self.buttonLayout)
        self.returnButton = QtGui.QPushButton("  Return to the Main Menu  ", self)
        self.returnButton.clicked.connect(self.return_function)
        self.buttonLayout.addWidget(self.returnButton)
        self.buttonSpacer = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.buttonLayout.addItem(self.buttonSpacer)
ToDoList.py 文件源码 项目:CyclopsVFX-Unity 作者: geoffroygivry 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def paintEvent(self, event):
        painter = QtGui.QPainter(self)
        painter.setRenderHint(QtGui.QPainter.Antialiasing)
        parent = self.parentWidget()

        pieRect = QtCore.QRect(1, 1, self.width()-2, self.height()-2)
        startAngle = 0 * 16

        if self.currentIndex() == 0:
            # STATUS = WAITING
            painter.drawEllipse(pieRect)
        elif self.currentIndex() == 1:
            # STATUS = IN PROGGRESS
            painter.setPen(QtGui.QColor(0,0,0,0))
            painter.setBrush(QtGui.QColor(255, 140, 30))
            startAngle = 90 * 16
            spanAngle = self.currentIndex() * 270 * 16
            painter.drawPie(pieRect, startAngle, spanAngle)
        elif self.currentIndex() == 2:
            # STATUS = FINISHED
            painter.setPen(QtGui.QColor(0,0,0,0))
            painter.setBrush(QtGui.QColor('darkGreen'))
            spanAngle = self.currentIndex() * 360 * 16
            painter.drawPie(pieRect, startAngle, spanAngle)
timeline_widget.py 文件源码 项目:OpenTimelineIO 作者: PixarAnimationStudios 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __init__(self, item, timeline_range, *args, **kwargs):
        super(_BaseItem, self).__init__(*args, **kwargs)
        self.item = item
        self.timeline_range = timeline_range

        self.setFlags(QtGui.QGraphicsItem.ItemIsSelectable)
        self.setBrush(
            QtGui.QBrush(QtGui.QColor(180, 180, 180, 255))
        )

        self.source_in_label = QtGui.QGraphicsSimpleTextItem(self)
        self.source_out_label = QtGui.QGraphicsSimpleTextItem(self)
        self.source_name_label = QtGui.QGraphicsSimpleTextItem(self)

        self._add_markers()
        self._set_labels()
correlation_table.py 文件源码 项目:BrainModulyzer 作者: sugeerth 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def ChangeColors(self):
        """
        Clustered Order is the sorted order of different brain regions based on the communities detected   

        """
        self.sortDataStructure(self.Order,self.Brain_Regions)


        self.setVerticalHeaderLabels(self.ClusteredOrder)
        self.setHorizontalHeaderLabels(['\n'.join(name) for name in self.ClusteredOrder])


        for i in range(len(self.correlationTable.header)):
                for j in range(len(self.correlationTable.header)):

                    table_item = self.item(i,j)

                    t = self.ColorNumpyArray[self.sortedOrder[i],self.sortedOrder[j]]
                    table_item.setBackground(QtGui.QColor(*t))
                    table_item.setToolTip("%s,%s,%g" % (self.Brain_Regions[self.sortedOrder[i]] ,self.Brain_Regions[self.sortedOrder[j]],self.correlationTable.data[self.sortedOrder[i], self.sortedOrder[j]]))

        self.verticalHeader()
        self.horizontalHeader()
exception.py 文件源码 项目:smhr 作者: andycasey 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def format(color, style=None):
    """
    Return a QTextCharFormat with the given attributes.

    :param color:
        The color to format the text.

    :param style: [optional]
        The styling for the text.

    """
    _color = QtGui.QColor()
    _color.setNamedColor(color)

    _format = QtGui.QTextCharFormat()
    _format.setForeground(_color)
    if style is not None and 'bold' in style:
        _format.setFontWeight(QtGui.QFont.Bold)
    if style is not None and 'italic' in style:
        _format.setFontItalic(True)

    return _format


# Syntax styles that can be shared by all languages
menu.py 文件源码 项目:HearthPacks 作者: Arzaroth 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def paintEvent(self, event):
        painter = QPainter()
        painter.begin(self)
        painter.setRenderHint(QPainter.Antialiasing)
        painter.fillRect(event.rect(), QBrush(QColor(127, 127, 127, 127)))
        painter.setPen(QPen(Qt.NoPen))

        for i in range(6):
            if int(self.counter / 10) % 6 == i:
                factor = self.counter % 10
                if factor >= 5:
                    factor = 5 - (self.counter % 5)
                painter.setBrush(QBrush(QColor(95 + factor * 32, 127, 127)))
            else:
                painter.setBrush(QBrush(QColor(127, 127, 127)))
            painter.drawEllipse(
                self.width() / 2 + 30 * math.cos(2 * math.pi * i / 6.0) - 10,
                self.height() / 2 + 30 * math.sin(2 * math.pi * i / 6.0) - 10,
                20, 20)

        painter.end()
CommunitiesAcrossTimeStep.py 文件源码 项目:ECoG-ClusterFlow 作者: sugeerth 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def CreateTrackingNodes(self, partitionValues):
        i = 0
        self.counter = self.counter+1
        self.presentNodeObjects = []
        sceneRect = self.sceneRect()

        # Create the nodes which are rated in the way that it is organized
        # Just create one layer of the nodes here!! for now

        for communities, sub_communities in partitionValues.items():
            i = i + 1
            node_value=CommunityGraphNode(self,communities, sub_communities)
            node_value.setPos(sceneRect.left() + self.variableWidth*100, i*40)
            self.presentNodeObjects.append(node_value)
            self.scene.addItem(node_value)

        if self.first:
            value = len(partitionValues.values())
            self.first = False #*
            self.NewCommunitiesToBeAssigned = []
            self.NewCommunitiesToBeAssigned = deque([j for i,j in enumerate(self.distinguishableColors) if i > (13)])
            for i in self.presentNodeObjects:
                color = self.NewCommunitiesToBeAssigned.popleft()
                colorNew = QtGui.QColor(color[0],color[1],color[2])
                i.PutColor(colorNew)
correlation_table.py 文件源码 项目:ECoG-ClusterFlow 作者: sugeerth 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def ChangeColors(self):
        """
        Clustered Order is the sorted order of different brain regions based on the communities detected   

        """
        self.sortDataStructure(self.Order,self.Brain_Regions)


        self.setVerticalHeaderLabels(self.ClusteredOrder)
        self.setHorizontalHeaderLabels(['\n'.join(name) for name in self.ClusteredOrder])


        for i in range(len(self.correlationTable.header)):
                for j in range(len(self.correlationTable.header)):

                    table_item = self.item(i,j)

                    t = self.ColorNumpyArray[self.sortedOrder[i],self.sortedOrder[j]]
                    table_item.setBackground(QtGui.QColor(*t))
                    table_item.setToolTip("%s,%s,%g" % (self.Brain_Regions[self.sortedOrder[i]] ,self.Brain_Regions[self.sortedOrder[j]],self.correlationTable.data[self.sortedOrder[i], self.sortedOrder[j]]))

        self.verticalHeader()
        self.horizontalHeader()
correlation_table.py 文件源码 项目:ECoG-ClusterFlow 作者: sugeerth 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def ChangeColors(self):
        """
        Clustered Order is the sorted order of different brain regions based on the communities detected   
        """
        """Calling the Parent Method for Sorting the cells"""
        self.sortDataStructure(self.Order,self.Brain_Regions)

        """Sorting the header labels vertical and horizontalHeader"""
        self.setVerticalHeaderLabels(self.ClusteredOrder)
        self.setHorizontalHeaderLabels(['\n'.join(name) for name in self.ClusteredOrder])
        for i in range(len(self.correlationTable.header)):
            for j in range(len(self.correlationTable.header)):
                table_item = self.item(i,j)
                if (self.GraphDataStructure().ThresholdData[self.sortedOrder[i]][self.sortedOrder[j]] != 0) and self.sortedValues[i] == self.sortedValues[j]:
                    table_item.setBackground(QtGui.QColor(*self.colors[self.sortedOrder[i]]))
                else:
                    table_item.setBackground(QtGui.QColor(QtCore.Qt.white))
                table_item.setToolTip("%s,%s,%g" % (self.Brain_Regions[self.sortedOrder[i]] ,self.Brain_Regions[self.sortedOrder[j]],self.correlationTable.data[self.sortedOrder[i], self.sortedOrder[j]]))

        self.verticalHeader()
        self.horizontalHeader()
ElectrodeNode.py 文件源码 项目:ECoG-ClusterFlow 作者: sugeerth 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def PutColor(self,colorvalue, alphaValue = 255, AlphaDraw = False):
        self.colorvalue = colorvalue

        if self.Glyph:
            self.ColorQ.append(self.CommunityColor)
        self.CommunityColor = QtGui.QColor(colorvalue)

        # set the graph nodes to the transparent
        if alphaValue == None:
            self.CommunityColor.setAlpha(0) 
            self.opacity = 0
        elif not(alphaValue==-1):
            if AlphaDraw: 
                self.CommunityColor.setAlpha(alphaValue)
            else:
                self.CommunityColor.setAlpha(255)

        self.opacity = alphaValue

        self.NodeCommunityColor = True
        self.update()
app.py 文件源码 项目:shortcircuit 作者: farshield 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def add_data_to_table(self, route):
        self.tableWidget_path.setRowCount(len(route))
        for i, row in enumerate(route):
            for j, col in enumerate(row):
                item = QtGui.QTableWidgetItem("{}".format(col))
                self.tableWidget_path.setItem(i, j, item)

                if j in [1, 2]:
                    self.tableWidget_path.item(i, j).setTextAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)

                if row[1] == "HS":
                    color = QtGui.QColor(223, 240, 216)
                elif row[1] == "LS":
                    color = QtGui.QColor(252, 248, 227)
                elif row[1] == "NS":
                    color = QtGui.QColor(242, 222, 222)
                else:
                    color = QtGui.QColor(210, 226, 242)

                if j == 3 and "wormhole" in col:
                    self.tableWidget_path.item(i, j).setIcon(self.icon_wormhole)
                self.tableWidget_path.item(i, j).setBackground(color)
                self.tableWidget_path.item(i, j).setForeground(QtGui.QColor(0, 0, 0))
catalogcomponent.py 文件源码 项目:freecad-pyoptools 作者: cihologramas 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def catalogChange(self,*args):

        while self.form.Reference.count():
            self.form.Reference.removeItem(0)

        for reference in self.form.Catalog.itemData(args[0]):
            red = QtGui.QPixmap(16, 16)
            red.fill(QtGui.QColor("red"))
            green = QtGui.QPixmap(16, 16)
            green.fill(QtGui.QColor("green"))

            if self.is_available(self.form.Catalog.currentText(),reference):
                color = green
            else:
                color = red

            self.form.Reference.addItem(color,reference)
            #item.setStyleSheet("color: green")
bar_widget.py 文件源码 项目:tdoa 作者: xiongyihui 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def drawBars(self, painter):
        size = self.size()
        width = size.width()
        height = size.height()

        bar_width = float(width - self.padding) / self.bars_number

        color = QtGui.QColor(0, 0, 0)
        painter.setPen(color)
        painter.setBrush(color)
        painter.drawRect(0, 0, width, height)
        for bar, value in enumerate(self.bars):
            bar_height = (height - self.padding) * value / self.resolution
            if not bar_height:
                bar_height = 1
            painter.setBrush(self.barColor(bar))
            painter.drawRect(
                bar * bar_width + self.padding,
                height - bar_height,
                bar_width - self.padding,
                bar_height - self.padding)
ToDoList.py 文件源码 项目:nuke 作者: Kagarrache 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def paintEvent(self, event):
        painter = QtGui.QPainter(self)
        painter.setRenderHint(QtGui.QPainter.Antialiasing)
        parent = self.parentWidget()

        pieRect = QtCore.QRect(1, 1, self.width()-2, self.height()-2)
        startAngle = 0 * 16

        if self.currentIndex() == 0:
            # STATUS = WAITING
            painter.drawEllipse(pieRect)
        elif self.currentIndex() == 1:
            # STATUS = IN PROGGRESS
            painter.setPen(QtGui.QColor(0,0,0,0))
            painter.setBrush(QtGui.QColor(255, 140, 30))
            startAngle = 90 * 16
            spanAngle = self.currentIndex() * 270 * 16
            painter.drawPie(pieRect, startAngle, spanAngle)
        elif self.currentIndex() == 2:
            # STATUS = FINISHED
            painter.setPen(QtGui.QColor(0,0,0,0))
            painter.setBrush(QtGui.QColor('darkGreen'))
            spanAngle = self.currentIndex() * 360 * 16
            painter.drawPie(pieRect, startAngle, spanAngle)
facedraw.py 文件源码 项目:freecad-nurbs 作者: microelly2 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def createnewwire(widget):
    '''new wire for next drawing'''

    ef=widget.ef

    w=App.ActiveDocument.addObject("Part::Feature","A Drawing on " + ef.objname + ": "+ ef.subelement +"#")
    w.Shape=Part.Shape()
    wam=App.ActiveDocument.addObject("Part::Feature","YY Drawing on " + ef.objname + ": "+ ef.subelement +"#")
    wam.Shape=Part.Shape()

    if 10:
        c=PySide.QtGui.QColorDialog.getColor(QtGui.QColor(random.randint(10,255),random.randint(10,255),random.randint(10,255)))
        w.ViewObject.LineColor=(1.0/255*c.red(),1.0/255*c.green(),1.0/255*c.blue())
        w.ViewObject.PointColor=(1.0/255*c.red(),1.0/255*c.green(),1.0/255*c.blue())
    else:
        w.ViewObject.LineColor=(random.random(),random.random(),random.random())

    ef.wire=w
    ef.wirem=wam
    ef.pts=[]



## dialog fpr facedrwaing options
minxss_beacon_decoder.py 文件源码 项目:MinXSS_Beacon_Decoder 作者: jmason86 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def stopRead(self):
        """
        Purpose:
            Respond to disconnect button being clicked -- disconnect from the port, be it serial or socket
        Input:
            None
        Output:
            None
        """
        self.connectedPort.close()

        # Update GUI
        self.label_serialStatus.setText(QtGui.QApplication.translate("MainWindow", "Port closed", None, QtGui.QApplication.UnicodeUTF8))
        palette = QtGui.QPalette()
        palette.setColor(QtGui.QPalette.Foreground, QColor(242, 86, 77))  # Red
        self.label_serialStatus.setPalette(palette)
minxss_beacon_decoder.py 文件源码 项目:MinXSS_Beacon_Decoder 作者: jmason86 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def saveLogToggled(self):
        """
        Purpose:
            Respond to the user toggling the save log button (create a new output data log as appropriate)
        Input:
            None
        Output:
            Creates a log file on disk if toggling on
        """
        if self.checkBox_saveLog.isChecked():
            self.setupOutputLog()
        else:
            # Update the GUI for the log file - not saving
            self.textBrowser_savingToLogFile.setText("Not saving to log file")
            palette = QtGui.QPalette()
            palette.setColor(QtGui.QPalette.Text, QColor(242, 86, 77))  # Red
            self.textBrowser_savingToLogFile.setPalette(palette)
importManager.py 文件源码 项目:nukeScripts 作者: mlavoy 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def compareFiles(self,*args):
        color=QtGui.QColor(255,0,0)
        it = QtGui.QTreeWidgetItemIterator(self.publishesTree)
        for i in it:
            if i.value().childCount()==0:
                serverPath=self.convertTreePathToServerPath(self.getTreePathFromItem(i.value()))
                localPath=serverPath.replace("P:",self.localDrive)
                frames=[]
                if os.path.exists(localPath):
                    for file in os.listdir(localPath+'/exr'):
                        if os.path.isfile(localPath+'/exr/'+file):
                            print file
                            frames.append(str(int(file.split(".")[1])))
                    frames.sort()
                    i.value().setForeground(0,color)
                    i.value().setText(2,",".join(frames))
main_max.py 文件源码 项目:TACTIC-Handler 作者: listyque 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def setPaletteFromDct(dct):
    palette = QtGui.QPalette()
    for role in roles:
        for group in groups:
            color = QtGui.QColor(dct['%s:%s' % (role, group)])
            qGrp = getattr(QtGui.QPalette, group)
            qRl = getattr(QtGui.QPalette, role)
            palette.setColor(qGrp, qRl, color)
    QtGui.QApplication.setPalette(palette)
design.py 文件源码 项目:TWTools 作者: ZeX2 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def setupUi(self):
        """Bruh"""
        self.setGeometry(50, 50, 450, 250)
        self.setWindowTitle("ZeZe's TWTools - Updating Servers")
        self.setWindowIcon(QtGui.QIcon(resource_path("images/icon.png")))

        """Background color"""
        self.backgroundPalette = QtGui.QPalette()
        self.backgroundColor = QtGui.QColor(217, 204, 170)
        self.backgroundPalette.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(self.backgroundPalette)

        """Layout"""
        self.verticalLayout = QtGui.QVBoxLayout(self)

        self.text = QtGui.QLabel("Updating server list:")
        self.verticalLayout.addWidget(self.text)

        """Download bar"""
        self.progress_bar = QtGui.QProgressBar(self)
        self.progress_bar.setMinimum(0)
        self.progress_bar.setMaximum(27)
        self.progress_bar.setValue(0)
        self.progress_bar.setFormat("%v / %m")
        self.verticalLayout.addWidget(self.progress_bar)

        """Text browser for progress"""
        self.progress_text = QtGui.QTextBrowser(self)
        self.verticalLayout.addWidget(self.progress_text)

        """Button"""
        self.horizontalLayout = QtGui.QHBoxLayout(self)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.Spacer = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(self.Spacer)

        self.cancelButton = QtGui.QPushButton("Cancel")
        self.horizontalLayout.addWidget(self.cancelButton)
        self.cancelButton.clicked.connect(self.cancel_function)
KicadSolderTool.py 文件源码 项目:KicadSolderTool 作者: pioupus 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def set_marker(self,point, bot):
        scene_point = point
        if self.marker_set:
            self.scene.removeItem(self.marker_ellipse)
            self.scene.removeItem(self.marker_line_h)
            self.scene.removeItem(self.marker_line_v)

        color = QtGui.QColor()
        if bot:
            color = QtGui.QColor(QtCore.Qt.red)
        else:
            color = QtGui.QColor(QtCore.Qt.darkGreen)
        color.setAlpha(100)
        pen = QtGui.QPen()
        pen.setWidth(2)
        pen.setColor(color)
        self.marker_ellipse = self.scene.addEllipse(scene_point.x()-10,scene_point.y()-10,20,20,pen);
        self.marker_line_h = self.scene.addLine(scene_point.x()-10,scene_point.y(),scene_point.x()+10,scene_point.y(),pen);
        self.marker_line_v = self.scene.addLine(scene_point.x(),scene_point.y()-10,scene_point.x(),scene_point.y()+10,pen);
        self.marker_set = True
        if bot:
            self.svg_item_bot.setVisible(True)
            self.svg_item_top.setVisible(False)
            if not self.is_flipped:
                self.scale(-1,1)
                self.is_flipped = True
        else:
            self.svg_item_bot.setVisible(False)
            self.svg_item_top.setVisible(True)
            if self.is_flipped:
                self.scale(-1,1)   
                self.is_flipped = False
GDT.py 文件源码 项目:FreeCAD-GDT 作者: juanvanyo 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def getRGB(param):
    color = QtGui.QColor(getParam(param,16753920)>>8)
    r = float(color.red()/255.0)
    g = float(color.green()/255.0)
    b = float(color.blue()/255.0)
    col = (r,g,b,0.0)
    return col
ToDoList.py 文件源码 项目:CyclopsVFX-Unity 作者: geoffroygivry 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def paintEvent(self, event):
        '''Paint the button grey if not highlighted, else yellow'''

        painter = QtGui.QPainter(self)
        colour = QtGui.QColor(247, 147, 30, 150)
        gradient = QtGui.QLinearGradient(QtCore.QPoint(0,0), QtCore.QPoint(self.width()/2, 0))
        gradient.setColorAt(0, QtCore.Qt.transparent)
        gradient.setColorAt(1, colour)
        gradient.setSpread(QtGui.QGradient.ReflectSpread)
        painter.setBrush(QtGui.QBrush(gradient))
        painter.setPen(QtCore.Qt.transparent)
        rect = QtCore.QRect(0,0,self.width(),self.height())
        painter.drawRect(rect)
ToDoList.py 文件源码 项目:CyclopsVFX-Unity 作者: geoffroygivry 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super(PriorityWidget, self).__init__(parent)
        self.color = QtGui.QColor(247, 147, 30, 255)
        self.font = QtGui.QFont('Helvetica', 12, QtGui.QFont.Bold)
        self.setToolTip('<b>priority</b><br>use either:<ul><li>LMB to increase  -  RMB to decrease</li><li>alt+LMB drag to change value</li><li>MMB drag to change value</li></ul><i>move mouse away after changing value<br>to trigger re-sorting</i>')
        self.active = False
        self.mouseOver = False
        self.value = 0
        self.allowDrag = False
        self.setFocusPolicy(QtCore.Qt.TabFocus)
        self.indicator = DragIndicator(self)
        self.indicator.setVisible(False)
        self.indicator.move(0, 15)
ToDoList.py 文件源码 项目:CyclopsVFX-Unity 作者: geoffroygivry 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super(StatusWidgetBar, self).__init__(parent)
        self.setToolTip('<b>status</b><br>click to edit')
        self.addItems(['waiting', 'in progress', 'finished'])
        self.active = False
        self.colWaiting = QtGui.QColor(180, 100, 10)
        self.colInProgress = QtGui.QColor(255, 140, 30)
        self.colFinished = QtGui.QColor('darkGreen')
ToDoList.py 文件源码 项目:CyclopsVFX-Unity 作者: geoffroygivry 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super(DeleteWidget, self).__init__(parent)
        self.size = QtCore.QSize(20, 20)
        self.setSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
        self.setToolTip('permanently delete this task')
        self.padding = 7
        self.active = False
        self.inactiveColor = QtGui.QColor(180, 50, 0)
        self.activeColor = self.inactiveColor.lighter()
timeline_widget.py 文件源码 项目:OpenTimelineIO 作者: PixarAnimationStudios 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def itemChange(self, change, value):
        if change == QtGui.QGraphicsItem.ItemSelectedHasChanged:
            self.setPen(
                QtGui.QColor(0, 255, 0, 255) if self.isSelected()
                else QtGui.QColor(0, 0, 0, 255)
            )
            self.setZValue(
                self.zValue() + 1 if self.isSelected() else self.zValue() - 1
            )

        return super(_BaseItem, self).itemChange(change, value)
timeline_widget.py 文件源码 项目:OpenTimelineIO 作者: PixarAnimationStudios 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def __init__(self, *args, **kwargs):
        super(GapItem, self).__init__(*args, **kwargs)
        self.setBrush(
            QtGui.QBrush(QtGui.QColor(100, 100, 100, 255))
        )
        self.source_name_label.setText('GAP')
timeline_widget.py 文件源码 项目:OpenTimelineIO 作者: PixarAnimationStudios 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def __init__(self, item, timeline_range, rect, *args, **kwargs):
        rect.setHeight(TRANSITION_HEIGHT)
        super(TransitionItem, self).__init__(
            item,
            timeline_range,
            rect,
            *args,
            **kwargs
        )
        self.setBrush(
            QtGui.QBrush(QtGui.QColor(237, 228, 148, 255))
        )
        self.setY(TRACK_HEIGHT - TRANSITION_HEIGHT)
        self.setZValue(2)

        # add extra bit of shading
        shading_poly_f = QtGui.QPolygonF()
        shading_poly_f.append(QtCore.QPointF(0, 0))
        shading_poly_f.append(QtCore.QPointF(rect.width(), 0))
        shading_poly_f.append(QtCore.QPointF(0, rect.height()))

        shading_poly = QtGui.QGraphicsPolygonItem(shading_poly_f, parent=self)
        shading_poly.setBrush(QtGui.QBrush(QtGui.QColor(0, 0, 0, 30)))

        try:
            shading_poly.setPen(QtCore.Qt.NoPen)
        except TypeError:
            shading_poly.setPen(QtCore.Qt.transparent)
timeline_widget.py 文件源码 项目:OpenTimelineIO 作者: PixarAnimationStudios 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def __init__(self, *args, **kwargs):
        super(ClipItem, self).__init__(*args, **kwargs)
        self.setBrush(QtGui.QBrush(QtGui.QColor(168, 197, 255, 255)))
        self.source_name_label.setText(self.item.name)


问题


面经


文章

微信
公众号

扫码关注公众号