Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Import the necessary PyQt modules
- from PyQt6 import QtCore, QtGui, QtWidgets
- # Import the QLibrary class
- from PyQt6.QtCore import QLibrary
- # Create a QLibrary instance to load the compiled C++ module
- cppModule = QLibrary("/path/to/compiled/cpp/module")
- # Load the library
- cppModule.load()
- # Use the Qt APIs to access the functionality in the C++ module and
- # create a QDockWidget to contain the C++ module's graphical interface
- dockWidget = QtWidgets.QDockWidget()
- dockWidget.setWidget(cppModule.someQWidget())
- # Add the QDockWidget to your PyQt application's main window
- mainWindow = QtWidgets.QMainWindow()
- mainWindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea, dockWidget)
- # Show the main window
- mainWindow.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement