Skip to content

Separate Qt backend from public-facing API#5

Merged
kne42 merged 1 commit intonapari:masterfrom
kne42:separate-qt
Oct 13, 2018
Merged

Separate Qt backend from public-facing API#5
kne42 merged 1 commit intonapari:masterfrom
kne42:separate-qt

Conversation

@kne42
Copy link
Copy Markdown
Member

@kne42 kne42 commented Oct 12, 2018

Qt-related code has been moved to gui.elements.qt and public-facing elements now contain and interface with a private-facing _qt attribute that references the actual Qt object.

Additionally:

  • ImageContainer has been renamed to ImageLayer
  • Any reference to container has been renamed to layer
  • ImageWindow has been renamed to Window
  • ImageViewerWidget has been renamed to Viewer
  • Viewer.layout_type has been renamed to Viewer.layout
  • Viewer has a new screenshot method which renders the canvas as if the user took a screenshot. This returns the corresponding numpy array.
  • Viewer has privatized canvas, view, and containerlayout (now _layout). However, it now provides the camera attribute.

@pep8speaks
Copy link
Copy Markdown

Hello @kne42! Thanks for submitting the PR.

Line 13:80: E501 line too long (80 > 79 characters)
Line 312:5: E266 too many leading '#' for block comment
Line 391:5: E266 too many leading '#' for block comment

Line 90:19: E231 missing whitespace after ','

Copy link
Copy Markdown
Member

@royerloic royerloic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Copy link
Copy Markdown

@AhmetCanSolak AhmetCanSolak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems great except I am not sure if we are consistent with underscoring members for every class, if we going to keep it better to check the entire repository and fix where required. Thanks!

@kne42 kne42 merged commit 7f306c2 into napari:master Oct 13, 2018
ttung pushed a commit to ttung/napari that referenced this pull request Dec 20, 2019
…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
```
melonora referenced this pull request in melonora/napari May 8, 2023
Let tablet mode respect distance threshold
Czaki pushed a commit that referenced this pull request Oct 25, 2023
Co-authored-by: Lucy Liu <jliu176@gmail.com>
Co-authored-by: Juan Nunez-Iglesias <jni@fastmail.com>
Closes napari/docs#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants