Conversation
|
Hello @kne42! Thanks for updating the PR.
Comment last updated on October 02, 2018 at 20:50 Hours UTC |
6cd57d5 to
2f97d18
Compare
2f97d18 to
91d1e63
Compare
7637781 to
b6fa1c3
Compare
…visible
The visibilitychanged slot currently updates the title regardless of the visibility. We are seeing a crash when the viewer is shut down and a signal is sent to the visibilitychanged slot. That executes some code which causes a segfault in the python process[1]. This PR changes the visibility changed slot to only update the title bar if the widget is visible.
[1]
```
* frame #0: 0x0000000115cc96e4 QtWidgets`QWidgetPrivate::reparentFocusWidgets(QWidget*) + 356
frame napari#1: 0x0000000115cb99cf QtWidgets`QWidget::setParent(QWidget*, QFlags<Qt::WindowType>) + 911
frame napari#2: 0x0000000115cb82c0 QtWidgets`QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) + 688
frame napari#3: 0x0000000115d73e5e QtWidgets`QFrame::QFrame(QFramePrivate&, QWidget*, QFlags<Qt::WindowType>) + 14
frame napari#4: 0x0000000115dc3705 QtWidgets`QLabel::QLabel(QWidget*, QFlags<Qt::WindowType>) + 277
frame napari#5: 0x0000000116503189 QtWidgets.abi3.so`Sbk_QLabel_Init(_object*, _object*, _object*) + 1497
frame napari#6: 0x000000010015f84d Python`wrap_init + 12
frame napari#7: 0x0000000100113e64 Python`_PyObject_FastCallDict + 143
frame napari#8: 0x00000001001b17a2 Python`call_function + 439
frame napari#9: 0x00000001001aa46b Python`_PyEval_EvalFrameDefault + 3078
frame napari#10: 0x00000001001b1ee2 Python`_PyEval_EvalCodeWithName + 1638
frame napari#11: 0x00000001001b281b Python`_PyFunction_FastCallDict + 447
frame napari#12: 0x0000000100113e99 Python`_PyObject_FastCallDict + 196
frame napari#13: 0x0000000100113fa3 Python`_PyObject_Call_Prepend + 131
frame napari#14: 0x0000000100113d1e Python`PyObject_Call + 101
frame napari#15: 0x000000010015f7d1 Python`slot_tp_init + 57
frame napari#16: 0x000000010015c782 Python`type_call + 178
frame napari#17: 0x0000000100113e64 Python`_PyObject_FastCallDict + 143
frame napari#18: 0x00000001001141fa Python`_PyObject_FastCallKeywords + 97
frame napari#19: 0x00000001001b17a2 Python`call_function + 439
frame napari#20: 0x00000001001aa4fb Python`_PyEval_EvalFrameDefault + 3222
frame napari#21: 0x00000001001b28e0 Python`_PyFunction_FastCall + 110
frame napari#22: 0x0000000100113e99 Python`_PyObject_FastCallDict + 196
frame napari#23: 0x0000000100113fa3 Python`_PyObject_Call_Prepend + 131
frame napari#24: 0x0000000100113d1e Python`PyObject_Call + 101
frame napari#25: 0x000000011126f146 libpyside2.abi3.5.14.dylib`PySide::SignalManager::callPythonMetaMethod(QMetaMethod const&, void**, _object*, bool) + 534
frame napari#26: 0x000000011126eb77 libpyside2.abi3.5.14.dylib`PySide::SignalManager::qt_metacall(QObject*, QMetaObject::Call, int, void**) + 519
```
* Initial experimental performance monitoring If NAPARI_PERFMON is defined we use our own QApplication that times events and sends them to our new PerfTimers class. If NAPARI_PERFMON_TRACE_PATH is defined them PerfTimers will write the timers to a chrome://tracing support log file. NAPARI_PERFMON also creates a new dock widget QtPerformance which is very much a WIP. It shows the average UpdateRequest time which the main paint/draw event that hangs if we are doing IO during the draw. It also has a text window where it "lots" any "slow" events (UpdateRequest or otherwise). * Cleanup, remove unused code, remove print Create LONG_EVENT_MS class var Remove print and replace with comment. * Remove stale comment * Better comments * Improve comments * Set max/min not needed * perf_timers and tracing comments Big comment on the lack of full nesting support for PerfTimers * Define a perf_counter_ns() to support Python 3.6 * Cleanup QtPerformance, add "uptime" Add "draw time" and "slow events' labels. Add lots of comments. Extract method: _get_timer_info * Better comment describing the layout * Add perf_timer context object * Big iteration of perfmon stuff, put in own utils/perf folder (#1) * A lot of cleanup/improvement to perf stuff * Move USE_PERFMON check to event_loop.py * Split things into mutiple files * New Debug menu and trace file recording menu options. * Remove stray method * use perf.USE_PERFOMON instead of env var * Add a combo box to set threashold (#2) * Fix decorator * Need category, placeholder for now * New perfmon that works with Jupyter (#3) New convert_app_for_timing works with Jupyter The old approach was restricted to gui_qt which is only used when running napari from the command line. Now we have 2 approaches. We still do gui_qt for the console app. But in Viewer we call convert_app_for_timing and this works for Jupyter. * Fix comment * Better classname * Better comment about QApplication * Add event to string name mapping for PyQt5 In PySide2 the str() method gives you a nice string name like 'PySide2.QtCore.QEvent.Type.KeyPress' But in PyQt5 it return a string/integer like '6' which is annoying. This creates a lookup table on startup. This should be 100% find and perform fine. So we use it for both PyQt5 and PySide2 to be consisting so we work the same in both. * Better comment on convert_app_for_timing call * Edits for readability. Plus add sys.argv to the QApplication() * Merge in perf_func/perf_func_name from other branch. Most of the time we can just use perf_func that uses the function name by default. Most of the time that's what we want. * Talley review: moves/fixed Parameters for __init__ * Talley review: allow docking to the right I just picked "bottom" early on before I knew what was going to be in the widget. Works fine on the right so yes allowing that here. * Talley review: use env var directly and late import Avoid importing perf at all unless we are really using it. * Better comment * Talley review: remove allowed_areas entirely
Rollable instead of n_moveable dims
No description provided.