pyqt5

how to use QGraphicsView::RubberBandDrag?

戏子无情 提交于 2020-12-23 11:53:28
问题 Can somebody please provide an explanation, or better yet a short example, of how to use the RubberBandDrag enum value in QGraphicsView ? PyQt5 would be great, but I can translate from the C++ version if that is preferred for whomever can provide a helpful exmaple. NoDrag and ScrollHandDrag are relatively easy to understand ( NoDrag makes the mouse a pointer and you can capture clicks at certain locations, ScrollHandDrag makes the mouse a hand and you can implement click and drag to scroll

how to use QGraphicsView::RubberBandDrag?

徘徊边缘 提交于 2020-12-23 11:52:34
问题 Can somebody please provide an explanation, or better yet a short example, of how to use the RubberBandDrag enum value in QGraphicsView ? PyQt5 would be great, but I can translate from the C++ version if that is preferred for whomever can provide a helpful exmaple. NoDrag and ScrollHandDrag are relatively easy to understand ( NoDrag makes the mouse a pointer and you can capture clicks at certain locations, ScrollHandDrag makes the mouse a hand and you can implement click and drag to scroll

setPixmap crashing when trying to show image in label

一笑奈何 提交于 2020-12-21 04:05:26
问题 I have created a minimal example with pyqt designer, that changes the text of a label when a button is pressed and is supposed to present a screenshot in the window, via the label. Unfortunately, the example just crashes when it tries to show the screenshot in the label. from PIL.ImageQt import ImageQt from PyQt5 import QtCore, QtGui, QtWidgets from pyscreenshot import grab class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("Form") Form.resize(503, 382) self.pushButton =

setPixmap crashing when trying to show image in label

廉价感情. 提交于 2020-12-21 04:03:06
问题 I have created a minimal example with pyqt designer, that changes the text of a label when a button is pressed and is supposed to present a screenshot in the window, via the label. Unfortunately, the example just crashes when it tries to show the screenshot in the label. from PIL.ImageQt import ImageQt from PyQt5 import QtCore, QtGui, QtWidgets from pyscreenshot import grab class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("Form") Form.resize(503, 382) self.pushButton =

setPixmap crashing when trying to show image in label

霸气de小男生 提交于 2020-12-21 04:03:01
问题 I have created a minimal example with pyqt designer, that changes the text of a label when a button is pressed and is supposed to present a screenshot in the window, via the label. Unfortunately, the example just crashes when it tries to show the screenshot in the label. from PIL.ImageQt import ImageQt from PyQt5 import QtCore, QtGui, QtWidgets from pyscreenshot import grab class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("Form") Form.resize(503, 382) self.pushButton =

How to get a child thread to close when main GUI window is closed in pyqt5 / python 3?

你。 提交于 2020-12-15 07:20:10
问题 I am writing a GUI using pyqt5 (Python 3.6). I am trying to run another thread in parallel of the main GUI. I would like this child thread to terminate when I close the main application. In this example, the child thread is a simple counter. When I close the main GUI, the counter still keeps going. How can I get the thread to end when the GUI window is closed? In the real case I may have a thread that is running operations that takes a few minutes to execute. I am reluctant to use a flag

Qmessagebox background and text color

不羁的心 提交于 2020-12-15 05:53:06
问题 I have message response as you see on the above. I've managed to colour background to black: msg.setStyleSheet("background-color: rgb(0, 0, 0);") I've tried with same way for the text but it looks like this: msg.setStyleSheet("text-color: rgb(255, 255, 255);") My only purpose is texts are white and background is black... Here is my part of code: msg = QMessageBox() msg.setText("Message has been sended") msg.setWindowTitle("SENT") msg.setWindowIcon(QtGui.QIcon("black tic.png")) msg.setIcon

Peer to peer client with peerjs and python user

老子叫甜甜 提交于 2020-12-15 05:44:14
问题 Download and unrar this file in htdocs folder (for example C:/xampp/htdocs/telephone_calls) Run this ngrok command: ngrok http 192.168.1.24:80 (replace 192.168.1.24 with your lan ip address) Replace lines 118 and 119 of file manage_calls.py with your own. cd to telephone_calls directory and run python manage_calls.py With another device open a browser and go to https://25f4a7e689ce.ngrok.io/telephone_calls/client.html (replace 25f4a7e689ce with your own) Press the blue button "Τηλεφωνική

How to display a cv2 video inside a python GUI? [duplicate]

情到浓时终转凉″ 提交于 2020-12-15 05:31:45
问题 This question already has answers here : PyQt showing video stream from opencv (3 answers) Closed last year . I'm creating a GUI using Python/PyQt5 which should display a video along with other widgets in the same window. I've tried different approaches to this problem but stil can't seem to get it to work. Approach 1: Adding the video in a pixmap using OpenCV/cv2 only shows the first frame of the video. Approach 2: I have managed to get the video to play using cv2 however, it opens up in a

msgbox error while threading , GUI blocks [closed]

北城余情 提交于 2020-12-15 03:39:58
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last month . Improve this question I have a problem while executing the following gui. it works normally if there's no msgbox, but when there is a mesbox it blocks. any idea why the gui blocks when there is message. thank you from PyQt5 import QtCore, QtGui, QtWidgets import threading import time class Ui