• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python uic.loadUi函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中qgis.PyQt.uic.loadUi函数的典型用法代码示例。如果您正苦于以下问题:Python loadUi函数的具体用法?Python loadUi怎么用?Python loadUi使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了loadUi函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self):
     QDialog.__init__(self)
     # Set up the user interface from Designer.
     ui_path = os.path.join(os.path.dirname(__file__), 'Ui_QuickWKT.ui')
     uic.loadUi(ui_path, self)
     self.exampleComboBox.addItems(list(EXAMPLES.keys()))
     self.exampleComboBox.currentIndexChanged.connect(self.on_exampleComboBox_currentIndexChanged)
开发者ID:elpaso,项目名称:quickwkt,代码行数:7,代码来源:QuickWKTDialog.py


示例2: __init__

    def __init__(self, iface):

        self.supportedPaperSizes = ['A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8']  # ISO A series
        self.paperSizesPresent = []
        self.presetScales = ['200', '500', '1 000', '1 250', '2 500', '5 000', '10 000', '25 000', '50 000', '100 000']

        self.iface = iface
        QDialog.__init__(self)
        # Set up the user interface from Designer.
        self.ui = uic.loadUi(ui_file, self)

        # Set up the list of templates
        s = QtCore.QSettings()
        self.identifiable_only = s.value("SelectorTools/ProjectSelector/identifiableOnly", True, type=bool)
        self.templateFileRoot = s.value("SelectorTools/TemplateSelector/templateRoot", '', type=str)
        if len(self.templateFileRoot) == 0 or not os.path.isdir(self.templateFileRoot):
            raise TemplateSelectorException('\'%s\' is not a valid template file root folder.' % self.templateFileRoot)
        self.populateTemplateTypes()
        self.populatePoiLayers()
        self.onPoiLayerChanged()

        self.onTemplateTypeChanged()
        self.plugin_dir = os.path.dirname(__file__)

        # Replacement map
        self.ui.suitableForComboBox.addItem('<custom>')
        self.user = os.environ.get('username', '[user]')
        self.replaceMap = {
            'author': "Compiled by {} on [%concat(day($now ),'/',month($now),'/',year($now))%]".format(self.user)
        }
        self.ui.autofit_btn.clicked.connect(self.autofit_map)
        self.ui.suitableForComboBox.currentIndexChanged.connect(self.specify_dpi)
        self.ui.suitableForComboBox.editTextChanged.connect(self.text_changed)
        self.ui.poiLayerComboBox.currentIndexChanged.connect(self.onPoiLayerChanged)
开发者ID:lutraconsulting,项目名称:qgis-moor-tools-plugin,代码行数:34,代码来源:templateselectordialog.py


示例3: __init__

 def __init__(self, model):
     QDialog.__init__(self)
     # Set up the user interface from Designer.
     self.ui = uic.loadUi(ui_file, self)
     self.resultModel = model
     self.constraintTableView.setModel(self.resultModel)
     self.constraintTableView.resizeColumnsToContents()
开发者ID:lutraconsulting,项目名称:qgis-constraint-checker-plugin,代码行数:7,代码来源:constraint_results_dialog.py


示例4: __init__

    def __init__(self, iface):
        self.iface = iface
        QDialog.__init__(self)
        # Set up the user interface from Designer.
        self.ui = uic.loadUi(ui_file, self)

        self.configFilePath = os.path.join(os.path.dirname(__file__), 'config.cfg')
        self.defFlags = Qt.NoItemFlags | Qt.ItemIsEnabled | Qt.ItemIsEditable | Qt.ItemIsSelectable
        
        # Populate the PostGIS connection combo with the available connections
        
        # Determine our current preference
        s = QSettings()
        selectedConnection = str(s.value("constraintchecker/postgisConnection", ''))
        
        s.beginGroup('PostgreSQL/connections')
        i = 0
        for connectionName in s.childGroups():
            self.postgisConnectionComboBox.addItem(connectionName)
            if connectionName == selectedConnection:
                # Select this preference in the combo if exists
                self.postgisConnectionComboBox.setCurrentIndex(i)
            i += 1
        s.endGroup()
        
        # Now read the configuration file (if it exists) into the table widget
        try:
            self.readConfiguration()
        except:
            pass
