Skip to content

Commit

Permalink
fixing section selection dialog oddtopus#12
Browse files Browse the repository at this point in the history
Now it is possible to select a item with a mouse or keyboard
  • Loading branch information
cvgaviao committed May 24, 2018
1 parent eca6cc7 commit 45b35f5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frameFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def __init__(self,winTitle='Insert section', icon='flamingo.svg'):
self.firstCol=QWidget()
self.firstCol.setLayout(QVBoxLayout())
self.mainHL.addWidget(self.firstCol)
self.SType='IPE'
self.SType=''
self.currentRatingLab=QLabel('Section: '+self.SType)
self.firstCol.layout().addWidget(self.currentRatingLab)
self.sizeList=QListWidget()
Expand All @@ -238,7 +238,7 @@ def __init__(self,winTitle='Insert section', icon='flamingo.svg'):
self.ratingList=QListWidget()
self.ratingList.setMaximumWidth(100)
self.ratingList.addItems(self.PRatingsList)
self.ratingList.itemClicked.connect(self.changeRating)
self.ratingList.currentItemChanged.connect(self.changeRating)
self.ratingList.setCurrentRow(0)
self.secondCol.layout().addWidget(self.ratingList)
self.btn1=QPushButton('Insert')
Expand All @@ -258,7 +258,8 @@ def fillSizes(self):
for row in self.sectDictList:
s=row['SSize']
self.sizeList.addItem(s)
def changeRating(self,item):
def changeRating(self):
item = self.ratingList.currentItem()
self.SType=item.text()
self.currentRatingLab.setText('Section: '+self.SType)
self.fillSizes()
Expand Down

0 comments on commit 45b35f5

Please sign in to comment.