當前位置: 首頁>>代碼示例>>Python>>正文


Python Qt.white方法代碼示例

本文整理匯總了Python中PyQt4.QtCore.Qt.white方法的典型用法代碼示例。如果您正苦於以下問題:Python Qt.white方法的具體用法?Python Qt.white怎麽用?Python Qt.white使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt4.QtCore.Qt的用法示例。


在下文中一共展示了Qt.white方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import white [as 別名]
def __init__(self, *args):
        QWidget.__init__(self, *args)

        self._browser = QTextEdit(self)
        self._browser.setStyleSheet("font: 9pt \"Courier\";")
        self._browser.setReadOnly(True)
        self._browser.document().setDefaultStyleSheet(
            self._browser.document().defaultStyleSheet() +
            "span {white-space:pre;}")

        self._edit = _ExpandableTextEdit(self, self)
        self._edit.historyNext.connect(self._on_history_next)
        self._edit.historyPrev.connect(self._on_history_prev)
        self.setFocusProxy(self._edit)

        layout = QVBoxLayout(self)
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(self._browser)
        layout.addWidget(self._edit)

        self._history = ['']  # current empty line
        self._historyIndex = 0

        self._edit.setFocus() 
開發者ID:Denvi,項目名稱:FlatCAM,代碼行數:27,代碼來源:termwidget.py

示例2: open_proccessing

# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import white [as 別名]
def open_proccessing(self, detail=None):
        """
        Open processing and disable using shell commands  again until all commands are finished

        :param detail: text detail about what is currently called from TCL to python
        :return: None
        """

        self._edit.setTextColor(Qt.white)
        self._edit.setTextBackgroundColor(Qt.darkGreen)
        if detail is None:
            self._edit.setPlainText("...proccessing...")
        else:
            self._edit.setPlainText("...proccessing... [%s]" % detail)

        self._edit.setDisabled(True) 
開發者ID:Denvi,項目名稱:FlatCAM,代碼行數:18,代碼來源:termwidget.py

示例3: close_proccessing

# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import white [as 別名]
def close_proccessing(self):
        """
        Close processing and enable using shell commands  again
        :return:
        """

        self._edit.setTextColor(Qt.black)
        self._edit.setTextBackgroundColor(Qt.white)
        self._edit.setPlainText('')
        self._edit.setDisabled(False) 
開發者ID:Denvi,項目名稱:FlatCAM,代碼行數:12,代碼來源:termwidget.py

示例4: __init__

# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import white [as 別名]
def __init__(self):
        QMainWindow.__init__(self)
        QgsApplication.setPrefixPath("/Applications/QGIS.app/Contents/MacOS/", True)
        QgsApplication.initQgis()
        self.canvas = QgsMapCanvas()
        self.canvas.setCanvasColor(Qt.white)
        self.lyr = QgsVectorLayer("/qgis_data/ms/mississippi.shp", "Mississippi", "ogr")
        QgsMapLayerRegistry.instance().addMapLayer(self.lyr)
        self.canvas.setExtent(self.lyr.extent())
        self.canvas.setLayerSet([QgsMapCanvasLayer(self.lyr)])
        self.setCentralWidget(self.canvas)
        
        actionZoomIn = QAction("Zoom in", self)
        actionZoomOut = QAction("Zoom out", self)
        actionPan = QAction("Pan", self)
        
        actionZoomIn.setCheckable(True)
        actionZoomOut.setCheckable(True)
        actionPan.setCheckable(True)
        
        self.connect(actionZoomIn, SIGNAL("triggered()"), self.zoomIn)
        self.connect(actionZoomOut, SIGNAL("triggered()"), self.zoomOut)
        self.connect(actionPan, SIGNAL("triggered()"), self.pan)
        
        self.toolbar = self.addToolBar("Canvas actions")
        self.toolbar.addAction(actionZoomIn)
        self.toolbar.addAction(actionZoomOut)
        self.toolbar.addAction(actionPan)
        
        # create the map tools
        self.toolPan = QgsMapToolPan(self.canvas)
        self.toolPan.setAction(actionPan)
        self.toolZoomIn = QgsMapToolZoom(self.canvas, False) # false = in
        self.toolZoomIn.setAction(actionZoomIn)
        self.toolZoomOut = QgsMapToolZoom(self.canvas, True) # true = out
        self.toolZoomOut.setAction(actionZoomOut)
        
        # Button selected when the application loads:
        self.pan() 
開發者ID:PacktPublishing,項目名稱:QGIS-Python-Programming-Cookbook-Second-Edition,代碼行數:41,代碼來源:B06246_05_28-add.py

示例5: __init__

# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import white [as 別名]
def __init__(self):
        QMainWindow.__init__(self)
        QgsApplication.setPrefixPath("/Applications/QGIS.app/Contents/MacOS/", True)
        QgsApplication.initQgis()
        self.canvas = QgsMapCanvas()
        self.canvas.setCanvasColor(Qt.white)
        self.lyr = QgsVectorLayer("/qgis_data/ms/Mississippi.shp", "Mississippi", "ogr")
        QgsMapLayerRegistry.instance().addMapLayer(self.lyr)
        self.canvas.setExtent(self.lyr.extent())
        self.canvas.setLayerSet([QgsMapCanvasLayer(self.lyr)])

        self.setCentralWidget(self.canvas)
        actionZoomIn = QAction("Zoom in", self)
        actionZoomOut = QAction("Zoom out", self)
        actionPan = QAction("Pan", self)
        
        actionZoomIn.setCheckable(True)
        actionZoomOut.setCheckable(True)
        actionPan.setCheckable(True)

        self.connect(actionZoomIn, SIGNAL("triggered()"), self.zoomIn)
        self.connect(actionZoomOut, SIGNAL("triggered()"), self.zoomOut)
        self.connect(actionPan, SIGNAL("triggered()"), self.pan)
                
        self.toolbar = self.addToolBar("Canvas actions")
        self.toolbar.addAction(actionZoomIn)
        self.toolbar.addAction(actionZoomOut)
        self.toolbar.addAction(actionPan)
        
        # create the map tools
        self.toolPan = QgsMapToolPan(self.canvas)
        self.toolPan.setAction(actionPan)
        self.toolZoomIn = QgsMapToolZoom(self.canvas, False) # false = in
        self.toolZoomIn.setAction(actionZoomIn)
        self.toolZoomOut = QgsMapToolZoom(self.canvas, True) # true = out
        self.toolZoomOut.setAction(actionZoomOut)
        self.statusBar().showMessage(u"x: --, y: --")

        # Button selected when the application loads:
        self.pan() 
開發者ID:PacktPublishing,項目名稱:QGIS-Python-Programming-Cookbook-Second-Edition,代碼行數:42,代碼來源:B06246_05_32-coord.py

示例6: __init__

# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import white [as 別名]
def __init__(self): 
        self.qt = QTabWidget()
        self.qt.setGeometry(window_x, window_y, window_width, window_height)
        self.pal=QPalette()
        self.pal.setColor(QPalette.Background,Qt.white)
        self.pal.setColor(QPalette.Foreground,Qt.black)
        self.qt.setPalette(self.pal)
    
        self.tab1 = QWidget()
        self.DetailsTab=AddDetailsTab(self.tab1)
        self.qt.addTab(self.DetailsTab,"Create User")
    
        self.tab2 = QWidget()
        self.DatasetTab=GenerateDatasetTab(self.tab2)
        self.qt.addTab(self.DatasetTab,"Generate Face Dataset")

        self.tab3 = QWidget()
        self.StockTab=AddStocksTab(self.tab3)
        self.qt.addTab(self.StockTab,"Add Stocks")

        self.tab4 = QWidget()
        self.EventsTab=AddEventsTab(self.tab3)
        self.qt.addTab(self.EventsTab,"Create Event")

        self.qt.show()
        self.qt.setStyleSheet("#gframe {border-radius:5px;border:1px solid #a5a5a5}") 
開發者ID:aishmittal,項目名稱:Smart-Mirror,代碼行數:28,代碼來源:register.py

示例7: round

# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import white [as 別名]
def round(self):
        bmp = QBitmap(self.size())
        p = QPainter()
        p.begin(bmp)
        p.fillRect(bmp.rect(), Qt.white)
        p.setBrush(QColor(0,0,0))
        p.drawRoundedRect(bmp.rect(), 5, 5)
        p.setPen(QColor(255,255,255,255))
        p.drawPoints(QPointF(self.width()-2,self.height()-1), QPointF(self.width()-1,self.height()-2))
        p.setPen(QColor(0,0,0))
        p.drawPoints(QPointF(0,2),QPointF(3,0),QPointF(2,0),QPointF(1,1))
        p.end()
        self.setMask(bmp) 
開發者ID:l7dpi,項目名稱:openQPA,代碼行數:15,代碼來源:RoundWindow.py

示例8: paintEvent

# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import white [as 別名]
def paintEvent(self, event):
        path = QPainterPath()
        start_y = self.label_height
        #path.moveTo(85, self.label_height)
        #path.moveTo(85, 400-self.label_height)

        #defined_points = [p for p in self.points if not p['value'] == -1]

        #if len(defined_points)>2:
        for i, p in enumerate(self.data):
            y = (350./ (self.number_of_ticks)) * i + start_y
            if i == 0:
                path.moveTo((p * 20.) + 85, y)
            else:
                path.lineTo((p * 20.) + 85, y)

            #path.cubicTo((defined_points[0]['detail'] * 10.) + 85, self.label_height,
            #            (defined_points[1]['detail'] * 10.) + 85, 200,
            #            (defined_points[2]['detail'] * 10.) + 85, 400-self.label_height)
        #else:
            #print("Count of height for point: " + str((((self.max-self.min)/self.number_of_ticks) * defined_points[0]['value'])))
        #    path.lineTo((defined_points[0]['detail']*10.)+85, self.label_height)
        #    path.lineTo((defined_points[1]['detail']*10.)+85, 350+self.label_height)

        #path.lineTo(100, 100)
        #path.lineTo(150, 150)
        #path.cubicTo(50, 50, 50, 50, 80, 80)
        #path.cubicTo(80, 80, 50, 50, 80, 80)
        pen01 = QPen(Qt.white)
        pen01.setWidthF(2.0)
        pen02 = QPen(Qt.green)
        pen03 = QPen(Qt.red)
        pen02.setWidthF(2.5)

        qp = QPainter()
        qp.begin(self)
        qp.setRenderHint(QPainter.Antialiasing)
        #grid
        qp.setPen(pen01)
        qp.drawLine(20, self.label_height, 160, self.label_height)
        qp.drawLine(20, self.label_height + 350, 160, 350 + self.label_height)
        qp.drawLine(20, self.label_height, 20, 350 + self.label_height)
        qp.drawLine(160, self.label_height, 160, 350 + self.label_height)

        #path
        qp.setPen(pen02)
        qp.drawPath(path)


        qp.end() 
開發者ID:prusa3d,項目名稱:PrusaControl,代碼行數:52,代碼來源:gui.py

示例9: __init__

# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import white [as 別名]
def __init__(self):
        QMainWindow.__init__(self)
        QgsApplication.setPrefixPath("/Applications/QGIS.app/Contents/MacOS/", True)
        QgsApplication.initQgis()
        self.canvas = QgsMapCanvas()
        self.canvas.setCanvasColor(Qt.white)
        self.lyr = QgsVectorLayer("/qgis_data/nyc/NYC_MUSEUMS_GEO.shp", "Mississippi", "ogr")
        QgsMapLayerRegistry.instance().addMapLayer(self.lyr)
        self.canvas.setExtent(self.lyr.extent())
        self.canvas.setLayerSet([QgsMapCanvasLayer(self.lyr)])
        
        self.setCentralWidget(self.canvas)
        actionZoomIn = QAction("Zoom in", self)
        actionZoomOut = QAction("Zoom out", self)
        actionPan = QAction("Pan", self)
        actionSelect = QAction("Select", self)
        
        actionZoomIn.setCheckable(True)
        actionZoomOut.setCheckable(True)
        actionPan.setCheckable(True)
        actionSelect.setCheckable(True)
        
        self.connect(actionZoomIn, SIGNAL("triggered()"), self.zoomIn)
        self.connect(actionZoomOut, SIGNAL("triggered()"), self.zoomOut)
        self.connect(actionPan, SIGNAL("triggered()"), self.pan)
        self.connect(actionSelect, SIGNAL("triggered()"), self.select)
                
        self.toolbar = self.addToolBar("Canvas actions")
        self.toolbar.addAction(actionZoomIn)
        self.toolbar.addAction(actionZoomOut)
        self.toolbar.addAction(actionPan)
        self.toolbar.addAction(actionSelect)
        
        # create the map tools
        self.toolPan = QgsMapToolPan(self.canvas)
        self.toolPan.setAction(actionPan)
        self.toolZoomIn = QgsMapToolZoom(self.canvas, False) # false = in
        self.toolZoomIn.setAction(actionZoomIn)
        self.toolZoomOut = QgsMapToolZoom(self.canvas, True) # true = out
        self.toolZoomOut.setAction(actionZoomOut)
        self.toolSelect = SelectMapTool(self.canvas, self.lyr) 
        self.toolSelect.setAction(actionSelect)
                
        self.select() 
開發者ID:PacktPublishing,項目名稱:QGIS-Python-Programming-Cookbook-Second-Edition,代碼行數:46,代碼來源:B06246_05_31-select.py

示例10: __init__

# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import white [as 別名]
def __init__(self):
        QMainWindow.__init__(self)
        QgsApplication.setPrefixPath("/Applications/QGIS.app/Contents/MacOS/", True)
        QgsApplication.initQgis()
        self.canvas = QgsMapCanvas()
        self.canvas.setCanvasColor(Qt.white)
        self.lyr = QgsVectorLayer("/qgis_data/ms/mississippi.shp", "Mississippi", "ogr")
        QgsMapLayerRegistry.instance().addMapLayer(self.lyr)
        self.canvas.setExtent(self.lyr.extent())
        self.canvas.setLayerSet([QgsMapCanvasLayer(self.lyr)])
        
        self.setCentralWidget(self.canvas)
        actionZoomIn = QAction("Zoom in", self)
        actionZoomOut = QAction("Zoom out", self)
        actionPan = QAction("Pan", self)
        actionPoly = QAction("Polygon", self)
        
        actionZoomIn.setCheckable(True)
        actionZoomOut.setCheckable(True)
        actionPan.setCheckable(True)
        actionPoly.setCheckable(True)
        
        self.connect(actionZoomIn, SIGNAL("triggered()"), self.zoomIn)
        self.connect(actionZoomOut, SIGNAL("triggered()"), self.zoomOut)
        self.connect(actionPan, SIGNAL("triggered()"), self.pan)
        self.connect(actionPoly, SIGNAL("triggered()"), self.poly)
                
        self.toolbar = self.addToolBar("Canvas actions")
        self.toolbar.addAction(actionZoomIn)
        self.toolbar.addAction(actionZoomOut)
        self.toolbar.addAction(actionPan)
        self.toolbar.addAction(actionPoly)
        
        # create the map tools
        self.toolPan = QgsMapToolPan(self.canvas)
        self.toolPan.setAction(actionPan)
        self.toolZoomIn = QgsMapToolZoom(self.canvas, False) # false = in
        self.toolZoomIn.setAction(actionZoomIn)
        self.toolZoomOut = QgsMapToolZoom(self.canvas, True) # true = out
        self.toolZoomOut.setAction(actionZoomOut)
        self.toolPoly = PolyMapTool(self.canvas) 
        self.toolPoly.setAction(actionPoly)
                
        self.poly() 
開發者ID:PacktPublishing,項目名稱:QGIS-Python-Programming-Cookbook-Second-Edition,代碼行數:46,代碼來源:B06246_05_30-poly.py

示例11: __init__

# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import white [as 別名]
def __init__(self):
        QMainWindow.__init__(self)
        QgsApplication.setPrefixPath("/Applications/QGIS.app/Contents/MacOS/", True)
        QgsApplication.initQgis()
        self.canvas = QgsMapCanvas()
        self.canvas.setCanvasColor(Qt.white)
        self.lyr = QgsVectorLayer("/qgis_data/ms/mississippi.shp", "Mississippi", "ogr")
        QgsMapLayerRegistry.instance().addMapLayer(self.lyr)
        self.canvas.setExtent(self.lyr.extent())
        self.canvas.setLayerSet([QgsMapCanvasLayer(self.lyr)])
        
        self.setCentralWidget(self.canvas)
        actionZoomIn = QAction("Zoom in", self)
        actionZoomOut = QAction("Zoom out", self)
        actionPan = QAction("Pan", self)
        actionPoint = QAction("Point", self)
        
        actionZoomIn.setCheckable(True)
        actionZoomOut.setCheckable(True)
        actionPan.setCheckable(True)
        actionPoint.setCheckable(True)
        
        self.connect(actionZoomIn, SIGNAL("triggered()"), self.zoomIn)
        self.connect(actionZoomOut, SIGNAL("triggered()"), self.zoomOut)
        self.connect(actionPan, SIGNAL("triggered()"), self.pan)
        self.connect(actionPoint, SIGNAL("triggered()"), self.point)
                
        self.toolbar = self.addToolBar("Canvas actions")
        self.toolbar.addAction(actionZoomIn)
        self.toolbar.addAction(actionZoomOut)
        self.toolbar.addAction(actionPan)
        self.toolbar.addAction(actionPoint)
        
        # create the map tools
        self.toolPan = QgsMapToolPan(self.canvas)
        self.toolPan.setAction(actionPan)
        self.toolZoomIn = QgsMapToolZoom(self.canvas, False) # false = in
        self.toolZoomIn.setAction(actionZoomIn)
        self.toolZoomOut = QgsMapToolZoom(self.canvas, True) # true = out
        self.toolZoomOut.setAction(actionZoomOut)
        self.toolPoint = PointMapTool(self.canvas) 
        self.toolPoint.setAction(actionPoint)
                
        self.point() 
開發者ID:PacktPublishing,項目名稱:QGIS-Python-Programming-Cookbook-Second-Edition,代碼行數:46,代碼來源:B06246_05_29-point.py


注:本文中的PyQt4.QtCore.Qt.white方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。