Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port most code to set up menu items and actions from C++ to Python #442

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

yungyuc
Copy link
Member

@yungyuc yungyuc commented Dec 20, 2024

Except the menu for camera control, which needs code that is only available in C++, port the menu and action setup from C++ to Python.

@yungyuc yungyuc added enhancement New feature or request pilot GUI and visualization labels Dec 20, 2024
@@ -47,43 +47,6 @@ class RAction
QObject * parent = nullptr);
}; /* end class RAction */

class RPythonAction
Copy link
Member Author

Choose a reason for hiding this comment

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

With action setup code ported to Python, this helper class RPythonAction is not longer needed.

QString m_pyFuncName;
}; /* end class RPythonAction */

class RAppAction
Copy link
Member Author

Choose a reason for hiding this comment

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

With action setup code ported to Python, this helper class RAppAction is not longer needed.

@@ -118,92 +118,15 @@ void RManager::setUpMenu()
// "exited with code -1073740791". The reason is not yet clarified.

m_fileMenu = m_mainWindow->menuBar()->addMenu(QString("File"));
{
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove the C++ code setting up menu items.

m_viewMenu = m_mainWindow->menuBar()->addMenu(QString("View"));
{
// Code for controlling camera is not exposed to Python yet
Copy link
Member Author

Choose a reason for hiding this comment

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

Camera control is still in C++. We should expose it to Python later.

void quit() { m_core->quit(); }

public slots:
QMenu * fileMenu() { return m_fileMenu; }
Copy link
Member Author

Choose a reason for hiding this comment

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

Expose menu objects for access from Python.

mw = _vimpl.RManager.instance.mainWindow
mw.clearApplications()
populate_applications()
def populate_menu():
Copy link
Member Author

Choose a reason for hiding this comment

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

Populate the menu in Python.

@yungyuc yungyuc self-assigned this Dec 20, 2024
@yungyuc
Copy link
Member Author

yungyuc commented Dec 20, 2024

Merge for further GUI changes.

@yungyuc yungyuc merged commit d651cd6 into solvcon:master Dec 20, 2024
12 checks passed
@yungyuc yungyuc deleted the feature/menu-in-python branch December 20, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pilot GUI and visualization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant