本文整理汇总了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()
示例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)
示例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)
示例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}")
示例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)
示例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()
示例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