qgraphicsview

How to draw QtGraphicsView on Top of QVideoWidget with transparency

你离开我真会死。 提交于 2020-06-23 12:43:12
问题 I am trying to overlay some graphics(QtGraphicsView) on top of video player(QVideoWidget). i have already tried setting QtGraphicsView subclass stylesheets to transparent and background brush and none is working. #self.setBackgroundBrush(QtGui.QBrush(QtGui.QColor(30, 30, 30, 3))) #self.setStyleSheet("background-color:rgba(0,0,0,0)") #self.setStyleSheet("background:rgba(0,0,0,0)") self.setStyleSheet("background:transparent") self.setStyleSheet("background-color:transparent") self.setStyleSheet

Qt : problem between View coordinates and View coordinates to add item

眉间皱痕 提交于 2020-06-17 13:29:52
问题 I'm struggling for 2 days with my QGraphicsScene and QGraphicsView. When I click on the top left corner of my view (0,0), the mouse click event get the 0,0 but when I add item to the scene, it gives different coordinates and I can't find why. I think the problem is inside the scene->addItem Here is the code : void GraphBoard::drawState(QPoint cpoint) { qDebug() << "Coordonnées QPoint dans drawState "<< cpoint; qDebug() << "Coordonnées QPoint dans drawState x"<< cpoint.x(); qDebug() <<

Fit QGraphisItem in view

人盡茶涼 提交于 2020-06-09 02:59:09
问题 Is a method to fit any image in view (that I import in QPixmap) and keep aspect ratio>. I try many solution but non of those works. Also I don't not sure what I need to fit? QGraphicsScene in QGraphicsView? Or QPixmap in QGraphicsView? from PyQt5 import QtCore, QtGui, QtWidgets class GraphicsView(QtWidgets.QGraphicsView): def __init__(self, parent=None): super(GraphicsView, self).__init__(parent) scene = QtWidgets.QGraphicsScene() self.setScene(scene) if __name__ == "__main__": import sys app

Fit QGraphisItem in view

别来无恙 提交于 2020-06-09 02:58:54
问题 Is a method to fit any image in view (that I import in QPixmap) and keep aspect ratio>. I try many solution but non of those works. Also I don't not sure what I need to fit? QGraphicsScene in QGraphicsView? Or QPixmap in QGraphicsView? from PyQt5 import QtCore, QtGui, QtWidgets class GraphicsView(QtWidgets.QGraphicsView): def __init__(self, parent=None): super(GraphicsView, self).__init__(parent) scene = QtWidgets.QGraphicsScene() self.setScene(scene) if __name__ == "__main__": import sys app

Fit QGraphisItem in view

我们两清 提交于 2020-06-09 02:56:11
问题 Is a method to fit any image in view (that I import in QPixmap) and keep aspect ratio>. I try many solution but non of those works. Also I don't not sure what I need to fit? QGraphicsScene in QGraphicsView? Or QPixmap in QGraphicsView? from PyQt5 import QtCore, QtGui, QtWidgets class GraphicsView(QtWidgets.QGraphicsView): def __init__(self, parent=None): super(GraphicsView, self).__init__(parent) scene = QtWidgets.QGraphicsScene() self.setScene(scene) if __name__ == "__main__": import sys app

How to make a QGraphicsView background blinking in R - G - B every second

馋奶兔 提交于 2020-05-17 07:08:20
问题 As the title says I am trying to have my QGraphicsView blinking 1 second in red, 1 second in green and 1 second in blue and after that the loop start over again. After doing a lot of research in the past couple of days I didn't have a lot of luck as the main problem is that I am not sure I need to subclass QGraphicsView to obtain the effect I am looking for. I came across some references that I inserted below saying that for this type of problems QPropertyAnimation seems to be the right

Join QGraphicsItem and QPainter in same GraphicsScene

可紊 提交于 2020-05-17 06:14:28
问题 I am currently building an interactive canvas using PyQt5 and Graphicscene, so far modifying the codes found on those posts: PySide Node Graph connect items How to draw a line from mouse to a point in PyQt5? I have made two separates examples of what I would like , but so far I have not been able to merge the two into a single code. The first code I inserts a node and corresponding edge in the position clicked on the screen. Begins and ends with a double click of the left button of the mouse.

How to change QGraphicsView background color based on specific QString content inside a QListView

淺唱寂寞╮ 提交于 2020-05-17 06:11:08
问题 In order to shrink the problem I made a small verifiable example of a small gui. If you would like to take a glance at the code you can see it here. I have a specific string on a QLineEdit , this string is passed to a QListView via QPushButton as shown below. Those strings are choices of a QComboBox and they are very specific: 1) "[ INFO] Minimum Distance: 5", 2) "[ INFO] Minimum Distance: 10" and 3) "[ INFO] Minimum Distance: 15" The problem: How can I detect the specific QString content

Render QGraphicsView into video file frame time problem

我怕爱的太早我们不能终老 提交于 2020-04-30 09:16:26
问题 I'm developing a 2D/3D animation desginer program which user can design animated items on a graphic scene, after designing user needs to be able to convert the animation into a specific video file, for rendering I just run a QTimer with Qt::PreciseTimer key (when animation is playing on the QGraphicsView) and set its interval to 33ms to get 30 shots per second and in its timeout signal I just use GraphicsView->render to get an image of what is displaying on the scene then save it to the file,