Skip to content

Instantly share code, notes, and snippets.

@ilkermanap
Created June 5, 2018 09:02
Show Gist options
  • Save ilkermanap/68f3e09b99c704459a8cdfbb393aa2ca to your computer and use it in GitHub Desktop.
Save ilkermanap/68f3e09b99c704459a8cdfbb393aa2ca to your computer and use it in GitHub Desktop.
Basit pyside uygulamasi
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>113</width>
<height>27</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_2">
<property name="geometry">
<rect>
<x>220</x>
<y>60</y>
<width>113</width>
<height>27</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_3">
<property name="geometry">
<rect>
<x>140</x>
<y>170</y>
<width>113</width>
<height>27</height>
</rect>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</widget>
<resources/>
<connections>
<connection>
<sender>lineEdit</sender>
<signal>textChanged(QString)</signal>
<receiver>Dialog</receiver>
<slot>degisim()</slot>
<hints>
<hint type="sourcelabel">
<x>66</x>
<y>78</y>
</hint>
<hint type="destinationlabel">
<x>67</x>
<y>109</y>
</hint>
</hints>
</connection>
<connection>
<sender>lineEdit_2</sender>
<signal>textChanged(QString)</signal>
<receiver>Dialog</receiver>
<slot>degisim()</slot>
<hints>
<hint type="sourcelabel">
<x>244</x>
<y>79</y>
</hint>
<hint type="destinationlabel">
<x>245</x>
<y>110</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>degisim()</slot>
</slots>
</ui>
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pencerem.ui'
#
# Created: Tue Jun 5 10:59:37 2018
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(400, 300)
self.lineEdit = QtGui.QLineEdit(Dialog)
self.lineEdit.setGeometry(QtCore.QRect(20, 60, 113, 27))
self.lineEdit.setObjectName("lineEdit")
self.lineEdit_2 = QtGui.QLineEdit(Dialog)
self.lineEdit_2.setGeometry(QtCore.QRect(220, 60, 113, 27))
self.lineEdit_2.setObjectName("lineEdit_2")
self.lineEdit_3 = QtGui.QLineEdit(Dialog)
self.lineEdit_3.setGeometry(QtCore.QRect(140, 170, 113, 27))
self.lineEdit_3.setReadOnly(True)
self.lineEdit_3.setObjectName("lineEdit_3")
self.retranslateUi(Dialog)
QtCore.QObject.connect(self.lineEdit, QtCore.SIGNAL("textChanged(QString)"), Dialog.degisim)
QtCore.QObject.connect(self.lineEdit_2, QtCore.SIGNAL("textChanged(QString)"), Dialog.degisim)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
from PySide.QtGui import *
from ui_pencerem import Ui_Dialog
import sys
class MainWindow(QDialog, Ui_Dialog):
def __init__(self, app=None):
super(MainWindow, self).__init__()
self.app = app
self.setupUi(self)
self.show()
def degisim(self):
self.lineEdit_3.setText(self.lineEdit.text() + " " + self.lineEdit_2.text())
def main():
app = QApplication(sys.argv)
mainWin = MainWindow(app)
ret = app.exec_()
app.exit()
sys.exit(ret)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment