本文整理汇总了Python中qgis.PyQt.QtWidgets.QWidget方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QWidget方法的具体用法?Python QtWidgets.QWidget怎么用?Python QtWidgets.QWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qgis.PyQt.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QWidget方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from qgis.PyQt import QtWidgets [as 别名]
# 或者: from qgis.PyQt.QtWidgets import QWidget [as 别名]
def __init__(self, parent=None):
"""
Class constructor.
:param: (QWidget) widget parent to new DatabaseFileLineEdit instance.
"""
super(DatabaseFileLineEdit, self).__init__(parent)
self.setupUi(self)
self.parent = parent
self.driver = DsgEnums.NoDriver
self.abstractDb = None
self.abstractDbFactory = DbFactory()
self.serverAbstractDb = None
self.displayDict = {'2.1.3':'EDGV 2.1.3', '2.1.3 Pro':'EDGV 2.1.3 Pro', 'FTer_2a_Ed':'EDGV FTer 2a Ed', 'Non_EDGV':self.tr('Other database model'), '3.0':'EDGV 3.0'}
self.instantiateAbstractDb = False
self.connectionSelectorLineEdit.lineEdit.setText(self.tr('Select datasource'))
self.connectionSelectorLineEdit.lineEdit.setReadOnly(True)
示例2: __init__
# 需要导入模块: from qgis.PyQt import QtWidgets [as 别名]
# 或者: from qgis.PyQt.QtWidgets import QWidget [as 别名]
def __init__(self, parent=None, isStatic=False):
"""
Class constructor.
:param parent: (QWidget) widget parent to newly instantiated ConnectionComboBox.
:param isStatic: (bool) indicates whether server selection will be static (no default).
"""
super(ConnectionComboBox, self).__init__(parent)
self.setupUi(self)
self.parent = parent
self.abstractDb = None
self.abstractDbFactory = DbFactory()
self.serverAbstractDb = None
self.displayDict = {'2.1.3':'EDGV 2.1.3', '2.1.3 Pro':'EDGV 2.1.3 Pro','FTer_2a_Ed':'EDGV FTer 2a Ed', 'Non_EDGV':self.tr('Other database model'), '3.0':'EDGV 3.0'}
self.instantiateAbstractDb = False
self.isStatic = isStatic
if self.isStatic:
from DsgTools.gui.ServerTools.viewServers import ViewServersStatic
self.viewServers = ViewServersStatic()
else:
from DsgTools.gui.ServerTools.viewServers import ViewServers
self.viewServers = ViewServers()
self.viewServers.defaultChanged.connect(self.loadServerAbstractDb)
self.connectionSelectorComboBox.addItem(self.tr('Select database'))
self.loadServerAbstractDb()
示例3: __init__
# 需要导入模块: from qgis.PyQt import QtWidgets [as 别名]
# 或者: from qgis.PyQt.QtWidgets import QWidget [as 别名]
def __init__(self, parent=None, isStatic=False):
"""
Class contructor.
:param parent: (QWidget) widget parent to newly instantiated NewConnectionLineEdit.
:param isStatic: (bool) indicates whether server selection will be static (no default).
"""
super(NewConnectionLineEdit, self).__init__()
self.setupUi(self)
self.isStatic = isStatic
if self.isStatic:
from DsgTools.gui.ServerTools.viewServers import ViewServersStatic
self.viewServers = ViewServersStatic()
else:
from DsgTools.gui.ServerTools.viewServers import ViewServers
self.viewServers = ViewServers()
self.fillEdgvVersions()
self.reset()
示例4: getSelectionWidget
# 需要导入模块: from qgis.PyQt import QtWidgets [as 别名]
# 或者: from qgis.PyQt.QtWidgets import QWidget [as 别名]
def getSelectionWidget(source, parent=None):
"""
Gets selection widget to be returned to user as selectionWidget attribute.
:param parent: (QWidget) widget parent to newly instantiated selection widget.
:param source: (DsgEnums.int) driver enum to have its widget produced.
:return: (QWidget) selection widget for selected driver.
"""
sourceDict = {
DsgEnums.NoDriver : lambda : QWidget(), # returns a parent class empty object, to minimize standard distorsion
DsgEnums.PostGIS : lambda : PostgisWidget(parent=parent),
DsgEnums.NewPostGIS : lambda : NewPostgisWidget(parent=parent),
DsgEnums.SpatiaLite : lambda : SpatialiteWidget(parent=parent),
DsgEnums.NewSpatiaLite : lambda : NewSpatialiteWidget(parent=parent),
DsgEnums.Shapefile : lambda : ShapefileWidget(parent=parent),
DsgEnums.NewShapefile : lambda : NewShapefileWidget(parent=parent),
DsgEnums.Geopackage : lambda : GeopackageWidget(parent=parent),
DsgEnums.NewGeopackage : lambda : NewGeopackageWidget(parent=parent)
}
return sourceDict[source]()
示例5: __init__
# 需要导入模块: from qgis.PyQt import QtWidgets [as 别名]
# 或者: from qgis.PyQt.QtWidgets import QWidget [as 别名]
def __init__(self, source, isInput, parent=None):
"""
Class constructor.
:param parent: (QWidget) widget parent to newly instantiated DataSourceManagementWidget object.
:param source: (str) driver codename to have its widget produced.
:param isInput: (bool) indicates whether the chosen database is supposed to be a reading/input widget or writting/output one.
"""
super(DatasourceContainerWidget, self).__init__()
self.setupUi(self)
self.source = source
self.addDatasourceSelectionWidget()
if not isInput:
# output widget should not have filtering options
self.filterPushButton.hide()
# set filtering config
self.filterDlg = None
self.filterPushButton.setToolTip(self.tr('Click to set datasource filter options'))
self.removePushButton.setToolTip(self.tr('Remove this datasource widget'))
示例6: __init__
# 需要导入模块: from qgis.PyQt import QtWidgets [as 别名]
# 或者: from qgis.PyQt.QtWidgets import QWidget [as 别名]
def __init__(self, settings, explorer):
self.explorer = explorer
self.settings = settings
self.parameters = settings.settings()
QtWidgets.QWidget.__init__(self)
self.setupUi()
示例7: getWidget
# 需要导入模块: from qgis.PyQt import QtWidgets [as 别名]
# 或者: from qgis.PyQt.QtWidgets import QWidget [as 别名]
def getWidget(self, parent=None):
"""
Parents class reimplementation to retrieve widget.
:param parent: (QWidget) widget parent to new multi datasource widget.
"""
return MultiPostgisSelector(parent=parent)
示例8: createWidgetWithoutTabs
# 需要导入模块: from qgis.PyQt import QtWidgets [as 别名]
# 或者: from qgis.PyQt.QtWidgets import QWidget [as 别名]
def createWidgetWithoutTabs(self, formLayout):
"""
Adjusts the scroll area to receive the buttons directly (not grouped by category)
formLayout: Layout used to receive all the buttons
"""
w = QtWidgets.QWidget()
w.setLayout(formLayout)
self.scrollArea.setWidget(w)
示例9: createWidgetWithTabs
# 需要导入模块: from qgis.PyQt import QtWidgets [as 别名]
# 或者: from qgis.PyQt.QtWidgets import QWidget [as 别名]
def createWidgetWithTabs(self, formLayout):
"""
Creates a scroll area for each form layout.
formLayout: Layout used to receive the buttons in each tab
"""
scrollArea = QScrollArea()
scrollArea.setWidgetResizable(True)
scrollArea.setFrameShape(QFrame.Shape(0)) # no frame
w = QtWidgets.QWidget()
w.setLayout(formLayout)
scrollArea.setWidget(w)
return scrollArea
示例10: __init__
# 需要导入模块: from qgis.PyQt import QtWidgets [as 别名]
# 或者: from qgis.PyQt.QtWidgets import QWidget [as 别名]
def __init__(self, l, *args, **kwargs):
QMessageBox.__init__(self, *args, **kwargs)
QMessageBox.setWindowTitle(self,self.tr("opeNoise - Help CNOSSOS"))
scroll = QScrollArea(self)
scroll.setWidgetResizable(True)
self.content = QWidget()
scroll.setWidget(self.content)
lay = QVBoxLayout(self.content)
for item in l:
lay.addWidget(QLabel(item, self))
self.layout().addWidget(scroll, 0, 0, 1, self.layout().columnCount())
self.setStyleSheet("QScrollArea{min-width:800 px; min-height: 400px}")