Reputation: 1
PyQt5 is showing installed properly in Windows Command Prompt, but in scribus it says No module found.
Someone who has experience using PyQt5 in scribus please help
import scribus import sys from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QMessageBox from PyQt5.QtGui import QIcon from PyQt5.QtCore import QSize def create_button_with_icon():
app = QApplication(sys.argv)
# Create a QWidget window
window = QWidget()
window.setWindowTitle("Scribus Extension")
# Load your icon (adjust the path to your icon file)
icon_path = "C:/Users/pc point/Downloads/save_file.png"
button = QPushButton()
button.setIcon(QIcon(icon_path))
button.setIconSize(QSize(64, 64)) # Adjust the size of the icon as needed
# Connect the button click event to a function
button.clicked.connect(your_button_function)
# Set up the layout
layout = QVBoxLayout()
layout.addWidget(button)
window.setLayout(layout)
# Show the window
window.show()
# Start the PyQt5 event loop
sys.exit(app.exec_())
Upvotes: 0
Views: 53
Reputation: 868
You have to issues here: How to use a specific binary of Python with Scribus and how to add items to the menu.
Probably following the hints you got above, you asked the part about using a custom Python also in the Scribus forums and I answered it there (the issue being that Scribus uses its own libpython on Windows: https://wiki.scribus.net/canvas/Windows_Full_Python_Integration)
The part where you want to add items to the navigation is a different concern.
I'm pretty sure that I gave it a try a few years ago and I had to give up.
If I recall correctly, the main issue were:
What I did a bit more lately: add a menu entry for the user's own scripts:
https://bugs.scribus.net/view.php?id=15579
It's a first version that simply adds all scripts from a given set of paths to the Scripter menu. I plan to improve it to allow sub menus after (if ever) the patch gets accepted.
It's not the same as you plan to do, but, combined with the "action search", it can offer you a good enough result.
Upvotes: 0