some changes on dirty flag, added keyPress/release Events for Ctrl-Key
This commit is contained in:
parent
60c882fe04
commit
1ff3b845bb
12
QtPyLoT.py
12
QtPyLoT.py
@ -109,6 +109,7 @@ class MainWindow(QMainWindow):
|
|||||||
self.poS_id = None
|
self.poS_id = None
|
||||||
self.ae_id = None
|
self.ae_id = None
|
||||||
self.scroll_id = None
|
self.scroll_id = None
|
||||||
|
self._ctrl = False # control key pressed
|
||||||
|
|
||||||
# default factor for dataplot e.g. enabling/disabling scrollarea
|
# default factor for dataplot e.g. enabling/disabling scrollarea
|
||||||
self.height_factor = 12
|
self.height_factor = 12
|
||||||
@ -514,6 +515,14 @@ class MainWindow(QMainWindow):
|
|||||||
self.ref_event_button.setEnabled(False)
|
self.ref_event_button.setEnabled(False)
|
||||||
self.test_event_button.setEnabled(False)
|
self.test_event_button.setEnabled(False)
|
||||||
|
|
||||||
|
def keyPressEvent(self, event):
|
||||||
|
if event.key() == QtCore.Qt.Key.Key_Control:
|
||||||
|
self._ctrl = True
|
||||||
|
|
||||||
|
def keyReleaseEvent(self, event):
|
||||||
|
if event.key() == QtCore.Qt.Key.Key_Control:
|
||||||
|
self._ctrl = False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def metadata(self):
|
def metadata(self):
|
||||||
return self._metadata
|
return self._metadata
|
||||||
@ -712,6 +721,7 @@ class MainWindow(QMainWindow):
|
|||||||
return
|
return
|
||||||
self.project.add_eventlist(eventlist)
|
self.project.add_eventlist(eventlist)
|
||||||
self.init_events()
|
self.init_events()
|
||||||
|
self.setDirty(True)
|
||||||
|
|
||||||
def createEventBox(self):
|
def createEventBox(self):
|
||||||
'''
|
'''
|
||||||
@ -744,7 +754,6 @@ class MainWindow(QMainWindow):
|
|||||||
self.eventBox.setCurrentIndex(nitems)
|
self.eventBox.setCurrentIndex(nitems)
|
||||||
self.refreshEvents()
|
self.refreshEvents()
|
||||||
tabindex = self.tabs.currentIndex()
|
tabindex = self.tabs.currentIndex()
|
||||||
self.setDirty(True)
|
|
||||||
|
|
||||||
def fill_eventbox(self, eventBox=None, select_events='all'):
|
def fill_eventbox(self, eventBox=None, select_events='all'):
|
||||||
'''
|
'''
|
||||||
@ -1972,6 +1981,7 @@ class MainWindow(QMainWindow):
|
|||||||
if not exists:
|
if not exists:
|
||||||
self.project = Project()
|
self.project = Project()
|
||||||
self.init_events(new=True)
|
self.init_events(new=True)
|
||||||
|
self.setDirty(True)
|
||||||
self.project.save(filename)
|
self.project.save(filename)
|
||||||
self.setDirty(False)
|
self.setDirty(False)
|
||||||
return True
|
return True
|
||||||
|
@ -1 +1 @@
|
|||||||
3965-dirty
|
60c8-dirty
|
||||||
|
Loading…
Reference in New Issue
Block a user