-
Notifications
You must be signed in to change notification settings - Fork 0
/
jednotkySearchForm.py
69 lines (53 loc) · 2.54 KB
/
jednotkySearchForm.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# -*- coding: utf-8 -*-
"""
/***************************************************************************
vfkPluginDialog
A QGIS plugin
Plugin umoznujici praci s daty katastru nemovitosti
-------------------
begin : 2015-06-11
git sha : $Format:%H$
copyright : (C) 2015 by Stepan Bambula
email : stepan.bambula@gmail.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
from builtins import str
from qgis.PyQt import QtGui, QtWidgets
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from qgis.PyQt.QtCore import QAbstractItemModel, QModelIndex
from .ui_jednotkysearchform import *
class JednotkySearchForm(QWidget):
def __init__(self, parent=None):
super(JednotkySearchForm, self).__init__(parent)
# Set up the user interface from Designer.
self.ui = Ui_JednotkySearchForm()
self.ui.setupUi(self)
self.__mZpusobVyuzitiModel = QAbstractItemModel
def cisloJednotky(self):
return str(self.ui.mCisloJednotkyLineEdit.text()).strip()
def domovniCislo(self):
return str(self.ui.mCisloDomovniLineEdit.text()).strip()
def naParcele(self):
return str(self.ui.mNaParceleLineEdit.text()).strip()
def lv(self):
return str(self.ui.mLvJednotkyLineEdit.text()).strip()
def setZpusobVyuzitiModel(self, model):
self.__mZpusobVyuzitiModel = model
self.ui.mZpVyuzitiCombo.setModel(model)
self.ui.mZpVyuzitiCombo.setModelColumn(1)
def zpusobVyuzitiKod(self):
row = self.ui.mZpVyuzitiCombo.currentIndex()
index = QModelIndex(self.ui.mZpVyuzitiCombo.model().index(row, 1))
if self.ui.mZpVyuzitiCombo.model().data(index) == u"libovolný":
return u''
else:
return u"{}".format(self.ui.mZpVyuzitiCombo.model().data(index))