summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBlaine2020-05-16 11:55:23 +0530
committerBlaine2020-05-16 11:55:23 +0530
commit7df3f6ab2aadbc178173a26a299c9a809aaa35f4 (patch)
treeddb08518a6c279ec8b640d5dcdf59b810109a5f2 /src
parentc6a60b1c69daaa819ba52d29c5f5dc8a83023892 (diff)
downloadChemical-PFD-7df3f6ab2aadbc178173a26a299c9a809aaa35f4.tar.gz
Chemical-PFD-7df3f6ab2aadbc178173a26a299c9a809aaa35f4.tar.bz2
Chemical-PFD-7df3f6ab2aadbc178173a26a299c9a809aaa35f4.zip
QDragLeaveEvent + Generator functions
Diffstat (limited to 'src')
-rw-r--r--src/main/python/main.py4
-rw-r--r--src/main/python/utils/fileWindow.py3
-rw-r--r--src/main/python/utils/graphics.py3
-rw-r--r--src/main/python/utils/toolbar.py3
4 files changed, 10 insertions, 3 deletions
diff --git a/src/main/python/main.py b/src/main/python/main.py
index 7d72bae..ef52784 100644
--- a/src/main/python/main.py
+++ b/src/main/python/main.py
@@ -144,7 +144,9 @@ class appWindow(QMainWindow):
@property
def activeFiles(self):
- return [i for i in self.mdi.subWindowList() if i.tabCount]
+ for i in self.mdi.subWindowList():
+ if i.tabCount:
+ yield i
@property
def count(self):
diff --git a/src/main/python/utils/fileWindow.py b/src/main/python/utils/fileWindow.py
index e549568..4bd4ceb 100644
--- a/src/main/python/utils/fileWindow.py
+++ b/src/main/python/utils/fileWindow.py
@@ -187,7 +187,8 @@ class fileWindow(QMdiSubWindow):
@property
def tabList(self):
#returns a list of tabs in the given window
- return [self.tabber.widget(i) for i in range(self.tabCount)]
+ for i in range(self.tabCount):
+ yield self.tabber.widget(i)
@property
def tabCount(self):
diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py
index 6b2066f..dce664a 100644
--- a/src/main/python/utils/graphics.py
+++ b/src/main/python/utils/graphics.py
@@ -23,6 +23,9 @@ class customView(QGraphicsView):
def dragMoveEvent(self, QDragMoveEvent):
if QDragMoveEvent.mimeData().hasText():
QDragMoveEvent.acceptProposedAction()
+
+ def dragLeaveEvent(self, QDragLeaveEvent):
+ QDragLeaveEvent.accept()
def dropEvent(self, QDropEvent):
if QDropEvent.mimeData().hasText():
diff --git a/src/main/python/utils/toolbar.py b/src/main/python/utils/toolbar.py
index 93eb653..6f276df 100644
--- a/src/main/python/utils/toolbar.py
+++ b/src/main/python/utils/toolbar.py
@@ -89,7 +89,8 @@ class toolbar(QDockWidget):
@property
def toolbarItemList(self):
- return self.toolbarButtonDict.keys()
+ for i in self.toolbarButtonDict.keys():
+ yield i
class toolbarButton(QToolButton):