Python qgis.PyQt.QtWidgets.QWidget() Examples

The following are 10 code examples of qgis.PyQt.QtWidgets.QWidget(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module qgis.PyQt.QtWidgets , or try the search function .
Example #1
Source File: databaseFileLineEdit.py    From DsgTools with GNU General Public License v2.0 6 votes vote down vote up
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) 
Example #2
Source File: connectionComboBox.py    From DsgTools with GNU General Public License v2.0 6 votes vote down vote up
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() 
Example #3
Source File: newConnectionLineEdit.py    From DsgTools with GNU General Public License v2.0 6 votes vote down vote up
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() 
Example #4
Source File: datasourceSelectionWidgetFactory.py    From DsgTools with GNU General Public License v2.0 6 votes vote down vote up
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]() 
Example #5
Source File: datasourceContainerWidget.py    From DsgTools with GNU General Public License v2.0 6 votes vote down vote up
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')) 
Example #6
Source File: parametereditor.py    From qgis-geoserver-plugin with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, settings, explorer):
        self.explorer = explorer
        self.settings = settings
        self.parameters = settings.settings()
        QtWidgets.QWidget.__init__(self)
        self.setupUi() 
Example #7
Source File: multiPostgisSelectorWidget.py    From DsgTools with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #8
Source File: field_toolbox.py    From DsgTools with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #9
Source File: field_toolbox.py    From DsgTools with GNU General Public License v2.0 5 votes vote down vote up
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 
Example #10
Source File: do_SourceDetailsRoads.py    From openoise-map with GNU General Public License v3.0 5 votes vote down vote up
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}")