开发者ID:lutraconsulting,项目名称:qgis-constraint-checker-plugin,代码行数:30,代码来源:configuration_dialog.py


示例5: update_template

 def update_template(self):
     if self.template_subframe is not None:
         self.template_subframe.setParent(None)
     subframe = QFrame(self.template_frame)
     self.frame_layout.addWidget(subframe, 1, 0, 1, 2)
     self.template_subframe = uic.loadUi(os.path.join(
         self.template().subdir(), 'wizard_form_base.ui'),
         subframe)
开发者ID:g-sherman,项目名称:Qgis-Plugin-Builder,代码行数:8,代码来源:plugin_builder_dialog.py


示例6: __init__

    def __init__(self, iface, model):
        """Initialize the GUI control"""
        QObject.__init__(self)
        self.iface = iface
        self.model = model
        self.optionsDialog = None
        self.path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ui')

        # load the form
        self.dock = uic.loadUi(os.path.join(self.path, DOCK_WIDGET_FILE))
        self.iface.addDockWidget(Qt.BottomDockWidgetArea, self.dock)

        self.dock.pushButtonExportVideo.setEnabled(False)  # only enabled if there are managed layers
        self.dock.pushButtonOptions.clicked.connect(self.optionsClicked)
        self.dock.pushButtonExportVideo.clicked.connect(self.exportVideoClicked)
        self.dock.pushButtonToggleTime.clicked.connect(self.toggleTimeClicked)
        self.dock.pushButtonArchaeology.clicked.connect(self.archaeologyClicked)
        self.dock.pushButtonBack.clicked.connect(self.backClicked)
        self.dock.pushButtonForward.clicked.connect(self.forwardClicked)
        self.dock.pushButtonPlay.clicked.connect(self.playClicked)
        self.dock.dateTimeEditCurrentTime.dateTimeChanged.connect(self.currentTimeChangedDateText)
        # self.dock.horizontalTimeSlider.valueChanged.connect(self.currentTimeChangedSlider)

        self.sliderTimer = QTimer(self)
        self.sliderTimer.setInterval(250)
        self.sliderTimer.setSingleShot(True)
        self.sliderTimer.timeout.connect(self.currentTimeChangedSlider)
        self.dock.horizontalTimeSlider.valueChanged.connect(self.startTimer)

        self.dock.comboBoxTimeExtent.currentIndexChanged[str].connect(self.currentTimeFrameTypeChanged)
        self.dock.spinBoxTimeExtent.valueChanged.connect(self.currentTimeFrameSizeChanged)

        # this signal is responsible for rendering the label
        self.iface.mapCanvas().renderComplete.connect(self.renderLabel)

        # create shortcuts
        self.focusSC = QShortcut(QKeySequence("Ctrl+Space"), self.dock)
        self.focusSC.activated.connect(self.dock.horizontalTimeSlider.setFocus)

        # put default values
        self.dock.horizontalTimeSlider.setMinimum(conf.MIN_TIMESLIDER_DEFAULT)
        self.dock.horizontalTimeSlider.setMaximum(conf.MAX_TIMESLIDER_DEFAULT)
        self.dock.dateTimeEditCurrentTime.setMinimumDate(MIN_QDATE)
        self.showLabel = conf.DEFAULT_SHOW_LABEL
        self.exportEmpty = conf.DEFAULT_EXPORT_EMPTY
        self.labelOptions = TimestampLabelConfig(self.model)

        # placeholders for widgets that are added dynamically
        self.bcdateSpinBox = None

        # add to plugins toolbar
        try:
            self.action = QAction(QCoreApplication.translate("TimeManagerGuiControl", "Toggle visibility"), self.iface.mainWindow())
            self.action.triggered.connect(self.toggleDock)
            self.iface.addPluginToMenu(QCoreApplication.translate("TimeManagerGuiControl", "&TimeManager"), self.action)
        except Exception as e:
            pass  # OK for testing
