# Access to Main.cxx from custom Slicer Python application

**URL:** https://discourse.kitware.com/t/access-to-main-cxx-from-custom-slicer-python-application/1524
**Category:** Uncategorized
**Created:** [June 25, 2025, 10:35pm UTC](https://discourse.kitware.com/t/access-to-main-cxx-from-custom-slicer-python-application/1524 "2025-06-25T22:35:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ejm-revvity](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/e/35a633/32.png) [@ejm-revvity](https://discourse.kitware.com/u/ejm-revvity)
#### Post date: [June 25, 2025, 10:35pm UTC](https://discourse.kitware.com/t/access-to-main-cxx-from-custom-slicer-python-application/1524/1 "2025-06-25T22:35:38Z")

</div>

We have a custom Slicer Python application that starts in Main.cxx and utilizes a main window specified in xxxAppMainWindow.cxx (both files originally developed by Julien Finet, Kitware, Inc.) I want to modify/add to this part of the code in order to facilitate license management via a simple modal dialog. I have the following questions:

1. Is there complete access to Qt at this stage of execution i.e. can I create and use something derived from QDialog?
2. What is the scope of this dialog (from 1.) i.e. will I be able to instantiate it and render it from the custom application Python code? If so, how is it exposed and referenced?

---

<div class="post-metadata">

### Author: ![ejm-revvity](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/e/35a633/32.png) [@ejm-revvity](https://discourse.kitware.com/u/ejm-revvity)
#### Post date: [June 26, 2025, 9:26pm UTC](https://discourse.kitware.com/t/access-to-main-cxx-from-custom-slicer-python-application/1524/2 "2025-06-26T21:26:03Z")

</div>

Perhaps I have an answer:

1. Yes - I can create a QDialog derived dialog and display it modally before continuing to start the application.
2. I can reference and display this dialog, if properly exposed, via `slicer.util.mainWindow()`
