python/gui question

Xristos Xristoou saxri89 at gmail.com
Thu Mar 9 14:15:18 EST 2017


i want to create a very simple python plugin using QT designer but i an not sure how to connect my variable from gui to my python script.
my gui is simple have only one lineEdit and ok or cancel.
in the gui (widget):

 <widget class="QLineEdit" name="lineEdit">
   <property name="geometry">
    <rect>
     <x>20</x>
     <y>90</y>
     <width>171</width>
     <height>31</height>
    </rect>
   </property>
  </widget>


def run(self):
    self.dlg.show()
    result = self.dlg.exec_()
    if result:
        distance = self.dlg.lineEdit.value()
        if distance == 0:
            #do something
        else:
            #do sothing else
        pass

i test this code but dont work dont show me anything. any idea ?


More information about the Python-list mailing list