File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 112.0.1
22 - fix: correctly distinguish prereleases when checking for new versions
3+ - enh: allow loading data via drag&drop
342.0.0
45 - initial release
Original file line number Diff line number Diff line change @@ -372,6 +372,26 @@ def add_plot_window(self, plot_id):
372372 sub .setFixedSize (sub .sizeHint ())
373373 sub .show ()
374374
375+ def dragEnterEvent (self , e ):
376+ """Whether files are accepted"""
377+ if e .mimeData ().hasUrls ():
378+ e .accept ()
379+ else :
380+ e .ignore ()
381+
382+ def dropEvent (self , e ):
383+ """Add dropped files to view"""
384+ urls = e .mimeData ().urls ()
385+ pathlist = []
386+ for ff in urls :
387+ pp = pathlib .Path (ff .toLocalFile ())
388+ if pp .is_dir ():
389+ pathlist += list (pp .rglob ("*.rtdc" ))
390+ elif pp .suffix == ".rtdc" :
391+ pathlist .append (pp )
392+ if pathlist :
393+ self .add_dataslot (paths = sorted (pathlist ))
394+
375395 def init_analysis_view (self ):
376396 sub = widgets .MDISubWindowWOButtons (self )
377397 self .widget_ana_view = analysis .AnalysisView ()
Original file line number Diff line number Diff line change 1010 <height >670</height >
1111 </rect >
1212 </property >
13+ <property name =" acceptDrops" >
14+ <bool >true</bool >
15+ </property >
1316 <property name =" windowTitle" >
1417 <string >Shape-Out</string >
1518 </property >
You can’t perform that action at this time.
0 commit comments