开发者ID:anitagraser,项目名称:TimeManager,代码行数:57,代码来源:timemanagerguicontrol.py


示例7: showAnimationOptions

    def showAnimationOptions(self):
        self.animationDialog = uic.loadUi(os.path.join(self.path, ANIMATION_WIDGET_FILE))

        def selectFile():
            self.animationDialog.lineEdit.setText(QFileDialog.getOpenFileName())

        self.animationDialog.pushButton.clicked.connect(self.selectAnimationFolder)
        self.animationDialog.buttonBox.accepted.connect(self.sendAnimationOptions)
        self.animationDialog.show()
开发者ID:anitagraser,项目名称:TimeManager,代码行数:9,代码来源:timemanagerguicontrol.py


示例8: initGui

 def initGui(self):
     proj = QgsProject.instance()
     proj.readProject.connect(self.loadData)
     proj.writeProject.connect(self.saveData)
     self.iface.newProjectCreated .connect(self.clearEdit)
     
     pluginPath = path.dirname(path.abspath(__file__))
     self.dock = uic.loadUi(path.join(pluginPath, "ui_qnote.ui"))
     self.iface.addDockWidget(Qt.BottomDockWidgetArea, self.dock)
     self.loadData()
开发者ID:p0cisk,项目名称:qNote,代码行数:10,代码来源:qnote.py


示例9: xml

 def xml(self):
     self.doc = QDomDocument()
     element = self.doc.createElement("qgiswidgets")
     self.doc.appendChild(element)
     for p in glob.glob(self.ui_dir):
         self.printMsg("Loading " + p)
         # qgsrasterlayerpropertiesbase.ui is giving: No module named qwt_plot
         try:
             widget = loadUi(p)
             #print dir ( ui )
             self.widgetXml(element, widget)
         except Exception, e:
             #except IOError, e:
             self.printMsg(str(e))
开发者ID:lbartoletti,项目名称:QGIS,代码行数:14,代码来源:widgets_tree.py


示例10: __init__

    def __init__(self):
        
        QDialog.__init__(self)
        # Set up the user interface from Designer.
        self.ui = uic.loadUi(ui_file, self)

        self.settings = QtCore.QSettings()

        # Populate the values
        with open(DEFAULTS) as paths:
            projects = paths.readline().strip().split(':', 1)[-1]
            templates = paths.readline().strip().split(':', 1)[-1]
            self.ui.projectsFolderLineEdit.setText(projects)
            self.ui.templateRootLineEdit.setText(templates)
        project_selector_enabled = self.settings.value("SelectorTools/ProjectSelector/isEnabled", True, type=bool)
        identifiable_only = self.settings.value("SelectorTools/ProjectSelector/identifiableOnly", True, type=bool)
        self.ui.projectSelectorEnabledCheckBox.setChecked(project_selector_enabled)
        self.ui.identifiableOnly.setChecked(identifiable_only)
开发者ID:lutraconsulting,项目名称:qgis-moor-tools-plugin,代码行数:18,代码来源:settingsdialog.py


示例11: __init__

    def __init__(self, iface):
        
        self.iface = iface

        QDialog.__init__(self)
        # Set up the user interface from Designer.
        self.ui = uic.loadUi(ui_file, self)
        self.plugin_dir = os.path.dirname(__file__)
        
        # import pydevd; pydevd.settrace()
        
        # Disable OK button until we are sure we have at least one project
        self.ui.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)

        # Set up the list of templates
        self.settings = QtCore.QSettings()
        self.projectFileRoot = self.settings.value('SelectorTools/ProjectSelector/projectRoot', '', type=str)
        if len(self.projectFileRoot) == 0 or not os.path.isdir(self.projectFileRoot):
            raise ProjectSelectorException('\'%s\' is not a valid project file root folder.' % self.projectFileRoot)

        # Populate the list of project types
        self.ui.projectGroupComboBox.blockSignals(True)
        for entry in os.listdir(self.projectFileRoot):
            entryPath = os.path.join(self.projectFileRoot, entry)
            if not os.path.isdir(entryPath):
                continue
            # Check there's a .qgs file in this path
            for subEntry in os.listdir(entryPath):
                if subEntry.lower().endswith('.qgs') and os.path.isfile(os.path.join(entryPath, subEntry)):
                    # The folder contains at least one project, add it
                    self.ui.projectGroupComboBox.addItem(entry)
                    break
        self.ui.projectGroupComboBox.blockSignals(False)
        defaultGroup = self.settings.value('SelectorTools/ProjectSelector/defaultProjectGroup', '', type=str)
        if len(defaultGroup) > 0:
            self.ui.projectGroupComboBox.setCurrentIndex( self.ui.projectGroupComboBox.findText(defaultGroup) )
        if self.ui.projectGroupComboBox.count() == 1:
            self.ui.projectGroupComboBox.setCurrentIndex(0)
            self.ui.projectGroupComboBox.setEnabled(False)
        self.onProjectGroupChanged()
开发者ID:lutraconsulting,项目名称:qgis-moor-tools-plugin,代码行数:40,代码来源:projectselectordialog.py


示例12: __init__

 def __init__(self):
     QDialog.__init__(self)
     # Set up the user interface from Designer.
     self.ui = uic.loadUi(ui_file, self)
开发者ID:lutraconsulting,项目名称:qgis-constraint-checker-plugin,代码行数:4,代码来源:constraintcheckerdialog.py


示例13: __init__

 def __init__(self, iface, ui_path, out_table):
     self.iface = iface
     self.tempLayerIndexToId = {}
     self.dialog = uic.loadUi(ui_path)
     self.out_table = out_table
     self.addConnections()
开发者ID:anitagraser,项目名称:TimeManager,代码行数:6,代码来源:vectorlayerdialog.py


示例14: showOptionsDialog

    def showOptionsDialog(self, layerList, animationFrameLength, playBackwards=False, loopAnimation=False):
        """Show the optionsDialog and populate it with settings from timeLayerManager"""

        # load the form
        self.optionsDialog = uic.loadUi(os.path.join(self.path, OPTIONS_WIDGET_FILE))

        # restore settings from layerList:
        for layer in layerList:
            settings = layer_settings.getSettingsFromLayer(layer)
            layer_settings.addSettingsToRow(settings, self.optionsDialog.tableWidget)
        self.optionsDialog.tableWidget.resizeColumnsToContents()

        # restore animation options
        self.optionsDialog.spinBoxFrameLength.setValue(animationFrameLength)
        self.optionsDialog.checkBoxBackwards.setChecked(playBackwards)
        self.optionsDialog.checkBoxLabel.setChecked(self.showLabel)
        self.optionsDialog.checkBoxDontExportEmpty.setChecked(not self.exportEmpty)
        self.optionsDialog.checkBoxLoop.setChecked(loopAnimation)
        self.optionsDialog.show_label_options_button.clicked.connect(self.showLabelOptions)
        self.optionsDialog.checkBoxLabel.stateChanged.connect(self.showOrHideLabelOptions)

        self.optionsDialog.textBrowser.setHtml(QCoreApplication.translate('TimeManager', """\
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
    <meta name="qrichtext" content="1"/>

    <style>
    li.mono {
    font-family: Consolas, Courier New, Courier, monospace;
}
    </style>
</head>
<body>

<h1>Time Manager</h1>

<p>Time Manager filters your layers and displays only layers and features that match the specified time frame. Time Manager supports vector layers and raster layers (including WMS-T).</p>

<p>Timestamps have to be in one of the following formats:</p>

<ul>
<li class="mono">%Y-%m-%d %H:%M:%S.%f</li>
<li class="mono">%Y-%m-%d %H:%M:%S</li>
<li class="mono">%Y-%m-%d %H:%M</li>
<li class="mono">%Y-%m-%dT%H:%M:%S</li>
<li class="mono">%Y-%m-%dT%H:%M:%SZ</li>
<li class="mono">%Y-%m-%dT%H:%M</li>
<li class="mono">%Y-%m-%dT%H:%MZ</li>
<li class="mono">%Y-%m-%d</li>
<li class="mono">%Y/%m/%d %H:%M:%S.%f</li>
<li class="mono">%Y/%m/%d %H:%M:%S</li>
<li class="mono">%Y/%m/%d %H:%M</li>
<li class="mono">%Y/%m/%d</li>
<li class="mono">%H:%M:%S</li>
<li class="mono">%H:%M:%S.%f</li>
<li class="mono">%Y.%m.%d %H:%M:%S.%f</li>
<li class="mono">%Y.%m.%d %H:%M:%S</li>
<li class="mono">%Y.%m.%d %H:%M</li>
<li class="mono">%Y.%m.%d</li>
<li class="mono">%Y%m%d%H%M%SED</li>
<li>Integer timestamp in seconds after or before the epoch (1970-1-1)</li>
</ul>


<p>The layer list contains all layers managed by Time Manager.
To add a vector layer, press [Add layer].
To add a raster layer, press [Add raster].
If you want to remove a layer from the list, select it and press [Remove layer].</p>


<p>Below the layer list, you'll find the following <b>animation options</b>:</p>

<p><b>Show frame for x milliseconds</b>...
allows you to adjust for how long a frame will be visible during the animation</p>

<p><b>Play animation backwards</b>...
if checked, the animation will run in reverse direction</p>

<p><b>Display frame start time on map</b>...
if checked, displays the start time of the visible frame in the lower right corner of the map</p>

<h2>Add Layer dialog</h2>

<p>Here, you are asked to select the layer that should be added and specify the columns containing
start and (optionally) end time.</p>

<p>The <b>offset</b> option allows you to further time the appearance of features. If you specify
an offset of -1, the features will appear one second later than they would by default.</p>

<h2>Dock widget</h2>

<p>The dock was designed to attach to the bottom of the QGIS main window. It offers the following tools:</p>

<ul>
<li><img src="images/power_on.png" alt="power"/> ... On/Off switch, allows you to turn Time Manager's functionality on/off with the click of only one button</li>
<li><span class="hidden">[Settings]</span><input type="button" value="Settings"/> ... opens the Settings dialog where you can manage your spatio-temporal layers</li>
<li><span class="hidden">[Export Video]</span><input type="button" value="Export Video"/> ... exports an image series based on current settings (This button is only enabled if there are layers registered in Time Manager "Settings")</li>
<li><b>Time frame start: <span class="hidden">[2000-01-01 00:00:00]</span></b><input type="text" value="2000-01-01 00:00:00"/> ... shows the start time of the currently active frame. Allows you to precisely specify your desired analysis time.</li>
<li><b>Time frame size: </b><input type="text" value="1"/><span class="hidden">[x]</span><select><option value="days">days</option></select> ... allow you to choose the size of the time frame</li>
#.........这里部分代码省略.........
开发者ID:anitagraser,项目名称:TimeManager,代码行数:101,代码来源:timemanagerguicontrol.py


示例15: showArchOptions

 def showArchOptions(self):
     self.archMenu = uic.loadUi(os.path.join(self.path, ARCH_WIDGET_FILE))
     self.archMenu.buttonBox.accepted.connect(self.saveArchOptions)
     self.archMenu.buttonBox.rejected.connect(self.cancelArch)
     self.archMenu.show()
开发者ID:anitagraser,项目名称:TimeManager,代码行数:5,代码来源:timemanagerguicontrol.py


示例16: __init__

 def __init__(self, iface, parent=None):
     super(PostNAS_CreateFulltextindex, self).__init__(parent)
     self.dialog = uic.loadUi(os.path.join(os.path.dirname(__file__), 'PostNAS_FulltextindexInProgress.ui'))
开发者ID:Kreis-Unna,项目名称:PostNAS_Search,代码行数:3,代码来源:PostNAS_CreateFulltextindex.py



注:本文中的qgis.PyQt.uic.loadUi函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python uic.loadUiType函数代码示例发布时间:2022-05-26
下一篇:
Python sip.isdeleted函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap