本文整理汇总了Python中PyQt4.QtGui.QDialog.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QDialog.__init__方法的具体用法?Python QDialog.__init__怎么用?Python QDialog.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QDialog
的用法示例。
在下文中一共展示了QDialog.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.QtGui import QDialog [as 别名]
# 或者: from PyQt4.QtGui.QDialog import __init__ [as 别名]
def __init__(self, logger, parent=None):
QDialog.__init__(self, parent)
uic.loadUi(os.path.join(os.path.dirname(__file__), "res/create_layer.ui"), self)
self.__logger = logger
for lid, layer in QgsMapLayerRegistry.instance().mapLayers().iteritems():
logging.info('layer name: {}'.format(layer.name()))
if layer.type() == QgsMapLayer.VectorLayer and layer.customProperty("projected_layer") is None:
if layer.geometryType() == QGis.Line:
self.geometryLayer.addItem(layer.name(), layer.id())
self.dataLayer.addItem(layer.name(), layer.id())
if self.dataLayer.count():
self.__set_data_layer(self.dataLayer.currentIndex())
if self.geometryLayer.count():
self.__set_geometry_layer(self.geometryLayer.currentIndex())
self.dataLayer.currentIndexChanged.connect(self.__set_data_layer)
self.geometryLayer.currentIndexChanged.connect(self.__set_geometry_layer)
示例2: __init__
# 需要导入模块: from PyQt4.QtGui import QDialog [as 别名]
# 或者: from PyQt4.QtGui.QDialog import __init__ [as 别名]
def __init__(self, text, unit = None, minimum = None, maximum = None, parent = None):
"""
Initialization of the CfgSpinBox class (used for int values).
@param text: text string associated with the SpinBox
@param minimum: min value (int)
@param minimum: max value (int)
"""
QWidget.__init__(self, parent)
self.spinbox = QSpinBox(parent)
if unit is not None:
self.setUnit(unit)
self.setSpec({'minimum': minimum, 'maximum': maximum, 'comment': ''})
self.label = QLabel(text, parent)
self.layout = QHBoxLayout(parent);
self.spinbox.setMinimumWidth(200) #Provide better alignment with other items
self.layout.addWidget(self.label)
self.layout.addStretch()
self.layout.addWidget(self.spinbox)
self.setLayout(self.layout)
示例3: __init__
# 需要导入模块: from PyQt4.QtGui import QDialog [as 别名]
# 或者: from PyQt4.QtGui.QDialog import __init__ [as 别名]
def __init__(self, parent):
QDialog.__init__(self, parent)
self.folder = downloaddir
self.setupUi(self)
self.folderButton.clicked.connect(self.changeFolder)
self.labelFolder.setText(downloaddir)
示例4: __init__
# 需要导入模块: from PyQt4.QtGui import QDialog [as 别名]
# 或者: from PyQt4.QtGui.QDialog import __init__ [as 别名]
def __init__(self, parent):
QDialog.__init__(self, parent)
Ui_TextItemEditor.__init__(self)
self.setupUi(self)
self.itemName = "Value"
# Create an empty model for the list's data
self._model = QStandardItemModel(self.list_view)
示例5: __init__
# 需要导入模块: from PyQt4.QtGui import QDialog [as 别名]
# 或者: from PyQt4.QtGui.QDialog import __init__ [as 别名]
def __init__(self, parent):
QDialog.__init__(self, parent)
self.setupUi(self)
self.resize(920, self.height())
示例6: __init__
# 需要导入模块: from PyQt4.QtGui import QDialog [as 别名]
# 或者: from PyQt4.QtGui.QDialog import __init__ [as 别名]
def __init__( self, parent ):
QDialog.__init__( self, parent )
self.setupUi( self )
self.setModal( True )
self.expressionBuilderWidget.loadRecent( 'fieldcalc' )
self.buttonBox.button( QDialogButtonBox.Ok ).setEnabled( False )
self.expression = ''
self.expressionBuilderWidget.expressionParsed.connect( self.expressionChanged )
示例7: __init__
# 需要导入模块: from PyQt4.QtGui import QDialog [as 别名]
# 或者: from PyQt4.QtGui.QDialog import __init__ [as 别名]
def __init__(self, parent = None):
"""
Constructor
"""
QDialog.__init__(self, parent)
self.setupUi(self)