LayoutView documentation on web site does not include Qt binding methods

Hi, Matthias!

Source code in src/layview/layview/ contains bunch of methods in HAVE_QTBINDINGS section, but they are not included into web site documentation through they are referenced in other parts like bookmarks_frame in LV_NoBookmarksView.


  • Sorry, my bad, I didn't notice that this is methods of LayoutViewWidget. But nevertheless, LayoutViewWidget stuff is referenced in LayoutView as part of internal API.

  • Another question: It's possible to get LayoutViewWidget from LayoutView.view, but there is no method to get LayoutViewWidget from LayoutView.

  • Hi Eugene,

    LayoutView used to be a QWidget, but that turned out no longer to be feasible with the upcoming of a Qt-less LayoutView for the klayout Python module.

    Instead there is LayoutViewWidget if you want to embed a LayoutView into your own user interface.

    For example, this code shows how to instantiate a LayoutView detached from the main window:

    import pya
    file = "test.gds"
    dialog = pya.QDialog()
    layout = pya.QHBoxLayout(dialog)
    lvw = pya.LayoutViewWidget(dialog, False, None, 0 * pya.LayoutViewBase.LV_NoPropertiesPopup)
    vlayout = pya.QVBoxLayout(dialog)

    It is however, not possible currently to get the QWidget from an existing LayoutView. That is not impossible, but I wonder what the use case is.

    Kind regards,


  • edited April 2023

    Hi, Matthias!

    Use case is to tweak default appearance of some of LayoutViewWidget widgets while processing MainWindow.on_current_view_changed/on_view_created. For example, hiding/showing cells and layers panels.

  • I see. I feels a bit hacky as you need to act on the internal widget hierarchy, but basically that is possible.
    It should be easy to provide that access. I just wasn't aware of the need to have it. I have created a ticket to remind me:


Sign In or Register to comment.