Graphics Reference
In-Depth Information
elif direction_attr == TRACK_DIRECTION_BACKWARD:
index = 2
else:
index = 0
self.trackDirection.setCurrentIndex(index)
if status_attr == TRACK_STATUS_OPEN: index = 0
elif status_attr == TRACK_STATUS_CLOSED: index = 1
else: index = 0
self.trackStatus.setCurrentIndex(index)
The last method we need to define here is saveAttributes() , which stores the up-
dated values from the dialog window back in the feature's attributes:
def saveAttributes(self, feature):
index = self.trackType.currentIndex()
if index == 0: type_attr = TRACK_TYPE_ROAD
elif index == 1: type_attr = TRACK_TYPE_WALKING
elif index == 2: type_attr = TRACK_TYPE_BIKE
elif index == 3: type_attr = TRACK_TYPE_HORSE
else: type_attr = TRACK_TYPE_ROAD
name_attr = self.trackName.text()
index = self.trackDirection.currentIndex()
if index == 0: direction_attr =
TRACK_DIRECTION_BOTH
elif index == 1: direction_attr =
TRACK_DIRECTION_FORWARD
elif index == 2: direction_attr =
TRACK_DIRECTION_BACKWARD
else: direction_attr =
TRACK_DIRECTION_BOTH
index = self.trackStatus.currentIndex()
if index == 0: status_attr = TRACK_STATUS_OPEN
elif index == 1: status_attr = TRACK_STATUS_CLOSED
else: status_attr = TRACK_STATUS_OPEN
Search WWH ::




Custom Search