I want to add multiple value typed in lineedit to a combobox by clicking a button (one value at one time). My sample codes are as below:
import os, sys
import PyQt4
from PyQt4.QtGui import *
from PyQt4.QtCore import *
class Example(QWidget):
def __init__(self, parent = None):
super().__init__()
self.grid = QGridLayout()
self.setLayout(self.grid)
btn = QPushButton()
le = QLineEdit()
combo = QComboBox()
self.grid.addWidget(btn, 0, 0)
self.grid.addWidget(le, 0 , 1)
self.grid.addWidget(combo, 0, 2)
self.show()
def main():
app = QApplication(sys.argv)
main = Example()
main.show()
sys.exit(app.exec_())
main()
If anyone knows how to do it, pls let me know. Appreciated!!