Categories
Mastering Development

pyqt5 gui crashes when opening a new window that has a folium map with polyline drawn between two points

import folium from PyQt5 import QtWidgets, QtWebEngineWidgets from PyQt5.QtWidgets import QLabel, QPushButton, QApplication, QMainWindow class Main(): def __init__(self, parent=None): super(Main, self).__init__(parent) self.setFixedSize(1500, 800) self.initWindow() def initWindow(self): buttons = QtWidgets.QWidget() testclick = QPushButton(self.tr(“click me”)) testclick.setFixedSize(100, 30) testclick.clicked.connect(clicked_me()) vertical = QtWidgets.QVBoxLayout(buttons) vertical.addWidget(testclick) self.view = QtWebEngineWidgets.QWebEngineView() self.view.setContentsMargins(50, 50, 50, 50) central_widget = QtWidgets.QWidget() self.setCentralWidget(central_widget) horizontal_view = QtWidgets.QHBoxLayout(central_widget) horizontal_view.addWidget(buttons) […]

Categories
Mastering Development System & Network

I want a functionality to join any two dynamic circles with a line

I want to create a functionality, that help to join any two circles by a means of line. The function should be able two make connection between two circle through a line either by selecting two circles or any other means. Any help would be appreciated… import random from PyQt5 import QtCore from PyQt5.QtCore import […]

Categories
Development

PyQt5 Adding QCompleter to Existing QTextEdit

I am currently creating a SQL Editor and Query Wizard with PyQt5 and am running into an issue when trying to add a QCompleter to all my QPlainTextEdits in the wizard. All the UI is created with Qt Designer and is stored in a QStackedWidget. I have read into Promoting the widget in Designer to […]

Categories
Development

Recovering Latex Compilation Errors

I have a program to write a text and when I click on the ‘compile’ button, it compiles to latex, converts to pdf and displays it on my application. The problem is that when I have a compilation error, the application bugs and that’s it. I’d like to know if it’s possible to recover compilation […]

Categories
Development

How to remove a selected row from pyqt5 QStandarditemmodel in python?

I’ve been working on this code for a few days and am just stuck on how to remove a selected row from the QLineEdit (list1). I understand that by using QStandardModel I can use removeRow() to remove a row at a certain index, but I can’t seem to figure out how to determine the specific […]

Categories
Development

setPixmap causes process finished with exit code 1 [duplicate]

I return an image from function (find_defects). and I see that it is a valid image. I check image before return using cv2.imshow and it is also like i expected. But when i try to show this image on a GUI which i designed using PyQt, i see this error: Process finished with exit code […]

Categories
Development

PyQt5: pop-up progressbar using QThread

How can I implement a progress bar in a pop-up window that monitors the progress of a running function from a so-called Worker class (i.e. time/CPU-consuming task) by means of a QThread? I have checked countless examples and tutorials, but the fact that the progressbar shows up in a pop-up window seems to make everything […]

Categories
Development

Led Blink how to interrupt time.sleep RPI

I designed a form in qtdesigner. It has ‘on’ and ‘off’ buttons. On button should start to blink led and off button should stop it.So, If the time.sleep duration is short there is no problem but when i write 10 seconds for sleep it doesn’t stop instantly when i click on the off button. Program […]

Categories
Development

How do you stop PyQT widgets from staying displayed after reading their state

For some reason the UI widgets for an interface I created with PyQT5 will stay open and on top of any other graphic object on the screen, even from the OS and other applications. I’m assuming this is sort of modal thing but am perplexed, I’ve not seen this happen before. Instead of posting the […]

Categories
Development

Url not defined using Signals and slots PyQt5 in different classes

I am trying to run a Video with its parameter in parallel using Threads so when I click on the SD button its activates TP1 and TP2 buttons, and for each has a different Url. I want to display the video and start the ProgressBar and show the result at the end. from multiprocessing import […]