Skip to content

Commit ae88318

Browse files
committed
add help url, add feature for change current curve wen point selected
1 parent 7dd791a commit ae88318

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed

src/core/graphicsView.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ def mouseMoveEvent(self, evt):
215215
item = items[0]
216216
if item:
217217
if isinstance(item, QGraphicsPointItem) and item.parentCurve:
218-
self.changeCurrentCurve(item.parentCurve)
218+
# self.changeCurrentCurve(item.parentCurve)
219+
self.updateCurve(self.currentCurve, Qt.red)
220+
self.updateCurvePoints(self.currentCurve)
219221
self.sigModified.emit(True)
220222
elif isinstance(item, QGraphicsAxesItem):
221223
if item.axis == "x":
@@ -416,6 +418,16 @@ def slotSceneSeletChanged(self):
416418
self.scene.clearSelection()
417419
return
418420
# item = items[0]
421+
item = self.scene.focusItem()
422+
if not item:
423+
items = self.scene.selectedItems()
424+
if len(items) != 1:
425+
return
426+
else:
427+
item = items[0]
428+
if item:
429+
if isinstance(item, QGraphicsPointItem) and item.parentCurve:
430+
self.changeCurrentCurve(item.parentCurve)
419431

420432
def deleteItem(self, item):
421433
"""delete point on curve or axis object"""

src/core/mainwin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,14 @@ def showoriginalgraph():
194194
# help
195195
aboutText = "<b><center>" + self.title + "</center></b><br><br>"
196196
aboutText += self.tr(
197-
"This software is a Tool for digitize graph(like figure scanned from book).<br><br>")
197+
"This software is for digitizing graph(such as figures scanned from book).<br><br>")
198198
aboutText += self.tr(
199199
"author: lileilei<br>website: <a href='https://github.com/hustlei/GraphDigitizer'>https"
200-
"://github.com/hustlei/GraphDigitizer</a><br><br>welcom communicate with me: [email protected] ")
200+
"://github.com/hustlei/GraphDigitizer</a><br><br>welcome anyone to communicate with me: [email protected] ")
201201
aboutText += "<br>copyright &copy; 2020, lileilei@WuHan."
202202
self.actions["about"].triggered.connect(lambda: QMessageBox.about(self, "about", aboutText))
203+
import webbrowser
204+
self.actions["help"].triggered.connect(lambda: webbrowser.open("https://github.com/hustlei/GraphDigitizer"))
203205

204206
def initAxesAndCurveTable(self):
205207
self.axesxTable.setColumnWidth(0, 120)

src/core/mainwinbase.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def keys2str(standardkey):
109109
None,
110110
':appres.img/select.png',
111111
checkable=True)
112-
self.actions["select"].setChecked(True)
113112
self.actions["axesx"] = createAct(self.tr("Set x axis postions"),
114113
self.tr("Set x axis position"),
115114
None,
@@ -125,7 +124,7 @@ def keys2str(standardkey):
125124
None,
126125
':appres.img/curve.png',
127126
checkable=True)
128-
self.actions["del"] = createAct(self.tr("&del point or curve"), self.tr("delete"), QKeySequence.Delete,
127+
self.actions["del"] = createAct(self.tr("&del point or axis"), self.tr("delete"), QKeySequence.Delete,
129128
':appres.img/delete.png')
130129
self.actions["addcurve"] = createAct(self.tr("add a new curve"), self.tr("add a new curve"),
131130
None, ':appres.img/new.png')
@@ -173,6 +172,7 @@ def keys2str(standardkey):
173172
self.actions["config"] = createAct(self.tr("&Config"), self.tr("settings"), None, ":appres.img/config.png")
174173

175174
self.actions["about"] = createAct(self.tr("&About"), self.tr("About"))
175+
self.actions["help"] = createAct(self.tr("&Help"), self.tr("Help"))
176176

177177
# self.exitAct.triggered.connect(qApp.exit)#等价于qApp.quit
178178
self.actions["exit"].triggered.connect(self.close)
@@ -232,6 +232,8 @@ def createMenubar(self):
232232

233233
self.menus["Config"].addAction(self.actions["config"])
234234

235+
self.menus["Help"].addAction(self.actions["help"])
236+
self.menus["Help"].addSeparator()
235237
self.menus["Help"].addAction(self.actions["about"])
236238

237239
for m in self.menus.values():

src/core/widgets/fit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def initUI(self):
3030
self.toolbar = QToolBar(self)
3131
self.curveCombobox = QComboBox()
3232
self.curveCombobox.setMinimumWidth(150)
33-
self.curveCombobox.setMinimumHeight(26)
33+
self.curveCombobox.setMinimumHeight(22)
3434
self.fitBtn = QPushButton(self.tr("fit"))
3535
self.toolbar.addWidget(self.curveCombobox)
3636
self.toolbar.addWidget(self.fitBtn)

todo.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11

22
# Todo
33

4-
1. change current curve when a new curve selected
54
1. double click to change curve name
65
1. order the points table of current curve by ascending order of x axis
7-
1. fitting curves and interpolation
86

97
for future
108

@@ -16,4 +14,6 @@ for future
1614
# performed
1715

1816
+ 2020.05.06:fixed rename curve error
19-
+ 2020.05.06:add delete curve tool
17+
+ 2020.05.06:add delete curve tool
18+
+ 2020.05.06:selected curve automatically be the current curve
19+
+ 2020.05.05:fitting curve by polynamial

0 commit comments

Comments
 (0)